Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.useterse.ai/llms.txt

Use this file to discover all available pages before exploring further.

Context as Code is the idea. The generated SDK is the artifact. Running terse generate writes a single typed file to your project at src/terse.generated.ts. Every trigger, skill, deterministic tool wrapper, and real workspace resource (channels, repos, objects, owners) is exported as a typed value. Your workflows import from it. Your coding agent reads it. The compiler enforces it.
The generated file is deterministic, overwritten on every terse generate, and committed alongside your workflows. Do not hand-edit it.

What the file contains

Each section is generated from a real integration you’ve connected. Here’s a trimmed snapshot of what you’d see after connecting Slack, GitHub, and Attio.

Resource constants

Every workspace resource is exported as a typed constant. No UUIDs in your workflow code, no runtime lookups.
src/terse.generated.ts
export class SlackChannel {
    constructor(
        public readonly channelId: string,
        public readonly name: string
    ) {}

    static DealDesk = new SlackChannel("C08XYZ1234", "deal-desk")
    static Engineering = new SlackChannel("C09ABC5678", "engineering")
    static AllTerseInc = new SlackChannel("C01DEF9012", "all-terse-inc")
}

export class SlackUser {
    constructor(
        public readonly userId: string,
        public readonly name: string
    ) {}

    static OnCall = new SlackUser("U08XYZ1234", "on-call")
}

export class GithubOwner {
    constructor(public readonly name: string) {}

    static TerseAI = new GithubOwner("terse-ai")
}

export class Repos {
    constructor(
        public readonly repositoryId: number,
        public readonly name: string,
        public readonly owner: GithubOwner,
        public readonly fullName: string
    ) {}

    static TerseAI = {
        Terse: new Repos(829471023, "terse", GithubOwner.TerseAI, "terse-ai/terse"),
        Docs: new Repos(829471108, "docs", GithubOwner.TerseAI, "terse-ai/docs")
    } as const
}

export class AttioObject<TSlug extends string = string, TRecordValues extends Record<string, unknown> = Record<string, unknown>, TInputValues extends Record<string, unknown> = TRecordValues> {
    constructor(
        public readonly apiSlug: TSlug,
        public readonly name: string,
        public readonly objectId: string,
        public readonly attributes: readonly AttioAttributeDefinition[] = []
    ) {}

    declare readonly __recordValues: TRecordValues
    declare readonly __inputValues: TInputValues

    static Deal = new AttioObject<"deals", { name?: string; stage?: string; amount?: number }, { name?: string; stage?: string; amount?: number }>("deals", "deal", "obj_f1e3c0b2…", [
        /* attributes */
    ])
    static Company = new AttioObject<"companies", { name?: string; domains?: string[] }, { name?: string; domains?: string[] }>("companies", "company", "obj_8d22a17c…", [
        /* attributes */
    ])
}

Trigger builders and skills

Triggers and skills are exposed under two umbrella namespaces, with each integration as a nested key. Parameters take resource constants, not strings.
src/terse.generated.ts
export const Triggers = {
    slack: {
        /** Trigger on any message in a channel */
        onMessage(opts: { channel: SlackChannel; userIds?: string[] }): TypedTrigger<SlackMessageTrigger> {
            /* … */
        },
        /** Trigger when the Slack app is directly mentioned */
        onAppMention(opts: { channel: SlackChannel }): TypedTrigger<SlackAppMentionTrigger> {
            /* … */
        }
    },
    github: {
        /** Trigger when a pull request is opened */
        onPROpened(opts: { repo: Repos }): TypedTrigger<GithubPROpenedTrigger> {
            /* … */
        },
        /** Trigger when a pull request is merged */
        onPRMerged(opts: { repo: Repos }): TypedTrigger<GithubPRMergedTrigger> {
            /* … */
        },
        /** Trigger when a comment is created on an issue or pull request */
        onIssueComment(opts: { repo: Repos }): TypedTrigger<GithubIssueCommentCreatedTrigger> {
            /* … */
        }
    },
    attio: {
        /** Trigger when a record is created. Pass `object` to scope to a specific Attio object. */
        onRecordCreated<T extends GeneratedAttioObject>(opts?: { object: T }): TypedTrigger<AttioRecordCreatedTrigger> {
            /* … */
        }
    },
    schedule: {
        /** Run on a cron schedule */
        cron(opts: { expression: string }): TypedTrigger<CronTrigger> {
            /* … */
        }
    }
}

export const Skills = {
    /** Slack — send messages and manage threads in a specific channel */
    slack(opts: { channel: SlackChannel }): TypedSkill<"slack_list_channels" | "slack_list_users" | "slack_read_conversation" | "slack_send_message"> {
        /* … */
    },
    /** GitHub — read code and pull requests from the given repositories */
    github(opts: {
        repos: Repos[]
    }): TypedSkill<"grepGitHubCode" | "listGitHubCommits" | "listGitHubDirectory" | "listGitHubPullRequests" | "readGitHubFile" | "searchGitHubCode" | "summarizeGitHubPullRequestDiff"> {
        /* … */
    },
    /** Attio — query and upsert records on a CRM object */
    attio(opts: { object: AttioObject<any> }): TypedSkill<"attio_list_objects" | "attio_query_records" | "attio_upsert_record"> {
        /* … */
    }
}

Deterministic tool wrappers

Every connected integration also generates typed wrappers on agent.tools.*, with the exact parameter and return types of each tool. Use them when you know what to do and don’t want to burn tokens letting a model decide. agent.tools.* is gated at runtime by the agent’s skills: only integrations declared in skills are populated on agent.tools (the others are undefined). The TypeScript surface includes every connected integration, so the safety net here is “you’ll get a clear runtime error if you reach for a skill you didn’t declare.” The same file also exports toolbox: identical typed namespaces, but callable without a TerseAgent and not filtered by skills. Prefer toolbox for workflows that are purely deterministic.
src/terse.generated.ts
export type GeneratedTools = {
    slack: {
        /** Send to a channel, existing DM (`channelId`), or member DM (`slackUserId`). */
        sendMessage(params: SlackSendMessageParams): Promise<ToolOutputByName["slack_send_message"]>
        /** Read message history from a Slack channel or DM */
        readConversation(params: SlackReadConversationParams): Promise<ToolOutputByName["slack_read_conversation"]>
    }
    attio: {
        /** Query records on an Attio object */
        queryRecords<T extends GeneratedAttioObject>(params: AttioQueryRecordsParams<T>): Promise<AttioQueryRecordsResult<T>>
        /** Upsert records on an Attio object */
        upsertRecord<T extends GeneratedAttioObject>(params: AttioUpsertRecordParams<T>): Promise<AttioUpsertRecordResult<T>>
    }
    github: {
        /** Search code by semantic meaning */
        searchCode(params: SearchGitHubCodeParams): Promise<ToolOutputByName["searchGitHubCode"]>
    }
}

declare module "terse-sdk" {
    interface TerseAgent {
        readonly tools: GeneratedTools
    }
}

What you write against it

Because every resource, trigger, skill, and tool is an export, your workflow code reads like a description of your business, not a scavenger hunt through admin UIs.
src/index.ts
import { generateText, createJob } from "terse-sdk"

import { Repos, Skills, SlackChannel, Triggers, toolbox } from "./terse.generated"

createJob({
    name: "pr-summary-to-slack",
    triggers: [Triggers.github.onPROpened({ repo: Repos.TerseAI.Terse })],
    onTrigger: async event => {
        const message = await toolbox.slack.sendMessage({
            channelId: SlackChannel.Engineering.channelId,
            message: `New PR from ${event.sender.login}: ${event.pull_request.title}`
        })

        await generateText({
            prompt: `Summarize this PR and reply in thread (ts: ${message.message_ts}). ${event.formatForAgentRunner()}`,
            skills: [Skills.github({ repos: [Repos.TerseAI.Terse] }), Skills.slack({ channel: SlackChannel.Engineering })]
        })
    }
})
No channel IDs. No repository numbers. No list UUIDs. The only strings you write are your own content.

Why humans love it

Before the generated SDK, shipping a workflow meant context switching between your editor, your CRM admin, your Slack workspace, and GitHub settings to collect IDs. After it, SlackChannel.DealDesk replaces "C08XYZ1234" and Repos.TerseAI.Terse replaces a repository ID you’d otherwise dig out of a URL. Your editor lists every connected channel, object, and repo inline; hover for the real name. When #deal-desk is renamed in Slack, the next terse generate rewrites the constant and your code keeps working against SlackChannel.DealDesk. PRs read like English: AttioObject.Deal, not "obj_f1e3c0b2…".

Why coding agents love it even more

The generated SDK is the difference between an agent that guesses and an agent that knows. This is where the compounding wins live:
  • Cursor, Claude Code, Windsurf, and Codex see every real channel, repo, and list as an exported symbol; they pick the one that exists instead of asking which channel to post to.
  • Agents are notoriously bad at preserving long opaque strings across tool calls. With resource constants, there’s nothing to copy.
  • If an agent invents SlackChannel.SalesTeam or Repos.TerseAI.Website, the TypeScript language server in your editor flags it immediately, and any tsc --noEmit step in your own CI catches it before push. A fabricated resource never lands.
  • agent.tools.slack.sendMessage requires message plus either channelId or slackUserId (or both; channelId wins). The signature is enforced, so an agent can’t accidentally pass channel_name or forget message.
  • Point your coding assistant at src/terse.generated.ts and it instantly has a complete map of the integrations, resources, and tools available in your workspace. No documentation gap.
The net effect: coding agents ship working workflows on the first try, without a human looping through “here’s the channel ID, here’s the list ID, here’s the repo name” every time.

How it stays in sync

terse generate is idempotent and safe to re-run. Typical triggers for regenerating:
1

You connect a new integration

Run terse integrate or connect from the Terse app, then terse generate to pick up new trigger builders, skills, and tool wrappers.
2

Workspace resources change

A new Slack channel, a new Attio list, a renamed repo. Re-run terse generate and commit the updated file.
Because the file is committed to your repo, git history gives you a full audit trail of how your workspace has changed over time.

Where to go next

Context as Code

The philosophy behind compiling your workspace into typed code.

Skills & integrations

How the generated skills and triggers fit into a workflow.

Deterministic tool calls

Use toolbox or agent.tools.* to call integrations directly, no LLM in the loop.

TypeScript SDK reference

Full reference for the runtime types the generated file imports from.