@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,176 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ DefaultLogger,
5
+ DrizzleQueryError,
6
+ NoopLogger,
7
+ SQLiteAsyncDatabase,
8
+ SQLiteAsyncPreparedQuery,
9
+ SQLiteAsyncSession,
10
+ SQLiteAsyncTransaction,
11
+ SQLiteDialect,
12
+ booleanFromInteger,
13
+ bufferFromBytes,
14
+ castToText,
15
+ dateFromStoredMilliseconds,
16
+ dateFromStoredSeconds,
17
+ entityKind,
18
+ jitCompatCheck,
19
+ refineSqliteCodecs,
20
+ sql
21
+ } from "./chunk-Z7MSIRSQ.js";
22
+ import {
23
+ __name
24
+ } from "./chunk-ZVVMGPBJ.js";
25
+
26
+ // 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/sqlite/drizzle/node.js
27
+ import { DatabaseSync } from "node:sqlite";
28
+ var nodeSQLiteCodecs = refineSqliteCodecs({
29
+ "integer:boolean": { normalize: booleanFromInteger },
30
+ "integer:timestamp": { normalize: dateFromStoredSeconds },
31
+ "integer:timestamp_ms": { normalize: dateFromStoredMilliseconds },
32
+ "text:json": { normalize: JSON.parse },
33
+ blob: { normalize: bufferFromBytes },
34
+ "blob:json": {
35
+ cast: castToText,
36
+ normalize: JSON.parse
37
+ },
38
+ "blob:bigint": {
39
+ cast: castToText,
40
+ normalize: BigInt
41
+ },
42
+ numeric: {
43
+ cast: castToText,
44
+ normalize: String
45
+ },
46
+ "numeric:number": { normalize: Number },
47
+ "numeric:bigint": {
48
+ cast: castToText,
49
+ normalize: BigInt
50
+ }
51
+ });
52
+ var NodeSQLiteSession = class extends SQLiteAsyncSession {
53
+ static {
54
+ __name(this, "NodeSQLiteSession");
55
+ }
56
+ client;
57
+ relations;
58
+ options;
59
+ static [entityKind] = "SQLJsSession";
60
+ logger;
61
+ constructor(client, dialect, relations, options = {}) {
62
+ super(dialect, "sync");
63
+ this.client = client;
64
+ this.relations = relations;
65
+ this.options = options;
66
+ this.logger = options.logger ?? new NoopLogger();
67
+ }
68
+ prepareQuery(query, mode, _prepare, executeMethod, mapper, queryMetadata) {
69
+ let stmt;
70
+ try {
71
+ stmt = this.client.prepare(query.sql);
72
+ } catch (e) {
73
+ throw new DrizzleQueryError(query.sql, this.options.paramsInErrors ? query.params : void 0, e);
74
+ }
75
+ return new SQLiteAsyncPreparedQuery("sync", executeMethod, {
76
+ all: /* @__PURE__ */ __name((params) => {
77
+ stmt.setReturnArrays(mode === "arrays");
78
+ const res = stmt.all(...params);
79
+ if (mode === "objects") return res.map((row) => ({ ...row }));
80
+ return res;
81
+ }, "all"),
82
+ get: /* @__PURE__ */ __name((params) => {
83
+ stmt.setReturnArrays(mode === "arrays");
84
+ const res = stmt.get(...params);
85
+ if (res && mode === "objects") return { ...res };
86
+ return res;
87
+ }, "get"),
88
+ run: /* @__PURE__ */ __name((params) => {
89
+ stmt.setReturnArrays(false);
90
+ return stmt.run(...params);
91
+ }, "run")
92
+ }, query, mapper, mode, this.logger, void 0, queryMetadata, void 0, this.options.paramsInErrors);
93
+ }
94
+ transaction(transaction, config = {}) {
95
+ if (config?.behavior === "concurrent") throw new Error("Concurrent transactions are not supported by driver");
96
+ const tx = new NodeSQLiteTransaction("sync", this.dialect, this, this.relations);
97
+ this.run(sql.raw(`begin${config.behavior ? ` ${config.behavior}` : ""}`));
98
+ try {
99
+ const result = transaction(tx);
100
+ this.run(sql`commit`);
101
+ return result;
102
+ } catch (err) {
103
+ try {
104
+ this.run(sql`rollback`);
105
+ } catch {
106
+ }
107
+ throw err;
108
+ }
109
+ }
110
+ };
111
+ var NodeSQLiteTransaction = class NodeSQLiteTransaction2 extends SQLiteAsyncTransaction {
112
+ static {
113
+ __name(this, "NodeSQLiteTransaction2");
114
+ }
115
+ static [entityKind] = "SQLJsTransaction";
116
+ transaction(transaction) {
117
+ const savepointName = `sp${this.nestedIndex + 1}`;
118
+ const tx = new NodeSQLiteTransaction2("sync", this.dialect, this.session, this._.relations, this.nestedIndex + 1);
119
+ tx.run(sql.raw(`savepoint ${savepointName}`));
120
+ try {
121
+ const result = transaction(tx);
122
+ tx.run(sql.raw(`release savepoint ${savepointName}`));
123
+ return result;
124
+ } catch (err) {
125
+ try {
126
+ tx.run(sql.raw(`rollback to savepoint ${savepointName}`));
127
+ } catch {
128
+ }
129
+ throw err;
130
+ }
131
+ }
132
+ };
133
+ var NodeSQLiteDatabase = class extends SQLiteAsyncDatabase {
134
+ static {
135
+ __name(this, "NodeSQLiteDatabase");
136
+ }
137
+ static [entityKind] = "NodeSQLiteDatabase";
138
+ };
139
+ function construct(client, config = {}) {
140
+ const dialect = new SQLiteDialect({
141
+ codecs: config.codecs ?? nodeSQLiteCodecs,
142
+ useJitMappers: jitCompatCheck(config.jit)
143
+ });
144
+ let logger;
145
+ if (config.logger === true) logger = new DefaultLogger();
146
+ else if (config.logger !== false) logger = config.logger;
147
+ const relations = config.relations ?? {};
148
+ const db = new NodeSQLiteDatabase("sync", dialect, new NodeSQLiteSession(client, dialect, relations, {
149
+ logger,
150
+ paramsInErrors: config.paramsInErrors
151
+ }), relations);
152
+ db.$client = client;
153
+ return db;
154
+ }
155
+ __name(construct, "construct");
156
+ function drizzle(...params) {
157
+ if (params[0] === void 0 || typeof params[0] === "string") return construct(params[0] === void 0 ? new DatabaseSync(":memory:") : new DatabaseSync(params[0]), params[1]);
158
+ const { connection, client, ...config } = params[0];
159
+ if (client) return construct(client, config);
160
+ if (typeof connection === "object") {
161
+ const { path, ...options } = connection;
162
+ return construct(new DatabaseSync(path ?? ":memory:", options), config);
163
+ }
164
+ return construct(new DatabaseSync(connection ?? ":memory:"), config);
165
+ }
166
+ __name(drizzle, "drizzle");
167
+ (function(_drizzle) {
168
+ function mock(config) {
169
+ return construct({}, config);
170
+ }
171
+ __name(mock, "mock");
172
+ _drizzle.mock = mock;
173
+ })(drizzle || (drizzle = {}));
174
+ export {
175
+ drizzle
176
+ };