@zephinel/dsh-intelligent-ui 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +7 -0
- package/README.en.md +107 -86
- package/README.md +103 -82
- package/assets/intelligent-ui-components-layout.webp +0 -0
- package/assets/intelligent-ui-dashboard-en.webp +0 -0
- package/assets/intelligent-ui-dashboard-zh.webp +0 -0
- package/assets/intelligent-ui-editing-en.webp +0 -0
- package/assets/intelligent-ui-editing-zh.webp +0 -0
- package/assets/intelligent-ui-itinerary-en.webp +0 -0
- package/assets/intelligent-ui-itinerary-zh.webp +0 -0
- package/assets/intelligent-ui-on-demand-hint.webp +0 -0
- package/assets/intelligent-ui-quiz-en.webp +0 -0
- package/assets/intelligent-ui-quiz-zh.webp +0 -0
- package/assets/intelligent-ui-readme-components.webp +0 -0
- package/assets/intelligent-ui-readme-controls.webp +0 -0
- package/assets/intelligent-ui-readme-generation-en.webp +0 -0
- package/assets/intelligent-ui-readme-generation-zh.webp +0 -0
- package/assets/intelligent-ui-readme-overview-en.webp +0 -0
- package/assets/intelligent-ui-readme-overview-zh.webp +0 -0
- package/assets/intelligent-ui-readme-temporary.webp +0 -0
- package/assets/intelligent-ui-real-dashboard-en.webp +0 -0
- package/assets/intelligent-ui-real-dashboard-zh.webp +0 -0
- package/assets/intelligent-ui-real-itinerary-en.webp +0 -0
- package/assets/intelligent-ui-real-itinerary-zh.webp +0 -0
- package/assets/intelligent-ui-real-quiz-en.webp +0 -0
- package/assets/intelligent-ui-real-quiz-zh.webp +0 -0
- package/assets/intelligent-ui-settings.webp +0 -0
- package/assets/intelligent-ui-style-panel.webp +0 -0
- package/assets/intelligent-ui-temporary-result-dark.webp +0 -0
- package/assets/intelligent-ui-temporary-result.webp +0 -0
- package/assets/intelligent-ui-toggle.png +0 -0
- package/lib/client.js +169 -146
- package/lib/index.js +101 -62
- package/lib/standalone.css +1 -1
- package/lib/standalone.js +139 -133
- package/licenses/remix-icon-LICENSE +186 -0
- package/package.json +12 -6
- package/skills/intelligent-ui/SKILL.md +46 -25
- package/skills/intelligent-ui/references/components.md +10 -10
- package/skills/intelligent-ui/references/integration.md +24 -22
- package/skills/intelligent-ui/references/troubleshooting.md +11 -2
|
@@ -2,38 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
dsh-intelligent-ui is a DSH bundle with two halves:
|
|
4
4
|
|
|
5
|
-
- **Host** (`lib/index.js`, Node): registers the `render_ui` tool, validates programs with `@openuidev/lang-core` against the generated component spec compiled into the bundle, owns the per-session switch and answer-style overrides (persistence file + slash command + session projection + per-agent tool visibility), contributes the OpenUI Lang generation prompt as a conditional system-prompt section (`tool:intelligent-ui`, order 3100), serves the global `globalEnabled` / `answerStyle` / `freeComposition` / `exportBackground` / `exportScale` / `removeFollowUps` settings (the prompt reads the enable/style/composition values live; the browser also reads the image-export and page follow-up defaults), validates the model-provided `style` against the effective session style, registers the shipped Agent Skill when the deployment composes a skill service, and (when the deployment composes `webServer`) serves `lib/standalone.js` / `lib/standalone.css` on same-origin routes for interactive-page export. `@deepseek-ai/schemastery` is the one runtime dependency, used only for the Config schema the Host settings service reads.
|
|
6
|
-
- **Client** (`lib/client.js`, browser): registers a `conversation.chat.turnTail` card that renders every `render_ui` program recorded by the closing turn, a compact `render_ui` process row that keeps the raw program out of the tool list, the composer UI switch in `conversation.input.activity`, an export entry in `conversation.chat.assistant-actions` (only for messages whose closing Turn recorded `render_ui`; it saves the Turn's rendered cards as one PNG or one single-file interactive HTML page), and the deployment-wide configuration on the bundle's Plugins detail page in `plugins.bundle.config`. It also registers the extension's zh/en UI dictionaries with the client locale
|
|
5
|
+
- **Host** (`lib/index.js`, Node): registers the `render_ui` tool, validates programs with `@openuidev/lang-core` against the generated component spec compiled into the bundle, owns the per-session switch and answer-style overrides (persistence file + slash command + session projection + per-agent tool visibility), contributes the OpenUI Lang generation prompt as a conditional system-prompt section (`tool:intelligent-ui`, order 3100), serves the global `globalEnabled` / `answerStyle` / `freeComposition` / `documentMode` / `exportBackground` / `exportScale` / `removeFollowUps` settings (the prompt reads the enable/style/composition values live; the browser also reads the image-export and page follow-up defaults), validates the model-provided `style` against the effective session style, registers the shipped Agent Skill when the deployment composes a skill service, and (when the deployment composes `webServer`) serves `lib/standalone.js` / `lib/standalone.css` on same-origin routes for interactive-page export. `@deepseek-ai/schemastery` is the one runtime dependency, used only for the Config schema the Host settings service reads.
|
|
6
|
+
- **Client** (`lib/client.js`, browser): registers a `conversation.chat.turnTail` card that renders every `render_ui` program recorded by the closing turn, a compact `render_ui` process row that keeps the raw program out of the tool list, the composer UI switch in `conversation.input.activity`, an export entry in `conversation.chat.assistant-actions` (only for messages whose closing Turn recorded `render_ui`; it saves the Turn's rendered cards as one PNG or one single-file interactive HTML page), and the deployment-wide configuration on the bundle's Plugins detail page in `plugins.bundle.config`. It also registers the extension's zh/en UI dictionaries with the client locale serviceAn ordinary render recorded while the experimental document mode is on carries `document: true`; the client renders that result as a chrome-less document section instead of a card (no header, collapse control, editing entry or revision history). (`ctx.locale.register('intelligent-ui', { zh, en })`) and declares `locale` on those slot registrations, so an in-app language switch re-renders all of its chrome. The composer control opens built-in Auto/Card/Article preview cards, Custom styles with management, and a bottom On-demand UI entry. `conversation.input.overlay` shows an armed hint/examples/cancel; temporary result cards add a badge and adjust/save actions; the Plugin detail page adds global enablement, the global default style, and the export defaults (background color, 1x/2x, and whether images/pages remove the whole `@ToAssistant` follow-up block (on by default)).
|
|
7
7
|
|
|
8
8
|
The same package ships the Agent Skill in `skills/intelligent-ui/`. A deployment can use the tool without the skill; the skill is what makes an agent good at it.
|
|
9
9
|
|
|
10
10
|
## Current status
|
|
11
11
|
|
|
12
|
-
**Published.** `@zephinel/dsh-intelligent-ui@0.5.0` is on npm and the repository is public at `Zephinel/dsh-intelligent-ui`. Prefer the npm or GitHub bundle install below; the local-checkout flow remains available for development.
|
|
12
|
+
**Published.** `@zephinel/dsh-intelligent-ui@0.5.0` is on npm and the repository is public at `Zephinel/dsh-intelligent-ui`. The published 0.5.0 does not include the B1/B2 style editing and revision-history deletion currently in the local main branch (not yet pushed). Prefer the npm or GitHub bundle install below; the local-checkout flow remains available for development.
|
|
13
13
|
|
|
14
14
|
## Requirements
|
|
15
15
|
|
|
16
|
-
- DSH **0.2.
|
|
16
|
+
- DSH **0.2.2** (validated on `0.2.2-rc.1`, current latest), Node **24**.
|
|
17
17
|
- The **web** profile (or any profile whose app has a browser chat surface); the client half declares `"dsh": { "client": { "platform": "web" } }`.
|
|
18
18
|
- Interactive-page export additionally needs a `webServer` service so the Host can serve the standalone renderer assets; without it image export still works and page export reports a build failure.
|
|
19
19
|
- Style catalog and management require Host `webServer` plus `connection.requestRejection` authentication. On-demand uses the deployment's normal default conversation model services and session events; there is no extension-owned draft model endpoint, `llm` injection or `agentDefaultModel` injection. The structured clarification path additionally needs the built-in `ask_user_question` tool; a text fallback keeps the operation pending for the next message instead of requiring an immediate re-arm.
|
|
20
20
|
- The app composes the client locale service (`@deepseek-ai/dsh-client-locale`; DSH Web includes it by default). The browser half requires the `locale` service: without it the switch and the card do not mount, while the Host tool and prompt keep working. UI dictionaries live in `src/shared/locales.ts` (`zh` as the key-set source of truth, `en` checked complete); the renderer falls back to English outside DSH.
|
|
21
21
|
- Network access for the nice-to-haves: Wikipedia/Wikimedia (photo search), OpenFreeMap tiles and OSRM demo routing (Map). Offline, the page still renders with the fallbacks described below.
|
|
22
22
|
- Runtime dependency **`@deepseek-ai/schemastery`** (~3.18.5), installed with the package; the Host uses it only for the Plugin detail page Config schema.
|
|
23
|
-
- The package declares **no `engines.dsh` yet**; it was verified against `0.2.
|
|
23
|
+
- The package declares **no `engines.dsh` yet**; it was verified against `0.2.2-rc.1`. A later DSH may refuse it until a compatible release lands or an exact-version exemption is granted (below).
|
|
24
24
|
|
|
25
25
|
## Session switch and answer style
|
|
26
26
|
|
|
27
|
-
The extension costs ~
|
|
27
|
+
The extension costs ~10k prompt tokens, so access is opt-in. The deployment-wide defaults live on the Plugin detail page; the composer can override them for one session. A fresh install starts **off** globally, and session state survives refresh and DSH restarts.
|
|
28
28
|
|
|
29
|
-
- **Global defaults (Plugin detail page):** **Enable in all sessions**, the global **Auto / Card / Article** or saved-template style,
|
|
30
|
-
- **Session overrides (composer UI chip):** **Off / This session only /
|
|
29
|
+
- **Global defaults (Plugin detail page):** **Enable in all sessions**, the global **Auto / Card / Article** or saved-template style, the existing **Free-form layout** switch, and the experimental **Answer as a document (experimental)** switch (`documentMode`).
|
|
30
|
+
- **Session overrides (composer UI chip):** **Off / This session only / Follow global** for enablement (Follow global inherits the global switch without changing it; the chip states whether the global switch is on or off); `/iui on|off|inherit`. The **This session only** entry opens a style panel: built-in preview cards, saved templates, On-demand UI, and **Follow global**; `/iui style auto|card|article|inherit|<cs_id>`.
|
|
31
31
|
- **Effective values:** session override first, then the global value; `inherit` follows the global value.
|
|
32
|
-
- **Answer style:** `Card` is a compact interactive page; `Article` is a reading layout inside the `render_ui` card (`Toc` + collapsible `Section` + long Markdown prose); `Auto` lets the model choose. The Host appends the effective style to the generation prompt and rejects a `render_ui` style that conflicts with a forced Card/Article setting.
|
|
32
|
+
- **Answer style:** `Card` is a compact interactive page; `Article` is a reading layout inside the `render_ui` card (`Toc` + collapsible `Section` + long Markdown prose); `Auto` lets the model choose Card, Article or a free layout. The Host appends the effective style note to the generation prompt and rejects a `render_ui` style that conflicts with a forced Card/Article setting; in Auto it accepts `card`, `article` or `free`. The session style is a layout preference: the model decides per answer whether to render at all and may answer in Markdown when a page would add nothing (except an explicit render request or an authorized on-demand operation).
|
|
33
33
|
- **Persistence:** `<DSH_HOME>/dsh-intelligent-ui.json`, written atomically on every session change: `{ "sessions": [...], "offSessions": [...], "styles": { "<session-id>": "article" } }`. A legacy `{ "enabled": true }` or `{ "global": true, "sessions": [...] }` file is still read as migration state. Global values live in the Host settings document.
|
|
34
34
|
- **What off means for a session:** the `render_ui` schema is denied per agent through `agent.ctx.tools.restrict()`, the `tool:intelligent-ui` prompt section resolves to an empty string, and a stray call throws `render_ui is disabled for this session`.
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
35
|
+
- **Experimental document mode:** when `documentMode` is on, an ordinary answer (not an on-demand result, Artifact edit or saved template) must be rendered with `style: "free"` and the whole answer inside the program; the prompt omits the session style note, the Host ignores the selected template, and the success value/meta records `document: true`. The client then renders the result as a chrome-less document that reads as the turn's message text. It is a stopgap for in-message UI: the content still lives in the turn-tail result, so message copy/search/transcript export omit it, and the document page has no editing entry or revision history. The switch only affects new answers; recorded results replay with their recorded presentation.
|
|
36
|
+
- **What on means for a session:** the prompt section is injected with the effective style note; the model decides page vs text per answer, and a session style only names the layout when it renders.
|
|
37
|
+
- **Projection:** the `intelligent-ui` session projection folds the `command/run` + `command/done` pair (pending state) and projects `sessionEnable`, `sessionStyle`, `globalEnabled`, `globalStyle`, `enabled`, `style`, `pending`, nullable `onDemand`, and the optional capability bits `styleEdit`/`styleSwitch` (projection stateVersion 6). The composer control mirrors this projection and sends commands. It also publishes an optimistic view to other tabs over BroadcastChannel; when the host projection catches up, the projection becomes authoritative again.
|
|
37
38
|
- **Deployments without `sessionProjections` + `commands`:** no session controls and no persistence, so the extension keeps its legacy **always-on** behavior. DSH Web composes both services.
|
|
38
39
|
|
|
39
40
|
Use `/iui off` (session override) to stop paying the prompt cost for that session; use the Plugin detail page to change the deployment-wide default.
|
|
@@ -65,7 +66,7 @@ DSH Desktop installs the same bundle from the app instead of the CLI: **Plugins*
|
|
|
65
66
|
|
|
66
67
|
Packaging behavior that matters when publishing:
|
|
67
68
|
|
|
68
|
-
- The registry tarball ships the prebuilt `lib/` (host and client bundles), `cordis.patch.yml`, `skills/`, `locale/`, `licenses/`, `assets/`, the two READMEs (`README.md` / `README.en.md`), `LICENSE`, `NOTICE` and `icon.svg` (
|
|
69
|
+
- The registry tarball ships the prebuilt `lib/` (host and client bundles), `cordis.patch.yml`, `skills/`, `locale/`, `licenses/`, `assets/`, the two READMEs (`README.md` / `README.en.md`), `LICENSE`, `NOTICE` and `icon.svg` (65 files). The generated component spec and generation prompt are build inputs compiled into `lib/index.js`; `vendor/` and `src/` are not shipped.
|
|
69
70
|
- A Git checkout installs from source: pnpm runs the package's `prepare` build, so the install may ask for **build-script approval** and needs the toolchain. A registry tarball has nothing to build.
|
|
70
71
|
- Without `dsh.bundle`, the manager would install the package as a plain dependency with the warning `declares no dsh.bundle — installed as a plain dependency, not a profile layer`, and nothing would load. This package declares it, so that warning means the wrong spec or an old tarball.
|
|
71
72
|
|
|
@@ -73,7 +74,7 @@ If DSH refuses the package for version incompatibility, either install a compati
|
|
|
73
74
|
|
|
74
75
|
```sh
|
|
75
76
|
dsh plugin --profile web version-exemptions
|
|
76
|
-
dsh plugin --profile web allow-version @zephinel/dsh-intelligent-ui@0.5.0 --dsh-version 0.2.
|
|
77
|
+
dsh plugin --profile web allow-version @zephinel/dsh-intelligent-ui@0.5.0 --dsh-version 0.2.2-rc.1 --accept-risk
|
|
77
78
|
```
|
|
78
79
|
|
|
79
80
|
Remove it with the mirror command:
|
|
@@ -120,8 +121,8 @@ dsh --profile web --dump-config | grep -n intelligent-ui # the entry must be c
|
|
|
120
121
|
|
|
121
122
|
Verification checklist (remember the switch is off by default):
|
|
122
123
|
|
|
123
|
-
0. **Switch present.** The composer shows the **UI** chip in `conversation.input.activity`; its menu offers **Off**, **This session only**, and **
|
|
124
|
-
1. **Tool present while on.** With the switch admitting the session, it exposes `render_ui` with the argument schema `{ program: string, style: "card"|"article"|"free", title?: string, styleId?: string, temporaryStyle?: StyleSnapshot }`. Authorized new on-demand generation requires free layout; adjustments preserve the registered parent layout. Both override session style guidance; otherwise the effective style is built-in or a visible saved template; Auto requires the model to pass the concrete card
|
|
124
|
+
0. **Switch present.** The composer shows the **UI** chip in `conversation.input.activity`; its menu offers **Off**, **This session only**, and **Follow global** (localized: 「关闭 / 仅本会话 / 跟随全局」 in a Chinese UI); Follow global shows the current global state under the row. Pick **This session only** (or run `/iui on`) before checking the tool and prompt; with the switch off, steps 1–2 are expected to *fail* by design. The Plugin detail page exposes the global enablement switch, the default Answer style and Free-form layout.
|
|
125
|
+
1. **Tool present while on.** With the switch admitting the session, it exposes `render_ui` with the argument schema `{ program: string, style: "card"|"article"|"free", title?: string, styleId?: string, temporaryStyle?: StyleSnapshot }`. Authorized new on-demand generation requires free layout; adjustments preserve the registered parent layout. Both override session style guidance; otherwise the effective style is built-in or a visible saved template; Auto requires the model to pass the concrete style it chose (`card`, `article` or `free`), and any ordinary style may answer in Markdown when a page would add nothing. The model-facing description starts "Render an interactive answer as UI in the chat". With the switch off (or scoped to another session), the request tool list must **not** contain `render_ui`.
|
|
125
126
|
2. **Prompt present while on.** With the switch on, the composed system prompt contains the OpenUI Lang section (order 3100) with the 57-component catalog and the effective style note; with the switch off the section resolves to an empty string.
|
|
126
127
|
3. **Card works.** Ask the model to render a trivial page, or let the skill lead it. The turn ends with a card titled by `title` (or the localized default "Interactive answer" / 「交互式回答」) containing the rendered UI; the process area shows one such row, not the raw program.
|
|
127
128
|
4. **Skill present.** When the profile composes the skill registry, the session catalog lists `intelligent-ui`; loading it returns the body of `skills/intelligent-ui/SKILL.md`. Without a skill service the tool still works and only the catalog entry is missing.
|
|
@@ -152,17 +153,18 @@ Filesystem discovery is only a **manual fallback** for an environment where the
|
|
|
152
153
|
| Aspect | Contract |
|
|
153
154
|
| --- | --- |
|
|
154
155
|
| Name | `render_ui` |
|
|
155
|
-
| Arguments | `{ "program": string, "style": "card"|"article"|"free", "title"?: string, "styleId"?: string, "temporaryStyle"?: StyleSnapshot }`, `required: ["program", "style"]`, `additionalProperties: false` |
|
|
156
|
+
| Arguments | `{ "program": string, "style": "card"|"article"|"free", "title"?: string, "styleId"?: string, "temporaryStyle"?: StyleSnapshot, "editRequestId"?: string }`, `required: ["program", "style"]`, `additionalProperties: false` |
|
|
156
157
|
| `program` | One complete OpenUI Lang program, statement per line, `root` first. Passed verbatim by the model; persisted as the tool call's arguments and replayed from history. |
|
|
157
158
|
| `title` | Optional short card label, e.g. "Day in San Francisco". When omitted the client uses the localized default ("Interactive answer" / 「交互式回答」). |
|
|
158
|
-
| `style` | `"card"`, `"article"` or `"free"`; required. Free is accepted with an authorized temporary snapshot
|
|
159
|
+
| `style` | `"card"`, `"article"` or `"free"`; required. Free is accepted with an authorized temporary snapshot, the exact styleId of the selected free template (without temporaryStyle), an Auto session that chose free (no styleId/temporaryStyle), or an ordinary answer rendered while the deployment enables document mode (then free is required and styleId/temporaryStyle are rejected); without Card compactness or mandatory Toc/Section. Pass the effective base layout from the prompt; a Host-authorized temporary snapshot overrides the selected style only for that result. In Auto pass the style you chose. |
|
|
159
160
|
| `styleId` | Exact selected custom template id; omit for built-in or temporary styles. Mutually exclusive with temporaryStyle. |
|
|
160
|
-
| `temporaryStyle` | Host-authorized schemaVersion 1 snapshot: baseLayout equals style (Host-enforced `free` for new generation; adjustments must match the registered parent snapshot layout, including legacy card/article), reusable directives, optional theme (omitted = inherit the session theme; when passed it must be complete and contrast-checked), optional suggestedName. A snapshot without a theme cannot become a style template. Missing or evicted parents reject adjustment with an error asking the user to cancel and start a new on-demand generation. Model arguments cannot authorize an operation. |
|
|
161
|
-
|
|
|
161
|
+
| `temporaryStyle` | Host-authorized schemaVersion 1 snapshot: baseLayout equals style (Host-enforced `free` for new generation; adjustments must match the registered parent snapshot layout, including legacy card/article), reusable directives, optional theme (omitted = inherit the session theme; when passed it must be complete and contrast-checked), optional suggestedName. A snapshot without a theme cannot become a style template. Missing or evicted parents reject adjustment with an error asking the user to cancel and start a new on-demand generation. Model arguments cannot authorize an operation. A pending natural-language style edit also exercises this snapshot path, but only with `editRequestId` and without `styleId`. |
|
|
162
|
+
| `editRequestId` | The pending Artifact edit request this call applies: required for a natural-language style edit (`kind: "style"` envelope) and used for order-only/global-only block requests. A style request is explicit-only and never auto-applies; a called style edit records `styleEdit: true`, the approved `temporaryStyle` and the recorded `title`, and the revision keeps the layout with no `styleId`/`editedBlockIds`. |
|
|
163
|
+
| Success value | `{ "statements": number, "style": "card"|"article"|"free", "styleSource"?: "builtin"|"template"|"temporary", "styleId"?: string, "document"?: boolean, "warnings"?: string[] }` — the parsed statement count, the resolved style recorded with the page, `document: true` for an ordinary answer recorded in document mode, and any non-fatal findings (`Unresolved reference: …`, `Unreferenced statement (will not render): …`). The result meta also records `style`/`styleSource` so a settled free layout replays without a style identity. |
|
|
162
164
|
| Model-visible result | `Interactive UI rendered for the user (<n> statements, <style> style).` plus ` Notes: <warnings joined by "; ">` when warnings exist. |
|
|
163
165
|
| Empty/failed validation | Throws `Error: render_ui: …`; the model sees the message as a tool error and is expected to fix and retry in the same turn. |
|
|
164
166
|
| Validation | `createParser(componentSpecSchema, "Col")` from `@openuidev/lang-core`; the spec is generated from `vendor/spec.json` at build time and compiled into `lib/index.js`. Fatal findings are parser errors, `incomplete: true`, and an unresolved root. Warnings never block rendering. |
|
|
165
|
-
| Rendering | Client-side only. The card is appended at the end of the turn that called the tool; multiple calls in one turn render multiple cards, but the tool guidance asks for one. |
|
|
167
|
+
| Rendering | Client-side only. The card is appended at the end of the turn that called the tool; multiple calls in one turn render multiple cards, but the tool guidance asks for one. A result recorded with `document: true` is rendered as a chrome-less document section (the message-body presentation of the experimental document mode) instead of a card. |
|
|
166
168
|
| Interaction | All `$` state, `@functions`, `@Set`/`@Reset`, charts, maps and SVG run in the browser with no model round trip. `@ToAssistant` seeds the composer draft with the message and submits it, starting a new turn. |
|
|
167
169
|
| Persistence | The program and any inline temporaryStyle are recorded in tool arguments; DOM is not persisted. Replay reads those arguments when available in the loaded history window. Temporary replay needs no catalog; saved-template colors resolve from the current catalog and may fall back if missing. |
|
|
168
170
|
| Trust boundary | `HtmlView` runs in a sandboxed iframe with an opaque origin. Its CSP allows inline code, a few script/style/font CDNs and https images; no other network. Programs cannot reach the chat DOM, cookies or storage. |
|
|
@@ -187,7 +189,7 @@ Filesystem discovery is only a **manual fallback** for an environment where the
|
|
|
187
189
|
|
|
188
190
|
Work top-down; each step rules out one layer:
|
|
189
191
|
|
|
190
|
-
1. **Switch state (start here).** The extension is off by default. Check the composer **UI** control (Off / This session only /
|
|
192
|
+
1. **Switch state (start here).** The extension is off by default. Check the composer **UI** control (Off / This session only / Follow global; Chinese UI: 「关闭 / 仅本会话 / 跟随全局」) or run `/iui` to print the current state; if the control is missing, the profile lacks `sessionProjections`/`commands` or the browser half did not load. A tool error reading `render_ui is disabled for this session` means the switch does not admit this session (wrong scope, or a command that has not settled) — pick “this session only” and retry.
|
|
191
193
|
2. **Right profile.** Installed into `web` but the session runs under another profile (`headless`, `sdk`, custom) → install there too.
|
|
192
194
|
3. **Composed tree.** `dsh --profile web --dump-config` does not mention `intelligent-ui` → the bundle is not selected or the checkout is not linked. Re-add it (`dsh plugin --profile web add link:$(pwd)` from the checkout, or `node scripts/install.mjs`), then restart.
|
|
193
195
|
4. **Built artifacts.** For a checkout: `lib/index.js` and `lib/client.js` exist and are newer than `src/`. If not, `npm run build`.
|
|
@@ -203,7 +205,7 @@ Work top-down; each step rules out one layer:
|
|
|
203
205
|
|
|
204
206
|
- The card appears at the **end of the turn** (turn-tail), never inline mid-answer; during generation the process row reads the localized "Interactive answer" (「交互式回答」 in a Chinese UI).
|
|
205
207
|
- Model-authored programs occasionally fail validation; the host returns exact errors and the model is expected to self-repair in the same turn. Repeated failures are a prompt/model issue, not a host issue.
|
|
206
|
-
- The generation prompt is about
|
|
208
|
+
- The generation prompt is about 10K tokens and is sent **only for a session the switch admits**; otherwise the prompt section is empty and the tool schema is hidden. Prompt caching absorbs most of the cost while on.
|
|
207
209
|
- Photos, map tiles and routing are third-party services with offline fallbacks (see [troubleshooting.md](troubleshooting.md#runtime-fallbacks-valid-program-degraded-media)).
|
|
208
210
|
- `Math` relies on the host's global KaTeX styles; if a future DSH shell drops them, formulas degrade to text.
|
|
209
211
|
- This extension is web-only: profiles without a browser surface register the tool but have no card to render into.
|
|
@@ -78,6 +78,15 @@ render_ui: this session uses custom style "Ocean notes"; pass styleId: "cs_ocean
|
|
|
78
78
|
|
|
79
79
|
Follow that exact id/layout outside an authorized on-demand call. If the template is gone, let the user select another style; do not fabricate it.
|
|
80
80
|
|
|
81
|
+
Document-mode errors reject a layout the deployment does not use for ordinary answers:
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
render_ui: document mode renders the answer as one free-layout document; pass style: "free" without styleId or temporaryStyle.
|
|
85
|
+
render_ui: document mode does not use saved templates; omit styleId and pass style: "free".
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This deployment records ordinary answers as documents: pass `style: "free"`, put the whole answer (prose plus interactive blocks) in the program, and write no Markdown outside the call. Card/Article and saved-template layouts are rejected for these answers; apply on-demand results, saved templates and Artifact edit requests with their own recorded layout instead.
|
|
89
|
+
|
|
81
90
|
Command and result-save failures include:
|
|
82
91
|
|
|
83
92
|
```text
|
|
@@ -257,7 +266,7 @@ These are not errors to fix in the program; they are how the card behaves when t
|
|
|
257
266
|
|
|
258
267
|
| Situation | What the user sees | What to do |
|
|
259
268
|
| --- | --- | --- |
|
|
260
|
-
| Photo search offline or rate-limited | `SearchImage`
|
|
269
|
+
| Photo search offline or rate-limited | `SearchImage` shows a neutral placeholder. An explicit `Image` whose source is missing, too large, unsupported (e.g. SVG) or fails to load shows a short localized error placeholder and never searches for a substitute. Search timeouts are 8 s per request, 12 s total. | Nothing. Do not add prose about images failing; for a local file, pass the workspace path instead of a URL. |
|
|
261
270
|
| Map tiles unavailable | `Map tiles are temporarily unavailable. The places are still shown.`(「地图瓦片暂时不可用,地点仍会显示。」)The pins stay interactive. | Nothing; keep the place list near the map. |
|
|
262
271
|
| Map renderer cannot start (old browser, no WebGL) | `Map preview unavailable`(「地图预览不可用」)plus `The places are listed below.`(「地点列表见下方。」)with a numbered list of labels and coordinates. | Keep marker labels short and recognizable; the fallback is a list. |
|
|
263
272
|
| Routing service down | `Street routing unavailable. Showing direct connections.`(「街道路线不可用,改为直线连接。」)Straight lines still join the pins in order. | Nothing; route is an enhancement. |
|
|
@@ -287,4 +296,4 @@ If the page is merely visually weak, do not re-call for cosmetic fixes: choose b
|
|
|
287
296
|
|
|
288
297
|
### Free saved templates
|
|
289
298
|
|
|
290
|
-
A selected free template requires `style: "free"` and its exact `styleId`, without `temporaryStyle`.
|
|
299
|
+
A selected free template requires `style: "free"` and its exact `styleId`, without `temporaryStyle`. An Auto session may also pass `style: "free"` directly (no `styleId`/`temporaryStyle`); the Host records it as a built-in free layout. A forced Card/Article selection still rejects free, and adding an arbitrary styleId cannot authorize free. Free layouts require no Toc/Section or Article wrapper. Saving a result copies the registered layout, directives and theme; a theme-less result has no palette to copy, so the client hides Save and the API answers `no_theme`. A legacy client sending `baseLayout` receives `invalid_input` and must reload the updated client. Missing/deleted templates retain the existing default-theme fallback.
|