@pstdio/workbench 0.44.0 → 0.45.0-nightly.20261020145025

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pstdio/workbench",
3
- "version": "0.44.0",
3
+ "version": "0.45.0-nightly.20261020145025",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/pufflyai/prompt-studio"
@@ -43,8 +43,8 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@dnd-kit/core": "^6.3.1",
46
- "@pstdio/sdk": "^0.44.0",
47
- "@pstdio/ui": "^0.44.0",
46
+ "@pstdio/sdk": "^0.45.0-nightly.20261020145025",
47
+ "@pstdio/ui": "^0.45.0-nightly.20261020145025",
48
48
  "@tanstack/react-hotkeys": "0.10.0",
49
49
  "lucide-react": "^0.557.0",
50
50
  "rimless": "0.8.3",
@@ -1,120 +0,0 @@
1
- import { b as e, in as t, x as n } from "./workbench-renderers-Bz_dLyHW.js";
2
- import { resourceKey as r } from "@pstdio/sdk/extensions";
3
- //#region src/core/registries/navigation/navigation-tree-registry.ts
4
- var i = "navigation.root", a = (e = "content") => e === "content" ? i : `navigation.${e}`, o = (e) => `${e.kind}:${e.extensionId}:${e.id}`, s = (e, t) => o(e) === o(t), c = (e) => (t, n) => {
5
- let r = t.sourceExtensionId === e.extensionId;
6
- if (r !== (n.sourceExtensionId === e.extensionId)) return r ? -1 : 1;
7
- if (!r) {
8
- let e = t.sourceExtensionId.localeCompare(n.sourceExtensionId);
9
- if (e !== 0) return e;
10
- }
11
- return t.declarationIndex - n.declarationIndex || t.id.localeCompare(n.id);
12
- }, l = (e, t) => e ? `${e}:${t}` : t, u = (e, t) => ({
13
- ...t,
14
- resource: e.resolveResource ? e.resolveResource(t.resource) : t.resource
15
- }), d = (e, t) => {
16
- let n = e.findIndex((e) => e.id === t.id);
17
- if (n < 0) {
18
- e.push(t);
19
- return;
20
- }
21
- let r = e[n];
22
- e[n] = {
23
- ...r,
24
- nodes: [...r.nodes, ...t.nodes]
25
- };
26
- }, f = (i = {}) => {
27
- let f = /* @__PURE__ */ new Map(), p = {}, m = /* @__PURE__ */ new Set(), h = () => {
28
- for (let e of m) e();
29
- }, g = (e, t) => [...f.values()].filter((n) => s(n.owner, e) && (n.slot ?? "content") === t).sort(c(e)), _ = (e, t, r, i) => {
30
- let a = {
31
- ...e,
32
- id: l(t.idScope, e.id),
33
- moveScope: r,
34
- canHide: e.canHide ?? t.owner.kind === "mode",
35
- canReorder: e.canReorder ?? t.owner.kind === "mode",
36
- children: e.children?.map((e) => _(e, t, r, i))
37
- };
38
- return n(a, {
39
- contribution: t,
40
- node: e,
41
- resource: i,
42
- registryToken: p
43
- }), a;
44
- }, v = (e, t, n, r) => ({
45
- ...e,
46
- id: t.sourceExtensionId !== n.extensionId && !e.label ? a(t.slot) : l(t.idScope, e.id),
47
- moveScope: o(n),
48
- canHide: e.canHide ?? !0,
49
- canReorder: e.canReorder ?? !0,
50
- nodes: e.nodes.map((e) => _(e, t, o(n), r))
51
- });
52
- return {
53
- registerContribution(e) {
54
- if (f.has(e.id)) throw Error(`Navigation tree contribution already registered: ${e.id}`);
55
- if (!e.viewId && !e.getSections) throw Error(`Navigation tree contribution must declare a viewId or getSections: ${e.id}`);
56
- f.set(e.id, e);
57
- let n = e.viewId ? i.subscribeViewRefresh?.(e.viewId, h) : void 0;
58
- return h(), t(() => {
59
- f.get(e.id) === e && (n?.dispose(), f.delete(e.id), h());
60
- });
61
- },
62
- resolveOwner(e, t, n) {
63
- return [...f.values()].find((r) => r.owner.kind === e && r.owner.id === t && (!n || (r.slot ?? "content") === n))?.owner;
64
- },
65
- getReadKey(e, t = {}) {
66
- return JSON.stringify([
67
- "header",
68
- "content",
69
- "footer"
70
- ].flatMap((n) => g(e, n).map((e) => [e.id, r(u(e, t).resource)])));
71
- },
72
- async getSections(e, t = "content", n = {}) {
73
- let r = [];
74
- for (let a of g(e, t)) {
75
- n.signal?.throwIfAborted();
76
- let t = u(a, n), o = a.viewId ? await i.getViewSections?.(a.viewId, t) : await a.getSections?.(t);
77
- n.signal?.throwIfAborted();
78
- for (let n of o ?? []) d(r, v(n, a, e, t.resource));
79
- }
80
- return r;
81
- },
82
- async getChildren(t, n = {}) {
83
- n.signal?.throwIfAborted();
84
- let r = e(t, p);
85
- if (!r) return t.children ?? [];
86
- let a = t.moveScope ?? o(r.contribution.owner), s = {
87
- ...n,
88
- resource: r.resource
89
- }, c = r.contribution.viewId ? await i.getViewChildren?.(r.contribution.viewId, r.node, s) : await r.contribution.getChildren?.(r.node, s);
90
- return c ? c.map((e) => _(e, r.contribution, a, r.resource)) : t.children ?? [];
91
- },
92
- async moveNode(t, n, r = {}) {
93
- let a = e(t, p), o = n ? e(n, p) : void 0;
94
- a?.contribution.viewId && a.node.canDrag && (!n || o && a.contribution === o.contribution && o.node.canDrop) && await i.moveViewNode?.(a.contribution.viewId, a.node, o?.node, {
95
- ...r,
96
- resource: a.resource
97
- });
98
- },
99
- getDefaultExpandedSectionIds(e, t) {
100
- return (t ? [t] : [
101
- "header",
102
- "content",
103
- "footer"
104
- ]).flatMap((t) => g(e, t).flatMap((e) => (e.defaultExpandedSectionIds ?? (e.viewId ? i.getViewDefaultExpandedSectionIds?.(e.viewId) : void 0) ?? []).map((t) => l(e.idScope, t))));
105
- },
106
- onDidChange(e) {
107
- return m.add(e), t(() => m.delete(e));
108
- },
109
- listActions() {
110
- return [...f.values()].flatMap((e) => (e.listActions?.() ?? []).map((t) => ({
111
- ...t,
112
- ownerId: e.sourceExtensionId
113
- })));
114
- }
115
- };
116
- };
117
- //#endregion
118
- export { a as n, f as t };
119
-
120
- //# sourceMappingURL=navigation-tree-registry-C5l3eO3n.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"navigation-tree-registry-C5l3eO3n.js","names":["resourceKey","createDisposable","Disposable","TreeNode","TreeViewSection","ResourceRef","NavigationTarget","getNavigationTreeNodeSource","setNavigationTreeNodeSource","DeclaredNavigationAction","label","action","category","NavigationTreeSlot","NavigationTreeOwner","kind","id","extensionId","NavigationTreeContext","resource","signal","AbortSignal","NavigationTreeMoveContext","position","NavigationTreeContribution","idScope","owner","sourceExtensionId","declarationIndex","slot","viewId","defaultExpandedSectionIds","resolveResource","getSections","context","Promise","getChildren","node","listActions","CreateNavigationTreeRegistryInput","subscribeViewRefresh","listener","getViewDefaultExpandedSectionIds","getViewSections","getViewChildren","moveViewNode","source","target","NavigationTreeRegistry","ownerId","registerContribution","contribution","resolveOwner","getReadKey","moveNode","getDefaultExpandedSectionIds","onDidChange","navigationRootSectionId","navigationSlotRootSectionId","ownersEqual","left","right","contributionOrder","leftOwn","rightOwn","extensionOrder","localeCompare","scopedId","scope","readContext","mergeSection","sections","section","index","findIndex","candidate","push","current","nodes","createNavigationTreeRegistry","input","contributions","Map","registryToken","listeners","Set","emit","matching","values","filter","sort","projectNode","moveScope","projected","canHide","canReorder","children","map","child","projectSection","has","Error","set","refreshSubscription","undefined","get","dispose","delete","find","JSON","stringify","const","flatMap","throwIfAborted","query","sourceSections","sourceNode","targetNode","canDrag","canDrop","selectedSlot","slots","add","getNavigationTreeNodeSource","createDisposable","setNavigationTreeNodeSource","navigationRootSectionId","navigationSlotRootSectionId","slot","ownerId","owner","ownersEqual","left","right","contributionOrder","leftOwn","extensionOrder","scopedId","scope","id","readContext","context","contribution","mergeSection","index","sections","candidate","section","current","createNavigationTreeRegistry","contributions","registryToken","listeners","emit","listener","matching","projectNode","projected","node","child","moveScope","resource","projectSection","refreshSubscription","input","kind","resourceKey","query","sourceSections","source","children","sourceNode","target","targetNode","selectedSlot","action"],"sources":["../src/core/registries/navigation/navigation-tree-registry.ts"],"sourcesContent":["import { resourceKey } from \"@pstdio/sdk/extensions\";\nimport { createDisposable, type Disposable } from \"../../shared/disposable\";\nimport type { TreeNode, TreeViewSection } from \"../renderers/tree-renderer-registry\";\nimport type { ResourceRef } from \"../resources/resource-registry\";\nimport type { NavigationTarget } from \"./navigation-registry\";\nimport { getNavigationTreeNodeSource, setNavigationTreeNodeSource } from \"./navigation-tree-node-source\";\n\nexport interface DeclaredNavigationAction {\n label: string;\n action: NavigationTarget;\n category?: string;\n}\n\nexport type NavigationTreeSlot = \"header\" | \"content\" | \"footer\";\n\nexport interface NavigationTreeOwner {\n kind: \"mode\" | \"page\";\n id: string;\n extensionId: string;\n}\n\nexport interface NavigationTreeContext {\n resource?: ResourceRef;\n signal?: AbortSignal;\n}\n\nexport interface NavigationTreeMoveContext extends NavigationTreeContext {\n position?: \"before\" | \"after\" | \"inside\";\n}\n\nexport interface NavigationTreeContribution {\n id: string;\n /** Prefix projected section and node ids when they come from an independent tree renderer. */\n idScope?: string;\n owner: NavigationTreeOwner;\n sourceExtensionId: string;\n declarationIndex: number;\n slot?: NavigationTreeSlot;\n viewId?: string;\n defaultExpandedSectionIds?: string[];\n /** Resolve the data resource independently of the selected navigation item. */\n resolveResource?(resource: ResourceRef | undefined): ResourceRef | undefined;\n getSections?(context: NavigationTreeContext): Promise<TreeViewSection[]> | TreeViewSection[];\n getChildren?(node: TreeNode, context: NavigationTreeContext): Promise<TreeNode[]> | TreeNode[];\n /** Authored actions for discovery, independent of tree data and visibility context. */\n listActions?(): DeclaredNavigationAction[];\n}\n\nexport interface CreateNavigationTreeRegistryInput {\n subscribeViewRefresh?(viewId: string, listener: () => void): Disposable;\n getViewDefaultExpandedSectionIds?(viewId: string): readonly string[] | undefined;\n getViewSections?(viewId: string, context: NavigationTreeContext): Promise<TreeViewSection[]> | TreeViewSection[];\n getViewChildren?(viewId: string, node: TreeNode, context: NavigationTreeContext): Promise<TreeNode[]> | TreeNode[];\n moveViewNode?(\n viewId: string,\n source: TreeNode,\n target: TreeNode | undefined,\n context: NavigationTreeMoveContext,\n ): Promise<void> | void;\n}\n\nexport interface NavigationTreeRegistry {\n listActions(): (DeclaredNavigationAction & { ownerId: string })[];\n registerContribution(contribution: NavigationTreeContribution): Disposable;\n resolveOwner(\n kind: NavigationTreeOwner[\"kind\"],\n id: string,\n slot?: NavigationTreeSlot,\n ): NavigationTreeOwner | undefined;\n getReadKey(owner: NavigationTreeOwner, context?: NavigationTreeContext): string;\n getSections(\n owner: NavigationTreeOwner,\n slot?: NavigationTreeSlot,\n context?: NavigationTreeContext,\n ): Promise<TreeViewSection[]>;\n getChildren(node: TreeNode, context?: NavigationTreeContext): Promise<TreeNode[]>;\n moveNode(source: TreeNode, target: TreeNode | undefined, context?: NavigationTreeMoveContext): Promise<void>;\n getDefaultExpandedSectionIds(owner: NavigationTreeOwner, slot?: NavigationTreeSlot): string[];\n onDidChange(listener: () => void): Disposable;\n}\n\n// The owner's top-level section. Extensions add ungrouped entries here and use a labeled section for a named group.\nexport const navigationRootSectionId = \"navigation.root\";\n// Each slot keeps its own root, so pinned header and footer rows never share a section id with the body.\nexport const navigationSlotRootSectionId = (slot: NavigationTreeSlot = \"content\") =>\n slot === \"content\" ? navigationRootSectionId : `navigation.${slot}`;\n\nconst ownerId = (owner: NavigationTreeOwner) => `${owner.kind}:${owner.extensionId}:${owner.id}`;\n\nconst ownersEqual = (left: NavigationTreeOwner, right: NavigationTreeOwner) => ownerId(left) === ownerId(right);\n\nconst contributionOrder =\n (owner: NavigationTreeOwner) => (left: NavigationTreeContribution, right: NavigationTreeContribution) => {\n const leftOwn = left.sourceExtensionId === owner.extensionId;\n const rightOwn = right.sourceExtensionId === owner.extensionId;\n if (leftOwn !== rightOwn) return leftOwn ? -1 : 1;\n if (!leftOwn) {\n const extensionOrder = left.sourceExtensionId.localeCompare(right.sourceExtensionId);\n if (extensionOrder !== 0) return extensionOrder;\n }\n return left.declarationIndex - right.declarationIndex || left.id.localeCompare(right.id);\n };\n\nconst scopedId = (scope: string | undefined, id: string) => (scope ? `${scope}:${id}` : id);\n\nconst readContext = (contribution: NavigationTreeContribution, context: NavigationTreeContext) => ({\n ...context,\n resource: contribution.resolveResource ? contribution.resolveResource(context.resource) : context.resource,\n});\n\nconst mergeSection = (sections: TreeViewSection[], section: TreeViewSection) => {\n const index = sections.findIndex((candidate) => candidate.id === section.id);\n if (index < 0) {\n sections.push(section);\n return;\n }\n const current = sections[index]!;\n sections[index] = { ...current, nodes: [...current.nodes, ...section.nodes] };\n};\n\nexport const createNavigationTreeRegistry = (input: CreateNavigationTreeRegistryInput = {}): NavigationTreeRegistry => {\n const contributions = new Map<string, NavigationTreeContribution>();\n const registryToken = {};\n const listeners = new Set<() => void>();\n const emit = () => {\n for (const listener of listeners) listener();\n };\n\n const matching = (owner: NavigationTreeOwner, slot: NavigationTreeSlot) =>\n [...contributions.values()]\n .filter((contribution) => ownersEqual(contribution.owner, owner) && (contribution.slot ?? \"content\") === slot)\n .sort(contributionOrder(owner));\n\n const projectNode = (\n node: TreeNode,\n contribution: NavigationTreeContribution,\n moveScope: string,\n resource?: ResourceRef,\n ): TreeNode => {\n const projected: TreeNode = {\n ...node,\n id: scopedId(contribution.idScope, node.id),\n moveScope,\n // Mode rows are navigation links users may hide and arrange; page-owned level rows are data such as notes\n // or sessions, which keep the order their owner gives them unless a row opts in.\n canHide: node.canHide ?? contribution.owner.kind === \"mode\",\n canReorder: node.canReorder ?? contribution.owner.kind === \"mode\",\n children: node.children?.map((child) => projectNode(child, contribution, moveScope, resource)),\n };\n setNavigationTreeNodeSource(projected, { contribution, node, resource, registryToken });\n return projected;\n };\n\n const projectSection = (\n section: TreeViewSection,\n contribution: NavigationTreeContribution,\n owner: NavigationTreeOwner,\n resource?: ResourceRef,\n ): TreeViewSection => ({\n ...section,\n id:\n contribution.sourceExtensionId !== owner.extensionId && !section.label\n ? navigationSlotRootSectionId(contribution.slot)\n : scopedId(contribution.idScope, section.id),\n moveScope: ownerId(owner),\n canHide: section.canHide ?? true,\n canReorder: section.canReorder ?? true,\n nodes: section.nodes.map((node) => projectNode(node, contribution, ownerId(owner), resource)),\n });\n\n return {\n registerContribution(contribution) {\n if (contributions.has(contribution.id)) {\n throw new Error(`Navigation tree contribution already registered: ${contribution.id}`);\n }\n if (!contribution.viewId && !contribution.getSections) {\n throw new Error(`Navigation tree contribution must declare a viewId or getSections: ${contribution.id}`);\n }\n contributions.set(contribution.id, contribution);\n const refreshSubscription = contribution.viewId\n ? input.subscribeViewRefresh?.(contribution.viewId, emit)\n : undefined;\n emit();\n return createDisposable(() => {\n if (contributions.get(contribution.id) !== contribution) return;\n refreshSubscription?.dispose();\n contributions.delete(contribution.id);\n emit();\n });\n },\n\n resolveOwner(kind, id, slot) {\n return [...contributions.values()].find(\n (contribution) =>\n contribution.owner.kind === kind &&\n contribution.owner.id === id &&\n (!slot || (contribution.slot ?? \"content\") === slot),\n )?.owner;\n },\n\n getReadKey(owner, context = {}) {\n return JSON.stringify(\n ([\"header\", \"content\", \"footer\"] as const).flatMap((slot) =>\n matching(owner, slot).map((contribution) => [\n contribution.id,\n resourceKey(readContext(contribution, context).resource),\n ]),\n ),\n );\n },\n\n async getSections(owner, slot = \"content\", context = {}) {\n const sections: TreeViewSection[] = [];\n for (const contribution of matching(owner, slot)) {\n context.signal?.throwIfAborted();\n const query = readContext(contribution, context);\n const sourceSections = contribution.viewId\n ? await input.getViewSections?.(contribution.viewId, query)\n : await contribution.getSections?.(query);\n context.signal?.throwIfAborted();\n for (const section of sourceSections ?? []) {\n mergeSection(sections, projectSection(section, contribution, owner, query.resource));\n }\n }\n return sections;\n },\n\n async getChildren(node, context = {}) {\n context.signal?.throwIfAborted();\n const source = getNavigationTreeNodeSource(node, registryToken);\n if (!source) return node.children ?? [];\n const moveScope = node.moveScope ?? ownerId(source.contribution.owner);\n const query = { ...context, resource: source.resource };\n const children = source.contribution.viewId\n ? await input.getViewChildren?.(source.contribution.viewId, source.node, query)\n : await source.contribution.getChildren?.(source.node, query);\n if (!children) return node.children ?? [];\n return children.map((child) => projectNode(child, source.contribution, moveScope, source.resource));\n },\n\n async moveNode(sourceNode, targetNode, context = {}) {\n const source = getNavigationTreeNodeSource(sourceNode, registryToken);\n const target = targetNode ? getNavigationTreeNodeSource(targetNode, registryToken) : undefined;\n if (!source?.contribution.viewId || !source.node.canDrag) return;\n if (targetNode && (!target || source.contribution !== target.contribution || !target.node.canDrop)) return;\n await input.moveViewNode?.(source.contribution.viewId, source.node, target?.node, {\n ...context,\n resource: source.resource,\n });\n },\n\n getDefaultExpandedSectionIds(owner, selectedSlot) {\n const slots: readonly NavigationTreeSlot[] = selectedSlot ? [selectedSlot] : [\"header\", \"content\", \"footer\"];\n return slots.flatMap((slot) =>\n matching(owner, slot).flatMap((contribution) =>\n (\n contribution.defaultExpandedSectionIds ??\n (contribution.viewId ? input.getViewDefaultExpandedSectionIds?.(contribution.viewId) : undefined) ??\n []\n ).map((id) => scopedId(contribution.idScope, id)),\n ),\n );\n },\n\n onDidChange(listener) {\n listeners.add(listener);\n return createDisposable(() => listeners.delete(listener));\n },\n listActions() {\n return [...contributions.values()].flatMap((contribution) =>\n (contribution.listActions?.() ?? []).map((action) => ({\n ...action,\n ownerId: contribution.sourceExtensionId,\n })),\n );\n },\n };\n};\n"],"mappings":";;;AAkFA,IAAayD,IAA0B,mBAE1BC,KAA+B7B,IAA2B,cACrEA,MAAS,YAAY4B,IAA0B,cAAc5B,KAEzDoB,KAAWvB,MAA+B,GAAGA,EAAMX,KAAI,GAAIW,EAAMT,YAAW,GAAIS,EAAMV,MAEtF2C,KAAeC,GAA2BC,MAA+BZ,EAAQW,CAAI,MAAMX,EAAQY,CAAK,GAExGC,KACHpC,OAAgCkC,GAAkCC,MAAsC;CACvG,IAAME,IAAUH,EAAKjC,sBAAsBD,EAAMT;CAEjD,IAAI8C,OADaF,EAAMlC,sBAAsBD,EAAMT,cACzB,OAAO8C,IAAU,KAAK;CAChD,IAAI,CAACA,GAAS;EACZ,IAAME,IAAiBL,EAAKjC,kBAAkBuC,cAAcL,EAAMlC,iBAAiB;EACnF,IAAIsC,MAAmB,GAAG,OAAOA;CACnC;CACA,OAAOL,EAAKhC,mBAAmBiC,EAAMjC,oBAAoBgC,EAAK5C,GAAGkD,cAAcL,EAAM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