@deepseek-insight/dsi 0.5.9 → 0.5.11
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 +112 -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/06CitLNM.js +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/{DlLP-Tuk.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/{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/{DI6I60fv.js → BS84xqUl.js} +1 -1
- package/build/client/_app/immutable/chunks/BhA_Mtox.js +2 -0
- 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/{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/{B38Unp4-.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/CoCs8NEu.js +1 -0
- 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/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/DemMpn7y.js +1 -0
- 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/{Kcoq1pzq.js → FDKaBHdO.js} +1 -1
- package/build/client/_app/immutable/chunks/{BD8HEhdy.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/{Cy8ZCjxB.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.CO61_ZoK.js +2 -0
- package/build/client/_app/immutable/entry/start.D2897Ko1.js +1 -0
- package/build/client/_app/immutable/nodes/0.Cl1RKBMO.js +1 -0
- package/build/client/_app/immutable/nodes/1.BTAH4lX4.js +1 -0
- package/build/client/_app/immutable/nodes/2.BIBOCzYk.js +174 -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-kXJJJomG.js → internal.js-CRfRCfoU.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-7BOeaoQB.js → state.js-BB7-MsQ0.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-BVjBiEZD.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-N0F4WBmN.js → _page.svelte.js-D6UC7cGf.js} +5212 -380
- package/build/server/chunks/{handler-DonVRS0X.js → handler-BKbAUWNh.js} +8 -8
- package/build/server/chunks/{index.js-BeG-TgOY.js → index.js-DNjzSibQ.js} +35 -35
- package/build/server/chunks/{manifest.js-CjHfy5rn.js → manifest.js-By1cjJ9N.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-nA42GX_X.js +9 -0
- package/build/server/chunks/nodes/2.js-C5a91sl7.js +26 -0
- package/package.json +5 -2
- package/build/client/_app/immutable/assets/0.DqFt8jIM.css +0 -2
- package/build/client/_app/immutable/assets/2.CybNpyHE.css +0 -1
- package/build/client/_app/immutable/chunks/Bp4uuUjI.js +0 -3
- package/build/client/_app/immutable/chunks/COnL3E7k.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/Y2GhLLeG.js +0 -1
- package/build/client/_app/immutable/chunks/c6YVk1M6.js +0 -2
- package/build/client/_app/immutable/chunks/i0VQdJtv.js +0 -1
- package/build/client/_app/immutable/entry/app.BleekCCN.js +0 -2
- package/build/client/_app/immutable/entry/start.BpFQKF_D.js +0 -1
- package/build/client/_app/immutable/nodes/0.B_ZEZy7b.js +0 -1
- package/build/client/_app/immutable/nodes/1.CY-dc03C.js +0 -1
- package/build/client/_app/immutable/nodes/2.DbShW3bE.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-COiCqUkC.js +0 -41
- package/build/server/chunks/nodes/1.js-_W3O7q0J.js +0 -9
- package/build/server/chunks/nodes/2.js-BKYP_GxW.js +0 -24
package/build/server/chunks/entries/endpoints/api/workspace/git-status/_server.ts.js-CGSk5JWn.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
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, 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-status/+server.ts
|
|
18
|
+
/**
|
|
19
|
+
* api-workspace — GET /api/workspace/git-status?sessionId=…&root=…&repo=…
|
|
20
|
+
*
|
|
21
|
+
* Working-tree changes for ONE repo root, grouped view source (Git Eye ADR
|
|
22
|
+
* 2026-09-12, D5): the DSI server runs a READ-ONLY git status, gated exactly
|
|
23
|
+
* like git-map (ADR D2). The repo must BE the explorer's workspace root or
|
|
24
|
+
* live inside it — realpath containment, refused 403 outside-workspace.
|
|
25
|
+
* A missing git binary is a VISIBLE failure ({ ok:false, code:
|
|
26
|
+
* 'git-unavailable' }), never a blank pane.
|
|
27
|
+
*/
|
|
28
|
+
var GET = async ({ url }) => {
|
|
29
|
+
const sessionId = url.searchParams.get("sessionId");
|
|
30
|
+
const root = url.searchParams.get("root");
|
|
31
|
+
const repo = url.searchParams.get("repo");
|
|
32
|
+
if (sessionId === null || sessionId.trim().length === 0 || root === null || root.trim().length === 0 || repo === null || repo.trim().length === 0) return json({
|
|
33
|
+
ok: false,
|
|
34
|
+
error: {
|
|
35
|
+
code: "bad-params",
|
|
36
|
+
message: "sessionId, root and repo are required"
|
|
37
|
+
}
|
|
38
|
+
}, { status: 400 });
|
|
39
|
+
let enabled;
|
|
40
|
+
try {
|
|
41
|
+
enabled = await gitGateEnabled(sessionId);
|
|
42
|
+
} catch (err) {
|
|
43
|
+
return json(mapRpcFailure(err), { status: statusFor(err) });
|
|
44
|
+
}
|
|
45
|
+
if (!enabled) return json({
|
|
46
|
+
ok: true,
|
|
47
|
+
enabled: false
|
|
48
|
+
});
|
|
49
|
+
if (!await isInsideRoot(root, repo)) return json({
|
|
50
|
+
ok: false,
|
|
51
|
+
error: {
|
|
52
|
+
code: "outside-workspace",
|
|
53
|
+
message: "the repo path is not inside the workspace root"
|
|
54
|
+
}
|
|
55
|
+
}, { status: 403 });
|
|
56
|
+
try {
|
|
57
|
+
const status = await gitStatus(repo);
|
|
58
|
+
return json({
|
|
59
|
+
ok: true,
|
|
60
|
+
enabled: true,
|
|
61
|
+
...status
|
|
62
|
+
});
|
|
63
|
+
} catch (err) {
|
|
64
|
+
if (err instanceof GitUnavailableError) return json({
|
|
65
|
+
ok: false,
|
|
66
|
+
code: "git-unavailable",
|
|
67
|
+
message: err.message
|
|
68
|
+
});
|
|
69
|
+
return json({
|
|
70
|
+
ok: false,
|
|
71
|
+
error: {
|
|
72
|
+
code: "status-failed",
|
|
73
|
+
message: err instanceof Error ? err.message : "status failed"
|
|
74
|
+
}
|
|
75
|
+
}, { status: statusFor(err) });
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export { GET };
|
|
80
|
+
//# sourceMappingURL=_server.ts.js-CGSk5JWn.js.map
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { U as UI_LOCALES } from '../chunks/config.js-D2vQdial.js';
|
|
2
|
+
import { r as readSettingsDocument } from '../chunks/settings-document.js-BIwLIxnE.js';
|
|
3
|
+
import { g as getServerAsyncLocalStorage, i as isExcludedByRouteStrategy, s as serverAsyncLocalStorage, a as getStrategyForUrl, b as shouldRedirect, d as deLocalizeUrl, o as overwriteServerAsyncLocalStorage } from '../chunks/runtime.js-BPLc5RLR.js';
|
|
4
|
+
import { parse } from 'yaml';
|
|
5
|
+
import 'node:fs';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import 'node:os';
|
|
8
|
+
|
|
9
|
+
//#region src/lib/paraglide/server.js
|
|
10
|
+
/**
|
|
11
|
+
* Server middleware that handles locale-based routing and request processing.
|
|
12
|
+
*
|
|
13
|
+
* Configure `disableAsyncLocalStorage` when generating Paraglide with
|
|
14
|
+
* `paraglideVitePlugin()` or `compile()`, not when calling
|
|
15
|
+
* `paraglideMiddleware()`. Keep AsyncLocalStorage enabled by default and
|
|
16
|
+
* only disable it for runtimes that lack `AsyncLocalStorage` support and
|
|
17
|
+
* guarantee request isolation.
|
|
18
|
+
*
|
|
19
|
+
* This middleware performs several key functions:
|
|
20
|
+
*
|
|
21
|
+
* 1. Determines the locale for the incoming request using configured strategies
|
|
22
|
+
* 2. Handles URL localization and redirects (only for document requests)
|
|
23
|
+
* 3. Maintains locale state using AsyncLocalStorage to prevent request interference
|
|
24
|
+
*
|
|
25
|
+
* When URL strategy is used:
|
|
26
|
+
*
|
|
27
|
+
* - The locale is extracted from the URL for all request types
|
|
28
|
+
* - If URL doesn't match the determined locale, redirects to localized URL (only for document requests)
|
|
29
|
+
* - De-localizes URLs before passing to server (e.g., `/fr/about` → `/about`)
|
|
30
|
+
*
|
|
31
|
+
* @see https://paraglidejs.com/middleware
|
|
32
|
+
*
|
|
33
|
+
* @template T - The return type of the resolve function
|
|
34
|
+
*
|
|
35
|
+
* @param {Request} request - The incoming request object
|
|
36
|
+
* @param {(args: { request: Request, locale: import("./runtime.js").Locale }) => T | Promise<T>} resolve - Function to handle the request. The callback receives:
|
|
37
|
+
* - `request`: A modified request with a delocalized URL when the URL strategy is used (e.g., `/fr/about` → `/about`).
|
|
38
|
+
* If your framework handles URL localization itself (e.g., TanStack Router's `rewrite` option), use the original
|
|
39
|
+
* request instead to avoid redirect loops.
|
|
40
|
+
* - `locale`: The determined locale for this request.
|
|
41
|
+
* @param {{
|
|
42
|
+
* effectiveRequestUrl?: string | URL | ((request: Request) => string | URL),
|
|
43
|
+
* onRedirect?: (response: Response) => void
|
|
44
|
+
* }} [options] - Options to control middleware behavior. `effectiveRequestUrl` sets the effective request URL used for route matching, URL-based locale detection, redirects, and `getUrlOrigin()`.
|
|
45
|
+
* @returns {Promise<Response>}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // Basic usage in metaframeworks like NextJS, SvelteKit, Astro, Nuxt, etc.
|
|
50
|
+
* export const handle = async ({ event, resolve }) => {
|
|
51
|
+
* return paraglideMiddleware(event.request, ({ request, locale }) => {
|
|
52
|
+
* // let the framework further resolve the request
|
|
53
|
+
* return resolve(request);
|
|
54
|
+
* });
|
|
55
|
+
* };
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // Usage in a framework like Express JS or Hono
|
|
61
|
+
* app.use(async (req, res, next) => {
|
|
62
|
+
* const result = await paraglideMiddleware(req, ({ request, locale }) => {
|
|
63
|
+
* // If a redirect happens this won't be called
|
|
64
|
+
* return next(request);
|
|
65
|
+
* });
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* // Usage with frameworks that handle URL localization/delocalization themselves
|
|
72
|
+
* //
|
|
73
|
+
* // Some frameworks like TanStack Router handle URL localization and delocalization
|
|
74
|
+
* // themselves via their own rewrite APIs (e.g., `rewrite.input`/`rewrite.output`).
|
|
75
|
+
* //
|
|
76
|
+
* // When the framework handles this, the middleware's URL delocalization is not needed.
|
|
77
|
+
* // Using the modified `request` from the callback would cause a redirect loop because
|
|
78
|
+
* // both the middleware and the framework would attempt to delocalize the URL.
|
|
79
|
+
* //
|
|
80
|
+
* // Solution: Pass the original request to the handler instead of the modified one.
|
|
81
|
+
* // The middleware still handles locale detection, cookies, and AsyncLocalStorage context.
|
|
82
|
+
* //
|
|
83
|
+
* // ❌ WRONG - causes redirect loop when framework handles URL rewriting:
|
|
84
|
+
* // paraglideMiddleware(req, ({ request }) => handler.fetch(request))
|
|
85
|
+
* //
|
|
86
|
+
* // ✅ CORRECT - use original request when framework handles URL localization:
|
|
87
|
+
* // paraglideMiddleware(req, () => handler.fetch(req))
|
|
88
|
+
*
|
|
89
|
+
* * *
|
|
90
|
+
* export default {
|
|
91
|
+
* fetch(req: Request): Promise<Response> {
|
|
92
|
+
* // TanStack Router handles URL rewriting via deLocalizeUrl/localizeUrl
|
|
93
|
+
* // so we pass the original `req` instead of the modified `request`
|
|
94
|
+
* return paraglideMiddleware(req, () => handler.fetch(req))
|
|
95
|
+
* },
|
|
96
|
+
* }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
async function paraglideMiddleware(request, resolve, options) {
|
|
100
|
+
let requestAsyncLocalStorage = serverAsyncLocalStorage;
|
|
101
|
+
requestAsyncLocalStorage = getServerAsyncLocalStorage();
|
|
102
|
+
if (!requestAsyncLocalStorage) {
|
|
103
|
+
const { AsyncLocalStorage } = await import('async_hooks');
|
|
104
|
+
requestAsyncLocalStorage = getServerAsyncLocalStorage();
|
|
105
|
+
if (!requestAsyncLocalStorage) {
|
|
106
|
+
requestAsyncLocalStorage = new AsyncLocalStorage();
|
|
107
|
+
overwriteServerAsyncLocalStorage(requestAsyncLocalStorage);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!requestAsyncLocalStorage) {
|
|
111
|
+
requestAsyncLocalStorage = createMockAsyncLocalStorage();
|
|
112
|
+
overwriteServerAsyncLocalStorage(requestAsyncLocalStorage);
|
|
113
|
+
}
|
|
114
|
+
const url = resolveMiddlewareUrl(request, options?.effectiveRequestUrl);
|
|
115
|
+
const origin = url.origin;
|
|
116
|
+
if (isExcludedByRouteStrategy(url.href)) {
|
|
117
|
+
const locale = "en";
|
|
118
|
+
const newRequest = cloneRequestWithFallback(request, url);
|
|
119
|
+
/** @type {Set<string>} */
|
|
120
|
+
const messageCalls = /* @__PURE__ */ new Set();
|
|
121
|
+
return await requestAsyncLocalStorage?.run({
|
|
122
|
+
locale,
|
|
123
|
+
origin,
|
|
124
|
+
messageCalls
|
|
125
|
+
}, () => resolve({
|
|
126
|
+
locale,
|
|
127
|
+
request: newRequest
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
const strategy = getStrategyForUrl(url.href);
|
|
131
|
+
const decision = await shouldRedirect({
|
|
132
|
+
request,
|
|
133
|
+
effectiveRequestUrl: url
|
|
134
|
+
});
|
|
135
|
+
const locale = decision.locale;
|
|
136
|
+
if (request.headers.get("Sec-Fetch-Dest") === "document" && decision.shouldRedirect && decision.redirectUrl) {
|
|
137
|
+
/** @type {Record<string, string>} */
|
|
138
|
+
const headers = {};
|
|
139
|
+
if (strategy.includes("preferredLanguage")) headers["Vary"] = "Accept-Language";
|
|
140
|
+
const response = new Response(null, {
|
|
141
|
+
status: 307,
|
|
142
|
+
headers: {
|
|
143
|
+
Location: decision.redirectUrl.href,
|
|
144
|
+
...headers
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return response;
|
|
148
|
+
}
|
|
149
|
+
let newRequest;
|
|
150
|
+
if (strategy.includes("url")) newRequest = cloneRequestWithFallback(request, deLocalizeUrl(url));
|
|
151
|
+
else newRequest = cloneRequestWithFallback(request, url);
|
|
152
|
+
/** @type {Set<string>} */
|
|
153
|
+
const messageCalls = /* @__PURE__ */ new Set();
|
|
154
|
+
return await requestAsyncLocalStorage?.run({
|
|
155
|
+
locale,
|
|
156
|
+
origin,
|
|
157
|
+
messageCalls
|
|
158
|
+
}, () => resolve({
|
|
159
|
+
locale,
|
|
160
|
+
request: newRequest
|
|
161
|
+
}));
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @param {Request} request
|
|
165
|
+
* @param {string | URL | ((request: Request) => string | URL) | undefined} effectiveRequestUrl
|
|
166
|
+
* @returns {URL}
|
|
167
|
+
*/
|
|
168
|
+
function resolveMiddlewareUrl(request, effectiveRequestUrl) {
|
|
169
|
+
if (effectiveRequestUrl instanceof URL) return new URL(effectiveRequestUrl, request.url);
|
|
170
|
+
return new URL(request.url);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Some metaframeworks (NextJS) require a new Request object.
|
|
174
|
+
* https://github.com/opral/inlang-paraglide-js/issues/411
|
|
175
|
+
*
|
|
176
|
+
* However, some frameworks (TanStack Start 1.143+) use custom Request
|
|
177
|
+
* implementations that cannot be cloned with `new Request(request)`.
|
|
178
|
+
* https://github.com/opral/paraglide-js/issues/573
|
|
179
|
+
*
|
|
180
|
+
* Effective request URL overrides behind proxies:
|
|
181
|
+
* https://github.com/opral/paraglide-js/issues/652
|
|
182
|
+
*
|
|
183
|
+
* @param {Request} request
|
|
184
|
+
* @param {string | URL} [url]
|
|
185
|
+
* @returns {Request}
|
|
186
|
+
*/
|
|
187
|
+
function cloneRequestWithFallback(request, url = request.url) {
|
|
188
|
+
const targetUrl = typeof url === "string" ? url : url.href;
|
|
189
|
+
if (targetUrl === request.url) try {
|
|
190
|
+
return new Request(request.clone());
|
|
191
|
+
} catch {
|
|
192
|
+
try {
|
|
193
|
+
return new Request(request);
|
|
194
|
+
} catch {
|
|
195
|
+
return request;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
return new Request(targetUrl, request.clone());
|
|
200
|
+
} catch {
|
|
201
|
+
try {
|
|
202
|
+
return new Request(targetUrl, request);
|
|
203
|
+
} catch {
|
|
204
|
+
return request;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Creates a mock AsyncLocalStorage implementation for environments where
|
|
210
|
+
* native AsyncLocalStorage is not available or disabled.
|
|
211
|
+
*
|
|
212
|
+
* This mock implementation mimics the behavior of the native AsyncLocalStorage
|
|
213
|
+
* but doesn't require the async_hooks module. It's used as a fallback when
|
|
214
|
+
* the runtime does not expose AsyncLocalStorage or when it has been disabled.
|
|
215
|
+
*
|
|
216
|
+
* @returns {import("./runtime.js").ParaglideAsyncLocalStorage}
|
|
217
|
+
*/
|
|
218
|
+
function createMockAsyncLocalStorage() {
|
|
219
|
+
/** @type {any} */
|
|
220
|
+
let currentStore = void 0;
|
|
221
|
+
return {
|
|
222
|
+
getStore() {
|
|
223
|
+
return currentStore;
|
|
224
|
+
},
|
|
225
|
+
async run(store, callback) {
|
|
226
|
+
currentStore = store;
|
|
227
|
+
try {
|
|
228
|
+
return await callback();
|
|
229
|
+
} finally {
|
|
230
|
+
currentStore = void 0;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
//#region src/lib/server/locale.ts
|
|
237
|
+
/**
|
|
238
|
+
* The operator's `ui.locale` default from ~/.dsi/settings.yaml — the raw
|
|
239
|
+
* value (NOT gated): an absent section/missing file returns undefined so
|
|
240
|
+
* the resolver treats yaml as silent and falls through. configPath is the
|
|
241
|
+
* test seam (same shape as readSettingsDocument's own).
|
|
242
|
+
*/
|
|
243
|
+
function readOperatorYamlLocale(configPath) {
|
|
244
|
+
try {
|
|
245
|
+
const { text, missing } = readSettingsDocument("dsi", configPath);
|
|
246
|
+
if (missing) return void 0;
|
|
247
|
+
const doc = parse(text);
|
|
248
|
+
if (doc && typeof doc === "object" && "ui" in doc) return doc.ui?.locale;
|
|
249
|
+
return;
|
|
250
|
+
} catch {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/hooks.server.ts
|
|
256
|
+
/**
|
|
257
|
+
* SSR locale middleware — Three Tongues W1 task 1.4 (ADR 2026-09-12 D2/D3).
|
|
258
|
+
*
|
|
259
|
+
* paraglideMiddleware resolves the request locale with the compiled
|
|
260
|
+
* strategy order (cookie → preferredLanguage → baseLocale). The ADR's
|
|
261
|
+
* operator default (ui.locale in settings.yaml) slots BETWEEN cookie and
|
|
262
|
+
* header: when the request carries no dsi.locale cookie, we inject the
|
|
263
|
+
* yaml default as a cookie on the request before the middleware runs —
|
|
264
|
+
* so paraglide's cookie strategy reads it and the order becomes exactly
|
|
265
|
+
* cookie → yaml → Accept-Language → en.
|
|
266
|
+
*
|
|
267
|
+
* The resolved locale lands in the page via the %paraglide.locale%
|
|
268
|
+
* placeholder in src/app.html (first paint, no flash).
|
|
269
|
+
*
|
|
270
|
+
* The root layout's config-fetch contract (+layout.ts) is untouched:
|
|
271
|
+
* this handle hook composes BEFORE Kit's own plumbing and changes no
|
|
272
|
+
* fetch behavior.
|
|
273
|
+
*/
|
|
274
|
+
/** The request's dsi.locale cookie value, if it names a fleet locale. */
|
|
275
|
+
function validCookieLocale(request) {
|
|
276
|
+
const raw = request.headers.get("cookie")?.split(";").map((c) => c.trim()).find((c) => c.startsWith("dsi.locale="))?.slice(11);
|
|
277
|
+
return raw !== void 0 && UI_LOCALES.includes(raw) ? raw : void 0;
|
|
278
|
+
}
|
|
279
|
+
var handle = async ({ event, resolve }) => {
|
|
280
|
+
const yamlLocale = readOperatorYamlLocale();
|
|
281
|
+
let request = event.request;
|
|
282
|
+
if (yamlLocale !== void 0 && validCookieLocale(request) === void 0) {
|
|
283
|
+
const headers = new Headers(request.headers);
|
|
284
|
+
const kept = (headers.get("cookie") ?? "").split(";").map((c) => c.trim()).filter((c) => c.length > 0 && !c.startsWith("dsi.locale="));
|
|
285
|
+
kept.push("dsi.locale=" + encodeURIComponent(String(yamlLocale)));
|
|
286
|
+
headers.set("cookie", kept.join("; "));
|
|
287
|
+
event.cookies.set("dsi.locale", String(yamlLocale), {
|
|
288
|
+
path: "/",
|
|
289
|
+
httpOnly: false,
|
|
290
|
+
secure: event.url.protocol === "https:"
|
|
291
|
+
});
|
|
292
|
+
request = new Request(request.url, {
|
|
293
|
+
method: request.method,
|
|
294
|
+
headers,
|
|
295
|
+
body: request.body,
|
|
296
|
+
duplex: "half"
|
|
297
|
+
});
|
|
298
|
+
event.request = request;
|
|
299
|
+
}
|
|
300
|
+
return paraglideMiddleware(request, ({ request: localizedRequest, locale }) => {
|
|
301
|
+
event.request = localizedRequest;
|
|
302
|
+
return resolve(event, { transformPageChunk: ({ html }) => html.replace("%paraglide.locale%", locale) });
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
export { handle };
|
|
307
|
+
//# sourceMappingURL=hooks.server.js-B7FsvqtT.js.map
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { V as head, W as escape_html, y as derived } from '../../chunks/server.js-11-pxAWV.js';
|
|
2
|
+
import { c as getLocale } from '../../chunks/runtime.js-BPLc5RLR.js';
|
|
3
|
+
import { t, p as page } from '../../chunks/state.js-BB7-MsQ0.js';
|
|
4
|
+
import '../../chunks/uneval.js-BJ9Qq2SF.js';
|
|
5
|
+
import '../../chunks/internal.js-CRfRCfoU.js';
|
|
6
|
+
import '../../chunks/shared.js-HQ0rfhm4.js';
|
|
7
|
+
import '../../chunks/exports.js-DH_tjtdv.js';
|
|
8
|
+
import '../../chunks/config.js-D2vQdial.js';
|
|
9
|
+
import '../../chunks/utils.js-CAdNO8Tu.js';
|
|
10
|
+
|
|
11
|
+
//#region src/lib/paraglide/messages/backtoworkspace2.js
|
|
12
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
13
|
+
/** @typedef {{}} Backtoworkspace2Inputs */
|
|
14
|
+
var en_backtoworkspace2 = () => {
|
|
15
|
+
return `← Back to the workspace`;
|
|
16
|
+
};
|
|
17
|
+
var zh_backtoworkspace2 = () => {
|
|
18
|
+
return `← 返回工作区`;
|
|
19
|
+
};
|
|
20
|
+
var id_backtoworkspace2 = () => {
|
|
21
|
+
return `← Kembali ke workspace`;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* | output |
|
|
25
|
+
* | --- |
|
|
26
|
+
* | "← Back to the workspace" |
|
|
27
|
+
*
|
|
28
|
+
* @param {Backtoworkspace2Inputs} inputs
|
|
29
|
+
* @param {{ locale?: "en" | "zh" | "id" }} options
|
|
30
|
+
* @returns {LocalizedString}
|
|
31
|
+
*/
|
|
32
|
+
var backtoworkspace2 = ((inputs = {}, options = {}) => {
|
|
33
|
+
const locale = options.locale ?? getLocale();
|
|
34
|
+
if (locale === "zh") return zh_backtoworkspace2();
|
|
35
|
+
if (locale === "id") return id_backtoworkspace2();
|
|
36
|
+
return en_backtoworkspace2();
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/lib/paraglide/messages/dshunreachable1.js
|
|
40
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
41
|
+
/** @typedef {{}} Dshunreachable1Inputs */
|
|
42
|
+
var en_dshunreachable1 = () => {
|
|
43
|
+
return `DSH host unreachable`;
|
|
44
|
+
};
|
|
45
|
+
var zh_dshunreachable1 = () => {
|
|
46
|
+
return `DSH 主机不可达`;
|
|
47
|
+
};
|
|
48
|
+
var id_dshunreachable1 = () => {
|
|
49
|
+
return `Host DSH tidak dapat dijangkau`;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* | output |
|
|
53
|
+
* | --- |
|
|
54
|
+
* | "DSH host unreachable" |
|
|
55
|
+
*
|
|
56
|
+
* @param {Dshunreachable1Inputs} inputs
|
|
57
|
+
* @param {{ locale?: "en" | "zh" | "id" }} options
|
|
58
|
+
* @returns {LocalizedString}
|
|
59
|
+
*/
|
|
60
|
+
var dshunreachable1 = ((inputs = {}, options = {}) => {
|
|
61
|
+
const locale = options.locale ?? getLocale();
|
|
62
|
+
if (locale === "zh") return zh_dshunreachable1();
|
|
63
|
+
if (locale === "id") return id_dshunreachable1();
|
|
64
|
+
return en_dshunreachable1();
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/lib/paraglide/messages/reapednote1.js
|
|
68
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
69
|
+
/** @typedef {{}} Reapednote1Inputs */
|
|
70
|
+
var en_reapednote1 = () => {
|
|
71
|
+
return `It may have been reaped, or the link predates this host's ledger.`;
|
|
72
|
+
};
|
|
73
|
+
var zh_reapednote1 = () => {
|
|
74
|
+
return `它可能已被回收,或链接早于此主机的账本。`;
|
|
75
|
+
};
|
|
76
|
+
var id_reapednote1 = () => {
|
|
77
|
+
return `Mungkin sudah dihapus, atau tautannya lebih tua dari ledger host ini.`;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* | output |
|
|
81
|
+
* | --- |
|
|
82
|
+
* | "It may have been reaped, or the link predates this host's ledger." |
|
|
83
|
+
*
|
|
84
|
+
* @param {Reapednote1Inputs} inputs
|
|
85
|
+
* @param {{ locale?: "en" | "zh" | "id" }} options
|
|
86
|
+
* @returns {LocalizedString}
|
|
87
|
+
*/
|
|
88
|
+
var reapednote1 = ((inputs = {}, options = {}) => {
|
|
89
|
+
const locale = options.locale ?? getLocale();
|
|
90
|
+
if (locale === "zh") return zh_reapednote1();
|
|
91
|
+
if (locale === "id") return id_reapednote1();
|
|
92
|
+
return en_reapednote1();
|
|
93
|
+
});
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/lib/paraglide/messages/sessionnotfound2.js
|
|
96
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
97
|
+
/** @typedef {{}} Sessionnotfound2Inputs */
|
|
98
|
+
var en_sessionnotfound2 = () => {
|
|
99
|
+
return `Session not found`;
|
|
100
|
+
};
|
|
101
|
+
var zh_sessionnotfound2 = () => {
|
|
102
|
+
return `会话未找到`;
|
|
103
|
+
};
|
|
104
|
+
var id_sessionnotfound2 = () => {
|
|
105
|
+
return `Sesi tidak ditemukan`;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* | output |
|
|
109
|
+
* | --- |
|
|
110
|
+
* | "Session not found" |
|
|
111
|
+
*
|
|
112
|
+
* @param {Sessionnotfound2Inputs} inputs
|
|
113
|
+
* @param {{ locale?: "en" | "zh" | "id" }} options
|
|
114
|
+
* @returns {LocalizedString}
|
|
115
|
+
*/
|
|
116
|
+
var sessionnotfound2 = ((inputs = {}, options = {}) => {
|
|
117
|
+
const locale = options.locale ?? getLocale();
|
|
118
|
+
if (locale === "zh") return zh_sessionnotfound2();
|
|
119
|
+
if (locale === "id") return id_sessionnotfound2();
|
|
120
|
+
return en_sessionnotfound2();
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/lib/paraglide/messages/unexpectederror1.js
|
|
124
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
125
|
+
/** @typedef {{}} Unexpectederror1Inputs */
|
|
126
|
+
var en_unexpectederror1 = () => {
|
|
127
|
+
return `Unexpected error`;
|
|
128
|
+
};
|
|
129
|
+
var zh_unexpectederror1 = () => {
|
|
130
|
+
return `意外错误`;
|
|
131
|
+
};
|
|
132
|
+
var id_unexpectederror1 = () => {
|
|
133
|
+
return `Kesalahan tak terduga`;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* | output |
|
|
137
|
+
* | --- |
|
|
138
|
+
* | "Unexpected error" |
|
|
139
|
+
*
|
|
140
|
+
* @param {Unexpectederror1Inputs} inputs
|
|
141
|
+
* @param {{ locale?: "en" | "zh" | "id" }} options
|
|
142
|
+
* @returns {LocalizedString}
|
|
143
|
+
*/
|
|
144
|
+
var unexpectederror1 = ((inputs = {}, options = {}) => {
|
|
145
|
+
const locale = options.locale ?? getLocale();
|
|
146
|
+
if (locale === "zh") return zh_unexpectederror1();
|
|
147
|
+
if (locale === "id") return id_unexpectederror1();
|
|
148
|
+
return en_unexpectederror1();
|
|
149
|
+
});
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/routes/+error.svelte
|
|
152
|
+
function _error($$renderer, $$props) {
|
|
153
|
+
$$renderer.component(($$renderer) => {
|
|
154
|
+
/**
|
|
155
|
+
* App-wide error boundary (the Root-is-the-Floor ADR, 2026-09-02):
|
|
156
|
+
* 404 (session absent — and any retired address), 503 (host down),
|
|
157
|
+
* 409 (sub-agent ownership). The way back is `/` itself: a bare
|
|
158
|
+
* arrival restores the persisted desk, so "back" costs nothing.
|
|
159
|
+
*/
|
|
160
|
+
const status = derived(() => page.status);
|
|
161
|
+
const message = derived(() => page.error?.message ?? "Something went wrong.");
|
|
162
|
+
head("1j96wlh", $$renderer, ($$renderer) => {
|
|
163
|
+
$$renderer.title(($$renderer) => {
|
|
164
|
+
$$renderer.push(`<title>${escape_html(status())} — deepseek-insight</title>`);
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
$$renderer.push(`<main data-svelte="ErrorPage" class="mx-auto flex max-w-3xl flex-col items-center gap-4 px-4 py-16 text-center"><p class="text-5xl font-semibold text-slate-300" data-testid="error-status">${escape_html(status())}</p> `);
|
|
168
|
+
if (status() === 404) {
|
|
169
|
+
$$renderer.push("<!--[0-->");
|
|
170
|
+
$$renderer.push(`<h1 class="text-xl font-semibold">${escape_html(t(sessionnotfound2))}</h1> <p class="text-sm text-slate-500" data-testid="error-message">${escape_html(message())}</p> <p class="text-xs text-slate-400">${escape_html(t(reapednote1))}</p>`);
|
|
171
|
+
} else if (status() === 503) {
|
|
172
|
+
$$renderer.push("<!--[1-->");
|
|
173
|
+
$$renderer.push(`<h1 class="text-xl font-semibold">${escape_html(t(dshunreachable1))}</h1> <p class="text-sm text-slate-500" data-testid="error-message">${escape_html(message())}</p>`);
|
|
174
|
+
} else {
|
|
175
|
+
$$renderer.push("<!--[-1-->");
|
|
176
|
+
$$renderer.push(`<h1 class="text-xl font-semibold">${escape_html(t(unexpectederror1))}</h1> <p class="text-sm text-slate-500" data-testid="error-message">${escape_html(message())}</p>`);
|
|
177
|
+
}
|
|
178
|
+
$$renderer.push(`<!--]--> <a href="/" class="mt-2 rounded-md border border-slate-300 px-3 py-1.5 text-sm text-slate-600 hover:bg-slate-100" data-testid="error-back-home">${escape_html(t(backtoworkspace2))}</a></main>`);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export { _error as default };
|
|
183
|
+
//# sourceMappingURL=_error.svelte.js-BVjBiEZD.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { g as getDshConnection, D as DshRpcError, i as isSubagentRejection } from '../../chunks/dsh-connection.js-
|
|
1
|
+
import { g as getDshConnection, D as DshRpcError, i as isSubagentRejection } from '../../chunks/dsh-connection.js-DlwhJZaV.js';
|
|
2
2
|
import { h as historyToEvents, e as eventsToEntries } from '../../chunks/dsh-events.js-BtDxaV6Q.js';
|
|
3
|
-
import { p as permissionFromProjection,
|
|
4
|
-
import {
|
|
3
|
+
import { p as permissionFromProjection, f as filterKnobEvents } from '../../chunks/permission-state.js-yvwUSnug.js';
|
|
4
|
+
import { i as imageLimitsFromProjection } from '../../chunks/image-limits.js-CUdJ0f7r.js';
|
|
5
|
+
import { v as error } from '../../chunks/utils.js-CAdNO8Tu.js';
|
|
5
6
|
|
|
6
7
|
//#region src/routes/+page.server.ts
|
|
7
8
|
/**
|
|
@@ -82,4 +83,4 @@ var _page_server_ts = /*#__PURE__*/Object.freeze({
|
|
|
82
83
|
});
|
|
83
84
|
|
|
84
85
|
export { _page_server_ts as _ };
|
|
85
|
-
//# sourceMappingURL=_page.server.ts.js-
|
|
86
|
+
//# sourceMappingURL=_page.server.ts.js-CNU4x-f1.js.map
|