@wirecat/attio-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 (226) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/LICENSE +204 -0
  3. package/README.md +249 -2
  4. package/contracts/wirecat.json +2339 -0
  5. package/dist/bin/attio.d.ts +3 -0
  6. package/dist/bin/attio.d.ts.map +1 -0
  7. package/dist/bin/attio.js +40 -0
  8. package/dist/bin/attio.js.map +1 -0
  9. package/dist/bundle/agent-DYTWDBTT.js +37 -0
  10. package/dist/bundle/all-profiles-LZDKPHN2.js +320 -0
  11. package/dist/bundle/anthropic-BF72H77D.js +91 -0
  12. package/dist/bundle/app-server-H57FZJX5.js +249 -0
  13. package/dist/bundle/attio.js +183 -0
  14. package/dist/bundle/bun-WO77T4LG.js +169 -0
  15. package/dist/bundle/bun-sqlite-2BP7JDVO.js +76 -0
  16. package/dist/bundle/chunk-2E6JGBM5.js +1392 -0
  17. package/dist/bundle/chunk-34FJ26K2.js +54 -0
  18. package/dist/bundle/chunk-3I2FGNWO.js +23 -0
  19. package/dist/bundle/chunk-3NVOKVRY.js +42148 -0
  20. package/dist/bundle/chunk-3YFDZSM3.js +37 -0
  21. package/dist/bundle/chunk-4SMGM2Q6.js +274 -0
  22. package/dist/bundle/chunk-4STBJZR4.js +3571 -0
  23. package/dist/bundle/chunk-5K3FGXZH.js +46 -0
  24. package/dist/bundle/chunk-6ALPRBNV.js +100 -0
  25. package/dist/bundle/chunk-6NDJDDSQ.js +2000 -0
  26. package/dist/bundle/chunk-6SK3YB2B.js +218 -0
  27. package/dist/bundle/chunk-76RRELCU.js +65310 -0
  28. package/dist/bundle/chunk-7MXCUMHG.js +18 -0
  29. package/dist/bundle/chunk-7ZUOI3HY.js +73 -0
  30. package/dist/bundle/chunk-AMUONYQR.js +106 -0
  31. package/dist/bundle/chunk-ASCUOOLO.js +53 -0
  32. package/dist/bundle/chunk-BUGROVF3.js +72 -0
  33. package/dist/bundle/chunk-CHZ26CW5.js +9578 -0
  34. package/dist/bundle/chunk-CMO5ND3Y.js +794 -0
  35. package/dist/bundle/chunk-D72URWJE.js +532 -0
  36. package/dist/bundle/chunk-DF2IIO32.js +12645 -0
  37. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  38. package/dist/bundle/chunk-DQ6P3R4B.js +170 -0
  39. package/dist/bundle/chunk-DSRXCLPO.js +7 -0
  40. package/dist/bundle/chunk-EEPE3SOW.js +338 -0
  41. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  42. package/dist/bundle/chunk-EQGXEKSV.js +1197 -0
  43. package/dist/bundle/chunk-EQXT7KO4.js +388 -0
  44. package/dist/bundle/chunk-ERW2WOJT.js +24 -0
  45. package/dist/bundle/chunk-ESH2QGCA.js +372 -0
  46. package/dist/bundle/chunk-G3JTLVVL.js +771 -0
  47. package/dist/bundle/chunk-G6FQMVKW.js +52 -0
  48. package/dist/bundle/chunk-GBZ6JUXU.js +108 -0
  49. package/dist/bundle/chunk-GLHFJPYS.js +156 -0
  50. package/dist/bundle/chunk-GW4G5KLS.js +2333 -0
  51. package/dist/bundle/chunk-H7QDPW3D.js +78 -0
  52. package/dist/bundle/chunk-HG7FT3H3.js +319 -0
  53. package/dist/bundle/chunk-I3WS6V5H.js +188 -0
  54. package/dist/bundle/chunk-IDU4ESRZ.js +95 -0
  55. package/dist/bundle/chunk-IXCIQ7FZ.js +161 -0
  56. package/dist/bundle/chunk-J5P5VSRG.js +1233 -0
  57. package/dist/bundle/chunk-JA26HG7T.js +353 -0
  58. package/dist/bundle/chunk-JSTBW7F4.js +259 -0
  59. package/dist/bundle/chunk-KHDXRFJZ.js +185 -0
  60. package/dist/bundle/chunk-L5WS6CYZ.js +288 -0
  61. package/dist/bundle/chunk-LWJ4ZGUM.js +407 -0
  62. package/dist/bundle/chunk-MC2RQ2OB.js +38 -0
  63. package/dist/bundle/chunk-MNQACPXG.js +1332 -0
  64. package/dist/bundle/chunk-MOSH2KPD.js +358 -0
  65. package/dist/bundle/chunk-MRREDVPY.js +733 -0
  66. package/dist/bundle/chunk-MT2ZUZRA.js +1028 -0
  67. package/dist/bundle/chunk-O4A33Y54.js +29 -0
  68. package/dist/bundle/chunk-OBXDRUO4.js +63 -0
  69. package/dist/bundle/chunk-OFR3YYT6.js +6848 -0
  70. package/dist/bundle/chunk-P4U6AGWD.js +41 -0
  71. package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
  72. package/dist/bundle/chunk-PMP37KLR.js +142 -0
  73. package/dist/bundle/chunk-Q3JCUUOR.js +80 -0
  74. package/dist/bundle/chunk-Q7BSTQ3T.js +633 -0
  75. package/dist/bundle/chunk-QLHDUYGE.js +16 -0
  76. package/dist/bundle/chunk-RU5J7DWY.js +988 -0
  77. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  78. package/dist/bundle/chunk-S7K2XFQB.js +95 -0
  79. package/dist/bundle/chunk-SQHDE3TC.js +230 -0
  80. package/dist/bundle/chunk-TF7ZGCOK.js +76 -0
  81. package/dist/bundle/chunk-V6BTAILB.js +4072 -0
  82. package/dist/bundle/chunk-VDMIJ3JW.js +50 -0
  83. package/dist/bundle/chunk-VW5F6FK3.js +206 -0
  84. package/dist/bundle/chunk-W6F2CQZ6.js +1068 -0
  85. package/dist/bundle/chunk-WARIIYSW.js +58 -0
  86. package/dist/bundle/chunk-WK7GLHHL.js +334 -0
  87. package/dist/bundle/chunk-X5S5KUSU.js +2788 -0
  88. package/dist/bundle/chunk-X6R74TWX.js +131 -0
  89. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  90. package/dist/bundle/chunk-XXLQNHKF.js +82 -0
  91. package/dist/bundle/chunk-XXOTX4M3.js +362 -0
  92. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  93. package/dist/bundle/chunk-ZDBTYBFR.js +66 -0
  94. package/dist/bundle/chunk-ZGADZ4CH.js +557 -0
  95. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  96. package/dist/bundle/command-contract-7M6EPH3D.js +37 -0
  97. package/dist/bundle/command-server-entry-MNVPYQZ3.js +166 -0
  98. package/dist/bundle/decode-MQNKNXLK.js +297 -0
  99. package/dist/bundle/definitions-FODOIPM2.js +43379 -0
  100. package/dist/bundle/dispatch-TAQ7635E.js +411 -0
  101. package/dist/bundle/dist-EM7KLEG4.js +7577 -0
  102. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  103. package/dist/bundle/echarts-6ZSUNO4L.js +42501 -0
  104. package/dist/bundle/embed-PHCCJJ5Z.js +38 -0
  105. package/dist/bundle/embedder-WLZZQTKZ.js +111 -0
  106. package/dist/bundle/failure-MR2XVHFP.js +25 -0
  107. package/dist/bundle/first-run-64LREHSV.js +29 -0
  108. package/dist/bundle/first-screen-YSCAZIYJ.js +37 -0
  109. package/dist/bundle/instructions-22GCKNR5.js +11 -0
  110. package/dist/bundle/mcp-CNV7F2XZ.js +167 -0
  111. package/dist/bundle/meeting-combined-YX3T5WJD.js +24 -0
  112. package/dist/bundle/meeting-model-JWDTCGLZ.js +25 -0
  113. package/dist/bundle/meeting-semantic-375GYPZQ.js +22 -0
  114. package/dist/bundle/node-ITDTNRRZ.js +176 -0
  115. package/dist/bundle/node-KM3CUABH.js +2340 -0
  116. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  117. package/dist/bundle/node-sqlite-IRAGRMEZ.js +74 -0
  118. package/dist/bundle/oauth-CACOQJEL.js +20 -0
  119. package/dist/bundle/open-HU4KHKDR.js +23 -0
  120. package/dist/bundle/openai-JQUPAVKX.js +238 -0
  121. package/dist/bundle/process-QS5OHEUK.js +91 -0
  122. package/dist/bundle/program-QLCUCR76.js +33428 -0
  123. package/dist/bundle/prompt-VA5MKXJU.js +17 -0
  124. package/dist/bundle/recognize-JGA5IVKC.js +26 -0
  125. package/dist/bundle/remote-NPY2KZQ4.js +31 -0
  126. package/dist/bundle/rerank-4H2QR4XU.js +52 -0
  127. package/dist/bundle/schemas-THAI3G5S.js +21410 -0
  128. package/dist/bundle/serve-UH46SZQG.js +199 -0
  129. package/dist/bundle/server-6H7JS6SU.js +212 -0
  130. package/dist/bundle/server-SR52KBL3.js +79 -0
  131. package/dist/bundle/sqlite-runtime-EJWEUTBR.js +20 -0
  132. package/dist/bundle/state-34B6AUQZ.js +36 -0
  133. package/dist/bundle/store-3R4ILTCJ.js +177 -0
  134. package/dist/bundle/store-XSE35P3U.js +291 -0
  135. package/dist/bundle/store-maintenance-command-ABJARLI4.js +66 -0
  136. package/dist/bundle/surface-NOTIEJB5.js +65 -0
  137. package/dist/commands/api.d.ts +12 -0
  138. package/dist/commands/api.d.ts.map +1 -0
  139. package/dist/commands/api.js +27 -0
  140. package/dist/commands/api.js.map +1 -0
  141. package/dist/commands/crm.d.ts +4 -0
  142. package/dist/commands/crm.d.ts.map +1 -0
  143. package/dist/commands/crm.js +66 -0
  144. package/dist/commands/crm.js.map +1 -0
  145. package/dist/commands/session.d.ts +7 -0
  146. package/dist/commands/session.d.ts.map +1 -0
  147. package/dist/commands/session.js +22 -0
  148. package/dist/commands/session.js.map +1 -0
  149. package/dist/config.d.ts +14 -0
  150. package/dist/config.d.ts.map +1 -0
  151. package/dist/config.js +14 -0
  152. package/dist/config.js.map +1 -0
  153. package/dist/context.d.ts +37 -0
  154. package/dist/context.d.ts.map +1 -0
  155. package/dist/context.js +31 -0
  156. package/dist/context.js.map +1 -0
  157. package/dist/generated/definitions.d.ts +3 -0
  158. package/dist/generated/definitions.d.ts.map +1 -0
  159. package/dist/generated/definitions.js +43375 -0
  160. package/dist/generated/definitions.js.map +1 -0
  161. package/dist/generated/manifest.d.ts +6 -0
  162. package/dist/generated/manifest.d.ts.map +1 -0
  163. package/dist/generated/manifest.js +5158 -0
  164. package/dist/generated/manifest.js.map +1 -0
  165. package/dist/generated/schemas.d.ts +383 -0
  166. package/dist/generated/schemas.d.ts.map +1 -0
  167. package/dist/generated/schemas.js +21196 -0
  168. package/dist/generated/schemas.js.map +1 -0
  169. package/dist/generated/types.d.ts +10166 -0
  170. package/dist/generated/types.d.ts.map +1 -0
  171. package/dist/generated/types.js +5 -0
  172. package/dist/generated/types.js.map +1 -0
  173. package/dist/generated/wirecat-config.d.ts +15 -0
  174. package/dist/generated/wirecat-config.d.ts.map +1 -0
  175. package/dist/generated/wirecat-config.js +333 -0
  176. package/dist/generated/wirecat-config.js.map +1 -0
  177. package/dist/hooks.d.ts +3 -0
  178. package/dist/hooks.d.ts.map +1 -0
  179. package/dist/hooks.js +7 -0
  180. package/dist/hooks.js.map +1 -0
  181. package/dist/identity.d.ts +33 -0
  182. package/dist/identity.d.ts.map +1 -0
  183. package/dist/identity.js +31 -0
  184. package/dist/identity.js.map +1 -0
  185. package/dist/index.d.ts +3 -0
  186. package/dist/index.d.ts.map +1 -0
  187. package/dist/index.js +3 -0
  188. package/dist/index.js.map +1 -0
  189. package/dist/program.d.ts +6 -0
  190. package/dist/program.d.ts.map +1 -0
  191. package/dist/program.js +54 -0
  192. package/dist/program.js.map +1 -0
  193. package/dist/version.d.ts +2 -0
  194. package/dist/version.d.ts.map +1 -0
  195. package/dist/version.js +2 -0
  196. package/dist/version.js.map +1 -0
  197. package/dist/wcat.d.ts +3 -0
  198. package/dist/wcat.d.ts.map +1 -0
  199. package/dist/wcat.js +4 -0
  200. package/dist/wcat.js.map +1 -0
  201. package/package.json +87 -4
  202. package/skills/attio-cli/SKILL.md +58 -0
  203. package/skills/attio-cli/references/api/api-activities.md +62 -0
  204. package/skills/attio-cli/references/api/api-activity-records.md +96 -0
  205. package/skills/attio-cli/references/api/api-attributes.md +148 -0
  206. package/skills/attio-cli/references/api/api-call-recordings.md +53 -0
  207. package/skills/attio-cli/references/api/api-comments.md +36 -0
  208. package/skills/attio-cli/references/api/api-emails.md +23 -0
  209. package/skills/attio-cli/references/api/api-entries.md +127 -0
  210. package/skills/attio-cli/references/api/api-files.md +63 -0
  211. package/skills/attio-cli/references/api/api-lists.md +44 -0
  212. package/skills/attio-cli/references/api/api-meetings.md +82 -0
  213. package/skills/attio-cli/references/api/api-meta.md +8 -0
  214. package/skills/attio-cli/references/api/api-notes.md +64 -0
  215. package/skills/attio-cli/references/api/api-objects.md +55 -0
  216. package/skills/attio-cli/references/api/api-records.md +168 -0
  217. package/skills/attio-cli/references/api/api-sequences.md +15 -0
  218. package/skills/attio-cli/references/api/api-sql.md +15 -0
  219. package/skills/attio-cli/references/api/api-tasks.md +67 -0
  220. package/skills/attio-cli/references/api/api-threads.md +35 -0
  221. package/skills/attio-cli/references/api/api-transcripts.md +17 -0
  222. package/skills/attio-cli/references/api/api-views.md +133 -0
  223. package/skills/attio-cli/references/api/api-webhooks.md +62 -0
  224. package/skills/attio-cli/references/api/api-workspace-blocklist.md +39 -0
  225. package/skills/attio-cli/references/api/api-workspace-members.md +19 -0
  226. package/skills/attio-cli/references/api.md +35 -0
@@ -0,0 +1,78 @@
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.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/http/listen.js
8
+ import { createServer } from "node:http";
9
+ import { Readable } from "node:stream";
10
+ var MAX_BODY = 4 * 1024 * 1024;
11
+ var TooLarge = class extends Error {
12
+ static {
13
+ __name(this, "TooLarge");
14
+ }
15
+ };
16
+ var readBody = /* @__PURE__ */ __name((incoming, limit) => new Promise((resolve, reject) => {
17
+ if (Number(incoming.headers["content-length"] ?? 0) > limit)
18
+ return reject(new TooLarge());
19
+ const chunks = [];
20
+ let size = 0;
21
+ incoming.on("data", (chunk) => {
22
+ size += chunk.length;
23
+ if (size > limit) {
24
+ incoming.destroy();
25
+ reject(new TooLarge());
26
+ } else
27
+ chunks.push(chunk);
28
+ });
29
+ incoming.once("end", () => resolve(Buffer.concat(chunks)));
30
+ incoming.once("error", reject);
31
+ }), "readBody");
32
+ var toRequest = /* @__PURE__ */ __name(async (incoming, origin, maxBody) => {
33
+ const headers = new Headers();
34
+ for (const [name, value] of Object.entries(incoming.headers)) {
35
+ if (Array.isArray(value))
36
+ for (const one of value)
37
+ headers.append(name, one);
38
+ else if (value !== void 0)
39
+ headers.set(name, value);
40
+ }
41
+ const method = incoming.method ?? "GET";
42
+ const body = method === "GET" || method === "HEAD" ? void 0 : await readBody(incoming, maxBody);
43
+ if (body)
44
+ headers.set("content-length", String(body.length));
45
+ return new Request(new URL(incoming.url ?? "/", origin), { method, headers, ...body ? { body } : {} });
46
+ }, "toRequest");
47
+ var send = /* @__PURE__ */ __name(async (response, outgoing) => {
48
+ outgoing.writeHead(response.status, Object.fromEntries(response.headers));
49
+ if (!response.body)
50
+ return void outgoing.end();
51
+ const body = Readable.fromWeb(response.body);
52
+ outgoing.once("close", () => body.destroy());
53
+ body.pipe(outgoing);
54
+ }, "send");
55
+ var listen = /* @__PURE__ */ __name((handle, { host, port, maxBody = MAX_BODY }) => new Promise((resolve, reject) => {
56
+ const server = createServer((incoming, outgoing) => {
57
+ toRequest(incoming, `http://${host}`, maxBody).then(handle).then((response) => send(response, outgoing)).catch((error) => {
58
+ if (!outgoing.headersSent)
59
+ outgoing.writeHead(error instanceof TooLarge ? 413 : 500, { connection: "close" });
60
+ outgoing.end();
61
+ });
62
+ });
63
+ server.once("error", reject);
64
+ server.listen(port, host, () => {
65
+ const { port: bound } = server.address();
66
+ resolve({
67
+ url: new URL(`http://${host}:${bound}`),
68
+ close: /* @__PURE__ */ __name(() => new Promise((done) => {
69
+ server.close(() => done());
70
+ server.closeAllConnections();
71
+ }), "close")
72
+ });
73
+ });
74
+ }), "listen");
75
+
76
+ export {
77
+ listen
78
+ };
@@ -0,0 +1,319 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ wrapAnsi
5
+ } from "./chunk-EH6ZEJGT.js";
6
+ import {
7
+ WIRECAT_TOOLS
8
+ } from "./chunk-IDU4ESRZ.js";
9
+ import {
10
+ commandPathOf,
11
+ outputOf
12
+ } from "./chunk-X6R74TWX.js";
13
+ import {
14
+ Command,
15
+ Help,
16
+ NO_EFFECTS,
17
+ Option,
18
+ annotate,
19
+ commandAt,
20
+ environmentOf,
21
+ metaOf,
22
+ takesProfile
23
+ } from "./chunk-DF2IIO32.js";
24
+ import {
25
+ writes
26
+ } from "./chunk-J5P5VSRG.js";
27
+ import {
28
+ CliError
29
+ } from "./chunk-BUGROVF3.js";
30
+ import {
31
+ __name
32
+ } from "./chunk-ZVVMGPBJ.js";
33
+
34
+ // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/cli/help/command-help.js
35
+ var ARGUMENT_KINDS = {
36
+ chat: "chat",
37
+ chats: "chat",
38
+ message: "message",
39
+ messages: "message",
40
+ post: "message",
41
+ person: "person",
42
+ people: "person",
43
+ task: "task",
44
+ meeting: "meeting",
45
+ folder: "folder",
46
+ folders: "folder",
47
+ topic: "topic",
48
+ note: "note",
49
+ document: "document",
50
+ model: "model"
51
+ };
52
+ var ENTITY_KINDS = {
53
+ message: "message",
54
+ message_link: "message",
55
+ chat: "chat",
56
+ contact: "person",
57
+ member: "person",
58
+ person: "person",
59
+ task: "task",
60
+ meeting: "meeting",
61
+ meeting_details: "meeting",
62
+ meeting_hit: "meeting",
63
+ meeting_summary: "meeting",
64
+ folder: "folder",
65
+ topic: "topic",
66
+ note: "note",
67
+ document: "document",
68
+ model: "model"
69
+ };
70
+ var HOME = {
71
+ chat: "chats",
72
+ message: "messages",
73
+ person: "contacts",
74
+ task: "tasks",
75
+ meeting: "meetings",
76
+ folder: "folders",
77
+ topic: "topics",
78
+ note: "notes",
79
+ document: "documents",
80
+ model: "models"
81
+ };
82
+ var SAMPLES = {
83
+ chat: "Team",
84
+ message: "1234",
85
+ post: "1234",
86
+ person: "Anna",
87
+ people: "Anna",
88
+ task: "12",
89
+ meeting: "123",
90
+ folder: "Work",
91
+ topic: "General",
92
+ model: "default",
93
+ query: '"invoice"',
94
+ text: '"on my way"',
95
+ title: '"Weekly sync"',
96
+ name: "daily",
97
+ id: "1",
98
+ file: "./report.pdf",
99
+ link: "https://example.com/join/abc",
100
+ url: "https://example.com",
101
+ since: "1d",
102
+ duration: "1d",
103
+ limit: "20"
104
+ };
105
+ var MAX_NEXT = 3;
106
+ var choices = /* @__PURE__ */ new WeakMap();
107
+ var kindOfArgument = /* @__PURE__ */ __name((argument) => ARGUMENT_KINDS[argument.name()], "kindOfArgument");
108
+ var runs = /* @__PURE__ */ __name((command) => command.commands.length === 0 || Boolean(command._actionHandler), "runs");
109
+ var leaves = /* @__PURE__ */ __name((command) => command.commands.filter((child) => !child._hidden).flatMap((child) => [...runs(child) ? [child] : [], ...leaves(child)]), "leaves");
110
+ var rootOf = /* @__PURE__ */ __name((command) => {
111
+ let at = command;
112
+ while (at.parent)
113
+ at = at.parent;
114
+ return at;
115
+ }, "rootOf");
116
+ var call = /* @__PURE__ */ __name((command) => [
117
+ rootOf(command).name(),
118
+ ...commandPathOf(command),
119
+ ...command.registeredArguments.map((one) => one.required ? `<${one.name()}>` : `[${one.name()}]`)
120
+ ].join(" "), "call");
121
+ var fieldsOf = /* @__PURE__ */ __name((schema) => {
122
+ const variants = schema.anyOf;
123
+ if (variants)
124
+ return variants.flatMap(fieldsOf);
125
+ const required = schema.required ?? [];
126
+ return [...required, ...Object.keys(schema.properties ?? {})];
127
+ }, "fieldsOf");
128
+ var returnsOf = /* @__PURE__ */ __name((command) => {
129
+ const output = metaOf(command).output;
130
+ const { item, coverage } = outputOf(command);
131
+ if (!output || coverage !== "declared-entity")
132
+ return "";
133
+ const fields = [...new Set(fieldsOf(item))];
134
+ const noun = (output.view ? `${output.entity} ${output.view}` : output.entity).replaceAll("_", " ");
135
+ const more = fields.length > 8 ? `, and ${fields.length - 8} more` : "";
136
+ const root = rootOf(command);
137
+ const schema = commandAt(root, "commands info") ? `; every field: ${root.name()} commands info ${commandPathOf(command).join(" ")}` : "";
138
+ return `${noun} \u2014 ${fields.slice(0, 8).join(", ")}${more}${schema}`;
139
+ }, "returnsOf");
140
+ var nextOf = /* @__PURE__ */ __name((command) => {
141
+ const root = rootOf(command);
142
+ const choice = choices.get(command) ?? {};
143
+ const drop = new Set(choice.drop ?? []);
144
+ const pinned = (choice.pin ?? []).flatMap((path) => commandAt(root, path) ?? []);
145
+ const output = metaOf(command).output;
146
+ const kind = output ? ENTITY_KINDS[output.entity] : void 0;
147
+ const all = leaves(root);
148
+ const derived = kind ? all.filter((other) => other !== command && !pinned.includes(other)).filter((other) => other.registeredArguments.some((argument) => kindOfArgument(argument) === kind)).map((other, order) => ({ other, order })).sort((a, b) => {
149
+ const rank = /* @__PURE__ */ __name((other) => [
150
+ Number(writes(metaOf(other).effects)),
151
+ Number(!other.registeredArguments.some((one) => one.required && kindOfArgument(one) === kind)),
152
+ Number(commandPathOf(other)[0] !== HOME[kind]),
153
+ Number(other.parent !== command.parent)
154
+ ], "rank");
155
+ const [left, right] = [rank(a.other), rank(b.other)];
156
+ return left.reduce((found, value, at) => found || value - (right[at] ?? 0), 0) || a.order - b.order;
157
+ }).map(({ other }) => other) : [];
158
+ return [...pinned, ...derived].filter((other) => !drop.has(commandPathOf(other).join(" "))).slice(0, MAX_NEXT);
159
+ }, "nextOf");
160
+ var sample = /* @__PURE__ */ __name((name) => SAMPLES[name] ?? `<${name}>`, "sample");
161
+ var generatedExample = /* @__PURE__ */ __name((command) => {
162
+ const { query } = metaOf(command);
163
+ const words = command.registeredArguments.flatMap((argument) => {
164
+ const name = argument.name();
165
+ if (name === "query" && query)
166
+ return [];
167
+ if (!argument.required && SAMPLES[name] === void 0)
168
+ return [];
169
+ return [argument.argChoices?.[0] ?? sample(name)];
170
+ });
171
+ const options = command.options.filter((option) => option.mandatory).flatMap((option) => {
172
+ const flag = option.long ?? option.short ?? option.flags;
173
+ const placeholder = /[<[]([^>\]]+)[>\]]/.exec(option.flags)?.[1];
174
+ if (!(option.required || option.optional))
175
+ return [flag];
176
+ return [flag, option.argChoices?.[0] ?? sample(placeholder ?? option.attributeName())];
177
+ });
178
+ return [rootOf(command).name(), ...commandPathOf(command), ...words, ...options].join(" ");
179
+ }, "generatedExample");
180
+ var profiled = /* @__PURE__ */ new WeakSet();
181
+ var EXAMPLE_PROFILE = "personal";
182
+ var withProfile = /* @__PURE__ */ __name((command, example) => {
183
+ const root = rootOf(command);
184
+ const top = commandPathOf(command)[0];
185
+ if (!profiled.has(root) || top === void 0 || !takesProfile(command))
186
+ return example;
187
+ if (example.split(" ").includes("--profiles"))
188
+ return example;
189
+ const prefix = `${root.name()} ${top}`;
190
+ return example === prefix || example.startsWith(`${prefix} `) ? `${root.name()} ${EXAMPLE_PROFILE} ${example.slice(root.name().length + 1)}` : example;
191
+ }, "withProfile");
192
+ var commandHelp = /* @__PURE__ */ __name((command) => {
193
+ const written = metaOf(command).examples ?? [];
194
+ return {
195
+ returns: returnsOf(command),
196
+ next: nextOf(command).map(call),
197
+ examples: (written.length > 0 ? written : [generatedExample(command)]).map((one) => withProfile(command, one)),
198
+ origin: written.length > 0 ? "written" : "generated"
199
+ };
200
+ }, "commandHelp");
201
+ var LABEL = 15;
202
+ var commandHelpText = /* @__PURE__ */ __name((command) => {
203
+ const { returns, next, examples } = commandHelp(command);
204
+ const rows = /* @__PURE__ */ __name((label, values) => values.map((value, at) => `${(at === 0 ? label : "").padEnd(LABEL)}${value}`), "rows");
205
+ const availability = environmentOf(command).discoveryAvailability?.({
206
+ ...metaOf(command),
207
+ path: commandPathOf(command)
208
+ });
209
+ const profileMatters = profiled.has(rootOf(command)) && takesProfile(command);
210
+ const access = !availability ? [] : availability.available ? profileMatters ? rows("Availability:", ["available for this profile"]) : [] : rows("Availability:", [`unavailable \u2014 ${availability.reason}`]);
211
+ return [
212
+ "",
213
+ ...access,
214
+ ...rows("Returns:", returns ? [returns] : []),
215
+ ...rows("Next usually:", next),
216
+ ...rows("Example:", examples),
217
+ ""
218
+ ].join("\n");
219
+ }, "commandHelpText");
220
+ var installCommandHelp = /* @__PURE__ */ __name((program, { profile = true } = {}) => {
221
+ if (profile)
222
+ profiled.add(program);
223
+ for (const command of leaves(program))
224
+ command.addHelpText("after", () => commandHelpText(command));
225
+ }, "installCommandHelp");
226
+
227
+ // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/cli/help/first-screen.js
228
+ var WIDTH = 100;
229
+ var widest = /* @__PURE__ */ __name((texts) => texts.reduce((most, text) => Math.max(most, text.length), 0), "widest");
230
+ var block = /* @__PURE__ */ __name((title, rows, column) => rows.length === 0 ? [] : ["", `${title}:`, ...rows.map(([left, right]) => ` ${left.padEnd(column)}${right}`)], "block");
231
+ var TOPICS = [
232
+ ["--json", "output"],
233
+ ["--offline", "offline"],
234
+ ["--timeout", "timeouts"],
235
+ ["--dry-run", "dry run"]
236
+ ];
237
+ var optionTopics = /* @__PURE__ */ __name((program) => {
238
+ const longs = new Set(program.options.map((option) => option.long));
239
+ const topics = TOPICS.filter(([long]) => longs.has(long)).map(([, topic]) => topic);
240
+ return topics.length > 0 ? topics.join(", ") : "the options every command takes";
241
+ }, "optionTopics");
242
+ var pointers = /* @__PURE__ */ __name((program, cli, start, profile) => {
243
+ const has = /* @__PURE__ */ __name((path) => commandAt(program, path) !== void 0, "has");
244
+ const next = [
245
+ has("commands") ? [`${cli} commands`, "every command, by section"] : void 0,
246
+ has("guide") ? [`${cli} guide`, "scenarios: command sequences for common tasks"] : void 0,
247
+ [`${cli} help options`, optionTopics(program)]
248
+ ].filter((row) => row !== void 0);
249
+ const rows = [
250
+ ...start ? [["Start here:", start, profile ? "(any profile name works)" : ""]] : [],
251
+ ...has("account list") ? [["", `${cli} account list`, "your profiles and their logged-in accounts"]] : [],
252
+ ...next.map(([command = "", does = ""], at) => [at === 0 ? "Next:" : "", command, does]),
253
+ ...has("skill show") ? [["For agents:", `${cli} skill show`, "rules and the discovery loop"]] : []
254
+ ];
255
+ const width = widest(rows.map(([, command]) => command)) + 2;
256
+ return ["", ...rows.map(([label, command, does]) => `${label.padEnd(14)}${command.padEnd(width)}${does}`.trimEnd())];
257
+ }, "pointers");
258
+ var firstScreen = /* @__PURE__ */ __name((program, screen = {}) => {
259
+ const cli = program.name();
260
+ const profile = screen.profile !== false;
261
+ const pitch = screen.pitch ?? program.description().split("\n")[0] ?? "";
262
+ const can = (screen.can ?? []).map(({ command, does }) => [command, does]);
263
+ const works = WIRECAT_TOOLS.filter((tool) => tool.command !== cli).map(({ command, shown, does }) => [shown ?? command, does]);
264
+ const column = Math.max(22, widest([...can, ...works].map(([left]) => left))) + 2;
265
+ const start = screen.start ?? (commandAt(program, "setup") ? `${cli} ${EXAMPLE_PROFILE} setup` : void 0);
266
+ return [
267
+ wrapAnsi(`${cli} \u2014 ${pitch}`, WIDTH),
268
+ "",
269
+ `Usage: ${cli} ${profile ? "<profile> " : ""}<command> [options]`,
270
+ ...profile ? ["Account commands start with your profile, a name you choose; none is ever assumed."] : [],
271
+ ...block("What you can do", can, column),
272
+ ...block("Works with", works, column),
273
+ ...pointers(program, cli, start, profile),
274
+ ""
275
+ ].join("\n");
276
+ }, "firstScreen");
277
+ var optionsScreen = /* @__PURE__ */ __name((program) => {
278
+ const helper = program.createHelp();
279
+ const width = helper.longestOptionTermLength(program, helper);
280
+ return [
281
+ `Options for every ${program.name()} command:`,
282
+ ...helper.visibleOptions(program).map((option) => helper.formatItem(helper.optionTerm(option), width, helper.optionDescription(option), helper)),
283
+ ""
284
+ ].join("\n");
285
+ }, "optionsScreen");
286
+ var installHelp = /* @__PURE__ */ __name((program, screen = {}) => {
287
+ let full = false;
288
+ const own = program.configureHelp();
289
+ program.configureHelp({
290
+ ...own,
291
+ // Commander copies this configuration to children made with `.command()`, so only the root gets the screen.
292
+ formatHelp: /* @__PURE__ */ __name((command, helper) => command === program && !full ? firstScreen(program, screen) : (own.formatHelp ?? Help.prototype.formatHelp).call(helper, command, helper), "formatHelp")
293
+ });
294
+ installCommandHelp(program, { profile: screen.profile !== false });
295
+ program.addOption(new Option("--help-all", "the full help: every command and option").hideHelp());
296
+ program.on("option:help-all", () => {
297
+ full = true;
298
+ program.help();
299
+ });
300
+ if (program.commands.some((command) => command.name() === "help"))
301
+ return program;
302
+ const help = annotate(new Command("help"), { effects: NO_EFFECTS, mcp: false }).description("this screen; help options: the options for every command; help <command>: that command's help").argument("[topic...]", "options, or a command path").action((topic) => {
303
+ if (topic.length === 0)
304
+ return program.outputHelp();
305
+ if (topic.length === 1 && topic[0] === "options")
306
+ return program.configureOutput().writeOut?.(optionsScreen(program));
307
+ const command = commandAt(program, topic.join(" "));
308
+ if (!command)
309
+ throw new CliError("validation_error", `no command "${topic.join(" ")}" \u2014 run \`${program.name()} help\`, or \`${program.name()} help options\``, { available: program.commands.map((one) => one.name()).filter((name) => name !== "help") });
310
+ command.outputHelp();
311
+ });
312
+ program.addCommand(help, { hidden: true });
313
+ return program;
314
+ }, "installHelp");
315
+
316
+ export {
317
+ firstScreen,
318
+ installHelp
319
+ };
@@ -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-7MXCUMHG.js";
6
+ import {
7
+ commandPathOf
8
+ } from "./chunk-X6R74TWX.js";
9
+ import {
10
+ commandServerRequest,
11
+ metaOf
12
+ } from "./chunk-DF2IIO32.js";
13
+ import {
14
+ errorObjectOf,
15
+ renderError
16
+ } from "./chunk-J5P5VSRG.js";
17
+ import {
18
+ CliError
19
+ } from "./chunk-BUGROVF3.js";
20
+ import {
21
+ __name
22
+ } from "./chunk-ZVVMGPBJ.js";
23
+
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/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.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/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.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/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,95 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+
4
+ // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/ports/wirecat-tools.js
5
+ var WIRECAT_TOOLS = [
6
+ {
7
+ command: "tg",
8
+ appName: "tg-cli",
9
+ envPrefix: "TG",
10
+ package: "@wirecat/tg-cli",
11
+ does: "Telegram in the same local store: search, review and tasks offline"
12
+ },
13
+ {
14
+ command: "max",
15
+ appName: "max-cli",
16
+ envPrefix: "MAX",
17
+ package: "@wirecat/max-cli",
18
+ does: "MAX in the same local store: search, review and tasks offline"
19
+ },
20
+ {
21
+ command: "wa",
22
+ appName: "whatsapp-cli",
23
+ envPrefix: "WA",
24
+ package: "@wirecat/whatsapp-cli",
25
+ does: "WhatsApp in the same local store: search, review and tasks offline"
26
+ },
27
+ {
28
+ command: "zm",
29
+ appName: "zoom-cli",
30
+ envPrefix: "ZM",
31
+ package: "@wirecat/zoom-cli",
32
+ does: "Zoom meetings: transcripts and summaries, searchable with your other WireCat data"
33
+ },
34
+ {
35
+ command: "drive",
36
+ appName: "drive-cli",
37
+ envPrefix: "DRIVE",
38
+ package: "@wirecat/drive-cli",
39
+ does: "Google Drive and Docs as local text, searchable with your other WireCat data"
40
+ },
41
+ {
42
+ command: "gcal",
43
+ appName: "gcal-cli",
44
+ envPrefix: "GCAL",
45
+ package: "@wirecat/gcal-cli",
46
+ does: "Google Calendar events, searchable with your other WireCat data"
47
+ },
48
+ {
49
+ command: "memo",
50
+ appName: "cli-memo",
51
+ envPrefix: "MEMO",
52
+ package: "@wirecat/cli-memo",
53
+ shown: "memo context <person>",
54
+ does: "one person across messengers, mail, notes and meetings"
55
+ },
56
+ {
57
+ command: "mail",
58
+ appName: "mail-cli",
59
+ envPrefix: "MAIL",
60
+ package: "@wirecat/mail-cli",
61
+ does: "IMAP mail in the same local store: search your mailbox offline, next to your other WireCat data"
62
+ },
63
+ {
64
+ command: "b24",
65
+ appName: "bitrix24-cli",
66
+ envPrefix: "B24",
67
+ package: "@wirecat/bitrix24-cli",
68
+ does: "Bitrix24 CRM: deals, leads and pipelines, searchable with your other WireCat data"
69
+ },
70
+ {
71
+ command: "pbx",
72
+ appName: "asterisk-cli",
73
+ envPrefix: "PBX",
74
+ package: "@wirecat/asterisk-cli",
75
+ does: "Asterisk PBX calls and recordings, searchable with your other WireCat data"
76
+ },
77
+ {
78
+ command: "notion",
79
+ appName: "notion-cli",
80
+ envPrefix: "WCNOTION",
81
+ package: "@wirecat/notion-cli",
82
+ does: "Notion pages and databases as local text, searchable with your other WireCat data"
83
+ },
84
+ {
85
+ command: "ydisk",
86
+ appName: "yandex-disk-cli",
87
+ envPrefix: "YDISK",
88
+ package: "@wirecat/yandex-disk-cli",
89
+ does: "Yandex Disk folders as local text, searchable with your other WireCat data"
90
+ }
91
+ ];
92
+
93
+ export {
94
+ WIRECAT_TOOLS
95
+ };