@fses/workbench-app 0.2.18 → 0.2.21

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.
Files changed (126) hide show
  1. package/WORKBENCH-CLOSURE.json +14 -14
  2. package/dist/WorkbenchCardCenterDrawer-BxRFAZDG.js +421 -0
  3. package/dist/WorkbenchDiagnosticsFooter-BXQJLBMu.js +22 -0
  4. package/dist/WorkbenchDiagnosticsPage-OdYSvQ2O.js +72 -0
  5. package/dist/Workspace-C4Co3cIc.js +22678 -0
  6. package/dist/adapters/defaultAgentTransportAdapter.d.ts +6 -0
  7. package/dist/adapters/defaultBrowserAdapters.d.ts +22 -0
  8. package/dist/adapters/defaultPlatformRequestAdapter.d.ts +6 -0
  9. package/dist/adapters/defaultRealtimeAdapter.d.ts +6 -0
  10. package/dist/adapters/endpointResolver.d.ts +16 -0
  11. package/dist/adapters/index.d.ts +7 -1
  12. package/dist/adapters/servicePorts.d.ts +20 -0
  13. package/dist/adapters/types.d.ts +27 -1
  14. package/dist/canvas/api/index.js +1 -1
  15. package/dist/canvas/bridge/workbenchCanvasBus.d.ts +13 -1
  16. package/dist/canvas/persistence/canvasSnapshotStorage.d.ts +3 -2
  17. package/dist/{canvasFacade-B8jYm_aO.js → canvasFacade-ZFqB_i7z.js} +1 -1
  18. package/dist/{cardFactory-DmEBcCf4.js → cardFactory-D5dyYSC3.js} +197 -161
  19. package/dist/components/WorkbenchAppHost.vue.d.ts +5 -5
  20. package/dist/components/WorkbenchApplication.vue.d.ts +2 -2
  21. package/dist/components/WorkbenchCardCenterDrawer.vue.d.ts +2 -0
  22. package/dist/components/WorkbenchDiagnosticsFooter.vue.d.ts +2 -0
  23. package/dist/components/WorkbenchDiagnosticsPage.vue.d.ts +2 -0
  24. package/dist/components/WorkbenchDrawerOutlet.vue.d.ts +6 -0
  25. package/dist/components/WorkbenchFeatureOutlet.vue.d.ts +2 -0
  26. package/dist/components/WorkbenchSlotOutlet.vue.d.ts +5 -0
  27. package/dist/config/workbenchAppConfig.d.ts +4 -0
  28. package/dist/customCardCatalog-D8woQgB9.js +512 -0
  29. package/dist/extensions/index.d.ts +3 -54
  30. package/dist/extensions/index.js +7 -5
  31. package/dist/extensions/manifest.d.ts +27 -0
  32. package/dist/extensions/normalizeWorkbenchExtensions.d.ts +19 -0
  33. package/dist/extensions/types.d.ts +62 -0
  34. package/dist/fses-workbench-app.js +109 -89
  35. package/dist/i18n/index.d.ts +17 -0
  36. package/dist/i18n/index.js +14 -0
  37. package/dist/index-C1Y_OWV9.js +1772 -0
  38. package/dist/index-DkGYPLLJ.js +34 -0
  39. package/dist/index.d.ts +12 -1
  40. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvas.vue.d.ts +4 -4
  41. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvasSettingsMenu.vue.d.ts +4 -4
  42. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeImageComposeDrawer.vue.d.ts +19 -0
  43. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeToolbar.vue.d.ts +36 -0
  44. package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +2 -2
  45. package/dist/internal/personal-workbench/components/workbench/controllers/canvasConfigController.d.ts +23 -0
  46. package/dist/internal/personal-workbench/components/workbench/controllers/canvasLayoutController.d.ts +12 -0
  47. package/dist/internal/personal-workbench/components/workbench/controllers/canvasRefreshController.d.ts +11 -0
  48. package/dist/internal/personal-workbench/components/workbench/controllers/canvasSelectionController.d.ts +11 -0
  49. package/dist/internal/personal-workbench/components/workbench/showcase/WorkbenchShowcase.vue.d.ts +4 -4
  50. package/dist/internal/personal-workbench/controllers/workbenchBuiltinPluginBridge.d.ts +32 -0
  51. package/dist/internal/personal-workbench/controllers/workbenchChartConfigModel.d.ts +68 -0
  52. package/dist/internal/personal-workbench/controllers/workbenchChartDataSourceController.d.ts +100 -0
  53. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownController.d.ts +96 -0
  54. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownTable.d.ts +34 -0
  55. package/dist/internal/personal-workbench/controllers/workbenchFdeVersionController.d.ts +107 -0
  56. package/dist/internal/personal-workbench/controllers/workbenchRecommendationConfigModel.d.ts +82 -0
  57. package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +13 -9
  58. package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +3 -1
  59. package/dist/internal/personal-workbench/lib/fdeWorkbenchConfigClient.d.ts +6 -5
  60. package/dist/internal/personal-workbench/lib/runtimeIdentity.d.ts +5 -0
  61. package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
  62. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +4 -4
  63. package/dist/internal/personal-workbench/lib/workbenchApi.d.ts +61 -47
  64. package/dist/internal/personal-workbench/lib/workbenchMetricDetailApi.d.ts +2 -1
  65. package/dist/internal/personal-workbench/lib/workbenchRemoteClient.d.ts +3 -1
  66. package/dist/internal/personal-workbench/lib/workbenchRequestTransport.d.ts +24 -0
  67. package/dist/internal/personal-workbench/lib/workbenchStorage.d.ts +8 -7
  68. package/dist/internal/personal-workbench/pages/Workspace.vue.d.ts +2 -2
  69. package/dist/internal/personal-workbench/stores/domains/actionsRuntime.d.ts +35 -0
  70. package/dist/internal/personal-workbench/stores/domains/canvasRuntime.d.ts +44 -0
  71. package/dist/internal/personal-workbench/stores/domains/conversationRuntime.d.ts +29 -0
  72. package/dist/internal/personal-workbench/stores/domains/dataBindingRuntime.d.ts +27 -0
  73. package/dist/internal/personal-workbench/stores/domains/fdeRuntime.d.ts +38 -0
  74. package/dist/internal/personal-workbench/stores/domains/memoryRuntime.d.ts +53 -0
  75. package/dist/internal/personal-workbench/stores/workbenchRuntime.d.ts +28 -1
  76. package/dist/kernel/command/createCommandRegistry.d.ts +19 -0
  77. package/dist/kernel/createWorkbenchHostContext.d.ts +43 -0
  78. package/dist/kernel/createWorkbenchKernel.d.ts +7 -0
  79. package/dist/kernel/diagnostics/createWorkbenchDiagnostics.d.ts +35 -0
  80. package/dist/kernel/event/createEventBus.d.ts +16 -0
  81. package/dist/kernel/plugin/createPluginManager.d.ts +7 -0
  82. package/dist/kernel/plugin/registrationScope.d.ts +15 -0
  83. package/dist/kernel/plugin/types.d.ts +30 -0
  84. package/dist/kernel/registry/createRegistry.d.ts +42 -0
  85. package/dist/kernel/registry/resolveSlotContributions.d.ts +14 -0
  86. package/dist/kernel/types.d.ts +52 -0
  87. package/dist/kernel/workbenchHostContext.d.ts +14 -0
  88. package/dist/normalizeWorkbenchExtensions-Ccv3n3fC.js +425 -0
  89. package/dist/plugin/index.d.ts +7 -0
  90. package/dist/plugin/index.js +8 -0
  91. package/dist/plugin/types.d.ts +106 -0
  92. package/dist/plugins/defaultWorkbenchPlugins.d.ts +11 -0
  93. package/dist/plugins/workbenchCardCenterPlugin.d.ts +13 -0
  94. package/dist/plugins/workbenchDiagnosticsPlugin.d.ts +15 -0
  95. package/dist/plugins/workbenchDrawerCommands.d.ts +16 -0
  96. package/dist/plugins/workbenchSettingsPlugin.d.ts +19 -0
  97. package/dist/plugins/workbenchThemePlugin.d.ts +15 -0
  98. package/dist/routing/createWorkbenchFeatureRoute.d.ts +11 -0
  99. package/dist/routing/resolveWorkbenchFeatureRoute.d.ts +23 -0
  100. package/dist/runtime/index.d.ts +6 -1
  101. package/dist/runtime/index.js +6 -3
  102. package/dist/runtime/scope/createWorkbenchRuntimeScope.d.ts +10 -0
  103. package/dist/runtime/store/workbenchRuntimeContext.d.ts +12 -0
  104. package/dist/runtime/store/workbenchRuntimeFacade.d.ts +3 -0
  105. package/dist/style.css +1 -1
  106. package/dist/types/index.d.ts +2 -0
  107. package/dist/useWorkbenchRuntime-CJLqEtgU.js +24062 -0
  108. package/dist/version.d.ts +1 -1
  109. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +28256 -7528
  110. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +17 -17
  111. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  112. package/node_modules/@fses/ai-chat/package.json +3 -3
  113. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +5 -5
  114. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +5 -5
  115. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
  116. package/node_modules/@fses/workbench-card/dist/types/block.d.ts +4 -1
  117. package/node_modules/@fses/workbench-card/package.json +1 -1
  118. package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +4 -4
  119. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +1 -1
  120. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +1 -1
  121. package/node_modules/@fses/workbench-card/src/types/block.ts +4 -12
  122. package/package.json +11 -3
  123. package/dist/Workspace-JvnSC-w9.js +0 -23186
  124. package/dist/index-D-WW3bXH.js +0 -829
  125. package/dist/useWorkbenchRuntime-D_AtkXIX.js +0 -23865
  126. package/dist/workbenchCustomComponentRegistry-CWUPjCnJ.js +0 -267
@@ -0,0 +1,425 @@
1
+ import { b as V, c as D, d as k } from "./cardFactory-D5dyYSC3.js";
2
+ import { defineComponent as H, computed as A, ref as E, watch as G, onBeforeUnmount as j, openBlock as _, createElementBlock as w, createElementVNode as d, toDisplayString as f, createCommentVNode as W, normalizeClass as T } from "vue";
3
+ const q = "/workbench-card-previews/custom-cards";
4
+ function B(e) {
5
+ return `${e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "system_card"}.png`;
6
+ }
7
+ function Ae(e) {
8
+ const t = V(
9
+ {
10
+ capabilityId: e,
11
+ meta: {
12
+ id: `system-card-preview-${B(e).replace(/\.png$/u, "")}`,
13
+ systemCardPreview: !0
14
+ }
15
+ },
16
+ []
17
+ );
18
+ return t.status !== "success" || !t.block || !t.registryEntry ? null : {
19
+ ...t.block,
20
+ meta: {
21
+ ...t.block.meta,
22
+ rendererKey: t.registryEntry.rendererKey,
23
+ dataShape: t.registryEntry.dataShape
24
+ }
25
+ };
26
+ }
27
+ async function We(e) {
28
+ const t = await D(
29
+ {
30
+ capabilityId: e,
31
+ meta: {
32
+ id: `system-card-preview-${B(e).replace(/\.png$/u, "")}`,
33
+ systemCardPreview: !0
34
+ }
35
+ },
36
+ []
37
+ );
38
+ return t.status !== "success" || !t.block || !t.registryEntry ? null : {
39
+ ...t.block,
40
+ meta: {
41
+ ...t.block.meta,
42
+ rendererKey: t.registryEntry.rendererKey,
43
+ dataShape: t.registryEntry.dataShape
44
+ }
45
+ };
46
+ }
47
+ function Y(e) {
48
+ const t = e.trim().replace(/^\/+/, "");
49
+ return `${q}/${t}`;
50
+ }
51
+ const X = Y("template_weather_card.png"), x = "@byteluck-fe/workbench-template.WeatherCard", J = "card.fde.templateWeather", Te = [
52
+ {
53
+ capabilityId: J,
54
+ category: "card.fde_custom_cards",
55
+ type: "templateWeather",
56
+ title: k("FWA.60571787571486716"),
57
+ description: k("FWA.1b9f1787570205830"),
58
+ blockType: "display",
59
+ subType: "fdeCustom",
60
+ rendererKey: "fdeCustomComponent",
61
+ dataShape: "fdeCustomComponent",
62
+ shell: "card",
63
+ styleVariants: ["standard", "compact", "tile"],
64
+ defaultSize: "componentTall",
65
+ handlerClassName: "WorkbenchTemplateWeatherComponentAbility",
66
+ status: "implemented",
67
+ sourceLabel: "npm",
68
+ componentRef: x,
69
+ packageName: "@byteluck-fe/workbench-template",
70
+ packageVersion: "0.1.1",
71
+ exportName: "WeatherCard",
72
+ previewUrl: X,
73
+ defaultProps: { city: k("FWA.c4601787571649315") },
74
+ insertionMode: "registered"
75
+ }
76
+ ], Q = ["aria-busy"], Z = { class: "weather-card__header" }, ee = { class: "weather-card__heading" }, te = { class: "weather-card__city" }, re = {
77
+ key: 0,
78
+ class: "weather-card__region"
79
+ }, ne = {
80
+ key: 0,
81
+ class: "weather-card__state"
82
+ }, ae = {
83
+ key: 2,
84
+ class: "weather-card__body"
85
+ }, oe = { class: "weather-card__temperature" }, ie = { class: "weather-card__summary" }, se = { class: "weather-card__metrics" }, le = { class: "weather-card__metric" }, ce = { class: "weather-card__metric" }, ue = { class: "weather-card__updated" }, de = /* @__PURE__ */ H({
86
+ __name: "WeatherCard",
87
+ props: {
88
+ city: {}
89
+ },
90
+ setup(e) {
91
+ const t = e, n = A(() => t.city.trim()), r = A(() => {
92
+ var a;
93
+ return ((a = c.value) == null ? void 0 : a.city) ?? (n.value || "未选择城市");
94
+ }), s = E(!1), o = E(""), h = E("empty"), c = E(null);
95
+ let y = null, b = 0;
96
+ G(
97
+ n,
98
+ (a) => {
99
+ $(a);
100
+ },
101
+ { immediate: !0 }
102
+ ), j(() => {
103
+ y == null || y.abort();
104
+ });
105
+ async function $(a) {
106
+ const i = ++b;
107
+ if (y == null || y.abort(), y = null, c.value = null, o.value = "", !a) {
108
+ s.value = !1, h.value = "empty", o.value = "请输入城市名称";
109
+ return;
110
+ }
111
+ const l = new AbortController();
112
+ y = l, s.value = !0;
113
+ try {
114
+ const u = await U(a, l.signal), m = await I(u, l.signal);
115
+ if (i !== b)
116
+ return;
117
+ c.value = O(u, m);
118
+ } catch (u) {
119
+ if (l.signal.aborted || i !== b)
120
+ return;
121
+ h.value = "error", o.value = u instanceof Error ? u.message : "天气数据请求失败";
122
+ } finally {
123
+ i === b && (s.value = !1, y === l && (y = null));
124
+ }
125
+ }
126
+ async function U(a, i) {
127
+ var l;
128
+ const u = new URL("https://geocoding-api.open-meteo.com/v1/search");
129
+ u.searchParams.set("name", a), u.searchParams.set("count", "1"), u.searchParams.set("language", "zh"), u.searchParams.set("format", "json");
130
+ const m = await fetch(u, { signal: i });
131
+ if (!m.ok)
132
+ throw new Error("城市查询失败");
133
+ const v = (l = (await m.json()).results) == null ? void 0 : l[0];
134
+ if (!v)
135
+ throw new Error(`未找到城市:${a}`);
136
+ return v;
137
+ }
138
+ async function I(a, i) {
139
+ const l = new URL("https://api.open-meteo.com/v1/forecast");
140
+ l.searchParams.set("latitude", String(a.latitude)), l.searchParams.set("longitude", String(a.longitude)), l.searchParams.set(
141
+ "current",
142
+ "temperature_2m,relative_humidity_2m,weather_code,wind_speed_10m"
143
+ ), l.searchParams.set("daily", "temperature_2m_max,temperature_2m_min"), l.searchParams.set("forecast_days", "1"), l.searchParams.set("timezone", "auto");
144
+ const u = await fetch(l, { signal: i });
145
+ if (!u.ok)
146
+ throw new Error("天气数据请求失败");
147
+ const m = await u.json();
148
+ if (!m.current)
149
+ throw new Error("天气数据暂不可用");
150
+ return m;
151
+ }
152
+ function O(a, i) {
153
+ var l, u, m, v, P, R;
154
+ const p = i.current, C = i.daily, K = [a.admin2, a.admin1, a.country].filter((S, L, M) => !!S && M.indexOf(S) === L).join(" / ");
155
+ return {
156
+ city: a.name,
157
+ region: K,
158
+ condition: z(p == null ? void 0 : p.weather_code),
159
+ temperature: p == null ? void 0 : p.temperature_2m,
160
+ temperatureUnit: ((l = i.current_units) == null ? void 0 : l.temperature_2m) ?? "°C",
161
+ humidity: p == null ? void 0 : p.relative_humidity_2m,
162
+ humidityUnit: ((u = i.current_units) == null ? void 0 : u.relative_humidity_2m) ?? "%",
163
+ windSpeed: p == null ? void 0 : p.wind_speed_10m,
164
+ windSpeedUnit: ((m = i.current_units) == null ? void 0 : m.wind_speed_10m) ?? "km/h",
165
+ high: (v = C == null ? void 0 : C.temperature_2m_max) == null ? void 0 : v[0],
166
+ low: (P = C == null ? void 0 : C.temperature_2m_min) == null ? void 0 : P[0],
167
+ rangeUnit: ((R = i.daily_units) == null ? void 0 : R.temperature_2m_max) ?? "°C",
168
+ updatedAt: F(p == null ? void 0 : p.time)
169
+ };
170
+ }
171
+ function z(a) {
172
+ return a === 0 ? { label: "晴", tone: "clear" } : a === 1 || a === 2 ? { label: "多云", tone: "cloudy" } : a === 3 ? { label: "阴", tone: "cloudy" } : a === 45 || a === 48 ? { label: "雾", tone: "fog" } : [51, 53, 55, 56, 57, 61, 63, 65, 66, 67, 80, 81, 82].includes(a ?? -1) ? { label: "降雨", tone: "rain" } : [71, 73, 75, 77, 85, 86].includes(a ?? -1) ? { label: "降雪", tone: "snow" } : [95, 96, 99].includes(a ?? -1) ? { label: "雷阵雨", tone: "storm" } : { label: "未知", tone: "neutral" };
173
+ }
174
+ function F(a) {
175
+ return a ? a.replace("T", " ") : "未知";
176
+ }
177
+ function g(a, i) {
178
+ return typeof a != "number" ? "--" : `${Math.round(a)}${i}`;
179
+ }
180
+ return (a, i) => {
181
+ var l, u;
182
+ return _(), w("section", {
183
+ class: "weather-card",
184
+ "aria-busy": s.value
185
+ }, [
186
+ d("div", Z, [
187
+ d("div", ee, [
188
+ i[0] || (i[0] = d("div", { class: "weather-card__label" }, "实时天气", -1)),
189
+ d("h2", te, f(r.value), 1),
190
+ (l = c.value) != null && l.region ? (_(), w("p", re, f(c.value.region), 1)) : W("", !0)
191
+ ]),
192
+ d("div", {
193
+ class: T(["weather-card__badge", c.value ? `weather-card__badge--${c.value.condition.tone}` : void 0])
194
+ }, f(((u = c.value) == null ? void 0 : u.condition.label) ?? "待更新"), 3)
195
+ ]),
196
+ s.value ? (_(), w("div", ne, "正在获取天气...")) : o.value ? (_(), w("div", {
197
+ key: 1,
198
+ class: T(["weather-card__state", { "weather-card__state--error": h.value === "error" }])
199
+ }, f(o.value), 3)) : c.value ? (_(), w("div", ae, [
200
+ d("div", oe, f(g(c.value.temperature, c.value.temperatureUnit)), 1),
201
+ d("div", ie, [
202
+ d("span", null, "最高 " + f(g(c.value.high, c.value.rangeUnit)), 1),
203
+ d("span", null, "最低 " + f(g(c.value.low, c.value.rangeUnit)), 1)
204
+ ]),
205
+ d("div", se, [
206
+ d("div", le, [
207
+ i[1] || (i[1] = d("span", { class: "weather-card__metric-label" }, "湿度", -1)),
208
+ d("strong", null, f(g(c.value.humidity, c.value.humidityUnit)), 1)
209
+ ]),
210
+ d("div", ce, [
211
+ i[2] || (i[2] = d("span", { class: "weather-card__metric-label" }, "风速", -1)),
212
+ d("strong", null, f(g(c.value.windSpeed, c.value.windSpeedUnit)), 1)
213
+ ])
214
+ ]),
215
+ d("p", ue, "更新时间 " + f(c.value.updatedAt), 1)
216
+ ])) : W("", !0)
217
+ ], 8, Q);
218
+ };
219
+ }
220
+ }), me = [
221
+ {
222
+ packageName: "@byteluck-fe/workbench-template",
223
+ version: "0.1.1",
224
+ componentRef: "@byteluck-fe/workbench-template.WeatherCard",
225
+ componentName: k("FWA.3d751787571486718"),
226
+ exportName: "WeatherCard",
227
+ enabled: !0,
228
+ component: de,
229
+ validateProps: (e) => typeof e.city == "string" && e.city.trim().length > 0
230
+ }
231
+ // 示例:
232
+ // {
233
+ // packageName: '@fde-components/sales-summary',
234
+ // version: '1.2.0',
235
+ // componentRef: '@fde-components/sales-summary.SalesSummaryCard',
236
+ // componentName: '销售摘要组件',
237
+ // exportName: 'SalesSummaryCard',
238
+ // enabled: true,
239
+ // component: SalesSummaryCard,
240
+ // validateProps: (props) => typeof props.amount === 'number' && typeof props.trend === 'number',
241
+ // },
242
+ ], pe = new Map(me.map((e) => [e.componentRef, e]));
243
+ function fe(e, t, n) {
244
+ var r;
245
+ return ((r = e.validateProps) == null ? void 0 : r.call(e, t, n)) ?? !0;
246
+ }
247
+ const Ne = {
248
+ /**
249
+ * 根据 componentRef 查找已安装、已审核并启用的 npm 组件。
250
+ * @param data - FDE 自定义组件卡片数据。
251
+ * @returns 命中的组件登记项;未登记或禁用时返回 null。
252
+ */
253
+ resolve(e) {
254
+ const t = pe.get(e.componentRef);
255
+ return !t || t.enabled === !1 ? null : t;
256
+ },
257
+ validateProps: fe
258
+ }, he = /* @__PURE__ */ new Set([
259
+ "assistantPersonaProfiles",
260
+ "cards",
261
+ "fde",
262
+ "pages",
263
+ "quickEntryGroups",
264
+ "systemCardPromptSelections",
265
+ "themeDefinitions"
266
+ ]), ye = /* @__PURE__ */ new Set([
267
+ "cardContributions",
268
+ "capabilities",
269
+ "cards",
270
+ "commands",
271
+ "fde",
272
+ "featureRoutes",
273
+ "legacy",
274
+ "legacyRootRoutes",
275
+ "plugins",
276
+ "schemaVersion",
277
+ "slots",
278
+ "drawers"
279
+ ]);
280
+ function ge(e, t) {
281
+ if (!e) return [];
282
+ const n = e.filter((r, s) => {
283
+ const o = !!(r && typeof r.id == "string" && r.id.trim() && typeof r.capabilityId == "string" && r.capabilityId.trim());
284
+ return o || t.push(`Invalid workbench card contribution ignored at index ${s}`), o;
285
+ });
286
+ return n.length === e.length ? e : n;
287
+ }
288
+ function ve(e, t) {
289
+ if (!e) return [];
290
+ const n = e.filter((r, s) => {
291
+ const o = !!(r && typeof r.id == "string" && r.id.trim() && typeof r.title == "string" && r.component);
292
+ return o || t.push(`Invalid workbench drawer contribution ignored at index ${s}`), o;
293
+ });
294
+ return n.length === e.length ? e : n;
295
+ }
296
+ function _e(e, t) {
297
+ if (!e) return [];
298
+ const n = e.filter((r, s) => {
299
+ var h;
300
+ const o = !!((h = r == null ? void 0 : r.id) != null && h.trim() && typeof r.execute == "function");
301
+ return o || t.push(`Invalid workbench command contribution ignored at index ${s}`), o;
302
+ });
303
+ return n.length === e.length ? e : n;
304
+ }
305
+ function we(e, t) {
306
+ if (!e) return [];
307
+ const n = e.filter((r, s) => {
308
+ var h;
309
+ const o = !!((h = r == null ? void 0 : r.id) != null && h.trim() && Number.isInteger(r.version) && r.version > 0);
310
+ return o || t.push(`Invalid workbench capability contribution ignored at index ${s}`), o;
311
+ });
312
+ return n.length === e.length ? e : n;
313
+ }
314
+ function be(e) {
315
+ return e.schemaVersion === 1;
316
+ }
317
+ function Ce(e) {
318
+ if (!e) return;
319
+ const t = {};
320
+ for (const n of [
321
+ "generatedCards",
322
+ "generatedDashboard",
323
+ "generatedTemplatePage",
324
+ "generatedTemplateShell",
325
+ "workbenchTheme"
326
+ ])
327
+ Object.defineProperty(t, n, {
328
+ configurable: !1,
329
+ enumerable: !0,
330
+ get: () => e[n]
331
+ });
332
+ return t;
333
+ }
334
+ function N(e, t) {
335
+ return Object.keys(e).filter((n) => !t.has(n)).sort().map((n) => `Unknown workbench extension field ignored: ${n}`);
336
+ }
337
+ function Ee(e, t) {
338
+ if (!e) return [];
339
+ const n = e.filter((r, s) => {
340
+ const o = !!(r && typeof r.id == "string" && r.id.trim() && typeof r.path == "string" && r.path.trim() && !r.path.trim().startsWith("/") && typeof r.loadComponent == "function");
341
+ return o || t.push(`Invalid workbench feature route ignored at index ${s}`), o;
342
+ });
343
+ return n.length === e.length ? e : n;
344
+ }
345
+ function ke(e, t) {
346
+ if (!e) return [];
347
+ const n = e.filter((r, s) => {
348
+ const o = !!(r && typeof r.id == "string" && r.id.trim() && typeof r.slot == "string" && r.slot.trim() && r.component);
349
+ return o || t.push(`Invalid workbench slot contribution ignored at index ${s}`), o;
350
+ });
351
+ return n.length === e.length ? e : n;
352
+ }
353
+ function Pe(e, t) {
354
+ if (!e) return [];
355
+ const n = e.filter((r, s) => {
356
+ const o = !!(r && typeof r.id == "string" && r.id.trim() && r.kernelApiVersion === 1 && typeof r.setup == "function");
357
+ return o || t.push(`Invalid workbench host plugin ignored at index ${s}`), o;
358
+ });
359
+ return n.length === e.length ? e : n;
360
+ }
361
+ function Be(e) {
362
+ var t;
363
+ if (be(e)) {
364
+ const n = N(e, ye);
365
+ return {
366
+ manifest: {
367
+ ...e,
368
+ cardContributions: ge(e.cardContributions, n),
369
+ capabilities: we(e.capabilities, n),
370
+ drawers: ve(e.drawers, n),
371
+ commands: _e(e.commands, n),
372
+ featureRoutes: Ee(e.featureRoutes, n),
373
+ legacyRootRoutes: e.legacyRootRoutes ?? [],
374
+ plugins: Pe(e.plugins, n),
375
+ slots: ke(e.slots, n)
376
+ },
377
+ warnings: n
378
+ };
379
+ }
380
+ return {
381
+ manifest: {
382
+ cardContributions: [],
383
+ capabilities: [],
384
+ cards: e.cards,
385
+ commands: [],
386
+ fde: Ce(e.fde),
387
+ featureRoutes: [],
388
+ legacy: {
389
+ assistantPersonaProfiles: e.assistantPersonaProfiles,
390
+ quickEntryGroups: e.quickEntryGroups,
391
+ systemCardPromptSelections: e.systemCardPromptSelections,
392
+ themeDefinitions: e.themeDefinitions
393
+ },
394
+ legacyRootRoutes: ((t = e.pages) == null ? void 0 : t.routes) ?? [],
395
+ plugins: [],
396
+ schemaVersion: 1,
397
+ slots: [],
398
+ drawers: []
399
+ },
400
+ warnings: N(e, he)
401
+ };
402
+ }
403
+ function $e(e) {
404
+ var t, n, r, s;
405
+ return {
406
+ assistantPersonaProfiles: (t = e.legacy) == null ? void 0 : t.assistantPersonaProfiles,
407
+ cards: e.cards,
408
+ fde: e.fde,
409
+ pages: { routes: e.legacyRootRoutes ?? [] },
410
+ quickEntryGroups: (n = e.legacy) == null ? void 0 : n.quickEntryGroups,
411
+ systemCardPromptSelections: (r = e.legacy) == null ? void 0 : r.systemCardPromptSelections,
412
+ themeDefinitions: (s = e.legacy) == null ? void 0 : s.themeDefinitions
413
+ };
414
+ }
415
+ export {
416
+ Te as W,
417
+ J as a,
418
+ x as b,
419
+ X as c,
420
+ Ne as d,
421
+ We as e,
422
+ Be as n,
423
+ Ae as s,
424
+ $e as w
425
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @fileoverview 工作台插件 SDK 公共入口 - 只导出稳定插件与贡献点类型。
3
+ * @author seadon
4
+ * @created 2026-08-31
5
+ */
6
+ export type { WorkbenchCapabilityContribution, WorkbenchCapabilityRegistryWriter, WorkbenchCardContribution, WorkbenchCommandContribution, WorkbenchCommandExecutionContext, WorkbenchCommandRegistryWriter, WorkbenchDrawerContribution, WorkbenchPlugin, WorkbenchPluginContext, WorkbenchPluginEventBus, WorkbenchRegistrationHandle, WorkbenchRegistryWriter, WorkbenchRouteContribution, WorkbenchRuntimePluginApi, WorkbenchSlotContribution, } from './types';
7
+ export { WORKBENCH_DRAWER_CLOSE_COMMAND, WORKBENCH_DRAWER_CLOSE_EVENT, WORKBENCH_DRAWER_OPEN_COMMAND, WORKBENCH_DRAWER_OPEN_EVENT, WORKBENCH_DIAGNOSTICS_DRAWER_ID, } from '../plugins/workbenchDrawerCommands';
@@ -0,0 +1,8 @@
1
+ import { a as _, b as N, d as O, W, e as C } from "../index-DkGYPLLJ.js";
2
+ export {
3
+ _ as WORKBENCH_DIAGNOSTICS_DRAWER_ID,
4
+ N as WORKBENCH_DRAWER_CLOSE_COMMAND,
5
+ O as WORKBENCH_DRAWER_CLOSE_EVENT,
6
+ W as WORKBENCH_DRAWER_OPEN_COMMAND,
7
+ C as WORKBENCH_DRAWER_OPEN_EVENT
8
+ };
@@ -0,0 +1,106 @@
1
+ /**
2
+ * @fileoverview 工作台插件公共类型 - 定义插件生命周期和稳定贡献点合同。
3
+ * @author seadon
4
+ * @created 2026-08-31
5
+ */
6
+ import type { Component } from 'vue';
7
+ import type { WorkbenchServicePorts } from '../adapters/servicePorts';
8
+ import type { WorkbenchCanvasBus } from '../canvas/bridge/workbenchCanvasBus';
9
+ import type { WorkbenchAppConfig } from '../config/workbenchAppConfig';
10
+ export interface WorkbenchRegistrationHandle {
11
+ active: boolean;
12
+ dispose(): void;
13
+ }
14
+ export interface WorkbenchRouteContribution {
15
+ id: string;
16
+ loadComponent: () => Promise<Component | {
17
+ default: Component;
18
+ }>;
19
+ order?: number;
20
+ path: string;
21
+ requiredCapabilities?: readonly string[];
22
+ }
23
+ export interface WorkbenchSlotContribution {
24
+ component: Component;
25
+ id: string;
26
+ order?: number;
27
+ slot: string;
28
+ when?: () => boolean;
29
+ }
30
+ export interface WorkbenchDrawerContribution {
31
+ component: Component;
32
+ defaultWidth?: number;
33
+ id: string;
34
+ order?: number;
35
+ title: string;
36
+ }
37
+ export interface WorkbenchCardContribution {
38
+ capabilityId: string;
39
+ component?: Component;
40
+ id: string;
41
+ order?: number;
42
+ validateData?: (data: unknown) => boolean | string;
43
+ }
44
+ export interface WorkbenchCapabilityContribution {
45
+ enabled?: boolean | (() => boolean);
46
+ id: string;
47
+ order?: number;
48
+ version: number;
49
+ }
50
+ export interface WorkbenchCommandContribution<TPayload = unknown, TResult = unknown> {
51
+ execute(payload: TPayload, context: WorkbenchCommandExecutionContext): Promise<TResult> | TResult;
52
+ id: string;
53
+ order?: number;
54
+ }
55
+ export interface WorkbenchCommandExecutionContext {
56
+ config: Readonly<WorkbenchAppConfig>;
57
+ instanceId: string;
58
+ services: Readonly<WorkbenchServicePorts>;
59
+ }
60
+ export interface WorkbenchRegistryWriter<TContribution> {
61
+ register(contribution: TContribution): WorkbenchRegistrationHandle;
62
+ }
63
+ export interface WorkbenchCapabilityRegistryWriter extends WorkbenchRegistryWriter<WorkbenchCapabilityContribution> {
64
+ has(id: string): boolean;
65
+ isEnabled(id: string): boolean;
66
+ }
67
+ export interface WorkbenchCommandRegistryWriter {
68
+ execute<TResult = unknown>(id: string, payload?: unknown): Promise<TResult>;
69
+ has(id: string): boolean;
70
+ register(contribution: WorkbenchCommandContribution): WorkbenchRegistrationHandle;
71
+ }
72
+ export interface WorkbenchPluginEventBus {
73
+ emit(eventName: string, payload?: unknown): Promise<void>;
74
+ on(eventName: string, listener: (payload: unknown) => void | Promise<void>): WorkbenchRegistrationHandle;
75
+ }
76
+ export interface WorkbenchRuntimePluginApi {
77
+ readonly canvasBus: WorkbenchCanvasBus;
78
+ readonly disposed: boolean;
79
+ readonly instanceId: string;
80
+ trackCleanup(cleanup: () => void): WorkbenchRegistrationHandle;
81
+ }
82
+ export interface WorkbenchPluginContext {
83
+ capabilities: WorkbenchCapabilityRegistryWriter;
84
+ cards: WorkbenchRegistryWriter<WorkbenchCardContribution>;
85
+ commands: WorkbenchCommandRegistryWriter;
86
+ config: Readonly<WorkbenchAppConfig>;
87
+ drawers: WorkbenchRegistryWriter<WorkbenchDrawerContribution>;
88
+ events: WorkbenchPluginEventBus;
89
+ instanceId: string;
90
+ routes: WorkbenchRegistryWriter<WorkbenchRouteContribution>;
91
+ runtime: WorkbenchRuntimePluginApi;
92
+ services: Readonly<WorkbenchServicePorts>;
93
+ slots: WorkbenchRegistryWriter<WorkbenchSlotContribution>;
94
+ }
95
+ export interface WorkbenchPlugin {
96
+ dispose?(): void | Promise<void>;
97
+ id: string;
98
+ kernelApiVersion: 1;
99
+ remoteConfigurable?: boolean;
100
+ requires?: {
101
+ capabilities?: readonly string[];
102
+ plugins?: readonly string[];
103
+ };
104
+ setup(context: WorkbenchPluginContext): void | Promise<void>;
105
+ version: string;
106
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @fileoverview 工作台默认插件集合 - 汇总随 workbench-app 版本自动安装的包内插件。
3
+ * @author seadon
4
+ * @created 2026-08-31
5
+ */
6
+ import type { WorkbenchPlugin } from '../plugin/types';
7
+ export interface DefaultWorkbenchPluginRegistration {
8
+ criticality: 'core' | 'optional';
9
+ plugin: WorkbenchPlugin;
10
+ }
11
+ export declare const DEFAULT_WORKBENCH_PLUGIN_REGISTRATIONS: readonly DefaultWorkbenchPluginRegistration[];
@@ -0,0 +1,13 @@
1
+ import type { WorkbenchPlugin } from '../plugin/types';
2
+ export declare const WORKBENCH_CARD_CENTER_PLUGIN_ID = "workbench.builtin.card-center";
3
+ export declare const WORKBENCH_CARD_CENTER_CAPABILITY_ID = "workbench.card-center";
4
+ export declare const WORKBENCH_CARD_CENTER_DRAWER_ID = "workbench.card-center.drawer";
5
+ export declare const WORKBENCH_CARD_CENTER_OPEN_COMMAND = "workbench.card-center.open";
6
+ export declare const WORKBENCH_CARD_CENTER_INSERT_SYSTEM_EVENT = "workbench.card-center.insert-system-card";
7
+ export declare const WORKBENCH_CARD_CENTER_INSERT_CUSTOM_EVENT = "workbench.card-center.insert-custom-card";
8
+ export declare const WORKBENCH_CARD_CENTER_CONFIG_DIALOG_EVENT = "workbench.card-center.config-dialog-change";
9
+ /**
10
+ * 创建随 workbench-app 自动安装的卡片中心插件。
11
+ * @returns 提供卡片中心能力、抽屉和打开命令的内置插件。
12
+ */
13
+ export declare function createWorkbenchCardCenterPlugin(): WorkbenchPlugin;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview 工作台开发态诊断插件 - 用于验证包内 route、slot、drawer、command、event 和 Service Ports 闭环
3
+ * @author seadon
4
+ * @created 2026-08-31
5
+ */
6
+ import type { WorkbenchPlugin } from '../plugin/types';
7
+ export declare const WORKBENCH_DIAGNOSTICS_PLUGIN_ID = "workbench.optional.diagnostics";
8
+ export declare const WORKBENCH_DIAGNOSTICS_ROUTE_ID = "workbench.diagnostics.route";
9
+ export declare const WORKBENCH_DIAGNOSTICS_REFRESH_COMMAND = "workbench.diagnostics.refresh";
10
+ export declare const WORKBENCH_DIAGNOSTICS_REFRESH_EVENT = "workbench.diagnostics.refreshed";
11
+ /**
12
+ * 创建默认关闭的开发态诊断插件。
13
+ * @returns 可由内核自动安装的可选插件。
14
+ */
15
+ export declare function createWorkbenchDiagnosticsPlugin(): WorkbenchPlugin;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @fileoverview 工作台抽屉公共命令 - 为插件提供实例级抽屉打开和关闭事件。
3
+ * @author seadon
4
+ * @created 2026-08-31
5
+ */
6
+ import type { WorkbenchPlugin } from '../plugin/types';
7
+ export declare const WORKBENCH_DRAWER_OPEN_COMMAND = "workbench.drawer.open";
8
+ export declare const WORKBENCH_DRAWER_CLOSE_COMMAND = "workbench.drawer.close";
9
+ export declare const WORKBENCH_DIAGNOSTICS_DRAWER_ID = "workbench.diagnostics.drawer";
10
+ export declare const WORKBENCH_DRAWER_OPEN_EVENT = "workbench.drawer.open";
11
+ export declare const WORKBENCH_DRAWER_CLOSE_EVENT = "workbench.drawer.close";
12
+ /**
13
+ * 创建包内抽屉命令插件。
14
+ * @returns 提供抽屉打开/关闭命令的核心插件。
15
+ */
16
+ export declare function createWorkbenchDrawerCommandsPlugin(): WorkbenchPlugin;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @fileoverview 工作台通用设置内置插件 - 管理设置面板打开、关闭和保存命令生命周期。
3
+ * @author seadon
4
+ * @created 2026-09-01
5
+ */
6
+ import type { WorkbenchPlugin } from '../plugin/types';
7
+ export declare const WORKBENCH_SETTINGS_PLUGIN_ID = "workbench.builtin.settings";
8
+ export declare const WORKBENCH_SETTINGS_CAPABILITY_ID = "workbench.settings";
9
+ export declare const WORKBENCH_SETTINGS_OPEN_COMMAND = "workbench.settings.open";
10
+ export declare const WORKBENCH_SETTINGS_CLOSE_COMMAND = "workbench.settings.close";
11
+ export declare const WORKBENCH_SETTINGS_SAVE_COMMAND = "workbench.settings.save";
12
+ export declare const WORKBENCH_SETTINGS_OPEN_EVENT = "workbench.settings.open-requested";
13
+ export declare const WORKBENCH_SETTINGS_CLOSE_EVENT = "workbench.settings.close-requested";
14
+ export declare const WORKBENCH_SETTINGS_SAVE_EVENT = "workbench.settings.save-requested";
15
+ /**
16
+ * 创建通用设置内置插件。
17
+ * @returns 提供设置 capability 和 open/close/save 命令的插件。
18
+ */
19
+ export declare function createWorkbenchSettingsPlugin(): WorkbenchPlugin;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview 工作台主题内置插件 - 通过实例命令和事件管理主题切换生命周期。
3
+ * @author seadon
4
+ * @created 2026-09-01
5
+ */
6
+ import type { WorkbenchPlugin } from '../plugin/types';
7
+ export declare const WORKBENCH_THEME_PLUGIN_ID = "workbench.builtin.theme";
8
+ export declare const WORKBENCH_THEME_CAPABILITY_ID = "workbench.theme";
9
+ export declare const WORKBENCH_THEME_APPLY_COMMAND = "workbench.theme.apply";
10
+ export declare const WORKBENCH_THEME_APPLY_EVENT = "workbench.theme.apply-requested";
11
+ /**
12
+ * 创建主题内置插件。
13
+ * @returns 提供主题 capability、apply command 和实例事件的插件。
14
+ */
15
+ export declare function createWorkbenchThemePlugin(): WorkbenchPlugin;
@@ -0,0 +1,11 @@
1
+ import type { RouteRecordRaw } from 'vue-router';
2
+ import { type WorkbenchHostDefinition } from '../kernel/createWorkbenchHostContext';
3
+ export interface CreateWorkbenchFeatureRouteOptions {
4
+ host: WorkbenchHostDefinition;
5
+ }
6
+ /**
7
+ * 创建冻结宿主唯一的 `/workbench-app/*` 根路由。
8
+ * @param options - Workspace 与 Feature Outlet 共用的宿主装配对象。
9
+ * @returns 可直接插入宿主 router 且自行管理 HostContext 的路由记录。
10
+ */
11
+ export declare function createWorkbenchFeatureRoute(options: CreateWorkbenchFeatureRouteOptions): RouteRecordRaw;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @fileoverview Feature Outlet 路由解析 - 只匹配包内相对路径并校验结构化 capability。
3
+ * @author seadon
4
+ * @created 2026-08-31
5
+ */
6
+ import type { WorkbenchRouteContribution } from '../plugin/types';
7
+ import type { WorkbenchKernel } from '../kernel/types';
8
+ export type WorkbenchFeatureRouteResolution = {
9
+ route: WorkbenchRouteContribution;
10
+ status: 'ready';
11
+ } | {
12
+ missingCapabilities: string[];
13
+ status: 'forbidden';
14
+ } | {
15
+ status: 'not-found';
16
+ };
17
+ /**
18
+ * 从当前实例内核解析包内功能页面。
19
+ * @param kernel - 当前 Feature Outlet 独立实例内核。
20
+ * @param featurePath - `/workbench-app/` 后的相对路径。
21
+ * @returns 可渲染路由、权限拒绝或未找到状态。
22
+ */
23
+ export declare function resolveWorkbenchFeatureRoute(kernel: WorkbenchKernel, featurePath: string): WorkbenchFeatureRouteResolution;