@wirecat/amo-cli 0.6.0 → 0.7.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 (282) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -2
  3. package/contracts/wirecat.json +14 -0
  4. package/dist/amo/button.js +1 -1
  5. package/dist/amo/json.js +1 -1
  6. package/dist/amo/oauth.js +1 -2
  7. package/dist/amo/transport.js +1 -2
  8. package/dist/api-keys.js +1 -1
  9. package/dist/bin/amo.js +11 -11
  10. package/dist/bundle/amo.js +5 -183
  11. package/dist/bundle/{chunk-FYOPPKAN.js → chunk-3HWD4BKU.js} +4 -6
  12. package/dist/bundle/{chunk-GOCMJBEE.js → chunk-4EXURQQQ.js} +21 -19
  13. package/dist/bundle/chunk-AEWYRB6F.js +8 -0
  14. package/dist/bundle/{chunk-SWCJM3YD.js → chunk-GL7CRTHR.js} +3 -3
  15. package/dist/bundle/chunk-N2UB32VN.js +76 -0
  16. package/dist/bundle/{chunk-RNWUCAJJ.js → chunk-PVVSHDMQ.js} +7 -15
  17. package/dist/bundle/program-SQH3SPOW.js +2352 -0
  18. package/dist/bundle/{instructions-4H7UREH2.js → source-C65ZJUTW.js} +5 -6
  19. package/dist/bundle/store-SJ2TOUGU.js +12 -0
  20. package/dist/bundle/writer-I7GBI3VE.js +12 -0
  21. package/dist/commands/account.js +1 -1
  22. package/dist/commands/api.js +1 -3
  23. package/dist/commands/crm-shared.js +2 -3
  24. package/dist/commands/schedule.js +1 -1
  25. package/dist/commands/session.js +1 -3
  26. package/dist/commands/write.js +1 -2
  27. package/dist/config.js +1 -2
  28. package/dist/context.js +1 -2
  29. package/dist/crm/activities.js +1 -1
  30. package/dist/crm/records.js +1 -1
  31. package/dist/crm/source.js +1 -1
  32. package/dist/crm/writer.js +1 -1
  33. package/dist/identity.js +4 -0
  34. package/dist/program.js +1 -2
  35. package/dist/setup/flow.js +1 -1
  36. package/dist/store.js +1 -1
  37. package/dist/version.js +1 -1
  38. package/dist/whoami.js +1 -1
  39. package/package.json +3 -3
  40. package/scenarios/first-sync.md +13 -11
  41. package/scenarios/keep-in-sync.md +7 -6
  42. package/scenarios/safe-agent-writes.md +10 -9
  43. package/dist/amo/account.d.ts +0 -18
  44. package/dist/amo/account.d.ts.map +0 -1
  45. package/dist/amo/account.js.map +0 -1
  46. package/dist/amo/allow-list.d.ts +0 -31
  47. package/dist/amo/allow-list.d.ts.map +0 -1
  48. package/dist/amo/allow-list.js.map +0 -1
  49. package/dist/amo/button.d.ts +0 -53
  50. package/dist/amo/button.d.ts.map +0 -1
  51. package/dist/amo/button.js.map +0 -1
  52. package/dist/amo/errors.d.ts +0 -12
  53. package/dist/amo/errors.d.ts.map +0 -1
  54. package/dist/amo/errors.js.map +0 -1
  55. package/dist/amo/json.d.ts +0 -3
  56. package/dist/amo/json.d.ts.map +0 -1
  57. package/dist/amo/json.js.map +0 -1
  58. package/dist/amo/oauth.d.ts +0 -64
  59. package/dist/amo/oauth.d.ts.map +0 -1
  60. package/dist/amo/oauth.js.map +0 -1
  61. package/dist/amo/operation.d.ts +0 -45
  62. package/dist/amo/operation.d.ts.map +0 -1
  63. package/dist/amo/operation.js.map +0 -1
  64. package/dist/amo/operations.d.ts +0 -3
  65. package/dist/amo/operations.d.ts.map +0 -1
  66. package/dist/amo/operations.js.map +0 -1
  67. package/dist/amo/routes.d.ts +0 -67
  68. package/dist/amo/routes.d.ts.map +0 -1
  69. package/dist/amo/routes.js.map +0 -1
  70. package/dist/amo/transport.d.ts +0 -62
  71. package/dist/amo/transport.d.ts.map +0 -1
  72. package/dist/amo/transport.js.map +0 -1
  73. package/dist/api-keys.d.ts +0 -47
  74. package/dist/api-keys.d.ts.map +0 -1
  75. package/dist/api-keys.js.map +0 -1
  76. package/dist/bin/amo.d.ts +0 -3
  77. package/dist/bin/amo.d.ts.map +0 -1
  78. package/dist/bin/amo.js.map +0 -1
  79. package/dist/bundle/agent-VVACEKSX.js +0 -42
  80. package/dist/bundle/all-profiles-QNUKL4NA.js +0 -320
  81. package/dist/bundle/anthropic-PQN6MNP7.js +0 -90
  82. package/dist/bundle/app-server-Q2QEA7GP.js +0 -258
  83. package/dist/bundle/areas-27FRPBF3.js +0 -71
  84. package/dist/bundle/bun-F4M4KCNA.js +0 -169
  85. package/dist/bundle/bun-sqlite-P5IDBDVR.js +0 -75
  86. package/dist/bundle/chunk-22KAQPX7.js +0 -58
  87. package/dist/bundle/chunk-2JGNMZ55.js +0 -338
  88. package/dist/bundle/chunk-2VDHC7QO.js +0 -288
  89. package/dist/bundle/chunk-34ZOMVUK.js +0 -185
  90. package/dist/bundle/chunk-3J3EDSXF.js +0 -1939
  91. package/dist/bundle/chunk-3TYER5IK.js +0 -80
  92. package/dist/bundle/chunk-5NGLCDYQ.js +0 -106
  93. package/dist/bundle/chunk-5SQTHOBI.js +0 -12313
  94. package/dist/bundle/chunk-6GE36KUE.js +0 -360
  95. package/dist/bundle/chunk-6GZKY3HV.js +0 -3752
  96. package/dist/bundle/chunk-6OV2TRGF.js +0 -362
  97. package/dist/bundle/chunk-7CPIZFOE.js +0 -460
  98. package/dist/bundle/chunk-A5K2NU3K.js +0 -37780
  99. package/dist/bundle/chunk-ADLS6FVG.js +0 -24600
  100. package/dist/bundle/chunk-AEC4H5WZ.js +0 -259
  101. package/dist/bundle/chunk-APBEDWOE.js +0 -1718
  102. package/dist/bundle/chunk-AQ5RIOUE.js +0 -633
  103. package/dist/bundle/chunk-B7L5MSRP.js +0 -136
  104. package/dist/bundle/chunk-C7JPYWYQ.js +0 -77
  105. package/dist/bundle/chunk-D72URWJE.js +0 -532
  106. package/dist/bundle/chunk-DFDN6AUB.js +0 -21
  107. package/dist/bundle/chunk-DIZEHPS6.js +0 -1347
  108. package/dist/bundle/chunk-DNCLQPOM.js +0 -7
  109. package/dist/bundle/chunk-DPV53EZC.js +0 -206
  110. package/dist/bundle/chunk-DUPCDJ3W.js +0 -357
  111. package/dist/bundle/chunk-DWT24UVR.js +0 -388
  112. package/dist/bundle/chunk-DXWJORSY.js +0 -1703
  113. package/dist/bundle/chunk-DY3PLWIH.js +0 -332
  114. package/dist/bundle/chunk-DYWHAJRK.js +0 -1259
  115. package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
  116. package/dist/bundle/chunk-EXRM3ML4.js +0 -76
  117. package/dist/bundle/chunk-FFER7KJI.js +0 -407
  118. package/dist/bundle/chunk-FIP2DG7W.js +0 -64
  119. package/dist/bundle/chunk-FTH6WGYO.js +0 -24
  120. package/dist/bundle/chunk-FWRLGIF6.js +0 -5304
  121. package/dist/bundle/chunk-G3N2RHGF.js +0 -738
  122. package/dist/bundle/chunk-G46PNDWL.js +0 -58
  123. package/dist/bundle/chunk-G6NY7LFB.js +0 -230
  124. package/dist/bundle/chunk-GRGCZSES.js +0 -1007
  125. package/dist/bundle/chunk-GVSKLZRD.js +0 -30
  126. package/dist/bundle/chunk-GZ7WBU5Y.js +0 -18
  127. package/dist/bundle/chunk-HN2LCLGT.js +0 -1068
  128. package/dist/bundle/chunk-HO4JGD4Q.js +0 -16
  129. package/dist/bundle/chunk-HOF7GQWW.js +0 -142
  130. package/dist/bundle/chunk-HUAHLO6N.js +0 -29
  131. package/dist/bundle/chunk-IDCZ4LWS.js +0 -150
  132. package/dist/bundle/chunk-IN3VL7UU.js +0 -560
  133. package/dist/bundle/chunk-ISQ23VKV.js +0 -123
  134. package/dist/bundle/chunk-JVBCQHCS.js +0 -80
  135. package/dist/bundle/chunk-K5W7YEHB.js +0 -9541
  136. package/dist/bundle/chunk-KAFSS35C.js +0 -193
  137. package/dist/bundle/chunk-KLRCTMES.js +0 -100
  138. package/dist/bundle/chunk-KYRYD4CR.js +0 -38
  139. package/dist/bundle/chunk-LBZSURLL.js +0 -798
  140. package/dist/bundle/chunk-LC7ZD2RW.js +0 -92
  141. package/dist/bundle/chunk-LH6FJYMO.js +0 -334
  142. package/dist/bundle/chunk-LJKINNWC.js +0 -209
  143. package/dist/bundle/chunk-M36XP74N.js +0 -86
  144. package/dist/bundle/chunk-MNPGZCKE.js +0 -361
  145. package/dist/bundle/chunk-MRPMORLH.js +0 -353
  146. package/dist/bundle/chunk-NNREILWP.js +0 -189
  147. package/dist/bundle/chunk-NSOY4FMN.js +0 -159
  148. package/dist/bundle/chunk-OEEWVKJX.js +0 -53
  149. package/dist/bundle/chunk-OGJFDKDL.js +0 -161
  150. package/dist/bundle/chunk-PATZAYFZ.js +0 -453
  151. package/dist/bundle/chunk-PCR6GFNP.js +0 -1171
  152. package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
  153. package/dist/bundle/chunk-Q4MH2O5E.js +0 -108
  154. package/dist/bundle/chunk-QFOP3KUP.js +0 -2603
  155. package/dist/bundle/chunk-QQRJEWKB.js +0 -1197
  156. package/dist/bundle/chunk-S6JG4YUH.js +0 -72
  157. package/dist/bundle/chunk-SDVUGWD7.js +0 -614
  158. package/dist/bundle/chunk-SEFE6PGL.js +0 -218
  159. package/dist/bundle/chunk-SYRDEMQE.js +0 -68141
  160. package/dist/bundle/chunk-SYYQZDHJ.js +0 -95
  161. package/dist/bundle/chunk-T3W4V4A6.js +0 -63
  162. package/dist/bundle/chunk-TCT5D2X2.js +0 -6848
  163. package/dist/bundle/chunk-TES7MB6I.js +0 -82
  164. package/dist/bundle/chunk-TXDR6YSF.js +0 -23
  165. package/dist/bundle/chunk-TY7NDMFY.js +0 -46
  166. package/dist/bundle/chunk-U6XPWCWM.js +0 -133
  167. package/dist/bundle/chunk-UFKC7TIX.js +0 -28404
  168. package/dist/bundle/chunk-UNWF3TH5.js +0 -274
  169. package/dist/bundle/chunk-W3BOR6AT.js +0 -2333
  170. package/dist/bundle/chunk-WIHN3ELW.js +0 -2793
  171. package/dist/bundle/chunk-X76RS6JO.js +0 -1043
  172. package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
  173. package/dist/bundle/chunk-YF3S26TS.js +0 -4172
  174. package/dist/bundle/chunk-ZCQ4H7CA.js +0 -54
  175. package/dist/bundle/chunk-ZOZV32IR.js +0 -170
  176. package/dist/bundle/chunk-ZTKHXDEU.js +0 -52
  177. package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
  178. package/dist/bundle/cli-EAD3WZLR.js +0 -1254
  179. package/dist/bundle/command-contract-SMEJ2ICG.js +0 -40
  180. package/dist/bundle/command-server-entry-YTZP6I4T.js +0 -169
  181. package/dist/bundle/decode-57BE5OBT.js +0 -296
  182. package/dist/bundle/dispatch-56FECRCU.js +0 -411
  183. package/dist/bundle/dist-PAKDDIBT.js +0 -191
  184. package/dist/bundle/dist-T54K3FJV.js +0 -7577
  185. package/dist/bundle/echarts-QMAA7HH5.js +0 -42501
  186. package/dist/bundle/embed-NFGFYUO4.js +0 -37
  187. package/dist/bundle/embedder-SRBOJMXX.js +0 -110
  188. package/dist/bundle/failure-WDSX6H3B.js +0 -24
  189. package/dist/bundle/first-run-HWRUL2GR.js +0 -28
  190. package/dist/bundle/first-screen-ATN4D3FQ.js +0 -41
  191. package/dist/bundle/mcp-5HFPWC3W.js +0 -167
  192. package/dist/bundle/meeting-combined-BGDEHCWY.js +0 -26
  193. package/dist/bundle/meeting-model-WWGVRXPL.js +0 -24
  194. package/dist/bundle/meeting-semantic-ZQ47BL2Z.js +0 -21
  195. package/dist/bundle/node-P3PUHKYH.js +0 -176
  196. package/dist/bundle/node-P4E63KXA.js +0 -2340
  197. package/dist/bundle/node-TLZSIHIJ.js +0 -21
  198. package/dist/bundle/node-sqlite-JOTSNH3P.js +0 -73
  199. package/dist/bundle/oauth-XPSAL6VO.js +0 -19
  200. package/dist/bundle/open-PO52FVA5.js +0 -22
  201. package/dist/bundle/openai-WITYLMY5.js +0 -237
  202. package/dist/bundle/process-AFIXYXWL.js +0 -91
  203. package/dist/bundle/program-JODTZNBZ.js +0 -4920
  204. package/dist/bundle/prompt-XORLAXHY.js +0 -16
  205. package/dist/bundle/recognize-JKMZHDYS.js +0 -25
  206. package/dist/bundle/remote-3IMEJTEH.js +0 -30
  207. package/dist/bundle/rerank-3F2E6NNN.js +0 -51
  208. package/dist/bundle/serve-6BWU3NMB.js +0 -198
  209. package/dist/bundle/server-GPSB5WFG.js +0 -220
  210. package/dist/bundle/server-HMCC64ZU.js +0 -88
  211. package/dist/bundle/source-E72OS27D.js +0 -47
  212. package/dist/bundle/sqlite-runtime-YHYQDUXE.js +0 -19
  213. package/dist/bundle/state-R7W4U6T4.js +0 -35
  214. package/dist/bundle/store-HTVRL7FB.js +0 -312
  215. package/dist/bundle/store-IWW6U6QN.js +0 -34
  216. package/dist/bundle/store-TBZ3ZS6H.js +0 -186
  217. package/dist/bundle/store-maintenance-command-CJM2VLMW.js +0 -75
  218. package/dist/bundle/surface-5GBWNYBE.js +0 -74
  219. package/dist/bundle/writer-TW2Q55VJ.js +0 -49
  220. package/dist/commands/account.d.ts +0 -4
  221. package/dist/commands/account.d.ts.map +0 -1
  222. package/dist/commands/account.js.map +0 -1
  223. package/dist/commands/api.d.ts +0 -3
  224. package/dist/commands/api.d.ts.map +0 -1
  225. package/dist/commands/api.js.map +0 -1
  226. package/dist/commands/crm-shared.d.ts +0 -8
  227. package/dist/commands/crm-shared.d.ts.map +0 -1
  228. package/dist/commands/crm-shared.js.map +0 -1
  229. package/dist/commands/schedule.d.ts +0 -3
  230. package/dist/commands/schedule.d.ts.map +0 -1
  231. package/dist/commands/schedule.js.map +0 -1
  232. package/dist/commands/session.d.ts +0 -35
  233. package/dist/commands/session.d.ts.map +0 -1
  234. package/dist/commands/session.js.map +0 -1
  235. package/dist/commands/write.d.ts +0 -14
  236. package/dist/commands/write.d.ts.map +0 -1
  237. package/dist/commands/write.js.map +0 -1
  238. package/dist/config.d.ts +0 -4
  239. package/dist/config.d.ts.map +0 -1
  240. package/dist/config.js.map +0 -1
  241. package/dist/context.d.ts +0 -62
  242. package/dist/context.d.ts.map +0 -1
  243. package/dist/context.js.map +0 -1
  244. package/dist/crm/activities.d.ts +0 -32
  245. package/dist/crm/activities.d.ts.map +0 -1
  246. package/dist/crm/activities.js.map +0 -1
  247. package/dist/crm/records.d.ts +0 -20
  248. package/dist/crm/records.d.ts.map +0 -1
  249. package/dist/crm/records.js.map +0 -1
  250. package/dist/crm/source.d.ts +0 -41
  251. package/dist/crm/source.d.ts.map +0 -1
  252. package/dist/crm/source.js.map +0 -1
  253. package/dist/crm/writer.d.ts +0 -14
  254. package/dist/crm/writer.d.ts.map +0 -1
  255. package/dist/crm/writer.js.map +0 -1
  256. package/dist/identity.d.ts +0 -7
  257. package/dist/identity.d.ts.map +0 -1
  258. package/dist/identity.js.map +0 -1
  259. package/dist/index.d.ts +0 -3
  260. package/dist/index.d.ts.map +0 -1
  261. package/dist/index.js.map +0 -1
  262. package/dist/program.d.ts +0 -6
  263. package/dist/program.d.ts.map +0 -1
  264. package/dist/program.js.map +0 -1
  265. package/dist/reasons.d.ts +0 -10
  266. package/dist/reasons.d.ts.map +0 -1
  267. package/dist/reasons.js.map +0 -1
  268. package/dist/setup/flow.d.ts +0 -2
  269. package/dist/setup/flow.d.ts.map +0 -1
  270. package/dist/setup/flow.js.map +0 -1
  271. package/dist/store.d.ts +0 -15
  272. package/dist/store.d.ts.map +0 -1
  273. package/dist/store.js.map +0 -1
  274. package/dist/version.d.ts +0 -2
  275. package/dist/version.d.ts.map +0 -1
  276. package/dist/version.js.map +0 -1
  277. package/dist/wcat.d.ts +0 -3
  278. package/dist/wcat.d.ts.map +0 -1
  279. package/dist/wcat.js.map +0 -1
  280. package/dist/whoami.d.ts +0 -24
  281. package/dist/whoami.d.ts.map +0 -1
  282. package/dist/whoami.js.map +0 -1
@@ -1,72 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- __name
5
- } from "./chunk-ZVVMGPBJ.js";
6
-
7
- // node_modules/.pnpm/@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/errors.js
8
- var errorCodes = [
9
- "validation_error",
10
- "configuration_error",
11
- "authentication_error",
12
- "permission_error",
13
- "not_found",
14
- "confirmation_required",
15
- "rate_limited",
16
- "timeout",
17
- "network_error",
18
- "provider_error",
19
- "provider_unavailable",
20
- "invalid_response",
21
- "outcome_unknown",
22
- "conflict",
23
- "cancelled"
24
- ];
25
- var BRAND = /* @__PURE__ */ Symbol.for("@wirecat/cli-base/CliError");
26
- var CliError = class extends Error {
27
- static {
28
- __name(this, "CliError");
29
- }
30
- code;
31
- details;
32
- constructor(code, message, details = {}) {
33
- super(message);
34
- this.name = "CliError";
35
- this.code = code;
36
- this.details = details;
37
- Object.defineProperty(this, BRAND, { value: true });
38
- }
39
- };
40
- var isCliError = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && value[BRAND] === true, "isCliError");
41
-
42
- // node_modules/.pnpm/@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
43
- var CONTROL = (
44
- // biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
45
- /[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
46
- );
47
- var SUBDIVISION_FLAG = /\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}/gu;
48
- var LINE_BREAKS = /[\t\n\u2028\u2029]/g;
49
- var escaped = /* @__PURE__ */ __name((c) => {
50
- const code = c.codePointAt(0) ?? 0;
51
- if (code > 65535)
52
- return `\\u{${code.toString(16)}}`;
53
- return code > 255 ? `\\u${code.toString(16).padStart(4, "0")}` : `\\x${code.toString(16).padStart(2, "0")}`;
54
- }, "escaped");
55
- var visibleControls = /* @__PURE__ */ __name((text) => {
56
- let at = 0;
57
- let result = "";
58
- for (const flag of text.matchAll(SUBDIVISION_FLAG)) {
59
- result += text.slice(at, flag.index).replace(CONTROL, escaped) + flag[0];
60
- at = flag.index + flag[0].length;
61
- }
62
- return result + text.slice(at).replace(CONTROL, escaped);
63
- }, "visibleControls");
64
- var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
65
-
66
- export {
67
- errorCodes,
68
- CliError,
69
- isCliError,
70
- visibleControls,
71
- singleLine
72
- };
@@ -1,614 +0,0 @@
1
- import { createRequire as __bundleRequire } from "node:module";
2
- const require = __bundleRequire(import.meta.url);
3
- import {
4
- createRenderer,
5
- fieldsOf,
6
- processStreams,
7
- projectFields
8
- } from "./chunk-WIHN3ELW.js";
9
- import {
10
- COMPACT_FLAG
11
- } from "./chunk-QFOP3KUP.js";
12
- import {
13
- CliError,
14
- singleLine
15
- } from "./chunk-S6JG4YUH.js";
16
- import {
17
- __name
18
- } from "./chunk-ZVVMGPBJ.js";
19
-
20
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/sends/permissions.js
21
- var LEVELS = ["deny", "readonly", "ask", "allow"];
22
- var DANGEROUS = /* @__PURE__ */ new Set([
23
- "messages.delete",
24
- "messages.scheduled.cancel",
25
- "bot.messages.delete",
26
- "topics.delete",
27
- "chats.delete",
28
- "chats.clear"
29
- ]);
30
- var skipFlagFor = /* @__PURE__ */ __name((key) => DANGEROUS.has(key) ? "--allow-dangerous" : "--yes", "skipFlagFor");
31
- var DEFAULT_PERMISSIONS = {
32
- // Owner, 2026-11-14: deleting a message does not ask; a profile that wants the question sets `ask`.
33
- "messages.delete": "allow",
34
- "account.sessions.end": "ask",
35
- "bot.messages.delete": "allow",
36
- "topics.enable": "ask",
37
- "topics.delete": "ask",
38
- "chats.delete": "ask",
39
- "chats.clear": "ask",
40
- // Owner, 2026-11-14 (replaces NEED-568): a rule the owner enabled may send; `deny` stops every automatic reply.
41
- "replies.send": "allow",
42
- // NEED-1662: an agent that changes settings, schedules or recipients could lift its own limits; the owner opts in.
43
- "mcp.authority": "deny",
44
- // NEED-1663: writes no level stopped before, so MCP could not offer them; over MCP `ask` goes ahead.
45
- "store.backup": "ask",
46
- "store.restore": "ask",
47
- "store.migrate": "ask",
48
- "store.repair": "ask",
49
- "store.reset": "ask",
50
- "store.import": "ask",
51
- "store.clear": "ask",
52
- "store.decrypt": "ask",
53
- "store.copies.delete": "ask",
54
- "store.recover.run": "ask",
55
- "server.start": "ask",
56
- "server.stop": "ask",
57
- "server.restart": "ask",
58
- "models.download": "ask",
59
- // NEED-2357.f: many MCP clients (ChatGPT) cannot answer a question, and a switch deletes nothing; kept as a key so a
60
- // profile can still deny it.
61
- "models.set": "allow",
62
- "models.add": "ask",
63
- "images.models.download": "ask",
64
- "schedule.run": "ask",
65
- "schedule.exec": "ask",
66
- "doctor.reports.create": "ask",
67
- // A meeting changed on the service reaches its invitees: asked first, as zoom's `remote-meetings` was.
68
- "meetings.create": "ask",
69
- "meetings.update": "ask",
70
- "meetings.cancel": "ask"
71
- };
72
- var KEYED_UNDER_HOUSEKEEPING = new Set(Object.keys(DEFAULT_PERMISSIONS).filter((key) => /^(store|server|models|images|schedule|doctor)\./.test(key)));
73
- var AUTHORITY_KEY = "mcp.authority";
74
- var authorityAllowed = /* @__PURE__ */ __name((levels) => {
75
- const { level } = levelFor(levels, AUTHORITY_KEY);
76
- return level === "allow" || level === "ask";
77
- }, "authorityAllowed");
78
- var BOT_API_KEY = "bot.api";
79
- var isBotApi = /* @__PURE__ */ __name((path) => path[0] === "bot" && path[1] === "api", "isBotApi");
80
- var botApiAllowed = /* @__PURE__ */ __name((levels) => {
81
- const { level } = levelFor(levels, BOT_API_KEY, { ...DEFAULT_PERMISSIONS, [BOT_API_KEY]: "deny" });
82
- return level === "allow" || level === "ask";
83
- }, "botApiAllowed");
84
- var RESOURCES = [
85
- "messages",
86
- "drafts",
87
- "reactions",
88
- "polls",
89
- "topics",
90
- "chats",
91
- "contacts",
92
- "account",
93
- "bot",
94
- "conversations",
95
- "tags",
96
- "mentions",
97
- "search",
98
- "searches",
99
- "tasks",
100
- "replies",
101
- "attachments",
102
- "stats",
103
- "store",
104
- "metadata",
105
- "mcp",
106
- "server",
107
- "models",
108
- "schedule",
109
- "doctor",
110
- "images"
111
- ];
112
- var layerPermissions = /* @__PURE__ */ __name((layers) => {
113
- const levels = {};
114
- const sources = {};
115
- for (const [from, layer] of layers) {
116
- const nearer = Object.keys(levels);
117
- for (const [key, level] of Object.entries(layer ?? {})) {
118
- if (nearer.some((named2) => key === named2 || key.startsWith(`${named2}.`)))
119
- continue;
120
- levels[key] = level;
121
- sources[key] = from;
122
- }
123
- }
124
- return { levels, sources };
125
- }, "layerPermissions");
126
- var CEILING_KEY = "*";
127
- var STORE_ONLY_KEYS = /* @__PURE__ */ new Set([
128
- "attachments.extract",
129
- "conversations.embeddings",
130
- "conversations.links",
131
- "messages.server-search",
132
- "messages.sync-first",
133
- "metadata.sync",
134
- "stats.contacts.top.sync-first",
135
- "stats.messages.counters.sync",
136
- "stats.messages.show.sync-first",
137
- "stats.messages.top.sync-first",
138
- "store.gaps.repair"
139
- ]);
140
- var FETCH_KEYS = new Set([...STORE_ONLY_KEYS].filter((key) => !["attachments.extract", "conversations.embeddings", "conversations.links"].includes(key)));
141
- var fetchesUnder = /* @__PURE__ */ __name((level, key) => level === "readonly" && FETCH_KEYS.has(key), "fetchesUnder");
142
- var fetchesAt = /* @__PURE__ */ __name((level) => level === "allow" || level === "readonly", "fetchesAt");
143
- var stops = /* @__PURE__ */ __name((level, key) => level === "deny" || level === "readonly" && !FETCH_KEYS.has(key), "stops");
144
- var ALLOWED = { level: "allow", key: null };
145
- var ORDER = { deny: 0, readonly: 1, ask: 2, allow: 3 };
146
- var nearest = /* @__PURE__ */ __name((levels, key) => {
147
- for (let parts = key.split("."); parts.length > 0; parts = parts.slice(0, -1)) {
148
- const named2 = parts.join(".");
149
- const level = levels[named2];
150
- if (level)
151
- return { level, key: named2, depth: parts.length };
152
- }
153
- return void 0;
154
- }, "nearest");
155
- var levelFor = /* @__PURE__ */ __name((permissions, key, defaults = DEFAULT_PERMISSIONS) => {
156
- const found = profileLevel(permissions, key, defaults);
157
- const ceiling = permissions[CEILING_KEY];
158
- return ceiling && ORDER[ceiling] < ORDER[found.level] ? { level: ceiling, key: CEILING_KEY } : found;
159
- }, "levelFor");
160
- var profileLevel = /* @__PURE__ */ __name((permissions, key, defaults) => {
161
- const own = nearest(permissions, key);
162
- const builtIn = nearest(defaults, key);
163
- if (!builtIn || own && own.depth >= builtIn.depth)
164
- return own ? { level: own.level, key: own.key } : ALLOWED;
165
- if (!own || ORDER[builtIn.level] <= ORDER[own.level])
166
- return { level: builtIn.level, key: builtIn.key };
167
- return { level: own.level, key: own.key };
168
- }, "profileLevel");
169
- var CHAT_KEYS = {
170
- settings: "chats.update",
171
- "requests.accept": "chats.requests.confirm",
172
- "requests.decline": "chats.requests.reject",
173
- "link.create": "chats.links.create",
174
- "link.reset": "chats.links.reset",
175
- "link.revoke": "chats.links.remove",
176
- "link.update": "chats.links.update"
177
- };
178
- var ACCOUNT_KEYS = {
179
- "contact-add": "contacts.add",
180
- "contact-remove": "contacts.remove",
181
- "contact-import": "contacts.import",
182
- "contact-rename": "contacts.rename",
183
- "contact-block": "contacts.block",
184
- "contact-unblock": "contacts.unblock",
185
- profile: "account.update",
186
- "folder-create": "chats.folders.create",
187
- "folder-update": "chats.folders.update",
188
- "folder-delete": "chats.folders.delete",
189
- "folder-order": "chats.folders.order",
190
- "folder-join": "chats.folders.join",
191
- "sessions-end": "account.sessions.end",
192
- "chat-mute": "chats.mute",
193
- "chat-unmute": "chats.unmute",
194
- "chat-archive": "chats.archive",
195
- "chat-unarchive": "chats.unarchive",
196
- "chat-pin": "chats.pin",
197
- "chat-unpin": "chats.unpin",
198
- "chat-mark-unread": "chats.mark-unread",
199
- "message-star": "messages.star",
200
- "message-unstar": "messages.unstar",
201
- // A mail CLI names its own key on every write; these only answer `keyForWrite` when one is left out.
202
- "message-flag": "messages.update",
203
- "message-move": "messages.move",
204
- "message-copy": "messages.copy",
205
- "message-delete": "messages.trash",
206
- "message-restore": "messages.restore",
207
- privacy: "account.privacy.set"
208
- };
209
- var KIND_KEYS = {
210
- message: "messages.send",
211
- forward: "messages.forward",
212
- edit: "messages.edit",
213
- pin: "messages.pin",
214
- reaction: "reactions",
215
- read: "chats.mark-read",
216
- delete: "messages.delete"
217
- };
218
- var keyForWrite = /* @__PURE__ */ __name((kind, action) => {
219
- if (kind === "chat")
220
- return CHAT_KEYS[action] ?? `chats.${action ?? "update"}`;
221
- if (kind === "account") {
222
- const key = ACCOUNT_KEYS[action];
223
- if (!key)
224
- throw new Error(`an account change without a known action: ${action}`);
225
- return key;
226
- }
227
- return KIND_KEYS[kind];
228
- }, "keyForWrite");
229
- var writeOfKey = /* @__PURE__ */ __name((key) => {
230
- const account = Object.entries(ACCOUNT_KEYS).find(([, named2]) => named2 === key)?.[0];
231
- if (account)
232
- return { kind: "account", action: account };
233
- const kind = Object.entries(KIND_KEYS).find(([, named2]) => named2 === key || key.startsWith(`${named2}.`))?.[0];
234
- if (kind)
235
- return { kind };
236
- if (key === "messages.unpin")
237
- return { kind: "pin" };
238
- if (key.startsWith("chats.")) {
239
- const action = Object.entries(CHAT_KEYS).find(([, named2]) => named2 === key)?.[0] ?? key.slice("chats.".length);
240
- return { kind: "chat", action };
241
- }
242
- return {};
243
- }, "writeOfKey");
244
- var NAMED_WRITE_KEYS = [
245
- "drafts",
246
- "store.gaps.repair",
247
- "messages.sync-first",
248
- "messages.server-search",
249
- "messages.press",
250
- "messages.scheduled.cancel",
251
- "messages.scheduled.edit",
252
- "messages.scheduled.send",
253
- "chats.start",
254
- "chats.app",
255
- "stats.messages.counters.sync",
256
- "stats.messages.show.sync-first",
257
- "stats.messages.top.sync-first",
258
- "stats.contacts.top.sync-first",
259
- "account.sessions.list",
260
- "attachments.extract",
261
- "attachments.move",
262
- "attachments.update",
263
- "bot.callbacks.answer",
264
- "bot.chats.action",
265
- "bot.chats.admins.add",
266
- "bot.chats.admins.remove",
267
- "bot.chats.leave",
268
- "bot.chats.members.remove",
269
- "bot.chats.moderate",
270
- "bot.messages.delete",
271
- "bot.messages.edit",
272
- "bot.messages.pin",
273
- "bot.messages.send",
274
- "bot.messages.unpin",
275
- "chats.admins.add",
276
- "chats.admins.remove",
277
- "chats.links.create",
278
- "chats.links.reset",
279
- "chats.links.remove",
280
- "chats.links.update",
281
- "chats.members.add",
282
- "chats.members.remove",
283
- "chats.moderate",
284
- "conversations.embeddings",
285
- "conversations.links",
286
- "polls.close",
287
- "polls.create",
288
- "polls.vote",
289
- "searches.clear",
290
- "searches.create",
291
- "searches.delete",
292
- "contacts.aliases.set",
293
- "contacts.aliases.remove",
294
- "contacts.notes.add",
295
- "contacts.notes.edit",
296
- "contacts.notes.remove",
297
- "tags.rebuild",
298
- "metadata.sync",
299
- "mentions.rebuild",
300
- "mentions.confirm",
301
- "mentions.reject",
302
- "tags.add",
303
- "tags.remove",
304
- "tasks.acknowledge",
305
- "tasks.add",
306
- "tasks.claim",
307
- "tasks.close",
308
- "tasks.duplicates.defer",
309
- "tasks.duplicates.reject",
310
- "tasks.link",
311
- "tasks.merge",
312
- "tasks.update",
313
- "tasks.release",
314
- "tasks.scan",
315
- "tasks.unmerge",
316
- "topics.create",
317
- "topics.edit",
318
- "topics.enable"
319
- ];
320
- var WRITE_KEYS = [
321
- .../* @__PURE__ */ new Set([
322
- ...NAMED_WRITE_KEYS,
323
- ...Object.keys(DEFAULT_PERMISSIONS),
324
- ...Object.values(KIND_KEYS),
325
- ...Object.values(ACCOUNT_KEYS),
326
- ...Object.values(CHAT_KEYS)
327
- ])
328
- ];
329
- var HOUSEKEEPING = /* @__PURE__ */ new Set([
330
- "help",
331
- "guide",
332
- "config",
333
- "session",
334
- "doctor",
335
- "commands",
336
- "complete",
337
- "upgrade",
338
- "skill",
339
- "models",
340
- "server",
341
- // What a schedule runs is checked by its own key when it runs; an agent runs read-only.
342
- "schedule",
343
- "runs",
344
- "sends",
345
- "recipients",
346
- "flood",
347
- "mcp",
348
- // Its commands read the rules or flip the pause switch; what a rule sends is checked as `replies.send`.
349
- "replies"
350
- ]);
351
- var BOT_HOUSEKEEPING = /* @__PURE__ */ new Set(["auth", "list", "sends", "recipients", "mcp"]);
352
- var STORE_MAINTENANCE = /* @__PURE__ */ new Set(["info", "check", "copies"]);
353
- var SHOW_MESSAGES = /* @__PURE__ */ new Set(["inbox", "review", "watch", "serve", "store", "conversations", "projects"]);
354
- var readKeysForCommand = /* @__PURE__ */ __name((path) => {
355
- if (path[0] === "bot")
356
- return readKeysForCommand(path.slice(1)).map((key2) => `bot.${key2}`);
357
- const key = keyForCommand(path);
358
- if (!key)
359
- return [];
360
- if (path[0] === "attachments" && path[1] === "download")
361
- return [key, "messages", "chats"];
362
- if (path[0] === "attachments" && (path[1] === "extract" || path[1] === "show"))
363
- return [key, "messages"];
364
- if (path[0] === "store" && path[1] === "gaps" && path[2] === "repair")
365
- return [key, "messages"];
366
- if (path[0] === "store" && ["reset", "clear", "decrypt"].includes(path[1] ?? ""))
367
- return [key, "messages"];
368
- if (key === "store.recover.run")
369
- return [key, "messages"];
370
- if (path[0] === "search") {
371
- if (path[1] === "notes")
372
- return [key];
373
- if (path[1] === "topics")
374
- return [key, "topics"];
375
- if (path[1] === "conversations")
376
- return [key, "messages", "conversations"];
377
- return [key, "messages"];
378
- }
379
- if (path[0] !== "stats")
380
- return [key];
381
- const resource = path[1] === "charts" ? "chats" : path[1];
382
- return [
383
- .../* @__PURE__ */ new Set([
384
- key,
385
- "messages",
386
- ...["chats", "contacts", "tasks"].includes(resource ?? "") ? [resource] : []
387
- ])
388
- ];
389
- }, "readKeysForCommand");
390
- var keyForCommand = /* @__PURE__ */ __name((path) => {
391
- if (path.length === 0)
392
- return null;
393
- const [top, next] = path;
394
- if (top === "bot") {
395
- if (next === void 0 || BOT_HOUSEKEEPING.has(next))
396
- return null;
397
- const inner = keyForCommand(path.slice(1));
398
- return `bot.${inner ?? path.slice(1).join(".")}`;
399
- }
400
- if (KEYED_UNDER_HOUSEKEEPING.has(path.join(".")))
401
- return path.join(".");
402
- if (top === void 0 || HOUSEKEEPING.has(top) || top === "search" && next === "runs")
403
- return null;
404
- if (top === "images" && next === "models")
405
- return null;
406
- if (top === "attachments" && (next === "check" || next === "jobs"))
407
- return null;
408
- if (top === "attachments" && next === "download")
409
- return "messages";
410
- if (top === "store" && next !== void 0 && STORE_MAINTENANCE.has(next))
411
- return null;
412
- if (top === "conversations" && next === "links")
413
- return path[2] === "rebuild" ? "conversations.links.rebuild" : "conversations.links";
414
- if (top === "conversations" && (next === "embeddings" || next === "embed") || top === "images" && next === "embed" || top === "conversations" && next === "rebuild")
415
- return "conversations.embeddings";
416
- if (top === "attachments" && next === "list" || top === "chats" && next === "documents")
417
- return "messages";
418
- if (top === "mentions")
419
- return next === "rebuild" || next === "confirm" || next === "reject" ? `mentions.${next}` : "messages";
420
- if (top === "store" && (next === "gaps" || next === "jobs"))
421
- return path.join(".");
422
- if (SHOW_MESSAGES.has(top) || top === "contacts" && (next === "context" || next === "prepare" || next === "events"))
423
- return "messages";
424
- if (RESOURCES.includes(top))
425
- return path.join(".");
426
- return void 0;
427
- }, "keyForCommand");
428
- var RESOURCE_KEY = new RegExp(`^(${RESOURCES.join("|")})(\\.[a-z][a-z-]*)*$`);
429
- var COMMAND_PATH_KEY = /^[a-z][a-z-]*(\.[a-zA-Z][a-zA-Z-]*)*$/;
430
- var permissionOverrides = /* @__PURE__ */ __name((entries = [], shape = RESOURCE_KEY) => {
431
- const levels = {};
432
- const example = shape === RESOURCE_KEY ? "messages.send=allow" : "api=readonly";
433
- for (const entry of entries) {
434
- const [key = "", level = "", extra] = entry.split("=");
435
- if (!shape.test(key) || !LEVELS.includes(level) || extra !== void 0)
436
- throw new CliError("validation_error", `--permission takes a command path and level, e.g. ${example} (deny, readonly, ask, allow)`);
437
- levels[key] = level;
438
- }
439
- return levels;
440
- }, "permissionOverrides");
441
- var assertOverridesTighten = /* @__PURE__ */ __name((overrides, profile, defaults = DEFAULT_PERMISSIONS) => {
442
- for (const [key, level] of Object.entries(overrides)) {
443
- const under = Object.keys(profile).filter((named2) => named2.startsWith(`${key}.`));
444
- const lifted = [key, ...under].find((named2) => ORDER[level] > ORDER[levelFor(profile, named2, defaults).level]);
445
- if (lifted !== void 0)
446
- throw new CliError("validation_error", `--permission ${key}=${level} would loosen ${lifted} from ${levelFor(profile, lifted, defaults).level}; it only tightens \u2014 change the profile's permissions to loosen it`, { key, lifted });
447
- }
448
- }, "assertOverridesTighten");
449
- var assertRetentionEvidenceRead = /* @__PURE__ */ __name((permissions) => {
450
- for (const permission of ["stats.chats.retention", "chats"]) {
451
- if (levelFor(permissions, permission).level === "deny")
452
- throw new CliError("permission_error", `profile denies ${permission}`, { permission });
453
- }
454
- }, "assertRetentionEvidenceRead");
455
-
456
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/cli/result-fields.js
457
- var named = /* @__PURE__ */ __name((work) => {
458
- try {
459
- return work();
460
- } catch (error) {
461
- if (error instanceof CliError && error.code === "validation_error")
462
- throw new CliError("validation_error", "--json takes comma-separated field paths, for example --json=id,text", {
463
- param: "--json"
464
- });
465
- throw error;
466
- }
467
- }, "named");
468
- var fieldsOf2 = /* @__PURE__ */ __name((value) => named(() => fieldsOf(value)), "fieldsOf");
469
- var projectCommands = /* @__PURE__ */ __name((commands, fields) => commands.map((command) => ({
470
- ...projectFields(command, fields),
471
- path: command.path,
472
- name: command.name,
473
- origin: command.origin,
474
- effects: command.effects,
475
- commands: projectCommands(command.commands, fields)
476
- })), "projectCommands");
477
- var projectFields2 = /* @__PURE__ */ __name((value, fields) => named(() => {
478
- if (value && typeof value === "object" && "cli" in value && typeof value.cli === "string" && "contract" in value && "commands" in value && Array.isArray(value.commands))
479
- return { ...value, commands: projectCommands(value.commands, fields) };
480
- return projectFields(value, fields);
481
- }), "projectFields");
482
-
483
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/output-detail.js
484
- var RARELY_SET = ["editedAt", "replyTo", "forwardedFrom", "reactions"];
485
- var BRIEF = ["locator", "chatTitle", "timestamp", "senderName", "excerpt", "score"];
486
- var SNAKE_BRIEF = ["ref", "chat_title", "timestamp", "sender_name", "excerpt", "score"];
487
- var isRecord = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null, "isRecord");
488
- var isSnakeHit = /* @__PURE__ */ __name((value) => isRecord(value) && typeof value.ref === "string" && typeof value.excerpt === "string", "isSnakeHit");
489
- var isHit = /* @__PURE__ */ __name((value) => isSnakeHit(value) || isRecord(value) && typeof value.locator === "string" && typeof value.text === "string", "isHit");
490
- var picked = /* @__PURE__ */ __name((hit, keys) => Object.fromEntries(keys.flatMap((key) => hit[key] === void 0 || hit[key] === null ? [] : [[key, hit[key]]])), "picked");
491
- var shaped = /* @__PURE__ */ __name((hit, detail) => {
492
- if (isSnakeHit(hit))
493
- return detail === "brief" ? picked(hit, SNAKE_BRIEF) : hit;
494
- if (detail === "brief")
495
- return picked(hit, BRIEF);
496
- const { text, providerMetadata, ...rest } = hit;
497
- for (const key of RARELY_SET)
498
- if (rest[key] === null)
499
- delete rest[key];
500
- const metadata = rest.email ? void 0 : providerMetadata;
501
- return {
502
- ...rest,
503
- ...typeof rest.excerpt === "string" ? {} : { text },
504
- ...metadata === void 0 ? {} : { providerMetadata: metadata }
505
- };
506
- }, "shaped");
507
- var atDetail = /* @__PURE__ */ __name((value, detail = "default") => {
508
- if (detail === "full")
509
- return value;
510
- if (Array.isArray(value))
511
- return value.map((item) => isHit(item) ? shaped(item, detail) : item);
512
- if (isHit(value))
513
- return shaped(value, detail);
514
- if (typeof value === "object" && value !== null && Array.isArray(value.items))
515
- return { ...value, items: atDetail(value.items, detail) };
516
- return value;
517
- }, "atDetail");
518
-
519
- // node_modules/.pnpm/@wirecat+cli-core@2.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_a82f624c57005d53c3f072e45c3a3a86/node_modules/@wirecat/cli-core/dist/output.js
520
- var refuseCompact = /* @__PURE__ */ __name(({ json, jsonl, fields, hitDetail }) => {
521
- const other = jsonl ? "--jsonl" : fields !== void 0 ? "--json=\u2026" : json ? "--json" : hitDetail === "brief" ? "--brief" : "";
522
- if (other)
523
- throw new CliError("validation_error", `${COMPACT_FLAG} and ${other} ask for different output \u2014 pick one`, {
524
- reason: "output.conflict",
525
- param: COMPACT_FLAG
526
- });
527
- }, "refuseCompact");
528
- var resolveOutput = /* @__PURE__ */ __name(({ json, jsonl, quiet, streams = processStreams, tty, color, fields, hitDetail, env = process.env, capture, compact } = {}) => {
529
- if (compact)
530
- refuseCompact({ json, jsonl, fields, hitDetail });
531
- const interactive = tty ?? process.stdout.isTTY === true;
532
- const format = jsonl ? "jsonl" : json || compact || !interactive ? "json" : "pretty";
533
- const painted = format === "pretty" && (color ?? (env.NO_COLOR === void 0 && env.TERM !== "dumb" && !env.CI));
534
- const printing = createRenderer({ format, color: painted, streams });
535
- const rendered = capture ? { ...printing, result: capture, stream: /* @__PURE__ */ __name((items) => capture([...items]), "stream") } : printing;
536
- const level = hitDetail ?? (fields === void 0 ? "default" : "full");
537
- const standard = format === "pretty" ? rendered : {
538
- ...rendered,
539
- result: /* @__PURE__ */ __name((value) => rendered.result(atDetail(value, level)), "result"),
540
- stream: /* @__PURE__ */ __name((items) => rendered.stream(atDetail([...items], level)), "stream")
541
- };
542
- const created = standard;
543
- const paths = fields === void 0 ? void 0 : fieldsOf2(fields);
544
- const renderer = format === "pretty" ? oneLineFields(created) : paths ? {
545
- ...created,
546
- result: /* @__PURE__ */ __name((value) => created.result(projectFields2(value, paths)), "result"),
547
- stream: /* @__PURE__ */ __name((items) => created.stream([...items].map((item) => projectFields2(item, paths))), "stream")
548
- } : created;
549
- return {
550
- format,
551
- color: painted,
552
- streams,
553
- renderer: quiet ? silence(renderer) : renderer,
554
- ...compact ? { compact: true, full: hitDetail === "full" } : {}
555
- };
556
- }, "resolveOutput");
557
- var MULTI_LINE = /* @__PURE__ */ new Set(["text", "description"]);
558
- var oneLineFields = /* @__PURE__ */ __name((renderer) => ({
559
- ...renderer,
560
- result: /* @__PURE__ */ __name((value) => renderer.result(oneLine(value)), "result"),
561
- stream: /* @__PURE__ */ __name((items) => renderer.stream([...items].map((item) => oneLine(item))), "stream")
562
- }), "oneLineFields");
563
- var oneLine = /* @__PURE__ */ __name((value, key) => {
564
- if (typeof value === "string")
565
- return key !== void 0 && MULTI_LINE.has(key) ? value : singleLine(value);
566
- if (Array.isArray(value))
567
- return value.map((item) => oneLine(item, key));
568
- if (value !== null && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) {
569
- return Object.fromEntries(Object.entries(value).map(([field, item]) => [field, oneLine(item, field)]));
570
- }
571
- return value;
572
- }, "oneLine");
573
- var silence = /* @__PURE__ */ __name((renderer) => ({
574
- ...renderer,
575
- note: /* @__PURE__ */ __name(() => {
576
- }, "note"),
577
- success: /* @__PURE__ */ __name(() => {
578
- }, "success"),
579
- warn: /* @__PURE__ */ __name(() => {
580
- }, "warn")
581
- }), "silence");
582
-
583
- export {
584
- LEVELS,
585
- skipFlagFor,
586
- DEFAULT_PERMISSIONS,
587
- KEYED_UNDER_HOUSEKEEPING,
588
- AUTHORITY_KEY,
589
- authorityAllowed,
590
- BOT_API_KEY,
591
- isBotApi,
592
- botApiAllowed,
593
- RESOURCES,
594
- layerPermissions,
595
- CEILING_KEY,
596
- STORE_ONLY_KEYS,
597
- fetchesUnder,
598
- fetchesAt,
599
- stops,
600
- levelFor,
601
- keyForWrite,
602
- writeOfKey,
603
- WRITE_KEYS,
604
- readKeysForCommand,
605
- keyForCommand,
606
- RESOURCE_KEY,
607
- COMMAND_PATH_KEY,
608
- permissionOverrides,
609
- assertOverridesTighten,
610
- assertRetentionEvidenceRead,
611
- fieldsOf2 as fieldsOf,
612
- projectFields2 as projectFields,
613
- resolveOutput
614
- };