dsh-edge 0.2.0-alpha.2 → 0.2.0
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/README.i18n.yaml +2 -2
- package/README.md +6 -6
- package/README.zh.md +6 -6
- package/THIRD_PARTY_NOTICES.md +387 -1131
- package/dist/assets/index-BNMwCG9c.css +1 -0
- package/dist/assets/index-CA9Bpko5.js +96 -0
- package/dist/assets/langs/{php-D-uCvoST.js → php-DDkx9sim.js} +2 -2
- package/dist/assets/langs/{ruby-DEItuUFs.js → ruby-DCxyoPen.js} +2 -2
- package/dist/assets/{vendor-Cjbwl5VI.js → vendor-D22_Mp1f.js} +2 -2
- package/dist/index.html +26 -5
- package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +166 -27
- package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +136 -19
- package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +51 -12
- package/dist/plugins/@deepseek-ai/dsh-client-modules/client.js +188 -123
- package/dist/plugins/@deepseek-ai/dsh-client-runtime/client.js +43 -8
- package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +54 -54
- package/dist/plugins/@deepseek-ai/dsh-client-ui-brand-official/client.js +50 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +46 -17
- package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +805 -486
- package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +5 -5
- package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +82 -26
- package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +7 -7
- package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +2 -2
- package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +18 -18
- package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +96 -82
- package/dist/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js +989 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings/client.js +1177 -67
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +61 -65
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +51 -21
- package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +12 -12
- package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +18 -45
- package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +46 -3
- package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +102 -62
- package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +143 -142
- package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +25 -25
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +261 -86
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +72 -62
- package/package.json +22 -22
- package/scripts/legal-files.mjs +2 -1
- package/worker/direct/index.js +692 -688
- package/worker/isolated/index.js +469 -465
- package/dist/assets/index-C-1AiF3k.js +0 -112
- package/dist/assets/index-CSGf6Qzd.css +0 -1
|
@@ -4,7 +4,112 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
//#region lib/types/client/manifest.js
|
|
8
|
+
/**
|
|
9
|
+
* Client module system: the browser peer of Node's internal ESM loader, built
|
|
10
|
+
* as a lazy CJS table. The vendored cordis Loader consumes this object
|
|
11
|
+
* through its `internal` contract (the only call site is `EntryTree.import` →
|
|
12
|
+
* `internal.import`), which keeps entry governance (fiber lifecycle, inject
|
|
13
|
+
* waiting, update/refresh) entirely on the vendored side while this package
|
|
14
|
+
* owns code arrival.
|
|
15
|
+
*
|
|
16
|
+
* Lazy CJS model: executing a plugin bundle only REGISTERS its
|
|
17
|
+
* factory (`window.__ModuleLoader__.load({id, factory})`); every module body
|
|
18
|
+
* side effect — including CSS injection — lives inside the factory closure
|
|
19
|
+
* and runs at materialization, not at script execution. Materialization
|
|
20
|
+
* (factory(require) → exports) happens on first import/require and is
|
|
21
|
+
* memoized in {@link ClientModuleLoader.loadCache}; a factory that requires
|
|
22
|
+
* another registered-but-unmaterialized module materializes it recursively,
|
|
23
|
+
* so load order needs no external sequencing.
|
|
24
|
+
*
|
|
25
|
+
* Resolution branch order (import): seed word → shell instance; memoized
|
|
26
|
+
* record → exports; graph row → register its dependency factories and own
|
|
27
|
+
* factory; registered factory → materialize; anything else → throw (loud —
|
|
28
|
+
* the runtime mirror of the build-time bundle purity gate).
|
|
29
|
+
* The synchronous `require` handed to factories walks the same order minus
|
|
30
|
+
* the load branch. Loading is async, so a requested dynamic package must have
|
|
31
|
+
* registered its factory before a consumer materializes.
|
|
32
|
+
*
|
|
33
|
+
* This file is the browser-safe contract face (zero node imports): the
|
|
34
|
+
* `__DSH_BOOT__` wire types, the boot-manifest parser, and the boundaries around
|
|
35
|
+
* {@link ClientModuleSystem}. The package root is the host-side service that
|
|
36
|
+
* composes the wire.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Validate an optional string-array field read from a `dsh.client` declaration
|
|
40
|
+
* or from the boot wire.
|
|
41
|
+
* @param subject - diagnostic prefix naming the package or the wire row.
|
|
42
|
+
* @param field - field name as it appears in the diagnostic.
|
|
43
|
+
* @param value - the raw field value.
|
|
44
|
+
* @returns the validated array, or undefined when the field is absent.
|
|
45
|
+
* @throws {Error} when the value is present but is not an array of strings.
|
|
46
|
+
*/
|
|
47
|
+
function optionalStringArray(subject, field, value) {
|
|
48
|
+
if (value === void 0) return void 0;
|
|
49
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) throw new Error(`client-modules: ${subject} ${field} must be a string array`);
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Normalize a module specifier onto the graph row that owns it: a plugin bundle
|
|
54
|
+
* IS its package's client half, so `<id>/client` (the exports subpath external
|
|
55
|
+
* bundles emit) and the bare package name resolve to the same exports. Both the
|
|
56
|
+
* require path and graph composition normalize here, which is what lets each
|
|
57
|
+
* importing package request the subpath its own code imports.
|
|
58
|
+
* @param spec - module specifier as a bundle requires it or a declaration spells it.
|
|
59
|
+
* @returns the specifier with a trailing `/client` removed.
|
|
60
|
+
*/
|
|
61
|
+
function stripClientSuffix(spec) {
|
|
62
|
+
return spec.endsWith("/client") ? spec.slice(0, -7) : spec;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Parse `window.__DSH_BOOT__` into the two consumer views. Wire boundary:
|
|
66
|
+
* a missing or malformed graph throws (the shell shows the loud failure —
|
|
67
|
+
* a page without a valid manifest cannot boot anything).
|
|
68
|
+
* @param wire - the raw `window.__DSH_BOOT__` value.
|
|
69
|
+
* @returns the manifest with optional plugin-view fields normalized.
|
|
70
|
+
*/
|
|
71
|
+
function parseBootManifest(wire) {
|
|
72
|
+
if (typeof wire !== "object" || wire === null) throw new Error("client-modules: window.__DSH_BOOT__ is missing or not an object");
|
|
73
|
+
const graph = wire;
|
|
74
|
+
if (typeof graph.rev !== "string") throw new Error("client-modules: boot manifest rev must be a string");
|
|
75
|
+
if (!Array.isArray(graph.entries)) throw new Error("client-modules: boot manifest entries must be an array");
|
|
76
|
+
const modules = [];
|
|
77
|
+
const plugins = [];
|
|
78
|
+
for (const value of graph.entries) {
|
|
79
|
+
if (typeof value !== "object" || value === null) throw new Error("client-modules: boot manifest entry is not an object");
|
|
80
|
+
const row = value;
|
|
81
|
+
const where = typeof row.id === "string" ? `"${row.id}"` : JSON.stringify(row);
|
|
82
|
+
if (typeof row.id !== "string" || typeof row.url !== "string" || typeof row.rev !== "string") throw new Error(`client-modules: boot manifest entry ${where} must carry string id/url/rev`);
|
|
83
|
+
const subject = `boot manifest entry ${where}`;
|
|
84
|
+
const inject = optionalStringArray(subject, "inject", row.inject);
|
|
85
|
+
const external = optionalStringArray(subject, "external", row.external);
|
|
86
|
+
if (row.immediately !== void 0 && typeof row.immediately !== "boolean") throw new Error(`client-modules: boot manifest entry ${where} immediately must be a boolean`);
|
|
87
|
+
modules.push({
|
|
88
|
+
id: row.id,
|
|
89
|
+
url: row.url,
|
|
90
|
+
rev: row.rev,
|
|
91
|
+
external: external === void 0 ? [] : [...external]
|
|
92
|
+
});
|
|
93
|
+
plugins.push({
|
|
94
|
+
id: row.id,
|
|
95
|
+
inject: inject === void 0 ? [] : [...inject],
|
|
96
|
+
immediately: row.immediately === true
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
rev: graph.rev,
|
|
101
|
+
modules,
|
|
102
|
+
plugins
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
7
106
|
//#region lib/types/client/system.js
|
|
107
|
+
/**
|
|
108
|
+
* ClientModuleSystem — the implementation behind the {@link ClientModuleLoader}
|
|
109
|
+
* contract. The conceptual contract (lazy CJS model, resolution branch order) is
|
|
110
|
+
* documented on the public interfaces in `./manifest.ts`; this file owns the
|
|
111
|
+
* state tables and the load/materialize machinery.
|
|
112
|
+
*/
|
|
8
113
|
/** Default bundle-load hook: same-origin external classic script. */
|
|
9
114
|
const defaultLoadBundle = (url) => new Promise((resolve, reject) => {
|
|
10
115
|
const el = document.createElement("script");
|
|
@@ -21,12 +126,6 @@ window.__ModuleLoader__.load({
|
|
|
21
126
|
document.head.append(el);
|
|
22
127
|
});
|
|
23
128
|
/**
|
|
24
|
-
* A plugin bundle IS its package's client half: `<id>/client` (the exports
|
|
25
|
-
* subpath external bundles emit) and the bare graph id name the same
|
|
26
|
-
* exports, so table lookups normalize the suffix away.
|
|
27
|
-
*/
|
|
28
|
-
const stripClientSuffix = (spec) => spec.endsWith("/client") ? spec.slice(0, -7) : spec;
|
|
29
|
-
/**
|
|
30
129
|
* Claim and inventory the <style> tags a factory injected during
|
|
31
130
|
* materialization: preset-emitted tags arrive pre-tagged with data-plugin;
|
|
32
131
|
* any untagged tag is claimed for the materializing plugin (HMR bookkeeping).
|
|
@@ -41,15 +140,17 @@ window.__ModuleLoader__.load({
|
|
|
41
140
|
/**
|
|
42
141
|
* The client module system: state tables plus the arrival/materialization
|
|
43
142
|
* machinery implementing {@link ClientModuleLoader} (whose members carry the
|
|
44
|
-
* contract documentation). Construction indexes the boot rows
|
|
45
|
-
*
|
|
143
|
+
* contract documentation). Construction indexes the boot rows, retains the
|
|
144
|
+
* already-materialized bootstrap module, and switches the HTML-installed
|
|
145
|
+
* loader facade from its pending queue to live registration.
|
|
46
146
|
*/
|
|
47
147
|
var ClientModuleSystem = class {
|
|
48
148
|
version = "client";
|
|
149
|
+
manifest;
|
|
49
150
|
loadCache = /* @__PURE__ */ new Map();
|
|
50
151
|
seed;
|
|
51
|
-
statics = /* @__PURE__ */ new Map();
|
|
52
152
|
factories = /* @__PURE__ */ new Map();
|
|
153
|
+
bootstrapIds = /* @__PURE__ */ new Set();
|
|
53
154
|
/** In-flight prefetch (script load) per id; concurrent callers share it. */
|
|
54
155
|
pendingArrival = /* @__PURE__ */ new Map();
|
|
55
156
|
/** Materialization re-entrancy guard: factory-form CJS cannot deliver partial exports, so a cycle is fatal. */
|
|
@@ -58,28 +159,45 @@ window.__ModuleLoader__.load({
|
|
|
58
159
|
loadBundle;
|
|
59
160
|
/**
|
|
60
161
|
* Build the module system over the parsed boot rows.
|
|
61
|
-
* @param options -
|
|
162
|
+
* @param options - Parsed graph, platform seed, bootstrap module, registration facade, and transport.
|
|
62
163
|
*/
|
|
63
164
|
constructor(options) {
|
|
165
|
+
this.manifest = options.manifest;
|
|
64
166
|
this.seed = new Map(Object.entries(options.staticModules));
|
|
65
167
|
this.loadBundle = options.loadBundle ?? defaultLoadBundle;
|
|
66
|
-
for (const row of options.modules) {
|
|
168
|
+
for (const row of options.manifest.modules) {
|
|
67
169
|
if (this.graphRows.has(row.id)) throw new Error(`client-modules: duplicate graph entry "${row.id}"`);
|
|
68
170
|
this.graphRows.set(row.id, row);
|
|
69
171
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
172
|
+
const bootstrapId = stripClientSuffix(options.bootstrapModule.id);
|
|
173
|
+
this.bootstrapIds.add(bootstrapId);
|
|
174
|
+
this.loadCache.set(bootstrapId, {
|
|
175
|
+
id: bootstrapId,
|
|
176
|
+
exports: options.bootstrapModule.exports,
|
|
177
|
+
styles: [],
|
|
178
|
+
edges: /* @__PURE__ */ new Set()
|
|
179
|
+
});
|
|
180
|
+
const target = options.registrationTarget;
|
|
181
|
+
if (target.mode !== "queue") throw new Error("client-modules: window.__ModuleLoader__.create called after module-system boot");
|
|
182
|
+
const pending = target.pendingQueue.splice(0);
|
|
183
|
+
target.mode = "live";
|
|
184
|
+
target.load = (registration) => {
|
|
185
|
+
this.register(registration);
|
|
186
|
+
};
|
|
187
|
+
for (const registration of pending) target.load(registration);
|
|
188
|
+
}
|
|
189
|
+
/** Register one bundle factory, rejecting a script that executes twice without invalidation. */
|
|
190
|
+
register(registration) {
|
|
191
|
+
const id = stripClientSuffix(registration.id);
|
|
192
|
+
if (this.bootstrapIds.has(id) || this.factories.has(id)) throw new Error(`client-modules: duplicate factory registration for "${registration.id}" (bundle executed twice without invalidate?)`);
|
|
193
|
+
this.factories.set(id, registration.factory);
|
|
76
194
|
}
|
|
77
195
|
/** Load one graph row so its factory is registered (idempotent per in-flight arrival). */
|
|
78
196
|
arrive(row) {
|
|
79
197
|
const { id, url } = row;
|
|
80
198
|
const pending = this.pendingArrival.get(id);
|
|
81
199
|
if (pending !== void 0) return pending;
|
|
82
|
-
if (this.factories.has(id)) return Promise.resolve();
|
|
200
|
+
if (this.loadCache.has(id) || this.factories.has(id)) return Promise.resolve();
|
|
83
201
|
const task = this.loadBundle(url).then(() => {
|
|
84
202
|
if (!this.factories.has(id)) throw new Error(`client-modules: bundle ${url} loaded without registering "${id}" via __ModuleLoader__.load`);
|
|
85
203
|
}).finally(() => {
|
|
@@ -88,6 +206,19 @@ window.__ModuleLoader__.load({
|
|
|
88
206
|
this.pendingArrival.set(id, task);
|
|
89
207
|
return task;
|
|
90
208
|
}
|
|
209
|
+
/** Register each unresolved dynamic request before registering its consumer. */
|
|
210
|
+
async arriveGraphRow(row, open = []) {
|
|
211
|
+
const cycleStart = open.indexOf(row.id);
|
|
212
|
+
if (cycleStart !== -1) throw new Error(`client-modules: module arrival cycle ${[...open.slice(cycleStart), row.id].join(" -> ")} (the host must reject this graph before serving it)`);
|
|
213
|
+
const next = [...open, row.id];
|
|
214
|
+
for (const request of row.external) {
|
|
215
|
+
const id = stripClientSuffix(request);
|
|
216
|
+
if (this.seed.has(request) || this.loadCache.has(id)) continue;
|
|
217
|
+
const dependency = this.graphRows.get(id);
|
|
218
|
+
if (dependency !== void 0) await this.arriveGraphRow(dependency, next);
|
|
219
|
+
}
|
|
220
|
+
await this.arrive(row);
|
|
221
|
+
}
|
|
91
222
|
/** Materialize a registered factory (synchronous; memoized in loadCache). */
|
|
92
223
|
materialize(id) {
|
|
93
224
|
const existing = this.loadCache.get(id);
|
|
@@ -112,146 +243,80 @@ window.__ModuleLoader__.load({
|
|
|
112
243
|
}
|
|
113
244
|
}
|
|
114
245
|
/**
|
|
115
|
-
* The synchronous require answered to factories: seed →
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* cross-plugin value import is already a build error upstream).
|
|
246
|
+
* The synchronous require answered to factories: seed → memoized record →
|
|
247
|
+
* registered factory. Fetching is async and therefore unreachable
|
|
248
|
+
* from here; an external dynamic package must have arrived before its
|
|
249
|
+
* consumer materializes.
|
|
120
250
|
*/
|
|
121
251
|
makeRequire(edges) {
|
|
122
252
|
return (spec) => {
|
|
123
253
|
edges.add(spec);
|
|
124
254
|
if (this.seed.has(spec)) return this.seed.get(spec);
|
|
125
|
-
if (this.statics.has(spec)) return this.statics.get(spec);
|
|
126
255
|
const id = stripClientSuffix(spec);
|
|
127
256
|
const record = this.loadCache.get(id);
|
|
128
257
|
if (record !== void 0) return record.exports;
|
|
129
258
|
if (this.factories.has(id)) return this.materialize(id).exports;
|
|
130
|
-
throw new Error(`client-modules: require("${spec}") missed the module table — not a platform seed word, not a
|
|
259
|
+
throw new Error(`client-modules: require("${spec}") missed the module table — not a platform seed word, not a materialized module, and no registered package factory (a build-time externals drift, or a dynamic dependency that did not arrive)`);
|
|
131
260
|
};
|
|
132
261
|
}
|
|
133
262
|
async import(specifier) {
|
|
134
263
|
if (this.seed.has(specifier)) return this.seed.get(specifier);
|
|
135
|
-
const
|
|
264
|
+
const id = stripClientSuffix(specifier);
|
|
265
|
+
const existing = this.loadCache.get(id);
|
|
136
266
|
if (existing !== void 0) return existing.exports;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
exports,
|
|
142
|
-
styles: [],
|
|
143
|
-
edges: /* @__PURE__ */ new Set()
|
|
144
|
-
});
|
|
145
|
-
return exports;
|
|
146
|
-
}
|
|
147
|
-
if (!this.factories.has(specifier)) {
|
|
148
|
-
const row = this.graphRows.get(specifier);
|
|
149
|
-
if (row === void 0) throw new Error(`client-modules: cannot resolve "${specifier}" — not a seed word, not a shell-own module, and not a row in the boot graph (the runtime mirror of the bundle purity gate)`);
|
|
150
|
-
await this.arrive(row);
|
|
151
|
-
}
|
|
152
|
-
return this.materialize(specifier).exports;
|
|
153
|
-
}
|
|
154
|
-
registerStatic(id, module) {
|
|
155
|
-
if (this.statics.has(id)) throw new Error(`client-modules: shell-own module "${id}" registered twice`);
|
|
156
|
-
this.statics.set(id, module);
|
|
267
|
+
const row = this.graphRows.get(id);
|
|
268
|
+
if (row !== void 0) await this.arriveGraphRow(row);
|
|
269
|
+
else if (!this.factories.has(id)) throw new Error(`client-modules: cannot resolve "${specifier}" — not a seed word, not a materialized module, and not a row in the boot graph (the runtime mirror of the bundle purity gate)`);
|
|
270
|
+
return this.materialize(id).exports;
|
|
157
271
|
}
|
|
158
272
|
async prefetch(id) {
|
|
159
|
-
|
|
160
|
-
|
|
273
|
+
const normalized = stripClientSuffix(id);
|
|
274
|
+
if (this.loadCache.has(normalized)) return;
|
|
275
|
+
const row = this.graphRows.get(normalized);
|
|
161
276
|
if (row === void 0) throw new Error(`client-modules: prefetch("${id}") — not a graph entry`);
|
|
162
|
-
await this.
|
|
277
|
+
await this.arriveGraphRow(row);
|
|
163
278
|
}
|
|
164
279
|
invalidate(id) {
|
|
165
|
-
|
|
166
|
-
this.
|
|
280
|
+
const normalized = stripClientSuffix(id);
|
|
281
|
+
if (this.bootstrapIds.has(normalized)) return;
|
|
282
|
+
this.factories.delete(normalized);
|
|
283
|
+
this.loadCache.delete(normalized);
|
|
167
284
|
}
|
|
168
285
|
};
|
|
169
286
|
//#endregion
|
|
170
|
-
//#region lib/types/client/
|
|
171
|
-
|
|
172
|
-
* Client module system: the browser peer of Node's internal ESM loader, built
|
|
173
|
-
* as a lazy CJS table. The vendored cordis Loader consumes this object
|
|
174
|
-
* through its `internal` contract (the only call site is `EntryTree.import` →
|
|
175
|
-
* `internal.import`), which keeps entry governance (fiber lifecycle, inject
|
|
176
|
-
* waiting, update/refresh) entirely on the vendored side while this package
|
|
177
|
-
* owns code arrival.
|
|
178
|
-
*
|
|
179
|
-
* Lazy CJS model: executing a plugin bundle only REGISTERS its
|
|
180
|
-
* factory (`window.__ModuleLoader__.load({id, factory})`); every module body
|
|
181
|
-
* side effect — including CSS injection — lives inside the factory closure
|
|
182
|
-
* and runs at materialization, not at script execution. Materialization
|
|
183
|
-
* (factory(require) → exports) happens on first import/require and is
|
|
184
|
-
* memoized in {@link ClientModuleLoader.loadCache}; a factory that requires
|
|
185
|
-
* another registered-but-unmaterialized module materializes it recursively,
|
|
186
|
-
* so load order needs no external sequencing.
|
|
187
|
-
*
|
|
188
|
-
* Resolution branch order (import): seed word → shell instance; memoized
|
|
189
|
-
* record → exports; static registry (shell-own modules, e.g. app-shell) →
|
|
190
|
-
* module; registered factory → materialize; graph row → load + materialize;
|
|
191
|
-
* anything else → throw (loud — the runtime mirror of the
|
|
192
|
-
* build-time bundle purity gate). The synchronous `require` handed to
|
|
193
|
-
* factories walks the same order minus the load branch: loading is async,
|
|
194
|
-
* so only already-registered bundles can be required — and cross-plugin value
|
|
195
|
-
* imports are a build error anyway.
|
|
196
|
-
*
|
|
197
|
-
* This file is the browser-safe contract face (zero node imports): the
|
|
198
|
-
* `__DSH_BOOT__` wire types, the boot-manifest parser, and the boundaries around
|
|
199
|
-
* {@link ClientModuleSystem}. The package root is the host-side service that
|
|
200
|
-
* composes the wire.
|
|
201
|
-
*/
|
|
287
|
+
//#region lib/types/client/index.js
|
|
288
|
+
let moduleSystem;
|
|
202
289
|
/**
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* @param
|
|
207
|
-
* @returns
|
|
290
|
+
* Build the live module system from the HTML facade's materialized modules bundle.
|
|
291
|
+
* @param target - Stable registration facade whose pending queue becomes the live sink.
|
|
292
|
+
* @param bootstrapModule - This bundle's id and already-materialized exports.
|
|
293
|
+
* @param options - Raw boot graph, platform seed, and optional bundle transport.
|
|
294
|
+
* @returns The created module system, also published for this package's Cordis plugin face.
|
|
208
295
|
*/
|
|
209
|
-
function
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const row = value;
|
|
219
|
-
const where = typeof row.id === "string" ? `"${row.id}"` : JSON.stringify(row);
|
|
220
|
-
if (typeof row.id !== "string" || typeof row.url !== "string" || typeof row.rev !== "string") throw new Error(`client-modules: boot manifest entry ${where} must carry string id/url/rev`);
|
|
221
|
-
if (row.inject !== void 0 && (!Array.isArray(row.inject) || row.inject.some((i) => typeof i !== "string"))) throw new Error(`client-modules: boot manifest entry ${where} inject must be a string array`);
|
|
222
|
-
if (row.immediately !== void 0 && typeof row.immediately !== "boolean") throw new Error(`client-modules: boot manifest entry ${where} immediately must be a boolean`);
|
|
223
|
-
modules.push({
|
|
224
|
-
id: row.id,
|
|
225
|
-
url: row.url,
|
|
226
|
-
rev: row.rev
|
|
227
|
-
});
|
|
228
|
-
plugins.push({
|
|
229
|
-
id: row.id,
|
|
230
|
-
inject: row.inject === void 0 ? [] : [...row.inject],
|
|
231
|
-
immediately: row.immediately === true
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
return {
|
|
235
|
-
rev: graph.rev,
|
|
236
|
-
modules,
|
|
237
|
-
plugins
|
|
238
|
-
};
|
|
296
|
+
function createClientModuleSystem(target, bootstrapModule, options) {
|
|
297
|
+
moduleSystem = new ClientModuleSystem({
|
|
298
|
+
manifest: parseBootManifest(options.boot),
|
|
299
|
+
staticModules: options.staticModules,
|
|
300
|
+
registrationTarget: target,
|
|
301
|
+
bootstrapModule,
|
|
302
|
+
...options.loadBundle === void 0 ? {} : { loadBundle: options.loadBundle }
|
|
303
|
+
});
|
|
304
|
+
return moduleSystem;
|
|
239
305
|
}
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region lib/types/client/index.js
|
|
242
306
|
/**
|
|
243
307
|
* Enroll the kernel-built module system as `ctx.modules`.
|
|
244
308
|
* @param ctx - client root context.
|
|
245
309
|
*/
|
|
246
310
|
function apply(ctx) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
ctx.reflect.provide("modules", modules);
|
|
311
|
+
if (moduleSystem === void 0) throw new Error("client-modules: createClientModuleSystem must run before plugin boot");
|
|
312
|
+
ctx.reflect.provide("modules", moduleSystem);
|
|
250
313
|
}
|
|
251
314
|
//#endregion
|
|
252
315
|
exports.ClientModuleSystem = ClientModuleSystem;
|
|
253
316
|
exports.apply = apply;
|
|
317
|
+
exports.createClientModuleSystem = createClientModuleSystem;
|
|
254
318
|
exports.parseBootManifest = parseBootManifest;
|
|
319
|
+
exports.stripClientSuffix = stripClientSuffix;
|
|
255
320
|
return module.exports;
|
|
256
321
|
}
|
|
257
322
|
});
|
|
@@ -113,7 +113,7 @@ window.__ModuleLoader__.load({
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* Install the shell's renderer (
|
|
116
|
+
* Install the shell's renderer (ui-renderer's createSlotRenderer product).
|
|
117
117
|
* Boot-once: a second install throws. Runs through the caller's ctx.effect,
|
|
118
118
|
* so shell fiber unload uninstalls the renderer.
|
|
119
119
|
* @param renderer - the outlet machinery implementing SlotRenderer.
|
|
@@ -5347,9 +5347,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5347
5347
|
* shell over it: {@link defineStore} bakes an init/persist/actions literal
|
|
5348
5348
|
* into a {@link StoreHandle}, the registration-side store seat of slot
|
|
5349
5349
|
* terminals. Lives in the React-free runtime (the data layer owns its
|
|
5350
|
-
* engine;
|
|
5350
|
+
* engine; ui-renderer is shell-only React
|
|
5351
5351
|
* glue): engine products are bare observables — subscribe/getSnapshot/
|
|
5352
|
-
* update/set, NO selector hook. Hook synthesis is
|
|
5352
|
+
* update/set, NO selector hook. Hook synthesis is ui-renderer's (the one
|
|
5353
5353
|
* uSES bridge, cached per source at the binding site).
|
|
5354
5354
|
*/
|
|
5355
5355
|
/**
|
|
@@ -7193,7 +7193,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7193
7193
|
* @param mode - queue appends after the current turn; steer interrupts it.
|
|
7194
7194
|
* @returns the prompt result (also mirrored into promptError on failure).
|
|
7195
7195
|
*/
|
|
7196
|
-
async prompt(content, mode) {
|
|
7196
|
+
async prompt(content, mode, signal) {
|
|
7197
7197
|
this.promptError = null;
|
|
7198
7198
|
this.lastAgentError = null;
|
|
7199
7199
|
this.promptAttempted = true;
|
|
@@ -7206,7 +7206,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7206
7206
|
mode,
|
|
7207
7207
|
content,
|
|
7208
7208
|
clientTimeZone: resolvedClientTimeZone()
|
|
7209
|
-
})).result;
|
|
7209
|
+
}, signal)).result;
|
|
7210
7210
|
else if (this.address.mode === "one-shot") result = {
|
|
7211
7211
|
ok: false,
|
|
7212
7212
|
error: {
|
|
@@ -7231,7 +7231,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7231
7231
|
text: part.text
|
|
7232
7232
|
}] : []),
|
|
7233
7233
|
clientTimeZone: resolvedClientTimeZone()
|
|
7234
|
-
})).result;
|
|
7234
|
+
}, signal)).result;
|
|
7235
7235
|
result = routed.ok ? {
|
|
7236
7236
|
ok: true,
|
|
7237
7237
|
value: { accepted: true }
|
|
@@ -7363,7 +7363,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7363
7363
|
* @returns the admission result, or the error branch on transport failure.
|
|
7364
7364
|
*/
|
|
7365
7365
|
async command(line) {
|
|
7366
|
-
const result = await this.remote.commands.execute(this.sessionId, line);
|
|
7366
|
+
const result = await this.remote.commands.execute(this.sessionId, line, []);
|
|
7367
7367
|
if (!result.ok) return result;
|
|
7368
7368
|
return {
|
|
7369
7369
|
ok: true,
|
|
@@ -10295,10 +10295,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10295
10295
|
* @returns an absolute path when a workspace root is available, otherwise the original path.
|
|
10296
10296
|
*/
|
|
10297
10297
|
function resolveWorkspacePath(cwd, path) {
|
|
10298
|
-
if (path.startsWith("/") ||
|
|
10298
|
+
if (path.startsWith("/") || isWindowsStylePath(path)) return path;
|
|
10299
10299
|
if (cwd === void 0 || cwd === "") return path;
|
|
10300
10300
|
return `${cwd.replace(/[/\\]+$/, "")}/${path.replace(/^[/\\]+/, "")}`;
|
|
10301
10301
|
}
|
|
10302
|
+
/** Drive-letter or UNC path; Web display must not rewrite these as `~`. */
|
|
10303
|
+
function isWindowsStylePath(value) {
|
|
10304
|
+
return /^[A-Za-z]:[/\\]/.test(value) || value.startsWith("\\\\");
|
|
10305
|
+
}
|
|
10306
|
+
/**
|
|
10307
|
+
* Display-only POSIX home abbreviation. Windows drive and UNC paths stay
|
|
10308
|
+
* verbatim, including when `home` itself is a Windows path. A missing, empty,
|
|
10309
|
+
* or filesystem-root `home` leaves `path` unchanged so `/` cannot become `~`.
|
|
10310
|
+
* @param path - absolute or already-short display path.
|
|
10311
|
+
* @param home - host account home from `host.describe`; absent skips abbreviation.
|
|
10312
|
+
* @returns `~` or `~/…` for the POSIX home and its descendants, otherwise `path`.
|
|
10313
|
+
*/
|
|
10314
|
+
function abbreviateHomePath(path, home) {
|
|
10315
|
+
if (home === void 0 || home === "") return path;
|
|
10316
|
+
if (isWindowsStylePath(path) || isWindowsStylePath(home)) return path;
|
|
10317
|
+
const root = home.replace(/\/+$/, "");
|
|
10318
|
+
if (root === "" || root === "/") return path;
|
|
10319
|
+
if (path.replace(/\/+$/, "") === root) return "~";
|
|
10320
|
+
if (path.startsWith(`${root}/`)) return `~${path.slice(root.length)}`;
|
|
10321
|
+
return path;
|
|
10322
|
+
}
|
|
10302
10323
|
//#endregion
|
|
10303
10324
|
//#region lib/types/client/sessions/partial.js
|
|
10304
10325
|
/**
|
|
@@ -10374,6 +10395,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10374
10395
|
return names.length > 0 ? names.join(", ") : null;
|
|
10375
10396
|
}
|
|
10376
10397
|
/**
|
|
10398
|
+
* The referenced-session labels of one durable `session-reference` recall
|
|
10399
|
+
* source, in first-seen order; empty for every other source shape, including
|
|
10400
|
+
* a foreign or older log whose reference entries carry no readable label.
|
|
10401
|
+
* @param source - the logged `user/message` source, exactly as recorded.
|
|
10402
|
+
* @returns distinct non-empty reference labels.
|
|
10403
|
+
*/
|
|
10404
|
+
function sessionRecallLabels(source) {
|
|
10405
|
+
const record = asRecord(source);
|
|
10406
|
+
if (record === null || readString(record, "kind") !== "session-reference") return [];
|
|
10407
|
+
return collect(record, "references", "label");
|
|
10408
|
+
}
|
|
10409
|
+
/**
|
|
10377
10410
|
* Project one durable message source onto its transcript role and producer name.
|
|
10378
10411
|
*
|
|
10379
10412
|
* The source arrives over the wire as opaque JSON (`MessageSource` is
|
|
@@ -10512,6 +10545,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10512
10545
|
exports.SlotRegistry = SlotRegistry;
|
|
10513
10546
|
exports.WorkspaceCreateError = WorkspaceCreateError;
|
|
10514
10547
|
exports.WorkspaceRuntime = WorkspaceRuntime;
|
|
10548
|
+
exports.abbreviateHomePath = abbreviateHomePath;
|
|
10515
10549
|
exports.apply = apply;
|
|
10516
10550
|
exports.contextForm = contextForm;
|
|
10517
10551
|
exports.contextProvenance = contextProvenance;
|
|
@@ -10528,6 +10562,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10528
10562
|
exports.isTokenDelta = isTokenDelta;
|
|
10529
10563
|
exports.resolveWorkspacePath = resolveWorkspacePath;
|
|
10530
10564
|
exports.scopeOf = scopeOf;
|
|
10565
|
+
exports.sessionRecallLabels = sessionRecallLabels;
|
|
10531
10566
|
exports.shallowEqual = shallowEqual;
|
|
10532
10567
|
exports.toAssistantBlock = toAssistantBlock;
|
|
10533
10568
|
exports.toAssistantBlocks = toAssistantBlocks;
|