@yugoo-design/dsh-design-studio 0.2.8 → 0.2.11
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 +3 -0
- package/lib/node.d.ts +5 -1
- package/lib/node.js +48 -15
- package/licenses/dsh-distribution.json +22 -22
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -56,6 +56,9 @@ Other incomplete or malformed definitions remain editable with locatable readine
|
|
|
56
56
|
diagnostics. Imports get independent catalog identities and retain original bytes,
|
|
57
57
|
methods, runtime names and resources. Repeated display names receive numeric suffixes.
|
|
58
58
|
Kit imports preserve supplied Bundle trees; absent dependencies remain explicit.
|
|
59
|
+
Mount cards read titles and descriptions from the selected saved sources, including
|
|
60
|
+
imported trees without a separate library entry. Display metadata does not create
|
|
61
|
+
library records or change mount bindings.
|
|
59
62
|
|
|
60
63
|
`exportArchive({id, expectedRevision})` exports the current complete saved source
|
|
61
64
|
and mounted Bundle resources through the existing source-archive format. It supports
|
package/lib/node.d.ts
CHANGED
|
@@ -119,7 +119,11 @@ interface StudioInstanceBundleChoice extends DesignBundleVersionPin {
|
|
|
119
119
|
readonly instanceId?: string;
|
|
120
120
|
readonly revision?: number;
|
|
121
121
|
}
|
|
122
|
-
interface StudioInstanceDescription extends Omit<StudioInstanceStoredRecord, 'overlays' | 'importedFromSnapshot'> {
|
|
122
|
+
interface StudioInstanceDescription extends Omit<StudioInstanceStoredRecord, 'overlays' | 'importedFromSnapshot' | 'mounts'> {
|
|
123
|
+
/** Display-only metadata from the selected source; never persisted in mount pins. */
|
|
124
|
+
readonly mounts: readonly (StudioInstanceMount & {
|
|
125
|
+
readonly display?: Partial<Pick<StudioInstanceBundleChoice, 'title' | 'description' | 'displayDescription'>>;
|
|
126
|
+
})[];
|
|
123
127
|
/** Same-identity editable projection of a catalog source. */
|
|
124
128
|
readonly current?: boolean;
|
|
125
129
|
readonly refs: readonly {
|
package/lib/node.js
CHANGED
|
@@ -557,13 +557,20 @@ async function createStudioInstances(options) {
|
|
|
557
557
|
}
|
|
558
558
|
return typeof value === "string" && Buffer.byteLength(value) <= MAX_TEXT ? value : void 0;
|
|
559
559
|
};
|
|
560
|
-
const
|
|
560
|
+
const { title: _sourceTitle, ...copy } = await sourceDisplayCopy(record.kind, text);
|
|
561
|
+
return copy;
|
|
562
|
+
};
|
|
563
|
+
const sourceDisplayCopy = async (kind, text) => {
|
|
564
|
+
const source = await text(kind === "kit" ? "mindset.md" : "SKILL.md");
|
|
561
565
|
const frontmatter = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(source ?? "");
|
|
562
|
-
let meta = {}, translated;
|
|
566
|
+
let meta = {}, manifest = {}, translated;
|
|
567
|
+
if (kind === "bundle") try {
|
|
568
|
+
manifest = parse(await text("skill.yaml") ?? "") ?? {};
|
|
569
|
+
} catch {}
|
|
563
570
|
try {
|
|
564
571
|
meta = frontmatter ? parse(frontmatter[1]) ?? {} : {};
|
|
565
572
|
} catch {}
|
|
566
|
-
if (
|
|
573
|
+
if (kind === "kit") translated = meta.display_description;
|
|
567
574
|
else {
|
|
568
575
|
let locales = {};
|
|
569
576
|
try {
|
|
@@ -582,11 +589,14 @@ async function createStudioInstances(options) {
|
|
|
582
589
|
zh: await readLocale("zh-CN"),
|
|
583
590
|
en: await readLocale("en-US")
|
|
584
591
|
};
|
|
585
|
-
if (translated.zh === void 0 && translated.en === void 0)
|
|
586
|
-
translated = parse(await text("skill.yaml") ?? "")?.description;
|
|
587
|
-
} catch {}
|
|
592
|
+
if (translated.zh === void 0 && translated.en === void 0) translated = manifest.description;
|
|
588
593
|
}
|
|
594
|
+
let title;
|
|
595
|
+
try {
|
|
596
|
+
title = titleOf(manifest.title);
|
|
597
|
+
} catch {}
|
|
589
598
|
return {
|
|
599
|
+
...title ? { title } : {},
|
|
590
600
|
...typeof meta.description === "string" ? { description: meta.description } : {},
|
|
591
601
|
...translated && ["zh", "en"].every((language) => typeof translated[language] === "string" && translated[language].trim()) ? { displayDescription: {
|
|
592
602
|
zh: translated.zh,
|
|
@@ -736,7 +746,10 @@ async function createStudioInstances(options) {
|
|
|
736
746
|
...await displayCopy(record),
|
|
737
747
|
...await readiness(record),
|
|
738
748
|
files,
|
|
739
|
-
...record.kind === "kit" ? {
|
|
749
|
+
...record.kind === "kit" ? {
|
|
750
|
+
availableBundles: await candidates(records),
|
|
751
|
+
mounts: await describedMounts(record)
|
|
752
|
+
} : {}
|
|
740
753
|
};
|
|
741
754
|
};
|
|
742
755
|
const read = async (input) => describe(active(await repository.read(typeof input === "string" ? input : input.id)));
|
|
@@ -748,18 +761,18 @@ async function createStudioInstances(options) {
|
|
|
748
761
|
return mounts.map((mount) => pin(mount.bundle));
|
|
749
762
|
}
|
|
750
763
|
};
|
|
751
|
-
const
|
|
752
|
-
const selected = mounts.find((mount) => same(mount.bundle, pin(requested)));
|
|
753
|
-
if (!selected) throw new Error("Core requested a Bundle outside the selected exact mounts.");
|
|
764
|
+
const currentMountRecord = async (selected) => {
|
|
754
765
|
if (selected.bundle.instanceId) {
|
|
755
766
|
const current = modern(await repository.read(selected.bundle.instanceId));
|
|
756
767
|
if (current.kind !== "bundle" || current.bundle.name !== selected.bundle.name) throw new Error("Mounted Bundle identity changed.");
|
|
757
|
-
return
|
|
758
|
-
files: await filesOf(current),
|
|
759
|
-
sourceId: current.sourceId
|
|
760
|
-
};
|
|
768
|
+
return current;
|
|
761
769
|
}
|
|
762
|
-
|
|
770
|
+
return (await repository.list()).find((record) => !record.deletedAt && record.current === true && record.kind === "bundle" && record.bundle.name === selected.bundle.name);
|
|
771
|
+
};
|
|
772
|
+
const resolveMounts = (mounts, currentLibrary = false) => async (requested) => {
|
|
773
|
+
const selected = mounts.find((mount) => same(mount.bundle, pin(requested)));
|
|
774
|
+
if (!selected) throw new Error("Core requested a Bundle outside the selected exact mounts.");
|
|
775
|
+
const current = await currentMountRecord(selected);
|
|
763
776
|
if (current) return {
|
|
764
777
|
files: await filesOf(current),
|
|
765
778
|
sourceId: current.sourceId
|
|
@@ -771,6 +784,26 @@ async function createStudioInstances(options) {
|
|
|
771
784
|
sourceId: selected.bundle.source.sourceId
|
|
772
785
|
};
|
|
773
786
|
};
|
|
787
|
+
const describedMounts = async (record) => Promise.all(record.mounts.map(async (mount) => {
|
|
788
|
+
try {
|
|
789
|
+
const captured = await resolveMounts(record.mounts, record.current === true)(mount.bundle);
|
|
790
|
+
const display = await sourceDisplayCopy("bundle", async (path) => {
|
|
791
|
+
safePath(path);
|
|
792
|
+
const file = captured.files.find((file) => file.path === path);
|
|
793
|
+
return file && Buffer.byteLength(file.base64, "base64") <= MAX_TEXT ? decode$1(file.base64) : void 0;
|
|
794
|
+
});
|
|
795
|
+
const current = await currentMountRecord(mount);
|
|
796
|
+
return {
|
|
797
|
+
...mount,
|
|
798
|
+
display: {
|
|
799
|
+
...display,
|
|
800
|
+
...current ? { title: current.title } : {}
|
|
801
|
+
}
|
|
802
|
+
};
|
|
803
|
+
} catch {
|
|
804
|
+
return mount;
|
|
805
|
+
}
|
|
806
|
+
}));
|
|
774
807
|
const kitInput = async (record) => ({
|
|
775
808
|
kit: record.kit,
|
|
776
809
|
kitFiles: await filesOf(record),
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"outputSha256": {
|
|
7
7
|
"lib/index.js": "0da54290b39a73d15bc1649af784f05aa8e70ff772aaef58689f5eeb4971dbb6",
|
|
8
8
|
"lib/instance-changes-RvOGeBaE.js": "e9ed31b1c9d947b4d34172431a7aa2b5880135e3bfc0ec2c858f86035432759c",
|
|
9
|
-
"lib/node.js": "
|
|
9
|
+
"lib/node.js": "578389e27910ab8bef8d5c72b67f8e5e0452e4732b03c8e94c7e74b2bb150f18"
|
|
10
10
|
},
|
|
11
11
|
"normalBuildMaps": [
|
|
12
12
|
{
|
|
13
13
|
"output": "lib/index.js",
|
|
14
14
|
"observation": "normal-build-done-module-membership",
|
|
15
15
|
"evidenceFile": "dsh-release-studio-0-output-modules.json",
|
|
16
|
-
"evidenceSha256": "
|
|
16
|
+
"evidenceSha256": "dea1e8292bd0d65a51fdad251b110c1286c80d06a3c2014c7faa8d526b26d213",
|
|
17
17
|
"normalOutputSha256": "080de87c4980e16ce7950010e2e92ff213057587b11b980c5ba337437ba48db8",
|
|
18
18
|
"packedOutputSha256": "0da54290b39a73d15bc1649af784f05aa8e70ff772aaef58689f5eeb4971dbb6",
|
|
19
19
|
"projectOwnedSources": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"output": "lib/instance-changes-RvOGeBaE.js",
|
|
43
43
|
"observation": "normal-build-done-module-membership",
|
|
44
44
|
"evidenceFile": "dsh-release-studio-0-output-modules.json",
|
|
45
|
-
"evidenceSha256": "
|
|
45
|
+
"evidenceSha256": "dea1e8292bd0d65a51fdad251b110c1286c80d06a3c2014c7faa8d526b26d213",
|
|
46
46
|
"normalOutputSha256": "c602fc3fadb5d94e99bf713c86d606e96529cd04ec1f5848fe6c42d354350c8f",
|
|
47
47
|
"packedOutputSha256": "e9ed31b1c9d947b4d34172431a7aa2b5880135e3bfc0ec2c858f86035432759c",
|
|
48
48
|
"projectOwnedSources": [
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"output": "lib/node.js",
|
|
68
68
|
"observation": "normal-build-done-module-membership",
|
|
69
69
|
"evidenceFile": "dsh-release-studio-0-output-modules.json",
|
|
70
|
-
"evidenceSha256": "
|
|
71
|
-
"normalOutputSha256": "
|
|
72
|
-
"packedOutputSha256": "
|
|
70
|
+
"evidenceSha256": "dea1e8292bd0d65a51fdad251b110c1286c80d06a3c2014c7faa8d526b26d213",
|
|
71
|
+
"normalOutputSha256": "06b6a8588487fd0322b0a83129dd2a4f39459c2eb1b87ab2a35fac1de6ab26b8",
|
|
72
|
+
"packedOutputSha256": "578389e27910ab8bef8d5c72b67f8e5e0452e4732b03c8e94c7e74b2bb150f18",
|
|
73
73
|
"projectOwnedSources": [
|
|
74
74
|
"packages/studio/src/node/studio-authoring.mjs",
|
|
75
75
|
"packages/studio/src/node/studio-instance-composition.mjs",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"projectOwnedSourceSha256": {
|
|
80
80
|
"packages/studio/src/node/studio-authoring.mjs": "c5466098ac3013441ff8b13f84b400d8364b1bc8a68ea35f8de4da8634abd169",
|
|
81
81
|
"packages/studio/src/node/studio-instance-composition.mjs": "46bcf04640e329af1659a22e8b77530a782131cf211865bc092cae37c40cc0b8",
|
|
82
|
-
"packages/studio/src/node/studio-instances.mjs": "
|
|
82
|
+
"packages/studio/src/node/studio-instances.mjs": "e0451419bcaaa6df5388af47c56db8e4d4ff9c31a0bb91a78c416617829e95df",
|
|
83
83
|
"packages/studio/src/node/studio-panel-drafts.mjs": "acbbbdb5a5928097d5eb88d54d550ac05609c2c56295762ecfca1a3ebc605fcf"
|
|
84
84
|
},
|
|
85
85
|
"sourceCount": 4,
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"firstParty": true,
|
|
103
103
|
"currentSourceIdentity": {
|
|
104
104
|
"manifestPath": "packages/studio/package.json",
|
|
105
|
-
"sourceCommit": "
|
|
105
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
106
106
|
"name": "dsh-design-studio",
|
|
107
107
|
"version": "0.0.0",
|
|
108
108
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"firstParty": true,
|
|
119
119
|
"currentSourceIdentity": {
|
|
120
120
|
"manifestPath": "packages/studio/package.json",
|
|
121
|
-
"sourceCommit": "
|
|
121
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
122
122
|
"name": "dsh-design-studio",
|
|
123
123
|
"version": "0.0.0",
|
|
124
124
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"firstParty": true,
|
|
135
135
|
"currentSourceIdentity": {
|
|
136
136
|
"manifestPath": "packages/studio/package.json",
|
|
137
|
-
"sourceCommit": "
|
|
137
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
138
138
|
"name": "dsh-design-studio",
|
|
139
139
|
"version": "0.0.0",
|
|
140
140
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"firstParty": true,
|
|
151
151
|
"currentSourceIdentity": {
|
|
152
152
|
"manifestPath": "packages/studio/package.json",
|
|
153
|
-
"sourceCommit": "
|
|
153
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
154
154
|
"name": "dsh-design-studio",
|
|
155
155
|
"version": "0.0.0",
|
|
156
156
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"firstParty": true,
|
|
167
167
|
"currentSourceIdentity": {
|
|
168
168
|
"manifestPath": "packages/studio/package.json",
|
|
169
|
-
"sourceCommit": "
|
|
169
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
170
170
|
"name": "dsh-design-studio",
|
|
171
171
|
"version": "0.0.0",
|
|
172
172
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"firstParty": true,
|
|
183
183
|
"currentSourceIdentity": {
|
|
184
184
|
"manifestPath": "packages/studio/package.json",
|
|
185
|
-
"sourceCommit": "
|
|
185
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
186
186
|
"name": "dsh-design-studio",
|
|
187
187
|
"version": "0.0.0",
|
|
188
188
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -198,7 +198,7 @@
|
|
|
198
198
|
"firstParty": true,
|
|
199
199
|
"currentSourceIdentity": {
|
|
200
200
|
"manifestPath": "packages/studio/package.json",
|
|
201
|
-
"sourceCommit": "
|
|
201
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
202
202
|
"name": "dsh-design-studio",
|
|
203
203
|
"version": "0.0.0",
|
|
204
204
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
"firstParty": true,
|
|
215
215
|
"currentSourceIdentity": {
|
|
216
216
|
"manifestPath": "packages/studio/package.json",
|
|
217
|
-
"sourceCommit": "
|
|
217
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
218
218
|
"name": "dsh-design-studio",
|
|
219
219
|
"version": "0.0.0",
|
|
220
220
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"firstParty": true,
|
|
231
231
|
"currentSourceIdentity": {
|
|
232
232
|
"manifestPath": "packages/studio/package.json",
|
|
233
|
-
"sourceCommit": "
|
|
233
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
234
234
|
"name": "dsh-design-studio",
|
|
235
235
|
"version": "0.0.0",
|
|
236
236
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
"firstParty": true,
|
|
247
247
|
"currentSourceIdentity": {
|
|
248
248
|
"manifestPath": "packages/studio/package.json",
|
|
249
|
-
"sourceCommit": "
|
|
249
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
250
250
|
"name": "dsh-design-studio",
|
|
251
251
|
"version": "0.0.0",
|
|
252
252
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
"firstParty": true,
|
|
263
263
|
"currentSourceIdentity": {
|
|
264
264
|
"manifestPath": "packages/studio/package.json",
|
|
265
|
-
"sourceCommit": "
|
|
265
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
266
266
|
"name": "dsh-design-studio",
|
|
267
267
|
"version": "0.0.0",
|
|
268
268
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
"firstParty": true,
|
|
279
279
|
"currentSourceIdentity": {
|
|
280
280
|
"manifestPath": "packages/studio/package.json",
|
|
281
|
-
"sourceCommit": "
|
|
281
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
282
282
|
"name": "dsh-design-studio",
|
|
283
283
|
"version": "0.0.0",
|
|
284
284
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -287,14 +287,14 @@
|
|
|
287
287
|
{
|
|
288
288
|
"output": "lib/node.js",
|
|
289
289
|
"path": "packages/studio/src/node/studio-instances.mjs",
|
|
290
|
-
"sha256": "
|
|
290
|
+
"sha256": "e0451419bcaaa6df5388af47c56db8e4d4ff9c31a0bb91a78c416617829e95df",
|
|
291
291
|
"name": "dsh-design-studio",
|
|
292
292
|
"version": "0.0.0",
|
|
293
293
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae",
|
|
294
294
|
"firstParty": true,
|
|
295
295
|
"currentSourceIdentity": {
|
|
296
296
|
"manifestPath": "packages/studio/package.json",
|
|
297
|
-
"sourceCommit": "
|
|
297
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
298
298
|
"name": "dsh-design-studio",
|
|
299
299
|
"version": "0.0.0",
|
|
300
300
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
"firstParty": true,
|
|
311
311
|
"currentSourceIdentity": {
|
|
312
312
|
"manifestPath": "packages/studio/package.json",
|
|
313
|
-
"sourceCommit": "
|
|
313
|
+
"sourceCommit": "1c813ae4a77e3087224db27e3a898cea5ca61b97",
|
|
314
314
|
"name": "dsh-design-studio",
|
|
315
315
|
"version": "0.0.0",
|
|
316
316
|
"packageMetadataSha256": "5a27dcb60ce95be6cbe2d083b9cfd8a2c4012dda9b3a9541ff915f868d75c7ae"
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"directory": "packages/studio"
|
|
6
6
|
},
|
|
7
7
|
"name": "@yugoo-design/dsh-design-studio",
|
|
8
|
-
"version": "0.2.
|
|
8
|
+
"version": "0.2.11",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"description": "Host-neutral Studio catalog and authoring domain with an optional Node storage and source-composition adapter.",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"test:source-storage": "tsx --tsconfig tests/source-tsconfig.json --test tests/source-storage.test.mjs"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@yugoo-design/dsh-design-core": "0.2.
|
|
37
|
+
"@yugoo-design/dsh-design-core": "0.2.11"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"lib/**/*.js",
|