@things-factory/ai-assistant 10.1.90 → 10.1.91
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/client/components/assistant-chat.ts +26 -0
- package/client/components/assistant-dock.ts +9 -1
- package/client/components/workspace-view.ts +428 -0
- package/client/pages/assistant-workspace-page.ts +237 -0
- package/client/route.ts +9 -0
- package/client/utils/workspace.ts +89 -0
- package/dist-client/components/assistant-chat.d.ts +2 -0
- package/dist-client/components/assistant-chat.js +27 -0
- package/dist-client/components/assistant-chat.js.map +1 -1
- package/dist-client/components/assistant-dock.d.ts +1 -0
- package/dist-client/components/assistant-dock.js +9 -1
- package/dist-client/components/assistant-dock.js.map +1 -1
- package/dist-client/components/workspace-view.d.ts +19 -0
- package/dist-client/components/workspace-view.js +416 -0
- package/dist-client/components/workspace-view.js.map +1 -0
- package/dist-client/pages/assistant-workspace-page.d.ts +27 -0
- package/dist-client/pages/assistant-workspace-page.js +263 -0
- package/dist-client/pages/assistant-workspace-page.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +10 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/utils/workspace.d.ts +40 -0
- package/dist-client/utils/workspace.js +68 -0
- package/dist-client/utils/workspace.js.map +1 -0
- package/dist-server/service/assistant-mode/resolve.d.ts +2 -2
- package/dist-server/service/assistant-mode/resolve.js +5 -3
- package/dist-server/service/assistant-mode/resolve.js.map +1 -1
- package/dist-server/service/index.d.ts +2 -0
- package/dist-server/service/index.js +3 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/workspace/workspace-blocks.d.ts +24 -0
- package/dist-server/service/workspace/workspace-blocks.js +118 -0
- package/dist-server/service/workspace/workspace-blocks.js.map +1 -0
- package/dist-server/service/workspace/workspace-tools.d.ts +24 -0
- package/dist-server/service/workspace/workspace-tools.js +65 -0
- package/dist-server/service/workspace/workspace-tools.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/assistant-mode/resolve.test.ts +2 -1
- package/server/service/assistant-mode/resolve.ts +5 -3
- package/server/service/data-entry/data-entry.test.ts +2 -2
- package/server/service/index.ts +3 -0
- package/server/service/workspace/workspace-blocks.ts +127 -0
- package/server/service/workspace/workspace-tools.ts +66 -0
- package/server/service/workspace/workspace.test.ts +58 -0
- package/test/workspace.test.ts +54 -0
- package/things-factory.config.js +6 -1
- package/translations/en.json +21 -1
- package/translations/ja.json +21 -1
- package/translations/ko.json +21 -1
- package/translations/ms.json +21 -1
- package/translations/zh.json +21 -1
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
/*
|
|
3
|
+
* The blocks of an AI 작업판, drawn (operato-application/design/ai/workspace.md §3).
|
|
4
|
+
*
|
|
5
|
+
* Every kind is drawn here - the model writes no HTML. Charts use the eight validated categorical colours in
|
|
6
|
+
* a fixed order (dataviz reference palette, light and dark each checked); three of the light ones sit under
|
|
7
|
+
* 3:1 against the surface, so every chart carries its legend (two series or more) and a table view.
|
|
8
|
+
*/
|
|
9
|
+
import '@material/web/icon/icon.js';
|
|
10
|
+
import { LitElement, css, html, nothing, svg } from 'lit';
|
|
11
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
13
|
+
import { i18next } from '@operato/i18n';
|
|
14
|
+
import { renderMarkdown } from './markdown.js';
|
|
15
|
+
import { sortRows, tableCsv } from '../utils/workspace.js';
|
|
16
|
+
const LIGHT = ['#2a78d6', '#eb6834', '#1baf7a', '#eda100', '#e87ba4', '#008300', '#4a3aa7', '#e34948'];
|
|
17
|
+
const DARK = ['#3987e5', '#d95926', '#199e70', '#c98500', '#d55181', '#008300', '#9085e9', '#e66767'];
|
|
18
|
+
const t = (key, defaultValue, options = {}) => String(i18next.t(`ai-assistant.workspace.${key}`, { defaultValue, ...options }));
|
|
19
|
+
const shown = (value) => value === null || value === undefined ? '' : typeof value === 'number' ? value.toLocaleString(i18next.language || undefined) : String(value);
|
|
20
|
+
/** Four round steps from zero to above the largest value. */
|
|
21
|
+
function ticksFor(max) {
|
|
22
|
+
if (!(max > 0))
|
|
23
|
+
return [0, 1];
|
|
24
|
+
const raw = max / 4;
|
|
25
|
+
const power = 10 ** Math.floor(Math.log10(raw));
|
|
26
|
+
const step = [1, 2, 2.5, 5, 10].map(one => one * power).find(one => one >= raw) ?? raw;
|
|
27
|
+
return Array.from({ length: Math.ceil(max / step) + 1 }, (_, i) => Math.round(i * step * 1e6) / 1e6);
|
|
28
|
+
}
|
|
29
|
+
let AssistantWorkspaceView = class AssistantWorkspaceView extends LitElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.sorts = {};
|
|
33
|
+
this.asTable = new Set();
|
|
34
|
+
this.dark = false;
|
|
35
|
+
}
|
|
36
|
+
static { this.styles = css `
|
|
37
|
+
:host {
|
|
38
|
+
display: block;
|
|
39
|
+
color: var(--md-sys-color-on-surface);
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
line-height: 1.5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
section {
|
|
45
|
+
margin: 0 0 20px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
h1,
|
|
49
|
+
h2,
|
|
50
|
+
h3 {
|
|
51
|
+
margin: 24px 0 8px;
|
|
52
|
+
line-height: 1.3;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
h1 {
|
|
56
|
+
font-size: 22px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
h2 {
|
|
60
|
+
font-size: 18px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
h3 {
|
|
64
|
+
font-size: 15px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.metrics {
|
|
68
|
+
display: grid;
|
|
69
|
+
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
|
|
70
|
+
gap: 10px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.metric {
|
|
74
|
+
padding: 12px 14px;
|
|
75
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
76
|
+
border-radius: 10px;
|
|
77
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.metric .label {
|
|
81
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
82
|
+
font-size: 12px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.metric .value {
|
|
86
|
+
font-size: 22px;
|
|
87
|
+
font-weight: 650;
|
|
88
|
+
font-variant-numeric: tabular-nums;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.metric .note {
|
|
92
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
93
|
+
font-size: 12px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.bar {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: 8px;
|
|
100
|
+
margin-bottom: 6px;
|
|
101
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
102
|
+
font-size: 12px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.bar .caption {
|
|
106
|
+
flex: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.bar button {
|
|
110
|
+
display: inline-flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: 4px;
|
|
113
|
+
padding: 3px 8px;
|
|
114
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
115
|
+
border-radius: 6px;
|
|
116
|
+
background: transparent;
|
|
117
|
+
color: inherit;
|
|
118
|
+
font: inherit;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.bar md-icon {
|
|
123
|
+
--md-icon-size: 16px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.scroll {
|
|
127
|
+
max-height: 560px;
|
|
128
|
+
overflow: auto;
|
|
129
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
130
|
+
border-radius: 8px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
table {
|
|
134
|
+
width: 100%;
|
|
135
|
+
border-collapse: collapse;
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
th,
|
|
140
|
+
td {
|
|
141
|
+
padding: 6px 10px;
|
|
142
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
143
|
+
text-align: start;
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
th {
|
|
148
|
+
position: sticky;
|
|
149
|
+
top: 0;
|
|
150
|
+
background: var(--md-sys-color-surface-container);
|
|
151
|
+
font-weight: 600;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
th button {
|
|
155
|
+
border: 0;
|
|
156
|
+
padding: 0;
|
|
157
|
+
background: none;
|
|
158
|
+
color: inherit;
|
|
159
|
+
font: inherit;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
td.num,
|
|
164
|
+
th.num {
|
|
165
|
+
text-align: end;
|
|
166
|
+
font-variant-numeric: tabular-nums;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.chart svg {
|
|
170
|
+
width: 100%;
|
|
171
|
+
height: auto;
|
|
172
|
+
display: block;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.chart .grid {
|
|
176
|
+
stroke: var(--md-sys-color-outline-variant);
|
|
177
|
+
stroke-width: 1;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.chart .tick {
|
|
181
|
+
fill: var(--md-sys-color-on-surface-variant);
|
|
182
|
+
font-size: 11px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.legend {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-wrap: wrap;
|
|
188
|
+
gap: 4px 14px;
|
|
189
|
+
margin-top: 6px;
|
|
190
|
+
font-size: 12px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.legend .swatch {
|
|
194
|
+
display: inline-block;
|
|
195
|
+
width: 10px;
|
|
196
|
+
height: 10px;
|
|
197
|
+
margin-inline-end: 5px;
|
|
198
|
+
border-radius: 3px;
|
|
199
|
+
vertical-align: -1px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.steps {
|
|
203
|
+
list-style: none;
|
|
204
|
+
margin: 0;
|
|
205
|
+
padding: 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.steps li {
|
|
209
|
+
display: flex;
|
|
210
|
+
gap: 8px;
|
|
211
|
+
padding: 4px 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.steps md-icon {
|
|
215
|
+
--md-icon-size: 18px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.steps .done md-icon {
|
|
219
|
+
color: var(--md-sys-color-primary);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.steps .failed md-icon {
|
|
223
|
+
color: var(--md-sys-color-error);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.steps .note {
|
|
227
|
+
display: block;
|
|
228
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
229
|
+
font-size: 12px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.unreadable,
|
|
233
|
+
.cut {
|
|
234
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
235
|
+
font-size: 12px;
|
|
236
|
+
font-style: italic;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.markdown :first-child {
|
|
240
|
+
margin-top: 0;
|
|
241
|
+
}
|
|
242
|
+
`; }
|
|
243
|
+
connectedCallback() {
|
|
244
|
+
super.connectedCallback();
|
|
245
|
+
this.dark = document.body.classList.contains('dark');
|
|
246
|
+
this.themeWatch = new MutationObserver(() => (this.dark = document.body.classList.contains('dark')));
|
|
247
|
+
this.themeWatch.observe(document.body, { attributes: true, attributeFilter: ['class'] });
|
|
248
|
+
}
|
|
249
|
+
disconnectedCallback() {
|
|
250
|
+
this.themeWatch?.disconnect();
|
|
251
|
+
super.disconnectedCallback();
|
|
252
|
+
}
|
|
253
|
+
render() {
|
|
254
|
+
const blocks = this.workspace?.blocks ?? [];
|
|
255
|
+
return html `${blocks.map((block, i) => this.block(block, i))}`;
|
|
256
|
+
}
|
|
257
|
+
block(block, i) {
|
|
258
|
+
switch (block.kind) {
|
|
259
|
+
case 'heading':
|
|
260
|
+
return block.level === 1 ? html `<h1>${block.text}</h1>` : block.level === 3 ? html `<h3>${block.text}</h3>` : html `<h2>${block.text}</h2>`;
|
|
261
|
+
case 'text':
|
|
262
|
+
return html `<section class="markdown">${unsafeHTML(renderMarkdown(block.markdown))}</section>`;
|
|
263
|
+
case 'metrics':
|
|
264
|
+
return html `<section class="metrics">
|
|
265
|
+
${(block.items ?? []).map((one) => html `<div class="metric">
|
|
266
|
+
<div class="label">${one.label}</div>
|
|
267
|
+
<div class="value">${shown(one.value)}${one.unit ? html ` <small>${one.unit}</small>` : nothing}</div>
|
|
268
|
+
${one.note ? html `<div class="note">${one.note}</div>` : nothing}
|
|
269
|
+
</div>`)}
|
|
270
|
+
</section>`;
|
|
271
|
+
case 'table':
|
|
272
|
+
return this.table(block, i);
|
|
273
|
+
case 'chart':
|
|
274
|
+
return this.chart(block, i);
|
|
275
|
+
case 'steps':
|
|
276
|
+
return html `<section>
|
|
277
|
+
<ol class="steps">
|
|
278
|
+
${(block.items ?? []).map((one) => html `<li class=${one.state}>
|
|
279
|
+
<md-icon>${{ done: 'check_circle', doing: 'progress_activity', failed: 'error', todo: 'radio_button_unchecked' }[one.state] ?? 'radio_button_unchecked'}</md-icon>
|
|
280
|
+
<span>${one.label}${one.note ? html `<span class="note">${one.note}</span>` : nothing}</span>
|
|
281
|
+
</li>`)}
|
|
282
|
+
</ol>
|
|
283
|
+
</section>`;
|
|
284
|
+
default:
|
|
285
|
+
return html `<section class="unreadable">${t('unreadable', 'a block that cannot be drawn ({reason})', { reason: block.reason ?? block.kind })}</section>`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
table(block, i) {
|
|
289
|
+
const columns = block.columns ?? [];
|
|
290
|
+
const sort = this.sorts[i];
|
|
291
|
+
const rows = sort ? sortRows(block.rows ?? [], sort.column, sort.direction, i18next.language) : block.rows ?? [];
|
|
292
|
+
const toggle = (column) => (this.sorts = { ...this.sorts, [i]: { column, direction: sort?.column === column && sort.direction === 'asc' ? 'desc' : 'asc' } });
|
|
293
|
+
return html `<section>
|
|
294
|
+
<div class="bar">
|
|
295
|
+
<span class="caption">${block.caption ?? ''} · ${t('rows', '{count} rows', { count: rows.length })}</span>
|
|
296
|
+
<button @click=${() => this.download(block.caption || this.workspace?.title || 'table', columns, rows)}>
|
|
297
|
+
<md-icon>download</md-icon>${t('csv', 'CSV')}
|
|
298
|
+
</button>
|
|
299
|
+
</div>
|
|
300
|
+
${this.tableOf(columns, rows, sort, toggle)}
|
|
301
|
+
${block.cut ? html `<div class="cut">${t('cut', '{count} more rows were left out over the limit.', { count: block.cut })}</div>` : nothing}
|
|
302
|
+
</section>`;
|
|
303
|
+
}
|
|
304
|
+
tableOf(columns, rows, sort, toggle) {
|
|
305
|
+
return html `<div class="scroll">
|
|
306
|
+
<table>
|
|
307
|
+
<thead>
|
|
308
|
+
<tr>
|
|
309
|
+
${columns.map(column => html `<th class=${column.type === 'number' ? 'num' : ''} aria-sort=${sort?.column === column.name ? (sort.direction === 'asc' ? 'ascending' : 'descending') : 'none'}>
|
|
310
|
+
${toggle
|
|
311
|
+
? html `<button @click=${() => toggle(column.name)}>${column.label || column.name}${sort?.column === column.name ? (sort.direction === 'asc' ? ' ▲' : ' ▼') : ''}</button>`
|
|
312
|
+
: column.label || column.name}
|
|
313
|
+
</th>`)}
|
|
314
|
+
</tr>
|
|
315
|
+
</thead>
|
|
316
|
+
<tbody>
|
|
317
|
+
${rows.map(row => html `<tr>${columns.map(column => html `<td class=${column.type === 'number' || typeof row[column.name] === 'number' ? 'num' : ''}>${shown(row[column.name])}</td>`)}</tr>`)}
|
|
318
|
+
</tbody>
|
|
319
|
+
</table>
|
|
320
|
+
</div>`;
|
|
321
|
+
}
|
|
322
|
+
chart(block, i) {
|
|
323
|
+
const colours = this.dark ? DARK : LIGHT;
|
|
324
|
+
const x = block.x ?? [];
|
|
325
|
+
const series = block.series ?? [];
|
|
326
|
+
const name = (one) => (one.other ? t('other', 'other') : one.name);
|
|
327
|
+
const showingTable = this.asTable.has(i);
|
|
328
|
+
const flip = () => {
|
|
329
|
+
const next = new Set(this.asTable);
|
|
330
|
+
next.has(i) ? next.delete(i) : next.add(i);
|
|
331
|
+
this.asTable = next;
|
|
332
|
+
};
|
|
333
|
+
const bar = html `<div class="bar">
|
|
334
|
+
<span class="caption">${block.caption ?? ''}${block.unit ? ` (${block.unit})` : ''}</span>
|
|
335
|
+
<button @click=${flip}><md-icon>${showingTable ? 'bar_chart' : 'table_rows'}</md-icon>${showingTable ? t('as-chart', 'chart') : t('as-table', 'table')}</button>
|
|
336
|
+
</div>`;
|
|
337
|
+
if (showingTable) {
|
|
338
|
+
const columns = [{ name: '_x', label: '' }, ...series.map((one, s) => ({ name: `s${s}`, label: name(one), type: 'number' }))];
|
|
339
|
+
const rows = x.map((label, j) => Object.fromEntries([['_x', label], ...series.map((one, s) => [`s${s}`, one.values[j]])]));
|
|
340
|
+
return html `<section class="chart">${bar}${this.tableOf(columns, rows)}</section>`;
|
|
341
|
+
}
|
|
342
|
+
const W = 640;
|
|
343
|
+
const H = 240;
|
|
344
|
+
const left = 56;
|
|
345
|
+
const bottom = 28;
|
|
346
|
+
const plotW = W - left - 8;
|
|
347
|
+
const plotH = H - bottom - 10;
|
|
348
|
+
const values = series.flatMap(one => one.values).filter((v) => typeof v === 'number');
|
|
349
|
+
const min = Math.min(0, ...values);
|
|
350
|
+
const ticks = ticksFor(Math.max(...values, 0) - min).map(tick => tick + min);
|
|
351
|
+
const top = ticks[ticks.length - 1] || 1;
|
|
352
|
+
const y = (v) => 10 + plotH - ((v - min) / (top - min || 1)) * plotH;
|
|
353
|
+
const band = plotW / Math.max(1, x.length);
|
|
354
|
+
const everyNth = Math.max(1, Math.ceil(x.length / 12));
|
|
355
|
+
const marks = block.chart === 'line'
|
|
356
|
+
? series.map((one, s) => {
|
|
357
|
+
const points = one.values.map((v, j) => (typeof v === 'number' ? [left + band * (j + 0.5), y(v)] : null));
|
|
358
|
+
const path = points.reduce((d, p, j) => (p ? `${d}${d && points[j - 1] ? 'L' : 'M'}${p[0]},${p[1]}` : d), '');
|
|
359
|
+
return svg `<path d=${path} fill="none" stroke=${colours[s % 8]} stroke-width="2" stroke-linejoin="round" stroke-linecap="round"></path>
|
|
360
|
+
${points.map((p, j) => p ? svg `<circle cx=${p[0]} cy=${p[1]} r="4" fill=${colours[s % 8]} stroke="var(--md-sys-color-surface)" stroke-width="2"><title>${name(one)} · ${x[j]}: ${shown(one.values[j])}</title></circle>` : nothing)}`;
|
|
361
|
+
})
|
|
362
|
+
: series.map((one, s) => {
|
|
363
|
+
const inner = band * 0.7;
|
|
364
|
+
const width = Math.max(2, inner / series.length - 2);
|
|
365
|
+
return one.values.map((v, j) => {
|
|
366
|
+
if (typeof v !== 'number')
|
|
367
|
+
return nothing;
|
|
368
|
+
const x0 = left + band * j + (band - inner) / 2 + s * (width + 2);
|
|
369
|
+
const y0 = Math.min(y(v), y(0));
|
|
370
|
+
const h = Math.max(1, Math.abs(y(v) - y(0)));
|
|
371
|
+
return svg `<rect x=${x0} y=${y0} width=${width} height=${h} rx="3" fill=${colours[s % 8]}><title>${name(one)} · ${x[j]}: ${shown(v)}</title></rect>`;
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
return html `<section class="chart" role="img" aria-label=${block.caption || series.map(name).join(', ')}>
|
|
375
|
+
${bar}
|
|
376
|
+
<svg viewBox="0 0 ${W} ${H}">
|
|
377
|
+
${ticks.map(tick => svg `<line class="grid" x1=${left} x2=${W - 8} y1=${y(tick)} y2=${y(tick)}></line><text class="tick" x=${left - 6} y=${y(tick) + 4} text-anchor="end">${shown(tick)}</text>`)}
|
|
378
|
+
${marks}
|
|
379
|
+
${x.map((label, j) => (j % everyNth ? nothing : svg `<text class="tick" x=${left + band * (j + 0.5)} y=${H - 8} text-anchor="middle">${label}</text>`))}
|
|
380
|
+
</svg>
|
|
381
|
+
${series.length > 1
|
|
382
|
+
? html `<div class="legend">${series.map((one, s) => html `<span><span class="swatch" style="background:${colours[s % 8]}"></span>${name(one)}</span>`)}</div>`
|
|
383
|
+
: nothing}
|
|
384
|
+
</section>`;
|
|
385
|
+
}
|
|
386
|
+
download(title, columns, rows) {
|
|
387
|
+
const blob = new Blob([tableCsv(columns, rows)], { type: 'text/csv;charset=utf-8' });
|
|
388
|
+
const url = URL.createObjectURL(blob);
|
|
389
|
+
const link = document.createElement('a');
|
|
390
|
+
link.href = url;
|
|
391
|
+
link.download = `${title.replace(/[\\/:*?"<>|]+/g, '-').slice(0, 80)}.csv`;
|
|
392
|
+
link.click();
|
|
393
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
__decorate([
|
|
397
|
+
property({ attribute: false }),
|
|
398
|
+
__metadata("design:type", Object)
|
|
399
|
+
], AssistantWorkspaceView.prototype, "workspace", void 0);
|
|
400
|
+
__decorate([
|
|
401
|
+
state(),
|
|
402
|
+
__metadata("design:type", Object)
|
|
403
|
+
], AssistantWorkspaceView.prototype, "sorts", void 0);
|
|
404
|
+
__decorate([
|
|
405
|
+
state(),
|
|
406
|
+
__metadata("design:type", Object)
|
|
407
|
+
], AssistantWorkspaceView.prototype, "asTable", void 0);
|
|
408
|
+
__decorate([
|
|
409
|
+
state(),
|
|
410
|
+
__metadata("design:type", Object)
|
|
411
|
+
], AssistantWorkspaceView.prototype, "dark", void 0);
|
|
412
|
+
AssistantWorkspaceView = __decorate([
|
|
413
|
+
customElement('ox-assistant-workspace-view')
|
|
414
|
+
], AssistantWorkspaceView);
|
|
415
|
+
export { AssistantWorkspaceView };
|
|
416
|
+
//# sourceMappingURL=workspace-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-view.js","sourceRoot":"","sources":["../../client/components/workspace-view.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAuB,MAAM,KAAK,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAA+C,MAAM,uBAAuB,CAAA;AAEvG,MAAM,KAAK,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AACtG,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAErG,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,YAAoB,EAAE,UAAmC,EAAE,EAAE,EAAE,CACrF,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAA;AAElF,MAAM,KAAK,GAAG,CAAC,KAAc,EAAE,EAAE,CAC/B,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SA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AAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;QACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;QACxC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,QAAQ,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAA;QAC1E,IAAI,CAAC,KAAK,EAAE,CAAA;QACZ,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAA;IAClD,CAAC;;AApL+B;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;yDAA0B;AAExC;IAAhB,KAAK,EAAE;;qDAAkF;AACzE;IAAhB,KAAK,EAAE;;uDAAoC;AAC3B;IAAhB,KAAK,EAAE;;oDAAqB;AArNlB,sBAAsB;IADlC,aAAa,CAAC,6BAA6B,CAAC;GAChC,sBAAsB,CAsYlC","sourcesContent":["/*\n * The blocks of an AI 작업판, drawn (operato-application/design/ai/workspace.md §3).\n *\n * Every kind is drawn here - the model writes no HTML. Charts use the eight validated categorical colours in\n * a fixed order (dataviz reference palette, light and dark each checked); three of the light ones sit under\n * 3:1 against the surface, so every chart carries its legend (two series or more) and a table view.\n */\nimport '@material/web/icon/icon.js'\n\nimport { LitElement, css, html, nothing, svg, type TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { renderMarkdown } from './markdown.js'\nimport { sortRows, tableCsv, type WorkspaceBlockView, type WorkspaceView } from '../utils/workspace.js'\n\nconst LIGHT = ['#2a78d6', '#eb6834', '#1baf7a', '#eda100', '#e87ba4', '#008300', '#4a3aa7', '#e34948']\nconst DARK = ['#3987e5', '#d95926', '#199e70', '#c98500', '#d55181', '#008300', '#9085e9', '#e66767']\n\nconst t = (key: string, defaultValue: string, options: Record<string, unknown> = {}) =>\n String(i18next.t(`ai-assistant.workspace.${key}`, { defaultValue, ...options }))\n\nconst shown = (value: unknown) =>\n value === null || value === undefined ? '' : typeof value === 'number' ? value.toLocaleString(i18next.language || undefined) : String(value)\n\n/** Four round steps from zero to above the largest value. */\nfunction ticksFor(max: number): number[] {\n if (!(max > 0)) return [0, 1]\n const raw = max / 4\n const power = 10 ** Math.floor(Math.log10(raw))\n const step = [1, 2, 2.5, 5, 10].map(one => one * power).find(one => one >= raw) ?? raw\n return Array.from({ length: Math.ceil(max / step) + 1 }, (_, i) => Math.round(i * step * 1e6) / 1e6)\n}\n\n@customElement('ox-assistant-workspace-view')\nexport class AssistantWorkspaceView extends LitElement {\n static styles = css`\n :host {\n display: block;\n color: var(--md-sys-color-on-surface);\n font-size: 14px;\n line-height: 1.5;\n }\n\n section {\n margin: 0 0 20px;\n }\n\n h1,\n h2,\n h3 {\n margin: 24px 0 8px;\n line-height: 1.3;\n }\n\n h1 {\n font-size: 22px;\n }\n\n h2 {\n font-size: 18px;\n }\n\n h3 {\n font-size: 15px;\n }\n\n .metrics {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));\n gap: 10px;\n }\n\n .metric {\n padding: 12px 14px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 10px;\n background: var(--md-sys-color-surface-container-lowest);\n }\n\n .metric .label {\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n }\n\n .metric .value {\n font-size: 22px;\n font-weight: 650;\n font-variant-numeric: tabular-nums;\n }\n\n .metric .note {\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n }\n\n .bar {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 6px;\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n }\n\n .bar .caption {\n flex: 1;\n }\n\n .bar button {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n\n .bar md-icon {\n --md-icon-size: 16px;\n }\n\n .scroll {\n max-height: 560px;\n overflow: auto;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 8px;\n }\n\n table {\n width: 100%;\n border-collapse: collapse;\n font-size: 13px;\n }\n\n th,\n td {\n padding: 6px 10px;\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n text-align: start;\n white-space: nowrap;\n }\n\n th {\n position: sticky;\n top: 0;\n background: var(--md-sys-color-surface-container);\n font-weight: 600;\n }\n\n th button {\n border: 0;\n padding: 0;\n background: none;\n color: inherit;\n font: inherit;\n cursor: pointer;\n }\n\n td.num,\n th.num {\n text-align: end;\n font-variant-numeric: tabular-nums;\n }\n\n .chart svg {\n width: 100%;\n height: auto;\n display: block;\n }\n\n .chart .grid {\n stroke: var(--md-sys-color-outline-variant);\n stroke-width: 1;\n }\n\n .chart .tick {\n fill: var(--md-sys-color-on-surface-variant);\n font-size: 11px;\n }\n\n .legend {\n display: flex;\n flex-wrap: wrap;\n gap: 4px 14px;\n margin-top: 6px;\n font-size: 12px;\n }\n\n .legend .swatch {\n display: inline-block;\n width: 10px;\n height: 10px;\n margin-inline-end: 5px;\n border-radius: 3px;\n vertical-align: -1px;\n }\n\n .steps {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n .steps li {\n display: flex;\n gap: 8px;\n padding: 4px 0;\n }\n\n .steps md-icon {\n --md-icon-size: 18px;\n }\n\n .steps .done md-icon {\n color: var(--md-sys-color-primary);\n }\n\n .steps .failed md-icon {\n color: var(--md-sys-color-error);\n }\n\n .steps .note {\n display: block;\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n }\n\n .unreadable,\n .cut {\n color: var(--md-sys-color-on-surface-variant);\n font-size: 12px;\n font-style: italic;\n }\n\n .markdown :first-child {\n margin-top: 0;\n }\n `\n\n @property({ attribute: false }) workspace?: WorkspaceView\n\n @state() private sorts: Record<number, { column: string; direction: 'asc' | 'desc' }> = {}\n @state() private asTable = new Set<number>()\n @state() private dark = false\n\n private themeWatch?: MutationObserver\n\n connectedCallback() {\n super.connectedCallback()\n this.dark = document.body.classList.contains('dark')\n this.themeWatch = new MutationObserver(() => (this.dark = document.body.classList.contains('dark')))\n this.themeWatch.observe(document.body, { attributes: true, attributeFilter: ['class'] })\n }\n\n disconnectedCallback() {\n this.themeWatch?.disconnect()\n super.disconnectedCallback()\n }\n\n render() {\n const blocks = this.workspace?.blocks ?? []\n return html`${blocks.map((block, i) => this.block(block, i))}`\n }\n\n private block(block: WorkspaceBlockView, i: number): TemplateResult {\n switch (block.kind) {\n case 'heading':\n return block.level === 1 ? html`<h1>${block.text}</h1>` : block.level === 3 ? html`<h3>${block.text}</h3>` : html`<h2>${block.text}</h2>`\n case 'text':\n return html`<section class=\"markdown\">${unsafeHTML(renderMarkdown(block.markdown))}</section>`\n case 'metrics':\n return html`<section class=\"metrics\">\n ${(block.items ?? []).map(\n (one: any) => html`<div class=\"metric\">\n <div class=\"label\">${one.label}</div>\n <div class=\"value\">${shown(one.value)}${one.unit ? html` <small>${one.unit}</small>` : nothing}</div>\n ${one.note ? html`<div class=\"note\">${one.note}</div>` : nothing}\n </div>`\n )}\n </section>`\n case 'table':\n return this.table(block, i)\n case 'chart':\n return this.chart(block, i)\n case 'steps':\n return html`<section>\n <ol class=\"steps\">\n ${(block.items ?? []).map(\n (one: any) => html`<li class=${one.state}>\n <md-icon>${{ done: 'check_circle', doing: 'progress_activity', failed: 'error', todo: 'radio_button_unchecked' }[one.state as string] ?? 'radio_button_unchecked'}</md-icon>\n <span>${one.label}${one.note ? html`<span class=\"note\">${one.note}</span>` : nothing}</span>\n </li>`\n )}\n </ol>\n </section>`\n default:\n return html`<section class=\"unreadable\">${t('unreadable', 'a block that cannot be drawn ({reason})', { reason: block.reason ?? block.kind })}</section>`\n }\n }\n\n private table(block: WorkspaceBlockView, i: number): TemplateResult {\n const columns: { name: string; label?: string; type?: string }[] = block.columns ?? []\n const sort = this.sorts[i]\n const rows = sort ? sortRows(block.rows ?? [], sort.column, sort.direction, i18next.language) : block.rows ?? []\n const toggle = (column: string) =>\n (this.sorts = { ...this.sorts, [i]: { column, direction: sort?.column === column && sort.direction === 'asc' ? 'desc' : 'asc' } })\n return html`<section>\n <div class=\"bar\">\n <span class=\"caption\">${block.caption ?? ''} · ${t('rows', '{count} rows', { count: rows.length })}</span>\n <button @click=${() => this.download(block.caption || this.workspace?.title || 'table', columns, rows)}>\n <md-icon>download</md-icon>${t('csv', 'CSV')}\n </button>\n </div>\n ${this.tableOf(columns, rows, sort, toggle)}\n ${block.cut ? html`<div class=\"cut\">${t('cut', '{count} more rows were left out over the limit.', { count: block.cut })}</div>` : nothing}\n </section>`\n }\n\n private tableOf(columns: { name: string; label?: string; type?: string }[], rows: Record<string, any>[], sort?: { column: string; direction: string }, toggle?: (column: string) => void) {\n return html`<div class=\"scroll\">\n <table>\n <thead>\n <tr>\n ${columns.map(\n column => html`<th class=${column.type === 'number' ? 'num' : ''} aria-sort=${sort?.column === column.name ? (sort.direction === 'asc' ? 'ascending' : 'descending') : 'none'}>\n ${toggle\n ? html`<button @click=${() => toggle(column.name)}>${column.label || column.name}${sort?.column === column.name ? (sort.direction === 'asc' ? ' ▲' : ' ▼') : ''}</button>`\n : column.label || column.name}\n </th>`\n )}\n </tr>\n </thead>\n <tbody>\n ${rows.map(row => html`<tr>${columns.map(column => html`<td class=${column.type === 'number' || typeof row[column.name] === 'number' ? 'num' : ''}>${shown(row[column.name])}</td>`)}</tr>`)}\n </tbody>\n </table>\n </div>`\n }\n\n private chart(block: WorkspaceBlockView, i: number): TemplateResult {\n const colours = this.dark ? DARK : LIGHT\n const x: string[] = block.x ?? []\n const series: { name: string; other?: boolean; values: (number | null)[] }[] = block.series ?? []\n const name = (one: { name: string; other?: boolean }) => (one.other ? t('other', 'other') : one.name)\n const showingTable = this.asTable.has(i)\n const flip = () => {\n const next = new Set(this.asTable)\n next.has(i) ? next.delete(i) : next.add(i)\n this.asTable = next\n }\n\n const bar = html`<div class=\"bar\">\n <span class=\"caption\">${block.caption ?? ''}${block.unit ? ` (${block.unit})` : ''}</span>\n <button @click=${flip}><md-icon>${showingTable ? 'bar_chart' : 'table_rows'}</md-icon>${showingTable ? t('as-chart', 'chart') : t('as-table', 'table')}</button>\n </div>`\n\n if (showingTable) {\n const columns = [{ name: '_x', label: '' }, ...series.map((one, s) => ({ name: `s${s}`, label: name(one), type: 'number' }))]\n const rows = x.map((label, j) => Object.fromEntries([['_x', label], ...series.map((one, s) => [`s${s}`, one.values[j]])]))\n return html`<section class=\"chart\">${bar}${this.tableOf(columns, rows)}</section>`\n }\n\n const W = 640\n const H = 240\n const left = 56\n const bottom = 28\n const plotW = W - left - 8\n const plotH = H - bottom - 10\n const values = series.flatMap(one => one.values).filter((v): v is number => typeof v === 'number')\n const min = Math.min(0, ...values)\n const ticks = ticksFor(Math.max(...values, 0) - min).map(tick => tick + min)\n const top = ticks[ticks.length - 1] || 1\n const y = (v: number) => 10 + plotH - ((v - min) / (top - min || 1)) * plotH\n const band = plotW / Math.max(1, x.length)\n const everyNth = Math.max(1, Math.ceil(x.length / 12))\n\n const marks =\n block.chart === 'line'\n ? series.map((one, s) => {\n const points = one.values.map((v, j) => (typeof v === 'number' ? [left + band * (j + 0.5), y(v)] : null))\n const path = points.reduce((d, p, j) => (p ? `${d}${d && points[j - 1] ? 'L' : 'M'}${p[0]},${p[1]}` : d), '')\n return svg`<path d=${path} fill=\"none\" stroke=${colours[s % 8]} stroke-width=\"2\" stroke-linejoin=\"round\" stroke-linecap=\"round\"></path>\n ${points.map((p, j) =>\n p ? svg`<circle cx=${p[0]} cy=${p[1]} r=\"4\" fill=${colours[s % 8]} stroke=\"var(--md-sys-color-surface)\" stroke-width=\"2\"><title>${name(one)} · ${x[j]}: ${shown(one.values[j])}</title></circle>` : nothing\n )}`\n })\n : series.map((one, s) => {\n const inner = band * 0.7\n const width = Math.max(2, inner / series.length - 2)\n return one.values.map((v, j) => {\n if (typeof v !== 'number') return nothing\n const x0 = left + band * j + (band - inner) / 2 + s * (width + 2)\n const y0 = Math.min(y(v), y(0))\n const h = Math.max(1, Math.abs(y(v) - y(0)))\n return svg`<rect x=${x0} y=${y0} width=${width} height=${h} rx=\"3\" fill=${colours[s % 8]}><title>${name(one)} · ${x[j]}: ${shown(v)}</title></rect>`\n })\n })\n\n return html`<section class=\"chart\" role=\"img\" aria-label=${block.caption || series.map(name).join(', ')}>\n ${bar}\n <svg viewBox=\"0 0 ${W} ${H}\">\n ${ticks.map(tick => svg`<line class=\"grid\" x1=${left} x2=${W - 8} y1=${y(tick)} y2=${y(tick)}></line><text class=\"tick\" x=${left - 6} y=${y(tick) + 4} text-anchor=\"end\">${shown(tick)}</text>`)}\n ${marks}\n ${x.map((label, j) => (j % everyNth ? nothing : svg`<text class=\"tick\" x=${left + band * (j + 0.5)} y=${H - 8} text-anchor=\"middle\">${label}</text>`))}\n </svg>\n ${series.length > 1\n ? html`<div class=\"legend\">${series.map((one, s) => html`<span><span class=\"swatch\" style=\"background:${colours[s % 8]}\"></span>${name(one)}</span>`)}</div>`\n : nothing}\n </section>`\n }\n\n private download(title: string, columns: { name: string; label?: string }[], rows: Record<string, any>[]) {\n const blob = new Blob([tableCsv(columns, rows)], { type: 'text/csv;charset=utf-8' })\n const url = URL.createObjectURL(blob)\n const link = document.createElement('a')\n link.href = url\n link.download = `${title.replace(/[\\\\/:*?\"<>|]+/g, '-').slice(0, 80)}.csv`\n link.click()\n setTimeout(() => URL.revokeObjectURL(url), 1000)\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '../components/workspace-view.js';
|
|
3
|
+
import { PageView } from '@operato/shell';
|
|
4
|
+
declare const AssistantWorkspacePage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView;
|
|
5
|
+
export declare class AssistantWorkspacePage extends AssistantWorkspacePage_base {
|
|
6
|
+
static styles: import("lit").CSSResult[];
|
|
7
|
+
private sessionId;
|
|
8
|
+
private name;
|
|
9
|
+
private wanted;
|
|
10
|
+
private versions;
|
|
11
|
+
private loading;
|
|
12
|
+
private failure;
|
|
13
|
+
/** A version that arrived after the page was drawn - announced, not shown until asked. */
|
|
14
|
+
private newer;
|
|
15
|
+
private unsubscribe?;
|
|
16
|
+
get context(): {
|
|
17
|
+
title: string;
|
|
18
|
+
};
|
|
19
|
+
private get shown();
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
pageUpdated(_changes: any, lifecycle: any): Promise<void>;
|
|
23
|
+
private load;
|
|
24
|
+
private go;
|
|
25
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|