dsh-edge 0.18.0 → 0.19.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.
Files changed (118) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +8 -8
  3. package/README.zh.md +8 -8
  4. package/THIRD_PARTY_NOTICES.md +2011 -449
  5. package/dist/assets/fonts/Montserrat-OFL.txt +93 -0
  6. package/dist/assets/fonts/montserrat-light-Cvd2VjE_.woff2 +0 -0
  7. package/dist/assets/fonts/montserrat-medium-B4OyO9CN.woff2 +0 -0
  8. package/dist/assets/fonts/montserrat-regular-DYep38cA.woff2 +0 -0
  9. package/dist/assets/index-Cq6ljTv2.css +1 -0
  10. package/dist/assets/index-Dy0OhsZ5.js +127 -0
  11. package/dist/assets/langs/asciidoc-Ve4PFQV2.js +2 -0
  12. package/dist/assets/langs/bat-BkioyH1T.js +2 -0
  13. package/dist/assets/langs/bibtex-CHM0blh-.js +2 -0
  14. package/dist/assets/langs/clojure-P80f7IUj.js +2 -0
  15. package/dist/assets/langs/cmake-D1j8_8rp.js +2 -0
  16. package/dist/assets/langs/csv-fuZLfV_i.js +2 -0
  17. package/dist/assets/langs/dart-bE4Kk8sk.js +2 -0
  18. package/dist/assets/langs/diff-D97Zzqfu.js +2 -0
  19. package/dist/assets/langs/dotenv-Da5cRb03.js +2 -0
  20. package/dist/assets/langs/elixir-CvYZzuDY.js +2 -0
  21. package/dist/assets/langs/erlang-DsQrWhSR.js +2 -0
  22. package/dist/assets/langs/fish-BvzEVeQv.js +2 -0
  23. package/dist/assets/langs/fsharp-CXgrBDvD.js +2 -0
  24. package/dist/assets/langs/graphql-DujV8YkJ.js +2 -0
  25. package/dist/assets/langs/groovy-gcz8RCvz.js +2 -0
  26. package/dist/assets/langs/haskell-Df6bDoY_.js +2 -0
  27. package/dist/assets/langs/hcl-BWvSN4gD.js +2 -0
  28. package/dist/assets/langs/html-derivative-DOyKdj44.js +2 -0
  29. package/dist/assets/langs/html-fwsONPVS.js +2 -0
  30. package/dist/assets/langs/http-DcV90OkR.js +2 -0
  31. package/dist/assets/langs/javascript-DI5JR1nB.js +2 -0
  32. package/dist/assets/langs/julia-BpJ6DjL_.js +2 -0
  33. package/dist/assets/langs/latex-B4C7GdlO.js +2 -0
  34. package/dist/assets/langs/log-2UxHyX5q.js +2 -0
  35. package/dist/assets/langs/make-CHLpvVh8.js +2 -0
  36. package/dist/assets/langs/nix-CwoSXNpI.js +2 -0
  37. package/dist/assets/langs/perl-DsWkoyyU.js +2 -0
  38. package/dist/assets/langs/php-LEPfNACG.js +2 -0
  39. package/dist/assets/langs/powershell-Dpen1YoG.js +2 -0
  40. package/dist/assets/langs/proto-C7zT0LnQ.js +2 -0
  41. package/dist/assets/langs/r-Dspwwk_N.js +2 -0
  42. package/dist/assets/langs/rst-BbocfKWr.js +2 -0
  43. package/dist/assets/langs/ruby-R292Iif0.js +2 -0
  44. package/dist/assets/langs/scala-C151Ov-r.js +2 -0
  45. package/dist/assets/langs/svelte-DNMY6jOf.js +2 -0
  46. package/dist/assets/langs/system-verilog-CnnmHF94.js +2 -0
  47. package/dist/assets/langs/vb-D17OF-Vu.js +2 -0
  48. package/dist/assets/langs/verilog-BQ8w6xss.js +2 -0
  49. package/dist/assets/langs/vue-Dq2x6432.js +2 -0
  50. package/dist/favicon-dark.svg +3 -0
  51. package/dist/favicon.svg +0 -5
  52. package/dist/index.html +5 -4
  53. package/dist/manifest.webmanifest +3 -4
  54. package/dist/plugins/@deepseek-ai/dsh-api-gateway/client.js +353 -101
  55. package/dist/plugins/@deepseek-ai/dsh-api-job-controller/client.js +367 -0
  56. package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +7223 -3584
  57. package/dist/plugins/@deepseek-ai/dsh-api-session-controller/client.js +1107 -991
  58. package/dist/plugins/@deepseek-ai/dsh-api-workspace-controller/client.js +119 -6
  59. package/dist/plugins/@deepseek-ai/dsh-api-workspace-files/client.js +41 -35
  60. package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +354 -5279
  61. package/dist/plugins/@deepseek-ai/dsh-client-file-upload/client.js +10 -23
  62. package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +234 -80
  63. package/dist/plugins/@deepseek-ai/dsh-client-modules/client.js +554 -46
  64. package/dist/plugins/@deepseek-ai/dsh-client-shortcuts/client.js +2006 -0
  65. package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +1090 -914
  66. package/dist/plugins/@deepseek-ai/dsh-client-ui-approval/client.js +79 -6
  67. package/dist/plugins/@deepseek-ai/dsh-client-ui-attachment/client.js +126 -155
  68. package/dist/plugins/@deepseek-ai/dsh-client-ui-chat/client.js +5776 -1593
  69. package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +375 -121
  70. package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +3524 -1923
  71. package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +1615 -258
  72. package/dist/plugins/@deepseek-ai/dsh-client-ui-directory-picker-browse/client.js +9 -9
  73. package/dist/plugins/@deepseek-ai/dsh-client-ui-goal/client.js +25 -10
  74. package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +169 -24
  75. package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +413 -63
  76. package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +131 -14
  77. package/dist/plugins/@deepseek-ai/dsh-client-ui-message-feedback/client.js +24 -22
  78. package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +281 -128
  79. package/dist/plugins/@deepseek-ai/dsh-client-ui-open-in-app/client.js +674 -223
  80. package/dist/plugins/@deepseek-ai/dsh-client-ui-plan/client.js +596 -18
  81. package/dist/plugins/@deepseek-ai/dsh-client-ui-reference/client.js +92 -9
  82. package/dist/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js +467 -59
  83. package/dist/plugins/@deepseek-ai/dsh-client-ui-session/client.js +231 -72
  84. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings/client.js +281 -117
  85. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +642 -122
  86. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-models/client.js +1565 -438
  87. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugin-inventory/client.js +201 -75
  88. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-plugins/client.js +30 -1628
  89. package/dist/plugins/@deepseek-ai/dsh-client-ui-shortcuts/client.js +1163 -0
  90. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +165 -39
  91. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-browser/client.js +1648 -0
  92. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client.js +5515 -25622
  93. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-files/client.js +419 -118
  94. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-right/client.js +5692 -260
  95. package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +156 -41
  96. package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +386 -263
  97. package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +183 -73
  98. package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +2367 -429
  99. package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +788 -270
  100. package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +87 -79
  101. package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +28 -14
  102. package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +2647 -1044
  103. package/dist/plugins/@deepseek-ai/dsh-typert-registry/client.js +22 -7
  104. package/dist/plugins/dsh-edge-client-ui/client.js +1 -10
  105. package/package.json +96 -86
  106. package/scripts/cli.mjs +16 -4
  107. package/scripts/install.d.mts +12 -2
  108. package/scripts/install.mjs +36 -9
  109. package/scripts/legal-files.mjs +15 -0
  110. package/worker/direct/index.js +2564 -1822
  111. package/worker/isolated/index.js +2144 -1402
  112. package/dist/assets/index-BKQ_L1z6.js +0 -117
  113. package/dist/assets/index-DPX2bQLO.css +0 -1
  114. package/dist/assets/langs/html-CfGypltT.js +0 -2
  115. package/dist/assets/langs/php-DJl5gRdb.js +0 -2
  116. package/dist/assets/langs/ruby-5eNB0pDK.js +0 -2
  117. package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +0 -505
  118. package/dist/plugins/@deepseek-ai/dsh-client-ui-schedule/client.js +0 -307
@@ -8,19 +8,79 @@ window.__ModuleLoader__.load({
8
8
  let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
9
9
  let _deepseek_ai_dsh_client_ui_slots = require("@deepseek-ai/dsh-client-ui-slots");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
- let react = require("react");
11
+ //#region ../../util/values/src/index.ts
12
+ /**
13
+ * Weak-key lookup with a strongly retained iterable set of associated values.
14
+ *
15
+ * Each value must belong to only one key. The container performs no automatic
16
+ * cleanup; owners delete associations or clear the container at lifecycle end.
17
+ */
18
+ var WeakMapWithValues = class {
19
+ keys = /* @__PURE__ */ new WeakMap();
20
+ valueSet = /* @__PURE__ */ new Set();
21
+ /** Live strongly retained values in insertion order. */
22
+ values = this.valueSet;
23
+ /**
24
+ * Read the value associated with a key.
25
+ * @param key - weakly held lookup key.
26
+ * @returns the associated value, or absence.
27
+ */
28
+ get(key) {
29
+ return this.keys.get(key);
30
+ }
31
+ /**
32
+ * Test whether a key has an association.
33
+ * @param key - weakly held lookup key.
34
+ * @returns whether the key is present.
35
+ */
36
+ has(key) {
37
+ return this.keys.has(key);
38
+ }
39
+ /**
40
+ * Associate one key with one caller-unique value.
41
+ * @param key - weakly held lookup key.
42
+ * @param value - strongly retained value that belongs to no other key.
43
+ * @returns this container.
44
+ */
45
+ set(key, value) {
46
+ if (this.keys.has(key)) {
47
+ const previous = this.keys.get(key);
48
+ if (previous === value) return this;
49
+ this.valueSet.delete(previous);
50
+ }
51
+ this.keys.set(key, value);
52
+ this.valueSet.add(value);
53
+ return this;
54
+ }
55
+ /**
56
+ * Remove one association and its strongly retained value.
57
+ * @param key - weakly held lookup key.
58
+ * @returns whether an association was removed.
59
+ */
60
+ delete(key) {
61
+ if (!this.keys.has(key)) return false;
62
+ const value = this.keys.get(key);
63
+ const deleted = this.keys.delete(key);
64
+ this.valueSet.delete(value);
65
+ return deleted;
66
+ }
67
+ /** Remove every association and strongly retained value. */
68
+ clear() {
69
+ this.keys = /* @__PURE__ */ new WeakMap();
70
+ this.valueSet.clear();
71
+ }
72
+ };
73
+ //#endregion
12
74
  //#region lib/types/client/session-provider.js
13
- /** Session-owned rendering semantics for the standard SessionProvider seat. */
14
75
  /**
15
76
  * Render the selected Session body or its empty branch.
16
77
  * @param binding - current Session scope binding.
17
78
  * @param props - standard Session area render props.
18
- * @returns the selected Session subtree, keyed by Session identity.
79
+ * @returns the selected Session subtree.
19
80
  */
20
81
  function renderSessionArea(binding, { empty, children }) {
21
- const sessionId = binding.key;
22
- if (sessionId === void 0) return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: empty?.() ?? null });
23
- return (0, react_jsx_runtime.jsx)(react.Fragment, { children }, sessionId);
82
+ if (binding.key === void 0) return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: empty?.() ?? null });
83
+ return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
24
84
  }
25
85
  //#endregion
26
86
  //#region lib/types/client/index.js
@@ -72,20 +132,25 @@ window.__ModuleLoader__.load({
72
132
  var UiSession = class extends _deepseek_ai_cordis.Service {
73
133
  sessions;
74
134
  descriptors = [BUILTIN_SOURCE];
75
- bindings = /* @__PURE__ */ new Map();
135
+ bindings = new WeakMapWithValues();
76
136
  absent;
77
- currentBinding;
78
- currentListeners = /* @__PURE__ */ new Set();
137
+ current;
79
138
  pendingDomains = [];
80
139
  pendingSnapshot = /* @__PURE__ */ new Map();
81
- pendingListeners = /* @__PURE__ */ new Set();
82
- /** Root source of pending UI interactions, independent from Controller snapshots. */
83
- pendingInteractions = {
84
- getSnapshot: () => this.pendingSnapshot,
140
+ running = /* @__PURE__ */ new Map();
141
+ completionUnread = /* @__PURE__ */ new Set();
142
+ statusSnapshot = /* @__PURE__ */ new Map();
143
+ statusListeners = /* @__PURE__ */ new Set();
144
+ mainRetainId;
145
+ disposeMainRetain = () => {};
146
+ active = true;
147
+ /** Root source combining running, pending-interaction, and completion-reminder facts. */
148
+ sessionStatus = {
149
+ getSnapshot: () => this.statusSnapshot,
85
150
  subscribe: (listener) => {
86
- this.pendingListeners.add(listener);
151
+ this.statusListeners.add(listener);
87
152
  return () => {
88
- this.pendingListeners.delete(listener);
153
+ this.statusListeners.delete(listener);
89
154
  };
90
155
  }
91
156
  };
@@ -98,34 +163,51 @@ window.__ModuleLoader__.load({
98
163
  constructor(ctx, sessions) {
99
164
  super(ctx, "uiSession");
100
165
  this.sessions = sessions;
101
- this.absent = this.materializeAbsent();
102
- this.currentBinding = this.resolveCurrent();
166
+ this.absent = createBindingSource(this.materializeAbsent());
167
+ this.current = createBindingSource(this.absent.value);
103
168
  this.adapter = {
104
- current: {
105
- getSnapshot: () => this.currentBinding,
106
- subscribe: (listener) => {
107
- this.currentListeners.add(listener);
108
- return () => {
109
- this.currentListeners.delete(listener);
110
- };
111
- }
112
- },
113
- resolve: (key) => this.resolve(key),
169
+ current: this.current,
170
+ bindingSource: (target) => this.bindingSource(target),
114
171
  renderArea: renderSessionArea
115
172
  };
116
173
  ctx.effect(() => {
117
174
  const disposeList = sessions.list.subscribe(() => {
118
- this.publishCurrent();
175
+ this.publishMain();
119
176
  });
177
+ const disposeStatus = sessions.list.subscribe(() => {
178
+ this.reconcileStatus();
179
+ });
180
+ const disposeRemoteStatus = ctx.remote.$on("api-session/status", (sessionId, running) => {
181
+ this.observeRunning(sessionId, running);
182
+ });
183
+ this.publishMain();
184
+ this.reconcileStatus();
120
185
  return () => {
186
+ this.active = false;
121
187
  disposeList();
122
- const records = [...this.bindings.values()];
188
+ disposeStatus();
189
+ disposeRemoteStatus();
190
+ this.disposeMainRetain();
191
+ const records = [...this.bindings.values];
123
192
  this.bindings.clear();
124
193
  for (const record of records) record.release();
125
194
  };
126
195
  }, "ui-session: Session binding projection");
127
196
  }
128
197
  /**
198
+ * Resolve a stable renderer source for an owned Session reference or explicit absence.
199
+ * @param reference - active reference supplied by the Provider owner, or absence.
200
+ * @returns the binding source, which falls back to the absent projection when its generation ends.
201
+ * @throws when the reference does not belong to the active Controller generation.
202
+ */
203
+ bindingSource(reference) {
204
+ if (!this.active) return this.absent;
205
+ if (reference === void 0) return this.absent;
206
+ const owner = reference.binding;
207
+ if (this.sessions.binding(reference.sessionId) !== owner) throw new Error("ui-session: Session reference is not active in this Controller");
208
+ return this.sourceFor(owner);
209
+ }
210
+ /**
129
211
  * Register one Session-scoped standard-source contribution.
130
212
  * @param descriptor - static member roster and per-binding resolver.
131
213
  * @returns disposer owned by the caller's Cordis fiber.
@@ -177,38 +259,42 @@ window.__ModuleLoader__.load({
177
259
  }
178
260
  rebuildBindings() {
179
261
  const absent = this.materializeAbsent();
180
- const bindings = /* @__PURE__ */ new Map();
181
- try {
182
- for (const [sessionId, cached] of this.bindings) bindings.set(sessionId, this.createMaterializedBinding(cached.owner));
183
- } catch (error) {
184
- for (const record of bindings.values()) record.release();
185
- throw error;
186
- }
187
- const previous = this.bindings;
188
- this.absent = absent;
189
- this.bindings = bindings;
190
- for (const record of previous.values()) record.release();
191
- this.publishCurrent();
262
+ const updates = [...this.bindings.values].map((record) => ({
263
+ source: record.source,
264
+ value: this.materialize(record.owner)
265
+ }));
266
+ this.absent.value = absent;
267
+ for (const { source, value } of updates) source.value = value;
268
+ (0, _deepseek_ai_dsh_client_store.notifySubscribers)(this.absent.listeners, "[ui-session] absent binding");
269
+ for (const { source } of updates) (0, _deepseek_ai_dsh_client_store.notifySubscribers)(source.listeners, "[ui-session] Session binding");
270
+ this.publishMain();
192
271
  }
193
- resolve(key) {
194
- const owner = this.sessions.binding(key);
195
- if (owner === void 0) return void 0;
196
- const cached = this.bindings.get(key);
197
- if (cached?.owner === owner) return cached.value;
272
+ sourceFor(owner) {
273
+ const cached = this.bindings.get(owner);
274
+ if (cached !== void 0) return cached.source;
198
275
  const record = this.createMaterializedBinding(owner);
199
- this.bindings.set(key, record);
200
- cached?.release();
201
- return record.value;
276
+ this.bindings.set(owner, record);
277
+ return record.source;
202
278
  }
203
- resolveCurrent() {
204
- const current = this.sessions.list.getSnapshot().current;
205
- return current === void 0 ? this.absent : this.resolve(current) ?? this.absent;
279
+ publishMain() {
280
+ if (!this.active) return;
281
+ const byId = this.sessions.list.getSnapshot().byId;
282
+ const currentId = this.current.value.key;
283
+ const nextId = currentId !== void 0 && (this.sessions.retainInfo(currentId).getSnapshot().retainedBy.mainView ?? 0) > 0 ? currentId : Object.values(byId).find((candidate) => (candidate.retainedBy.mainView ?? 0) > 0)?.id;
284
+ this.watchMainRetention(nextId);
285
+ const owner = nextId === void 0 ? void 0 : this.sessions.binding(nextId);
286
+ const value = owner === void 0 ? this.absent.value : this.sourceFor(owner).value;
287
+ if (this.current.value === value) return;
288
+ this.current.value = value;
289
+ (0, _deepseek_ai_dsh_client_store.notifySubscribers)(this.current.listeners, "[ui-session] main binding");
206
290
  }
207
- publishCurrent() {
208
- const next = this.resolveCurrent();
209
- if (next === this.currentBinding) return;
210
- this.currentBinding = next;
211
- (0, _deepseek_ai_dsh_client_store.notifySubscribers)(this.currentListeners, "[ui-session] current binding");
291
+ watchMainRetention(sessionId) {
292
+ if (sessionId === this.mainRetainId) return;
293
+ this.disposeMainRetain();
294
+ this.mainRetainId = sessionId;
295
+ this.disposeMainRetain = sessionId === void 0 ? () => {} : this.sessions.retainInfo(sessionId).subscribe(() => {
296
+ this.publishMain();
297
+ });
212
298
  }
213
299
  publishPendingInteractions() {
214
300
  const next = /* @__PURE__ */ new Map();
@@ -223,20 +309,66 @@ window.__ModuleLoader__.load({
223
309
  const projected = new Map([...next].map(([sessionId, value]) => [sessionId, value.interaction]));
224
310
  if (samePendingInteractions(this.pendingSnapshot, projected)) return;
225
311
  this.pendingSnapshot = projected;
226
- (0, _deepseek_ai_dsh_client_store.notifySubscribers)(this.pendingListeners, "[ui-session] pending interactions");
312
+ this.publishStatus();
313
+ }
314
+ observeRunning(sessionId, running) {
315
+ const previous = this.running.get(sessionId);
316
+ const beforeBaseline = this.sessions.list.getSnapshot().phase === "pending";
317
+ this.running.set(sessionId, running);
318
+ if (running) this.completionUnread.delete(sessionId);
319
+ else if ((previous === true || previous === void 0 && beforeBaseline) && !this.isMain(sessionId)) this.completionUnread.add(sessionId);
320
+ this.publishStatus();
321
+ }
322
+ reconcileStatus() {
323
+ const list = this.sessions.list.getSnapshot();
324
+ const present = new Set(Object.keys(list.byId));
325
+ for (const id of list.ids) {
326
+ const row = list.byId[id];
327
+ const previous = this.running.get(id);
328
+ if (previous === void 0) this.running.set(id, row.running);
329
+ else if (previous !== row.running) this.observeRunning(id, row.running);
330
+ }
331
+ for (const id of present) if (this.isMain(id)) this.completionUnread.delete(id);
332
+ if (list.phase === "ready") for (const id of this.running.keys()) {
333
+ if (present.has(id)) continue;
334
+ this.running.delete(id);
335
+ this.completionUnread.delete(id);
336
+ }
337
+ this.publishStatus();
338
+ }
339
+ isMain(sessionId) {
340
+ return (this.sessions.list.getSnapshot().byId[sessionId]?.retainedBy.mainView ?? 0) > 0;
341
+ }
342
+ publishStatus() {
343
+ const ids = new Set([
344
+ ...Object.keys(this.sessions.list.getSnapshot().byId),
345
+ ...this.running.keys(),
346
+ ...this.pendingSnapshot.keys(),
347
+ ...this.completionUnread
348
+ ]);
349
+ const next = /* @__PURE__ */ new Map();
350
+ for (const id of ids) next.set(id, {
351
+ running: this.running.get(id),
352
+ pendingInteraction: this.pendingSnapshot.get(id),
353
+ completionUnread: this.completionUnread.has(id)
354
+ });
355
+ if (sameSessionStatus(this.statusSnapshot, next)) return;
356
+ this.statusSnapshot = next;
357
+ (0, _deepseek_ai_dsh_client_store.notifySubscribers)(this.statusListeners, "[ui-session] Session status");
227
358
  }
228
359
  createMaterializedBinding(owner) {
229
360
  const value = this.materialize(owner);
361
+ this.ctx.slots.bindStoreScope(value);
362
+ const source = createBindingSource(value);
230
363
  const releaseEffect = owner.ctx.effect(() => () => {
231
- if (this.bindings.get(owner.sessionId) !== record) return;
232
- this.bindings.delete(owner.sessionId);
233
- if (this.currentBinding !== value) return;
234
- this.currentBinding = this.absent;
235
- (0, _deepseek_ai_dsh_client_store.notifySubscribers)(this.currentListeners, "[ui-session] current binding");
364
+ if (this.bindings.get(owner) === record) this.bindings.delete(owner);
365
+ source.value = this.absent.value;
366
+ (0, _deepseek_ai_dsh_client_store.notifySubscribers)(source.listeners, "[ui-session] Session binding");
367
+ this.publishMain();
236
368
  }, `ui-session: binding ${owner.sessionId}`);
237
369
  const record = {
238
370
  owner,
239
- value,
371
+ source,
240
372
  release: () => {
241
373
  releaseEffect();
242
374
  }
@@ -255,15 +387,13 @@ window.__ModuleLoader__.load({
255
387
  copyDeclared("keyed hook", keyedHooks, descriptor.keyedHooks, contribution.keyedHooks, finalProps);
256
388
  copyDeclared("prop", props, descriptor.props, contribution.props, finalProps);
257
389
  }
258
- const value = {
390
+ return {
259
391
  key: binding.sessionId,
260
392
  ctx: binding.ctx,
261
393
  hooks,
262
394
  keyedHooks,
263
395
  props
264
396
  };
265
- this.ctx.slots.bindStoreScope(value);
266
- return value;
267
397
  }
268
398
  materializeAbsent() {
269
399
  const hooks = {};
@@ -283,6 +413,20 @@ window.__ModuleLoader__.load({
283
413
  };
284
414
  }
285
415
  };
416
+ function createBindingSource(value) {
417
+ const source = {
418
+ value,
419
+ listeners: /* @__PURE__ */ new Set(),
420
+ getSnapshot: () => source.value,
421
+ subscribe: (listener) => {
422
+ source.listeners.add(listener);
423
+ return () => {
424
+ source.listeners.delete(listener);
425
+ };
426
+ }
427
+ };
428
+ return source;
429
+ }
286
430
  function validateContribution(descriptor, contribution) {
287
431
  rejectUndeclared("hook", descriptor.hooks, contribution.hooks);
288
432
  rejectUndeclared("keyed hook", descriptor.keyedHooks, contribution.keyedHooks);
@@ -311,19 +455,34 @@ window.__ModuleLoader__.load({
311
455
  finalProps.add(propName);
312
456
  }
313
457
  /** Required Controller and renderer services. */
314
- const inject = ["sessions", "slots"];
458
+ const inject = [
459
+ "sessions",
460
+ "slots",
461
+ "remote"
462
+ ];
315
463
  /**
316
464
  * Install the Session root source and scoped adapter.
317
465
  * @param ctx - Client Cordis context.
318
466
  */
319
467
  function apply(ctx) {
320
468
  const service = new UiSession(ctx, ctx.sessions);
321
- ctx.slots.provideRoot({ hooks: {
322
- sessions: ctx.sessions.list,
323
- sessionPendingInteraction: service.pendingInteractions
324
- } });
469
+ ctx.slots.provideRoot({
470
+ hooks: {
471
+ sessions: ctx.sessions.list,
472
+ sessionStatus: service.sessionStatus
473
+ },
474
+ keyedHooks: { sessionRetainInfo: (key) => ctx.sessions.retainInfo(key) }
475
+ });
325
476
  ctx.slots.installScope("session", service.adapter);
326
477
  }
478
+ function sameSessionStatus(left, right) {
479
+ if (left.size !== right.size) return false;
480
+ for (const [id, status] of left) {
481
+ const candidate = right.get(id);
482
+ if (candidate === void 0 || candidate.running !== status.running || candidate.pendingInteraction !== status.pendingInteraction || candidate.completionUnread !== status.completionUnread) return false;
483
+ }
484
+ return true;
485
+ }
327
486
  function samePendingInteractions(left, right) {
328
487
  if (left.size !== right.size) return false;
329
488
  for (const [sessionId, interaction] of left) if (right.get(sessionId) !== interaction) return false;