@deepseek-insight/dsi 0.5.31 → 0.5.32

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 (77) hide show
  1. package/build/client/_app/immutable/assets/0.BU1D48E8.css +2 -0
  2. package/build/client/_app/immutable/chunks/DBe02xXt.js +1 -0
  3. package/build/client/_app/immutable/chunks/{CgNCitGK.js → DU8_fdC7.js} +2 -2
  4. package/build/client/_app/immutable/chunks/kgRREf9p.js +1 -0
  5. package/build/client/_app/immutable/chunks/{2on6iyc3.js → n6wHvlqG.js} +1 -1
  6. package/build/client/_app/immutable/entry/{app.CQmyDBAG.js → app.DbINeXv9.js} +2 -2
  7. package/build/client/_app/immutable/entry/start.CfKDOfK5.js +1 -0
  8. package/build/client/_app/immutable/nodes/{1.BZc7zU_C.js → 1.CgN4qkEI.js} +1 -1
  9. package/build/client/_app/immutable/nodes/2.D-rt0knM.js +174 -0
  10. package/build/client/_app/version.json +1 -1
  11. package/build/handler.js +4 -4
  12. package/build/index.js +4 -4
  13. package/build/server/chunks/chunks/{db.js-BTsRdpsi.js → db.js-BylhmazO.js} +2 -2
  14. package/build/server/chunks/chunks/{db2.js-ou6Vlz7O.js → db2.js-BDE3IYQf.js} +2 -2
  15. package/build/server/chunks/chunks/{dsh-connection.js-DawPog_I.js → dsh-connection.js-BSzUs8-n.js} +2 -2
  16. package/build/server/chunks/chunks/{git-probe.js-D5q52JMr.js → git-probe.js-DoWgYcXG.js} +2 -2
  17. package/build/server/chunks/chunks/{insight-config.js-DiF58x83.js → insight-config.js-XUD5BN0g.js} +6 -3
  18. package/build/server/chunks/chunks/{internal.js-BtKbXGxV.js → internal.js-DFJpTf_o.js} +2 -2
  19. package/build/server/chunks/chunks/{state.js-DO4TvfeY.js → state.js-CpGQrOQj.js} +2 -2
  20. package/build/server/chunks/chunks/{watcher.js-BJlOJaBs.js → watcher.js-ZBFDj7d0.js} +4 -4
  21. package/build/server/chunks/entries/endpoints/api/a2a/_id_/{_server.ts.js-CDJ0OmUG.js → _server.ts.js-DQenu1Rx.js} +3 -3
  22. package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-BVFSRjvv.js → _server.ts.js-C12q5Acf.js} +5 -5
  23. package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-Bhou8F5X.js → _server.ts.js-CdMcLL0n.js} +5 -5
  24. package/build/server/chunks/entries/endpoints/api/config/{_server.ts.js-BJIzdaiA.js → _server.ts.js-CeSzWmzO.js} +3 -3
  25. package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-C6n_idy7.js → _server.ts.js-BJMlDa_R.js} +3 -3
  26. package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-DADH8M-H.js → _server.ts.js-C5xgupWg.js} +3 -3
  27. package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-bC_NLj4U.js → _server.ts.js-DG0cxf9Y.js} +3 -3
  28. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-CoScceI5.js → _server.ts.js-CjIzvUMY.js} +3 -3
  29. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-C1FgtncS.js → _server.ts.js-DqvT86T0.js} +3 -3
  30. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-PIxDn234.js → _server.ts.js-BzBZnI3P.js} +3 -3
  31. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-B_CRf61I.js → _server.ts.js-DHWvuiKn.js} +3 -3
  32. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-DGGUjpY9.js → _server.ts.js-ARtFWpnE.js} +3 -3
  33. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-xEVeT3pb.js → _server.ts.js-rH3qhAct.js} +3 -3
  34. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-Df8t4hkX.js → _server.ts.js-D_fm0cJY.js} +3 -3
  35. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-CH1L9p8z.js → _server.ts.js-BqpeQTZq.js} +3 -3
  36. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-BvG76FMN.js → _server.ts.js-CHKAkZEq.js} +3 -3
  37. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/path/{_server.ts.js-t8Oiyikl.js → _server.ts.js-DxiKkvE-.js} +2 -2
  38. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-C7fokwxa.js → _server.ts.js-DmjKvFqc.js} +3 -3
  39. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-Cfm2eSa-.js → _server.ts.js-N1651orW.js} +3 -3
  40. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-DJ3WSBOS.js → _server.ts.js-w1dYBirS.js} +3 -3
  41. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-B8lDX-zk.js → _server.ts.js-Bwb62OTc.js} +3 -3
  42. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-DCKvoONe.js → _server.ts.js-D2BCSITG.js} +3 -3
  43. package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-Bl4xBKoB.js → _server.ts.js-t_DpnCyJ.js} +3 -3
  44. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js--FCZv4Np.js → _server.ts.js-BddU8qpx.js} +3 -3
  45. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file-bytes/{_server.ts.js-DEUnD1Mn.js → _server.ts.js-Di_7wqCI.js} +3 -3
  46. package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-BiHVvbW-.js → _server.ts.js-DPz9GQJJ.js} +3 -3
  47. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-CcDE1rk8.js → _server.ts.js-C1jO88hY.js} +3 -3
  48. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-C8vdE5Jr.js → _server.ts.js-C1akVoP3.js} +3 -3
  49. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-C9cgB8t0.js → _server.ts.js-C4RkBuGZ.js} +3 -3
  50. package/build/server/chunks/entries/endpoints/api/prompts/_id_/{_server.ts.js-oR6Qu-Wa.js → _server.ts.js-jiY6dVD-.js} +3 -3
  51. package/build/server/chunks/entries/endpoints/api/prompts/{_server.ts.js-j8TNOmk3.js → _server.ts.js-C0r4Wyxc.js} +3 -3
  52. package/build/server/chunks/entries/endpoints/api/prompts/use/{_server.ts.js-B6UZ2HZ5.js → _server.ts.js-wKxhb4I-.js} +3 -3
  53. package/build/server/chunks/entries/endpoints/api/settings/{_server.ts.js-BWE38_9X.js → _server.ts.js-DmU2MBc5.js} +2 -2
  54. package/build/server/chunks/entries/endpoints/api/terminal/{_server.ts.js-CmM-ksLQ.js → _server.ts.js-DHhod6dT.js} +4 -2
  55. package/build/server/chunks/entries/endpoints/api/workspace/file-write/{_server.ts.js-1pMekv7y.js → _server.ts.js-D1gyOGEM.js} +4 -4
  56. package/build/server/chunks/entries/endpoints/api/workspace/git-events/{_server.ts.js-Cwebkv8Y.js → _server.ts.js-D5XlAzdL.js} +4 -4
  57. package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/{_server.ts.js-4JF7UGE-.js → _server.ts.js-BKJbQR9z.js} +4 -4
  58. package/build/server/chunks/entries/endpoints/api/workspace/git-map/{_server.ts.js-B5i8ziTR.js → _server.ts.js-CehoxXA_.js} +4 -4
  59. package/build/server/chunks/entries/endpoints/api/workspace/git-status/{_server.ts.js-zYBj_jzG.js → _server.ts.js-DMhaSADa.js} +4 -4
  60. package/build/server/chunks/entries/endpoints/api/workspace/write-gate/{_server.ts.js-BbgR18Zo.js → _server.ts.js-BQRvPo9G.js} +4 -4
  61. package/build/server/chunks/entries/pages/{_error.svelte.js-BppCLlQz.js → _error.svelte.js-D1ggHK75.js} +3 -3
  62. package/build/server/chunks/entries/pages/{_page.server.ts.js-CNmIVlOY.js → _page.server.ts.js-C3_-EdaG.js} +2 -2
  63. package/build/server/chunks/entries/pages/{_page.svelte.js-B26jgDy0.js → _page.svelte.js-C-gx9imA.js} +322 -24
  64. package/build/server/chunks/{handler-H035jucs.js → handler-C-ZkJfQi.js} +3 -3
  65. package/build/server/chunks/{index.js-BwOnKfpd.js → index.js-BHhoIUPw.js} +2 -2
  66. package/build/server/chunks/{manifest.js-DSGtd5rA.js → manifest.js-DkA6N6z6.js} +45 -45
  67. package/build/server/chunks/nodes/{0.js--kZVi_Mf.js → 0.js-CWZQcgo6.js} +3 -3
  68. package/build/server/chunks/nodes/1.js-7HAwHjCf.js +9 -0
  69. package/build/server/chunks/nodes/{2.js-Bws89uBE.js → 2.js-CTiax7zN.js} +6 -6
  70. package/package.json +1 -1
  71. package/build/client/_app/immutable/assets/0.CeQisprJ.css +0 -2
  72. package/build/client/_app/immutable/chunks/3oS6cDzS.js +0 -1
  73. package/build/client/_app/immutable/chunks/BG5jnpAS.js +0 -1
  74. package/build/client/_app/immutable/entry/start.CX9hkEBk.js +0 -1
  75. package/build/client/_app/immutable/nodes/2.Bl8zOReA.js +0 -174
  76. package/build/server/chunks/nodes/1.js-CyCPH90h.js +0 -9
  77. /package/build/client/_app/immutable/nodes/{0.CioJu6OT.js → 0.ze9O6tWo.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { c as onDestroy, d as __exportAll } from '../../chunks/internal.js-BtKbXGxV.js';
1
+ import { c as onDestroy, d as __exportAll } from '../../chunks/internal.js-DFJpTf_o.js';
2
2
  import { V as head, y as derived, X as bind_props, W as escape_html, Y as attr, Z as attr_style, _ as attr_class, x as setContext, $ as spread_props, a0 as attributes, a1 as clsx, a2 as ensure_array_like, a3 as element, J as getContext, a4 as stringify, a5 as html, F as run, a6 as props_id } from '../../chunks/server.js-11-pxAWV.js';
3
3
  import { U as UI_LOCALES } from '../../chunks/config.js-B0w1-uCA.js';
4
4
  import { m as mergeEntries, c as collapseSystemPromptEntries, t as truncate } from '../../chunks/dsh-events.js-DEZgATm-.js';
@@ -7,7 +7,7 @@ import { b as applyKnobEvent, E as EMPTY_KNOBS, r as resolvePermission, l as loc
7
7
  import { D as DEFAULT_IMAGE_LIMITS } from '../../chunks/image-limits.js-CUdJ0f7r.js';
8
8
  import { a as appConfig, t as triggerMode, g as getTrigger, p as previewSegments, i as isValidTagWord, b as textPreviewOf, s as searchKey, c as shouldRecordPrompt, d as parseTagWords } from '../../chunks/app-config.svelte.js-BBPHOX4N.js';
9
9
  import { c as getLocale } from '../../chunks/runtime.js-CCJi3XaY.js';
10
- import { p as page, a as afterNavigate, t, c as replaceState, e as currentLocale, u as unexpectederror1, s as sessionnotfound2, r as reapednote1, d as dshunreachable1, b as backtoworkspace2 } from '../../chunks/state.js-DO4TvfeY.js';
10
+ import { p as page, a as afterNavigate, t, c as replaceState, e as currentLocale, u as unexpectederror1, s as sessionnotfound2, r as reapednote1, d as dshunreachable1, b as backtoworkspace2 } from '../../chunks/state.js-CpGQrOQj.js';
11
11
  import 'yaml';
12
12
  import 'html-to-image';
13
13
  import hljs from 'highlight.js/lib/core';
@@ -10870,6 +10870,38 @@ var terminalpaneltitle2 = ((inputs = {}, options = {}) => {
10870
10870
  return en_terminalpaneltitle2();
10871
10871
  });
10872
10872
  //#endregion
10873
+ //#region src/lib/paraglide/messages/terminalsessioncap2.js
10874
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
10875
+ /** @typedef {{}} Terminalsessioncap2Inputs */
10876
+ var en_terminalsessioncap2 = () => {
10877
+ return `Session cap reached — close a terminal to open another.`;
10878
+ };
10879
+ var zh_terminalsessioncap2 = () => {
10880
+ return `已达会话上限 — 请先关闭一个终端。`;
10881
+ };
10882
+ var id_terminalsessioncap2 = () => {
10883
+ return `Batas sesi tercapai — tutup satu terminal untuk membuka yang lain.`;
10884
+ };
10885
+ var es_terminalsessioncap2 = () => {
10886
+ return `Límite de sesiones alcanzado — cierra una terminal para abrir otra.`;
10887
+ };
10888
+ /**
10889
+ * | output |
10890
+ * | --- |
10891
+ * | "Session cap reached — close a terminal to open another." |
10892
+ *
10893
+ * @param {Terminalsessioncap2Inputs} inputs
10894
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
10895
+ * @returns {LocalizedString}
10896
+ */
10897
+ var terminalsessioncap2 = ((inputs = {}, options = {}) => {
10898
+ const locale = options.locale ?? getLocale();
10899
+ if (locale === "zh") return zh_terminalsessioncap2();
10900
+ if (locale === "id") return id_terminalsessioncap2();
10901
+ if (locale === "es") return es_terminalsessioncap2();
10902
+ return en_terminalsessioncap2();
10903
+ });
10904
+ //#endregion
10873
10905
  //#region src/lib/paraglide/messages/terminalsettleinferredidle3.js
10874
10906
  /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
10875
10907
  /** @typedef {{}} Terminalsettleinferredidle3Inputs */
@@ -10998,6 +11030,38 @@ var terminalsettletimeout2 = ((inputs = {}, options = {}) => {
10998
11030
  return en_terminalsettletimeout2();
10999
11031
  });
11000
11032
  //#endregion
11033
+ //#region src/lib/paraglide/messages/terminaltabclose2.js
11034
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
11035
+ /** @typedef {{}} Terminaltabclose2Inputs */
11036
+ var en_terminaltabclose2 = () => {
11037
+ return `Close tab`;
11038
+ };
11039
+ var zh_terminaltabclose2 = () => {
11040
+ return `关闭标签页`;
11041
+ };
11042
+ var id_terminaltabclose2 = () => {
11043
+ return `Tutup tab`;
11044
+ };
11045
+ var es_terminaltabclose2 = () => {
11046
+ return `Cerrar pestaña`;
11047
+ };
11048
+ /**
11049
+ * | output |
11050
+ * | --- |
11051
+ * | "Close tab" |
11052
+ *
11053
+ * @param {Terminaltabclose2Inputs} inputs
11054
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
11055
+ * @returns {LocalizedString}
11056
+ */
11057
+ var terminaltabclose2 = ((inputs = {}, options = {}) => {
11058
+ const locale = options.locale ?? getLocale();
11059
+ if (locale === "zh") return zh_terminaltabclose2();
11060
+ if (locale === "id") return id_terminaltabclose2();
11061
+ if (locale === "es") return es_terminaltabclose2();
11062
+ return en_terminaltabclose2();
11063
+ });
11064
+ //#endregion
11001
11065
  //#region src/lib/paraglide/messages/text.js
11002
11066
  /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
11003
11067
  /** @typedef {{}} TextInputs */
@@ -12559,10 +12623,12 @@ var _index_exports = /* @__PURE__ */ __exportAll({
12559
12623
  terminalDisabled: () => terminaldisabled1,
12560
12624
  terminalOpening: () => terminalopening1,
12561
12625
  terminalPanelTitle: () => terminalpaneltitle2,
12626
+ terminalSessionCap: () => terminalsessioncap2,
12562
12627
  terminalSettleInferredIdle: () => terminalsettleinferredidle3,
12563
12628
  terminalSettleSessionExit: () => terminalsettlesessionexit3,
12564
12629
  terminalSettleStdinRead: () => terminalsettlestdinread3,
12565
12630
  terminalSettleTimeout: () => terminalsettletimeout2,
12631
+ terminalTabClose: () => terminaltabclose2,
12566
12632
  text: () => text,
12567
12633
  thinkLabel: () => thinklabel1,
12568
12634
  thinkingLabel: () => thinkinglabel1,
@@ -12950,10 +13016,12 @@ var messages_exports = /* @__PURE__ */ __exportAll({
12950
13016
  terminalDisabled: () => terminaldisabled1,
12951
13017
  terminalOpening: () => terminalopening1,
12952
13018
  terminalPanelTitle: () => terminalpaneltitle2,
13019
+ terminalSessionCap: () => terminalsessioncap2,
12953
13020
  terminalSettleInferredIdle: () => terminalsettleinferredidle3,
12954
13021
  terminalSettleSessionExit: () => terminalsettlesessionexit3,
12955
13022
  terminalSettleStdinRead: () => terminalsettlestdinread3,
12956
13023
  terminalSettleTimeout: () => terminalsettletimeout2,
13024
+ terminalTabClose: () => terminaltabclose2,
12957
13025
  text: () => text,
12958
13026
  thinkLabel: () => thinklabel1,
12959
13027
  thinkingLabel: () => thinkinglabel1,
@@ -17953,13 +18021,21 @@ function parseCommand(text) {
17953
18021
  args
17954
18022
  };
17955
18023
  }
17956
- case "/dsi-prompts":
17957
18024
  case "/dsi-terminal":
18025
+ if (args === "" || args === "--new-tab" || args === "--split-down") return {
18026
+ type: "terminal",
18027
+ args: "",
18028
+ ...args !== "" ? { terminalAction: args.slice(2) } : {}
18029
+ };
18030
+ return {
18031
+ type: "terminal",
18032
+ args
18033
+ };
18034
+ case "/dsi-prompts":
17958
18035
  case "/dsi-settings":
17959
18036
  case "/dsh-settings": return {
17960
18037
  type: {
17961
18038
  "/dsi-prompts": "promptmanager",
17962
- "/dsi-terminal": "terminal",
17963
18039
  "/dsi-settings": "dsisettings",
17964
18040
  "/dsh-settings": "dshsettings"
17965
18041
  }[token],
@@ -18093,13 +18169,23 @@ var COMMAND_HELP = {
18093
18169
  ]
18094
18170
  },
18095
18171
  terminal: {
18096
- usage: "/dsi-terminal",
18097
- summary: "Aims the operator terminal panel: the open terminal takes the focus; otherwise a NEW panel opens to the right of this conversation. Renders the disabled note unless terminal.enabled is set in settings.",
18172
+ usage: "/dsi-terminal [--new-tab | --split-down]",
18173
+ summary: "Aims the operator terminal desk: the open desk takes the focus; otherwise a NEW panel opens to the right of this conversation. --new-tab appends a tab; --split-down stacks another shell under the selected one; the two flags cannot combine. Renders the disabled note unless terminal.enabled is set in settings.",
18098
18174
  params: [],
18099
- examples: [{
18100
- line: "/dsi-terminal",
18101
- description: "The terminal panel comes forward — beside this conversation if it was closed."
18102
- }]
18175
+ examples: [
18176
+ {
18177
+ line: "/dsi-terminal",
18178
+ description: "The terminal desk comes forward — beside this conversation if it was closed."
18179
+ },
18180
+ {
18181
+ line: "/dsi-terminal --new-tab",
18182
+ description: "A new desk tab, selected; the previous tab keeps running, hidden."
18183
+ },
18184
+ {
18185
+ line: "/dsi-terminal --split-down",
18186
+ description: "Another shell stacked under the selected one, in the same tab."
18187
+ }
18188
+ ]
18103
18189
  },
18104
18190
  promptmanager: {
18105
18191
  usage: "/dsi-prompts",
@@ -23530,7 +23616,7 @@ async function executeCommand(command, ctx, onNote) {
23530
23616
  if (command.type === "workspace") return runWorkspaceLine(command.wsPath, command.wsName, ctx, onNote);
23531
23617
  if (command.type === "mention") return runMention(command.sessionId ?? "", command.args, command.a2aId, ctx, onNote);
23532
23618
  if (command.type === "promptmanager") return runPromptManager(command.args, ctx, onNote);
23533
- if (command.type === "terminal") return runTerminal(command.args, ctx, onNote);
23619
+ if (command.type === "terminal") return runTerminal(command.args, command.terminalAction, ctx, onNote);
23534
23620
  if (command.type === "skillshelf") return runSkillShelf(command.args, command.reload === true, ctx, onNote);
23535
23621
  if (command.type === "dsisettings" || command.type === "dshsettings") return runSettingsEditor(command.type === "dsisettings" ? "dsi" : "dsh", command.type === "dsisettings" ? "/dsi-settings" : "/dsh-settings", command.args, ctx, onNote);
23536
23622
  if (command.type === "loadinjected") return runLoadInjected(command.filename, command.addPanel === true, ctx, onNote);
@@ -23655,14 +23741,17 @@ async function executeCommand(command, ctx, onNote) {
23655
23741
  * command. No wire call — the manager content talks to /api/prompts itself.
23656
23742
  */
23657
23743
  /**
23658
- * /dsi-terminal (Web Terminal spec Wave 5, 2026-09-24): aim the operator
23659
- * terminal panel — the manager-request grammar. The enabled gate lives
23660
- * HERE (the composer gives honest feedback even before a panel exists):
23661
- * a disabled flag notes the fact and opens nothing.
23744
+ * /dsi-terminal (Web Terminal spec Wave 5, 2026-09-24; widened by The
23745
+ * Terminal Desk ADR 2026-09-24 D2): aim the operator terminal desk — the
23746
+ * manager-request grammar. The enabled gate lives HERE (the composer gives
23747
+ * honest feedback even before a panel exists): a disabled flag notes the
23748
+ * fact and opens nothing. action carries the parser-admitted flag
23749
+ * ('new-tab' | 'split-down') onward — with no desk on the floor all three
23750
+ * shapes create the first tab; the action discriminates only when one exists.
23662
23751
  */
23663
- async function runTerminal(args, ctx, onNote) {
23752
+ async function runTerminal(args, action, ctx, onNote) {
23664
23753
  if (args !== "") {
23665
- const usage = "usage: /dsi-terminal";
23754
+ const usage = "usage: /dsi-terminal [--new-tab | --split-down]";
23666
23755
  onNote?.(false, usage);
23667
23756
  return {
23668
23757
  ok: false,
@@ -25800,6 +25889,173 @@ function TerminalPanel($$renderer, $$props) {
25800
25889
  });
25801
25890
  }
25802
25891
  //#endregion
25892
+ //#region src/lib/components/terminal/TerminalTabHeader.svelte
25893
+ function TerminalTabHeader($$renderer, $$props) {
25894
+ let { children } = $$props;
25895
+ $$renderer.push(`<div data-svelte="TerminalTabHeader" role="tablist" class="flex items-center gap-1 border-b border-slate-800 px-1 py-0.5" data-testid="terminal-tab-header">`);
25896
+ children($$renderer);
25897
+ $$renderer.push(`<!----></div>`);
25898
+ }
25899
+ //#endregion
25900
+ //#region src/lib/components/terminal/TerminalTabButton.svelte
25901
+ function TerminalTabButton($$renderer, $$props) {
25902
+ $$renderer.component(($$renderer) => {
25903
+ let { index, selected, label} = $$props;
25904
+ $$renderer.push(`<div data-svelte="TerminalTabButton" role="tab"${attr("aria-selected", selected)} tabindex="0"${attr_class(`flex cursor-pointer items-center gap-1 rounded px-2 py-0.5 text-[10px] ${selected ? "bg-slate-700 text-slate-100" : "text-slate-400 hover:bg-slate-800"}`)}${attr("data-testid", `terminal-tab-button-${stringify(index)}`)}${attr("data-selected", selected ? "true" : "false")}><span>${escape_html(label)}</span> <span class="ml-1 rounded px-1 text-slate-500 hover:bg-slate-600 hover:text-slate-200" role="button" tabindex="-1"${attr("aria-label", t(terminaltabclose2) + " " + label)}${attr("data-testid", `terminal-tab-close-${stringify(index)}`)}>×</span></div>`);
25905
+ });
25906
+ }
25907
+ //#endregion
25908
+ //#region src/lib/components/terminal/TerminalTabContainer.svelte
25909
+ function TerminalTabContainer($$renderer, $$props) {
25910
+ let { index, visible, children } = $$props;
25911
+ $$renderer.push(`<div data-svelte="TerminalTabContainer"${attr_class(`min-h-0 grow ${visible ? "flex" : "hidden"} flex-col`)}${attr("hidden", !visible)}${attr("data-testid", `terminal-tab-container-${stringify(index)}`)}${attr("data-visible", visible ? "true" : "false")}>`);
25912
+ children($$renderer);
25913
+ $$renderer.push(`<!----></div>`);
25914
+ }
25915
+ //#endregion
25916
+ //#region src/lib/components/terminal/TerminalSplitContainer.svelte
25917
+ function TerminalSplitContainer($$renderer, $$props) {
25918
+ let { rowCount, children } = $$props;
25919
+ $$renderer.push(`<div data-svelte="TerminalSplitContainer"${attr_class(`flex min-h-0 grow flex-col gap-0.5 ${rowCount > 1 ? "overflow-y-auto" : "overflow-hidden"}`)} data-testid="terminal-split-container"${attr("data-rows", rowCount)}>`);
25920
+ children($$renderer);
25921
+ $$renderer.push(`<!----></div>`);
25922
+ }
25923
+ //#endregion
25924
+ //#region src/lib/components/terminal/TerminalDesk.svelte
25925
+ function TerminalDesk($$renderer, $$props) {
25926
+ $$renderer.component(($$renderer) => {
25927
+ /** TerminalDesk — the ONE terminal floor slot (Terminal Desk ADR,
25928
+ * 2026-09-24, D1/D3): tabs of stacked rows over the server's N-session
25929
+ * registry. The floor counts desks (always at most one); this
25930
+ * component owns the tab/row tree, selection, the close cascades (D5),
25931
+ * and the reload survival pair (D3): the blob MIRROR rides out via
25932
+ * onMirror; the probe's live session list adjudicates the REBUILD —
25933
+ * remembered ids that are gone or exited drop, survivors re-attach
25934
+ * (byte-0 replay per the Surviving Shell's amended D3), and an
25935
+ * all-dead desk falls back to one fresh self-open row. Row sessions
25936
+ * the desk mints itself are handed to the panel (row mode); the FIRST
25937
+ * row of a virgin desk self-opens via the panel's own ladder, so a
25938
+ * bare command behaves byte-identically to the pre-desk panel. */
25939
+ /** Null = self-open (the panel runs its own ladder and reports back
25940
+ * via onAssigned); set = the desk holds this session's lease. */
25941
+ let { onShellExit, restored = null, onMirror } = $$props;
25942
+ let nextKey = 1;
25943
+ const mkKey = () => nextKey++;
25944
+ const defaultTab = () => ({
25945
+ key: mkKey(),
25946
+ rows: [{
25947
+ key: mkKey(),
25948
+ assigned: null
25949
+ }]
25950
+ });
25951
+ let restoring = !!restored && restored.tabs.length > 0;
25952
+ let tabs = restoring ? [] : [defaultTab()];
25953
+ let selectedTab = 0;
25954
+ let opening = false;
25955
+ let capped = false;
25956
+ /** Mint a fresh session server-side and hand it to a new row (row
25957
+ * mode). A new tab or split-down NEVER re-attaches an existing
25958
+ * session — the reattach ladder is reload-recovery, not a spawner. */
25959
+ async function mintSession() {
25960
+ opening = true;
25961
+ try {
25962
+ const res = await fetch("/api/terminal", {
25963
+ method: "POST",
25964
+ headers: { "content-type": "application/json" },
25965
+ body: "{}"
25966
+ });
25967
+ if (!res.ok) {
25968
+ if ((await res.json().catch(() => ({})))?.error === "MAX_SESSIONS") capped = true;
25969
+ return null;
25970
+ }
25971
+ const body = await res.json();
25972
+ return {
25973
+ key: mkKey(),
25974
+ assigned: {
25975
+ sessionId: body.sessionId,
25976
+ token: body.token
25977
+ }
25978
+ };
25979
+ } finally {
25980
+ opening = false;
25981
+ }
25982
+ }
25983
+ /** The floor's forwarded command action (ADR D2): --new-tab appends a
25984
+ * tab and selects it; --split-down stacks a row on the SELECTED tab.
25985
+ * Both open a fresh session (never re-attach). */
25986
+ function applyAction(action) {
25987
+ (async () => {
25988
+ const row = await mintSession();
25989
+ if (!row) return;
25990
+ if (action === "new-tab") {
25991
+ tabs.push({
25992
+ key: mkKey(),
25993
+ rows: [row]
25994
+ });
25995
+ selectedTab = tabs.length - 1;
25996
+ } else tabs[selectedTab].rows.push(row);
25997
+ })();
25998
+ }
25999
+ $$renderer.push(`<div data-svelte="TerminalDesk" class="flex h-full min-h-0 flex-col rounded-lg bg-slate-900" data-testid="terminal-desk">`);
26000
+ if (restoring) {
26001
+ $$renderer.push("<!--[0-->");
26002
+ $$renderer.push(`<div class="p-3 text-xs text-slate-500" data-testid="terminal-desk-restoring">...</div>`);
26003
+ } else {
26004
+ $$renderer.push("<!--[-1-->");
26005
+ TerminalTabHeader($$renderer, {
26006
+ children: ($$renderer) => {
26007
+ $$renderer.push(`<!--[-->`);
26008
+ const each_array = ensure_array_like(tabs);
26009
+ for (let i = 0, $$length = each_array.length; i < $$length; i++) {
26010
+ each_array[i];
26011
+ TerminalTabButton($$renderer, {
26012
+ index: i,
26013
+ label: "T" + (i + 1),
26014
+ selected: i === selectedTab});
26015
+ }
26016
+ $$renderer.push(`<!--]-->`);
26017
+ }});
26018
+ $$renderer.push(`<!----> <!--[-->`);
26019
+ const each_array_1 = ensure_array_like(tabs);
26020
+ for (let i = 0, $$length = each_array_1.length; i < $$length; i++) {
26021
+ let tab = each_array_1[i];
26022
+ TerminalTabContainer($$renderer, {
26023
+ index: i,
26024
+ visible: i === selectedTab,
26025
+ children: ($$renderer) => {
26026
+ TerminalSplitContainer($$renderer, {
26027
+ rowCount: tab.rows.length,
26028
+ children: ($$renderer) => {
26029
+ $$renderer.push(`<!--[-->`);
26030
+ const each_array_2 = ensure_array_like(tab.rows);
26031
+ for (let $$index_1 = 0, $$length = each_array_2.length; $$index_1 < $$length; $$index_1++) {
26032
+ let row = each_array_2[$$index_1];
26033
+ $$renderer.push(`<div class="min-h-0" style="flex: 1 1 0; min-height: 10rem;">`);
26034
+ TerminalPanel($$renderer, {
26035
+ assigned: row.assigned});
26036
+ $$renderer.push(`<!----></div>`);
26037
+ }
26038
+ $$renderer.push(`<!--]-->`);
26039
+ }});
26040
+ }});
26041
+ }
26042
+ $$renderer.push(`<!--]--> `);
26043
+ if (opening) {
26044
+ $$renderer.push("<!--[0-->");
26045
+ $$renderer.push(`<div class="p-2 text-[10px] text-slate-500" data-testid="terminal-desk-opening">...</div>`);
26046
+ } else $$renderer.push("<!--[-1-->");
26047
+ $$renderer.push(`<!--]--> `);
26048
+ if (capped) {
26049
+ $$renderer.push("<!--[0-->");
26050
+ $$renderer.push(`<div class="p-2 text-[10px] text-slate-500" data-testid="terminal-desk-capped">${escape_html(t(terminalsessioncap2))}</div>`);
26051
+ } else $$renderer.push("<!--[-1-->");
26052
+ $$renderer.push(`<!--]-->`);
26053
+ }
26054
+ $$renderer.push(`<!--]--></div>`);
26055
+ bind_props($$props, { applyAction });
26056
+ });
26057
+ }
26058
+ //#endregion
25803
26059
  //#region src/lib/components/settings-skills/SettingsSkillsToolbar.svelte
25804
26060
  function SettingsSkillsToolbar($$renderer, $$props) {
25805
26061
  $$renderer.component(($$renderer) => {
@@ -27397,6 +27653,31 @@ function clampExpanded(value) {
27397
27653
  }
27398
27654
  return out;
27399
27655
  }
27656
+ /** The terminal desk's structure clamp (Terminal Desk ADR D3, Wave 3):
27657
+ * sanitize a stored desk mirror into { tabs, selectedTab } or undefined.
27658
+ * Junk drops FIELD-WISE — non-string sessionIds drop, empty/junk tabs
27659
+ * drop, selectedTab clamps into range — so a stale blob degrades to
27660
+ * "fewer rows remembered", never a phantom row. All tabs dropped (or
27661
+ * junk at the top) ⇒ undefined: the desk falls back to one fresh row. */
27662
+ function clampDeskMirror(value) {
27663
+ if (value === null || typeof value !== "object") return void 0;
27664
+ const raw = value;
27665
+ if (!Array.isArray(raw.tabs)) return void 0;
27666
+ const tabs = [];
27667
+ for (const tab of raw.tabs) {
27668
+ if (tab === null || typeof tab !== "object") continue;
27669
+ const ids = tab.sessionIds;
27670
+ if (!Array.isArray(ids)) continue;
27671
+ const sessionIds = ids.filter((id) => typeof id === "string" && id.length > 0);
27672
+ if (sessionIds.length === 0) continue;
27673
+ tabs.push({ sessionIds });
27674
+ }
27675
+ if (tabs.length === 0) return void 0;
27676
+ return {
27677
+ tabs,
27678
+ selectedTab: typeof raw.selectedTab === "number" && Number.isFinite(raw.selectedTab) ? Math.max(0, Math.min(tabs.length - 1, Math.round(raw.selectedTab))) : 0
27679
+ };
27680
+ }
27400
27681
  /** Persisted defaults when nothing (usable) is stored. */
27401
27682
  function defaultPanelPrefs() {
27402
27683
  return {
@@ -27466,11 +27747,15 @@ function sanitizePanels(raw) {
27466
27747
  kind: "prompt-manager",
27467
27748
  width
27468
27749
  };
27469
- if (entry.kind === "terminal") return {
27470
- id: entry.id,
27471
- kind: "terminal",
27472
- width
27473
- };
27750
+ if (entry.kind === "terminal") {
27751
+ const desk = clampDeskMirror(entry.desk);
27752
+ return {
27753
+ id: entry.id,
27754
+ kind: "terminal",
27755
+ ...desk ? { desk } : {},
27756
+ width
27757
+ };
27758
+ }
27474
27759
  if (entry.kind === "settings-editor") return {
27475
27760
  id: entry.id,
27476
27761
  kind: "settings-editor",
@@ -28403,6 +28688,15 @@ function _page($$renderer, $$props) {
28403
28688
  let treePct = clampTreePct(initialPrefs.treePct);
28404
28689
  let panels = seededInitially ? [makePanel(seedSessionId(), seedCold?.agentPreset ?? null)] : initialPrefs.panels;
28405
28690
  syncPanelIdSeq(panels);
28691
+ /** The one terminal desk's ref (Terminal Desk ADR D1/D2, Wave 2): the
28692
+ * floor forwards the parsed command action (--new-tab / --split-down)
28693
+ * into the desk's methods when the desk is already open — repeat bare
28694
+ * stays focus-only. */
28695
+ /** The desk's published structure mirror, by panel id (Terminal Desk
28696
+ * ADR D3, Wave 3): read at savePanelPrefs time — the $effect that
28697
+ * persists the floor serializes each terminal entry's desk field.
28698
+ * A copy, never the authority; the probe adjudicates on rebuild. */
28699
+ let terminalDeskMirrors = {};
28406
28700
  let selectedPanelId = seededInitially ? panels[0]?.id ?? null : initialPrefs.selectedPanelId;
28407
28701
  /** Which panel the loupe reads (The Panel Loupe ADR D5, 2026-09-04):
28408
28702
  * session-local by decision — never persisted (the R2 effect above
@@ -28711,7 +29005,11 @@ function _page($$renderer, $$props) {
28711
29005
  if (panel.kind === "terminal") {
28712
29006
  $$renderer.push("<!--[0-->");
28713
29007
  $$renderer.push(`<div class="panel-manager-body svelte-1uha8ag" data-testid="panel-terminal">`);
28714
- TerminalPanel($$renderer);
29008
+ TerminalDesk($$renderer, {
29009
+ restored: panel.desk ?? null,
29010
+ onMirror: (m) => terminalDeskMirrors[panel.id] = m,
29011
+ onShellExit: () => removePanel(panel.id)
29012
+ });
28715
29013
  $$renderer.push(`<!----></div>`);
28716
29014
  } else if (panel.kind === "prompt-manager") {
28717
29015
  $$renderer.push("<!--[1-->");
@@ -28947,4 +29245,4 @@ function _page($$renderer, $$props) {
28947
29245
  }
28948
29246
 
28949
29247
  export { _page as default };
28950
- //# sourceMappingURL=_page.svelte.js-B26jgDy0.js.map
29248
+ //# sourceMappingURL=_page.svelte.js-C-gx9imA.js.map
@@ -9,8 +9,8 @@ import * as qs from 'node:querystring';
9
9
  import { Readable } from 'node:stream';
10
10
  import { S as SvelteKitError } from './chunks/shared.js-HQ0rfhm4.js';
11
11
  import './chunks/utils.js-CAdNO8Tu.js';
12
- import { S as Server } from './index.js-BwOnKfpd.js';
13
- import { m as manifest } from './manifest.js-DSGtd5rA.js';
12
+ import { S as Server } from './index.js-BHhoIUPw.js';
13
+ import { m as manifest } from './manifest.js-DkA6N6z6.js';
14
14
  import { env, dir, env_prefix } from '../../env.js';
15
15
  import { format } from 'node:url';
16
16
 
@@ -1732,4 +1732,4 @@ const handler = sequence(
1732
1732
  );
1733
1733
 
1734
1734
  export { format_listening_address as f, handler as h, polka as p };
1735
- //# sourceMappingURL=handler-H035jucs.js.map
1735
+ //# sourceMappingURL=handler-C-ZkJfQi.js.map
@@ -1,4 +1,4 @@
1
- import { _ as __commonJSMin, o as options, s as set_private_env, a as set_public_env, g as get_hooks, p as public_env, r as read_implementation, b as set_read_implementation } from './chunks/internal.js-BtKbXGxV.js';
1
+ import { _ as __commonJSMin, o as options, s as set_private_env, a as set_public_env, g as get_hooks, p as public_env, r as read_implementation, b as set_read_implementation } from './chunks/internal.js-DFJpTf_o.js';
2
2
  import { n as noop, T as TRAILING_SLASH_PARAM, I as INVALIDATED_PARAM, R as Redirect, b as get_relative_path, S as SvelteKitError, g as get_status, t as text_encoder, o as once, H as HttpError, d as normalize_error, e as create_remote_key, f as parse_remote_arg, s as stringify, h as stringify$1, A as ActionFailure, i as split_remote_key, j as base64_encode } from './chunks/shared.js-HQ0rfhm4.js';
3
3
  import { b as base, o as override, a as assets, r as reset, c as app_dir } from './chunks/internal2.js-BcS47nI-.js';
4
4
  import { f as format_server_error, j as json, i as is_form_content_type, t as text, h as has_prerendered_path, a as handle_fatal_error, r as redirect_response, g as get_set_cookies, n as negotiate, w as with_request_store, p as parseString, m as merge_tracing, b as method_not_allowed, s as static_error_page, c as handle_error_and_jsonify, d as get_global_name, e as create_replacer, k as serialize_uses, l as clarify_devalue_error, E as ENDPOINT_METHODS, P as PAGE_METHODS, o as get_node_type, q as isRedirect, u as escape_html, v as error, x as deserialize_binary_form } from './chunks/utils.js-CAdNO8Tu.js';
@@ -3861,4 +3861,4 @@ var Server = class {
3861
3861
  };
3862
3862
 
3863
3863
  export { Server as S };
3864
- //# sourceMappingURL=index.js-BwOnKfpd.js.map
3864
+ //# sourceMappingURL=index.js-BHhoIUPw.js.map