@deepseek-insight/dsi 0.6.0 → 0.6.2

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 (38) hide show
  1. package/bin/dsi.mjs +48 -2
  2. package/bin/lib/plugin-chain.mjs +27 -3
  3. package/build/client/_app/immutable/assets/{2.DLFRZPDf.css → 2.D6PL9MJd.css} +1 -1
  4. package/build/client/_app/immutable/chunks/B9TIQpmf.js +1 -0
  5. package/build/client/_app/immutable/chunks/BBAtuGck.js +1 -0
  6. package/build/client/_app/immutable/chunks/Cy_g8G-H.js +2 -0
  7. package/build/client/_app/immutable/chunks/{DzZu8EY2.js → D1QINeUi.js} +1 -1
  8. package/build/client/_app/immutable/entry/{app.Toc7d2RT.js → app.CXE1IG8X.js} +2 -2
  9. package/build/client/_app/immutable/entry/start.CsK-Qb0T.js +1 -0
  10. package/build/client/_app/immutable/nodes/{1.BMemLSP2.js → 1.BNp3xTdo.js} +1 -1
  11. package/build/client/_app/immutable/nodes/{2.BDUOgoKA.js → 2.C9PI6lyi.js} +193 -193
  12. package/build/client/_app/version.json +1 -1
  13. package/build/handler.js +4 -4
  14. package/build/index.js +4 -4
  15. package/build/server/chunks/chunks/github-stars.js-BZGcEdID.js +63 -0
  16. package/build/server/chunks/chunks/{internal.js-Dhppl8VW.js → internal.js-DsUajvrO.js} +2 -2
  17. package/build/server/chunks/chunks/stars.js-C41Y0FsW.js +18 -0
  18. package/build/server/chunks/chunks/{state.js--QbGDz9E.js → state.js-BtreSUn6.js} +2 -2
  19. package/build/server/chunks/entries/endpoints/api/plugins/apply/{_server.ts.js-BXwRN5sp.js → _server.ts.js-CpO--Jwf.js} +35 -10
  20. package/build/server/chunks/entries/endpoints/api/plugins/reload/{_server.ts.js-U8vRgx7E.js → _server.ts.js-BACFXWMj.js} +5 -1
  21. package/build/server/chunks/entries/endpoints/api/plugins/snapshot/{_server.ts.js-9Ezy2OeQ.js → _server.ts.js-BJg0hLlC.js} +6 -2
  22. package/build/server/chunks/entries/endpoints/api/skills/reload/{_server.ts.js-BUnCt45D.js → _server.ts.js-lJhCBpB2.js} +7 -1
  23. package/build/server/chunks/entries/endpoints/api/skills/snapshot/{_server.ts.js-CaBD0w0v.js → _server.ts.js-Ct_PmlXs.js} +7 -1
  24. package/build/server/chunks/entries/pages/{_error.svelte.js-n2xOEPvp.js → _error.svelte.js-D6O3Y5u2.js} +3 -3
  25. package/build/server/chunks/entries/pages/{_page.svelte.js-BJ7eKmkS.js → _page.svelte.js-KMQA_6l7.js} +107 -86
  26. package/build/server/chunks/{handler-BJHxQwK-.js → handler-DDf2L-zB.js} +3 -3
  27. package/build/server/chunks/{index.js-BXPH1Bno.js → index.js-BAmbTnM5.js} +2 -2
  28. package/build/server/chunks/{manifest.js-DjQqMW2U.js → manifest.js-0LY0s8-F.js} +9 -9
  29. package/build/server/chunks/nodes/1.js-COCS1z-W.js +9 -0
  30. package/build/server/chunks/nodes/{2.js-BnWybqO0.js → 2.js-BPtjg-62.js} +4 -4
  31. package/package.json +1 -1
  32. package/template/.dsi/resources/plugins-reff.md +1 -2
  33. package/template/.dsi/resources/skills-reff.md +7 -6
  34. package/build/client/_app/immutable/chunks/BZW4nu4u.js +0 -1
  35. package/build/client/_app/immutable/chunks/CpgMZB3l.js +0 -1
  36. package/build/client/_app/immutable/chunks/DZixYQAd.js +0 -2
  37. package/build/client/_app/immutable/entry/start.CCaKY2bM.js +0 -1
  38. package/build/server/chunks/nodes/1.js-Cb5I-Dtm.js +0 -9
@@ -1 +1 @@
1
- {"version":"1790511063366"}
1
+ {"version":"1790582740155"}
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-BJHxQwK-.js';
6
- import './server/chunks/index.js-BXPH1Bno.js';
7
- import './server/chunks/manifest.js-DjQqMW2U.js';
5
+ export { h as handler } from './server/chunks/handler-DDf2L-zB.js';
6
+ import './server/chunks/index.js-BAmbTnM5.js';
7
+ import './server/chunks/manifest.js-0LY0s8-F.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-Dhppl8VW.js';
19
+ import './server/chunks/chunks/internal.js-DsUajvrO.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-BJHxQwK-.js';
4
+ import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-DDf2L-zB.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-BXPH1Bno.js';
18
- import './server/chunks/chunks/internal.js-Dhppl8VW.js';
17
+ import './server/chunks/index.js-BAmbTnM5.js';
18
+ import './server/chunks/chunks/internal.js-DsUajvrO.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-DjQqMW2U.js';
22
+ import './server/chunks/manifest.js-0LY0s8-F.js';
23
23
  import 'node:url';
24
24
 
25
25
  const path = env('SOCKET_PATH', false);
@@ -0,0 +1,63 @@
1
+ //#region src/lib/server/github-stars.ts
2
+ /**
3
+ * GitHub star counts for shelf/rack registries. Best-effort: a failed or
4
+ * absent fetch simply omits the entry — never breaks the snapshot. Results
5
+ * are cached in-memory for an hour (GitHub's unauthenticated ceiling is
6
+ * 60 req/h per IP).
7
+ */
8
+ var STAR_TTL_MS = 36e5;
9
+ var cache = /* @__PURE__ */ new Map();
10
+ /** Repo URL -> 'owner/repo'. Tolerates deep URLs like
11
+ * https://github.com/cursor/plugins/tree/main/pstack/skills (the shelf's
12
+ * SKR reff lines point at subfolders, not the repo root). */
13
+ function repoSlugFromUrl(repoUrl) {
14
+ try {
15
+ const u = new URL(repoUrl);
16
+ if (u.hostname !== "github.com") return null;
17
+ const seg = u.pathname.replace(/\.git$/, "").split("/").filter(Boolean);
18
+ if (seg.length < 2) return null;
19
+ const [owner, repo] = seg;
20
+ if (!/^[A-Za-z0-9_.-]+$/.test(owner) || !/^[A-Za-z0-9_.-]+$/.test(repo)) return null;
21
+ return owner + "/" + repo;
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+ async function fetchRepoStars(slug) {
27
+ const hit = cache.get(slug);
28
+ if (hit && Date.now() - hit.at < STAR_TTL_MS) return hit.count;
29
+ try {
30
+ const res = await fetch("https://api.github.com/repos/" + slug, {
31
+ headers: {
32
+ accept: "application/vnd.github+json",
33
+ "user-agent": "deepseek-insight"
34
+ },
35
+ signal: AbortSignal.timeout(5e3)
36
+ });
37
+ if (!res.ok) return null;
38
+ const body = await res.json();
39
+ if (typeof body.stargazers_count !== "number") return null;
40
+ cache.set(slug, {
41
+ count: body.stargazers_count,
42
+ at: Date.now()
43
+ });
44
+ return body.stargazers_count;
45
+ } catch {
46
+ return null;
47
+ }
48
+ }
49
+ /** Star counts keyed by the caller's key; an entry whose fetch failed
50
+ * (rate limit, private/moved repo, offline, non-GitHub URL) is absent. */
51
+ async function fetchStarsByKey(items) {
52
+ const stars = {};
53
+ await Promise.all(items.map(async ({ key, repo }) => {
54
+ const slug = repoSlugFromUrl(repo);
55
+ if (!slug) return;
56
+ const count = await fetchRepoStars(slug);
57
+ if (count !== null) stars[key] = count;
58
+ }));
59
+ return stars;
60
+ }
61
+
62
+ export { fetchStarsByKey as f };
63
+ //# sourceMappingURL=github-stars.js-BZGcEdID.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: "1ps1321"
725
+ version_hash: "42n7qv"
726
726
  };
727
727
  async function get_hooks() {
728
728
  let handle;
@@ -745,4 +745,4 @@ async function get_hooks() {
745
745
  }
746
746
 
747
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-Dhppl8VW.js.map
748
+ //# sourceMappingURL=internal.js-DsUajvrO.js.map
@@ -0,0 +1,18 @@
1
+ import { f as fetchStarsByKey } from './github-stars.js-BZGcEdID.js';
2
+
3
+ //#region src/lib/server/plugins/stars.ts
4
+ /**
5
+ * plugin-rack — GitHub star counts for the reff plugins. Thin adapter over
6
+ * the generic github-stars helper, keyed by plugin id.
7
+ */
8
+ /** Star counts keyed by plugin id; a plugin whose stars could not be
9
+ * fetched (rate limit, private/moved repo, offline) is simply absent. */
10
+ async function fetchRackStars(plugins) {
11
+ return fetchStarsByKey(plugins.map((p) => ({
12
+ key: p.id,
13
+ repo: p.repo
14
+ })));
15
+ }
16
+
17
+ export { fetchRackStars as f };
18
+ //# sourceMappingURL=stars.js-C41Y0FsW.js.map
@@ -1,4 +1,4 @@
1
- import { i as index_server_exports } from './internal.js-Dhppl8VW.js';
1
+ import { i as index_server_exports } from './internal.js-DsUajvrO.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';
@@ -303,4 +303,4 @@ var page = {
303
303
  };
304
304
 
305
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--QbGDz9E.js.map
306
+ //# sourceMappingURL=state.js-BtreSUn6.js.map
@@ -1,7 +1,7 @@
1
1
  import { g as getRackEngine, R as RackEngineMissingError, a as RackEngineFailedError } from '../../../../../chunks/engine.js-CrdWRSwf.js';
2
2
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
- import { existsSync } from 'node:fs';
4
- import { join } from 'node:path';
3
+ import { existsSync, mkdirSync, appendFileSync, openSync, closeSync } from 'node:fs';
4
+ import { join, dirname } from 'node:path';
5
5
  import { spawn } from 'node:child_process';
6
6
  import 'node:os';
7
7
  import 'node:util';
@@ -20,18 +20,43 @@ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
20
20
  function dsiBinPath() {
21
21
  return process.env.DSI_BIN || join(process.cwd(), "bin", "dsi.mjs");
22
22
  }
23
- var spawner = (node, bin, args) => {
24
- spawn(node, [bin, ...args], {
25
- detached: true,
26
- stdio: "ignore"
27
- }).unref();
23
+ /** Where the detached chain's stdout/stderr land (RCA 2026-09-27): a
24
+ * bounce that dies at preflight used to vanish with stdio 'ignore'. The
25
+ * log is cwd-relative like dsiBinPath (the DSI checkout's tmp/, which
26
+ * .gitignore's *.log already covers); DSI_BOUNCE_LOG overrides. */
27
+ function bounceLogPath() {
28
+ return process.env.DSI_BOUNCE_LOG || join(process.cwd(), "tmp", "bounce.log");
29
+ }
30
+ var defaultSpawner = (node, bin, args) => {
31
+ const log = bounceLogPath();
32
+ mkdirSync(dirname(log), { recursive: true });
33
+ appendFileSync(log, "[" + (/* @__PURE__ */ new Date()).toISOString() + "] bounce spawn: dsi " + bin.split("/").slice(-2).join("/") + " " + args.join(" ") + "\n");
34
+ const out = openSync(log, "a");
35
+ try {
36
+ spawn(node, [bin, ...args], {
37
+ detached: true,
38
+ stdio: [
39
+ "ignore",
40
+ out,
41
+ out
42
+ ]
43
+ }).unref();
44
+ } finally {
45
+ closeSync(out);
46
+ }
28
47
  };
48
+ var spawner = defaultSpawner;
29
49
  /** @returns false when the bin is missing (route answers honestly; the
30
- * operator restarts by hand — never a half-truth 200). */
50
+ * operator restarts by hand — never a half-truth 200). When the serving
51
+ * floor is a DEV floor (DSI_DEV=1, set by startDsiDevServer), the chain
52
+ * re-serves --dev too (RCA 2026-09-27: a dev pair bounced into build mode
53
+ * left the browser staring at 5175's corpse). */
31
54
  function spawnRestartChain() {
32
55
  const bin = dsiBinPath();
33
56
  if (!existsSync(bin)) return false;
34
- spawner(process.execPath, bin, ["dsh", "--plugin-restart"]);
57
+ const args = ["dsh", "--plugin-restart"];
58
+ if (process.env.DSI_DEV === "1") args.push("--dev");
59
+ spawner(process.execPath, bin, args);
35
60
  return true;
36
61
  }
37
62
  //#endregion
@@ -97,4 +122,4 @@ var POST = async ({ request }) => {
97
122
  };
98
123
 
99
124
  export { POST };
100
- //# sourceMappingURL=_server.ts.js-BXwRN5sp.js.map
125
+ //# sourceMappingURL=_server.ts.js-CpO--Jwf.js.map
@@ -1,10 +1,12 @@
1
1
  import { g as getRackEngine } from '../../../../../chunks/engine.js-CrdWRSwf.js';
2
+ import { f as fetchRackStars } from '../../../../../chunks/stars.js-C41Y0FsW.js';
2
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
4
  import 'node:fs';
4
5
  import 'node:path';
5
6
  import 'node:os';
6
7
  import 'node:child_process';
7
8
  import 'node:util';
9
+ import '../../../../../chunks/github-stars.js-BZGcEdID.js';
8
10
  import '../../../../../chunks/shared.js-HQ0rfhm4.js';
9
11
  import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
10
12
 
@@ -17,9 +19,11 @@ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
17
19
  var POST = async () => {
18
20
  try {
19
21
  const { snapshot, errors } = await getRackEngine().refresh(true);
22
+ const stars = await fetchRackStars(snapshot.plugins);
20
23
  return json({
21
24
  ok: true,
22
25
  snapshot,
26
+ stars,
23
27
  ...errors ? { errors } : {}
24
28
  });
25
29
  } catch (err) {
@@ -31,4 +35,4 @@ var POST = async () => {
31
35
  };
32
36
 
33
37
  export { POST };
34
- //# sourceMappingURL=_server.ts.js-U8vRgx7E.js.map
38
+ //# sourceMappingURL=_server.ts.js-BACFXWMj.js.map
@@ -1,10 +1,12 @@
1
1
  import { g as getRackEngine } from '../../../../../chunks/engine.js-CrdWRSwf.js';
2
+ import { f as fetchRackStars } from '../../../../../chunks/stars.js-C41Y0FsW.js';
2
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
4
  import 'node:fs';
4
5
  import 'node:path';
5
6
  import 'node:os';
6
7
  import 'node:child_process';
7
8
  import 'node:util';
9
+ import '../../../../../chunks/github-stars.js-BZGcEdID.js';
8
10
  import '../../../../../chunks/shared.js-HQ0rfhm4.js';
9
11
  import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
10
12
 
@@ -19,10 +21,12 @@ var GET = async () => {
19
21
  const engine = getRackEngine();
20
22
  const { present } = await engine.snapshotStatus();
21
23
  const { snapshot, reused } = await engine.refresh(!present);
24
+ const stars = await fetchRackStars(snapshot.plugins);
22
25
  return json({
23
26
  ok: true,
24
27
  reused,
25
- snapshot
28
+ snapshot,
29
+ stars
26
30
  });
27
31
  } catch (err) {
28
32
  return json({
@@ -33,4 +37,4 @@ var GET = async () => {
33
37
  };
34
38
 
35
39
  export { GET };
36
- //# sourceMappingURL=_server.ts.js-9Ezy2OeQ.js.map
40
+ //# sourceMappingURL=_server.ts.js-BJg0hLlC.js.map
@@ -1,3 +1,4 @@
1
+ import { f as fetchStarsByKey } from '../../../../../chunks/github-stars.js-BZGcEdID.js';
1
2
  import { g as getEngine, u as uninstallableIds, b as EngineCancelledError } from '../../../../../chunks/engine2.js-BRoFbCnL.js';
2
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
4
  import 'node:fs';
@@ -16,9 +17,14 @@ import '../../../../../chunks/uneval.js-BJ9Qq2SF.js';
16
17
  var POST = async () => {
17
18
  try {
18
19
  const { snapshot } = await getEngine().refresh(true);
20
+ const stars = await fetchStarsByKey(snapshot.sources.map((s) => ({
21
+ key: s.id,
22
+ repo: s.repo
23
+ })));
19
24
  return json({
20
25
  ok: true,
21
26
  snapshot,
27
+ stars,
22
28
  uninstallable: uninstallableIds(snapshot)
23
29
  });
24
30
  } catch (err) {
@@ -35,4 +41,4 @@ var POST = async () => {
35
41
  };
36
42
 
37
43
  export { POST };
38
- //# sourceMappingURL=_server.ts.js-BUnCt45D.js.map
44
+ //# sourceMappingURL=_server.ts.js-lJhCBpB2.js.map
@@ -1,3 +1,4 @@
1
+ import { f as fetchStarsByKey } from '../../../../../chunks/github-stars.js-BZGcEdID.js';
1
2
  import { g as getEngine, u as uninstallableIds } from '../../../../../chunks/engine2.js-BRoFbCnL.js';
2
3
  import { j as json } from '../../../../../chunks/utils.js-CAdNO8Tu.js';
3
4
  import 'node:fs';
@@ -19,10 +20,15 @@ var GET = async () => {
19
20
  const engine = getEngine();
20
21
  const { present } = await engine.snapshotStatus();
21
22
  const { snapshot, reused } = await engine.refresh(!present);
23
+ const stars = await fetchStarsByKey(snapshot.sources.map((s) => ({
24
+ key: s.id,
25
+ repo: s.repo
26
+ })));
22
27
  return json({
23
28
  ok: true,
24
29
  reused,
25
30
  snapshot,
31
+ stars,
26
32
  uninstallable: uninstallableIds(snapshot)
27
33
  });
28
34
  } catch (err) {
@@ -34,4 +40,4 @@ var GET = async () => {
34
40
  };
35
41
 
36
42
  export { GET };
37
- //# sourceMappingURL=_server.ts.js-CaBD0w0v.js.map
43
+ //# sourceMappingURL=_server.ts.js-Ct_PmlXs.js.map
@@ -1,7 +1,7 @@
1
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--QbGDz9E.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-BtreSUn6.js';
3
3
  import '../../chunks/uneval.js-BJ9Qq2SF.js';
4
- import '../../chunks/internal.js-Dhppl8VW.js';
4
+ import '../../chunks/internal.js-DsUajvrO.js';
5
5
  import '../../chunks/shared.js-HQ0rfhm4.js';
6
6
  import '../../chunks/exports.js-DH_tjtdv.js';
7
7
  import '../../chunks/config.js-B0w1-uCA.js';
@@ -40,4 +40,4 @@ function _error($$renderer, $$props) {
40
40
  }
41
41
 
42
42
  export { _error as default };
43
- //# sourceMappingURL=_error.svelte.js-n2xOEPvp.js.map
43
+ //# sourceMappingURL=_error.svelte.js-D6O3Y5u2.js.map