@deepseek-insight/dsi 0.6.21 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dsi.mjs +16 -8
- package/bin/lib/dev-mode.mjs +6 -2
- package/build/client/_app/immutable/assets/0.c2dRYi3B.css +2 -0
- package/build/client/_app/immutable/assets/2.DBblYO_a.css +1 -0
- package/build/client/_app/immutable/chunks/C0CuJuob.js +1 -0
- package/build/client/_app/immutable/chunks/{DygY_IXG.js → CvvYpRG9.js} +1 -1
- package/build/client/_app/immutable/chunks/D-Rolhzs.js +1 -0
- package/build/client/_app/immutable/chunks/{BtiOY3LQ.js → DpSjzsDs.js} +2 -2
- package/build/client/_app/immutable/chunks/GMyoOYdi.js +6 -0
- package/build/client/_app/immutable/chunks/J_8-FdbR.js +1 -0
- package/build/client/_app/immutable/entry/{app.a14BvSUo.js → app.GsYnI6xk.js} +2 -2
- package/build/client/_app/immutable/entry/start.keNjq0dA.js +1 -0
- package/build/client/_app/immutable/nodes/{0.BE97Xr19.js → 0.BJVfjaPJ.js} +1 -1
- package/build/client/_app/immutable/nodes/{1.BKoLqRXA.js → 1.rhLd5ssJ.js} +1 -1
- package/build/client/_app/immutable/nodes/2.DdzHBwFT.js +340 -0
- package/build/client/_app/version.json +1 -1
- package/build/handler.js +4 -4
- package/build/index.js +4 -4
- package/build/server/chunks/chunks/{app-config.svelte.js-D7wkLUkK.js → app-config.svelte.js-BM4WbMFB.js} +5 -3
- package/build/server/chunks/chunks/{config.js-B0w1-uCA.js → config.js-vThvQeMn.js} +12 -3
- package/build/server/chunks/chunks/{db.js-DRhjT6xK.js → db.js-B8BUpxGM.js} +2 -2
- package/build/server/chunks/chunks/{db2.js-DUta2B-n.js → db2.js-CNe3I_g2.js} +2 -2
- package/build/server/chunks/chunks/{dsh-connection.js-DL5qjlq2.js → dsh-connection.js-xltcocWy.js} +181 -4
- package/build/server/chunks/chunks/{git-probe.js-6ARRicD2.js → git-probe.js-CUsTmhmV.js} +2 -2
- package/build/server/chunks/chunks/{insight-config.js-CA-iT3lB.js → insight-config.js-CaHHJpFK.js} +41 -5
- package/build/server/chunks/chunks/{internal2.js-Bcxjr5x2.js → internal2.js-BtL7AFjQ.js} +3 -3
- package/build/server/chunks/chunks/registry.js-BTiJ1Kaj.js +577 -0
- package/build/server/chunks/chunks/{registry.js-G1hzOje_.js → registry2.js-D3Pr1Rv9.js} +2 -2
- package/build/server/chunks/chunks/{settings-document.js-BRTO59Al.js → settings-document.js-Gw1puaik.js} +2 -2
- package/build/server/chunks/chunks/{state.js-ez_uUx9I.js → state.js-D3ob-Gqa.js} +3 -3
- package/build/server/chunks/chunks/{watcher.js-Dogr6xsl.js → watcher.js-DcT3cS4v.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/a2a/_id_/{_server.ts.js-CpeC2QLb.js → _server.ts.js-19pFOjH8.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-BkLuKDZr.js → _server.ts.js-BcUn6axe.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-BOyrp9zt.js → _server.ts.js-oMpzLZoy.js} +7 -7
- package/build/server/chunks/entries/endpoints/api/browser/_id_/close/_server.ts.js-DC3qPMQS.js +32 -0
- package/build/server/chunks/entries/endpoints/api/browser/_id_/input/_server.ts.js-CHNcK7BH.js +78 -0
- package/build/server/chunks/entries/endpoints/api/browser/_id_/mcp/_server.ts.js-CYkOJL2O.js +50 -0
- package/build/server/chunks/entries/endpoints/api/browser/_id_/navigate/_server.ts.js-DHTDi8KR.js +62 -0
- package/build/server/chunks/entries/endpoints/api/browser/_id_/page/_server.ts.js-Y5khEC2l.js +33 -0
- package/build/server/chunks/entries/endpoints/api/browser/_id_/stream/_server.ts.js-BmjgfZD2.js +74 -0
- package/build/server/chunks/entries/endpoints/api/browser/_id_/viewport/_server.ts.js-IxS-goi1.js +42 -0
- package/build/server/chunks/entries/endpoints/api/browser/_server.ts.js-6STmJ7FD.js +37 -0
- package/build/server/chunks/entries/endpoints/api/config/{_server.ts.js-BG78X__J.js → _server.ts.js-BVyx8gPc.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-Cae4x1c7.js → _server.ts.js-CNJbv6CC.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/jobs/{_server.ts.js-hGmoSsDv.js → _server.ts.js-CDWmXDJX.js} +37 -5
- package/build/server/chunks/entries/endpoints/api/dsh/jobs/follow/_server.ts.js-BDXQcQSL.js +56 -0
- package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-BLb8o1cY.js → _server.ts.js-CgedtzOg.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-BFeDKrPz.js → _server.ts.js-ut2pK15B.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-DmSTTfI5.js → _server.ts.js-Ct2W7g4c.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-Cus9XrC9.js → _server.ts.js-Rke3V_qh.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-DcrNU0_y.js → _server.ts.js-BYHm5WBA.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/changes/{_server.ts.js-CpuEcp6p.js → _server.ts.js-B_bEUKkt.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-CU9o8Tho.js → _server.ts.js-D78fGUQk.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-LWw-YpVI.js → _server.ts.js-CgB_c7zG.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-BMMZlvr7.js → _server.ts.js-dVaW22_K.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-DZ6qFrfm.js → _server.ts.js-Dl8SBXdH.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-CYt4aYoc.js → _server.ts.js-BKDiwMIE.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-CPZuvN-_.js → _server.ts.js-D3FY2Wxt.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/path/{_server.ts.js-_SIiC8sn.js → _server.ts.js-BWuIEdjl.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-Dcfp7gSm.js → _server.ts.js-CeiQFOGP.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-CmxqUwLT.js → _server.ts.js-lMofZOns.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-DCNKXRwy.js → _server.ts.js-CNalVHrK.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-AURyR2ll.js → _server.ts.js-I2s8qvcV.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-BVF36vTO.js → _server.ts.js-DTKELD7v.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-LX3JZbRr.js → _server.ts.js-BXSD__Gg.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js-BJ0d199o.js → _server.ts.js-C9IZl2Qh.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-BDy9jQXv.js → _server.ts.js-BRXu3UtL.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-DoTpSXIc.js → _server.ts.js-DmnpiaD2.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-BnfIobo7.js → _server.ts.js-C5qCdsdm.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-KRyjIODB.js → _server.ts.js-BVUn49yf.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/prompts/_id_/{_server.ts.js-bRLZ5TWI.js → _server.ts.js-DuCOsoF0.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/prompts/{_server.ts.js-ChzWZoFk.js → _server.ts.js-2mcRY7IP.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/prompts/use/{_server.ts.js-DdH5QmPS.js → _server.ts.js-DZjaHZxU.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/settings/{_server.ts.js-DwGQj520.js → _server.ts.js-DTVmsohJ.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/terminal/_id_/output/{_server.ts.js-m6Cug5hN.js → _server.ts.js-BNBxebgG.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/terminal/_id_/reattach/{_server.ts.js-wSsMKLiw.js → _server.ts.js-DDRJBGIr.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/terminal/_id_/send/{_server.ts.js-CTc5xP72.js → _server.ts.js-CA0vc_Cm.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/terminal/_id_/stream/{_server.ts.js-C8PLMU0Y.js → _server.ts.js-D6L8Gd_f.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/terminal/{_server.ts.js-CwXC6Stk.js → _server.ts.js-DZXTArj7.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/workspace/file-write/{_server.ts.js-CWWi0aa8.js → _server.ts.js-LSc5EKH7.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/workspace/git-events/{_server.ts.js-Dc0g7HPl.js → _server.ts.js-DNjiScBe.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/{_server.ts.js-CvPoP9yH.js → _server.ts.js-CHMbLoSn.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/workspace/git-map/{_server.ts.js-f5Gk_lb6.js → _server.ts.js-BgM4JEAm.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/workspace/git-status/{_server.ts.js-BMkKlCgS.js → _server.ts.js-BH0cLS8o.js} +6 -6
- package/build/server/chunks/entries/endpoints/api/workspace/write-gate/{_server.ts.js-DUL-2q1R.js → _server.ts.js-BzlV3cVT.js} +6 -6
- package/build/server/chunks/entries/{hooks.server.js-BSnc9oHw.js → hooks.server.js-B-e4_ekh.js} +3 -3
- package/build/server/chunks/entries/pages/{_error.svelte.js-DDQEX5e3.js → _error.svelte.js-9cKDDMkE.js} +4 -4
- package/build/server/chunks/entries/pages/{_page.server.ts.js-DFRnK-I2.js → _page.server.ts.js-DttLUwdf.js} +2 -2
- package/build/server/chunks/entries/pages/{_page.svelte.js-DrMNc6ih.js → _page.svelte.js-hjZYZCe1.js} +10507 -9470
- package/build/server/chunks/{handler-Cqw6zPgE.js → handler-B_azsHTz.js} +3 -3
- package/build/server/chunks/{index.js-CZ6hvqti.js → index.js-3VY3QWe-.js} +2 -2
- package/build/server/chunks/{manifest.js-SFcYF8ua.js → manifest.js-hHcXduh_.js} +113 -50
- package/build/server/chunks/nodes/{0.js-BqYWZcQy.js → 0.js-B_LVBEe8.js} +3 -3
- package/build/server/chunks/nodes/1.js-BRybp38b.js +9 -0
- package/build/server/chunks/nodes/{2.js-CnybOb74.js → 2.js-bVRsbAhW.js} +9 -9
- package/package.json +4 -1
- package/skills/dsi-pattern-thin/SKILL.md +116 -0
- package/skills/dsi-pattern-thin/references/case-study-2026-10-21-conversation-feed-host.md +64 -0
- package/skills/dsi-pattern-thin/references/case-study-2026-10-21-tool-run-row-host.md +66 -0
- package/template/.dsi/prompts.sqlite-shm +0 -0
- package/template/.dsi/prompts.sqlite-wal +0 -0
- package/build/client/_app/immutable/assets/0.BQzh2ktU.css +0 -2
- package/build/client/_app/immutable/assets/2.ByYVysCj.css +0 -1
- package/build/client/_app/immutable/chunks/6lkFuaQJ.js +0 -1
- package/build/client/_app/immutable/chunks/Ct20Yiq1.js +0 -1
- package/build/client/_app/immutable/chunks/D6mTYwDH.js +0 -6
- package/build/client/_app/immutable/chunks/DlfWhx6l.js +0 -1
- package/build/client/_app/immutable/entry/start.DwHZM5ia.js +0 -1
- package/build/client/_app/immutable/nodes/2.CSRBDmmw.js +0 -337
- package/build/server/chunks/nodes/1.js-CoGgQITW.js +0 -9
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { c as readA2aConfig } from '../../../../../chunks/insight-config.js-
|
|
2
|
-
import { g as getDshConnection } from '../../../../../chunks/dsh-connection.js-
|
|
3
|
-
import { c as configureWatcher, r as registerWatch } from '../../../../../chunks/watcher.js-
|
|
1
|
+
import { c as readA2aConfig } from '../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
2
|
+
import { g as getDshConnection } from '../../../../../chunks/dsh-connection.js-xltcocWy.js';
|
|
3
|
+
import { c as configureWatcher, r as registerWatch } from '../../../../../chunks/watcher.js-DcT3cS4v.js';
|
|
4
4
|
import { m as mintA2aId } from '../../../../../chunks/a2a-protocol.js-C77mVg2Q.js';
|
|
5
5
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
6
|
-
import '../../../../../chunks/config.js-
|
|
7
|
-
import '../../../../../chunks/settings-document.js-
|
|
6
|
+
import '../../../../../chunks/config.js-vThvQeMn.js';
|
|
7
|
+
import '../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
8
8
|
import 'node:fs';
|
|
9
9
|
import 'node:path';
|
|
10
10
|
import 'node:os';
|
|
11
11
|
import 'yaml';
|
|
12
12
|
import '../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
13
|
-
import '../../../../../chunks/db.js-
|
|
13
|
+
import '../../../../../chunks/db.js-B8BUpxGM.js';
|
|
14
14
|
import 'node:sqlite';
|
|
15
15
|
import '../../../../../chunks/dsh-events.js-CGuF_had.js';
|
|
16
16
|
import '../../../../../chunks/merge.js-yMwW440S.js';
|
|
@@ -99,4 +99,4 @@ var POST = async ({ request }) => {
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
export { POST };
|
|
102
|
-
//# sourceMappingURL=_server.ts.js-
|
|
102
|
+
//# sourceMappingURL=_server.ts.js-oMpzLZoy.js.map
|
package/build/server/chunks/entries/endpoints/api/browser/_id_/close/_server.ts.js-DC3qPMQS.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { b as browserRegistry } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/close/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/close — the D8 owner-release endpoint.
|
|
20
|
+
* Kills the MCP child, the CDP session, the headed Chromium; frees the port;
|
|
21
|
+
* removes the registry entry. Idempotent: closing a gone session is 200.
|
|
22
|
+
*/
|
|
23
|
+
var POST = async (ctx) => {
|
|
24
|
+
const r = await browserRegistry.close(ctx.params.id);
|
|
25
|
+
return json({
|
|
26
|
+
ok: r.ok,
|
|
27
|
+
alreadyClosed: r.alreadyClosed
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { POST };
|
|
32
|
+
//# sourceMappingURL=_server.ts.js-DC3qPMQS.js.map
|
package/build/server/chunks/entries/endpoints/api/browser/_id_/input/_server.ts.js-CHNcK7BH.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { b as browserRegistry, B as BrowserRegistryRefusal } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/input/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/input — the pointer/keyboard dispatcher (Wave 1, 1.4).
|
|
20
|
+
* Body is a validated InputDispatch (mouse | key | text) in ALREADY-SCALED
|
|
21
|
+
* CSS-pixel coordinates — the panel owns the displayed÷viewport math (D6).
|
|
22
|
+
* 409 CLOSED after panel-close (D8); 404 NO_SESSION for an unknown id.
|
|
23
|
+
*/
|
|
24
|
+
var MOUSE_TYPES = /* @__PURE__ */ new Set([
|
|
25
|
+
"mousePressed",
|
|
26
|
+
"mouseReleased",
|
|
27
|
+
"mouseMoved",
|
|
28
|
+
"mouseWheel"
|
|
29
|
+
]);
|
|
30
|
+
var KEY_TYPES = /* @__PURE__ */ new Set(["keyDown", "keyUp"]);
|
|
31
|
+
function validate(body) {
|
|
32
|
+
const b = body;
|
|
33
|
+
if (!b || typeof b !== "object") return null;
|
|
34
|
+
if (b.kind === "mouse" && MOUSE_TYPES.has(String(b.type)) && Number.isFinite(b.x) && Number.isFinite(b.y)) return {
|
|
35
|
+
kind: "mouse",
|
|
36
|
+
type: b.type,
|
|
37
|
+
x: Number(b.x),
|
|
38
|
+
y: Number(b.y),
|
|
39
|
+
button: typeof b.button === "string" ? b.button : void 0,
|
|
40
|
+
clickCount: typeof b.clickCount === "number" ? b.clickCount : void 0,
|
|
41
|
+
deltaX: typeof b.deltaX === "number" ? b.deltaX : void 0,
|
|
42
|
+
deltaY: typeof b.deltaY === "number" ? b.deltaY : void 0
|
|
43
|
+
};
|
|
44
|
+
if (b.kind === "key" && KEY_TYPES.has(String(b.type)) && typeof b.key === "string" && typeof b.code === "string") return {
|
|
45
|
+
kind: "key",
|
|
46
|
+
type: b.type,
|
|
47
|
+
key: b.key,
|
|
48
|
+
code: b.code,
|
|
49
|
+
windowsVirtualKeyCode: Number(b.windowsVirtualKeyCode) || 0,
|
|
50
|
+
text: typeof b.text === "string" ? b.text : void 0
|
|
51
|
+
};
|
|
52
|
+
if (b.kind === "text" && typeof b.text === "string" && b.text.length < 4096) return {
|
|
53
|
+
kind: "text",
|
|
54
|
+
text: b.text
|
|
55
|
+
};
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
var POST = async (ctx) => {
|
|
59
|
+
let body;
|
|
60
|
+
try {
|
|
61
|
+
body = await ctx.request.json();
|
|
62
|
+
} catch {
|
|
63
|
+
return json({ error: "BAD_REQUEST" }, { status: 400 });
|
|
64
|
+
}
|
|
65
|
+
const input = validate(body);
|
|
66
|
+
if (!input) return json({ error: "BAD_INPUT" }, { status: 400 });
|
|
67
|
+
try {
|
|
68
|
+
await browserRegistry.dispatch(ctx.params.id, input);
|
|
69
|
+
return json({ ok: true });
|
|
70
|
+
} catch (err) {
|
|
71
|
+
if (err instanceof BrowserRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 409 });
|
|
72
|
+
if (err.name === "RelayClosedError") return json({ error: "CLOSED" }, { status: 409 });
|
|
73
|
+
throw err;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { POST };
|
|
78
|
+
//# sourceMappingURL=_server.ts.js-CHNcK7BH.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { b as browserRegistry, B as BrowserRegistryRefusal } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/mcp/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/mcp — the agent's connection descriptor (Wave 3, 3.3).
|
|
20
|
+
* GET: where the DSH agent's MCP config points for THIS session —
|
|
21
|
+
* { mode, url?, pid? }. The in-process brain serves SSE on the sibling
|
|
22
|
+
* listener; the child mode is stdio (the agent host spawns it itself).
|
|
23
|
+
*/
|
|
24
|
+
var GET = (ctx) => {
|
|
25
|
+
try {
|
|
26
|
+
const info = browserRegistry.list().find((s) => s.id === ctx.params.id);
|
|
27
|
+
if (!info) return json({ error: "NO_SESSION" }, { status: 404 });
|
|
28
|
+
if (info.mcp === "in-process") return json({
|
|
29
|
+
mode: "in-process",
|
|
30
|
+
url: browserRegistry.mcpBrainUrl(ctx.params.id),
|
|
31
|
+
health: info.mcpHealth
|
|
32
|
+
});
|
|
33
|
+
if (info.mcp === "child") return json({
|
|
34
|
+
mode: "stdio",
|
|
35
|
+
command: "npx @playwright/mcp@<pin> --cdp-endpoint http://127.0.0.1:" + info.port,
|
|
36
|
+
pid: info.pid,
|
|
37
|
+
health: info.mcpHealth
|
|
38
|
+
});
|
|
39
|
+
return json({
|
|
40
|
+
mode: "none",
|
|
41
|
+
health: info.mcpHealth
|
|
42
|
+
});
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if (err instanceof BrowserRegistryRefusal) return json({ error: err.code }, { status: 404 });
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { GET };
|
|
50
|
+
//# sourceMappingURL=_server.ts.js-CYkOJL2O.js.map
|
package/build/server/chunks/entries/endpoints/api/browser/_id_/navigate/_server.ts.js-DHTDi8KR.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { b as browserRegistry, B as BrowserRegistryRefusal } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/navigate/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/navigate — drive the mirrored browser's page from the
|
|
20
|
+
* header proxies (ADR-0031 D1–D4): a closed union of { url } (the original
|
|
21
|
+
* address-bar verb, ADR-0029 Wave 2), { action: 'reload' } (D4),
|
|
22
|
+
* { action: 'back' } / { action: 'forward' } (D3). One route, one refusal
|
|
23
|
+
* path; every branch answers the landed page's pageInfo.
|
|
24
|
+
*/
|
|
25
|
+
var URL_OK = /^https?:\/\/|^data:text\/html/;
|
|
26
|
+
var ACTIONS = /* @__PURE__ */ new Set([
|
|
27
|
+
"reload",
|
|
28
|
+
"back",
|
|
29
|
+
"forward"
|
|
30
|
+
]);
|
|
31
|
+
var POST = async (ctx) => {
|
|
32
|
+
let body;
|
|
33
|
+
try {
|
|
34
|
+
body = await ctx.request.json();
|
|
35
|
+
} catch {
|
|
36
|
+
return json({ error: "BAD_REQUEST" }, { status: 400 });
|
|
37
|
+
}
|
|
38
|
+
if (!("url" in body) === !("action" in body)) return json({ error: "BAD_REQUEST" }, { status: 400 });
|
|
39
|
+
try {
|
|
40
|
+
if ("url" in body) {
|
|
41
|
+
if (typeof body.url !== "string" || !URL_OK.test(body.url)) return json({ error: "BAD_URL" }, { status: 400 });
|
|
42
|
+
await browserRegistry.navigate(ctx.params.id, body.url, { waitLoad: true });
|
|
43
|
+
return json({
|
|
44
|
+
...await browserRegistry.pageInfo(ctx.params.id),
|
|
45
|
+
...await browserRegistry.navInfo(ctx.params.id)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (typeof body.action !== "string" || !ACTIONS.has(body.action)) return json({ error: "BAD_ACTION" }, { status: 400 });
|
|
49
|
+
if (body.action === "reload") return json(await browserRegistry.reload(ctx.params.id));
|
|
50
|
+
const info = await browserRegistry.pageHistory(ctx.params.id, body.action);
|
|
51
|
+
return json(info);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
if (err instanceof BrowserRegistryRefusal) return json({
|
|
54
|
+
error: err.code,
|
|
55
|
+
reason: err.message
|
|
56
|
+
}, { status: err.code === "NO_SESSION" ? 404 : 409 });
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { POST };
|
|
62
|
+
//# sourceMappingURL=_server.ts.js-DHTDi8KR.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { b as browserRegistry, B as BrowserRegistryRefusal } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/page/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/page — the active page's { url, title } (Wave 2
|
|
20
|
+
* amendment: the status strip's location read; the e2e's DOM-truth channel).
|
|
21
|
+
*/
|
|
22
|
+
var GET = async (ctx) => {
|
|
23
|
+
if (browserRegistry.isClosed(ctx.params.id)) return json({ error: "CLOSED" }, { status: 409 });
|
|
24
|
+
try {
|
|
25
|
+
return json(await browserRegistry.pageInfo(ctx.params.id));
|
|
26
|
+
} catch (err) {
|
|
27
|
+
if (err instanceof BrowserRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 409 });
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { GET };
|
|
33
|
+
//# sourceMappingURL=_server.ts.js-Y5khEC2l.js.map
|
package/build/server/chunks/entries/endpoints/api/browser/_id_/stream/_server.ts.js-BmjgfZD2.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { b as browserRegistry, B as BrowserRegistryRefusal } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/stream/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/stream — the SSE downstream (Wave 1 task 1.4).
|
|
20
|
+
* Frames: frame (seq + jpeg base64 + metadata), closed. ?fromSeq resumes a
|
|
21
|
+
* late attacher from the latest frame (the terminal fromByte pattern).
|
|
22
|
+
* Cancel arm: client going away MUST drop the subscriber or the next frame
|
|
23
|
+
* enqueues into a dead controller (crash RCA 2026-09-24 lesson).
|
|
24
|
+
*/
|
|
25
|
+
var SSE_HEADERS = {
|
|
26
|
+
"content-type": "text/event-stream",
|
|
27
|
+
"cache-control": "no-store",
|
|
28
|
+
connection: "keep-alive",
|
|
29
|
+
"x-accel-buffering": "no",
|
|
30
|
+
"content-encoding": "identity"
|
|
31
|
+
};
|
|
32
|
+
function sse(event, data) {
|
|
33
|
+
return "event: " + event + "\ndata: " + JSON.stringify(data) + "\n\n";
|
|
34
|
+
}
|
|
35
|
+
var GET = (ctx) => {
|
|
36
|
+
const id = ctx.params.id;
|
|
37
|
+
try {
|
|
38
|
+
browserRegistry.peek(id);
|
|
39
|
+
} catch (err) {
|
|
40
|
+
if (err instanceof BrowserRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 403 });
|
|
41
|
+
throw err;
|
|
42
|
+
}
|
|
43
|
+
const fromSeq = Number(ctx.url.searchParams.get("fromSeq") ?? "0");
|
|
44
|
+
const relay = browserRegistry.relay(id);
|
|
45
|
+
browserRegistry.noteStreamOpen(id);
|
|
46
|
+
const encoder = new TextEncoder();
|
|
47
|
+
const state = { closed: false };
|
|
48
|
+
let off = null;
|
|
49
|
+
const stream = new ReadableStream({
|
|
50
|
+
start(controller) {
|
|
51
|
+
const push = (chunk) => {
|
|
52
|
+
if (state.closed) return;
|
|
53
|
+
try {
|
|
54
|
+
controller.enqueue(encoder.encode(chunk));
|
|
55
|
+
} catch {
|
|
56
|
+
state.closed = true;
|
|
57
|
+
off?.();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const latest = relay.latestFrame();
|
|
61
|
+
if (latest && Number.isFinite(fromSeq) && latest.seq > fromSeq) push(sse("frame", latest));
|
|
62
|
+
off = relay.subscribe((f) => push(sse("frame", f)));
|
|
63
|
+
},
|
|
64
|
+
cancel() {
|
|
65
|
+
state.closed = true;
|
|
66
|
+
off?.();
|
|
67
|
+
browserRegistry.noteStreamClose(id);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return new Response(stream, { headers: SSE_HEADERS });
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { GET };
|
|
74
|
+
//# sourceMappingURL=_server.ts.js-BmjgfZD2.js.map
|
package/build/server/chunks/entries/endpoints/api/browser/_id_/viewport/_server.ts.js-IxS-goi1.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { b as browserRegistry, B as BrowserRegistryRefusal } from '../../../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/[id]/viewport/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser/[id]/viewport — size the mirrored page to the panel's
|
|
20
|
+
* glass box (ADR-0031 amendment 2): the screencast frame then matches
|
|
21
|
+
* the panel, so content renders at native scale, never zoomed. The
|
|
22
|
+
* registry clamps; this route only validates shapes.
|
|
23
|
+
*/
|
|
24
|
+
var POST = async (ctx) => {
|
|
25
|
+
let body;
|
|
26
|
+
try {
|
|
27
|
+
body = await ctx.request.json();
|
|
28
|
+
} catch {
|
|
29
|
+
return json({ error: "BAD_REQUEST" }, { status: 400 });
|
|
30
|
+
}
|
|
31
|
+
if (typeof body.width !== "number" || typeof body.height !== "number" || !Number.isFinite(body.width) || !Number.isFinite(body.height)) return json({ error: "BAD_REQUEST" }, { status: 400 });
|
|
32
|
+
try {
|
|
33
|
+
await browserRegistry.setViewport(ctx.params.id, body.width, body.height);
|
|
34
|
+
return json({ ok: true });
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (err instanceof BrowserRegistryRefusal) return json({ error: err.code }, { status: err.code === "NO_SESSION" ? 404 : 409 });
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { POST };
|
|
42
|
+
//# sourceMappingURL=_server.ts.js-IxS-goi1.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { b as browserRegistry } from '../../../../chunks/registry.js-BTiJ1Kaj.js';
|
|
2
|
+
import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:path';
|
|
8
|
+
import 'node:os';
|
|
9
|
+
import 'yaml';
|
|
10
|
+
import '../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
11
|
+
import 'node:child_process';
|
|
12
|
+
import 'node:crypto';
|
|
13
|
+
import 'playwright-core';
|
|
14
|
+
import '../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/browser/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* /api/browser — the session table (Wave 1 task 1.4).
|
|
20
|
+
* GET lists sessions; POST opens a new headed browser session (D2/D5) and
|
|
21
|
+
* returns { id, port }. The registry owns every refusal.
|
|
22
|
+
*/
|
|
23
|
+
var GET = () => json({ sessions: browserRegistry.list() });
|
|
24
|
+
var POST = async () => {
|
|
25
|
+
try {
|
|
26
|
+
const info = await browserRegistry.open();
|
|
27
|
+
return json(info);
|
|
28
|
+
} catch (e) {
|
|
29
|
+
return json({
|
|
30
|
+
error: "OPEN_FAILED",
|
|
31
|
+
message: e.message
|
|
32
|
+
}, { status: 500 });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { GET, POST };
|
|
37
|
+
//# sourceMappingURL=_server.ts.js-6STmJ7FD.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as resolvePromptsDbPath } from '../../../../chunks/db2.js-
|
|
1
|
+
import { f as readSettingsHomes, g as readJobsConfig, e as readPromptsConfig, h as readSidebarConfig, i as readPanelConfig, c as readA2aConfig, k as readHomeConfig, l as readConversationConfig, m as readChatConfig } from '../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
2
|
+
import { r as resolvePromptsDbPath } from '../../../../chunks/db2.js-CNe3I_g2.js';
|
|
3
3
|
import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import '../../../../chunks/config.js-
|
|
6
|
-
import '../../../../chunks/settings-document.js-
|
|
5
|
+
import '../../../../chunks/config.js-vThvQeMn.js';
|
|
6
|
+
import '../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:path';
|
|
9
9
|
import 'yaml';
|
|
@@ -44,9 +44,10 @@ var GET = async () => {
|
|
|
44
44
|
tags: readPromptsConfig().tags,
|
|
45
45
|
dbPath: collapseHome(resolvePromptsDbPath())
|
|
46
46
|
},
|
|
47
|
+
jobs: readJobsConfig(),
|
|
47
48
|
settingsHomes: readSettingsHomes()
|
|
48
49
|
});
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
export { GET };
|
|
52
|
-
//# sourceMappingURL=_server.ts.js-
|
|
53
|
+
//# sourceMappingURL=_server.ts.js-BVyx8gPc.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-
|
|
1
|
+
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-xltcocWy.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
-
import '../../../../../chunks/config.js-
|
|
4
|
-
import '../../../../../chunks/
|
|
5
|
-
import '../../../../../chunks/settings-document.js-
|
|
3
|
+
import '../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:os';
|
|
@@ -42,4 +42,4 @@ var GET = async ({ url }) => {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export { GET };
|
|
45
|
-
//# sourceMappingURL=_server.ts.js-
|
|
45
|
+
//# sourceMappingURL=_server.ts.js-CNJbv6CC.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-
|
|
1
|
+
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-xltcocWy.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
-
import '../../../../../chunks/config.js-
|
|
4
|
-
import '../../../../../chunks/
|
|
5
|
-
import '../../../../../chunks/settings-document.js-
|
|
3
|
+
import '../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:os';
|
|
@@ -27,7 +27,39 @@ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
|
27
27
|
* POST: job.kill passthrough — body {sessionId, jobId} → {outcome}.
|
|
28
28
|
* The session fence stays server-side; a refusal surfaces verbatim.
|
|
29
29
|
*/
|
|
30
|
+
/** ADR-0032 D3 — the URL-length guard: one batch per tick for ≤50 watched sessions. */
|
|
31
|
+
var JOBS_BATCH_LIMIT = 50;
|
|
30
32
|
var GET = async ({ url }) => {
|
|
33
|
+
const batchParam = url.searchParams.get("sessionIds");
|
|
34
|
+
if (batchParam !== null) {
|
|
35
|
+
const ids = [...new Set(batchParam.split(",").map((s) => s.trim()).filter(Boolean))];
|
|
36
|
+
if (ids.length === 0 || ids.length > JOBS_BATCH_LIMIT) return json({
|
|
37
|
+
ok: false,
|
|
38
|
+
error: {
|
|
39
|
+
code: "bad-session",
|
|
40
|
+
message: `sessionIds must list 1-${JOBS_BATCH_LIMIT} comma-separated session ids`
|
|
41
|
+
}
|
|
42
|
+
}, { status: 400 });
|
|
43
|
+
const rosters = {};
|
|
44
|
+
const relay = getDshConnection().relay;
|
|
45
|
+
for (const id of ids) try {
|
|
46
|
+
relay.touchJobRoster(id);
|
|
47
|
+
const frame = relay.jobRosterSnapshot(id);
|
|
48
|
+
rosters[id] = frame.pending ? {
|
|
49
|
+
jobs: frame.jobs,
|
|
50
|
+
pending: true
|
|
51
|
+
} : { jobs: frame.jobs };
|
|
52
|
+
} catch {
|
|
53
|
+
rosters[id] = {
|
|
54
|
+
jobs: [],
|
|
55
|
+
pending: true
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return json({
|
|
59
|
+
ok: true,
|
|
60
|
+
rosters
|
|
61
|
+
});
|
|
62
|
+
}
|
|
31
63
|
const sessionId = url.searchParams.get("sessionId");
|
|
32
64
|
if (!sessionId) return json({
|
|
33
65
|
ok: false,
|
|
@@ -90,4 +122,4 @@ var POST = async ({ request }) => {
|
|
|
90
122
|
};
|
|
91
123
|
|
|
92
124
|
export { GET, POST };
|
|
93
|
-
//# sourceMappingURL=_server.ts.js-
|
|
125
|
+
//# sourceMappingURL=_server.ts.js-CDWmXDJX.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { g as getDshConnection } from '../../../../../../chunks/dsh-connection.js-xltcocWy.js';
|
|
2
|
+
import '../../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
3
|
+
import '../../../../../../chunks/config.js-vThvQeMn.js';
|
|
4
|
+
import '../../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import 'node:os';
|
|
8
|
+
import 'yaml';
|
|
9
|
+
import '../../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
10
|
+
|
|
11
|
+
//#region src/routes/api/dsh/jobs/follow/+server.ts
|
|
12
|
+
/**
|
|
13
|
+
* api-dsh — GET /api/dsh/jobs/follow?sessionId=…&jobId=…
|
|
14
|
+
*
|
|
15
|
+
* The Job Follower Tab's browser face (ADR-0035 D2/D4): one text/event-stream
|
|
16
|
+
* per subscribed tab. Frames (opened/output/status/error) ride as SSE `data:`
|
|
17
|
+
* lines; the browser's abort closes the stream and unrefs the relay — the
|
|
18
|
+
* last unsubscriber closes the host job.follow stream. Read-only by
|
|
19
|
+
* construction: no POST exists on this route.
|
|
20
|
+
*/
|
|
21
|
+
var GET = ({ url }) => {
|
|
22
|
+
const jobId = url.searchParams.get("jobId") ?? "";
|
|
23
|
+
const owner = url.searchParams.get("sessionId") ?? "";
|
|
24
|
+
if (!jobId) return new Response(JSON.stringify({
|
|
25
|
+
ok: false,
|
|
26
|
+
error: {
|
|
27
|
+
code: "bad-job",
|
|
28
|
+
message: "jobId is required"
|
|
29
|
+
}
|
|
30
|
+
}), { status: 400 });
|
|
31
|
+
const relay = getDshConnection().relay;
|
|
32
|
+
const encoder = new TextEncoder();
|
|
33
|
+
let unsubscribe = null;
|
|
34
|
+
const stream = new ReadableStream({
|
|
35
|
+
start(controller) {
|
|
36
|
+
const send = (event) => {
|
|
37
|
+
try {
|
|
38
|
+
controller.enqueue(encoder.encode("data: " + JSON.stringify(event) + "\n\n"));
|
|
39
|
+
} catch {}
|
|
40
|
+
};
|
|
41
|
+
unsubscribe = relay.subscribeJobFollow(owner, jobId, send);
|
|
42
|
+
},
|
|
43
|
+
cancel() {
|
|
44
|
+
unsubscribe?.();
|
|
45
|
+
unsubscribe = null;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return new Response(stream, { headers: {
|
|
49
|
+
"content-type": "text/event-stream",
|
|
50
|
+
"cache-control": "no-cache",
|
|
51
|
+
connection: "keep-alive"
|
|
52
|
+
} });
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { GET };
|
|
56
|
+
//# sourceMappingURL=_server.ts.js-BDXQcQSL.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-
|
|
1
|
+
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-xltcocWy.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
-
import '../../../../../chunks/config.js-
|
|
4
|
-
import '../../../../../chunks/
|
|
5
|
-
import '../../../../../chunks/settings-document.js-
|
|
3
|
+
import '../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:os';
|
|
@@ -35,4 +35,4 @@ var POST = async ({ request }) => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export { POST };
|
|
38
|
-
//# sourceMappingURL=_server.ts.js-
|
|
38
|
+
//# sourceMappingURL=_server.ts.js-CgedtzOg.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-
|
|
1
|
+
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-xltcocWy.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
-
import '../../../../../chunks/config.js-
|
|
4
|
-
import '../../../../../chunks/
|
|
5
|
-
import '../../../../../chunks/settings-document.js-
|
|
3
|
+
import '../../../../../chunks/insight-config.js-CaHHJpFK.js';
|
|
4
|
+
import '../../../../../chunks/config.js-vThvQeMn.js';
|
|
5
|
+
import '../../../../../chunks/settings-document.js-Gw1puaik.js';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import 'node:os';
|
|
@@ -32,4 +32,4 @@ var GET = async () => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export { GET };
|
|
35
|
-
//# sourceMappingURL=_server.ts.js-
|
|
35
|
+
//# sourceMappingURL=_server.ts.js-ut2pK15B.js.map
|