@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.
- package/README.md +438 -3
- package/lib/authoring/panel-components.json +10790 -0
- package/lib/authoring/studio-creators/material.json +1 -0
- package/lib/authoring-agent-vc786tS0.js +648 -0
- package/lib/authoring-agent.d.ts +24 -0
- package/lib/authoring-agent.js +2 -0
- package/lib/authoring-agent.types-0S0xnlDW.d.ts +87 -0
- package/lib/authoring-entry.d.ts +20 -0
- package/lib/authoring-entry.js +77 -0
- package/lib/authoring-host-m8-GmXIx.js +348 -0
- package/lib/authoring-host.d.ts +5 -0
- package/lib/authoring-host.js +2 -0
- package/lib/authoring-host.types-BZt9l0xK.d.ts +77 -0
- package/lib/authoring-reference-store.d.ts +39 -0
- package/lib/authoring-reference-store.js +385 -0
- package/lib/authoring-service-WClXJGik.js +347 -0
- package/lib/authoring-service.d.ts +121 -0
- package/lib/authoring-service.js +2 -0
- package/lib/authoring-session.d.ts +5 -0
- package/lib/authoring-session.js +204 -0
- package/lib/authoring-session.types-C6HosIWU.d.ts +58 -0
- package/lib/authoring-sources-BzRuEuub.d.ts +17 -0
- package/lib/authoring-sources.d.ts +2 -0
- package/lib/authoring-sources.js +95 -0
- package/lib/authoring-workbench.d.ts +15 -0
- package/lib/authoring-workbench.js +782 -0
- package/lib/authoring.page-rpc-CYYWsmxc.d.ts +30 -0
- package/lib/authoring.page-rpc.d.ts +2 -0
- package/lib/authoring.page-rpc.js +55 -0
- package/lib/authoring.remote-client.d.ts +2557 -0
- package/lib/authoring.remote-client.js +435 -0
- package/lib/client-adapter-BmIzQcMT.d.ts +65 -0
- package/lib/client-adapter.d.ts +2 -64
- package/lib/client.js +1 -2
- package/lib/css-assets/dsh-design-studio-page/9178281a0695f79ff8bff8eca529231b67f896dc1c12c8dbaaad24b32dd3fc07.eot +0 -0
- package/lib/css-assets/dsh-design-studio-page/b366faf39f6bcc48f10b10f2860e5ebe57091cb2a15beeed8a0977e24560bbba.svg +224 -0
- package/lib/css-assets/dsh-design-studio-page/manifest.json +20 -0
- package/lib/index.js +4 -105
- package/lib/kit-files-DKBlBOG8.js +159 -0
- package/lib/page-client.js +4 -23849
- package/lib/page-path-BkPiqrUH.d.ts +25 -0
- package/lib/page-path.d.ts +2 -2
- package/lib/page-path.js +70 -2
- package/lib/page-rpc-DXbf4seT.d.ts +24 -0
- package/lib/page-rpc.d.ts +2 -15
- package/lib/page-rpc.js +9 -4
- package/lib/page.d.ts +5 -3
- package/lib/page.js +219 -2
- package/lib/remote-method-ab_lHwWN.js +16 -0
- package/lib/typert.host.d.ts +827 -2
- package/lib/typert.host.js +2 -1
- package/lib/typert.remote-client-CWz-anTr.d.ts +37 -0
- package/lib/typert.remote-client.d.ts +1 -36
- package/licenses/dsh-distribution.json +8644 -149
- package/package.json +73 -10
- package/lib/page-path-wn8e_fid.d.ts +0 -14
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { t as markStudioRemote } from "./remote-method-ab_lHwWN.js";
|
|
2
|
+
import { i as readStudioPanelComponents, n as STUDIO_AUTHORING_METHOD_GUIDANCE, r as readStudioAuthoringMaterial } from "./authoring-agent-vc786tS0.js";
|
|
3
|
+
import { STUDIO_AUTHORING_RPC_SCHEMAS } from "./authoring.remote-client.js";
|
|
4
|
+
import { studioPreparedUrl } from "./page-path.js";
|
|
5
|
+
import { t as createDshStudioAuthoringHost } from "./authoring-host-m8-GmXIx.js";
|
|
6
|
+
import { Service } from "@deepseek-ai/cordis";
|
|
7
|
+
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
8
|
+
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
9
|
+
import { PANEL_COMPONENT_CATALOG } from "@yugoo-design/dsh-design-core/dsl";
|
|
10
|
+
//#region src/authoring-tools.ts
|
|
11
|
+
const actions = [
|
|
12
|
+
"catalog",
|
|
13
|
+
"list",
|
|
14
|
+
"read",
|
|
15
|
+
"copy",
|
|
16
|
+
"rename",
|
|
17
|
+
"readFile",
|
|
18
|
+
"prepareChanges",
|
|
19
|
+
"saveChanges",
|
|
20
|
+
"updateMounts",
|
|
21
|
+
"preview"
|
|
22
|
+
];
|
|
23
|
+
function registerStudioCustomizationTool(ctx, service) {
|
|
24
|
+
ctx.systemPrompt.section({
|
|
25
|
+
name: "studio:customization-methods",
|
|
26
|
+
order: 550,
|
|
27
|
+
text: `${STUDIO_AUTHORING_METHOD_GUIDANCE} Use studio_customize action read with request {authoring:{}} for the creator index, then request {authoring:{resource,offset}} for an indexed resource, or request {components:{name?,reference?,type?}} for installed component references. Read bound source separately using the existing working-copy id and file list. Packaged methods grant no write, save, publication or installation authority.`
|
|
28
|
+
});
|
|
29
|
+
ctx.tools.register(defineTool({
|
|
30
|
+
name: "studio_customize",
|
|
31
|
+
description: "Customize reusable Kit/Bundle methods and Panels in the SAME working copies shown in Studio. This edits authoring content, not a Design Project. Before editing, use read request {authoring:{}} for creator methods; for Panel changes discover {components:{}} then exact {components:{name,reference:\"contract\"}} and docs/examples before choosing parameters. catalog.currentKits lists available installed and local Kits for project selection; catalog.kits/bundles inspect installed source pins only, so absence there does not mean a local Kit is unavailable. Use list/read to reopen current local source; copy with kind and an exact kit or bundle {name,version}; readFile for source; rename requires id, expectedRevision and title {zh,en}. Read the current copy before selecting its revision. prepareChanges with id, expectedRevision and complete-file changes to inspect the diff, diagnostics and Panel preview before saving. Preparation never saves. Call saveChanges only when the user explicitly requests saving; pass the same changes, revision and candidate digest, using mode validated for a validated candidate or draft when the user wants to retain incomplete work. Kit mount changes use updateMounts. Saves do not publish, export or change installed content. After a conflict or an uncertain response, read the current working copy before proposing a new save; never blindly retry. request is the existing Studio operation input; it never accepts an agent identity, filesystem root or model configuration.",
|
|
32
|
+
parameters: {
|
|
33
|
+
action: {
|
|
34
|
+
type: "string",
|
|
35
|
+
required: true,
|
|
36
|
+
enum: [...actions]
|
|
37
|
+
},
|
|
38
|
+
request: {
|
|
39
|
+
type: "object",
|
|
40
|
+
required: true,
|
|
41
|
+
properties: {},
|
|
42
|
+
additionalProperties: true,
|
|
43
|
+
description: "Action-specific Studio input. Before authoring, read with {authoring:{}} for creator methods; read a listed resource with {authoring:{resource,offset}} and follow nextOffset. Source read: {id}; readFile: {id,path}. catalog: {query?}; list: {}; copy: {kind:\"bundle\",bundle:{name:\"exact-name\",version:\"exact-version\"}} (or kind:\"kit\",kit:{name,version}). rename: {id,expectedRevision,title:{zh,en}}. prepareChanges: {id,expectedRevision,changes:[{path,content}],bundle?}; saveChanges also sends mode (validated or draft) and the same candidate digest. preview: {id,expectedRevision,bundle?}. Use the current read receipt for expectedRevision; never guess or omit it on writes."
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
output: {
|
|
47
|
+
schema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
properties: { content: {
|
|
51
|
+
type: "string",
|
|
52
|
+
required: true
|
|
53
|
+
} }
|
|
54
|
+
},
|
|
55
|
+
render: (_args, result) => [{
|
|
56
|
+
type: "text",
|
|
57
|
+
text: result.content
|
|
58
|
+
}]
|
|
59
|
+
},
|
|
60
|
+
async execute(args, exec) {
|
|
61
|
+
const agent = exec.agent;
|
|
62
|
+
if (!agent) throw new Error("Studio customization requires the actual calling Agent");
|
|
63
|
+
exec.signal?.throwIfAborted();
|
|
64
|
+
const input = args.request;
|
|
65
|
+
let result;
|
|
66
|
+
switch (args.action) {
|
|
67
|
+
case "catalog":
|
|
68
|
+
result = await service.catalog(agent, input);
|
|
69
|
+
break;
|
|
70
|
+
case "list":
|
|
71
|
+
result = await service.list(agent, STUDIO_AUTHORING_RPC_SCHEMAS.list.request.parse(input));
|
|
72
|
+
break;
|
|
73
|
+
case "read":
|
|
74
|
+
if (Object.hasOwn(input, "components")) {
|
|
75
|
+
if (Object.keys(input).some((key) => key !== "components")) throw new Error("Read component references separately from working-copy source");
|
|
76
|
+
result = await service.readPanelComponents(agent, input.components);
|
|
77
|
+
} else if (Object.hasOwn(input, "authoring")) {
|
|
78
|
+
if (Object.keys(input).some((key) => key !== "authoring")) throw new Error("Read authoring methods separately from working-copy source");
|
|
79
|
+
result = await service.readAuthoringMaterial(agent, input.authoring);
|
|
80
|
+
} else result = await service.read(agent, STUDIO_AUTHORING_RPC_SCHEMAS.read.request.parse(input));
|
|
81
|
+
break;
|
|
82
|
+
case "copy":
|
|
83
|
+
result = await service.copy(agent, STUDIO_AUTHORING_RPC_SCHEMAS.copy.request.parse(input));
|
|
84
|
+
break;
|
|
85
|
+
case "rename":
|
|
86
|
+
result = await service.rename(agent, STUDIO_AUTHORING_RPC_SCHEMAS.rename.request.parse(input));
|
|
87
|
+
break;
|
|
88
|
+
case "readFile":
|
|
89
|
+
result = await service.readFile(agent, STUDIO_AUTHORING_RPC_SCHEMAS.readFile.request.parse(input));
|
|
90
|
+
break;
|
|
91
|
+
case "prepareChanges":
|
|
92
|
+
result = await service.prepareChanges(agent, STUDIO_AUTHORING_RPC_SCHEMAS.prepareChanges.request.parse(input));
|
|
93
|
+
break;
|
|
94
|
+
case "saveChanges":
|
|
95
|
+
result = await service.saveChanges(agent, STUDIO_AUTHORING_RPC_SCHEMAS.saveChanges.request.parse(input));
|
|
96
|
+
break;
|
|
97
|
+
case "updateMounts":
|
|
98
|
+
result = await service.updateMounts(agent, STUDIO_AUTHORING_RPC_SCHEMAS.updateMounts.request.parse(input));
|
|
99
|
+
break;
|
|
100
|
+
case "preview":
|
|
101
|
+
result = await service.preview(agent, STUDIO_AUTHORING_RPC_SCHEMAS.preview.request.parse(input));
|
|
102
|
+
break;
|
|
103
|
+
default: throw new Error("Unknown Studio customization action");
|
|
104
|
+
}
|
|
105
|
+
const candidate = args.action === "prepareChanges" ? STUDIO_AUTHORING_RPC_SCHEMAS.prepareChanges.result.parse(result) : void 0;
|
|
106
|
+
return { content: JSON.stringify({
|
|
107
|
+
result,
|
|
108
|
+
studioUrl: candidate?.authoring?.url ?? `/design-studio/?agentId=${encodeURIComponent(String(agent.id))}`
|
|
109
|
+
}) };
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/authoring-service.ts
|
|
115
|
+
/** Explicit native Service activation over the existing composed Host. */
|
|
116
|
+
/** No model client or extra catalog: project the installed shared Core vocabulary. */
|
|
117
|
+
function readComponents() {
|
|
118
|
+
return {
|
|
119
|
+
components: Object.entries(PANEL_COMPONENT_CATALOG).map(([name, entry]) => ({
|
|
120
|
+
name,
|
|
121
|
+
...entry,
|
|
122
|
+
generated: "autoOrder" in entry && entry.autoOrder !== void 0
|
|
123
|
+
})),
|
|
124
|
+
contract: "Runtime vocabulary and composition guidance only; not a complete parameter schema or standard A2UI specification."
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
var DshStudioAuthoringService = class extends TypertRemoteService {
|
|
128
|
+
static inject = [
|
|
129
|
+
"design",
|
|
130
|
+
"fs",
|
|
131
|
+
"agents",
|
|
132
|
+
"sessions",
|
|
133
|
+
"sessionQuery",
|
|
134
|
+
"tools",
|
|
135
|
+
"systemPrompt"
|
|
136
|
+
];
|
|
137
|
+
owner;
|
|
138
|
+
config;
|
|
139
|
+
initialization;
|
|
140
|
+
host;
|
|
141
|
+
closed = false;
|
|
142
|
+
accepting = false;
|
|
143
|
+
disposing;
|
|
144
|
+
calls = /* @__PURE__ */ new Set();
|
|
145
|
+
constructor(ctx, config) {
|
|
146
|
+
super(ctx, "studioAuthoring");
|
|
147
|
+
this.owner = ctx;
|
|
148
|
+
this.config = Object.freeze({ ...config });
|
|
149
|
+
ctx.effect(() => () => this.dispose(), "studio-authoring-service");
|
|
150
|
+
}
|
|
151
|
+
async [Service.init]() {
|
|
152
|
+
if (this.closed) throw new Error("Studio authoring Service is disposed");
|
|
153
|
+
const pending = createDshStudioAuthoringHost({
|
|
154
|
+
ctx: this.owner,
|
|
155
|
+
design: this.owner.design,
|
|
156
|
+
fs: this.owner.fs,
|
|
157
|
+
stateRoot: this.config.stateRoot,
|
|
158
|
+
workspaceRoot: this.config.workspaceRoot,
|
|
159
|
+
readComponents
|
|
160
|
+
});
|
|
161
|
+
this.initialization = pending;
|
|
162
|
+
const host = await pending;
|
|
163
|
+
this.host = host;
|
|
164
|
+
if (this.closed) {
|
|
165
|
+
await host.dispose();
|
|
166
|
+
throw new Error("Studio authoring Service closed during initialization");
|
|
167
|
+
}
|
|
168
|
+
this.accepting = true;
|
|
169
|
+
registerStudioCustomizationTool(this.owner, this);
|
|
170
|
+
}
|
|
171
|
+
/** Plugin lifetime only; page/request teardown never calls this method. */
|
|
172
|
+
dispose() {
|
|
173
|
+
if (this.disposing) return this.disposing;
|
|
174
|
+
this.closed = true;
|
|
175
|
+
this.accepting = false;
|
|
176
|
+
const stop = this.host?.dispose();
|
|
177
|
+
const settleInitialization = this.initialization?.then((host) => host.dispose(), () => void 0);
|
|
178
|
+
const calls = [...this.calls].map((call) => call.then(() => void 0, () => void 0));
|
|
179
|
+
this.disposing = Promise.allSettled([
|
|
180
|
+
stop,
|
|
181
|
+
settleInitialization,
|
|
182
|
+
...calls
|
|
183
|
+
]).then((results) => {
|
|
184
|
+
const failures = results.filter((r) => r.status === "rejected").map((r) => r.reason);
|
|
185
|
+
if (failures.length) throw new AggregateError([...new Set(failures)], "Studio authoring Service cleanup failed");
|
|
186
|
+
});
|
|
187
|
+
this.disposing.catch(() => {});
|
|
188
|
+
return this.disposing;
|
|
189
|
+
}
|
|
190
|
+
invoke(agent, operation) {
|
|
191
|
+
if (this.closed || !this.accepting || !this.host) return Promise.reject(/* @__PURE__ */ new Error("Studio authoring Service is unavailable"));
|
|
192
|
+
const host = this.host;
|
|
193
|
+
const result = Promise.resolve().then(() => {
|
|
194
|
+
if (this.closed || !this.accepting) throw new Error("Studio authoring Service is disposed");
|
|
195
|
+
return operation(host.forParent(agent));
|
|
196
|
+
});
|
|
197
|
+
this.calls.add(result);
|
|
198
|
+
result.finally(() => this.calls.delete(result)).catch(() => {});
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
/** Preserve call-time JSON intent before invoke queues its admission check. */
|
|
202
|
+
request(agent, input, parser, operation) {
|
|
203
|
+
let captured;
|
|
204
|
+
try {
|
|
205
|
+
captured = parser.parse(input);
|
|
206
|
+
} catch (error) {
|
|
207
|
+
return Promise.reject(error);
|
|
208
|
+
}
|
|
209
|
+
return this.invoke(agent, (parent) => operation(parent, captured));
|
|
210
|
+
}
|
|
211
|
+
reference(run) {
|
|
212
|
+
run.result.catch(() => {});
|
|
213
|
+
return structuredClone(run.reference);
|
|
214
|
+
}
|
|
215
|
+
/** Installed-source inspection plus the same current Kit choices as project selection. */
|
|
216
|
+
catalog(agent, request) {
|
|
217
|
+
if (!request || typeof request !== "object" || Array.isArray(request) || Object.keys(request).some((key) => key !== "query") || request.query !== void 0 && (typeof request.query !== "string" || request.query.length > 4096)) return Promise.reject(/* @__PURE__ */ new Error("Studio catalog accepts only an optional search query"));
|
|
218
|
+
const query = request.query;
|
|
219
|
+
return this.invoke(agent, async () => {
|
|
220
|
+
const catalog = this.owner.get("studioManagement");
|
|
221
|
+
if (!catalog) throw new Error("Studio catalog service is unavailable");
|
|
222
|
+
const [installed, current] = await Promise.all([catalog.workspace(query ?? ""), this.owner.design.listCurrentKits()]);
|
|
223
|
+
const search = query?.trim().toLocaleLowerCase() ?? "";
|
|
224
|
+
return {
|
|
225
|
+
...installed,
|
|
226
|
+
currentKits: current.filter((kit) => !search || `${kit.name} ${kit.description ?? ""}`.toLocaleLowerCase().includes(search))
|
|
227
|
+
};
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
list(agent, request) {
|
|
231
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.list.request, (p, captured) => p.instances.list(captured));
|
|
232
|
+
}
|
|
233
|
+
read(agent, request) {
|
|
234
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.read.request, (p, captured) => p.instances.read(captured));
|
|
235
|
+
}
|
|
236
|
+
create(agent, request) {
|
|
237
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.create.request, (p, captured) => p.instances.create(captured));
|
|
238
|
+
}
|
|
239
|
+
importSources(agent, request) {
|
|
240
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.importSources.request, (p, captured) => p.instances.importSources(captured));
|
|
241
|
+
}
|
|
242
|
+
/** Existing conversation read tool only; not a browser Remote or filesystem port. */
|
|
243
|
+
readAuthoringMaterial(agent, request) {
|
|
244
|
+
const captured = structuredClone(request);
|
|
245
|
+
return this.invoke(agent, () => readStudioAuthoringMaterial(captured));
|
|
246
|
+
}
|
|
247
|
+
readPanelComponents(agent, request) {
|
|
248
|
+
const captured = structuredClone(request);
|
|
249
|
+
return this.invoke(agent, () => readStudioPanelComponents(captured));
|
|
250
|
+
}
|
|
251
|
+
copy(agent, request) {
|
|
252
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.copy.request, (p, captured) => p.instances.copy(captured));
|
|
253
|
+
}
|
|
254
|
+
editCurrent(agent, request) {
|
|
255
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.editCurrent.request, (p, captured) => p.instances.editCurrent(captured));
|
|
256
|
+
}
|
|
257
|
+
rename(agent, request) {
|
|
258
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.rename.request, (p, captured) => p.instances.rename(captured));
|
|
259
|
+
}
|
|
260
|
+
remove(agent, request) {
|
|
261
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.remove.request, (p, captured) => p.instances.remove(captured));
|
|
262
|
+
}
|
|
263
|
+
readFile(agent, request) {
|
|
264
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.readFile.request, (p, captured) => p.instances.readFile(captured));
|
|
265
|
+
}
|
|
266
|
+
saveFile(agent, request) {
|
|
267
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.saveFile.request, (p, captured) => p.instances.saveFile(captured));
|
|
268
|
+
}
|
|
269
|
+
prepareChanges(agent, request) {
|
|
270
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.prepareChanges.request, async (p, captured) => {
|
|
271
|
+
const { locator, prepared } = await p.prepareChanges(captured);
|
|
272
|
+
const { requestId, digest: _digest, ...studio } = locator;
|
|
273
|
+
return {
|
|
274
|
+
...prepared.candidate,
|
|
275
|
+
authoring: {
|
|
276
|
+
requestId,
|
|
277
|
+
studio,
|
|
278
|
+
url: studioPreparedUrl(String(agent.id), locator)
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
saveChanges(agent, request) {
|
|
284
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.saveChanges.request, (p, captured) => p.instances.saveChanges(captured));
|
|
285
|
+
}
|
|
286
|
+
updateMounts(agent, request) {
|
|
287
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.updateMounts.request, (p, captured) => p.instances.updateMounts(captured));
|
|
288
|
+
}
|
|
289
|
+
preview(agent, request) {
|
|
290
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.preview.request, (p, captured) => p.instances.preview(captured));
|
|
291
|
+
}
|
|
292
|
+
start(agent, request) {
|
|
293
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.start.request, async (p, captured) => this.reference(await p.start(captured)));
|
|
294
|
+
}
|
|
295
|
+
resume(agent, request) {
|
|
296
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.resume.request, async (p, captured) => this.reference(await p.resume(captured)));
|
|
297
|
+
}
|
|
298
|
+
observe(agent, address) {
|
|
299
|
+
return this.request(agent, address, STUDIO_AUTHORING_RPC_SCHEMAS.observe.request, (p, captured) => p.observe(captured));
|
|
300
|
+
}
|
|
301
|
+
cancel(agent, request) {
|
|
302
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.cancel.request, (p, captured) => {
|
|
303
|
+
const { expectedTurn, ...address } = captured;
|
|
304
|
+
return p.cancel(address, { expectedTurn });
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
readPrepared(agent, address) {
|
|
308
|
+
return this.request(agent, address, STUDIO_AUTHORING_RPC_SCHEMAS.readPrepared.request, async (p, captured) => {
|
|
309
|
+
const prepared = await p.readPrepared(captured);
|
|
310
|
+
return prepared === void 0 ? {} : { prepared };
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
listReferences(agent) {
|
|
314
|
+
return this.invoke(agent, (p) => p.listReferences());
|
|
315
|
+
}
|
|
316
|
+
exportContentArchive(agent, request) {
|
|
317
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.exportContentArchive.request, (p, input) => p.content.exportContentArchive(input));
|
|
318
|
+
}
|
|
319
|
+
readArchive(agent, request) {
|
|
320
|
+
return this.request(agent, request, STUDIO_AUTHORING_RPC_SCHEMAS.readArchive.request, (p, input) => p.content.readArchive(input));
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
const proto = DshStudioAuthoringService.prototype;
|
|
324
|
+
markStudioRemote(proto, "list", proto.list);
|
|
325
|
+
markStudioRemote(proto, "read", proto.read);
|
|
326
|
+
markStudioRemote(proto, "create", proto.create);
|
|
327
|
+
markStudioRemote(proto, "importSources", proto.importSources);
|
|
328
|
+
markStudioRemote(proto, "copy", proto.copy);
|
|
329
|
+
markStudioRemote(proto, "editCurrent", proto.editCurrent);
|
|
330
|
+
markStudioRemote(proto, "rename", proto.rename);
|
|
331
|
+
markStudioRemote(proto, "remove", proto.remove);
|
|
332
|
+
markStudioRemote(proto, "readFile", proto.readFile);
|
|
333
|
+
markStudioRemote(proto, "saveFile", proto.saveFile);
|
|
334
|
+
markStudioRemote(proto, "prepareChanges", proto.prepareChanges);
|
|
335
|
+
markStudioRemote(proto, "saveChanges", proto.saveChanges);
|
|
336
|
+
markStudioRemote(proto, "updateMounts", proto.updateMounts);
|
|
337
|
+
markStudioRemote(proto, "preview", proto.preview);
|
|
338
|
+
markStudioRemote(proto, "start", proto.start);
|
|
339
|
+
markStudioRemote(proto, "resume", proto.resume);
|
|
340
|
+
markStudioRemote(proto, "observe", proto.observe);
|
|
341
|
+
markStudioRemote(proto, "cancel", proto.cancel);
|
|
342
|
+
markStudioRemote(proto, "readPrepared", proto.readPrepared);
|
|
343
|
+
markStudioRemote(proto, "listReferences", proto.listReferences);
|
|
344
|
+
markStudioRemote(proto, "exportContentArchive", proto.exportContentArchive);
|
|
345
|
+
markStudioRemote(proto, "readArchive", proto.readArchive);
|
|
346
|
+
//#endregion
|
|
347
|
+
export { DshStudioAuthoringService as t };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { r as StudioAuthoringReference, t as StudioAuthoringObservation } from "./authoring-agent.types-0S0xnlDW.js";
|
|
2
|
+
import { r as StudioSessionPrepared } from "./authoring-session.types-C6HosIWU.js";
|
|
3
|
+
import { a as StudioPreparedLocator, i as StudioAuthoringAddress, r as DshStudioAuthoringParent } from "./authoring-host.types-BZt9l0xK.js";
|
|
4
|
+
import { r as StudioPageAuthoringStart } from "./authoring.page-rpc-CYYWsmxc.js";
|
|
5
|
+
import { Context, Service } from "@deepseek-ai/cordis";
|
|
6
|
+
import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
7
|
+
import { Agent } from "@deepseek-ai/dsh-agent";
|
|
8
|
+
import { StudioInstances } from "@yugoo-design/dsh-design-studio/node";
|
|
9
|
+
//#region src/authoring-service.d.ts
|
|
10
|
+
interface DshStudioAuthoringServiceConfig {
|
|
11
|
+
/** Explicit private canonical Host directory, outside installed content/projects. */
|
|
12
|
+
readonly stateRoot: string;
|
|
13
|
+
/** Explicit isolated Host workspace; never a browser argument. */
|
|
14
|
+
readonly workspaceRoot: string;
|
|
15
|
+
}
|
|
16
|
+
declare class DshStudioAuthoringService extends TypertRemoteService {
|
|
17
|
+
static inject: string[];
|
|
18
|
+
private readonly owner;
|
|
19
|
+
private readonly config;
|
|
20
|
+
private initialization?;
|
|
21
|
+
private host?;
|
|
22
|
+
private closed;
|
|
23
|
+
private accepting;
|
|
24
|
+
private disposing?;
|
|
25
|
+
private readonly calls;
|
|
26
|
+
constructor(ctx: Context, config: DshStudioAuthoringServiceConfig);
|
|
27
|
+
protected [Service.init](): Promise<void>;
|
|
28
|
+
/** Plugin lifetime only; page/request teardown never calls this method. */
|
|
29
|
+
dispose(): Promise<void>;
|
|
30
|
+
private invoke;
|
|
31
|
+
/** Preserve call-time JSON intent before invoke queues its admission check. */
|
|
32
|
+
private request;
|
|
33
|
+
private reference;
|
|
34
|
+
/** Installed-source inspection plus the same current Kit choices as project selection. */
|
|
35
|
+
catalog(agent: Agent, request: Record<string, unknown>): Promise<{
|
|
36
|
+
currentKits: {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly version: string;
|
|
39
|
+
readonly description?: string;
|
|
40
|
+
}[];
|
|
41
|
+
query: string;
|
|
42
|
+
kits: readonly import("@yugoo-design/dsh-design-studio").StudioKitView[];
|
|
43
|
+
bundles: readonly import("@yugoo-design/dsh-design-studio").StudioBundleView[];
|
|
44
|
+
}>;
|
|
45
|
+
list(agent: Agent, request?: Parameters<StudioInstances['list']>[0]): Promise<readonly import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription[]>;
|
|
46
|
+
read(agent: Agent, request: {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
}): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
49
|
+
create(agent: Agent, request: Parameters<StudioInstances['create']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
50
|
+
importSources(agent: Agent, request: Parameters<StudioInstances['importSources']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
51
|
+
/** Existing conversation read tool only; not a browser Remote or filesystem port. */
|
|
52
|
+
readAuthoringMaterial(agent: Agent, request: unknown): Promise<{
|
|
53
|
+
skills?: {
|
|
54
|
+
name: string;
|
|
55
|
+
description: string;
|
|
56
|
+
method: string;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
nextOffset?: number | undefined;
|
|
59
|
+
offset: number;
|
|
60
|
+
content: string;
|
|
61
|
+
bytes: number;
|
|
62
|
+
totalBytes: number;
|
|
63
|
+
resource: string;
|
|
64
|
+
}>;
|
|
65
|
+
readPanelComponents(agent: Agent, request: unknown): Promise<unknown>;
|
|
66
|
+
copy(agent: Agent, request: Parameters<StudioInstances['copy']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
67
|
+
editCurrent(agent: Agent, request: Parameters<StudioInstances['editCurrent']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
68
|
+
rename(agent: Agent, request: Parameters<StudioInstances['rename']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
69
|
+
remove(agent: Agent, request: Parameters<StudioInstances['remove']>[0]): Promise<{
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly revision: number;
|
|
72
|
+
readonly trashed: true;
|
|
73
|
+
}>;
|
|
74
|
+
readFile(agent: Agent, request: Parameters<StudioInstances['readFile']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceReadFile>;
|
|
75
|
+
saveFile(agent: Agent, request: Parameters<StudioInstances['saveFile']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
76
|
+
prepareChanges(agent: Agent, request: Parameters<StudioInstances['prepareChanges']>[0]): Promise<{
|
|
77
|
+
authoring: {
|
|
78
|
+
requestId: string;
|
|
79
|
+
studio: {
|
|
80
|
+
id: string;
|
|
81
|
+
expectedRevision: number;
|
|
82
|
+
bundle?: import("@yugoo-design/dsh-design-studio").DesignBundleVersionPin;
|
|
83
|
+
};
|
|
84
|
+
url: string;
|
|
85
|
+
};
|
|
86
|
+
id: string;
|
|
87
|
+
baseRevision: number;
|
|
88
|
+
revision: number;
|
|
89
|
+
digest: string;
|
|
90
|
+
diff: readonly import("@yugoo-design/dsh-design-studio").StudioInstanceFileDiff[];
|
|
91
|
+
valid: boolean;
|
|
92
|
+
diagnostics: readonly import("@yugoo-design/dsh-design-studio").StudioDiagnostic[];
|
|
93
|
+
preview?: import("@yugoo-design/dsh-design-studio").StudioPanelPreview;
|
|
94
|
+
}>;
|
|
95
|
+
saveChanges(agent: Agent, request: Parameters<StudioInstances['saveChanges']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription & {
|
|
96
|
+
readonly changeReceipt: import("@yugoo-design/dsh-design-studio").StudioInstanceChangeReceipt;
|
|
97
|
+
}>;
|
|
98
|
+
updateMounts(agent: Agent, request: Parameters<StudioInstances['updateMounts']>[0]): Promise<import("@yugoo-design/dsh-design-studio/node").StudioInstanceDescription>;
|
|
99
|
+
preview(agent: Agent, request: Parameters<StudioInstances['preview']>[0]): Promise<import("@yugoo-design/dsh-design-studio").StudioPanelPreviewResult>;
|
|
100
|
+
start(agent: Agent, request: StudioPageAuthoringStart): Promise<StudioAuthoringReference>;
|
|
101
|
+
resume(agent: Agent, request: StudioPageAuthoringStart & {
|
|
102
|
+
readonly previous: StudioAuthoringAddress;
|
|
103
|
+
readonly explicit: true;
|
|
104
|
+
}): Promise<StudioAuthoringReference>;
|
|
105
|
+
observe(agent: Agent, address: StudioAuthoringAddress): Promise<StudioAuthoringObservation>;
|
|
106
|
+
cancel(agent: Agent, request: StudioAuthoringAddress & {
|
|
107
|
+
readonly expectedTurn: number | null;
|
|
108
|
+
}): Promise<StudioAuthoringObservation>;
|
|
109
|
+
readPrepared(agent: Agent, address: StudioAuthoringAddress | StudioPreparedLocator): Promise<{
|
|
110
|
+
prepared?: undefined;
|
|
111
|
+
} | {
|
|
112
|
+
prepared: StudioSessionPrepared;
|
|
113
|
+
}>;
|
|
114
|
+
listReferences(agent: Agent): Promise<readonly StudioAuthoringReference[]>;
|
|
115
|
+
exportContentArchive(agent: Agent, request: Parameters<DshStudioAuthoringParent['content']['exportContentArchive']>[0]): Promise<string>;
|
|
116
|
+
readArchive(agent: Agent, request: {
|
|
117
|
+
source: string;
|
|
118
|
+
}): Promise<import("@yugoo-design/dsh-design-studio").StudioContentArchive>;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { DshStudioAuthoringService, DshStudioAuthoringService as default, DshStudioAuthoringServiceConfig };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { a as StudioSessionRun, i as StudioSessionResume, n as StudioAuthoringSessionOptions, o as StudioSessionStart, r as StudioSessionPrepared, t as StudioAuthoringSession } from "./authoring-session.types-C6HosIWU.js";
|
|
2
|
+
//#region src/authoring-session.d.ts
|
|
3
|
+
declare function createStudioAuthoringSession(options: StudioAuthoringSessionOptions): StudioAuthoringSession;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { type StudioAuthoringSession, type StudioAuthoringSessionOptions, type StudioSessionPrepared, type StudioSessionResume, type StudioSessionRun, type StudioSessionStart, createStudioAuthoringSession };
|