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.
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +4 -3
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +36 -253
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/toolRun.js +1 -1
- package/dist/commands/toolRun.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/LanguageProvider.d.ts +6 -2
- package/dist/providers/LanguageProvider.d.ts.map +1 -1
- package/dist/providers/codegenTypes.d.ts +16 -130
- package/dist/providers/codegenTypes.d.ts.map +1 -1
- package/dist/providers/typescript/TypeScriptProvider.d.ts +2 -2
- package/dist/providers/typescript/TypeScriptProvider.d.ts.map +1 -1
- package/dist/providers/typescript/TypeScriptProvider.js +53 -4
- package/dist/providers/typescript/TypeScriptProvider.js.map +1 -1
- package/dist/providers/typescript/attioProjection.d.ts +50 -0
- package/dist/providers/typescript/attioProjection.d.ts.map +1 -0
- package/dist/providers/typescript/attioProjection.js +358 -0
- package/dist/providers/typescript/attioProjection.js.map +1 -0
- package/dist/providers/typescript/modules/IntegrationModule.d.ts +82 -0
- package/dist/providers/typescript/modules/IntegrationModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/IntegrationModule.js +184 -0
- package/dist/providers/typescript/modules/IntegrationModule.js.map +1 -0
- package/dist/providers/typescript/modules/attio/AttioModule.d.ts +55 -0
- package/dist/providers/typescript/modules/attio/AttioModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/attio/AttioModule.js +163 -0
- package/dist/providers/typescript/modules/attio/AttioModule.js.map +1 -0
- package/dist/providers/typescript/modules/attio/attioProjection.d.ts +50 -0
- package/dist/providers/typescript/modules/attio/attioProjection.d.ts.map +1 -0
- package/dist/providers/typescript/modules/attio/attioProjection.js +358 -0
- package/dist/providers/typescript/modules/attio/attioProjection.js.map +1 -0
- package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts +4 -0
- package/dist/providers/typescript/modules/attio/attioToolMethods.d.ts.map +1 -0
- package/dist/providers/typescript/modules/attio/attioToolMethods.js +295 -0
- package/dist/providers/typescript/modules/attio/attioToolMethods.js.map +1 -0
- package/dist/providers/typescript/modules/attio/attioTypes.d.ts +36 -0
- package/dist/providers/typescript/modules/attio/attioTypes.d.ts.map +1 -0
- package/dist/providers/typescript/modules/attio/attioTypes.js +2 -0
- package/dist/providers/typescript/modules/attio/attioTypes.js.map +1 -0
- package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts +25 -0
- package/dist/providers/typescript/modules/datadog/DatadogModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/datadog/DatadogModule.js +33 -0
- package/dist/providers/typescript/modules/datadog/DatadogModule.js.map +1 -0
- package/dist/providers/typescript/modules/github/GithubModule.d.ts +44 -0
- package/dist/providers/typescript/modules/github/GithubModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/github/GithubModule.js +111 -0
- package/dist/providers/typescript/modules/github/GithubModule.js.map +1 -0
- package/dist/providers/typescript/modules/gmail/GmailModule.d.ts +17 -0
- package/dist/providers/typescript/modules/gmail/GmailModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/gmail/GmailModule.js +30 -0
- package/dist/providers/typescript/modules/gmail/GmailModule.js.map +1 -0
- package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts +25 -0
- package/dist/providers/typescript/modules/hey_reach/HeyReachModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js +33 -0
- package/dist/providers/typescript/modules/hey_reach/HeyReachModule.js.map +1 -0
- package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts +26 -0
- package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js +34 -0
- package/dist/providers/typescript/modules/launchdarkly/LaunchDarklyModule.js.map +1 -0
- package/dist/providers/typescript/modules/linear/LinearModule.d.ts +35 -0
- package/dist/providers/typescript/modules/linear/LinearModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/linear/LinearModule.js +48 -0
- package/dist/providers/typescript/modules/linear/LinearModule.js.map +1 -0
- package/dist/providers/typescript/modules/moduleHelpers.d.ts +23 -0
- package/dist/providers/typescript/modules/moduleHelpers.d.ts.map +1 -0
- package/dist/providers/typescript/modules/moduleHelpers.js +74 -0
- package/dist/providers/typescript/modules/moduleHelpers.js.map +1 -0
- package/dist/providers/typescript/modules/notion/NotionModule.d.ts +33 -0
- package/dist/providers/typescript/modules/notion/NotionModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/notion/NotionModule.js +44 -0
- package/dist/providers/typescript/modules/notion/NotionModule.js.map +1 -0
- package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts +30 -0
- package/dist/providers/typescript/modules/posthog/PosthogModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/posthog/PosthogModule.js +60 -0
- package/dist/providers/typescript/modules/posthog/PosthogModule.js.map +1 -0
- package/dist/providers/typescript/modules/registry.d.ts +11 -0
- package/dist/providers/typescript/modules/registry.d.ts.map +1 -0
- package/dist/providers/typescript/modules/registry.js +37 -0
- package/dist/providers/typescript/modules/registry.js.map +1 -0
- package/dist/providers/typescript/modules/resend/ResendModule.d.ts +32 -0
- package/dist/providers/typescript/modules/resend/ResendModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/resend/ResendModule.js +71 -0
- package/dist/providers/typescript/modules/resend/ResendModule.js.map +1 -0
- package/dist/providers/typescript/modules/slack/SlackModule.d.ts +32 -0
- package/dist/providers/typescript/modules/slack/SlackModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/slack/SlackModule.js +51 -0
- package/dist/providers/typescript/modules/slack/SlackModule.js.map +1 -0
- package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts +20 -0
- package/dist/providers/typescript/modules/snowflake/SnowflakeModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js +27 -0
- package/dist/providers/typescript/modules/snowflake/SnowflakeModule.js.map +1 -0
- package/dist/providers/typescript/modules/templateRenderer.d.ts +17 -0
- package/dist/providers/typescript/modules/templateRenderer.d.ts.map +1 -0
- package/dist/providers/typescript/modules/templateRenderer.js +64 -0
- package/dist/providers/typescript/modules/templateRenderer.js.map +1 -0
- package/dist/providers/typescript/modules/terse/TerseModule.d.ts +20 -0
- package/dist/providers/typescript/modules/terse/TerseModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/terse/TerseModule.js +61 -0
- package/dist/providers/typescript/modules/terse/TerseModule.js.map +1 -0
- package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts +17 -0
- package/dist/providers/typescript/modules/workos/WorkOSModule.d.ts.map +1 -0
- package/dist/providers/typescript/modules/workos/WorkOSModule.js +30 -0
- package/dist/providers/typescript/modules/workos/WorkOSModule.js.map +1 -0
- package/dist/providers/typescript/prepareCodegenData.d.ts +13 -0
- package/dist/providers/typescript/prepareCodegenData.d.ts.map +1 -1
- package/dist/providers/typescript/prepareCodegenData.js +42 -3
- package/dist/providers/typescript/prepareCodegenData.js.map +1 -1
- package/dist/providers/typescript/templateEngine.d.ts +8 -2
- package/dist/providers/typescript/templateEngine.d.ts.map +1 -1
- package/dist/providers/typescript/templateEngine.js +241 -29
- package/dist/providers/typescript/templateEngine.js.map +1 -1
- package/dist/providers/typescript/triggerTypeDeclarations.d.ts +4 -4
- package/dist/providers/typescript/triggerTypeDeclarations.d.ts.map +1 -1
- package/dist/providers/typescript/triggerTypeDeclarations.js +26 -83
- package/dist/providers/typescript/triggerTypeDeclarations.js.map +1 -1
- package/dist/providers/typescript/typePrinter.d.ts +1 -0
- package/dist/providers/typescript/typePrinter.d.ts.map +1 -1
- package/dist/providers/typescript/typePrinter.js +7 -1
- package/dist/providers/typescript/typePrinter.js.map +1 -1
- package/package.json +7 -5
- package/src/providers/typescript/modules/attio/attio.schemas.hbs +150 -0
- package/src/providers/typescript/modules/attio/attio.tools.hbs +192 -0
- package/src/providers/typescript/modules/attio/attio.triggers.hbs +130 -0
- package/src/providers/typescript/modules/datadog/datadog.tools.hbs +16 -0
- package/src/providers/typescript/modules/github/github.tools.hbs +68 -0
- package/src/providers/typescript/modules/github/github.triggers.hbs +40 -0
- package/src/providers/typescript/modules/gmail/gmail.tools.hbs +17 -0
- package/src/providers/typescript/modules/gmail/gmail.triggers.hbs +16 -0
- package/src/providers/typescript/modules/hey_reach/hey_reach.tools.hbs +9 -0
- package/src/providers/typescript/modules/hey_reach/hey_reach.triggers.hbs +56 -0
- package/src/providers/typescript/modules/launchdarkly/launchdarkly.tools.hbs +16 -0
- package/src/providers/typescript/modules/linear/linear.tools.hbs +23 -0
- package/src/providers/typescript/modules/linear/linear.triggers.hbs +24 -0
- package/src/providers/typescript/modules/notion/notion.tools.hbs +20 -0
- package/src/providers/typescript/modules/posthog/posthog.tools.hbs +28 -0
- package/src/providers/typescript/modules/resend/resend.tools.hbs +46 -0
- package/src/providers/typescript/modules/slack/slack.tools.hbs +18 -0
- package/src/providers/typescript/modules/slack/slack.triggers.hbs +28 -0
- package/src/providers/typescript/modules/snowflake/snowflake.tools.hbs +12 -0
- package/src/providers/typescript/modules/terse/terse.tools.hbs +22 -0
- package/src/providers/typescript/modules/terse/terse.triggers.hbs +33 -0
- package/src/providers/typescript/modules/workos/workos.tools.hbs +12 -0
- package/src/providers/typescript/modules/workos/workos.triggers.hbs +64 -0
- package/templates/typescript/codegen/.impeccable/hook.cache.json +1 -1
- package/templates/typescript/codegen/common.hbs +6 -0
- package/templates/typescript/codegen/partials/tools-slice.hbs +18 -0
- package/templates/typescript/codegen/root.hbs +72 -0
- package/templates/typescript/codegen/sdk-primitives.hbs +42 -0
- package/templates/typescript/codegen/generated.hbs +0 -14
- package/templates/typescript/codegen/partials/attio-section.hbs +0 -86
- package/templates/typescript/codegen/partials/datadog-section.hbs +0 -3
- package/templates/typescript/codegen/partials/github-section.hbs +0 -30
- package/templates/typescript/codegen/partials/header.hbs +0 -17
- package/templates/typescript/codegen/partials/hey-reach-section.hbs +0 -3
- package/templates/typescript/codegen/partials/launchdarkly-section.hbs +0 -3
- package/templates/typescript/codegen/partials/linear-section.hbs +0 -5
- package/templates/typescript/codegen/partials/notion-section.hbs +0 -5
- package/templates/typescript/codegen/partials/posthog-section.hbs +0 -15
- package/templates/typescript/codegen/partials/skills-section.hbs +0 -99
- package/templates/typescript/codegen/partials/slack-section.hbs +0 -5
- package/templates/typescript/codegen/partials/tools-section.hbs +0 -94
- package/templates/typescript/codegen/partials/triggers-section.hbs +0 -353
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{{sectionHeader "HeyReach triggers"}}
|
|
2
|
+
|
|
3
|
+
{{#each triggerDeclarations}}
|
|
4
|
+
{{{this}}}
|
|
5
|
+
|
|
6
|
+
{{/each}}
|
|
7
|
+
export const heyReachTriggers = {
|
|
8
|
+
/** Trigger when a connection request is sent */
|
|
9
|
+
onConnectionRequestSent(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachConnectionRequestSentTrigger> {
|
|
10
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.CONNECTION_REQUEST_SENT, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
11
|
+
},
|
|
12
|
+
/** Trigger when a connection request is accepted */
|
|
13
|
+
onConnectionRequestAccepted(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachConnectionRequestAcceptedTrigger> {
|
|
14
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.CONNECTION_REQUEST_ACCEPTED, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
15
|
+
},
|
|
16
|
+
/** Trigger when a LinkedIn message is sent */
|
|
17
|
+
onMessageSent(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachMessageSentTrigger> {
|
|
18
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.MESSAGE_SENT, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
19
|
+
},
|
|
20
|
+
/** Trigger on the first reply to a LinkedIn message */
|
|
21
|
+
onMessageReplyReceived(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachMessageReplyReceivedTrigger> {
|
|
22
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.MESSAGE_REPLY_RECEIVED, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
23
|
+
},
|
|
24
|
+
/** Trigger when an InMail is sent */
|
|
25
|
+
onInmailSent(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachInmailSentTrigger> {
|
|
26
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.INMAIL_SENT, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
27
|
+
},
|
|
28
|
+
/** Trigger on the first reply to an InMail */
|
|
29
|
+
onInmailReplyReceived(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachInmailReplyReceivedTrigger> {
|
|
30
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.INMAIL_REPLY_RECEIVED, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
31
|
+
},
|
|
32
|
+
/** Trigger when a follow is sent */
|
|
33
|
+
onFollowSent(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachFollowSentTrigger> {
|
|
34
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.FOLLOW_SENT, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
35
|
+
},
|
|
36
|
+
/** Trigger when a post is liked */
|
|
37
|
+
onLikedPost(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachLikedPostTrigger> {
|
|
38
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.LIKED_POST, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
39
|
+
},
|
|
40
|
+
/** Trigger when a profile is viewed */
|
|
41
|
+
onViewedProfile(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachViewedProfileTrigger> {
|
|
42
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.VIEWED_PROFILE, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
43
|
+
},
|
|
44
|
+
/** Trigger when a campaign completes */
|
|
45
|
+
onCampaignCompleted(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachCampaignCompletedTrigger> {
|
|
46
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.CAMPAIGN_COMPLETED, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
47
|
+
},
|
|
48
|
+
/** Trigger when lead tags are updated */
|
|
49
|
+
onLeadTagUpdated(opts?: { campaigns?: HeyReachCampaign[] }): TypedTrigger<HeyReachLeadTagUpdatedTrigger> {
|
|
50
|
+
return new HeyReachInputConfig("{{escape section.id}}", HeyReachEventType.LEAD_TAG_UPDATED, (opts?.campaigns ?? []).map(c => c.campaignId))
|
|
51
|
+
},
|
|
52
|
+
/** Trigger on specific HeyReach event types */
|
|
53
|
+
trigger(opts: { campaigns?: HeyReachCampaign[]; eventType: HeyReachEventType }): TypedTrigger<HeyReachTrigger> {
|
|
54
|
+
return new HeyReachInputConfig("{{escape section.id}}", opts.eventType, (opts.campaigns ?? []).map(c => c.campaignId))
|
|
55
|
+
},
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{{sectionHeader "LaunchDarkly resources"}}
|
|
2
|
+
|
|
3
|
+
{{> resource-class section.projectClass}}
|
|
4
|
+
|
|
5
|
+
{{#if toolFile}}
|
|
6
|
+
{{sectionHeader "LaunchDarkly tools"}}
|
|
7
|
+
|
|
8
|
+
{{> tools-slice toolFile}}
|
|
9
|
+
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{sectionHeader "LaunchDarkly skill"}}
|
|
12
|
+
|
|
13
|
+
/** LaunchDarkly — read and toggle feature flags in a project + environments */
|
|
14
|
+
export function launchDarklySkill(opts: { project: LaunchDarklyProject; environmentKeys: string[] }): TypedSkill<{{{section.skillToolType}}}> {
|
|
15
|
+
return new LaunchDarklyConfig("{{escape section.id}}", opts.project.projectKey, opts.environmentKeys)
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{sectionHeader "Linear resources"}}
|
|
2
|
+
|
|
3
|
+
{{> resource-class section.teamClass}}
|
|
4
|
+
|
|
5
|
+
{{> resource-class section.projectClass}}
|
|
6
|
+
|
|
7
|
+
{{#if toolFile}}
|
|
8
|
+
{{sectionHeader "Linear tools"}}
|
|
9
|
+
|
|
10
|
+
{{> tools-slice toolFile}}
|
|
11
|
+
|
|
12
|
+
{{/if}}
|
|
13
|
+
{{sectionHeader "Linear skill"}}
|
|
14
|
+
|
|
15
|
+
/** Linear — read and write issues, optionally scoped to a team or project */
|
|
16
|
+
export function linearSkill(opts?: { team?: LinearTeam; project?: LinearProject }): TypedSkill<{{{section.skillToolType}}}> {
|
|
17
|
+
return new LinearOutputConfig(
|
|
18
|
+
"{{escape section.id}}",
|
|
19
|
+
opts?.team?.teamId ?? null,
|
|
20
|
+
opts?.team?.name ?? null,
|
|
21
|
+
opts?.project?.projectId ?? null
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{{sectionHeader "Linear triggers"}}
|
|
2
|
+
|
|
3
|
+
{{#each triggerDeclarations}}
|
|
4
|
+
{{{this}}}
|
|
5
|
+
|
|
6
|
+
{{/each}}
|
|
7
|
+
export const linearTriggers = {
|
|
8
|
+
/** Trigger when a new issue is created. Optionally scope with `LinearTeam.*` / `LinearProject.*`. */
|
|
9
|
+
onIssueCreated(opts?: { team?: LinearTeam; project?: LinearProject }): TypedTrigger<LinearIssueCreatedTrigger> {
|
|
10
|
+
return new LinearInputConfig("{{escape section.id}}", opts?.project?.projectId ?? null, [LinearEventType.ISSUE_CREATED], opts?.team?.teamId ?? null)
|
|
11
|
+
},
|
|
12
|
+
/** Trigger when an issue is updated */
|
|
13
|
+
onIssueUpdated(opts?: { team?: LinearTeam; project?: LinearProject }): TypedTrigger<LinearIssueUpdatedTrigger> {
|
|
14
|
+
return new LinearInputConfig("{{escape section.id}}", opts?.project?.projectId ?? null, [LinearEventType.ISSUE_UPDATED], opts?.team?.teamId ?? null)
|
|
15
|
+
},
|
|
16
|
+
/** Trigger when a comment is added to an issue */
|
|
17
|
+
onComment(opts?: { team?: LinearTeam; project?: LinearProject }): TypedTrigger<LinearCommentCreatedTrigger> {
|
|
18
|
+
return new LinearInputConfig("{{escape section.id}}", opts?.project?.projectId ?? null, [LinearEventType.COMMENT_CREATED], opts?.team?.teamId ?? null)
|
|
19
|
+
},
|
|
20
|
+
/** Trigger on all Linear events */
|
|
21
|
+
trigger(opts?: { team?: LinearTeam; project?: LinearProject; eventTypes?: LinearEventType[] }): TypedTrigger<LinearTrigger> {
|
|
22
|
+
return new LinearInputConfig("{{escape section.id}}", opts?.project?.projectId ?? null, opts?.eventTypes, opts?.team?.teamId ?? null)
|
|
23
|
+
},
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{{sectionHeader "Notion resources"}}
|
|
2
|
+
|
|
3
|
+
{{> resource-class section.databaseClass}}
|
|
4
|
+
|
|
5
|
+
{{> resource-class section.pageClass}}
|
|
6
|
+
|
|
7
|
+
{{#if toolFile}}
|
|
8
|
+
{{sectionHeader "Notion tools"}}
|
|
9
|
+
|
|
10
|
+
{{> tools-slice toolFile}}
|
|
11
|
+
|
|
12
|
+
{{/if}}
|
|
13
|
+
{{sectionHeader "Notion skill"}}
|
|
14
|
+
|
|
15
|
+
/** Notion — read and write to the given databases or pages */
|
|
16
|
+
export function notionSkill(opts?: { databases?: NotionDatabase[]; pages?: NotionPage[] }): TypedSkill<{{{section.skillToolType}}}> {
|
|
17
|
+
return new NotionConfig("{{escape section.id}}",
|
|
18
|
+
opts?.databases?.map(d => d.databaseId), opts?.databases?.map(d => d.title),
|
|
19
|
+
opts?.pages?.map(p => p.pageId), opts?.pages?.map(p => p.title))
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{{sectionHeader "PostHog resources"}}
|
|
2
|
+
|
|
3
|
+
{{> resource-class section.projectClass}}
|
|
4
|
+
|
|
5
|
+
{{#if section.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 section.eventNames}}
|
|
13
|
+
| "{{escape this}}"
|
|
14
|
+
{{/each}}
|
|
15
|
+
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#if toolFile}}
|
|
18
|
+
{{sectionHeader "PostHog tools"}}
|
|
19
|
+
|
|
20
|
+
{{> tools-slice toolFile}}
|
|
21
|
+
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{sectionHeader "PostHog skill"}}
|
|
24
|
+
|
|
25
|
+
/** PostHog — query analytics for a specific project */
|
|
26
|
+
export function posthogSkill(opts: { project: PosthogProject }): TypedSkill<{{{section.skillToolType}}}> {
|
|
27
|
+
return new PosthogConfig("{{escape section.id}}", opts.project.projectId, opts.project.name)
|
|
28
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{{sectionHeader "Resend templates"}}
|
|
2
|
+
|
|
3
|
+
export type ResendTemplateVariableValue = string | number
|
|
4
|
+
|
|
5
|
+
export interface GeneratedResendTemplate {
|
|
6
|
+
readonly templateId: string
|
|
7
|
+
readonly alias: string | null
|
|
8
|
+
readonly name: string
|
|
9
|
+
readonly variables: readonly { key: string; type: "string" | "number"; required: boolean; fallbackValue: ResendTemplateVariableValue | null }[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ResendTemplates = {
|
|
13
|
+
{{#each section.templates}}
|
|
14
|
+
{{staticName}}: {
|
|
15
|
+
templateId: "{{escape id}}",
|
|
16
|
+
alias: {{#if alias}}"{{escape alias}}"{{else}}null{{/if}},
|
|
17
|
+
name: "{{escape name}}",
|
|
18
|
+
variables: [{{{variablesMetadata}}}],
|
|
19
|
+
},
|
|
20
|
+
{{/each}}
|
|
21
|
+
} as const satisfies Record<string, GeneratedResendTemplate>
|
|
22
|
+
|
|
23
|
+
export type ResendTemplate = (typeof ResendTemplates)[keyof typeof ResendTemplates]
|
|
24
|
+
{{#if section.templates.length}}
|
|
25
|
+
|
|
26
|
+
{{{section.baseParamsDeclaration}}}
|
|
27
|
+
|
|
28
|
+
/** Send a published Resend email template. `variables` is typed per template, keyed by `templateId`. */
|
|
29
|
+
export type ResendSendTemplateParams =
|
|
30
|
+
{{#each section.templates}}
|
|
31
|
+
| (ResendSendTemplateBaseParams & { templateId: typeof ResendTemplates.{{staticName}}.templateId; variables: {{{variablesType}}} })
|
|
32
|
+
{{/each}}
|
|
33
|
+
|
|
34
|
+
{{/if}}
|
|
35
|
+
{{#if toolFile}}
|
|
36
|
+
{{sectionHeader "Resend tools"}}
|
|
37
|
+
|
|
38
|
+
{{> tools-slice toolFile}}
|
|
39
|
+
|
|
40
|
+
{{/if}}
|
|
41
|
+
{{sectionHeader "Resend skill"}}
|
|
42
|
+
|
|
43
|
+
/** Resend — send transactional email using generated published templates */
|
|
44
|
+
export function resendSkill(): TypedSkill<{{{section.skillToolType}}}> {
|
|
45
|
+
return new ResendOutputConfig("{{escape section.id}}")
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{sectionHeader "Slack resources"}}
|
|
2
|
+
|
|
3
|
+
{{> resource-class section.channelClass}}
|
|
4
|
+
|
|
5
|
+
{{> resource-class section.userClass}}
|
|
6
|
+
|
|
7
|
+
{{#if toolFile}}
|
|
8
|
+
{{sectionHeader "Slack tools"}}
|
|
9
|
+
|
|
10
|
+
{{> tools-slice toolFile}}
|
|
11
|
+
|
|
12
|
+
{{/if}}
|
|
13
|
+
{{sectionHeader "Slack skill"}}
|
|
14
|
+
|
|
15
|
+
/** Slack — send messages and manage threads in a specific channel */
|
|
16
|
+
export function slackSkill(opts: { channel: SlackChannel; userIds?: string[]; userNames?: string[]; listenToUserDms?: boolean }): TypedSkill<{{{section.skillToolType}}}> {
|
|
17
|
+
return new SlackOutputConfig("{{escape section.id}}", opts.channel.channelId ?? null, opts.channel.name ?? null, opts.userIds ?? [], opts.userNames ?? null, opts.listenToUserDms)
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{{sectionHeader "Slack triggers"}}
|
|
2
|
+
|
|
3
|
+
{{#each triggerDeclarations}}
|
|
4
|
+
{{{this}}}
|
|
5
|
+
|
|
6
|
+
{{/each}}
|
|
7
|
+
export const slackTriggers = {
|
|
8
|
+
/** Trigger on any message in a channel */
|
|
9
|
+
onMessage(opts: { channel: SlackChannel; userIds?: string[] }): TypedTrigger<SlackMessageTrigger> {
|
|
10
|
+
return new SlackConfig("{{escape section.id}}", opts.channel.channelId, opts.channel.name, false, opts.userIds ?? [], [SlackEventType.MESSAGE])
|
|
11
|
+
},
|
|
12
|
+
/** Trigger on direct messages to the bot */
|
|
13
|
+
onDm(opts?: { userIds?: string[] }): TypedTrigger<SlackMessageTrigger> {
|
|
14
|
+
return new SlackConfig("{{escape section.id}}", undefined, undefined, true, opts?.userIds ?? [], [SlackEventType.MESSAGE])
|
|
15
|
+
},
|
|
16
|
+
/** Trigger when the Slack app is directly mentioned */
|
|
17
|
+
onAppMention(opts: { channel: SlackChannel; userIds?: string[] }): TypedTrigger<SlackAppMentionTrigger> {
|
|
18
|
+
return new SlackConfig("{{escape section.id}}", opts.channel.channelId, opts.channel.name, false, opts.userIds ?? [], [SlackEventType.APP_MENTION])
|
|
19
|
+
},
|
|
20
|
+
/** Trigger when a reaction is added to a message in a channel */
|
|
21
|
+
onReactionAdded(opts: { channel: SlackChannel; userIds?: string[] }): TypedTrigger<SlackReactionAddedTrigger> {
|
|
22
|
+
return new SlackConfig("{{escape section.id}}", opts.channel.channelId, opts.channel.name, false, opts.userIds ?? [], [SlackEventType.REACTION_ADDED])
|
|
23
|
+
},
|
|
24
|
+
/** Trigger on all Slack events (messages + DMs) for a channel */
|
|
25
|
+
trigger(opts?: { channel?: SlackChannel; listenToUserDms?: boolean; userIds?: string[]; eventTypes?: SlackEventType[] }): TypedTrigger<SlackTrigger> {
|
|
26
|
+
return new SlackConfig("{{escape section.id}}", opts?.channel?.channelId, opts?.channel?.name, opts?.listenToUserDms, opts?.userIds ?? [], opts?.eventTypes)
|
|
27
|
+
},
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{#if toolFile}}
|
|
2
|
+
{{sectionHeader "Snowflake tools"}}
|
|
3
|
+
|
|
4
|
+
{{> tools-slice toolFile}}
|
|
5
|
+
|
|
6
|
+
{{/if}}
|
|
7
|
+
{{sectionHeader "Snowflake skill"}}
|
|
8
|
+
|
|
9
|
+
/** Snowflake — run SQL queries against your warehouse */
|
|
10
|
+
export function snowflakeSkill(): TypedSkill<{{{section.skillToolType}}}> {
|
|
11
|
+
return new SnowflakeOutputConfig("{{escape section.id}}")
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{{#if toolFile}}
|
|
2
|
+
{{sectionHeader "Terse built-in tools"}}
|
|
3
|
+
|
|
4
|
+
{{> tools-slice toolFile}}
|
|
5
|
+
|
|
6
|
+
{{/if}}
|
|
7
|
+
{{sectionHeader "Built-in skills"}}
|
|
8
|
+
|
|
9
|
+
/** 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). */
|
|
10
|
+
export function webSkill(opts: { allowedDomains?: string[] } = {}): TypedSkill<"web_search" | "web_extract" | "web_research"> {
|
|
11
|
+
return new WebConfig(opts)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** ImageEdit — edit and generate images */
|
|
15
|
+
export function imageEditSkill(): TypedSkill<"image_edit"> {
|
|
16
|
+
return new ImageEditConfig()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Memory — built-in persistent memory the agent reads and writes under /memories, scoped to this job and surviving across runs. */
|
|
20
|
+
export function memorySkill(): TypedSkill<"memory"> {
|
|
21
|
+
return new MemoryConfig()
|
|
22
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{{sectionHeader "Built-in triggers"}}
|
|
2
|
+
|
|
3
|
+
{{#each triggerDeclarations}}
|
|
4
|
+
{{{this}}}
|
|
5
|
+
|
|
6
|
+
{{/each}}
|
|
7
|
+
export const scheduleTriggers = {
|
|
8
|
+
/** Run on a cron schedule (5-field cron expression, evaluated in UTC) */
|
|
9
|
+
cron(opts: { expression: string }): TypedTrigger<CronTrigger> {
|
|
10
|
+
return new TimeTriggerConfig(opts.expression)
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const webhookTriggers = {
|
|
15
|
+
/** Trigger via an external HTTP request to a generated URL */
|
|
16
|
+
onRequest<TBody = unknown>(): TypedTrigger<WebhookTrigger<TBody>> {
|
|
17
|
+
return new WebhookInputConfig()
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Bind a web-monitor event to a Zod schema: the `payload` field types as the schema's output */
|
|
22
|
+
export type WebMonitorTriggerFor<TSchema> = WebMonitorTrigger<InferStructuredOutput<TSchema>>
|
|
23
|
+
|
|
24
|
+
export const webMonitorTriggers = {
|
|
25
|
+
/** Trigger when a query against the live web matches the given schema */
|
|
26
|
+
onEvent<const TSchema>(opts: {
|
|
27
|
+
query: string
|
|
28
|
+
frequency: { number: number; unit: FrequencyUnit }
|
|
29
|
+
outputSchema?: TSchema
|
|
30
|
+
}): TypedTrigger<WebMonitorTrigger<InferStructuredOutput<TSchema>>> {
|
|
31
|
+
return new WebMonitorConfig(opts.query, opts.frequency, opts.outputSchema)
|
|
32
|
+
},
|
|
33
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{{#if toolFile}}
|
|
2
|
+
{{sectionHeader "WorkOS tools"}}
|
|
3
|
+
|
|
4
|
+
{{> tools-slice toolFile}}
|
|
5
|
+
|
|
6
|
+
{{/if}}
|
|
7
|
+
{{sectionHeader "WorkOS skill"}}
|
|
8
|
+
|
|
9
|
+
/** WorkOS — manage users, organizations and invitations */
|
|
10
|
+
export function workOSSkill(): TypedSkill<{{{section.skillToolType}}}> {
|
|
11
|
+
return new WorkOSOutputConfig("{{escape section.id}}")
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{{sectionHeader "WorkOS triggers"}}
|
|
2
|
+
|
|
3
|
+
{{#each triggerDeclarations}}
|
|
4
|
+
{{{this}}}
|
|
5
|
+
|
|
6
|
+
{{/each}}
|
|
7
|
+
export const workOSTriggers = {
|
|
8
|
+
/** Trigger on user creation */
|
|
9
|
+
onUserCreated(): TypedTrigger<WorkOSUserCreatedTrigger> {
|
|
10
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.USER_CREATED])
|
|
11
|
+
},
|
|
12
|
+
/** Trigger on user update */
|
|
13
|
+
onUserUpdated(): TypedTrigger<WorkOSUserUpdatedTrigger> {
|
|
14
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.USER_UPDATED])
|
|
15
|
+
},
|
|
16
|
+
/** Trigger on user deletion */
|
|
17
|
+
onUserDeleted(): TypedTrigger<WorkOSUserDeletedTrigger> {
|
|
18
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.USER_DELETED])
|
|
19
|
+
},
|
|
20
|
+
/** Trigger on organization membership creation */
|
|
21
|
+
onMembershipCreated(): TypedTrigger<WorkOSOrganizationMembershipCreatedTrigger> {
|
|
22
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.ORGANIZATION_MEMBERSHIP_CREATED])
|
|
23
|
+
},
|
|
24
|
+
/** Trigger on organization membership update */
|
|
25
|
+
onMembershipUpdated(): TypedTrigger<WorkOSOrganizationMembershipUpdatedTrigger> {
|
|
26
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.ORGANIZATION_MEMBERSHIP_UPDATED])
|
|
27
|
+
},
|
|
28
|
+
/** Trigger on organization membership deletion */
|
|
29
|
+
onMembershipDeleted(): TypedTrigger<WorkOSOrganizationMembershipDeletedTrigger> {
|
|
30
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.ORGANIZATION_MEMBERSHIP_DELETED])
|
|
31
|
+
},
|
|
32
|
+
/** Trigger on any organization membership change */
|
|
33
|
+
onMembershipChanged(): TypedTrigger<WorkOSMembershipTrigger> {
|
|
34
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.ORGANIZATION_MEMBERSHIP_CREATED, WorkOSEventType.ORGANIZATION_MEMBERSHIP_UPDATED, WorkOSEventType.ORGANIZATION_MEMBERSHIP_DELETED])
|
|
35
|
+
},
|
|
36
|
+
/** Trigger when an invitation is sent (created or resent) */
|
|
37
|
+
onInvitationSent(): TypedTrigger<WorkOSInvitationTrigger> {
|
|
38
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.INVITATION_CREATED, WorkOSEventType.INVITATION_RESENT])
|
|
39
|
+
},
|
|
40
|
+
/** Trigger when an invitation is first created */
|
|
41
|
+
onInvitationCreated(): TypedTrigger<WorkOSInvitationCreatedTrigger> {
|
|
42
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.INVITATION_CREATED])
|
|
43
|
+
},
|
|
44
|
+
/** Trigger when an invitation is resent */
|
|
45
|
+
onInvitationResent(): TypedTrigger<WorkOSInvitationResentTrigger> {
|
|
46
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.INVITATION_RESENT])
|
|
47
|
+
},
|
|
48
|
+
/** Trigger on invitation accepted */
|
|
49
|
+
onInvitationAccepted(): TypedTrigger<WorkOSInvitationAcceptedTrigger> {
|
|
50
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.INVITATION_ACCEPTED])
|
|
51
|
+
},
|
|
52
|
+
/** Trigger when an invitation is revoked */
|
|
53
|
+
onInvitationRevoked(): TypedTrigger<WorkOSInvitationRevokedTrigger> {
|
|
54
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.INVITATION_REVOKED])
|
|
55
|
+
},
|
|
56
|
+
/** Trigger on organization creation */
|
|
57
|
+
onOrganizationCreated(): TypedTrigger<WorkOSOrganizationTrigger> {
|
|
58
|
+
return new WorkOSInputConfig("{{escape section.id}}", [WorkOSEventType.ORGANIZATION_CREATED])
|
|
59
|
+
},
|
|
60
|
+
/** Trigger on specific WorkOS event types */
|
|
61
|
+
trigger(opts?: { eventTypes?: WorkOSEventType[] }): TypedTrigger<WorkOSTrigger | WorkOSUserTrigger | WorkOSMembershipTrigger | WorkOSInvitationTrigger | WorkOSOrganizationTrigger> {
|
|
62
|
+
return new WorkOSInputConfig("{{escape section.id}}", opts?.eventTypes)
|
|
63
|
+
},
|
|
64
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"sessions":{"9819a905-dfd0-4796-9ebb-35ebffe9e823":{"updatedAt":1783680440916,"files":{"/Users/olimorissette/Desktop/projects/Terse/packages/terse-cli/src/providers/typescript/templateEngine.ts":{"editCount":1,"findings":[]},"/Users/olimorissette/Desktop/projects/Terse/packages/terse-cli/src/providers/typescript/prepareCodegenData.ts":{"editCount":2,"findings":[]}}}}}
|
|
1
|
+
{"version":1,"sessions":{"9819a905-dfd0-4796-9ebb-35ebffe9e823":{"updatedAt":1783680440916,"files":{"/Users/olimorissette/Desktop/projects/Terse/packages/terse-cli/src/providers/typescript/templateEngine.ts":{"editCount":1,"findings":[]},"/Users/olimorissette/Desktop/projects/Terse/packages/terse-cli/src/providers/typescript/prepareCodegenData.ts":{"editCount":2,"findings":[]}}},"880affde-d725-41e0-945d-5d13f7843af7":{"updatedAt":1783982109807,"files":{"/Users/olimorissette/Desktop/projects/Terse/packages/terse-cli/src/providers/typescript/templateEngine.ts":{"editCount":1,"findings":[]},"/Users/olimorissette/Desktop/projects/Terse/packages/terse-cli/src/commands/generate.ts":{"editCount":2,"findings":[]}}}}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{{#each declarations}}
|
|
2
|
+
{{{this}}}
|
|
3
|
+
|
|
4
|
+
{{/each}}
|
|
5
|
+
export type {{typeName}} = {
|
|
6
|
+
{{#each methods}}
|
|
7
|
+
{{#if description}} /** {{description}} */
|
|
8
|
+
{{/if}} {{{generatedSignature}}}
|
|
9
|
+
{{/each}}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const {{constName}}: {{typeName}} = {
|
|
13
|
+
{{#each methods}}
|
|
14
|
+
{{#each runtimeLines}}
|
|
15
|
+
{{{this}}}
|
|
16
|
+
{{/each}}
|
|
17
|
+
{{/each}}
|
|
18
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{{sectionHeader "Triggers"}}
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Triggers available in your workspace.
|
|
5
|
+
*
|
|
6
|
+
* Type `Triggers.` in your editor to see every connected integration with triggers.
|
|
7
|
+
* Use these in `createJob({ triggers: [...] })`.
|
|
8
|
+
*/
|
|
9
|
+
export const Triggers = {
|
|
10
|
+
{{#each triggersAggregateLines}}
|
|
11
|
+
{{{this}}}
|
|
12
|
+
{{/each}}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
{{sectionHeader "Skills"}}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Skills available in your workspace.
|
|
19
|
+
*
|
|
20
|
+
* Type `Skills.` in your editor to see every connected integration's skill at a glance.
|
|
21
|
+
* Use these in `generateText({ skills: [...] })` (or `TerseAgent.create({ skills: [...] })`).
|
|
22
|
+
*/
|
|
23
|
+
export const Skills = {
|
|
24
|
+
{{#each skillsAggregateLines}}
|
|
25
|
+
{{{this}}}
|
|
26
|
+
{{/each}}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
{{sectionHeader "Typed Tools"}}
|
|
30
|
+
|
|
31
|
+
export type GeneratedTools = {
|
|
32
|
+
{{#each toolboxEntries}}
|
|
33
|
+
{{key}}: {{typeName}}
|
|
34
|
+
{{/each}}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare module "terse-sdk" {
|
|
38
|
+
interface TerseAgent {
|
|
39
|
+
readonly tools: GeneratedTools
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function createTools(agent: TerseAgent): GeneratedTools {
|
|
44
|
+
const allowed: Set<string> = new Set(agent.skills.map(config => config.integrationType))
|
|
45
|
+
return {
|
|
46
|
+
{{#each toolboxEntries}}
|
|
47
|
+
...(allowed.has("{{escape integrationType}}") ? { {{key}}: {{constName}} } : {}),
|
|
48
|
+
{{/each}}
|
|
49
|
+
} as GeneratedTools
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
;(globalThis as any).__terse_createTools = createTools
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Deterministic tool calls without an agent.
|
|
56
|
+
*
|
|
57
|
+
* `toolbox` exposes every connected integration tool as a typed function. Unlike
|
|
58
|
+
* `agent.tools`, it does not require constructing a `TerseAgent` and is not
|
|
59
|
+
* filtered by `skills`. Use it when you know exactly which tool to call and
|
|
60
|
+
* don't need an LLM in the loop.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { toolbox } from "./terse.generated"
|
|
65
|
+
* await toolbox.slack.sendMessage({ channelId: "...", message: "hi" })
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export const toolbox: GeneratedTools = {
|
|
69
|
+
{{#each toolboxEntries}}
|
|
70
|
+
{{key}}: {{constName}},
|
|
71
|
+
{{/each}}
|
|
72
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ── Platform primitives (from "terse-sdk") ────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Everything below ships with the terse-sdk package. This summary is the
|
|
4
|
+
// reference for job code — do not read the terse-sdk dist to rediscover it.
|
|
5
|
+
//
|
|
6
|
+
// Defining jobs:
|
|
7
|
+
// createJob({ name, triggers: [...], states?, filter?, onTrigger, durable? })
|
|
8
|
+
// Registers a workflow. `filter` and `onTrigger` receive (event, state);
|
|
9
|
+
// `filter` returns boolean to decide whether the run proceeds.
|
|
10
|
+
// Every trigger event has event.formatForAgentRunner(): string — the
|
|
11
|
+
// canonical way to inline the triggering event into an agent prompt.
|
|
12
|
+
//
|
|
13
|
+
// Agentic execution:
|
|
14
|
+
// generateText({ prompt, skills: [...], toolApprovals?, outputSchema? })
|
|
15
|
+
// One-shot agent run. Returns Promise<string>, or Promise<z.infer<schema>>
|
|
16
|
+
// when `outputSchema` (a zod schema) is given. Skills come from the
|
|
17
|
+
// generated `Skills` export below; the agent can only touch integrations
|
|
18
|
+
// whose skills are passed.
|
|
19
|
+
// TerseAgent.create({ prompt, skills, toolApprovals? })
|
|
20
|
+
// Streaming variant: `for await (const result of agent.run(message))`.
|
|
21
|
+
// `agent.tools` is typed to the generated tools of the passed skills.
|
|
22
|
+
//
|
|
23
|
+
// Per-job state (typed key/value store):
|
|
24
|
+
// states: [{ key: "runCount", value: z.number().default(0) }]
|
|
25
|
+
// then `await state.get("runCount")` / `await state.set("runCount", n)`
|
|
26
|
+
// in `filter`/`onTrigger`. Keys and value types come from the declaration.
|
|
27
|
+
//
|
|
28
|
+
// Durability (all of these require `durable: true` on the job):
|
|
29
|
+
// step(client.method(args)) Journals a single wrapped call; arguments and
|
|
30
|
+
// result must be serializable.
|
|
31
|
+
// jobStep({ run, input?, inputSchema?, outputSchema? })
|
|
32
|
+
// Journals a code block as one step.
|
|
33
|
+
// sleep("2h" | ms | Date) Suspends the run; resumes after the duration.
|
|
34
|
+
// await log(...args) Replay-safe console.log (prints exactly once).
|
|
35
|
+
// waitForInput({ via: slack({ channel: SlackChannel.X.channelId }), prompt, options })
|
|
36
|
+
// Suspends until a human answers; resolves to
|
|
37
|
+
// { choice, text?, respondent }. `options` is
|
|
38
|
+
// [{ id, label, description?, freeText? }].
|
|
39
|
+
//
|
|
40
|
+
// Secrets:
|
|
41
|
+
// Write with `terse secrets add`; read in job code via process.env.MY_SECRET.
|
|
42
|
+
// There is no value-returning secrets API — env vars are the read side.
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{{> header}}
|
|
2
|
-
|
|
3
|
-
{{#if github}}{{> github-section github}}{{/if~}}
|
|
4
|
-
{{#if slack}}{{> slack-section slack}}{{/if~}}
|
|
5
|
-
{{#if linear}}{{> linear-section linear}}{{/if~}}
|
|
6
|
-
{{#if notion}}{{> notion-section notion}}{{/if~}}
|
|
7
|
-
{{#if posthog}}{{> posthog-section posthog}}{{/if~}}
|
|
8
|
-
{{#if datadog}}{{> datadog-section datadog}}{{/if~}}
|
|
9
|
-
{{#if launchdarkly}}{{> launchdarkly-section launchdarkly}}{{/if~}}
|
|
10
|
-
{{#if attio}}{{> attio-section attio}}{{/if~}}
|
|
11
|
-
{{#if heyreach}}{{> hey-reach-section heyreach}}{{/if~}}
|
|
12
|
-
{{> triggers-section}}
|
|
13
|
-
{{> skills-section}}
|
|
14
|
-
{{#if tools}}{{> tools-section tools}}{{/if}}
|