@yugoo-design/dsh-design-studio-dsh 0.1.2 → 0.2.2

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.
Files changed (56) hide show
  1. package/README.md +438 -3
  2. package/lib/authoring/panel-components.json +10790 -0
  3. package/lib/authoring/studio-creators/material.json +1 -0
  4. package/lib/authoring-agent-vc786tS0.js +648 -0
  5. package/lib/authoring-agent.d.ts +24 -0
  6. package/lib/authoring-agent.js +2 -0
  7. package/lib/authoring-agent.types-0S0xnlDW.d.ts +87 -0
  8. package/lib/authoring-entry.d.ts +20 -0
  9. package/lib/authoring-entry.js +77 -0
  10. package/lib/authoring-host-m8-GmXIx.js +348 -0
  11. package/lib/authoring-host.d.ts +5 -0
  12. package/lib/authoring-host.js +2 -0
  13. package/lib/authoring-host.types-BZt9l0xK.d.ts +77 -0
  14. package/lib/authoring-reference-store.d.ts +39 -0
  15. package/lib/authoring-reference-store.js +385 -0
  16. package/lib/authoring-service-WClXJGik.js +347 -0
  17. package/lib/authoring-service.d.ts +121 -0
  18. package/lib/authoring-service.js +2 -0
  19. package/lib/authoring-session.d.ts +5 -0
  20. package/lib/authoring-session.js +204 -0
  21. package/lib/authoring-session.types-C6HosIWU.d.ts +58 -0
  22. package/lib/authoring-sources-BzRuEuub.d.ts +17 -0
  23. package/lib/authoring-sources.d.ts +2 -0
  24. package/lib/authoring-sources.js +95 -0
  25. package/lib/authoring-workbench.d.ts +15 -0
  26. package/lib/authoring-workbench.js +782 -0
  27. package/lib/authoring.page-rpc-CYYWsmxc.d.ts +30 -0
  28. package/lib/authoring.page-rpc.d.ts +2 -0
  29. package/lib/authoring.page-rpc.js +55 -0
  30. package/lib/authoring.remote-client.d.ts +2557 -0
  31. package/lib/authoring.remote-client.js +435 -0
  32. package/lib/client-adapter-BmIzQcMT.d.ts +65 -0
  33. package/lib/client-adapter.d.ts +2 -64
  34. package/lib/client.js +1 -2
  35. package/lib/css-assets/dsh-design-studio-page/9178281a0695f79ff8bff8eca529231b67f896dc1c12c8dbaaad24b32dd3fc07.eot +0 -0
  36. package/lib/css-assets/dsh-design-studio-page/b366faf39f6bcc48f10b10f2860e5ebe57091cb2a15beeed8a0977e24560bbba.svg +224 -0
  37. package/lib/css-assets/dsh-design-studio-page/manifest.json +20 -0
  38. package/lib/index.js +4 -105
  39. package/lib/kit-files-DKBlBOG8.js +159 -0
  40. package/lib/page-client.js +4 -23849
  41. package/lib/page-path-BkPiqrUH.d.ts +25 -0
  42. package/lib/page-path.d.ts +2 -2
  43. package/lib/page-path.js +70 -2
  44. package/lib/page-rpc-DXbf4seT.d.ts +24 -0
  45. package/lib/page-rpc.d.ts +2 -15
  46. package/lib/page-rpc.js +9 -4
  47. package/lib/page.d.ts +5 -3
  48. package/lib/page.js +219 -2
  49. package/lib/remote-method-ab_lHwWN.js +16 -0
  50. package/lib/typert.host.d.ts +827 -2
  51. package/lib/typert.host.js +2 -1
  52. package/lib/typert.remote-client-CWz-anTr.d.ts +37 -0
  53. package/lib/typert.remote-client.d.ts +1 -36
  54. package/licenses/dsh-distribution.json +8644 -149
  55. package/package.json +73 -10
  56. package/lib/page-path-wn8e_fid.d.ts +0 -14
package/README.md CHANGED
@@ -7,9 +7,426 @@ snapshot and only the requested Bundle's owning sources. An unavailable source
7
7
  returns `studio.source_unavailable` without breaking healthy Kits. The original
8
8
  explicit `kitSources` mode remains available with its strict startup validation.
9
9
 
10
- `dsh-design-studio-dsh` is the DSH-only adapter around the host-neutral read-only Studio application and shared `StudioWorkspace`. It owns the session-free `studioManagement` Typert Remote, a root-scoped Settings launcher, and the plugin-owned `/design-studio/` full-page route. It does not change the Agent loop, Design Project selection, Design Files, or G/R/A services, and it persists nothing: Studio 1.0 has no durable record, no working copies, and no mutation endpoint.
10
+ `dsh-design-studio-dsh` adapts the shared Studio to DSH. Its integrated page owns
11
+ the session-free `studioManagement` inspection Remote, a Settings launcher
12
+ and the plugin-owned `/design-studio/` route. Settings opens catalog and source
13
+ inspection. Host-prepared creation and editing links open the same shared
14
+ Studio workspace with an explicit native Session locator;
15
+ when the trusted authoring service is enabled, users can open the current library Kit or Bundle, ask AI for a proposal, review
16
+ it and save in place. Explicit Copy creates an independent identity.
17
+ The bounded native factories and their activation requirements follow below.
11
18
 
12
- The Remote exposes exactly six read methods: `workspace`, `readKitWorkspace` (exact `name@version` pin required; a diverging response identity diagnoses), `readKitFiles` and `readKitFile` (the same exact Kit pin), `readBundleWorkspace`, and `readBundleFile`. Kit file inspection includes `kit.yaml`, `mindset.md` and other authored files beneath the selected Kit root, excluding `.git` and `node_modules`; the text viewer accepts regular UTF-8 files up to 1 MiB, with bounded tree traversal. Missing sources, forbidden paths, binary content and oversized files diagnose rather than falling back to another version. The catalog snapshot projects `ctx.design.listKits()`. Bundle source reads run through `ctx.fs`: the `kitSources` config lists installed content packages (`packageName`, resolved like the Design Core kit-loader) or absolute directories (`root`); every path resolves through the filesystem capability and must stay canonically contained in a configured root, so traversal and symlink escapes never read outside the authored trees and non-UTF-8 content diagnoses as binary. Invalid or ambiguous configuration — a missing root, a root without `mindset.md`, a relative path, a duplicate root, or one Kit/Bundle name declared by two roots — fails loud at startup. Without `kitSources` the catalog stays readable and Bundle reads diagnose `studio.source_not_configured`. Disposal rejects new work and drains admitted calls.
19
+ Native authoring follows the shared [editor-level save contract](../studio/README.md#edit-current-content):
20
+ successful saves are readable by another process or a reopened application;
21
+ process interruption preserves complete old or new snapshots, write failures
22
+ are reported, and stale revisions cannot overwrite newer edits. This is not a
23
+ power-loss durability claim or a guarantee against loss of the latest save in
24
+ an operating-system crash.
25
+
26
+ Private directories use POSIX ownership, permission modes and directory sync
27
+ on POSIX. Windows uses inherited user-directory access, physical path and file
28
+ identity checks, file sync and no-clobber reference publication. Both retain the
29
+ existing JSON format and editor-level save boundary. The shared working-copy
30
+ save algorithm has no directory-sync prerequisite. Windows reference-store
31
+ component checks pass under actual Windows Node; working-copy save/reopen,
32
+ host conversation and installed-package acceptance remain separate checks.
33
+ The official distribution mounts the authoring service through its separate
34
+ Loader row; inspection remains independently available. Unix permission-bit
35
+ emulation, a native access-control helper and SQLite are not prerequisites.
36
+
37
+ Configured projects run from their own complete current `design_kit/` tree,
38
+ with the Kit in `kit/` and mounted Bundles in `bundles/`. The trusted Studio
39
+ Host registers one current-library source port for initial project copies;
40
+ project-local definitions are never registered in the global catalog. Library
41
+ changes affect future projects. An Agent can compare and apply changes to an
42
+ existing project through ordinary file editing, validation, saving and Git.
43
+ There is no content release, local version switch or mandatory upgrade flow.
44
+
45
+ `editCurrent` is a strict parent-scoped JSON operation over the same S2 store.
46
+ `captureKit` and `loadKit` remain trusted Host-only capabilities: their source
47
+ filesystem functions never cross the browser RPC. Old Kit/Panel draft
48
+ confirmation and fork routes are removed.
49
+
50
+ ## Native authoring adapter
51
+
52
+ The optional `dsh-design-studio-dsh/authoring` entry exports
53
+ `createStudioAuthoringAgent(ctx)`, exposing `start`, `observe`, `resume` and
54
+ `dispose`. A start request supplies the exact live native parent, an isolated
55
+ workspace, the host-bound instance revision and allowed paths, and the shared
56
+ Studio `read`/`prepare` capability. The SDK child inherits the parent's model
57
+ route and receives only those two tools. Candidate receipts are available through
58
+ `onPrepared` or `readPrepared()` for the existing Studio review/save path.
59
+
60
+ Each run retains its native session, message and turn references separately from
61
+ its local invocation and epoch. Observation checks actual consumption and the
62
+ matching turn outcome. Cancellation fences the owned handle and expected turn;
63
+ explicit resume first observes the retained session and requires a new prompt.
64
+ Callers retain references before dispatch and keep unknown delivery pending
65
+ instead of automatically resending it. Candidate availability and native turn
66
+ completion are separate observations.
67
+
68
+ Every `studio_authoring_prepare` call starts from the bound saved revision and
69
+ replaces the whole previous unsaved proposal. Calls do not accumulate changes.
70
+ To correct diagnostics, the native author resends all still-intended unsaved
71
+ complete-file replacements, including files unchanged since its previous proposal.
72
+ During the same request, later candidates and their diagnostics replace a pristine
73
+ displayed proposal. Human source, title or mount edits retain the current editor;
74
+ **Review latest changes / 审阅最新建议** uses its ordinary discard confirmation.
75
+ An in-flight or unverified save prevents replacement. Saving still requires the
76
+ existing exact candidate validation and verified receipt.
77
+
78
+ The focused SDK tests use an explicitly selected official SDK graph with a
79
+ scripted model, injected S3 ports and memory persistence. They cover the adapter's lifecycle and tool
80
+ boundaries; real model two-round authoring, filesystem durability, page wiring
81
+ and installed-host acceptance require their respective integration checks.
82
+ With an existing official archive selected through `DSH_TEST_ASAR`, run
83
+ `pnpm --filter dsh-design-studio-dsh test:authoring-agent`. The alternative
84
+ `DSH_TEST_WEB_ANCHOR` selects an existing official Web SDK graph; supply one
85
+ of these paths, keeping its configuration and credentials unchanged.
86
+
87
+ The optional `dsh-design-studio-dsh/authoring-session` entry exports
88
+ `createStudioAuthoringSession({ ctx, parent, instances, readComponents,
89
+ workspaceRoot, retainReference })`. It composes the same native adapter with
90
+ `dsh-design-studio/node` read/prepare capabilities over the caller's existing
91
+ instances. Start selects an exact working-copy revision and an initial source
92
+ reading focus. Legal reads, full-file replacements and new files remain bound to
93
+ that same Kit or Bundle; the initial paths are not an editing whitelist. Source
94
+ reads also discover the bound source's file list and Kit mount bindings.
95
+ `studio_authoring_read({mount:{bindingKey}})` lists an existing mount's files;
96
+ `{mount:{bindingKey,paths:["SKILL.md"]}}` reads its current saved method. It uses
97
+ the existing local/retained-source resolver, independently of packaged authoring
98
+ examples and component references. Mounted sources remain read-only and
99
+ `studio_authoring_prepare` continues to write only the bound Kit or Bundle.
100
+ Bundle source uses its exact pin; Kit-owned source can omit a preview Bundle, while a supplied preview pin must match an explicit mount. The
101
+ factory retains the native address before dispatch and returns a typed
102
+ `{ request, candidate }` for the shared review UI. Saving remains an explicit
103
+ call to the existing instance service, using its candidate digest and revision.
104
+ Cold references permit observation; cancellation requires an exact owned run.
105
+
106
+ Kit candidates without a preview Bundle use the shared Core definition validator
107
+ and carry no Panel preview. Their explicit validated save rechecks the same exact
108
+ source and mount closure, returning `definition_passed` through the strict Remote
109
+ codec. Bundles with omitted presentation or `presentation.mode: none` likewise
110
+ receive `definition_passed` after Core definition validation, without a Panel.
111
+ Declarative Bundle candidates and explicit Kit previews retain `preview_passed`
112
+ and their real Panel/sample checks. Empty-mount or otherwise invalid Kit definitions
113
+ cannot receive a validated receipt; an explicit draft save can preserve unfinished
114
+ source. Neither receipt proves native turn completion or publication.
115
+
116
+ With the same official SDK archive selection, run `test:authoring-session` for
117
+ the bridge's scripted native execution and real temporary instance storage
118
+ checks. These exercise two explicit revisions, user save and fresh service
119
+ reopen, alongside conflict, parent identity, cancellation and disposal guards.
120
+ They do not establish real-model, browser or installed-host acceptance.
121
+
122
+ The optional `dsh-design-studio-dsh/authoring-reference-store` entry exports
123
+ `createStudioAuthoringReferenceStore({ stateRoot })`. Choose an explicit private
124
+ host directory outside installed content and Design Projects. The store owns
125
+ only its reference subdirectory and retains exact native addresses and source
126
+ scope, with explicit-parent `read` and bounded `list` methods. Its `retain`
127
+ function can supply the session factory's `retainReference` callback. It stores
128
+ no execution status, candidate or design content; native observation and shared
129
+ Studio working copies keep those responsibilities.
130
+
131
+ This entry also exports `prepareStudioAuthoringDirectory(path)` for an owning
132
+ Host to prepare a private storage or workspace leaf. It requires an absolute
133
+ canonical path with existing physical ancestors, creates only that leaf and
134
+ verifies platform-appropriate access and identity without repairing permissions.
135
+ On POSIX it syncs the leaf and parent before returning; Windows checks their
136
+ physical identities and retains inherited access. Failure can leave a valid
137
+ empty leaf for an explicit later attempt. It creates no reference namespace or
138
+ native session.
139
+
140
+ The reference store verifies physical paths and file identity on both platforms,
141
+ with POSIX ownership and directory-sync checks where supported. Files that
142
+ require sync use a writable handle on Windows; observation remains read-only.
143
+ These checks do not establish a power-loss guarantee or make directory flushing
144
+ a prerequisite for ordinary working-copy saves. A failed
145
+ retention can leave an already published address, so callers must reconcile it
146
+ rather than infer absence or resend. A cold reference supports observation; it
147
+ does not restore S4's owned cancellation handle or prepared-candidate projection.
148
+ Run `test:authoring-reference-store` for temporary-filesystem fault and reopening
149
+ checks. These checks do not simulate power loss or establish actual Host restart
150
+ recovery. The session-free inspection service does not use this store.
151
+
152
+ The optional `dsh-design-studio-dsh/authoring-sources` entry exports
153
+ `createDshStudioInstanceAdapters({ design, fs })`. A trusted Host supplies its
154
+ existing Core registry and public DSH filesystem service. The factory resolves
155
+ independent Bundles by exact pin and retains their registered `sourceId`; Kits
156
+ use the exact Kit resolver, including retained older versions. Missing sources
157
+ or mismatched pins diagnose instead of selecting a newer version.
158
+
159
+ Source capture preserves binary assets, original text bytes, methods and notices
160
+ through bounded `fs.readBytes` reads, excluding `.git` and `node_modules`.
161
+ Containment stays with the public filesystem service. Known listing, stat and
162
+ byte-length disagreements reject the capture; these checks do not provide an
163
+ atomic snapshot of the whole installed tree. The returned catalog and composition
164
+ ports feed the existing shared Studio instance service, which owns compilation,
165
+ snapshots and saves. The caller chooses its private storage separately.
166
+
167
+ Kit mount choices preserve the shared optional `description` and bilingual
168
+ `displayDescription` through the strict instance codec. Both come from the same
169
+ installed or retained Bundle source projection; older choices may omit them.
170
+ The codec still rejects unexpected fields and malformed translated copy. Choice
171
+ labels and descriptions do not enter mount requests: those retain their existing
172
+ exact pin and revision checks.
173
+
174
+ The shared catalog still compiles every independent Bundle when listing choices.
175
+ Consequently, Kit working-copy copy/read can fail on an unrelated broken
176
+ independent source, even when exact capture of that Kit succeeds. This adapter
177
+ preserves that shared policy. Page navigation does not activate a Host through
178
+ this entry. Run `test:authoring-sources` for the explicit
179
+ filesystem-port fixtures with real Core compilation and temporary Studio
180
+ copy/reopen checks; actual DSH filesystem, native model and installed-host
181
+ integration require separate checks.
182
+
183
+ The optional `dsh-design-studio-dsh/authoring-remote` entry exports
184
+ `createSameOriginStudioAuthoringClient({ agentId, fetch? })`. It supplies the shared
185
+ instance client and asynchronous native start, resume, observation, cancellation,
186
+ prepared-candidate and retained-reference calls over the existing same-origin
187
+ Studio transport. The explicit SessionId is a locator for the Host's actual
188
+ native Agent lookup. Native operations accept only `{ sessionId, epoch }`
189
+ addresses; the enabled Host service must resolve their retained canonical scope.
190
+ Unknown fields and malformed results reject, and failed requests are never
191
+ automatically resent. Source preparation and native completion never save files.
192
+
193
+ These strict descriptors and transport primitives do not register or activate an
194
+ authoring service. Run `test:authoring-rpc`
195
+ for JSON/request correlation, parent locators and real temporary instance
196
+ copy/candidate/save/reopen through the transport fixture. Fixture HTTP replies and
197
+ native references do not establish real Gateway lookup, Host authorization or
198
+ installed-page acceptance.
199
+
200
+ The optional `dsh-design-studio-dsh/authoring-host` entry exports
201
+ `createDshStudioAuthoringHost({ ctx, design, fs, stateRoot, workspaceRoot,
202
+ readComponents })`. It composes the existing source adapters, one shared
203
+ instance service, private reference store and native session factory. The owning
204
+ Cordis service declares `agents`, `sessions` and `sessionQuery` dependencies
205
+ alongside `design` and `fs`, supplies explicit private storage and an isolated
206
+ workspace, and reads the actual installed component catalog.
207
+
208
+ `forParent(actualAgent)` binds the exact live native object and returns guarded
209
+ instance operations, retained-reference reads and native authoring methods.
210
+ Kit-owned source authoring does not require a mounted Bundle. The selected paths
211
+ must exist as editable files in that exact Kit working copy; a supplied preview
212
+ pin must still match one of its mounts. Native Panel preview remains conditional
213
+ on that explicit Bundle pin.
214
+ The same object reuses its facade; a same-ID replacement can observe retained
215
+ addresses but cannot inherit old cancellation or prepared-candidate handles.
216
+ Instance records remain shared Host data. Only the existing explicit instance
217
+ save changes source. Disposing the Host or parent facade closes admission,
218
+ releases native work and joins admitted I/O; an already committed save can still
219
+ need reopening after a disconnected response. Page/request teardown must not
220
+ dispose this Host-owned facade.
221
+
222
+ The owning service tracks initialization before awaiting it and joins its
223
+ settlement during unload. A rejected creation can leave valid private metadata;
224
+ it does not make a usable native session available. Run `test:authoring-host`
225
+ with the same official SDK selection for composition, failure and lifecycle
226
+ checks using scripted native execution and actual temporary source/reference
227
+ storage. Fresh service reopening in these checks is distinct from a real Host
228
+ restart. This entry does not register an authoring Remote or change the page.
229
+
230
+ The optional `dsh-design-studio-dsh/authoring-service` entry exports
231
+ `DshStudioAuthoringService`. A trusted Host explicitly activates it with
232
+ `ctx.plugin(DshStudioAuthoringService, { stateRoot, workspaceRoot })`, supplying
233
+ private canonical storage and an isolated workspace. Its public dependencies are
234
+ `design`, `fs`, `agents`, `sessions`, `sessionQuery` and `tools`. The package's existing
235
+ `./typert` contribution declares both the six inspection operations and the 22
236
+ agent-scoped `studioAuthoring` operations; register that contribution once.
237
+ The Service forwards them to the composed Host and projects the shared Core
238
+ component vocabulary. The Gateway resolves each SessionId locator to the actual
239
+ Agent before invoking the Service. A browser-supplied reference cannot replace
240
+ the Host's retained canonical scope.
241
+
242
+ The Service registers shutdown before asynchronous initialization, joins the raw
243
+ factory promise on unload, and closes native admission before draining calls.
244
+ It validates and snapshots request data before queued admission, so later caller
245
+ mutations cannot rewrite a submitted save or native request.
246
+ Start and resume return retained addresses without waiting for native completion;
247
+ prepared candidates still require the existing explicit review and save. Page or
248
+ request teardown does not dispose the Service. Run `test:authoring-service` with
249
+ that official SDK selection for real Gateway lookup, Service lifecycle and
250
+ native prepare/explicit-save/reopen checks. These use a scripted model, memory
251
+ session persistence and explicit filesystem/connection fixtures. They do not
252
+ establish HTTP authentication, real-model or installed-page acceptance. The
253
+ inspection entry and page navigation alone do not activate this Service. The
254
+ official distribution activates it through the separate authoring Loader row.
255
+
256
+ When enabled, the same Service registers `studio_customize` in the Host's tool
257
+ registry. The native conversation can discover installed pins through the
258
+ existing inspection service, copy or reopen a working copy, read its source,
259
+ prepare a diff/preview, and explicitly save authorized changes. These operations
260
+ use the same instance service, revisions, candidate digests and save guards as
261
+ the Studio page. The actual calling Agent supplies identity; tool arguments
262
+ cannot select another Agent, filesystem root or model. Preparation never saves,
263
+ and saving does not publish. No second model client or source repository is
264
+ introduced. This tool is separate from the restricted read/prepare tools given
265
+ to the page's authoring child.
266
+
267
+ Before editing, read the creator method index through `studio_customize` with
268
+ `action: "read", request: { authoring: {} }`. Read each indexed resource with
269
+ `request: { authoring: { resource, offset } }`, following every `nextOffset` until
270
+ complete. The restricted child uses the same selector in `studio_authoring_read`;
271
+ source-path reads remain separate. Both entry points receive method-reading
272
+ guidance and use one package-owned material capsule, assembled during the normal
273
+ build from the existing Bundle, Kit and Skill creator sources. The capsule is
274
+ read-only guidance, not a working copy or an additional method authority.
275
+ Unknown resources, filesystem paths, caller identities and invalid offsets are
276
+ rejected. Method pages and large component references contain at most 16 KiB of UTF-8 text.
277
+ Component references return JSON text pages; keep the selectors and follow
278
+ `nextOffset` with `components.offset` to read the complete reference; no child filesystem tool or
279
+ save capability is added. The owning service also depends on `systemPrompt` for
280
+ this native guidance. Run `test:authoring-material` for pagination and boundary
281
+ checks, and the SDK authoring tests after a normal build for both native tool paths.
282
+
283
+ For Panel composition, use the same read operation with `components: {}` to
284
+ discover the installed vocabulary. Then read `components: { name, reference }`
285
+ with the exact component name and `reference: "contract"`, `"docs"` or
286
+ `"examples"`. Follow returned contract `read` selectors, including their `type`.
287
+ This reuses Core's source-derived reference query and the same generated
288
+ `panel-components.json` as Companion, with its 256 KiB response budget. It does
289
+ not infer component parameters from names or create another DSL schema.
290
+
291
+ The parent-scoped page exposes archive export and stateless `readArchive`.
292
+ `readArchive({ source })` returns `StudioContentArchive` after format, path,
293
+ byte and digest checks. It stores no import record and does not run full
294
+ Bundle definition validation or grant executable trust. The page sends those
295
+ files through `importSources`, which preserves incomplete definitions for
296
+ ordinary editing. The old prepare/read/list/adopt archive workflow is removed.
297
+
298
+ An export accepts an exact installed Kit or Bundle request
299
+ `{ kind: 'kit' | 'bundle', pin, provenance }` or the exact saved working copy request
300
+ `{ id, expectedRevision, provenance }`. The latter derives its own Kit/Bundle pin
301
+ from S2 and exports every saved overlay, opaque resource and retained mount in
302
+ one read transaction. Stale revisions fail; installed base content is never a
303
+ substitute for the selected copy. Imports and exports retain the existing
304
+ `studio-content-archive/v1` format and validation limits. The shared UI keeps its
305
+ existing HTTP upload budget.
306
+ Installed Bundle export resolves the catalog's exact source and captures immutable
307
+ bytes through the shared archive adapter. It needs no containing Kit and creates
308
+ no working copy. The independent loader rechecks the captured Bundle identity.
309
+
310
+ `prepareChanges` preserves the S2 candidate fields and adds
311
+ `authoring: { requestId, studio: { id, expectedRevision, bundle? }, url }`.
312
+ The pin is the independent copy's actual Bundle pin, or an explicitly requested
313
+ Kit mount. The content-only URL identifies this exact receipt for the same live
314
+ parent. The Host retains at most 16 temporary receipts and 32 MiB per parent,
315
+ deduplicates identical requests, and rechecks the current source and digest on
316
+ `readPrepared`. Foreign parents, changed pins/digests, expired receipts and stale
317
+ revisions fail closed. Receipts disappear on parent/Service disposal; they are
318
+ neither persisted source nor a save authority. Reopen from the conversation to
319
+ prepare a current proposal after one expires.
320
+
321
+ The optional `dsh-design-studio-dsh/authoring-entry` entry provides a Cordis
322
+ plugin that prepares roots and mounts that existing Service. A trusted Host
323
+ may load the namespace with `ctx.plugin(StudioAuthoringEntry, config)`.
324
+ `config` accepts either or both of `stateRoot` and `workspaceRoot`. Omitted
325
+ values use the public RC2 `dshHomePath('yugoo-design-studio')` and
326
+ `dshHomePath('yugoo-design-studio-workspace')`, respectively. The Host home must
327
+ already exist as a physical canonical directory. Explicit overrides obey the
328
+ same private single-leaf preparation rules; the plugin never creates missing
329
+ ancestors or uses installed content or a Design Project as implicit storage.
330
+
331
+ The entry captures roots before asynchronous work, closes admission when its
332
+ Cordis fiber unloads, and joins both root preparation and Service cleanup.
333
+ Failed initialization preserves existing metadata and does not retry itself.
334
+ Disposing it does not dispose the parent Agent. The official distribution's
335
+ `dsh-design-studio-authoring` Loader row loads this entry; a custom Host may
336
+ activate it explicitly through the same public export. Run
337
+ `test:authoring-entry` with the same official SDK selection for private-root
338
+ and actual Cordis/Service initialization and unload checks. These checks have
339
+ no native model turn and do not accept an installed Host or Windows activation.
340
+
341
+ The optional `dsh-design-studio-dsh/authoring-workbench` entry exports
342
+ `StudioAuthoringWorkbench({ client, id, locale, onBack, onChanged,
343
+ onDirtyChange?, presentation?, preparedLocator? })`. Supply a stable parent-scoped authoring client and the
344
+ existing shared Studio shell: `.ygd-studio-workspace`, `STUDIO_WORKSPACE_CSS`
345
+ and `.ygd-studio-body`. The component reuses the shared instance editor,
346
+ candidate review and read-only `PanelSamplePreview`. Studio is an independent
347
+ tab/browser workspace. Its default `presentation: 'full'` keeps the authoring
348
+ conversation beside the working-copy content during Kit/Bundle creation or
349
+ editing. An exact `preparedLocator` from a Host proposal opens the
350
+ corresponding candidate inline in the existing working-copy Files view once its
351
+ parent, source, pin and digest are checked. It requires no second review-selection
352
+ click. The same `InstanceWorkbench` and complete file tree remain mounted.
353
+ Review opens a changed file inline; a verified save keeps that file selected. Revert dismisses unsaved suggestions
354
+ without writing; a contextual action can reopen them. Only explicit Save writes
355
+ through the existing S2 client.
356
+ A candidate URL enters the same complete editor and carries
357
+ `studioTarget`, `studioRequest` and `studioDigest` alongside its parent locator;
358
+ the Host validates them again. A Kit target without an explicit Bundle opens
359
+ its source without selecting the first mount.
360
+
361
+ New blank Bundle working copies can request native source authoring while their
362
+ definition is unfinished, including after a draft save and reopen. The exact
363
+ source revision, Bundle pin and editable paths still bind the request. Candidates
364
+ follow ordinary Core preview validation and explicit save rules; unfinished
365
+ candidates remain ineligible for a validated save. Other Bundle copies keep the
366
+ current-preview preflight.
367
+
368
+ The left conversation and the same right-side working
369
+ copy stay mounted while source changes appear inline. Kit source candidates use
370
+ the source view; Bundle content can open on its Panel preview, with source editing
371
+ available through the same editor. The left side retains
372
+ submitted intents, public native replies, tool actions and their observed outcomes,
373
+ candidate/save feedback and unsent input during review and return. Companion and
374
+ Studio reuse the same message and collapsible activity components. Observation
375
+ reads the exact native request epoch, excludes private thinking and replacement
376
+ compaction messages, and returns at most the latest 200 rows with an omission count.
377
+ This is a bounded projection, not a second durable history store. It uses
378
+ the existing parent-scoped native port without adding another model client.
379
+ The original Host may prepare a proposal before opening Studio, or guide the user
380
+ to open it first. Both paths keep the same copy, editor, inline changes and
381
+ explicit save controls; later requests do not require a separate review page.
382
+ An explicit `presentation: 'content-only'` remains a compatibility input, not the
383
+ default or a new embedded-Host workflow.
384
+ It accepts Kit and independent declarative Bundle copies, including incomplete
385
+ source without a valid Panel preview. The initial read selects up to 64 editable
386
+ text files; further reads and changes use the existing per-call limits. Kit-owned
387
+ source can validate independently of a Panel selection. An explicitly supplied preview Bundle must match an exact mount;
388
+ mount declarations retain their existing management/save guards. Dirty source
389
+ stays mounted and blocks dispatch/review;
390
+ a current owned candidate appears inline automatically only when the working
391
+ copy is clean and its exact base revision still matches. It needs no first
392
+ review-selection click. Revert restores manual editing, and the same candidate
393
+ does not reopen automatically on the next poll; a new request or candidate may
394
+ open once through the same guards. Explicit save retains the shared
395
+ revision/digest check. An uncertain save permits read-only Refresh without
396
+ claiming a verified save or retrying the write. Native execution, candidate availability
397
+ and saved source have separate feedback. An unknown response permits read-only
398
+ checking; a connection change retains input and requires explicit reopening.
399
+ Historical run controls are not restored by reopening. Run
400
+ `test:authoring-workbench` for React/shared-Panel and temporary S2 checks with
401
+ explicit native RPC fixtures. This component does not activate the Service or
402
+ create a native parent. The scoped page composes it inside the same shared
403
+ workspace; native model and installed-page checks remain separate.
404
+
405
+ The native client does not add a Studio link to the conversation header.
406
+ Settings remains the catalog entry; a host request to create or edit a Kit or
407
+ Bundle can return a scoped link to the independent editor. In Web it opens at
408
+ `/design-studio/?agentId=<encoded-session-id>&presentation=full`. Editing there
409
+ keeps the request conversation on the left and the same copy's source, diff and
410
+ Panel on the right; a current candidate appears in that editor without requiring
411
+ another review page. Host-prepared candidate links also enter this complete
412
+ editor with their exact revision and digest. Official Desktop retains its
413
+ compatible same-window navigation while opening the same full presentation;
414
+ this does not implement embedding Studio in the Host conversation. The SessionId
415
+ is a locator for the Gateway's actual Agent
416
+ lookup, not an authorization grant.
417
+ The page captures one locator on opening and rejects duplicates or malformed
418
+ values. Without it, the page keeps session-free inspection. Page unmounting
419
+ only releases local UI reads; it does not cancel or dispose Host-owned work.
420
+ Run `test:page-authoring` for the shared reading-to-review/save path and the
421
+ normal `test` script for built module registration and routes. These checks do
422
+ not prove a real desktop return trip or installed authoring service.
423
+
424
+ The inspection Remote exposes exactly six read methods: `workspace`, `readKitWorkspace` (exact `name@version` pin required; a diverging response identity diagnoses), `readKitFiles` and `readKitFile` (the same exact Kit pin), `readBundleWorkspace`, and `readBundleFile`. Kit file inspection includes `kit.yaml`, `mindset.md` and other authored files beneath the selected Kit root, excluding `.git` and `node_modules`; the text viewer accepts regular UTF-8 files up to 1 MiB, with bounded tree traversal. Missing sources, forbidden paths, binary content and oversized files diagnose rather than falling back to another version. The catalog snapshot projects `ctx.design.listKits()`. Bundle source reads run through `ctx.fs`: the `kitSources` config lists installed content packages (`packageName`, resolved like the Design Core kit-loader) or absolute directories (`root`); every path resolves through the filesystem capability and must stay canonically contained in a configured root, so traversal and symlink escapes never read outside the authored trees and non-UTF-8 content diagnoses as binary. Invalid or ambiguous configuration — a missing root, a root without `mindset.md`, a relative path, a duplicate root, or one Kit/Bundle name declared by two roots — fails loud at startup. Without `kitSources` the catalog stays readable and Bundle reads diagnose `studio.source_not_configured`. Disposal rejects new work and drains admitted calls.
425
+
426
+ The native `studio_customize` tool's `catalog` result also includes `currentKits`,
427
+ using Core's current Kit choices from installed and saved local sources. Its
428
+ `kits`/`bundles` fields remain installed-source inspection; a local import need
429
+ not appear there. Discovery does not replace a selected project's own sources.
13
430
 
14
431
  Strict codecs follow the current Typert `create(): TypertSchema` factory contract.
15
432
  The existing Zod validators supply that parser capability; both Host registration
@@ -19,7 +436,22 @@ invalid types and strict result validation retain their original constraints.
19
436
 
20
437
  The Settings surface presents the read-only Studio's scope and opens the plugin-owned same-origin route `/design-studio/`. HTTP(S) Web uses a separate `target="_blank" rel="noopener noreferrer"` page and retains the conversation tab. On the official Desktop application's exact `dsh-app://app` authority, the launcher navigates in the current window: Desktop rejects new windows on its application protocol. The Desktop Studio page adds a compact **Back to conversation / 返回对话** link to the same-origin application root `/`, without changing the shared `StudioWorkspace`. It never consumes a `returnTo` parameter, referrer, private boot API, backend port, or copied credentials. The host owns conversation and Panel restoration when its application reloads; source and adapter tests do not establish that native round trip.
21
438
 
22
- G/R/A loops publish independently and therefore expose no atomic-set size preference here. The route is registered through the public `webServer.register` seam (exact slash-less redirect plus prefix) and withdrawn on disposal. It serves one HTML shell and one self-contained page bundle. That bundle calls only the session-free `studioManagement` read methods through a narrow same-origin `/api` adapter; on Desktop, requests remain on `dsh-app://app` even when the custom scheme reports an opaque (`null`) origin, using the host's existing protocol proxy. It does not start the DSH SPA module loader, client plugin runtime, connection registry, commands, or goals. The adapter validates the gateway response and the generated Typert result before rendering the unchanged shared `StudioWorkspace`. Page disposal only unmounts the rendered root. A future Codex or Claude Code companion server serves the same page bundle and implements the same JSON read methods rather than introducing another Studio format.
439
+ G/R/A loops publish independently and therefore expose no atomic-set size
440
+ preference here. The route uses the public `webServer.register` seam: the
441
+ slash-less redirect preserves the query, and the prefix serves one HTML shell
442
+ and one self-contained page bundle. Packaged CSS assets have a separate owned
443
+ prefix backed by their verified manifest. Registration rolls back on failure;
444
+ disposal withdraws all owned routes.
445
+
446
+ The page uses the existing same-origin `/api` carrier for `studioManagement`
447
+ inspection and, with an explicit locator, `studioAuthoring` operations. On
448
+ Desktop, requests remain on `dsh-app://app` even when that custom scheme reports
449
+ an opaque (`null`) origin, using the Host's existing protocol proxy. The page
450
+ does not boot the DSH SPA module loader, client plugin runtime, connection
451
+ registry, commands or goals. The carrier and strict Typert codecs validate
452
+ requests and replies before the shared workspace consumes them. A future
453
+ Codex or Claude Code companion server can serve this shared page and implement
454
+ the same JSON contracts without introducing another Studio format.
23
455
 
24
456
  The standalone page bundles its React runtime and fails the build on unresolved
25
457
  dependencies or remaining static/dynamic module imports. Its page-route test also
@@ -32,6 +464,9 @@ Only the standalone browser page injects `PanelSelect` and
32
464
  Studio's optional neutral choice-control port. This is a shared control and popup
33
465
  style, not the broad provider API or Panel/DSL workspace renderer. The server,
34
466
  Settings launcher and transports retain their existing dependency boundary.
467
+ The authoring workbench separately consumes the public
468
+ `dsh-design-panel/sample-preview` entry for a read-only sample of the selected
469
+ Bundle; it does not import Panel source or activate a native provider.
35
470
  The menu snapshots Studio's semantic
36
471
  tokens and fonts; inside an open native dialog it stays within that dialog's top
37
472
  layer, otherwise it uses the owning document body. These source changes do not