@fses/workbench-app 0.2.18 → 0.2.20

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 (124) hide show
  1. package/WORKBENCH-CLOSURE.json +14 -14
  2. package/dist/WorkbenchCardCenterDrawer-CWBuBD04.js +421 -0
  3. package/dist/WorkbenchDiagnosticsFooter-BxpwRNMe.js +22 -0
  4. package/dist/WorkbenchDiagnosticsPage-D0mWFNWS.js +72 -0
  5. package/dist/Workspace-DwnUU7_7.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-DcoxF7gK.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 +106 -89
  35. package/dist/index-CytMrt6f.js +1771 -0
  36. package/dist/index-DkGYPLLJ.js +34 -0
  37. package/dist/index.d.ts +10 -1
  38. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvas.vue.d.ts +4 -4
  39. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvasSettingsMenu.vue.d.ts +4 -4
  40. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeImageComposeDrawer.vue.d.ts +19 -0
  41. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeToolbar.vue.d.ts +36 -0
  42. package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +2 -2
  43. package/dist/internal/personal-workbench/components/workbench/controllers/canvasConfigController.d.ts +23 -0
  44. package/dist/internal/personal-workbench/components/workbench/controllers/canvasLayoutController.d.ts +12 -0
  45. package/dist/internal/personal-workbench/components/workbench/controllers/canvasRefreshController.d.ts +11 -0
  46. package/dist/internal/personal-workbench/components/workbench/controllers/canvasSelectionController.d.ts +11 -0
  47. package/dist/internal/personal-workbench/components/workbench/showcase/WorkbenchShowcase.vue.d.ts +4 -4
  48. package/dist/internal/personal-workbench/controllers/workbenchBuiltinPluginBridge.d.ts +32 -0
  49. package/dist/internal/personal-workbench/controllers/workbenchChartConfigModel.d.ts +68 -0
  50. package/dist/internal/personal-workbench/controllers/workbenchChartDataSourceController.d.ts +100 -0
  51. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownController.d.ts +96 -0
  52. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownTable.d.ts +34 -0
  53. package/dist/internal/personal-workbench/controllers/workbenchFdeVersionController.d.ts +107 -0
  54. package/dist/internal/personal-workbench/controllers/workbenchRecommendationConfigModel.d.ts +82 -0
  55. package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +13 -9
  56. package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +3 -1
  57. package/dist/internal/personal-workbench/lib/fdeWorkbenchConfigClient.d.ts +6 -5
  58. package/dist/internal/personal-workbench/lib/runtimeIdentity.d.ts +5 -0
  59. package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
  60. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +4 -4
  61. package/dist/internal/personal-workbench/lib/workbenchApi.d.ts +61 -47
  62. package/dist/internal/personal-workbench/lib/workbenchMetricDetailApi.d.ts +2 -1
  63. package/dist/internal/personal-workbench/lib/workbenchRemoteClient.d.ts +3 -1
  64. package/dist/internal/personal-workbench/lib/workbenchRequestTransport.d.ts +24 -0
  65. package/dist/internal/personal-workbench/lib/workbenchStorage.d.ts +8 -7
  66. package/dist/internal/personal-workbench/pages/Workspace.vue.d.ts +2 -2
  67. package/dist/internal/personal-workbench/stores/domains/actionsRuntime.d.ts +35 -0
  68. package/dist/internal/personal-workbench/stores/domains/canvasRuntime.d.ts +44 -0
  69. package/dist/internal/personal-workbench/stores/domains/conversationRuntime.d.ts +29 -0
  70. package/dist/internal/personal-workbench/stores/domains/dataBindingRuntime.d.ts +27 -0
  71. package/dist/internal/personal-workbench/stores/domains/fdeRuntime.d.ts +38 -0
  72. package/dist/internal/personal-workbench/stores/domains/memoryRuntime.d.ts +53 -0
  73. package/dist/internal/personal-workbench/stores/workbenchRuntime.d.ts +28 -1
  74. package/dist/kernel/command/createCommandRegistry.d.ts +19 -0
  75. package/dist/kernel/createWorkbenchHostContext.d.ts +43 -0
  76. package/dist/kernel/createWorkbenchKernel.d.ts +7 -0
  77. package/dist/kernel/diagnostics/createWorkbenchDiagnostics.d.ts +35 -0
  78. package/dist/kernel/event/createEventBus.d.ts +16 -0
  79. package/dist/kernel/plugin/createPluginManager.d.ts +7 -0
  80. package/dist/kernel/plugin/registrationScope.d.ts +15 -0
  81. package/dist/kernel/plugin/types.d.ts +30 -0
  82. package/dist/kernel/registry/createRegistry.d.ts +42 -0
  83. package/dist/kernel/registry/resolveSlotContributions.d.ts +14 -0
  84. package/dist/kernel/types.d.ts +52 -0
  85. package/dist/kernel/workbenchHostContext.d.ts +14 -0
  86. package/dist/normalizeWorkbenchExtensions-Ccv3n3fC.js +425 -0
  87. package/dist/plugin/index.d.ts +7 -0
  88. package/dist/plugin/index.js +8 -0
  89. package/dist/plugin/types.d.ts +106 -0
  90. package/dist/plugins/defaultWorkbenchPlugins.d.ts +11 -0
  91. package/dist/plugins/workbenchCardCenterPlugin.d.ts +13 -0
  92. package/dist/plugins/workbenchDiagnosticsPlugin.d.ts +15 -0
  93. package/dist/plugins/workbenchDrawerCommands.d.ts +16 -0
  94. package/dist/plugins/workbenchSettingsPlugin.d.ts +19 -0
  95. package/dist/plugins/workbenchThemePlugin.d.ts +15 -0
  96. package/dist/routing/createWorkbenchFeatureRoute.d.ts +11 -0
  97. package/dist/routing/resolveWorkbenchFeatureRoute.d.ts +23 -0
  98. package/dist/runtime/index.d.ts +6 -1
  99. package/dist/runtime/index.js +6 -3
  100. package/dist/runtime/scope/createWorkbenchRuntimeScope.d.ts +10 -0
  101. package/dist/runtime/store/workbenchRuntimeContext.d.ts +12 -0
  102. package/dist/runtime/store/workbenchRuntimeFacade.d.ts +3 -0
  103. package/dist/style.css +1 -1
  104. package/dist/types/index.d.ts +2 -0
  105. package/dist/useWorkbenchRuntime-CJLqEtgU.js +24062 -0
  106. package/dist/version.d.ts +1 -1
  107. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +28256 -7528
  108. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +17 -17
  109. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  110. package/node_modules/@fses/ai-chat/package.json +3 -3
  111. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +5 -5
  112. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +5 -5
  113. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
  114. package/node_modules/@fses/workbench-card/dist/types/block.d.ts +4 -1
  115. package/node_modules/@fses/workbench-card/package.json +1 -1
  116. package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +4 -4
  117. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +1 -1
  118. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +1 -1
  119. package/node_modules/@fses/workbench-card/src/types/block.ts +4 -12
  120. package/package.json +7 -3
  121. package/dist/Workspace-JvnSC-w9.js +0 -23186
  122. package/dist/index-D-WW3bXH.js +0 -829
  123. package/dist/useWorkbenchRuntime-D_AtkXIX.js +0 -23865
  124. package/dist/workbenchCustomComponentRegistry-CWUPjCnJ.js +0 -267
@@ -1,829 +0,0 @@
1
- import { toRefs as ne, shallowReadonly as F, inject as oe, defineComponent as T, provide as ae, openBlock as w, createElementBlock as k, renderSlot as y, createElementVNode as C, normalizeClass as L, normalizeStyle as R, withModifiers as se, unref as _, createCommentVNode as P, createVNode as G, Transition as ie, withCtx as A, computed as de, createBlock as Y, defineAsyncComponent as ce } from "vue";
2
- import { d as o, e as le } from "./cardFactory-DmEBcCf4.js";
3
- import "./canvasFacade-B8jYm_aO.js";
4
- import { b as ue } from "./useWorkbenchRuntime-D_AtkXIX.js";
5
- import "./workbenchCustomComponentRegistry-CWUPjCnJ.js";
6
- const fe = "0.2.18", U = "workbench-app-version";
7
- function me() {
8
- if (typeof document > "u" || document.querySelector(`meta[name="${U}"]`)) return !1;
9
- const e = document.createElement("meta");
10
- return e.name = U, e.content = fe, document.head.appendChild(e), !0;
11
- }
12
- me();
13
- const J = Symbol("workbench-app-context");
14
- function he(e) {
15
- const { adapters: r, config: t, extensions: n } = ne(e);
16
- return {
17
- adapters: F(r),
18
- config: F(t),
19
- extensions: F(n)
20
- };
21
- }
22
- function nr() {
23
- const e = oe(J);
24
- if (!e)
25
- throw new Error("useWorkbenchAppContext must be used inside WorkbenchWorkspaceCore");
26
- return e;
27
- }
28
- const be = { class: "fses-workbench-app" }, pe = /* @__PURE__ */ T({
29
- __name: "WorkbenchWorkspaceCore",
30
- props: {
31
- adapters: {},
32
- config: {},
33
- extensions: {}
34
- },
35
- setup(e) {
36
- return ae(J, he(e)), (t, n) => (w(), k("div", be, [
37
- y(t.$slots, "default")
38
- ]));
39
- }
40
- }), ye = { class: "workbench-shell" }, ge = ["aria-label"], we = ["aria-hidden", "inert"], Ae = { class: "workbench-studio-panel__body" }, Ie = ["aria-label"], V = 48, ke = /* @__PURE__ */ T({
41
- __name: "WorkbenchShell",
42
- props: {
43
- studioPanelWidth: {},
44
- studioPanelCollapsed: { type: Boolean },
45
- studioPanelEnabled: { type: Boolean },
46
- drawerOpen: { type: Boolean },
47
- drawerWidth: {},
48
- dragging: { type: Boolean },
49
- canvasFocusMode: { type: Boolean },
50
- imageWorkbench: { type: Boolean }
51
- },
52
- emits: ["startDrag"],
53
- setup(e, { emit: r }) {
54
- const t = r;
55
- return (n, a) => (w(), k("div", ye, [
56
- C("div", {
57
- class: L(["workbench-shell__body", { "workbench-shell__body--dragging": e.dragging }])
58
- }, [
59
- C("div", {
60
- class: "workbench-shell__canvas-pane",
61
- style: R({
62
- flexBasis: e.drawerOpen ? `calc(100% - ${e.drawerWidth || 392}px)` : e.canvasFocusMode || !e.studioPanelEnabled ? "100%" : e.studioPanelCollapsed ? `calc(100% - ${V}px)` : `calc(100% - ${e.studioPanelWidth}px - 8px)`
63
- })
64
- }, [
65
- y(n.$slots, "left", {}, void 0, !0)
66
- ], 4),
67
- e.studioPanelEnabled && !e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (w(), k("div", {
68
- key: 0,
69
- "aria-orientation": "vertical",
70
- "data-i18n-aria-label": "FWA.8cb91787571066462",
71
- "aria-label": _(o)("FWA.8cb91787571066462"),
72
- class: "workbench-splitter",
73
- role: "separator",
74
- onPointerdown: a[0] || (a[0] = (c) => t("startDrag", c)),
75
- onDragstart: a[1] || (a[1] = se(() => {
76
- }, ["prevent"]))
77
- }, [...a[2] || (a[2] = [
78
- C("div", { class: "workbench-splitter__track" }, null, -1)
79
- ])], 40, ge)) : P("", !0),
80
- e.studioPanelEnabled && !e.canvasFocusMode && !e.drawerOpen ? (w(), k("div", {
81
- key: 1,
82
- class: L(["workbench-studio-panel", { "workbench-studio-panel--collapsed": e.studioPanelCollapsed }]),
83
- style: R({ flexBasis: e.studioPanelCollapsed ? "0px" : `${e.studioPanelWidth}px` }),
84
- "aria-hidden": e.studioPanelCollapsed ? "true" : void 0,
85
- inert: e.studioPanelCollapsed ? !0 : void 0
86
- }, [
87
- C("div", Ae, [
88
- y(n.$slots, "right", {}, void 0, !0)
89
- ])
90
- ], 14, we)) : P("", !0),
91
- G(ie, { name: "workbench-assistant-rail-shell" }, {
92
- default: A(() => [
93
- e.studioPanelEnabled && e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (w(), k("div", {
94
- key: 0,
95
- class: "workbench-assistant-rail-shell",
96
- style: R({ flexBasis: `${V}px` }),
97
- "data-i18n-aria-label": "FWA.f0e91787570935726",
98
- "aria-label": _(o)("FWA.f0e91787570935726")
99
- }, [
100
- y(n.$slots, "collapsed-right", {}, void 0, !0)
101
- ], 12, Ie)) : P("", !0)
102
- ]),
103
- _: 3
104
- }),
105
- e.drawerOpen ? (w(), k("div", {
106
- key: 2,
107
- class: "workbench-shell__drawer",
108
- style: R({ flexBasis: `${e.drawerWidth || 392}px` })
109
- }, [
110
- y(n.$slots, "drawer", {}, void 0, !0)
111
- ], 4)) : P("", !0)
112
- ], 2)
113
- ]));
114
- }
115
- }), Se = (e, r) => {
116
- const t = e.__vccOpts || e;
117
- for (const [n, a] of r)
118
- t[n] = a;
119
- return t;
120
- }, We = /* @__PURE__ */ Se(ke, [["__scopeId", "data-v-1cfa390d"]]), or = /* @__PURE__ */ T({
121
- __name: "WorkbenchAppHost",
122
- props: {
123
- adapters: {},
124
- config: {},
125
- extensions: {},
126
- runtime: {}
127
- },
128
- setup(e) {
129
- const r = e, t = de(() => ({
130
- canvasFocusMode: r.runtime.canvasFocusMode ?? !1,
131
- drawerOpen: r.runtime.drawerOpen ?? !1,
132
- drawerWidth: r.runtime.drawerWidth,
133
- dragging: r.runtime.dragging ?? !1,
134
- imageWorkbench: r.runtime.imageWorkbench ?? !1,
135
- studioPanelCollapsed: r.runtime.studioPanelCollapsed ?? !1,
136
- studioPanelEnabled: r.runtime.studioPanelEnabled ?? !0,
137
- studioPanelWidth: r.runtime.studioPanelWidth ?? 420
138
- }));
139
- return (n, a) => (w(), Y(pe, {
140
- adapters: r.adapters,
141
- config: r.config,
142
- extensions: r.extensions
143
- }, {
144
- default: A(() => [
145
- G(We, {
146
- "canvas-focus-mode": t.value.canvasFocusMode,
147
- "drawer-open": t.value.drawerOpen,
148
- "drawer-width": t.value.drawerWidth,
149
- dragging: t.value.dragging,
150
- "image-workbench": t.value.imageWorkbench,
151
- "studio-panel-collapsed": t.value.studioPanelCollapsed,
152
- "studio-panel-enabled": t.value.studioPanelEnabled,
153
- "studio-panel-width": t.value.studioPanelWidth,
154
- onStartDrag: a[0] || (a[0] = (c) => {
155
- var b, g;
156
- return (g = (b = r.runtime).startStudioPanelDrag) == null ? void 0 : g.call(b, c);
157
- })
158
- }, {
159
- left: A(() => [
160
- y(n.$slots, "left")
161
- ]),
162
- right: A(() => [
163
- y(n.$slots, "right")
164
- ]),
165
- "collapsed-right": A(() => [
166
- y(n.$slots, "collapsed-right")
167
- ]),
168
- drawer: A(() => [
169
- y(n.$slots, "drawer")
170
- ]),
171
- _: 3
172
- }, 8, ["canvas-focus-mode", "drawer-open", "drawer-width", "dragging", "image-workbench", "studio-panel-collapsed", "studio-panel-enabled", "studio-panel-width"])
173
- ]),
174
- _: 3
175
- }, 8, ["adapters", "config", "extensions"]));
176
- }
177
- }), ar = /* @__PURE__ */ T({
178
- __name: "WorkbenchApplication",
179
- props: {
180
- adapters: {},
181
- config: {},
182
- embedInPortal: { type: Boolean, default: !1 },
183
- extensions: {}
184
- },
185
- setup(e) {
186
- const r = e;
187
- le(r.adapters, r.config, r.extensions);
188
- const t = ce(() => import("./Workspace-JvnSC-w9.js"));
189
- return (n, a) => (w(), Y(_(t), {
190
- "embed-in-portal": r.embedInPortal
191
- }, {
192
- "before-workbench": A(() => [
193
- y(n.$slots, "before-workbench")
194
- ]),
195
- _: 3
196
- }, 8, ["embed-in-portal"]));
197
- }
198
- });
199
- function sr(e) {
200
- return {
201
- getItem: (r) => e.getItem(r),
202
- removeItem: (r) => e.removeItem(r),
203
- setItem: (r, t) => e.setItem(r, t)
204
- };
205
- }
206
- const Ce = {
207
- resolveAssetUrl: (e) => e
208
- }, S = {
209
- debug: (e, r) => console.debug(e, r),
210
- error: (e, r) => console.error(e, r),
211
- info: (e, r) => console.info(e, r),
212
- warn: (e, r) => console.warn(e, r)
213
- }, Re = {
214
- error: (e) => S.error(e),
215
- info: (e) => S.info(e),
216
- success: (e) => S.info(e),
217
- warning: (e) => S.warn(e)
218
- };
219
- function ir(e = {}) {
220
- const r = /* @__PURE__ */ new Map();
221
- return {
222
- agentTransportAdapter: {
223
- openEventStream: async () => {
224
- },
225
- requestJson: async () => ({})
226
- },
227
- assetAdapter: Ce,
228
- identityAdapter: {
229
- readIdentity: () => ({ appId: "test-app", roleId: "default", tenantId: "test-tenant", userId: "test-user" })
230
- },
231
- loggerAdapter: S,
232
- messageAdapter: Re,
233
- platformRequestAdapter: {
234
- ensureSessionReady: async () => !0,
235
- requestJson: async () => ({})
236
- },
237
- routerAdapter: {
238
- push: () => {
239
- },
240
- readQuery: () => ({}),
241
- replaceQuery: () => {
242
- }
243
- },
244
- storageAdapter: {
245
- getItem: (t) => r.get(t) ?? null,
246
- removeItem: (t) => {
247
- r.delete(t);
248
- },
249
- setItem: (t, n) => {
250
- r.set(t, n);
251
- }
252
- },
253
- uploadAdapter: {
254
- uploadFile: async () => ({})
255
- },
256
- ...e
257
- };
258
- }
259
- const Pe = [
260
- "attachments",
261
- "cards",
262
- "cardRecommendationDraft",
263
- "defaultExpanded",
264
- "detail",
265
- "error",
266
- "initialEventsPending",
267
- "markThinking",
268
- "memoryCaptureDraft",
269
- "planDraft",
270
- "processInvocations",
271
- "processPreamble",
272
- "queryResultTable",
273
- "queryResultTables",
274
- "registeredCardInsertDraft",
275
- "removeThinking",
276
- "taskStateDraft",
277
- "thinkingProcess",
278
- "thinkingProcessMessages",
279
- "workbenchTurnId"
280
- ];
281
- function dr(e, r) {
282
- for (const t of Pe)
283
- e[t] = r[t];
284
- }
285
- function Ee(e) {
286
- const r = e.cardRecommendationDraft;
287
- if (!r || typeof r != "object") return "";
288
- const t = r.sourceTurnId;
289
- return typeof t == "string" && t.trim() ? t.trim() : "";
290
- }
291
- function Te(e) {
292
- const r = e.cardRecommendationDraft;
293
- if (!r || typeof r != "object") return "";
294
- const t = r.placementTurnId;
295
- return typeof t == "string" && t.trim() ? t.trim() : "";
296
- }
297
- function X(e) {
298
- const r = e.workbenchTurnId;
299
- return typeof r == "string" && r.trim() ? r.trim() : "";
300
- }
301
- function Z(e) {
302
- if (typeof e != "string" || !e.startsWith("workbench-turn-")) return "";
303
- const r = ["-reply", "-conclusion-stream", "-item-", "-process-", "-task-", "-card-mutation-confirmation"];
304
- for (const t of r) {
305
- const n = e.indexOf(t, 15);
306
- if (n > 15) return e.slice(15, n);
307
- }
308
- return "";
309
- }
310
- function M(e, r) {
311
- var n;
312
- if (e.role !== "assistant" || !((n = e.content) != null && n.trim())) return !1;
313
- const t = X(e);
314
- return t ? t === r : Z(e.id) !== r ? !1 : typeof e.id == "string" && (e.id.endsWith("-reply") || e.id.endsWith("-conclusion-stream"));
315
- }
316
- function Q(e, r) {
317
- return !!(r && e.some((t) => M(t, r)));
318
- }
319
- function Fe(e, r) {
320
- const t = Ee(r), n = Te(r);
321
- return Q(e, t) ? t : Q(e, n) ? n : n || X(r) || t || Z(r.id);
322
- }
323
- function cr(e) {
324
- for (const r of e.appendedMessages.values()) {
325
- if (!r.cardRecommendationDraft) continue;
326
- const t = Fe(e.messages, r);
327
- if (!t) continue;
328
- const n = e.messages.indexOf(r);
329
- if (n < 0) continue;
330
- const a = e.messages.findIndex((g) => M(g, t));
331
- if (a < 0 || n === a + 1) continue;
332
- const [c] = e.messages.splice(n, 1), b = e.messages.findIndex((g) => M(g, t));
333
- if (b < 0) {
334
- e.messages.splice(n, 0, c);
335
- continue;
336
- }
337
- e.messages.splice(b + 1, 0, c);
338
- }
339
- }
340
- function _e(e) {
341
- return !e.thinkingProcess;
342
- }
343
- function Me(e) {
344
- const r = e.content.trim();
345
- if (!_e(e)) return r;
346
- const t = r.replace(/完成(?:,用时 .*)?$/u, "").trim();
347
- return o("FWA.cc001787570980831", { p0: t });
348
- }
349
- function lr(e, r) {
350
- return {
351
- content: Me(e),
352
- loading: !1,
353
- ...typeof e.startTime == "number" ? { startTime: e.startTime } : {},
354
- ...typeof e.endTime == "number" ? { endTime: e.endTime } : typeof r == "number" ? { endTime: r } : {}
355
- };
356
- }
357
- function p(e) {
358
- return e && typeof e == "object" && !Array.isArray(e) ? e : {};
359
- }
360
- function s(e) {
361
- return typeof e == "string" ? e.trim() : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
362
- }
363
- function j(e) {
364
- return Array.isArray(e) ? String(e.length) : "";
365
- }
366
- function ee(e) {
367
- const r = p(e);
368
- return [
369
- s(r.bindingId),
370
- s(r.id),
371
- s(r.metricId),
372
- s(r.metricCode),
373
- s(r.source),
374
- s(r.bindingKind),
375
- s(r.serviceOperation),
376
- s(r.refreshApi),
377
- s(r.contractHash)
378
- ].join("|");
379
- }
380
- function re(e) {
381
- const r = p(e), t = p(r.data);
382
- return [
383
- s(r.resultId),
384
- s(r.sourceTurnId),
385
- s(r.rowCount),
386
- j(r.rows || t.rows),
387
- j(r.columns || t.columns),
388
- ee(r.dataBinding || t.dataBinding)
389
- ].join("|");
390
- }
391
- function Be(e) {
392
- const r = p(e), t = p(r.blockPlan), n = p(t.data), a = p(t.meta), c = p(a.queryResult);
393
- return [
394
- s(r.recommendationId),
395
- s(r.capabilityId),
396
- s(r.title),
397
- s(r.previewStatus),
398
- s(r.nextAction),
399
- s(r.dataShape),
400
- s(t.id),
401
- s(t.title),
402
- ee(r.dataBinding || n.dataBinding),
403
- re(r.queryResult || c)
404
- ].join(":");
405
- }
406
- function ur(e) {
407
- const r = p(e), t = typeof r.type == "string" ? r.type : "";
408
- if (t === "card_recommendations_ready") {
409
- const n = Array.isArray(r.recommendations) ? r.recommendations : [], a = ue({
410
- payload: r,
411
- conversationId: s(r.conversationId),
412
- groupType: t
413
- });
414
- return [
415
- t,
416
- a.renderKey,
417
- s(r.sourceTurnId),
418
- s(r.placementTurnId),
419
- re(r.queryResult),
420
- n.map(Be).join(",")
421
- ].join(":");
422
- }
423
- if (t === "query_result_table_ready") {
424
- const n = p(r.queryResult), a = Array.isArray(n.rows) ? n.rows.length : "", c = Array.isArray(n.columns) ? n.columns.length : "";
425
- return `${t}:${a}:${c}:${n.rowCount ?? ""}`;
426
- }
427
- return t;
428
- }
429
- const De = /* @__PURE__ */ new Set(["pending", "running"]), Ne = "/data-binding-candidate/query", ve = "/workbench/v2/documents/", Oe = "/data-bindings/";
430
- function He(e) {
431
- return typeof (e == null ? void 0 : e.refreshApi) == "string" ? e.refreshApi.trim() : "";
432
- }
433
- function $e(e) {
434
- return e.includes(Ne);
435
- }
436
- function te(e) {
437
- let r = e;
438
- try {
439
- r = new URL(e, "http://localhost").pathname;
440
- } catch {
441
- r = e;
442
- }
443
- return r.includes(ve) && r.includes(Oe);
444
- }
445
- function B(e) {
446
- return !!(e && typeof e == "object" && !Array.isArray(e));
447
- }
448
- function h(e) {
449
- if (!B(e)) return !1;
450
- const r = typeof e.source == "string" ? e.source.trim().toLowerCase() : "", t = typeof e.sourceType == "string" ? e.sourceType.trim().toLowerCase() : "", n = typeof e.composeSource == "string" ? e.composeSource.trim().toLowerCase() : "";
451
- return r === "image" || t === "image" || n === "image" || h(e.params);
452
- }
453
- function W(e) {
454
- return B(e) ? h(e) || h(e.recognition) ? !0 : B(e.v2) ? W(e.v2) : !1 : !1;
455
- }
456
- function qe(e, r, t) {
457
- return (r == null ? void 0 : r.suppressImageComposeAutoRefresh) !== !0 || !te(t) ? !1 : h(e == null ? void 0 : e.params) || h(e) || h(r) || h(r == null ? void 0 : r.source) || h(r == null ? void 0 : r.data) || W(r == null ? void 0 : r.recognition) || W(r == null ? void 0 : r.meta);
458
- }
459
- function xe(e, r) {
460
- return h(e == null ? void 0 : e.params) || h(e) || h(r) || h(r == null ? void 0 : r.source) || h(r == null ? void 0 : r.data) || W(r == null ? void 0 : r.recognition) || W(r == null ? void 0 : r.meta);
461
- }
462
- function fr(e, r) {
463
- if (!e) return !1;
464
- const t = He(e);
465
- if (!t || $e(t) || qe(e, r, t)) return !1;
466
- const n = typeof (e == null ? void 0 : e.status) == "string" ? e.status.trim().toLowerCase() : "";
467
- return !(De.has(n) || te(t) && xe(e, r));
468
- }
469
- function mr(e) {
470
- var n;
471
- const r = (n = e.title) == null ? void 0 : n.trim(), t = r ? Le(r) : void 0;
472
- return t || o("FWA.56db1787570894461", { p0: e.index + 1 });
473
- }
474
- function Le(e) {
475
- const r = e.replace(/[A-Za-z0-9_./\\()[\]{}::,,;;#%+\-=]+/gu, "").replace(/\s+/gu, "").trim();
476
- return r && /[\u3400-\u9fff]/u.test(r) ? r : void 0;
477
- }
478
- function D(e, r = {}, t = "-") {
479
- return Number.isFinite(e) ? new Intl.NumberFormat("zh-CN", r).format(e) : t;
480
- }
481
- function hr(e, r = "") {
482
- return r === "percent" ? `${(e * 100).toFixed(1)}%` : r === "currency" ? Math.abs(e) >= 1e8 ? o("FWA.15b51787570950350", { p0: (e / 1e8).toFixed(2) }) : Math.abs(e) >= 1e4 ? o("FWA.e1c91787570950875", { p0: (e / 1e4).toFixed(1) }) : `¥${D(e)}` : D(e);
483
- }
484
- function br(e, r = {}) {
485
- return e === 0 ? "-" : D(e, r);
486
- }
487
- function K(e = {}) {
488
- var t, n, a, c, b, g, v, O, H, $, q, x;
489
- const r = {
490
- workspaceId: u([
491
- i((t = e.routeQuery) == null ? void 0 : t.workspaceId),
492
- l(e.locationSearch, "workspaceId"),
493
- f(e.locationHash, "workspaceId"),
494
- m(e.locationPathname, "workspaceId")
495
- ]),
496
- userId: u([
497
- i((n = e.routeQuery) == null ? void 0 : n.userId),
498
- l(e.locationSearch, "userId"),
499
- f(e.locationHash, "userId"),
500
- m(e.locationPathname, "userId")
501
- ]),
502
- tenantId: z(e, ["tenantId", "tenant_id", "tenant-id"]),
503
- appId: z(e, ["appId", "app_id", "app-id"]),
504
- roleId: "",
505
- mode: u([
506
- i((a = e.routeQuery) == null ? void 0 : a.mode),
507
- l(e.locationSearch, "mode"),
508
- f(e.locationHash, "mode"),
509
- m(e.locationPathname, "mode")
510
- ]),
511
- fdeMode: u([
512
- i((c = e.routeQuery) == null ? void 0 : c.fdeMode),
513
- l(e.locationSearch, "fdeMode"),
514
- f(e.locationHash, "fdeMode"),
515
- m(e.locationPathname, "fdeMode")
516
- ]),
517
- workbenchEditable: u([
518
- i((b = e.routeQuery) == null ? void 0 : b.workbenchEditable),
519
- l(e.locationSearch, "workbenchEditable"),
520
- f(e.locationHash, "workbenchEditable"),
521
- m(e.locationPathname, "workbenchEditable")
522
- ]),
523
- conversationId: u([
524
- i((g = e.routeQuery) == null ? void 0 : g.conversationId),
525
- l(e.locationSearch, "conversationId"),
526
- f(e.locationHash, "conversationId"),
527
- m(e.locationPathname, "conversationId")
528
- ]),
529
- resourceId: u([
530
- i((v = e.routeQuery) == null ? void 0 : v.resourceId),
531
- l(e.locationSearch, "resourceId"),
532
- f(e.locationHash, "resourceId"),
533
- m(e.locationPathname, "resourceId")
534
- ]),
535
- fdeResourceId: u([
536
- i((O = e.routeQuery) == null ? void 0 : O.fdeResourceId),
537
- l(e.locationSearch, "fdeResourceId"),
538
- f(e.locationHash, "fdeResourceId"),
539
- m(e.locationPathname, "fdeResourceId")
540
- ]),
541
- path: u([
542
- i((H = e.routeQuery) == null ? void 0 : H.path),
543
- l(e.locationSearch, "path"),
544
- f(e.locationHash, "path"),
545
- m(e.locationPathname, "path")
546
- ]),
547
- fdePath: u([
548
- i(($ = e.routeQuery) == null ? void 0 : $.fdePath),
549
- l(e.locationSearch, "fdePath"),
550
- f(e.locationHash, "fdePath"),
551
- m(e.locationPathname, "fdePath")
552
- ]),
553
- name: u([
554
- i((q = e.routeQuery) == null ? void 0 : q.name),
555
- l(e.locationSearch, "name"),
556
- f(e.locationHash, "name"),
557
- m(e.locationPathname, "name")
558
- ]),
559
- fdeName: u([
560
- i((x = e.routeQuery) == null ? void 0 : x.fdeName),
561
- l(e.locationSearch, "fdeName"),
562
- f(e.locationHash, "fdeName"),
563
- m(e.locationPathname, "fdeName")
564
- ])
565
- };
566
- return Qe(r);
567
- }
568
- function pr(e) {
569
- if (typeof window > "u")
570
- return K({ routeQuery: e });
571
- const r = K({
572
- routeQuery: e,
573
- locationPathname: window.location.pathname,
574
- locationSearch: window.location.search,
575
- locationHash: window.location.hash
576
- });
577
- return {
578
- ...r,
579
- userId: r.userId || Ue(window)
580
- };
581
- }
582
- function i(e) {
583
- return Array.isArray(e) ? i(e[0]) : typeof e == "string" ? e.trim() : "";
584
- }
585
- function l(e, r) {
586
- var t;
587
- return e && ((t = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get(r)) == null ? void 0 : t.trim()) || "";
588
- }
589
- function f(e, r) {
590
- if (!e) return "";
591
- const t = e.indexOf("?");
592
- if (t < 0) return "";
593
- const n = e.indexOf("#", t + 1), a = n >= 0 ? e.slice(t + 1, n) : e.slice(t + 1);
594
- return l(a, r);
595
- }
596
- function m(e, r) {
597
- if (!e || !e.includes("=")) return "";
598
- const t = e.split("/").filter(Boolean).find((n) => n.includes("="));
599
- return t ? l(t, r) : "";
600
- }
601
- function z(e, r) {
602
- return u(r.flatMap((t) => {
603
- var n;
604
- return [
605
- i((n = e.routeQuery) == null ? void 0 : n[t]),
606
- l(e.locationSearch, t),
607
- f(e.locationHash, t),
608
- m(e.locationPathname, t)
609
- ];
610
- }));
611
- }
612
- function u(e) {
613
- return e.find((r) => r.trim()) || "";
614
- }
615
- function Ue(e) {
616
- const r = [
617
- e.__BT_WORKBENCH_USER__,
618
- e.__BT_RUNTIME_IDENTITY__,
619
- e.__BT_RUNTIME_CONTEXT__
620
- ];
621
- for (const t of r) {
622
- const n = Ve(t);
623
- if (n) return n;
624
- }
625
- return "";
626
- }
627
- function Ve(e) {
628
- if (!e || typeof e != "object" || Array.isArray(e)) return "";
629
- const r = e;
630
- return u([
631
- i(r.userId),
632
- i(r.user_id),
633
- i(r.egoUserinfo),
634
- i(r.egoUserInfo),
635
- i(r["ego-userinfo"])
636
- ]);
637
- }
638
- function Qe(e) {
639
- if (!je(e)) return e;
640
- const r = e.fdeResourceId || e.resourceId;
641
- return {
642
- ...e,
643
- workspaceId: e.workspaceId || r,
644
- userId: e.userId || "fdeadmin",
645
- roleId: e.roleId || "fde",
646
- fdeResourceId: r
647
- };
648
- }
649
- function je(e) {
650
- const r = e.mode.trim().toLowerCase(), t = e.fdeMode.trim().toLowerCase();
651
- return r === "fde" || t === "true" || t === "1" || t === "yes";
652
- }
653
- const d = {
654
- radius: "standard",
655
- border: "light",
656
- shadow: "soft",
657
- texture: "white",
658
- textureColor: "#ffffff",
659
- motion: "none",
660
- density: "standard"
661
- }, yr = [
662
- {
663
- key: "radius",
664
- label: o("FWA.71e11787571689316"),
665
- options: [
666
- { value: "square", label: o("FWA.fbad1787571689609") },
667
- { value: "small", label: o("FWA.50721787571587373") },
668
- { value: "standard", label: o("FWA.e83b1787571408644") },
669
- { value: "large", label: o("FWA.c0491787571587595") }
670
- ]
671
- },
672
- {
673
- key: "border",
674
- label: o("FWA.49d21787571689615"),
675
- options: [
676
- { value: "none", label: o("FWA.f0961787571587988") },
677
- { value: "light", label: o("FWA.36d41787571258647") },
678
- { value: "strong", label: o("FWA.35961787571588423") }
679
- ]
680
- },
681
- {
682
- key: "shadow",
683
- label: o("FWA.30c71787571689687"),
684
- options: [
685
- { value: "none", label: o("FWA.6e7c1787571588944") },
686
- { value: "soft", label: o("FWA.db821787571589152") },
687
- { value: "strong", label: o("FWA.7fbe1787571589516") }
688
- ]
689
- },
690
- {
691
- key: "texture",
692
- label: o("FWA.e4e81787571690132"),
693
- options: [
694
- { value: "white", label: o("FWA.3e791787571690179") },
695
- { value: "muted", label: o("FWA.2b471787571590077") },
696
- { value: "glass", label: o("FWA.c3e41787571409224") },
697
- { value: "texture", label: o("FWA.6b941787571590518") }
698
- ]
699
- },
700
- {
701
- key: "motion",
702
- label: o("FWA.f1801787571690658"),
703
- options: [
704
- { value: "none", label: o("FWA.252a1787571591043") },
705
- { value: "lift", label: o("FWA.f1bf1787571410166") },
706
- { value: "glow", label: o("FWA.8a811787571410691") }
707
- ]
708
- },
709
- {
710
- key: "density",
711
- label: o("FWA.b02d1787571690666"),
712
- options: [
713
- { value: "loose", label: o("FWA.2d611787571591242") },
714
- { value: "standard", label: o("FWA.780f1787571591588") },
715
- { value: "compact", label: o("FWA.6a711787571146025") }
716
- ]
717
- }
718
- ], Ke = {
719
- radius: ["square", "small", "standard", "large"],
720
- border: ["none", "light", "strong"],
721
- shadow: ["none", "soft", "strong"],
722
- texture: ["white", "muted", "glass", "texture", "color"],
723
- motion: ["none", "lift", "glow"],
724
- density: ["loose", "standard", "compact"]
725
- };
726
- function N(e) {
727
- return e && typeof e == "object" && !Array.isArray(e) ? e : {};
728
- }
729
- function I(e, r) {
730
- const t = d[e];
731
- return typeof r == "string" && Ke[e].includes(r) ? r : t;
732
- }
733
- function ze(e) {
734
- return typeof e == "string" && /^#[0-9a-fA-F]{6}$/.test(e) ? e.toLowerCase() : d.textureColor;
735
- }
736
- function E(e) {
737
- const r = N(e);
738
- return {
739
- radius: I("radius", r.radius),
740
- border: I("border", r.border),
741
- shadow: I("shadow", r.shadow),
742
- texture: I("texture", r.texture),
743
- textureColor: ze(r.textureColor),
744
- motion: I("motion", r.motion),
745
- density: I("density", r.density)
746
- };
747
- }
748
- function gr(e) {
749
- const r = E(e);
750
- return r.radius === d.radius && r.border === d.border && r.shadow === d.shadow && r.texture === d.texture && r.textureColor === d.textureColor && r.motion === d.motion && r.density === d.density;
751
- }
752
- const Ge = {
753
- square: 0,
754
- small: 4,
755
- standard: 8,
756
- large: 16
757
- }, Ye = {
758
- none: "none",
759
- soft: "soft",
760
- standard: "soft",
761
- strong: "strong"
762
- }, Je = {
763
- thumbnail: "compact",
764
- compact: "compact",
765
- standard: "standard",
766
- expanded: "loose"
767
- };
768
- function wr(e) {
769
- const r = E(e);
770
- return {
771
- cardStyle: {
772
- cardRadius: Ge[r.radius],
773
- cardShadow: r.shadow === "strong" ? "strong" : r.shadow,
774
- density: r.density === "loose" ? "expanded" : r.density,
775
- ...r.texture === "color" ? { backgroundColor: r.textureColor } : {},
776
- shell: { ...r }
777
- }
778
- };
779
- }
780
- function Ar(e) {
781
- const r = N(e == null ? void 0 : e.cardStyle), t = N(r.shell);
782
- if (Object.keys(t).length > 0)
783
- return E(t);
784
- const n = typeof r.cardRadius == "number" ? r.cardRadius <= 0 ? "square" : r.cardRadius <= 4 ? "small" : r.cardRadius >= 16 ? "large" : "standard" : d.radius, a = typeof r.cardShadow == "string" && Ye[r.cardShadow] || d.shadow, c = typeof r.density == "string" && Je[r.density] || d.density, b = typeof r.backgroundColor == "string" ? r.backgroundColor : void 0;
785
- return E({
786
- radius: n,
787
- border: d.border,
788
- shadow: a,
789
- texture: b ? "color" : d.texture,
790
- textureColor: b,
791
- motion: d.motion,
792
- density: c
793
- });
794
- }
795
- const Ir = "@fses/workbench-app";
796
- export {
797
- Re as A,
798
- br as B,
799
- nr as C,
800
- d as D,
801
- yr as W,
802
- Se as _,
803
- Me as a,
804
- dr as b,
805
- lr as c,
806
- ur as d,
807
- pr as e,
808
- hr as f,
809
- or as g,
810
- Ar as h,
811
- gr as i,
812
- wr as j,
813
- J as k,
814
- Ir as l,
815
- fe as m,
816
- E as n,
817
- ar as o,
818
- cr as p,
819
- We as q,
820
- mr as r,
821
- fr as s,
822
- pe as t,
823
- sr as u,
824
- he as v,
825
- He as w,
826
- ir as x,
827
- Ce as y,
828
- S as z
829
- };