@deepseek-insight/dsi 0.6.17 → 0.6.18
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/README.md +2 -2
- package/bin/lib/dev-mode.mjs +8 -0
- package/build/client/_app/immutable/assets/2.C7lNCQCV.css +1 -0
- package/build/client/_app/immutable/chunks/{CuWK-Is9.js → Bqotzgnw.js} +1 -1
- package/build/client/_app/immutable/chunks/{CBpybevN.js → CtUqZStl.js} +2 -2
- package/build/client/_app/immutable/chunks/D-YP16Kb.js +1 -0
- package/build/client/_app/immutable/chunks/D21lpWN6.js +1 -0
- package/build/client/_app/immutable/entry/{app.rnAj22Bt.js → app.CGvLdbvX.js} +2 -2
- package/build/client/_app/immutable/entry/start.-NibTCMf.js +1 -0
- package/build/client/_app/immutable/nodes/{1.CEJdtANo.js → 1.CiNEHoEh.js} +1 -1
- package/build/client/_app/immutable/nodes/{2.D-He2bY-.js → 2.5NpWuIn7.js} +219 -219
- 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/{dsh-connection.js-DvncrWM4.js → dsh-connection.js-DL5qjlq2.js} +211 -6
- package/build/server/chunks/chunks/{dsh-events.js-B_E1BU9F.js → dsh-events.js-35seDLwL.js} +3 -1
- package/build/server/chunks/chunks/{engine.js-1gYqtdBP.js → engine.js-EfjwaLzA.js} +2 -2
- package/build/server/chunks/chunks/{git-probe.js-S9w9gGXE.js → git-probe.js-D4DjBXSY.js} +3 -3
- package/build/server/chunks/chunks/{internal2.js-Uh9eeZMM.js → internal2.js-C4ukUWRE.js} +2 -2
- package/build/server/chunks/chunks/{state.js-5SpXEMQf.js → state.js-OSxIx7MQ.js} +2 -2
- package/build/server/chunks/chunks/{watcher.js-BfZOp5td.js → watcher.js-CACduBB9.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-D9vpMh8K.js → _server.ts.js-DHFHuGSm.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-HPJEmfbv.js → _server.ts.js-CUUfDBcc.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-BaAmRXrU.js → _server.ts.js-Cae4x1c7.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/jobs/_server.ts.js-hGmoSsDv.js +93 -0
- package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-D-Ftq5ei.js → _server.ts.js-BLb8o1cY.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-C0_j53OW.js → _server.ts.js-BFeDKrPz.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-CxMvUVdS.js → _server.ts.js-DmSTTfI5.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-CfjRtKMp.js → _server.ts.js-Cus9XrC9.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-D7uC5b_j.js → _server.ts.js-DcrNU0_y.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/changes/{_server.ts.js-TeoUfrIl.js → _server.ts.js-CpuEcp6p.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-uqUb-EdM.js → _server.ts.js-CU9o8Tho.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-C_DF0fAc.js → _server.ts.js-BiAJcPpb.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-BfkqDQXU.js → _server.ts.js-BMMZlvr7.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-vCfxCACS.js → _server.ts.js-DZ6qFrfm.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-DJlpW4hl.js → _server.ts.js-ecbtat_C.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-Cqn5ZMGh.js → _server.ts.js-CPZuvN-_.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-ChB_0ZdM.js → _server.ts.js-Dcfp7gSm.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-BVHypcWF.js → _server.ts.js-CmxqUwLT.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-BwDVfVrR.js → _server.ts.js-DCNKXRwy.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-DRmd83Ea.js → _server.ts.js-AURyR2ll.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-hc61Nb64.js → _server.ts.js-BVF36vTO.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-xkp4IT7y.js → _server.ts.js-LX3JZbRr.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js-BvPKBiTg.js → _server.ts.js-BJ0d199o.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-BSsF01K6.js → _server.ts.js-BDy9jQXv.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-DNLxFs1R.js → _server.ts.js-DoTpSXIc.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-5jaRPaKn.js → _server.ts.js-BnfIobo7.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-A-hvBqyy.js → _server.ts.js-KRyjIODB.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/apply/{_server.ts.js-NZ9IorXC.js → _server.ts.js-D-m-ci1C.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/reload/{_server.ts.js-Ct28d7_t.js → _server.ts.js-BwingoJE.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/plugins/snapshot/{_server.ts.js-DswGIO4S.js → _server.ts.js-50wKeeCi.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/workspace/file-write/{_server.ts.js-C0x68iMD.js → _server.ts.js-Cb7X2G82.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/workspace/git-events/{_server.ts.js-DzdGKZdV.js → _server.ts.js-DZ67v729.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/{_server.ts.js-BC1jb3zy.js → _server.ts.js-BuO5Stmm.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/workspace/git-map/{_server.ts.js-BE9XJyhN.js → _server.ts.js-Bb_I5Ze7.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/workspace/git-status/{_server.ts.js-CWlGtOu8.js → _server.ts.js-cHWxh5VB.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/workspace/write-gate/{_server.ts.js-CgcggNrH.js → _server.ts.js-Blcfn0zm.js} +4 -4
- package/build/server/chunks/entries/pages/{_error.svelte.js-5nTeAv_j.js → _error.svelte.js-2wYgv54Z.js} +3 -3
- package/build/server/chunks/entries/pages/{_page.server.ts.js-CbzURHkB.js → _page.server.ts.js-C_ydvzuE.js} +3 -3
- package/build/server/chunks/entries/pages/{_page.svelte.js-DhwtRb8h.js → _page.svelte.js-BvcQOPvs.js} +472 -7
- package/build/server/chunks/{handler-Bx0HQRi_.js → handler-D0h_ogA5.js} +3 -3
- package/build/server/chunks/{index.js-DlqGbs2e.js → index.js-C43GYBhl.js} +2 -2
- package/build/server/chunks/{manifest.js-C5Epl_0n.js → manifest.js-DN0QODc_.js} +46 -39
- package/build/server/chunks/nodes/1.js-Da_l90xT.js +9 -0
- package/build/server/chunks/nodes/{2.js-rGsgHmCd.js → 2.js-_OZDbZ-E.js} +7 -7
- package/package.json +4 -4
- package/skills/dsi-add-plugin/references/allowbuilds-template.md +1 -1
- package/skills/dsi-sync/SKILL.md +8 -8
- package/template/.dsi/prompts.sqlite-shm +0 -0
- package/template/.dsi/prompts.sqlite-wal +0 -0
- package/template/.dsi/resources/plugins-reff.md +1 -1
- package/template/.dsi/resources/skills-reff.md +1 -1
- package/build/client/_app/immutable/assets/2.yPxdQ-n0.css +0 -1
- package/build/client/_app/immutable/chunks/BwzVWUYp.js +0 -1
- package/build/client/_app/immutable/chunks/gD0YbXxV.js +0 -1
- package/build/client/_app/immutable/entry/start.BZMX9WpT.js +0 -1
- package/build/server/chunks/nodes/1.js-BBFJCoA_.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1792184999340"}
|
package/build/handler.js
CHANGED
|
@@ -2,9 +2,9 @@ import './shims.js';
|
|
|
2
2
|
import 'node:fs';
|
|
3
3
|
import 'node:path';
|
|
4
4
|
import 'node:process';
|
|
5
|
-
export { h as handler } from './server/chunks/handler-
|
|
6
|
-
import './server/chunks/index.js-
|
|
7
|
-
import './server/chunks/manifest.js-
|
|
5
|
+
export { h as handler } from './server/chunks/handler-D0h_ogA5.js';
|
|
6
|
+
import './server/chunks/index.js-C43GYBhl.js';
|
|
7
|
+
import './server/chunks/manifest.js-DN0QODc_.js';
|
|
8
8
|
import './env.js';
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
import 'node:crypto';
|
|
@@ -19,6 +19,6 @@ import 'node:url';
|
|
|
19
19
|
import './server/chunks/chunks/index-server.js-CV2lq-ha.js';
|
|
20
20
|
import './server/chunks/chunks/server.js-DqHGsQU2.js';
|
|
21
21
|
import './server/chunks/chunks/internal.js-BcS47nI-.js';
|
|
22
|
-
import './server/chunks/chunks/internal2.js-
|
|
22
|
+
import './server/chunks/chunks/internal2.js-C4ukUWRE.js';
|
|
23
23
|
import './server/chunks/chunks/exports.js-DH_tjtdv.js';
|
|
24
24
|
//# sourceMappingURL=handler.js.map
|
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import http from 'node:http';
|
|
2
2
|
import fs__default from 'node:fs';
|
|
3
3
|
import process from 'node:process';
|
|
4
|
-
import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-
|
|
4
|
+
import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-D0h_ogA5.js';
|
|
5
5
|
import { env, timeout_env } from './env.js';
|
|
6
6
|
import { rm } from 'node:fs/promises';
|
|
7
7
|
import './shims.js';
|
|
@@ -14,13 +14,13 @@ import 'node:stream';
|
|
|
14
14
|
import './server/chunks/chunks/shared.js-HQ0rfhm4.js';
|
|
15
15
|
import './server/chunks/chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
16
|
import './server/chunks/chunks/utils.js-CAdNO8Tu.js';
|
|
17
|
-
import './server/chunks/index.js-
|
|
17
|
+
import './server/chunks/index.js-C43GYBhl.js';
|
|
18
18
|
import './server/chunks/chunks/index-server.js-CV2lq-ha.js';
|
|
19
19
|
import './server/chunks/chunks/server.js-DqHGsQU2.js';
|
|
20
20
|
import './server/chunks/chunks/internal.js-BcS47nI-.js';
|
|
21
|
-
import './server/chunks/chunks/internal2.js-
|
|
21
|
+
import './server/chunks/chunks/internal2.js-C4ukUWRE.js';
|
|
22
22
|
import './server/chunks/chunks/exports.js-DH_tjtdv.js';
|
|
23
|
-
import './server/chunks/manifest.js-
|
|
23
|
+
import './server/chunks/manifest.js-DN0QODc_.js';
|
|
24
24
|
import 'node:url';
|
|
25
25
|
|
|
26
26
|
const path = env('SOCKET_PATH', false);
|
package/build/server/chunks/chunks/{dsh-connection.js-DvncrWM4.js → dsh-connection.js-DL5qjlq2.js}
RENAMED
|
@@ -118,7 +118,8 @@ var DSH_METHODS = {
|
|
|
118
118
|
* workspace-file/not-text. Same refusals as read.
|
|
119
119
|
*/
|
|
120
120
|
workspaceFileReadBytes: "workspaceFiles/readBytes",
|
|
121
|
-
workspaceFileList: "workspaceFiles/list"
|
|
121
|
+
workspaceFileList: "workspaceFiles/list",
|
|
122
|
+
jobKill: "job/kill"
|
|
122
123
|
};
|
|
123
124
|
/** Args builders — one per endpoint, pinned to the live-probed shapes. */
|
|
124
125
|
var DSH_ARGS = {
|
|
@@ -161,12 +162,19 @@ var DSH_ARGS = {
|
|
|
161
162
|
path
|
|
162
163
|
}),
|
|
163
164
|
/** Flat args like the read — WorkspaceByteRange {offset, length}, 0-based
|
|
164
|
-
* bytes;
|
|
165
|
+
* bytes; {} = the host's window defaults. */
|
|
165
166
|
workspaceFileReadBytes: (sessionId, path, range) => ({
|
|
166
167
|
workspaceFileScopeId: sessionId,
|
|
167
168
|
path,
|
|
168
169
|
range: range ?? {}
|
|
169
|
-
})
|
|
170
|
+
}),
|
|
171
|
+
/** Jobs (Job Badge Wave 1): request-wrapped like skillsList —
|
|
172
|
+
* job/list {request:{sessionId}}, job/kill {request:{sessionId, jobId}}. */
|
|
173
|
+
jobList: (sessionId) => ({ request: { sessionId } }),
|
|
174
|
+
jobKill: (sessionId, jobId) => ({ request: {
|
|
175
|
+
sessionId,
|
|
176
|
+
jobId
|
|
177
|
+
} })
|
|
170
178
|
};
|
|
171
179
|
/**
|
|
172
180
|
* The ONE stream carrier (0.1.2): `/api/remote.mux` WebSocket multiplexing
|
|
@@ -796,6 +804,14 @@ var DownlinkManager = class {
|
|
|
796
804
|
workspaceBaselineWaiters = /* @__PURE__ */ new Set();
|
|
797
805
|
/** Subscribes parked while the carrier is CONNECTING (flushed on open). */
|
|
798
806
|
pendingSubscribes = /* @__PURE__ */ new Set();
|
|
807
|
+
/**
|
|
808
|
+
* The Roster Mirror's mux bridge (ADR 2026-10-17 D1/D2): sessions with a
|
|
809
|
+
* job/list logical stream this generation, sessions the server-side watch
|
|
810
|
+
* holds, and sessions parked while the carrier connects.
|
|
811
|
+
*/
|
|
812
|
+
jobRosterStreams = /* @__PURE__ */ new Set();
|
|
813
|
+
jobRosterWatched = /* @__PURE__ */ new Set();
|
|
814
|
+
pendingJobRoster = /* @__PURE__ */ new Set();
|
|
799
815
|
reconnectTimer;
|
|
800
816
|
/** Wave 4.2 — consecutive failed generations; drives the backoff ladder. */
|
|
801
817
|
reconnectAttempt = 0;
|
|
@@ -840,6 +856,8 @@ var DownlinkManager = class {
|
|
|
840
856
|
this.openEventStream(socket);
|
|
841
857
|
this.openStateStream(socket, `workspaces-${String(this.streamSeq)}`, "workspace/follow");
|
|
842
858
|
this.openStateStream(socket, `control-${String(this.streamSeq)}`, "session/control");
|
|
859
|
+
for (const sessionId of this.jobRosterWatched) this.openJobRosterStream(sessionId);
|
|
860
|
+
this.pendingJobRoster.clear();
|
|
843
861
|
}
|
|
844
862
|
/** Open one state stream (workspace/follow | session/control) with empty args. */
|
|
845
863
|
openStateStream(socket, streamId, endpoint) {
|
|
@@ -852,6 +870,47 @@ var DownlinkManager = class {
|
|
|
852
870
|
assistantStream: true
|
|
853
871
|
} } });
|
|
854
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* Open (or ensure) the job/list logical stream for one watched session
|
|
875
|
+
* (ADR 2026-10-17 D1/D2). Parked while the carrier connects; reopened per
|
|
876
|
+
* generation for every watched session; 'end'/'error' drops the tracking
|
|
877
|
+
* entry so the next poll touch reopens and self-heals.
|
|
878
|
+
*/
|
|
879
|
+
openJobRosterStream(sessionId) {
|
|
880
|
+
this.ensureDownlinks();
|
|
881
|
+
this.jobRosterWatched.add(sessionId);
|
|
882
|
+
const socket = this.wsMux;
|
|
883
|
+
if (socket === void 0 || this.opened === false) {
|
|
884
|
+
this.pendingJobRoster.add(sessionId);
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
if (this.jobRosterStreams.has(sessionId)) return;
|
|
888
|
+
this.sendStreamOpen(socket, `jobs-${sessionId}-${String(this.streamSeq)}`, "job/list", { args: { request: { sessionId } } });
|
|
889
|
+
this.jobRosterStreams.add(sessionId);
|
|
890
|
+
}
|
|
891
|
+
/** The reaper's close: stop tracking and tell the carrier (best-effort;
|
|
892
|
+
* a carrier without stream-close semantics just gets ignored items). */
|
|
893
|
+
closeJobRosterStream(sessionId) {
|
|
894
|
+
this.jobRosterWatched.delete(sessionId);
|
|
895
|
+
this.pendingJobRoster.delete(sessionId);
|
|
896
|
+
this.jobRosterStreams.delete(sessionId);
|
|
897
|
+
for (const key of [...this.streamSockets.keys()]) {
|
|
898
|
+
if (!key.startsWith(`jobs-${sessionId}-`)) continue;
|
|
899
|
+
this.streamSockets.delete(key);
|
|
900
|
+
try {
|
|
901
|
+
this.wsMux?.send?.(JSON.stringify({
|
|
902
|
+
type: "close",
|
|
903
|
+
streamId: key
|
|
904
|
+
}));
|
|
905
|
+
} catch {}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
/** Extract the sessionId from a jobs-<sessionId>-<seq> stream id. */
|
|
909
|
+
jobRosterSessionIdOf(streamId) {
|
|
910
|
+
const rest = streamId.slice(5);
|
|
911
|
+
const cut = rest.lastIndexOf("-");
|
|
912
|
+
return cut > 0 ? rest.slice(0, cut) : null;
|
|
913
|
+
}
|
|
855
914
|
openEventStream(socket) {
|
|
856
915
|
this.sendStreamOpen(socket, `events-${String(this.streamSeq)}`, REMOTE_EVENT_STREAM_ENDPOINT, REMOTE_EVENT_STREAM_PAYLOAD);
|
|
857
916
|
}
|
|
@@ -890,6 +949,8 @@ var DownlinkManager = class {
|
|
|
890
949
|
this.wsMux = void 0;
|
|
891
950
|
this.opened = false;
|
|
892
951
|
this.streamSockets.clear();
|
|
952
|
+
this.jobRosterStreams.clear();
|
|
953
|
+
this.pendingJobRoster.clear();
|
|
893
954
|
this.projections.clear();
|
|
894
955
|
this.workspaces = [];
|
|
895
956
|
for (const waiter of this.workspaceBaselineWaiters) waiter.resolve();
|
|
@@ -916,9 +977,21 @@ var DownlinkManager = class {
|
|
|
916
977
|
else if (frame.streamId.startsWith("events-")) this.onEventItem(value);
|
|
917
978
|
else if (frame.streamId.startsWith("workspaces-")) this.onWorkspaceItem(value);
|
|
918
979
|
else if (frame.streamId.startsWith("control-")) this.onControlItem(value);
|
|
980
|
+
else if (frame.streamId.startsWith("jobs-")) {
|
|
981
|
+
const sessionId = this.jobRosterSessionIdOf(frame.streamId);
|
|
982
|
+
if (sessionId !== null) this.conn.relay.onJobRosterItem(sessionId, value);
|
|
983
|
+
}
|
|
919
984
|
return;
|
|
920
985
|
}
|
|
921
|
-
if (frame.type === "error")
|
|
986
|
+
if (frame.type === "error") {
|
|
987
|
+
if (frame.streamId.startsWith("jobs-")) {
|
|
988
|
+
const sessionId = this.jobRosterSessionIdOf(frame.streamId);
|
|
989
|
+
if (sessionId !== null) {
|
|
990
|
+
this.conn.relay.onJobRosterStreamError(sessionId, frame.error?.code, frame.error?.message);
|
|
991
|
+
this.jobRosterStreams.delete(sessionId);
|
|
992
|
+
}
|
|
993
|
+
} else this.conn.log(`dsh-connection: stream ${frame.streamId} failed`, frame.error?.code, frame.error?.message);
|
|
994
|
+
}
|
|
922
995
|
this.streamSockets.delete(frame.streamId);
|
|
923
996
|
}
|
|
924
997
|
/** session/follow item: snapshot seeds the baseline; events append; the
|
|
@@ -1226,6 +1299,28 @@ var RpcRelay = class {
|
|
|
1226
1299
|
settledAnswers = /* @__PURE__ */ new Map();
|
|
1227
1300
|
/** Catalog-invalidation registry (Slash Menu W1) — listeners see every arm. */
|
|
1228
1301
|
catalogInvalidated = /* @__PURE__ */ new Set();
|
|
1302
|
+
/** Job roster registry (Job Badge Wave 1) — per-frame fan-out to watchers. */
|
|
1303
|
+
jobRosterListeners = /* @__PURE__ */ new Set();
|
|
1304
|
+
/**
|
|
1305
|
+
* The Roster Mirror (ADR 2026-10-17, The Roster Mirror — D1): the newest
|
|
1306
|
+
* job/list stream frame per session. Authority stays the host registry;
|
|
1307
|
+
* this is the derived copy GET /api/dsh/jobs serves. Pending (no frame
|
|
1308
|
+
* yet) is honest darkness, never a synthesized empty set.
|
|
1309
|
+
*/
|
|
1310
|
+
jobRosterCache = /* @__PURE__ */ new Map();
|
|
1311
|
+
/** Poll-liveness per watched session — the HTTP-native watch (D2): the
|
|
1312
|
+
* browser's 2s poll is the heartbeat; silence past the grace reaps. */
|
|
1313
|
+
jobRosterTouch = /* @__PURE__ */ new Map();
|
|
1314
|
+
/** First stream failure per session logged once (D3 loudness budget). */
|
|
1315
|
+
jobRosterFailureLogged = /* @__PURE__ */ new Set();
|
|
1316
|
+
/** The roster reaper interval (armed on first touch, disarmed at zero). */
|
|
1317
|
+
jobRosterReapTimer;
|
|
1318
|
+
/** Open/close transports wired once by DshConnection (mux bridge). */
|
|
1319
|
+
jobRosterTransport = null;
|
|
1320
|
+
/** Grace before an unpolled session's stream closes (tests shrink it). */
|
|
1321
|
+
jobRosterGraceMs = 1e4;
|
|
1322
|
+
/** Sessions whose stream is believed open — one open per watch period. */
|
|
1323
|
+
jobRosterOpened = /* @__PURE__ */ new Set();
|
|
1229
1324
|
/**
|
|
1230
1325
|
* Parent-address hints for subagent-origin sessions (SubagentAddressHint),
|
|
1231
1326
|
* folded from session.list rows by rawListSessions.
|
|
@@ -1760,6 +1855,107 @@ var RpcRelay = class {
|
|
|
1760
1855
|
return await this.conn.rpc(DSH_METHODS.cancel, DSH_ARGS.cancel({ sessionId }));
|
|
1761
1856
|
}
|
|
1762
1857
|
/**
|
|
1858
|
+
* Subscribe to per-session job roster pushes (mux frame fan-out). Returns
|
|
1859
|
+
* the unsubscribe — the roster store's unwatch MUST call it, or the
|
|
1860
|
+
* listener outlives its row (ADR give-up: streams are refcounted).
|
|
1861
|
+
*/
|
|
1862
|
+
onJobRoster(listener) {
|
|
1863
|
+
this.jobRosterListeners.add(listener);
|
|
1864
|
+
return () => this.jobRosterListeners.delete(listener);
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* Deliver one whole-set roster frame to listeners. Called by the mux push
|
|
1868
|
+
* path (dsh-connection frame switch); a frame REPLACES the session's set —
|
|
1869
|
+
* consumers overwrite, never merge (host JobListFrame contract).
|
|
1870
|
+
*/
|
|
1871
|
+
dispatchJobRoster(sessionId, jobs) {
|
|
1872
|
+
for (const listener of this.jobRosterListeners) listener(sessionId, jobs);
|
|
1873
|
+
}
|
|
1874
|
+
/** Wire the open/close transports (called once by DshConnection). */
|
|
1875
|
+
wireJobRosterTransport(transport) {
|
|
1876
|
+
this.jobRosterTransport = transport;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* One browser poll tick — the HTTP-native watch (D2): touch liveness and
|
|
1880
|
+
* make sure the session's job/list stream is open. The browser store's
|
|
1881
|
+
* refcounted watch lifecycle expresses itself here as a 2s heartbeat;
|
|
1882
|
+
* silence past the grace window is the unwatch.
|
|
1883
|
+
*/
|
|
1884
|
+
touchJobRoster(sessionId) {
|
|
1885
|
+
this.jobRosterTouch.set(sessionId, Date.now());
|
|
1886
|
+
if (!this.jobRosterOpened.has(sessionId)) {
|
|
1887
|
+
this.jobRosterOpened.add(sessionId);
|
|
1888
|
+
this.jobRosterTransport?.open(sessionId);
|
|
1889
|
+
}
|
|
1890
|
+
this.armJobRosterReaper();
|
|
1891
|
+
}
|
|
1892
|
+
/** Arm the reaper lazily; it disarms itself when no session is watched. */
|
|
1893
|
+
armJobRosterReaper() {
|
|
1894
|
+
if (this.jobRosterReapTimer !== void 0) return;
|
|
1895
|
+
this.jobRosterReapTimer = setInterval(() => this.reapJobRosters(), Math.max(1e3, Math.floor(this.jobRosterGraceMs / 2)));
|
|
1896
|
+
this.jobRosterReapTimer.unref?.();
|
|
1897
|
+
}
|
|
1898
|
+
/** Close streams (and drop their caches) for sessions not polled within the grace. */
|
|
1899
|
+
reapJobRosters(now = Date.now()) {
|
|
1900
|
+
for (const [sessionId, last] of this.jobRosterTouch) {
|
|
1901
|
+
if (now - last <= this.jobRosterGraceMs) continue;
|
|
1902
|
+
this.jobRosterTouch.delete(sessionId);
|
|
1903
|
+
this.jobRosterCache.delete(sessionId);
|
|
1904
|
+
this.jobRosterFailureLogged.delete(sessionId);
|
|
1905
|
+
this.jobRosterOpened.delete(sessionId);
|
|
1906
|
+
this.jobRosterTransport?.close(sessionId);
|
|
1907
|
+
}
|
|
1908
|
+
if (this.jobRosterTouch.size === 0 && this.jobRosterReapTimer !== void 0) {
|
|
1909
|
+
clearInterval(this.jobRosterReapTimer);
|
|
1910
|
+
this.jobRosterReapTimer = void 0;
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* One job/list stream item — a whole-set frame (the host frames on open,
|
|
1915
|
+
* then per coalesced commit burst; typert.host.js contract). Replaces the
|
|
1916
|
+
* session's mirror and fans out to the roster listeners.
|
|
1917
|
+
*/
|
|
1918
|
+
onJobRosterItem(sessionId, value) {
|
|
1919
|
+
if (sessionId === "") return;
|
|
1920
|
+
const raw = value;
|
|
1921
|
+
const jobs = Array.isArray(raw) ? raw : Array.isArray(raw?.jobs) ? raw.jobs : null;
|
|
1922
|
+
if (jobs === null) return;
|
|
1923
|
+
this.jobRosterCache.set(sessionId, { jobs });
|
|
1924
|
+
this.dispatchJobRoster(sessionId, jobs);
|
|
1925
|
+
}
|
|
1926
|
+
/** Stream-level failure — logged once per session per watch (D3). */
|
|
1927
|
+
onJobRosterStreamError(sessionId, code, message) {
|
|
1928
|
+
this.jobRosterOpened.delete(sessionId);
|
|
1929
|
+
if (sessionId === "" || this.jobRosterFailureLogged.has(sessionId)) return;
|
|
1930
|
+
this.jobRosterFailureLogged.add(sessionId);
|
|
1931
|
+
this.conn.log("dsh-connection: job/list stream failed", sessionId, code, message);
|
|
1932
|
+
}
|
|
1933
|
+
/**
|
|
1934
|
+
* The mirror's answer for one session: the cached frame, or an honest
|
|
1935
|
+
* pending (D3) — unknown is not empty. Replaces the retired unary
|
|
1936
|
+
* job/list call (RCA 2026-10-17: the host refuses unary on a stream-only
|
|
1937
|
+
* method).
|
|
1938
|
+
*/
|
|
1939
|
+
jobRosterSnapshot(sessionId) {
|
|
1940
|
+
const cached = this.jobRosterCache.get(sessionId);
|
|
1941
|
+
return cached ? {
|
|
1942
|
+
jobs: cached.jobs,
|
|
1943
|
+
pending: false
|
|
1944
|
+
} : {
|
|
1945
|
+
jobs: [],
|
|
1946
|
+
pending: true
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* job.kill passthrough — the human's ONLY direct job verb (ADR fact 6:
|
|
1951
|
+
* starting is always the owner Agent's tool call). The fence stays
|
|
1952
|
+
* server-side: DSI sends the caller's sessionId verbatim and surfaces a
|
|
1953
|
+
* refusal (belongs to another session) instead of masking it.
|
|
1954
|
+
*/
|
|
1955
|
+
async jobKill(sessionId, jobId) {
|
|
1956
|
+
return await this.conn.rpc(DSH_METHODS.jobKill, DSH_ARGS.jobKill(sessionId, jobId));
|
|
1957
|
+
}
|
|
1958
|
+
/**
|
|
1763
1959
|
* POC-3 W3 (3.1) — session.rename {sessionId, title}.
|
|
1764
1960
|
*
|
|
1765
1961
|
* Appends a session/title event with the `user` source — pins the title
|
|
@@ -1996,6 +2192,10 @@ var DshConnection = class {
|
|
|
1996
2192
|
answerReapGraceMs,
|
|
1997
2193
|
staleGenerationRetryMs
|
|
1998
2194
|
});
|
|
2195
|
+
this.relay.wireJobRosterTransport({
|
|
2196
|
+
open: (sessionId) => this.downlinks.openJobRosterStream(sessionId),
|
|
2197
|
+
close: (sessionId) => this.downlinks.closeJobRosterStream(sessionId)
|
|
2198
|
+
});
|
|
1999
2199
|
}
|
|
2000
2200
|
/** Open the stream generation (idempotent) — see DownlinkManager. */
|
|
2001
2201
|
ensureDownlinks() {
|
|
@@ -2039,7 +2239,12 @@ var DshConnection = class {
|
|
|
2039
2239
|
case "question/resolved":
|
|
2040
2240
|
this.relay.registerSettlement(frame);
|
|
2041
2241
|
return;
|
|
2042
|
-
default:
|
|
2242
|
+
default:
|
|
2243
|
+
if (typeof frame?.type === "string" && frame.type.startsWith("job/") && Array.isArray(frame.jobs)) {
|
|
2244
|
+
this.relay.dispatchJobRoster(String(frame.sessionId ?? ""), frame.jobs);
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
this.log("dsh-connection: mux frame ignored", frame?.type);
|
|
2043
2248
|
}
|
|
2044
2249
|
}
|
|
2045
2250
|
/** The session's live tail for the events poll, or null when no attempt
|
|
@@ -2246,4 +2451,4 @@ var DshConnection = class {
|
|
|
2246
2451
|
};
|
|
2247
2452
|
|
|
2248
2453
|
export { DshRpcError as D, isPromptImageMediaType as a, buildPromptContent as b, getDshConnection as g, isSubagentRejection as i, mapRpcFailure as m, statusFor as s };
|
|
2249
|
-
//# sourceMappingURL=dsh-connection.js-
|
|
2454
|
+
//# sourceMappingURL=dsh-connection.js-DL5qjlq2.js.map
|
|
@@ -221,6 +221,8 @@ var SILENT_TYPES = /* @__PURE__ */ new Set([
|
|
|
221
221
|
"goal/change",
|
|
222
222
|
"hook/invoked",
|
|
223
223
|
"hook/result",
|
|
224
|
+
"job/registered",
|
|
225
|
+
"job/settled",
|
|
224
226
|
"llm/retry",
|
|
225
227
|
"llm/retry-started",
|
|
226
228
|
"assistant/attempt",
|
|
@@ -535,4 +537,4 @@ function historyToEvents(history) {
|
|
|
535
537
|
}
|
|
536
538
|
|
|
537
539
|
export { entryForEvent as a, eventsToEntries as e, historyToEvents as h };
|
|
538
|
-
//# sourceMappingURL=dsh-events.js-
|
|
540
|
+
//# sourceMappingURL=dsh-events.js-35seDLwL.js.map
|
|
@@ -29,7 +29,7 @@ var execFileP = promisify(execFile);
|
|
|
29
29
|
* with RACK_GARDEN_PATH / RACK_GARDEN_REPO when the checkout lives elsewhere. */
|
|
30
30
|
function gardenArgs() {
|
|
31
31
|
const gardenPath = process.env.RACK_GARDEN_PATH ?? join(process.cwd(), "plugins");
|
|
32
|
-
const gardenRepo = process.env.RACK_GARDEN_REPO ?? "https://github.com/mitmplay/
|
|
32
|
+
const gardenRepo = process.env.RACK_GARDEN_REPO ?? "https://github.com/mitmplay/dsh-insight";
|
|
33
33
|
return existsSync(gardenPath) ? [
|
|
34
34
|
"--garden",
|
|
35
35
|
gardenPath,
|
|
@@ -109,4 +109,4 @@ function getRackEngine() {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export { RackEngineMissingError as R, RackEngineFailedError as a, getRackEngine as g };
|
|
112
|
-
//# sourceMappingURL=engine.js-
|
|
112
|
+
//# sourceMappingURL=engine.js-EfjwaLzA.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getDshConnection } from './dsh-connection.js-
|
|
2
|
-
import { h as historyToEvents } from './dsh-events.js-
|
|
1
|
+
import { g as getDshConnection } from './dsh-connection.js-DL5qjlq2.js';
|
|
2
|
+
import { h as historyToEvents } from './dsh-events.js-35seDLwL.js';
|
|
3
3
|
import { a as foldKnobs, f as filterKnobEvents, F as FULL_ACCESS_PRESET } from './permission-state.js-B7UpAHBv.js';
|
|
4
4
|
import { promises } from 'node:fs';
|
|
5
5
|
import * as nodePath from 'node:path';
|
|
@@ -216,4 +216,4 @@ async function gitStatus(repo) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
export { GitUnavailableError as G, gitStatus as a, gitFileHead as b, detectRepos as d, gitGateEnabled as g, isInsideRoot as i, parsePorcelainStatus as p, resolveEnclosingRepo as r };
|
|
219
|
-
//# sourceMappingURL=git-probe.js-
|
|
219
|
+
//# sourceMappingURL=git-probe.js-D4DjBXSY.js.map
|
|
@@ -580,7 +580,7 @@ var options = {
|
|
|
580
580
|
app: ({ head, body, assets, nonce, env }) => "<!doctype html>\n<html lang=\"%paraglide.locale%\">\n <head>\n <meta charset=\"utf-8\" />\n <link rel=\"icon\" href=\"" + assets + "/favicon.svg\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <script>\n /* The Three-State Lamp pre-paint (ADR-0023 D3, 2026-10-11): resolve\n * the choice and set html[data-theme] BEFORE the bundle paints —\n * no flash of light on a dark reload. The key 'dsi-theme' is\n * pinned identical to src/lib/utils/theme-prefs.svelte.ts by\n * tests/unit/theme-prefs.test.ts; change both together. */\n try {\n var m = location.search.match(/[?&]profile=([^&]*)/);\n var prof = m ? m[1].replace(/[^A-Za-z0-9_-]/g, '').slice(0, 40) : '';\n var k = 'dsi-theme' + (prof ? '_' + prof : '');\n var t = localStorage.getItem(k);\n if (t !== 'light' && t !== 'dark' && t !== 'system') t = 'system';\n document.documentElement.dataset.theme =\n t === 'dark' || (t === 'system' && window.matchMedia && matchMedia('(prefers-color-scheme: dark)').matches)\n ? 'dark'\n : 'light';\n } catch (e) {\n document.documentElement.dataset.theme = 'light';\n }\n <\/script>\n " + head + "\n </head>\n <body data-sveltekit-preload-data=\"tap\">\n <div style=\"display: contents\">" + body + "</div>\n </body>\n</html>\n",
|
|
581
581
|
error: error_template_default
|
|
582
582
|
},
|
|
583
|
-
version_hash: "
|
|
583
|
+
version_hash: "1g1y6t7"
|
|
584
584
|
};
|
|
585
585
|
async function get_hooks() {
|
|
586
586
|
let handle;
|
|
@@ -603,4 +603,4 @@ async function get_hooks() {
|
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
export { set_public_env as a, set_read_implementation as b, get_hooks as g, options as o, public_env as p, read_implementation as r, set_private_env as s };
|
|
606
|
-
//# sourceMappingURL=internal2.js-
|
|
606
|
+
//# sourceMappingURL=internal2.js-C4ukUWRE.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as index_server_exports } from './index-server.js-CV2lq-ha.js';
|
|
2
2
|
import './shared.js-HQ0rfhm4.js';
|
|
3
|
-
import './internal2.js-
|
|
3
|
+
import './internal2.js-C4ukUWRE.js';
|
|
4
4
|
import './exports.js-DH_tjtdv.js';
|
|
5
5
|
import { U as snapshot, g as getContext, n as noop } from './server.js-DqHGsQU2.js';
|
|
6
6
|
import { U as UI_LOCALES } from './config.js-B0w1-uCA.js';
|
|
@@ -304,4 +304,4 @@ var page = {
|
|
|
304
304
|
};
|
|
305
305
|
|
|
306
306
|
export { afterNavigate as a, backtoworkspace2 as b, currentLocale as c, dshunreachable1 as d, replaceState as e, page as p, reapednote1 as r, sessionnotfound2 as s, t, unexpectederror1 as u };
|
|
307
|
-
//# sourceMappingURL=state.js-
|
|
307
|
+
//# sourceMappingURL=state.js-OSxIx7MQ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as readA2aConfig } from './insight-config.js-CA-iT3lB.js';
|
|
2
2
|
import { i as insertWaiting, o as openA2aDb, s as settleRow, p as pruneTerminalBefore, l as listWaiting } from './db.js-DRhjT6xK.js';
|
|
3
|
-
import { g as getDshConnection } from './dsh-connection.js-
|
|
4
|
-
import { a as entryForEvent, h as historyToEvents } from './dsh-events.js-
|
|
3
|
+
import { g as getDshConnection } from './dsh-connection.js-DL5qjlq2.js';
|
|
4
|
+
import { a as entryForEvent, h as historyToEvents } from './dsh-events.js-35seDLwL.js';
|
|
5
5
|
|
|
6
6
|
//#region src/lib/server/a2a/matcher.ts
|
|
7
7
|
/**
|
|
@@ -470,4 +470,4 @@ function registerWatch(row) {
|
|
|
470
470
|
}
|
|
471
471
|
|
|
472
472
|
export { configureWatcher as c, ensureStarted as e, registerWatch as r };
|
|
473
|
-
//# sourceMappingURL=watcher.js-
|
|
473
|
+
//# sourceMappingURL=watcher.js-CACduBB9.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as listRecent } from '../../../../chunks/db.js-DRhjT6xK.js';
|
|
2
|
-
import { e as ensureStarted } from '../../../../chunks/watcher.js-
|
|
2
|
+
import { e as ensureStarted } from '../../../../chunks/watcher.js-CACduBB9.js';
|
|
3
3
|
import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
4
|
import '../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
5
5
|
import '../../../../chunks/config.js-B0w1-uCA.js';
|
|
@@ -10,8 +10,8 @@ import 'node:os';
|
|
|
10
10
|
import 'yaml';
|
|
11
11
|
import '../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
12
12
|
import 'node:sqlite';
|
|
13
|
-
import '../../../../chunks/dsh-connection.js-
|
|
14
|
-
import '../../../../chunks/dsh-events.js-
|
|
13
|
+
import '../../../../chunks/dsh-connection.js-DL5qjlq2.js';
|
|
14
|
+
import '../../../../chunks/dsh-events.js-35seDLwL.js';
|
|
15
15
|
import '../../../../chunks/merge.js-yMwW440S.js';
|
|
16
16
|
import '../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
17
17
|
import '../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
@@ -61,4 +61,4 @@ var GET = ({ url }) => {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
export { GET };
|
|
64
|
-
//# sourceMappingURL=_server.ts.js-
|
|
64
|
+
//# sourceMappingURL=_server.ts.js-DHFHuGSm.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as readA2aConfig } from '../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
2
|
-
import { g as getDshConnection } from '../../../../../chunks/dsh-connection.js-
|
|
3
|
-
import { c as configureWatcher, r as registerWatch } from '../../../../../chunks/watcher.js-
|
|
2
|
+
import { g as getDshConnection } from '../../../../../chunks/dsh-connection.js-DL5qjlq2.js';
|
|
3
|
+
import { c as configureWatcher, r as registerWatch } from '../../../../../chunks/watcher.js-CACduBB9.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
6
|
import '../../../../../chunks/config.js-B0w1-uCA.js';
|
|
@@ -12,7 +12,7 @@ import 'yaml';
|
|
|
12
12
|
import '../../../../../chunks/settings-home2.js-f75-B6RI.js';
|
|
13
13
|
import '../../../../../chunks/db.js-DRhjT6xK.js';
|
|
14
14
|
import 'node:sqlite';
|
|
15
|
-
import '../../../../../chunks/dsh-events.js-
|
|
15
|
+
import '../../../../../chunks/dsh-events.js-35seDLwL.js';
|
|
16
16
|
import '../../../../../chunks/merge.js-yMwW440S.js';
|
|
17
17
|
import '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
18
18
|
import '../../../../../chunks/uneval.js-BJ9Qq2SF.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-CUUfDBcc.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DL5qjlq2.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
3
|
import '../../../../../chunks/config.js-B0w1-uCA.js';
|
|
4
4
|
import '../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
@@ -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-Cae4x1c7.js.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { g as getDshConnection, s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DL5qjlq2.js';
|
|
2
|
+
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../../chunks/config.js-B0w1-uCA.js';
|
|
4
|
+
import '../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
5
|
+
import '../../../../../chunks/settings-document.js-BRTO59Al.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 '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
12
|
+
import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
13
|
+
|
|
14
|
+
//#region src/routes/api/dsh/jobs/+server.ts
|
|
15
|
+
/**
|
|
16
|
+
* api-dsh — GET /api/dsh/jobs?sessionId=… · POST /api/dsh/jobs
|
|
17
|
+
*
|
|
18
|
+
* Jobs (ADR-0026 D2/D3, Job Badge Wave 1): the browser's only view of the
|
|
19
|
+
* host's per-session job roster (BC-1/BC-6 — the browser never reaches the
|
|
20
|
+
* DSH Host directly).
|
|
21
|
+
*
|
|
22
|
+
* GET: one job.list snapshot for sessionId — the whole visible set (the
|
|
23
|
+
* session's own jobs plus every unowned job). Live updates ride the mux push
|
|
24
|
+
* path (relay.dispatchJobRoster) or a client refetch; the ledger is NOT
|
|
25
|
+
* authority for live state (ADR fact 10).
|
|
26
|
+
*
|
|
27
|
+
* POST: job.kill passthrough — body {sessionId, jobId} → {outcome}.
|
|
28
|
+
* The session fence stays server-side; a refusal surfaces verbatim.
|
|
29
|
+
*/
|
|
30
|
+
var GET = async ({ url }) => {
|
|
31
|
+
const sessionId = url.searchParams.get("sessionId");
|
|
32
|
+
if (!sessionId) return json({
|
|
33
|
+
ok: false,
|
|
34
|
+
error: {
|
|
35
|
+
code: "bad-session",
|
|
36
|
+
message: "sessionId query parameter is required"
|
|
37
|
+
}
|
|
38
|
+
}, { status: 400 });
|
|
39
|
+
try {
|
|
40
|
+
const relay = getDshConnection().relay;
|
|
41
|
+
relay.touchJobRoster(sessionId);
|
|
42
|
+
const frame = relay.jobRosterSnapshot(sessionId);
|
|
43
|
+
return json({
|
|
44
|
+
ok: true,
|
|
45
|
+
sessionId,
|
|
46
|
+
jobs: frame.jobs,
|
|
47
|
+
...frame.pending ? { pending: true } : {}
|
|
48
|
+
});
|
|
49
|
+
} catch (err) {
|
|
50
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var POST = async ({ request }) => {
|
|
54
|
+
let body;
|
|
55
|
+
try {
|
|
56
|
+
body = await request.json();
|
|
57
|
+
} catch {
|
|
58
|
+
return json({
|
|
59
|
+
ok: false,
|
|
60
|
+
error: {
|
|
61
|
+
code: "bad-json",
|
|
62
|
+
message: "request body is not valid JSON"
|
|
63
|
+
}
|
|
64
|
+
}, { status: 400 });
|
|
65
|
+
}
|
|
66
|
+
const { sessionId, jobId } = body ?? {};
|
|
67
|
+
if (typeof sessionId !== "string" || sessionId.length === 0) return json({
|
|
68
|
+
ok: false,
|
|
69
|
+
error: {
|
|
70
|
+
code: "bad-session",
|
|
71
|
+
message: "sessionId is required"
|
|
72
|
+
}
|
|
73
|
+
}, { status: 400 });
|
|
74
|
+
if (typeof jobId !== "string" || jobId.length === 0) return json({
|
|
75
|
+
ok: false,
|
|
76
|
+
error: {
|
|
77
|
+
code: "bad-job",
|
|
78
|
+
message: "jobId is required"
|
|
79
|
+
}
|
|
80
|
+
}, { status: 400 });
|
|
81
|
+
try {
|
|
82
|
+
const result = await getDshConnection().relay.jobKill(sessionId, jobId);
|
|
83
|
+
return json({
|
|
84
|
+
ok: true,
|
|
85
|
+
outcome: result.outcome
|
|
86
|
+
});
|
|
87
|
+
} catch (err) {
|
|
88
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { GET, POST };
|
|
93
|
+
//# sourceMappingURL=_server.ts.js-hGmoSsDv.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DL5qjlq2.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
3
|
import '../../../../../chunks/config.js-B0w1-uCA.js';
|
|
4
4
|
import '../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
@@ -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-BLb8o1cY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DL5qjlq2.js';
|
|
2
2
|
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
3
|
import '../../../../../chunks/config.js-B0w1-uCA.js';
|
|
4
4
|
import '../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
@@ -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-BFeDKrPz.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DL5qjlq2.js';
|
|
2
2
|
import { j as json } from '../../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
3
|
import '../../../../../../../chunks/config.js-B0w1-uCA.js';
|
|
4
4
|
import '../../../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
@@ -43,4 +43,4 @@ var GET = async ({ params, url }) => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export { GET };
|
|
46
|
-
//# sourceMappingURL=_server.ts.js-
|
|
46
|
+
//# sourceMappingURL=_server.ts.js-DmSTTfI5.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
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-DL5qjlq2.js';
|
|
2
2
|
import { j as json } from '../../../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
3
|
import '../../../../../../../chunks/config.js-B0w1-uCA.js';
|
|
4
4
|
import '../../../../../../../chunks/insight-config.js-CA-iT3lB.js';
|
|
@@ -32,4 +32,4 @@ var POST = async ({ params }) => {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export { POST };
|
|
35
|
-
//# sourceMappingURL=_server.ts.js-
|
|
35
|
+
//# sourceMappingURL=_server.ts.js-Cus9XrC9.js.map
|