@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.
- package/README.md +427 -3
- package/lib/authoring/panel-components.json +10790 -0
- package/lib/authoring/studio-creators/material.json +1 -0
- package/lib/authoring-agent-Ci08ifdJ.js +634 -0
- package/lib/authoring-agent.d.ts +24 -0
- package/lib/authoring-agent.js +2 -0
- package/lib/authoring-agent.types-QLa61eE6.d.ts +88 -0
- package/lib/authoring-entry.d.ts +20 -0
- package/lib/authoring-entry.js +77 -0
- package/lib/authoring-host-BlsA6wXz.js +347 -0
- package/lib/authoring-host.d.ts +5 -0
- package/lib/authoring-host.js +2 -0
- package/lib/authoring-host.types-d5UT0WEk.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-qGEk-IE_.js +342 -0
- package/lib/authoring-service.d.ts +112 -0
- package/lib/authoring-service.js +2 -0
- package/lib/authoring-session.d.ts +5 -0
- package/lib/authoring-session.js +203 -0
- package/lib/authoring-session.types-MHEaEFkO.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 +85 -0
- package/lib/authoring-workbench.d.ts +15 -0
- package/lib/authoring-workbench.js +782 -0
- package/lib/authoring.page-rpc-Bg6VAT0Z.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-BgD1mpCC.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-Bj5jO20L.d.ts +25 -0
- package/lib/page-path.d.ts +2 -2
- package/lib/page-path.js +70 -2
- package/lib/page-rpc-DiazVY00.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,58 @@
|
|
|
1
|
+
import { r as StudioAuthoringReference, t as StudioAuthoringObservation } from "./authoring-agent.types-QLa61eE6.js";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
import { DesignBundleVersionPin, StudioInstanceCandidate, StudioInstanceChangeRequest } from "@yugoo-design/dsh-design-studio";
|
|
4
|
+
import { Agent } from "@deepseek-ai/dsh-agent";
|
|
5
|
+
import { StudioAuthoringComponentCatalog, StudioAwaitable, StudioInstances } from "@yugoo-design/dsh-design-studio/node";
|
|
6
|
+
//#region src/authoring-session.types.d.ts
|
|
7
|
+
/** A projection of the existing S2/S1 receipt, not another candidate authority. */
|
|
8
|
+
interface StudioSessionPrepared {
|
|
9
|
+
readonly request: StudioInstanceChangeRequest;
|
|
10
|
+
readonly candidate: StudioInstanceCandidate;
|
|
11
|
+
}
|
|
12
|
+
interface StudioAuthoringSessionOptions {
|
|
13
|
+
readonly ctx: Context;
|
|
14
|
+
readonly parent: Agent;
|
|
15
|
+
readonly instances: Pick<StudioInstances, 'read' | 'readFile' | 'prepareChanges'>;
|
|
16
|
+
readonly readComponents: () => StudioAwaitable<StudioAuthoringComponentCatalog>;
|
|
17
|
+
/** Host-selected isolated workspace, never a browser-supplied path. */
|
|
18
|
+
readonly workspaceRoot: string;
|
|
19
|
+
/** Caller persists the native address before H2 attempts dispatch. */
|
|
20
|
+
readonly retainReference: (reference: StudioAuthoringReference) => void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
interface StudioSessionStart {
|
|
23
|
+
readonly invocationId: string;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly expectedRevision: number;
|
|
26
|
+
readonly paths: readonly string[];
|
|
27
|
+
readonly bundle?: DesignBundleVersionPin;
|
|
28
|
+
readonly prompt: string;
|
|
29
|
+
readonly signal?: AbortSignal;
|
|
30
|
+
readonly onPrepared?: (prepared: StudioSessionPrepared) => void | Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
interface StudioSessionResume extends StudioSessionStart {
|
|
33
|
+
readonly previous: StudioAuthoringReference;
|
|
34
|
+
readonly explicit: true;
|
|
35
|
+
}
|
|
36
|
+
interface StudioSessionRun {
|
|
37
|
+
readonly reference: StudioAuthoringReference;
|
|
38
|
+
/** Native turn outcome, independently of candidate validity or user save. */
|
|
39
|
+
readonly result: Promise<StudioAuthoringObservation>;
|
|
40
|
+
observe(): Promise<StudioAuthoringObservation>;
|
|
41
|
+
cancel(options: {
|
|
42
|
+
readonly expectedTurn: number | null;
|
|
43
|
+
}): Promise<StudioAuthoringObservation>;
|
|
44
|
+
readPrepared(): StudioSessionPrepared | undefined;
|
|
45
|
+
}
|
|
46
|
+
interface StudioAuthoringSession {
|
|
47
|
+
start(request: StudioSessionStart): Promise<StudioSessionRun>;
|
|
48
|
+
resume(request: StudioSessionResume): Promise<StudioSessionRun>;
|
|
49
|
+
observe(reference: StudioAuthoringReference): Promise<StudioAuthoringObservation>;
|
|
50
|
+
/** Only this session object's exact retained run handle can be cancelled. */
|
|
51
|
+
cancel(reference: StudioAuthoringReference, options: {
|
|
52
|
+
readonly expectedTurn: number | null;
|
|
53
|
+
}): Promise<StudioAuthoringObservation>;
|
|
54
|
+
readPrepared(reference: StudioAuthoringReference): StudioSessionPrepared | undefined;
|
|
55
|
+
dispose(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { StudioSessionRun as a, StudioSessionResume as i, StudioAuthoringSessionOptions as n, StudioSessionStart as o, StudioSessionPrepared as r, StudioAuthoringSession as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DesignService from "@yugoo-design/dsh-design-core";
|
|
2
|
+
import { StudioInstanceAdapters, StudioInstances } from "@yugoo-design/dsh-design-studio/node";
|
|
3
|
+
import { FileSystem } from "@deepseek-ai/dsh-fs";
|
|
4
|
+
//#region src/authoring-sources.d.ts
|
|
5
|
+
interface DshStudioInstanceSources {
|
|
6
|
+
readonly design: Pick<DesignService, 'listBundles' | 'resolveBundle' | 'resolveKit'>;
|
|
7
|
+
readonly fs: FileSystem;
|
|
8
|
+
}
|
|
9
|
+
/** A trusted library source for initial project copies, never a project registry. */
|
|
10
|
+
declare function registerDshStudioCurrentKitSource(design: Pick<DesignService, 'registerCurrentKitSource' | 'listKits'>, instances: Pick<StudioInstances, 'list' | 'editCurrent' | 'loadKit'>): () => void;
|
|
11
|
+
/**
|
|
12
|
+
* No source discovery, Node source I/O, stateRoot or native session. S2 remains
|
|
13
|
+
* the compiler, snapshot, composition and save owner, including its list policy.
|
|
14
|
+
*/
|
|
15
|
+
declare function createDshStudioInstanceAdapters({ design, fs }: DshStudioInstanceSources): StudioInstanceAdapters;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { createDshStudioInstanceAdapters as n, registerDshStudioCurrentKitSource as r, DshStudioInstanceSources as t };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { n as openInstalledSourceFiles, t as kitFileError } from "./kit-files-DKBlBOG8.js";
|
|
2
|
+
import { DesignKitVersion } from "@yugoo-design/dsh-design-core";
|
|
3
|
+
import { createStudioInstanceAdapters } from "@yugoo-design/dsh-design-studio/node";
|
|
4
|
+
//#region src/authoring-sources.ts
|
|
5
|
+
/** A trusted library source for initial project copies, never a project registry. */
|
|
6
|
+
function registerDshStudioCurrentKitSource(design, instances) {
|
|
7
|
+
const records = async () => (await instances.list({ kind: "kit" })).filter((record) => record.kit);
|
|
8
|
+
return design.registerCurrentKitSource({
|
|
9
|
+
async load(name) {
|
|
10
|
+
const matches = (await records()).filter((record) => record.kit.name === name);
|
|
11
|
+
const selected = matches.find((record) => record.current) ?? matches[0];
|
|
12
|
+
if (selected) return instances.loadKit({
|
|
13
|
+
id: selected.id,
|
|
14
|
+
expectedRevision: selected.revision
|
|
15
|
+
});
|
|
16
|
+
const installed = design.listKits().find((kit) => kit.name === name);
|
|
17
|
+
if (!installed) return void 0;
|
|
18
|
+
const current = await instances.editCurrent({
|
|
19
|
+
kind: "kit",
|
|
20
|
+
kit: {
|
|
21
|
+
name: installed.name,
|
|
22
|
+
version: String(installed.version)
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return instances.loadKit({
|
|
26
|
+
id: current.id,
|
|
27
|
+
expectedRevision: current.revision
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
async list() {
|
|
31
|
+
return (await records()).map((record) => ({
|
|
32
|
+
name: record.kit.name,
|
|
33
|
+
version: record.kit.version,
|
|
34
|
+
...record.description ? { description: record.description } : {}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* No source discovery, Node source I/O, stateRoot or native session. S2 remains
|
|
41
|
+
* the compiler, snapshot, composition and save owner, including its list policy.
|
|
42
|
+
*/
|
|
43
|
+
function createDshStudioInstanceAdapters({ design, fs }) {
|
|
44
|
+
const unavailable = (message) => kitFileError("studio.source_unavailable", message);
|
|
45
|
+
const bundle = (pin) => {
|
|
46
|
+
const content = design.resolveBundle(pin);
|
|
47
|
+
if (!content) throw unavailable(`Independent Bundle ${pin.name}@${pin.version} is not registered.`);
|
|
48
|
+
if ((content.skill.catalogName ?? content.skill.name) !== pin.name || String(content.skill.version) !== pin.version) throw kitFileError("studio.source_pin_mismatch", "Resolved Bundle differs from the exact requested pin.");
|
|
49
|
+
if (typeof content.sourceId !== "string" || !content.sourceId || content.sourceId.length > 4096 || /[\u0000-\u001f\u007f]/u.test(content.sourceId)) throw unavailable("Registered Bundle has no valid trusted sourceId.");
|
|
50
|
+
if (typeof content.resourceRoot !== "string" || !content.resourceRoot) throw unavailable("Registered Bundle has no resourceRoot.");
|
|
51
|
+
return {
|
|
52
|
+
sourceId: content.sourceId,
|
|
53
|
+
root: content.resourceRoot
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
return createStudioInstanceAdapters({
|
|
57
|
+
async listBundles() {
|
|
58
|
+
const skills = design.listBundles();
|
|
59
|
+
if (skills.length > 1024) throw kitFileError("studio.source_limit", "Bundle catalog exceeds 1024 entries.");
|
|
60
|
+
return skills.map((skill) => ({
|
|
61
|
+
name: skill.catalogName ?? skill.name,
|
|
62
|
+
version: String(skill.version)
|
|
63
|
+
})).filter((pin) => design.resolveBundle(pin) !== void 0).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : a.version < b.version ? -1 : a.version > b.version ? 1 : 0);
|
|
64
|
+
},
|
|
65
|
+
async captureBundle(pin) {
|
|
66
|
+
const { root, sourceId } = bundle(pin);
|
|
67
|
+
return {
|
|
68
|
+
sourceId,
|
|
69
|
+
files: await (await openInstalledSourceFiles(fs, root)).captureTree()
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
async captureKit(pin) {
|
|
73
|
+
const kit = design.resolveKit({
|
|
74
|
+
kit: pin.name,
|
|
75
|
+
version: DesignKitVersion(pin.version)
|
|
76
|
+
});
|
|
77
|
+
if (!kit) throw unavailable(`Kit ${pin.name}@${pin.version} is not registered.`);
|
|
78
|
+
if (kit.name !== pin.name || String(kit.version) !== pin.version) throw kitFileError("studio.source_pin_mismatch", "Resolved Kit differs from the exact requested pin.");
|
|
79
|
+
if (typeof kit.sourceRoot !== "string" || !kit.sourceRoot) throw unavailable("Registered Kit has no sourceRoot.");
|
|
80
|
+
return { files: await (await openInstalledSourceFiles(fs, kit.sourceRoot, "Kit")).captureTree() };
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { createDshStudioInstanceAdapters, registerDshStudioCurrentKitSource };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as StudioPreparedLocator } from "./authoring-host.types-d5UT0WEk.js";
|
|
2
|
+
import { n as StudioPageAuthoringClient } from "./authoring.page-rpc-Bg6VAT0Z.js";
|
|
3
|
+
import { InstanceWorkbenchProps } from "@yugoo-design/dsh-design-studio-ui";
|
|
4
|
+
//#region src/authoring-workbench.d.ts
|
|
5
|
+
interface StudioAuthoringWorkbenchProps extends Omit<InstanceWorkbenchProps, 'client' | 'renderSupplement' | 'embedded' | 'initialView' | 'sourceChanges'> {
|
|
6
|
+
/** Already scoped to the native parent by the page. Identity changes invalidate this open editor. */
|
|
7
|
+
client: StudioPageAuthoringClient;
|
|
8
|
+
presentation?: 'content-only' | 'full';
|
|
9
|
+
preparedLocator?: StudioPreparedLocator;
|
|
10
|
+
initialPrompt?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const StudioAuthoringPromptContext: import("react").Context<string | undefined>;
|
|
13
|
+
declare function StudioAuthoringWorkbench(props: StudioAuthoringWorkbenchProps): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { StudioAuthoringPromptContext, StudioAuthoringWorkbench, StudioAuthoringWorkbenchProps };
|