@fses/workbench-app 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/WORKBENCH-CLOSURE.json +12 -12
  2. package/dist/Workspace-fYH2XNdb.js +22699 -0
  3. package/dist/fses-workbench-app.js +2 -2
  4. package/dist/{index-DbH6tMQy.js → index-CbIJlts1.js} +8 -8
  5. package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +2 -2
  6. package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +41 -2
  7. package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +111 -0
  8. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +72 -0
  9. package/dist/internal/personal-workbench/lib/workbenchSocketClient.d.ts +1 -1
  10. package/dist/internal/personal-workbench/lib/workbenchStorage.d.ts +2 -0
  11. package/dist/runtime/index.js +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/{useWorkbenchRuntime-XpOzwm56.js → useWorkbenchRuntime-Ch8lqkjO.js} +6707 -6315
  14. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +293 -293
  15. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +1 -1
  16. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  17. package/node_modules/@fses/ai-chat/package.json +3 -3
  18. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-echarts-protocol.js +656 -641
  19. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +3700 -3674
  20. package/node_modules/@fses/workbench-card/dist/types/block.d.ts +9 -0
  21. package/node_modules/@fses/workbench-card/package.json +4 -3
  22. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +19950 -0
  23. package/node_modules/@fses/workbench-card/src/renderers/WorkbenchBlockRenderer.vue +2 -2
  24. package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/series.converter.ts +34 -13
  25. package/node_modules/@fses/workbench-card/src/renderers/native/nativeBindings.ts +20 -5
  26. package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceCompositeBindings.ts +5 -1
  27. package/node_modules/@fses/workbench-card/src/types/block.ts +9 -0
  28. package/package.json +3 -3
  29. package/dist/Workspace-DMye5DU8.js +0 -43113
@@ -2031,9 +2031,9 @@ const {
2031
2031
  </div>
2032
2032
  <div class="grid min-h-0 grid-cols-7 items-stretch gap-1 overflow-hidden">
2033
2033
  <div v-for="(item, index) in referenceOpsTrendChartItems(effectiveData as CustomCanvasData)" :key="`ops-trend-${index}`" class="grid h-full min-h-0 grid-rows-[auto_minmax(0,1fr)_auto] gap-0.5 text-center text-xs text-slate-500">
2034
- <b class="hidden text-slate-700">{{ nestedBlockItemValue(item) || nestedBlockItemLabel(item, index) }}</b>
2034
+ <b class="truncate text-slate-700">{{ nestedBlockItemValue(item) || nestedBlockItemLabel(item, index) }}</b>
2035
2035
  <span class="flex h-full min-h-0 items-end justify-center"><i :class="referenceOpsTrendBarClasses(item)" :style="{ height: textValue(item.barHeight, '60%'), minHeight: '12px', width: '46%' }" /></span>
2036
- <span class="hidden truncate">{{ nestedBlockItemValue(item) ? nestedBlockItemLabel(item, index) : `周${index + 1}` }}</span>
2036
+ <span class="truncate">{{ nestedBlockItemValue(item) ? nestedBlockItemLabel(item, index) : `周${index + 1}` }}</span>
2037
2037
  </div>
2038
2038
  </div>
2039
2039
  </div>
@@ -51,26 +51,47 @@ function toStringLabels(value: unknown): string[] {
51
51
  * @returns 可传给 ECharts series.data 的值
52
52
  */
53
53
  function normalizeSeriesValue(value: unknown): unknown {
54
- if (typeof value === 'number' && Number.isFinite(value)) return value;
55
- if (typeof value === 'string' && value.trim()) {
56
- const parsed = Number(value);
57
- return Number.isFinite(parsed) ? parsed : value;
58
- }
59
54
  if (isRecord(value) && 'value' in value) {
60
55
  const rawValue = value.value;
61
- const parsedValue = typeof rawValue === 'string' && rawValue.trim()
62
- ? Number(rawValue)
63
- : rawValue;
56
+ const parsedValue = finiteNumber(rawValue);
64
57
  return {
65
58
  ...value,
66
- value: typeof parsedValue === 'number' && Number.isFinite(parsedValue)
59
+ value: parsedValue !== undefined
67
60
  ? parsedValue
68
61
  : rawValue,
69
62
  };
70
63
  }
64
+ const numericValue = finiteNumber(value);
65
+ if (numericValue !== undefined) return numericValue;
71
66
  return value;
72
67
  }
73
68
 
69
+ /**
70
+ * Reads a finite number from primitive values or typed value wrappers.
71
+ * @param value - Runtime series value from protocol data.
72
+ * @returns Finite number, or undefined when no numeric value can be read.
73
+ */
74
+ function finiteNumber(value: unknown): number | undefined {
75
+ if (typeof value === 'number') return Number.isFinite(value) ? value : undefined;
76
+ if (typeof value === 'bigint') {
77
+ const numericValue = Number(value);
78
+ return Number.isFinite(numericValue) ? numericValue : undefined;
79
+ }
80
+ if (typeof value === 'string') {
81
+ const normalized = value.replace(/[,,\s]/gu, '').trim();
82
+ if (!normalized) return undefined;
83
+ const numericValue = Number(normalized);
84
+ return Number.isFinite(numericValue) ? numericValue : undefined;
85
+ }
86
+ if (!isRecord(value)) return undefined;
87
+ for (const key of ['value', 'raw_value', 'numeric_value', 'metric_value', 'count', 'amount']) {
88
+ if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
89
+ const numericValue = finiteNumber(value[key]);
90
+ if (numericValue !== undefined) return numericValue;
91
+ }
92
+ return undefined;
93
+ }
94
+
74
95
  /**
75
96
  * 从 canonical 或 dataset 包裹的协议数据中读取类目标签。
76
97
  * @param source - 协议数据对象或其中的 dataset 对象
@@ -291,8 +312,8 @@ function isWaterfallHelperSeries(seriesDef: Record<string, unknown>): boolean {
291
312
  */
292
313
  function waterfallNumber(value: unknown): number {
293
314
  const raw = isRecord(value) && 'value' in value ? value.value : value;
294
- const parsed = typeof raw === 'string' && raw.trim() ? Number(raw) : raw;
295
- return typeof parsed === 'number' && Number.isFinite(parsed) ? Math.max(0, parsed) : 0;
315
+ const parsed = finiteNumber(raw);
316
+ return parsed !== undefined ? Math.max(0, parsed) : 0;
296
317
  }
297
318
 
298
319
  /**
@@ -517,13 +538,13 @@ function buildPieData(series: NormalizedSeriesItem, categories: string[]): unkno
517
538
  name: typeof item.name === 'string' && item.name.trim()
518
539
  ? item.name.trim()
519
540
  : categories[index] || series.name || `item-${index + 1}`,
520
- value: 'value' in item ? item.value : 0,
541
+ value: finiteNumber(item.value) ?? 0,
521
542
  }));
522
543
  }
523
544
 
524
545
  return series.data.map((value, index) => ({
525
546
  name: categories[index] || `item-${index + 1}`,
526
- value,
547
+ value: finiteNumber(value) ?? value,
527
548
  }));
528
549
  }
529
550
 
@@ -96,11 +96,19 @@ function tableCellText(value: unknown): string {
96
96
  export function tableColumnsFromRows(columns: unknown, rows: unknown): string[] {
97
97
  const declaredColumns = visibleImageTableColumns(columns);
98
98
  if (declaredColumns.length > 0) return declaredColumns;
99
- const firstObjectRow = Array.isArray(rows)
100
- ? rows.map(tableRowRecord).find((row) => Object.keys(row).some(imageTableColumnVisible))
101
- : undefined;
99
+ const objectRows = Array.isArray(rows)
100
+ ? rows.map(tableRowRecord).filter((row) => Object.keys(row).some(imageTableColumnVisible))
101
+ : [];
102
+ const firstObjectRow = objectRows[0];
102
103
  if (!firstObjectRow) return [];
103
- return Object.keys(firstObjectRow).filter(imageTableColumnVisible).slice(0, 3);
104
+ const firstColumns = Object.keys(firstObjectRow).filter(imageTableColumnVisible);
105
+ const usesStableColumns = objectRows.every((row) => {
106
+ const rowColumns = Object.keys(row).filter(imageTableColumnVisible);
107
+ return rowColumns.length === firstColumns.length
108
+ && rowColumns.every((column, index) => column === firstColumns[index]);
109
+ });
110
+ // 异构对象行无法共享真实列头,统一降级为逐行键值摘要,避免后续行错列或整行空白。
111
+ return usesStableColumns ? firstColumns.slice(0, 3) : ['字段', '内容'];
104
112
  }
105
113
 
106
114
  /**
@@ -115,9 +123,16 @@ export function tableRowCells(row: unknown, columns: string[]): string[] {
115
123
  if (Array.isArray(cells)) {
116
124
  return cells.slice(0, columns.length).map(tableCellText);
117
125
  }
126
+ const usesKeyValueFallback = columns.length === 2
127
+ && columns[0] === '字段'
128
+ && columns[1] === '内容'
129
+ && !columns.every((column) => Object.prototype.hasOwnProperty.call(record, column));
118
130
  const entries = Object.entries(record)
119
131
  .filter(([key]) => imageTableColumnVisible(key))
120
- .map(([, value]) => tableCellText(value))
132
+ .map(([key, value]) => {
133
+ const text = tableCellText(value);
134
+ return usesKeyValueFallback && text ? `${key}:${text}` : text;
135
+ })
121
136
  .filter(Boolean);
122
137
  return entries.slice(0, columns.length);
123
138
  }
@@ -122,10 +122,13 @@ export function createReferenceCompositeBindings(context: ReferenceCompositeCont
122
122
  if (!imageComposeCompactCard(block)) return '';
123
123
  const parentKind = referenceCompositeKindFromContainerTitle(block.title);
124
124
  const automaticImageSource = referenceCompositeUsesAutomaticImageSource(block, data);
125
+ const explicitKind = referenceCompositeKindFromVisualKind(block, data);
126
+ if (automaticImageSource && explicitKind === 'bidCollaboration') {
127
+ return referenceCompositeKindAllowedForBlock(explicitKind, block, data) ? explicitKind : '';
128
+ }
125
129
  if (automaticImageSource && parentKind === 'bidCollaboration') return '';
126
130
  if (customCanvasLooksLikeRiskSummaryTitle(block)) return 'riskSummary';
127
131
  if (automaticImageSource && !parentKind) {
128
- const explicitKind = referenceCompositeKindFromVisualKind(block, data);
129
132
  return explicitKind && referenceCompositeKindAllowedForBlock(explicitKind, block, data) ? explicitKind : '';
130
133
  }
131
134
  if (customCanvasLooksLikeStandaloneQuickLinks(block, data)) return '';
@@ -193,6 +196,7 @@ export function createReferenceCompositeBindings(context: ReferenceCompositeCont
193
196
  if (visualKind === 'operationHealth') return 'operationHealth';
194
197
  if (visualKind === 'operationEfficiency') return 'operationEfficiency';
195
198
  if (visualKind === 'riskSummary') return 'riskSummary';
199
+ if (visualKind === 'bidCollaboration') return 'bidCollaboration';
196
200
  return '';
197
201
  }
198
202
 
@@ -712,6 +712,15 @@ export interface ConversationTurn {
712
712
  error?: string;
713
713
  suppressErrorDisplay?: boolean;
714
714
  collapsed?: boolean;
715
+ deepAgentSubmission?: {
716
+ idempotencyKey: string;
717
+ runId?: string;
718
+ threadId?: string;
719
+ queuePosition?: number;
720
+ status: 'submitting' | 'pending' | 'active' | 'retry_waiting' | 'accepted';
721
+ retryCount?: number;
722
+ retryKind?: 'queue_full' | 'migration' | 'legacy_active' | 'network' | 'unknown';
723
+ };
715
724
  }
716
725
 
717
726
  export type CardDataTaskStatus =
package/package.json CHANGED
@@ -10,8 +10,8 @@
10
10
  "@byteluck-fe/workbench-template": "0.1.1",
11
11
  "@byteluck/agentic-protocol": "2.2.1",
12
12
  "@byteluck/workbench-skill-contracts": "0.1.0",
13
- "@fses/ai-chat": "1.0.0",
14
- "@fses/workbench-card": "0.3.0",
13
+ "@fses/ai-chat": "1.0.2",
14
+ "@fses/workbench-card": "0.3.2",
15
15
  "@microsoft/fetch-event-source": "2.0.1",
16
16
  "axios": "^1.15.0",
17
17
  "clsx": "^2.1.1",
@@ -142,5 +142,5 @@
142
142
  },
143
143
  "type": "module",
144
144
  "types": "./dist/index.d.ts",
145
- "version": "0.2.1"
145
+ "version": "0.2.3"
146
146
  }