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

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 +427 -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-Ci08ifdJ.js +634 -0
  5. package/lib/authoring-agent.d.ts +24 -0
  6. package/lib/authoring-agent.js +2 -0
  7. package/lib/authoring-agent.types-QLa61eE6.d.ts +88 -0
  8. package/lib/authoring-entry.d.ts +20 -0
  9. package/lib/authoring-entry.js +77 -0
  10. package/lib/authoring-host-BlsA6wXz.js +347 -0
  11. package/lib/authoring-host.d.ts +5 -0
  12. package/lib/authoring-host.js +2 -0
  13. package/lib/authoring-host.types-d5UT0WEk.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-qGEk-IE_.js +342 -0
  17. package/lib/authoring-service.d.ts +112 -0
  18. package/lib/authoring-service.js +2 -0
  19. package/lib/authoring-session.d.ts +5 -0
  20. package/lib/authoring-session.js +203 -0
  21. package/lib/authoring-session.types-MHEaEFkO.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 +85 -0
  25. package/lib/authoring-workbench.d.ts +15 -0
  26. package/lib/authoring-workbench.js +782 -0
  27. package/lib/authoring.page-rpc-Bg6VAT0Z.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-BgD1mpCC.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-Bj5jO20L.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-DiazVY00.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,415 @@ 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. Bundle
94
+ source uses its exact pin; Kit-owned source can omit a preview Bundle, while a supplied preview pin must match an explicit mount. The
95
+ factory retains the native address before dispatch and returns a typed
96
+ `{ request, candidate }` for the shared review UI. Saving remains an explicit
97
+ call to the existing instance service, using its candidate digest and revision.
98
+ Cold references permit observation; cancellation requires an exact owned run.
99
+
100
+ Kit candidates without a preview Bundle use the shared Core definition validator
101
+ and carry no Panel preview. Their explicit validated save rechecks the same exact
102
+ source and mount closure, returning `definition_passed` through the strict Remote
103
+ codec. Bundles with omitted presentation or `presentation.mode: none` likewise
104
+ receive `definition_passed` after Core definition validation, without a Panel.
105
+ Declarative Bundle candidates and explicit Kit previews retain `preview_passed`
106
+ and their real Panel/sample checks. Empty-mount or otherwise invalid Kit definitions
107
+ cannot receive a validated receipt; an explicit draft save can preserve unfinished
108
+ source. Neither receipt proves native turn completion or publication.
109
+
110
+ With the same official SDK archive selection, run `test:authoring-session` for
111
+ the bridge's scripted native execution and real temporary instance storage
112
+ checks. These exercise two explicit revisions, user save and fresh service
113
+ reopen, alongside conflict, parent identity, cancellation and disposal guards.
114
+ They do not establish real-model, browser or installed-host acceptance.
115
+
116
+ The optional `dsh-design-studio-dsh/authoring-reference-store` entry exports
117
+ `createStudioAuthoringReferenceStore({ stateRoot })`. Choose an explicit private
118
+ host directory outside installed content and Design Projects. The store owns
119
+ only its reference subdirectory and retains exact native addresses and source
120
+ scope, with explicit-parent `read` and bounded `list` methods. Its `retain`
121
+ function can supply the session factory's `retainReference` callback. It stores
122
+ no execution status, candidate or design content; native observation and shared
123
+ Studio working copies keep those responsibilities.
124
+
125
+ This entry also exports `prepareStudioAuthoringDirectory(path)` for an owning
126
+ Host to prepare a private storage or workspace leaf. It requires an absolute
127
+ canonical path with existing physical ancestors, creates only that leaf and
128
+ verifies platform-appropriate access and identity without repairing permissions.
129
+ On POSIX it syncs the leaf and parent before returning; Windows checks their
130
+ physical identities and retains inherited access. Failure can leave a valid
131
+ empty leaf for an explicit later attempt. It creates no reference namespace or
132
+ native session.
133
+
134
+ The reference store verifies physical paths and file identity on both platforms,
135
+ with POSIX ownership and directory-sync checks where supported. Files that
136
+ require sync use a writable handle on Windows; observation remains read-only.
137
+ These checks do not establish a power-loss guarantee or make directory flushing
138
+ a prerequisite for ordinary working-copy saves. A failed
139
+ retention can leave an already published address, so callers must reconcile it
140
+ rather than infer absence or resend. A cold reference supports observation; it
141
+ does not restore S4's owned cancellation handle or prepared-candidate projection.
142
+ Run `test:authoring-reference-store` for temporary-filesystem fault and reopening
143
+ checks. These checks do not simulate power loss or establish actual Host restart
144
+ recovery. The session-free inspection service does not use this store.
145
+
146
+ The optional `dsh-design-studio-dsh/authoring-sources` entry exports
147
+ `createDshStudioInstanceAdapters({ design, fs })`. A trusted Host supplies its
148
+ existing Core registry and public DSH filesystem service. The factory resolves
149
+ independent Bundles by exact pin and retains their registered `sourceId`; Kits
150
+ use the exact Kit resolver, including retained older versions. Missing sources
151
+ or mismatched pins diagnose instead of selecting a newer version.
152
+
153
+ Source capture preserves binary assets, original text bytes, methods and notices
154
+ through bounded `fs.readBytes` reads, excluding `.git` and `node_modules`.
155
+ Containment stays with the public filesystem service. Known listing, stat and
156
+ byte-length disagreements reject the capture; these checks do not provide an
157
+ atomic snapshot of the whole installed tree. The returned catalog and composition
158
+ ports feed the existing shared Studio instance service, which owns compilation,
159
+ snapshots and saves. The caller chooses its private storage separately.
160
+
161
+ Kit mount choices preserve the shared optional `description` and bilingual
162
+ `displayDescription` through the strict instance codec. Both come from the same
163
+ installed or retained Bundle source projection; older choices may omit them.
164
+ The codec still rejects unexpected fields and malformed translated copy. Choice
165
+ labels and descriptions do not enter mount requests: those retain their existing
166
+ exact pin and revision checks.
167
+
168
+ The shared catalog still compiles every independent Bundle when listing choices.
169
+ Consequently, Kit working-copy copy/read can fail on an unrelated broken
170
+ independent source, even when exact capture of that Kit succeeds. This adapter
171
+ preserves that shared policy. Page navigation does not activate a Host through
172
+ this entry. Run `test:authoring-sources` for the explicit
173
+ filesystem-port fixtures with real Core compilation and temporary Studio
174
+ copy/reopen checks; actual DSH filesystem, native model and installed-host
175
+ integration require separate checks.
176
+
177
+ The optional `dsh-design-studio-dsh/authoring-remote` entry exports
178
+ `createSameOriginStudioAuthoringClient({ agentId, fetch? })`. It supplies the shared
179
+ instance client and asynchronous native start, resume, observation, cancellation,
180
+ prepared-candidate and retained-reference calls over the existing same-origin
181
+ Studio transport. The explicit SessionId is a locator for the Host's actual
182
+ native Agent lookup. Native operations accept only `{ sessionId, epoch }`
183
+ addresses; the enabled Host service must resolve their retained canonical scope.
184
+ Unknown fields and malformed results reject, and failed requests are never
185
+ automatically resent. Source preparation and native completion never save files.
186
+
187
+ These strict descriptors and transport primitives do not register or activate an
188
+ authoring service. Run `test:authoring-rpc`
189
+ for JSON/request correlation, parent locators and real temporary instance
190
+ copy/candidate/save/reopen through the transport fixture. Fixture HTTP replies and
191
+ native references do not establish real Gateway lookup, Host authorization or
192
+ installed-page acceptance.
193
+
194
+ The optional `dsh-design-studio-dsh/authoring-host` entry exports
195
+ `createDshStudioAuthoringHost({ ctx, design, fs, stateRoot, workspaceRoot,
196
+ readComponents })`. It composes the existing source adapters, one shared
197
+ instance service, private reference store and native session factory. The owning
198
+ Cordis service declares `agents`, `sessions` and `sessionQuery` dependencies
199
+ alongside `design` and `fs`, supplies explicit private storage and an isolated
200
+ workspace, and reads the actual installed component catalog.
201
+
202
+ `forParent(actualAgent)` binds the exact live native object and returns guarded
203
+ instance operations, retained-reference reads and native authoring methods.
204
+ Kit-owned source authoring does not require a mounted Bundle. The selected paths
205
+ must exist as editable files in that exact Kit working copy; a supplied preview
206
+ pin must still match one of its mounts. Native Panel preview remains conditional
207
+ on that explicit Bundle pin.
208
+ The same object reuses its facade; a same-ID replacement can observe retained
209
+ addresses but cannot inherit old cancellation or prepared-candidate handles.
210
+ Instance records remain shared Host data. Only the existing explicit instance
211
+ save changes source. Disposing the Host or parent facade closes admission,
212
+ releases native work and joins admitted I/O; an already committed save can still
213
+ need reopening after a disconnected response. Page/request teardown must not
214
+ dispose this Host-owned facade.
215
+
216
+ The owning service tracks initialization before awaiting it and joins its
217
+ settlement during unload. A rejected creation can leave valid private metadata;
218
+ it does not make a usable native session available. Run `test:authoring-host`
219
+ with the same official SDK selection for composition, failure and lifecycle
220
+ checks using scripted native execution and actual temporary source/reference
221
+ storage. Fresh service reopening in these checks is distinct from a real Host
222
+ restart. This entry does not register an authoring Remote or change the page.
223
+
224
+ The optional `dsh-design-studio-dsh/authoring-service` entry exports
225
+ `DshStudioAuthoringService`. A trusted Host explicitly activates it with
226
+ `ctx.plugin(DshStudioAuthoringService, { stateRoot, workspaceRoot })`, supplying
227
+ private canonical storage and an isolated workspace. Its public dependencies are
228
+ `design`, `fs`, `agents`, `sessions`, `sessionQuery` and `tools`. The package's existing
229
+ `./typert` contribution declares both the six inspection operations and the 22
230
+ agent-scoped `studioAuthoring` operations; register that contribution once.
231
+ The Service forwards them to the composed Host and projects the shared Core
232
+ component vocabulary. The Gateway resolves each SessionId locator to the actual
233
+ Agent before invoking the Service. A browser-supplied reference cannot replace
234
+ the Host's retained canonical scope.
235
+
236
+ The Service registers shutdown before asynchronous initialization, joins the raw
237
+ factory promise on unload, and closes native admission before draining calls.
238
+ It validates and snapshots request data before queued admission, so later caller
239
+ mutations cannot rewrite a submitted save or native request.
240
+ Start and resume return retained addresses without waiting for native completion;
241
+ prepared candidates still require the existing explicit review and save. Page or
242
+ request teardown does not dispose the Service. Run `test:authoring-service` with
243
+ that official SDK selection for real Gateway lookup, Service lifecycle and
244
+ native prepare/explicit-save/reopen checks. These use a scripted model, memory
245
+ session persistence and explicit filesystem/connection fixtures. They do not
246
+ establish HTTP authentication, real-model or installed-page acceptance. The
247
+ inspection entry and page navigation alone do not activate this Service. The
248
+ official distribution activates it through the separate authoring Loader row.
249
+
250
+ When enabled, the same Service registers `studio_customize` in the Host's tool
251
+ registry. The native conversation can discover installed pins through the
252
+ existing inspection service, copy or reopen a working copy, read its source,
253
+ prepare a diff/preview, and explicitly save authorized changes. These operations
254
+ use the same instance service, revisions, candidate digests and save guards as
255
+ the Studio page. The actual calling Agent supplies identity; tool arguments
256
+ cannot select another Agent, filesystem root or model. Preparation never saves,
257
+ and saving does not publish. No second model client or source repository is
258
+ introduced. This tool is separate from the restricted read/prepare tools given
259
+ to the page's authoring child.
260
+
261
+ Before editing, read the creator method index through `studio_customize` with
262
+ `action: "read", request: { authoring: {} }`. Read each indexed resource with
263
+ `request: { authoring: { resource, offset } }`, following every `nextOffset` until
264
+ complete. The restricted child uses the same selector in `studio_authoring_read`;
265
+ source-path reads remain separate. Both entry points receive method-reading
266
+ guidance and use one package-owned material capsule, assembled during the normal
267
+ build from the existing Bundle, Kit and Skill creator sources. The capsule is
268
+ read-only guidance, not a working copy or an additional method authority.
269
+ Unknown resources, filesystem paths, caller identities and invalid offsets are
270
+ rejected. Method pages and large component references contain at most 16 KiB of UTF-8 text.
271
+ Component references return JSON text pages; keep the selectors and follow
272
+ `nextOffset` with `components.offset` to read the complete reference; no child filesystem tool or
273
+ save capability is added. The owning service also depends on `systemPrompt` for
274
+ this native guidance. Run `test:authoring-material` for pagination and boundary
275
+ checks, and the SDK authoring tests after a normal build for both native tool paths.
276
+
277
+ For Panel composition, use the same read operation with `components: {}` to
278
+ discover the installed vocabulary. Then read `components: { name, reference }`
279
+ with the exact component name and `reference: "contract"`, `"docs"` or
280
+ `"examples"`. Follow returned contract `read` selectors, including their `type`.
281
+ This reuses Core's source-derived reference query and the same generated
282
+ `panel-components.json` as Companion, with its 256 KiB response budget. It does
283
+ not infer component parameters from names or create another DSL schema.
284
+
285
+ The parent-scoped page exposes archive export and stateless `readArchive`.
286
+ `readArchive({ source })` returns `StudioContentArchive` after format, path,
287
+ byte and digest checks. It stores no import record and does not run full
288
+ Bundle definition validation or grant executable trust. The page sends those
289
+ files through `importSources`, which preserves incomplete definitions for
290
+ ordinary editing. The old prepare/read/list/adopt archive workflow is removed.
291
+
292
+ An export accepts an exact installed Kit or Bundle request
293
+ `{ kind: 'kit' | 'bundle', pin, provenance }` or the exact saved working copy request
294
+ `{ id, expectedRevision, provenance }`. The latter derives its own Kit/Bundle pin
295
+ from S2 and exports every saved overlay, opaque resource and retained mount in
296
+ one read transaction. Stale revisions fail; installed base content is never a
297
+ substitute for the selected copy. Imports and exports retain the existing
298
+ `studio-content-archive/v1` format and validation limits. The shared UI keeps its
299
+ existing HTTP upload budget.
300
+ Installed Bundle export resolves the catalog's exact source and captures immutable
301
+ bytes through the shared archive adapter. It needs no containing Kit and creates
302
+ no working copy. The independent loader rechecks the captured Bundle identity.
303
+
304
+ `prepareChanges` preserves the S2 candidate fields and adds
305
+ `authoring: { requestId, studio: { id, expectedRevision, bundle? }, url }`.
306
+ The pin is the independent copy's actual Bundle pin, or an explicitly requested
307
+ Kit mount. The content-only URL identifies this exact receipt for the same live
308
+ parent. The Host retains at most 16 temporary receipts and 32 MiB per parent,
309
+ deduplicates identical requests, and rechecks the current source and digest on
310
+ `readPrepared`. Foreign parents, changed pins/digests, expired receipts and stale
311
+ revisions fail closed. Receipts disappear on parent/Service disposal; they are
312
+ neither persisted source nor a save authority. Reopen from the conversation to
313
+ prepare a current proposal after one expires.
314
+
315
+ The optional `dsh-design-studio-dsh/authoring-entry` entry provides a Cordis
316
+ plugin that prepares roots and mounts that existing Service. A trusted Host
317
+ may load the namespace with `ctx.plugin(StudioAuthoringEntry, config)`.
318
+ `config` accepts either or both of `stateRoot` and `workspaceRoot`. Omitted
319
+ values use the public RC2 `dshHomePath('yugoo-design-studio')` and
320
+ `dshHomePath('yugoo-design-studio-workspace')`, respectively. The Host home must
321
+ already exist as a physical canonical directory. Explicit overrides obey the
322
+ same private single-leaf preparation rules; the plugin never creates missing
323
+ ancestors or uses installed content or a Design Project as implicit storage.
324
+
325
+ The entry captures roots before asynchronous work, closes admission when its
326
+ Cordis fiber unloads, and joins both root preparation and Service cleanup.
327
+ Failed initialization preserves existing metadata and does not retry itself.
328
+ Disposing it does not dispose the parent Agent. The official distribution's
329
+ `dsh-design-studio-authoring` Loader row loads this entry; a custom Host may
330
+ activate it explicitly through the same public export. Run
331
+ `test:authoring-entry` with the same official SDK selection for private-root
332
+ and actual Cordis/Service initialization and unload checks. These checks have
333
+ no native model turn and do not accept an installed Host or Windows activation.
334
+
335
+ The optional `dsh-design-studio-dsh/authoring-workbench` entry exports
336
+ `StudioAuthoringWorkbench({ client, id, locale, onBack, onChanged,
337
+ onDirtyChange?, presentation?, preparedLocator? })`. Supply a stable parent-scoped authoring client and the
338
+ existing shared Studio shell: `.ygd-studio-workspace`, `STUDIO_WORKSPACE_CSS`
339
+ and `.ygd-studio-body`. The component reuses the shared instance editor,
340
+ candidate review and read-only `PanelSamplePreview`. Studio is an independent
341
+ tab/browser workspace. Its default `presentation: 'full'` keeps the authoring
342
+ conversation beside the working-copy content during Kit/Bundle creation or
343
+ editing. An exact `preparedLocator` from a Host proposal opens the
344
+ corresponding candidate inline in the existing working-copy Files view once its
345
+ parent, source, pin and digest are checked. It requires no second review-selection
346
+ click. The same `InstanceWorkbench` and complete file tree remain mounted.
347
+ Review opens a changed file inline; a verified save keeps that file selected. Revert dismisses unsaved suggestions
348
+ without writing; a contextual action can reopen them. Only explicit Save writes
349
+ through the existing S2 client.
350
+ A candidate URL enters the same complete editor and carries
351
+ `studioTarget`, `studioRequest` and `studioDigest` alongside its parent locator;
352
+ the Host validates them again. A Kit target without an explicit Bundle opens
353
+ its source without selecting the first mount.
354
+
355
+ New blank Bundle working copies can request native source authoring while their
356
+ definition is unfinished, including after a draft save and reopen. The exact
357
+ source revision, Bundle pin and editable paths still bind the request. Candidates
358
+ follow ordinary Core preview validation and explicit save rules; unfinished
359
+ candidates remain ineligible for a validated save. Other Bundle copies keep the
360
+ current-preview preflight.
361
+
362
+ The left conversation and the same right-side working
363
+ copy stay mounted while source changes appear inline. Kit source candidates use
364
+ the source view; Bundle content can open on its Panel preview, with source editing
365
+ available through the same editor. The left side retains
366
+ submitted intents, public native replies, tool actions and their observed outcomes,
367
+ candidate/save feedback and unsent input during review and return. Companion and
368
+ Studio reuse the same message and collapsible activity components. Observation
369
+ reads the exact native request epoch, excludes private thinking and replacement
370
+ compaction messages, and returns at most the latest 200 rows with an omission count.
371
+ This is a bounded projection, not a second durable history store. It uses
372
+ the existing parent-scoped native port without adding another model client.
373
+ The original Host may prepare a proposal before opening Studio, or guide the user
374
+ to open it first. Both paths keep the same copy, editor, inline changes and
375
+ explicit save controls; later requests do not require a separate review page.
376
+ An explicit `presentation: 'content-only'` remains a compatibility input, not the
377
+ default or a new embedded-Host workflow.
378
+ It accepts Kit and independent declarative Bundle copies, including incomplete
379
+ source without a valid Panel preview. The initial read selects up to 64 editable
380
+ text files; further reads and changes use the existing per-call limits. Kit-owned
381
+ source can validate independently of a Panel selection. An explicitly supplied preview Bundle must match an exact mount;
382
+ mount declarations retain their existing management/save guards. Dirty source
383
+ stays mounted and blocks dispatch/review;
384
+ a current owned candidate appears inline automatically only when the working
385
+ copy is clean and its exact base revision still matches. It needs no first
386
+ review-selection click. Revert restores manual editing, and the same candidate
387
+ does not reopen automatically on the next poll; a new request or candidate may
388
+ open once through the same guards. Explicit save retains the shared
389
+ revision/digest check. An uncertain save permits read-only Refresh without
390
+ claiming a verified save or retrying the write. Native execution, candidate availability
391
+ and saved source have separate feedback. An unknown response permits read-only
392
+ checking; a connection change retains input and requires explicit reopening.
393
+ Historical run controls are not restored by reopening. Run
394
+ `test:authoring-workbench` for React/shared-Panel and temporary S2 checks with
395
+ explicit native RPC fixtures. This component does not activate the Service or
396
+ create a native parent. The scoped page composes it inside the same shared
397
+ workspace; native model and installed-page checks remain separate.
398
+
399
+ The native client does not add a Studio link to the conversation header.
400
+ Settings remains the catalog entry; a host request to create or edit a Kit or
401
+ Bundle can return a scoped link to the independent editor. In Web it opens at
402
+ `/design-studio/?agentId=<encoded-session-id>&presentation=full`. Editing there
403
+ keeps the request conversation on the left and the same copy's source, diff and
404
+ Panel on the right; a current candidate appears in that editor without requiring
405
+ another review page. Host-prepared candidate links also enter this complete
406
+ editor with their exact revision and digest. Official Desktop retains its
407
+ compatible same-window navigation while opening the same full presentation;
408
+ this does not implement embedding Studio in the Host conversation. The SessionId
409
+ is a locator for the Gateway's actual Agent
410
+ lookup, not an authorization grant.
411
+ The page captures one locator on opening and rejects duplicates or malformed
412
+ values. Without it, the page keeps session-free inspection. Page unmounting
413
+ only releases local UI reads; it does not cancel or dispose Host-owned work.
414
+ Run `test:page-authoring` for the shared reading-to-review/save path and the
415
+ normal `test` script for built module registration and routes. These checks do
416
+ not prove a real desktop return trip or installed authoring service.
417
+
418
+ 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.
13
419
 
14
420
  Strict codecs follow the current Typert `create(): TypertSchema` factory contract.
15
421
  The existing Zod validators supply that parser capability; both Host registration
@@ -19,7 +425,22 @@ invalid types and strict result validation retain their original constraints.
19
425
 
20
426
  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
427
 
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.
428
+ G/R/A loops publish independently and therefore expose no atomic-set size
429
+ preference here. The route uses the public `webServer.register` seam: the
430
+ slash-less redirect preserves the query, and the prefix serves one HTML shell
431
+ and one self-contained page bundle. Packaged CSS assets have a separate owned
432
+ prefix backed by their verified manifest. Registration rolls back on failure;
433
+ disposal withdraws all owned routes.
434
+
435
+ The page uses the existing same-origin `/api` carrier for `studioManagement`
436
+ inspection and, with an explicit locator, `studioAuthoring` operations. On
437
+ Desktop, requests remain on `dsh-app://app` even when that custom scheme reports
438
+ an opaque (`null`) origin, using the Host's existing protocol proxy. The page
439
+ does not boot the DSH SPA module loader, client plugin runtime, connection
440
+ registry, commands or goals. The carrier and strict Typert codecs validate
441
+ requests and replies before the shared workspace consumes them. A future
442
+ Codex or Claude Code companion server can serve this shared page and implement
443
+ the same JSON contracts without introducing another Studio format.
23
444
 
24
445
  The standalone page bundles its React runtime and fails the build on unresolved
25
446
  dependencies or remaining static/dynamic module imports. Its page-route test also
@@ -32,6 +453,9 @@ Only the standalone browser page injects `PanelSelect` and
32
453
  Studio's optional neutral choice-control port. This is a shared control and popup
33
454
  style, not the broad provider API or Panel/DSL workspace renderer. The server,
34
455
  Settings launcher and transports retain their existing dependency boundary.
456
+ The authoring workbench separately consumes the public
457
+ `dsh-design-panel/sample-preview` entry for a read-only sample of the selected
458
+ Bundle; it does not import Panel source or activate a native provider.
35
459
  The menu snapshots Studio's semantic
36
460
  tokens and fonts; inside an open native dialog it stays within that dialog's top
37
461
  layer, otherwise it uses the owning document body. These source changes do not