@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,66 @@
1
+ import { CliError } from "@wirecat/cli-base";
2
+ import { retrying } from "@wirecat/cli-base/http";
3
+ import { openAppStore, recalledAccount, serviceApiCall } from "@wirecat/cli-core/cli";
4
+ import { crmSourceFromManifest } from "@wirecat/cli-core/crm";
5
+ import { addCrmCommands, openCrmStore } from "@wirecat/cli-core/crm/cli";
6
+ import { Pacer, pacePathFor } from "@wirecat/cli-core/sends";
7
+ import { Command } from "commander";
8
+ import { API } from "../config.js";
9
+ import { contextOf, PACE, tokenOf } from "../context.js";
10
+ import { HOOK_OPTIONS, LIVE, SOURCE } from "../generated/wirecat-config.js";
11
+ import { IDENTITY } from "../identity.js";
12
+ import { serviceFetch } from "./api.js";
13
+ // The account is the one `session start` checked the token against; the store keeps each account's rows apart.
14
+ const accountOf = (command) => {
15
+ const { env, profile } = contextOf(command);
16
+ const account = recalledAccount(IDENTITY, SOURCE.provider, profile, env);
17
+ if (!account)
18
+ throw new CliError("authentication_error", `${profile} is not signed in; run ${IDENTITY.command} ${profile} session start`, {
19
+ reason: "auth.missing",
20
+ });
21
+ return account;
22
+ };
23
+ const open = async (command, { readOnly }) => {
24
+ const { env, profile, environment } = contextOf(command);
25
+ const { store, account } = await openCrmStore({
26
+ app: IDENTITY,
27
+ env,
28
+ profile,
29
+ readOnly,
30
+ provider: SOURCE.provider,
31
+ // The shared store, with this CLI's provider entry written so every other CLI's search knows it (WC-ARCH-21).
32
+ open: (at, options) => openAppStore(at, {
33
+ app: IDENTITY,
34
+ provider: { name: SOURCE.provider, kind: "crm", aliases: [], command: IDENTITY.command },
35
+ ...options,
36
+ }),
37
+ account: () => accountOf(command),
38
+ });
39
+ const fetch = retrying(serviceFetch(environment), { pacer: new Pacer(pacePathFor(IDENTITY, profile, env), PACE) });
40
+ const call = serviceApiCall({ manifest: API.manifest, service: API.service, fetch, token: () => tokenOf(command) });
41
+ let source;
42
+ return {
43
+ profile,
44
+ account,
45
+ // A CRM that limits its users is not described by a manifest yet; nobody's rows are hidden.
46
+ user: null,
47
+ store,
48
+ env,
49
+ locked: Boolean(env[`${IDENTITY.envPrefix}_PROFILE_LOCK`]),
50
+ source: () => (source ??= crmSourceFromManifest(SOURCE, { api: API.manifest, call, ...HOOK_OPTIONS })),
51
+ close: () => store.close(),
52
+ };
53
+ };
54
+ /** cli-core's CRM commands over the source wirecat.config.ts describes: sync, store status, deals, search. */
55
+ export const crmCommands = () => {
56
+ const holder = new Command(IDENTITY.command);
57
+ addCrmCommands(holder, {
58
+ app: IDENTITY,
59
+ open,
60
+ leads: SOURCE.kinds.includes("lead"),
61
+ // People and companies whose entity names a search, and the users when the source names a call for them.
62
+ live: LIVE,
63
+ });
64
+ return [...holder.commands];
65
+ };
66
+ //# sourceMappingURL=crm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crm.js","sourceRoot":"","sources":["../../src/commands/crm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,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AG,YAAY,EAAE,CAAC,CAAC;QACtG,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;KAC3B,CAAA;AACH,CAAC,CAAA;AAED,8GAA8G;AAC9G,MAAM,CAAC,MAAM,WAAW,GAAG,GAAc,EAAE;IACzC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC5C,cAAc,CAAC,MAAM,EAAE;QACrB,GAAG,EAAE,QAAQ;QACb,IAAI;QACJ,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QACpC,yGAAyG;QACzG,IAAI,EAAE,IAAI;KACX,CAAC,CAAA;IACF,OAAO,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { Command } from "commander";
2
+ /**
3
+ * `session start | status | end | list` (WC-ACCT-12): the token is checked by the call `auth.verify` names in
4
+ * wirecat.config.ts, and the account is the id and name its answer holds.
5
+ */
6
+ export declare const sessionCommand: () => Command;
7
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOxC;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,OAW9B,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { manifestVerify, tokenSessionCommand } from "@wirecat/cli-core/cli";
2
+ import { API, configuration } from "../config.js";
3
+ import { contextOf } from "../context.js";
4
+ import { VERIFY } from "../generated/wirecat-config.js";
5
+ import { IDENTITY } from "../identity.js";
6
+ import { serviceFetch } from "./api.js";
7
+ /**
8
+ * `session start | status | end | list` (WC-ACCT-12): the token is checked by the call `auth.verify` names in
9
+ * wirecat.config.ts, and the account is the id and name its answer holds.
10
+ */
11
+ export const sessionCommand = () => tokenSessionCommand({
12
+ app: IDENTITY,
13
+ service: API.service,
14
+ resolveSettings: configuration.resolveSettings,
15
+ verify: manifestVerify({
16
+ manifest: API.manifest,
17
+ service: API.service,
18
+ verify: VERIFY,
19
+ fetch: (command) => serviceFetch(contextOf(command).environment),
20
+ }),
21
+ });
22
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/commands/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3E,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAY,EAAE,CAC1C,mBAAmB,CAAC;IAClB,GAAG,EAAE,QAAQ;IACb,OAAO,EAAE,GAAG,CAAC,OAAO;IACpB,eAAe,EAAE,aAAa,CAAC,eAAe;IAC9C,MAAM,EAAE,cAAc,CAAC;QACrB,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC;KACjE,CAAC;CACH,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { type Configuration } from "@wirecat/cli-core/cli";
2
+ /** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
3
+ export declare const API: {
4
+ manifest: {
5
+ servers: readonly import("@wirecat/cli-base/codegen").ApiServer[];
6
+ securitySchemes: Readonly<Record<string, import("@wirecat/cli-base/codegen").SecurityScheme>>;
7
+ security: readonly import("@wirecat/cli-base/codegen").SecurityRequirement[];
8
+ operations: readonly import("@wirecat/cli-base/codegen").ManifestOperation[];
9
+ };
10
+ service: string;
11
+ };
12
+ export declare const permissions: import("@wirecat/cli-core/cli").CommandPermissions;
13
+ export declare const configuration: Configuration;
14
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,uBAAuB,CAAA;AAI9B,gHAAgH;AAIhH,eAAO,MAAM,GAAG;;;;;;;;CAGf,CAAA;AAED,eAAO,MAAM,WAAW,oDAAiD,CAAA;AAEzE,eAAO,MAAM,aAAa,EAAE,aAAsD,CAAA"}
package/dist/config.js ADDED
@@ -0,0 +1,14 @@
1
+ import { commandPermissions, serviceApiOperations, serviceApiPermissions, settingsFor, } from "@wirecat/cli-core/cli";
2
+ import * as manifest from "./generated/manifest.js";
3
+ import { IDENTITY } from "./identity.js";
4
+ /** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
5
+ // The keys a delete or a share checks come from `permissions` in
6
+ // scripts/generate.ts. The operations the api group cannot offer are left out: one that answers with a
7
+ // credential (the CLI signs in through `session`) and a body it cannot send, such as a multipart form.
8
+ export const API = {
9
+ manifest: { ...manifest, operations: serviceApiOperations(manifest).offered },
10
+ service: "Attio",
11
+ };
12
+ export const permissions = commandPermissions(serviceApiPermissions(API));
13
+ export const configuration = settingsFor(IDENTITY, { permissions });
14
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,GACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,gHAAgH;AAChH,iEAAiE;AACjE,uGAAuG;AACvG,uGAAuG;AACvG,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,QAAQ,EAAE,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE;IAC7E,OAAO,EAAE,OAAO;CACjB,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA;AAEzE,MAAM,CAAC,MAAM,aAAa,GAAkB,WAAW,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { type BaseEnvironment, type GlobalFlags, ProfileTokenStore } from "@wirecat/cli-core/cli";
2
+ import type { Command } from "commander";
3
+ /** What a test hands `run()` beside cli-core's own: the fake service in place of the network (WC-ARCH-10). */
4
+ export interface ServiceEnvironment extends BaseEnvironment {
5
+ fetch?: typeof fetch;
6
+ }
7
+ export declare const PACE: {
8
+ perMinute: number;
9
+ burst: number;
10
+ };
11
+ /**
12
+ * Settings, keyring and the run come from cli-core's `baseContext` and nowhere else: a command that resolves settings
13
+ * on its own skips `--timeout`, the run record and the profile's permissions (WC-LIFE-5, WC-LIFE-15).
14
+ */
15
+ export declare const contextOf: (command: Command) => {
16
+ settings: import("@wirecat/cli-core/cli").Settings;
17
+ renderer: import("@wirecat/cli-base").Renderer;
18
+ format: import("@wirecat/cli-base").RenderFormat;
19
+ color: boolean;
20
+ streams: import("@wirecat/cli-base").Streams;
21
+ compact?: boolean;
22
+ full?: boolean;
23
+ env: NodeJS.ProcessEnv;
24
+ keyring?: import("@wirecat/cli-base").KeyringStore;
25
+ run: <T>(body: (events: import("@wirecat/cli-core/cli").EventSink) => Promise<T>, options?: {
26
+ unbounded?: boolean;
27
+ name?: string;
28
+ }) => Promise<T>;
29
+ track: (closeable: import("@wirecat/cli-core/cli").Closeable) => void;
30
+ environment: ServiceEnvironment;
31
+ flags: GlobalFlags;
32
+ profile: string;
33
+ tokens: ProfileTokenStore;
34
+ };
35
+ /** The profile's saved token, or an authentication error that says how to sign in. Read before any request. */
36
+ export declare const tokenOf: (command: Command) => string;
37
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,WAAW,EAChB,iBAAiB,EAElB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIxC,8GAA8G;AAC9G,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB;AAGD,eAAO,MAAM,IAAI;IAAK,SAAS;IAAO,KAAK;CAAM,CAAA;AAEjD;;;GAGG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO;;;;;;;;;;;;;;;;;;;CAczC,CAAA;AAED,+GAA+G;AAC/G,eAAO,MAAM,OAAO,YAAa,OAAO,KAAG,MAI1C,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { baseContext, environmentOf, ProfileTokenStore, refuseOffline, } from "@wirecat/cli-core/cli";
2
+ import { API, configuration } from "./config.js";
3
+ import { IDENTITY } from "./identity.js";
4
+ // Attio allows 100 reads and 25 writes a second (docs.attio.com/rest-api/guides/rate-limiting); half of the writes.
5
+ export const PACE = { perMinute: 720, burst: 12 };
6
+ /**
7
+ * Settings, keyring and the run come from cli-core's `baseContext` and nowhere else: a command that resolves settings
8
+ * on its own skips `--timeout`, the run record and the profile's permissions (WC-LIFE-5, WC-LIFE-15).
9
+ */
10
+ export const contextOf = (command) => {
11
+ const base = baseContext(command, configuration.resolveSettings);
12
+ return {
13
+ ...base,
14
+ environment: environmentOf(command),
15
+ flags: command.optsWithGlobals(),
16
+ profile: base.settings.profile,
17
+ tokens: new ProfileTokenStore({
18
+ app: IDENTITY,
19
+ env: base.env,
20
+ keyring: base.keyring,
21
+ warn: base.renderer.warn,
22
+ }),
23
+ };
24
+ };
25
+ /** The profile's saved token, or an authentication error that says how to sign in. Read before any request. */
26
+ export const tokenOf = (command) => {
27
+ const { profile, tokens } = contextOf(command);
28
+ refuseOffline(command, API.service);
29
+ return tokens.need(profile);
30
+ };
31
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,aAAa,EAEb,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAOxC,oHAAoH;AACpH,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC5C,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAChE,OAAO;QACL,GAAG,IAAI;QACP,WAAW,EAAE,aAAa,CAAqB,OAAO,CAAC;QACvD,KAAK,EAAE,OAAO,CAAC,eAAe,EAAe;QAC7C,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;QAC9B,MAAM,EAAE,IAAI,iBAAiB,CAAC;YAC5B,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI;SACzB,CAAC;KACH,CAAA;AACH,CAAC,CAAA;AAED,+GAA+G;AAC/G,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAU,EAAE;IAClD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;IAC9C,aAAa,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { SchemaNode } from "@wirecat/cli-base/codegen";
2
+ export declare const definitions: Readonly<Record<string, SchemaNode>>;
3
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/generated/definitions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAs53C5D,CAAA"}