@deepseek-insight/dsi 0.5.29 → 0.5.30

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 (89) hide show
  1. package/README.md +10 -5
  2. package/build/client/_app/immutable/assets/0.Ckapanfk.css +2 -0
  3. package/build/client/_app/immutable/assets/{2.B2JMICOx.css → 2.DUjQJ-eX.css} +1 -1
  4. package/build/client/_app/immutable/chunks/BK9eh7ly.js +1 -0
  5. package/build/client/_app/immutable/chunks/C3BHN0de.js +16 -0
  6. package/build/client/_app/immutable/chunks/DFcmLsZu.js +1 -0
  7. package/build/client/_app/immutable/chunks/DIOBYJe3.js +1 -0
  8. package/build/client/_app/immutable/chunks/{D4yILG4p.js → DX_pn7Eg.js} +1 -1
  9. package/build/client/_app/immutable/chunks/{Ch00tocz.js → smd3Jq9O.js} +2 -2
  10. package/build/client/_app/immutable/entry/{app.CxAgK_V4.js → app.CIeDJy8c.js} +2 -2
  11. package/build/client/_app/immutable/entry/start.BdDgymYC.js +1 -0
  12. package/build/client/_app/immutable/nodes/{1.DJ0wIUro.js → 1.VxhMSm3s.js} +1 -1
  13. package/build/client/_app/immutable/nodes/2.xvwoCX2a.js +174 -0
  14. package/build/client/_app/version.json +1 -1
  15. package/build/handler.js +4 -4
  16. package/build/index.js +4 -4
  17. package/build/server/chunks/chunks/{app-config.svelte.js-F-U5xz0r.js → app-config.svelte.js-BBPHOX4N.js} +2 -2
  18. package/build/server/chunks/chunks/{config.js-BvW5LrfQ.js → config.js-B0w1-uCA.js} +10 -2
  19. package/build/server/chunks/chunks/{db.js-CSrMZzws.js → db.js-BTsRdpsi.js} +2 -2
  20. package/build/server/chunks/chunks/{db2.js-B9P1MuEl.js → db2.js-ou6Vlz7O.js} +2 -2
  21. package/build/server/chunks/chunks/{dsh-connection.js-DjwmUFoE.js → dsh-connection.js-DawPog_I.js} +3 -3
  22. package/build/server/chunks/chunks/{git-probe.js-BGOqAXVt.js → git-probe.js-D5q52JMr.js} +2 -2
  23. package/build/server/chunks/chunks/{insight-config.js-CmCFt2Kp.js → insight-config.js-DiF58x83.js} +22 -4
  24. package/build/server/chunks/chunks/{internal.js-D-70iBmc.js → internal.js-Cr424dfu.js} +3 -3
  25. package/build/server/chunks/chunks/registry.js-G1hzOje_.js +545 -0
  26. package/build/server/chunks/chunks/{settings-document.js-i5MkkSFH.js → settings-document.js-BRTO59Al.js} +2 -2
  27. package/build/server/chunks/chunks/{state.js-BKUnFOB4.js → state.js-BPfg8KK0.js} +3 -3
  28. package/build/server/chunks/chunks/{watcher.js-CuX0WU5B.js → watcher.js-BJlOJaBs.js} +4 -4
  29. package/build/server/chunks/entries/endpoints/api/a2a/_id_/{_server.ts.js-BGuC49gg.js → _server.ts.js-CDJ0OmUG.js} +5 -5
  30. package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-BVH1ToLe.js → _server.ts.js-BVFSRjvv.js} +7 -7
  31. package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-a85F1GOf.js → _server.ts.js-Bhou8F5X.js} +7 -7
  32. package/build/server/chunks/entries/endpoints/api/config/{_server.ts.js-CBq4bRig.js → _server.ts.js-BJIzdaiA.js} +5 -5
  33. package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-BpQX_N7Q.js → _server.ts.js-C6n_idy7.js} +5 -5
  34. package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-eYQQnSgq.js → _server.ts.js-DADH8M-H.js} +5 -5
  35. package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-vOFZ1siq.js → _server.ts.js-bC_NLj4U.js} +5 -5
  36. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-D2tytVhM.js → _server.ts.js-CoScceI5.js} +5 -5
  37. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-BEn9Ta_U.js → _server.ts.js-C1FgtncS.js} +5 -5
  38. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-ZfOtq-D3.js → _server.ts.js-PIxDn234.js} +5 -5
  39. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-BmJbICbR.js → _server.ts.js-B_CRf61I.js} +5 -5
  40. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-gsaVQwiM.js → _server.ts.js-DGGUjpY9.js} +5 -5
  41. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-Dn0v3kPL.js → _server.ts.js-xEVeT3pb.js} +5 -5
  42. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-3y0ufVj_.js → _server.ts.js-Df8t4hkX.js} +5 -5
  43. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-CLe_Yd9T.js → _server.ts.js-CH1L9p8z.js} +5 -5
  44. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-Reg3sATn.js → _server.ts.js-BvG76FMN.js} +5 -5
  45. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/path/{_server.ts.js-Der7_1Gf.js → _server.ts.js-t8Oiyikl.js} +4 -4
  46. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-B0F4vS5A.js → _server.ts.js-C7fokwxa.js} +5 -5
  47. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-DLlAJ59P.js → _server.ts.js-Cfm2eSa-.js} +5 -5
  48. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-cxdpHzTp.js → _server.ts.js-DJ3WSBOS.js} +5 -5
  49. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-Bdymup3B.js → _server.ts.js-B8lDX-zk.js} +5 -5
  50. package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-13DIGKaK.js → _server.ts.js-DCKvoONe.js} +5 -5
  51. package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-ChqfgswA.js → _server.ts.js-Bl4xBKoB.js} +5 -5
  52. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js-CT8DKYFX.js → _server.ts.js--FCZv4Np.js} +5 -5
  53. package/build/server/chunks/entries/endpoints/api/dsh/workspace-file-bytes/{_server.ts.js-DY-EoPi1.js → _server.ts.js-DEUnD1Mn.js} +5 -5
  54. package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-D4tdFfjX.js → _server.ts.js-BiHVvbW-.js} +5 -5
  55. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-BUcBfYnX.js → _server.ts.js-CcDE1rk8.js} +5 -5
  56. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-CunmEcMs.js → _server.ts.js-C8vdE5Jr.js} +5 -5
  57. package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-CmGqWlUy.js → _server.ts.js-C9cgB8t0.js} +5 -5
  58. package/build/server/chunks/entries/endpoints/api/prompts/_id_/{_server.ts.js-DMyDOvrX.js → _server.ts.js-oR6Qu-Wa.js} +5 -5
  59. package/build/server/chunks/entries/endpoints/api/prompts/{_server.ts.js-BS2wQOe7.js → _server.ts.js-j8TNOmk3.js} +5 -5
  60. package/build/server/chunks/entries/endpoints/api/prompts/use/{_server.ts.js-5-lf15sG.js → _server.ts.js-B6UZ2HZ5.js} +5 -5
  61. package/build/server/chunks/entries/endpoints/api/settings/{_server.ts.js-PDRzWcsI.js → _server.ts.js-BWE38_9X.js} +4 -4
  62. package/build/server/chunks/entries/endpoints/api/terminal/_id_/output/_server.ts.js-m6Cug5hN.js +31 -0
  63. package/build/server/chunks/entries/endpoints/api/terminal/_id_/send/_server.ts.js-CTc5xP72.js +60 -0
  64. package/build/server/chunks/entries/endpoints/api/terminal/_id_/stream/_server.ts.js-_-HKTzoH.js +95 -0
  65. package/build/server/chunks/entries/endpoints/api/terminal/_server.ts.js-CmM-ksLQ.js +73 -0
  66. package/build/server/chunks/entries/endpoints/api/workspace/file-write/{_server.ts.js-COt-HtL0.js → _server.ts.js-1pMekv7y.js} +6 -6
  67. package/build/server/chunks/entries/endpoints/api/workspace/git-events/{_server.ts.js-k7bgOO_c.js → _server.ts.js-Cwebkv8Y.js} +6 -6
  68. package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/{_server.ts.js-H1HUbRif.js → _server.ts.js-4JF7UGE-.js} +6 -6
  69. package/build/server/chunks/entries/endpoints/api/workspace/git-map/{_server.ts.js-D7nqciP7.js → _server.ts.js-B5i8ziTR.js} +6 -6
  70. package/build/server/chunks/entries/endpoints/api/workspace/git-status/{_server.ts.js-D0HYWO9M.js → _server.ts.js-zYBj_jzG.js} +6 -6
  71. package/build/server/chunks/entries/endpoints/api/workspace/write-gate/{_server.ts.js-Boi1Sn8U.js → _server.ts.js-BbgR18Zo.js} +6 -6
  72. package/build/server/chunks/entries/{hooks.server.js-Bt6VP5fg.js → hooks.server.js-BSnc9oHw.js} +3 -3
  73. package/build/server/chunks/entries/pages/{_error.svelte.js-Bee5xNts.js → _error.svelte.js-izlnhqFW.js} +4 -4
  74. package/build/server/chunks/entries/pages/{_page.server.ts.js-DdzOMHcO.js → _page.server.ts.js-CNmIVlOY.js} +2 -2
  75. package/build/server/chunks/entries/pages/{_page.svelte.js-B2EA5ccE.js → _page.svelte.js-DOcEfh5K.js} +472 -50
  76. package/build/server/chunks/{handler-BVZR5A-R.js → handler-t4JeFn6X.js} +3 -3
  77. package/build/server/chunks/{index.js-Nwzp6b_k.js → index.js-DgUdoRMr.js} +2 -2
  78. package/build/server/chunks/{manifest.js-Bof9naPY.js → manifest.js-CuVIAGaj.js} +72 -44
  79. package/build/server/chunks/nodes/{0.js-iA5BIbe7.js → 0.js-DphETTOT.js} +3 -3
  80. package/build/server/chunks/nodes/1.js-3gG-llw5.js +9 -0
  81. package/build/server/chunks/nodes/{2.js-QPzVOzfX.js → 2.js-CmddEN1j.js} +9 -9
  82. package/package.json +4 -1
  83. package/build/client/_app/immutable/assets/0.BbBUj8Gs.css +0 -2
  84. package/build/client/_app/immutable/chunks/Zxb_bQ44.js +0 -1
  85. package/build/client/_app/immutable/chunks/muEkqSbS.js +0 -1
  86. package/build/client/_app/immutable/entry/start.CImCAUy1.js +0 -1
  87. package/build/client/_app/immutable/nodes/2.8eo5qS19.js +0 -171
  88. package/build/server/chunks/nodes/1.js-CxOuNsR_.js +0 -9
  89. /package/build/client/_app/immutable/nodes/{0.B3l2ZewD.js → 0.tkrxyU6K.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { r as readSettingsDocument, s as saveSettingsDocument, S as SettingsParseError } from '../../../../chunks/settings-document.js-i5MkkSFH.js';
2
- import { n as DEFAULT_DSH_PRESET_ENGLISH, o as DEFAULT_SERVER_CONFIG, q as DEFAULT_PROMPTS_CONFIG, s as DEFAULT_SIDEBAR_CONFIG, t as DEFAULT_PANEL_CONFIG, u as DEFAULT_A2A_CONFIG, v as DEFAULT_HOME_CONFIG, w as DEFAULT_CONVERSATION_CONFIG, x as DEFAULT_CHAT_CONFIG } from '../../../../chunks/insight-config.js-CmCFt2Kp.js';
1
+ import { r as readSettingsDocument, s as saveSettingsDocument, S as SettingsParseError } from '../../../../chunks/settings-document.js-BRTO59Al.js';
2
+ import { n as DEFAULT_DSH_PRESET_ENGLISH, o as DEFAULT_SERVER_CONFIG, q as DEFAULT_PROMPTS_CONFIG, s as DEFAULT_SIDEBAR_CONFIG, t as DEFAULT_PANEL_CONFIG, u as DEFAULT_A2A_CONFIG, v as DEFAULT_HOME_CONFIG, w as DEFAULT_CONVERSATION_CONFIG, x as DEFAULT_CHAT_CONFIG } from '../../../../chunks/insight-config.js-DiF58x83.js';
3
3
  import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
4
4
  import { stringify } from 'yaml';
5
- import '../../../../chunks/config.js-BvW5LrfQ.js';
5
+ import '../../../../chunks/config.js-B0w1-uCA.js';
6
6
  import 'node:fs';
7
7
  import 'node:path';
8
8
  import 'node:os';
@@ -100,4 +100,4 @@ var PUT = async ({ url, request }) => {
100
100
  };
101
101
 
102
102
  export { GET, PUT };
103
- //# sourceMappingURL=_server.ts.js-PDRzWcsI.js.map
103
+ //# sourceMappingURL=_server.ts.js-BWE38_9X.js.map
@@ -0,0 +1,31 @@
1
+ import { t as terminalRegistry, T as TerminalRegistryRefusal } from '../../../../../../chunks/registry.js-G1hzOje_.js';
2
+ import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:path';
4
+ import 'node:os';
5
+ import 'node:fs/promises';
6
+ import 'node:child_process';
7
+ import 'node:crypto';
8
+ import 'node:events';
9
+ import 'node-pty';
10
+ import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
11
+ import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
12
+
13
+ //#region src/routes/api/terminal/[id]/output/+server.ts
14
+ /**
15
+ * /api/terminal/[id]/output — the retained tail as JSON (Wave 5 fix).
16
+ * The watcher path (no token, ADR D7): offset-based reads with lossy +
17
+ * spillPath, the same facts the SSE stream carries, as a pull.
18
+ */
19
+ var GET = (ctx) => {
20
+ try {
21
+ const fromByteRaw = Number(ctx.url.searchParams.get("fromByte") ?? "0");
22
+ const fromByte = Number.isFinite(fromByteRaw) && fromByteRaw >= 0 ? fromByteRaw : 0;
23
+ return json(terminalRegistry.readFrom(ctx.params.id, fromByte));
24
+ } catch (err) {
25
+ if (err instanceof TerminalRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 403 });
26
+ throw err;
27
+ }
28
+ };
29
+
30
+ export { GET };
31
+ //# sourceMappingURL=_server.ts.js-m6Cug5hN.js.map
@@ -0,0 +1,60 @@
1
+ import { t as terminalRegistry, T as TerminalRegistryRefusal, a as TerminalSendRefusal } from '../../../../../../chunks/registry.js-G1hzOje_.js';
2
+ import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:path';
4
+ import 'node:os';
5
+ import 'node:fs/promises';
6
+ import 'node:child_process';
7
+ import 'node:crypto';
8
+ import 'node:events';
9
+ import 'node-pty';
10
+ import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
11
+ import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
12
+
13
+ //#region src/routes/api/terminal/[id]/send/+server.ts
14
+ /**
15
+ * /api/terminal/[id]/send — the tokened action dispatcher (Wave 3, 3.1).
16
+ * write | signal | close. The registry owns the fence; refusals surface as
17
+ * their stable codes (SEND_ACTIVE rides the write path as 409).
18
+ */
19
+ var SIGNALS = [
20
+ "SIGINT",
21
+ "SIGTERM",
22
+ "SIGKILL",
23
+ "SIGTSTP",
24
+ "SIGHUP"
25
+ ];
26
+ var POST = async (ctx) => {
27
+ let body;
28
+ try {
29
+ body = await ctx.request.json();
30
+ } catch {
31
+ return json({ error: "BAD_REQUEST" }, { status: 400 });
32
+ }
33
+ const id = ctx.params.id;
34
+ const token = typeof body.token === "string" ? body.token : "";
35
+ try {
36
+ switch (body.action) {
37
+ case "write":
38
+ if (typeof body.data !== "string") return json({ error: "BAD_REQUEST" }, { status: 400 });
39
+ terminalRegistry.write(id, token, body.data);
40
+ return json({ written: true });
41
+ case "signal": {
42
+ if (typeof body.signal !== "string" || !SIGNALS.includes(body.signal)) return json({ error: "BAD_REQUEST" }, { status: 400 });
43
+ const pgid = terminalRegistry.signal(id, token, body.signal);
44
+ return json({ signalled: pgid });
45
+ }
46
+ case "close": {
47
+ const result = await terminalRegistry.close(id, token);
48
+ return json(result, { status: result.quiescent ? 200 : 500 });
49
+ }
50
+ default: return json({ error: "BAD_REQUEST" }, { status: 400 });
51
+ }
52
+ } catch (err) {
53
+ if (err instanceof TerminalRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 403 });
54
+ if (err instanceof TerminalSendRefusal) return json({ error: "SEND_ACTIVE" }, { status: 409 });
55
+ throw err;
56
+ }
57
+ };
58
+
59
+ export { POST };
60
+ //# sourceMappingURL=_server.ts.js-CTc5xP72.js.map
@@ -0,0 +1,95 @@
1
+ import { t as terminalRegistry, T as TerminalRegistryRefusal } from '../../../../../../chunks/registry.js-G1hzOje_.js';
2
+ import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:path';
4
+ import 'node:os';
5
+ import 'node:fs/promises';
6
+ import 'node:child_process';
7
+ import 'node:crypto';
8
+ import 'node:events';
9
+ import 'node-pty';
10
+ import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
11
+ import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
12
+
13
+ //#region src/routes/api/terminal/[id]/stream/+server.ts
14
+ /**
15
+ * /api/terminal/[id]/stream — the SSE downstream (Wave 3, task 3.2).
16
+ *
17
+ * Frames: output (byte-offset deltas with lossy + spillPath), settled,
18
+ * exit, closed, error. Watching is the open path (no token — ADR D7);
19
+ * the stream ends after closed. fromByte resumes a late attacher from the
20
+ * ring tail; a slid-out offset reports lossy and names the spill.
21
+ * X-Accel-Buffering: no keeps reverse proxies from buffering the stream.
22
+ */
23
+ var SSE_HEADERS = {
24
+ "content-type": "text/event-stream",
25
+ "cache-control": "no-store",
26
+ connection: "keep-alive",
27
+ "x-accel-buffering": "no"
28
+ };
29
+ function sseFrame(event, data) {
30
+ return "event: " + event + "\ndata: " + JSON.stringify(data) + "\n\n";
31
+ }
32
+ var GET = (ctx) => {
33
+ const id = ctx.params.id;
34
+ try {
35
+ terminalRegistry.peek(id);
36
+ } catch (err) {
37
+ if (err instanceof TerminalRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 403 });
38
+ throw err;
39
+ }
40
+ const fromByteRaw = Number(ctx.url.searchParams.get("fromByte") ?? "0");
41
+ const fromByte = Number.isFinite(fromByteRaw) && fromByteRaw >= 0 ? fromByteRaw : 0;
42
+ const session = terminalRegistry.events(id);
43
+ if (!session) return json({ error: "NO_SESSION" }, { status: 404 });
44
+ const encoder = new TextEncoder();
45
+ const stream = new ReadableStream({ start(controller) {
46
+ let closed = false;
47
+ const enqueue = (chunk) => {
48
+ if (!closed) controller.enqueue(encoder.encode(chunk));
49
+ };
50
+ const read = session.readFrom(fromByte);
51
+ enqueue(sseFrame("output", {
52
+ text: read.text,
53
+ nextOffset: read.nextOffset,
54
+ lossy: read.lossy,
55
+ spillPath: read.spillPath
56
+ }));
57
+ const onEvent = (event) => {
58
+ if (event.type === "output") {
59
+ enqueue(sseFrame("output", {
60
+ text: event.bytes,
61
+ nextOffset: event.nextOffset,
62
+ lossy: false
63
+ }));
64
+ return;
65
+ }
66
+ if (event.type === "settled") {
67
+ enqueue(sseFrame("settled", { reason: event.reason }));
68
+ return;
69
+ }
70
+ if (event.type === "exit") {
71
+ enqueue(sseFrame("exit", { outcome: event.outcome }));
72
+ return;
73
+ }
74
+ if (event.type === "closed") {
75
+ enqueue(sseFrame("closed", {
76
+ quiescent: event.quiescent,
77
+ lingeringPids: event.lingeringPids
78
+ }));
79
+ closed = true;
80
+ session.off("event", onEvent);
81
+ controller.close();
82
+ }
83
+ };
84
+ session.on("event", onEvent);
85
+ if (session.isExited() && terminalRegistry.exitOutcome(id) !== null && !terminalRegistry.list().some((s) => s.id === id)) {
86
+ enqueue(sseFrame("error", { error: "NO_SESSION" }));
87
+ closed = true;
88
+ controller.close();
89
+ }
90
+ } });
91
+ return new Response(stream, { headers: SSE_HEADERS });
92
+ };
93
+
94
+ export { GET };
95
+ //# sourceMappingURL=_server.ts.js-_-HKTzoH.js.map
@@ -0,0 +1,73 @@
1
+ import { y as readTerminalConfig } from '../../../../chunks/insight-config.js-DiF58x83.js';
2
+ import { t as terminalRegistry } from '../../../../chunks/registry.js-G1hzOje_.js';
3
+ import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
4
+ import { homedir } from 'node:os';
5
+ import '../../../../chunks/config.js-B0w1-uCA.js';
6
+ import '../../../../chunks/settings-document.js-BRTO59Al.js';
7
+ import 'node:fs';
8
+ import 'node:path';
9
+ import 'yaml';
10
+ import '../../../../chunks/settings-home2.js-f75-B6RI.js';
11
+ import 'node:fs/promises';
12
+ import 'node:child_process';
13
+ import 'node:crypto';
14
+ import 'node:events';
15
+ import 'node-pty';
16
+ import '../../../../chunks/shared.js-HQ0rfhm4.js';
17
+ import '../../../../chunks/uneval.js-BJ9Qq2SF.js';
18
+
19
+ //#region src/routes/api/terminal/+server.ts
20
+ /**
21
+ * /api/terminal — open and list (spec 2026-09-24 Wave 3, task 3.1).
22
+ *
23
+ * The resolve(request): Spec step lives here (ADR D3): the seam applies no
24
+ * defaults, so this route fills every spec field from the operator's
25
+ * terminal config and the explicit request before the registry spawns
26
+ * anything. The whole surface is gated by terminal.enabled — a disabled
27
+ * flag answers NOT_ENABLED and the floor renders nothing.
28
+ */
29
+ var GET = () => {
30
+ const cfg = readTerminalConfig();
31
+ return json({
32
+ enabled: cfg.enabled,
33
+ sessions: terminalRegistry.list()
34
+ });
35
+ };
36
+ function intInRange(v, min, max, fallback) {
37
+ return typeof v === "number" && Number.isInteger(v) && v >= min && v <= max ? v : fallback;
38
+ }
39
+ /** resolve(request): Spec — the owning defaulting step. Explicit request
40
+ * values win over operator config floors; the seam never sees a default. */
41
+ function resolveSpec(body, cfg) {
42
+ return {
43
+ argv: [process.env.SHELL || "/bin/bash", "-l"],
44
+ cwd: typeof body.cwd === "string" && body.cwd.length > 0 ? body.cwd : homedir(),
45
+ rows: intInRange(body.rows, 2, 200, 24),
46
+ cols: intInRange(body.cols, 2, 500, 80),
47
+ terminalType: "xterm-256color",
48
+ graceMs: cfg.graceMs,
49
+ idleMs: cfg.idleMs,
50
+ tailBytes: cfg.tailBytes,
51
+ env: void 0
52
+ };
53
+ }
54
+ var POST = async ({ request }) => {
55
+ const cfg = readTerminalConfig();
56
+ if (!cfg.enabled) return json({ error: "NOT_ENABLED" }, { status: 403 });
57
+ let body = {};
58
+ try {
59
+ body = await request.json();
60
+ } catch {
61
+ body = {};
62
+ }
63
+ const { session, token } = terminalRegistry.create(resolveSpec(body, cfg));
64
+ return json({
65
+ sessionId: session.id,
66
+ token,
67
+ fromByte: 0,
68
+ totalBytes: session.streamBytes()
69
+ });
70
+ };
71
+
72
+ export { GET, POST };
73
+ //# sourceMappingURL=_server.ts.js-CmM-ksLQ.js.map
@@ -1,11 +1,11 @@
1
- import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DjwmUFoE.js';
2
- import { g as gitGateEnabled, i as isInsideRoot } from '../../../../../chunks/git-probe.js-BGOqAXVt.js';
1
+ import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DawPog_I.js';
2
+ import { g as gitGateEnabled, i as isInsideRoot } from '../../../../../chunks/git-probe.js-D5q52JMr.js';
3
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
4
4
  import { promises } from 'node:fs';
5
5
  import * as nodePath from 'node:path';
6
- import '../../../../../chunks/config.js-BvW5LrfQ.js';
7
- import '../../../../../chunks/insight-config.js-CmCFt2Kp.js';
8
- import '../../../../../chunks/settings-document.js-i5MkkSFH.js';
6
+ import '../../../../../chunks/config.js-B0w1-uCA.js';
7
+ import '../../../../../chunks/insight-config.js-DiF58x83.js';
8
+ import '../../../../../chunks/settings-document.js-BRTO59Al.js';
9
9
  import 'node:os';
10
10
  import 'yaml';
11
11
  import '../../../../../chunks/settings-home2.js-f75-B6RI.js';
@@ -107,4 +107,4 @@ var POST = async ({ request }) => {
107
107
  };
108
108
 
109
109
  export { POST };
110
- //# sourceMappingURL=_server.ts.js-COt-HtL0.js.map
110
+ //# sourceMappingURL=_server.ts.js-1pMekv7y.js.map
@@ -1,12 +1,12 @@
1
- import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DjwmUFoE.js';
2
- import { g as gitGateEnabled, i as isInsideRoot, a as gitStatus, p as parsePorcelainStatus } from '../../../../../chunks/git-probe.js-BGOqAXVt.js';
1
+ import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DawPog_I.js';
2
+ import { g as gitGateEnabled, i as isInsideRoot, a as gitStatus, p as parsePorcelainStatus } from '../../../../../chunks/git-probe.js-D5q52JMr.js';
3
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
4
4
  import { watch } from 'node:fs';
5
5
  import { join } from 'node:path';
6
6
  import { execFileSync } from 'node:child_process';
7
- import '../../../../../chunks/config.js-BvW5LrfQ.js';
8
- import '../../../../../chunks/insight-config.js-CmCFt2Kp.js';
9
- import '../../../../../chunks/settings-document.js-i5MkkSFH.js';
7
+ import '../../../../../chunks/config.js-B0w1-uCA.js';
8
+ import '../../../../../chunks/insight-config.js-DiF58x83.js';
9
+ import '../../../../../chunks/settings-document.js-BRTO59Al.js';
10
10
  import 'node:os';
11
11
  import 'yaml';
12
12
  import '../../../../../chunks/settings-home2.js-f75-B6RI.js';
@@ -293,4 +293,4 @@ var GET = async ({ url, request }) => {
293
293
  };
294
294
 
295
295
  export { GET };
296
- //# sourceMappingURL=_server.ts.js-k7bgOO_c.js.map
296
+ //# sourceMappingURL=_server.ts.js-Cwebkv8Y.js.map
@@ -1,9 +1,9 @@
1
- import { s as statusFor } from '../../../../../chunks/dsh-connection.js-DjwmUFoE.js';
2
- import { r as resolveEnclosingRepo, i as isInsideRoot, b as gitFileHead, G as GitUnavailableError } from '../../../../../chunks/git-probe.js-BGOqAXVt.js';
1
+ import { s as statusFor } from '../../../../../chunks/dsh-connection.js-DawPog_I.js';
2
+ import { r as resolveEnclosingRepo, i as isInsideRoot, b as gitFileHead, G as GitUnavailableError } from '../../../../../chunks/git-probe.js-D5q52JMr.js';
3
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
4
- import '../../../../../chunks/config.js-BvW5LrfQ.js';
5
- import '../../../../../chunks/insight-config.js-CmCFt2Kp.js';
6
- import '../../../../../chunks/settings-document.js-i5MkkSFH.js';
4
+ import '../../../../../chunks/config.js-B0w1-uCA.js';
5
+ import '../../../../../chunks/insight-config.js-DiF58x83.js';
6
+ import '../../../../../chunks/settings-document.js-BRTO59Al.js';
7
7
  import 'node:fs';
8
8
  import 'node:path';
9
9
  import 'node:os';
@@ -76,4 +76,4 @@ var GET = async ({ url }) => {
76
76
  };
77
77
 
78
78
  export { GET };
79
- //# sourceMappingURL=_server.ts.js-H1HUbRif.js.map
79
+ //# sourceMappingURL=_server.ts.js-4JF7UGE-.js.map
@@ -1,9 +1,9 @@
1
- import { s as statusFor } from '../../../../../chunks/dsh-connection.js-DjwmUFoE.js';
2
- import { d as detectRepos } from '../../../../../chunks/git-probe.js-BGOqAXVt.js';
1
+ import { s as statusFor } from '../../../../../chunks/dsh-connection.js-DawPog_I.js';
2
+ import { d as detectRepos } from '../../../../../chunks/git-probe.js-D5q52JMr.js';
3
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
4
- import '../../../../../chunks/config.js-BvW5LrfQ.js';
5
- import '../../../../../chunks/insight-config.js-CmCFt2Kp.js';
6
- import '../../../../../chunks/settings-document.js-i5MkkSFH.js';
4
+ import '../../../../../chunks/config.js-B0w1-uCA.js';
5
+ import '../../../../../chunks/insight-config.js-DiF58x83.js';
6
+ import '../../../../../chunks/settings-document.js-BRTO59Al.js';
7
7
  import 'node:fs';
8
8
  import 'node:path';
9
9
  import 'node:os';
@@ -64,4 +64,4 @@ var GET = async ({ url }) => {
64
64
  };
65
65
 
66
66
  export { GET };
67
- //# sourceMappingURL=_server.ts.js-D7nqciP7.js.map
67
+ //# sourceMappingURL=_server.ts.js-B5i8ziTR.js.map
@@ -1,9 +1,9 @@
1
- import { s as statusFor } from '../../../../../chunks/dsh-connection.js-DjwmUFoE.js';
2
- import { i as isInsideRoot, a as gitStatus, G as GitUnavailableError } from '../../../../../chunks/git-probe.js-BGOqAXVt.js';
1
+ import { s as statusFor } from '../../../../../chunks/dsh-connection.js-DawPog_I.js';
2
+ import { i as isInsideRoot, a as gitStatus, G as GitUnavailableError } from '../../../../../chunks/git-probe.js-D5q52JMr.js';
3
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
4
- import '../../../../../chunks/config.js-BvW5LrfQ.js';
5
- import '../../../../../chunks/insight-config.js-CmCFt2Kp.js';
6
- import '../../../../../chunks/settings-document.js-i5MkkSFH.js';
4
+ import '../../../../../chunks/config.js-B0w1-uCA.js';
5
+ import '../../../../../chunks/insight-config.js-DiF58x83.js';
6
+ import '../../../../../chunks/settings-document.js-BRTO59Al.js';
7
7
  import 'node:fs';
8
8
  import 'node:path';
9
9
  import 'node:os';
@@ -69,4 +69,4 @@ var GET = async ({ url }) => {
69
69
  };
70
70
 
71
71
  export { GET };
72
- //# sourceMappingURL=_server.ts.js-D0HYWO9M.js.map
72
+ //# sourceMappingURL=_server.ts.js-zYBj_jzG.js.map
@@ -1,9 +1,9 @@
1
- import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DjwmUFoE.js';
2
- import { g as gitGateEnabled } from '../../../../../chunks/git-probe.js-BGOqAXVt.js';
1
+ import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DawPog_I.js';
2
+ import { g as gitGateEnabled } from '../../../../../chunks/git-probe.js-D5q52JMr.js';
3
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
4
- import '../../../../../chunks/config.js-BvW5LrfQ.js';
5
- import '../../../../../chunks/insight-config.js-CmCFt2Kp.js';
6
- import '../../../../../chunks/settings-document.js-i5MkkSFH.js';
4
+ import '../../../../../chunks/config.js-B0w1-uCA.js';
5
+ import '../../../../../chunks/insight-config.js-DiF58x83.js';
6
+ import '../../../../../chunks/settings-document.js-BRTO59Al.js';
7
7
  import 'node:fs';
8
8
  import 'node:path';
9
9
  import 'node:os';
@@ -51,4 +51,4 @@ var GET = async ({ url }) => {
51
51
  };
52
52
 
53
53
  export { GET };
54
- //# sourceMappingURL=_server.ts.js-Boi1Sn8U.js.map
54
+ //# sourceMappingURL=_server.ts.js-BbgR18Zo.js.map
@@ -1,5 +1,5 @@
1
- import { U as UI_LOCALES } from '../chunks/config.js-BvW5LrfQ.js';
2
- import { r as readSettingsDocument } from '../chunks/settings-document.js-i5MkkSFH.js';
1
+ import { U as UI_LOCALES } from '../chunks/config.js-B0w1-uCA.js';
2
+ import { r as readSettingsDocument } from '../chunks/settings-document.js-BRTO59Al.js';
3
3
  import { g as getServerAsyncLocalStorage, i as isExcludedByRouteStrategy, s as serverAsyncLocalStorage, a as getStrategyForUrl, b as shouldRedirect, d as deLocalizeUrl, o as overwriteServerAsyncLocalStorage } from '../chunks/runtime.js-CCJi3XaY.js';
4
4
  import { parse } from 'yaml';
5
5
  import 'node:fs';
@@ -304,4 +304,4 @@ var handle = async ({ event, resolve }) => {
304
304
  };
305
305
 
306
306
  export { handle };
307
- //# sourceMappingURL=hooks.server.js-Bt6VP5fg.js.map
307
+ //# sourceMappingURL=hooks.server.js-BSnc9oHw.js.map
@@ -1,10 +1,10 @@
1
1
  import { V as head, W as escape_html, y as derived } from '../../chunks/server.js-11-pxAWV.js';
2
- import { t, p as page, s as sessionnotfound2, r as reapednote1, d as dshunreachable1, u as unexpectederror1, b as backtoworkspace2 } from '../../chunks/state.js-BKUnFOB4.js';
2
+ import { t, p as page, s as sessionnotfound2, r as reapednote1, d as dshunreachable1, u as unexpectederror1, b as backtoworkspace2 } from '../../chunks/state.js-BPfg8KK0.js';
3
3
  import '../../chunks/uneval.js-BJ9Qq2SF.js';
4
- import '../../chunks/internal.js-D-70iBmc.js';
4
+ import '../../chunks/internal.js-Cr424dfu.js';
5
5
  import '../../chunks/shared.js-HQ0rfhm4.js';
6
6
  import '../../chunks/exports.js-DH_tjtdv.js';
7
- import '../../chunks/config.js-BvW5LrfQ.js';
7
+ import '../../chunks/config.js-B0w1-uCA.js';
8
8
  import '../../chunks/runtime.js-CCJi3XaY.js';
9
9
  import '../../chunks/utils.js-CAdNO8Tu.js';
10
10
 
@@ -40,4 +40,4 @@ function _error($$renderer, $$props) {
40
40
  }
41
41
 
42
42
  export { _error as default };
43
- //# sourceMappingURL=_error.svelte.js-Bee5xNts.js.map
43
+ //# sourceMappingURL=_error.svelte.js-izlnhqFW.js.map
@@ -1,4 +1,4 @@
1
- import { g as getDshConnection, D as DshRpcError, i as isSubagentRejection } from '../../chunks/dsh-connection.js-DjwmUFoE.js';
1
+ import { g as getDshConnection, D as DshRpcError, i as isSubagentRejection } from '../../chunks/dsh-connection.js-DawPog_I.js';
2
2
  import { h as historyToEvents, e as eventsToEntries } from '../../chunks/dsh-events.js-DEZgATm-.js';
3
3
  import { p as permissionFromProjection, f as filterKnobEvents } from '../../chunks/permission-state.js-B7UpAHBv.js';
4
4
  import { i as imageLimitsFromProjection } from '../../chunks/image-limits.js-CUdJ0f7r.js';
@@ -83,4 +83,4 @@ var _page_server_ts = /*#__PURE__*/Object.freeze({
83
83
  });
84
84
 
85
85
  export { _page_server_ts as _ };
86
- //# sourceMappingURL=_page.server.ts.js-DdzOMHcO.js.map
86
+ //# sourceMappingURL=_page.server.ts.js-CNmIVlOY.js.map