@happyvertical/smrt-svelte 0.55.8 → 0.55.10
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/AGENTS.md +1 -1
- package/agents/overview-surfaces.md +122 -17
- package/agents/workspace.md +6 -0
- package/dist/components/activity/ActivityList.svelte +35 -0
- package/dist/components/activity/ActivityList.svelte.d.ts +11 -0
- package/dist/components/activity/ActivityList.svelte.d.ts.map +1 -0
- package/dist/components/activity/index.d.ts +3 -0
- package/dist/components/activity/index.d.ts.map +1 -0
- package/dist/components/activity/index.js +1 -0
- package/dist/components/activity/safe-href.d.ts +3 -0
- package/dist/components/activity/safe-href.d.ts.map +1 -0
- package/dist/components/activity/safe-href.js +12 -0
- package/dist/components/activity/types.d.ts +9 -0
- package/dist/components/activity/types.d.ts.map +1 -0
- package/dist/components/activity/types.js +1 -0
- package/dist/components/notifications/LocalizedNotifications.fixture.svelte +16 -0
- package/dist/components/notifications/LocalizedNotifications.fixture.svelte.d.ts +11 -0
- package/dist/components/notifications/LocalizedNotifications.fixture.svelte.d.ts.map +1 -0
- package/dist/components/notifications/NotificationBell.svelte +136 -0
- package/dist/components/notifications/NotificationBell.svelte.d.ts +13 -0
- package/dist/components/notifications/NotificationBell.svelte.d.ts.map +1 -0
- package/dist/components/notifications/index.d.ts +3 -0
- package/dist/components/notifications/index.d.ts.map +1 -0
- package/dist/components/notifications/index.js +1 -0
- package/dist/components/notifications/types.d.ts +27 -0
- package/dist/components/notifications/types.d.ts.map +1 -0
- package/dist/components/notifications/types.js +1 -0
- package/dist/components/overview/OverviewAssistantUndo.svelte +77 -0
- package/dist/components/overview/OverviewAssistantUndo.svelte.d.ts +13 -0
- package/dist/components/overview/OverviewAssistantUndo.svelte.d.ts.map +1 -0
- package/dist/components/overview/assistant-surface.d.ts +90 -0
- package/dist/components/overview/assistant-surface.d.ts.map +1 -0
- package/dist/components/overview/assistant-surface.js +65 -0
- package/dist/components/overview/assistant.svelte.d.ts +115 -0
- package/dist/components/overview/assistant.svelte.d.ts.map +1 -0
- package/dist/components/overview/assistant.svelte.js +260 -0
- package/dist/components/overview/controller.svelte.d.ts +8 -0
- package/dist/components/overview/controller.svelte.d.ts.map +1 -1
- package/dist/components/overview/controller.svelte.js +76 -13
- package/dist/components/overview/index.d.ts +2 -0
- package/dist/components/overview/index.d.ts.map +1 -1
- package/dist/components/overview/index.js +2 -0
- package/dist/components/overview/operations.d.ts +169 -0
- package/dist/components/overview/operations.d.ts.map +1 -0
- package/dist/components/overview/operations.js +358 -0
- package/dist/components/overview/server.d.ts +2 -0
- package/dist/components/overview/server.d.ts.map +1 -1
- package/dist/components/overview/server.js +2 -0
- package/dist/components/workspace/admin-shell/settings-delta.d.ts +21 -0
- package/dist/components/workspace/admin-shell/settings-delta.d.ts.map +1 -0
- package/dist/components/workspace/admin-shell/settings-delta.js +142 -0
- package/dist/components/workspace/index.d.ts +1 -0
- package/dist/components/workspace/index.d.ts.map +1 -1
- package/dist/components/workspace/index.js +1 -0
- package/dist/components/workspace/server/index.d.ts +6 -2
- package/dist/components/workspace/server/index.d.ts.map +1 -1
- package/dist/components/workspace/server/index.js +5 -2
- package/dist/i18n/server.d.ts +1 -0
- package/dist/i18n/server.d.ts.map +1 -1
- package/dist/i18n/server.js +1 -0
- package/dist/i18n/strings.notifications.d.ts +12 -0
- package/dist/i18n/strings.notifications.d.ts.map +1 -0
- package/dist/i18n/strings.notifications.js +13 -0
- package/dist/i18n/strings.overview.d.ts +6 -0
- package/dist/i18n/strings.overview.d.ts.map +1 -1
- package/dist/i18n/strings.overview.js +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +20 -14
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured overview operations (#3727 phase 4): the batch an assistant (or
|
|
3
|
+
* any other non-UI caller) applies to an overview, and the description it
|
|
4
|
+
* reads first.
|
|
5
|
+
*
|
|
6
|
+
* An operation is data, never code: `add`, `configure`, `move`, `resize` and
|
|
7
|
+
* `remove`, with the same option vocabulary the grid's own editor uses. A batch
|
|
8
|
+
* is planned against the page's definition and the current override with the
|
|
9
|
+
* phase-1 model and then checked with {@link checkOverviewOverride}, so it can
|
|
10
|
+
* only produce an override the save endpoint would accept. A batch is atomic:
|
|
11
|
+
* one invalid operation rejects the whole batch and nothing is returned to
|
|
12
|
+
* apply. Nothing here loads data or runs a query.
|
|
13
|
+
*
|
|
14
|
+
* Svelte-free; on both `./overview` and `./overview/server`.
|
|
15
|
+
*/
|
|
16
|
+
import { checkOverviewOverride, diffOverview, nextWidgetId, resolveOverview, } from './model.js';
|
|
17
|
+
import { defaultWidgetOptions, validateWidgetOptions } from './schema.js';
|
|
18
|
+
import { OVERVIEW_DEFAULT_MAX_WIDGETS, OVERVIEW_ID_PATTERN, } from './types.js';
|
|
19
|
+
/** Most operations one batch may carry. */
|
|
20
|
+
export const OVERVIEW_MAX_OPERATIONS = 20;
|
|
21
|
+
export const OVERVIEW_OPERATION_KINDS = [
|
|
22
|
+
'add',
|
|
23
|
+
'configure',
|
|
24
|
+
'move',
|
|
25
|
+
'resize',
|
|
26
|
+
'remove',
|
|
27
|
+
];
|
|
28
|
+
function isRecord(value) {
|
|
29
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
30
|
+
}
|
|
31
|
+
const OPERATION_KEYS = {
|
|
32
|
+
add: ['op', 'type', 'span', 'options', 'index'],
|
|
33
|
+
configure: ['op', 'id', 'options'],
|
|
34
|
+
move: ['op', 'id', 'index'],
|
|
35
|
+
resize: ['op', 'id', 'span'],
|
|
36
|
+
remove: ['op', 'id'],
|
|
37
|
+
};
|
|
38
|
+
function cloneWidget(widget) {
|
|
39
|
+
return { ...widget, options: { ...widget.options } };
|
|
40
|
+
}
|
|
41
|
+
function describeOptionIssues(issues) {
|
|
42
|
+
return issues
|
|
43
|
+
.map((issue) => `${issue.key || '(options)'}: ${issue.code}`)
|
|
44
|
+
.join(', ');
|
|
45
|
+
}
|
|
46
|
+
function typeAllowed(definition, def) {
|
|
47
|
+
return ((!definition.allowed || definition.allowed.includes(def.type)) &&
|
|
48
|
+
(!def.allowedIn || def.allowedIn.includes(definition.id)));
|
|
49
|
+
}
|
|
50
|
+
/** Widget types an overview allows, in registration order. */
|
|
51
|
+
export function allowedWidgetTypes(definition, registry) {
|
|
52
|
+
return registry.list().filter((def) => typeAllowed(definition, def));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Plan a batch of operations against an overview. Total: never throws, never
|
|
56
|
+
* mutates its input. On success, persist (or `controller.restore`) the
|
|
57
|
+
* returned `override`; on failure nothing may be applied.
|
|
58
|
+
*/
|
|
59
|
+
export function planOverviewOperations(input) {
|
|
60
|
+
const { definition, registry } = input;
|
|
61
|
+
const max = input.maxOperations ?? OVERVIEW_MAX_OPERATIONS;
|
|
62
|
+
const batchIssue = (code, message) => ({
|
|
63
|
+
ok: false,
|
|
64
|
+
issues: [{ index: null, op: null, widgetId: null, code, message }],
|
|
65
|
+
});
|
|
66
|
+
if (!Array.isArray(input.operations) || input.operations.length === 0) {
|
|
67
|
+
return batchIssue('malformed', 'operations must be a non-empty array');
|
|
68
|
+
}
|
|
69
|
+
if (input.operations.length > max) {
|
|
70
|
+
return batchIssue('too_many_operations', `a batch holds at most ${max} operations`);
|
|
71
|
+
}
|
|
72
|
+
const resolved = resolveOverview(definition, input.override, registry);
|
|
73
|
+
const current = diffOverview(resolved.base, resolved.document);
|
|
74
|
+
const widgets = resolved.document.widgets.map(cloneWidget);
|
|
75
|
+
const cap = definition.maxWidgets ?? OVERVIEW_DEFAULT_MAX_WIDGETS;
|
|
76
|
+
const reserved = new Set([
|
|
77
|
+
...resolved.base.widgets.map((widget) => widget.id),
|
|
78
|
+
...widgets.map((widget) => widget.id),
|
|
79
|
+
...(current?.removed ?? []),
|
|
80
|
+
]);
|
|
81
|
+
const context = { models: definition.models };
|
|
82
|
+
const issues = [];
|
|
83
|
+
const results = [];
|
|
84
|
+
input.operations.forEach((raw, index) => {
|
|
85
|
+
const op = isRecord(raw) && typeof raw.op === 'string' ? raw.op : null;
|
|
86
|
+
const widgetId = isRecord(raw) && typeof raw.id === 'string' ? raw.id : null;
|
|
87
|
+
const fail = (code, message, extra = {}) => {
|
|
88
|
+
issues.push({ index, op, widgetId, code, message, ...extra });
|
|
89
|
+
};
|
|
90
|
+
if (!isRecord(raw) || op === null) {
|
|
91
|
+
fail('malformed', 'operation must be an object with an "op"');
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (!OVERVIEW_OPERATION_KINDS.includes(op)) {
|
|
95
|
+
fail('malformed', `unknown op "${op}"; use one of ${OVERVIEW_OPERATION_KINDS.join(', ')}`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const kind = op;
|
|
99
|
+
const extra = Object.keys(raw).filter((key) => !OPERATION_KEYS[kind].includes(key));
|
|
100
|
+
if (extra.length) {
|
|
101
|
+
fail('malformed', `unknown field(s) for ${kind}: ${extra.join(', ')}`);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const spanFor = (def, value) => {
|
|
105
|
+
if (typeof value !== 'number' ||
|
|
106
|
+
!Number.isInteger(value) ||
|
|
107
|
+
value < def.minSpan ||
|
|
108
|
+
value > def.maxSpan) {
|
|
109
|
+
fail('invalid_span', `span for "${def.type}" must be an integer from ${def.minSpan} to ${def.maxSpan}`);
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return value;
|
|
113
|
+
};
|
|
114
|
+
const indexFor = (value, length) => {
|
|
115
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) {
|
|
116
|
+
fail('invalid_index', 'index must be a non-negative integer');
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
return Math.min(value, length);
|
|
120
|
+
};
|
|
121
|
+
const find = () => {
|
|
122
|
+
const position = widgetId === null || !OVERVIEW_ID_PATTERN.test(widgetId)
|
|
123
|
+
? -1
|
|
124
|
+
: widgets.findIndex((widget) => widget.id === widgetId);
|
|
125
|
+
if (position < 0) {
|
|
126
|
+
fail('unknown_widget', `no widget "${widgetId ?? ''}" on this overview; ids are ${widgets.map((widget) => widget.id).join(', ') || '(none)'}`);
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
const widget = widgets[position];
|
|
130
|
+
return { position, widget, def: registry.get(widget.type) };
|
|
131
|
+
};
|
|
132
|
+
if (kind === 'add') {
|
|
133
|
+
const type = typeof raw.type === 'string' ? raw.type : '';
|
|
134
|
+
const def = registry.get(type);
|
|
135
|
+
if (!def) {
|
|
136
|
+
fail('unknown_type', `widget type "${type}" is not registered`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (!typeAllowed(definition, def)) {
|
|
140
|
+
fail('type_not_allowed', `widget type "${type}" is not allowed on this overview; allowed: ${allowedWidgetTypes(definition, registry)
|
|
141
|
+
.map((entry) => entry.type)
|
|
142
|
+
.join(', ') || '(none)'}`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (widgets.length >= cap) {
|
|
146
|
+
fail('limit', `an overview holds at most ${cap} widgets`);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (raw.options !== undefined && !isRecord(raw.options)) {
|
|
150
|
+
fail('invalid_options', 'options must be an object');
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const checked = validateWidgetOptions(def.options, { ...defaultWidgetOptions(def.options), ...(raw.options ?? {}) }, context);
|
|
154
|
+
if (!checked.ok) {
|
|
155
|
+
fail('invalid_options', `options do not match "${type}": ${describeOptionIssues(checked.issues)}`, { options: checked.issues });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const span = raw.span === undefined ? def.defaultSpan : spanFor(def, raw.span);
|
|
159
|
+
if (span === null)
|
|
160
|
+
return;
|
|
161
|
+
const at = raw.index === undefined
|
|
162
|
+
? widgets.length
|
|
163
|
+
: indexFor(raw.index, widgets.length);
|
|
164
|
+
if (at === null)
|
|
165
|
+
return;
|
|
166
|
+
const id = nextWidgetId(reserved);
|
|
167
|
+
reserved.add(id);
|
|
168
|
+
widgets.splice(at, 0, {
|
|
169
|
+
id,
|
|
170
|
+
type,
|
|
171
|
+
span,
|
|
172
|
+
options: checked.options,
|
|
173
|
+
version: def.version,
|
|
174
|
+
});
|
|
175
|
+
results.push({ index, op: kind, id });
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const found = find();
|
|
179
|
+
if (!found)
|
|
180
|
+
return;
|
|
181
|
+
const { position, widget, def } = found;
|
|
182
|
+
if (kind === 'remove') {
|
|
183
|
+
widgets.splice(position, 1);
|
|
184
|
+
results.push({ index, op: kind, id: widget.id });
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (kind === 'move') {
|
|
188
|
+
const rest = widgets.filter((entry) => entry.id !== widget.id);
|
|
189
|
+
const at = indexFor(raw.index, rest.length);
|
|
190
|
+
if (at === null)
|
|
191
|
+
return;
|
|
192
|
+
rest.splice(at, 0, widget);
|
|
193
|
+
widgets.splice(0, widgets.length, ...rest);
|
|
194
|
+
results.push({ index, op: kind, id: widget.id });
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (!def) {
|
|
198
|
+
fail('unknown_type', `widget type "${widget.type}" is not registered`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (kind === 'resize') {
|
|
202
|
+
const span = spanFor(def, raw.span);
|
|
203
|
+
if (span === null)
|
|
204
|
+
return;
|
|
205
|
+
widgets[position] = { ...widget, span };
|
|
206
|
+
results.push({ index, op: kind, id: widget.id });
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
// configure
|
|
210
|
+
if (!isRecord(raw.options)) {
|
|
211
|
+
fail('invalid_options', 'options must be an object');
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const checked = validateWidgetOptions(def.options, { ...widget.options, ...raw.options }, context);
|
|
215
|
+
if (!checked.ok) {
|
|
216
|
+
fail('invalid_options', `options do not match "${widget.type}": ${describeOptionIssues(checked.issues)}`, { options: checked.issues });
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
widgets[position] = {
|
|
220
|
+
...widget,
|
|
221
|
+
options: checked.options,
|
|
222
|
+
version: def.version,
|
|
223
|
+
};
|
|
224
|
+
results.push({ index, op: kind, id: widget.id });
|
|
225
|
+
});
|
|
226
|
+
if (issues.length > 0)
|
|
227
|
+
return { ok: false, issues };
|
|
228
|
+
// The same strict check the save endpoint runs: whatever the operations
|
|
229
|
+
// produced must be an override the server would accept.
|
|
230
|
+
const proposed = diffOverview(resolved.base, { widgets });
|
|
231
|
+
const checked = checkOverviewOverride(definition, proposed, registry);
|
|
232
|
+
if (!checked.ok) {
|
|
233
|
+
return { ok: false, issues: checked.issues.map(fromOverviewIssue) };
|
|
234
|
+
}
|
|
235
|
+
const document = resolveOverview(definition, checked.override, registry).document;
|
|
236
|
+
return {
|
|
237
|
+
ok: true,
|
|
238
|
+
override: checked.override,
|
|
239
|
+
document,
|
|
240
|
+
results,
|
|
241
|
+
unchanged: JSON.stringify(checked.override) === JSON.stringify(current ?? null),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function fromOverviewIssue(issue) {
|
|
245
|
+
const code = issue.code === 'unknown_type' ||
|
|
246
|
+
issue.code === 'type_not_allowed' ||
|
|
247
|
+
issue.code === 'invalid_options' ||
|
|
248
|
+
issue.code === 'invalid_span'
|
|
249
|
+
? issue.code
|
|
250
|
+
: issue.code === 'too_many'
|
|
251
|
+
? 'limit'
|
|
252
|
+
: 'rejected';
|
|
253
|
+
return {
|
|
254
|
+
index: null,
|
|
255
|
+
op: null,
|
|
256
|
+
widgetId: issue.widgetId,
|
|
257
|
+
code,
|
|
258
|
+
message: issue.message,
|
|
259
|
+
...(issue.options ? { options: issue.options } : {}),
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/** Describe an overview for a caller that builds operations (an assistant). */
|
|
263
|
+
export function describeOverview(input) {
|
|
264
|
+
const { definition, registry } = input;
|
|
265
|
+
const t = input.translate ?? ((key) => key);
|
|
266
|
+
const resolved = resolveOverview(definition, input.override, registry);
|
|
267
|
+
const describeField = (field) => {
|
|
268
|
+
const out = {
|
|
269
|
+
key: field.key,
|
|
270
|
+
type: field.type,
|
|
271
|
+
label: t(field.label),
|
|
272
|
+
};
|
|
273
|
+
if (field.help)
|
|
274
|
+
out.help = t(field.help);
|
|
275
|
+
if (field.required)
|
|
276
|
+
out.required = true;
|
|
277
|
+
if (field.default !== undefined)
|
|
278
|
+
out.default = field.default;
|
|
279
|
+
if (field.min !== undefined)
|
|
280
|
+
out.min = field.min;
|
|
281
|
+
if (field.max !== undefined)
|
|
282
|
+
out.max = field.max;
|
|
283
|
+
if (field.maxLength !== undefined)
|
|
284
|
+
out.maxLength = field.maxLength;
|
|
285
|
+
if (field.choices)
|
|
286
|
+
out.choices = field.choices.map((c) => c.value);
|
|
287
|
+
if (field.type === 'model' && definition.models) {
|
|
288
|
+
out.models = [...definition.models];
|
|
289
|
+
}
|
|
290
|
+
return out;
|
|
291
|
+
};
|
|
292
|
+
const titleOf = (widget) => {
|
|
293
|
+
const title = widget.options.title;
|
|
294
|
+
if (typeof title === 'string' && title)
|
|
295
|
+
return title;
|
|
296
|
+
const def = registry.get(widget.type);
|
|
297
|
+
return def ? t(def.title) : widget.type;
|
|
298
|
+
};
|
|
299
|
+
return {
|
|
300
|
+
id: definition.id,
|
|
301
|
+
canCustomize: input.canCustomize,
|
|
302
|
+
customized: diffOverview(resolved.base, resolved.document) !== null,
|
|
303
|
+
maxWidgets: definition.maxWidgets ?? OVERVIEW_DEFAULT_MAX_WIDGETS,
|
|
304
|
+
maxOperations: input.maxOperations ?? OVERVIEW_MAX_OPERATIONS,
|
|
305
|
+
widgetTypes: allowedWidgetTypes(definition, registry).map((def) => ({
|
|
306
|
+
type: def.type,
|
|
307
|
+
title: t(def.title),
|
|
308
|
+
...(def.description ? { description: t(def.description) } : {}),
|
|
309
|
+
version: def.version,
|
|
310
|
+
span: { default: def.defaultSpan, min: def.minSpan, max: def.maxSpan },
|
|
311
|
+
options: def.options.map(describeField),
|
|
312
|
+
})),
|
|
313
|
+
widgets: resolved.document.widgets.map((widget, index) => ({
|
|
314
|
+
...cloneWidget(widget),
|
|
315
|
+
index,
|
|
316
|
+
title: titleOf(widget),
|
|
317
|
+
})),
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* JSON schema of one operation, for a tool's `inputSchema` / `parameters`.
|
|
322
|
+
* Option values are JSON primitives; the per-type fields come from
|
|
323
|
+
* {@link describeOverview}.
|
|
324
|
+
*/
|
|
325
|
+
export const OVERVIEW_OPERATION_SCHEMA = {
|
|
326
|
+
type: 'object',
|
|
327
|
+
required: ['op'],
|
|
328
|
+
additionalProperties: false,
|
|
329
|
+
properties: {
|
|
330
|
+
op: { type: 'string', enum: [...OVERVIEW_OPERATION_KINDS] },
|
|
331
|
+
type: {
|
|
332
|
+
type: 'string',
|
|
333
|
+
description: 'add: a widget type the description lists.',
|
|
334
|
+
},
|
|
335
|
+
id: {
|
|
336
|
+
type: 'string',
|
|
337
|
+
description: 'configure/move/resize/remove: an existing widget id.',
|
|
338
|
+
},
|
|
339
|
+
span: {
|
|
340
|
+
type: 'integer',
|
|
341
|
+
minimum: 1,
|
|
342
|
+
maximum: 4,
|
|
343
|
+
description: "add/resize: columns, within the type's span range.",
|
|
344
|
+
},
|
|
345
|
+
index: {
|
|
346
|
+
type: 'integer',
|
|
347
|
+
minimum: 0,
|
|
348
|
+
description: 'add/move: zero-based position.',
|
|
349
|
+
},
|
|
350
|
+
options: {
|
|
351
|
+
type: 'object',
|
|
352
|
+
description: 'add: the options; configure: keys to change (null resets a key). Only the fields the description lists; values are strings, numbers or booleans.',
|
|
353
|
+
additionalProperties: {
|
|
354
|
+
type: ['string', 'number', 'boolean', 'null'],
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
};
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* schemas, widget registry, and the server load contract. Safe to import from
|
|
6
6
|
* a `+page.server.ts` or a save endpoint.
|
|
7
7
|
*/
|
|
8
|
+
export { createOverviewAssistantSurface, type OverviewAssistantPersistResult, type OverviewAssistantSurface, type OverviewAssistantSurfaceOptions, } from './assistant-surface.js';
|
|
8
9
|
export { type LoadOverviewOptions, loadOverview, type WidgetLoadInput, } from './load.js';
|
|
9
10
|
export { applyOverviewOverride, checkOverviewOverride, defineOverview, diffOverview, isEmptyOverride, nextWidgetId, type OverviewOverrideCheck, parseOverviewDocument, parseOverviewOverride, type ResolvedOverview, resolveOverview, type SanitizeOptions, sanitizeOverview, } from './model.js';
|
|
11
|
+
export { allowedWidgetTypes, type DescribeOverviewInput, describeOverview, OVERVIEW_MAX_OPERATIONS, OVERVIEW_OPERATION_KINDS, OVERVIEW_OPERATION_SCHEMA, type OverviewAddOperation, type OverviewConfigureOperation, type OverviewDescription, type OverviewMoveOperation, type OverviewOperation, type OverviewOperationIssue, type OverviewOperationIssueCode, type OverviewOperationKind, type OverviewOperationResult, type OverviewOptionDescription, type OverviewPlan, type OverviewRemoveOperation, type OverviewResizeOperation, type OverviewWidgetTypeDescription, type PlanOverviewOperationsInput, planOverviewOperations, } from './operations.js';
|
|
10
12
|
export { parseRecipeExportRef, type RecipeExportResolver, type RecipeWidgetRegistration, type RecipeWidgetSkip, type RecipeWidgetSkipReason, type RecipeWidgetSource, type RegisterRecipeWidgetsOptions, registerRecipeWidgets, } from './recipe-widgets.js';
|
|
11
13
|
export { createWidgetRegistry, defaultWidgetRegistry, registerWidget, resolveWidgetComponents, type WidgetComponents, WidgetRegistry, } from './registry.js';
|
|
12
14
|
export { assertWidgetOptionFields, defaultWidgetOptions, IDENTIFIER_PATTERN, MODEL_PATTERN, optionsEqual, validateWidgetOptions, } from './schema.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/components/overview/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,KAAK,mBAAmB,EACxB,YAAY,EACZ,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,eAAe,EACpB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/components/overview/server.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,8BAA8B,EAC9B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,GACrC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,mBAAmB,EACxB,YAAY,EACZ,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,eAAe,EACf,KAAK,eAAe,EACpB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EAChC,sBAAsB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,4BAA4B,EACjC,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,cAAc,YAAY,CAAC"}
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* schemas, widget registry, and the server load contract. Safe to import from
|
|
6
6
|
* a `+page.server.ts` or a save endpoint.
|
|
7
7
|
*/
|
|
8
|
+
export { createOverviewAssistantSurface, } from './assistant-surface.js';
|
|
8
9
|
export { loadOverview, } from './load.js';
|
|
9
10
|
export { applyOverviewOverride, checkOverviewOverride, defineOverview, diffOverview, isEmptyOverride, nextWidgetId, parseOverviewDocument, parseOverviewOverride, resolveOverview, sanitizeOverview, } from './model.js';
|
|
11
|
+
export { allowedWidgetTypes, describeOverview, OVERVIEW_MAX_OPERATIONS, OVERVIEW_OPERATION_KINDS, OVERVIEW_OPERATION_SCHEMA, planOverviewOperations, } from './operations.js';
|
|
10
12
|
export { parseRecipeExportRef, registerRecipeWidgets, } from './recipe-widgets.js';
|
|
11
13
|
export { createWidgetRegistry, defaultWidgetRegistry, registerWidget, resolveWidgetComponents, WidgetRegistry, } from './registry.js';
|
|
12
14
|
export { assertWidgetOptionFields, defaultWidgetOptions, IDENTIFIER_PATTERN, MODEL_PATTERN, optionsEqual, validateWidgetOptions, } from './schema.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ShellSettingsDelta } from './types.js';
|
|
2
|
+
/** One part of a stored delta that was dropped, and why. */
|
|
3
|
+
export interface ShellSettingsIssue {
|
|
4
|
+
/** Dotted path of the dropped value, e.g. `keymap.left`. */
|
|
5
|
+
path: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ShellSettingsDeltaCheck {
|
|
9
|
+
/** The readable part, pruned (empty object when nothing is left). */
|
|
10
|
+
delta: ShellSettingsDelta;
|
|
11
|
+
/** What was dropped. Empty when the input was a valid delta. */
|
|
12
|
+
issues: ShellSettingsIssue[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Validate and prune an untrusted shell settings delta. Never throws:
|
|
16
|
+
* unknown keys and malformed values are dropped and reported, the rest is
|
|
17
|
+
* kept. A caller that must refuse bad input (a save) checks `issues`; a
|
|
18
|
+
* reader that must degrade (a load) uses `delta`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function sanitizeShellSettingsDelta(input: unknown): ShellSettingsDeltaCheck;
|
|
21
|
+
//# sourceMappingURL=settings-delta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-delta.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/admin-shell/settings-delta.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAIV,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAmBpB,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,KAAK,EAAE,kBAAkB,CAAC;IAC1B,gEAAgE;IAChE,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AA+CD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,uBAAuB,CAgFzB"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an untrusted value as a {@link ShellSettingsDelta} (#3727).
|
|
3
|
+
*
|
|
4
|
+
* The browser settings adapter trusts what it wrote itself; a server that
|
|
5
|
+
* stores shell preferences for many users (`@happyvertical/smrt-preferences`)
|
|
6
|
+
* must not. This module is pure (no Svelte, no DOM) and is published on the
|
|
7
|
+
* Node-safe `./workspace/server` subpath as well as `./workspace`.
|
|
8
|
+
*/
|
|
9
|
+
import { isShellLayoutEmpty, normalizeShellLayout } from './layout.js';
|
|
10
|
+
const EDGES = ['top', 'left', 'right', 'bottom'];
|
|
11
|
+
const PANEL_STATES = ['hidden', 'collapsed', 'expanded'];
|
|
12
|
+
const MODIFIERS = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];
|
|
13
|
+
const DELTA_KEYS = new Set([
|
|
14
|
+
'hotkeysEnabled',
|
|
15
|
+
'keymap',
|
|
16
|
+
'panels',
|
|
17
|
+
'sizes',
|
|
18
|
+
'activeFocusToolId',
|
|
19
|
+
'layout',
|
|
20
|
+
]);
|
|
21
|
+
/** `KeyboardEvent.code` values are short ASCII identifiers. */
|
|
22
|
+
const KEY_CODE_PATTERN = /^[A-Za-z][A-Za-z0-9]{0,31}$/;
|
|
23
|
+
/** Generous bound on a stored panel width in CSS pixels. */
|
|
24
|
+
const MAX_PANEL_SIZE = 10_000;
|
|
25
|
+
const MAX_FOCUS_TOOL_ID_LENGTH = 200;
|
|
26
|
+
function isRecord(value) {
|
|
27
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
function readBinding(value) {
|
|
30
|
+
if (!isRecord(value) || typeof value.code !== 'string')
|
|
31
|
+
return undefined;
|
|
32
|
+
if (!KEY_CODE_PATTERN.test(value.code))
|
|
33
|
+
return undefined;
|
|
34
|
+
const binding = { code: value.code };
|
|
35
|
+
for (const key of Object.keys(value)) {
|
|
36
|
+
if (key === 'code')
|
|
37
|
+
continue;
|
|
38
|
+
if (!MODIFIERS.includes(key))
|
|
39
|
+
return undefined;
|
|
40
|
+
const flag = value[key];
|
|
41
|
+
if (typeof flag !== 'boolean')
|
|
42
|
+
return undefined;
|
|
43
|
+
if (flag)
|
|
44
|
+
binding[key] = true;
|
|
45
|
+
}
|
|
46
|
+
return binding;
|
|
47
|
+
}
|
|
48
|
+
function readEdgeMap(value, name, read, issues) {
|
|
49
|
+
if (value === undefined)
|
|
50
|
+
return undefined;
|
|
51
|
+
if (!isRecord(value)) {
|
|
52
|
+
issues.push({ path: name, message: 'must be an object keyed by edge' });
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
const out = {};
|
|
56
|
+
for (const [edge, entry] of Object.entries(value)) {
|
|
57
|
+
if (!EDGES.includes(edge)) {
|
|
58
|
+
issues.push({ path: `${name}.${edge}`, message: 'unknown edge' });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const parsed = read(entry);
|
|
62
|
+
if (parsed === undefined) {
|
|
63
|
+
issues.push({ path: `${name}.${edge}`, message: 'invalid value' });
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
out[edge] = parsed;
|
|
67
|
+
}
|
|
68
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Validate and prune an untrusted shell settings delta. Never throws:
|
|
72
|
+
* unknown keys and malformed values are dropped and reported, the rest is
|
|
73
|
+
* kept. A caller that must refuse bad input (a save) checks `issues`; a
|
|
74
|
+
* reader that must degrade (a load) uses `delta`.
|
|
75
|
+
*/
|
|
76
|
+
export function sanitizeShellSettingsDelta(input) {
|
|
77
|
+
const issues = [];
|
|
78
|
+
const delta = {};
|
|
79
|
+
if (input === null || input === undefined)
|
|
80
|
+
return { delta, issues };
|
|
81
|
+
if (!isRecord(input)) {
|
|
82
|
+
issues.push({ path: '', message: 'shell settings must be an object' });
|
|
83
|
+
return { delta, issues };
|
|
84
|
+
}
|
|
85
|
+
for (const key of Object.keys(input)) {
|
|
86
|
+
if (!DELTA_KEYS.has(key)) {
|
|
87
|
+
issues.push({ path: key, message: 'unknown setting' });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (input.hotkeysEnabled !== undefined) {
|
|
91
|
+
if (typeof input.hotkeysEnabled === 'boolean') {
|
|
92
|
+
delta.hotkeysEnabled = input.hotkeysEnabled;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
issues.push({ path: 'hotkeysEnabled', message: 'must be a boolean' });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (input.activeFocusToolId !== undefined) {
|
|
99
|
+
const id = input.activeFocusToolId;
|
|
100
|
+
if (id === null ||
|
|
101
|
+
(typeof id === 'string' &&
|
|
102
|
+
id !== '' &&
|
|
103
|
+
id.length <= MAX_FOCUS_TOOL_ID_LENGTH)) {
|
|
104
|
+
delta.activeFocusToolId = id;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
issues.push({
|
|
108
|
+
path: 'activeFocusToolId',
|
|
109
|
+
message: 'must be a short string or null',
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const keymap = readEdgeMap(input.keymap, 'keymap', (entry) => (entry === null ? null : readBinding(entry)), issues);
|
|
114
|
+
if (keymap)
|
|
115
|
+
delta.keymap = keymap;
|
|
116
|
+
const panels = readEdgeMap(input.panels, 'panels', (entry) => PANEL_STATES.includes(entry)
|
|
117
|
+
? entry
|
|
118
|
+
: undefined, issues);
|
|
119
|
+
if (panels)
|
|
120
|
+
delta.panels = panels;
|
|
121
|
+
// A `null` size means "back to the configured width": nothing to store.
|
|
122
|
+
const sizes = readEdgeMap(isRecord(input.sizes)
|
|
123
|
+
? Object.fromEntries(Object.entries(input.sizes).filter(([, size]) => size !== null))
|
|
124
|
+
: input.sizes, 'sizes', (entry) => typeof entry === 'number' &&
|
|
125
|
+
Number.isFinite(entry) &&
|
|
126
|
+
entry > 0 &&
|
|
127
|
+
entry <= MAX_PANEL_SIZE
|
|
128
|
+
? entry
|
|
129
|
+
: undefined, issues);
|
|
130
|
+
if (sizes)
|
|
131
|
+
delta.sizes = sizes;
|
|
132
|
+
if (input.layout !== undefined) {
|
|
133
|
+
const layout = normalizeShellLayout(input.layout);
|
|
134
|
+
if (!isShellLayoutEmpty(layout)) {
|
|
135
|
+
delta.layout = layout;
|
|
136
|
+
}
|
|
137
|
+
else if (input.layout !== null) {
|
|
138
|
+
issues.push({ path: 'layout', message: 'unreadable or empty layout' });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return { delta, issues };
|
|
142
|
+
}
|
|
@@ -39,6 +39,7 @@ export { default as ShortcutsOverlay } from './admin-shell/ShortcutsOverlay.svel
|
|
|
39
39
|
export { default as SystemScopePanel } from './admin-shell/SystemScopePanel.svelte';
|
|
40
40
|
export { default as SystemStatusChips } from './admin-shell/SystemStatusChips.svelte';
|
|
41
41
|
export { clampPanelSize, DEFAULT_SHELL_KEYMAP, DEFAULT_SHELL_PANEL_RESIZE, LocalStorageShellSettingsAdapter, mergeShellSettingsDelta, panelPersists, pruneShellSettingsDelta, resolveHotkey, resolveInitialPanelState, resolvePanelResize, resolveShellConfig, stripUnpersistedSettings, } from './admin-shell/settings.js';
|
|
42
|
+
export { type ShellSettingsDeltaCheck, type ShellSettingsIssue, sanitizeShellSettingsDelta, } from './admin-shell/settings-delta.js';
|
|
42
43
|
export { isShellIconName, SHELL_DEFAULT_SECTION_ICON, SHELL_ICON_PATHS, SHELL_SECTION_ICONS, type ShellIconName, } from './admin-shell/shell-icons.js';
|
|
43
44
|
export type { ShellPlacementItem, ShellRegion, ShellSlot, } from './admin-shell/slots.js';
|
|
44
45
|
export { isShellSlot, resolveSlot, SHELL_DOCK_ITEM_PREFIX, SHELL_HOST_SLOT_ITEM_PREFIX, SHELL_SLOTS, shellDockItemId, shellHostSlotItemId, slotFallbackChain, slotRegion, } from './admin-shell/slots.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,YAAY,EACZ,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,gBAA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,EACnB,iBAAiB,EACjB,UAAU,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAE5F,OAAO,EACL,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,mBAAmB,IAAI,qBAAqB,EAC5C,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAA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B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,WAAW,EACX,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAE5F,OAAO,EACL,KAAK,UAAU,EACf,KAAK,0BAA0B,EAC/B,mBAAmB,IAAI,qBAAqB,EAC5C,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC"}
|
|
@@ -41,6 +41,7 @@ export { default as ShortcutsOverlay } from './admin-shell/ShortcutsOverlay.svel
|
|
|
41
41
|
export { default as SystemScopePanel } from './admin-shell/SystemScopePanel.svelte';
|
|
42
42
|
export { default as SystemStatusChips } from './admin-shell/SystemStatusChips.svelte';
|
|
43
43
|
export { clampPanelSize, DEFAULT_SHELL_KEYMAP, DEFAULT_SHELL_PANEL_RESIZE, LocalStorageShellSettingsAdapter, mergeShellSettingsDelta, panelPersists, pruneShellSettingsDelta, resolveHotkey, resolveInitialPanelState, resolvePanelResize, resolveShellConfig, stripUnpersistedSettings, } from './admin-shell/settings.js';
|
|
44
|
+
export { sanitizeShellSettingsDelta, } from './admin-shell/settings-delta.js';
|
|
44
45
|
export { isShellIconName, SHELL_DEFAULT_SECTION_ICON, SHELL_ICON_PATHS, SHELL_SECTION_ICONS, } from './admin-shell/shell-icons.js';
|
|
45
46
|
export { isShellSlot, resolveSlot, SHELL_DOCK_ITEM_PREFIX, SHELL_HOST_SLOT_ITEM_PREFIX, SHELL_SLOTS, shellDockItemId, shellHostSlotItemId, slotFallbackChain, slotRegion, } from './admin-shell/slots.js';
|
|
46
47
|
export { ADMIN_SHELL_DESKTOP_QUERY, ADMIN_SHELL_PHONE_QUERY, createShellState, detectShellViewport, ShellState, } from './admin-shell/state.svelte.js';
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @happyvertical/smrt-svelte/workspace/server
|
|
3
3
|
*
|
|
4
|
-
* Server-only utilities for the workspace shell
|
|
5
|
-
*
|
|
4
|
+
* Server-only utilities for the workspace shell: the dock availability gate
|
|
5
|
+
* composer (Phase 4c per happyvertical/smrt#1226) and the shell settings
|
|
6
|
+
* delta sanitizer and merge a server-side preference store uses (#3727).
|
|
6
7
|
*
|
|
7
8
|
* Node-safe: no Svelte component imports, no browser-only APIs. Import
|
|
8
9
|
* this subpath from `+server.ts` endpoints, REST handlers, or anywhere
|
|
9
10
|
* else outside the client bundle.
|
|
10
11
|
*/
|
|
12
|
+
export { mergeShellSettingsDelta } from '../admin-shell/settings.js';
|
|
13
|
+
export { type ShellSettingsDeltaCheck, type ShellSettingsIssue, sanitizeShellSettingsDelta, } from '../admin-shell/settings-delta.js';
|
|
14
|
+
export type { ShellHotkeyBinding, ShellSettingsDelta, } from '../admin-shell/types.js';
|
|
11
15
|
export { composeDockAvailability } from './compose-availability.js';
|
|
12
16
|
export type { AvailableTool, ComposeDockAvailabilityOptions, GatedToolSummary, GateEvaluationContext, GateEvaluator, } from './types.js';
|
|
13
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/server/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/workspace/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EACV,aAAa,EACb,8BAA8B,EAC9B,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,GACd,MAAM,YAAY,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @happyvertical/smrt-svelte/workspace/server
|
|
3
3
|
*
|
|
4
|
-
* Server-only utilities for the workspace shell
|
|
5
|
-
*
|
|
4
|
+
* Server-only utilities for the workspace shell: the dock availability gate
|
|
5
|
+
* composer (Phase 4c per happyvertical/smrt#1226) and the shell settings
|
|
6
|
+
* delta sanitizer and merge a server-side preference store uses (#3727).
|
|
6
7
|
*
|
|
7
8
|
* Node-safe: no Svelte component imports, no browser-only APIs. Import
|
|
8
9
|
* this subpath from `+server.ts` endpoints, REST handlers, or anywhere
|
|
9
10
|
* else outside the client bundle.
|
|
10
11
|
*/
|
|
12
|
+
export { mergeShellSettingsDelta } from '../admin-shell/settings.js';
|
|
13
|
+
export { sanitizeShellSettingsDelta, } from '../admin-shell/settings-delta.js';
|
|
11
14
|
export { composeDockAvailability } from './compose-availability.js';
|
package/dist/i18n/server.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import './strings.forms.js';
|
|
|
22
22
|
import './strings.board.js';
|
|
23
23
|
import './strings.sortable.js';
|
|
24
24
|
import './strings.audit.js';
|
|
25
|
+
import './strings.notifications.js';
|
|
25
26
|
import './strings.import-export.js';
|
|
26
27
|
import './strings.workspace.js';
|
|
27
28
|
import './strings.screens.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/i18n/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAGL,KAAK,4BAA4B,EAElC,MAAM,+BAA+B,CAAC;AACvC,OAAO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