//#region src/templates.d.ts /** * The starter templates shipped in the repo's top-level `think-starters/` * directory. The first entry is the default used when `--template` is omitted. */ declare const THINK_TEMPLATES: readonly [ { readonly name: "basic"; readonly description: "Minimal Think chat agent with a small React chat UI."; }, { readonly name: "personal-assistant"; readonly description: "Assistant with persistent memory (configureSession) and scheduled tasks."; }, { readonly name: "coding-agent"; readonly description: "Coding agent with workspace file tools and a coding skill."; }, { readonly name: "customer-support"; readonly description: "Support agent with custom tools and an escalation skill."; }, { readonly name: "webhook-agent"; readonly description: "Agent fed by inbound webhooks via durable, idempotent submissions."; }, { readonly name: "business-workflow"; readonly description: "Operations agent with human-in-the-loop approval gates and a scheduled digest."; } ]; type ThinkTemplateName = (typeof THINK_TEMPLATES)[number]["name"]; declare const DEFAULT_TEMPLATE: ThinkTemplateName; /** The GitHub repo path that hosts the starter templates for remote fetches. */ declare const THINK_TEMPLATES_REPO = "cloudflare/agents/think-starters"; /** Default git ref used when fetching a remote template. */ declare const DEFAULT_TEMPLATE_REF = "main"; interface TemplateFetchRequest { template: string; ref: string; dest: string; } type TemplateFetcher = (request: TemplateFetchRequest) => Promise; declare function isKnownTemplate(name: string): name is ThinkTemplateName; declare function resolveTemplateName(name: string | undefined): string; declare function formatTemplateList(): string; //#endregion //#region src/init.d.ts interface InitCommandOptions { root?: string; directory?: string; name?: string; /** Starter template to scaffold. Prompts interactively when omitted. */ template?: string; /** Git ref passed to the remote template fetcher. Defaults to `main`. */ ref?: string; yes?: boolean; install?: boolean; dryRun?: boolean; /** Local templates directory override (used in-repo and by tests). */ templatesDir?: string; /** * Fetches a template from a remote source. Defaults to a degit (tiged) fetch * from the agents repo; injectable for tests. */ fetchTemplate?: TemplateFetcher; promptTemplate?: (defaultTemplate: string) => Promise; promptTargetDirectory?: (defaultDirectory: string) => Promise; installRunner?: (root: string) => Promise; gitRunner?: (root: string) => Promise; /** Injectable git work-tree check (used in tests). */ isInsideGitRepo?: (root: string) => Promise; } declare function initCommand(options: InitCommandOptions): Promise; declare function looksLikeThinkApp(root: string): Promise; //#endregion //#region src/cli-utils.d.ts type GitInitOutcome = "initialized" | "existing" | "failed"; interface InitializeGitOptions { /** Injectable for tests; defaults to spawning `git init`. */ gitRunner?: (root: string) => Promise; /** Injectable for tests; defaults to `git rev-parse --is-inside-work-tree`. */ isInsideGitRepo?: (root: string) => Promise; } /** * Initialize a git repository, but never on top of an existing one. Skipping * when already inside a work tree avoids the misleading "Reinitialized existing * Git repository" reinit and, more importantly, avoids creating a nested repo * when scaffolding into a subfolder of an existing project. A missing or broken * git binary is non-fatal: we warn and continue. */ declare function initializeGit( root: string, options?: InitializeGitOptions ): Promise; /** Human-readable line describing what `initializeGit` did. */ declare function gitOutcomeMessage(outcome: GitInitOutcome): string; declare function runNpmInstall(root: string): Promise; declare function packageName(name: string): string; declare function fileExists(file: string): Promise; declare function readTextIfExists(file: string): Promise; //#endregion export { DEFAULT_TEMPLATE, DEFAULT_TEMPLATE_REF, type GitInitOutcome, type InitCommandOptions, THINK_TEMPLATES, THINK_TEMPLATES_REPO, type TemplateFetchRequest, type TemplateFetcher, type ThinkTemplateName, fileExists, formatTemplateList, gitOutcomeMessage, initCommand, initializeGit, isKnownTemplate, looksLikeThinkApp, packageName, readTextIfExists, resolveTemplateName, runNpmInstall }; //# sourceMappingURL=lib.d.ts.map