Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f8a88d3
feat(spec): offer the hook texts row in the Studio hook form
claude Nov 19, 2026
0cfc18e
feat(spec): HookContext declares ctx.text
claude Nov 19, 2026
0d0744c
feat(platform-objects): the hook texts row in the eleven metadata-for…
claude Nov 19, 2026
5fb2206
test(spec): a parsed hook context needs its engine reference
claude Nov 19, 2026
13feefb
test(spec): the typed hook context literal carries its engine reference
claude Nov 19, 2026
772b1c3
chore(spec): regenerate the artifacts HookContext.text moves, add the…
claude Nov 19, 2026
3d0f92b
test(platform-objects): the hook form's texts record joins the enumer…
claude Nov 19, 2026
b702af9
chore(changeset): HookContext.text is an added protocol member, spec …
claude Nov 19, 2026
88900c1
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 19, 2026
a1fd42b
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 19, 2026
ab850bf
feat(spec): the Studio action form offers the action's declared texts
claude Nov 19, 2026
e2f6d2f
feat(platform-objects): the action texts row's label and help text in…
claude Nov 19, 2026
26fbd42
feat(spec): the Studio action form offers the action's refusal catalogue
claude Nov 19, 2026
52a32ad
feat(platform-objects): the action refusals row's label and help text…
claude Nov 19, 2026
6547df4
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 19, 2026
ef816f8
test(lint): the shipped-forms predicate census counts the action text…
claude Nov 19, 2026
5cddfca
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/35096-action-form-texts-refusals-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@objectstack/spec': patch
'@objectstack/platform-objects': patch
---

feat(spec): the Studio action form offers an action's declared `refusals` and `texts`

Clause-②: no
Metadata-protocol: none

- **Studio action form.** `actionForm` gains two rows in the Behavior section, right after the script `body`, each shown only on a `type: 'script'` action as the body is: `refusals`, a key-only record keyed by the SCREAMING_SNAKE code the body throws, each entry editing its `message`, `status`, `reasons` (a key-only record of `{ message }`) and `params`; and `texts`, a key-only record keyed by the snake_case key the body asks for with `ctx.text`, each entry editing its `message` and `params`. They are the hook form's two rows, because the action entries are the hook entries. An author editing an action in the Studio can now write the `refusals` and `texts` the schema already accepts, instead of going through the metadata API or the package source. Nothing about what an action may declare changes.
- **Locale packs.** The rows' labels and help text ship in all eleven metadata-forms locale packs of `@objectstack/platform-objects`.
10 changes: 8 additions & 2 deletions packages/lint/src/validate-predicate-path-refs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,10 @@ describe('#7010 corpus — shipped METADATA_FORM_REGISTRY', () => {
// It is 91 today, an ADDITION of ONE: #29462 offered the field form's
// `referenceNameVisible` row, gated on `data.type in ['lookup','user']`. It
// is an in-list, so it does not reach the literal-comparison census below.
expect(predicates, 'the shipped metadata forms carry no predicates at all').toBe(91);
// It is 93 today, an ADDITION of TWO: #35096 and #34823 offered the action
// form's `texts` and `refusals` rows, each gated like `body` on
// `data.type == 'script'`. They reach the literal-comparison census below.
expect(predicates, 'the shipped metadata forms carry no predicates at all').toBe(93);

const findings = validatePredicatePathRefs(corrupted);
expect(findings).toHaveLength(predicates);
Expand Down Expand Up @@ -827,7 +830,10 @@ describe('#7010 corpus — shipped METADATA_FORM_REGISTRY', () => {
// It is 65 today: #35047's `field :: percentDisplay` gate also opens for a
// percent formula, `data.type == 'formula' && data.returnType == 'percent'`,
// two more single-quoted literal comparisons.
expect(comparisons, 'no shipped predicate carries an `==`/`!=` literal comparison').toBe(65);
// It is 67 today: #35096's `action :: texts` and #34823's
// `action :: refusals` rows are each gated on `data.type == 'script'`, two
// single-quoted literal comparisons.
expect(comparisons, 'no shipped predicate carries an `==`/`!=` literal comparison').toBe(67);

const rhsFindings = validatePredicatePathRefs(corrupted)
.filter((f) => f.rule === PREDICATE_RHS_PATH_SHAPED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,16 @@ describe('#19403 round 5 — the blind spot, FIFTH shape: one schema, two forms,
// `type === 'repeater'`, and `body` is a `composite`. All five echoed in
// all three locales, and they are five of the six keys this round decides.
// 7 since the action form offers the `onSuccess` composite — its two
// children, `navigate` and `openIn`, authored in all three locales.
expect(ACTION_ENUMERATED.skipped.length).toBe(7);
// children, `navigate` and `openIn`, authored in all three locales. 9
// since #35096: the form offers the `texts` record, whose entry fields
// (`message`, `params`) are enumerated the same way. 14 since #34823: the
// form offers the `refusals` record, the hook row's five entry fields.
expect(ACTION_ENUMERATED.skipped.length).toBe(14);
expect(ACTION_ENUMERATED.skipped).toContain('texts.message');
expect(ACTION_ENUMERATED.skipped).toContain('texts.params');
for (const child of ['message', 'status', 'reasons', 'reasons.message', 'params']) {
expect(ACTION_ENUMERATED.skipped).toContain(`refusals.${child}`);
}
for (const child of SHARED_BODY_CHILDREN) {
expect(ACTION_ENUMERATED.skipped).toContain(`body.${child}`);
expect(
Expand Down Expand Up @@ -728,8 +736,10 @@ describe('#19403 round 5 — the blind spot, FIFTH shape: one schema, two forms,
const coveredParents = new Set(ACTION_ENUMERATED.covered.map((k) => k.replace(/\.[^.]+$/, '')));
const skippedParents = new Set(ACTION_ENUMERATED.skipped.map((k) => k.replace(/\.[^.]+$/, '')));
expect([...coveredParents]).toEqual(['params']);
// `onSuccess` since the action form offers it as a composite beside `body`.
expect([...skippedParents]).toEqual(['body', 'onSuccess']);
// `onSuccess` since the action form offers it as a composite beside `body`,
// `texts` since #35096 and `refusals` (with its nested `reasons`) since
// #34823, the two record rows after `body`.
expect([...skippedParents]).toEqual(['body', 'refusals', 'refusals.reasons', 'texts', 'onSuccess']);
for (const parent of ['params', 'body']) {
expect(ACTION_ENUMERATED.covered.includes(parent), `${parent} is not itself a row property`).toBe(false);
expect(ACTION_ENUMERATED.skipped.includes(parent), `${parent} is not itself an unwalked child`).toBe(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,42 @@ export const arMetadataForms: NonNullable<TranslationData['metadataForms']> = {
label: "الذاكرة (ميغابايت)",
helpText: "حد الذاكرة لكل استدعاء (ميغابايت، بحد أقصى 256)"
},
refusals: {
label: "حالات الرفض",
helpText: "فهرس حالات الرفض، مفهرس برمز SCREAMING_SNAKE الذي يرميه متن الإجراء (مثل SIGN_IN_REQUIRED). يقرأ المستدعي الرسالة المُعلنة، مترجمة إلى لغته، مع الحالة المُعلنة. لمتن JavaScript ‏(L2) في إجراء script؛ ويُرفض في متن التعبير"
},
"refusals.message": {
label: "الرسالة",
helpText: "الجملة التي يقرؤها المستخدم عندما يرمي المتن هذا الرمز. نص عادي، ما لم يُعلن الإدخال params: عندها يملأ العنصر النائب {{ name }} معاملًا مُعلنًا"
},
"refusals.status": {
label: "الحالة",
helpText: "حالة HTTP للرفض (400–499). عند الغياب: 400"
},
"refusals.reasons": {
label: "الأسباب",
helpText: "جمل إضافية تحت الرمز نفسه، مفهرسة بالسبب بصيغة snake_case الذي يرميه المتن بجانب الرمز ({ code, reason }). يبقى الرمز والحالة المُرسَلان لهذا الإدخال؛ ويُرفض سبب غير مُعلن هنا. عند الغياب: لا يُقرأ السبب المرمي"
},
"refusals.reasons.message": {
label: "الرسالة",
helpText: "الجملة التي يقرؤها المستخدم عندما يرمي المتن هذا السبب تحت الرمز. تتبع عناصرها النائبة {{ }} معاملات params للإدخال"
},
"refusals.params": {
label: "المعاملات",
helpText: "الأسماء التي يمكن للجمل ملؤها (مثل state): يرمي المتن { code, params: { state } } ويعرض العنصر النائب {{ state }} قيمتها. عند الغياب: الجمل نص عادي"
},
texts: {
label: "النصوص",
helpText: "الجمل التي يكتبها الإجراء في السجلات، مفهرسة بالمفتاح بصيغة snake_case الذي يطلبه متنه عبر ctx.text (مثل email_subject). يتلقى المتن الرسالة المُعلنة بلغة المؤسسة، مترجمة، مع الرسالة المُعلنة بديلًا عند غياب الترجمة. لمتن JavaScript ‏(L2) في إجراء script؛ ويُرفض في متن التعبير"
},
"texts.message": {
label: "الرسالة",
helpText: "الجملة التي يكتبها الإجراء عندما يطلب متنه هذا المفتاح. نص عادي، ما لم يُعلن الإدخال params: عندها يملأ العنصر النائب {{ name }} معاملًا مُعلنًا"
},
"texts.params": {
label: "المعاملات",
helpText: "الأسماء التي يمكن للجملة ملؤها (مثل subject): يطلب المتن ctx.text(key, { subject }) ويعرض العنصر النائب {{ subject }} قيمتها. عند الغياب: الجملة نص عادي"
},
params: {
label: "المعلمات",
helpText: "معلمات إدخال المستخدم (إظهار نموذج قبل التنفيذ)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,42 @@ export const deMetadataForms: NonNullable<TranslationData['metadataForms']> = {
label: "Speicher (MB)",
helpText: "Speicherobergrenze pro Aufruf (MB, max. 256)"
},
refusals: {
label: "Ablehnungen",
helpText: "Katalog der Ablehnungen, nach dem SCREAMING_SNAKE-Code, den der Rumpf der Aktion wirft (z. B. SIGN_IN_REQUIRED). Der Aufrufer liest die deklarierte Meldung, übersetzt in seine Sprache, mit dem deklarierten Status. Für den JavaScript-Rumpf (L2) einer script-Aktion; bei einem Ausdrucksrumpf abgelehnt"
},
"refusals.message": {
label: "Meldung",
helpText: "Der Satz, den der Benutzer liest, wenn der Rumpf diesen Code wirft. Einfacher Text, außer der Eintrag deklariert params: dann füllt ein Platzhalter {{ name }} einen deklarierten Parameter"
},
"refusals.status": {
label: "Status",
helpText: "HTTP-Status der Ablehnung (400–499). Fehlt er: 400"
},
"refusals.reasons": {
label: "Gründe",
helpText: "Weitere Sätze unter demselben Code, nach dem snake_case-Grund, den der Rumpf neben dem Code wirft ({ code, reason }). Gesendeter Code und Status bleiben die dieses Eintrags; ein hier nicht deklarierter Grund wird abgelehnt. Fehlt er: Ein geworfener Grund wird nicht gelesen"
},
"refusals.reasons.message": {
label: "Meldung",
helpText: "Der Satz, den der Benutzer liest, wenn der Rumpf diesen Grund unter dem Code wirft. Seine {{ }}-Platzhalter folgen den params des Eintrags"
},
"refusals.params": {
label: "Parameter",
helpText: "Namen, die die Sätze füllen dürfen (z. B. state): Der Rumpf wirft { code, params: { state } }, und ein Platzhalter {{ state }} zeigt den Wert. Fehlt er: Die Sätze sind einfacher Text"
},
texts: {
label: "Texte",
helpText: "Sätze, die die Aktion in Datensätze schreibt, nach dem snake_case-Schlüssel, den ihr Rumpf mit ctx.text anfragt (z. B. email_subject). Der Rumpf erhält die deklarierte Meldung in der Sprache der Organisation, übersetzt, mit der deklarierten Meldung als Rückfall. Für den JavaScript-Rumpf (L2) einer script-Aktion; bei einem Ausdrucksrumpf abgelehnt"
},
"texts.message": {
label: "Meldung",
helpText: "Der Satz, den die Aktion schreibt, wenn ihr Rumpf diesen Schlüssel anfragt. Einfacher Text, außer der Eintrag deklariert params: dann füllt ein Platzhalter {{ name }} einen deklarierten Parameter"
},
"texts.params": {
label: "Parameter",
helpText: "Namen, die der Satz füllen darf (z. B. subject): Der Rumpf fragt ctx.text(key, { subject }) an, und ein Platzhalter {{ subject }} zeigt den Wert. Fehlt er: Der Satz ist einfacher Text"
},
params: {
label: "Parameter",
helpText: "Benutzereingabeparameter (Formular vor der Ausführung anzeigen)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
export const deGeneratedSourceHashes: Readonly<Record<string, string>> = {
"metadataForms.action.fields.name.label": "5274417ff1ccaf01",
"metadataForms.action.fields.patch.label": "815f68570a78eba1",
"metadataForms.action.fields.refusals.status.label": "64a420165247654b",
"metadataForms.agent.fields.avatar.label": "0f06369995b69b8b",
"metadataForms.agent.fields.name.label": "5274417ff1ccaf01",
"metadataForms.app.fields.branding.label": "ec6e391065514b64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,42 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
label: "Memory Mb",
helpText: "Per-invocation memory cap (MB, max 256)"
},
refusals: {
label: "Refusals",
helpText: "Refusal catalogue, keyed by the SCREAMING_SNAKE code the action's body throws (e.g. SIGN_IN_REQUIRED). The caller reads the declared message, translated into their language, with the declared status. For a script action's JavaScript (L2) body; refused on an expression body"
},
"refusals.message": {
label: "Message",
helpText: "The sentence the user reads when the body throws this code. Plain text, unless the entry declares params: then a {{ name }} hole fills a declared param"
},
"refusals.status": {
label: "Status",
helpText: "HTTP status of the refusal (400–499). Absent: 400"
},
"refusals.reasons": {
label: "Reasons",
helpText: "Further sentences under this same code, keyed by the snake_case reason the body throws beside the code ({ code, reason }). The wire code and status stay this entry's; a reason not declared here is refused. Absent: a thrown reason is not read"
},
"refusals.reasons.message": {
label: "Message",
helpText: "The sentence the user reads when the body throws this reason under the code. Its {{ }} holes follow the entry's params"
},
"refusals.params": {
label: "Params",
helpText: "Names the sentences may fill (e.g. state): the body throws { code, params: { state } }, and a {{ state }} hole renders it. Absent: the sentences are plain text"
},
texts: {
label: "Texts",
helpText: "Sentences the action writes into records, keyed by the snake_case key its body asks for with ctx.text (e.g. email_subject). The body gets the declared message in the organization's language, translated, with the declared message as the fallback. For a script action's JavaScript (L2) body; refused on an expression body"
},
"texts.message": {
label: "Message",
helpText: "The sentence the action writes when its body asks for this key. Plain text, unless the entry declares params: then a {{ name }} hole fills a declared param"
},
"texts.params": {
label: "Params",
helpText: "Names the sentence may fill (e.g. subject): the body asks for ctx.text(key, { subject }), and a {{ subject }} hole renders it. Absent: the sentence is plain text"
},
params: {
label: "Params",
helpText: "User input parameters (show form before executing)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,42 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
label: "Memoria (MB)",
helpText: "Límite de memoria por invocación (MB, máx. 256)"
},
refusals: {
label: "Rechazos",
helpText: "Catálogo de rechazos, indexado por el código SCREAMING_SNAKE que lanza el cuerpo de la acción (p. ej. SIGN_IN_REQUIRED). Quien llama recibe el mensaje declarado, traducido a su idioma, con el estado declarado. Para el cuerpo JavaScript (L2) de una acción script; se rechaza en un cuerpo de expresión"
},
"refusals.message": {
label: "Mensaje",
helpText: "La frase que lee el usuario cuando el cuerpo lanza este código. Texto plano, salvo que la entrada declare params: entonces un marcador {{ name }} se rellena con un parámetro declarado"
},
"refusals.status": {
label: "Estado",
helpText: "Estado HTTP del rechazo (400–499). Si se omite: 400"
},
"refusals.reasons": {
label: "Motivos",
helpText: "Más frases bajo este mismo código, indexadas por el motivo snake_case que el cuerpo lanza junto al código ({ code, reason }). El código y el estado que se envían siguen siendo los de esta entrada; se rechaza un motivo no declarado aquí. Si se omite: no se lee un motivo lanzado"
},
"refusals.reasons.message": {
label: "Mensaje",
helpText: "La frase que lee el usuario cuando el cuerpo lanza este motivo bajo el código. Sus marcadores {{ }} siguen los params de la entrada"
},
"refusals.params": {
label: "Parámetros",
helpText: "Nombres que las frases pueden rellenar (p. ej. state): el cuerpo lanza { code, params: { state } } y un marcador {{ state }} muestra su valor. Si se omite: las frases son texto plano"
},
texts: {
label: "Textos",
helpText: "Frases que la acción escribe en los registros, indexadas por la clave snake_case que su cuerpo pide con ctx.text (p. ej. email_subject). El cuerpo recibe el mensaje declarado en el idioma de la organización, traducido, con el mensaje declarado como respaldo. Para el cuerpo JavaScript (L2) de una acción script; se rechaza en un cuerpo de expresión"
},
"texts.message": {
label: "Mensaje",
helpText: "La frase que escribe la acción cuando su cuerpo pide esta clave. Texto plano, salvo que la entrada declare params: entonces un marcador {{ name }} se rellena con un parámetro declarado"
},
"texts.params": {
label: "Parámetros",
helpText: "Nombres que la frase puede rellenar (p. ej. subject): el cuerpo pide ctx.text(key, { subject }) y un marcador {{ subject }} muestra su valor. Si se omite: la frase es texto plano"
},
params: {
label: "Parámetros",
helpText: "Parámetros de entrada de usuario (muestra el formulario antes de ejecutar)"
Expand Down
Loading
Loading