@deepseek-insight/dsi 0.5.24 → 0.5.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.agents/skills/dsi-adr/SKILL.md +3 -3
  2. package/.agents/skills/dsi-ov-setup/SKILL.md +6 -1
  3. package/.agents/skills/dsi-skill-shelf/SKILL.md +46 -0
  4. package/.agents/skills/dsi-skill-shelf/shelf.mjs +547 -0
  5. package/.agents/skills/dsi-spec/SKILL.md +4 -4
  6. package/.agents/skills/dsi-spec/references/tasks-json-template.md +1 -1
  7. package/build/client/_app/immutable/assets/0.DoqT6ojN.css +2 -0
  8. package/build/client/_app/immutable/assets/2.Bfl8hQcu.css +1 -0
  9. package/build/client/_app/immutable/chunks/DL2Y4nxy.js +1 -0
  10. package/build/client/_app/immutable/chunks/{xNyHdy4Z.js → DuItqZFP.js} +1 -1
  11. package/build/client/_app/immutable/chunks/Xs5m2yqM.js +1 -0
  12. package/build/client/_app/immutable/chunks/pNaMQbLr.js +2 -0
  13. package/build/client/_app/immutable/entry/{app.BfVt8pR9.js → app.DjIR2gNq.js} +2 -2
  14. package/build/client/_app/immutable/entry/start.Bho-erid.js +1 -0
  15. package/build/client/_app/immutable/nodes/1.CERO4WcC.js +1 -0
  16. package/build/client/_app/immutable/nodes/2.DwsATN7B.js +171 -0
  17. package/build/client/_app/version.json +1 -1
  18. package/build/handler.js +4 -4
  19. package/build/index.js +4 -4
  20. package/build/server/chunks/chunks/engine.js-CBxHjv0c.js +96 -0
  21. package/build/server/chunks/chunks/{internal.js-nJTGYhdX.js → internal.js-9ErK1M89.js} +3 -3
  22. package/build/server/chunks/chunks/{state.js-D0-EDcsi.js → state.js-CoQ1E4r6.js} +163 -3
  23. package/build/server/chunks/entries/endpoints/api/skills/install/_server.ts.js-CtHQQsxC.js +47 -0
  24. package/build/server/chunks/entries/endpoints/api/skills/reload/_server.ts.js-BOlSdtQw.js +33 -0
  25. package/build/server/chunks/entries/endpoints/api/skills/snapshot/_server.ts.js-Yz5rNblU.js +37 -0
  26. package/build/server/chunks/entries/endpoints/api/skills/uninstall/_server.ts.js-Bzy9Oq4k.js +47 -0
  27. package/build/server/chunks/entries/endpoints/api/skills/voice/_server.ts.js-yiGBLufB.js +72 -0
  28. package/build/server/chunks/entries/pages/_error.svelte.js-jdm5qmCK.js +43 -0
  29. package/build/server/chunks/entries/pages/{_page.svelte.js-D63btYnK.js → _page.svelte.js-qgIk1zgI.js} +9820 -3399
  30. package/build/server/chunks/{handler-DiaR2DmJ.js → handler-DBjyvmti.js} +3 -3
  31. package/build/server/chunks/{index.js-trwV04zl.js → index.js-DP_xAH0H.js} +2 -2
  32. package/build/server/chunks/{manifest.js-B2sb3fMn.js → manifest.js-B3WD8tJ6.js} +40 -5
  33. package/build/server/chunks/nodes/{0.js-CcvNYltc.js → 0.js-DO4F8XMq.js} +3 -3
  34. package/build/server/chunks/nodes/1.js-Vh-e4em9.js +9 -0
  35. package/build/server/chunks/nodes/{2.js-CEsSSgY6.js → 2.js-DtdHKW9v.js} +4 -4
  36. package/package.json +9 -1
  37. package/template/.dsi/prompts.sqlite +0 -0
  38. package/template/.dsi/resources/skills-reff.md +8 -0
  39. package/build/client/_app/immutable/assets/0.C4pk9RsQ.css +0 -2
  40. package/build/client/_app/immutable/assets/2.BpERqkk_.css +0 -1
  41. package/build/client/_app/immutable/chunks/BFAx3hqQ.js +0 -2
  42. package/build/client/_app/immutable/chunks/BjB44r24.js +0 -1
  43. package/build/client/_app/immutable/chunks/as89y6ti.js +0 -1
  44. package/build/client/_app/immutable/entry/start.BOYIplSn.js +0 -1
  45. package/build/client/_app/immutable/nodes/1.BZ_iRXtk.js +0 -1
  46. package/build/client/_app/immutable/nodes/2.BADJoHBB.js +0 -171
  47. package/build/server/chunks/entries/pages/_error.svelte.js-BTQyW5Df.js +0 -203
  48. package/build/server/chunks/nodes/1.js-2FULYexO.js +0 -9
  49. package/template/.dsi/prompts.sqlite-shm +0 -0
  50. package/template/.dsi/prompts.sqlite-wal +0 -0
  51. /package/build/client/_app/immutable/nodes/{0.BBoMIehN.js → 0.DlNmLZ8S.js} +0 -0
@@ -1 +1 @@
1
- {"version":"1789841612472"}
1
+ {"version":"1790137618682"}
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-DiaR2DmJ.js';
6
- import './server/chunks/index.js-trwV04zl.js';
7
- import './server/chunks/manifest.js-B2sb3fMn.js';
5
+ export { h as handler } from './server/chunks/handler-DBjyvmti.js';
6
+ import './server/chunks/index.js-DP_xAH0H.js';
7
+ import './server/chunks/manifest.js-B3WD8tJ6.js';
8
8
  import './env.js';
9
9
  import 'node:buffer';
10
10
  import 'node:crypto';
@@ -16,7 +16,7 @@ import './server/chunks/chunks/shared.js-HQ0rfhm4.js';
16
16
  import './server/chunks/chunks/uneval.js-BJ9Qq2SF.js';
17
17
  import './server/chunks/chunks/utils.js-CAdNO8Tu.js';
18
18
  import 'node:url';
19
- import './server/chunks/chunks/internal.js-nJTGYhdX.js';
19
+ import './server/chunks/chunks/internal.js-9ErK1M89.js';
20
20
  import './server/chunks/chunks/server.js-11-pxAWV.js';
21
21
  import './server/chunks/chunks/internal2.js-BcS47nI-.js';
22
22
  import './server/chunks/chunks/exports.js-DH_tjtdv.js';
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-DiaR2DmJ.js';
4
+ import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-DBjyvmti.js';
5
5
  import { env, timeout_env } from './env.js';
6
6
  import { rm } from 'node:fs/promises';
7
7
  import './shims.js';
@@ -14,12 +14,12 @@ 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-trwV04zl.js';
18
- import './server/chunks/chunks/internal.js-nJTGYhdX.js';
17
+ import './server/chunks/index.js-DP_xAH0H.js';
18
+ import './server/chunks/chunks/internal.js-9ErK1M89.js';
19
19
  import './server/chunks/chunks/server.js-11-pxAWV.js';
20
20
  import './server/chunks/chunks/internal2.js-BcS47nI-.js';
21
21
  import './server/chunks/chunks/exports.js-DH_tjtdv.js';
22
- import './server/chunks/manifest.js-B2sb3fMn.js';
22
+ import './server/chunks/manifest.js-B3WD8tJ6.js';
23
23
  import 'node:url';
24
24
 
25
25
  const path = env('SOCKET_PATH', false);
@@ -0,0 +1,96 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ import { execFile } from 'node:child_process';
5
+ import { promisify } from 'node:util';
6
+
7
+ //#region src/lib/server/skills/types.ts
8
+ var EngineMissingError = class extends Error {
9
+ enginePath;
10
+ constructor(enginePath) {
11
+ super("shelf engine not found: " + enginePath);
12
+ this.name = "EngineMissingError";
13
+ this.enginePath = enginePath;
14
+ }
15
+ };
16
+ var EngineFailedError = class extends Error {
17
+ payload;
18
+ constructor(message, payload) {
19
+ super(message);
20
+ this.name = "EngineFailedError";
21
+ this.payload = payload;
22
+ }
23
+ };
24
+ /** Uninstallable = on disk AND signed (ADR D5 control matrix). */
25
+ function uninstallableIds(snapshot) {
26
+ return snapshot.sources.flatMap((s) => s.skills.filter((k) => k.installed && k.signed).map((k) => k.id));
27
+ }
28
+ //#endregion
29
+ //#region src/lib/server/skills/engine.ts
30
+ var execFileP = promisify(execFile);
31
+ /** Fast commands (status, cached refresh, apply) stay on the snappy floor. */
32
+ var ENGINE_TIMEOUT_MS = 12e4;
33
+ /** A FULL live refresh enumerates ~140 skills and fetches every raw
34
+ * SKILL.md + package.json sequentially (~6m measured 2026-09-22) — the
35
+ * reload verb dies at 120s with 'shelf engine timed out' (observed in
36
+ * headed verification). Give the slow command room to finish. */
37
+ var ENGINE_REFRESH_TIMEOUT_MS = Number(process.env.SHELF_REFRESH_TIMEOUT_MS) || 6e5;
38
+ function defaultEnginePath() {
39
+ return process.env.SHELF_ENGINE_PATH || join(homedir(), ".agents/skills/dsi-skill-shelf/shelf.mjs");
40
+ }
41
+ /** Test seam: override to stub the engine process. */
42
+ var runner = async (enginePath, args, timeoutMs = ENGINE_TIMEOUT_MS) => {
43
+ const { stdout } = await execFileP("node", [enginePath, ...args], {
44
+ timeout: timeoutMs,
45
+ maxBuffer: 33554432
46
+ });
47
+ return stdout;
48
+ };
49
+ async function run(args, timeoutMs = ENGINE_TIMEOUT_MS) {
50
+ const enginePath = defaultEnginePath();
51
+ if (!existsSync(enginePath)) throw new EngineMissingError(enginePath);
52
+ let stdout;
53
+ try {
54
+ stdout = await runner(enginePath, args, timeoutMs);
55
+ } catch (err) {
56
+ const e = err;
57
+ if (e.killed) throw new EngineFailedError("shelf engine timed out after " + timeoutMs + "ms", null);
58
+ throw new EngineFailedError(String(e.message ?? e), null);
59
+ }
60
+ let payload;
61
+ try {
62
+ payload = JSON.parse(stdout);
63
+ } catch {
64
+ throw new EngineFailedError("shelf engine emitted non-JSON output", null);
65
+ }
66
+ if (payload.v !== 1) throw new EngineFailedError("shelf engine wire version mismatch: v=" + payload.v, payload);
67
+ return payload;
68
+ }
69
+ function getEngine() {
70
+ return {
71
+ async snapshotStatus() {
72
+ const p = await run(["snapshot-status"]);
73
+ return { present: Boolean(p.present) };
74
+ },
75
+ async refresh(reload) {
76
+ const p = await run(reload ? ["refresh", "--reload"] : ["refresh"], reload ? ENGINE_REFRESH_TIMEOUT_MS : ENGINE_TIMEOUT_MS);
77
+ if (!p.ok || !p.snapshot) throw new EngineFailedError("refresh failed", p);
78
+ return {
79
+ snapshot: p.snapshot,
80
+ reused: Boolean(p.reused)
81
+ };
82
+ },
83
+ async apply(action, targets) {
84
+ const p = await run([
85
+ "apply",
86
+ action,
87
+ ...targets
88
+ ]);
89
+ if (!p.results) throw new EngineFailedError("apply returned no results", p);
90
+ return p.results;
91
+ }
92
+ };
93
+ }
94
+
95
+ export { EngineMissingError as E, EngineFailedError as a, getEngine as g, uninstallableIds as u };
96
+ //# sourceMappingURL=engine.js-CBxHjv0c.js.map
@@ -722,7 +722,7 @@ var options = {
722
722
  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 " + head + "\n </head>\n <body data-sveltekit-preload-data=\"tap\">\n <div style=\"display: contents\">" + body + "</div>\n </body>\n</html>\n",
723
723
  error: error_template_default
724
724
  },
725
- version_hash: "ef35mj"
725
+ version_hash: "1u3g258"
726
726
  };
727
727
  async function get_hooks() {
728
728
  let handle;
@@ -744,5 +744,5 @@ async function get_hooks() {
744
744
  };
745
745
  }
746
746
 
747
- export { __commonJSMin as _, set_public_env as a, set_read_implementation as b, onDestroy as c, get_hooks as g, index_server_exports as i, options as o, public_env as p, read_implementation as r, set_private_env as s };
748
- //# sourceMappingURL=internal.js-nJTGYhdX.js.map
747
+ export { __commonJSMin as _, set_public_env as a, set_read_implementation as b, onDestroy as c, __exportAll as d, get_hooks as g, index_server_exports as i, options as o, public_env as p, read_implementation as r, set_private_env as s };
748
+ //# sourceMappingURL=internal.js-9ErK1M89.js.map
@@ -1,4 +1,4 @@
1
- import { i as index_server_exports } from './internal.js-nJTGYhdX.js';
1
+ import { i as index_server_exports } from './internal.js-9ErK1M89.js';
2
2
  import './shared.js-HQ0rfhm4.js';
3
3
  import './exports.js-DH_tjtdv.js';
4
4
  import { U as snapshot, J as getContext, G as noop } from './server.js-11-pxAWV.js';
@@ -36,6 +36,166 @@ function t(fn) {
36
36
  } catch {}
37
37
  return fn();
38
38
  }
39
+ //#endregion
40
+ //#region src/lib/paraglide/messages/backtoworkspace2.js
41
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
42
+ /** @typedef {{}} Backtoworkspace2Inputs */
43
+ var en_backtoworkspace2 = () => {
44
+ return `← Back to the workspace`;
45
+ };
46
+ var zh_backtoworkspace2 = () => {
47
+ return `← 返回工作区`;
48
+ };
49
+ var id_backtoworkspace2 = () => {
50
+ return `← Kembali ke workspace`;
51
+ };
52
+ var es_backtoworkspace2 = () => {
53
+ return `← Volver al workspace`;
54
+ };
55
+ /**
56
+ * | output |
57
+ * | --- |
58
+ * | "← Back to the workspace" |
59
+ *
60
+ * @param {Backtoworkspace2Inputs} inputs
61
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
62
+ * @returns {LocalizedString}
63
+ */
64
+ var backtoworkspace2 = ((inputs = {}, options = {}) => {
65
+ const locale = options.locale ?? getLocale();
66
+ if (locale === "zh") return zh_backtoworkspace2();
67
+ if (locale === "id") return id_backtoworkspace2();
68
+ if (locale === "es") return es_backtoworkspace2();
69
+ return en_backtoworkspace2();
70
+ });
71
+ //#endregion
72
+ //#region src/lib/paraglide/messages/dshunreachable1.js
73
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
74
+ /** @typedef {{}} Dshunreachable1Inputs */
75
+ var en_dshunreachable1 = () => {
76
+ return `DSH host unreachable`;
77
+ };
78
+ var zh_dshunreachable1 = () => {
79
+ return `DSH 主机不可达`;
80
+ };
81
+ var id_dshunreachable1 = () => {
82
+ return `Host DSH tidak dapat dijangkau`;
83
+ };
84
+ var es_dshunreachable1 = () => {
85
+ return `Host DSH inalcanzable`;
86
+ };
87
+ /**
88
+ * | output |
89
+ * | --- |
90
+ * | "DSH host unreachable" |
91
+ *
92
+ * @param {Dshunreachable1Inputs} inputs
93
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
94
+ * @returns {LocalizedString}
95
+ */
96
+ var dshunreachable1 = ((inputs = {}, options = {}) => {
97
+ const locale = options.locale ?? getLocale();
98
+ if (locale === "zh") return zh_dshunreachable1();
99
+ if (locale === "id") return id_dshunreachable1();
100
+ if (locale === "es") return es_dshunreachable1();
101
+ return en_dshunreachable1();
102
+ });
103
+ //#endregion
104
+ //#region src/lib/paraglide/messages/reapednote1.js
105
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
106
+ /** @typedef {{}} Reapednote1Inputs */
107
+ var en_reapednote1 = () => {
108
+ return `It may have been reaped, or the link predates this host's ledger.`;
109
+ };
110
+ var zh_reapednote1 = () => {
111
+ return `它可能已被回收,或链接早于此主机的账本。`;
112
+ };
113
+ var id_reapednote1 = () => {
114
+ return `Mungkin sudah dihapus, atau tautannya lebih tua dari ledger host ini.`;
115
+ };
116
+ var es_reapednote1 = () => {
117
+ return `Puede haber sido recolectada, o el enlace es anterior al libro mayor de este host.`;
118
+ };
119
+ /**
120
+ * | output |
121
+ * | --- |
122
+ * | "It may have been reaped, or the link predates this host's ledger." |
123
+ *
124
+ * @param {Reapednote1Inputs} inputs
125
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
126
+ * @returns {LocalizedString}
127
+ */
128
+ var reapednote1 = ((inputs = {}, options = {}) => {
129
+ const locale = options.locale ?? getLocale();
130
+ if (locale === "zh") return zh_reapednote1();
131
+ if (locale === "id") return id_reapednote1();
132
+ if (locale === "es") return es_reapednote1();
133
+ return en_reapednote1();
134
+ });
135
+ //#endregion
136
+ //#region src/lib/paraglide/messages/sessionnotfound2.js
137
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
138
+ /** @typedef {{}} Sessionnotfound2Inputs */
139
+ var en_sessionnotfound2 = () => {
140
+ return `Session not found`;
141
+ };
142
+ var zh_sessionnotfound2 = () => {
143
+ return `会话未找到`;
144
+ };
145
+ var id_sessionnotfound2 = () => {
146
+ return `Sesi tidak ditemukan`;
147
+ };
148
+ var es_sessionnotfound2 = () => {
149
+ return `Sesión no encontrada`;
150
+ };
151
+ /**
152
+ * | output |
153
+ * | --- |
154
+ * | "Session not found" |
155
+ *
156
+ * @param {Sessionnotfound2Inputs} inputs
157
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
158
+ * @returns {LocalizedString}
159
+ */
160
+ var sessionnotfound2 = ((inputs = {}, options = {}) => {
161
+ const locale = options.locale ?? getLocale();
162
+ if (locale === "zh") return zh_sessionnotfound2();
163
+ if (locale === "id") return id_sessionnotfound2();
164
+ if (locale === "es") return es_sessionnotfound2();
165
+ return en_sessionnotfound2();
166
+ });
167
+ //#endregion
168
+ //#region src/lib/paraglide/messages/unexpectederror1.js
169
+ /** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
170
+ /** @typedef {{}} Unexpectederror1Inputs */
171
+ var en_unexpectederror1 = () => {
172
+ return `Unexpected error`;
173
+ };
174
+ var zh_unexpectederror1 = () => {
175
+ return `意外错误`;
176
+ };
177
+ var id_unexpectederror1 = () => {
178
+ return `Kesalahan tak terduga`;
179
+ };
180
+ var es_unexpectederror1 = () => {
181
+ return `Error inesperado`;
182
+ };
183
+ /**
184
+ * | output |
185
+ * | --- |
186
+ * | "Unexpected error" |
187
+ *
188
+ * @param {Unexpectederror1Inputs} inputs
189
+ * @param {{ locale?: "en" | "zh" | "id" | "es" }} options
190
+ * @returns {LocalizedString}
191
+ */
192
+ var unexpectederror1 = ((inputs = {}, options = {}) => {
193
+ const locale = options.locale ?? getLocale();
194
+ if (locale === "zh") return zh_unexpectederror1();
195
+ if (locale === "id") return id_unexpectederror1();
196
+ if (locale === "es") return es_unexpectederror1();
197
+ return en_unexpectederror1();
198
+ });
39
199
  var is_legacy = noop.toString().includes("$$") || /function \w+\(\) \{\}/.test(noop.toString());
40
200
  var placeholder_url = "a:";
41
201
  if (is_legacy) {
@@ -142,5 +302,5 @@ var page = {
142
302
  }
143
303
  };
144
304
 
145
- export { afterNavigate as a, currentLocale as c, page as p, replaceState as r, t };
146
- //# sourceMappingURL=state.js-D0-EDcsi.js.map
305
+ export { afterNavigate as a, backtoworkspace2 as b, replaceState as c, dshunreachable1 as d, currentLocale as e, page as p, reapednote1 as r, sessionnotfound2 as s, t, unexpectederror1 as u };
306
+ //# sourceMappingURL=state.js-CoQ1E4r6.js.map
@@ -0,0 +1,47 @@
1
+ import { g as getEngine, E as EngineMissingError, a as EngineFailedError } from '../../../../../chunks/engine.js-CBxHjv0c.js';
2
+ import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:fs';
4
+ import 'node:path';
5
+ import 'node:os';
6
+ import 'node:child_process';
7
+ import 'node:util';
8
+ import '../../../../../chunks/shared.js-HQ0rfhm4.js';
9
+ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
10
+
11
+ //#region src/routes/api/skills/install/+server.ts
12
+ /**
13
+ * api-skills - POST /api/skills/install
14
+ * Body: { targets: string[] } - explicit shelf numbers or ids.
15
+ * Returns per-target results; 400 on malformed body, 503 on engine failure.
16
+ */
17
+ var POST = async ({ request }) => {
18
+ let targets;
19
+ try {
20
+ targets = (await request.json()).targets;
21
+ } catch {
22
+ return json({
23
+ ok: false,
24
+ error: "malformed JSON body"
25
+ }, { status: 400 });
26
+ }
27
+ if (!Array.isArray(targets) || targets.length === 0 || !targets.every((t) => typeof t === "string" && t.length > 0)) return json({
28
+ ok: false,
29
+ error: "targets must be a non-empty array of strings"
30
+ }, { status: 400 });
31
+ try {
32
+ const results = await getEngine().apply("install", targets);
33
+ return json({
34
+ ok: results.every((r) => r.ok),
35
+ results
36
+ });
37
+ } catch (err) {
38
+ const status = err instanceof EngineMissingError || err instanceof EngineFailedError ? 503 : 500;
39
+ return json({
40
+ ok: false,
41
+ error: String(err.message)
42
+ }, { status });
43
+ }
44
+ };
45
+
46
+ export { POST };
47
+ //# sourceMappingURL=_server.ts.js-CtHQQsxC.js.map
@@ -0,0 +1,33 @@
1
+ import { g as getEngine, u as uninstallableIds } from '../../../../../chunks/engine.js-CBxHjv0c.js';
2
+ import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:fs';
4
+ import 'node:path';
5
+ import 'node:os';
6
+ import 'node:child_process';
7
+ import 'node:util';
8
+ import '../../../../../chunks/shared.js-HQ0rfhm4.js';
9
+ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
10
+
11
+ //#region src/routes/api/skills/reload/+server.ts
12
+ /**
13
+ * api-skills - POST /api/skills/reload
14
+ * Forced rebuild (ADR D3 --reload): re-reads the SKR, re-diffs, regenerates.
15
+ */
16
+ var POST = async () => {
17
+ try {
18
+ const { snapshot } = await getEngine().refresh(true);
19
+ return json({
20
+ ok: true,
21
+ snapshot,
22
+ uninstallable: uninstallableIds(snapshot)
23
+ });
24
+ } catch (err) {
25
+ return json({
26
+ ok: false,
27
+ error: String(err.message)
28
+ }, { status: 503 });
29
+ }
30
+ };
31
+
32
+ export { POST };
33
+ //# sourceMappingURL=_server.ts.js-BOlSdtQw.js.map
@@ -0,0 +1,37 @@
1
+ import { g as getEngine, u as uninstallableIds } from '../../../../../chunks/engine.js-CBxHjv0c.js';
2
+ import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:fs';
4
+ import 'node:path';
5
+ import 'node:os';
6
+ import 'node:child_process';
7
+ import 'node:util';
8
+ import '../../../../../chunks/shared.js-HQ0rfhm4.js';
9
+ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
10
+
11
+ //#region src/routes/api/skills/snapshot/+server.ts
12
+ /**
13
+ * api-skills - GET /api/skills/snapshot
14
+ * Snapshot-first (ADR D3): absent cache triggers build; present cache is used as-is.
15
+ * Response: { ok, snapshot, uninstallable } - uninstallable from signed+installed (D5).
16
+ */
17
+ var GET = async () => {
18
+ try {
19
+ const engine = getEngine();
20
+ const { present } = await engine.snapshotStatus();
21
+ const { snapshot, reused } = await engine.refresh(!present);
22
+ return json({
23
+ ok: true,
24
+ reused,
25
+ snapshot,
26
+ uninstallable: uninstallableIds(snapshot)
27
+ });
28
+ } catch (err) {
29
+ return json({
30
+ ok: false,
31
+ error: String(err.message)
32
+ }, { status: 503 });
33
+ }
34
+ };
35
+
36
+ export { GET };
37
+ //# sourceMappingURL=_server.ts.js-Yz5rNblU.js.map
@@ -0,0 +1,47 @@
1
+ import { g as getEngine, E as EngineMissingError, a as EngineFailedError } from '../../../../../chunks/engine.js-CBxHjv0c.js';
2
+ import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
+ import 'node:fs';
4
+ import 'node:path';
5
+ import 'node:os';
6
+ import 'node:child_process';
7
+ import 'node:util';
8
+ import '../../../../../chunks/shared.js-HQ0rfhm4.js';
9
+ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
10
+
11
+ //#region src/routes/api/skills/uninstall/+server.ts
12
+ /**
13
+ * api-skills - POST /api/skills/uninstall
14
+ * Body: { ids: string[] }. Signed-only (ADR D5): any unsigned refusal maps to 409.
15
+ */
16
+ var POST = async ({ request }) => {
17
+ let ids;
18
+ try {
19
+ ids = (await request.json()).ids;
20
+ } catch {
21
+ return json({
22
+ ok: false,
23
+ error: "malformed JSON body"
24
+ }, { status: 400 });
25
+ }
26
+ if (!Array.isArray(ids) || ids.length === 0 || !ids.every((t) => typeof t === "string" && t.length > 0)) return json({
27
+ ok: false,
28
+ error: "ids must be a non-empty array of strings"
29
+ }, { status: 400 });
30
+ try {
31
+ const results = await getEngine().apply("uninstall", ids);
32
+ const unsigned = results.some((r) => !r.ok && /unsigned/.test(r.error ?? ""));
33
+ return json({
34
+ ok: results.every((r) => r.ok),
35
+ results
36
+ }, { status: unsigned ? 409 : 200 });
37
+ } catch (err) {
38
+ const status = err instanceof EngineMissingError || err instanceof EngineFailedError ? 503 : 500;
39
+ return json({
40
+ ok: false,
41
+ error: String(err.message)
42
+ }, { status });
43
+ }
44
+ };
45
+
46
+ export { POST };
47
+ //# sourceMappingURL=_server.ts.js-Bzy9Oq4k.js.map
@@ -0,0 +1,72 @@
1
+ import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
2
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { homedir } from 'node:os';
5
+ import '../../../../../chunks/shared.js-HQ0rfhm4.js';
6
+ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
7
+
8
+ //#region src/lib/server/skills/voice.ts
9
+ /**
10
+ * skill-voice (The Shelf Voice ADR D5) - the merged voice map: one entry
11
+ * per shelf-installed skill carrying its per-locale words, read from the
12
+ * .dsi-voice/<locale>.json sidecars the engine wrote at install time.
13
+ * Homegrown dsi-* skills are NOT here - their voice is compile-time
14
+ * paraglide (D7), resolved client-side.
15
+ */
16
+ var VOICE_LOCALES = [
17
+ "en",
18
+ "zh",
19
+ "id",
20
+ "es"
21
+ ];
22
+ var VOICE_DIR = ".dsi-voice";
23
+ function buildVoiceMap(skillsDir) {
24
+ const map = {};
25
+ if (!existsSync(skillsDir)) return map;
26
+ for (const skillId of readdirSync(skillsDir)) {
27
+ const voiceDir = join(skillsDir, skillId, VOICE_DIR);
28
+ if (!existsSync(voiceDir)) continue;
29
+ for (const locale of VOICE_LOCALES) {
30
+ const file = join(voiceDir, locale + ".json");
31
+ if (!existsSync(file)) continue;
32
+ try {
33
+ const entry = JSON.parse(readFileSync(file, "utf8"));
34
+ if (typeof entry?.name === "string" && typeof entry?.description === "string") {
35
+ map[skillId] = map[skillId] ?? {};
36
+ map[skillId][locale] = {
37
+ name: entry.name,
38
+ description: entry.description,
39
+ whenToUse: String(entry.whenToUse ?? "")
40
+ };
41
+ }
42
+ } catch {}
43
+ }
44
+ }
45
+ return map;
46
+ }
47
+ //#endregion
48
+ //#region src/routes/api/skills/voice/+server.ts
49
+ /**
50
+ * api-skills - GET /api/skills/voice (The Shelf Voice ADR D5).
51
+ * The merged voice map for shelf-installed skills; the slash menu
52
+ * overlays it onto the host's English wire rows at render.
53
+ */
54
+ function skillsDirFromEnv() {
55
+ return process.env.SHELF_SKILLS_DIR || join(homedir(), ".agents/skills");
56
+ }
57
+ var GET = async () => {
58
+ try {
59
+ return json({
60
+ ok: true,
61
+ voice: buildVoiceMap(skillsDirFromEnv())
62
+ });
63
+ } catch (err) {
64
+ return json({
65
+ ok: false,
66
+ error: String(err.message)
67
+ }, { status: 503 });
68
+ }
69
+ };
70
+
71
+ export { GET };
72
+ //# sourceMappingURL=_server.ts.js-yiGBLufB.js.map
@@ -0,0 +1,43 @@
1
+ import { V as head, W as escape_html, y as derived } from '../../chunks/server.js-11-pxAWV.js';
2
+ import { t, p as page, s as sessionnotfound2, r as reapednote1, d as dshunreachable1, u as unexpectederror1, b as backtoworkspace2 } from '../../chunks/state.js-CoQ1E4r6.js';
3
+ import '../../chunks/uneval.js-BJ9Qq2SF.js';
4
+ import '../../chunks/internal.js-9ErK1M89.js';
5
+ import '../../chunks/shared.js-HQ0rfhm4.js';
6
+ import '../../chunks/exports.js-DH_tjtdv.js';
7
+ import '../../chunks/config.js-BvW5LrfQ.js';
8
+ import '../../chunks/runtime.js-CCJi3XaY.js';
9
+ import '../../chunks/utils.js-CAdNO8Tu.js';
10
+
11
+ //#region src/routes/+error.svelte
12
+ function _error($$renderer, $$props) {
13
+ $$renderer.component(($$renderer) => {
14
+ /**
15
+ * App-wide error boundary (the Root-is-the-Floor ADR, 2026-09-02):
16
+ * 404 (session absent — and any retired address), 503 (host down),
17
+ * 409 (sub-agent ownership). The way back is `/` itself: a bare
18
+ * arrival restores the persisted desk, so "back" costs nothing.
19
+ */
20
+ const status = derived(() => page.status);
21
+ const message = derived(() => page.error?.message ?? "Something went wrong.");
22
+ head("1j96wlh", $$renderer, ($$renderer) => {
23
+ $$renderer.title(($$renderer) => {
24
+ $$renderer.push(`<title>${escape_html(status())} — deepseek-insight</title>`);
25
+ });
26
+ });
27
+ $$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> `);
28
+ if (status() === 404) {
29
+ $$renderer.push("<!--[0-->");
30
+ $$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>`);
31
+ } else if (status() === 503) {
32
+ $$renderer.push("<!--[1-->");
33
+ $$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>`);
34
+ } else {
35
+ $$renderer.push("<!--[-1-->");
36
+ $$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>`);
37
+ }
38
+ $$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>`);
39
+ });
40
+ }
41
+
42
+ export { _error as default };
43
+ //# sourceMappingURL=_error.svelte.js-jdm5qmCK.js.map