@deepseek-insight/dsi 0.5.8 → 0.5.10
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 +27 -60
- package/bin/dsi.mjs +108 -8
- package/build/client/_app/immutable/assets/0.B-x78bUH.css +2 -0
- package/build/client/_app/immutable/assets/2.DHY7FpOZ.css +1 -0
- package/build/client/_app/immutable/chunks/{CJ_zvTBg.js → 1KjP5PPV.js} +1 -1
- package/build/client/_app/immutable/chunks/{BAZKJuQw.js → 4BUyCMHs.js} +1 -1
- package/build/client/_app/immutable/chunks/{qEGLx2Wc.js → 5BuKkouu.js} +1 -1
- package/build/client/_app/immutable/chunks/{Cj-Zm41R.js → 5W1abxrJ.js} +1 -1
- package/build/client/_app/immutable/chunks/{DlQrSOw4.js → 7Qwz4TD3.js} +1 -1
- package/build/client/_app/immutable/chunks/{2irkVCIh.js → B3Lta-Nn.js} +1 -1
- package/build/client/_app/immutable/chunks/{Dr0pcX_F.js → B5bIZjCh.js} +1 -1
- package/build/client/_app/immutable/chunks/{CZXl7qUb.js → BDws8KMN.js} +1 -1
- package/build/client/_app/immutable/chunks/{CmbEK4CY.js → BFYiBR8b.js} +1 -1
- package/build/client/_app/immutable/chunks/{BI4pMaIG.js → BK9wQfnJ.js} +1 -1
- package/build/client/_app/immutable/chunks/{Beo7Z46k.js → BKMUCRSB.js} +1 -1
- package/build/client/_app/immutable/chunks/BLOKPG58.js +1 -0
- package/build/client/_app/immutable/chunks/{D16vkywU.js → BNCXVe_Y.js} +1 -1
- package/build/client/_app/immutable/chunks/{DtBGId5S.js → BO15_-NJ.js} +1 -1
- package/build/client/_app/immutable/chunks/{CfZ7uSQe.js → BOGXkyy3.js} +1 -1
- package/build/client/_app/immutable/chunks/{BhNEBkk_.js → BP1EDRMh.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bn9NRi0R.js → BQFPW2iU.js} +1 -1
- package/build/client/_app/immutable/chunks/{D7fX-3xy.js → BS84xqUl.js} +1 -1
- package/build/client/_app/immutable/chunks/{DVXVVWkX.js → BhMqa9V0.js} +1 -1
- package/build/client/_app/immutable/chunks/{OmE6SGvs.js → BnEcDyty.js} +1 -1
- package/build/client/_app/immutable/chunks/{D4gq_dik.js → BoJ5ww2X.js} +1 -1
- package/build/client/_app/immutable/chunks/{BnF5Jm-h.js → BtWgux0k.js} +1 -1
- package/build/client/_app/immutable/chunks/BuVjHIij.js +1 -0
- package/build/client/_app/immutable/chunks/{CA_WNCsl.js → C7xeaPF2.js} +1 -1
- package/build/client/_app/immutable/chunks/{GBaNblmo.js → CA7VtFsM.js} +1 -1
- package/build/client/_app/immutable/chunks/{9TvT6fta.js → CIZRvqf3.js} +1 -1
- package/build/client/_app/immutable/chunks/{DuM1hSCa.js → CKk3hDrH.js} +1 -1
- package/build/client/_app/immutable/chunks/CM2YlsBZ.js +1 -0
- package/build/client/_app/immutable/chunks/CNIDhcUc.js +2 -0
- package/build/client/_app/immutable/chunks/{DzVMo6mB.js → CQNMOuVz.js} +1 -1
- package/build/client/_app/immutable/chunks/{wFIeY1Cf.js → CVJBb63S.js} +1 -1
- package/build/client/_app/immutable/chunks/CWCyOfZL.js +1 -0
- package/build/client/_app/immutable/chunks/{Dg_UWGX7.js → CWJVj28H.js} +1 -1
- package/build/client/_app/immutable/chunks/{sIEmSkn6.js → CWRt23V2.js} +1 -1
- package/build/client/_app/immutable/chunks/{DWDfcLfy.js → CXDjw6BI.js} +1 -1
- package/build/client/_app/immutable/chunks/{BBKpNcUe.js → CbmGLQlS.js} +1 -1
- package/build/client/_app/immutable/chunks/{raVGrKQy.js → CfKp2keY.js} +4 -4
- package/build/client/_app/immutable/chunks/{LWre5GKl.js → CfPrYC2A.js} +1 -1
- package/build/client/_app/immutable/chunks/{zpcgJjUg.js → CfqeI44h.js} +1 -1
- package/build/client/_app/immutable/chunks/{BJL7RCQE.js → CjMviqoD.js} +1 -1
- package/build/client/_app/immutable/chunks/Ct7xT-0E.js +1 -0
- package/build/client/_app/immutable/chunks/{DGarjVZC.js → CwpTIVX4.js} +1 -1
- package/build/client/_app/immutable/chunks/{C1JXY9b5.js → D-p2gaJO.js} +1 -1
- package/build/client/_app/immutable/chunks/{CWVpRRWx.js → D2Punuji.js} +1 -1
- package/build/client/_app/immutable/chunks/{CWKM3f5q.js → D9XozwcM.js} +1 -1
- package/build/client/_app/immutable/chunks/DChUx8Ds.js +1 -0
- package/build/client/_app/immutable/chunks/DFZg0vdm.js +8 -0
- package/build/client/_app/immutable/chunks/{BOfSXrr7.js → DHChdxxK.js} +1 -1
- package/build/client/_app/immutable/chunks/DKLs56Hm.js +1 -0
- package/build/client/_app/immutable/chunks/{D0I62FkS.js → DTVIMflS.js} +1 -1
- package/build/client/_app/immutable/chunks/{D8-5qLJg.js → DVsJyQaB.js} +1 -1
- package/build/client/_app/immutable/chunks/{Btk-1DaX.js → D_4vyw9k.js} +1 -1
- package/build/client/_app/immutable/chunks/{CPgSxomx.js → Da0rl5Rb.js} +1 -1
- package/build/client/_app/immutable/chunks/{DPKol_4Z.js → DfxnqpU2.js} +1 -1
- package/build/client/_app/immutable/chunks/DnA33f7e.js +3 -0
- package/build/client/_app/immutable/chunks/{6GKQw8m6.js → DrLWFO8Z.js} +1 -1
- package/build/client/_app/immutable/chunks/{DITEY8D_.js → DtdNJetN.js} +1 -1
- package/build/client/_app/immutable/chunks/{DLOOos_8.js → Dufckt0T.js} +1 -1
- package/build/client/_app/immutable/chunks/{DAS1CLuE.js → DzNl4lTU.js} +1 -1
- package/build/client/_app/immutable/chunks/E-1cXrsM.js +1 -0
- package/build/client/_app/immutable/chunks/{DYqsupvX.js → FDKaBHdO.js} +1 -1
- package/build/client/_app/immutable/chunks/FmeCgKwk.js +1 -0
- package/build/client/_app/immutable/chunks/{BrTsmS-o.js → KCYBrblk.js} +5 -5
- package/build/client/_app/immutable/chunks/N_z8g1dA.js +1 -0
- package/build/client/_app/immutable/chunks/{DbcKN35_.js → NxBjh70M.js} +1 -1
- package/build/client/_app/immutable/chunks/{B1YSaoU7.js → T453H1uG.js} +1 -1
- package/build/client/_app/immutable/chunks/{DqwfDHZH.js → XM-sjL-p.js} +1 -1
- package/build/client/_app/immutable/chunks/{CcL1k2On.js → _OxPZn8v.js} +1 -1
- package/build/client/_app/immutable/chunks/{DvCMcJ3P.js → dg-Ik0Xp.js} +1 -1
- package/build/client/_app/immutable/chunks/{Cd6K7Y8m.js → eNqKaSDb.js} +1 -1
- package/build/client/_app/immutable/chunks/{mVHw7KEX.js → hFCLiR2C.js} +1 -1
- package/build/client/_app/immutable/chunks/{Rh9cy7xg.js → pRzztTzl.js} +1 -1
- package/build/client/_app/immutable/chunks/{Cb1pwoev.js → qDr7l6ST.js} +1 -1
- package/build/client/_app/immutable/chunks/{nDMCpPkF.js → tziyL5EM.js} +1 -1
- package/build/client/_app/immutable/chunks/{UNxFjlik.js → wRPKccfz.js} +1 -1
- package/build/client/_app/immutable/entry/app.BQBFBQPC.js +2 -0
- package/build/client/_app/immutable/entry/start.Cz8Ti8Dy.js +1 -0
- package/build/client/_app/immutable/nodes/0.Cl1RKBMO.js +1 -0
- package/build/client/_app/immutable/nodes/1.D8GGUpeE.js +1 -0
- package/build/client/_app/immutable/nodes/2.LG4wpZ6R.js +174 -0
- package/build/client/_app/immutable/workers/settings-css-worker-DRH2OcAG.js +93 -0
- package/build/client/_app/immutable/workers/settings-html-worker-DQLddT9h.js +506 -0
- package/build/client/_app/immutable/workers/settings-json-worker-D_Dqrls5.js +62 -0
- package/build/client/_app/immutable/workers/settings-ts-worker-DkYoA6bF.js +67738 -0
- package/build/client/_app/version.json +1 -1
- package/build/env.js +2 -2
- package/build/handler.js +9 -9
- package/build/index.js +9 -9
- package/build/server/chunks/chunks/{app-config.svelte.js-Co9jacqT.js → app-config.svelte.js-BkhuJ9bF.js} +2 -2
- package/build/server/chunks/chunks/{config.js-BBYogCe7.js → config.js-D2vQdial.js} +9 -2
- package/build/server/chunks/chunks/{db.js-C4EPtpZT.js → db.js-Cya8uRCD.js} +2 -2
- package/build/server/chunks/chunks/{db2.js-BYr2lzQs.js → db2.js-CPqi0hcH.js} +2 -2
- package/build/server/chunks/chunks/{dsh-connection.js-D52KwDXm.js → dsh-connection.js-DlwhJZaV.js} +3 -3
- package/build/server/chunks/chunks/{exports.js-DMiPee3x.js → exports.js-DH_tjtdv.js} +4 -4
- package/build/server/chunks/chunks/git-probe.js-nfLEa58f.js +219 -0
- package/build/server/chunks/chunks/image-limits.js-CUdJ0f7r.js +41 -0
- package/build/server/chunks/chunks/{insight-config.js-BAitz0O1.js → insight-config.js-BwcV3Bct.js} +5 -159
- package/build/server/chunks/chunks/{internal.js-CLhwhxSl.js → internal.js-Cuz_sBks.js} +6 -5
- package/build/server/chunks/chunks/{internal2.js-D-DAuSVh.js → internal2.js-BcS47nI-.js} +2 -2
- package/build/server/chunks/chunks/{image-limits.js-BMPZ55kJ.js → permission-state.js-yvwUSnug.js} +8 -41
- package/build/server/chunks/chunks/runtime.js-BPLc5RLR.js +854 -0
- package/build/server/chunks/chunks/{server.js-DoCd0fEo.js → server.js-11-pxAWV.js} +73 -2
- package/build/server/chunks/chunks/settings-document.js-BIwLIxnE.js +162 -0
- package/build/server/chunks/chunks/{shared.js-C4-Py8s_.js → shared.js-HQ0rfhm4.js} +4 -4
- package/build/server/chunks/chunks/{state.js-Ct3UbrbR.js → state.js-CwHEPfXH.js} +42 -10
- package/build/server/chunks/chunks/{utils.js-tOWCe9Wk.js → utils.js-CAdNO8Tu.js} +6 -6
- package/build/server/chunks/chunks/{watcher.js-CZl6B1Gm.js → watcher.js-CmpeTgh-.js} +4 -4
- package/build/server/chunks/entries/endpoints/api/a2a/_id_/{_server.ts.js-BiJNs-w9.js → _server.ts.js-D5AWBpBQ.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-DpYiPNfK.js → _server.ts.js-BZvM0qV8.js} +9 -8
- package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-hsrqtyai.js → _server.ts.js-CwQ8v1Gr.js} +9 -8
- package/build/server/chunks/entries/endpoints/api/config/{_server.ts.js-C22-pOYW.js → _server.ts.js-DRFbC3XB.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-GB8GCnt9.js → _server.ts.js-1NUslX2J.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-1f1lp4p6.js → _server.ts.js-BaNBBHLR.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-bQ6fWiaE.js → _server.ts.js-CW2NY_YQ.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-Dpn0vlL4.js → _server.ts.js-QA9zJsqt.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-BCKU6r0e.js → _server.ts.js-CVXZhV9H.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-B6CP7Ox-.js → _server.ts.js-Cit4Casr.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-CuIGYst7.js → _server.ts.js-CyjB1woG.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-BJk9GfEb.js → _server.ts.js-DllJ8vBI.js} +9 -7
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-BRjJibko.js → _server.ts.js-BNnAmzy2.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-Du0XmI7X.js → _server.ts.js-BM_jJMFG.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-BmxbonR_.js → _server.ts.js-qKiwUxSN.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-B03gh2aZ.js → _server.ts.js-CZ0zXTiV.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-BO9Iy5Ki.js → _server.ts.js-3o3S3pHm.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-qr2peU-n.js → _server.ts.js-DsCnz_8J.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-D4PIEynR.js → _server.ts.js-6QBc29c0.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-CcBAtZWB.js → _server.ts.js-Cur_rwoa.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-CE1gTwwX.js → _server.ts.js-BBRIvxEV.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-GugaguYO.js → _server.ts.js-HXmuGYk_.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js-D7ZCMRXo.js → _server.ts.js-BtF78EDX.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file-bytes/{_server.ts.js-BeLFfBNx.js → _server.ts.js-DaxAqI2r.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-CUMrE1yT.js → _server.ts.js-Cp3JRhml.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-CPTg8pND.js → _server.ts.js-DCHNOxOw.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-ikZ2NK35.js → _server.ts.js-CTCYuknC.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-DO-sihfI.js → _server.ts.js-B1O7CmG7.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/prompts/_id_/{_server.ts.js-CtWIL8u1.js → _server.ts.js-CMAYot0u.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/prompts/{_server.ts.js-CCV5F65b.js → _server.ts.js-Bk-I6Cmq.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/prompts/use/{_server.ts.js-5zjPgL0k.js → _server.ts.js-CWdigZaS.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/settings/{_server.ts.js-DGy6xjPE.js → _server.ts.js-BgZ3eon4.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/file-write/_server.ts.js-CMDHM8Ts.js +109 -0
- package/build/server/chunks/entries/endpoints/api/workspace/git-events/_server.ts.js-DsrelTvu.js +295 -0
- package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/_server.ts.js-Bjo1hSe3.js +87 -0
- package/build/server/chunks/entries/endpoints/api/workspace/git-map/_server.ts.js-kbPAnTV6.js +75 -0
- package/build/server/chunks/entries/endpoints/api/workspace/git-status/_server.ts.js-CGSk5JWn.js +80 -0
- package/build/server/chunks/entries/hooks.server.js-B7FsvqtT.js +307 -0
- package/build/server/chunks/entries/pages/_error.svelte.js-BcGj5uWu.js +183 -0
- package/build/server/chunks/entries/pages/{_page.server.ts.js-BGXwU4Ay.js → _page.server.ts.js-CNU4x-f1.js} +5 -4
- package/build/server/chunks/entries/pages/{_page.svelte.js-BxAPMhC5.js → _page.svelte.js-vy-eThLC.js} +5297 -392
- package/build/server/chunks/{handler-D4tuQz0Q.js → handler-uNq08tmU.js} +8 -8
- package/build/server/chunks/{index.js-Bj9XVTa8.js → index.js-vyc3xio1.js} +35 -35
- package/build/server/chunks/{manifest.js-zxk8d3d8.js → manifest.js-Cx3f-cHu.js} +72 -44
- package/build/server/chunks/nodes/{0.js-DCyDo8-C.js → 0.js-BRdcKR1I.js} +3 -3
- package/build/server/chunks/nodes/1.js-Dp8B4lMj.js +9 -0
- package/build/server/chunks/nodes/2.js-D_OTrlKi.js +26 -0
- package/package.json +6 -3
- package/build/client/_app/immutable/assets/0.DqFt8jIM.css +0 -2
- package/build/client/_app/immutable/assets/2.dKbN8ToR.css +0 -1
- package/build/client/_app/immutable/chunks/BoyJtMif.js +0 -1
- package/build/client/_app/immutable/chunks/Bp4uuUjI.js +0 -3
- package/build/client/_app/immutable/chunks/CDt9a7EA.js +0 -2
- package/build/client/_app/immutable/chunks/CV7-m-Xm.js +0 -1
- package/build/client/_app/immutable/chunks/CsHVnZCH.js +0 -1
- package/build/client/_app/immutable/chunks/D1qzYj9m.js +0 -1
- package/build/client/_app/immutable/chunks/DXeGLmed.js +0 -8
- package/build/client/_app/immutable/chunks/ESmLJICu.js +0 -1
- package/build/client/_app/immutable/chunks/PaZBB01u.js +0 -1
- package/build/client/_app/immutable/chunks/UmdltqoE.js +0 -1
- package/build/client/_app/immutable/chunks/i0VQdJtv.js +0 -1
- package/build/client/_app/immutable/entry/app.CQ41dis3.js +0 -2
- package/build/client/_app/immutable/entry/start.DjPg9fbN.js +0 -1
- package/build/client/_app/immutable/nodes/0.B_ZEZy7b.js +0 -1
- package/build/client/_app/immutable/nodes/1.-77Wm-KY.js +0 -1
- package/build/client/_app/immutable/nodes/2.B4TGPB8b.js +0 -69
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/save/_server.ts.js-CO9iOVa4.js +0 -110
- package/build/server/chunks/entries/pages/_error.svelte.js-B6WyZdis.js +0 -41
- package/build/server/chunks/nodes/1.js-DK1imDS5.js +0 -9
- package/build/server/chunks/nodes/2.js-YT-YLp-v.js +0 -24
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { l as listPrompts, s as searchPrompts, c as createPrompt } from '../../../../chunks/db2.js-
|
|
2
|
-
import { j as json } from '../../../../chunks/utils.js-
|
|
3
|
-
import '../../../../chunks/insight-config.js-
|
|
4
|
-
import '../../../../chunks/config.js-
|
|
1
|
+
import { l as listPrompts, s as searchPrompts, c as createPrompt } from '../../../../chunks/db2.js-CPqi0hcH.js';
|
|
2
|
+
import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
|
+
import '../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
4
|
+
import '../../../../chunks/config.js-D2vQdial.js';
|
|
5
|
+
import '../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
5
6
|
import 'node:fs';
|
|
6
7
|
import 'node:path';
|
|
7
8
|
import 'node:os';
|
|
8
9
|
import 'yaml';
|
|
9
10
|
import 'node:sqlite';
|
|
10
|
-
import '../../../../chunks/shared.js-
|
|
11
|
+
import '../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
11
12
|
import '../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
12
13
|
|
|
13
14
|
//#region src/routes/api/prompts/+server.ts
|
|
@@ -84,4 +85,4 @@ var POST = async ({ request }) => {
|
|
|
84
85
|
};
|
|
85
86
|
|
|
86
87
|
export { GET, POST };
|
|
87
|
-
//# sourceMappingURL=_server.ts.js-
|
|
88
|
+
//# sourceMappingURL=_server.ts.js-Bk-I6Cmq.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { i as readPromptsConfig } from '../../../../../chunks/insight-config.js-
|
|
2
|
-
import { f as findPromptByText, r as recordPromptUse } from '../../../../../chunks/db2.js-
|
|
3
|
-
import { j as json } from '../../../../../chunks/utils.js-
|
|
4
|
-
import '../../../../../chunks/config.js-
|
|
1
|
+
import { i as readPromptsConfig } from '../../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
2
|
+
import { f as findPromptByText, r as recordPromptUse } from '../../../../../chunks/db2.js-CPqi0hcH.js';
|
|
3
|
+
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
|
+
import '../../../../../chunks/config.js-D2vQdial.js';
|
|
5
|
+
import '../../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
5
6
|
import 'node:fs';
|
|
6
7
|
import 'node:path';
|
|
7
8
|
import 'node:os';
|
|
8
9
|
import 'yaml';
|
|
9
10
|
import 'node:sqlite';
|
|
10
|
-
import '../../../../../chunks/shared.js-
|
|
11
|
+
import '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
11
12
|
import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
12
13
|
|
|
13
14
|
//#region src/routes/api/prompts/use/+server.ts
|
|
@@ -51,4 +52,4 @@ var POST = async ({ request }) => {
|
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
export { POST };
|
|
54
|
-
//# sourceMappingURL=_server.ts.js-
|
|
55
|
+
//# sourceMappingURL=_server.ts.js-CWdigZaS.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { j as
|
|
1
|
+
import { r as readSettingsDocument, s as saveSettingsDocument, S as SettingsParseError } from '../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
2
|
+
import { j as DEFAULT_DSH_PRESET_ENGLISH, k as DEFAULT_SERVER_CONFIG, l as DEFAULT_PROMPTS_CONFIG, m as DEFAULT_SIDEBAR_CONFIG, n as DEFAULT_PANEL_CONFIG, o as DEFAULT_A2A_CONFIG, p as DEFAULT_HOME_CONFIG, q as DEFAULT_CONVERSATION_CONFIG, s as DEFAULT_CHAT_CONFIG } from '../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
3
|
+
import { j as json } from '../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
3
4
|
import { stringify } from 'yaml';
|
|
4
|
-
import '../../../../chunks/config.js-
|
|
5
|
+
import '../../../../chunks/config.js-D2vQdial.js';
|
|
5
6
|
import 'node:fs';
|
|
6
7
|
import 'node:path';
|
|
7
8
|
import 'node:os';
|
|
8
|
-
import '../../../../chunks/shared.js-
|
|
9
|
+
import '../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
9
10
|
import '../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
10
11
|
|
|
11
12
|
//#region src/routes/api/settings/+server.ts
|
|
@@ -98,4 +99,4 @@ var PUT = async ({ url, request }) => {
|
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
export { GET, PUT };
|
|
101
|
-
//# sourceMappingURL=_server.ts.js-
|
|
102
|
+
//# sourceMappingURL=_server.ts.js-BgZ3eon4.js.map
|
package/build/server/chunks/entries/endpoints/api/workspace/file-write/_server.ts.js-CMDHM8Ts.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DlwhJZaV.js';
|
|
2
|
+
import { g as gitGateEnabled, i as isInsideRoot } from '../../../../../chunks/git-probe.js-nfLEa58f.js';
|
|
3
|
+
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
|
+
import { promises } from 'node:fs';
|
|
5
|
+
import * as nodePath from 'node:path';
|
|
6
|
+
import '../../../../../chunks/config.js-D2vQdial.js';
|
|
7
|
+
import '../../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
8
|
+
import '../../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
9
|
+
import 'node:os';
|
|
10
|
+
import 'yaml';
|
|
11
|
+
import '../../../../../chunks/dsh-events.js-BtDxaV6Q.js';
|
|
12
|
+
import '../../../../../chunks/permission-state.js-yvwUSnug.js';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/workspace/file-write/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* api-workspace — POST /api/workspace/file-write
|
|
20
|
+
*
|
|
21
|
+
* The File Eye's direct save (ADR The File Eye 2026-09-12, D4): on a
|
|
22
|
+
* full-access desk the DSI server writes the bytes ITSELF — fresh gate,
|
|
23
|
+
* realpath containment of the target inside the workspace root, then
|
|
24
|
+
* fs.writeFile. The written receipt IS proof of effect (unlike the
|
|
25
|
+
* retired delegated turn). Every refusal happens BEFORE the filesystem
|
|
26
|
+
* is touched.
|
|
27
|
+
*/
|
|
28
|
+
var POST = async ({ request }) => {
|
|
29
|
+
let body;
|
|
30
|
+
try {
|
|
31
|
+
body = await request.json();
|
|
32
|
+
} catch {
|
|
33
|
+
return json({
|
|
34
|
+
ok: false,
|
|
35
|
+
error: {
|
|
36
|
+
code: "bad-json",
|
|
37
|
+
message: "request body is not valid JSON"
|
|
38
|
+
}
|
|
39
|
+
}, { status: 400 });
|
|
40
|
+
}
|
|
41
|
+
const { sessionId, root, path, content } = body ?? {};
|
|
42
|
+
if (typeof sessionId !== "string" || sessionId.trim().length === 0) return json({
|
|
43
|
+
ok: false,
|
|
44
|
+
error: {
|
|
45
|
+
code: "bad-session",
|
|
46
|
+
message: "sessionId is required"
|
|
47
|
+
}
|
|
48
|
+
}, { status: 400 });
|
|
49
|
+
if (typeof root !== "string" || root.trim().length === 0) return json({
|
|
50
|
+
ok: false,
|
|
51
|
+
error: {
|
|
52
|
+
code: "bad-root",
|
|
53
|
+
message: "root is required"
|
|
54
|
+
}
|
|
55
|
+
}, { status: 400 });
|
|
56
|
+
if (typeof path !== "string" || path.length === 0) return json({
|
|
57
|
+
ok: false,
|
|
58
|
+
error: {
|
|
59
|
+
code: "bad-path",
|
|
60
|
+
message: "path is required"
|
|
61
|
+
}
|
|
62
|
+
}, { status: 400 });
|
|
63
|
+
if (typeof content !== "string") return json({
|
|
64
|
+
ok: false,
|
|
65
|
+
error: {
|
|
66
|
+
code: "bad-content",
|
|
67
|
+
message: "content must be a string"
|
|
68
|
+
}
|
|
69
|
+
}, { status: 400 });
|
|
70
|
+
let enabled;
|
|
71
|
+
try {
|
|
72
|
+
enabled = await gitGateEnabled(sessionId);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
75
|
+
}
|
|
76
|
+
if (!enabled) return json({
|
|
77
|
+
ok: false,
|
|
78
|
+
error: {
|
|
79
|
+
code: "gate-closed",
|
|
80
|
+
message: "the desk does not permit direct writes"
|
|
81
|
+
}
|
|
82
|
+
}, { status: 403 });
|
|
83
|
+
const absolute = nodePath.join(root, ...path.split("/").filter((p) => p.length > 0));
|
|
84
|
+
if (!await isInsideRoot(root, absolute)) return json({
|
|
85
|
+
ok: false,
|
|
86
|
+
error: {
|
|
87
|
+
code: "outside-workspace",
|
|
88
|
+
message: "the file path is not inside the workspace root"
|
|
89
|
+
}
|
|
90
|
+
}, { status: 403 });
|
|
91
|
+
try {
|
|
92
|
+
await promises.writeFile(absolute, content, "utf8");
|
|
93
|
+
return json({
|
|
94
|
+
ok: true,
|
|
95
|
+
written: true
|
|
96
|
+
});
|
|
97
|
+
} catch (err) {
|
|
98
|
+
return json({
|
|
99
|
+
ok: false,
|
|
100
|
+
error: {
|
|
101
|
+
code: "write-failed",
|
|
102
|
+
message: err instanceof Error ? err.message : "write failed"
|
|
103
|
+
}
|
|
104
|
+
}, { status: 500 });
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { POST };
|
|
109
|
+
//# sourceMappingURL=_server.ts.js-CMDHM8Ts.js.map
|
package/build/server/chunks/entries/endpoints/api/workspace/git-events/_server.ts.js-DsrelTvu.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DlwhJZaV.js';
|
|
2
|
+
import { g as gitGateEnabled, i as isInsideRoot, a as gitStatus, p as parsePorcelainStatus } from '../../../../../chunks/git-probe.js-nfLEa58f.js';
|
|
3
|
+
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
|
+
import { watch } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { execFileSync } from 'node:child_process';
|
|
7
|
+
import '../../../../../chunks/config.js-D2vQdial.js';
|
|
8
|
+
import '../../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
9
|
+
import '../../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
10
|
+
import 'node:os';
|
|
11
|
+
import 'yaml';
|
|
12
|
+
import '../../../../../chunks/dsh-events.js-BtDxaV6Q.js';
|
|
13
|
+
import '../../../../../chunks/permission-state.js-yvwUSnug.js';
|
|
14
|
+
import '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
/** Module-level registry — the DSI server is a long-lived Node process
|
|
18
|
+
* (adapter-node), so this state persists across requests (ADR fact 8). */
|
|
19
|
+
var registry = /* @__PURE__ */ new Map();
|
|
20
|
+
function workspaceOf(workspaceKey) {
|
|
21
|
+
let ws = registry.get(workspaceKey);
|
|
22
|
+
if (!ws) {
|
|
23
|
+
ws = {
|
|
24
|
+
generation: 0,
|
|
25
|
+
watchers: /* @__PURE__ */ new Map(),
|
|
26
|
+
listeners: /* @__PURE__ */ new Set()
|
|
27
|
+
};
|
|
28
|
+
registry.set(workspaceKey, ws);
|
|
29
|
+
}
|
|
30
|
+
return ws;
|
|
31
|
+
}
|
|
32
|
+
/** Current generation for a workspace (0 before the first ring). */
|
|
33
|
+
function getGeneration(workspaceKey) {
|
|
34
|
+
return registry.get(workspaceKey)?.generation ?? 0;
|
|
35
|
+
}
|
|
36
|
+
/** Subscribe to generation bumps for one workspace. Returns an unsubscribe. */
|
|
37
|
+
function onGeneration(workspaceKey, cb) {
|
|
38
|
+
const ws = workspaceOf(workspaceKey);
|
|
39
|
+
ws.listeners.add(cb);
|
|
40
|
+
return () => ws.listeners.delete(cb);
|
|
41
|
+
}
|
|
42
|
+
function bump(workspaceKey) {
|
|
43
|
+
const ws = registry.get(workspaceKey);
|
|
44
|
+
if (!ws) return;
|
|
45
|
+
ws.generation += 1;
|
|
46
|
+
for (const cb of ws.listeners) try {
|
|
47
|
+
cb(ws.generation);
|
|
48
|
+
} catch {}
|
|
49
|
+
}
|
|
50
|
+
function scheduleRing(workspaceKey, entry) {
|
|
51
|
+
if (entry.timer !== null) clearTimeout(entry.timer);
|
|
52
|
+
entry.timer = setTimeout(async () => {
|
|
53
|
+
entry.timer = null;
|
|
54
|
+
let snapshot = null;
|
|
55
|
+
try {
|
|
56
|
+
const status = await gitStatus(entry.repo);
|
|
57
|
+
snapshot = JSON.stringify(status.files);
|
|
58
|
+
} catch {
|
|
59
|
+
snapshot = null;
|
|
60
|
+
}
|
|
61
|
+
if (snapshot === null || snapshot === entry.lastStatus) return;
|
|
62
|
+
entry.lastStatus = snapshot;
|
|
63
|
+
entry.rootEventPending = false;
|
|
64
|
+
let open = false;
|
|
65
|
+
try {
|
|
66
|
+
open = await entry.gateCheck();
|
|
67
|
+
} catch {
|
|
68
|
+
open = false;
|
|
69
|
+
}
|
|
70
|
+
if (open) bump(workspaceKey);
|
|
71
|
+
else try {
|
|
72
|
+
entry.onGateClosed();
|
|
73
|
+
} catch {}
|
|
74
|
+
}, 300);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Acquire one claim on a repo's index watcher for a workspace. The watcher
|
|
78
|
+
* is created on the FIRST acquire and torn down when the last lease is
|
|
79
|
+
* released (ADR D5). gateCheck is re-resolved on every ring — never cached.
|
|
80
|
+
*/
|
|
81
|
+
function acquireWatch(opts) {
|
|
82
|
+
const ws = workspaceOf(opts.workspaceKey);
|
|
83
|
+
let entry = ws.watchers.get(opts.repo);
|
|
84
|
+
if (!entry) {
|
|
85
|
+
let watcher;
|
|
86
|
+
try {
|
|
87
|
+
watcher = watch(join(opts.repo, ".git"), () => {
|
|
88
|
+
scheduleRing(opts.workspaceKey, fresh);
|
|
89
|
+
});
|
|
90
|
+
} catch {
|
|
91
|
+
const dead = {
|
|
92
|
+
watcher: { close: () => void 0 },
|
|
93
|
+
rootWatcher: null,
|
|
94
|
+
refcount: 0,
|
|
95
|
+
repo: opts.repo,
|
|
96
|
+
gateCheck: opts.gateCheck,
|
|
97
|
+
onGateClosed: opts.onGateClosed ?? (() => void 0),
|
|
98
|
+
timer: null,
|
|
99
|
+
lastStatus: null,
|
|
100
|
+
rootEventPending: false
|
|
101
|
+
};
|
|
102
|
+
entry = dead;
|
|
103
|
+
ws.watchers.set(opts.repo, entry);
|
|
104
|
+
entry.refcount += 1;
|
|
105
|
+
let alreadyReleased = false;
|
|
106
|
+
return { release: async () => {
|
|
107
|
+
if (alreadyReleased) return;
|
|
108
|
+
alreadyReleased = true;
|
|
109
|
+
await releaseWatcher(opts.workspaceKey, dead);
|
|
110
|
+
} };
|
|
111
|
+
}
|
|
112
|
+
const fresh = {
|
|
113
|
+
watcher,
|
|
114
|
+
rootWatcher: null,
|
|
115
|
+
refcount: 0,
|
|
116
|
+
repo: opts.repo,
|
|
117
|
+
gateCheck: opts.gateCheck,
|
|
118
|
+
onGateClosed: opts.onGateClosed ?? (() => void 0),
|
|
119
|
+
timer: null,
|
|
120
|
+
lastStatus: statusSnapshotSync(opts.repo),
|
|
121
|
+
rootEventPending: false
|
|
122
|
+
};
|
|
123
|
+
entry = fresh;
|
|
124
|
+
watcher.on("error", () => {
|
|
125
|
+
releaseWatcher(opts.workspaceKey, fresh);
|
|
126
|
+
});
|
|
127
|
+
let rootWatcher = null;
|
|
128
|
+
try {
|
|
129
|
+
rootWatcher = watch(opts.repo, (kind, name) => {
|
|
130
|
+
const n = name === null ? "" : String(name);
|
|
131
|
+
if (n === ".git" || n.startsWith(".git")) return;
|
|
132
|
+
fresh.rootEventPending = true;
|
|
133
|
+
scheduleRing(opts.workspaceKey, fresh);
|
|
134
|
+
});
|
|
135
|
+
} catch {
|
|
136
|
+
rootWatcher = null;
|
|
137
|
+
}
|
|
138
|
+
fresh.rootWatcher = rootWatcher;
|
|
139
|
+
watcher.on("error", () => {
|
|
140
|
+
releaseWatcher(opts.workspaceKey, fresh);
|
|
141
|
+
});
|
|
142
|
+
ws.watchers.set(opts.repo, entry);
|
|
143
|
+
}
|
|
144
|
+
entry.refcount += 1;
|
|
145
|
+
let released = false;
|
|
146
|
+
return { release: async () => {
|
|
147
|
+
if (released) return;
|
|
148
|
+
released = true;
|
|
149
|
+
await releaseWatcher(opts.workspaceKey, entry);
|
|
150
|
+
} };
|
|
151
|
+
}
|
|
152
|
+
async function releaseWatcher(workspaceKey, entry) {
|
|
153
|
+
const ws = registry.get(workspaceKey);
|
|
154
|
+
if (!ws) return;
|
|
155
|
+
if (ws.watchers.get(entry.repo) !== entry) return;
|
|
156
|
+
entry.refcount -= 1;
|
|
157
|
+
if (entry.refcount > 0) return;
|
|
158
|
+
ws.watchers.delete(entry.repo);
|
|
159
|
+
if (entry.timer !== null) clearTimeout(entry.timer);
|
|
160
|
+
entry.timer = null;
|
|
161
|
+
try {
|
|
162
|
+
await entry.watcher.close();
|
|
163
|
+
} catch {}
|
|
164
|
+
if (entry.rootWatcher !== null) try {
|
|
165
|
+
entry.rootWatcher.close();
|
|
166
|
+
} catch {}
|
|
167
|
+
if (ws.watchers.size === 0 && ws.listeners.size === 0) registry.delete(workspaceKey);
|
|
168
|
+
}
|
|
169
|
+
/** SYNC baseline seed (Index Pulse): a null lastStatus makes the first
|
|
170
|
+
* verified ring bump even when NOTHING changed (FSEvents setup ghosts
|
|
171
|
+
* made that a real flake). Reading porcelain synchronously at acquire
|
|
172
|
+
* costs one bounded git child per watcher CREATION (not per ring) and
|
|
173
|
+
* removes the race an async seed provably has. */
|
|
174
|
+
function statusSnapshotSync(repo) {
|
|
175
|
+
try {
|
|
176
|
+
const out = execFileSync("git", [
|
|
177
|
+
"-C",
|
|
178
|
+
repo,
|
|
179
|
+
"status",
|
|
180
|
+
"--porcelain=v1",
|
|
181
|
+
"-z"
|
|
182
|
+
], {
|
|
183
|
+
timeout: 1e4,
|
|
184
|
+
maxBuffer: 4194304
|
|
185
|
+
});
|
|
186
|
+
return JSON.stringify(parsePorcelainStatus(out.toString()).files);
|
|
187
|
+
} catch {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/routes/api/workspace/git-events/+server.ts
|
|
193
|
+
/**
|
|
194
|
+
* api-workspace — GET /api/workspace/git-events?sessionId=…&root=…&repo=…(&repo=…)
|
|
195
|
+
*
|
|
196
|
+
* The Index Pulse's SSE stream (ADR 2026-09-13, D3/D5): one server-sent
|
|
197
|
+
* events channel per explorer panel. The gate is resolved at connect —
|
|
198
|
+
* closed means the plain git-status JSON contract ({ ok:true,
|
|
199
|
+
* enabled:false }), NOT a stream. Open, the stream speaks two events:
|
|
200
|
+
* `generation` (a per-workspace monotonic integer, one per debounced ring)
|
|
201
|
+
* and `enabled:false` (the gate died mid-stream; the panel degrades to
|
|
202
|
+
* today's manual-Refresh world). TRUTH NEVER RIDES THIS STREAM — the panel
|
|
203
|
+
* refetches rows through the unchanged gated git-status route. Watchers
|
|
204
|
+
* are refcounted per workspace; the last client's disconnect closes them.
|
|
205
|
+
*/
|
|
206
|
+
var GET = async ({ url, request }) => {
|
|
207
|
+
const sessionId = url.searchParams.get("sessionId");
|
|
208
|
+
const root = url.searchParams.get("root");
|
|
209
|
+
const repos = url.searchParams.getAll("repo").filter((r) => r.trim().length > 0);
|
|
210
|
+
if (sessionId === null || sessionId.trim().length === 0 || root === null || root.trim().length === 0 || repos.length === 0) return json({
|
|
211
|
+
ok: false,
|
|
212
|
+
error: {
|
|
213
|
+
code: "bad-params",
|
|
214
|
+
message: "sessionId, root and at least one repo are required"
|
|
215
|
+
}
|
|
216
|
+
}, { status: 400 });
|
|
217
|
+
let enabled;
|
|
218
|
+
try {
|
|
219
|
+
enabled = await gitGateEnabled(sessionId);
|
|
220
|
+
} catch (err) {
|
|
221
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
222
|
+
}
|
|
223
|
+
if (!enabled) return json({
|
|
224
|
+
ok: true,
|
|
225
|
+
enabled: false
|
|
226
|
+
});
|
|
227
|
+
for (const repo of repos) if (!await isInsideRoot(root, repo)) return json({
|
|
228
|
+
ok: false,
|
|
229
|
+
error: {
|
|
230
|
+
code: "outside-workspace",
|
|
231
|
+
message: "the repo path is not inside the workspace root"
|
|
232
|
+
}
|
|
233
|
+
}, { status: 403 });
|
|
234
|
+
const encoder = new TextEncoder();
|
|
235
|
+
const workspaceKey = root;
|
|
236
|
+
let cleanup = () => void 0;
|
|
237
|
+
const stream = new ReadableStream({
|
|
238
|
+
start(controller) {
|
|
239
|
+
let closed = false;
|
|
240
|
+
const send = (event, data) => {
|
|
241
|
+
if (closed) return;
|
|
242
|
+
try {
|
|
243
|
+
controller.enqueue(encoder.encode("event: " + event + "\ndata: " + data + "\n\n"));
|
|
244
|
+
} catch {
|
|
245
|
+
closed = true;
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
send("generation", String(getGeneration(workspaceKey)));
|
|
249
|
+
const leases = repos.map((repo) => acquireWatch({
|
|
250
|
+
workspaceKey,
|
|
251
|
+
repo,
|
|
252
|
+
gateCheck: () => gitGateEnabled(sessionId),
|
|
253
|
+
onGateClosed: () => {
|
|
254
|
+
send("enabled", "false");
|
|
255
|
+
finish();
|
|
256
|
+
}
|
|
257
|
+
}));
|
|
258
|
+
const unsubscribe = onGeneration(workspaceKey, (generation) => {
|
|
259
|
+
send("generation", String(generation));
|
|
260
|
+
});
|
|
261
|
+
const ping = setInterval(() => {
|
|
262
|
+
if (closed) return;
|
|
263
|
+
try {
|
|
264
|
+
controller.enqueue(encoder.encode(": ping\n\n"));
|
|
265
|
+
} catch {
|
|
266
|
+
closed = true;
|
|
267
|
+
}
|
|
268
|
+
}, 25e3);
|
|
269
|
+
function finish() {
|
|
270
|
+
if (closed) return;
|
|
271
|
+
closed = true;
|
|
272
|
+
clearInterval(ping);
|
|
273
|
+
unsubscribe();
|
|
274
|
+
for (const lease of leases) lease.release();
|
|
275
|
+
try {
|
|
276
|
+
controller.close();
|
|
277
|
+
} catch {}
|
|
278
|
+
}
|
|
279
|
+
cleanup = finish;
|
|
280
|
+
request.signal.addEventListener("abort", finish);
|
|
281
|
+
},
|
|
282
|
+
cancel() {
|
|
283
|
+
cleanup();
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
return new Response(stream, { headers: {
|
|
287
|
+
"content-type": "text/event-stream; charset=utf-8",
|
|
288
|
+
"cache-control": "no-cache",
|
|
289
|
+
connection: "keep-alive",
|
|
290
|
+
"x-accel-buffering": "no"
|
|
291
|
+
} });
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
export { GET };
|
|
295
|
+
//# sourceMappingURL=_server.ts.js-DsrelTvu.js.map
|
package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/_server.ts.js-Bjo1hSe3.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DlwhJZaV.js';
|
|
2
|
+
import { g as gitGateEnabled, r as resolveEnclosingRepo, i as isInsideRoot, b as gitFileHead, G as GitUnavailableError } from '../../../../../chunks/git-probe.js-nfLEa58f.js';
|
|
3
|
+
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
|
+
import '../../../../../chunks/config.js-D2vQdial.js';
|
|
5
|
+
import '../../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
6
|
+
import '../../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:os';
|
|
10
|
+
import 'yaml';
|
|
11
|
+
import '../../../../../chunks/dsh-events.js-BtDxaV6Q.js';
|
|
12
|
+
import '../../../../../chunks/permission-state.js-yvwUSnug.js';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/workspace/git-file-head/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* api-workspace — GET /api/workspace/git-file-head?sessionId=…&root=…&path=…
|
|
20
|
+
*
|
|
21
|
+
* The File Eye's "before" side (ADR The File Eye 2026-09-12, D2): the
|
|
22
|
+
* DSI server resolves the file's enclosing repo and runs a READ-ONLY
|
|
23
|
+
* git show HEAD:<rel>, gated exactly like git-status. head is null when
|
|
24
|
+
* git has no version of the path (untracked / newly added) — the honest
|
|
25
|
+
* no-before-version, never an error. Containment over realpaths.
|
|
26
|
+
*/
|
|
27
|
+
var GET = async ({ url }) => {
|
|
28
|
+
const sessionId = url.searchParams.get("sessionId");
|
|
29
|
+
const root = url.searchParams.get("root");
|
|
30
|
+
const path = url.searchParams.get("path");
|
|
31
|
+
if (sessionId === null || sessionId.trim().length === 0 || root === null || root.trim().length === 0 || path === null || path.trim().length === 0) return json({
|
|
32
|
+
ok: false,
|
|
33
|
+
error: {
|
|
34
|
+
code: "bad-params",
|
|
35
|
+
message: "sessionId, root and path are required"
|
|
36
|
+
}
|
|
37
|
+
}, { status: 400 });
|
|
38
|
+
let enabled;
|
|
39
|
+
try {
|
|
40
|
+
enabled = await gitGateEnabled(sessionId);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
43
|
+
}
|
|
44
|
+
if (!enabled) return json({
|
|
45
|
+
ok: true,
|
|
46
|
+
enabled: false
|
|
47
|
+
});
|
|
48
|
+
const enclosing = await resolveEnclosingRepo(root, path);
|
|
49
|
+
if (enclosing === null) return json({
|
|
50
|
+
ok: false,
|
|
51
|
+
error: {
|
|
52
|
+
code: "no-repo",
|
|
53
|
+
message: "no git repo encloses this path"
|
|
54
|
+
}
|
|
55
|
+
}, { status: 404 });
|
|
56
|
+
if (!await isInsideRoot(root, enclosing.repo)) return json({
|
|
57
|
+
ok: false,
|
|
58
|
+
error: {
|
|
59
|
+
code: "outside-workspace",
|
|
60
|
+
message: "the repo path is not inside the workspace root"
|
|
61
|
+
}
|
|
62
|
+
}, { status: 403 });
|
|
63
|
+
try {
|
|
64
|
+
const head = await gitFileHead(enclosing.repo, enclosing.rel);
|
|
65
|
+
return json({
|
|
66
|
+
ok: true,
|
|
67
|
+
enabled: true,
|
|
68
|
+
head
|
|
69
|
+
});
|
|
70
|
+
} catch (err) {
|
|
71
|
+
if (err instanceof GitUnavailableError) return json({
|
|
72
|
+
ok: false,
|
|
73
|
+
code: "git-unavailable",
|
|
74
|
+
message: err.message
|
|
75
|
+
});
|
|
76
|
+
return json({
|
|
77
|
+
ok: false,
|
|
78
|
+
error: {
|
|
79
|
+
code: "head-failed",
|
|
80
|
+
message: err instanceof Error ? err.message : "head read failed"
|
|
81
|
+
}
|
|
82
|
+
}, { status: statusFor(err) });
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { GET };
|
|
87
|
+
//# sourceMappingURL=_server.ts.js-Bjo1hSe3.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { s as statusFor, m as mapRpcFailure } from '../../../../../chunks/dsh-connection.js-DlwhJZaV.js';
|
|
2
|
+
import { g as gitGateEnabled, d as detectRepos } from '../../../../../chunks/git-probe.js-nfLEa58f.js';
|
|
3
|
+
import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
|
|
4
|
+
import '../../../../../chunks/config.js-D2vQdial.js';
|
|
5
|
+
import '../../../../../chunks/insight-config.js-BwcV3Bct.js';
|
|
6
|
+
import '../../../../../chunks/settings-document.js-BIwLIxnE.js';
|
|
7
|
+
import 'node:fs';
|
|
8
|
+
import 'node:path';
|
|
9
|
+
import 'node:os';
|
|
10
|
+
import 'yaml';
|
|
11
|
+
import '../../../../../chunks/dsh-events.js-BtDxaV6Q.js';
|
|
12
|
+
import '../../../../../chunks/permission-state.js-yvwUSnug.js';
|
|
13
|
+
import 'node:child_process';
|
|
14
|
+
import '../../../../../chunks/shared.js-HQ0rfhm4.js';
|
|
15
|
+
import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
16
|
+
|
|
17
|
+
//#region src/routes/api/workspace/git-map/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* api-workspace — GET /api/workspace/git-map?sessionId=…&dir=…
|
|
20
|
+
*
|
|
21
|
+
* Per-level repo flags for the workspace explorer (Git Eye ADR 2026-09-12,
|
|
22
|
+
* D1/D3): which immediate child directories host a .git entry, and whether
|
|
23
|
+
* the level itself does. Detection lives in $lib/server/git-probe and is
|
|
24
|
+
* GATED (ADR D2): unless the owning session's sandbox mode is
|
|
25
|
+
* danger-full-access, the route answers { ok:true, enabled:false } and
|
|
26
|
+
* touches the filesystem for NOTHING. Errors keep the explorer's honest
|
|
27
|
+
* failure face: a vanished directory is 404 not-found, a forbidden one 403,
|
|
28
|
+
* anything else the shared status mapping.
|
|
29
|
+
*/
|
|
30
|
+
function errnoStatus(err) {
|
|
31
|
+
const code = err?.code;
|
|
32
|
+
if (code === "ENOENT") return 404;
|
|
33
|
+
if (code === "EACCES" || code === "EPERM") return 403;
|
|
34
|
+
return statusFor(err);
|
|
35
|
+
}
|
|
36
|
+
var GET = async ({ url }) => {
|
|
37
|
+
const sessionId = url.searchParams.get("sessionId");
|
|
38
|
+
const dir = url.searchParams.get("dir");
|
|
39
|
+
if (sessionId === null || sessionId.trim().length === 0 || dir === null || dir.trim().length === 0) return json({
|
|
40
|
+
ok: false,
|
|
41
|
+
error: {
|
|
42
|
+
code: "bad-params",
|
|
43
|
+
message: "sessionId and dir are required"
|
|
44
|
+
}
|
|
45
|
+
}, { status: 400 });
|
|
46
|
+
let enabled;
|
|
47
|
+
try {
|
|
48
|
+
enabled = await gitGateEnabled(sessionId);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
51
|
+
}
|
|
52
|
+
if (!enabled) return json({
|
|
53
|
+
ok: true,
|
|
54
|
+
enabled: false
|
|
55
|
+
});
|
|
56
|
+
try {
|
|
57
|
+
const map = await detectRepos(dir);
|
|
58
|
+
return json({
|
|
59
|
+
ok: true,
|
|
60
|
+
enabled: true,
|
|
61
|
+
...map
|
|
62
|
+
});
|
|
63
|
+
} catch (err) {
|
|
64
|
+
return json({
|
|
65
|
+
ok: false,
|
|
66
|
+
error: {
|
|
67
|
+
code: "probe-failed",
|
|
68
|
+
message: err instanceof Error ? err.message : "probe failed"
|
|
69
|
+
}
|
|
70
|
+
}, { status: errnoStatus(err) });
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { GET };
|
|
75
|
+
//# sourceMappingURL=_server.ts.js-kbPAnTV6.js.map
|