terse-cli 0.2.16 → 0.3.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 (331) hide show
  1. package/dist/_tmp_create_project.d.ts +2 -0
  2. package/dist/_tmp_create_project.d.ts.map +1 -0
  3. package/dist/_tmp_create_project.js +17 -0
  4. package/dist/_tmp_create_project.js.map +1 -0
  5. package/dist/_tmp_delete_agent.d.ts +2 -0
  6. package/dist/_tmp_delete_agent.d.ts.map +1 -0
  7. package/dist/_tmp_delete_agent.js +14 -0
  8. package/dist/_tmp_delete_agent.js.map +1 -0
  9. package/dist/_tmp_manual_trigger.d.ts +2 -0
  10. package/dist/_tmp_manual_trigger.d.ts.map +1 -0
  11. package/dist/_tmp_manual_trigger.js +17 -0
  12. package/dist/_tmp_manual_trigger.js.map +1 -0
  13. package/dist/_tmp_patch_active.d.ts +2 -0
  14. package/dist/_tmp_patch_active.d.ts.map +1 -0
  15. package/dist/_tmp_patch_active.js +21 -0
  16. package/dist/_tmp_patch_active.js.map +1 -0
  17. package/dist/codegen.d.ts +15 -0
  18. package/dist/codegen.d.ts.map +1 -1
  19. package/dist/codegen.js +466 -81
  20. package/dist/codegen.js.map +1 -1
  21. package/dist/commands/deployTheme.d.ts +28 -0
  22. package/dist/commands/deployTheme.d.ts.map +1 -0
  23. package/dist/commands/deployTheme.js +68 -0
  24. package/dist/commands/deployTheme.js.map +1 -0
  25. package/dist/commands/dev.d.ts +3 -0
  26. package/dist/commands/dev.d.ts.map +1 -0
  27. package/dist/commands/dev.js +47 -0
  28. package/dist/commands/dev.js.map +1 -0
  29. package/dist/commands/fsExec.d.ts +8 -0
  30. package/dist/commands/fsExec.d.ts.map +1 -0
  31. package/dist/commands/fsExec.js +46 -0
  32. package/dist/commands/fsExec.js.map +1 -0
  33. package/dist/commands/generate.d.ts.map +1 -1
  34. package/dist/commands/generate.js +36 -267
  35. package/dist/commands/generate.js.map +1 -1
  36. package/dist/commands/serve.d.ts +1 -0
  37. package/dist/commands/serve.d.ts.map +1 -0
  38. package/dist/commands/serve.js +2 -0
  39. package/dist/commands/serve.js.map +1 -0
  40. package/dist/commands/terseCliTheme.d.ts +28 -0
  41. package/dist/commands/terseCliTheme.d.ts.map +1 -0
  42. package/dist/commands/terseCliTheme.js +68 -0
  43. package/dist/commands/terseCliTheme.js.map +1 -0
  44. package/dist/commands/tool.d.ts +6 -0
  45. package/dist/commands/tool.d.ts.map +1 -0
  46. package/dist/commands/tool.js +34 -0
  47. package/dist/commands/tool.js.map +1 -0
  48. package/dist/commands/toolRun.js +1 -1
  49. package/dist/commands/toolRun.js.map +1 -1
  50. package/dist/data/standardSlackEmoji.d.ts +2 -0
  51. package/dist/data/standardSlackEmoji.d.ts.map +1 -0
  52. package/dist/data/standardSlackEmoji.js +1978 -0
  53. package/dist/data/standardSlackEmoji.js.map +1 -0
  54. package/dist/data/standardSlackEmoji.json +1974 -0
  55. package/dist/deploy.d.ts +2 -1
  56. package/dist/deploy.d.ts.map +1 -1
  57. package/dist/deploy.js +61 -38
  58. package/dist/deploy.js.map +1 -1
  59. package/dist/generate.d.ts +2 -1
  60. package/dist/generate.d.ts.map +1 -1
  61. package/dist/generate.js +67 -69
  62. package/dist/generate.js.map +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/init.d.ts +2 -1
  66. package/dist/init.d.ts.map +1 -1
  67. package/dist/init.js +45 -96
  68. package/dist/init.js.map +1 -1
  69. package/dist/integrate.d.ts +1 -0
  70. package/dist/integrate.d.ts.map +1 -1
  71. package/dist/integrate.js +191 -11
  72. package/dist/integrate.js.map +1 -1
  73. package/dist/nonInteractive.d.ts +4 -2
  74. package/dist/nonInteractive.d.ts.map +1 -1
  75. package/dist/nonInteractive.js +5 -2
  76. package/dist/nonInteractive.js.map +1 -1
  77. package/dist/perf.d.ts +9 -0
  78. package/dist/perf.d.ts.map +1 -0
  79. package/dist/perf.js +59 -0
  80. package/dist/perf.js.map +1 -0
  81. package/dist/providers/LanguageProvider.d.ts +6 -2
  82. package/dist/providers/LanguageProvider.d.ts.map +1 -1
  83. package/dist/providers/codegen.test.d.ts +2 -0
  84. package/dist/providers/codegen.test.d.ts.map +1 -0
  85. package/dist/providers/codegen.test.js +45 -0
  86. package/dist/providers/codegen.test.js.map +1 -0
  87. package/dist/providers/codegenTypes.d.ts +16 -134
  88. package/dist/providers/codegenTypes.d.ts.map +1 -1
  89. package/dist/providers/python/PythonProvider.js +1 -0
  90. package/dist/providers/python/PythonProvider.js.map +1 -1
  91. package/dist/providers/python/PythonProvider.test.d.ts +2 -0
  92. package/dist/providers/python/PythonProvider.test.d.ts.map +1 -0
  93. package/dist/providers/python/PythonProvider.test.js +169 -0
  94. package/dist/providers/python/PythonProvider.test.js.map +1 -0
  95. package/dist/providers/typescript/TypeScriptProvider.d.ts +2 -2
  96. package/dist/providers/typescript/TypeScriptProvider.d.ts.map +1 -1
  97. package/dist/providers/typescript/TypeScriptProvider.js +53 -4
  98. package/dist/providers/typescript/TypeScriptProvider.js.map +1 -1
  99. package/dist/providers/typescript/attioProjection.d.ts +50 -0
  100. package/dist/providers/typescript/attioProjection.d.ts.map +1 -0
  101. package/dist/providers/typescript/attioProjection.js +358 -0
  102. package/dist/providers/typescript/attioProjection.js.map +1 -0
  103. package/dist/providers/typescript/modules/IntegrationModule.d.ts +82 -0
  104. package/dist/providers/typescript/modules/IntegrationModule.d.ts.map +1 -0
  105. package/dist/providers/typescript/modules/IntegrationModule.js +184 -0
  106. package/dist/providers/typescript/modules/IntegrationModule.js.map +1 -0
  107. package/dist/providers/typescript/modules/attio/AttioModule.d.ts +55 -0
  108. package/dist/providers/typescript/modules/attio/AttioModule.d.ts.map +1 -0
  109. package/dist/providers/typescript/modules/attio/AttioModule.js +163 -0
  110. package/dist/providers/typescript/modules/attio/AttioModule.js.map +1 -0
  111. package/dist/providers/typescript/modules/attio/attioProjection.d.ts +50 -0
  112. package/dist/providers/typescript/modules/attio/attioProjection.d.ts.map +1 -0
  113. package/dist/providers/typescript/modules/attio/attioProjection.js +358 -0
  114. package/dist/providers/typescript/modules/attio/attioProjection.js.map +1 -0
  115. package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts +4 -0
  116. package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts.map +1 -0
  117. package/dist/providers/typescript/modules/attio/attioToolMethods.js +295 -0
  118. package/dist/providers/typescript/modules/attio/attioToolMethods.js.map +1 -0
  119. package/dist/providers/typescript/modules/attio/attioTypes.d.ts +36 -0
  120. package/dist/providers/typescript/modules/attio/attioTypes.d.ts.map +1 -0
  121. package/dist/providers/typescript/modules/attio/attioTypes.js +2 -0
  122. package/dist/providers/typescript/modules/attio/attioTypes.js.map +1 -0
  123. package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts +25 -0
  124. package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts.map +1 -0
  125. package/dist/providers/typescript/modules/datadog/DatadogModule.js +33 -0
  126. package/dist/providers/typescript/modules/datadog/DatadogModule.js.map +1 -0
  127. package/dist/providers/typescript/modules/github/GithubModule.d.ts +44 -0
  128. package/dist/providers/typescript/modules/github/GithubModule.d.ts.map +1 -0
  129. package/dist/providers/typescript/modules/github/GithubModule.js +111 -0
  130. package/dist/providers/typescript/modules/github/GithubModule.js.map +1 -0
  131. package/dist/providers/typescript/modules/gmail/GmailModule.d.ts +17 -0
  132. package/dist/providers/typescript/modules/gmail/GmailModule.d.ts.map +1 -0
  133. package/dist/providers/typescript/modules/gmail/GmailModule.js +30 -0
  134. package/dist/providers/typescript/modules/gmail/GmailModule.js.map +1 -0
  135. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts +25 -0
  136. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts.map +1 -0
  137. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js +33 -0
  138. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js.map +1 -0
  139. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts +26 -0
  140. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts.map +1 -0
  141. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js +34 -0
  142. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js.map +1 -0
  143. package/dist/providers/typescript/modules/linear/LinearModule.d.ts +35 -0
  144. package/dist/providers/typescript/modules/linear/LinearModule.d.ts.map +1 -0
  145. package/dist/providers/typescript/modules/linear/LinearModule.js +48 -0
  146. package/dist/providers/typescript/modules/linear/LinearModule.js.map +1 -0
  147. package/dist/providers/typescript/modules/moduleHelpers.d.ts +23 -0
  148. package/dist/providers/typescript/modules/moduleHelpers.d.ts.map +1 -0
  149. package/dist/providers/typescript/modules/moduleHelpers.js +74 -0
  150. package/dist/providers/typescript/modules/moduleHelpers.js.map +1 -0
  151. package/dist/providers/typescript/modules/notion/NotionModule.d.ts +33 -0
  152. package/dist/providers/typescript/modules/notion/NotionModule.d.ts.map +1 -0
  153. package/dist/providers/typescript/modules/notion/NotionModule.js +44 -0
  154. package/dist/providers/typescript/modules/notion/NotionModule.js.map +1 -0
  155. package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts +30 -0
  156. package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts.map +1 -0
  157. package/dist/providers/typescript/modules/posthog/PosthogModule.js +60 -0
  158. package/dist/providers/typescript/modules/posthog/PosthogModule.js.map +1 -0
  159. package/dist/providers/typescript/modules/registry.d.ts +11 -0
  160. package/dist/providers/typescript/modules/registry.d.ts.map +1 -0
  161. package/dist/providers/typescript/modules/registry.js +37 -0
  162. package/dist/providers/typescript/modules/registry.js.map +1 -0
  163. package/dist/providers/typescript/modules/resend/ResendModule.d.ts +32 -0
  164. package/dist/providers/typescript/modules/resend/ResendModule.d.ts.map +1 -0
  165. package/dist/providers/typescript/modules/resend/ResendModule.js +71 -0
  166. package/dist/providers/typescript/modules/resend/ResendModule.js.map +1 -0
  167. package/dist/providers/typescript/modules/slack/SlackModule.d.ts +32 -0
  168. package/dist/providers/typescript/modules/slack/SlackModule.d.ts.map +1 -0
  169. package/dist/providers/typescript/modules/slack/SlackModule.js +51 -0
  170. package/dist/providers/typescript/modules/slack/SlackModule.js.map +1 -0
  171. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts +20 -0
  172. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts.map +1 -0
  173. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js +27 -0
  174. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js.map +1 -0
  175. package/dist/providers/typescript/modules/templateRenderer.d.ts +17 -0
  176. package/dist/providers/typescript/modules/templateRenderer.d.ts.map +1 -0
  177. package/dist/providers/typescript/modules/templateRenderer.js +64 -0
  178. package/dist/providers/typescript/modules/templateRenderer.js.map +1 -0
  179. package/dist/providers/typescript/modules/terse/TerseModule.d.ts +20 -0
  180. package/dist/providers/typescript/modules/terse/TerseModule.d.ts.map +1 -0
  181. package/dist/providers/typescript/modules/terse/TerseModule.js +61 -0
  182. package/dist/providers/typescript/modules/terse/TerseModule.js.map +1 -0
  183. package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts +17 -0
  184. package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts.map +1 -0
  185. package/dist/providers/typescript/modules/workos/WorkOSModule.js +30 -0
  186. package/dist/providers/typescript/modules/workos/WorkOSModule.js.map +1 -0
  187. package/dist/providers/typescript/prepareCodegenData.test.d.ts +2 -0
  188. package/dist/providers/typescript/prepareCodegenData.test.d.ts.map +1 -0
  189. package/dist/providers/typescript/prepareCodegenData.test.js +54 -0
  190. package/dist/providers/typescript/prepareCodegenData.test.js.map +1 -0
  191. package/dist/providers/typescript/projectedTypes.d.ts +11 -0
  192. package/dist/providers/typescript/projectedTypes.d.ts.map +1 -0
  193. package/dist/providers/typescript/projectedTypes.js +53 -0
  194. package/dist/providers/typescript/projectedTypes.js.map +1 -0
  195. package/dist/providers/typescript/projectionPrinter.d.ts +26 -0
  196. package/dist/providers/typescript/projectionPrinter.d.ts.map +1 -0
  197. package/dist/providers/typescript/projectionPrinter.js +110 -0
  198. package/dist/providers/typescript/projectionPrinter.js.map +1 -0
  199. package/dist/providers/typescript/replayLogDedupe.d.ts +6 -0
  200. package/dist/providers/typescript/replayLogDedupe.d.ts.map +1 -0
  201. package/dist/providers/typescript/replayLogDedupe.js +156 -0
  202. package/dist/providers/typescript/replayLogDedupe.js.map +1 -0
  203. package/dist/providers/typescript/templateEngine.d.ts +8 -2
  204. package/dist/providers/typescript/templateEngine.d.ts.map +1 -1
  205. package/dist/providers/typescript/templateEngine.js +241 -29
  206. package/dist/providers/typescript/templateEngine.js.map +1 -1
  207. package/dist/providers/typescript/triggerPayloads.d.ts +7 -0
  208. package/dist/providers/typescript/triggerPayloads.d.ts.map +1 -0
  209. package/dist/providers/typescript/triggerPayloads.js +60 -0
  210. package/dist/providers/typescript/triggerPayloads.js.map +1 -0
  211. package/dist/providers/typescript/triggerTypeDeclarations.d.ts +7 -0
  212. package/dist/providers/typescript/triggerTypeDeclarations.d.ts.map +1 -0
  213. package/dist/providers/typescript/triggerTypeDeclarations.js +42 -0
  214. package/dist/providers/typescript/triggerTypeDeclarations.js.map +1 -0
  215. package/dist/providers/typescript/triggerTypeRegistry.d.ts +7 -0
  216. package/dist/providers/typescript/triggerTypeRegistry.d.ts.map +1 -0
  217. package/dist/providers/typescript/triggerTypeRegistry.js +198 -0
  218. package/dist/providers/typescript/triggerTypeRegistry.js.map +1 -0
  219. package/dist/providers/typescript/typePrinter.d.ts +23 -0
  220. package/dist/providers/typescript/typePrinter.d.ts.map +1 -0
  221. package/dist/providers/typescript/typePrinter.js +123 -0
  222. package/dist/providers/typescript/typePrinter.js.map +1 -0
  223. package/dist/run.d.ts +2 -11
  224. package/dist/run.d.ts.map +1 -1
  225. package/dist/run.js +42 -153
  226. package/dist/run.js.map +1 -1
  227. package/dist/sampleEventId.d.ts +0 -4
  228. package/dist/sampleEventId.d.ts.map +1 -1
  229. package/dist/sampleEventId.js +0 -4
  230. package/dist/sampleEventId.js.map +1 -1
  231. package/dist/shared/ApiRoutes.d.ts +19 -0
  232. package/dist/shared/ApiRoutes.d.ts.map +1 -1
  233. package/dist/shared/ApiRoutes.js +17 -1
  234. package/dist/shared/ApiRoutes.js.map +1 -1
  235. package/dist/shared/Configs.d.ts +24 -2
  236. package/dist/shared/Configs.d.ts.map +1 -1
  237. package/dist/shared/Configs.js +32 -2
  238. package/dist/shared/Configs.js.map +1 -1
  239. package/dist/shared/Integrations.d.ts +18 -1
  240. package/dist/shared/Integrations.d.ts.map +1 -1
  241. package/dist/shared/Integrations.js +10 -1
  242. package/dist/shared/Integrations.js.map +1 -1
  243. package/dist/shared/InvalidationKeys.d.ts +1 -0
  244. package/dist/shared/InvalidationKeys.d.ts.map +1 -1
  245. package/dist/shared/InvalidationKeys.js +3 -0
  246. package/dist/shared/InvalidationKeys.js.map +1 -1
  247. package/dist/shared/ModelEvents.d.ts +9 -0
  248. package/dist/shared/ModelEvents.d.ts.map +1 -1
  249. package/dist/shared/ModelEvents.js +15 -0
  250. package/dist/shared/ModelEvents.js.map +1 -1
  251. package/dist/shared/ToolDisplayUtils.d.ts.map +1 -1
  252. package/dist/shared/ToolDisplayUtils.js +107 -11
  253. package/dist/shared/ToolDisplayUtils.js.map +1 -1
  254. package/dist/shared/types.d.ts +1013 -108
  255. package/dist/shared/types.d.ts.map +1 -1
  256. package/dist/shared/types.js.map +1 -1
  257. package/dist/test.d.ts +2 -1
  258. package/dist/test.d.ts.map +1 -1
  259. package/dist/test.js +43 -23
  260. package/dist/test.js.map +1 -1
  261. package/dist/triggerParseDetail.d.ts +8 -0
  262. package/dist/triggerParseDetail.d.ts.map +1 -0
  263. package/dist/triggerParseDetail.js +30 -0
  264. package/dist/triggerParseDetail.js.map +1 -0
  265. package/dist/util.d.ts +2 -3
  266. package/dist/util.d.ts.map +1 -1
  267. package/dist/util.js +3 -3
  268. package/dist/util.js.map +1 -1
  269. package/package.json +7 -5
  270. package/src/providers/typescript/modules/attio/attio.schemas.hbs +150 -0
  271. package/src/providers/typescript/modules/attio/attio.tools.hbs +192 -0
  272. package/src/providers/typescript/modules/attio/attio.triggers.hbs +130 -0
  273. package/src/providers/typescript/modules/datadog/datadog.tools.hbs +16 -0
  274. package/src/providers/typescript/modules/github/github.tools.hbs +68 -0
  275. package/src/providers/typescript/modules/github/github.triggers.hbs +40 -0
  276. package/src/providers/typescript/modules/gmail/gmail.tools.hbs +17 -0
  277. package/src/providers/typescript/modules/gmail/gmail.triggers.hbs +16 -0
  278. package/src/providers/typescript/modules/hey_reach/hey_reach.tools.hbs +9 -0
  279. package/src/providers/typescript/modules/hey_reach/hey_reach.triggers.hbs +56 -0
  280. package/src/providers/typescript/modules/launchdarkly/launchdarkly.tools.hbs +16 -0
  281. package/src/providers/typescript/modules/linear/linear.tools.hbs +23 -0
  282. package/src/providers/typescript/modules/linear/linear.triggers.hbs +24 -0
  283. package/src/providers/typescript/modules/notion/notion.tools.hbs +20 -0
  284. package/src/providers/typescript/modules/posthog/posthog.tools.hbs +28 -0
  285. package/{templates/typescript/codegen/partials/resend-section.hbs → src/providers/typescript/modules/resend/resend.tools.hbs} +17 -5
  286. package/src/providers/typescript/modules/slack/slack.tools.hbs +18 -0
  287. package/src/providers/typescript/modules/slack/slack.triggers.hbs +28 -0
  288. package/src/providers/typescript/modules/snowflake/snowflake.tools.hbs +12 -0
  289. package/src/providers/typescript/modules/terse/terse.tools.hbs +22 -0
  290. package/src/providers/typescript/modules/terse/terse.triggers.hbs +33 -0
  291. package/src/providers/typescript/modules/workos/workos.tools.hbs +12 -0
  292. package/src/providers/typescript/modules/workos/workos.triggers.hbs +64 -0
  293. package/templates/typescript/codegen/.impeccable/hook.cache.json +1 -0
  294. package/templates/typescript/codegen/common.hbs +6 -0
  295. package/templates/typescript/codegen/partials/tools-slice.hbs +18 -0
  296. package/templates/typescript/codegen/root.hbs +72 -0
  297. package/templates/typescript/codegen/sdk-primitives.hbs +42 -0
  298. package/dist/jsonOutput.d.ts +0 -19
  299. package/dist/jsonOutput.d.ts.map +0 -1
  300. package/dist/jsonOutput.js +0 -25
  301. package/dist/jsonOutput.js.map +0 -1
  302. package/dist/providers/typescript/parkSignals.d.ts +0 -7
  303. package/dist/providers/typescript/parkSignals.d.ts.map +0 -1
  304. package/dist/providers/typescript/parkSignals.js +0 -45
  305. package/dist/providers/typescript/parkSignals.js.map +0 -1
  306. package/dist/replay.d.ts +0 -3
  307. package/dist/replay.d.ts.map +0 -1
  308. package/dist/replay.js +0 -20
  309. package/dist/replay.js.map +0 -1
  310. package/dist/testRelay.d.ts +0 -6
  311. package/dist/testRelay.d.ts.map +0 -1
  312. package/dist/testRelay.js +0 -91
  313. package/dist/testRelay.js.map +0 -1
  314. package/dist/urls.d.ts +0 -3
  315. package/dist/urls.d.ts.map +0 -1
  316. package/dist/urls.js +0 -27
  317. package/dist/urls.js.map +0 -1
  318. package/templates/typescript/codegen/generated.hbs +0 -15
  319. package/templates/typescript/codegen/partials/attio-section.hbs +0 -86
  320. package/templates/typescript/codegen/partials/datadog-section.hbs +0 -3
  321. package/templates/typescript/codegen/partials/github-section.hbs +0 -30
  322. package/templates/typescript/codegen/partials/header.hbs +0 -17
  323. package/templates/typescript/codegen/partials/hey-reach-section.hbs +0 -3
  324. package/templates/typescript/codegen/partials/launchdarkly-section.hbs +0 -3
  325. package/templates/typescript/codegen/partials/linear-section.hbs +0 -5
  326. package/templates/typescript/codegen/partials/notion-section.hbs +0 -5
  327. package/templates/typescript/codegen/partials/posthog-section.hbs +0 -15
  328. package/templates/typescript/codegen/partials/skills-section.hbs +0 -105
  329. package/templates/typescript/codegen/partials/slack-section.hbs +0 -5
  330. package/templates/typescript/codegen/partials/tools-section.hbs +0 -94
  331. package/templates/typescript/codegen/partials/triggers-section.hbs +0 -353
@@ -0,0 +1,184 @@
1
+ import { ToolDefinitions, TriggerDefinitions, runHistoryActionBaseSchema, toolsWithIntegrationId } from "terse-types";
2
+ import { buildTriggerDeclarationsForBucket } from "../triggerTypeDeclarations.js";
3
+ import { printType } from "../typePrinter.js";
4
+ import { escapeString, toCamelCase, toPascalCase, toolNameToTypeName } from "./moduleHelpers.js";
5
+ import { ModuleTemplateRenderer } from "./templateRenderer.js";
6
+ const INTEGRATIONS_WITH_TRIGGERS = new Set(Object.values(TriggerDefinitions).map(definition => definition.integration));
7
+ export const RUN_HISTORY_ACTION_HOIST = { name: "RunHistoryAction", schema: runHistoryActionBaseSchema };
8
+ /**
9
+ * One module per integration (plus the built-in "terse" module): owns fetching the
10
+ * integration's workspace data, preparing its template data, and rendering its leaf
11
+ * file bodies. The assembler composes the bodies into the terse.generated bundle.
12
+ */
13
+ export class IntegrationModule {
14
+ async render(input) {
15
+ if (input.instance === undefined && this.requiresInstance)
16
+ return this.emptyOutput();
17
+ const section = await this.prepareSection(input);
18
+ const toolFile = await this.buildToolFile(input);
19
+ const triggers = this.hasTriggers ? await buildTriggerDeclarationsForBucket(this.triggerBucket) : undefined;
20
+ const context = {
21
+ section,
22
+ toolFile,
23
+ triggerDeclarations: triggers?.declarations ?? [],
24
+ ...(await this.extraTemplateContext(input, toolFile))
25
+ };
26
+ const leafFiles = [];
27
+ if (this.hasSchemas)
28
+ leafFiles.push(this.renderLeaf("schemas", context));
29
+ leafFiles.push(this.renderLeaf("tools", context));
30
+ if (this.hasTriggers)
31
+ leafFiles.push(this.renderLeaf("triggers", context));
32
+ return {
33
+ integration: this.type,
34
+ leafFiles,
35
+ sdkImports: [...this.sectionImports, ...(toolFile ? ["TerseAgent"] : [])],
36
+ triggerDeclaredNames: triggers?.declaredNames ?? [],
37
+ triggerExtraImports: triggers?.extraImports ?? [],
38
+ toolboxEntries: toolFile ? [{ key: toolFile.key, integrationType: toolFile.integrationType, typeName: toolFile.typeName, constName: toolFile.constName }] : [],
39
+ triggersAggregateLines: this.triggersAggregateLines,
40
+ skillsAggregateLines: this.skillsAggregateLines
41
+ };
42
+ }
43
+ get requiresInstance() {
44
+ return true;
45
+ }
46
+ requireInstance(input) {
47
+ if (input.instance === undefined)
48
+ throw new MissingModuleInstanceError(this.type);
49
+ return input.instance;
50
+ }
51
+ get hasTriggers() {
52
+ return INTEGRATIONS_WITH_TRIGGERS.has(this.type);
53
+ }
54
+ get hasSchemas() {
55
+ return false;
56
+ }
57
+ get triggerBucket() {
58
+ return this.type;
59
+ }
60
+ get triggersAggregateLines() {
61
+ return [];
62
+ }
63
+ get skillsAggregateLines() {
64
+ return [];
65
+ }
66
+ extraTemplateContext(_input, _toolFile) {
67
+ return {};
68
+ }
69
+ async buildToolFile(input) {
70
+ const tools = input.tools;
71
+ if (tools.length === 0)
72
+ return undefined;
73
+ const needsAutoFill = tools.some(hasAutoFillId);
74
+ const integrationId = input.instance ? this.instanceId(input.instance) : undefined;
75
+ if (needsAutoFill && !integrationId)
76
+ return undefined;
77
+ const key = this.type;
78
+ const declarations = (await Promise.all(tools.map(tool => this.toolDeclarations(tool, input)))).flat();
79
+ const methods = tools.flatMap(tool => this.toolMethods(tool, integrationId, input));
80
+ return {
81
+ key,
82
+ integrationType: key,
83
+ typeName: `${toPascalCase(key)}GeneratedTools`,
84
+ constName: `${toCamelCase(key)}Tools`,
85
+ declarations,
86
+ methods
87
+ };
88
+ }
89
+ async toolDeclarations(tool, input) {
90
+ const name = tool.name;
91
+ if (!isKnownToolName(name))
92
+ return [];
93
+ const definition = ToolDefinitions[name];
94
+ const printOptions = this.toolParamsPrintOptions(tool, input);
95
+ const paramsDeclaration = printOptions.suppress
96
+ ? undefined
97
+ : await printType({
98
+ typeName: toolNameToTypeName(name, "Params"),
99
+ schema: definition.inputSchema,
100
+ io: "input",
101
+ description: tool.description || undefined,
102
+ omitFields: hasAutoFillId(tool) ? ["integrationId"] : undefined,
103
+ fieldOverrides: printOptions.fieldOverrides
104
+ });
105
+ const resultDeclaration = await printType({
106
+ typeName: toolNameToTypeName(name, "Result"),
107
+ schema: definition.outputSchema,
108
+ io: "output",
109
+ hoisted: [RUN_HISTORY_ACTION_HOIST]
110
+ });
111
+ return [...(paramsDeclaration ? [paramsDeclaration] : []), resultDeclaration];
112
+ }
113
+ toolParamsPrintOptions(_tool, _input) {
114
+ return {};
115
+ }
116
+ toolMethods(tool, integrationId, _input) {
117
+ const methodName = toCamelCase(tool.displayName);
118
+ const paramsType = toolNameToTypeName(tool.name, "Params");
119
+ const resultType = toolNameToTypeName(tool.name, "Result");
120
+ const normalizedParamsExpr = this.normalizeParamsExpression(tool);
121
+ const generatedSignature = `${methodName}(params: ${paramsType}): Promise<${resultType}>`;
122
+ let runtimeLines;
123
+ if (integrationId && hasAutoFillId(tool)) {
124
+ runtimeLines = [
125
+ `${methodName}: (params: ${paramsType}) =>`,
126
+ ` TerseAgent.executeTool<${resultType}>("${escapeString(tool.name)}", { ...(${normalizedParamsExpr}), integrationId: "${escapeString(integrationId)}" }),`
127
+ ];
128
+ }
129
+ else {
130
+ runtimeLines = [`${methodName}: (params: ${paramsType}) =>`, ` TerseAgent.executeTool<${resultType}>("${escapeString(tool.name)}", { ...(${normalizedParamsExpr}) }),`];
131
+ }
132
+ return [
133
+ {
134
+ description: tool.description || undefined,
135
+ generatedSignature,
136
+ runtimeLines
137
+ }
138
+ ];
139
+ }
140
+ normalizeParamsExpression(_tool) {
141
+ return "params";
142
+ }
143
+ selectActiveInstance(instances, activeConnectionId) {
144
+ if (activeConnectionId) {
145
+ const match = instances.find(instance => this.instanceId(instance) === activeConnectionId);
146
+ if (match)
147
+ return match;
148
+ }
149
+ return instances[0];
150
+ }
151
+ renderLeaf(kind, context) {
152
+ const stem = this.type;
153
+ return {
154
+ fileName: `${stem}.${kind}.ts`,
155
+ kind,
156
+ body: ModuleTemplateRenderer.getInstance().renderModuleTemplate(stem, `${stem}.${kind}.hbs`, context)
157
+ };
158
+ }
159
+ emptyOutput() {
160
+ return {
161
+ integration: this.type,
162
+ leafFiles: [],
163
+ sdkImports: [],
164
+ triggerDeclaredNames: [],
165
+ triggerExtraImports: [],
166
+ toolboxEntries: [],
167
+ triggersAggregateLines: [],
168
+ skillsAggregateLines: []
169
+ };
170
+ }
171
+ }
172
+ export class MissingModuleInstanceError extends Error {
173
+ constructor(type) {
174
+ super(`Integration module "${type}" rendered without an active instance.`);
175
+ this.name = "MissingModuleInstanceError";
176
+ }
177
+ }
178
+ function hasAutoFillId(tool) {
179
+ return toolsWithIntegrationId.has(tool.name);
180
+ }
181
+ function isKnownToolName(name) {
182
+ return name in ToolDefinitions;
183
+ }
184
+ //# sourceMappingURL=IntegrationModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IntegrationModule.js","sourceRoot":"","sources":["../../../../src/providers/typescript/modules/IntegrationModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,eAAe,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEtI,OAAO,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAA;AACjF,OAAO,EAAqB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAEhE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,MAAM,0BAA0B,GAAiC,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAA;AAErJ,MAAM,CAAC,MAAM,wBAAwB,GAAiB,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAA;AAEtH;;;;GAIG;AACH,MAAM,OAAgB,iBAAiB;IAUnC,KAAK,CAAC,MAAM,CAAC,KAAmC;QAC5C,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC,WAAW,EAAE,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AAE,EAAE;YACxB,mBAAmB,EAAE,EAAE;YACvB,cAAc,EAAE,EAAE;YAClB,sBAAsB,EAAE,EAAE;YAC1B,oBAAoB,EAAE,EAAE;SAC3B,CAAA;IACL,CAAC;CACJ;AAED,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACjD,YAAY,IAAqB;QAC7B,KAAK,CAAC,uBAAuB,IAAI,wCAAwC,CAAC,CAAA;QAC1E,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAA;IAC5C,CAAC;CACJ;AAED,SAAS,aAAa,CAAC,IAAoB;IACvC,OAAQ,sBAA8C,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzE,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACjC,OAAO,IAAI,IAAI,eAAe,CAAA;AAClC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { ToolDefinition } from "terse-types";
2
+ import { IntegrationType } from "terse-types";
3
+ import { IntegrationModule, type ModuleRenderInput, type ToolMethodContext } from "../IntegrationModule.js";
4
+ import type { AttioAttributeData, AttioInstanceData } from "./attioTypes.js";
5
+ export declare class AttioModule extends IntegrationModule<AttioInstanceData, AttioSectionContext> {
6
+ readonly type = IntegrationType.ATTIO;
7
+ readonly summaryLabel = "Attio";
8
+ protected readonly sectionImports: string[];
9
+ fetchInstances(apiKey: string): Promise<AttioInstanceData[]>;
10
+ instanceId(instance: AttioInstanceData): string;
11
+ protected get hasSchemas(): boolean;
12
+ protected get triggersAggregateLines(): readonly string[];
13
+ protected get skillsAggregateLines(): readonly string[];
14
+ protected prepareSection(input: ModuleRenderInput<AttioInstanceData>): Promise<AttioSectionContext>;
15
+ protected toolDeclarations(): Promise<string[]>;
16
+ protected toolMethods(tool: ToolDefinition, integrationId: string | undefined, input: ModuleRenderInput<AttioInstanceData>): ToolMethodContext[];
17
+ protected extraTemplateContext(input: ModuleRenderInput<AttioInstanceData>): Promise<Record<string, unknown>>;
18
+ }
19
+ interface AttioObjectContext {
20
+ staticName: string;
21
+ apiSlug: string;
22
+ objectId: string;
23
+ singularNoun: string;
24
+ attributeSource: string;
25
+ recordValuesType: string;
26
+ inputValuesType: string;
27
+ multiValueSlugsText: string;
28
+ attributes: Array<AttioAttributeData & {
29
+ api_slug: string;
30
+ }>;
31
+ }
32
+ interface AttioListContext {
33
+ staticName: string;
34
+ apiSlug: string;
35
+ name: string;
36
+ listId: string;
37
+ parentObject: string;
38
+ attributeSource: string;
39
+ entryValuesType: string;
40
+ entryRecordValuesType: string;
41
+ multiValueSlugsText: string;
42
+ attributes: Array<AttioAttributeData & {
43
+ api_slug: string;
44
+ }>;
45
+ }
46
+ export interface AttioSectionContext {
47
+ id: string;
48
+ skillToolType: string;
49
+ objects: AttioObjectContext[];
50
+ lists: AttioListContext[];
51
+ valueTypeLines: string[];
52
+ recordTriggerAliases: string[];
53
+ }
54
+ export {};
55
+ //# sourceMappingURL=AttioModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttioModule.d.ts","sourceRoot":"","sources":["../../../../../src/providers/typescript/modules/attio/AttioModule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAa,eAAe,EAAc,MAAM,aAAa,CAAA;AAGpE,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAa3G,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAA;AAE3F,qBAAa,WAAY,SAAQ,iBAAiB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;IACtF,QAAQ,CAAC,IAAI,yBAAwB;IACrC,QAAQ,CAAC,YAAY,WAAU;IAC/B,SAAS,CAAC,QAAQ,CAAC,cAAc,WAAsH;IAEjJ,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAkBlE,U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IACvB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,UAAU,EAAE,KAAK,CAAC,kBAAkB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/D;AAED,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,kBAAkB,EAAE,CAAA;IAC7B,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,oBAAoB,EAAE,MAAM,EAAE,CAAA;CACjC"}
@@ -0,0 +1,163 @@
1
+ import { ApiRoutes, IntegrationType, buildRoute } from "terse-types";
2
+ import { fetchWithAuth } from "../../../../api.js";
3
+ import { IntegrationModule } from "../IntegrationModule.js";
4
+ import { buildSkillToolType, escapeString, toGeneratedIdentifier } from "../moduleHelpers.js";
5
+ import { attioIsMultiValue, attioListValueTypeNames, attioObjectValueTypeNames, buildAttioObjectTypeDeclarations, buildAttioRecordTriggerAliases, buildAttioToolTypeDeclarations, buildAttioValueTypeDeclarations } from "./attioProjection.js";
6
+ import { buildAttioToolMethods } from "./attioToolMethods.js";
7
+ export class AttioModule extends IntegrationModule {
8
+ type = IntegrationType.ATTIO;
9
+ summaryLabel = "Attio";
10
+ sectionImports = ["registerEventTransform", "AttioOutputConfig", "TypedSkill", "AttioInputConfig", "AttioEventType", "TypedTrigger"];
11
+ async fetchInstances(apiKey) {
12
+ const instances = await fetchWithAuth(ApiRoutes.ATTIO.INTEGRATIONS, apiKey);
13
+ return Promise.all(instances.map(async (inst) => {
14
+ const objects = await fetchWithAuth(buildRoute(ApiRoutes.ATTIO.OBJECTS, { integrationId: inst.id }), apiKey).catch(() => []);
15
+ const lists = await fetchWithAuth(buildRoute(ApiRoutes.ATTIO.LISTS, { integrationId: inst.id }), apiKey).catch(() => []);
16
+ return {
17
+ id: inst.id,
18
+ displayName: inst.workspaceName || inst.id,
19
+ objects: Array.isArray(objects) ? objects : [],
20
+ lists: Array.isArray(lists) ? lists : []
21
+ };
22
+ }));
23
+ }
24
+ instanceId(instance) {
25
+ return instance.id;
26
+ }
27
+ get hasSchemas() {
28
+ return true;
29
+ }
30
+ get triggersAggregateLines() {
31
+ return [" attio: attioTriggers,"];
32
+ }
33
+ get skillsAggregateLines() {
34
+ return [" /** Attio — query and upsert records on a CRM object */", " attio: attioSkill,"];
35
+ }
36
+ async prepareSection(input) {
37
+ const inst = this.requireInstance(input);
38
+ const objects = buildGeneratedAttioObjects(inst);
39
+ const lists = buildGeneratedAttioLists(inst);
40
+ const valueTypeLines = [...(await buildAttioValueTypeDeclarations()), ...(await buildAttioObjectTypeDeclarations(objects, lists)), ...attioOptionConstLines(objects, lists)];
41
+ return {
42
+ id: inst.id,
43
+ skillToolType: buildSkillToolType(input.tools),
44
+ objects,
45
+ lists,
46
+ valueTypeLines,
47
+ recordTriggerAliases: buildAttioRecordTriggerAliases(objects)
48
+ };
49
+ }
50
+ toolDeclarations() {
51
+ return Promise.resolve([]);
52
+ }
53
+ toolMethods(tool, integrationId, input) {
54
+ if (integrationId) {
55
+ const attioMethods = buildAttioToolMethods(integrationId, tool);
56
+ if (attioMethods)
57
+ return attioMethods;
58
+ }
59
+ return super.toolMethods(tool, integrationId, input);
60
+ }
61
+ async extraTemplateContext(input) {
62
+ const toolTypeDeclarations = input.tools.length > 0 ? await buildAttioToolTypeDeclarations(input.tools.map(tool => tool.name)) : [];
63
+ return { toolTypeDeclarations };
64
+ }
65
+ }
66
+ function buildGeneratedAttioObjects(inst) {
67
+ const usedNames = new Set();
68
+ return inst.objects.map(object => {
69
+ let staticName = toGeneratedIdentifier(object.singular_noun || object.api_slug || "Object", "AttioObject");
70
+ while (usedNames.has(staticName))
71
+ staticName += "_";
72
+ usedNames.add(staticName);
73
+ const attributes = (object.attributes || []).filter((attr) => !!attr.api_slug);
74
+ return {
75
+ staticName,
76
+ apiSlug: object.api_slug,
77
+ objectId: object.id.object_id,
78
+ singularNoun: object.singular_noun,
79
+ attributeSource: renderAttioAttributeSource(attributes),
80
+ recordValuesType: attioObjectValueTypeNames(staticName).record,
81
+ inputValuesType: attioObjectValueTypeNames(staticName).input,
82
+ multiValueSlugsText: renderMultiValueSlugs(attributes),
83
+ attributes
84
+ };
85
+ });
86
+ }
87
+ function buildGeneratedAttioLists(inst) {
88
+ const usedNames = new Set();
89
+ return inst.lists.map(list => {
90
+ let staticName = toGeneratedIdentifier(list.name || list.api_slug || "List", "AttioList");
91
+ while (usedNames.has(staticName))
92
+ staticName += "_";
93
+ usedNames.add(staticName);
94
+ const attributes = (list.attributes || []).filter((attr) => !!attr.api_slug);
95
+ const parentObject = Array.isArray(list.parent_object) ? list.parent_object[0] || "" : list.parent_object || "";
96
+ return {
97
+ staticName,
98
+ apiSlug: list.api_slug,
99
+ name: list.name,
100
+ listId: list.id.list_id,
101
+ parentObject,
102
+ attributeSource: renderAttioAttributeSource(attributes),
103
+ entryValuesType: attioListValueTypeNames(staticName).entry,
104
+ entryRecordValuesType: attioListValueTypeNames(staticName).entryRecord,
105
+ multiValueSlugsText: renderMultiValueSlugs(attributes),
106
+ attributes
107
+ };
108
+ });
109
+ }
110
+ function renderMultiValueSlugs(attributes) {
111
+ return attributes
112
+ .filter(attioIsMultiValue)
113
+ .map(attr => `"${escapeString(attr.api_slug)}"`)
114
+ .join(", ");
115
+ }
116
+ function renderAttioAttributeSource(attributes) {
117
+ if (attributes.length === 0)
118
+ return "[]";
119
+ return `[\n${attributes
120
+ .map(attr => {
121
+ const fields = [
122
+ `apiSlug: "${escapeString(attr.api_slug)}"`,
123
+ attr.title ? `title: "${escapeString(attr.title)}"` : undefined,
124
+ attr.type ? `type: "${escapeString(attr.type)}"` : undefined,
125
+ attr.is_required !== undefined ? `isRequired: ${attr.is_required ? "true" : "false"}` : undefined,
126
+ attr.is_unique !== undefined ? `isUnique: ${attr.is_unique ? "true" : "false"}` : undefined
127
+ ]
128
+ .filter(Boolean)
129
+ .join(", ");
130
+ return ` { ${fields} }`;
131
+ })
132
+ .join(",\n")}\n ]`;
133
+ }
134
+ function attioOptionConstLines(objects, lists) {
135
+ const lines = [];
136
+ const usedConstNames = new Set();
137
+ for (const object of [...objects, ...lists]) {
138
+ for (const attr of object.attributes) {
139
+ if (!attr.options || attr.options.length === 0)
140
+ continue;
141
+ let attrName = toGeneratedIdentifier(attr.title || attr.api_slug, "Attribute");
142
+ if (attrName.startsWith(object.staticName) && attrName.length > object.staticName.length) {
143
+ attrName = attrName.slice(object.staticName.length);
144
+ }
145
+ let constName = `Attio${object.staticName}${attrName}`;
146
+ while (usedConstNames.has(constName))
147
+ constName += "_";
148
+ usedConstNames.add(constName);
149
+ lines.push("", `export const ${constName} = {`);
150
+ const usedKeys = new Set();
151
+ for (const title of attr.options) {
152
+ let key = toGeneratedIdentifier(title, "Option");
153
+ while (usedKeys.has(key))
154
+ key += "_";
155
+ usedKeys.add(key);
156
+ lines.push(` ${key}: "${escapeString(title)}",`);
157
+ }
158
+ lines.push("} as const");
159
+ }
160
+ }
161
+ return lines;
162
+ }
163
+ //# sourceMappingURL=AttioModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttioModule.js","sourceRoot":"","sources":["../../../../../src/providers/typescript/modules/attio/AttioModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAkD,MAAM,yBAAyB,CAAA;AAC3G,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAE7F,OAAO,EACH,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,EAChC,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAClC,MAAM,sBAAsB,CAA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AE,QAAQ,CAAC,CAAA;gBAChD,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;oBAAE,GAAG,IAAI,GAAG,CAAA;gBACpC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBACjB,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YACvD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC5B,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAA;AAChB,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ import type { AttioAttributeData } from "./attioTypes.js";
3
+ export declare function buildAttioValueTypeDeclarations(): Promise<string[]>;
4
+ export declare function buildAttioObjectTypeDeclarations(objects: readonly AttioValueTypeSource[], lists: readonly AttioValueTypeSource[]): Promise<string[]>;
5
+ export declare function attioObjectValueTypeNames(staticName: string): {
6
+ record: string;
7
+ input: string;
8
+ };
9
+ export declare function attioListValueTypeNames(staticName: string): {
10
+ entry: string;
11
+ entryRecord: string;
12
+ };
13
+ export declare function buildAttioRecordTriggerAliases(objects: readonly AttioValueTypeSource[]): string[];
14
+ export declare function buildAttioToolTypeDeclarations(attioToolNames: readonly string[]): Promise<string[]>;
15
+ export declare function attioOutputTypeName(toolName: string): string;
16
+ export declare function attioMethodParamsTypeName(methodName: string): string;
17
+ export declare class AttioProjectionError extends Error {
18
+ constructor(message: string);
19
+ }
20
+ export declare function buildAttioValuesSchema(attributes: readonly AttioAttributeData[], mode: AttioValueMode): z.ZodType;
21
+ export declare function attioIsMultiValue(attr: AttioAttributeData): boolean;
22
+ export declare const ATTIO_RESOURCE_METHOD_SPECS: Record<string, AttioResourceMethodSpec[]>;
23
+ export type AttioValueMode = "input" | "record";
24
+ export type AttioResultSpec = {
25
+ kind: "single";
26
+ key: string;
27
+ what?: string;
28
+ } | {
29
+ kind: "singleWithCursor";
30
+ key: string;
31
+ what?: string;
32
+ } | {
33
+ kind: "list";
34
+ key: string;
35
+ cursor?: boolean;
36
+ } | {
37
+ kind: "void";
38
+ };
39
+ export interface AttioResourceMethodSpec {
40
+ /** Discriminant to inject into the request; omitted for single-op tools with flat request schemas. */
41
+ action?: string;
42
+ methodName: string;
43
+ emptyParams?: boolean;
44
+ result: AttioResultSpec;
45
+ }
46
+ export type AttioValueTypeSource = {
47
+ readonly staticName: string;
48
+ readonly attributes: readonly AttioAttributeData[];
49
+ };
50
+ //# sourceMappingURL=attioProjection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attioProjection.d.ts","sourceRoot":"","sources":["../../../../../src/providers/typescript/modules/attio/attioProjection.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,wBAAsB,+BAA+B,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAUzE;AAED,wBAAsB,gCAAgC,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,EAAE,KAAK,EAAE,SAAS,oBAAoB,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAkB1J;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAE/F;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAElG;AAED,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAQjG;AAED,wBAAsB,8BAA8B,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA6BzG;AAED,wBAAgB,mBAAmB,CAA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