Skip to content

Commit 9609c13

Browse files
feat(spec)!: retire the ask_ai action type (ADR-0160 D7) (#37924)
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3kn7MME6XXkhPoFyJyisdQ)_ Fixes #37856 Fixes #37827 Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: follow-up #37857 ## 维护者速读 - 作者和终端用户:记录页、列表行、仪表盘上不再有「问 AI」动作按钮,进入助手只走页头的「问 AI」入口,它自动带上当前记录。 - 属于「问 AI」入口专题:按维护者裁定,在 19.0.0 正式版之前撤掉只在预发布版出现过的这个动作类型。 - 已写了这种动作的作者会在校验时看到一句处方;升级命令能删的自动删,被引用的留给作者手删;库里已存的这种动作直接不显示,可按名删除。正式版前撤回本 PR 即可恢复。 - 要你做什么:批准合入;请在下一个预发布版之前合入(技能文档那张卡 #37937 已先合,技能示例检查已绿;next.1 已经带上了技能的改动,本 PR 合入后两边才一致)。 ## What changes ADR-0160 D7, seventh amendment: `ask_ai` leaves `ActionType` before 19.0.0 with no compatibility shim. It was published only on `19.0.0-next.0`. - **Refusal with one prescription** (`packages/spec/src/ui/action-ask-ai-retired.ts`, not barrel-exported) in every slot that takes an action type: `ActionType` (now `enumWithRetiredValues`, so the dashboard header's derived `actionType` refuses it too), a declared or inline action's `type`, `actionType` on `action:button` / `action:icon` rows, and `type` on `action:group` / `action:menu` members. - **ADR-0087 kit**: D2 conversion `action-type-ask-ai-removed` (retired from the load path, `retiredAfter: '18.6.0'`) and D3 entry `ui-action-type-ask-ai-retired`. `ConversionContext.atRest` tells the two doors apart: - over sources (`os migrate meta --from 18`) a declared `ask_ai` action is deleted only when no string anywhere else in the stack names it; a named one stays as written with every reference, and is listed by the D3 entry. (The conversion's `reportTodo` call is not reached in production: `os migrate meta` passes no context, and at rest `keep` is always false. L2 N1, 7218663105.) The conversion never deletes a reference. - at rest (stored rows, built artifacts) every `ask_ai` action, row and member is deleted. - **Stored seam answers "no item"**: `applyConversionsToStoredItem` returns `undefined` when the chain leaves nothing of a row. Its callers in `metadata-protocol` (overlay reads, list drafts, registry hydration, diff load, package duplicate/import), `metadata` (`DatabaseLoader`), `core` (authored translation sync) and `service-datasource` serve and register nothing for such a row. `DatabaseLoader` still reads a row's identity (name, object binding) from the stored body, so the delete door reaches it. `migrateStoredMetadata` lists it `skipped` with `DELETE /api/v1/meta/action/<name>` instead of re-saving it. - **Removed with the type** (revert of b7dee0e, adapted): ActionRunner's ask_ai executor and `setAssistantFocusHandler` / `drawsAction` / `isAskAiAction`; `<ActionProvider onAskAi>` and `useDrawsAction()`; the renderers' drawn-action gates; `useAskAiHandler`; `setChatFocus` and its hosts. The conversation pin from #36999 stays, set from the composer chip only. #37827 (the record page dropping the handler) closes because the handler is gone. - `ActionType`'s live members are now the non-exported `ACTION_TYPE_VALUES` array it wraps. `scripts/check-skill-identifier-liveness.mjs` binds the `### Action Types` table to it (the `SeedMode` precedent). This one gate file is outside the claim's file surface; it is the only way that gate can read the enum now. ## Tests - `packages/spec/src/ui/action-ask-ai-retired.test.ts`: the refusal and its path in each slot, with live-type controls. - `packages/spec/src/conversions/action-type-ask-ai-removed.test.ts`: source keeps the named action and deletes the unnamed one, lists the D3 entry, and reports the todo when a context is passed (a test-only path; see above); at rest deletes both; idempotent; stored seam answers `undefined` for an ask_ai `action` row and strips only the action from an object row. - `packages/spec/src/shared/retired-key-removal-version.pin.test.ts`: the conversion joined to its prescriptions (names 19.0.0 and `--from 18`). - `packages/metadata/src/loaders/database-loader-ask-ai-retired-row.test.ts` (real SQLite): load serves nothing, `exists` and `delete` reach the row, and a same-name write keeps the two object bindings apart. Ablation: reading identity through the converted body turns the last case red. - `packages/metadata-protocol/src/protocol.stored-ask-ai-retired-row.test.ts`: the stored pass lists the row `skipped` with the delete door, an apply run writes nothing, the list read serves only the live row. Ablation: removing the skip branch turns two cases red. ## Acceptance notes - **Landing order**: C1s #37857 (PR #37937) merged first as `4de4e3e9`, and this branch merged it (`24857955`, head `ffd87c6a`). `check:skill-examples` is green on the merged tree (351 examples). The release PR #37661 (`30a8047b`, `19.0.0-next.1`) merged between the two, so a next.1 published from that tree has the skills without the `ask_ai` teaching while the spec still parses it. This PR closes that window and should land before the next prerelease. The record is on #37937. - **Baselines**: `check:api-surface`, `check:authorable-surface` and `check:generated` are green with no baseline file changed. The reference pages under `content/docs/references/` are regenerated (the enum lists lose `ask_ai`). - `git grep -n ask_ai` outside `skills/**`, `docs/adr/**`, `.changeset/pre/` and the CHANGELOGs leaves only the prescription and its two schema call sites, the conversion and its semantic entry, and their tests. The Studio canvas strings (`designer.canvas.askAi*`) are untouched. - `.changeset/pre/37142-ask-ai-action-type.md` and the `setChatFocus` line of `.changeset/pre/36999-conversation-focus.md` are left as written. This PR's changeset carries the correction. Whether the prerelease texts themselves change is for the release owner. - **brightrule**: it declares `brightrule_policy_ask` (`type: 'ask_ai'`) and has to drop it before it moves to a build with this change. It was not booted here, and this repo cannot read its source. The card's acceptance line "brightrule boots on the new version" is a release gate, not a merge gate. It is carried by brightrule's owner, epic:#5027#1, who gets a Notify with the merge sha on #37634. ## Verification <details><summary>Readings</summary> - spec: `vitest run` full package 976 files / 29,727 tests, 1 red before the pin join (fixed, 68/68 after); `src/ui src/conversions src/migrations` 224 files / 7,701 tests green. - typecheck green: spec (`tsc` + `check:test-typecheck`), metadata, metadata-protocol, core (+ test typecheck), runtime (+ test typecheck), service-datasource, `@object-ui/core`, `react`, `components`, `plugin-grid`, `plugin-detail`, `app-shell`. - metadata `database-loader.test.ts` + new file: 502 green. metadata-protocol new file: 3 green. - `dispatch-gates.mjs --commands`: 128 commands run. Red found and fixed: `check:generated` / `check:test-typecheck` (stored seam's `undefined` in 4 existing tests), `check:skill-identifier-liveness`, `check:engine-double-contract` (ledger `--write`), `check:objectql-double-limit`, `check:test-source-alias`. Prerequisites cleared: `check:published-readme-exports`, `check-plugin-teardown-shape --self-test`. Still red: `check:skill-examples` (order above). - dogfood battery on the final head `ffd87c6a`: passed under the verify lock (VERDICT command-exit 0), 490 test files passed and 3 skipped, 4144 tests passed and 68 skipped, 0 failed. This is the CI command with no shard. The os-dev-report for this head is 7222528251. </details> Two-minute check: `pnpm --filter @objectstack/spec exec vitest run src/ui/action-ask-ai-retired.test.ts src/conversions/action-type-ask-ai-removed.test.ts`. Expect 2 files green. --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a9901ed commit 9609c13

95 files changed

Lines changed: 1456 additions & 1888 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/metadata-protocol': patch
4+
'@objectstack/metadata': patch
5+
'@objectstack/core': patch
6+
'@objectstack/runtime': patch
7+
'@objectstack/service-datasource': patch
8+
'@object-ui/core': minor
9+
'@object-ui/react': minor
10+
'@object-ui/components': patch
11+
'@object-ui/plugin-grid': patch
12+
'@object-ui/plugin-detail': patch
13+
'@object-ui/app-shell': minor
14+
---
15+
16+
feat(spec)!: retire the `ask_ai` action type — the shell's 「问 AI」 entry is the one way into the assistant
17+
18+
Clause-②: no (narrowing)
19+
Metadata-protocol: narrowed
20+
Skills-docs: follow-up #37857
21+
22+
<!-- adr-0087: registered action-type-ask-ai-removed, ui-action-type-ask-ai-retired -->
23+
24+
**BREAKING** enum value removal on `ActionType` (`@objectstack/spec/ui`), ADR-0160 D7 as its seventh amendment rules. `ask_ai` was published only on the 19 prerelease line (`19.0.0-next.0`) and in no stable release; it leaves before 19.0.0 with no compatibility shim. A button per page is a second entry to the assistant, and the shell's 「问 AI」 entry in the page header already opens on the record in view. The accepted cost: a list row has no ask-AI action of its own.
25+
26+
| FROM | TO |
27+
|:--|:--|
28+
| `{ name: 'ask_about_case', type: 'ask_ai', locations: ['record_page'] }` | nothing: delete the action and every reference to it; the shell's 「问 AI」 entry opens on the record |
29+
| `{ type: 'action:button', properties: { actionType: 'ask_ai' } }` | nothing: delete the row |
30+
31+
The one-line fix: delete each `ask_ai` action and every name that points at it (a page header's `actions`, a list view's `rowActions` / `bulkActions`, a related list's `actions`, a quick-actions list, a record alert's `actionName`, an app navigation entry). `os migrate meta --from 18` lists the edits; `--write` deletes an `ask_ai` action that nothing in the stack names and every inline row and container member that spells it, and leaves a named one, with its references, for you to delete by hand.
32+
33+
- **`@objectstack/spec`**: every slot that takes an action type refuses `ask_ai` with one prescription: a declared or inline action's `type`, an `action:button` / `action:icon` row's `actionType`, an `action:group` / `action:menu` member's `type`, and a dashboard header action's `actionType`. The D2 conversion `action-type-ask-ai-removed` (retired from the load path) deletes, over sources, only what nothing names and, at rest (stored rows, built artifacts), every `ask_ai` action, row and member. The D3 entry `ui-action-type-ask-ai-retired` names what is done by hand. `applyConversionsToStoredItem` now answers `undefined` when the chain leaves no item of a row, which a stored `action` row of this type is; `ConversionContext` gains `atRest`. `ActionSchema`'s ask_ai refinements and the dashboard's record-less refusal leave with the type.
34+
- **`@objectstack/metadata-protocol`**, **`@objectstack/metadata`**, **`@objectstack/core`**, **`@objectstack/service-datasource`**: a stored row the seam yields no item of is registered and served as nothing. The database loader still finds it by name, so `DELETE /api/v1/meta/action/<name>` removes it, and `migrateStoredMetadata` lists it `skipped` with that instruction instead of re-saving it.
35+
- **`@objectstack/runtime`**: the action-execution branches for `ask_ai` are gone.
36+
- **`@object-ui/core`**: `ActionRunner.setAssistantFocusHandler`, `ActionRunner.drawsAction`, `ActionRunner.bulkRefusal`, `isAskAiAction` and the `AssistantFocus` / `AssistantFocusHandler` types are removed; `ActionEngine` no longer filters undrawn actions or refuses a bulk run of one.
37+
- **`@object-ui/react`**: `<ActionProvider onAskAi>` and `useDrawsAction()` are removed.
38+
- **`@object-ui/components`**, **`@object-ui/plugin-grid`**, **`@object-ui/plugin-detail`**: the renderers drop their drawn-action gates.
39+
- **`@object-ui/app-shell`**: `setChatFocus` and its `follow` option are removed; the conversation's record pin is set from the composer chip only. `useAskAiHandler`, `AiSurfaceState.focusServed` and the catalog `focus` lookup behind them leave with the type. This also closes #37827, the record page that dropped the shell's ask-AI handler: there is no handler left to drop.
40+
41+
Correction to two prerelease notes already published in `19.0.0-next.0` (`.changeset/pre/37142-ask-ai-action-type.md` and the `setChatFocus` line of `.changeset/pre/36999-conversation-focus.md`): the `ask_ai` action type and the `setChatFocus` setter they announce do not ship in 19.0.0. The in-composer record pin from #36999 stays.

‎content/docs/protocol/objectui/actions.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ refreshAfter: true
4141

4242
## Action Types
4343

44-
The `type` field selects how an action is dispatched. The complete enum is **`script`, `url`, `modal`, `flow`, `api`, `form`, `ask_ai`** — there are no other types. `type` defaults to `script` when omitted.
44+
The `type` field selects how an action is dispatched. The complete enum is **`script`, `url`, `modal`, `flow`, `api`, `form`** — there are no other types. `type` defaults to `script` when omitted.
4545

4646
| Type | Behavior | `target` required? |
4747
| --- | --- | --- |
@@ -51,7 +51,6 @@ The `type` field selects how an action is dispatched. The complete enum is **`sc
5151
| `modal` | Open a modal/page by name. | Yes |
5252
| `api` | Call an API endpoint (`method` defaults to `POST`). | Yes |
5353
| `form` | Open a FormView by name, routed to `/_console/forms/:name` **inside the console shell**; the submit lands on the created record. | Yes |
54-
| `ask_ai` | Open the console's in-app assistant on a fresh conversation focused on the one record the action runs on (ADR-0160 D7); a conversation the assistant showed before keeps its own focus. Sends no message and calls no server. It is not drawn with no in-app assistant, nor where no single record is held: never in a bulk bar or a related list's toolbar, and in a list toolbar only while exactly one row is selected. A dashboard header refuses it. Never an AI tool: `ai.exposed: true` beside it is refused. | No — a `target` is refused |
5554

5655
The one thing that is not a type: the **declarative single-record field write**. It is spelled `operation: 'update'` + `patch` — the same words a list view's `bulkActionDefs` uses for the bulk form — and it rides the default `script` route: the platform action route performs the write on the data plane **as the caller** (never system-elevated), so the caller's permissions, the object's hooks and its validations fire exactly as for a user edit. Beside `operation: 'update'` an action carries no executor binding of its own — `target`, `body`, `method`, `bodyExtra` and any other explicit `type` are refused — and `patch` is merged under whatever the `params` dialog collects, so a fixed value can be declared without exposing it in the dialog. `undoable` has its anchor here: the capture is the prior value of every field the action writes — the merged bag, `patch` under `params`, not `patch` alone.
5756

@@ -225,7 +224,7 @@ interface Action {
225224
order?: number; // Sort order within a location group (lower = higher)
226225
227226
// Behavior
228-
type?: 'script' | 'url' | 'modal' | 'flow' | 'api' | 'form' | 'ask_ai'; // default 'script'
227+
type?: 'script' | 'url' | 'modal' | 'flow' | 'api' | 'form'; // default 'script'
229228
target?: string; // URL / script / flow / modal / endpoint
230229
operation?: 'update'; // Declarative single-record field write (rides the default script route)
231230
patch?: Record<string, unknown>; // Static field values for operation: 'update', merged under params

‎content/docs/references/data/object.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ const result = ApiMethod.parse(data);
523523
| **icon** | `string` | optional | Icon name |
524524
| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: 'action:menu'` to sit in the record page's ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only. |
525525
| **component** | `Enum<'action:button' \| 'action:icon' \| 'action:menu' \| 'action:group'>` | optional | Visual component override |
526-
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
526+
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
527527
| **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. |
528528
| **openIn** | `Enum<'self' \| 'new-tab'>` | optional | For type:'url' — where to open `target`. 'new-tab' opens a new browser tab; 'self' navigates in place. When omitted, external/absolute URLs open in a new tab and relative URLs navigate in place. Static execution option — keep it OUT of `params` (which is user-input-collection only). |
529529
| **body** | `{ language: 'expression'; source: string } \| { language: 'js'; source: string; capabilities?: Enum<'api.read' \| 'api.write' \| 'api.transaction' \| 'crypto.uuid' \| 'log' \| …>[]; timeoutMs?: integer; … }` | optional | Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`. An action body runs as system, and its update, transfer, delete, purge or restore of an object declared managedBy: 'append-only' is refused with PERMISSION_DENIED; an insert is not judged by this rule. Its system elevation does not lift the organization wall: the body has its reads and writes judged by the invoking user's organization wall. A write whose own data names an organization outside it, or empties a record's organization, is refused with PERMISSION_DENIED. Where the wall denies the user (no active organization under isolated, no membership under group), its reads of an organization's records return none, its deletes remove none, and its other writes are refused with PERMISSION_DENIED. |

‎content/docs/references/kernel/metadata-plugin.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const result = MetadataBulkResultSchema.parse(data);
333333
| **icon** | `string` | optional | Icon name |
334334
| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: 'action:menu'` to sit in the record page's ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only. |
335335
| **component** | `Enum<'action:button' \| 'action:icon' \| 'action:menu' \| 'action:group'>` | optional | Visual component override |
336-
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
336+
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
337337
| **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. |
338338
| **openIn** | `Enum<'self' \| 'new-tab'>` | optional | For type:'url' — where to open `target`. 'new-tab' opens a new browser tab; 'self' navigates in place. When omitted, external/absolute URLs open in a new tab and relative URLs navigate in place. Static execution option — keep it OUT of `params` (which is user-input-collection only). |
339339
| **body** | `{ language: 'expression'; source: string } \| { language: 'js'; source: string; capabilities?: Enum<'api.read' \| 'api.write' \| 'api.transaction' \| 'crypto.uuid' \| 'log' \| …>[]; timeoutMs?: integer; … }` | optional | Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`. An action body runs as system, and its update, transfer, delete, purge or restore of an object declared managedBy: 'append-only' is refused with PERMISSION_DENIED; an insert is not judged by this rule. Its system elevation does not lift the organization wall: the body has its reads and writes judged by the invoking user's organization wall. A write whose own data names an organization outside it, or empties a record's organization, is refused with PERMISSION_DENIED. Where the wall denies the user (no active organization under isolated, no membership under group), its reads of an organization's records return none, its deletes remove none, and its other writes are refused with PERMISSION_DENIED. |

‎content/docs/references/ui/action.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const result = ActionSchema.parse(data);
5050
| **icon** | `string` | optional | Icon name |
5151
| **locations** | `Enum<'list' \| 'record' \| 'record_page' \| 'record_row' \| 'record_related' \| 'record_section'>[]` | optional | Locations where this action is visible. `record_section` is drawn only by an authored record page block that renders it; the standard record page (on a phone, in the side preview, and for an object with no authored page) does not draw it, so an action that must reach every surface adds `record_page` as well, with `component: 'action:menu'` to sit in the record page's ⋯ menu rather than be a header button. `list` acts on no record (the list page toolbar); `record` acts on one record, on the record page and on each list row; `record_page` and `record_row` are one of those two only. |
5252
| **component** | `Enum<'action:button' \| 'action:icon' \| 'action:menu' \| 'action:group'>` | optional | Visual component override |
53-
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
53+
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
5454
| **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. |
5555
| **openIn** | `Enum<'self' \| 'new-tab'>` | optional | For type:'url' — where to open `target`. 'new-tab' opens a new browser tab; 'self' navigates in place. When omitted, external/absolute URLs open in a new tab and relative URLs navigate in place. Static execution option — keep it OUT of `params` (which is user-input-collection only). |
5656
| **body** | `{ language: 'expression'; source: string } \| { language: 'js'; source: string; capabilities?: Enum<'api.read' \| 'api.write' \| 'api.transaction' \| 'crypto.uuid' \| 'log' \| …>[]; timeoutMs?: integer; … }` | optional | Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`. An action body runs as system, and its update, transfer, delete, purge or restore of an object declared managedBy: 'append-only' is refused with PERMISSION_DENIED; an insert is not judged by this rule. Its system elevation does not lift the organization wall: the body has its reads and writes judged by the invoking user's organization wall. A write whose own data names an organization outside it, or empties a record's organization, is refused with PERMISSION_DENIED. Where the wall denies the user (no active organization under isolated, no membership under group), its reads of an organization's records return none, its deletes remove none, and its other writes are refused with PERMISSION_DENIED. |
@@ -419,7 +419,6 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities
419419
* `flow`
420420
* `api`
421421
* `form`
422-
* `ask_ai`
423422

424423

425424
---
@@ -430,7 +429,7 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities
430429

431430
| Property | Type | Required | Description |
432431
| :--- | :--- | :--- | :--- |
433-
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form' \| 'ask_ai'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
432+
| **type** | `Enum<'script' \| 'url' \| 'modal' \| 'flow' \| 'api' \| 'form'>` | optional (default: `"script"`) | Action functionality type — the dispatch route. The declarative single-record field write is not a type: it is `operation: 'update'` + `patch` on the default `script` route. |
434433
| **name** | `string` | optional | Machine name (lowercase snake_case) |
435434
| **label** | `string \| Record<string, string>` | optional | Display label |
436435
| **target** | `string` | optional | URL, Script Name, Flow ID, or API Endpoint. Supports $`{param.X}` and $`{ctx.X}` interpolation. For type:'url': an http:// or https:// URL, a mailto: address, or an in-app path starting with / or ./ (a console route; a record is /apps/APP/OBJECT/record/ID, APP being the app's route segment — see onSuccess.navigate) — every other scheme and a protocol-relative //host are refused. |

0 commit comments

Comments
 (0)