@wirecat/cli-template 0.9.0 → 0.11.0

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 (119) hide show
  1. package/.github/workflows/ci.yml +18 -0
  2. package/.github/workflows/release.yml +63 -0
  3. package/CHANGELOG.md +72 -1
  4. package/CLAUDE.md +1 -3
  5. package/bin/release +5 -3
  6. package/contracts/help.snap +2 -0
  7. package/dist/bin/clidev.js +34 -12
  8. package/dist/bundle/all-profiles-MJ6XSFOO.js +24 -0
  9. package/dist/bundle/anthropic-W5UKBZUB.js +70 -0
  10. package/dist/bundle/app-server-EZ46JAHB.js +217 -0
  11. package/dist/bundle/bun-HB6O2TTT.js +169 -0
  12. package/dist/bundle/bun-sqlite-KBXOW2ES.js +69 -0
  13. package/dist/bundle/chunk-2B5U4Z5H.js +100 -0
  14. package/dist/bundle/chunk-35KYY65W.js +122 -0
  15. package/dist/bundle/chunk-4LURWBVV.js +752 -0
  16. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  17. package/dist/bundle/chunk-7IXL4UFK.js +158 -0
  18. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  19. package/dist/bundle/chunk-AK257OMS.js +8353 -0
  20. package/dist/bundle/chunk-CXQXVKUY.js +24 -0
  21. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  22. package/dist/bundle/chunk-E42W72PQ.js +151 -0
  23. package/dist/bundle/chunk-EFHLQXG6.js +5104 -0
  24. package/dist/bundle/chunk-EGRB55FF.js +264 -0
  25. package/dist/bundle/chunk-ERGB4NJA.js +53 -0
  26. package/dist/bundle/chunk-ERKR3VJ5.js +1146 -0
  27. package/dist/bundle/chunk-FDBINRWA.js +884 -0
  28. package/dist/bundle/chunk-FZZIU4B7.js +34514 -0
  29. package/dist/bundle/chunk-GOO67PDU.js +2 -0
  30. package/dist/bundle/chunk-HDY5X3WQ.js +281 -0
  31. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  32. package/dist/bundle/chunk-IBBN7Z3A.js +630 -0
  33. package/dist/bundle/chunk-IDWW4TU2.js +18 -0
  34. package/dist/bundle/chunk-IGHEW777.js +164 -0
  35. package/dist/bundle/chunk-IN3FVRPK.js +76 -0
  36. package/dist/bundle/chunk-JAOGZMKQ.js +48 -0
  37. package/dist/bundle/chunk-JHO2LL2J.js +459 -0
  38. package/dist/bundle/chunk-JRK73FOW.js +78 -0
  39. package/dist/bundle/chunk-KAREKBUZ.js +24 -0
  40. package/dist/bundle/chunk-KJTNT4SW.js +82 -0
  41. package/dist/bundle/chunk-L5WWMP5M.js +1904 -0
  42. package/dist/bundle/chunk-MFS52LTZ.js +570 -0
  43. package/dist/bundle/chunk-MJRSEUKG.js +442 -0
  44. package/dist/bundle/chunk-MUSYGFCY.js +3556 -0
  45. package/dist/bundle/chunk-N2Z3MCOF.js +779 -0
  46. package/dist/bundle/chunk-NOVLCHDV.js +45 -0
  47. package/dist/bundle/chunk-O3UXNU3S.js +54 -0
  48. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  49. package/dist/bundle/chunk-OV6PHTAY.js +36226 -0
  50. package/dist/bundle/chunk-PBN4RBHS.js +2315 -0
  51. package/dist/bundle/chunk-PDGXMKJS.js +31 -0
  52. package/dist/bundle/chunk-PJOVK7PG.js +191 -0
  53. package/dist/bundle/chunk-QBP7OMN5.js +58 -0
  54. package/dist/bundle/chunk-QJ6XW4DM.js +7556 -0
  55. package/dist/bundle/chunk-QKWRL4OD.js +1028 -0
  56. package/dist/bundle/chunk-RUKDZEID.js +73 -0
  57. package/dist/bundle/chunk-SVDF6NJF.js +215 -0
  58. package/dist/bundle/chunk-TAYOKLGF.js +193 -0
  59. package/dist/bundle/chunk-TGB5F7NC.js +288 -0
  60. package/dist/bundle/chunk-V3ZTQ24B.js +161 -0
  61. package/dist/bundle/chunk-VLNKTMV7.js +3103 -0
  62. package/dist/bundle/chunk-VYSUKHKL.js +63 -0
  63. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  64. package/dist/bundle/chunk-YJNUDHJD.js +3390 -0
  65. package/dist/bundle/chunk-Z7MSIRSQ.js +6848 -0
  66. package/dist/bundle/chunk-ZLY6GUAS.js +82 -0
  67. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  68. package/dist/bundle/clidev.js +22 -0
  69. package/dist/bundle/command-contract-75VJ36U4.js +29 -0
  70. package/dist/bundle/decode-AMXUVKNY.js +158 -0
  71. package/dist/bundle/dist-ESHIQU4M.js +7577 -0
  72. package/dist/bundle/echarts-GJDMQ2AQ.js +42501 -0
  73. package/dist/bundle/embed-L4CRZ2XQ.js +35 -0
  74. package/dist/bundle/embedder-IBGV4M2K.js +108 -0
  75. package/dist/bundle/first-run-VTKC2IBV.js +23 -0
  76. package/dist/bundle/first-screen-X5IJKBSU.js +27 -0
  77. package/dist/bundle/instructions-YJECS4KN.js +11 -0
  78. package/dist/bundle/mcp-G6XP2IRO.js +151 -0
  79. package/dist/bundle/mcp-OQBZXELQ.js +165 -0
  80. package/dist/bundle/mcp-RDZGYPSY.js +78 -0
  81. package/dist/bundle/node-NQG4EVZR.js +176 -0
  82. package/dist/bundle/node-P4E63KXA.js +2340 -0
  83. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  84. package/dist/bundle/node-sqlite-BR7F3BLB.js +61 -0
  85. package/dist/bundle/oauth-J7UAWNIK.js +17 -0
  86. package/dist/bundle/open-BR47R5UE.js +19 -0
  87. package/dist/bundle/process-66I7RDPJ.js +91 -0
  88. package/dist/bundle/program-K6347XBZ.js +17279 -0
  89. package/dist/bundle/prompt-NE5JJ7UP.js +12 -0
  90. package/dist/bundle/recognize-GC3YFVIA.js +21 -0
  91. package/dist/bundle/remote-QELOMKQM.js +26 -0
  92. package/dist/bundle/rerank-BH6TZ2SP.js +49 -0
  93. package/dist/bundle/serve-WWLRNDT2.js +19 -0
  94. package/dist/bundle/server-DE6NLNUF.js +52 -0
  95. package/dist/bundle/server-ZPSQKOAH.js +39 -0
  96. package/dist/bundle/state-2BEGXAMO.js +33 -0
  97. package/dist/bundle/store-AH6WZMCF.js +120 -0
  98. package/dist/bundle/store-maintenance-command-PBXX3IEV.js +40 -0
  99. package/dist/version.d.ts +1 -1
  100. package/dist/version.d.ts.map +1 -1
  101. package/dist/version.js +1 -1
  102. package/dist/version.js.map +1 -1
  103. package/docs/commands.md +9 -13
  104. package/docs/dev/TESTING.md +10 -0
  105. package/docs/dev/reference-clis.md +7 -5
  106. package/docs/dev/skills/release/SKILL.md +15 -8
  107. package/docs/dev/skills/release/fresh-audit.md +4 -0
  108. package/docs/dev/test-matrix.md +1 -1
  109. package/kit/dist/new.js +1 -0
  110. package/package.json +8 -5
  111. package/scripts/audit.sh +14 -3
  112. package/scripts/smoke-bundle.ts +64 -0
  113. package/scripts/smoke.ts +18 -0
  114. package/scripts/test-matrix-untested.ts +1 -1
  115. package/scripts/version-level.test.ts +17 -1
  116. package/scripts/version-level.ts +35 -7
  117. package/skills/clidev-cli/SKILL.md +8 -0
  118. package/src/version.ts +1 -1
  119. package/lint/baseline/unknown-verb.json +0 -1
@@ -0,0 +1,21 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ child_process,
5
+ crypto,
6
+ fs,
7
+ os,
8
+ path,
9
+ stream,
10
+ util
11
+ } from "./chunk-DFDN6AUB.js";
12
+ import "./chunk-ZVVMGPBJ.js";
13
+ export {
14
+ child_process,
15
+ crypto,
16
+ fs,
17
+ os,
18
+ path,
19
+ stream,
20
+ util
21
+ };
@@ -0,0 +1,61 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ loadVectorExtension,
5
+ vectorExtension
6
+ } from "./chunk-QBP7OMN5.js";
7
+ import "./chunk-EFHLQXG6.js";
8
+ import "./chunk-Y5E2WNWB.js";
9
+ import {
10
+ __name
11
+ } from "./chunk-ZVVMGPBJ.js";
12
+
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/store/drivers/node-sqlite.js
14
+ import { DatabaseSync } from "node:sqlite";
15
+ var openWithNodeSqlite = /* @__PURE__ */ __name(async (path) => cacheOverNodeSqlite(await nodeClient(path)), "openWithNodeSqlite");
16
+ var nodeClient = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
17
+ const extension = await vectorExtension();
18
+ const client = new DatabaseSync(path, { readOnly, allowExtension: true });
19
+ try {
20
+ loadVectorExtension(client, extension);
21
+ return client;
22
+ } catch (error) {
23
+ client.close();
24
+ throw error;
25
+ }
26
+ }, "nodeClient");
27
+ var STATEMENT_CACHE_SIZE = 1e3;
28
+ var cacheOverNodeSqlite = /* @__PURE__ */ __name((database, cacheSize = STATEMENT_CACHE_SIZE) => {
29
+ const statements = /* @__PURE__ */ new Map();
30
+ const prepare = /* @__PURE__ */ __name((sql) => {
31
+ const statement = database.prepare(sql);
32
+ return {
33
+ run: /* @__PURE__ */ __name((...parameters) => ({ changes: Number(statement.run(...parameters).changes) }), "run"),
34
+ get: /* @__PURE__ */ __name((...parameters) => statement.get(...parameters), "get"),
35
+ all: /* @__PURE__ */ __name((...parameters) => statement.all(...parameters), "all")
36
+ };
37
+ }, "prepare");
38
+ return {
39
+ exec: /* @__PURE__ */ __name((sql) => database.exec(sql), "exec"),
40
+ prepare: /* @__PURE__ */ __name((sql) => {
41
+ const cached = statements.get(sql);
42
+ if (cached)
43
+ statements.delete(sql);
44
+ const statement = cached ?? prepare(sql);
45
+ statements.set(sql, statement);
46
+ if (statements.size > cacheSize)
47
+ statements.delete(statements.keys().next().value);
48
+ return statement;
49
+ }, "prepare"),
50
+ close: /* @__PURE__ */ __name(() => {
51
+ statements.clear();
52
+ database.close();
53
+ }, "close")
54
+ };
55
+ }, "cacheOverNodeSqlite");
56
+ export {
57
+ STATEMENT_CACHE_SIZE,
58
+ cacheOverNodeSqlite,
59
+ nodeClient,
60
+ openWithNodeSqlite
61
+ };
@@ -0,0 +1,17 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ ownerLogin,
5
+ revokeAll
6
+ } from "./chunk-TGB5F7NC.js";
7
+ import "./chunk-5D4AEUVA.js";
8
+ import "./chunk-V3ZTQ24B.js";
9
+ import "./chunk-RUKDZEID.js";
10
+ import "./chunk-VYSUKHKL.js";
11
+ import "./chunk-EFHLQXG6.js";
12
+ import "./chunk-Y5E2WNWB.js";
13
+ import "./chunk-ZVVMGPBJ.js";
14
+ export {
15
+ ownerLogin,
16
+ revokeAll
17
+ };
@@ -0,0 +1,19 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CAPABILITY_STATEMENTS,
5
+ assertStoreCapable,
6
+ openCache,
7
+ openFile,
8
+ storeCapable
9
+ } from "./chunk-2B5U4Z5H.js";
10
+ import "./chunk-EFHLQXG6.js";
11
+ import "./chunk-Y5E2WNWB.js";
12
+ import "./chunk-ZVVMGPBJ.js";
13
+ export {
14
+ CAPABILITY_STATEMENTS,
15
+ assertStoreCapable,
16
+ openCache,
17
+ openFile,
18
+ storeCapable
19
+ };
@@ -0,0 +1,91 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import "./chunk-Y5E2WNWB.js";
4
+ import {
5
+ __name
6
+ } from "./chunk-ZVVMGPBJ.js";
7
+
8
+ // node_modules/.pnpm/@wirecat+cli-core@0.495.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_24cca5e5c8b0984f2f26e7d1ba6b6d47/node_modules/@wirecat/cli-core/dist/embeddings/process.js
9
+ import { spawn } from "node:child_process";
10
+ import { createInterface } from "node:readline";
11
+ import { fileURLToPath } from "node:url";
12
+ var openProcess = /* @__PURE__ */ __name(async (model, directory, { threads }) => {
13
+ const child = await modelProcess({ model, directory, threads });
14
+ return {
15
+ model,
16
+ embed: /* @__PURE__ */ __name(async (texts, kind) => ((await child.ask({ texts, kind })).vectors ?? []).map((vector) => Float32Array.from(vector)), "embed"),
17
+ close: child.close
18
+ };
19
+ }, "openProcess");
20
+ var openRerankerProcess = /* @__PURE__ */ __name(async (model, directory, { threads }) => {
21
+ const child = await modelProcess({ model, directory, threads, rerank: true });
22
+ return {
23
+ model,
24
+ score: /* @__PURE__ */ __name(async (question, passages) => (await child.ask({ question, texts: passages })).scores ?? [], "score"),
25
+ close: child.close
26
+ };
27
+ }, "openRerankerProcess");
28
+ var modelProcess = /* @__PURE__ */ __name(async (setup) => {
29
+ const child = spawn(process.execPath, [fileURLToPath(new URL("./child.js", new URL("embeddings/process.js", import.meta.resolve("@wirecat/cli-core")).href)), JSON.stringify(setup)], { stdio: ["pipe", "pipe", "pipe"] });
30
+ const pending = /* @__PURE__ */ new Map();
31
+ let said = "";
32
+ child.stderr.setEncoding("utf8").on("data", (text) => {
33
+ said = (said + text).slice(-2e3);
34
+ });
35
+ let ready = /* @__PURE__ */ __name(() => {
36
+ }, "ready");
37
+ let refused = /* @__PURE__ */ __name((_error) => {
38
+ }, "refused");
39
+ const started = new Promise((resolve, reject) => {
40
+ ready = resolve;
41
+ refused = reject;
42
+ });
43
+ let gone;
44
+ const stopped = /* @__PURE__ */ __name((error) => {
45
+ gone ??= error;
46
+ refused(error);
47
+ for (const job of pending.values())
48
+ job.reject(error);
49
+ pending.clear();
50
+ }, "stopped");
51
+ const exited = new Promise((resolve) => {
52
+ child.once("exit", (code) => {
53
+ const last = said.trim().split("\n").at(-1);
54
+ stopped(new Error(`the embedding process stopped (exit ${code})${last ? `: ${last}` : ""}`));
55
+ resolve();
56
+ });
57
+ });
58
+ child.once("error", stopped);
59
+ createInterface({ input: child.stdout }).on("line", (line) => {
60
+ const answer = JSON.parse(line);
61
+ if ("ready" in answer)
62
+ return ready();
63
+ const job = pending.get(answer.id);
64
+ pending.delete(answer.id);
65
+ if (answer.error !== void 0 || !(answer.vectors ?? answer.scores))
66
+ job?.reject(new Error(answer.error ?? "no answer"));
67
+ else
68
+ job?.resolve(answer);
69
+ });
70
+ await started;
71
+ let next = 0;
72
+ return {
73
+ ask: /* @__PURE__ */ __name((request) => new Promise((resolve, reject) => {
74
+ if (gone)
75
+ return reject(gone);
76
+ const id = next++;
77
+ pending.set(id, { resolve, reject });
78
+ child.stdin.write(`${JSON.stringify({ id, ...request })}
79
+ `);
80
+ }), "ask"),
81
+ close: /* @__PURE__ */ __name(async () => {
82
+ if (child.exitCode === null && child.signalCode === null)
83
+ child.stdin.end();
84
+ await exited;
85
+ }, "close")
86
+ };
87
+ }, "modelProcess");
88
+ export {
89
+ openProcess,
90
+ openRerankerProcess
91
+ };