@wirecat/hubspot-cli 0.0.0-stage → 0.2.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 (261) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +204 -0
  3. package/README.md +280 -2
  4. package/contracts/wirecat.json +3270 -0
  5. package/dist/bin/hubspot.d.ts +3 -0
  6. package/dist/bin/hubspot.d.ts.map +1 -0
  7. package/dist/bin/hubspot.js +40 -0
  8. package/dist/bin/hubspot.js.map +1 -0
  9. package/dist/bundle/all-profiles-64JAUYW4.js +279 -0
  10. package/dist/bundle/anthropic-VJOS4OUM.js +91 -0
  11. package/dist/bundle/app-server-GXV2OFML.js +245 -0
  12. package/dist/bundle/bun-M3J2QTR3.js +169 -0
  13. package/dist/bundle/bun-sqlite-IX3XYA5F.js +76 -0
  14. package/dist/bundle/chunk-24ERVFJP.js +73 -0
  15. package/dist/bundle/chunk-2QZK5BEP.js +392 -0
  16. package/dist/bundle/chunk-2UOJ7DLZ.js +46 -0
  17. package/dist/bundle/chunk-2VGD63G6.js +604 -0
  18. package/dist/bundle/chunk-2VGZRYEH.js +334 -0
  19. package/dist/bundle/chunk-36ITRDYY.js +63116 -0
  20. package/dist/bundle/chunk-3WLYWRGG.js +1395 -0
  21. package/dist/bundle/chunk-43EKCUBJ.js +72 -0
  22. package/dist/bundle/chunk-4W6BMH45.js +731 -0
  23. package/dist/bundle/chunk-5A6ZYNAQ.js +2003 -0
  24. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  25. package/dist/bundle/chunk-5GBUCHRU.js +274 -0
  26. package/dist/bundle/chunk-5K7QLJMM.js +4072 -0
  27. package/dist/bundle/chunk-65TWQ7BV.js +54 -0
  28. package/dist/bundle/chunk-7ELMWE3P.js +12066 -0
  29. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  30. package/dist/bundle/chunk-B3MANLNK.js +602 -0
  31. package/dist/bundle/chunk-C32AKHTY.js +2310 -0
  32. package/dist/bundle/chunk-CLAN3FES.js +1246 -0
  33. package/dist/bundle/chunk-CWXOXIWS.js +46 -0
  34. package/dist/bundle/chunk-D72URWJE.js +532 -0
  35. package/dist/bundle/chunk-DB2XKHI4.js +72 -0
  36. package/dist/bundle/chunk-DBEQI5YM.js +100 -0
  37. package/dist/bundle/chunk-DFCHHR5M.js +38 -0
  38. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  39. package/dist/bundle/chunk-DRWWJLI6.js +188 -0
  40. package/dist/bundle/chunk-DSP36YHQ.js +29 -0
  41. package/dist/bundle/chunk-E52JAS35.js +1028 -0
  42. package/dist/bundle/chunk-E5WLE7BM.js +78 -0
  43. package/dist/bundle/chunk-ECEZOLOD.js +230 -0
  44. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  45. package/dist/bundle/chunk-FBCCBCFH.js +288 -0
  46. package/dist/bundle/chunk-FKA7DOCK.js +53 -0
  47. package/dist/bundle/chunk-FOZYMDRL.js +259 -0
  48. package/dist/bundle/chunk-FPUGMDJV.js +7 -0
  49. package/dist/bundle/chunk-FTFV3HFW.js +721 -0
  50. package/dist/bundle/chunk-GPYCBYX5.js +218 -0
  51. package/dist/bundle/chunk-H3TNVEQX.js +782 -0
  52. package/dist/bundle/chunk-HC5ZWE5X.js +193 -0
  53. package/dist/bundle/chunk-HCAZV5NP.js +95 -0
  54. package/dist/bundle/chunk-HZRQLAHO.js +16 -0
  55. package/dist/bundle/chunk-IJADZW42.js +195 -0
  56. package/dist/bundle/chunk-IMJQRPLN.js +92 -0
  57. package/dist/bundle/chunk-JLDBMEKZ.js +106 -0
  58. package/dist/bundle/chunk-LOBVOGOE.js +66 -0
  59. package/dist/bundle/chunk-LXZ66MCH.js +1328 -0
  60. package/dist/bundle/chunk-MFNMKHML.js +26462 -0
  61. package/dist/bundle/chunk-MVA5HVKL.js +1392 -0
  62. package/dist/bundle/chunk-N2XADGL4.js +76 -0
  63. package/dist/bundle/chunk-NHHJHXMQ.js +58 -0
  64. package/dist/bundle/chunk-NUU4WZVL.js +52 -0
  65. package/dist/bundle/chunk-NWHEHV3K.js +133 -0
  66. package/dist/bundle/chunk-NXERIDPJ.js +319 -0
  67. package/dist/bundle/chunk-O3DYRCIT.js +23 -0
  68. package/dist/bundle/chunk-O55RWNSH.js +161 -0
  69. package/dist/bundle/chunk-P5BHKKBI.js +206 -0
  70. package/dist/bundle/chunk-PPHBRESD.js +82 -0
  71. package/dist/bundle/chunk-PVKF24ZW.js +364 -0
  72. package/dist/bundle/chunk-Q2OLOMHL.js +4045 -0
  73. package/dist/bundle/chunk-QGFX5MXL.js +460 -0
  74. package/dist/bundle/chunk-QJW35N5V.js +761 -0
  75. package/dist/bundle/chunk-QU25DA5N.js +360 -0
  76. package/dist/bundle/chunk-RMIYKDUL.js +1068 -0
  77. package/dist/bundle/chunk-RR5MX5TM.js +142 -0
  78. package/dist/bundle/chunk-SDQGB4KB.js +185 -0
  79. package/dist/bundle/chunk-TBJYLC5K.js +2788 -0
  80. package/dist/bundle/chunk-TI46WQXQ.js +1197 -0
  81. package/dist/bundle/chunk-TKVL2C3B.js +170 -0
  82. package/dist/bundle/chunk-TLKEPUAV.js +786 -0
  83. package/dist/bundle/chunk-TOSCB4SO.js +1227 -0
  84. package/dist/bundle/chunk-TP7GDWVF.js +6848 -0
  85. package/dist/bundle/chunk-URX6YDUL.js +9393 -0
  86. package/dist/bundle/chunk-UUMUL4L3.js +72 -0
  87. package/dist/bundle/chunk-VOH7S5M4.js +40963 -0
  88. package/dist/bundle/chunk-W53EJOFQ.js +63 -0
  89. package/dist/bundle/chunk-W7HM2VGO.js +24 -0
  90. package/dist/bundle/chunk-WE4UFASG.js +88 -0
  91. package/dist/bundle/chunk-X2M6NIQG.js +18 -0
  92. package/dist/bundle/chunk-XRREFEIW.js +372 -0
  93. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  94. package/dist/bundle/chunk-YMCY7VRE.js +1846 -0
  95. package/dist/bundle/chunk-Z73OL5HV.js +41 -0
  96. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  97. package/dist/bundle/command-contract-C6CBFXZF.js +40 -0
  98. package/dist/bundle/command-server-entry-DJKVVZCQ.js +169 -0
  99. package/dist/bundle/decode-FC65Y4IV.js +297 -0
  100. package/dist/bundle/definitions-MVPICAWV.js +2991 -0
  101. package/dist/bundle/dispatch-KOISQ5QJ.js +411 -0
  102. package/dist/bundle/dist-7TGU56B2.js +7577 -0
  103. package/dist/bundle/echarts-FVTUDXDU.js +42501 -0
  104. package/dist/bundle/embed-VNBZFPYH.js +38 -0
  105. package/dist/bundle/embedder-6U4NOFRO.js +111 -0
  106. package/dist/bundle/failure-FZ6VYKEQ.js +25 -0
  107. package/dist/bundle/first-run-UWAFSINQ.js +29 -0
  108. package/dist/bundle/first-screen-RTVMGHAE.js +40 -0
  109. package/dist/bundle/hubspot.js +198 -0
  110. package/dist/bundle/instructions-HET7BCYK.js +11 -0
  111. package/dist/bundle/mcp-RGNRW77S.js +167 -0
  112. package/dist/bundle/meeting-combined-L5AGBPYX.js +25 -0
  113. package/dist/bundle/meeting-model-NTB4RK3F.js +25 -0
  114. package/dist/bundle/meeting-semantic-JY3OGCBS.js +22 -0
  115. package/dist/bundle/node-CXZIFHZC.js +176 -0
  116. package/dist/bundle/node-P4E63KXA.js +2340 -0
  117. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  118. package/dist/bundle/node-sqlite-P3O7XN7Q.js +74 -0
  119. package/dist/bundle/oauth-HNCY4B2S.js +20 -0
  120. package/dist/bundle/open-F4P6YV54.js +23 -0
  121. package/dist/bundle/openai-4AICLIK3.js +238 -0
  122. package/dist/bundle/process-5RUXWGYS.js +91 -0
  123. package/dist/bundle/program-XA4C44Z4.js +9374 -0
  124. package/dist/bundle/prompt-NFMDVBZ4.js +17 -0
  125. package/dist/bundle/recognize-DKN3RY4V.js +26 -0
  126. package/dist/bundle/remote-6QHAGQWY.js +31 -0
  127. package/dist/bundle/rerank-M4KHEHUZ.js +52 -0
  128. package/dist/bundle/schemas-JRL3DLMP.js +952 -0
  129. package/dist/bundle/serve-DNU43ND6.js +199 -0
  130. package/dist/bundle/server-ATG5KY7K.js +207 -0
  131. package/dist/bundle/server-VNWVVH7A.js +77 -0
  132. package/dist/bundle/source-54HR4IWG.js +661 -0
  133. package/dist/bundle/sqlite-runtime-EMQAC63N.js +20 -0
  134. package/dist/bundle/state-T45CX7VY.js +36 -0
  135. package/dist/bundle/store-6LCEVBAZ.js +176 -0
  136. package/dist/bundle/store-6TZ2FCVA.js +295 -0
  137. package/dist/bundle/store-DXWYNVVB.js +32 -0
  138. package/dist/bundle/store-maintenance-command-J57HCJYY.js +68 -0
  139. package/dist/bundle/writer-NLLI5YRM.js +79 -0
  140. package/dist/commands/account.d.ts +3 -0
  141. package/dist/commands/account.d.ts.map +1 -0
  142. package/dist/commands/account.js +87 -0
  143. package/dist/commands/account.js.map +1 -0
  144. package/dist/commands/api.d.ts +9 -0
  145. package/dist/commands/api.d.ts.map +1 -0
  146. package/dist/commands/api.js +70 -0
  147. package/dist/commands/api.js.map +1 -0
  148. package/dist/commands/crm-shared.d.ts +8 -0
  149. package/dist/commands/crm-shared.d.ts.map +1 -0
  150. package/dist/commands/crm-shared.js +109 -0
  151. package/dist/commands/crm-shared.js.map +1 -0
  152. package/dist/commands/schedule.d.ts +3 -0
  153. package/dist/commands/schedule.d.ts.map +1 -0
  154. package/dist/commands/schedule.js +9 -0
  155. package/dist/commands/schedule.js.map +1 -0
  156. package/dist/commands/session.d.ts +14 -0
  157. package/dist/commands/session.d.ts.map +1 -0
  158. package/dist/commands/session.js +164 -0
  159. package/dist/commands/session.js.map +1 -0
  160. package/dist/config.d.ts +60 -0
  161. package/dist/config.d.ts.map +1 -0
  162. package/dist/config.js +153 -0
  163. package/dist/config.js.map +1 -0
  164. package/dist/context.d.ts +88 -0
  165. package/dist/context.d.ts.map +1 -0
  166. package/dist/context.js +137 -0
  167. package/dist/context.js.map +1 -0
  168. package/dist/crm/activities.d.ts +24 -0
  169. package/dist/crm/activities.d.ts.map +1 -0
  170. package/dist/crm/activities.js +214 -0
  171. package/dist/crm/activities.js.map +1 -0
  172. package/dist/crm/associations.d.ts +20 -0
  173. package/dist/crm/associations.d.ts.map +1 -0
  174. package/dist/crm/associations.js +47 -0
  175. package/dist/crm/associations.js.map +1 -0
  176. package/dist/crm/records.d.ts +63 -0
  177. package/dist/crm/records.d.ts.map +1 -0
  178. package/dist/crm/records.js +333 -0
  179. package/dist/crm/records.js.map +1 -0
  180. package/dist/crm/search.d.ts +57 -0
  181. package/dist/crm/search.d.ts.map +1 -0
  182. package/dist/crm/search.js +47 -0
  183. package/dist/crm/search.js.map +1 -0
  184. package/dist/crm/source.d.ts +37 -0
  185. package/dist/crm/source.d.ts.map +1 -0
  186. package/dist/crm/source.js +366 -0
  187. package/dist/crm/source.js.map +1 -0
  188. package/dist/crm/writer.d.ts +15 -0
  189. package/dist/crm/writer.d.ts.map +1 -0
  190. package/dist/crm/writer.js +199 -0
  191. package/dist/crm/writer.js.map +1 -0
  192. package/dist/generated/definitions.d.ts +3 -0
  193. package/dist/generated/definitions.d.ts.map +1 -0
  194. package/dist/generated/definitions.js +2987 -0
  195. package/dist/generated/definitions.js.map +1 -0
  196. package/dist/generated/manifest.d.ts +6 -0
  197. package/dist/generated/manifest.d.ts.map +1 -0
  198. package/dist/generated/manifest.js +6504 -0
  199. package/dist/generated/manifest.js.map +1 -0
  200. package/dist/generated/schemas.d.ts +205 -0
  201. package/dist/generated/schemas.d.ts.map +1 -0
  202. package/dist/generated/schemas.js +810 -0
  203. package/dist/generated/schemas.js.map +1 -0
  204. package/dist/generated/types.d.ts +1114 -0
  205. package/dist/generated/types.d.ts.map +1 -0
  206. package/dist/generated/types.js +5 -0
  207. package/dist/generated/types.js.map +1 -0
  208. package/dist/hubspot/account.d.ts +12 -0
  209. package/dist/hubspot/account.d.ts.map +1 -0
  210. package/dist/hubspot/account.js +23 -0
  211. package/dist/hubspot/account.js.map +1 -0
  212. package/dist/hubspot/transport.d.ts +81 -0
  213. package/dist/hubspot/transport.d.ts.map +1 -0
  214. package/dist/hubspot/transport.js +354 -0
  215. package/dist/hubspot/transport.js.map +1 -0
  216. package/dist/identity.d.ts +7 -0
  217. package/dist/identity.d.ts.map +1 -0
  218. package/dist/identity.js +32 -0
  219. package/dist/identity.js.map +1 -0
  220. package/dist/index.d.ts +3 -0
  221. package/dist/index.d.ts.map +1 -0
  222. package/dist/index.js +3 -0
  223. package/dist/index.js.map +1 -0
  224. package/dist/program.d.ts +6 -0
  225. package/dist/program.d.ts.map +1 -0
  226. package/dist/program.js +78 -0
  227. package/dist/program.js.map +1 -0
  228. package/dist/reasons.d.ts +10 -0
  229. package/dist/reasons.d.ts.map +1 -0
  230. package/dist/reasons.js +33 -0
  231. package/dist/reasons.js.map +1 -0
  232. package/dist/setup/flow.d.ts +2 -0
  233. package/dist/setup/flow.d.ts.map +1 -0
  234. package/dist/setup/flow.js +97 -0
  235. package/dist/setup/flow.js.map +1 -0
  236. package/dist/setup/texts.en.json +19 -0
  237. package/dist/setup/texts.es.json +19 -0
  238. package/dist/setup/texts.ru.json +19 -0
  239. package/dist/store.d.ts +16 -0
  240. package/dist/store.d.ts.map +1 -0
  241. package/dist/store.js +34 -0
  242. package/dist/store.js.map +1 -0
  243. package/dist/version.d.ts +2 -0
  244. package/dist/version.d.ts.map +1 -0
  245. package/dist/version.js +2 -0
  246. package/dist/version.js.map +1 -0
  247. package/dist/wcat.d.ts +3 -0
  248. package/dist/wcat.d.ts.map +1 -0
  249. package/dist/wcat.js +4 -0
  250. package/dist/wcat.js.map +1 -0
  251. package/dist/whoami.d.ts +19 -0
  252. package/dist/whoami.d.ts.map +1 -0
  253. package/dist/whoami.js +15 -0
  254. package/dist/whoami.js.map +1 -0
  255. package/package.json +98 -4
  256. package/skills/hubspot-cli/SKILL.md +102 -0
  257. package/skills/hubspot-cli/references/api/api-advanced.md +51 -0
  258. package/skills/hubspot-cli/references/api/api-basic.md +1064 -0
  259. package/skills/hubspot-cli/references/api/api-batch.md +724 -0
  260. package/skills/hubspot-cli/references/api/api-search.md +147 -0
  261. package/skills/hubspot-cli/references/api.md +16 -0
@@ -0,0 +1,100 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ MAX_SECRET_INPUT,
5
+ bufferedInput,
6
+ inputPolicy
7
+ } from "./chunk-PPHBRESD.js";
8
+ import {
9
+ CliError
10
+ } from "./chunk-DB2XKHI4.js";
11
+ import {
12
+ __name
13
+ } from "./chunk-ZVVMGPBJ.js";
14
+
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
16
+ import { createInterface } from "node:readline";
17
+ import { Writable } from "node:stream";
18
+ var EMPTY_TRIES = 3;
19
+ var pasteHint = /* @__PURE__ */ __name((platform = process.platform) => `Nothing arrived. To paste in a terminal, use ${platform === "darwin" ? "Cmd+V" : "Ctrl+Shift+V (or right-click \u2192 Paste)"}.`, "pasteHint");
20
+ var readSecret = /* @__PURE__ */ __name(async (prompt, { input = process.stdin, output = process.stderr, echo = false, signal: givenSignal } = {}) => {
21
+ const policy = inputPolicy(input);
22
+ const signals = [givenSignal, policy.signal].filter((one) => one !== void 0);
23
+ const signal = signals.length ? AbortSignal.any(signals) : void 0;
24
+ const cancelled = /* @__PURE__ */ __name(() => new CliError("cancelled", "cancelled \u2014 nothing was stored"), "cancelled");
25
+ if (signal?.aborted)
26
+ throw cancelled();
27
+ if (input.isTTY && policy.noInput)
28
+ throw new CliError("validation_error", "interactive input is disabled \u2014 provide the input through a pipe", {
29
+ reason: "input.required"
30
+ });
31
+ if (!input.isTTY) {
32
+ return (await bufferedInput(input, {
33
+ maxBytes: Math.min(policy.maxBytes ?? MAX_SECRET_INPUT, MAX_SECRET_INPUT),
34
+ ...signal ? { signal } : {}
35
+ })).toString("utf8").trim();
36
+ }
37
+ let muted = false;
38
+ const shim = new Writable({
39
+ write(chunk, _encoding, done) {
40
+ if (!muted)
41
+ output.write(chunk);
42
+ done();
43
+ }
44
+ });
45
+ const reader = createInterface({ input, output: shim, terminal: true });
46
+ const abort = /* @__PURE__ */ __name(() => reader.close(), "abort");
47
+ let bytes = 0;
48
+ let inputFailure;
49
+ const data = /* @__PURE__ */ __name((chunk) => {
50
+ bytes += Buffer.byteLength(chunk);
51
+ if (bytes > Math.min(policy.maxBytes ?? MAX_SECRET_INPUT, MAX_SECRET_INPUT)) {
52
+ inputFailure = new CliError("validation_error", "secret input exceeds its byte limit", {
53
+ reason: "input.too-large",
54
+ retryable: false
55
+ });
56
+ reader.close();
57
+ }
58
+ }, "data");
59
+ const inputError = /* @__PURE__ */ __name((error) => {
60
+ inputFailure = error;
61
+ reader.close();
62
+ }, "inputError");
63
+ input.on("data", data).on("error", inputError);
64
+ try {
65
+ const answer = await new Promise((resolve, reject) => {
66
+ const cancel = /* @__PURE__ */ __name(() => reject(inputFailure ?? cancelled()), "cancel");
67
+ reader.once("SIGINT", cancel);
68
+ reader.once("close", cancel);
69
+ signal?.addEventListener("abort", abort, { once: true });
70
+ const ask = /* @__PURE__ */ __name((tries) => {
71
+ muted = false;
72
+ reader.question(prompt, (line) => {
73
+ if (echo || line.trim() || tries >= EMPTY_TRIES)
74
+ return resolve(line);
75
+ output.write(`
76
+ ${pasteHint()}
77
+ `);
78
+ ask(tries + 1);
79
+ });
80
+ muted = !echo;
81
+ }, "ask");
82
+ ask(1);
83
+ });
84
+ if (!echo && !answer.trim())
85
+ throw new CliError("validation_error", `nothing arrived after ${EMPTY_TRIES} tries. ${pasteHint()}`, {
86
+ reason: "input.empty"
87
+ });
88
+ return answer.trim();
89
+ } finally {
90
+ input.off("data", data).off("error", inputError);
91
+ signal?.removeEventListener("abort", abort);
92
+ reader.close();
93
+ output.write("\n");
94
+ }
95
+ }, "readSecret");
96
+
97
+ export {
98
+ pasteHint,
99
+ readSecret
100
+ };
@@ -0,0 +1,38 @@
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-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/store/driver.js
8
+ var TIME_LIMIT_FUNCTION = "wc_time_limit";
9
+ var TimeLimitReached = class extends Error {
10
+ static {
11
+ __name(this, "TimeLimitReached");
12
+ }
13
+ constructor() {
14
+ super("the statement ran past its time limit");
15
+ this.name = "TimeLimitReached";
16
+ }
17
+ };
18
+ var beforeTimeLimit = /* @__PURE__ */ __name((until) => {
19
+ if (Date.now() > Number(until))
20
+ throw new TimeLimitReached();
21
+ return 1;
22
+ }, "beforeTimeLimit");
23
+ var JOURNAL_SIZE_LIMIT = 64 * 1024 * 1024;
24
+ var PRAGMAS = `
25
+ PRAGMA busy_timeout = 5000;
26
+ PRAGMA journal_mode = WAL;
27
+ PRAGMA journal_size_limit = ${JOURNAL_SIZE_LIMIT};
28
+ PRAGMA foreign_keys = ON;
29
+ `;
30
+ var isQueryOnly = /* @__PURE__ */ __name((database) => Number(Object.values(database.prepare("PRAGMA query_only").get() ?? {})[0]) === 1, "isQueryOnly");
31
+
32
+ export {
33
+ TIME_LIMIT_FUNCTION,
34
+ TimeLimitReached,
35
+ beforeTimeLimit,
36
+ PRAGMAS,
37
+ isQueryOnly
38
+ };
@@ -0,0 +1,21 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+
4
+ // node_modules/.pnpm/@anthropic-ai+sdk@1.3.0_zod@4.6.7/node_modules/@anthropic-ai/sdk/internal/node.mjs
5
+ import * as child_process from "node:child_process";
6
+ import * as crypto from "node:crypto";
7
+ import * as fs from "node:fs";
8
+ import * as os from "node:os";
9
+ import * as path from "node:path";
10
+ import * as stream from "node:stream";
11
+ import * as util from "node:util";
12
+
13
+ export {
14
+ child_process,
15
+ crypto,
16
+ fs,
17
+ os,
18
+ path,
19
+ stream,
20
+ util
21
+ };
@@ -0,0 +1,188 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ stdinFieldOf
5
+ } from "./chunk-X2M6NIQG.js";
6
+ import {
7
+ commandPathOf
8
+ } from "./chunk-NWHEHV3K.js";
9
+ import {
10
+ commandServerRequest,
11
+ metaOf
12
+ } from "./chunk-7ELMWE3P.js";
13
+ import {
14
+ errorObjectOf,
15
+ renderError
16
+ } from "./chunk-TOSCB4SO.js";
17
+ import {
18
+ CliError
19
+ } from "./chunk-DB2XKHI4.js";
20
+ import {
21
+ __name
22
+ } from "./chunk-ZVVMGPBJ.js";
23
+
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/cli/command-server.js
25
+ import { createInterface } from "node:readline";
26
+
27
+ // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
28
+ var COMMAND_SERVER_ARGV = ["commands", "--serve"];
29
+ var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
30
+
31
+ // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/cli/command-server.js
32
+ var COMMAND_SERVER_PROTOCOL = 1;
33
+ var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
34
+ var COMMAND_SERVER_CONCURRENT = 8;
35
+ var runsAlone = /* @__PURE__ */ __name((command) => commandPathOf(command)[0] === "store", "runsAlone");
36
+ var enterCommandServer = /* @__PURE__ */ __name(async (command, cli) => {
37
+ const request = commandServerRequest();
38
+ if (!request)
39
+ return;
40
+ refuseInCommandServer(command, cli);
41
+ if (runsAlone(command))
42
+ await request.alone();
43
+ }, "enterCommandServer");
44
+ var refuseInCommandServer = /* @__PURE__ */ __name((command, cli) => {
45
+ if (!commandServerRequest())
46
+ return;
47
+ const typed = [cli, ...commandPathOf(command)].join(" ");
48
+ const { lifetime } = metaOf(command);
49
+ if (lifetime)
50
+ throw new CliError("validation_error", `\`${typed}\` ${lifetime === "persistent" ? "runs until it is stopped" : "waits on a person"}; the command server runs only commands that return \u2014 start it as a process of its own`);
51
+ if (stdinFieldOf(command))
52
+ throw new CliError("validation_error", `\`${typed}\` reads its input on stdin, which the command server does not pass on \u2014 start it as a process of its own`);
53
+ }, "refuseInCommandServer");
54
+ var refusal = /* @__PURE__ */ __name((cli, message) => `${renderError(errorObjectOf(new CliError("validation_error", message)), { cli, interactive: false })}
55
+ `, "refusal");
56
+ var requestOf = /* @__PURE__ */ __name((line, cli) => {
57
+ let parsed;
58
+ try {
59
+ parsed = JSON.parse(line);
60
+ } catch {
61
+ return { id: null, error: "a request is one JSON object per line" };
62
+ }
63
+ const { id, argv } = parsed ?? {};
64
+ const known = typeof id === "number" && Number.isFinite(id) ? id : null;
65
+ if (known === null)
66
+ return { id: null, error: 'a request needs a numeric "id"' };
67
+ if (!Array.isArray(argv) || !argv.every((word) => typeof word === "string"))
68
+ return { id: known, error: '"argv" is a list of strings' };
69
+ if (isCommandServer(argv))
70
+ return { id: known, error: `\`${cli} commands --serve\` cannot run inside itself` };
71
+ return { id: known, argv };
72
+ }, "requestOf");
73
+ var serveCommands = /* @__PURE__ */ __name(async ({ input, write, run, cli, version, idleMs = COMMAND_SERVER_IDLE_MS, concurrent = COMMAND_SERVER_CONCURRENT, signal }) => {
74
+ const send = /* @__PURE__ */ __name((value) => write(`${JSON.stringify(value)}
75
+ `), "send");
76
+ await send({ ready: true, protocol: COMMAND_SERVER_PROTOCOL, version, concurrent });
77
+ const lines = createInterface({ input, crlfDelay: Number.POSITIVE_INFINITY });
78
+ return new Promise((resolve) => {
79
+ const waiting = [];
80
+ let active = 0;
81
+ let running = 0;
82
+ let gated = false;
83
+ let drained;
84
+ let turns = Promise.resolve();
85
+ let timer;
86
+ let ending = false;
87
+ let done = false;
88
+ const finish = /* @__PURE__ */ __name(() => {
89
+ if (done)
90
+ return;
91
+ done = true;
92
+ clearTimeout(timer);
93
+ lines.close();
94
+ resolve(0);
95
+ }, "finish");
96
+ const settle = /* @__PURE__ */ __name(() => {
97
+ if (running === 0 && drained) {
98
+ const go = drained;
99
+ drained = void 0;
100
+ go();
101
+ }
102
+ pump();
103
+ if (active > 0 || waiting.length > 0 || done)
104
+ return;
105
+ if (ending)
106
+ finish();
107
+ else {
108
+ clearTimeout(timer);
109
+ timer = setTimeout(finish, idleMs);
110
+ }
111
+ }, "settle");
112
+ const start = /* @__PURE__ */ __name((line) => {
113
+ active += 1;
114
+ running += 1;
115
+ let holdsPlace = true;
116
+ let ended = false;
117
+ let turn;
118
+ let release;
119
+ const alone = /* @__PURE__ */ __name(() => {
120
+ if (turn)
121
+ return turn;
122
+ holdsPlace = false;
123
+ running -= 1;
124
+ turn = turns.then(() => new Promise((go) => {
125
+ if (ended)
126
+ return go();
127
+ gated = true;
128
+ drained = /* @__PURE__ */ __name(() => {
129
+ if (ended)
130
+ gated = false;
131
+ else {
132
+ holdsPlace = true;
133
+ running += 1;
134
+ }
135
+ go();
136
+ }, "drained");
137
+ settle();
138
+ }));
139
+ turns = turn.then(() => ended && !holdsPlace ? void 0 : new Promise((free) => release = free));
140
+ return turn;
141
+ }, "alone");
142
+ const answer = /* @__PURE__ */ __name(async () => {
143
+ const request = requestOf(line, cli);
144
+ if ("error" in request)
145
+ return send({ id: request.id, code: 2, stdout: "", stderr: refusal(cli, request.error) });
146
+ const answered = await run(request.argv, alone);
147
+ return send({ id: request.id, ...answered });
148
+ }, "answer");
149
+ answer().catch(finish).finally(() => {
150
+ ended = true;
151
+ active -= 1;
152
+ if (holdsPlace)
153
+ running -= 1;
154
+ if (release) {
155
+ gated = false;
156
+ release();
157
+ }
158
+ settle();
159
+ });
160
+ }, "start");
161
+ const pump = /* @__PURE__ */ __name(() => {
162
+ while (!done && !gated && running < concurrent && waiting.length > 0)
163
+ start(waiting.shift());
164
+ }, "pump");
165
+ lines.on("line", (line) => {
166
+ if (done || ending || line.trim() === "")
167
+ return;
168
+ clearTimeout(timer);
169
+ waiting.push(line);
170
+ pump();
171
+ });
172
+ const end = /* @__PURE__ */ __name(() => {
173
+ ending = true;
174
+ settle();
175
+ }, "end");
176
+ lines.on("close", end);
177
+ if (signal?.aborted)
178
+ end();
179
+ signal?.addEventListener("abort", end, { once: true });
180
+ settle();
181
+ });
182
+ }, "serveCommands");
183
+
184
+ export {
185
+ COMMAND_SERVER_CONCURRENT,
186
+ enterCommandServer,
187
+ serveCommands
188
+ };
@@ -0,0 +1,29 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError,
5
+ singleLine
6
+ } from "./chunk-DB2XKHI4.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-ZVVMGPBJ.js";
10
+
11
+ // node_modules/.pnpm/@wirecat+cli-core@0.687.0_@wirecat+cli-base@0.109.0_commander@15.0.0_esbuild@0.28.2_typ_3e6248e31e5b79d53006284373ddef70/node_modules/@wirecat/cli-core/dist/domain/tags.js
12
+ var TAG_TYPES = ["chat", "contact", "message", "task"];
13
+ var TAG = /^[a-z0-9-]{1,32}$/;
14
+ var tagOf = /* @__PURE__ */ __name((value) => {
15
+ const tag = value.trim().toLowerCase();
16
+ return TAG.test(tag) ? tag : void 0;
17
+ }, "tagOf");
18
+ var normalizeTag = /* @__PURE__ */ __name((value) => {
19
+ const tag = tagOf(value);
20
+ if (tag === void 0)
21
+ throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
22
+ return tag;
23
+ }, "normalizeTag");
24
+
25
+ export {
26
+ TAG_TYPES,
27
+ tagOf,
28
+ normalizeTag
29
+ };