terse-cli 0.2.15 → 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 (165) hide show
  1. package/dist/commands/deploy.d.ts.map +1 -1
  2. package/dist/commands/deploy.js +4 -3
  3. package/dist/commands/deploy.js.map +1 -1
  4. package/dist/commands/generate.d.ts.map +1 -1
  5. package/dist/commands/generate.js +36 -253
  6. package/dist/commands/generate.js.map +1 -1
  7. package/dist/commands/toolRun.js +1 -1
  8. package/dist/commands/toolRun.js.map +1 -1
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/providers/LanguageProvider.d.ts +6 -2
  12. package/dist/providers/LanguageProvider.d.ts.map +1 -1
  13. package/dist/providers/codegenTypes.d.ts +16 -130
  14. package/dist/providers/codegenTypes.d.ts.map +1 -1
  15. package/dist/providers/typescript/TypeScriptProvider.d.ts +2 -2
  16. package/dist/providers/typescript/TypeScriptProvider.d.ts.map +1 -1
  17. package/dist/providers/typescript/TypeScriptProvider.js +53 -4
  18. package/dist/providers/typescript/TypeScriptProvider.js.map +1 -1
  19. package/dist/providers/typescript/attioProjection.d.ts +50 -0
  20. package/dist/providers/typescript/attioProjection.d.ts.map +1 -0
  21. package/dist/providers/typescript/attioProjection.js +358 -0
  22. package/dist/providers/typescript/attioProjection.js.map +1 -0
  23. package/dist/providers/typescript/modules/IntegrationModule.d.ts +82 -0
  24. package/dist/providers/typescript/modules/IntegrationModule.d.ts.map +1 -0
  25. package/dist/providers/typescript/modules/IntegrationModule.js +184 -0
  26. package/dist/providers/typescript/modules/IntegrationModule.js.map +1 -0
  27. package/dist/providers/typescript/modules/attio/AttioModule.d.ts +55 -0
  28. package/dist/providers/typescript/modules/attio/AttioModule.d.ts.map +1 -0
  29. package/dist/providers/typescript/modules/attio/AttioModule.js +163 -0
  30. package/dist/providers/typescript/modules/attio/AttioModule.js.map +1 -0
  31. package/dist/providers/typescript/modules/attio/attioProjection.d.ts +50 -0
  32. package/dist/providers/typescript/modules/attio/attioProjection.d.ts.map +1 -0
  33. package/dist/providers/typescript/modules/attio/attioProjection.js +358 -0
  34. package/dist/providers/typescript/modules/attio/attioProjection.js.map +1 -0
  35. package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts +4 -0
  36. package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts.map +1 -0
  37. package/dist/providers/typescript/modules/attio/attioToolMethods.js +295 -0
  38. package/dist/providers/typescript/modules/attio/attioToolMethods.js.map +1 -0
  39. package/dist/providers/typescript/modules/attio/attioTypes.d.ts +36 -0
  40. package/dist/providers/typescript/modules/attio/attioTypes.d.ts.map +1 -0
  41. package/dist/providers/typescript/modules/attio/attioTypes.js +2 -0
  42. package/dist/providers/typescript/modules/attio/attioTypes.js.map +1 -0
  43. package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts +25 -0
  44. package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts.map +1 -0
  45. package/dist/providers/typescript/modules/datadog/DatadogModule.js +33 -0
  46. package/dist/providers/typescript/modules/datadog/DatadogModule.js.map +1 -0
  47. package/dist/providers/typescript/modules/github/GithubModule.d.ts +44 -0
  48. package/dist/providers/typescript/modules/github/GithubModule.d.ts.map +1 -0
  49. package/dist/providers/typescript/modules/github/GithubModule.js +111 -0
  50. package/dist/providers/typescript/modules/github/GithubModule.js.map +1 -0
  51. package/dist/providers/typescript/modules/gmail/GmailModule.d.ts +17 -0
  52. package/dist/providers/typescript/modules/gmail/GmailModule.d.ts.map +1 -0
  53. package/dist/providers/typescript/modules/gmail/GmailModule.js +30 -0
  54. package/dist/providers/typescript/modules/gmail/GmailModule.js.map +1 -0
  55. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts +25 -0
  56. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts.map +1 -0
  57. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js +33 -0
  58. package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js.map +1 -0
  59. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts +26 -0
  60. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts.map +1 -0
  61. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js +34 -0
  62. package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js.map +1 -0
  63. package/dist/providers/typescript/modules/linear/LinearModule.d.ts +35 -0
  64. package/dist/providers/typescript/modules/linear/LinearModule.d.ts.map +1 -0
  65. package/dist/providers/typescript/modules/linear/LinearModule.js +48 -0
  66. package/dist/providers/typescript/modules/linear/LinearModule.js.map +1 -0
  67. package/dist/providers/typescript/modules/moduleHelpers.d.ts +23 -0
  68. package/dist/providers/typescript/modules/moduleHelpers.d.ts.map +1 -0
  69. package/dist/providers/typescript/modules/moduleHelpers.js +74 -0
  70. package/dist/providers/typescript/modules/moduleHelpers.js.map +1 -0
  71. package/dist/providers/typescript/modules/notion/NotionModule.d.ts +33 -0
  72. package/dist/providers/typescript/modules/notion/NotionModule.d.ts.map +1 -0
  73. package/dist/providers/typescript/modules/notion/NotionModule.js +44 -0
  74. package/dist/providers/typescript/modules/notion/NotionModule.js.map +1 -0
  75. package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts +30 -0
  76. package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts.map +1 -0
  77. package/dist/providers/typescript/modules/posthog/PosthogModule.js +60 -0
  78. package/dist/providers/typescript/modules/posthog/PosthogModule.js.map +1 -0
  79. package/dist/providers/typescript/modules/registry.d.ts +11 -0
  80. package/dist/providers/typescript/modules/registry.d.ts.map +1 -0
  81. package/dist/providers/typescript/modules/registry.js +37 -0
  82. package/dist/providers/typescript/modules/registry.js.map +1 -0
  83. package/dist/providers/typescript/modules/resend/ResendModule.d.ts +32 -0
  84. package/dist/providers/typescript/modules/resend/ResendModule.d.ts.map +1 -0
  85. package/dist/providers/typescript/modules/resend/ResendModule.js +71 -0
  86. package/dist/providers/typescript/modules/resend/ResendModule.js.map +1 -0
  87. package/dist/providers/typescript/modules/slack/SlackModule.d.ts +32 -0
  88. package/dist/providers/typescript/modules/slack/SlackModule.d.ts.map +1 -0
  89. package/dist/providers/typescript/modules/slack/SlackModule.js +51 -0
  90. package/dist/providers/typescript/modules/slack/SlackModule.js.map +1 -0
  91. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts +20 -0
  92. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts.map +1 -0
  93. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js +27 -0
  94. package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js.map +1 -0
  95. package/dist/providers/typescript/modules/templateRenderer.d.ts +17 -0
  96. package/dist/providers/typescript/modules/templateRenderer.d.ts.map +1 -0
  97. package/dist/providers/typescript/modules/templateRenderer.js +64 -0
  98. package/dist/providers/typescript/modules/templateRenderer.js.map +1 -0
  99. package/dist/providers/typescript/modules/terse/TerseModule.d.ts +20 -0
  100. package/dist/providers/typescript/modules/terse/TerseModule.d.ts.map +1 -0
  101. package/dist/providers/typescript/modules/terse/TerseModule.js +61 -0
  102. package/dist/providers/typescript/modules/terse/TerseModule.js.map +1 -0
  103. package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts +17 -0
  104. package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts.map +1 -0
  105. package/dist/providers/typescript/modules/workos/WorkOSModule.js +30 -0
  106. package/dist/providers/typescript/modules/workos/WorkOSModule.js.map +1 -0
  107. package/dist/providers/typescript/prepareCodegenData.d.ts +13 -0
  108. package/dist/providers/typescript/prepareCodegenData.d.ts.map +1 -1
  109. package/dist/providers/typescript/prepareCodegenData.js +42 -3
  110. package/dist/providers/typescript/prepareCodegenData.js.map +1 -1
  111. package/dist/providers/typescript/templateEngine.d.ts +8 -2
  112. package/dist/providers/typescript/templateEngine.d.ts.map +1 -1
  113. package/dist/providers/typescript/templateEngine.js +241 -29
  114. package/dist/providers/typescript/templateEngine.js.map +1 -1
  115. package/dist/providers/typescript/triggerTypeDeclarations.d.ts +4 -4
  116. package/dist/providers/typescript/triggerTypeDeclarations.d.ts.map +1 -1
  117. package/dist/providers/typescript/triggerTypeDeclarations.js +26 -83
  118. package/dist/providers/typescript/triggerTypeDeclarations.js.map +1 -1
  119. package/dist/providers/typescript/typePrinter.d.ts +1 -0
  120. package/dist/providers/typescript/typePrinter.d.ts.map +1 -1
  121. package/dist/providers/typescript/typePrinter.js +7 -1
  122. package/dist/providers/typescript/typePrinter.js.map +1 -1
  123. package/package.json +7 -5
  124. package/src/providers/typescript/modules/attio/attio.schemas.hbs +150 -0
  125. package/src/providers/typescript/modules/attio/attio.tools.hbs +192 -0
  126. package/src/providers/typescript/modules/attio/attio.triggers.hbs +130 -0
  127. package/src/providers/typescript/modules/datadog/datadog.tools.hbs +16 -0
  128. package/src/providers/typescript/modules/github/github.tools.hbs +68 -0
  129. package/src/providers/typescript/modules/github/github.triggers.hbs +40 -0
  130. package/src/providers/typescript/modules/gmail/gmail.tools.hbs +17 -0
  131. package/src/providers/typescript/modules/gmail/gmail.triggers.hbs +16 -0
  132. package/src/providers/typescript/modules/hey_reach/hey_reach.tools.hbs +9 -0
  133. package/src/providers/typescript/modules/hey_reach/hey_reach.triggers.hbs +56 -0
  134. package/src/providers/typescript/modules/launchdarkly/launchdarkly.tools.hbs +16 -0
  135. package/src/providers/typescript/modules/linear/linear.tools.hbs +23 -0
  136. package/src/providers/typescript/modules/linear/linear.triggers.hbs +24 -0
  137. package/src/providers/typescript/modules/notion/notion.tools.hbs +20 -0
  138. package/src/providers/typescript/modules/posthog/posthog.tools.hbs +28 -0
  139. package/src/providers/typescript/modules/resend/resend.tools.hbs +46 -0
  140. package/src/providers/typescript/modules/slack/slack.tools.hbs +18 -0
  141. package/src/providers/typescript/modules/slack/slack.triggers.hbs +28 -0
  142. package/src/providers/typescript/modules/snowflake/snowflake.tools.hbs +12 -0
  143. package/src/providers/typescript/modules/terse/terse.tools.hbs +22 -0
  144. package/src/providers/typescript/modules/terse/terse.triggers.hbs +33 -0
  145. package/src/providers/typescript/modules/workos/workos.tools.hbs +12 -0
  146. package/src/providers/typescript/modules/workos/workos.triggers.hbs +64 -0
  147. package/templates/typescript/codegen/.impeccable/hook.cache.json +1 -1
  148. package/templates/typescript/codegen/common.hbs +6 -0
  149. package/templates/typescript/codegen/partials/tools-slice.hbs +18 -0
  150. package/templates/typescript/codegen/root.hbs +72 -0
  151. package/templates/typescript/codegen/sdk-primitives.hbs +42 -0
  152. package/templates/typescript/codegen/generated.hbs +0 -14
  153. package/templates/typescript/codegen/partials/attio-section.hbs +0 -86
  154. package/templates/typescript/codegen/partials/datadog-section.hbs +0 -3
  155. package/templates/typescript/codegen/partials/github-section.hbs +0 -30
  156. package/templates/typescript/codegen/partials/header.hbs +0 -17
  157. package/templates/typescript/codegen/partials/hey-reach-section.hbs +0 -3
  158. package/templates/typescript/codegen/partials/launchdarkly-section.hbs +0 -3
  159. package/templates/typescript/codegen/partials/linear-section.hbs +0 -5
  160. package/templates/typescript/codegen/partials/notion-section.hbs +0 -5
  161. package/templates/typescript/codegen/partials/posthog-section.hbs +0 -15
  162. package/templates/typescript/codegen/partials/skills-section.hbs +0 -99
  163. package/templates/typescript/codegen/partials/slack-section.hbs +0 -5
  164. package/templates/typescript/codegen/partials/tools-section.hbs +0 -94
  165. package/templates/typescript/codegen/partials/triggers-section.hbs +0 -353
@@ -1,86 +0,0 @@
1
- {{sectionHeader "Attio"}}
2
-
3
- {{#each valueTypeLines}}
4
- {{{this}}}
5
- {{/each}}
6
-
7
- export type AttioAttributeDefinition<TSlug extends string = string, TType extends string = string> = {
8
- apiSlug: TSlug
9
- title?: string
10
- type?: TType
11
- isRequired?: boolean
12
- isUnique?: boolean
13
- }
14
-
15
- export class AttioObject<
16
- TSlug extends string = string,
17
- TRecordValues extends Record<string, unknown> = Record<string, unknown>,
18
- TInputValues extends Record<string, unknown> = TRecordValues
19
- > {
20
- constructor(
21
- public readonly apiSlug: TSlug,
22
- public readonly name: string,
23
- public readonly objectId: string,
24
- public readonly attributes: readonly AttioAttributeDefinition[] = []
25
- ) {}
26
-
27
- declare readonly __recordValues: TRecordValues
28
- declare readonly __inputValues: TInputValues
29
- {{#if objects.length}}
30
-
31
- {{#each objects}}
32
- static {{staticName}} = new AttioObject<"{{escape apiSlug}}", {{{recordValuesType}}}, {{{inputValuesType}}}>("{{escape apiSlug}}", "{{escape singularNoun}}", "{{escape objectId}}", {{{attributeSource}}})
33
- {{/each}}
34
- {{/if}}
35
- }
36
-
37
- {{#if objects.length}}
38
- export type GeneratedAttioObject =
39
- {{#each objects}}
40
- | typeof AttioObject.{{staticName}}
41
- {{/each}}
42
- {{else}}
43
- export type GeneratedAttioObject = AttioObject
44
- {{/if}}
45
-
46
- export class AttioList<
47
- TSlug extends string = string,
48
- TEntryValues extends Record<string, unknown> = Record<string, unknown>,
49
- TEntryRecordValues extends Record<string, unknown> = TEntryValues
50
- > {
51
- constructor(
52
- public readonly apiSlug: TSlug,
53
- public readonly name: string,
54
- public readonly listId: string,
55
- public readonly parentObject: string,
56
- public readonly attributes: readonly AttioAttributeDefinition[] = []
57
- ) {}
58
-
59
- declare readonly __entryValues: TEntryValues
60
- declare readonly __entryRecordValues: TEntryRecordValues
61
- {{#if lists.length}}
62
-
63
- {{#each lists}}
64
- static {{staticName}} = new AttioList<"{{escape apiSlug}}", {{{entryValuesType}}}, {{{entryRecordValuesType}}}>("{{escape apiSlug}}", "{{escape name}}", "{{escape listId}}", "{{escape parentObject}}", {{{attributeSource}}})
65
- {{/each}}
66
- {{/if}}
67
- }
68
-
69
- {{#if lists.length}}
70
- export type GeneratedAttioList =
71
- {{#each lists}}
72
- | typeof AttioList.{{staticName}}
73
- {{/each}}
74
- {{else}}
75
- export type GeneratedAttioList = AttioList
76
- {{/if}}
77
-
78
- function attioParentObjectFilter(object: GeneratedAttioObject | undefined) {
79
- if (!object) return null
80
- return { $and: [{ field: "id.object_id", operator: "equals" as const, value: object.objectId }] }
81
- }
82
-
83
- {{#each runtimeLines}}
84
- {{{this}}}
85
- {{/each}}
86
-
@@ -1,3 +0,0 @@
1
- {{sectionHeader "Datadog"}}
2
-
3
- {{> resource-class indexClass}}
@@ -1,30 +0,0 @@
1
- {{sectionHeader "GitHub"}}
2
-
3
- export class GithubOwner {
4
- constructor(public readonly name: string) {}
5
- {{#if owners.length}}
6
-
7
- {{#each owners}}
8
- static {{staticName}} = new GithubOwner("{{escape name}}")
9
- {{/each}}
10
- {{/if}}
11
- }
12
-
13
- export class Repos {
14
- constructor(
15
- public readonly repositoryId: number,
16
- public readonly name: string,
17
- public readonly owner: GithubOwner,
18
- public readonly fullName: string
19
- ) {}
20
- {{#if repoGroups.length}}
21
-
22
- {{#each repoGroups}}
23
- static {{ownerStaticName}} = {
24
- {{#each repos}}
25
- {{staticName}}: new Repos({{id}}, "{{escape name}}", GithubOwner.{{../ownerStaticName}}, "{{escape fullName}}"),
26
- {{/each}}
27
- } as const
28
- {{/each}}
29
- {{/if}}
30
- }
@@ -1,17 +0,0 @@
1
- // Auto-generated by `terse generate` — do not edit manually
2
- // Re-run `terse generate` to update.
3
-
4
- {{#if availableIntegrations}}
5
- // The integrations currently available in Terse: {{availableIntegrations}}.
6
- // Connect one with `terse integrate connect <type>`; list its tools with `terse integrate tool <type> --json`.
7
- {{/if}}
8
-
9
- {{#if useMultilineImports}}
10
- import {
11
- {{#each imports}}
12
- {{this}},
13
- {{/each}}
14
- } from "terse-sdk"
15
- {{else}}
16
- import { {{#each imports}}{{this}}{{#unless @last}}, {{/unless}}{{/each}} } from "terse-sdk"
17
- {{/if}}
@@ -1,3 +0,0 @@
1
- {{sectionHeader "HeyReach"}}
2
-
3
- {{> resource-class campaignClass}}
@@ -1,3 +0,0 @@
1
- {{sectionHeader "LaunchDarkly"}}
2
-
3
- {{> resource-class projectClass}}
@@ -1,5 +0,0 @@
1
- {{sectionHeader "Linear"}}
2
-
3
- {{> resource-class teamClass}}
4
-
5
- {{> resource-class projectClass}}
@@ -1,5 +0,0 @@
1
- {{sectionHeader "Notion"}}
2
-
3
- {{> resource-class databaseClass}}
4
-
5
- {{> resource-class pageClass}}
@@ -1,15 +0,0 @@
1
- {{sectionHeader "PostHog"}}
2
-
3
- {{> resource-class projectClass}}
4
-
5
- {{#if eventNames.length}}
6
- /**
7
- * Custom event names observed in your PostHog project over the last 180 days.
8
- * Built-in $-prefixed events (e.g. "$pageview") are always accepted alongside these.
9
- * Terse supports US PostHog Cloud (us.posthog.com) only; EU-hosted PostHog is not supported.
10
- */
11
- export type PosthogEventName =
12
- {{#each eventNames}}
13
- | "{{escape this}}"
14
- {{/each}}
15
- {{/if}}
@@ -1,99 +0,0 @@
1
- {{sectionHeader "Skills"}}
2
-
3
- /**
4
- * Skills available in your workspace.
5
- *
6
- * Type `Skills.` in your editor to see every connected integration's skill at a glance.
7
- * Use these in `generateText({ skills: [...] })` (or `TerseAgent.create({ skills: [...] })`).
8
- */
9
- export const Skills = {
10
- {{#if slack}}
11
- /** Slack — send messages and manage threads in a specific channel */
12
- slack(opts: { channel: SlackChannel; userIds?: string[]; userNames?: string[]; listenToUserDms?: boolean }): TypedSkill<{{{slack.skillToolType}}}> {
13
- return new SlackOutputConfig("{{escape slack.id}}", opts.channel.channelId ?? null, opts.channel.name ?? null, opts.userIds ?? [], opts.userNames ?? null, opts.listenToUserDms)
14
- },
15
- {{/if}}
16
- {{#if github}}
17
- /** GitHub — read code and pull requests from the given repositories */
18
- github(opts: { repos: Repos[] }): TypedSkill<{{{github.skillToolType}}}> {
19
- return new GitHubConfig("{{escape github.id}}", opts.repos.map(r => r.repositoryId))
20
- },
21
- {{/if}}
22
- {{#if linear}}
23
- /** Linear — read and write issues, optionally scoped to a team or project */
24
- linear(opts?: { team?: LinearTeam; project?: LinearProject }): TypedSkill<{{{linear.skillToolType}}}> {
25
- return new LinearOutputConfig(
26
- "{{escape linear.id}}",
27
- opts?.team?.teamId ?? null,
28
- opts?.team?.name ?? null,
29
- opts?.project?.projectId ?? null
30
- )
31
- },
32
- {{/if}}
33
- {{#if gmail}}
34
- /** Gmail — send emails */
35
- gmail(): TypedSkill<{{{gmail.skillToolType}}}> {
36
- return new GmailOutputConfig("{{escape gmail.id}}")
37
- },
38
- /** Gmail — create draft emails (no auto-send) */
39
- gmailDraft(): TypedSkill<{{{gmail.skillToolType}}}> {
40
- return new GmailDraftOutputConfig("{{escape gmail.id}}")
41
- },
42
- {{/if}}
43
- {{#if notion}}
44
- /** Notion — read and write to the given databases or pages */
45
- notion(opts?: { databases?: NotionDatabase[]; pages?: NotionPage[] }): TypedSkill<{{{notion.skillToolType}}}> {
46
- return new NotionConfig("{{escape notion.id}}",
47
- opts?.databases?.map(d => d.databaseId), opts?.databases?.map(d => d.title),
48
- opts?.pages?.map(p => p.pageId), opts?.pages?.map(p => p.title))
49
- },
50
- {{/if}}
51
- {{#if posthog}}
52
- /** PostHog — query analytics for a specific project */
53
- posthog(opts: { project: PosthogProject }): TypedSkill<{{{posthog.skillToolType}}}> {
54
- return new PosthogConfig("{{escape posthog.id}}", opts.project.projectId, opts.project.name)
55
- },
56
- {{/if}}
57
- {{#if datadog}}
58
- /** Datadog — search and analyze logs, optionally scoped to specific indexes */
59
- datadog(opts?: { indexes?: DatadogIndex[] }): TypedSkill<{{{datadog.skillToolType}}}> {
60
- return new DatadogConfig("{{escape datadog.id}}", opts?.indexes?.map(i => i.name))
61
- },
62
- {{/if}}
63
- {{#if launchdarkly}}
64
- /** LaunchDarkly — read and toggle feature flags in a project + environments */
65
- launchDarkly(opts: { project: LaunchDarklyProject; environmentKeys: string[] }): TypedSkill<{{{launchdarkly.skillToolType}}}> {
66
- return new LaunchDarklyConfig("{{escape launchdarkly.id}}", opts.project.projectKey, opts.environmentKeys)
67
- },
68
- {{/if}}
69
- {{#if workos}}
70
- /** WorkOS — manage users, organizations and invitations */
71
- workOS(): TypedSkill<{{{workos.skillToolType}}}> {
72
- return new WorkOSOutputConfig("{{escape workos.id}}")
73
- },
74
- {{/if}}
75
- {{#if attio}}
76
- /** Attio — query and upsert records on a CRM object */
77
- attio(opts: { object: AttioObject<any> }): TypedSkill<{{{attio.skillToolType}}}> {
78
- return new AttioOutputConfig("{{escape attio.id}}", opts.object.apiSlug)
79
- },
80
- {{/if}}
81
- {{#if snowflake}}
82
- /** Snowflake — run SQL queries against your warehouse */
83
- snowflake(): TypedSkill<{{{snowflake.skillToolType}}}> {
84
- return new SnowflakeOutputConfig("{{escape snowflake.id}}")
85
- },
86
- {{/if}}
87
- /** Web — built-in web search, page extraction, and multi-source research. Pass `allowedDomains` to restrict search and page extraction to specific sites (and their subdomains). */
88
- web(opts: { allowedDomains?: string[] } = {}): TypedSkill<"web_search" | "web_extract" | "web_research"> {
89
- return new WebConfig(opts)
90
- },
91
- /** ImageEdit — edit and generate images */
92
- imageEdit(): TypedSkill<"image_edit"> {
93
- return new ImageEditConfig()
94
- },
95
- /** Memory — built-in persistent memory the agent reads and writes under /memories, scoped to this job and surviving across runs. */
96
- memory(): TypedSkill<"memory"> {
97
- return new MemoryConfig()
98
- },
99
- }
@@ -1,5 +0,0 @@
1
- {{sectionHeader "Slack"}}
2
-
3
- {{> resource-class channelClass}}
4
-
5
- {{> resource-class userClass}}
@@ -1,94 +0,0 @@
1
- {{sectionHeader "Typed Tools"}}
2
-
3
- {{#each attioPreludeLines}}
4
- {{{this}}}
5
- {{/each}}
6
- {{#each paramTypes}}
7
- {{#if description}}/** {{description}} */
8
- {{/if}}export type {{typeName}} = {{{tsType}}}
9
-
10
- {{/each}}
11
- {{#if githubRepoMappings.length}}
12
- const __githubRepoNameToFullName = new Map<string, string>([
13
- {{#each githubRepoMappings}}
14
- ["{{escape name}}", "{{escape fullName}}"],
15
- {{/each}}
16
- ])
17
-
18
- function __normalizeGitHubRepos(repo: unknown): string {
19
- if (repo && typeof repo === "object" && "fullName" in (repo as Record<string, unknown>)) {
20
- const fullName = (repo as { fullName?: unknown }).fullName
21
- if (typeof fullName === "string" && fullName.length > 0) return fullName
22
- }
23
- if (typeof repo === "string") {
24
- if (repo.includes("/")) return repo
25
- return __githubRepoNameToFullName.get(repo) ?? repo
26
- }
27
- return String(repo ?? "")
28
- }
29
-
30
- function __normalizeGitHubReposNames(repositories: unknown): string[] {
31
- if (!Array.isArray(repositories)) return []
32
- return repositories.map(repo => __normalizeGitHubRepos(repo))
33
- }
34
-
35
- {{/if}}
36
- export type GeneratedTools = {
37
- {{#each groups}}
38
- {{key}}: {
39
- {{#each methods}}
40
- {{#if description}} /** {{description}} */
41
- {{/if}} {{{generatedSignature}}}
42
- {{/each}}
43
- }
44
- {{/each}}
45
- }
46
-
47
- declare module "terse-sdk" {
48
- interface TerseAgent {
49
- readonly tools: GeneratedTools
50
- }
51
- }
52
-
53
- function createTools(agent: TerseAgent): GeneratedTools {
54
- const allowed: Set<string> = new Set(agent.skills.map(config => config.integrationType))
55
- return {
56
- {{#each groups}}
57
- ...(allowed.has("{{escape integrationType}}") ? { {{key}}: {
58
- {{#each methods}}
59
- {{#each runtimeLines}}
60
- {{{this}}}
61
- {{/each}}
62
- {{/each}}
63
- } } : {}),
64
- {{/each}}
65
- } as GeneratedTools
66
- }
67
-
68
- ;(globalThis as any).__terse_createTools = createTools
69
-
70
- /**
71
- * Deterministic tool calls without an agent.
72
- *
73
- * `toolbox` exposes every connected integration tool as a typed function. Unlike
74
- * `agent.tools`, it does not require constructing a `TerseAgent` and is not
75
- * filtered by `skills`. Use it when you know exactly which tool to call and
76
- * don't need an LLM in the loop.
77
- *
78
- * @example
79
- * ```ts
80
- * import { toolbox } from "./terse.generated"
81
- * await toolbox.slack.sendMessage({ channelId: "...", message: "hi" })
82
- * ```
83
- */
84
- export const toolbox: GeneratedTools = {
85
- {{#each groups}}
86
- {{key}}: {
87
- {{#each methods}}
88
- {{#each runtimeLines}}
89
- {{{this}}}
90
- {{/each}}
91
- {{/each}}
92
- },
93
- {{/each}}
94
- }