dsh-edge 0.2.0 → 0.3.0-alpha.2
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 +13 -10
- package/README.zh.md +13 -10
- package/THIRD_PARTY_NOTICES.md +447 -348
- package/dist/assets/{index-BNMwCG9c.css → index-C6eRlFa6.css} +1 -1
- package/dist/assets/{index-CA9Bpko5.js → index-ClqxG24t.js} +35 -35
- package/dist/index.html +3 -3
- package/dist/plugins/@deepseek-ai/dsh-api-gateway/client.js +84 -55
- package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +10 -6
- package/dist/plugins/@deepseek-ai/dsh-client-runtime/client.js +15 -6
- package/dist/plugins/@deepseek-ai/dsh-client-ui-attachment/client.js +782 -0
- package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +188 -72
- package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +46 -13
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +287 -128
- package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +46 -9
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +26 -0
- package/package.json +25 -22
- package/scripts/cli.mjs +56 -1
- package/scripts/install.d.mts +31 -0
- package/scripts/install.mjs +304 -16
- package/scripts/legal-files.mjs +5 -1
- package/scripts/wrangler-config-core.mjs +28 -0
- package/scripts/wrangler-config.d.mts +1 -0
- package/worker/direct/index.js +1021 -991
- package/worker/isolated/index.js +677 -647
package/dist/index.html
CHANGED
|
@@ -39,16 +39,16 @@ window.__ModuleLoader__={
|
|
|
39
39
|
return exports.createClientModuleSystem(this,{id:registration.id,exports},options)
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
})()</script><script src="/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=7eb526320903"></script><script src="/plugins/@deepseek-ai/dsh-client-runtime/client.js?rev=
|
|
42
|
+
})()</script><script src="/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=7eb526320903"></script><script src="/plugins/@deepseek-ai/dsh-client-runtime/client.js?rev=5a9e129c42ae"></script><script>globalThis["__DSH_BOOT__"] = {"rev":"ca0dd421ae2a","entries":[{"id":"@deepseek-ai/dsh-typert-registry","url":"/plugins/@deepseek-ai/dsh-typert-registry/client.js?rev=f41d56e0b747","rev":"f41d56e0b747","inject":[],"immediately":true},{"id":"@deepseek-ai/dsh-api-gateway","url":"/plugins/@deepseek-ai/dsh-api-gateway/client.js?rev=965b70361a00","rev":"965b70361a00","inject":["@deepseek-ai/dsh-typert-registry","@deepseek-ai/dsh-client-connection"],"immediately":true},{"id":"@deepseek-ai/dsh-client-modules","url":"/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=7eb526320903","rev":"7eb526320903","inject":[],"immediately":true},{"id":"@deepseek-ai/dsh-client-connection","url":"/plugins/@deepseek-ai/dsh-client-connection/client.js?rev=c54bce6ee644","rev":"c54bce6ee644","inject":[],"immediately":true},{"id":"@deepseek-ai/dsh-api-remotes","url":"/plugins/@deepseek-ai/dsh-api-remotes/client.js?rev=9a16f4532366","rev":"9a16f4532366","inject":["@deepseek-ai/dsh-api-gateway"],"immediately":true},{"id":"@deepseek-ai/dsh-client-runtime","url":"/plugins/@deepseek-ai/dsh-client-runtime/client.js?rev=5a9e129c42ae","rev":"5a9e129c42ae","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-typert-registry","@deepseek-ai/dsh-api-remotes"],"immediately":true},{"id":"@deepseek-ai/dsh-client-ui-theme","url":"/plugins/@deepseek-ai/dsh-client-ui-theme/client.js?rev=e19c47b60a1c","rev":"e19c47b60a1c","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes"],"immediately":true},{"id":"@deepseek-ai/dsh-client-locale","url":"/plugins/@deepseek-ai/dsh-client-locale/client.js?rev=2660ca3f6a00","rev":"2660ca3f6a00","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes"],"immediately":true},{"id":"@deepseek-ai/dsh-client-ui-layout","url":"/plugins/@deepseek-ai/dsh-client-ui-layout/client.js?rev=abdb7f55acba","rev":"abdb7f55acba","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-theme"]},{"id":"@deepseek-ai/dsh-client-ui-renderer","url":"/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js?rev=79b59d365f3b","rev":"79b59d365f3b","inject":["@deepseek-ai/dsh-client-runtime"],"immediately":true},{"id":"@deepseek-ai/dsh-client-ui-sidebar","url":"/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js?rev=d1f4cbcb94e2","rev":"d1f4cbcb94e2","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-layout","@deepseek-ai/dsh-client-locale"]},{"id":"@deepseek-ai/dsh-client-ui-settings","url":"/plugins/@deepseek-ai/dsh-client-ui-settings/client.js?rev=5d1695c62b38","rev":"5d1695c62b38","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-settings-general","url":"/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js?rev=f733efde3f2f","rev":"f733efde3f2f","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-sidebar"]},{"id":"@deepseek-ai/dsh-client-ui-conversation","url":"/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js?rev=3bbe1845a0fd","rev":"3bbe1845a0fd","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-layout"]},{"id":"@deepseek-ai/dsh-client-ui-brand-official","url":"/plugins/@deepseek-ai/dsh-client-ui-brand-official/client.js?rev=c426d52ce216","rev":"c426d52ce216","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-sidebar"]},{"id":"@deepseek-ai/dsh-client-ui-attachment","url":"/plugins/@deepseek-ai/dsh-client-ui-attachment/client.js?rev=5349ce7aa495","rev":"5349ce7aa495","inject":["@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-tool","url":"/plugins/@deepseek-ai/dsh-client-ui-tool/client.js?rev=48c8d92e8828","rev":"48c8d92e8828","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-workflow-run","url":"/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js?rev=60e130ad4f36","rev":"60e130ad4f36","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-deliverables","url":"/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js?rev=13a78ee19f2e","rev":"13a78ee19f2e","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-workspace","url":"/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js?rev=c3b628226e01","rev":"c3b628226e01","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-sidebar"]},{"id":"@deepseek-ai/dsh-client-ui-input-trigger","url":"/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js?rev=b9564b9138a7","rev":"b9564b9138a7","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale"]},{"id":"@deepseek-ai/dsh-client-ui-commands","url":"/plugins/@deepseek-ai/dsh-client-ui-commands/client.js?rev=887c0ca028a4","rev":"887c0ca028a4","inject":["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-input-trigger","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-skill","url":"/plugins/@deepseek-ai/dsh-client-ui-skill/client.js?rev=f229a70eecce","rev":"f229a70eecce","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-tool","@deepseek-ai/dsh-client-ui-input-trigger","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-subagent","url":"/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js?rev=0bb1ff842ae8","rev":"0bb1ff842ae8","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-primitives","@deepseek-ai/dsh-client-ui-input-trigger"]},{"id":"@deepseek-ai/dsh-client-ui-jobs","url":"/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js?rev=ed0d04a8c154","rev":"ed0d04a8c154","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-primitives"]},{"id":"@deepseek-ai/dsh-client-ui-model-selection","url":"/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js?rev=639da97bfe66","rev":"639da97bfe66","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-commands","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-permission-presets","url":"/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js?rev=6cbbb8ca6afc","rev":"6cbbb8ca6afc","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-commands","@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-settings"]},{"id":"@deepseek-ai/dsh-client-ui-agent-preset","url":"/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js?rev=96dbaff92d41","rev":"96dbaff92d41","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-user-questions","url":"/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js?rev=350ccf0385ba","rev":"350ccf0385ba","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-trajectory","url":"/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js?rev=3345fd0d652c","rev":"3345fd0d652c","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"dsh-edge-client-ui","url":"/plugins/dsh-edge-client-ui/client.js?rev=5b4da7d56a88","rev":"5b4da7d56a88","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-locale"]}]}</script>
|
|
43
43
|
<meta charset="utf-8" />
|
|
44
44
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
45
45
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
46
46
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
47
47
|
<title>DeepSeek Harness</title>
|
|
48
|
-
<script type="module" crossorigin src="/assets/index-
|
|
48
|
+
<script type="module" crossorigin src="/assets/index-ClqxG24t.js"></script>
|
|
49
49
|
<link rel="modulepreload" crossorigin href="/assets/vendor-D22_Mp1f.js">
|
|
50
50
|
<link rel="stylesheet" crossorigin href="/assets/vendor-CjyC-hUb.css">
|
|
51
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
51
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C6eRlFa6.css">
|
|
52
52
|
</head>
|
|
53
53
|
<body>
|
|
54
54
|
<div id="root"></div>
|
|
@@ -95,9 +95,15 @@ window.__ModuleLoader__.load({
|
|
|
95
95
|
async mountContribution(callerCtx, contribution) {
|
|
96
96
|
this.validateContribution(contribution);
|
|
97
97
|
const disposeRemote = callerCtx.typert.remotes.register(contribution);
|
|
98
|
+
const groups = /* @__PURE__ */ new Map();
|
|
99
|
+
for (const descriptor of contribution.descriptors) {
|
|
100
|
+
const group = groups.get(descriptor.namespace);
|
|
101
|
+
if (group === void 0) groups.set(descriptor.namespace, [descriptor]);
|
|
102
|
+
else group.push(descriptor);
|
|
103
|
+
}
|
|
98
104
|
const installed = [];
|
|
99
105
|
try {
|
|
100
|
-
for (const
|
|
106
|
+
for (const [namespace, descriptors] of groups) installed.push(await this.installNamespace(namespace, descriptors));
|
|
101
107
|
} catch (error) {
|
|
102
108
|
for (const dispose of installed.reverse()) await dispose();
|
|
103
109
|
await disposeRemote();
|
|
@@ -135,64 +141,42 @@ window.__ModuleLoader__.load({
|
|
|
135
141
|
else service.assertMethodAvailable(method);
|
|
136
142
|
}
|
|
137
143
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return async () => {
|
|
155
|
-
/* v8 ignore next -- Cordis effect disposers are idempotent and invoke this cleanup at most once. */
|
|
156
|
-
if (!token.active) return;
|
|
157
|
-
token.active = false;
|
|
158
|
-
token.abort.abort();
|
|
159
|
-
for (const dispose of installed.reverse()) await dispose();
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
async installDirect(descriptor, token) {
|
|
163
|
-
const namespace = await this.namespace(descriptor.namespace);
|
|
164
|
-
try {
|
|
165
|
-
namespace.service.installDirect(descriptor, token);
|
|
166
|
-
} catch (error) {
|
|
167
|
-
await this.disposeNamespace(descriptor.namespace, namespace);
|
|
168
|
-
throw error;
|
|
169
|
-
}
|
|
170
|
-
return async () => {
|
|
171
|
-
namespace.service.remove("direct", descriptor.method, token);
|
|
172
|
-
await this.disposeNamespace(descriptor.namespace, namespace);
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
async installScoped(descriptor, projection, token) {
|
|
176
|
-
const namespace = await this.namespace(descriptor.namespace);
|
|
177
|
-
try {
|
|
178
|
-
namespace.service.installScoped(descriptor, projection, token);
|
|
179
|
-
} catch (error) {
|
|
180
|
-
await this.disposeNamespace(descriptor.namespace, namespace);
|
|
181
|
-
throw error;
|
|
182
|
-
}
|
|
144
|
+
/**
|
|
145
|
+
* Mount one namespace's descriptor group with no visibility gap: a fresh
|
|
146
|
+
* namespace installs its whole group synchronously inside its fiber's
|
|
147
|
+
* apply, so a plugin parked on the namespace service never observes it
|
|
148
|
+
* without the methods the same contribution carries; an existing namespace
|
|
149
|
+
* takes the group in one synchronous step.
|
|
150
|
+
* @param name - Remote namespace.
|
|
151
|
+
* @param descriptors - Every contribution descriptor naming that namespace.
|
|
152
|
+
* @returns disposer unmounting the group and the namespace once empty.
|
|
153
|
+
*/
|
|
154
|
+
async installNamespace(name, descriptors) {
|
|
155
|
+
let namespace = this.namespaces.get(name);
|
|
156
|
+
let installed;
|
|
157
|
+
if (namespace === void 0) ({namespace, installed} = await this.createNamespace(name, descriptors));
|
|
158
|
+
else installed = installMethods(namespace.service, descriptors);
|
|
159
|
+
const handle = namespace;
|
|
183
160
|
return async () => {
|
|
184
|
-
|
|
185
|
-
|
|
161
|
+
for (const method of [...installed].reverse()) {
|
|
162
|
+
/* v8 ignore next -- Cordis effect disposers are idempotent and invoke this cleanup at most once. */
|
|
163
|
+
if (!method.token.active) continue;
|
|
164
|
+
method.token.active = false;
|
|
165
|
+
method.token.abort.abort();
|
|
166
|
+
if (method.scoped) handle.service.remove("scoped", method.descriptor.method, method.token);
|
|
167
|
+
if (method.direct) handle.service.remove("direct", method.descriptor.method, method.token);
|
|
168
|
+
}
|
|
169
|
+
await this.disposeNamespace(name, handle);
|
|
186
170
|
};
|
|
187
171
|
}
|
|
188
|
-
async
|
|
189
|
-
let namespace = this.namespaces.get(name);
|
|
190
|
-
if (namespace !== void 0) return namespace;
|
|
172
|
+
async createNamespace(name, descriptors) {
|
|
191
173
|
let service;
|
|
174
|
+
let installed;
|
|
192
175
|
const fiber = this.ownerCtx.plugin({
|
|
193
176
|
name: remoteServiceKey(name),
|
|
194
177
|
apply: (ctx) => {
|
|
195
178
|
service = new RemoteNamespaceService(ctx, name, (direct, scoped, caller, args) => this.invokeMethod(direct, scoped, caller, args));
|
|
179
|
+
installed = installMethods(service, descriptors);
|
|
196
180
|
}
|
|
197
181
|
});
|
|
198
182
|
try {
|
|
@@ -201,14 +185,17 @@ window.__ModuleLoader__.load({
|
|
|
201
185
|
await fiber.dispose();
|
|
202
186
|
throw error;
|
|
203
187
|
}
|
|
204
|
-
/* v8 ignore next -- a settled namespace fiber synchronously constructs its Service. */
|
|
205
|
-
if (service === void 0) throw new Error(`client api: namespace ${JSON.stringify(name)} did not start`);
|
|
206
|
-
namespace = {
|
|
188
|
+
/* v8 ignore next 3 -- a settled namespace fiber synchronously constructs its Service and installs the group. */
|
|
189
|
+
if (service === void 0 || installed === void 0) throw new Error(`client api: namespace ${JSON.stringify(name)} did not start`);
|
|
190
|
+
const namespace = {
|
|
207
191
|
service,
|
|
208
192
|
dispose: fiber.dispose
|
|
209
193
|
};
|
|
210
194
|
this.namespaces.set(name, namespace);
|
|
211
|
-
return
|
|
195
|
+
return {
|
|
196
|
+
namespace,
|
|
197
|
+
installed
|
|
198
|
+
};
|
|
212
199
|
}
|
|
213
200
|
async disposeNamespace(name, namespace) {
|
|
214
201
|
if (!namespace.service.empty || this.namespaces.get(name) !== namespace) return;
|
|
@@ -339,6 +326,48 @@ window.__ModuleLoader__.load({
|
|
|
339
326
|
Reflect.deleteProperty(this, method);
|
|
340
327
|
}
|
|
341
328
|
};
|
|
329
|
+
/**
|
|
330
|
+
* Install one descriptor group on a namespace service, unwinding the partial
|
|
331
|
+
* group when a descriptor is refused.
|
|
332
|
+
* @param service - Namespace service taking the methods.
|
|
333
|
+
* @param descriptors - Descriptor group of one contribution.
|
|
334
|
+
* @returns per-descriptor records for the group disposer.
|
|
335
|
+
*/
|
|
336
|
+
function installMethods(service, descriptors) {
|
|
337
|
+
const installed = [];
|
|
338
|
+
try {
|
|
339
|
+
for (const descriptor of descriptors) {
|
|
340
|
+
const method = {
|
|
341
|
+
descriptor,
|
|
342
|
+
token: {
|
|
343
|
+
active: true,
|
|
344
|
+
abort: new AbortController()
|
|
345
|
+
},
|
|
346
|
+
direct: false,
|
|
347
|
+
scoped: false
|
|
348
|
+
};
|
|
349
|
+
installed.push(method);
|
|
350
|
+
if (descriptor.invocation.kind === "direct") {
|
|
351
|
+
service.installDirect(descriptor, method.token);
|
|
352
|
+
method.direct = true;
|
|
353
|
+
}
|
|
354
|
+
const projection = scopedProjection(descriptor);
|
|
355
|
+
if (projection !== void 0) {
|
|
356
|
+
service.installScoped(descriptor, projection, method.token);
|
|
357
|
+
method.scoped = true;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
} catch (error) {
|
|
361
|
+
for (const method of [...installed].reverse()) {
|
|
362
|
+
method.token.active = false;
|
|
363
|
+
method.token.abort.abort();
|
|
364
|
+
if (method.scoped) service.remove("scoped", method.descriptor.method, method.token);
|
|
365
|
+
if (method.direct) service.remove("direct", method.descriptor.method, method.token);
|
|
366
|
+
}
|
|
367
|
+
throw error;
|
|
368
|
+
}
|
|
369
|
+
return installed;
|
|
370
|
+
}
|
|
342
371
|
const REMOTE_NAMESPACE_FIELDS = new Set([
|
|
343
372
|
"ctx",
|
|
344
373
|
"empty",
|
|
@@ -5263,8 +5263,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5263
5263
|
workspaceId: workspaceIdSchema.optional(),
|
|
5264
5264
|
cwd: string().optional(),
|
|
5265
5265
|
sessionId: sessionIdSchema.optional(),
|
|
5266
|
-
agentPreset: string().optional()
|
|
5267
|
-
|
|
5266
|
+
agentPreset: string().optional(),
|
|
5267
|
+
reuseWorkspaceBlank: literal(true).optional()
|
|
5268
|
+
}).refine((payload) => payload.workspaceId === void 0 || payload.cwd === void 0, { message: "session.create accepts workspaceId or cwd, not both" }).refine((payload) => payload.reuseWorkspaceBlank !== true || payload.workspaceId !== void 0 && payload.sessionId !== void 0, { message: "session.create reuseWorkspaceBlank requires workspaceId and sessionId" });
|
|
5268
5269
|
/** session.create response value. */
|
|
5269
5270
|
const sessionCreateValueSchema = object({
|
|
5270
5271
|
sessionId: sessionIdSchema,
|
|
@@ -10200,9 +10201,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10200
10201
|
const ENDPOINT_SEGMENT_PATTERN = /^[A-Za-z0-9_$.-]+$/;
|
|
10201
10202
|
/**
|
|
10202
10203
|
* Create the browser-backed generic RPC caller.
|
|
10204
|
+
* @param doFetch - transport override; defaults to the page's global fetch.
|
|
10203
10205
|
* @returns caller that owns request correlation and response-envelope validation.
|
|
10204
10206
|
*/
|
|
10205
|
-
function createWebConnectionRpc() {
|
|
10207
|
+
function createWebConnectionRpc(doFetch) {
|
|
10208
|
+
const send = doFetch ?? ((input, init) => globalThis.fetch(input, init));
|
|
10206
10209
|
return { async call(channel, endpoint, payload, signal) {
|
|
10207
10210
|
assertTarget(channel, endpoint);
|
|
10208
10211
|
const rpcId = RpcId(randomUuid());
|
|
@@ -10212,7 +10215,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10212
10215
|
method: endpoint,
|
|
10213
10216
|
payload
|
|
10214
10217
|
};
|
|
10215
|
-
const response = await
|
|
10218
|
+
const response = await send(new URL(`${channel}/${endpoint}`, resolveBase()), {
|
|
10216
10219
|
method: "POST",
|
|
10217
10220
|
headers: { "content-type": "application/json" },
|
|
10218
10221
|
body: JSON.stringify(message),
|
|
@@ -10260,8 +10263,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
10260
10263
|
function apply(ctx) {
|
|
10261
10264
|
const pageLocation = typeof location === "undefined" ? void 0 : location;
|
|
10262
10265
|
const fixtureClient = pageLocation !== void 0 && new URLSearchParams(pageLocation.search).has("fixture") ? new FixtureApiClient() : void 0;
|
|
10263
|
-
const
|
|
10264
|
-
const
|
|
10266
|
+
const transport = globalThis.__DSH_TRANSPORT__;
|
|
10267
|
+
const api = fixtureClient ?? transport?.createApiClient() ?? new WebApiClient();
|
|
10268
|
+
const rpc = fixtureClient?.rpc ?? createWebConnectionRpc(transport?.fetch);
|
|
10265
10269
|
let started = false;
|
|
10266
10270
|
let description;
|
|
10267
10271
|
const descriptionListeners = /* @__PURE__ */ new Set();
|
|
@@ -8145,7 +8145,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8145
8145
|
*/
|
|
8146
8146
|
async create(opts = {}) {
|
|
8147
8147
|
try {
|
|
8148
|
-
const shared =
|
|
8148
|
+
const shared = {
|
|
8149
|
+
...opts.sessionId === void 0 ? {} : { sessionId: opts.sessionId },
|
|
8150
|
+
...opts.reuseWorkspaceBlank === void 0 ? {} : { reuseWorkspaceBlank: opts.reuseWorkspaceBlank }
|
|
8151
|
+
};
|
|
8149
8152
|
const payload = opts.workspaceId !== void 0 ? {
|
|
8150
8153
|
workspaceId: opts.workspaceId,
|
|
8151
8154
|
...shared
|
|
@@ -9812,7 +9815,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9812
9815
|
list;
|
|
9813
9816
|
/** Workspace baseline and frame owner. */
|
|
9814
9817
|
manager;
|
|
9815
|
-
/** In-flight blank-session
|
|
9818
|
+
/** In-flight blank-session connects keyed by workspace (reuse or create). */
|
|
9816
9819
|
connecting = /* @__PURE__ */ new Map();
|
|
9817
9820
|
/** Guards the runtime-owned one-shot initial-selection subscription. */
|
|
9818
9821
|
initialSelectionStarted = false;
|
|
@@ -9844,9 +9847,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9844
9847
|
}
|
|
9845
9848
|
/**
|
|
9846
9849
|
* Resolve the session a New Session flow lands in once this Workspace is
|
|
9847
|
-
* chosen:
|
|
9848
|
-
* list mirror, else create a fresh one on the host
|
|
9849
|
-
* the full Session+Agent — the client
|
|
9850
|
+
* chosen: explicitly adopt the workspace's existing blank session when one
|
|
9851
|
+
* is in the list mirror, else create a fresh one on the host
|
|
9852
|
+
* (`session.create` births or resumes the full Session+Agent — the client
|
|
9853
|
+
* holds no intermediate state). The adoption tells optional default owners
|
|
9854
|
+
* that this exact session passed the reuse checks.
|
|
9850
9855
|
* caller owns navigation: take the returned id to `sessions.open`.
|
|
9851
9856
|
* Resolution guarantee (both arms): the returned id is already in the list
|
|
9852
9857
|
* store and `sessions.binding(id)` resolves synchronously — draft hand-off
|
|
@@ -9863,7 +9868,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9863
9868
|
const sessions = this.sessions.list.getSnapshot();
|
|
9864
9869
|
for (const id of sessions.ids) {
|
|
9865
9870
|
const summary = sessions.byId[id];
|
|
9866
|
-
if (summary !== void 0 && summary.blank && summary.cwd === workspace.path && workspace.sessionIds.includes(summary.id) && !archived.includes(summary.id)) return
|
|
9871
|
+
if (summary !== void 0 && summary.blank && summary.cwd === workspace.path && workspace.sessionIds.includes(summary.id) && !archived.includes(summary.id)) return this.sessions.create({
|
|
9872
|
+
workspaceId,
|
|
9873
|
+
sessionId: summary.id,
|
|
9874
|
+
reuseWorkspaceBlank: true
|
|
9875
|
+
});
|
|
9867
9876
|
}
|
|
9868
9877
|
const attempt = this.sessions.create({ workspaceId }).finally(() => {
|
|
9869
9878
|
this.connecting.delete(workspaceId);
|