@wirecat/cli-memo 0.131.75 → 0.131.77

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 (224) hide show
  1. package/dist/actions/actions.d.ts +1 -0
  2. package/dist/actions/actions.d.ts.map +1 -1
  3. package/dist/actions/actions.js +3 -3
  4. package/dist/actions/actions.js.map +1 -1
  5. package/dist/actions/command.d.ts.map +1 -1
  6. package/dist/actions/command.js +3 -1
  7. package/dist/actions/command.js.map +1 -1
  8. package/dist/agents/command.d.ts.map +1 -1
  9. package/dist/agents/command.js +3 -2
  10. package/dist/agents/command.js.map +1 -1
  11. package/dist/agents/log.d.ts +1 -1
  12. package/dist/agents/log.d.ts.map +1 -1
  13. package/dist/agents/log.js +5 -4
  14. package/dist/agents/log.js.map +1 -1
  15. package/dist/bin/memo.js +2 -2
  16. package/dist/bin/memo.js.map +1 -1
  17. package/dist/bundle/{all-profiles-LUGN5BHP.js → all-profiles-4UWCPMRQ.js} +10 -8
  18. package/dist/bundle/{anthropic-W7JXDZPL.js → anthropic-HECHQVOK.js} +7 -5
  19. package/dist/bundle/{app-server-TRRARE66.js → app-server-GQEQWFYQ.js} +42 -40
  20. package/dist/bundle/auto-3O7JD27U.js +91 -0
  21. package/dist/bundle/{bun-S3JZIN4S.js → bun-IWGIAD7H.js} +2 -2
  22. package/dist/bundle/{bun-sqlite-X3WQN3CV.js → bun-sqlite-VJFM4TVN.js} +7 -5
  23. package/dist/bundle/{chunk-KDBAY5JZ.js → chunk-2DLCQ4AK.js} +1 -1
  24. package/dist/bundle/{chunk-W46O6RJ5.js → chunk-2IQWMWMC.js} +42 -130
  25. package/dist/bundle/{chunk-4O2MYFYC.js → chunk-3EPBPSP6.js} +1 -1
  26. package/dist/bundle/{chunk-KEBL3PY4.js → chunk-3QBRLN6T.js} +2 -2
  27. package/dist/bundle/{chunk-V7BDQIZS.js → chunk-3URQNBDV.js} +2 -2
  28. package/dist/bundle/{chunk-UU3OAPGO.js → chunk-4EFQOTNQ.js} +7 -7
  29. package/dist/bundle/{chunk-RZS24U4N.js → chunk-4VO2RJAE.js} +12 -10
  30. package/dist/bundle/{chunk-WKLF7CAM.js → chunk-5APYWW46.js} +34 -32
  31. package/dist/bundle/{chunk-VYCLOFPC.js → chunk-6A37YXAL.js} +6 -184
  32. package/dist/bundle/{chunk-346PWQJF.js → chunk-6RN34ZWU.js} +6 -6
  33. package/dist/bundle/{chunk-WZHCQ4VZ.js → chunk-6VISMU6R.js} +8 -8
  34. package/dist/bundle/{chunk-ZP2XI5DR.js → chunk-76T57Y3Q.js} +6 -6
  35. package/dist/bundle/{chunk-FGMFJUHR.js → chunk-7YALAAL4.js} +734 -374
  36. package/dist/bundle/{chunk-KA5MDFLU.js → chunk-A3QZXQI3.js} +1 -1
  37. package/dist/bundle/{chunk-4XI7S3PO.js → chunk-A54EZ6DV.js} +15 -15
  38. package/dist/bundle/{chunk-5RLCKP5E.js → chunk-AH6V2UJZ.js} +22 -18
  39. package/dist/bundle/{chunk-2EZFUIL4.js → chunk-BA6GHX5B.js} +27 -27
  40. package/dist/bundle/{chunk-E74VWHZ2.js → chunk-BFEXVALS.js} +1 -1
  41. package/dist/bundle/{chunk-XPSXVUZG.js → chunk-BNOSAHVH.js} +3 -3
  42. package/dist/bundle/{chunk-ZXW5FPH2.js → chunk-C3HS26N5.js} +1 -1
  43. package/dist/bundle/{chunk-VFKCZJFT.js → chunk-CFZZUGUD.js} +22 -22
  44. package/dist/bundle/{chunk-KYJBGCTC.js → chunk-CPKS7JKX.js} +2 -2
  45. package/dist/bundle/{chunk-7Y4HUYI3.js → chunk-D7KQYLAN.js} +8 -8
  46. package/dist/bundle/{chunk-LX3OSTBD.js → chunk-DE5BNDIA.js} +4 -4
  47. package/dist/bundle/{chunk-SJD4KTK2.js → chunk-DJYMK7EI.js} +4 -4
  48. package/dist/bundle/{chunk-EWRHTZD3.js → chunk-DNPE4LOZ.js} +11 -11
  49. package/dist/bundle/chunk-EXFRC4OT.js +106 -0
  50. package/dist/bundle/{chunk-XMHWGHID.js → chunk-EY46RMMS.js} +183 -158
  51. package/dist/bundle/{chunk-UIAGASGP.js → chunk-HFZHXP4U.js} +6 -6
  52. package/dist/bundle/{chunk-QYJJBE56.js → chunk-HKDUGTWQ.js} +3 -3
  53. package/dist/bundle/{chunk-VB4OLJHK.js → chunk-HWIKY7KF.js} +3 -3
  54. package/dist/bundle/{chunk-2QND7VJS.js → chunk-INXIJXU2.js} +7 -7
  55. package/dist/bundle/{chunk-OWUEEVF6.js → chunk-IYINNZQE.js} +13 -12
  56. package/dist/bundle/{chunk-YLYZNPAZ.js → chunk-JKLJM7EG.js} +2 -2
  57. package/dist/bundle/{chunk-6VMIMAZ2.js → chunk-JSGRDE5Q.js} +302 -298
  58. package/dist/bundle/{chunk-G45BLLDR.js → chunk-JTLPFUIQ.js} +4 -4
  59. package/dist/bundle/{chunk-4QGUBKN5.js → chunk-KTBPBMNR.js} +6 -6
  60. package/dist/bundle/{chunk-ZTZLAGZA.js → chunk-KYW7RWGE.js} +3 -3
  61. package/dist/bundle/{chunk-6I4DOBSD.js → chunk-LHVNZ25W.js} +13 -13
  62. package/dist/bundle/{chunk-SIQDO5DN.js → chunk-LO74ISD6.js} +4 -4
  63. package/dist/bundle/{chunk-XQ3RZU3J.js → chunk-M4MM4QUM.js} +1 -1
  64. package/dist/bundle/{chunk-6AOPUQTC.js → chunk-MRUE3BWX.js} +1 -1
  65. package/dist/bundle/{chunk-QKWM4VK4.js → chunk-MZHH5XMX.js} +2 -2
  66. package/dist/bundle/{chunk-SCYHDYLI.js → chunk-NGWUFB4K.js} +1 -1
  67. package/dist/bundle/{chunk-NR633L2N.js → chunk-OAWNQZ3V.js} +4 -4
  68. package/dist/bundle/{chunk-SIOPF2UG.js → chunk-OB3OPV55.js} +6 -6
  69. package/dist/bundle/{chunk-E2PSOSTN.js → chunk-OQSIFLZS.js} +2 -2
  70. package/dist/bundle/{chunk-4KDORB7C.js → chunk-PPARTGFE.js} +10 -10
  71. package/dist/bundle/{chunk-YB4KGUXY.js → chunk-QNJ6O6J4.js} +3 -3
  72. package/dist/bundle/{chunk-GFVSZY4J.js → chunk-S5T4SO7I.js} +8 -2
  73. package/dist/bundle/{chunk-YDTGYYOR.js → chunk-SHO3T3F2.js} +4 -4
  74. package/dist/bundle/{chunk-6FTZ53TT.js → chunk-TFXKS2WG.js} +1 -1
  75. package/dist/bundle/{chunk-5CTOWPOL.js → chunk-TIHQFMH2.js} +12 -10
  76. package/dist/bundle/{chunk-XQHOMQNZ.js → chunk-TXXKLYJQ.js} +4 -4
  77. package/dist/bundle/{chunk-ZISVFVQU.js → chunk-UD5JUJES.js} +365 -364
  78. package/dist/bundle/{chunk-KUFOM3SB.js → chunk-UDRKGCDS.js} +2 -2
  79. package/dist/bundle/chunk-UIS44ZMF.js +185 -0
  80. package/dist/bundle/{chunk-AOHT5FNX.js → chunk-VIY77EDM.js} +48 -48
  81. package/dist/bundle/{chunk-MPZBV5RL.js → chunk-VMTTWF2M.js} +8 -8
  82. package/dist/bundle/{chunk-IQIM4UC7.js → chunk-W36BMC6F.js} +5 -5
  83. package/dist/bundle/{chunk-JINEHQ2T.js → chunk-WZZ426CJ.js} +99 -84
  84. package/dist/bundle/chunk-X2SA73EE.js +200 -0
  85. package/dist/bundle/{chunk-BDVM5652.js → chunk-XLZPP5MB.js} +1 -1
  86. package/dist/bundle/{chunk-LPGE6ACC.js → chunk-YABNPKKQ.js} +2 -2
  87. package/dist/bundle/{chunk-ZL63GL3Y.js → chunk-YZ4J67GU.js} +3 -3
  88. package/dist/bundle/{chunk-C6MWOBEL.js → chunk-ZPB3VTS7.js} +22 -12
  89. package/dist/bundle/{chunk-W64FO6DD.js → chunk-ZPPMGXER.js} +400 -37
  90. package/dist/bundle/command-contract-SEDOYJIJ.js +34 -0
  91. package/dist/bundle/{command-server-entry-XVUPTSSH.js → command-server-entry-TQBKNSM3.js} +71 -53
  92. package/dist/bundle/{decode-METZOSMG.js → decode-VFRSEIBD.js} +7 -5
  93. package/dist/bundle/{dispatch-PHB2Y6ZL.js → dispatch-N73TJNYM.js} +3 -3
  94. package/dist/bundle/{echarts-EBSP4VCK.js → echarts-DP2GC2C6.js} +2 -2
  95. package/dist/bundle/{embed-GVVU7N7W.js → embed-BIINGRNY.js} +8 -6
  96. package/dist/bundle/{embedder-6BZOYAXV.js → embedder-2AUO2PHQ.js} +11 -9
  97. package/dist/bundle/entry-APUFP74B.js +23 -0
  98. package/dist/bundle/entry-LGJ2Y7AS.js +78 -0
  99. package/dist/bundle/failure-5QSMH2CD.js +71 -0
  100. package/dist/bundle/{failure-OBT7CUVW.js → failure-IPHFR3KW.js} +3 -2
  101. package/dist/bundle/{first-run-HQ4GA4EF.js → first-run-7UMKRQL7.js} +11 -9
  102. package/dist/bundle/first-screen-H5CQSLIX.js +32 -0
  103. package/dist/bundle/{instructions-VDKK3Y5Z.js → instructions-WDKCHEG6.js} +1 -1
  104. package/dist/bundle/mcp-3HKOGYHL.js +92 -0
  105. package/dist/bundle/memo.js +9 -56
  106. package/dist/bundle/{node-HWGZYNUX.js → node-QBL3F2VF.js} +2 -2
  107. package/dist/bundle/{node-sqlite-PSYENWGS.js → node-sqlite-WFKC73E5.js} +8 -6
  108. package/dist/bundle/{oauth-TQGMUJK2.js → oauth-4PT7N4SE.js} +9 -7
  109. package/dist/bundle/{open-KDDJDKCE.js → open-I7XENSGI.js} +7 -5
  110. package/dist/bundle/openai-DUSBTUFI.js +26 -0
  111. package/dist/bundle/{process-APNTXJJE.js → process-TVXEHAK6.js} +1 -1
  112. package/dist/bundle/{program-OGDARQTX.js → program-3X4EPBEW.js} +587 -234
  113. package/dist/bundle/{prompt-BMBZCLGF.js → prompt-QRYXTON7.js} +7 -5
  114. package/dist/bundle/{recognize-3SEY2MAR.js → recognize-ZLDPIN36.js} +6 -4
  115. package/dist/bundle/{remote-ODH54UXO.js → remote-3GRP5YE3.js} +9 -7
  116. package/dist/bundle/{rerank-JQHBNTUK.js → rerank-6B2FI6LN.js} +9 -7
  117. package/dist/bundle/serve-ZP3TEANT.js +24 -0
  118. package/dist/bundle/{server-ADPO4V4B.js → server-3SJJNNSX.js} +63 -59
  119. package/dist/bundle/server-72VZYABL.js +50 -0
  120. package/dist/bundle/server-UY47EXPQ.js +64 -0
  121. package/dist/bundle/{state-M3VGXSV4.js → state-JDH2X2CY.js} +8 -6
  122. package/dist/bundle/{store-GSZAXU3A.js → store-FDNYGJUF.js} +14 -12
  123. package/dist/bundle/store-maintenance-command-5LFS45JM.js +49 -0
  124. package/dist/bundle/update-257J2SPM.js +74 -0
  125. package/dist/digest/backfill.d.ts.map +1 -1
  126. package/dist/digest/backfill.js +2 -1
  127. package/dist/digest/backfill.js.map +1 -1
  128. package/dist/digest/digest-commands.d.ts.map +1 -1
  129. package/dist/digest/digest-commands.js +2 -1
  130. package/dist/digest/digest-commands.js.map +1 -1
  131. package/dist/doctor/command.d.ts.map +1 -1
  132. package/dist/doctor/command.js +2 -1
  133. package/dist/doctor/command.js.map +1 -1
  134. package/dist/examples.d.ts.map +1 -1
  135. package/dist/examples.js +13 -1
  136. package/dist/examples.js.map +1 -1
  137. package/dist/exit-code.d.ts +7 -0
  138. package/dist/exit-code.d.ts.map +1 -0
  139. package/dist/exit-code.js +19 -0
  140. package/dist/exit-code.js.map +1 -0
  141. package/dist/facts/command.d.ts.map +1 -1
  142. package/dist/facts/command.js +3 -2
  143. package/dist/facts/command.js.map +1 -1
  144. package/dist/facts/fact.d.ts +1 -1
  145. package/dist/facts/fact.d.ts.map +1 -1
  146. package/dist/facts/fact.js +3 -3
  147. package/dist/facts/fact.js.map +1 -1
  148. package/dist/mcp/catalogue.d.ts +3 -0
  149. package/dist/mcp/catalogue.d.ts.map +1 -1
  150. package/dist/mcp/catalogue.js +1 -0
  151. package/dist/mcp/catalogue.js.map +1 -1
  152. package/dist/memories/command.d.ts.map +1 -1
  153. package/dist/memories/command.js +3 -2
  154. package/dist/memories/command.js.map +1 -1
  155. package/dist/memories/memory.d.ts +1 -1
  156. package/dist/memories/memory.d.ts.map +1 -1
  157. package/dist/memories/memory.js +2 -2
  158. package/dist/memories/memory.js.map +1 -1
  159. package/dist/page.d.ts +14 -5
  160. package/dist/page.d.ts.map +1 -1
  161. package/dist/page.js +11 -5
  162. package/dist/page.js.map +1 -1
  163. package/dist/program.d.ts +3 -1
  164. package/dist/program.d.ts.map +1 -1
  165. package/dist/program.js +7 -1
  166. package/dist/program.js.map +1 -1
  167. package/dist/reasons.d.ts.map +1 -1
  168. package/dist/reasons.js +6 -0
  169. package/dist/reasons.js.map +1 -1
  170. package/dist/records/import.d.ts.map +1 -1
  171. package/dist/records/import.js +60 -5
  172. package/dist/records/import.js.map +1 -1
  173. package/dist/records/input.d.ts +6 -2
  174. package/dist/records/input.d.ts.map +1 -1
  175. package/dist/records/input.js +87 -3
  176. package/dist/records/input.js.map +1 -1
  177. package/dist/run/entry.d.ts +7 -0
  178. package/dist/run/entry.d.ts.map +1 -0
  179. package/dist/run/entry.js +62 -0
  180. package/dist/run/entry.js.map +1 -0
  181. package/dist/run/import.d.ts.map +1 -1
  182. package/dist/run/import.js +2 -1
  183. package/dist/run/import.js.map +1 -1
  184. package/dist/sources/command.d.ts.map +1 -1
  185. package/dist/sources/command.js +55 -4
  186. package/dist/sources/command.js.map +1 -1
  187. package/dist/sources/read.d.ts +29 -2
  188. package/dist/sources/read.d.ts.map +1 -1
  189. package/dist/sources/read.js +67 -5
  190. package/dist/sources/read.js.map +1 -1
  191. package/dist/sources/readers/ai-model.d.ts +4 -0
  192. package/dist/sources/readers/ai-model.d.ts.map +1 -0
  193. package/dist/sources/readers/ai-model.js +74 -0
  194. package/dist/sources/readers/ai-model.js.map +1 -0
  195. package/dist/sources/readers/index.d.ts +1 -0
  196. package/dist/sources/readers/index.d.ts.map +1 -1
  197. package/dist/sources/readers/index.js +3 -1
  198. package/dist/sources/readers/index.js.map +1 -1
  199. package/dist/sources/readers/keys.js +1 -1
  200. package/dist/sources/readers/keys.js.map +1 -1
  201. package/dist/sources/readers/types.d.ts +5 -2
  202. package/dist/sources/readers/types.d.ts.map +1 -1
  203. package/dist/sources/readers/types.js +1 -1
  204. package/dist/sources/readers/types.js.map +1 -1
  205. package/dist/sources/suggest-command.d.ts.map +1 -1
  206. package/dist/sources/suggest-command.js +16 -5
  207. package/dist/sources/suggest-command.js.map +1 -1
  208. package/dist/version.d.ts +1 -1
  209. package/dist/version.js +1 -1
  210. package/package.json +2 -2
  211. package/dist/bundle/auto-AQAKW55Z.js +0 -89
  212. package/dist/bundle/chunk-XPCTY6XV.js +0 -116
  213. package/dist/bundle/command-contract-QQG343ZQ.js +0 -32
  214. package/dist/bundle/entry-TBOYUMWB.js +0 -21
  215. package/dist/bundle/failure-EKMEAYZH.js +0 -69
  216. package/dist/bundle/first-screen-6T65PQ37.js +0 -30
  217. package/dist/bundle/mcp-DEY765VA.js +0 -90
  218. package/dist/bundle/openai-QPGCUM4T.js +0 -24
  219. package/dist/bundle/serve-C22ZONSM.js +0 -22
  220. package/dist/bundle/server-3UX245DY.js +0 -62
  221. package/dist/bundle/server-6G5XF3V5.js +0 -48
  222. package/dist/bundle/store-maintenance-command-QMTALGSQ.js +0 -47
  223. package/dist/bundle/update-HDJ23IV5.js +0 -72
  224. /package/dist/bundle/{chunk-IXSUVHW6.js → chunk-6AALVDEA.js} +0 -0
@@ -2,11 +2,11 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  updateCommand
5
- } from "./chunk-KEBL3PY4.js";
5
+ } from "./chunk-3QBRLN6T.js";
6
6
  import {
7
7
  DEFAULT_STEMMERS,
8
8
  LANGUAGES
9
- } from "./chunk-MPZBV5RL.js";
9
+ } from "./chunk-VMTTWF2M.js";
10
10
  import {
11
11
  installerOf
12
12
  } from "./chunk-NT5IOEEK.js";
@@ -15,18 +15,18 @@ import {
15
15
  readSetupAnswers,
16
16
  unanswered,
17
17
  writeSetupAnswers
18
- } from "./chunk-XQHOMQNZ.js";
18
+ } from "./chunk-TXXKLYJQ.js";
19
19
  import {
20
20
  sharedConfigPath
21
- } from "./chunk-4QGUBKN5.js";
21
+ } from "./chunk-KTBPBMNR.js";
22
22
  import {
23
23
  storePath
24
- } from "./chunk-LPGE6ACC.js";
24
+ } from "./chunk-YABNPKKQ.js";
25
25
  import {
26
26
  __name
27
27
  } from "./chunk-ZVVMGPBJ.js";
28
28
 
29
- // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_845871b12d72ec55150c07203d8cbfbb/node_modules/@wirecat/cli-core/dist/cli/first-run.js
29
+ // node_modules/.pnpm/@wirecat+cli-core@0.628.0_@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_type_ae6a34897f184099b1a87c0d4b483e54/node_modules/@wirecat/cli-core/dist/cli/first-run.js
30
30
  import { spawnSync } from "node:child_process";
31
31
  import { accessSync, constants, realpathSync } from "node:fs";
32
32
  import { delimiter, join } from "node:path";
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
84
84
  return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
85
85
  }, "suggested");
86
86
  var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
87
- const { openStore } = await import("./store-GSZAXU3A.js");
87
+ const { openStore } = await import("./store-FDNYGJUF.js");
88
88
  const store = await openStore({ env });
89
89
  let rebuild = false;
90
90
  try {
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
113
113
  if (!rebuild)
114
114
  return;
115
115
  const [{ openCache }, { buildStems }] = await Promise.all([
116
- import("./open-KDDJDKCE.js"),
117
- import("./store-maintenance-command-QMTALGSQ.js")
116
+ import("./open-I7XENSGI.js"),
117
+ import("./store-maintenance-command-5LFS45JM.js")
118
118
  ]);
119
119
  const database = await openCache(storePath(env));
120
120
  try {
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
126
126
  var askTools = /* @__PURE__ */ __name(async (run) => {
127
127
  const { command, env, io } = run;
128
128
  const installed = run.installed ?? ((name) => onPath(name, env));
129
- const { WIRECAT_TOOLS } = await import("./first-screen-6T65PQ37.js");
129
+ const { WIRECAT_TOOLS } = await import("./first-screen-H5CQSLIX.js");
130
130
  const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
131
131
  const missing = others.filter((tool) => !installed(tool.command));
132
132
  io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
@@ -199,7 +199,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
199
199
  contentLanguages: start.contentLanguages,
200
200
  all: start.path[0] === "setup",
201
201
  io: {
202
- ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-BMBZCLGF.js")).readSecret(prompt, { input, echo: true }), "ask"),
202
+ ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-QRYXTON7.js")).readSecret(prompt, { input, echo: true }), "ask"),
203
203
  say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
204
204
  `), "say")
205
205
  }
@@ -0,0 +1,106 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ array,
5
+ dottedId,
6
+ duplicates,
7
+ isoTime,
8
+ optional,
9
+ parseRegistry,
10
+ picklist,
11
+ pipe,
12
+ record,
13
+ regex,
14
+ strictObject,
15
+ string,
16
+ text,
17
+ unknown
18
+ } from "./chunk-6A37YXAL.js";
19
+ import {
20
+ __name
21
+ } from "./chunk-ZVVMGPBJ.js";
22
+
23
+ // node_modules/.pnpm/@wirecat+cli-base@0.95.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/log.js
24
+ var LOG_SEVERITIES = ["trace", "debug", "info", "warn", "error", "fatal"];
25
+ var logRecordSchema = strictObject({
26
+ time: isoTime,
27
+ severity: picklist(LOG_SEVERITIES),
28
+ /** The registered event id, `provider.request.failed`: never a sentence, so never content. */
29
+ body: string(),
30
+ run_id: text,
31
+ /** From an MCP caller's `_meta.traceparent`, when it sent one. */
32
+ trace_id: optional(pipe(string(), regex(/^[0-9a-f]{32}$/, "32 lower-case hex digits"))),
33
+ command: string(),
34
+ attributes: record(string(), unknown()),
35
+ resource: strictObject({ service: text, version: text })
36
+ });
37
+ var logEventSchema = strictObject({
38
+ id: dottedId,
39
+ meaning: text,
40
+ /** Attribute keys every record of this event carries. */
41
+ keys: array(string())
42
+ });
43
+ var defineLogEvents = /* @__PURE__ */ __name((input) => parseRegistry("log events", array(logEventSchema), input, (events) => [
44
+ ...duplicates(events.map((event) => event.id)).map((id) => `"${id}" is listed twice`),
45
+ ...events.flatMap((event) => duplicates(event.keys).map((key) => `${event.id}: key "${key}" is listed twice`))
46
+ ]), "defineLogEvents");
47
+ var LOG_EVENTS = defineLogEvents([
48
+ { id: "command.failed", meaning: "a command ended with an error", keys: ["code", "reason"] }
49
+ ]);
50
+ var LOG_ATTRIBUTE_KEYS = [
51
+ "code",
52
+ "count",
53
+ "durationMs",
54
+ "errorClass",
55
+ "errorCode",
56
+ "event",
57
+ "frames",
58
+ "operation",
59
+ "outcome",
60
+ "reason",
61
+ "status"
62
+ ];
63
+ var CONTENT_WORDS = /* @__PURE__ */ new Set([
64
+ "authorization",
65
+ "body",
66
+ "caption",
67
+ "content",
68
+ "cookie",
69
+ "credential",
70
+ "credentials",
71
+ "email",
72
+ "password",
73
+ "phone",
74
+ "query",
75
+ "secret",
76
+ "text",
77
+ "title",
78
+ "token"
79
+ ]);
80
+ var CONTENT_LAST_WORDS = /* @__PURE__ */ new Set(["message", "name"]);
81
+ var wordsOf = /* @__PURE__ */ __name((key) => key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).filter(Boolean).map((word) => word.toLowerCase()), "wordsOf");
82
+ var isContentKey = /* @__PURE__ */ __name((key) => {
83
+ const words = wordsOf(key);
84
+ return words.some((word) => CONTENT_WORDS.has(word)) || CONTENT_LAST_WORDS.has(words.at(-1) ?? "");
85
+ }, "isContentKey");
86
+ var TRACEPARENT = /^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/;
87
+ var traceIdOf = /* @__PURE__ */ __name((traceparent) => {
88
+ if (typeof traceparent !== "string")
89
+ return void 0;
90
+ const match = TRACEPARENT.exec(traceparent.trim());
91
+ if (!match)
92
+ return void 0;
93
+ const [, version, traceId = "", parentId = "", , rest] = match;
94
+ if (version === "ff" || version === "00" && rest !== void 0)
95
+ return void 0;
96
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentId))
97
+ return void 0;
98
+ return traceId;
99
+ }, "traceIdOf");
100
+
101
+ export {
102
+ defineLogEvents,
103
+ LOG_ATTRIBUTE_KEYS,
104
+ isContentKey,
105
+ traceIdOf
106
+ };