dsh-edge 0.19.0 → 0.19.3

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 (31) hide show
  1. package/THIRD_PARTY_NOTICES.md +1991 -1741
  2. package/dist/assets/index-5SrrfWpU.js +127 -0
  3. package/dist/assets/index-BPHePDI_.css +1 -0
  4. package/dist/index.html +3 -3
  5. package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +260 -20
  6. package/dist/plugins/@deepseek-ai/dsh-client-shortcuts/client.js +12 -7
  7. package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +9 -20
  8. package/dist/plugins/@deepseek-ai/dsh-client-ui-chat/client.js +90 -126
  9. package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +111 -50
  10. package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +14 -1
  11. package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +3 -3
  12. package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +216 -63
  13. package/dist/plugins/@deepseek-ai/dsh-client-ui-open-in-app/client.js +37 -23
  14. package/dist/plugins/@deepseek-ai/dsh-client-ui-plan/client.js +4 -4
  15. package/dist/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js +1 -1
  16. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +7 -7
  17. package/dist/plugins/@deepseek-ai/dsh-client-ui-shortcuts/client.js +1 -1
  18. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +10 -15
  19. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-files/client.js +9 -4
  20. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar-right/client.js +183 -156
  21. package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +1 -1
  22. package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +6 -6
  23. package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +304 -54
  24. package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +1257 -218
  25. package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +1 -1
  26. package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +3 -2
  27. package/package.json +93 -93
  28. package/worker/direct/index.js +945 -891
  29. package/worker/isolated/index.js +809 -755
  30. package/dist/assets/index-Cq6ljTv2.css +0 -1
  31. package/dist/assets/index-Dy0OhsZ5.js +0 -127
@@ -5426,38 +5426,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5426
5426
  "unavailable": "P3OORG_unavailable"
5427
5427
  };
5428
5428
  //#endregion
5429
- //#region lib/types/client/shell/close-focus.js
5430
- /** Focus continuity after page operations replace docked or floating pane elements. */
5431
- /**
5432
- * Focus the page selected by an open or split after its DOM has committed.
5433
- * @param document - product document owning the input focus.
5434
- * @param sessionId - Session whose page is opening.
5435
- * @param open - synchronous operation returning its selected pane, or undefined when unchanged.
5436
- */
5437
- function openWithPaneFocus(document, sessionId, open) {
5438
- let paneId;
5439
- (0, react_dom.flushSync)(() => {
5440
- paneId = open();
5441
- });
5442
- if (paneId !== void 0) visibleSidebarPane(document, sessionId, paneId)?.focus({ preventScroll: true });
5443
- }
5444
- /**
5445
- * Commit a focused page's removal before focusing a surviving visible pane.
5446
- * @param document - product document owning the input focus.
5447
- * @param sessionId - Session whose page is closing.
5448
- * @param paneId - pane whose page is closing; preferred if it survives.
5449
- * @param close - synchronous cleanup and layout removal; errors preserve focus.
5450
- */
5451
- function closeWithPaneFocus(document, sessionId, paneId, close) {
5452
- const before = document.activeElement;
5453
- const owner = before?.closest("[data-sidebar-right-session]");
5454
- const source = before?.closest("[data-dockkit-pane], [data-dockkit-float]");
5455
- const retain = owner?.dataset.sidebarRightSession === sessionId && (source?.dataset.dockkitPane ?? source?.dataset.dockkitFloat) === paneId;
5456
- (0, react_dom.flushSync)(close);
5457
- if (!retain || document.activeElement !== document.body && document.activeElement !== before) return;
5458
- visibleSidebarPane(document, sessionId, paneId)?.focus({ preventScroll: true });
5459
- }
5460
- //#endregion
5461
5429
  //#region lib/types/client/shell/SidebarRight.js
5462
5430
  /**
5463
5431
  * The Sidebar's seat in the frame, and the panel it draws.
@@ -5747,22 +5715,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5747
5715
  }
5748
5716
  /**
5749
5717
  * The right column's occupant: stable tab containers, docked or floating.
5750
- * It is also where the
5751
- * frame learns the panel's presentation, and where `ctx.sidebarRight` learns
5752
- * which session it is acting on, because this is the seat that knows both.
5718
+ * It is also where the frame learns the panel's presentation, because this is
5719
+ * the seat that knows it. `ctx.sidebarRight` names the on-screen Session
5720
+ * itself; this seat reports only what it renders with: the room its kit
5721
+ * measured and the automatic fullscreen rule of its frame width.
5753
5722
  */
5754
- function RightbarSeat({ sessionId, width, viewportWidth, canShow, useStore, actions, t, renderSlot, syncPresentation, bindService, openTab, closeTab, useTabTypes, useTabNavigation, occurrence, retainTab, active, useShortcuts, splitPane, toggleFullscreen }) {
5723
+ function RightbarSeat({ sessionId, width, viewportWidth, canShow, useStore, actions, t, renderSlot, syncPresentation, measureRoom, reportAutoFullscreen, openTab, closeTab, useTabTypes, useTabNavigation, occurrence, retainTab, active, useShortcuts, splitPane, toggleFullscreen }) {
5755
5724
  const shortcuts = useShortcuts((entries) => entries);
5756
- const surfaces = useStore((state) => state.bySession);
5757
- const surface = surfaces[sessionId];
5725
+ const surface = useStore((state) => state.bySession[sessionId]);
5758
5726
  const shown = active && surface !== void 0 && surface.layout.expanded;
5759
5727
  const autoFullscreen = viewportWidth < 768;
5760
5728
  const fullscreen = autoFullscreen || surface?.layout.mode === "fullscreen";
5761
5729
  const panelRef = (0, react.useRef)(null);
5762
- const room = (0, react.useRef)(/* @__PURE__ */ new Map());
5763
5730
  const reportRoom = (0, react.useCallback)((fits) => {
5764
- room.current = fits;
5765
- }, []);
5731
+ measureRoom((paneId) => fits.get(paneId)?.row !== false);
5732
+ }, [measureRoom]);
5766
5733
  const track = shown && !autoFullscreen;
5767
5734
  (0, react.useEffect)(() => {
5768
5735
  if (active && surface === void 0) actions.open(sessionId);
@@ -5781,6 +5748,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5781
5748
  fullscreen,
5782
5749
  canShow
5783
5750
  ]);
5751
+ (0, react.useLayoutEffect)(() => {
5752
+ reportAutoFullscreen(autoFullscreen);
5753
+ }, [reportAutoFullscreen, autoFullscreen]);
5784
5754
  (0, react.useLayoutEffect)(() => {
5785
5755
  if (!active) return;
5786
5756
  let disposed = false;
@@ -5816,26 +5786,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5816
5786
  fullscreen: false
5817
5787
  });
5818
5788
  } : void 0, [syncPresentation, active]);
5819
- (0, react.useEffect)(() => active ? bindService({
5820
- sessionId,
5821
- actions,
5822
- surfaces,
5823
- autoFullscreen,
5824
- closeWithFocus: (paneId, close) => {
5825
- closeWithPaneFocus(document, sessionId, paneId, close);
5826
- },
5827
- openWithFocus: (open) => {
5828
- openWithPaneFocus(document, sessionId, open);
5829
- },
5830
- canSplitPane: (paneId) => room.current.get(paneId)?.row !== false
5831
- }) : void 0, [
5832
- bindService,
5833
- sessionId,
5834
- actions,
5835
- surfaces,
5836
- autoFullscreen,
5837
- active
5838
- ]);
5839
5789
  if (surface === void 0) return null;
5840
5790
  return (0, react_jsx_runtime.jsx)(SidebarPanel, {
5841
5791
  sessionId,
@@ -5862,6 +5812,38 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5862
5812
  });
5863
5813
  }
5864
5814
  //#endregion
5815
+ //#region lib/types/client/shell/close-focus.js
5816
+ /** Focus continuity after page operations replace docked or floating pane elements. */
5817
+ /**
5818
+ * Focus the page selected by an open or split after its DOM has committed.
5819
+ * @param document - product document owning the input focus.
5820
+ * @param sessionId - Session whose page is opening.
5821
+ * @param open - synchronous operation returning its selected pane, or undefined when unchanged.
5822
+ */
5823
+ function openWithPaneFocus(document, sessionId, open) {
5824
+ let paneId;
5825
+ (0, react_dom.flushSync)(() => {
5826
+ paneId = open();
5827
+ });
5828
+ if (paneId !== void 0) visibleSidebarPane(document, sessionId, paneId)?.focus({ preventScroll: true });
5829
+ }
5830
+ /**
5831
+ * Commit a focused page's removal before focusing a surviving visible pane.
5832
+ * @param document - product document owning the input focus.
5833
+ * @param sessionId - Session whose page is closing.
5834
+ * @param paneId - pane whose page is closing; preferred if it survives.
5835
+ * @param close - synchronous cleanup and layout removal; errors preserve focus.
5836
+ */
5837
+ function closeWithPaneFocus(document, sessionId, paneId, close) {
5838
+ const before = document.activeElement;
5839
+ const owner = before?.closest("[data-sidebar-right-session]");
5840
+ const source = before?.closest("[data-dockkit-pane], [data-dockkit-float]");
5841
+ const retain = owner?.dataset.sidebarRightSession === sessionId && (source?.dataset.dockkitPane ?? source?.dataset.dockkitFloat) === paneId;
5842
+ (0, react_dom.flushSync)(close);
5843
+ if (!retain || document.activeElement !== document.body && document.activeElement !== before) return;
5844
+ visibleSidebarPane(document, sessionId, paneId)?.focus({ preventScroll: true });
5845
+ }
5846
+ //#endregion
5865
5847
  //#region lib/types/client/shell/RightbarRoot.js
5866
5848
  /** Root-scoped controller for the right Sidebar's Session content. */
5867
5849
  function SessionView({ view, visible, SessionProvider, renderSlot, mountView, width, viewportWidth, canShow }) {
@@ -6260,19 +6242,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6260
6242
  *
6261
6243
  * The surface is per session and its state lives in that session's store
6262
6244
  * instance, which the slot runtime mints per session and a root service cannot
6263
- * reach on its own. Two paths lead in. The mounted seat publishes its binding —
6264
- * session id, bound actions, its surface — for exactly as long as it is mounted,
6265
- * and every command on the public face goes through that binding; a command
6266
- * arriving with no seat mounted has no session to act on and fails loudly rather
6267
- * than writing into a surface nobody is drawing. `mounted` publishes that
6268
- * binding's session as an observable, so a consumer that wants to open content
6269
- * as soon as a seat is on screen subscribes to it instead of assuming one is
6270
- * bound when its own effect runs. And the plugin adopts each
6271
- * session's store instance as the runtime mints it, so the controller reaches
6272
- * any session's store by id and syncs the Tab domain from that store's commits.
6245
+ * reach on its own. The plugin adopts each session's store instance as the
6246
+ * runtime mints it, so the controller reaches any session's store by id and
6247
+ * syncs the Tab domain from that store's commits, on screen or not.
6248
+ *
6249
+ * The plugin also names the Session on screen — the selected Session while the
6250
+ * Conversation fills the main column — from the selection and the main panel,
6251
+ * before React renders either change, and publishes it as `mounted`. Every
6252
+ * command on the public face acts on that Session through its adopted store; a
6253
+ * command with no Session on screen, or with one whose store the runtime has not
6254
+ * minted, has nothing to act on and fails loudly rather than writing into a
6255
+ * surface nobody is drawing. The seats never publish which Session they draw:
6256
+ * they report only what they render with, the room their docking kit measured
6257
+ * and the automatic fullscreen rule of their frame width.
6273
6258
  *
6274
6259
  * A tab's own actions (`tabActions`) aim at the session the tab is in, not at
6275
- * the mounted one: they run through that session's adopted store, so a callback
6260
+ * the on-screen one: they run through that session's adopted store, so a callback
6276
6261
  * fired after the user switched sessions still lands where its tab is, and they
6277
6262
  * do nothing for a session whose store was never minted.
6278
6263
  *
@@ -6284,24 +6269,39 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6284
6269
  * hand the store one settled intent and record the navigation in the Tab
6285
6270
  * domain. Placement is the caller's option, never a type's property.
6286
6271
  *
6287
- * The registration adopts Session stores and injects the mounted seat binding;
6288
- * callers use the service's navigation methods.
6272
+ * The registration adopts Session stores, names the on-screen Session, and
6273
+ * forwards the seats' reports; callers use the service's navigation methods.
6289
6274
  */
6290
6275
  /**
6291
- * Create the public controller and the plugin-private store adoption callback.
6276
+ * Create the public controller and the plugin-private Session callbacks.
6292
6277
  * Adoption reconciles restored records before any seat renders, then follows commits.
6293
6278
  * @param tabs - registered tab types.
6294
6279
  * @param pin - resource retention for an occurrence's lifetime.
6295
- * @returns the controller and plugin-owned adoption and scope-removal callbacks.
6280
+ * @param host - the viewport rule and focus continuity the commands use.
6281
+ * @returns the controller; store adoption and scope removal; naming the on-screen Session; and recording a seat's room rule.
6296
6282
  */
6297
- function createSidebarRightController(tabs, pin) {
6283
+ function createSidebarRightController(tabs, pin, host) {
6298
6284
  const adopted = /* @__PURE__ */ new Map();
6285
+ const rooms = /* @__PURE__ */ new Map();
6286
+ const onScreen = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(void 0);
6299
6287
  const inventory = new SidebarTabInventory();
6300
- const controller = new SidebarRightController(tabs, pin, adopted, inventory.source);
6288
+ const controller = new SidebarRightController(tabs, pin, host, {
6289
+ adopted,
6290
+ rooms,
6291
+ onScreen,
6292
+ openTabs: inventory.source
6293
+ });
6301
6294
  return {
6302
6295
  controller,
6303
6296
  forget: (sessionId) => {
6304
6297
  inventory.remove(sessionId);
6298
+ rooms.delete(sessionId);
6299
+ },
6300
+ show: (sessionId) => {
6301
+ if (onScreen.getSnapshot() !== sessionId) onScreen.set(sessionId);
6302
+ },
6303
+ measure: (sessionId, canSplitPane) => {
6304
+ rooms.set(sessionId, canSplitPane);
6305
6305
  },
6306
6306
  adopt(sessionId, store) {
6307
6307
  adopted.get(sessionId)?.unsubscribe();
@@ -6328,13 +6328,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6328
6328
  /** Cross-plugin right-Sidebar face (ctx.sidebarRight). */
6329
6329
  var SidebarRightController = class {
6330
6330
  tabs;
6331
- adopted;
6331
+ host;
6332
6332
  /** Open tab metadata across saved and adopted Sessions, independent of visible seats. */
6333
6333
  openTabs;
6334
- mountedSession = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(void 0);
6335
- /** The mounted seat's session; see {@link ISidebarRight.mounted}. */
6336
- mounted = this.mountedSession;
6337
- binding;
6334
+ /** The on-screen Session; see {@link ISidebarRight.mounted}. */
6335
+ mounted;
6336
+ adopted;
6337
+ rooms;
6338
6338
  closeHandlers = /* @__PURE__ */ new Map();
6339
6339
  /**
6340
6340
  * Register resource cleanup before explicit removal. Failure preserves the tab.
@@ -6357,13 +6357,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6357
6357
  /**
6358
6358
  * @param tabs - the tab-type registry consulted to claim an address.
6359
6359
  * @param pin - `ctx.resources.pin`, which the Tab domain holds addresses with.
6360
- * @param adopted - plugin-owned session stores used by occurrence actions.
6361
- * @param openTabs - plugin-owned metadata source across saved and adopted layouts.
6360
+ * @param host - the viewport rule and focus continuity the commands use.
6361
+ * @param sessions - plugin-owned adopted stores, room rules, on-screen Session, and open tab metadata.
6362
6362
  */
6363
- constructor(tabs, pin, adopted = /* @__PURE__ */ new Map(), openTabs = new SidebarTabInventory().source) {
6363
+ constructor(tabs, pin, host, sessions) {
6364
6364
  this.tabs = tabs;
6365
- this.adopted = adopted;
6366
- this.openTabs = openTabs;
6365
+ this.host = host;
6366
+ this.adopted = sessions.adopted;
6367
+ this.rooms = sessions.rooms;
6368
+ this.mounted = sessions.onScreen;
6369
+ this.openTabs = sessions.openTabs;
6367
6370
  this.tabDomain = new TabDomain(this, pin);
6368
6371
  }
6369
6372
  /**
@@ -6375,27 +6378,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6375
6378
  return Object.values(this.adopted.get(sessionId)?.store.getSnapshot().bySession[sessionId]?.layout.tabs ?? {});
6376
6379
  }
6377
6380
  /**
6378
- * Adopt the mounted seat's binding, replacing any previous one.
6379
- *
6380
- * Called from the seat while it is mounted, and released when it leaves.
6381
- * @param binding - the mounted seat's session, actions, and the store's surfaces.
6382
- * @returns a release callback that clears exactly this binding.
6383
- */
6384
- bind(binding) {
6385
- this.binding = binding;
6386
- this.publishMounted();
6387
- return () => {
6388
- if (this.binding !== binding) return;
6389
- this.binding = void 0;
6390
- this.publishMounted();
6391
- };
6392
- }
6393
- /** Publish the mounted session only when it changes; a republished binding for the same session is silent. */
6394
- publishMounted() {
6395
- const next = this.binding?.sessionId;
6396
- if (this.mountedSession.getSnapshot() !== next) this.mountedSession.set(next);
6397
- }
6398
- /**
6399
6381
  * Open a resource: claim it, place it, reveal the column, record the navigation.
6400
6382
  * @param address - a `dsh-resource://<type>/…` address.
6401
6383
  * @param options - placement, the opening type, and navigation parameters.
@@ -6476,10 +6458,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6476
6458
  }
6477
6459
  /** The steps both opens share: one store intent, and the navigation record for the tab it settles on. */
6478
6460
  place(sessionId, actions, claim, address, placement, params) {
6479
- const surface = this.adopted.get(sessionId)?.store.getSnapshot().bySession[sessionId] ?? (this.binding?.sessionId === sessionId ? this.binding.surfaces[sessionId] : void 0);
6461
+ const surface = this.adopted.get(sessionId)?.store.getSnapshot().bySession[sessionId];
6480
6462
  const targetPane = surface === void 0 ? void 0 : placement.paneId ?? (0, _deepseek_ai_dsh_client_ui_dockkit.activeDockPaneId)(surface.layout);
6481
6463
  const target = targetPane === void 0 ? void 0 : surface?.layout.nodes[targetPane];
6482
- const preferNewPane = placement.preferNewPane === true && placement.replaceTab === void 0 && surface !== void 0 && target?.kind === "pane" && target.host === "dock" && target.tabs.length > 0 && (0, _deepseek_ai_dsh_client_ui_dockkit.canSplit)(surface.layout) && (0, _deepseek_ai_dsh_client_ui_dockkit.dockPaneIds)(surface.layout).length < 2 && this.binding?.sessionId === sessionId && this.binding.canSplitPane(target.id);
6464
+ const preferNewPane = placement.preferNewPane === true && placement.replaceTab === void 0 && surface !== void 0 && target?.kind === "pane" && target.host === "dock" && target.tabs.length > 0 && (0, _deepseek_ai_dsh_client_ui_dockkit.canSplit)(surface.layout) && (0, _deepseek_ai_dsh_client_ui_dockkit.dockPaneIds)(surface.layout).length < 2 && this.mounted.getSnapshot() === sessionId && this.canSplitPane(sessionId, target.id);
6483
6465
  const commit = () => {
6484
6466
  actions.openContent(sessionId, {
6485
6467
  kind: claim.kind,
@@ -6506,20 +6488,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6506
6488
  this.removeAfterCleanup(sessionId, replaced, commit);
6507
6489
  }
6508
6490
  /**
6509
- * Close one tab of the mounted session; the sole docked guide remains open.
6491
+ * Close one tab of the on-screen Session; the sole docked guide remains open.
6510
6492
  * @param tabId - the tab to close.
6511
6493
  */
6512
6494
  close(tabId) {
6513
- const { sessionId, actions } = this.require();
6514
- if (this.adopted.has(sessionId)) {
6515
- this.closeIn(sessionId, tabId);
6516
- return;
6517
- }
6518
- actions.closeTab(sessionId, tabId);
6495
+ this.closeIn(this.require().sessionId, tabId);
6519
6496
  }
6520
6497
  /**
6521
6498
  * The active tab of the active pane.
6522
- * @returns the record, or `undefined` with no mounted surface.
6499
+ * @returns the record, or `undefined` without an on-screen surface.
6523
6500
  */
6524
6501
  active() {
6525
6502
  const layout = this.mountedSurface()?.layout;
@@ -6529,15 +6506,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6529
6506
  }
6530
6507
  /**
6531
6508
  * Whether the column is currently showing its panel.
6532
- * @returns `true` while expanded; `false` while collapsed or with no mounted surface.
6509
+ * @returns `true` while expanded; `false` while collapsed or without an on-screen surface.
6533
6510
  */
6534
6511
  isExpanded() {
6535
6512
  return this.mountedSurface()?.layout.expanded ?? false;
6536
6513
  }
6537
6514
  /** Collapse the column, or expand it and focus its active dock pane after rendering. */
6538
6515
  toggleExpanded() {
6539
- const { sessionId, actions, openWithFocus } = this.require();
6540
- openWithFocus(() => {
6516
+ const { sessionId, actions } = this.require();
6517
+ this.host.openWithFocus(sessionId, () => {
6541
6518
  actions.toggleExpanded(sessionId);
6542
6519
  const layout = this.mountedSurface()?.layout;
6543
6520
  return layout?.expanded ? (0, _deepseek_ai_dsh_client_ui_dockkit.activeDockPaneId)(layout) : void 0;
@@ -6558,26 +6535,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6558
6535
  * @returns current focused page identity, or undefined outside a visible sidebar page.
6559
6536
  */
6560
6537
  focusedTarget(element = document.activeElement) {
6561
- const binding = this.binding;
6562
- const surface = this.mountedSurface();
6563
- return binding === void 0 || surface === void 0 ? void 0 : sidebarTargetFromElement(element, binding.sessionId, surface.layout, (tabId) => this.tabDomain.occurrence(binding.sessionId, { id: tabId }));
6538
+ const screen = this.screen();
6539
+ return screen === void 0 ? void 0 : sidebarTargetFromElement(element, screen.sessionId, screen.surface.layout, (tabId) => this.tabDomain.occurrence(screen.sessionId, { id: tabId }));
6564
6540
  }
6565
6541
  /**
6566
- * Choose a focused sidebar pane, or the mounted Session's active dock pane for an outside open.
6542
+ * Choose a focused sidebar pane, or the on-screen Session's active dock pane for an outside open.
6567
6543
  * @param element - live command input target; stale sidebar markup never falls back to another pane.
6568
- * @returns captured target, or undefined without a mounted Session.
6544
+ * @returns captured target, or undefined without an on-screen surface.
6569
6545
  */
6570
6546
  commandTarget(element = document.activeElement) {
6571
6547
  const focused = this.focusedTarget(element);
6572
6548
  if (focused !== void 0 || element?.closest("[data-sidebar-right-session]")) return focused;
6573
- const binding = this.binding;
6574
- const layout = this.mountedSurface()?.layout;
6575
- if (binding === void 0 || layout === void 0) return void 0;
6549
+ const screen = this.screen();
6550
+ if (screen === void 0) return void 0;
6551
+ const { sessionId, surface: { layout } } = screen;
6576
6552
  const pane = (0, _deepseek_ai_dsh_client_ui_dockkit.getPane)(layout, (0, _deepseek_ai_dsh_client_ui_dockkit.activeDockPaneId)(layout));
6577
6553
  const tabId = pane.activeTabId;
6578
- const held = tabId === void 0 ? void 0 : this.tabDomain.occurrence(binding.sessionId, { id: tabId });
6554
+ const held = tabId === void 0 ? void 0 : this.tabDomain.occurrence(sessionId, { id: tabId });
6579
6555
  return {
6580
- sessionId: binding.sessionId,
6556
+ sessionId,
6581
6557
  paneId: pane.id,
6582
6558
  host: pane.host,
6583
6559
  tabId,
@@ -6592,10 +6568,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6592
6568
  */
6593
6569
  openTabFromTarget(kind, target) {
6594
6570
  if (!this.isTargetCurrent(target)) return;
6595
- this.require().openWithFocus(() => {
6571
+ const { sessionId, actions } = this.require();
6572
+ this.host.openWithFocus(sessionId, () => {
6596
6573
  const tab = target.tabId === void 0 ? void 0 : this.mountedSurface()?.layout.tabs[target.tabId];
6597
6574
  if (target.host === "float" && tab?.kind === kind && this.tabs.get(kind)?.multiple !== true) {
6598
- this.require().actions.setExpanded(target.sessionId, true);
6575
+ actions.setExpanded(sessionId, true);
6599
6576
  this.focus(tab.id);
6600
6577
  } else this.openTab(kind, {
6601
6578
  ...target.host === "dock" ? { paneId: target.paneId } : {},
@@ -6623,20 +6600,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6623
6600
  const surface = this.mountedSurface();
6624
6601
  if (surface === void 0 || target.tabId === void 0) return "unavailable";
6625
6602
  const tabId = target.tabId;
6626
- const binding = this.require();
6627
- binding.closeWithFocus(target.paneId, () => {
6603
+ const { sessionId, actions } = this.require();
6604
+ this.host.closeWithFocus(sessionId, target.paneId, () => {
6628
6605
  if (canCloseTab(surface, tabId)) this.close(tabId);
6629
- else binding.actions.setExpanded(target.sessionId, false);
6606
+ else actions.setExpanded(sessionId, false);
6630
6607
  });
6631
6608
  return "closed";
6632
6609
  }
6633
6610
  /**
6634
6611
  * Check a captured target before acting, including reopened records and intervening navigation.
6635
6612
  * @param target - identity captured while resolving the input.
6636
- * @returns whether the mounted Session, pane, tab lifetime and navigation still match.
6613
+ * @returns whether the on-screen Session, pane, tab lifetime and navigation still match.
6637
6614
  */
6638
6615
  isTargetCurrent(target) {
6639
- if (this.binding?.sessionId !== target.sessionId) return false;
6616
+ if (this.mounted.getSnapshot() !== target.sessionId) return false;
6640
6617
  const layout = this.mountedSurface()?.layout;
6641
6618
  const pane = layout?.nodes[target.paneId];
6642
6619
  if (pane?.kind !== "pane" || pane.host !== target.host) return false;
@@ -6658,7 +6635,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6658
6635
  if (!layout.expanded) return "collapsed";
6659
6636
  if ((0, _deepseek_ai_dsh_client_ui_dockkit.getPane)(layout, target.paneId).tabs.length === 0) return "empty";
6660
6637
  if (!(0, _deepseek_ai_dsh_client_ui_dockkit.canSplit)(layout) || (0, _deepseek_ai_dsh_client_ui_dockkit.dockPaneIds)(layout).length >= 2) return "budget";
6661
- if (!this.require().canSplitPane(target.paneId)) return "width";
6638
+ if (!this.canSplitPane(target.sessionId, target.paneId)) return "width";
6662
6639
  }
6663
6640
  /**
6664
6641
  * Toggle the right panel's display mode through the same action as its chrome button.
@@ -6666,9 +6643,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6666
6643
  */
6667
6644
  toggleFullscreen(target) {
6668
6645
  if (!this.isTargetCurrent(target) || target.host === "float" || !this.isExpanded()) return;
6669
- const { sessionId, actions, autoFullscreen } = this.require();
6670
- const fullscreen = autoFullscreen === true || this.mountedSurface()?.layout.mode === "fullscreen";
6671
- if (fullscreen && autoFullscreen === true) actions.setExpanded(sessionId, false);
6646
+ const { sessionId, actions } = this.require();
6647
+ const autoFullscreen = this.host.autoFullscreen();
6648
+ const fullscreen = autoFullscreen || this.mountedSurface()?.layout.mode === "fullscreen";
6649
+ if (fullscreen && autoFullscreen) actions.setExpanded(sessionId, false);
6672
6650
  actions.setMode(sessionId, fullscreen ? "push" : "fullscreen");
6673
6651
  }
6674
6652
  /**
@@ -6677,15 +6655,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6677
6655
  * @returns the new pane's id, or `undefined` when nothing was split.
6678
6656
  */
6679
6657
  split(paneId) {
6680
- const { sessionId, actions, canSplitPane } = this.require();
6658
+ const { sessionId, actions } = this.require();
6681
6659
  const layout = this.mountedSurface()?.layout;
6682
6660
  if (layout === void 0) return void 0;
6683
6661
  const target = paneId ?? (0, _deepseek_ai_dsh_client_ui_dockkit.activeDockPaneId)(layout);
6684
6662
  const node = layout.nodes[target];
6685
6663
  if (node === void 0 || node.kind !== "pane" || node.host !== "dock") return void 0;
6686
- if (!(0, _deepseek_ai_dsh_client_ui_dockkit.canSplit)(layout) || (0, _deepseek_ai_dsh_client_ui_dockkit.dockPaneIds)(layout).length >= 2 || !canSplitPane(target)) return void 0;
6664
+ if (!(0, _deepseek_ai_dsh_client_ui_dockkit.canSplit)(layout) || (0, _deepseek_ai_dsh_client_ui_dockkit.dockPaneIds)(layout).length >= 2 || !this.canSplitPane(sessionId, target)) return void 0;
6687
6665
  let created;
6688
- this.require().openWithFocus(() => {
6666
+ this.host.openWithFocus(sessionId, () => {
6689
6667
  actions.splitPane(sessionId, target, (id) => {
6690
6668
  created = id;
6691
6669
  });
@@ -6716,7 +6694,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6716
6694
  actions.unfloatPane(sessionId, paneId);
6717
6695
  }
6718
6696
  /**
6719
- * Step the mounted session's surface back one intent.
6697
+ * Step the on-screen Session's surface back one intent.
6720
6698
  *
6721
6699
  * @internal Not part of the product: the sequence is an architectural fact
6722
6700
  * with no user-facing control yet. Kept reachable for tests.
@@ -6726,7 +6704,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6726
6704
  actions.undo(sessionId);
6727
6705
  }
6728
6706
  /**
6729
- * Step the mounted session's surface forward one intent.
6707
+ * Step the on-screen Session's surface forward one intent.
6730
6708
  *
6731
6709
  * @internal See `_undo`.
6732
6710
  */
@@ -6734,10 +6712,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6734
6712
  const { sessionId, actions } = this.require();
6735
6713
  actions.redo(sessionId);
6736
6714
  }
6737
- /** The mounted session's surface; `undefined` without a seat or before its first open. */
6715
+ /**
6716
+ * The on-screen Session and its committed surface; `undefined` with no Session
6717
+ * on screen, before the runtime mints its store, or before its first open.
6718
+ */
6719
+ screen() {
6720
+ const sessionId = this.mounted.getSnapshot();
6721
+ if (sessionId === void 0) return void 0;
6722
+ const surface = this.adopted.get(sessionId)?.store.getSnapshot().bySession[sessionId];
6723
+ return surface === void 0 ? void 0 : {
6724
+ sessionId,
6725
+ surface
6726
+ };
6727
+ }
6728
+ /** The on-screen Session's surface; see {@link SidebarRightController.screen}. */
6738
6729
  mountedSurface() {
6739
- const { binding } = this;
6740
- return binding === void 0 ? void 0 : this.adopted.get(binding.sessionId)?.store.getSnapshot().bySession[binding.sessionId] ?? binding.surfaces[binding.sessionId];
6730
+ return this.screen()?.surface;
6731
+ }
6732
+ /** Whether a Session's docked pane has room for two working halves, as its seat last measured; unmeasured panes do. */
6733
+ canSplitPane(sessionId, paneId) {
6734
+ return this.rooms.get(sessionId)?.(paneId) ?? true;
6741
6735
  }
6742
6736
  /**
6743
6737
  * The store actions a tab's own action on `sessionId` runs through: that
@@ -6748,8 +6742,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6748
6742
  return this.adopted.get(sessionId)?.store.actions;
6749
6743
  }
6750
6744
  require() {
6751
- if (this.binding === void 0) throw new Error("sidebarRight: no session surface is mounted");
6752
- return this.binding;
6745
+ const sessionId = this.mounted.getSnapshot();
6746
+ const actions = sessionId === void 0 ? void 0 : this.actionsFor(sessionId);
6747
+ if (sessionId === void 0 || actions === void 0) throw new Error("sidebarRight: no session surface is mounted");
6748
+ return {
6749
+ sessionId,
6750
+ actions
6751
+ };
6753
6752
  }
6754
6753
  };
6755
6754
  //#endregion
@@ -9044,9 +9043,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9044
9043
  views.dispose();
9045
9044
  };
9046
9045
  }, "ui-sidebar-right: retained Session views");
9047
- const { controller, adopt, forget } = createSidebarRightController(tabs, (address, signal) => {
9046
+ const layout = ctx.layout;
9047
+ let autoFullscreen = false;
9048
+ const { controller, adopt, forget, show, measure } = createSidebarRightController(tabs, (address, signal) => {
9048
9049
  ctx.resources.pin(address, signal);
9050
+ }, {
9051
+ autoFullscreen: () => autoFullscreen,
9052
+ openWithFocus: (sessionId, open) => {
9053
+ openWithPaneFocus(document, sessionId, open);
9054
+ },
9055
+ closeWithFocus: (sessionId, paneId, close) => {
9056
+ closeWithPaneFocus(document, sessionId, paneId, close);
9057
+ }
9049
9058
  });
9059
+ ctx.effect(() => {
9060
+ const sync = () => {
9061
+ const selected = views.source.getSnapshot().find((view) => view.selected);
9062
+ show(layout.panelInfo.getSnapshot().activePanelId === null ? selected?.sessionId : void 0);
9063
+ };
9064
+ const unsubscribeViews = views.source.subscribe(sync);
9065
+ const unsubscribePanel = layout.panelInfo.subscribe(sync);
9066
+ sync();
9067
+ return () => {
9068
+ unsubscribeViews();
9069
+ unsubscribePanel();
9070
+ show(void 0);
9071
+ };
9072
+ }, "ui-sidebar-right: on-screen Session");
9050
9073
  const disposeRegistry = ctx.reflect.provide("sidebarRightTabs", tabs);
9051
9074
  const disposeService = ctx.reflect.provide("sidebarRight", controller);
9052
9075
  ctx.effect(() => () => {
@@ -9085,13 +9108,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9085
9108
  };
9086
9109
  }
9087
9110
  };
9088
- const layout = ctx.layout;
9089
9111
  const injected = {
9090
9112
  syncPresentation({ shown, track, fullscreen }) {
9091
9113
  if (shown) layout.openRightbar(track, fullscreen);
9092
9114
  else layout.closeRightbar();
9093
9115
  },
9094
- bindService: (binding) => controller.bind(binding),
9116
+ reportAutoFullscreen: (value) => {
9117
+ autoFullscreen = value;
9118
+ },
9095
9119
  splitPane: (paneId) => {
9096
9120
  controller.split(paneId);
9097
9121
  },
@@ -9145,6 +9169,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9145
9169
  store,
9146
9170
  inject: (sessionId) => ({
9147
9171
  ...injected,
9172
+ measureRoom: (canSplitPane) => {
9173
+ measure(sessionId, canSplitPane);
9174
+ },
9148
9175
  closeTab: (tabId) => {
9149
9176
  try {
9150
9177
  controller.closeIn(sessionId, tabId);
@@ -66,7 +66,7 @@ window.__ModuleLoader__.load({
66
66
  }
67
67
  //#endregion
68
68
  //#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-skill/src/client/SkillRow.module.css.mjs
69
- const css = ".iWrAna_card{flex-direction:column;display:flex}.iWrAna_row{height:calc(24px + var(--dsh-content-font-delta,0px));align-items:center;min-width:0;display:flex;position:relative;overflow:hidden}.iWrAna_row[data-expandable]{cursor:pointer}.iWrAna_leading{width:calc(16px + var(--dsh-content-font-delta,0px));height:calc(16px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex;position:relative}.iWrAna_leading svg{width:calc(14px + var(--dsh-content-font-delta,0px));height:calc(14px + var(--dsh-content-font-delta,0px))}.iWrAna_chevron{color:var(--dsw-alias-label-secondary)}.iWrAna_iconIdle{opacity:1;transition:opacity .1s;display:inline-flex}.iWrAna_chevronHover{opacity:0;margin:auto;transition:opacity .1s;position:absolute;inset:0}.iWrAna_row:hover .iWrAna_iconIdle{opacity:0}.iWrAna_row:hover .iWrAna_chevronHover{opacity:1}.iWrAna_title{font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-secondary);flex:none}.iWrAna_separator{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}.iWrAna_summary{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-tertiary);flex:auto;overflow:hidden}.iWrAna_errorSummary{color:var(--dsw-alias-state-error-primary)}.iWrAna_stoppedSummary{color:var(--dsw-alias-state-warn-label)}.iWrAna_bodyWrap{flex-direction:column;display:flex}.iWrAna_instructionsCard{border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-markdown-code-block);flex-direction:column;max-height:260px;margin:4px 0 4px 4px;display:flex;overflow:hidden}.iWrAna_instructionsHeader{border-bottom:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-markdown-code-block-banner);color:var(--dsw-alias-label-caption);text-transform:uppercase;letter-spacing:.04em;flex:none;padding:8px 12px;font-size:11px;font-weight:500;line-height:16px}.iWrAna_instructions{white-space:pre-wrap;overflow-wrap:anywhere;min-height:0;font:var(--dsw-font-markdown-code-block-small);color:var(--dsw-alias-label-secondary);margin:0;padding:10px 12px 12px;overflow:auto}.iWrAna_instructions[data-error]{color:var(--dsw-alias-state-error-primary)}.iWrAna_instructions::-webkit-scrollbar-thumb{border-radius:var(--dsw-radius-sm);background-clip:padding-box;border:2px solid #0000}.iWrAna_instructions::-webkit-scrollbar-track{margin:6px 0}.iWrAna_inspectButton{border:.5px solid var(--dsw-alias-border-l4);corner-shape:round;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);cursor:pointer;opacity:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin:4px 0 2px 4px;padding:2px 8px;font-size:11px;line-height:16px;transition:opacity .1s;display:inline-flex}.iWrAna_card:hover .iWrAna_inspectButton,.iWrAna_inspectButton:focus-visible{opacity:1}.iWrAna_inspectButton:hover{background:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}.iWrAna_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.iWrAna_iconIdle,.iWrAna_chevronHover,.iWrAna_inspectButton{transition:none}}";
69
+ const css = ".iWrAna_card{flex-direction:column;display:flex}.iWrAna_row{height:calc(24px + var(--dsh-content-font-delta,0px));min-width:0;color:var(--dsw-alias-label-tertiary);align-items:center;transition:color .1s;display:flex;position:relative;overflow:hidden}.iWrAna_row:hover{color:var(--dsw-alias-label-secondary)}.iWrAna_row[data-expandable]{cursor:pointer}.iWrAna_leading{width:calc(16px + var(--dsh-content-font-delta,0px));height:calc(16px + var(--dsh-content-font-delta,0px));color:inherit;flex:none;justify-content:center;align-items:center;margin-right:6px;display:inline-flex;position:relative}.iWrAna_leading svg{width:calc(14px + var(--dsh-content-font-delta,0px));height:calc(14px + var(--dsh-content-font-delta,0px))}.iWrAna_chevron{color:inherit}.iWrAna_iconIdle{opacity:1;transition:opacity .1s;display:inline-flex}.iWrAna_chevronHover{opacity:0;margin:auto;transition:opacity .1s;position:absolute;inset:0}.iWrAna_row:hover .iWrAna_iconIdle{opacity:0}.iWrAna_row:hover .iWrAna_chevronHover{opacity:1}.iWrAna_title{font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));flex:none}.iWrAna_separator{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}.iWrAna_summary{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));flex:auto;overflow:hidden}.iWrAna_errorSummary{color:var(--dsw-alias-state-error-primary)}.iWrAna_stoppedSummary{color:var(--dsw-alias-state-warn-label)}.iWrAna_bodyWrap{flex-direction:column;display:flex}.iWrAna_instructionsCard{border:.5px solid var(--dsw-alias-border-l1);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-markdown-code-block);flex-direction:column;max-height:260px;margin:4px 0 4px 4px;display:flex;overflow:hidden}.iWrAna_instructionsHeader{border-bottom:.5px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-markdown-code-block-banner);color:var(--dsw-alias-label-caption);text-transform:uppercase;letter-spacing:.04em;flex:none;padding:8px 12px;font-size:11px;font-weight:500;line-height:16px}.iWrAna_instructions{white-space:pre-wrap;overflow-wrap:anywhere;min-height:0;font:var(--dsw-font-markdown-code-block-small);color:var(--dsw-alias-label-secondary);margin:0;padding:10px 12px 12px;overflow:auto}.iWrAna_instructions[data-error]{color:var(--dsw-alias-state-error-primary)}.iWrAna_instructions::-webkit-scrollbar-thumb{border-radius:var(--dsw-radius-sm);background-clip:padding-box;border:2px solid #0000}.iWrAna_instructions::-webkit-scrollbar-track{margin:6px 0}.iWrAna_inspectButton{border:.5px solid var(--dsw-alias-border-l4);corner-shape:round;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-secondary);cursor:pointer;opacity:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin:4px 0 2px 4px;padding:2px 8px;font-size:11px;line-height:16px;transition:opacity .1s;display:inline-flex}.iWrAna_card:hover .iWrAna_inspectButton,.iWrAna_inspectButton:focus-visible{opacity:1}.iWrAna_inspectButton:hover{background:var(--dsw-alias-interactive-bg-hover-solid);color:var(--dsw-alias-label-primary)}.iWrAna_visuallyHidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.iWrAna_row,.iWrAna_iconIdle,.iWrAna_chevronHover,.iWrAna_inspectButton{transition:none}}";
70
70
  const tagId = "@deepseek-ai/dsh-client-ui-skill/SkillRow.module.css";
71
71
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
72
72
  const tag = document.createElement("style");