@wirecat/hubspot-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 (269) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/LICENSE +204 -0
  3. package/README.md +256 -2
  4. package/contracts/wirecat.json +1965 -0
  5. package/dist/bin/hubspot.d.ts +3 -0
  6. package/dist/bin/hubspot.d.ts.map +1 -0
  7. package/dist/bin/hubspot.js +40 -0
  8. package/dist/bin/hubspot.js.map +1 -0
  9. package/dist/bundle/all-profiles-64JAUYW4.js +279 -0
  10. package/dist/bundle/anthropic-VJOS4OUM.js +91 -0
  11. package/dist/bundle/app-server-422MCA7S.js +245 -0
  12. package/dist/bundle/bun-M3J2QTR3.js +169 -0
  13. package/dist/bundle/bun-sqlite-IX3XYA5F.js +76 -0
  14. package/dist/bundle/chunk-24ERVFJP.js +73 -0
  15. package/dist/bundle/chunk-2QZK5BEP.js +392 -0
  16. package/dist/bundle/chunk-2TWQIWWG.js +1328 -0
  17. package/dist/bundle/chunk-2VGD63G6.js +604 -0
  18. package/dist/bundle/chunk-2VGZRYEH.js +334 -0
  19. package/dist/bundle/chunk-36ITRDYY.js +63116 -0
  20. package/dist/bundle/chunk-43EKCUBJ.js +72 -0
  21. package/dist/bundle/chunk-4W6BMH45.js +731 -0
  22. package/dist/bundle/chunk-5A6ZYNAQ.js +2003 -0
  23. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  24. package/dist/bundle/chunk-5GBUCHRU.js +274 -0
  25. package/dist/bundle/chunk-5K7QLJMM.js +4072 -0
  26. package/dist/bundle/chunk-65TWQ7BV.js +54 -0
  27. package/dist/bundle/chunk-7ELMWE3P.js +12066 -0
  28. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  29. package/dist/bundle/chunk-B3MANLNK.js +602 -0
  30. package/dist/bundle/chunk-BKXDHU3G.js +1395 -0
  31. package/dist/bundle/chunk-C32AKHTY.js +2310 -0
  32. package/dist/bundle/chunk-CLAN3FES.js +1246 -0
  33. package/dist/bundle/chunk-CWXOXIWS.js +46 -0
  34. package/dist/bundle/chunk-D72URWJE.js +532 -0
  35. package/dist/bundle/chunk-DB2XKHI4.js +72 -0
  36. package/dist/bundle/chunk-DBEQI5YM.js +100 -0
  37. package/dist/bundle/chunk-DFCHHR5M.js +38 -0
  38. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  39. package/dist/bundle/chunk-DRWWJLI6.js +188 -0
  40. package/dist/bundle/chunk-DSP36YHQ.js +29 -0
  41. package/dist/bundle/chunk-E52JAS35.js +1028 -0
  42. package/dist/bundle/chunk-E5WLE7BM.js +78 -0
  43. package/dist/bundle/chunk-ECEZOLOD.js +230 -0
  44. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  45. package/dist/bundle/chunk-FBCCBCFH.js +288 -0
  46. package/dist/bundle/chunk-FKA7DOCK.js +53 -0
  47. package/dist/bundle/chunk-FOZYMDRL.js +259 -0
  48. package/dist/bundle/chunk-FPUGMDJV.js +7 -0
  49. package/dist/bundle/chunk-FTFV3HFW.js +721 -0
  50. package/dist/bundle/chunk-H3TNVEQX.js +782 -0
  51. package/dist/bundle/chunk-HC5ZWE5X.js +193 -0
  52. package/dist/bundle/chunk-HCAZV5NP.js +95 -0
  53. package/dist/bundle/chunk-HTAN663T.js +4045 -0
  54. package/dist/bundle/chunk-HZRQLAHO.js +16 -0
  55. package/dist/bundle/chunk-IMJQRPLN.js +92 -0
  56. package/dist/bundle/chunk-JLDBMEKZ.js +106 -0
  57. package/dist/bundle/chunk-JRCPCVPI.js +9393 -0
  58. package/dist/bundle/chunk-LNV33FDC.js +786 -0
  59. package/dist/bundle/chunk-LOBVOGOE.js +66 -0
  60. package/dist/bundle/chunk-MVA5HVKL.js +1392 -0
  61. package/dist/bundle/chunk-N2XADGL4.js +76 -0
  62. package/dist/bundle/chunk-NHHJHXMQ.js +58 -0
  63. package/dist/bundle/chunk-NUU4WZVL.js +52 -0
  64. package/dist/bundle/chunk-NWHEHV3K.js +133 -0
  65. package/dist/bundle/chunk-NXERIDPJ.js +319 -0
  66. package/dist/bundle/chunk-O3DYRCIT.js +23 -0
  67. package/dist/bundle/chunk-O55RWNSH.js +161 -0
  68. package/dist/bundle/chunk-P5BHKKBI.js +206 -0
  69. package/dist/bundle/chunk-PPHBRESD.js +82 -0
  70. package/dist/bundle/chunk-PVKF24ZW.js +364 -0
  71. package/dist/bundle/chunk-QGFX5MXL.js +460 -0
  72. package/dist/bundle/chunk-QJW35N5V.js +761 -0
  73. package/dist/bundle/chunk-QU25DA5N.js +360 -0
  74. package/dist/bundle/chunk-RMIYKDUL.js +1068 -0
  75. package/dist/bundle/chunk-RR5MX5TM.js +142 -0
  76. package/dist/bundle/chunk-SAKK2YRU.js +218 -0
  77. package/dist/bundle/chunk-SDQGB4KB.js +185 -0
  78. package/dist/bundle/chunk-TBJYLC5K.js +2788 -0
  79. package/dist/bundle/chunk-TI46WQXQ.js +1197 -0
  80. package/dist/bundle/chunk-TKVL2C3B.js +170 -0
  81. package/dist/bundle/chunk-TOSCB4SO.js +1227 -0
  82. package/dist/bundle/chunk-TP7GDWVF.js +6848 -0
  83. package/dist/bundle/chunk-UUMUL4L3.js +72 -0
  84. package/dist/bundle/chunk-VIEYMDBR.js +41 -0
  85. package/dist/bundle/chunk-W53EJOFQ.js +63 -0
  86. package/dist/bundle/chunk-W7HM2VGO.js +24 -0
  87. package/dist/bundle/chunk-WE4UFASG.js +88 -0
  88. package/dist/bundle/chunk-WQBX7XYP.js +26174 -0
  89. package/dist/bundle/chunk-X2M6NIQG.js +18 -0
  90. package/dist/bundle/chunk-X7XUX7A4.js +1846 -0
  91. package/dist/bundle/chunk-XRREFEIW.js +372 -0
  92. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  93. package/dist/bundle/chunk-ZBDSHFG4.js +40933 -0
  94. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  95. package/dist/bundle/command-contract-C6CBFXZF.js +40 -0
  96. package/dist/bundle/command-server-entry-DJKVVZCQ.js +169 -0
  97. package/dist/bundle/decode-FC65Y4IV.js +297 -0
  98. package/dist/bundle/definitions-MVPICAWV.js +2991 -0
  99. package/dist/bundle/dispatch-KOISQ5QJ.js +411 -0
  100. package/dist/bundle/dist-MYZZKZJ7.js +7577 -0
  101. package/dist/bundle/echarts-FVTUDXDU.js +42501 -0
  102. package/dist/bundle/embed-VNBZFPYH.js +38 -0
  103. package/dist/bundle/embedder-6U4NOFRO.js +111 -0
  104. package/dist/bundle/failure-FZ6VYKEQ.js +25 -0
  105. package/dist/bundle/first-run-RPIJZEDT.js +29 -0
  106. package/dist/bundle/first-screen-RTVMGHAE.js +40 -0
  107. package/dist/bundle/hubspot.js +198 -0
  108. package/dist/bundle/instructions-HET7BCYK.js +11 -0
  109. package/dist/bundle/mcp-RGNRW77S.js +167 -0
  110. package/dist/bundle/meeting-combined-L5AGBPYX.js +25 -0
  111. package/dist/bundle/meeting-model-NTB4RK3F.js +25 -0
  112. package/dist/bundle/meeting-semantic-JY3OGCBS.js +22 -0
  113. package/dist/bundle/node-CXZIFHZC.js +176 -0
  114. package/dist/bundle/node-P4E63KXA.js +2340 -0
  115. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  116. package/dist/bundle/node-sqlite-P3O7XN7Q.js +74 -0
  117. package/dist/bundle/oauth-HNCY4B2S.js +20 -0
  118. package/dist/bundle/open-F4P6YV54.js +23 -0
  119. package/dist/bundle/openai-4AICLIK3.js +238 -0
  120. package/dist/bundle/process-5RUXWGYS.js +91 -0
  121. package/dist/bundle/program-POG5GHUQ.js +9241 -0
  122. package/dist/bundle/prompt-NFMDVBZ4.js +17 -0
  123. package/dist/bundle/recognize-DKN3RY4V.js +26 -0
  124. package/dist/bundle/remote-6QHAGQWY.js +31 -0
  125. package/dist/bundle/rerank-M4KHEHUZ.js +52 -0
  126. package/dist/bundle/schemas-JRL3DLMP.js +952 -0
  127. package/dist/bundle/serve-DNU43ND6.js +199 -0
  128. package/dist/bundle/server-C3ZHA7AZ.js +77 -0
  129. package/dist/bundle/server-XJSNF3K5.js +207 -0
  130. package/dist/bundle/source-A3SBLHC4.js +934 -0
  131. package/dist/bundle/sqlite-runtime-EMQAC63N.js +20 -0
  132. package/dist/bundle/state-T45CX7VY.js +36 -0
  133. package/dist/bundle/store-6LCEVBAZ.js +176 -0
  134. package/dist/bundle/store-6TZ2FCVA.js +295 -0
  135. package/dist/bundle/store-CCDNUB6A.js +32 -0
  136. package/dist/bundle/store-maintenance-command-BRCG6MNA.js +68 -0
  137. package/dist/commands/account.d.ts +3 -0
  138. package/dist/commands/account.d.ts.map +1 -0
  139. package/dist/commands/account.js +87 -0
  140. package/dist/commands/account.js.map +1 -0
  141. package/dist/commands/api.d.ts +9 -0
  142. package/dist/commands/api.d.ts.map +1 -0
  143. package/dist/commands/api.js +65 -0
  144. package/dist/commands/api.js.map +1 -0
  145. package/dist/commands/comments.d.ts +3 -0
  146. package/dist/commands/comments.d.ts.map +1 -0
  147. package/dist/commands/comments.js +114 -0
  148. package/dist/commands/comments.js.map +1 -0
  149. package/dist/commands/crm-shared.d.ts +8 -0
  150. package/dist/commands/crm-shared.d.ts.map +1 -0
  151. package/dist/commands/crm-shared.js +93 -0
  152. package/dist/commands/crm-shared.js.map +1 -0
  153. package/dist/commands/schedule.d.ts +3 -0
  154. package/dist/commands/schedule.d.ts.map +1 -0
  155. package/dist/commands/schedule.js +9 -0
  156. package/dist/commands/schedule.js.map +1 -0
  157. package/dist/commands/session.d.ts +14 -0
  158. package/dist/commands/session.d.ts.map +1 -0
  159. package/dist/commands/session.js +164 -0
  160. package/dist/commands/session.js.map +1 -0
  161. package/dist/config.d.ts +22 -0
  162. package/dist/config.d.ts.map +1 -0
  163. package/dist/config.js +28 -0
  164. package/dist/config.js.map +1 -0
  165. package/dist/context.d.ts +88 -0
  166. package/dist/context.d.ts.map +1 -0
  167. package/dist/context.js +137 -0
  168. package/dist/context.js.map +1 -0
  169. package/dist/crm/activities.d.ts +24 -0
  170. package/dist/crm/activities.d.ts.map +1 -0
  171. package/dist/crm/activities.js +214 -0
  172. package/dist/crm/activities.js.map +1 -0
  173. package/dist/crm/associations.d.ts +20 -0
  174. package/dist/crm/associations.d.ts.map +1 -0
  175. package/dist/crm/associations.js +47 -0
  176. package/dist/crm/associations.js.map +1 -0
  177. package/dist/crm/records.d.ts +63 -0
  178. package/dist/crm/records.d.ts.map +1 -0
  179. package/dist/crm/records.js +333 -0
  180. package/dist/crm/records.js.map +1 -0
  181. package/dist/crm/search.d.ts +57 -0
  182. package/dist/crm/search.d.ts.map +1 -0
  183. package/dist/crm/search.js +47 -0
  184. package/dist/crm/search.js.map +1 -0
  185. package/dist/crm/source.d.ts +32 -0
  186. package/dist/crm/source.d.ts.map +1 -0
  187. package/dist/crm/source.js +369 -0
  188. package/dist/crm/source.js.map +1 -0
  189. package/dist/generated/definitions.d.ts +3 -0
  190. package/dist/generated/definitions.d.ts.map +1 -0
  191. package/dist/generated/definitions.js +2987 -0
  192. package/dist/generated/definitions.js.map +1 -0
  193. package/dist/generated/manifest.d.ts +6 -0
  194. package/dist/generated/manifest.d.ts.map +1 -0
  195. package/dist/generated/manifest.js +6499 -0
  196. package/dist/generated/manifest.js.map +1 -0
  197. package/dist/generated/schemas.d.ts +205 -0
  198. package/dist/generated/schemas.d.ts.map +1 -0
  199. package/dist/generated/schemas.js +810 -0
  200. package/dist/generated/schemas.js.map +1 -0
  201. package/dist/generated/types.d.ts +1114 -0
  202. package/dist/generated/types.d.ts.map +1 -0
  203. package/dist/generated/types.js +5 -0
  204. package/dist/generated/types.js.map +1 -0
  205. package/dist/hubspot/account.d.ts +12 -0
  206. package/dist/hubspot/account.d.ts.map +1 -0
  207. package/dist/hubspot/account.js +23 -0
  208. package/dist/hubspot/account.js.map +1 -0
  209. package/dist/hubspot/transport.d.ts +76 -0
  210. package/dist/hubspot/transport.d.ts.map +1 -0
  211. package/dist/hubspot/transport.js +346 -0
  212. package/dist/hubspot/transport.js.map +1 -0
  213. package/dist/identity.d.ts +7 -0
  214. package/dist/identity.d.ts.map +1 -0
  215. package/dist/identity.js +32 -0
  216. package/dist/identity.js.map +1 -0
  217. package/dist/index.d.ts +3 -0
  218. package/dist/index.d.ts.map +1 -0
  219. package/dist/index.js +3 -0
  220. package/dist/index.js.map +1 -0
  221. package/dist/program.d.ts +6 -0
  222. package/dist/program.d.ts.map +1 -0
  223. package/dist/program.js +77 -0
  224. package/dist/program.js.map +1 -0
  225. package/dist/reasons.d.ts +10 -0
  226. package/dist/reasons.d.ts.map +1 -0
  227. package/dist/reasons.js +33 -0
  228. package/dist/reasons.js.map +1 -0
  229. package/dist/sample/comments.d.ts +61 -0
  230. package/dist/sample/comments.d.ts.map +1 -0
  231. package/dist/sample/comments.js +39 -0
  232. package/dist/sample/comments.js.map +1 -0
  233. package/dist/sample/records.d.ts +16 -0
  234. package/dist/sample/records.d.ts.map +1 -0
  235. package/dist/sample/records.js +22 -0
  236. package/dist/sample/records.js.map +1 -0
  237. package/dist/sample/transport.d.ts +42 -0
  238. package/dist/sample/transport.d.ts.map +1 -0
  239. package/dist/sample/transport.js +153 -0
  240. package/dist/sample/transport.js.map +1 -0
  241. package/dist/setup/flow.d.ts +2 -0
  242. package/dist/setup/flow.d.ts.map +1 -0
  243. package/dist/setup/flow.js +97 -0
  244. package/dist/setup/flow.js.map +1 -0
  245. package/dist/setup/texts.en.json +19 -0
  246. package/dist/setup/texts.es.json +19 -0
  247. package/dist/setup/texts.ru.json +19 -0
  248. package/dist/store.d.ts +16 -0
  249. package/dist/store.d.ts.map +1 -0
  250. package/dist/store.js +34 -0
  251. package/dist/store.js.map +1 -0
  252. package/dist/version.d.ts +2 -0
  253. package/dist/version.d.ts.map +1 -0
  254. package/dist/version.js +2 -0
  255. package/dist/version.js.map +1 -0
  256. package/dist/wcat.d.ts +3 -0
  257. package/dist/wcat.d.ts.map +1 -0
  258. package/dist/wcat.js +4 -0
  259. package/dist/wcat.js.map +1 -0
  260. package/dist/whoami.d.ts +19 -0
  261. package/dist/whoami.d.ts.map +1 -0
  262. package/dist/whoami.js +15 -0
  263. package/dist/whoami.js.map +1 -0
  264. package/package.json +98 -4
  265. package/skills/hubspot-cli/SKILL.md +97 -0
  266. package/skills/hubspot-cli/references/api/api-basic.md +462 -0
  267. package/skills/hubspot-cli/references/api/api-batch.md +149 -0
  268. package/skills/hubspot-cli/references/api/api-search.md +147 -0
  269. package/skills/hubspot-cli/references/api.md +15 -0
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { IDENTITY } from "./identity.js";
2
+ export { createProgram, definition, run } from "./program.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { type ProgramDefinition, type ProgramOptions, type RunOptions } from "@wirecat/cli-core/cli";
2
+ import type { Command } from "commander";
3
+ export declare const definition: () => ProgramDefinition;
4
+ export declare const createProgram: (options?: ProgramOptions) => Command;
5
+ export declare const run: (argv: string[], options?: RunOptions) => Promise<number>;
6
+ //# sourceMappingURL=program.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAQL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,EAMhB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAwCxC,eAAO,MAAM,UAAU,QAAO,iBAoC5B,CAAA;AAEF,eAAO,MAAM,aAAa,aAAc,cAAc,KAAG,OAAqD,CAAA;AAE9G,eAAO,MAAM,GAAG,SAAU,MAAM,EAAE,YAAY,UAAU,KAAG,OAAO,CAAC,MAAM,CAA2C,CAAA"}
@@ -0,0 +1,77 @@
1
+ import { join } from "node:path";
2
+ import { resolvePaths } from "@wirecat/cli-base";
3
+ import { appDoctorCommand, appMcpCommand, commandsCommand, configCommand, createProgram as createSharedProgram, outputFor, ProfileTokenStore, run as runShared, runsCommand, setupCommand, skillCommand, upgradeCommand, } from "@wirecat/cli-core/cli";
4
+ import { appUpdate } from "@wirecat/cli-core/update";
5
+ import { accountCommand } from "./commands/account.js";
6
+ import { apiCommand } from "./commands/api.js";
7
+ import { crmSharedCommands } from "./commands/crm-shared.js";
8
+ import { scheduleCommand } from "./commands/schedule.js";
9
+ import { sessionCommand } from "./commands/session.js";
10
+ import { configuration } from "./config.js";
11
+ import { SERVICE } from "./hubspot/transport.js";
12
+ import { IDENTITY, PACKAGE, SKILL } from "./identity.js";
13
+ import { hubspotSetup } from "./setup/flow.js";
14
+ const update = appUpdate({
15
+ packageName: PACKAGE,
16
+ command: IDENTITY.command,
17
+ version: IDENTITY.version,
18
+ entry: import.meta.url,
19
+ statePath: (env) => join(resolvePaths({ appName: IDENTITY.appName, prefix: IDENTITY.envPrefix, env }).state, "update-check.json"),
20
+ // biome-ignore lint/plugin/no-own-settings: the update check runs before any command exists to give baseContext
21
+ enabled: (env) => configuration.resolveSettings({}, { env, needsProfile: false }).updateCheck,
22
+ offVariables: [`${IDENTITY.envPrefix}_NO_UPDATE_CHECK`],
23
+ });
24
+ const mcpCommand = () => appMcpCommand(IDENTITY, configuration, {
25
+ name: SERVICE,
26
+ untrusted: [
27
+ "contact, company and deal names",
28
+ "pipeline and stage names",
29
+ "owner names",
30
+ "property values, notes and activity text",
31
+ "e-mail addresses, phone numbers and links",
32
+ "whatever api returns",
33
+ ],
34
+ permissionExample: "people.list=deny",
35
+ skill: SKILL,
36
+ signedIn: (profile, env, keyring) => new ProfileTokenStore({ app: IDENTITY, env, ...(keyring ? { keyring } : {}) }).signedIn(profile),
37
+ });
38
+ export const definition = () => ({
39
+ app: IDENTITY,
40
+ // The whole object: cli-core refuses a command by its key only when it gets the permission table too.
41
+ configuration,
42
+ firstScreen: {
43
+ pitch: "a HubSpot account's CRM for scripts and agents, read into one local store.",
44
+ can: [
45
+ { command: "sync", does: "copy your deals, contacts and companies; the next sync takes the changes" },
46
+ { command: "deals list status:open", does: "open deals with stage, amount and owner, from the store, offline" },
47
+ { command: 'search all "kitchen"', does: "stored deals beside your other WireCat tools' data" },
48
+ { command: 'people list "Anna"', does: "any contact, read live from the account" },
49
+ { command: "activities list", does: "notes, calls, e-mails, meetings and tasks on your deals" },
50
+ { command: "api deals-list --limit 5", does: "any CRM read of HubSpot's API, one command per operation" },
51
+ ],
52
+ start: `${IDENTITY.command} work session start`,
53
+ },
54
+ commands: () => [
55
+ commandsCommand(IDENTITY),
56
+ sessionCommand(),
57
+ accountCommand(),
58
+ ...crmSharedCommands(),
59
+ apiCommand(),
60
+ scheduleCommand(),
61
+ appDoctorCommand(IDENTITY, configuration, { packageName: PACKAGE }),
62
+ skillCommand(IDENTITY, SKILL),
63
+ mcpCommand(),
64
+ upgradeCommand(IDENTITY, PACKAGE, (command) => ({
65
+ ...outputFor(command),
66
+ installer: () => update.installer({}),
67
+ latest: () => update.latest({}),
68
+ install: (argv) => update.runUpdate(argv, {}),
69
+ })),
70
+ configCommand(IDENTITY, configuration),
71
+ setupCommand(hubspotSetup),
72
+ runsCommand(IDENTITY),
73
+ ],
74
+ });
75
+ export const createProgram = (options) => createSharedProgram(definition(), options);
76
+ export const run = (argv, options) => runShared(argv, definition(), options);
77
+ //# sourceMappingURL=program.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,aAAa,EACb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AAqB;KAChD;IACD,QAAQ,EAAE,GAAG,EAAE,CAAC;QACd,eAAe,CAAC,QAAQ,CAAC;QACzB,cAAc,EAAE;QAChB,cAAc,EAAE;QAChB,GAAG,iBAAiB,EAAE;QACtB,UAAU,EAAE;QACZ,eAAe,EAAE;QACjB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;QACnE,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC7B,UAAU,EAAE;QACZ,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC9C,GAAG,SAAS,CAAC,OAAO,CAAC;YACrB,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;SAC9C,CAAC,CAAC;QACH,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC;QACtC,YAAY,CAAC,YAAY,CAAC;QAC1B,WAAW,CAAC,QAAQ,CAAC;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAwB,EAAW,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA;AAE9G,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,IAAc,EAAE,OAAoB,EAAmB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ export declare const REASONS: {
2
+ reason: string;
3
+ code: "authentication_error" | "cancelled" | "configuration_error" | "confirmation_required" | "conflict" | "internal_error" | "invalid_response" | "network_error" | "not_found" | "outcome_unknown" | "permission_error" | "provider_error" | "provider_unavailable" | "rate_limited" | "timeout" | "validation_error";
4
+ message: string;
5
+ details: string[];
6
+ step?: string | undefined;
7
+ }[];
8
+ /** Detail keys hubspot's errors carry beyond cli-core's own. */
9
+ export declare const DETAILS: string[];
10
+ //# sourceMappingURL=reasons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasons.d.ts","sourceRoot":"","sources":["../src/reasons.ts"],"names":[],"mappings":"AA2BA,eAAO,MAAM,OAAO;;;;;;GAOnB,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,OAAO,UAAwD,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { defineReasons } from "@wirecat/cli-base/standards";
2
+ import { CORE_REASONS } from "@wirecat/cli-core";
3
+ /** cli-core's registry refuses a reason listed twice, and core adds reasons of its own over time; its entry wins. */
4
+ const CORE = new Set(CORE_REASONS.map((one) => one.reason));
5
+ /** hubspot's own reasons; the shared ones (`offline.refused`, `session.missing`) are cli-core's. */
6
+ const OWN = [
7
+ ["session.duplicate", "conflict", "another profile here already signs in to this HubSpot account"],
8
+ ["account.id-missing", "configuration_error", "WCHUBSPOT_TOKEN needs WCHUBSPOT_ACCOUNT, the HubSpot account's id"],
9
+ ["account.id-malformed", "configuration_error", "WCHUBSPOT_ACCOUNT must be the HubSpot account's id, digits only"],
10
+ [
11
+ "account.unchecked",
12
+ "configuration_error",
13
+ "a WCHUBSPOT_TOKEN profile uses the local copy only after an online run checked it",
14
+ ],
15
+ ["account.mismatch", "configuration_error", "WCHUBSPOT_ACCOUNT names another account than the token's own"],
16
+ ["account-remove.account-shared", "conflict", "another profile reads the same account, whose copy the store shares"],
17
+ ["session.expired", "authentication_error", "HubSpot refused the key: it was revoked, expired or mistyped"],
18
+ ["hubspot.scope-missing", "permission_error", "the HubSpot key lacks a scope this command needs"],
19
+ ["hubspot.access-denied", "permission_error", "the HubSpot key may not read this"],
20
+ ["hubspot.daily-limit", "rate_limited", "the HubSpot account spent its daily API allowance, shared by all its apps"],
21
+ ["hubspot.rate-limit", "rate_limited", "HubSpot asked to slow down for a few seconds"],
22
+ ["hubspot.too-many-filters", "validation_error", "a HubSpot search takes at most 6 conditions together"],
23
+ ["hubspot.search-cap", "validation_error", "a HubSpot search reaches only its first 10,000 results"],
24
+ ];
25
+ export const REASONS = defineReasons(OWN.filter(([reason]) => !CORE.has(reason)).map(([reason, code, message]) => ({
26
+ reason,
27
+ code,
28
+ message,
29
+ details: [],
30
+ })));
31
+ /** Detail keys hubspot's errors carry beyond cli-core's own. */
32
+ export const DETAILS = ["account", "profile", "profiles", "status", "scope"];
33
+ //# sourceMappingURL=reasons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasons.js","sourceRoot":"","sources":["../src/reasons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,qHAAqH;AACrH,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAE3D,oGAAoG;AACpG,MAAM,GAAG,GAAsD;IAC7D,CAAC,mBAAmB,EAAE,UAAU,EAAE,+DAA+D,CAAC;IAClG,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,mEAAmE,CAAC;IAClH,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,iEAAiE,CAAC;IAClH;QACE,mBAAmB;QACnB,qBAAqB;QACrB,mFAAmF;KACpF;IACD,CAAC,kBAAkB,EAAE,qBAAqB,EAAE,8DAA8D,CAAC;IAC3G,CAAC,+BAA+B,EAAE,UAAU,EAAE,qEAAqE,CAAC;IACpH,CAAC,iBAAiB,EAAE,sBAAsB,EAAE,8DAA8D,CAAC;IAC3G,CAAC,uBAAuB,EAAE,kBAAkB,EAAE,kDAAkD,CAAC;IACjG,CAAC,uBAAuB,EAAE,kBAAkB,EAAE,mCAAmC,CAAC;IAClF,CAAC,qBAAqB,EAAE,cAAc,EAAE,2EAA2E,CAAC;IACpH,CAAC,oBAAoB,EAAE,cAAc,EAAE,8CAA8C,CAAC;IACtF,CAAC,0BAA0B,EAAE,kBAAkB,EAAE,sDAAsD,CAAC;IACxG,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,wDAAwD,CAAC;CACrG,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAClC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM;IACN,IAAI;IACJ,OAAO;IACP,OAAO,EAAE,EAAE;CACZ,CAAC,CAAC,CACJ,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA"}
@@ -0,0 +1,61 @@
1
+ import * as v from "valibot";
2
+ import type { Transport } from "./transport.js";
3
+ declare const wireComment: v.ObjectSchema<{
4
+ readonly id: v.StringSchema<undefined>;
5
+ readonly body: v.StringSchema<undefined>;
6
+ readonly authorName: v.StringSchema<undefined>;
7
+ readonly createdAt: v.StringSchema<undefined>;
8
+ }, undefined>;
9
+ /**
10
+ * The answer's own shape, in snake_case (WC-OUT-12). `answerEntity` publishes it, so `--json=id,text` and the MCP
11
+ * schema both come from here (WC-CMD-19). No wire type leaves this file (WC-ARCH-3).
12
+ */
13
+ export declare const commentSchema: v.StrictObjectSchema<{
14
+ readonly id: v.StringSchema<undefined>;
15
+ readonly text: v.StringSchema<undefined>;
16
+ readonly author: v.StringSchema<undefined>;
17
+ readonly created_at: v.StringSchema<undefined>;
18
+ }, undefined>;
19
+ export type Comment = v.InferOutput<typeof commentSchema>;
20
+ export declare const commentOf: (wire: v.InferOutput<typeof wireComment>) => Comment;
21
+ /** Every call the sample makes: a method, a path template and only the fields the service documents. */
22
+ export declare const commentsService: (api: Transport) => {
23
+ me: () => Promise<{
24
+ id: string;
25
+ name: string;
26
+ }>;
27
+ list: ({ limit, offset, author }: {
28
+ limit: number;
29
+ offset: number;
30
+ author?: string | undefined;
31
+ }) => Promise<{
32
+ items: {
33
+ id: string;
34
+ text: string;
35
+ author: string;
36
+ created_at: string;
37
+ }[];
38
+ hasMore: boolean;
39
+ }>;
40
+ show: (id: string) => Promise<{
41
+ id: string;
42
+ text: string;
43
+ author: string;
44
+ created_at: string;
45
+ }>;
46
+ create: (text: string) => Promise<{
47
+ id: string;
48
+ text: string;
49
+ author: string;
50
+ created_at: string;
51
+ }>;
52
+ update: (id: string, text: string) => Promise<{
53
+ id: string;
54
+ text: string;
55
+ author: string;
56
+ created_at: string;
57
+ }>;
58
+ };
59
+ export type CommentsService = ReturnType<typeof commentsService>;
60
+ export {};
61
+ //# sourceMappingURL=comments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/sample/comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAI/C,QAAA,MAAM,WAAW;;;;;aAKf,CAAA;AAIF;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;aAKxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,eAAO,MAAM,SAAS,SAAU,CAAC,CAAC,WAAW,CAAC,OAAO,WAAW,CAAC,KAAG,OAKlE,CAAA;AAEF,wGAAwG;AACxG,eAAO,MAAM,eAAe,QAAS,SAAS;IAC5C,EAAE;;;;IACF,IAAI,8BAAoC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE;;;;;;;;;IAItG,IAAI,OAAa,MAAM;;;;;;IAEvB,MAAM,SAAe,MAAM;;;;;;IAE3B,MAAM,OAAa,MAAM,QAAQ,MAAM;;;;;;CAIvC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA"}
@@ -0,0 +1,39 @@
1
+ import * as v from "valibot";
2
+ // SAMPLE: replace these shapes with your service's. Each wire name comes from the service's docs or a captured answer,
3
+ // never from memory; the strict fake in src/testing/fake-comments.ts refuses any other.
4
+ const wireComment = v.object({
5
+ id: v.string(),
6
+ body: v.string(),
7
+ authorName: v.string(),
8
+ createdAt: v.string(),
9
+ });
10
+ const wirePage = v.object({ comments: v.array(wireComment), hasMore: v.boolean() });
11
+ const wireUser = v.object({ id: v.string(), name: v.string() });
12
+ /**
13
+ * The answer's own shape, in snake_case (WC-OUT-12). `answerEntity` publishes it, so `--json=id,text` and the MCP
14
+ * schema both come from here (WC-CMD-19). No wire type leaves this file (WC-ARCH-3).
15
+ */
16
+ export const commentSchema = v.strictObject({
17
+ id: v.string(),
18
+ text: v.string(),
19
+ author: v.string(),
20
+ created_at: v.string(),
21
+ });
22
+ export const commentOf = (wire) => ({
23
+ id: wire.id,
24
+ text: wire.body,
25
+ author: wire.authorName,
26
+ created_at: wire.createdAt,
27
+ });
28
+ /** Every call the sample makes: a method, a path template and only the fields the service documents. */
29
+ export const commentsService = (api) => ({
30
+ me: () => api.send({ method: "GET", path: "me" }, wireUser),
31
+ list: async ({ limit, offset, author }) => {
32
+ const page = await api.send({ method: "GET", path: "comments", query: { limit, offset, by: author } }, wirePage);
33
+ return { items: page.comments.map(commentOf), hasMore: page.hasMore };
34
+ },
35
+ show: async (id) => commentOf(await api.send({ method: "GET", path: "comments/{id}", ids: { id } }, wireComment)),
36
+ create: async (text) => commentOf(await api.send({ method: "POST", path: "comments", body: { body: text } }, wireComment)),
37
+ update: async (id, text) => commentOf(await api.send({ method: "PATCH", path: "comments/{id}", ids: { id }, body: { body: text } }, wireComment)),
38
+ });
39
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/sample/comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B,uHAAuH;AACvH,wFAAwF;AACxF,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA;AACF,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;AACnF,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAuC,EAAW,EAAE,CAAC,CAAC;I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AW,CAAC,CAAC;IACpG,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,IAAY,EAAE,EAAE,CACzC,SAAS,CACP,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,CAC3G;CACJ,CAAC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { type IngestReceipt } from "@wirecat/cli-core/services";
2
+ import type { MessageStore } from "@wirecat/cli-core/store";
3
+ import type { Comment } from "./comments.js";
4
+ export interface RecordsSource {
5
+ provider: string;
6
+ account: string;
7
+ batchId: string;
8
+ }
9
+ /** The JSONL a records import reads, ready for a file or stdout: the header line, then one record per line. */
10
+ export declare function commentLines(source: RecordsSource, comments: AsyncIterable<Comment> | Iterable<Comment>): AsyncGenerator<string, void, unknown>;
11
+ /**
12
+ * Takes a JSONL file or stdin into the shared store one line at a time, so memory does not grow with the file. The
13
+ * header's `source.account` must be `account`, or every record is refused.
14
+ */
15
+ export declare const importRecords: (store: Pick<MessageStore, "records">, input: NodeJS.ReadableStream, account: string) => Promise<IngestReceipt>;
16
+ //# sourceMappingURL=records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/sample/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAA2B,MAAM,4BAA4B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,+GAA+G;AAC/G,wBAAuB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,yCAa9G;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,UACjB,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,SAC7B,MAAM,CAAC,cAAc,WACnB,MAAM,KACd,OAAO,CAAC,aAAa,CAAuD,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { ingestLines, jsonlLines } from "@wirecat/cli-core/services";
2
+ /** The JSONL a records import reads, ready for a file or stdout: the header line, then one record per line. */
3
+ export async function* commentLines(source, comments) {
4
+ yield `${JSON.stringify({
5
+ schema_version: 1,
6
+ source: { provider: source.provider, account: source.account, batch_id: source.batchId },
7
+ })}\n`;
8
+ for await (const comment of comments)
9
+ yield `${JSON.stringify({
10
+ key: comment.id,
11
+ type: "custom:comment",
12
+ external_id: comment.id,
13
+ operation: "upsert",
14
+ fields: { text: comment.text, author: comment.author, created_at: comment.created_at },
15
+ })}\n`;
16
+ }
17
+ /**
18
+ * Takes a JSONL file or stdin into the shared store one line at a time, so memory does not grow with the file. The
19
+ * header's `source.account` must be `account`, or every record is refused.
20
+ */
21
+ export const importRecords = (store, input, account) => ingestLines(store, jsonlLines(input), { account });
22
+ //# sourceMappingURL=records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.js","sourceRoot":"","sources":["../../src/sample/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAcxF,+GAA+G;AAC/G,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,YAAY,CAAC,MAAqB,EAAE,QAAoD;IAC7G,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;QACtB,cAAc,EAAE,CAAC;QACjB,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE;KACzF,CAAC,IAAI,CAAA;IACN,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,QAAQ;QAClC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;YACtB,GAAG,EAAE,OAAO,CAAC,EAAE;YACf,IAAI,EAAE,gBAAgB;YACtB,WAAW,EAAE,OAAO,CAAC,EAAE;YACvB,SAAS,EAAE,QAAQ;YACnB,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;SACvF,CAAC,IAAI,CAAA;AACV,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,KAAoC,EACpC,KAA4B,EAC5B,OAAe,EACS,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { CliError, type SleepLike } from "@wirecat/cli-base";
2
+ import { type EventSink } from "@wirecat/cli-core/cli";
3
+ import type { Pacer } from "@wirecat/cli-core/sends";
4
+ import * as v from "valibot";
5
+ export declare const SERVICE_URL = "https://comments.example.invalid/v1/";
6
+ export declare const SERVICE = "Example Comments";
7
+ export interface Request {
8
+ method: "GET" | "POST" | "PATCH";
9
+ /** The path as a template, `comments/{id}`: the run record keeps the template, never an id. */
10
+ path: string;
11
+ ids?: Record<string, string>;
12
+ query?: Record<string, string | number | undefined>;
13
+ body?: Record<string, unknown>;
14
+ }
15
+ export interface TransportOptions {
16
+ token: string;
17
+ fetch?: typeof fetch;
18
+ signal?: AbortSignal | undefined;
19
+ /** The run's sink from `baseContext(...).run(events => …)`, so each request lands in the run record (WC-LIFE-15). */
20
+ events?: EventSink;
21
+ /** cli-core's per-profile pace, shared by every process of the profile through a file. */
22
+ pacer?: Pacer;
23
+ sleep?: SleepLike;
24
+ now?: () => number;
25
+ timeoutMs?: number;
26
+ }
27
+ /**
28
+ * A refusal as a CliError with cli-base's code for its status. The service's own message is never repeated: it can
29
+ * quote what was sent (WC-SECR-6). A write that failed on the service's side may have happened, so it is
30
+ * `outcome_unknown` and never retryable (WC-OUT-20, WC-LIFE-9).
31
+ */
32
+ export declare const failureOf: (status: number, writes: boolean, retryAfterMs?: number) => CliError;
33
+ /**
34
+ * The only code that holds the token: it goes in the Authorization header, never in an address, an error or a run
35
+ * record (WC-SECR-7). Nothing here retries. A read the caller may run again; a write is never sent twice, since the
36
+ * first may have landed (WC-OUT-20).
37
+ */
38
+ export declare const transport: (options: TransportOptions) => {
39
+ send: <T>(request: Request, answer: v.GenericSchema<unknown, T>) => Promise<T>;
40
+ };
41
+ export type Transport = ReturnType<typeof transport>;
42
+ //# sourceMappingURL=transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/sample/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAyB,KAAK,SAAS,EAAa,MAAM,mBAAmB,CAAA;AAE9F,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,uBAAuB,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAK5B,eAAO,MAAM,WAAW,yCAAyC,CAAA;AACjE,eAAO,MAAM,OAAO,qBAAqB,CAAA;AAOzC,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;IAChC,+FAA+F;IAC/F,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IACpB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IAChC,qHAAqH;IACrH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAkBD;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAY,MAAM,UAAU,OAAO,iBAAiB,MAAM,KAAG,QAqBlF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,YAAa,gBAAgB;WA6B7B,CAAC,WAAW,OAAO,UAAU,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAAC;CAiE1F,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -0,0 +1,153 @@
1
+ import { CliError, isCliError, realSleep, wallClock } from "@wirecat/cli-base";
2
+ import { hostFetch, providerWaitMs, readJsonResponse, statusToCode } from "@wirecat/cli-base/http";
3
+ import { providerRequest } from "@wirecat/cli-core/cli";
4
+ import * as v from "valibot";
5
+ import { DESKTOP } from "../identity.js";
6
+ // SAMPLE: the Example Comments service does not exist; `.invalid` never resolves, so a real run reaches nothing.
7
+ // Replace the address, the paths and the answer shapes with your service's, each from its docs or a captured answer.
8
+ export const SERVICE_URL = "https://comments.example.invalid/v1/";
9
+ export const SERVICE = "Example Comments";
10
+ const TIMEOUT_MS = 30_000;
11
+ const LARGEST_ANSWER = 8 * 1024 * 1024;
12
+ /** A pace wait longer than this ends the run with `rate_limited` instead of sitting in it. */
13
+ const LONGEST_PACE_WAIT_MS = 60_000;
14
+ /** `new URL` folds a `.` or `..` segment into its parent, so such an id would reach another endpoint. */
15
+ const segment = (name, value) => {
16
+ if (value === "" || value === "." || value === "..")
17
+ throw new CliError("validation_error", `${name} must name one item; an empty, "." or ".." id is refused`);
18
+ return encodeURIComponent(value);
19
+ };
20
+ const urlOf = ({ path, ids = {}, query = {} }) => {
21
+ const url = new URL(path.replace(/\{(\w+)\}/g, (_, name) => segment(name, ids[name] ?? "")), SERVICE_URL);
22
+ for (const [key, value] of Object.entries(query))
23
+ if (value !== undefined)
24
+ url.searchParams.set(key, String(value));
25
+ return url;
26
+ };
27
+ /**
28
+ * A refusal as a CliError with cli-base's code for its status. The service's own message is never repeated: it can
29
+ * quote what was sent (WC-SECR-6). A write that failed on the service's side may have happened, so it is
30
+ * `outcome_unknown` and never retryable (WC-OUT-20, WC-LIFE-9).
31
+ */
32
+ export const failureOf = (status, writes, retryAfterMs) => {
33
+ if (status === 401)
34
+ return new CliError("authentication_error", `${SERVICE} refused the token; sign in again with session start`, {
35
+ status,
36
+ });
37
+ if (status === 429)
38
+ return new CliError("rate_limited", `${SERVICE} asked to slow down; retry the command later`, {
39
+ status,
40
+ retryable: true,
41
+ ...(retryAfterMs === undefined ? {} : { retry_after_ms: retryAfterMs }),
42
+ });
43
+ if (status >= 500 && writes)
44
+ return new CliError("outcome_unknown", `${SERVICE} failed during a write; check it before repeating the write`, {
45
+ status,
46
+ retryable: false,
47
+ });
48
+ if (status === 404)
49
+ return new CliError("not_found", `${SERVICE} has no such item, or this token cannot see it`);
50
+ return new CliError(statusToCode(status), `${SERVICE} refused the request (HTTP ${status})`, {
51
+ status,
52
+ retryable: status >= 500,
53
+ });
54
+ };
55
+ /**
56
+ * The only code that holds the token: it goes in the Authorization header, never in an address, an error or a run
57
+ * record (WC-SECR-7). Nothing here retries. A read the caller may run again; a write is never sent twice, since the
58
+ * first may have landed (WC-OUT-20).
59
+ */
60
+ export const transport = (options) => {
61
+ const fetchOf = hostFetch({ hosts: DESKTOP.hosts ?? [], ...(options.fetch ? { fetch: options.fetch } : {}) });
62
+ const sleep = options.sleep ?? realSleep;
63
+ const now = options.now ?? Date.now;
64
+ const turn = async () => {
65
+ if (!options.pacer)
66
+ return;
67
+ const wait = (await options.pacer.reserve()) - now();
68
+ if (wait <= 0)
69
+ return;
70
+ if (wait > LONGEST_PACE_WAIT_MS)
71
+ throw new CliError("rate_limited", `this profile must wait ${Math.ceil(wait / 1000)} s before its next request`, {
72
+ retry_after_ms: wait,
73
+ });
74
+ await sleep(wait, options.signal, "retry");
75
+ };
76
+ const unanswered = (writes, error) => {
77
+ // Before the stop check: a write stopped in flight may still have landed (WC-LIFE-9).
78
+ if (writes)
79
+ return new CliError("outcome_unknown", `${SERVICE} did not answer a write; check it before repeating the write`, {
80
+ retryable: false,
81
+ });
82
+ if (options.signal?.aborted)
83
+ return new CliError("cancelled", `the ${SERVICE} request was stopped`);
84
+ const timedOut = error?.name === "TimeoutError";
85
+ return timedOut
86
+ ? new CliError("timeout", `${SERVICE} did not answer in time`, { retryable: true })
87
+ : new CliError("network_error", `${SERVICE} could not be reached`, { retryable: true });
88
+ };
89
+ const send = async (request, answer) => {
90
+ const writes = request.method !== "GET";
91
+ const url = urlOf(request);
92
+ await turn();
93
+ // Not AbortSignal.timeout: its timer keeps the run's async context alive until it fires.
94
+ const deadline = new AbortController();
95
+ const timer = setTimeout(() => deadline.abort(new DOMException("timed out", "TimeoutError")), options.timeoutMs ?? TIMEOUT_MS);
96
+ timer.unref();
97
+ const signal = options.signal ? AbortSignal.any([options.signal, deadline.signal]) : deadline.signal;
98
+ const end = providerRequest(`${request.method} /${request.path}`, options.events, {
99
+ method: request.method,
100
+ transport: "http",
101
+ });
102
+ try {
103
+ let response;
104
+ try {
105
+ response = await fetchOf(url, {
106
+ method: request.method,
107
+ headers: {
108
+ authorization: `Bearer ${options.token}`,
109
+ accept: "application/json",
110
+ ...(request.body ? { "content-type": "application/json" } : {}),
111
+ },
112
+ ...(request.body ? { body: JSON.stringify(request.body) } : {}),
113
+ // A redirect would carry the Authorization header to an address we did not choose.
114
+ redirect: "error",
115
+ signal,
116
+ });
117
+ }
118
+ catch (error) {
119
+ const failure = unanswered(writes, deadline.signal.reason ?? error);
120
+ end({ errorCode: failure.code });
121
+ throw failure;
122
+ }
123
+ if (!response.ok) {
124
+ const failure = failureOf(response.status, writes, providerWaitMs(response.headers, wallClock));
125
+ end({ status: response.status, errorCode: failure.code });
126
+ throw failure;
127
+ }
128
+ let body;
129
+ try {
130
+ body = await readJsonResponse(response, { maxBytes: LARGEST_ANSWER, signal });
131
+ }
132
+ catch (error) {
133
+ const failure = isCliError(error) && error.code !== "invalid_response"
134
+ ? error
135
+ : new CliError("invalid_response", `${SERVICE} answered with something other than bounded JSON`);
136
+ end({ status: response.status, errorCode: failure.code });
137
+ throw failure;
138
+ }
139
+ const parsed = v.safeParse(answer, body);
140
+ if (!parsed.success) {
141
+ end({ status: response.status, errorCode: "invalid_response" });
142
+ throw new CliError("invalid_response", `${SERVICE}'s answer does not have the documented shape`);
143
+ }
144
+ end({ status: response.status });
145
+ return parsed.output;
146
+ }
147
+ finally {
148
+ clearTimeout(timer);
149
+ }
150
+ };
151
+ return { send };
152
+ };
153
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/sample/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAkB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC9F,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAClG,OAAO,EAAkB,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,i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,CAAC,CAAA;gBACpG,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;gBACzD,MAAM,OAAO,CAAA;YACf,CAAC;YACD,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACxC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC,CAAA;gBAC/D,MAAM,IAAI,QAAQ,CAAC,kBAAkB,EAAE,GAAG,OAAO,8CAA8C,CAAC,CAAA;YAClG,CAAC;YACD,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;YAChC,OAAO,MAAM,CAAC,MAAM,CAAA;QACtB,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAA;QACrB,CAAC;IACH,CAAC,CAAA;IAED,OAAO,EAAE,IAAI,EAAE,CAAA;AACjB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const hubspotSetup: import("@wirecat/cli-core/cli").Setup;
2
+ //# sourceMappingURL=flow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/setup/flow.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,YAAY,uCA8DvB,CAAA"}