@wirecat/attio-cli 0.0.0-stage → 0.1.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 (242) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +204 -0
  3. package/README.md +248 -2
  4. package/contracts/wirecat.json +2321 -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-KLBL3FYD.js +37 -0
  10. package/dist/bundle/all-profiles-C2NMRQPE.js +320 -0
  11. package/dist/bundle/anthropic-KOU2ILDK.js +91 -0
  12. package/dist/bundle/app-server-TINV4NNY.js +249 -0
  13. package/dist/bundle/attio.js +183 -0
  14. package/dist/bundle/bun-GVNM6IWY.js +169 -0
  15. package/dist/bundle/bun-sqlite-IF6B3EQI.js +76 -0
  16. package/dist/bundle/chunk-2343HKEW.js +362 -0
  17. package/dist/bundle/chunk-2H2MWGBD.js +988 -0
  18. package/dist/bundle/chunk-2P7ENEQ7.js +288 -0
  19. package/dist/bundle/chunk-4EYKJLWI.js +771 -0
  20. package/dist/bundle/chunk-4HQDT5PF.js +338 -0
  21. package/dist/bundle/chunk-4QE4L7UL.js +142 -0
  22. package/dist/bundle/chunk-4XHWGJXT.js +6848 -0
  23. package/dist/bundle/chunk-5DCRHSBI.js +72 -0
  24. package/dist/bundle/chunk-5ETXE5KF.js +372 -0
  25. package/dist/bundle/chunk-5WAGTWCS.js +156 -0
  26. package/dist/bundle/chunk-6B5PSQQ7.js +319 -0
  27. package/dist/bundle/chunk-6BVPS2YY.js +230 -0
  28. package/dist/bundle/chunk-6L5EUGLP.js +188 -0
  29. package/dist/bundle/chunk-7NFEMS4A.js +1028 -0
  30. package/dist/bundle/chunk-A7YQTQ5U.js +733 -0
  31. package/dist/bundle/chunk-AEPOHR4Z.js +82 -0
  32. package/dist/bundle/chunk-ARRQVUJ2.js +334 -0
  33. package/dist/bundle/chunk-BHNFRL3H.js +95 -0
  34. package/dist/bundle/chunk-CBPL3GID.js +23 -0
  35. package/dist/bundle/chunk-D72URWJE.js +532 -0
  36. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  37. package/dist/bundle/chunk-DVN54VPI.js +16 -0
  38. package/dist/bundle/chunk-DW3V7GTY.js +388 -0
  39. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  40. package/dist/bundle/chunk-ETSOG6TZ.js +65288 -0
  41. package/dist/bundle/chunk-FJV3MO57.js +29 -0
  42. package/dist/bundle/chunk-HLLRNP2G.js +170 -0
  43. package/dist/bundle/chunk-HQJ2TABD.js +18 -0
  44. package/dist/bundle/chunk-ICUXAOEM.js +42063 -0
  45. package/dist/bundle/chunk-IGALQ74S.js +358 -0
  46. package/dist/bundle/chunk-IPHUAWFG.js +100 -0
  47. package/dist/bundle/chunk-IYMWUL6E.js +633 -0
  48. package/dist/bundle/chunk-JKCXDIGC.js +52 -0
  49. package/dist/bundle/chunk-JTOKDROB.js +95 -0
  50. package/dist/bundle/chunk-JZMGOVCZ.js +80 -0
  51. package/dist/bundle/chunk-KB3YJJPN.js +794 -0
  52. package/dist/bundle/chunk-KD4EUUER.js +37 -0
  53. package/dist/bundle/chunk-LB6D4QF2.js +2333 -0
  54. package/dist/bundle/chunk-LWUJZ2E3.js +108 -0
  55. package/dist/bundle/chunk-MCQOXTAL.js +53 -0
  56. package/dist/bundle/chunk-MMGCGPKM.js +3571 -0
  57. package/dist/bundle/chunk-MXDIXBIV.js +24 -0
  58. package/dist/bundle/chunk-MYVWV5L5.js +407 -0
  59. package/dist/bundle/chunk-MZNRIH3T.js +1233 -0
  60. package/dist/bundle/chunk-NEFILPPV.js +353 -0
  61. package/dist/bundle/chunk-O6CVJGGL.js +131 -0
  62. package/dist/bundle/chunk-OPXCRQTV.js +161 -0
  63. package/dist/bundle/chunk-PKNFA5TU.js +38 -0
  64. package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
  65. package/dist/bundle/chunk-PO6PLQYL.js +50 -0
  66. package/dist/bundle/chunk-PWUQC2GI.js +218 -0
  67. package/dist/bundle/chunk-QCEEPJNN.js +185 -0
  68. package/dist/bundle/chunk-QG4WCLGB.js +1332 -0
  69. package/dist/bundle/chunk-QNQ2OF24.js +9578 -0
  70. package/dist/bundle/chunk-RCKRXBJF.js +1392 -0
  71. package/dist/bundle/chunk-RK4GN2II.js +2000 -0
  72. package/dist/bundle/chunk-RRH7UK7L.js +106 -0
  73. package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
  74. package/dist/bundle/chunk-S7WJXELM.js +58 -0
  75. package/dist/bundle/chunk-SBRFKB77.js +1197 -0
  76. package/dist/bundle/chunk-SP6DPFZ4.js +4072 -0
  77. package/dist/bundle/chunk-SWJDLFDM.js +557 -0
  78. package/dist/bundle/chunk-TWCVCW5T.js +66 -0
  79. package/dist/bundle/chunk-V2R2BJJU.js +63 -0
  80. package/dist/bundle/chunk-V5K3M7FE.js +78 -0
  81. package/dist/bundle/chunk-V6ALLFEE.js +1068 -0
  82. package/dist/bundle/chunk-V6EVJXLO.js +259 -0
  83. package/dist/bundle/chunk-VJ4CPL6F.js +54 -0
  84. package/dist/bundle/chunk-VL25A6V2.js +41 -0
  85. package/dist/bundle/chunk-WBEZZGZE.js +12645 -0
  86. package/dist/bundle/chunk-WIYAMDPP.js +73 -0
  87. package/dist/bundle/chunk-WRJGITBX.js +76 -0
  88. package/dist/bundle/chunk-XHIVZPQ2.js +7 -0
  89. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  90. package/dist/bundle/chunk-XTQIXZVM.js +2788 -0
  91. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  92. package/dist/bundle/chunk-YKN4Y35P.js +206 -0
  93. package/dist/bundle/chunk-ZMJZQGCN.js +46 -0
  94. package/dist/bundle/chunk-ZPSH27BB.js +274 -0
  95. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  96. package/dist/bundle/command-contract-3FR7BK72.js +37 -0
  97. package/dist/bundle/command-server-entry-4XR4GDS7.js +166 -0
  98. package/dist/bundle/decode-24EITKP4.js +297 -0
  99. package/dist/bundle/definitions-HU62PG4L.js +43364 -0
  100. package/dist/bundle/dispatch-VE6CXCJW.js +411 -0
  101. package/dist/bundle/dist-PAKDDIBT.js +191 -0
  102. package/dist/bundle/dist-ZSNEZYVF.js +7577 -0
  103. package/dist/bundle/echarts-LEVLEF7L.js +42501 -0
  104. package/dist/bundle/embed-G6FGY3VZ.js +38 -0
  105. package/dist/bundle/embedder-B6LNMXZZ.js +111 -0
  106. package/dist/bundle/failure-ASVFQXMF.js +25 -0
  107. package/dist/bundle/first-run-NVXVVALW.js +29 -0
  108. package/dist/bundle/first-screen-N3IPK5AT.js +37 -0
  109. package/dist/bundle/instructions-F3KPYMJK.js +11 -0
  110. package/dist/bundle/mcp-BUCB5ZPE.js +167 -0
  111. package/dist/bundle/meeting-combined-7FREWXMB.js +24 -0
  112. package/dist/bundle/meeting-model-GJPAIUQL.js +25 -0
  113. package/dist/bundle/meeting-semantic-YWY645AH.js +22 -0
  114. package/dist/bundle/node-KM3CUABH.js +2340 -0
  115. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  116. package/dist/bundle/node-WVUZSDLD.js +176 -0
  117. package/dist/bundle/node-sqlite-V4NNKABG.js +74 -0
  118. package/dist/bundle/oauth-7CENTQIN.js +20 -0
  119. package/dist/bundle/open-OLTONZBG.js +23 -0
  120. package/dist/bundle/openai-M6ES74YN.js +238 -0
  121. package/dist/bundle/process-VFIFK5KO.js +91 -0
  122. package/dist/bundle/program-N72VUDXM.js +33418 -0
  123. package/dist/bundle/prompt-TNWPBEBB.js +17 -0
  124. package/dist/bundle/recognize-PV2WOUWS.js +26 -0
  125. package/dist/bundle/remote-3F6JACS5.js +31 -0
  126. package/dist/bundle/rerank-33C67PIV.js +52 -0
  127. package/dist/bundle/schemas-RLDEALIJ.js +21410 -0
  128. package/dist/bundle/serve-3DEMACSQ.js +199 -0
  129. package/dist/bundle/server-AAK2HWQM.js +79 -0
  130. package/dist/bundle/server-LIBRGMUZ.js +212 -0
  131. package/dist/bundle/sqlite-runtime-SMAREHYG.js +20 -0
  132. package/dist/bundle/state-WPHAVJIU.js +36 -0
  133. package/dist/bundle/store-A7V4FEXE.js +177 -0
  134. package/dist/bundle/store-PMAPJNXT.js +291 -0
  135. package/dist/bundle/store-maintenance-command-QHRHAEYN.js +66 -0
  136. package/dist/bundle/surface-MN4RTNYW.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/comments.d.ts +3 -0
  142. package/dist/commands/comments.d.ts.map +1 -0
  143. package/dist/commands/comments.js +114 -0
  144. package/dist/commands/comments.js.map +1 -0
  145. package/dist/commands/crm.d.ts +4 -0
  146. package/dist/commands/crm.d.ts.map +1 -0
  147. package/dist/commands/crm.js +66 -0
  148. package/dist/commands/crm.js.map +1 -0
  149. package/dist/commands/session.d.ts +7 -0
  150. package/dist/commands/session.d.ts.map +1 -0
  151. package/dist/commands/session.js +22 -0
  152. package/dist/commands/session.js.map +1 -0
  153. package/dist/config.d.ts +14 -0
  154. package/dist/config.d.ts.map +1 -0
  155. package/dist/config.js +14 -0
  156. package/dist/config.js.map +1 -0
  157. package/dist/context.d.ts +37 -0
  158. package/dist/context.d.ts.map +1 -0
  159. package/dist/context.js +31 -0
  160. package/dist/context.js.map +1 -0
  161. package/dist/generated/definitions.d.ts +3 -0
  162. package/dist/generated/definitions.d.ts.map +1 -0
  163. package/dist/generated/definitions.js +43360 -0
  164. package/dist/generated/definitions.js.map +1 -0
  165. package/dist/generated/manifest.d.ts +6 -0
  166. package/dist/generated/manifest.d.ts.map +1 -0
  167. package/dist/generated/manifest.js +5158 -0
  168. package/dist/generated/manifest.js.map +1 -0
  169. package/dist/generated/schemas.d.ts +383 -0
  170. package/dist/generated/schemas.d.ts.map +1 -0
  171. package/dist/generated/schemas.js +21196 -0
  172. package/dist/generated/schemas.js.map +1 -0
  173. package/dist/generated/types.d.ts +10156 -0
  174. package/dist/generated/types.d.ts.map +1 -0
  175. package/dist/generated/types.js +5 -0
  176. package/dist/generated/types.js.map +1 -0
  177. package/dist/generated/wirecat-config.d.ts +15 -0
  178. package/dist/generated/wirecat-config.d.ts.map +1 -0
  179. package/dist/generated/wirecat-config.js +328 -0
  180. package/dist/generated/wirecat-config.js.map +1 -0
  181. package/dist/hooks.d.ts +3 -0
  182. package/dist/hooks.d.ts.map +1 -0
  183. package/dist/hooks.js +7 -0
  184. package/dist/hooks.js.map +1 -0
  185. package/dist/identity.d.ts +33 -0
  186. package/dist/identity.d.ts.map +1 -0
  187. package/dist/identity.js +31 -0
  188. package/dist/identity.js.map +1 -0
  189. package/dist/index.d.ts +3 -0
  190. package/dist/index.d.ts.map +1 -0
  191. package/dist/index.js +3 -0
  192. package/dist/index.js.map +1 -0
  193. package/dist/program.d.ts +6 -0
  194. package/dist/program.d.ts.map +1 -0
  195. package/dist/program.js +54 -0
  196. package/dist/program.js.map +1 -0
  197. package/dist/sample/comments.d.ts +61 -0
  198. package/dist/sample/comments.d.ts.map +1 -0
  199. package/dist/sample/comments.js +39 -0
  200. package/dist/sample/comments.js.map +1 -0
  201. package/dist/sample/records.d.ts +16 -0
  202. package/dist/sample/records.d.ts.map +1 -0
  203. package/dist/sample/records.js +22 -0
  204. package/dist/sample/records.js.map +1 -0
  205. package/dist/sample/transport.d.ts +42 -0
  206. package/dist/sample/transport.d.ts.map +1 -0
  207. package/dist/sample/transport.js +153 -0
  208. package/dist/sample/transport.js.map +1 -0
  209. package/dist/version.d.ts +2 -0
  210. package/dist/version.d.ts.map +1 -0
  211. package/dist/version.js +2 -0
  212. package/dist/version.js.map +1 -0
  213. package/dist/wcat.d.ts +3 -0
  214. package/dist/wcat.d.ts.map +1 -0
  215. package/dist/wcat.js +4 -0
  216. package/dist/wcat.js.map +1 -0
  217. package/package.json +87 -4
  218. package/skills/attio-cli/SKILL.md +58 -0
  219. package/skills/attio-cli/references/api/api-activities.md +62 -0
  220. package/skills/attio-cli/references/api/api-activity-records.md +96 -0
  221. package/skills/attio-cli/references/api/api-attributes.md +148 -0
  222. package/skills/attio-cli/references/api/api-call-recordings.md +53 -0
  223. package/skills/attio-cli/references/api/api-comments.md +36 -0
  224. package/skills/attio-cli/references/api/api-emails.md +23 -0
  225. package/skills/attio-cli/references/api/api-entries.md +127 -0
  226. package/skills/attio-cli/references/api/api-files.md +63 -0
  227. package/skills/attio-cli/references/api/api-lists.md +44 -0
  228. package/skills/attio-cli/references/api/api-meetings.md +82 -0
  229. package/skills/attio-cli/references/api/api-meta.md +8 -0
  230. package/skills/attio-cli/references/api/api-notes.md +64 -0
  231. package/skills/attio-cli/references/api/api-objects.md +55 -0
  232. package/skills/attio-cli/references/api/api-records.md +168 -0
  233. package/skills/attio-cli/references/api/api-sequences.md +15 -0
  234. package/skills/attio-cli/references/api/api-sql.md +15 -0
  235. package/skills/attio-cli/references/api/api-tasks.md +67 -0
  236. package/skills/attio-cli/references/api/api-threads.md +35 -0
  237. package/skills/attio-cli/references/api/api-transcripts.md +17 -0
  238. package/skills/attio-cli/references/api/api-views.md +133 -0
  239. package/skills/attio-cli/references/api/api-webhooks.md +62 -0
  240. package/skills/attio-cli/references/api/api-workspace-blocklist.md +39 -0
  241. package/skills/attio-cli/references/api/api-workspace-members.md +19 -0
  242. package/skills/attio-cli/references/api.md +35 -0
@@ -0,0 +1,259 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ textModel,
5
+ vectorModelKey
6
+ } from "./chunk-ARRQVUJ2.js";
7
+ import {
8
+ OPENAI_URL,
9
+ openRemote,
10
+ remoteKey,
11
+ remoteModel
12
+ } from "./chunk-QCEEPJNN.js";
13
+ import {
14
+ endpointFetch
15
+ } from "./chunk-5ETXE5KF.js";
16
+ import {
17
+ isTextModelInstalled,
18
+ openEmbedder,
19
+ textModelsDirectory
20
+ } from "./chunk-7NFEMS4A.js";
21
+ import {
22
+ CliError
23
+ } from "./chunk-5DCRHSBI.js";
24
+ import {
25
+ __name
26
+ } from "./chunk-ZVVMGPBJ.js";
27
+
28
+ // node_modules/.pnpm/@wirecat+cli-core@0.700.0_@wirecat+cli-base@0.118.0_commander@15.0.0_esbuild@0.28.2_typ_365b7216b918b4ff8396dc0e09311081/node_modules/@wirecat/cli-core/dist/services/meeting-model.js
29
+ var integer = /* @__PURE__ */ __name((value, name, max) => {
30
+ if (!Number.isSafeInteger(value) || value < 1 || value > max)
31
+ throw new CliError("validation_error", `Invalid ${name}`);
32
+ return value;
33
+ }, "integer");
34
+ var cancelled = /* @__PURE__ */ __name((signal) => {
35
+ if (signal?.aborted)
36
+ throw new CliError("cancelled", "Meeting embedding was cancelled");
37
+ }, "cancelled");
38
+ var validatedRemote = /* @__PURE__ */ __name((remote) => {
39
+ let url;
40
+ try {
41
+ url = new URL(remote.baseUrl);
42
+ } catch {
43
+ throw new CliError("validation_error", "Invalid embedding endpoint");
44
+ }
45
+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash)
46
+ throw new CliError("validation_error", "Embedding endpoint requires HTTP/S without credentials, query or fragment");
47
+ if (typeof remote.model !== "string" || !/^[\w./:-]{1,200}$/.test(remote.model))
48
+ throw new CliError("validation_error", "Invalid embedding model name");
49
+ const dims = integer(remote.dims, "embedding dimensions", 8192);
50
+ const baseUrl = remote.baseUrl.replace(/\/+$/, "");
51
+ const result = remoteModel({ model: remote.model, dims, ...baseUrl === OPENAI_URL ? {} : { baseUrl } });
52
+ return result;
53
+ }, "validatedRemote");
54
+ var meetingEmbeddingModel = /* @__PURE__ */ __name((choice, env) => {
55
+ if (typeof choice === "string") {
56
+ const model = textModel(choice, env);
57
+ return { key: vectorModelKey(model), dims: model.dims, kind: "local", model: model.id };
58
+ }
59
+ if (!choice || typeof choice !== "object" || !choice.remote)
60
+ throw new CliError("validation_error", "An explicit embedding model is required");
61
+ const remote = validatedRemote(choice.remote);
62
+ if (choice.concurrency !== void 0 && choice.concurrency !== 1)
63
+ throw new CliError("validation_error", "Meeting embedding supports one remote request worker");
64
+ return { key: remoteKey(remote), dims: remote.dims, kind: "remote", model: remote.model };
65
+ }, "meetingEmbeddingModel");
66
+ var createMeetingRemoteModel = /* @__PURE__ */ __name((input) => {
67
+ try {
68
+ return validatedRemote(remoteModel(input));
69
+ } catch (error) {
70
+ if (error instanceof CliError)
71
+ throw error;
72
+ throw new CliError("validation_error", "Invalid embedding endpoint");
73
+ }
74
+ }, "createMeetingRemoteModel");
75
+ var withAbort = /* @__PURE__ */ __name(async (pending, signal) => {
76
+ cancelled(signal);
77
+ if (!signal)
78
+ return pending;
79
+ let onAbort = /* @__PURE__ */ __name(() => {
80
+ }, "onAbort");
81
+ const interrupted = new Promise((_, reject) => {
82
+ onAbort = /* @__PURE__ */ __name(() => reject(new CliError("cancelled", "Meeting embedding was cancelled")), "onAbort");
83
+ signal.addEventListener("abort", onAbort, { once: true });
84
+ });
85
+ try {
86
+ return await Promise.race([pending, interrupted]);
87
+ } finally {
88
+ signal.removeEventListener("abort", onAbort);
89
+ }
90
+ }, "withAbort");
91
+ var boundedResponse = /* @__PURE__ */ __name(async (response, maxBytes, signal) => {
92
+ const length = response.headers.get("content-length");
93
+ if (length !== null && (!/^\d+$/.test(length) || Number(length) > maxBytes)) {
94
+ void response.body?.cancel().catch(() => {
95
+ });
96
+ throw new CliError("invalid_response", "Embedding response exceeds the byte budget");
97
+ }
98
+ if (!response.body)
99
+ throw new CliError("invalid_response", "Embedding response has no body");
100
+ const reader = response.body.getReader();
101
+ const chunks = [];
102
+ let bytes = 0;
103
+ try {
104
+ for (; ; ) {
105
+ cancelled(signal);
106
+ const part = await withAbort(reader.read(), signal);
107
+ cancelled(signal);
108
+ if (part.done)
109
+ break;
110
+ bytes += part.value.byteLength;
111
+ if (bytes > maxBytes)
112
+ throw new CliError("invalid_response", "Embedding response exceeds the byte budget");
113
+ chunks.push(part.value);
114
+ }
115
+ const body = Buffer.concat(chunks, bytes).toString("utf8");
116
+ try {
117
+ return JSON.parse(body);
118
+ } catch {
119
+ throw new CliError("invalid_response", "Embedding response is not JSON");
120
+ }
121
+ } finally {
122
+ void reader.cancel().catch(() => {
123
+ });
124
+ reader.releaseLock();
125
+ }
126
+ }, "boundedResponse");
127
+ var openMeetingEmbedder = /* @__PURE__ */ __name(async (choice, options = {}) => {
128
+ const descriptor = meetingEmbeddingModel(choice, options.env);
129
+ const { signal } = options;
130
+ cancelled(signal);
131
+ const maxInputBytes = integer(options.maxInputBytes ?? 1024 * 1024, "input byte budget", 16 * 1024 * 1024);
132
+ const maxResponseBytes = integer(options.maxResponseBytes ?? 8 * 1024 * 1024, "response byte budget", 64 * 1024 * 1024);
133
+ if (options.threads !== void 0)
134
+ integer(options.threads, "embedding threads", 128);
135
+ let engine;
136
+ let remoteFailure;
137
+ if (typeof choice === "string") {
138
+ const model = textModel(choice, options.env);
139
+ const directory = options.directory ?? textModelsDirectory(options.env);
140
+ if (!isTextModelInstalled(model, directory))
141
+ throw new CliError("configuration_error", "The explicit local embedding model is not installed");
142
+ engine = await openEmbedder(model, directory, {
143
+ ...options.threads === void 0 ? {} : { threads: options.threads }
144
+ });
145
+ } else {
146
+ const remote = validatedRemote(choice.remote);
147
+ const key = choice.apiKey ?? (remote.provider === "openai" ? (options.env ?? process.env).OPENAI_API_KEY : void 0);
148
+ if (remote.provider === "openai" && !key)
149
+ throw new CliError("authentication_error", "The explicit remote embedding model requires an API key");
150
+ const post = options.fetch ?? endpointFetch(remote.baseUrl, 12e4);
151
+ const guarded = /* @__PURE__ */ __name(async (url, init) => {
152
+ try {
153
+ cancelled(signal);
154
+ const responseTask = post(url, { ...init, redirect: "manual", ...signal ? { signal } : {} }).then((response2) => {
155
+ if (signal?.aborted) {
156
+ void response2.body?.cancel().catch(() => {
157
+ });
158
+ cancelled(signal);
159
+ }
160
+ return response2;
161
+ });
162
+ const response = await withAbort(responseTask, signal);
163
+ if (signal?.aborted) {
164
+ void response.body?.cancel().catch(() => {
165
+ });
166
+ cancelled(signal);
167
+ }
168
+ if (response.status >= 300 && response.status < 400) {
169
+ void response.body?.cancel().catch(() => {
170
+ });
171
+ throw new CliError("invalid_response", "Embedding redirects are refused");
172
+ }
173
+ if (!response.ok) {
174
+ void response.body?.cancel().catch(() => {
175
+ });
176
+ return new Response("{}", { status: response.status });
177
+ }
178
+ const body = await boundedResponse(response, maxResponseBytes, signal);
179
+ if (!body || typeof body !== "object" || !("data" in body) || !Array.isArray(body.data) || body.data.length > 256)
180
+ throw new CliError("invalid_response", "Embedding response lacks vector data");
181
+ for (const entry of body.data) {
182
+ if (!entry || typeof entry !== "object" || !Number.isSafeInteger(entry.index) || entry.index < 0 || !Array.isArray(entry.embedding) || entry.embedding.length !== remote.dims || entry.embedding.some((value) => typeof value !== "number" || !Number.isFinite(value) || !Number.isFinite(Math.fround(value))))
183
+ throw new CliError("invalid_response", "Embedding response contains invalid vectors");
184
+ }
185
+ const indices = body.data.map((entry) => entry.index).sort((a, b) => a - b);
186
+ if (indices.some((index, position) => index !== position))
187
+ throw new CliError("invalid_response", "Embedding response contains invalid vector indices");
188
+ return new Response(JSON.stringify({ data: body.data.map((entry) => ({ index: entry.index, embedding: entry.embedding })) }), { status: response.status });
189
+ } catch (error) {
190
+ remoteFailure = error;
191
+ throw error;
192
+ }
193
+ }, "guarded");
194
+ engine = openRemote(remote, key, { concurrency: 1, fetch: guarded, tries: 1, env: options.env ?? process.env });
195
+ }
196
+ if (signal?.aborted) {
197
+ await engine.close();
198
+ cancelled(signal);
199
+ }
200
+ let closed = false;
201
+ let running = false;
202
+ let active = null;
203
+ let closing = null;
204
+ return {
205
+ ...descriptor,
206
+ async embed(texts, kind) {
207
+ cancelled(signal);
208
+ if (closed)
209
+ throw new CliError("configuration_error", "Meeting embedder is closed");
210
+ if (!Array.isArray(texts) || texts.length > 1e3 || texts.some((text) => typeof text !== "string") || !["query", "passage"].includes(kind))
211
+ throw new CliError("validation_error", "Invalid meeting embedding inputs");
212
+ if (Buffer.byteLength(JSON.stringify(texts), "utf8") > maxInputBytes || texts.length * descriptor.dims * 4 > maxResponseBytes)
213
+ throw new CliError("validation_error", "Meeting embedding input or vector payload exceeds its byte budget");
214
+ if (running)
215
+ throw new CliError("validation_error", "A meeting embedding request is already running");
216
+ running = true;
217
+ let settled = /* @__PURE__ */ __name(() => {
218
+ }, "settled");
219
+ active = new Promise((resolve) => {
220
+ settled = resolve;
221
+ });
222
+ remoteFailure = void 0;
223
+ try {
224
+ const vectors = await engine.embed([...texts], kind);
225
+ cancelled(signal);
226
+ if (vectors.length !== texts.length || vectors.some((vector) => vector.length !== descriptor.dims || !vector.some((value) => value !== 0) || [...vector].some((value) => !Number.isFinite(value))))
227
+ throw new CliError("invalid_response", "Meeting embedder returned invalid vectors");
228
+ return vectors;
229
+ } catch (error) {
230
+ cancelled(signal);
231
+ if (remoteFailure instanceof CliError)
232
+ throw remoteFailure;
233
+ if (error instanceof CliError)
234
+ throw error;
235
+ throw new CliError("provider_error", "Meeting embedding failed");
236
+ } finally {
237
+ running = false;
238
+ settled();
239
+ active = null;
240
+ }
241
+ },
242
+ async close() {
243
+ if (!closing) {
244
+ closed = true;
245
+ closing = (async () => {
246
+ await active;
247
+ await engine.close();
248
+ })();
249
+ }
250
+ await closing;
251
+ }
252
+ };
253
+ }, "openMeetingEmbedder");
254
+
255
+ export {
256
+ meetingEmbeddingModel,
257
+ createMeetingRemoteModel,
258
+ openMeetingEmbedder
259
+ };
@@ -0,0 +1,54 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ resolvePaths
5
+ } from "./chunk-XTQIXZVM.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.700.0_@wirecat+cli-base@0.118.0_commander@15.0.0_esbuild@0.28.2_typ_365b7216b918b4ff8396dc0e09311081/node_modules/@wirecat/cli-core/dist/store/path.js
11
+ import { realpathSync } from "node:fs";
12
+ import { userInfo } from "node:os";
13
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
14
+ var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
15
+ var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
16
+ var accountHome = /* @__PURE__ */ __name(() => {
17
+ try {
18
+ return userInfo().homedir;
19
+ } catch {
20
+ return void 0;
21
+ }
22
+ }, "accountHome");
23
+ var inOwnerFolder = /* @__PURE__ */ __name((file, home = accountHome()) => {
24
+ if (!home || file === ":memory:")
25
+ return false;
26
+ const owner = wirecatDirectory({ HOME: home, USERPROFILE: home });
27
+ const within = /* @__PURE__ */ __name((path, folder) => {
28
+ const inside = relative(folder, path);
29
+ return !(inside.startsWith("..") || isAbsolute(inside));
30
+ }, "within");
31
+ return within(resolve(file), owner) || within(settled(resolve(file)), settled(owner));
32
+ }, "inOwnerFolder");
33
+ var settled = /* @__PURE__ */ __name((path) => {
34
+ try {
35
+ return realpathSync(path);
36
+ } catch {
37
+ const parent = dirname(path);
38
+ return parent === path ? path : join(settled(parent), basename(path));
39
+ }
40
+ }, "settled");
41
+ var refuseOwnerStoreInTests = /* @__PURE__ */ __name((file, env = process.env, home = accountHome()) => {
42
+ if (!env.VITEST || !inOwnerFolder(file, home))
43
+ return;
44
+ throw new Error(`a test tried to open ${file}, in the owner's real WireCat folder; give it a MESSAGING_STORE or HOME of its own`);
45
+ }, "refuseOwnerStoreInTests");
46
+
47
+ export {
48
+ wirecatDirectory,
49
+ storePath,
50
+ accountHome,
51
+ inOwnerFolder,
52
+ settled,
53
+ refuseOwnerStoreInTests
54
+ };
@@ -0,0 +1,41 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+
4
+ // dist/version.js
5
+ var VERSION = "0.1.0";
6
+
7
+ // dist/identity.js
8
+ var PACKAGE = "@wirecat/attio-cli";
9
+ var IDENTITY = {
10
+ command: "attio",
11
+ appName: "attio-cli",
12
+ envPrefix: "WCATTIO",
13
+ description: "Attio CRM: deals, people and companies for you and your AI agent",
14
+ version: VERSION,
15
+ issues: "https://github.com/WireCatLabs/attio-cli/issues/new",
16
+ messenger: false,
17
+ contentLanguages: ["en"]
18
+ };
19
+ var DESKTOP = {
20
+ ...IDENTITY,
21
+ docs: "https://github.com/WireCatLabs/attio-cli#readme",
22
+ // app.attio.com is only Attio's OAuth sign-in page, which the API description names; requests go to api.attio.com.
23
+ hosts: ["api.attio.com", "app.attio.com"],
24
+ tagline: "Attio deals, people and companies for your agent",
25
+ syncs: "your deals, people and companies",
26
+ signIn: {
27
+ gives: "Lets your agent read your Attio deals, people and companies and call the Attio API.",
28
+ asks: "An access token: in Attio, Workspace settings \u2192 Developers \u2192 New access token, with read access to records, object configuration and user management. Only a workspace admin can make one.",
29
+ methods: [
30
+ { id: "token", label: "Attio access token", words: ["{profile}", "session", "start", "--json"], stdin: true }
31
+ ]
32
+ }
33
+ };
34
+ var SKILL = new URL("../skills/attio-cli/SKILL.md", new URL("../identity.js", import.meta.url).href);
35
+
36
+ export {
37
+ PACKAGE,
38
+ IDENTITY,
39
+ DESKTOP,
40
+ SKILL
41
+ };