yugoo-design 0.2.0 → 0.2.3
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 +4 -4
- package/bin/npm-agent-installation.mjs +1 -1
- package/bin/npm-installer-dsh.mjs +111 -4
- package/package.json +3 -2
- package/payload/desktop-preparation/materials.json +4 -4
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/material.json +1 -1
- package/payload/desktop-preparation/qwenwork-template/authoring/studio-creators/source/docs/system-design-baseline.md +5 -0
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/material.json +1 -1
- package/payload/desktop-preparation/studio-authoring-template/authoring/studio-creators/source/docs/system-design-baseline.md +5 -0
- package/payload/overlays/claude-code/.claude-plugin/plugin.json +1 -1
- package/payload/overlays/claude-code/authoring/studio-creators/material.json +1 -1
- package/payload/overlays/claude-code/authoring/studio-creators/source/docs/system-design-baseline.md +5 -0
- package/payload/overlays/codex/.codex-plugin/plugin.json +1 -1
- package/payload/overlays/codex/authoring/studio-creators/material.json +1 -1
- package/payload/overlays/codex/authoring/studio-creators/source/docs/system-design-baseline.md +5 -0
- package/payload/overlays/qoder/.qoder-plugin/plugin.json +1 -1
- package/payload/overlays/qoder/authoring/studio-creators/material.json +1 -1
- package/payload/overlays/qoder/authoring/studio-creators/source/docs/system-design-baseline.md +5 -0
- package/payload/shared/authoring/studio-creators/material.json +1 -1
- package/payload/shared/authoring/studio-creators/source/docs/system-design-baseline.md +5 -0
- package/payload/shared/knowledge/runtime-manifest.json +2 -1
- package/payload/shared/scripts/design.mjs +1 -1
- package/payload/shared/scripts/{server-BBHB9EQr.mjs → server-BnEtfptI.mjs} +1 -1
- package/payload/shared/scripts/{studio-CS5TyoYn.mjs → studio-CFUWk0vJ.mjs} +1 -1
- package/payload/shared/scripts/{studio-instances-D-Y1WNya.mjs → studio-instances-gQFR9yqL.mjs} +65 -2
- package/payload/shared/scripts/workbuddy-panel-service.mjs +1 -1
- package/payload/shared/web/client.js +127 -86
- package/release-hosts.json +1 -1
- package/release-manifest.json +32 -31
|
@@ -730,6 +730,11 @@ The Design Studio is the authoring and management GUI for Kits, Mindsets, and th
|
|
|
730
730
|
|
|
731
731
|
The catalog maintains current saved Kit and Bundle content. Editing, copying and importing use the same source-instance service. Projects copy the selected current definitions once and subsequently use their own files. There is no local publication state, confirmation lock or version-switching workflow.
|
|
732
732
|
|
|
733
|
+
UI and Agent discovery share the current Kit choices, including saved local
|
|
734
|
+
imports. Installed-source inspection remains distinct: its absence cannot make
|
|
735
|
+
a local Kit unavailable. Discovery reads do not update an existing project's
|
|
736
|
+
Kit copy or add another persistent catalog.
|
|
737
|
+
|
|
733
738
|
Local Studio working-copy persistence has editor-level guarantees. The filesystem
|
|
734
739
|
adapter writes, syncs and closes a temporary file before atomic replacement. A
|
|
735
740
|
successful save is readable by another process or a reopened application;
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"@huggingface/transformers": "3.8.1",
|
|
7
7
|
"onnxruntime-common": "1.21.0",
|
|
8
8
|
"undici": "8.10.2",
|
|
9
|
-
"trash": "10.1.1"
|
|
9
|
+
"trash": "10.1.1",
|
|
10
|
+
"yaml": "2.9.1"
|
|
10
11
|
},
|
|
11
12
|
"assets": {
|
|
12
13
|
"cli-lifecycle.mjs": "039c7705557b58c435c0a96a6540b2a233a3583ebab36c5d100bad0771a15d88",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, n as __exportAll, t as __commonJSMin } from "./rolldown-runtime-B4iAMlE-.mjs";
|
|
2
2
|
import { i as notificationErrorResponse, n as requireThreadId } from "./codex-connection-1RvU1XCj.mjs";
|
|
3
3
|
import { t as callCompanion } from "./connection-file-CNwrHbAG.mjs";
|
|
4
|
-
import { a as openCompanionProject, c as resolveCodexMainTranscript, i as companionFs, l as createClaudeTranscript, n as companionKnowledgeRuntimeUrl, o as assertCompanionKitContributions, r as runtime, s as createCompanionContentLibrary, t as startCompanion, u as createQwenWorkTranscript } from "./server-
|
|
4
|
+
import { a as openCompanionProject, c as resolveCodexMainTranscript, i as companionFs, l as createClaudeTranscript, n as companionKnowledgeRuntimeUrl, o as assertCompanionKitContributions, r as runtime, s as createCompanionContentLibrary, t as startCompanion, u as createQwenWorkTranscript } from "./server-BnEtfptI.mjs";
|
|
5
5
|
import { A as validateSkillDesign, Ct as PANEL_COMPONENT_CATALOG, D as OFFICIAL_REFLECTION_PROFILE, E as OFFICIAL_GROUNDING_PROFILE, G as parseDesignCommand, K as runDesignProjectCommand, O as officialAdvisoryProfile, St as GENERATED_COMPONENT_KINDS, T as OFFICIAL_ALIGNMENT_PROFILE, at as ensureProjectKit, h as DESIGN_CLARITY_OUTPUT_SCHEMA, it as DesignProjectRegistry, xt as queryPanelAuthoringReference } from "./core-entry-DESmwP78.mjs";
|
|
6
6
|
import { n as DESIGN_GIT_READ_DESCRIPTION, r as designGitReadArguments, t as DESIGN_GIT_READ_ACTIONS } from "./design-git-read-BUV0s4TT.mjs";
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
@@ -5605,7 +5605,7 @@ function createCompanionContentLibrary({ fs, kitRoot, stateRoot, trustedContentS
|
|
|
5605
5605
|
},
|
|
5606
5606
|
/** The shared Studio store owns current library edits; projects take a copy. */
|
|
5607
5607
|
async studio() {
|
|
5608
|
-
return studio ??= import("./studio-
|
|
5608
|
+
return studio ??= import("./studio-CFUWk0vJ.mjs").then(({ createCompanionStudio }) => createCompanionStudio(() => this.loadInstalled(), kitRoot, stateRoot, this)).catch((error) => {
|
|
5609
5609
|
studio = void 0;
|
|
5610
5610
|
throw error;
|
|
5611
5611
|
});
|
|
@@ -717,7 +717,7 @@ async function createCompanionStudio(kit, kitRoot, stateRoot, contentLibrary) {
|
|
|
717
717
|
};
|
|
718
718
|
const instances = () => {
|
|
719
719
|
if (!stateRoot) throw new Error("Studio authoring storage is not configured.");
|
|
720
|
-
return instanceService ??= Promise.all([import("./studio-instances-
|
|
720
|
+
return instanceService ??= Promise.all([import("./studio-instances-gQFR9yqL.mjs"), import("./studio-instance-composition-BJzYMyvV.mjs")]).then(async ([{ createStudioInstances }, { createStudioInstanceAdapters }]) => {
|
|
721
721
|
return createStudioInstances({
|
|
722
722
|
stateRoot,
|
|
723
723
|
...createStudioInstanceAdapters({
|
package/payload/shared/scripts/{studio-instances-D-Y1WNya.mjs → studio-instances-gQFR9yqL.mjs}
RENAMED
|
@@ -426,6 +426,7 @@ async function createStudioInstances(options) {
|
|
|
426
426
|
sourceId: current.sourceId
|
|
427
427
|
};
|
|
428
428
|
if (currentLibrary && selected.bundle.version !== requested.version) return catalog.captureBundle(pin(requested));
|
|
429
|
+
if (!selected.bundle.source?.snapshot) throw new Error(`Mounted Bundle source is unavailable for ${selected.bindingKey}.`);
|
|
429
430
|
return {
|
|
430
431
|
files: await entriesOf(selected.bundle.source.snapshot),
|
|
431
432
|
sourceId: selected.bundle.source.sourceId
|
|
@@ -646,6 +647,68 @@ async function createStudioInstances(options) {
|
|
|
646
647
|
};
|
|
647
648
|
return {
|
|
648
649
|
read,
|
|
650
|
+
async readMountedBundle({ id, expectedRevision, bindingKey, paths = [] }) {
|
|
651
|
+
if (!Array.isArray(paths)) throw new Error("Select an exact list of mounted Bundle source paths.");
|
|
652
|
+
const request = paths.length ? normalizeStudioInstanceChanges({
|
|
653
|
+
id,
|
|
654
|
+
expectedRevision,
|
|
655
|
+
changes: paths.map((path) => ({
|
|
656
|
+
path,
|
|
657
|
+
content: ""
|
|
658
|
+
}))
|
|
659
|
+
}) : {
|
|
660
|
+
id,
|
|
661
|
+
expectedRevision,
|
|
662
|
+
changes: []
|
|
663
|
+
};
|
|
664
|
+
const selectedKey = runtimeNameOf(bindingKey);
|
|
665
|
+
return repository.transaction(async (tx) => {
|
|
666
|
+
const record = modern(await tx.read(request.id));
|
|
667
|
+
checkRevision(record, request.expectedRevision);
|
|
668
|
+
if (record.kind !== "kit") throw new Error("Select a Kit to read its mounted Bundles.");
|
|
669
|
+
const mount = record.mounts.find((item) => item.bindingKey === selectedKey);
|
|
670
|
+
if (!mount) throw new Error("Select a Bundle mounted by this Kit; read the mounts first.");
|
|
671
|
+
const captured = await resolveMounts(record.mounts, record.current === true)(mount.bundle);
|
|
672
|
+
const entries = new Map(captured.files.map((file) => [file.path, file]));
|
|
673
|
+
const availableFiles = captured.files.map((file) => {
|
|
674
|
+
const bytes = Buffer.byteLength(file.base64, "base64");
|
|
675
|
+
let readable = bytes <= MAX_TEXT;
|
|
676
|
+
try {
|
|
677
|
+
decode(file.base64);
|
|
678
|
+
} catch {
|
|
679
|
+
readable = false;
|
|
680
|
+
}
|
|
681
|
+
return {
|
|
682
|
+
path: file.path,
|
|
683
|
+
bytes,
|
|
684
|
+
readable
|
|
685
|
+
};
|
|
686
|
+
}).sort((a, b) => a.path.localeCompare(b.path));
|
|
687
|
+
const selected = request.changes.map(({ path }) => ({
|
|
688
|
+
path,
|
|
689
|
+
file: entries.get(path)
|
|
690
|
+
}));
|
|
691
|
+
if (selected.some(({ path, file }) => file && !availableFiles.find((info) => info.path === path).readable)) throw new Error("Mounted Bundle source must be UTF-8 text of at most 1 MiB per file.");
|
|
692
|
+
if (selected.reduce((bytes, { file }) => bytes + (file ? Buffer.byteLength(file.base64, "base64") : 0), 0) > STUDIO_INSTANCE_CHANGE_LIMITS.totalBytes) throw new Error("Mounted Bundle read exceeds the 4 MiB text budget; select fewer paths.");
|
|
693
|
+
return {
|
|
694
|
+
id: record.id,
|
|
695
|
+
revision: record.revision,
|
|
696
|
+
bindingKey: mount.bindingKey,
|
|
697
|
+
bundle: pin(mount.bundle),
|
|
698
|
+
sourceId: captured.sourceId,
|
|
699
|
+
readOnly: true,
|
|
700
|
+
availableFiles,
|
|
701
|
+
files: selected.map(({ path, file }) => file ? {
|
|
702
|
+
path,
|
|
703
|
+
exists: true,
|
|
704
|
+
content: decode(file.base64)
|
|
705
|
+
} : {
|
|
706
|
+
path,
|
|
707
|
+
exists: false
|
|
708
|
+
})
|
|
709
|
+
};
|
|
710
|
+
});
|
|
711
|
+
},
|
|
649
712
|
async captureKit({ id, expectedRevision } = {}) {
|
|
650
713
|
return repository.transaction(async (tx) => {
|
|
651
714
|
const record = modern(await tx.read(id));
|
|
@@ -778,13 +841,13 @@ async function createStudioInstances(options) {
|
|
|
778
841
|
changeReceipt: receipt
|
|
779
842
|
};
|
|
780
843
|
},
|
|
781
|
-
async list({ kind } = {}) {
|
|
844
|
+
async list({ kind, includeReadiness = true } = {}) {
|
|
782
845
|
if (kind !== void 0 && !["kit", "bundle"].includes(kind)) throw new Error("Unknown instance kind.");
|
|
783
846
|
const records = await repository.list();
|
|
784
847
|
return Promise.all(records.filter((record) => !record.deletedAt && (!kind || record.kind === kind)).map(async (record) => ({
|
|
785
848
|
...projection(record, records),
|
|
786
849
|
...await displayCopy(record),
|
|
787
|
-
...await readiness(record)
|
|
850
|
+
...includeReadiness ? await readiness(record) : {}
|
|
788
851
|
})));
|
|
789
852
|
},
|
|
790
853
|
async listBundles() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as requireThreadId } from "./codex-connection-1RvU1XCj.mjs";
|
|
2
|
-
import { t as startCompanion } from "./server-
|
|
2
|
+
import { t as startCompanion } from "./server-BnEtfptI.mjs";
|
|
3
3
|
import { isAbsolute, join } from "node:path";
|
|
4
4
|
import { writeFile } from "node:fs/promises";
|
|
5
5
|
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -261399,7 +261399,7 @@ function StudioGlyph({ bundle = false }) {
|
|
|
261399
261399
|
});
|
|
261400
261400
|
}
|
|
261401
261401
|
/** One card presentation for the Bundle catalog and Kit mount selection. */
|
|
261402
|
-
function BundleCard({ bundle, locale, badge, onBadgeClick, badgeLabel, children }) {
|
|
261402
|
+
function BundleCard({ bundle, locale, badge, onBadgeClick, badgeLabel, sourceLabel, children }) {
|
|
261403
261403
|
const description = bundle.displayDescription?.[locale] ?? bundle.description;
|
|
261404
261404
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
261405
261405
|
className: "ygd-studio-kit-card ygd-studio-bundle-card",
|
|
@@ -261423,8 +261423,8 @@ function BundleCard({ bundle, locale, badge, onBadgeClick, badgeLabel, children
|
|
|
261423
261423
|
}),
|
|
261424
261424
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
261425
261425
|
className: "ygd-studio-source-id",
|
|
261426
|
-
title: bundle.name,
|
|
261427
|
-
children: bundle.name
|
|
261426
|
+
title: sourceLabel ?? bundle.name,
|
|
261427
|
+
children: sourceLabel ?? bundle.name
|
|
261428
261428
|
}),
|
|
261429
261429
|
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
261430
261430
|
className: "ygd-studio-card-description",
|
|
@@ -262277,7 +262277,11 @@ function MountEditorSession({ client, record, locale, onSaved, onActions, onDirt
|
|
|
262277
262277
|
}, [owner]);
|
|
262278
262278
|
const keyOf = mountKey;
|
|
262279
262279
|
const choices = new Map(candidates.map((bundle) => [keyOf(bundle), bundle]));
|
|
262280
|
-
const
|
|
262280
|
+
const retained = (key) => {
|
|
262281
|
+
const mount = record.mounts.find((mount) => keyOf(mount.bundle) === key);
|
|
262282
|
+
return !!mount && !mount.bundle.instanceId && !mount.instanceId && !!mount.bundle.source?.snapshot && !!mount.bundle.source.sourceId;
|
|
262283
|
+
};
|
|
262284
|
+
const missing = [...selected].filter((key) => !choices.has(key) && !retained(key));
|
|
262281
262285
|
const available = candidates.filter((bundle) => !selected.has(keyOf(bundle)));
|
|
262282
262286
|
const filtered = available.filter((bundle) => [
|
|
262283
262287
|
bundle.name,
|
|
@@ -262440,7 +262444,7 @@ function MountEditorSession({ client, record, locale, onSaved, onActions, onDirt
|
|
|
262440
262444
|
layout: "inline",
|
|
262441
262445
|
tone: "info",
|
|
262442
262446
|
locale,
|
|
262443
|
-
title: zh ? "来源暂不可用" : "Source unavailable"
|
|
262447
|
+
title: retained(key) ? zh ? "引用随套件保留的来源" : "References source retained with this Kit" : zh ? "来源暂不可用" : "Source unavailable"
|
|
262444
262448
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
262445
262449
|
type: "button",
|
|
262446
262450
|
className: "ygd-studio-btn-secondary",
|
|
@@ -265381,6 +265385,7 @@ async function readStudioImportFiles(kind, selected, readArchive) {
|
|
|
265381
265385
|
if (!readArchive) throw Error("This host cannot read Studio archives.");
|
|
265382
265386
|
return readArchive(source);
|
|
265383
265387
|
};
|
|
265388
|
+
if (/\.zip$/i.test(path) && !isStudioZip(bytes)) throw Error("Invalid ZIP archive: choose a valid ZIP file.");
|
|
265384
265389
|
if (isStudioZip(bytes)) {
|
|
265385
265390
|
const entries = readStudioZipEntries(bytes);
|
|
265386
265391
|
if (entries.has("studio-manifest.json")) archive = await checkedArchive(decodeStudioContentZip(bytes));
|
|
@@ -265412,6 +265417,7 @@ const HTTP_BYTES = 12582912;
|
|
|
265412
265417
|
/** Presentation only: preserve the validator's detail without exposing its virtual root. */
|
|
265413
265418
|
function formatStudioImportError(error, locale) {
|
|
265414
265419
|
const lines = error.replaceAll("/studio-content-archive-virtual/", "").split("\n").map((line) => {
|
|
265420
|
+
if (/^Invalid ZIP archive:/i.test(line)) return locale === "zh" ? "所选文件不是有效的 ZIP 压缩包,请检查文件格式。" : line;
|
|
265415
265421
|
const missing = line.match(/^Missing required file: (.+)$/i) ?? line.match(/^[^\n]*?: missing (?:[^\n]*? )?file (.+)$/i);
|
|
265416
265422
|
if (missing) return locale === "zh" ? `缺少必需文件:${missing[1]}` : `Missing required file: ${missing[1]}`;
|
|
265417
265423
|
return line;
|
|
@@ -265781,6 +265787,7 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
265781
265787
|
const [trialTarget, setTrialTarget] = (0, import_react.useState)(null);
|
|
265782
265788
|
const [fileLocationOpen, setFileLocationOpen] = (0, import_react.useState)(false);
|
|
265783
265789
|
const [mountsOpen, setMountsOpen] = (0, import_react.useState)(false);
|
|
265790
|
+
const [localMountRecord, setLocalMountRecord] = (0, import_react.useState)();
|
|
265784
265791
|
const mountRequest = (0, import_react.useRef)();
|
|
265785
265792
|
const [mountQuery, setMountQuery] = (0, import_react.useState)("");
|
|
265786
265793
|
const [archiveBusy, setArchiveBusy] = (0, import_react.useState)(false);
|
|
@@ -265812,11 +265819,13 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
265812
265819
|
}, [contentClient]);
|
|
265813
265820
|
const createGeneration = (0, import_react.useRef)(0);
|
|
265814
265821
|
const draftDirty = (0, import_react.useRef)(false);
|
|
265822
|
+
const sourceDirty = (0, import_react.useRef)(false);
|
|
265815
265823
|
const panelDirty = (0, import_react.useRef)(false), trialDirty = (0, import_react.useRef)(false);
|
|
265816
265824
|
const reportPreviewDirty = (kind, value) => {
|
|
265817
265825
|
if (kind === "panel") panelDirty.current = value;
|
|
265818
265826
|
else trialDirty.current = value;
|
|
265819
265827
|
draftDirty.current = panelDirty.current || trialDirty.current;
|
|
265828
|
+
sourceDirty.current = draftDirty.current;
|
|
265820
265829
|
onDraftDirtyChange?.(draftDirty.current);
|
|
265821
265830
|
};
|
|
265822
265831
|
(0, import_react.useEffect)(() => {
|
|
@@ -265899,6 +265908,7 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
265899
265908
|
panelDirty.current = false;
|
|
265900
265909
|
trialDirty.current = false;
|
|
265901
265910
|
draftDirty.current = false;
|
|
265911
|
+
sourceDirty.current = false;
|
|
265902
265912
|
authoringDirty.current = false;
|
|
265903
265913
|
onDraftDirtyChange?.(false);
|
|
265904
265914
|
setInitialPrompt(void 0);
|
|
@@ -265925,7 +265935,7 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
265925
265935
|
}
|
|
265926
265936
|
};
|
|
265927
265937
|
const exportInstance = (record) => {
|
|
265928
|
-
if (!contentClient || record.deletedAt || record.id === instanceId &&
|
|
265938
|
+
if (!contentClient || record.deletedAt || record.id === instanceId && sourceDirty.current) return;
|
|
265929
265939
|
exportContent({
|
|
265930
265940
|
id: record.id,
|
|
265931
265941
|
expectedRevision: record.revision
|
|
@@ -266074,6 +266084,7 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
266074
266084
|
await refreshInstances();
|
|
266075
266085
|
if (request !== createGeneration.current) return;
|
|
266076
266086
|
draftDirty.current = false;
|
|
266087
|
+
sourceDirty.current = false;
|
|
266077
266088
|
onDraftDirtyChange?.(false);
|
|
266078
266089
|
setAuthoringIntent("edit");
|
|
266079
266090
|
setInstanceMode("read");
|
|
@@ -266110,6 +266121,7 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
266110
266121
|
await refreshInstances();
|
|
266111
266122
|
if (request !== createGeneration.current) return;
|
|
266112
266123
|
draftDirty.current = false;
|
|
266124
|
+
sourceDirty.current = false;
|
|
266113
266125
|
authoringDirty.current = false;
|
|
266114
266126
|
onDraftDirtyChange?.(false);
|
|
266115
266127
|
setAuthoringIntent("edit");
|
|
@@ -266213,76 +266225,104 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
266213
266225
|
if (request === createGeneration.current) setCreating(false);
|
|
266214
266226
|
}
|
|
266215
266227
|
};
|
|
266216
|
-
const localCards = (kind) => visibleLocalInstances(kind).map((record) =>
|
|
266217
|
-
|
|
266218
|
-
|
|
266219
|
-
|
|
266220
|
-
|
|
266221
|
-
|
|
266222
|
-
|
|
266223
|
-
|
|
266224
|
-
|
|
266225
|
-
|
|
266226
|
-
|
|
266227
|
-
|
|
266228
|
-
|
|
266229
|
-
|
|
266230
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
266231
|
-
className: "ygd-studio-card-description",
|
|
266232
|
-
children: renderStudioMarkdown(record.displayDescription?.[locale] ?? record.description ?? "")
|
|
266228
|
+
const localCards = (kind) => visibleLocalInstances(kind).map((record) => {
|
|
266229
|
+
const warning = record.readiness && !record.readiness.ready && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266230
|
+
type: "button",
|
|
266231
|
+
className: "ygd-studio-btn-link ygd-studio-import-warning",
|
|
266232
|
+
onClick: () => setIncompleteImport(record),
|
|
266233
|
+
children: locale === "zh" ? "⚠ 待完善" : "⚠ Incomplete"
|
|
266234
|
+
});
|
|
266235
|
+
const actions = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
266236
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266237
|
+
type: "button",
|
|
266238
|
+
className: "ygd-studio-btn-secondary",
|
|
266239
|
+
disabled: creating,
|
|
266240
|
+
onClick: () => openLocal(record, "read"),
|
|
266241
|
+
children: locale === "zh" ? "打开" : "Open"
|
|
266233
266242
|
}),
|
|
266234
|
-
|
|
266243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266235
266244
|
type: "button",
|
|
266236
|
-
className: "ygd-studio-btn-
|
|
266237
|
-
|
|
266238
|
-
|
|
266245
|
+
className: "ygd-studio-btn-secondary",
|
|
266246
|
+
disabled: creating,
|
|
266247
|
+
onClick: () => void copyInstalled(record.kind, record.source.kit, record.source.bundle, record.id),
|
|
266248
|
+
children: locale === "zh" ? "复制" : "Copy"
|
|
266239
266249
|
}),
|
|
266240
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
266241
|
-
|
|
266242
|
-
|
|
266250
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266251
|
+
type: "button",
|
|
266252
|
+
className: "ygd-studio-btn-secondary",
|
|
266253
|
+
disabled: creating,
|
|
266254
|
+
onClick: () => openLocal(record, "edit"),
|
|
266255
|
+
children: locale === "zh" ? "编辑" : "Edit"
|
|
266243
266256
|
}),
|
|
266244
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
266245
|
-
|
|
266246
|
-
children: [
|
|
266247
|
-
|
|
266248
|
-
|
|
266249
|
-
|
|
266250
|
-
|
|
266251
|
-
|
|
266252
|
-
|
|
266253
|
-
|
|
266254
|
-
|
|
266255
|
-
|
|
266256
|
-
|
|
266257
|
-
disabled: creating,
|
|
266258
|
-
onClick: () => void copyInstalled(record.kind, record.source.kit, record.source.bundle, record.id),
|
|
266259
|
-
children: locale === "zh" ? "复制" : "Copy"
|
|
266260
|
-
}),
|
|
266261
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266262
|
-
type: "button",
|
|
266263
|
-
className: "ygd-studio-btn-secondary",
|
|
266264
|
-
disabled: creating,
|
|
266265
|
-
onClick: () => openLocal(record, "edit"),
|
|
266266
|
-
children: locale === "zh" ? "编辑" : "Edit"
|
|
266267
|
-
}),
|
|
266268
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InstanceActionsMenu, {
|
|
266269
|
-
locale,
|
|
266270
|
-
children: [contentClient && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266271
|
-
className: "ygd-studio-btn-link",
|
|
266272
|
-
type: "button",
|
|
266273
|
-
disabled: creating || archiveBusy,
|
|
266274
|
-
onClick: () => exportInstance(record),
|
|
266275
|
-
children: locale === "zh" ? "导出" : "Export"
|
|
266276
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstanceTrashAction, {
|
|
266277
|
-
locale,
|
|
266278
|
-
disabled: creating,
|
|
266279
|
-
onClick: () => void removeLocal(record)
|
|
266280
|
-
})]
|
|
266281
|
-
})
|
|
266282
|
-
]
|
|
266257
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(InstanceActionsMenu, {
|
|
266258
|
+
locale,
|
|
266259
|
+
children: [contentClient && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
|
266260
|
+
className: "ygd-studio-btn-link",
|
|
266261
|
+
type: "button",
|
|
266262
|
+
disabled: creating || archiveBusy,
|
|
266263
|
+
onClick: () => exportInstance(record),
|
|
266264
|
+
children: locale === "zh" ? "导出" : "Export"
|
|
266265
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InstanceTrashAction, {
|
|
266266
|
+
locale,
|
|
266267
|
+
disabled: creating,
|
|
266268
|
+
onClick: () => void removeLocal(record)
|
|
266269
|
+
})]
|
|
266283
266270
|
})
|
|
266284
|
-
]
|
|
266285
|
-
|
|
266271
|
+
] });
|
|
266272
|
+
const bundle = record.bundle ?? record.source.bundle;
|
|
266273
|
+
if (kind === "bundle" && bundle) {
|
|
266274
|
+
const uses = new Set(record.refs.map((ref) => ref.id)).size;
|
|
266275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(BundleCard, {
|
|
266276
|
+
bundle: {
|
|
266277
|
+
...bundle,
|
|
266278
|
+
title: record.title,
|
|
266279
|
+
description: record.description,
|
|
266280
|
+
displayDescription: record.displayDescription
|
|
266281
|
+
},
|
|
266282
|
+
locale,
|
|
266283
|
+
sourceLabel: locale === "zh" ? "本地内容 · 已保存 · 可编辑" : "Local content · Saved · editable",
|
|
266284
|
+
badge: `${uses} Kit`,
|
|
266285
|
+
badgeLabel: locale === "zh" ? `${uses} Kit · 查看挂载` : `${uses} Kit · View mounts`,
|
|
266286
|
+
onBadgeClick: () => setLocalMountRecord(record),
|
|
266287
|
+
children: [warning, actions]
|
|
266288
|
+
}, record.id);
|
|
266289
|
+
}
|
|
266290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
|
|
266291
|
+
className: "ygd-studio-kit-card",
|
|
266292
|
+
children: [
|
|
266293
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
266294
|
+
className: "ygd-studio-card-top",
|
|
266295
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StudioGlyph, { bundle: kind === "bundle" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
266296
|
+
className: "ygd-studio-card-pill",
|
|
266297
|
+
children: locale === "zh" ? "本地内容" : "Local content"
|
|
266298
|
+
})]
|
|
266299
|
+
}),
|
|
266300
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", {
|
|
266301
|
+
className: "ygd-studio-kit-card-name",
|
|
266302
|
+
children: record.title[locale]
|
|
266303
|
+
}),
|
|
266304
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
266305
|
+
className: "ygd-studio-card-description",
|
|
266306
|
+
children: renderStudioMarkdown(record.displayDescription?.[locale] ?? record.description ?? "")
|
|
266307
|
+
}),
|
|
266308
|
+
warning,
|
|
266309
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
266310
|
+
className: "ygd-studio-card-meta",
|
|
266311
|
+
children: locale === "zh" ? "已保存 · 可编辑" : "Saved · editable"
|
|
266312
|
+
}),
|
|
266313
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
266314
|
+
className: "ygd-studio-kit-card-actions",
|
|
266315
|
+
children: actions
|
|
266316
|
+
})
|
|
266317
|
+
]
|
|
266318
|
+
}, record.id);
|
|
266319
|
+
});
|
|
266320
|
+
const mountBundle = localMountRecord?.bundle ?? localMountRecord?.source.bundle ?? (mountsOpen ? bundleWorkspace : void 0);
|
|
266321
|
+
const closeMounts = () => {
|
|
266322
|
+
setLocalMountRecord(void 0);
|
|
266323
|
+
setMountsOpen(false);
|
|
266324
|
+
refreshInstances().catch((error) => setAuthoringError(String(error)));
|
|
266325
|
+
};
|
|
266286
266326
|
const bundleContextKit = () => {
|
|
266287
266327
|
if (!bundleWorkspace) return void 0;
|
|
266288
266328
|
const candidates = (snapshot.view?.bundles.find((item) => item.name === bundleWorkspace.name && item.version === bundleWorkspace.version))?.usedBy ?? snapshot.view?.kits.filter((kit) => kit.name === bundleWorkspace.kit) ?? [];
|
|
@@ -266521,20 +266561,6 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
266521
266561
|
]
|
|
266522
266562
|
})] })
|
|
266523
266563
|
}),
|
|
266524
|
-
mountsOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StudioDialog, {
|
|
266525
|
-
title: `${locale === "zh" ? "挂载管理" : "Mount Management"} · ${bundleWorkspace.name}`,
|
|
266526
|
-
close: () => setMountsOpen(false),
|
|
266527
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleMounts, {
|
|
266528
|
-
onEditKit: instances?.editCurrent ? (kit) => {
|
|
266529
|
-
setMountsOpen(false);
|
|
266530
|
-
editInstalled("kit", kit);
|
|
266531
|
-
} : void 0,
|
|
266532
|
-
client: instances,
|
|
266533
|
-
bundle: bundleWorkspace,
|
|
266534
|
-
installed: snapshot.view?.bundles.find((bundle) => bundle.name === bundleWorkspace.name && bundle.version === bundleWorkspace.version)?.usedBy ?? [],
|
|
266535
|
-
locale
|
|
266536
|
-
})
|
|
266537
|
-
}),
|
|
266538
266564
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
266539
266565
|
className: "ygd-studio-workplane-bar",
|
|
266540
266566
|
"aria-label": "Bundle content",
|
|
@@ -266862,8 +266888,9 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
266862
266888
|
setInstanceId(record?.id);
|
|
266863
266889
|
refreshInstances().catch((error) => setAuthoringError(String(error)));
|
|
266864
266890
|
},
|
|
266865
|
-
onDirtyChange: (value) => {
|
|
266891
|
+
onDirtyChange: (value, state) => {
|
|
266866
266892
|
draftDirty.current = value;
|
|
266893
|
+
sourceDirty.current = state?.sourceDirty ?? value;
|
|
266867
266894
|
onDraftDirtyChange?.(value || authoringDirty.current);
|
|
266868
266895
|
}
|
|
266869
266896
|
}, instanceMode === "edit" ? renderInstanceWorkbench : void 0) : bundleMain !== void 0 ? bundleMain : snapshot.section === "bundles" ? bundlesListMain : kitMain });
|
|
@@ -267114,6 +267141,20 @@ function StudioWorkspace({ client, controller: supplied, authoring, renderPrevie
|
|
|
267114
267141
|
if (files.length) importFiles(files, importKind.current);
|
|
267115
267142
|
}
|
|
267116
267143
|
})] }),
|
|
267144
|
+
mountBundle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StudioDialog, {
|
|
267145
|
+
title: `${locale === "zh" ? "挂载管理" : "Mount Management"} · ${localMountRecord?.title[locale] ?? mountBundle.name}`,
|
|
267146
|
+
close: closeMounts,
|
|
267147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BundleMounts, {
|
|
267148
|
+
onEditKit: instances?.editCurrent ? (kit) => {
|
|
267149
|
+
closeMounts();
|
|
267150
|
+
editInstalled("kit", kit);
|
|
267151
|
+
} : void 0,
|
|
267152
|
+
client: instances,
|
|
267153
|
+
bundle: mountBundle,
|
|
267154
|
+
installed: localMountRecord ? [] : snapshot.view?.bundles.find((bundle) => bundle.name === mountBundle.name && bundle.version === mountBundle.version)?.usedBy ?? [],
|
|
267155
|
+
locale
|
|
267156
|
+
})
|
|
267157
|
+
}),
|
|
267117
267158
|
incompleteImport && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StudioDialog, {
|
|
267118
267159
|
title: locale === "zh" ? "已导入,内容待完善" : "Imported — needs completion",
|
|
267119
267160
|
close: () => setIncompleteImport(void 0),
|