@wirecat/cli-template 0.14.0 → 0.16.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 (154) hide show
  1. package/.github/workflows/ci.yml +17 -0
  2. package/AGENTS.md +56 -2
  3. package/CHANGELOG.md +46 -0
  4. package/README.md +12 -4
  5. package/biome.json +2 -2
  6. package/contracts/mcp-tools.json +2 -2
  7. package/dist/bin/clidev.js +2 -2
  8. package/dist/bundle/{chunk-LU4A2T7Y.js → all-profiles-FS7AEOE7.js} +8 -5
  9. package/dist/bundle/{anthropic-ICTW7CNQ.js → anthropic-5RN7BGDI.js} +3 -3
  10. package/dist/bundle/{app-server-B6BCKXR7.js → app-server-WGTKZQKJ.js} +28 -29
  11. package/dist/bundle/{bun-sqlite-JE6FJFQT.js → bun-sqlite-WK2IGBGD.js} +2 -2
  12. package/dist/bundle/{chunk-AS2PJNQ2.js → chunk-2MWNE4L3.js} +1 -1
  13. package/dist/bundle/{chunk-2DAXUNTS.js → chunk-5HHIPDNW.js} +1 -1
  14. package/dist/bundle/{chunk-YOJLIVGO.js → chunk-5KAYQKBK.js} +1 -1
  15. package/dist/bundle/{chunk-62JRF2JA.js → chunk-6WOJIAYA.js} +1 -1
  16. package/dist/bundle/chunk-7EUX7AZV.js +141 -0
  17. package/dist/bundle/{chunk-7F5VMLVK.js → chunk-ADFSSIV4.js} +1 -1
  18. package/dist/bundle/{chunk-U6QD3J3F.js → chunk-ATHZEV2Z.js} +2 -2
  19. package/dist/bundle/{chunk-UT5TQ6MD.js → chunk-BPMKAZSS.js} +8 -8
  20. package/dist/bundle/{chunk-DZLHY4IA.js → chunk-C3GNOEJP.js} +1 -1
  21. package/dist/bundle/{chunk-PIJUGF5F.js → chunk-CTBHQRX6.js} +1 -1
  22. package/dist/bundle/{chunk-LFLSV353.js → chunk-DEHBTFIC.js} +1 -1
  23. package/dist/bundle/{chunk-NVNUUHT5.js → chunk-EA3TMI4A.js} +8 -8
  24. package/dist/bundle/{chunk-BEBD27QT.js → chunk-EILS4BTQ.js} +16 -18
  25. package/dist/bundle/{chunk-BVLPNNEL.js → chunk-ENDBOYQR.js} +14 -14
  26. package/dist/bundle/{chunk-6AW4DDK4.js → chunk-ETJXPB6A.js} +1 -1
  27. package/dist/bundle/{chunk-LATYBJ4T.js → chunk-FMO6F5Q2.js} +1 -1
  28. package/dist/bundle/{chunk-RJ7AS7UB.js → chunk-HTYLT6ME.js} +24 -7
  29. package/dist/bundle/{chunk-F34HGYWF.js → chunk-JFXWLQ2L.js} +1 -1
  30. package/dist/bundle/{chunk-IZKXJJ7V.js → chunk-JJZCPBH3.js} +29 -6
  31. package/dist/bundle/{chunk-G7W53MQP.js → chunk-LRHX62ZF.js} +2 -2
  32. package/dist/bundle/{chunk-SOYOOU2D.js → chunk-MBBOINK4.js} +2 -2
  33. package/dist/bundle/{chunk-BM5ZCDPQ.js → chunk-MEXT6XDP.js} +2 -2
  34. package/dist/bundle/{chunk-R2JKPHH5.js → chunk-NVPWZF67.js} +1 -1
  35. package/dist/bundle/{chunk-45244QQ6.js → chunk-OF56L2JU.js} +2 -2
  36. package/dist/bundle/{chunk-4PA6DJ7F.js → chunk-OGTRPW2K.js} +3 -3
  37. package/dist/bundle/{chunk-VXOR76ZL.js → chunk-ORV4EGNC.js} +1 -1
  38. package/dist/bundle/{chunk-TJJ2XSJP.js → chunk-QGOOPPEW.js} +2 -2
  39. package/dist/bundle/{chunk-NH6LZ3H3.js → chunk-RFJKNFVF.js} +3 -3
  40. package/dist/bundle/{chunk-R5RYPD23.js → chunk-RYOAQCVJ.js} +1 -1
  41. package/dist/bundle/{chunk-66VMJGV6.js → chunk-SKBRW5U3.js} +1 -1
  42. package/dist/bundle/{chunk-BWBZCYUN.js → chunk-TXHCL75B.js} +43 -6
  43. package/dist/bundle/{chunk-QXOSPYM3.js → chunk-VPCXYY46.js} +1 -1
  44. package/dist/bundle/{chunk-IOJ2DTCY.js → chunk-WDWP5N6M.js} +2 -0
  45. package/dist/bundle/{chunk-HYTHTSJP.js → chunk-WM5AMTRY.js} +4 -4
  46. package/dist/bundle/{chunk-ASHVHS52.js → chunk-YNROUY3R.js} +10 -10
  47. package/dist/bundle/{chunk-DQIBGCF3.js → chunk-Z5NL6YNU.js} +2 -2
  48. package/dist/bundle/{chunk-5SAF3XOL.js → chunk-ZSY4WAGI.js} +28 -21
  49. package/dist/bundle/clidev.js +3 -3
  50. package/dist/bundle/{command-contract-JMVMT5HT.js → command-contract-ZDU73EPH.js} +9 -9
  51. package/dist/bundle/{decode-NXB5UKMO.js → decode-QMLOGZ6R.js} +2 -2
  52. package/dist/bundle/{embed-IKZ24BMC.js → embed-PIR2LJR2.js} +4 -4
  53. package/dist/bundle/{embedder-GMQ24DOQ.js → embedder-6KBRPAEQ.js} +4 -4
  54. package/dist/bundle/{first-run-MDD4SIUK.js → first-run-JO3CMY3Z.js} +7 -7
  55. package/dist/bundle/{first-screen-376CXGXJ.js → first-screen-3T5IXTFL.js} +10 -10
  56. package/dist/bundle/{node-sqlite-73Z4SFOA.js → node-sqlite-LIK6OYNF.js} +2 -2
  57. package/dist/bundle/{oauth-EVTPAMZP.js → oauth-7FVF7HQQ.js} +4 -4
  58. package/dist/bundle/{open-46WZAPJ3.js → open-CRZDEATN.js} +2 -2
  59. package/dist/bundle/{openai-GWRDAHDU.js → openai-WAJ6WREQ.js} +11 -32
  60. package/dist/bundle/{program-B3CY3FP7.js → program-ZFFFPBRS.js} +2263 -300
  61. package/dist/bundle/{prompt-IVEYRLS5.js → prompt-QQIVHO3M.js} +3 -3
  62. package/dist/bundle/{recognize-WVEKHODM.js → recognize-4KLBZDEC.js} +2 -2
  63. package/dist/bundle/{remote-4K5VPMC7.js → remote-BABMZTHA.js} +5 -5
  64. package/dist/bundle/{rerank-V24UJZYJ.js → rerank-P3IQQJIL.js} +4 -4
  65. package/dist/bundle/{chunk-EMHCXXNJ.js → serve-25SSAKRZ.js} +6 -4
  66. package/dist/bundle/server-G4GCDMYI.js +52 -0
  67. package/dist/bundle/{chunk-PX2KP4QE.js → server-P4XUYY5A.js} +27 -7
  68. package/dist/bundle/{state-ZPYGECVP.js → state-QCQALQBJ.js} +3 -3
  69. package/dist/bundle/{store-6JQCLPQF.js → store-ZECPRGGH.js} +7 -7
  70. package/dist/bundle/store-maintenance-command-ECUO5G6L.js +42 -0
  71. package/dist/commands/comments.d.ts +3 -0
  72. package/dist/commands/comments.d.ts.map +1 -0
  73. package/dist/commands/comments.js +114 -0
  74. package/dist/commands/comments.js.map +1 -0
  75. package/dist/commands/session.d.ts +3 -0
  76. package/dist/commands/session.d.ts.map +1 -0
  77. package/dist/commands/session.js +96 -0
  78. package/dist/commands/session.js.map +1 -0
  79. package/dist/config.d.ts +2 -0
  80. package/dist/config.d.ts.map +1 -1
  81. package/dist/config.js +4 -2
  82. package/dist/config.js.map +1 -1
  83. package/dist/context.d.ts +83 -0
  84. package/dist/context.d.ts.map +1 -0
  85. package/dist/context.js +58 -0
  86. package/dist/context.js.map +1 -0
  87. package/dist/program.d.ts.map +1 -1
  88. package/dist/program.js +26 -5
  89. package/dist/program.js.map +1 -1
  90. package/dist/sample/comments.d.ts +61 -0
  91. package/dist/sample/comments.d.ts.map +1 -0
  92. package/dist/sample/comments.js +39 -0
  93. package/dist/sample/comments.js.map +1 -0
  94. package/dist/sample/transport.d.ts +42 -0
  95. package/dist/sample/transport.d.ts.map +1 -0
  96. package/dist/sample/transport.js +152 -0
  97. package/dist/sample/transport.js.map +1 -0
  98. package/dist/token.d.ts +16 -0
  99. package/dist/token.d.ts.map +1 -0
  100. package/dist/token.js +32 -0
  101. package/dist/token.js.map +1 -0
  102. package/dist/version.d.ts +1 -1
  103. package/dist/version.js +1 -1
  104. package/docs/commands.md +234 -12
  105. package/docs/configuration.md +1 -1
  106. package/docs/dev/reference-clis.md +3 -2
  107. package/docs/dev/test-matrix.md +36 -5
  108. package/docs/index.md +4 -3
  109. package/docs/security.md +4 -2
  110. package/kit/dist/new.js +6 -3
  111. package/lint/overrides.json +9 -1
  112. package/package.json +3 -4
  113. package/scripts/test-matrix-untested.ts +19 -0
  114. package/skills/clidev-cli/SKILL.md +1 -1
  115. package/src/commands/comments.ts +167 -0
  116. package/src/commands/session.ts +144 -0
  117. package/src/comments.test.ts +258 -0
  118. package/src/config.ts +5 -2
  119. package/src/context.ts +78 -0
  120. package/src/mcp.test.ts +71 -76
  121. package/src/program.test.ts +39 -17
  122. package/src/program.ts +30 -5
  123. package/src/sample/comments.ts +51 -0
  124. package/src/sample/transport.test.ts +117 -0
  125. package/src/sample/transport.ts +184 -0
  126. package/src/testing/fake-comments.ts +167 -0
  127. package/src/testing/harness.ts +51 -0
  128. package/src/token.ts +42 -0
  129. package/src/version.ts +1 -1
  130. package/dist/bundle/all-profiles-NVB2HT2S.js +0 -24
  131. package/dist/bundle/chunk-GUFPQZUA.js +0 -48
  132. package/dist/bundle/chunk-NL2DQPT7.js +0 -2
  133. package/dist/bundle/mcp-KHUZOJO6.js +0 -82
  134. package/dist/bundle/mcp-MZHWJXAE.js +0 -152
  135. package/dist/bundle/serve-PJWSOV7F.js +0 -19
  136. package/dist/bundle/server-2ZN7KZHZ.js +0 -40
  137. package/dist/bundle/server-5VYM7CCF.js +0 -53
  138. package/dist/bundle/store-maintenance-command-7XICIYHW.js +0 -42
  139. package/dist/commands/doctor.d.ts +0 -77
  140. package/dist/commands/doctor.d.ts.map +0 -1
  141. package/dist/commands/doctor.js +0 -74
  142. package/dist/commands/doctor.js.map +0 -1
  143. package/dist/commands/mcp.d.ts +0 -3
  144. package/dist/commands/mcp.d.ts.map +0 -1
  145. package/dist/commands/mcp.js +0 -97
  146. package/dist/commands/mcp.js.map +0 -1
  147. package/dist/mcp.d.ts +0 -29
  148. package/dist/mcp.d.ts.map +0 -1
  149. package/dist/mcp.js +0 -98
  150. package/dist/mcp.js.map +0 -1
  151. package/src/commands/doctor.ts +0 -86
  152. package/src/commands/mcp.ts +0 -130
  153. package/src/mcp-http.test.ts +0 -172
  154. package/src/mcp.ts +0 -140
@@ -7,10 +7,10 @@ import {
7
7
  agentJson,
8
8
  commandAvailability,
9
9
  failureContext
10
- } from "./chunk-HYTHTSJP.js";
10
+ } from "./chunk-WM5AMTRY.js";
11
11
  import {
12
12
  callerOf
13
- } from "./chunk-F34HGYWF.js";
13
+ } from "./chunk-JFXWLQ2L.js";
14
14
  import {
15
15
  QUERY_ARGUMENT,
16
16
  lentConnection,
@@ -18,10 +18,10 @@ import {
18
18
  refuseLacking,
19
19
  servicesFor,
20
20
  storeModeDeps
21
- } from "./chunk-5SAF3XOL.js";
21
+ } from "./chunk-ZSY4WAGI.js";
22
22
  import {
23
23
  MAX_BUFFERED_INPUT
24
- } from "./chunk-2DAXUNTS.js";
24
+ } from "./chunk-5HHIPDNW.js";
25
25
  import {
26
26
  DEFAULT_OUTPUT_BYTES,
27
27
  ENTITIES,
@@ -45,16 +45,16 @@ import {
45
45
  sealed,
46
46
  startRecording,
47
47
  traceOf
48
- } from "./chunk-RJ7AS7UB.js";
48
+ } from "./chunk-HTYLT6ME.js";
49
49
  import {
50
50
  currentCaller,
51
51
  keepsSuccess,
52
52
  runContextOf,
53
53
  withCaller
54
- } from "./chunk-VXOR76ZL.js";
54
+ } from "./chunk-ORV4EGNC.js";
55
55
  import {
56
56
  queryDescription
57
- } from "./chunk-YOJLIVGO.js";
57
+ } from "./chunk-5KAYQKBK.js";
58
58
  import {
59
59
  COMPACT_FLAG,
60
60
  CliError,
@@ -97,7 +97,7 @@ import {
97
97
  unknown,
98
98
  word,
99
99
  writes
100
- } from "./chunk-IOJ2DTCY.js";
100
+ } from "./chunk-WDWP5N6M.js";
101
101
  import {
102
102
  __name
103
103
  } from "./chunk-ZVVMGPBJ.js";
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  resolvePaths,
8
8
  writeSecurely
9
- } from "./chunk-IOJ2DTCY.js";
9
+ } from "./chunk-WDWP5N6M.js";
10
10
  import {
11
11
  __name
12
12
  } from "./chunk-ZVVMGPBJ.js";
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-IOJ2DTCY.js";
5
+ } from "./chunk-WDWP5N6M.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-IOJ2DTCY.js";
5
+ } from "./chunk-WDWP5N6M.js";
6
6
  import {
7
7
  importFrom
8
8
  } from "./chunk-Y5E2WNWB.js";
@@ -12,7 +12,7 @@ import {
12
12
  fold,
13
13
  normalize,
14
14
  parseStemmers
15
- } from "./chunk-R2JKPHH5.js";
15
+ } from "./chunk-NVPWZF67.js";
16
16
  import {
17
17
  CHAT_MESSAGES_READ,
18
18
  FACT_STATUSES,
@@ -112,17 +112,17 @@ import {
112
112
  validateQuery,
113
113
  walkQuery,
114
114
  zonedMoment
115
- } from "./chunk-YOJLIVGO.js";
115
+ } from "./chunk-5KAYQKBK.js";
116
116
  import {
117
117
  DEFAULT_TASK_CATEGORIES,
118
118
  sharedConfigPath,
119
119
  storedTaskCategories,
120
120
  taskCategoriesReader
121
- } from "./chunk-TJJ2XSJP.js";
121
+ } from "./chunk-QGOOPPEW.js";
122
122
  import {
123
123
  quietSqliteWarning,
124
124
  storeCapable
125
- } from "./chunk-NH6LZ3H3.js";
125
+ } from "./chunk-RFJKNFVF.js";
126
126
  import {
127
127
  PRAGMAS,
128
128
  TIME_LIMIT_FUNCTION,
@@ -156,7 +156,7 @@ import {
156
156
  import {
157
157
  refuseOwnerStoreInTests,
158
158
  storePath
159
- } from "./chunk-62JRF2JA.js";
159
+ } from "./chunk-6WOJIAYA.js";
160
160
  import {
161
161
  CliError,
162
162
  array,
@@ -176,7 +176,7 @@ import {
176
176
  singleLine,
177
177
  strictObject,
178
178
  string
179
- } from "./chunk-IOJ2DTCY.js";
179
+ } from "./chunk-WDWP5N6M.js";
180
180
  import {
181
181
  resolveFrom
182
182
  } from "./chunk-Y5E2WNWB.js";
@@ -48399,7 +48399,7 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
48399
48399
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
48400
48400
  quietSqliteWarning();
48401
48401
  const { drizzle } = await import("./node-52WF2326.js");
48402
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-73Z4SFOA.js");
48402
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-LIK6OYNF.js");
48403
48403
  const client = await nodeClient(path, { readOnly });
48404
48404
  try {
48405
48405
  return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
@@ -48409,7 +48409,7 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
48409
48409
  }
48410
48410
  }, "openUnderNode");
48411
48411
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
48412
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-JE6FJFQT.js");
48412
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-WK2IGBGD.js");
48413
48413
  const { drizzle } = await import("./bun-ILPS6AYA.js");
48414
48414
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
48415
48415
  try {
@@ -8,14 +8,12 @@ import {
8
8
  chartRenderer,
9
9
  chatChart,
10
10
  keepRefreshedRefs,
11
+ mcpUrlOf,
11
12
  refuseWriteBeforeConnecting,
12
13
  registerPrompts,
13
14
  stdinFieldOf,
14
15
  syncsFirst
15
- } from "./chunk-BWBZCYUN.js";
16
- import {
17
- mcpUrlOf
18
- } from "./chunk-GUFPQZUA.js";
16
+ } from "./chunk-TXHCL75B.js";
19
17
  import {
20
18
  answeredWire
21
19
  } from "./chunk-VS5LGSTM.js";
@@ -39,21 +37,21 @@ import {
39
37
  tool,
40
38
  toolKey,
41
39
  toolsFromCommands
42
- } from "./chunk-UT5TQ6MD.js";
40
+ } from "./chunk-BPMKAZSS.js";
43
41
  import {
44
42
  agentJson,
45
43
  skillResource
46
- } from "./chunk-HYTHTSJP.js";
44
+ } from "./chunk-WM5AMTRY.js";
47
45
  import {
48
46
  StdioServerTransport,
49
47
  callerOf,
50
48
  callingAgent,
51
49
  serveStdio
52
- } from "./chunk-F34HGYWF.js";
50
+ } from "./chunk-JFXWLQ2L.js";
53
51
  import {
54
52
  connectedFor,
55
53
  guardFor
56
- } from "./chunk-IZKXJJ7V.js";
54
+ } from "./chunk-JJZCPBH3.js";
57
55
  import {
58
56
  capability,
59
57
  dateWindow,
@@ -62,7 +60,7 @@ import {
62
60
  servicesFor,
63
61
  storedDeps,
64
62
  wholeList
65
- } from "./chunk-5SAF3XOL.js";
63
+ } from "./chunk-ZSY4WAGI.js";
66
64
  import {
67
65
  instructions
68
66
  } from "./chunk-G45R7M42.js";
@@ -72,10 +70,10 @@ import {
72
70
  } from "./chunk-5D4AEUVA.js";
73
71
  import {
74
72
  mcpHttpMarker
75
- } from "./chunk-6AW4DDK4.js";
73
+ } from "./chunk-ETJXPB6A.js";
76
74
  import {
77
75
  findCommand
78
- } from "./chunk-BM5ZCDPQ.js";
76
+ } from "./chunk-MEXT6XDP.js";
79
77
  import {
80
78
  DEFAULT_OUTPUT_BYTES,
81
79
  changesAuthorityAt,
@@ -92,21 +90,21 @@ import {
92
90
  sealed,
93
91
  snakeKeys,
94
92
  typedCommand
95
- } from "./chunk-RJ7AS7UB.js";
93
+ } from "./chunk-HTYLT6ME.js";
96
94
  import {
97
95
  isCliFailure,
98
96
  withCaller
99
- } from "./chunk-VXOR76ZL.js";
97
+ } from "./chunk-ORV4EGNC.js";
100
98
  import {
101
99
  openStore,
102
100
  pdfPreviewLimits
103
- } from "./chunk-NVNUUHT5.js";
101
+ } from "./chunk-EA3TMI4A.js";
104
102
  import {
105
103
  timezoneOf
106
- } from "./chunk-YOJLIVGO.js";
104
+ } from "./chunk-5KAYQKBK.js";
107
105
  import {
108
106
  warmEmbedders
109
- } from "./chunk-DQIBGCF3.js";
107
+ } from "./chunk-Z5NL6YNU.js";
110
108
  import {
111
109
  CliError,
112
110
  description,
@@ -124,7 +122,7 @@ import {
124
122
  strictObject,
125
123
  string,
126
124
  visibleControls
127
- } from "./chunk-IOJ2DTCY.js";
125
+ } from "./chunk-WDWP5N6M.js";
128
126
  import {
129
127
  __name
130
128
  } from "./chunk-ZVVMGPBJ.js";
@@ -740,7 +738,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
740
738
  }, "serveOverStdio");
741
739
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
742
740
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
743
- const { serveOverHttp } = await import("./serve-PJWSOV7F.js");
741
+ const { serveOverHttp } = await import("./serve-25SSAKRZ.js");
744
742
  const appName = messenger.app.command;
745
743
  const appEnvPrefix = messenger.app.envPrefix;
746
744
  const listening = await serveOverHttp(build, {
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answerOf,
5
5
  messengerContext
6
- } from "./chunk-IZKXJJ7V.js";
6
+ } from "./chunk-JJZCPBH3.js";
7
7
  import {
8
8
  FETCHING,
9
9
  RULES_VERSION,
@@ -24,10 +24,10 @@ import {
24
24
  typedQuery,
25
25
  withQuery,
26
26
  withTimeLimit
27
- } from "./chunk-5SAF3XOL.js";
27
+ } from "./chunk-ZSY4WAGI.js";
28
28
  import {
29
29
  readSecret
30
- } from "./chunk-G7W53MQP.js";
30
+ } from "./chunk-LRHX62ZF.js";
31
31
  import {
32
32
  stringWidth,
33
33
  wrapAnsi
@@ -38,16 +38,16 @@ import {
38
38
  releaseLock,
39
39
  servingProfiles,
40
40
  takeLock
41
- } from "./chunk-DZLHY4IA.js";
41
+ } from "./chunk-C3GNOEJP.js";
42
42
  import {
43
43
  checkedOptions,
44
44
  range
45
- } from "./chunk-R5RYPD23.js";
45
+ } from "./chunk-RYOAQCVJ.js";
46
46
  import {
47
47
  messagesFor,
48
48
  systemFor,
49
49
  validateImages
50
- } from "./chunk-LATYBJ4T.js";
50
+ } from "./chunk-FMO6F5Q2.js";
51
51
  import {
52
52
  Command,
53
53
  LOCAL_READ,
@@ -76,10 +76,10 @@ import {
76
76
  snakeKeys,
77
77
  storeTable,
78
78
  withoutProviderRefs
79
- } from "./chunk-RJ7AS7UB.js";
79
+ } from "./chunk-HTYLT6ME.js";
80
80
  import {
81
81
  failureKey
82
- } from "./chunk-VXOR76ZL.js";
82
+ } from "./chunk-ORV4EGNC.js";
83
83
  import {
84
84
  holdersOf
85
85
  } from "./chunk-VOTEB3AN.js";
@@ -111,16 +111,16 @@ import {
111
111
  storeClients,
112
112
  storeContents,
113
113
  vectorIndexCounts
114
- } from "./chunk-NVNUUHT5.js";
114
+ } from "./chunk-EA3TMI4A.js";
115
115
  import {
116
116
  queryFieldsOf
117
- } from "./chunk-YOJLIVGO.js";
117
+ } from "./chunk-5KAYQKBK.js";
118
118
  import {
119
119
  openCache
120
- } from "./chunk-NH6LZ3H3.js";
120
+ } from "./chunk-RFJKNFVF.js";
121
121
  import {
122
122
  storePath
123
- } from "./chunk-62JRF2JA.js";
123
+ } from "./chunk-6WOJIAYA.js";
124
124
  import {
125
125
  CliError,
126
126
  Credentials,
@@ -151,7 +151,7 @@ import {
151
151
  union,
152
152
  visibleControls,
153
153
  writeSecurely
154
- } from "./chunk-IOJ2DTCY.js";
154
+ } from "./chunk-WDWP5N6M.js";
155
155
  import {
156
156
  __commonJS,
157
157
  __name,
@@ -6645,7 +6645,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6645
6645
  if (!adapter && target.provider === "openai")
6646
6646
  adapter = openai;
6647
6647
  if (!adapter && target.provider === "anthropic")
6648
- adapter = (await import("./anthropic-ICTW7CNQ.js")).anthropic;
6648
+ adapter = (await import("./anthropic-5RN7BGDI.js")).anthropic;
6649
6649
  if (!adapter)
6650
6650
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6651
6651
  if (request.images !== void 0 && adapter.images !== true)
@@ -5,7 +5,7 @@ import {
5
5
  readLock,
6
6
  releaseLock,
7
7
  takeLock
8
- } from "./chunk-DZLHY4IA.js";
8
+ } from "./chunk-C3GNOEJP.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-IOJ2DTCY.js";
5
+ } from "./chunk-WDWP5N6M.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
@@ -10,10 +10,10 @@ import {
10
10
  providerErrorKey,
11
11
  renderEvent,
12
12
  runContextOf
13
- } from "./chunk-VXOR76ZL.js";
13
+ } from "./chunk-ORV4EGNC.js";
14
14
  import {
15
15
  permissionCeiling
16
- } from "./chunk-U6QD3J3F.js";
16
+ } from "./chunk-ATHZEV2Z.js";
17
17
  import {
18
18
  carries
19
19
  } from "./chunk-VOTEB3AN.js";
@@ -67,17 +67,17 @@ import {
67
67
  text,
68
68
  time,
69
69
  untrusted
70
- } from "./chunk-YOJLIVGO.js";
70
+ } from "./chunk-5KAYQKBK.js";
71
71
  import {
72
72
  sharedConfigPath
73
- } from "./chunk-TJJ2XSJP.js";
73
+ } from "./chunk-QGOOPPEW.js";
74
74
  import {
75
75
  filesPresent,
76
76
  sharedModelsDirectory
77
- } from "./chunk-45244QQ6.js";
77
+ } from "./chunk-OF56L2JU.js";
78
78
  import {
79
79
  storePath
80
- } from "./chunk-62JRF2JA.js";
80
+ } from "./chunk-6WOJIAYA.js";
81
81
  import {
82
82
  COMPACT_FLAG,
83
83
  CliError,
@@ -144,7 +144,7 @@ import {
144
144
  visibleControls,
145
145
  writeSecurely,
146
146
  writes
147
- } from "./chunk-IOJ2DTCY.js";
147
+ } from "./chunk-WDWP5N6M.js";
148
148
  import {
149
149
  __name
150
150
  } from "./chunk-ZVVMGPBJ.js";
@@ -5190,6 +5190,7 @@ var currentRun = /* @__PURE__ */ __name(() => {
5190
5190
  return processScope;
5191
5191
  }, "currentRun");
5192
5192
  var inRun = /* @__PURE__ */ __name((scope, body) => scopes.run(scope, body), "inRun");
5193
+ var runEvent = /* @__PURE__ */ __name((event2) => scopes.getStore()?.events?.(event2), "runEvent");
5193
5194
  var typedCommand = /* @__PURE__ */ __name((tool, words, profile = currentRun().profile) => [tool, profile, words].filter((part) => part !== void 0 && part !== "").join(" "), "typedCommand");
5194
5195
  var useAsProcessRun = /* @__PURE__ */ __name((scope) => {
5195
5196
  processScope = scope;
@@ -5207,6 +5208,7 @@ var childTrace = /* @__PURE__ */ __name(() => {
5207
5208
  }, "childTrace");
5208
5209
  var attempts = new AsyncLocalStorage2();
5209
5210
  var withAttempt = /* @__PURE__ */ __name((attempt, work) => attempts.run(attempt, work), "withAttempt");
5211
+ var currentAttempt = /* @__PURE__ */ __name(() => attempts.getStore(), "currentAttempt");
5210
5212
 
5211
5213
  // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/runs/recording.js
5212
5214
  var recorded = /* @__PURE__ */ __name(async (options, body) => {
@@ -5455,6 +5457,11 @@ var liftProfile = /* @__PURE__ */ __name((argv, words, valued = /* @__PURE__ */
5455
5457
  return { profile: first2, rest: [...argv.slice(0, at2), ...argv.slice(at2 + 1)] };
5456
5458
  }, "liftProfile");
5457
5459
  var valuedOptions = /* @__PURE__ */ __name((program2) => new Set(program2.options.filter((option) => option.required).flatMap((option) => [option.long, option.short].filter((flag2) => flag2 !== void 0))), "valuedOptions");
5460
+ var refuseCommandName = /* @__PURE__ */ __name((profile, words, command) => {
5461
+ if (words.has(profile)) {
5462
+ throw new CliError("validation_error", `"${profile}" is a command, so \`${command} ${profile} \u2026\` would always mean the command and never this profile. Pick a name that is not one of: ` + [...words].sort().join(", "));
5463
+ }
5464
+ }, "refuseCommandName");
5458
5465
  var rootOf = /* @__PURE__ */ __name((command) => {
5459
5466
  let root = command;
5460
5467
  while (root.parent)
@@ -7156,6 +7163,10 @@ var changesAuthorityNow = /* @__PURE__ */ __name((command) => {
7156
7163
  return unless === void 0 || command.opts()[unless] !== true;
7157
7164
  }, "changesAuthorityNow");
7158
7165
  var LOGIN = /* @__PURE__ */ new WeakSet();
7166
+ var logsInOrOut = /* @__PURE__ */ __name((command) => {
7167
+ LOGIN.add(command);
7168
+ return command;
7169
+ }, "logsInOrOut");
7159
7170
  var isLogin = /* @__PURE__ */ __name((command) => LOGIN.has(command), "isLogin");
7160
7171
  var KEPT_UNDER_LOCK = /* @__PURE__ */ new WeakSet();
7161
7172
  var destroysNothing = /* @__PURE__ */ __name((command) => {
@@ -12353,6 +12364,7 @@ export {
12353
12364
  readEvents,
12354
12365
  currentRun,
12355
12366
  inRun,
12367
+ runEvent,
12356
12368
  typedCommand,
12357
12369
  useAsProcessRun,
12358
12370
  processRun,
@@ -12360,6 +12372,7 @@ export {
12360
12372
  traceOf,
12361
12373
  childTrace,
12362
12374
  withAttempt,
12375
+ currentAttempt,
12363
12376
  recordLogFor,
12364
12377
  spawnDetached,
12365
12378
  jobsDir,
@@ -12396,6 +12409,7 @@ export {
12396
12409
  refuseJoinedPath,
12397
12410
  LEVELS,
12398
12411
  skipFlagFor,
12412
+ DEFAULT_PERMISSIONS,
12399
12413
  AUTHORITY_KEY,
12400
12414
  authorityAllowed,
12401
12415
  BOT_API_KEY,
@@ -12432,6 +12446,7 @@ export {
12432
12446
  commandWords,
12433
12447
  liftProfile,
12434
12448
  valuedOptions,
12449
+ refuseCommandName,
12435
12450
  rootOf,
12436
12451
  sampleCommand,
12437
12452
  TEXT_MODELS,
@@ -12455,6 +12470,7 @@ export {
12455
12470
  issueMessage,
12456
12471
  rememberAccount,
12457
12472
  recalledAccount,
12473
+ profilesHere,
12458
12474
  NONE_NAMED,
12459
12475
  namedProfile,
12460
12476
  NoProfileHere,
@@ -12476,6 +12492,7 @@ export {
12476
12492
  changesAuthority,
12477
12493
  changesAuthorityAt,
12478
12494
  changesAuthorityNow,
12495
+ logsInOrOut,
12479
12496
  isLogin,
12480
12497
  destroysNothing,
12481
12498
  admittedUnderLock,
@@ -29,7 +29,7 @@ import {
29
29
  agentOf,
30
30
  clientHash,
31
31
  currentCaller
32
- } from "./chunk-VXOR76ZL.js";
32
+ } from "./chunk-ORV4EGNC.js";
33
33
  import {
34
34
  __name
35
35
  } from "./chunk-ZVVMGPBJ.js";
@@ -13,12 +13,14 @@ import {
13
13
  refuseLacking,
14
14
  servicesFor,
15
15
  throughWrapper
16
- } from "./chunk-5SAF3XOL.js";
16
+ } from "./chunk-ZSY4WAGI.js";
17
17
  import {
18
18
  servingProfiles
19
- } from "./chunk-DZLHY4IA.js";
19
+ } from "./chunk-C3GNOEJP.js";
20
20
  import {
21
+ AUTHORITY_KEY,
21
22
  CEILING_KEY,
23
+ DEFAULT_PERMISSIONS,
22
24
  LOG_ATTRIBUTES,
23
25
  MESSENGER_CHANGE_REFUSAL,
24
26
  WRITE_KEYS,
@@ -43,21 +45,21 @@ import {
43
45
  rememberAccount,
44
46
  rootOf2 as rootOf,
45
47
  skipFlagFor
46
- } from "./chunk-RJ7AS7UB.js";
48
+ } from "./chunk-HTYLT6ME.js";
47
49
  import {
48
50
  isCliFailure,
49
51
  providerErrorKey
50
- } from "./chunk-VXOR76ZL.js";
52
+ } from "./chunk-ORV4EGNC.js";
51
53
  import {
52
54
  openStore
53
- } from "./chunk-NVNUUHT5.js";
55
+ } from "./chunk-EA3TMI4A.js";
54
56
  import {
55
57
  CliError,
56
58
  logRecordOf,
57
59
  realSleep,
58
60
  resolvePaths,
59
61
  writeSecurely
60
- } from "./chunk-IOJ2DTCY.js";
62
+ } from "./chunk-WDWP5N6M.js";
61
63
  import {
62
64
  __name
63
65
  } from "./chunk-ZVVMGPBJ.js";
@@ -717,6 +719,26 @@ var Pacer = class {
717
719
  };
718
720
 
719
721
  // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
722
+ var HOUSEKEEPING = /* @__PURE__ */ new Set([
723
+ "help",
724
+ "guide",
725
+ "config",
726
+ "session",
727
+ "doctor",
728
+ "commands",
729
+ "complete",
730
+ "upgrade",
731
+ "skill",
732
+ "mcp",
733
+ "runs"
734
+ ]);
735
+ var commandPathKey = /* @__PURE__ */ __name((path) => path[0] === void 0 || HOUSEKEEPING.has(path[0]) ? null : path.join("."), "commandPathKey");
736
+ var commandPermissions = /* @__PURE__ */ __name(({ keyOf = commandPathKey, extra = [], defaults = {}, alsoChecks } = {}) => ({
737
+ keyOf,
738
+ extra: [AUTHORITY_KEY, ...extra],
739
+ defaults: { ...DEFAULT_PERMISSIONS, ...defaults },
740
+ ...alsoChecks ? { alsoChecks } : {}
741
+ }), "commandPermissions");
720
742
  var pathOf = /* @__PURE__ */ __name((command) => {
721
743
  const words = [];
722
744
  for (let at = command; at?.parent; at = at.parent)
@@ -1979,6 +2001,7 @@ export {
1979
2001
  levelRefusal,
1980
2002
  sendGuard,
1981
2003
  guardFor,
2004
+ commandPermissions,
1982
2005
  knownPermissionKeys,
1983
2006
  knownBeside,
1984
2007
  unknownPermissionIssues,
@@ -4,10 +4,10 @@ import {
4
4
  MAX_SECRET_INPUT,
5
5
  bufferedInput,
6
6
  inputPolicy
7
- } from "./chunk-2DAXUNTS.js";
7
+ } from "./chunk-5HHIPDNW.js";
8
8
  import {
9
9
  CliError
10
- } from "./chunk-IOJ2DTCY.js";
10
+ } from "./chunk-WDWP5N6M.js";
11
11
  import {
12
12
  __name
13
13
  } from "./chunk-ZVVMGPBJ.js";
@@ -2,10 +2,10 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  unit
5
- } from "./chunk-DQIBGCF3.js";
5
+ } from "./chunk-Z5NL6YNU.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-IOJ2DTCY.js";
8
+ } from "./chunk-WDWP5N6M.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
@@ -7,11 +7,11 @@ import {
7
7
  describeOptions,
8
8
  keyForCommand,
9
9
  metaOf
10
- } from "./chunk-RJ7AS7UB.js";
10
+ } from "./chunk-HTYLT6ME.js";
11
11
  import {
12
12
  CliError,
13
13
  jsonSchemaOf
14
- } from "./chunk-IOJ2DTCY.js";
14
+ } from "./chunk-WDWP5N6M.js";
15
15
  import {
16
16
  __name
17
17
  } from "./chunk-ZVVMGPBJ.js";
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-IOJ2DTCY.js";
5
+ } from "./chunk-WDWP5N6M.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
@@ -2,10 +2,10 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  wirecatDirectory
5
- } from "./chunk-62JRF2JA.js";
5
+ } from "./chunk-6WOJIAYA.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-IOJ2DTCY.js";
8
+ } from "./chunk-WDWP5N6M.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
@@ -7,7 +7,7 @@ import {
7
7
  commandPathOf,
8
8
  findCommand,
9
9
  outputOf
10
- } from "./chunk-BM5ZCDPQ.js";
10
+ } from "./chunk-MEXT6XDP.js";
11
11
  import {
12
12
  Command,
13
13
  Help,
@@ -18,11 +18,11 @@ import {
18
18
  environmentOf,
19
19
  metaOf,
20
20
  takesProfile
21
- } from "./chunk-RJ7AS7UB.js";
21
+ } from "./chunk-HTYLT6ME.js";
22
22
  import {
23
23
  CliError,
24
24
  writes
25
- } from "./chunk-IOJ2DTCY.js";
25
+ } from "./chunk-WDWP5N6M.js";
26
26
  import {
27
27
  __name
28
28
  } from "./chunk-ZVVMGPBJ.js";