From 45199d8af5abdf7a5ea4f7e552ca955aa058e4d3 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 24 Jul 2026 10:13:41 -0600 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20draft=20JSDoc=20for=20978=20undocum?= =?UTF-8?q?ented=20exports=20(47%=E2=86=9295%)=20via=20agent-docs=20sugges?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fills the public-API JSDoc gap so the generated agent-readable docs (llms.txt, API pages) carry real summaries. Drafted by @tangle-network/agent-docs suggest — a cheap model (gpt-4.1-mini via the Tangle router) writes a one-line summary from each undocumented export's signature + source, inserted above the declaration. Then the deterministic doc pass (scripts/gen-codemap.mjs) picks them up, so the committed docs stay type-derived. - 978 JSDoc comments across 168 source files; documented coverage 47%→95% (3146/3318 exports). - Additive comments only — `pnpm typecheck` stays green; behavior unchanged. - docs/ regenerated so the codemap staleness gate passes. These are model-drafted summaries for human review — accurate on spot-check (e.g. AuthorizeResult → "Resolve authorization status and context for a chat turn…"), and improvable in place; NO raw model text enters the gated output. --- docs/api/app-auth.md | 10 +- docs/api/assets.md | 82 +- docs/api/assistant.md | 40 +- docs/api/billing.md | 16 +- docs/api/brand-extraction.md | 6 +- docs/api/brand.md | 4 +- docs/api/catalog.md | 4 +- docs/api/chat-routes.md | 110 +- docs/api/chat-store.md | 54 +- docs/api/config.md | 2 +- docs/api/design-canvas-drizzle.md | 16 +- docs/api/design-canvas-react-engine.md | 98 +- docs/api/design-canvas-react-lazy.md | 2 +- docs/api/design-canvas-react.md | 108 +- docs/api/design-canvas.md | 150 +-- docs/api/durable-chat.md | 90 +- docs/api/harness.md | 10 +- docs/api/index.md | 1066 ++++++++--------- docs/api/intakes-api.md | 2 +- docs/api/intakes-drizzle.md | 16 +- docs/api/intakes-react-lazy.md | 4 +- docs/api/intakes-react.md | 2 +- docs/api/intakes.md | 2 +- docs/api/integrations.md | 8 +- docs/api/interactions.md | 56 +- docs/api/knowledge-loop.md | 6 +- docs/api/knowledge.md | 4 +- docs/api/missions.md | 50 +- docs/api/model-resolution.md | 20 +- docs/api/plans.md | 12 +- docs/api/platform.md | 70 +- docs/api/preflight.md | 6 +- docs/api/preset-cloudflare.md | 6 +- docs/api/redact.md | 10 +- docs/api/run.md | 6 +- docs/api/runtime.md | 56 +- docs/api/sandbox.md | 186 +-- docs/api/sequences-drizzle.md | 20 +- docs/api/sequences-react.md | 60 +- docs/api/sequences.md | 150 +-- docs/api/store.md | 10 +- docs/api/stream.md | 56 +- docs/api/studio-react.md | 6 +- docs/api/studio.md | 74 +- docs/api/tangle.md | 6 +- docs/api/teams-drizzle.md | 46 +- docs/api/teams-invitations-api.md | 12 +- docs/api/teams-members-api.md | 4 +- docs/api/teams-react-lazy.md | 12 +- docs/api/teams-react.md | 10 +- docs/api/teams-resend.md | 2 +- docs/api/teams.md | 48 +- docs/api/theme-contract.md | 6 +- docs/api/theme-tailwind-preset.md | 2 +- docs/api/theme.md | 4 +- docs/api/tools.md | 50 +- docs/api/trace.md | 12 +- docs/api/turn-stream.md | 52 +- docs/api/vault-lazy.md | 4 +- docs/api/vault.md | 2 +- docs/api/web-react-terminal.md | 10 +- docs/api/web-react.md | 156 +-- docs/api/web.md | 8 +- src/app-auth/index.ts | 5 + src/assets/schema.ts | 7 + src/assets/types.ts | 34 + src/assistant/client.ts | 4 + src/assistant/types.ts | 10 + src/assistant/useAssistantChat.ts | 3 + src/assistant/useAssistantModels.ts | 1 + src/assistant/useAssistantThreads.ts | 2 + src/billing/index.ts | 8 + src/brand-extraction/map.ts | 2 + src/brand-extraction/types.ts | 1 + src/brand/index.tsx | 2 + src/chat-routes/attachment-upload.ts | 2 + src/chat-routes/attachment-validation.ts | 1 + src/chat-routes/detached-turn.ts | 2 + src/chat-routes/dispatch-parts.ts | 4 + src/chat-routes/durable-projection.ts | 2 + src/chat-routes/file-index.ts | 5 + src/chat-routes/promote-file-part.ts | 4 + src/chat-routes/resolve-attachments.ts | 2 + src/chat-routes/sandbox-producer.ts | 2 + src/chat-routes/stale-turn-lock.ts | 2 + src/chat-routes/turn-routes.ts | 9 + src/chat-routes/upload.ts | 4 + src/chat-routes/wire.ts | 15 + src/chat-store/parts.ts | 13 + src/chat-store/schema.ts | 6 + src/chat-store/store.ts | 8 + .../components/layer-tree.ts | 1 + .../components/ruler-math.ts | 2 + .../components/transform-math.ts | 1 + src/design-canvas-react/contracts.ts | 11 + .../engine/command-stack.ts | 1 + src/design-canvas-react/engine/commands.ts | 30 + src/design-canvas-react/engine/selection.ts | 2 + src/design-canvas-react/engine/snap.ts | 1 + src/design-canvas-react/engine/zoom-pan.ts | 2 + src/design-canvas-react/export-math.ts | 1 + src/design-canvas-react/export.ts | 1 + src/design-canvas/apply.ts | 3 + src/design-canvas/drizzle-store.ts | 2 + src/design-canvas/export-presets.ts | 9 + src/design-canvas/mcp-entry.ts | 2 + src/design-canvas/mcp-handler.ts | 3 + src/design-canvas/mcp-tools.ts | 5 + src/design-canvas/model.ts | 24 + src/design-canvas/operations.ts | 18 + src/design-canvas/schema.ts | 6 + src/design-canvas/store.ts | 6 + src/design-canvas/templates.ts | 3 + src/design-canvas/validate.ts | 2 + src/durable-chat/adapters.ts | 4 + src/durable-chat/errors.ts | 4 + src/durable-chat/interactions.ts | 4 + src/durable-chat/memory.ts | 1 + src/durable-chat/plan-routes.ts | 5 + src/durable-chat/types.ts | 27 + src/harness/index.ts | 5 + src/intakes-react/contracts.ts | 1 + src/intakes-react/lazy.tsx | 1 + src/intakes/api.ts | 1 + src/intakes/drizzle/schema.ts | 5 + src/intakes/drizzle/store.ts | 3 + src/intakes/model.ts | 1 + src/integrations/index.ts | 4 + src/interactions/contract.ts | 17 + src/interactions/route.ts | 9 + src/interactions/sidecar.ts | 2 + src/knowledge-loop/index.ts | 3 + src/knowledge/index.ts | 2 + src/missions/engine.ts | 9 + src/missions/events.ts | 3 + src/missions/plan-parse.ts | 3 + src/missions/service.ts | 10 + src/model-resolution/index.ts | 10 + src/plans/index.ts | 6 + src/platform/billing.ts | 13 + src/platform/guards.ts | 7 + src/platform/hub.ts | 9 + src/platform/sso.ts | 6 + src/preflight/index.ts | 3 + src/preset-cloudflare/index.ts | 3 + src/redact/index.ts | 5 + src/run/index.ts | 3 + src/runtime/agent.ts | 3 + src/runtime/certified-delivery.ts | 2 + src/runtime/model-catalog.ts | 2 + src/runtime/model.ts | 19 + src/runtime/openai-stream.ts | 1 + src/runtime/surface-profile.ts | 1 + src/sandbox/binary-read.ts | 3 + src/sandbox/index.ts | 60 + src/sandbox/outcome.ts | 1 + src/sandbox/terminal-proxy-token.ts | 3 + src/sandbox/workspace-terminal.ts | 26 + src/sequences-react/contracts.ts | 6 + src/sequences-react/engine/command-stack.ts | 1 + src/sequences-react/engine/commands.ts | 10 + src/sequences-react/engine/playback.ts | 2 + src/sequences-react/engine/snap.ts | 1 + src/sequences-react/engine/zoom.ts | 2 + src/sequences-react/media/frame-provider.ts | 5 + src/sequences-react/media/transcription.ts | 3 + src/sequences/apply.ts | 1 + src/sequences/captions.ts | 2 + src/sequences/drizzle-store.ts | 2 + src/sequences/exports.ts | 12 + src/sequences/mcp-entry.ts | 2 + src/sequences/mcp-handler.ts | 3 + src/sequences/mcp-tools.ts | 6 + src/sequences/model.ts | 16 + src/sequences/operations.ts | 14 + src/sequences/schema.ts | 8 + src/sequences/store.ts | 5 + src/sequences/validate.ts | 14 + src/store/index.ts | 5 + src/stream/stream-normalizer.ts | 16 + src/stream/turn-buffer.ts | 6 + src/stream/turn-identity.ts | 6 + src/studio-react/type-config.ts | 3 + src/studio/generation.ts | 37 + src/tangle/index.ts | 3 + src/teams-react/contracts.ts | 5 + src/teams-react/lazy.tsx | 3 + src/teams/drizzle/access.ts | 9 + src/teams/drizzle/invitations-schema.ts | 4 + src/teams/drizzle/personal-organization.ts | 4 + src/teams/drizzle/schema.ts | 6 + src/teams/invitations-api.ts | 6 + src/teams/invitations.ts | 10 + src/teams/invite.ts | 2 + src/teams/members-api.ts | 2 + src/teams/resend.ts | 1 + src/teams/roles.ts | 12 + src/theme-contract/index.ts | 3 + src/theme/tailwind-preset.ts | 1 + src/theme/theme.ts | 2 + src/tools/auth.ts | 3 + src/tools/capability.ts | 2 + src/tools/dispatch.ts | 1 + src/tools/gating.ts | 2 + src/tools/http.ts | 1 + src/tools/mcp-rpc.ts | 3 + src/tools/mcp.ts | 2 + src/tools/openai.ts | 2 + src/tools/runtime.ts | 1 + src/tools/types.ts | 8 + src/trace/flow-types.ts | 1 + src/trace/index.ts | 3 + src/trace/mission-flow.ts | 1 + src/trace/mission-trace.ts | 1 + src/turn-stream/adapters.ts | 9 + src/turn-stream/core.ts | 13 + src/turn-stream/do.ts | 2 + src/turn-stream/memory.ts | 2 + src/vault/contracts.ts | 1 + src/vault/lazy.tsx | 1 + src/web-react/chat-stream.ts | 5 + src/web-react/durable-interaction-submit.ts | 5 + src/web-react/durable-plan-flow.ts | 9 + src/web-react/index.tsx | 7 + src/web-react/interaction-card-support.ts | 6 + src/web-react/sandbox-terminal.ts | 5 + src/web-react/smooth-text.ts | 1 + src/web-react/use-chat-interactions.ts | 5 + src/web-react/use-composer-attachments.ts | 2 + src/web-react/use-file-mentions.ts | 3 + src/web/index.ts | 4 + 231 files changed, 2584 insertions(+), 1606 deletions(-) diff --git a/docs/api/app-auth.md b/docs/api/app-auth.md index 619360a..649110a 100644 --- a/docs/api/app-auth.md +++ b/docs/api/app-auth.md @@ -8,7 +8,7 @@ Source: `src/app-auth/index.ts` ### `AppAuth` -`interface` +`interface` — Define authentication guard with session retrieval and optional SSO handlers for app requests ```ts interface AppAuth @@ -16,7 +16,7 @@ interface AppAuth ### `AppAuthConfig` -`interface` +`interface` — Define configuration settings for app authentication including app name, base URL, secrets, and trusted origins ```ts interface AppAuthConfig @@ -32,7 +32,7 @@ interface AppAuthEmailClient ### `AppAuthEmailConfig` -`interface` +`interface` — Define email configuration for app authentication including client, sender, verification, and warning options ```ts interface AppAuthEmailConfig @@ -48,7 +48,7 @@ type AppAuthInstance ### `AppAuthSchema` -`interface` +`interface` — Define the structure for application authentication data including users, sessions, accounts, and verifications ```ts interface AppAuthSchema @@ -64,7 +64,7 @@ interface AppAuthSession ### `AppAuthSocialConfig` -`interface` +`interface` — Define social authentication configuration options for GitHub and Google providers ```ts interface AppAuthSocialConfig diff --git a/docs/api/assets.md b/docs/api/assets.md index 1d59f11..df96a14 100644 --- a/docs/api/assets.md +++ b/docs/api/assets.md @@ -8,7 +8,7 @@ Source: `src/assets/index.ts` ### `ApprovalEvent` -`interface` +`interface` — Describe an approval event with action details, user info, and optional edited fields ```ts interface ApprovalEvent @@ -16,7 +16,7 @@ interface ApprovalEvent ### `ApprovalEventSchema` -`const` +`const` — Validate approval event data including asset, action, user, timestamp, and optional fields ```ts ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEnum<{ scheduled: "scheduled"; approved:… @@ -24,7 +24,7 @@ ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEn ### `AssetContentMap` -`type` +`type` — Map asset keys to their corresponding content types for various media and copy formats ```ts type AssetContentMap @@ -32,7 +32,7 @@ type AssetContentMap ### `AssetFormat` -`type` +`type` — Define valid asset format strings for various media and copy types ```ts type AssetFormat @@ -40,7 +40,7 @@ type AssetFormat ### `AssetSpec` -`interface` +`interface` — Define the structure and metadata for an asset including its format, brand, content, and status ```ts interface AssetSpec @@ -48,7 +48,7 @@ interface AssetSpec ### `AssetStatus` -`type` +`type` — Define possible states representing the lifecycle status of an asset ```ts type AssetStatus @@ -56,7 +56,7 @@ type AssetStatus ### `AssetVariant` -`interface` +`interface` — Describe an asset variant with identification, approval status, and edit history details ```ts interface AssetVariant @@ -64,7 +64,7 @@ interface AssetVariant ### `BrandTokens` -`interface` +`interface` — Define brand identity tokens including colors, font, logo, business name, and voice ```ts interface BrandTokens @@ -72,7 +72,7 @@ interface BrandTokens ### `BrandTokensSchema` -`const` +`const` — Validate brand token properties including colors, font, logo URL, business name, and voice ```ts ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodString; fontFamily: ZodString; logoUrl: ZodO… @@ -80,7 +80,7 @@ ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodStrin ### `ConversionMetrics` -`interface` +`interface` — Define metrics for tracking impressions, clicks, conversions, and related rates ```ts interface ConversionMetrics @@ -88,7 +88,7 @@ interface ConversionMetrics ### `ConversionMetricsSchema` -`const` +`const` — Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields ```ts ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; ctr: ZodNumber; cvr: ZodNumber; }, $stri… @@ -96,7 +96,7 @@ ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; c ### `CopyContent` -`interface` +`interface` — Define the structure for content with headline, body, platform, and optional hashtags and character count ```ts interface CopyContent @@ -104,7 +104,7 @@ interface CopyContent ### `CopyContentSchema` -`const` +`const` — Validate and parse copy content with headline, body, optional hashtags, platform, and character count ```ts ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional>; platform: ZodEnum<{ x: "x… @@ -112,7 +112,7 @@ ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional; sections: ZodArray; sections: Zod ### `EmailCtaSection` -`interface` +`interface` — Define a call-to-action section with label, URL, and optional subtext for email content ```ts interface EmailCtaSection @@ -152,7 +152,7 @@ interface EmailCtaSection ### `EmailDividerSection` -`interface` +`interface` — Define a section representing a divider in an email layout ```ts interface EmailDividerSection @@ -160,7 +160,7 @@ interface EmailDividerSection ### `EmailFeatureSection` -`interface` +`interface` — Define a feature section with headline, description, and optional image for email content ```ts interface EmailFeatureSection @@ -168,7 +168,7 @@ interface EmailFeatureSection ### `EmailHeroSection` -`interface` +`interface` — Define the structure for a hero section in an email with headline, image, and call-to-action fields ```ts interface EmailHeroSection @@ -176,7 +176,7 @@ interface EmailHeroSection ### `EmailSection` -`type` +`type` — Define a union type representing different sections of an email template ```ts type EmailSection @@ -184,7 +184,7 @@ type EmailSection ### `EmailTestimonialSection` -`interface` +`interface` — Define the structure for an email testimonial section with quote, author, and optional details ```ts interface EmailTestimonialSection @@ -192,7 +192,7 @@ interface EmailTestimonialSection ### `ImageBackground` -`type` +`type` — Define image background styles as color, gradient, or image with optional overlay settings ```ts type ImageBackground @@ -200,7 +200,7 @@ type ImageBackground ### `ImageContent` -`interface` +`interface` — Define the structure for image content containing an array of image slides ```ts interface ImageContent @@ -208,7 +208,7 @@ interface ImageContent ### `ImageContentSchema` -`const` +`const` — Validate image content with an array of one or more slides containing background details ```ts ZodObject<{ slides: ZodArray; valu… @@ -216,7 +216,7 @@ ZodObject<{ slides: ZodArray AssistantChat @@ -432,7 +432,7 @@ interface UseAssistantChatOptions ### `useAssistantModels` -`function` +`function` — Resolve and return the current assistant models from the per-client cache with immediate client swap updates ```ts () => AssistantModels @@ -440,7 +440,7 @@ interface UseAssistantChatOptions ### `useAssistantThreads` -`function` +`function` — Resolve and manage assistant threads state for a given user including pending deletions and refresh logic ```ts (userId: string | null) => AssistantThreads diff --git a/docs/api/billing.md b/docs/api/billing.md index 929b3ab..9c9b6c9 100644 --- a/docs/api/billing.md +++ b/docs/api/billing.md @@ -8,7 +8,7 @@ Source: `src/billing/index.ts` ### `createPlatformBalanceManager` -`function` +`function` — Create a platform balance manager to handle user plan limits and state based on provided options ```ts (opts: PlatformBalanceManagerOptions) => PlatformBalanceManager @@ -24,7 +24,7 @@ Source: `src/billing/index.ts` ### `createWorkspaceKeyManager` -`function` +`function` — Create a workspace key manager that handles key provisioning and budget tracking ```ts (opts: WorkspaceKeyManagerOptions) => WorkspaceKeyManager @@ -64,7 +64,7 @@ interface PlatformBalanceInfo ### `PlatformBalanceManager` -`interface` +`interface` — Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking ```ts interface PlatformBalanceManager @@ -72,7 +72,7 @@ interface PlatformBalanceManager ### `PlatformBalanceManagerOptions` -`interface` +`interface` — Define configuration options for managing platform balance based on billing plans ```ts interface PlatformBalanceManagerOptions @@ -104,7 +104,7 @@ interface PlatformProductUsage ### `SharedBillingState` -`interface` +`interface` — Define shared billing state including user ID, plan, balances, concurrency, and overage permission ```ts interface SharedBillingState @@ -120,7 +120,7 @@ interface TcloudKeyClient ### `WorkspaceKeyManager` -`interface` +`interface` — Manage workspace keys by ensuring, rotating, and tracking usage of active child-key secrets ```ts interface WorkspaceKeyManager @@ -128,7 +128,7 @@ interface WorkspaceKeyManager ### `WorkspaceKeyManagerOptions` -`interface` +`interface` — Define configuration options for managing workspace keys including provisioning, storage, and cryptography ```ts interface WorkspaceKeyManagerOptions @@ -152,7 +152,7 @@ interface WorkspaceKeyStore ### `WorkspaceModelKeyUsage` -`interface` +`interface` — Describe usage and budget details for a workspace model key including expiration and exhaustion status ```ts interface WorkspaceModelKeyUsage diff --git a/docs/api/brand-extraction.md b/docs/api/brand-extraction.md index 634316c..7f131aa 100644 --- a/docs/api/brand-extraction.md +++ b/docs/api/brand-extraction.md @@ -72,7 +72,7 @@ interface DecidedBrandKit ### `DecidedFonts` -`interface` +`interface` — Define font selections for display and body text with optional BrandFont properties ```ts interface DecidedFonts @@ -80,7 +80,7 @@ interface DecidedFonts ### `DecidedPalette` -`interface` +`interface` — Define a color palette with background, surface, text, and accent colors for UI elements ```ts interface DecidedPalette @@ -112,7 +112,7 @@ interface DecidedPalette ### `ExtractBrandKitOptions` -`interface` +`interface` — Define options for extracting brand kit data including HTML input, fetch method, timeout, and list limits ```ts interface ExtractBrandKitOptions diff --git a/docs/api/brand.md b/docs/api/brand.md index 2ad3e57..5766c01 100644 --- a/docs/api/brand.md +++ b/docs/api/brand.md @@ -16,7 +16,7 @@ Source: `src/brand/index.tsx` ### `BrandHeaderProps` -`interface` +`interface` — Define properties for a brand header including optional title, children, and CSS class name ```ts interface BrandHeaderProps @@ -32,7 +32,7 @@ interface BrandHeaderProps ### `LogoProps` -`interface` +`interface` — Define properties to customize the logo variant, size, style, and icon display options ```ts interface LogoProps diff --git a/docs/api/catalog.md b/docs/api/catalog.md index 71ad5d4..04719ec 100644 --- a/docs/api/catalog.md +++ b/docs/api/catalog.md @@ -16,7 +16,7 @@ Source: `src/catalog/index.ts` ### `CatalogModel` -`interface` +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags ```ts interface CatalogModel @@ -32,7 +32,7 @@ interface CatalogModel ### `ModelCatalog` -`interface` +`interface` — Define a catalog containing models with a default ID and fetch timestamp ```ts interface ModelCatalog diff --git a/docs/api/chat-routes.md b/docs/api/chat-routes.md index 92db9ce..d7b4ccd 100644 --- a/docs/api/chat-routes.md +++ b/docs/api/chat-routes.md @@ -80,7 +80,7 @@ type AttachmentReadResult ### `AttachmentTypeCheckResult` -`type` +`type` — Represent the result of checking an attachment's type with success or specific failure details ```ts type AttachmentTypeCheckResult @@ -112,7 +112,7 @@ type AttachmentWriteResult ### `buildDispatchParts` -`function` +`function` — Build dispatch parts from input by resolving mentions, paths, and applying size constraints asynchronously ```ts (input: BuildDispatchPartsInput) => Promise @@ -120,7 +120,7 @@ type AttachmentWriteResult ### `BuildDispatchPartsInput` -`interface` +`interface` — Build input parameters for dispatching chat message parts including text, attachments, mentions, and history ```ts interface BuildDispatchPartsInput @@ -136,7 +136,7 @@ interface BuildDispatchPartsInput ### `bytesToBase64` -`function` +`function` — Convert a Uint8Array of bytes into a base64-encoded string ```ts (bytes: Uint8Array) => string @@ -168,7 +168,7 @@ type ChatMentionKind ### `ChatRouteDurableProjection` -`interface` +`interface` — Resolve chat route events and materialize their durable state records ```ts interface ChatRouteDurableProjection @@ -176,7 +176,7 @@ interface ChatRouteDurableProjection ### `ChatRouteDurableProjectionLogger` -`type` +`type` — Log chat route projection messages with optional metadata for durable processing ```ts type ChatRouteDurableProjectionLogger @@ -184,7 +184,7 @@ type ChatRouteDurableProjectionLogger ### `ChatTurnAuthorization` -`type` +`type` — Resolve authorization status and context for a chat turn including tenant and user identification ```ts type ChatTurnAuthorization @@ -192,7 +192,7 @@ type ChatTurnAuthorization ### `ChatTurnAuthorizeArgs` -`interface` +`interface` — Define arguments required to authorize a chat turn based on intent and request details ```ts interface ChatTurnAuthorizeArgs @@ -224,7 +224,7 @@ interface ChatTurnHeartbeat ### `ChatTurnInputError` -`class` +`class` — Represent errors for invalid chat turn inputs with status and code properties ```ts class ChatTurnInputError @@ -248,7 +248,7 @@ interface ChatTurnLifecycle ### `ChatTurnLifecycleComplete` -`interface` +`interface` — Define the structure representing the completion state of a chat turn lifecycle with usage data ```ts interface ChatTurnLifecycleComplete @@ -256,7 +256,7 @@ interface ChatTurnLifecycleComplete ### `ChatTurnLifecycleError` -`interface` +`interface` — Represent an error occurring during a chat turn lifecycle with context and duration information ```ts interface ChatTurnLifecycleError @@ -264,7 +264,7 @@ interface ChatTurnLifecycleError ### `ChatTurnLifecycleStart` -`interface` +`interface` — Define lifecycle start event with context and timestamp for a chat turn ```ts interface ChatTurnLifecycleStart @@ -296,7 +296,7 @@ interface ChatTurnMessageStore ### `ChatTurnPartInput` -`type` +`type` — Resolve input as either a text part or a file part of a chat turn ```ts type ChatTurnPartInput @@ -304,7 +304,7 @@ type ChatTurnPartInput ### `ChatTurnProduceArgs` -`interface` +`interface` — Define the arguments required to produce a chat turn with context and messaging details ```ts interface ChatTurnProduceArgs @@ -336,7 +336,7 @@ interface ChatTurnRouteProducer ### `ChatTurnRoutes` -`interface` +`interface` — Define routes to run, replay, and list running chat turns with streaming and reconnect support ```ts interface ChatTurnRoutes @@ -368,7 +368,7 @@ interface ChatTurnUsage ### `createAttachmentUploadRoute` -`function` +`function` — Resolve an attachment upload route handler with customizable limits and validation options ```ts (options: CreateAttachmentUploadRouteOptions) => (request: Request) => Promise @@ -376,7 +376,7 @@ interface ChatTurnUsage ### `CreateAttachmentUploadRouteOptions` -`interface` +`interface` — Define options to authorize, write, and limit attachment uploads in a route ```ts interface CreateAttachmentUploadRouteOptions @@ -384,7 +384,7 @@ interface CreateAttachmentUploadRouteOptions ### `createChatTurnRoutes` -`function` +`function` — Build chat turn routes to handle and validate incoming chat requests with optional logging ```ts (options: CreateChatTurnRoutesOptions) => ChatTurnRoutes @@ -392,7 +392,7 @@ interface CreateAttachmentUploadRouteOptions ### `CreateChatTurnRoutesOptions` -`interface` +`interface` — Define options to configure chat turn routes including authorization, storage, and event buffering ```ts interface CreateChatTurnRoutesOptions @@ -400,7 +400,7 @@ interface CreateChatTurnRoutesOptions ### `createSandboxChatProducer` -`function` +`function` — Create a sandbox chat producer that manages chat turn routing with logging and interaction rendering options ```ts (options: SandboxChatProducerOptions) => ChatTurnRouteProducer @@ -408,7 +408,7 @@ interface CreateChatTurnRoutesOptions ### `createSandboxFileIndexRoute` -`function` +`function` — Resolve a sandbox file index route with authorization, caching, and configurable depth and entries limits ```ts (options: CreateSandboxFileIndexRouteOptions) => (request: Request) => Promise @@ -416,7 +416,7 @@ interface CreateChatTurnRoutesOptions ### `CreateSandboxFileIndexRouteOptions` -`interface` +`interface` — Define options to authorize and configure sandbox file index route behavior ```ts interface CreateSandboxFileIndexRouteOptions @@ -424,7 +424,7 @@ interface CreateSandboxFileIndexRouteOptions ### `createUploadRoute` -`function` +`function` — Create an upload route handler that authorizes requests and processes file uploads with size limits ```ts (options: CreateUploadRouteOptions) => (request: Request) => Promise @@ -432,7 +432,7 @@ interface CreateSandboxFileIndexRouteOptions ### `CreateUploadRouteOptions` -`interface` +`interface` — Define options to authorize uploads and configure file size limits and upload directory ```ts interface CreateUploadRouteOptions @@ -472,7 +472,7 @@ interface DetachedTurnFinal ### `DetachedTurnOptions` -`interface` +`interface` — Define options for managing and projecting a detached turn event stream in a session ```ts interface DetachedTurnOptions @@ -488,7 +488,7 @@ type DetachedTurnParts ### `DetachedTurnResult` -`interface` +`interface` — Describe the result of a detached turn including state, text, parts, usage, and optional error or cache flag ```ts interface DetachedTurnResult @@ -528,7 +528,7 @@ number ### `DispatchPartsOutcome` -`type` +`type` — Resolve the outcome of dispatching parts with success status and corresponding value or error message ```ts type DispatchPartsOutcome @@ -536,7 +536,7 @@ type DispatchPartsOutcome ### `FileIndexAuthorization` -`type` +`type` — Define authorization details and parameters for indexing a file workspace with optional caching and ignore rules ```ts type FileIndexAuthorization @@ -552,7 +552,7 @@ interface FileIndexCache ### `FileIndexReadyResponse` -`interface` +`interface` — Describe a ready file index response with workspace-relative entries and truncation status ```ts interface FileIndexReadyResponse @@ -560,7 +560,7 @@ interface FileIndexReadyResponse ### `FileIndexResponse` -`type` +`type` — Resolve a response indicating the file index is either ready or warming up ```ts type FileIndexResponse @@ -592,7 +592,7 @@ interface FileMention ### `FileMentionsToPartsOptions` -`interface` +`interface` — Define options to resolve mention paths when converting file mentions to parts ```ts interface FileMentionsToPartsOptions @@ -616,7 +616,7 @@ type FilePartPromotionOutcome ### `INLINE_PARTS_MAX_BYTES` -`const` +`const` — Define the maximum byte size allowed for inline parts in data processing ```ts 950000 @@ -688,7 +688,7 @@ number ### `ProducerErrorEvent` -`interface` +`interface` — Represent an error event emitted by a producer containing message, code, and optional details ```ts interface ProducerErrorEvent @@ -696,7 +696,7 @@ interface ProducerErrorEvent ### `ProducerNoticeEvent` -`interface` +`interface` — Define the structure for a producer notice event with type, id, kind, and text fields ```ts interface ProducerNoticeEvent @@ -704,7 +704,7 @@ interface ProducerNoticeEvent ### `ProducerPassthroughEvent` -`interface` +`interface` — Define an event carrying passthrough data with flexible properties for producer communication ```ts interface ProducerPassthroughEvent @@ -720,7 +720,7 @@ type ProducerPassthroughEventType ### `ProducerReasoningEvent` -`interface` +`interface` — Define an event representing reasoning output with a fixed type and associated text ```ts interface ProducerReasoningEvent @@ -728,7 +728,7 @@ interface ProducerReasoningEvent ### `ProducerTextEvent` -`interface` +`interface` — Represent a text event produced by a source with a fixed type and associated text content ```ts interface ProducerTextEvent @@ -736,7 +736,7 @@ interface ProducerTextEvent ### `ProducerToolCallEvent` -`interface` +`interface` — Represent an event triggered by a producer tool call with its identifier, name, and arguments ```ts interface ProducerToolCallEvent @@ -744,7 +744,7 @@ interface ProducerToolCallEvent ### `ProducerToolResultEvent` -`interface` +`interface` — Describe the structure of an event representing the result of a producer tool call ```ts interface ProducerToolResultEvent @@ -752,7 +752,7 @@ interface ProducerToolResultEvent ### `ProducerUsageEvent` -`interface` +`interface` — Describe usage event with prompt and completion token counts for a producer ```ts interface ProducerUsageEvent @@ -760,7 +760,7 @@ interface ProducerUsageEvent ### `ProducerWireEvent` -`type` +`type` — Represent events emitted by a producer during its operation for processing and handling ```ts type ProducerWireEvent @@ -776,7 +776,7 @@ number ### `promoteAgentFilePart` -`function` +`function` — Promote a part of an agent file with optional byte limits and MIME type detection ```ts (options: PromoteAgentFilePartOptions) => Promise @@ -784,7 +784,7 @@ number ### `PromoteAgentFilePartOptions` -`interface` +`interface` — Define options for promoting a part of an agent file within a specific session and scope ```ts interface PromoteAgentFilePartOptions @@ -792,7 +792,7 @@ interface PromoteAgentFilePartOptions ### `PromoteFilePartResult` -`type` +`type` — Resolve the result of promoting a file part with success status and relevant data or error details ```ts type PromoteFilePartResult @@ -800,7 +800,7 @@ type PromoteFilePartResult ### `PromptInputPart` -`type` +`type` — Extract a single element type from the array parameter of SandboxInstance's streamPrompt method ```ts type PromptInputPart @@ -808,7 +808,7 @@ type PromptInputPart ### `promptPartsByteSize` -`function` +`function` — Calculate the total byte size of an array of chat turn parts ```ts (parts: ChatTurnPartInput[]) => number @@ -816,7 +816,7 @@ type PromptInputPart ### `RawAgentFilePart` -`interface` +`interface` — Define the structure for a raw file part with optional metadata and media type information ```ts interface RawAgentFilePart @@ -832,7 +832,7 @@ type ReadAttachmentFn ### `ReadSandboxMentionFn` -`type` +`type` — Resolve sandbox mention details by reading from a specified path with optional byte reading ```ts type ReadSandboxMentionFn @@ -848,7 +848,7 @@ type ReadSandboxMentionFn ### `ReconcileStaleTurnLockOptions` -`interface` +`interface` — Resolve options for probing and releasing stale TURN locks based on lock start time and sandbox state ```ts interface ReconcileStaleTurnLockOptions @@ -856,7 +856,7 @@ interface ReconcileStaleTurnLockOptions ### `ReconcileStaleTurnLockResult` -`interface` +`interface` — Describe the outcome of reconciling a stale turn lock including release status and diagnostics ```ts interface ReconcileStaleTurnLockResult @@ -872,7 +872,7 @@ interface ReconcileStaleTurnLockResult ### `ResolveChatAttachmentsOptions` -`interface` +`interface` — Define options to resolve and validate chat attachments with size, count, and path constraints ```ts interface ResolveChatAttachmentsOptions @@ -880,7 +880,7 @@ interface ResolveChatAttachmentsOptions ### `ResolveChatAttachmentsResult` -`type` +`type` — Resolve the result of chat attachment processing with success status and corresponding data or error ```ts type ResolveChatAttachmentsResult @@ -896,7 +896,7 @@ type ResolveChatAttachmentsResult ### `SandboxChatProducerOptions` -`interface` +`interface` — Define options for producing sandbox chat events with rendering and interaction controls ```ts interface SandboxChatProducerOptions @@ -912,7 +912,7 @@ interface SandboxFileTreeSource ### `SandboxMentionPathCheck` -`type` +`type` — Represent the result of a sandbox mention path check indicating success or failure with an error message ```ts type SandboxMentionPathCheck @@ -1016,7 +1016,7 @@ number ### `UploadAuthorization` -`type` +`type` — Resolve upload authorization status and provide upload destination or error response ```ts type UploadAuthorization diff --git a/docs/api/chat-store.md b/docs/api/chat-store.md index 79cdb9e..6e5abc1 100644 --- a/docs/api/chat-store.md +++ b/docs/api/chat-store.md @@ -8,7 +8,7 @@ Source: `src/chat-store/index.ts` ### `AppendMessageInput` -`interface` +`interface` — Define input parameters for appending a message to a chat thread with optional metadata ```ts interface AppendMessageInput @@ -64,7 +64,7 @@ interface AppendMessageInput ### `BulkDeleteThreadsInput` -`interface` +`interface` — Define input for bulk deleting threads with access checks per workspace ```ts interface BulkDeleteThreadsInput @@ -104,7 +104,7 @@ interface ChatFilePart ### `ChatImagePart` -`interface` +`interface` — Define properties for an image part within a chat message including optional metadata fields ```ts interface ChatImagePart @@ -136,7 +136,7 @@ interface ChatMentionPart ### `ChatMessagePart` -`type` +`type` — Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions ```ts type ChatMessagePart @@ -144,7 +144,7 @@ type ChatMessagePart ### `ChatMessageRow` -`type` +`type` — Resolve the selected structure of a chat message row from the messages table ```ts type ChatMessageRow @@ -176,7 +176,7 @@ interface ChatPartTime ### `ChatPlanPart` -`type` +`type` — Resolve a chat plan part by aliasing it to the persisted chat plan part type ```ts type ChatPlanPart @@ -184,7 +184,7 @@ type ChatPlanPart ### `ChatReasoningPart` -`interface` +`interface` — Define a reasoning part of a chat with text content and optional metadata fields ```ts interface ChatReasoningPart @@ -192,7 +192,7 @@ interface ChatReasoningPart ### `ChatStepFinishPart` -`interface` +`interface` — Define a chat step finish part indicating completion with optional reason, tokens, and cost ```ts interface ChatStepFinishPart @@ -208,7 +208,7 @@ interface ChatStepStartPart ### `ChatStore` -`interface` +`interface` — Manage chat threads and messages with operations for listing, creating, updating, and deleting data ```ts interface ChatStore @@ -224,7 +224,7 @@ class ChatStoreInputError ### `ChatSubtaskPart` -`interface` +`interface` — Define a subtask part of a chat with prompt, description, agent, and optional identifier ```ts interface ChatSubtaskPart @@ -248,7 +248,7 @@ interface ChatTextPart ### `ChatThreadRow` -`type` +`type` — Resolve the selected fields of a chat thread row from the chat threads table ```ts type ChatThreadRow @@ -256,7 +256,7 @@ type ChatThreadRow ### `ChatToolPart` -`interface` +`interface` — Define a chat component representing a tool with its state and optional call identifier ```ts interface ChatToolPart @@ -264,7 +264,7 @@ interface ChatToolPart ### `ChatToolState` -`interface` +`interface` — Describe the current state and data of a chat tool including status, input, output, and metadata ```ts interface ChatToolState @@ -288,7 +288,7 @@ interface ChatUsageTokens ### `createChatStore` -`function` +`function` — Create a chat store managing threads and messages based on the provided database and tables ```ts (db: ChatDatabase, tables: TTables) => ChatStore = {}, TMessageExtras extends Record part is ChatInteractionPart @@ -360,7 +360,7 @@ interface CreateThreadInput ### `isChatPlanPart` -`function` +`function` — Resolve whether a chat message part is a persisted chat plan part ```ts (part: ChatMessagePart) => part is ChatPlanPersistedPart @@ -368,7 +368,7 @@ interface CreateThreadInput ### `isChatStepFinishPart` -`function` +`function` — Determine if a chat message part represents the completion of a chat step ```ts (part: ChatMessagePart) => part is ChatStepFinishPart @@ -376,7 +376,7 @@ interface CreateThreadInput ### `isChatTextPart` -`function` +`function` — Resolve whether a chat message part is a text part based on its type property ```ts (part: ChatMessagePart) => part is ChatTextPart @@ -384,7 +384,7 @@ interface CreateThreadInput ### `isChatToolPart` -`function` +`function` — Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property ```ts (part: ChatMessagePart) => part is ChatToolPart @@ -392,7 +392,7 @@ interface CreateThreadInput ### `ListMessagesOptions` -`interface` +`interface` — Define options to configure message listing with optional limit and offset parameters ```ts interface ListMessagesOptions @@ -400,7 +400,7 @@ interface ListMessagesOptions ### `ListThreadsInput` -`interface` +`interface` — Define input parameters for listing threads within a workspace with pagination options ```ts interface ListThreadsInput @@ -408,7 +408,7 @@ interface ListThreadsInput ### `ListThreadsResult` -`interface` +`interface` — Represent a paginated collection of chat threads with total count and pagination details ```ts interface ListThreadsResult @@ -432,7 +432,7 @@ interface ListThreadsResult ### `NewChatMessageRow` -`type` +`type` — Resolve the type for inserting a new chat message row into the messages table ```ts type NewChatMessageRow @@ -440,7 +440,7 @@ type NewChatMessageRow ### `NewChatThreadRow` -`type` +`type` — Resolve the type for inserting a new chat thread row into the threads table ```ts type NewChatThreadRow diff --git a/docs/api/config.md b/docs/api/config.md index ee5634d..a67d00e 100644 --- a/docs/api/config.md +++ b/docs/api/config.md @@ -80,7 +80,7 @@ interface KnowledgeLoopConfig ### `KnowledgeRequirementSpec` -`interface` +`interface` — Define the criteria and conditions required to satisfy a specific knowledge requirement ```ts interface KnowledgeRequirementSpec diff --git a/docs/api/design-canvas-drizzle.md b/docs/api/design-canvas-drizzle.md index b0b83ab..0831b51 100644 --- a/docs/api/design-canvas-drizzle.md +++ b/docs/api/design-canvas-drizzle.md @@ -8,7 +8,7 @@ Source: `src/design-canvas/drizzle.ts` ### `createDesignCanvasTables` -`function` +`function` — Build SQLite tables for design documents with workspace and user references ```ts (opts: CreateDesignCanvasTablesOptions) => { designDocuments: SQLiteTableWithColumns<{ name: "design_document"; schema:… @@ -16,7 +16,7 @@ Source: `src/design-canvas/drizzle.ts` ### `CreateDesignCanvasTablesOptions` -`interface` +`interface` — Define options for creating design canvas tables including workspace and user table configurations ```ts interface CreateDesignCanvasTablesOptions @@ -24,7 +24,7 @@ interface CreateDesignCanvasTablesOptions ### `createDrizzleSceneStore` -`function` +`function` — Create a scene store configured with database tables and scoped to a specific document and workspace ```ts (options: CreateDrizzleSceneStoreOptions) => SceneStore @@ -32,7 +32,7 @@ interface CreateDesignCanvasTablesOptions ### `CreateDrizzleSceneStoreOptions` -`interface` +`interface` — Define options for creating a Drizzle scene store including database, tables, and scope ```ts interface CreateDrizzleSceneStoreOptions @@ -56,7 +56,7 @@ type DesignCanvasParentTable ### `DesignCanvasTables` -`type` +`type` — Resolve the structure and data of design canvas tables for rendering and manipulation ```ts type DesignCanvasTables @@ -64,7 +64,7 @@ type DesignCanvasTables ### `DesignDecisionRow` -`type` +`type` — Resolve a design decision row from the design decisions table selection ```ts type DesignDecisionRow @@ -72,7 +72,7 @@ type DesignDecisionRow ### `DesignDocumentRow` -`type` +`type` — Resolve the selected structure of a design document row from design canvas tables ```ts type DesignDocumentRow @@ -80,7 +80,7 @@ type DesignDocumentRow ### `DesignExportRow` -`type` +`type` — Resolve the selected fields of designExports from DesignCanvasTables ```ts type DesignExportRow diff --git a/docs/api/design-canvas-react-engine.md b/docs/api/design-canvas-react-engine.md index 27efb6d..3b46a70 100644 --- a/docs/api/design-canvas-react-engine.md +++ b/docs/api/design-canvas-react-engine.md @@ -8,7 +8,7 @@ Source: `src/design-canvas-react/engine.ts` ### `addElementCommand` -`function` +`function` — Create a command to add an element to a scene with optional positioning and grouping ```ts (input: AddElementInput) => SceneCommand @@ -16,7 +16,7 @@ Source: `src/design-canvas-react/engine.ts` ### `AddElementInput` -`interface` +`interface` — Define input parameters for adding a scene element with optional index and parent group ID ```ts interface AddElementInput @@ -24,7 +24,7 @@ interface AddElementInput ### `addPageCommand` -`function` +`function` — Create a command to add a page with optional settings and index in the scene ```ts (input: AddPageInput) => SceneCommand @@ -32,7 +32,7 @@ interface AddElementInput ### `AddPageInput` -`interface` +`interface` — Define input parameters for adding a new page with optional settings and position index ```ts interface AddPageInput @@ -40,7 +40,7 @@ interface AddPageInput ### `ApplySceneResult` -`interface` +`interface` — Resolve the result of applying a scene update including revision and optional normalized document ```ts interface ApplySceneResult @@ -48,7 +48,7 @@ interface ApplySceneResult ### `bindSlotCommand` -`function` +`function` — Bind a slot to an element within a page and generate the corresponding scene command ```ts (input: BindSlotInput) => SceneCommand @@ -56,7 +56,7 @@ interface ApplySceneResult ### `BindSlotInput` -`interface` +`interface` — Define input parameters for binding a slot within a scene document element ```ts interface BindSlotInput @@ -96,7 +96,7 @@ interface BindSlotInput ### `createSceneCommandStack` -`function` +`function` — Create a command stack for scene editing with reapply capabilities based on the given document and page ID ```ts (document: SceneDocument, activePageId: string) => SceneCommandStackWithReapply @@ -104,7 +104,7 @@ interface BindSlotInput ### `createSnapEngine` -`function` +`function` — Build a SnapEngine instance to manage snapping targets and behavior within an editor scene ```ts () => SnapEngine @@ -112,7 +112,7 @@ interface BindSlotInput ### `createZoomPanMath` -`function` +`function` — Create zoom and pan math utilities enforcing valid zoom range constraints ```ts (config: ZoomPanConfig) => ZoomPanMath @@ -128,7 +128,7 @@ readonly InsertTemplate[] ### `deleteElementCommand` -`function` +`function` — Resolve a command to delete an element from a specified page in the document ```ts (input: DeleteElementInput) => SceneCommand @@ -136,7 +136,7 @@ readonly InsertTemplate[] ### `DeleteElementInput` -`interface` +`interface` — Define input parameters required to delete an element from a specific page in a document ```ts interface DeleteElementInput @@ -144,7 +144,7 @@ interface DeleteElementInput ### `deletePageCommand` -`function` +`function` — Delete a page from a document ensuring it is not the last remaining page ```ts (input: DeletePageInput) => SceneCommand @@ -152,7 +152,7 @@ interface DeleteElementInput ### `DeletePageInput` -`interface` +`interface` — Define input parameters required to delete a page from a scene document ```ts interface DeletePageInput @@ -168,7 +168,7 @@ type DesignCanvasMode ### `DesignCanvasProps` -`interface` +`interface` — Define properties and callbacks for configuring and controlling the design canvas editor ```ts interface DesignCanvasProps @@ -192,7 +192,7 @@ NudgeDelta ### `duplicatePageCommand` -`function` +`function` — Create a command to duplicate a page and prepare its deletion operation in the scene ```ts (input: DuplicatePageInput) => SceneCommand @@ -200,7 +200,7 @@ NudgeDelta ### `DuplicatePageInput` -`interface` +`interface` — Define input parameters required to duplicate a page within a scene document ```ts interface DuplicatePageInput @@ -208,7 +208,7 @@ interface DuplicatePageInput ### `EditorSceneState` -`interface` +`interface` — Define the state of the editor scene including document, view settings, and selection details ```ts interface EditorSceneState @@ -216,7 +216,7 @@ interface EditorSceneState ### `ExportCropRect` -`interface` +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds ```ts interface ExportCropRect @@ -256,7 +256,7 @@ interface ExportViewSnapshot ### `groupElementsCommand` -`function` +`function` — Create a command to group multiple elements into a single group within a scene ```ts (input: GroupElementsInput) => SceneCommand @@ -264,7 +264,7 @@ interface ExportViewSnapshot ### `GroupElementsInput` -`interface` +`interface` — Define input parameters for grouping elements within a scene document on a specific page ```ts interface GroupElementsInput @@ -328,7 +328,7 @@ interface InsertTemplate ### `MarqueeSelectOptions` -`interface` +`interface` — Define options to configure marquee selection behavior including containment requirements ```ts interface MarqueeSelectOptions @@ -352,7 +352,7 @@ interface MarqueeSelectOptions ### `multiSetAttrsCommand` -`function` +`function` — Build a scene command to set multiple attributes on elements across pages ```ts (entries: MultiSetAttrsEntry[]) => SceneCommand @@ -360,7 +360,7 @@ interface MarqueeSelectOptions ### `MultiSetAttrsEntry` -`interface` +`interface` — Define an entry linking page and element IDs with current and prior scene attribute patches ```ts interface MultiSetAttrsEntry @@ -376,7 +376,7 @@ interface MultiSetAttrsEntry ### `NudgeDelta` -`interface` +`interface` — Represent horizontal and vertical displacement values for nudging elements ```ts interface NudgeDelta @@ -384,7 +384,7 @@ interface NudgeDelta ### `reorderElementCommand` -`function` +`function` — Resolve a command to reorder an element within a scene by moving it to a specified index ```ts (input: ReorderElementInput) => SceneCommand @@ -392,7 +392,7 @@ interface NudgeDelta ### `ReorderElementInput` -`interface` +`interface` — Define input parameters to reorder an element within a page ```ts interface ReorderElementInput @@ -400,7 +400,7 @@ interface ReorderElementInput ### `reorderPageCommand` -`function` +`function` — Create a command to reorder a page to a specified index within a scene ```ts (input: ReorderPageInput) => SceneCommand @@ -408,7 +408,7 @@ interface ReorderElementInput ### `ReorderPageInput` -`interface` +`interface` — Define input parameters to reorder a page by specifying its ID and target index ```ts interface ReorderPageInput @@ -416,7 +416,7 @@ interface ReorderPageInput ### `ResolvedExportParams` -`interface` +`interface` — Define parameters required to resolve export settings including crop, pixel ratio, type, and quality ```ts interface ResolvedExportParams @@ -448,7 +448,7 @@ interface ResolvedExportParams ### `SceneCommand` -`interface` +`interface` — Define a command with execution, undo, and operation methods for scene editing and persistence ```ts interface SceneCommand @@ -456,7 +456,7 @@ interface SceneCommand ### `SceneCommandStack` -`interface` +`interface` — Manage and track scene commands with undo, redo, and state subscription capabilities ```ts interface SceneCommandStack @@ -472,7 +472,7 @@ interface SceneCommandStackWithReapply ### `setAttrsCommand` -`function` +`function` — Create a command to set attributes on a scene element with undo capability ```ts (input: SetAttrsInput) => SceneCommand @@ -480,7 +480,7 @@ interface SceneCommandStackWithReapply ### `SetAttrsInput` -`interface` +`interface` — Define input parameters for setting element attributes within a specific page context ```ts interface SetAttrsInput @@ -488,7 +488,7 @@ interface SetAttrsInput ### `setDocumentTitleCommand` -`function` +`function` — Resolve a command to rename a document title with undo and redo operations ```ts (input: SetDocumentTitleInput) => SceneCommand @@ -496,7 +496,7 @@ interface SetAttrsInput ### `SetDocumentTitleInput` -`interface` +`interface` — Define input parameters for setting the title of a scene document ```ts interface SetDocumentTitleInput @@ -504,7 +504,7 @@ interface SetDocumentTitleInput ### `setPageGuidesCommand` -`function` +`function` — Create a command to update page guides with undo support ```ts (input: SetPageGuidesInput) => SceneCommand @@ -512,7 +512,7 @@ interface SetDocumentTitleInput ### `SetPageGuidesInput` -`interface` +`interface` — Define input parameters for setting guides on a specific page within a document ```ts interface SetPageGuidesInput @@ -520,7 +520,7 @@ interface SetPageGuidesInput ### `setPagePropsCommand` -`function` +`function` — Build a command to update page properties based on the provided input ```ts (input: SetPagePropsInput) => SceneCommand @@ -528,7 +528,7 @@ interface SetPageGuidesInput ### `SetPagePropsInput` -`interface` +`interface` — Define input parameters for setting properties on a specific page within a scene document ```ts interface SetPagePropsInput @@ -536,7 +536,7 @@ interface SetPagePropsInput ### `SnapEngine` -`interface` +`interface` — Resolve snapping targets and apply snapping logic to moving elements within the editor scene ```ts interface SnapEngine @@ -544,7 +544,7 @@ interface SnapEngine ### `SnapResult` -`interface` +`interface` — Define the result of a snap operation including coordinates and active snap lines ```ts interface SnapResult @@ -552,7 +552,7 @@ interface SnapResult ### `SnapTarget` -`interface` +`interface` — Define a target position and kind for snapping elements on a page ```ts interface SnapTarget @@ -560,7 +560,7 @@ interface SnapTarget ### `SnapTargetKind` -`type` +`type` — Define snap target categories for aligning elements within a layout system ```ts type SnapTargetKind @@ -568,7 +568,7 @@ type SnapTargetKind ### `SnapTargets` -`interface` +`interface` — Define vertical and horizontal collections of snap targets for alignment purposes ```ts interface SnapTargets @@ -576,7 +576,7 @@ interface SnapTargets ### `ungroupElementCommand` -`function` +`function` — Resolve a command to ungroup a group element into its child elements within a scene ```ts (input: UngroupElementInput) => SceneCommand @@ -584,7 +584,7 @@ interface SnapTargets ### `UngroupElementInput` -`interface` +`interface` — Define input parameters required to ungroup elements within a specific page and group ```ts interface UngroupElementInput @@ -592,7 +592,7 @@ interface UngroupElementInput ### `ZoomPanConfig` -`interface` +`interface` — Define configuration options for minimum and maximum zoom levels in a zoom-pan interface ```ts interface ZoomPanConfig @@ -600,7 +600,7 @@ interface ZoomPanConfig ### `ZoomPanMath` -`interface` +`interface` — Define methods and properties to calculate zoom and pan transformations between document and screen coordinates ```ts interface ZoomPanMath diff --git a/docs/api/design-canvas-react-lazy.md b/docs/api/design-canvas-react-lazy.md index 0afbefd..94d90ec 100644 --- a/docs/api/design-canvas-react-lazy.md +++ b/docs/api/design-canvas-react-lazy.md @@ -32,7 +32,7 @@ LazyExoticComponent<(props: DesignCanvasProps) => Element> ### `DesignCanvasProps` -`interface` +`interface` — Define properties and callbacks for configuring and controlling the design canvas editor ```ts interface DesignCanvasProps diff --git a/docs/api/design-canvas-react.md b/docs/api/design-canvas-react.md index 3e47d11..4fb759c 100644 --- a/docs/api/design-canvas-react.md +++ b/docs/api/design-canvas-react.md @@ -8,7 +8,7 @@ Source: `src/design-canvas-react/index.ts` ### `addElementCommand` -`function` +`function` — Create a command to add an element to a scene with optional positioning and grouping ```ts (input: AddElementInput) => SceneCommand @@ -16,7 +16,7 @@ Source: `src/design-canvas-react/index.ts` ### `AddElementInput` -`interface` +`interface` — Define input parameters for adding a scene element with optional index and parent group ID ```ts interface AddElementInput @@ -24,7 +24,7 @@ interface AddElementInput ### `addPageCommand` -`function` +`function` — Create a command to add a page with optional settings and index in the scene ```ts (input: AddPageInput) => SceneCommand @@ -32,7 +32,7 @@ interface AddElementInput ### `AddPageInput` -`interface` +`interface` — Define input parameters for adding a new page with optional settings and position index ```ts interface AddPageInput @@ -40,7 +40,7 @@ interface AddPageInput ### `ApplySceneResult` -`interface` +`interface` — Resolve the result of applying a scene update including revision and optional normalized document ```ts interface ApplySceneResult @@ -48,7 +48,7 @@ interface ApplySceneResult ### `BakedNodeAttrs` -`interface` +`interface` — Define baked node attributes including position, size, and rotation with collapsed scale ```ts interface BakedNodeAttrs @@ -80,7 +80,7 @@ interface BakedNodeAttrs ### `bindSlotCommand` -`function` +`function` — Bind a slot to an element within a page and generate the corresponding scene command ```ts (input: BindSlotInput) => SceneCommand @@ -88,7 +88,7 @@ interface BakedNodeAttrs ### `BindSlotInput` -`interface` +`interface` — Define input parameters for binding a slot within a scene document element ```ts interface BindSlotInput @@ -200,7 +200,7 @@ interface CanvasInsertPanelProps ### `createSceneCommandStack` -`function` +`function` — Create a command stack for scene editing with reapply capabilities based on the given document and page ID ```ts (document: SceneDocument, activePageId: string) => SceneCommandStackWithReapply @@ -208,7 +208,7 @@ interface CanvasInsertPanelProps ### `createSnapEngine` -`function` +`function` — Build a SnapEngine instance to manage snapping targets and behavior within an editor scene ```ts () => SnapEngine @@ -216,7 +216,7 @@ interface CanvasInsertPanelProps ### `createZoomPanMath` -`function` +`function` — Create zoom and pan math utilities enforcing valid zoom range constraints ```ts (config: ZoomPanConfig) => ZoomPanMath @@ -232,7 +232,7 @@ readonly InsertTemplate[] ### `deleteElementCommand` -`function` +`function` — Resolve a command to delete an element from a specified page in the document ```ts (input: DeleteElementInput) => SceneCommand @@ -240,7 +240,7 @@ readonly InsertTemplate[] ### `DeleteElementInput` -`interface` +`interface` — Define input parameters required to delete an element from a specific page in a document ```ts interface DeleteElementInput @@ -248,7 +248,7 @@ interface DeleteElementInput ### `deletePageCommand` -`function` +`function` — Delete a page from a document ensuring it is not the last remaining page ```ts (input: DeletePageInput) => SceneCommand @@ -256,7 +256,7 @@ interface DeleteElementInput ### `DeletePageInput` -`interface` +`interface` — Define input parameters required to delete a page from a scene document ```ts interface DeletePageInput @@ -312,7 +312,7 @@ type DesignCanvasMode ### `DesignCanvasProps` -`interface` +`interface` — Define properties and callbacks for configuring and controlling the design canvas editor ```ts interface DesignCanvasProps @@ -344,7 +344,7 @@ NudgeDelta ### `duplicatePageCommand` -`function` +`function` — Create a command to duplicate a page and prepare its deletion operation in the scene ```ts (input: DuplicatePageInput) => SceneCommand @@ -352,7 +352,7 @@ NudgeDelta ### `DuplicatePageInput` -`interface` +`interface` — Define input parameters required to duplicate a page within a scene document ```ts interface DuplicatePageInput @@ -360,7 +360,7 @@ interface DuplicatePageInput ### `EditorSceneState` -`interface` +`interface` — Define the state of the editor scene including document, view settings, and selection details ```ts interface EditorSceneState @@ -400,7 +400,7 @@ interface ExportControlProps ### `ExportCropRect` -`interface` +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds ```ts interface ExportCropRect @@ -424,7 +424,7 @@ interface ExportCropRect ### `ExportPageDataUrlOptions` -`interface` +`interface` — Define options to export a page as a data URL with format, pixel ratio, bleed, and preset settings ```ts interface ExportPageDataUrlOptions @@ -496,7 +496,7 @@ interface GridLayerProps ### `groupElementsCommand` -`function` +`function` — Create a command to group multiple elements into a single group within a scene ```ts (input: GroupElementsInput) => SceneCommand @@ -504,7 +504,7 @@ interface GridLayerProps ### `GroupElementsInput` -`interface` +`interface` — Define input parameters for grouping elements within a scene document on a specific page ```ts interface GroupElementsInput @@ -584,7 +584,7 @@ interface InsertTemplate ### `LayerRow` -`interface` +`interface` — Describe a layer row with its element, depth, grouping, ownership, and parent group details ```ts interface LayerRow @@ -624,7 +624,7 @@ interface LayersPanelProps ### `MarqueeSelectOptions` -`interface` +`interface` — Define options to configure marquee selection behavior including containment requirements ```ts interface MarqueeSelectOptions @@ -648,7 +648,7 @@ interface MarqueeSelectOptions ### `multiSetAttrsCommand` -`function` +`function` — Build a scene command to set multiple attributes on elements across pages ```ts (entries: MultiSetAttrsEntry[]) => SceneCommand @@ -656,7 +656,7 @@ interface MarqueeSelectOptions ### `MultiSetAttrsEntry` -`interface` +`interface` — Define an entry linking page and element IDs with current and prior scene attribute patches ```ts interface MultiSetAttrsEntry @@ -672,7 +672,7 @@ interface MultiSetAttrsEntry ### `NudgeDelta` -`interface` +`interface` — Represent horizontal and vertical displacement values for nudging elements ```ts interface NudgeDelta @@ -696,7 +696,7 @@ interface PagesStripProps ### `reorderElementCommand` -`function` +`function` — Resolve a command to reorder an element within a scene by moving it to a specified index ```ts (input: ReorderElementInput) => SceneCommand @@ -704,7 +704,7 @@ interface PagesStripProps ### `ReorderElementInput` -`interface` +`interface` — Define input parameters to reorder an element within a page ```ts interface ReorderElementInput @@ -712,7 +712,7 @@ interface ReorderElementInput ### `reorderPageCommand` -`function` +`function` — Create a command to reorder a page to a specified index within a scene ```ts (input: ReorderPageInput) => SceneCommand @@ -720,7 +720,7 @@ interface ReorderElementInput ### `ReorderPageInput` -`interface` +`interface` — Define input parameters to reorder a page by specifying its ID and target index ```ts interface ReorderPageInput @@ -728,7 +728,7 @@ interface ReorderPageInput ### `ResolvedExportParams` -`interface` +`interface` — Define parameters required to resolve export settings including crop, pixel ratio, type, and quality ```ts interface ResolvedExportParams @@ -760,7 +760,7 @@ interface RulersProps ### `RulerTick` -`interface` +`interface` — Define a ruler tick with a position and optional label for measurement markings ```ts interface RulerTick @@ -784,7 +784,7 @@ interface RulerTick ### `SceneCommand` -`interface` +`interface` — Define a command with execution, undo, and operation methods for scene editing and persistence ```ts interface SceneCommand @@ -792,7 +792,7 @@ interface SceneCommand ### `SceneCommandStack` -`interface` +`interface` — Manage and track scene commands with undo, redo, and state subscription capabilities ```ts interface SceneCommandStack @@ -832,7 +832,7 @@ interface SelectionLayerProps ### `setAttrsCommand` -`function` +`function` — Create a command to set attributes on a scene element with undo capability ```ts (input: SetAttrsInput) => SceneCommand @@ -840,7 +840,7 @@ interface SelectionLayerProps ### `SetAttrsInput` -`interface` +`interface` — Define input parameters for setting element attributes within a specific page context ```ts interface SetAttrsInput @@ -848,7 +848,7 @@ interface SetAttrsInput ### `setDocumentTitleCommand` -`function` +`function` — Resolve a command to rename a document title with undo and redo operations ```ts (input: SetDocumentTitleInput) => SceneCommand @@ -856,7 +856,7 @@ interface SetAttrsInput ### `SetDocumentTitleInput` -`interface` +`interface` — Define input parameters for setting the title of a scene document ```ts interface SetDocumentTitleInput @@ -864,7 +864,7 @@ interface SetDocumentTitleInput ### `setPageGuidesCommand` -`function` +`function` — Create a command to update page guides with undo support ```ts (input: SetPageGuidesInput) => SceneCommand @@ -872,7 +872,7 @@ interface SetDocumentTitleInput ### `SetPageGuidesInput` -`interface` +`interface` — Define input parameters for setting guides on a specific page within a document ```ts interface SetPageGuidesInput @@ -880,7 +880,7 @@ interface SetPageGuidesInput ### `setPagePropsCommand` -`function` +`function` — Build a command to update page properties based on the provided input ```ts (input: SetPagePropsInput) => SceneCommand @@ -888,7 +888,7 @@ interface SetPageGuidesInput ### `SetPagePropsInput` -`interface` +`interface` — Define input parameters for setting properties on a specific page within a scene document ```ts interface SetPagePropsInput @@ -896,7 +896,7 @@ interface SetPagePropsInput ### `SnapEngine` -`interface` +`interface` — Resolve snapping targets and apply snapping logic to moving elements within the editor scene ```ts interface SnapEngine @@ -904,7 +904,7 @@ interface SnapEngine ### `SnapResult` -`interface` +`interface` — Define the result of a snap operation including coordinates and active snap lines ```ts interface SnapResult @@ -912,7 +912,7 @@ interface SnapResult ### `SnapTarget` -`interface` +`interface` — Define a target position and kind for snapping elements on a page ```ts interface SnapTarget @@ -920,7 +920,7 @@ interface SnapTarget ### `SnapTargetKind` -`type` +`type` — Define snap target categories for aligning elements within a layout system ```ts type SnapTargetKind @@ -928,7 +928,7 @@ type SnapTargetKind ### `SnapTargets` -`interface` +`interface` — Define vertical and horizontal collections of snap targets for alignment purposes ```ts interface SnapTargets @@ -936,7 +936,7 @@ interface SnapTargets ### `TickStep` -`interface` +`interface` — Define spacing and visibility rules for major and minor ticks in a coordinate system ```ts interface TickStep @@ -968,7 +968,7 @@ interface TransformerNode ### `ungroupElementCommand` -`function` +`function` — Resolve a command to ungroup a group element into its child elements within a scene ```ts (input: UngroupElementInput) => SceneCommand @@ -976,7 +976,7 @@ interface TransformerNode ### `UngroupElementInput` -`interface` +`interface` — Define input parameters required to ungroup elements within a specific page and group ```ts interface UngroupElementInput @@ -1024,7 +1024,7 @@ interface ZoomControlsProps ### `ZoomPanConfig` -`interface` +`interface` — Define configuration options for minimum and maximum zoom levels in a zoom-pan interface ```ts interface ZoomPanConfig @@ -1032,7 +1032,7 @@ interface ZoomPanConfig ### `ZoomPanMath` -`interface` +`interface` — Define methods and properties to calculate zoom and pan transformations between document and screen coordinates ```ts interface ZoomPanMath diff --git a/docs/api/design-canvas.md b/docs/api/design-canvas.md index ba6e097..22f2531 100644 --- a/docs/api/design-canvas.md +++ b/docs/api/design-canvas.md @@ -8,7 +8,7 @@ Source: `src/design-canvas/index.ts` ### `AddElementOperation` -`interface` +`interface` — Define an operation to add a scene element to a page with optional index and parent group ```ts interface AddElementOperation @@ -16,7 +16,7 @@ interface AddElementOperation ### `AddPageOperation` -`interface` +`interface` — Define an operation to add a new page with an optional position and caller-minted page ID ```ts interface AddPageOperation @@ -56,7 +56,7 @@ interface ApplyDataOperation ### `ApplySceneOptions` -`interface` +`interface` — Resolve element ID conflicts by providing fresh unique identifiers during scene application ```ts interface ApplySceneOptions @@ -64,7 +64,7 @@ interface ApplySceneOptions ### `assertColor` -`function` +`function` — Validate that a string is a hex, rgb(a), or 'transparent' color and throw an error if not ```ts (value: string, label: string) => void @@ -72,7 +72,7 @@ interface ApplySceneOptions ### `assertFinite` -`function` +`function` — Assert that a value is a finite number and throw an error with a label if not ```ts (value: number, label: string) => void @@ -80,7 +80,7 @@ interface ApplySceneOptions ### `assertPositiveFinite` -`function` +`function` — Assert that a value is a positive finite number and throw an error with a label if not ```ts (value: number, label: string) => void @@ -96,7 +96,7 @@ interface ApplySceneOptions ### `BindSlotOperation` -`interface` +`interface` — Define an operation to bind or unbind a unique slot to an element on a specific page ```ts interface BindSlotOperation @@ -120,7 +120,7 @@ interface BindSlotOperation ### `Bounds` -`interface` +`interface` — Define rectangular boundaries with position and size properties ```ts interface Bounds @@ -128,7 +128,7 @@ interface Bounds ### `boundsIntersect` -`function` +`function` — Determine if two rectangular bounds overlap or intersect each other ```ts (a: Bounds, b: Bounds) => boolean @@ -144,7 +144,7 @@ interface Bounds ### `BuildDesignCanvasMcpServerEntryOptions` -`type` +`type` — Build scoped MCP server entry options for the design canvas environment ```ts type BuildDesignCanvasMcpServerEntryOptions @@ -152,7 +152,7 @@ type BuildDesignCanvasMcpServerEntryOptions ### `CANVAS_ELEMENT_KINDS` -`const` +`const` — Provide a readonly array of string identifiers representing canvas element kinds ```ts readonly string[] @@ -160,7 +160,7 @@ readonly string[] ### `CANVAS_MCP_TOOL_NAMES` -`const` +`const` — Extract names of all tools from the CANVAS_MCP_TOOLS array ```ts string[] @@ -168,7 +168,7 @@ string[] ### `CANVAS_MCP_TOOLS` -`const` +`const` — Provide a collection of MCP tool definitions for manipulating and querying the design canvas environment ```ts McpToolDefinition[] @@ -184,7 +184,7 @@ readonly ChannelPreset[] ### `ChannelPreset` -`interface` +`interface` — Define a preset configuration for a channel including its id, label, width, and height ```ts interface ChannelPreset @@ -192,7 +192,7 @@ interface ChannelPreset ### `ChannelPresetId` -`type` +`type` — Resolve a valid channel preset identifier from the predefined channel presets array ```ts type ChannelPresetId @@ -200,7 +200,7 @@ type ChannelPresetId ### `ChannelScaleResult` -`interface` +`interface` — Define the pixel ratio and horizontal offset for scaling a Konva stage to a channel preset size ```ts interface ChannelScaleResult @@ -216,7 +216,7 @@ interface ChannelScaleResult ### `createDesignCanvasMcpHandler` -`function` +`function` — Create a request handler for the design canvas MCP tool with specified options ```ts (opts: CreateDesignCanvasMcpHandlerOptions) => (request: Request) => Promise @@ -224,7 +224,7 @@ interface ChannelScaleResult ### `CreateDesignCanvasMcpHandlerOptions` -`interface` +`interface` — Define options for creating a design canvas MCP handler including store, ID minting, and optional server info ```ts interface CreateDesignCanvasMcpHandlerOptions @@ -232,7 +232,7 @@ interface CreateDesignCanvasMcpHandlerOptions ### `createEmptyDocument` -`function` +`function` — Create a new empty SceneDocument with a title and optional initial page settings ```ts (title: string, page?: NewPageOptions | undefined) => SceneDocument @@ -240,7 +240,7 @@ interface CreateDesignCanvasMcpHandlerOptions ### `createPage` -`function` +`function` — Create a new ScenePage with specified options and a unique identifier ```ts (options: NewPageOptions, id: string) => ScenePage @@ -248,7 +248,7 @@ interface CreateDesignCanvasMcpHandlerOptions ### `DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION` -`const` +`const` — Describe the live visual asset editor capabilities for the current design document using CSS pixel coordinates ```ts "Live visual asset editor for the current design document: read scene state, add/move/resize/delete elements, manage pa… @@ -256,7 +256,7 @@ interface CreateDesignCanvasMcpHandlerOptions ### `DeleteElementOperation` -`interface` +`interface` — Resolve deletion of a specific element from a page by its identifiers ```ts interface DeleteElementOperation @@ -264,7 +264,7 @@ interface DeleteElementOperation ### `DeletePageOperation` -`interface` +`interface` — Represent a delete page operation with a specified page identifier ```ts interface DeletePageOperation @@ -272,7 +272,7 @@ interface DeletePageOperation ### `DesignCanvasMcpServerInfo` -`interface` +`interface` — Describe design canvas MCP server information including name and version ```ts interface DesignCanvasMcpServerInfo @@ -280,7 +280,7 @@ interface DesignCanvasMcpServerInfo ### `DesignCanvasMcpToolEnv` -`interface` +`interface` — Define the environment for MCP tool with a scene store and ID minting function ```ts interface DesignCanvasMcpToolEnv @@ -288,7 +288,7 @@ interface DesignCanvasMcpToolEnv ### `DuplicatePageOperation` -`interface` +`interface` — Define an operation to duplicate a page with a new caller-specified page ID ```ts interface DuplicatePageOperation @@ -312,7 +312,7 @@ interface DuplicatePageOperation ### `EllipseElement` -`interface` +`interface` — Define properties for an ellipse element including dimensions, fill, and optional stroke details ```ts interface EllipseElement @@ -320,7 +320,7 @@ interface EllipseElement ### `estimateTextHeight` -`function` +`function` — Estimate the height of multiline text based on font size and line height ```ts (element: Pick) => number @@ -328,7 +328,7 @@ interface EllipseElement ### `EXPORT_PRESETS` -`const` +`const` — Provide predefined export configurations for various social media and image formats ```ts Record @@ -336,7 +336,7 @@ Record ### `ExportCropRect` -`interface` +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds ```ts interface ExportCropRect @@ -344,7 +344,7 @@ interface ExportCropRect ### `ExportFormat` -`type` +`type` — Define supported image export formats as PNG or JPEG ```ts type ExportFormat @@ -360,7 +360,7 @@ interface ExportPreset ### `findCanvasMcpTool` -`function` +`function` — Find the canvas MCP tool definition matching the given name or return undefined ```ts (name: string) => McpToolDefinition | undefined @@ -376,7 +376,7 @@ interface ExportPreset ### `findPreset` -`function` +`function` — Resolve a size preset by its identifier or return null if not found ```ts (id: string) => SizePreset | null @@ -384,7 +384,7 @@ interface ExportPreset ### `GroupElement` -`interface` +`interface` — Define a group element that contains multiple child scene elements ```ts interface GroupElement @@ -392,7 +392,7 @@ interface GroupElement ### `GroupElementsOperation` -`interface` +`interface` — Group elements by grouping two or more sibling elements in their current z-order under a new group ID ```ts interface GroupElementsOperation @@ -400,7 +400,7 @@ interface GroupElementsOperation ### `ImageElement` -`interface` +`interface` — Define properties for an image element including source, dimensions, and fit mode ```ts interface ImageElement @@ -408,7 +408,7 @@ interface ImageElement ### `InstantiateOptions` -`interface` +`interface` — Define options for instantiating a document with title, optional bindings, and custom id minting ```ts interface InstantiateOptions @@ -424,7 +424,7 @@ interface InstantiateOptions ### `LineElement` -`interface` +`interface` — Define a line element with points, stroke, stroke width, and optional dash pattern ```ts interface LineElement @@ -448,7 +448,7 @@ interface LineElement ### `NewPageOptions` -`interface` +`interface` — Define options to configure a new page including name, dimensions, and background color ```ts interface NewPageOptions @@ -456,7 +456,7 @@ interface NewPageOptions ### `NewSceneDecision` -`interface` +`interface` — Define the structure for decisions related to creating a new scene with instructions and optional details ```ts interface NewSceneDecision @@ -480,7 +480,7 @@ interface PageGuides ### `RectElement` -`interface` +`interface` — Define a rectangular scene element with size, fill, optional stroke, and corner radius properties ```ts interface RectElement @@ -488,7 +488,7 @@ interface RectElement ### `ReorderElementOperation` -`interface` +`interface` — Resolve an operation to reorder an element within its current owner by specifying the target index ```ts interface ReorderElementOperation @@ -496,7 +496,7 @@ interface ReorderElementOperation ### `ReorderPageOperation` -`interface` +`interface` — Represent an operation to reorder a page by moving it to a specified index ```ts interface ReorderPageOperation @@ -512,7 +512,7 @@ interface ReorderPageOperation ### `requireElement` -`function` +`function` — Resolve and return the element, its owner array, and index from the page by element ID ```ts (page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; } @@ -520,7 +520,7 @@ interface ReorderPageOperation ### `requirePage` -`function` +`function` — Resolve and return a page by ID from a document or throw an error if not found ```ts (document: SceneDocument, pageId: string) => ScenePage @@ -544,7 +544,7 @@ interface ReorderPageOperation ### `SCENE_ELEMENT_KINDS` -`const` +`const` — Define all valid kinds of scene elements used in the application ```ts readonly ("text" | "image" | "rect" | "video" | "ellipse" | "line" | "group")[] @@ -552,7 +552,7 @@ readonly ("text" | "image" | "rect" | "video" | "ellipse" | "line" | "group")[] ### `SCENE_OPERATION_TYPES` -`const` +`const` — Define all valid operation types for scene manipulation in the application ```ts readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | "group_elements" | "ungroup_element" | "… @@ -560,7 +560,7 @@ readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | " ### `SCENE_SCHEMA_VERSION` -`const` +`const` — Define the current version number of the scene schema ```ts 1 @@ -568,7 +568,7 @@ readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | " ### `SceneApplyResult` -`type` +`type` — Represent the result of applying changes to a scene as an element, page, or entire document ```ts type SceneApplyResult @@ -584,7 +584,7 @@ type SceneAttrsPatch ### `SceneDecision` -`interface` +`interface` — Define the structure for decisions made within a scene including type, instructions, and metadata ```ts interface SceneDecision @@ -592,7 +592,7 @@ interface SceneDecision ### `SceneDocument` -`interface` +`interface` — Define the structure and properties of a scene document including version, title, pages, settings, and metadata ```ts interface SceneDocument @@ -600,7 +600,7 @@ interface SceneDocument ### `SceneDocumentRecord` -`interface` +`interface` — Represent a scene document with its current revision number for version tracking ```ts interface SceneDocumentRecord @@ -608,7 +608,7 @@ interface SceneDocumentRecord ### `SceneElement` -`type` +`type` — Represent a graphical element in a scene including shapes, text, media, or groups ```ts type SceneElement @@ -624,7 +624,7 @@ interface SceneElementBase ### `SceneElementKind` -`type` +`type` — Extract the kind property from a SceneElement to identify its element type ```ts type SceneElementKind @@ -632,7 +632,7 @@ type SceneElementKind ### `SceneExportFormat` -`type` +`type` — Define supported formats for exporting a scene including image and JSON options ```ts type SceneExportFormat @@ -640,7 +640,7 @@ type SceneExportFormat ### `SceneExportRecord` -`interface` +`interface` — Describe a scene export with its status, format, metadata, and result information ```ts interface SceneExportRecord @@ -648,7 +648,7 @@ interface SceneExportRecord ### `SceneOperation` -`type` +`type` — Represent operations that modify scenes by adding, updating, reordering, grouping, or deleting elements and pages ```ts type SceneOperation @@ -656,7 +656,7 @@ type SceneOperation ### `SceneOperationType` -`type` +`type` — Extract the type property from a SceneOperation to represent its operation type ```ts type SceneOperationType @@ -664,7 +664,7 @@ type SceneOperationType ### `ScenePage` -`interface` +`interface` — Define the structure and properties of a scene page including layout, background, and elements ```ts interface ScenePage @@ -672,7 +672,7 @@ interface ScenePage ### `ScenePlan` -`interface` +`interface` — Define a plan summarizing a scene with its description and associated operations ```ts interface ScenePlan @@ -680,7 +680,7 @@ interface ScenePlan ### `SceneSettings` -`interface` +`interface` — Define settings for scene export including print conversion factor for unit calculations ```ts interface SceneSettings @@ -688,7 +688,7 @@ interface SceneSettings ### `SceneStore` -`interface` +`interface` — Manage scene documents, decisions, and exports with atomic save and revision control ```ts interface SceneStore @@ -704,7 +704,7 @@ interface SceneStoreScope ### `SetAttrsOperation` -`interface` +`interface` — Define an operation to update attributes of a specific element on a page ```ts interface SetAttrsOperation @@ -712,7 +712,7 @@ interface SetAttrsOperation ### `SetDocumentTitleOperation` -`interface` +`interface` — Define an operation to set the document title to a specified string ```ts interface SetDocumentTitleOperation @@ -720,7 +720,7 @@ interface SetDocumentTitleOperation ### `SetPageGuidesOperation` -`interface` +`interface` — Resolve an operation to set guides on a specific page by its identifier ```ts interface SetPageGuidesOperation @@ -728,7 +728,7 @@ interface SetPageGuidesOperation ### `SetPagePropsOperation` -`interface` +`interface` — Define an operation to set or update properties of a page including size, background, and bleed ```ts interface SetPagePropsOperation @@ -736,7 +736,7 @@ interface SetPagePropsOperation ### `SIZE_PRESETS` -`const` +`const` — Provide predefined size presets for social, presentation, and print categories ```ts readonly SizePreset[] @@ -744,7 +744,7 @@ readonly SizePreset[] ### `SizePreset` -`interface` +`interface` — Define size presets with identifiers, labels, categories, and dimensions for various media types ```ts interface SizePreset @@ -752,7 +752,7 @@ interface SizePreset ### `SlotFillKind` -`type` +`type` — Define allowed string literals representing different slot fill kinds ```ts type SlotFillKind @@ -760,7 +760,7 @@ type SlotFillKind ### `storeApplyScenePlan` -`function` +`function` — Resolve and apply a scene plan to the store with specified actor context and generate results ```ts (store: SceneStore, plan: ScenePlan, opts: { actorKind: "human_edit" | "agent_edit" | "agent_proposal" | "export" | "no… @@ -768,7 +768,7 @@ type SlotFillKind ### `TemplateSlot` -`interface` +`interface` — Define a slot template specifying its name, page, element, and fill characteristics ```ts interface TemplateSlot @@ -776,7 +776,7 @@ interface TemplateSlot ### `TextElement` -`interface` +`interface` — Define properties for a text element including content, style, alignment, and layout parameters ```ts interface TextElement @@ -784,7 +784,7 @@ interface TextElement ### `UngroupElementOperation` -`interface` +`interface` — Resolve an operation to ungroup elements within a specified page and group context ```ts interface UngroupElementOperation @@ -800,7 +800,7 @@ interface UngroupElementOperation ### `validateSceneOperation` -`function` +`function` — Validate a scene operation against the document to ensure it meets required constraints ```ts (document: SceneDocument, operation: SceneOperation) => void @@ -808,7 +808,7 @@ interface UngroupElementOperation ### `validateSceneOperations` -`function` +`function` — Validate each scene operation against the document and throw detailed errors for invalid operations ```ts (document: SceneDocument, operations: SceneOperation[]) => void diff --git a/docs/api/durable-chat.md b/docs/api/durable-chat.md index c4b1e6f..add0129 100644 --- a/docs/api/durable-chat.md +++ b/docs/api/durable-chat.md @@ -8,7 +8,7 @@ Source: `src/durable-chat/index.ts` ### `applyDurableInteractionAnswer` -`function` +`function` — Resolve and record the outcome and answers of a durable interaction within the given store and scope ```ts (store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: "declined" | "accepted", answers?: R… @@ -16,7 +16,7 @@ Source: `src/durable-chat/index.ts` ### `applyDurableInteractionAsk` -`function` +`function` — Resolve and upsert a durable interaction ask in the store with optional event and timing parameters ```ts (store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde… @@ -24,7 +24,7 @@ Source: `src/durable-chat/index.ts` ### `applyDurableInteractionCancel` -`function` +`function` — Resolve cancellation of a durable interaction with optional reason and event details ```ts (store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… @@ -40,7 +40,7 @@ Source: `src/durable-chat/index.ts` ### `createDurableChatScope` -`function` +`function` — Create a durable chat scope from a non-empty string value ```ts (value: string) => DurableChatScope @@ -64,7 +64,7 @@ Source: `src/durable-chat/index.ts` ### `CreateDurableInteractionRoutePersistenceOptions` -`type` +`type` — Define options for durable interaction route persistence with reconciliation guarantees and authority functions ```ts type CreateDurableInteractionRoutePersistenceOptions @@ -80,7 +80,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `createDurablePlanRoutes` -`function` +`function` — Build durable plan routes with authorization and effect handling based on provided options ```ts (options: DurablePlanRouteOptions) => DurablePlanRoutes @@ -88,7 +88,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `createInMemoryDurableChatStateStore` -`function` +`function` — Create an in-memory durable chat state store for managing chat session data efficiently ```ts () => InMemoryDurableChatStateStore @@ -96,7 +96,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `DurableAnswerIntentJournal` -`type` +`type` — Provide durable methods to manage the lifecycle of answer intents in a plan store ```ts type DurableAnswerIntentJournal @@ -104,7 +104,7 @@ type DurableAnswerIntentJournal ### `DurableAnswerIntentRecord` -`interface` +`interface` — Define the structure for recording durable answer intent details and their states ```ts interface DurableAnswerIntentRecord @@ -112,7 +112,7 @@ interface DurableAnswerIntentRecord ### `DurableAnswerIntentState` -`type` +`type` — Define possible states for a durable answer intent lifecycle ```ts type DurableAnswerIntentState @@ -120,7 +120,7 @@ type DurableAnswerIntentState ### `DurableChatConflictError` -`class` +`class` — Represent conflict errors occurring in durable chat state management ```ts class DurableChatConflictError @@ -136,7 +136,7 @@ class DurableChatError ### `DurableChatErrorCode` -`type` +`type` — Define error codes representing possible Durable Chat failure scenarios ```ts type DurableChatErrorCode @@ -144,7 +144,7 @@ type DurableChatErrorCode ### `DurableChatEventProjection` -`interface` +`interface` — Resolve chat events and materialize their state into durable records ```ts interface DurableChatEventProjection @@ -152,7 +152,7 @@ interface DurableChatEventProjection ### `DurableChatGoneError` -`class` +`class` — Represent durable chat errors indicating the chat plan is no longer available ```ts class DurableChatGoneError @@ -168,7 +168,7 @@ type DurableChatScope ### `durableChatScopeKey` -`function` +`function` — Resolve a valid durable chat scope key from the given scope input ```ts (scope: DurableChatScope) => string @@ -184,7 +184,7 @@ type DurableChatStateStore ### `DurableChatUnavailableError` -`class` +`class` — Represent unavailable durable chat authority errors with status code 503 ```ts class DurableChatUnavailableError @@ -192,7 +192,7 @@ class DurableChatUnavailableError ### `DurableFollowUpReceipt` -`interface` +`interface` — Define a durable receipt capturing stable identifiers and state for follow-up decisions ```ts interface DurableFollowUpReceipt @@ -200,7 +200,7 @@ interface DurableFollowUpReceipt ### `DurableInteractionAcknowledgement` -`interface` +`interface` — Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields ```ts interface DurableInteractionAcknowledgement @@ -208,7 +208,7 @@ interface DurableInteractionAcknowledgement ### `DurableInteractionGuarantee` -`type` +`type` — Define interaction durability levels to specify reconciliation or best-effort guarantees ```ts type DurableInteractionGuarantee @@ -224,7 +224,7 @@ type DurableInteractionGuarantee ### `DurableInteractionProjection` -`interface` +`interface` — Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag ```ts interface DurableInteractionProjection @@ -232,7 +232,7 @@ interface DurableInteractionProjection ### `DurableInteractionProjectionAdapter` -`interface` +`interface` — Define methods to manage durable interaction projections including upsert, cancel, and materialize operations ```ts interface DurableInteractionProjectionAdapter @@ -240,7 +240,7 @@ interface DurableInteractionProjectionAdapter ### `DurableInteractionSettlement` -`interface` +`interface` — Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents ```ts interface DurableInteractionSettlement @@ -248,7 +248,7 @@ interface DurableInteractionSettlement ### `DurableInteractionSettlementFactoryOptions` -`interface` +`interface` — Define options for creating durable interaction settlement factories including store and optional reconcile authority ```ts interface DurableInteractionSettlementFactoryOptions @@ -256,7 +256,7 @@ interface DurableInteractionSettlementFactoryOptions ### `DurableInteractionSettlementOptions` -`interface` +`interface` — Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider ```ts interface DurableInteractionSettlementOptions @@ -272,7 +272,7 @@ interface DurablePlanAuthority ### `DurablePlanAuthorityCurrentResult` -`interface` +`interface` — Represent the current authoritative state and optional receipt of a durable plan authority ```ts interface DurablePlanAuthorityCurrentResult @@ -280,7 +280,7 @@ interface DurablePlanAuthorityCurrentResult ### `DurablePlanAuthorityDecision` -`type` +`type` — Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions ```ts type DurablePlanAuthorityDecision @@ -288,7 +288,7 @@ type DurablePlanAuthorityDecision ### `DurablePlanAuthorityResult` -`interface` +`interface` — Describe the outcome of an authority's durable plan decision including follow-up and metadata ```ts interface DurablePlanAuthorityResult @@ -296,7 +296,7 @@ interface DurablePlanAuthorityResult ### `DurablePlanAuthorization` -`type` +`type` — Resolve authorization status for durable plans using scopes, responses, or nullish values ```ts type DurablePlanAuthorization @@ -304,7 +304,7 @@ type DurablePlanAuthorization ### `DurablePlanCommandJournal` -`type` +`type` — Pick essential methods to manage and record durable plan command operations ```ts type DurablePlanCommandJournal @@ -312,7 +312,7 @@ type DurablePlanCommandJournal ### `DurablePlanCommandKey` -`type` +`type` — Represent a unique identifier key for durable plan commands ```ts type DurablePlanCommandKey @@ -320,7 +320,7 @@ type DurablePlanCommandKey ### `DurablePlanCommandRecord` -`interface` +`interface` — Define the structure for recording durable plan commands with associated metadata and state information ```ts interface DurablePlanCommandRecord @@ -328,7 +328,7 @@ interface DurablePlanCommandRecord ### `DurablePlanCommandState` -`type` +`type` — Define possible states for a durable plan command in its lifecycle ```ts type DurablePlanCommandState @@ -336,7 +336,7 @@ type DurablePlanCommandState ### `DurablePlanDecision` -`type` +`type` — Represent durable plan outcomes as either approved or rejected ```ts type DurablePlanDecision @@ -344,7 +344,7 @@ type DurablePlanDecision ### `DurablePlanEffectRecord` -`interface` +`interface` — Define the structure for recording the state and metadata of a durable plan effect ```ts interface DurablePlanEffectRecord @@ -360,7 +360,7 @@ type DurablePlanProjection ### `DurablePlanRouteAuthorizeArgs` -`interface` +`interface` — Define arguments for authorizing durable plan route requests with operation and optional plan ID ```ts interface DurablePlanRouteAuthorizeArgs @@ -368,7 +368,7 @@ interface DurablePlanRouteAuthorizeArgs ### `DurablePlanRouteOptions` -`interface` +`interface` — Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling ```ts interface DurablePlanRouteOptions @@ -376,7 +376,7 @@ interface DurablePlanRouteOptions ### `DurablePlanRoutes` -`interface` +`interface` — Define routes handling durable plan requests with current and decide methods ```ts interface DurablePlanRoutes @@ -384,7 +384,7 @@ interface DurablePlanRoutes ### `DurablePlanStateStore` -`type` +`type` — Represent durable storage for plan state management with persistence and reliability guarantees ```ts type DurablePlanStateStore @@ -392,7 +392,7 @@ type DurablePlanStateStore ### `DurablePlanStore` -`interface` +`interface` — Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context ```ts interface DurablePlanStore @@ -416,7 +416,7 @@ typeof InMemoryDurableChatStateStore ### `normalizePlanDecision` -`function` +`function` — Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs ```ts (value: unknown) => DurablePlanDecision | null @@ -424,7 +424,7 @@ typeof InMemoryDurableChatStateStore ### `planAuthorityIdempotencyKey` -`function` +`function` — Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision ```ts (scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string @@ -432,7 +432,7 @@ typeof InMemoryDurableChatStateStore ### `planCommandKey` -`function` +`function` — Generate a unique key string for a plan command using plan ID, revision, and decision ```ts (planId: string, revision: number, decision: DurablePlanDecision) => string @@ -440,7 +440,7 @@ typeof InMemoryDurableChatStateStore ### `planEffectKey` -`function` +`function` — Generate a unique string key representing the effect of a plan decision within a given scope and revision ```ts (scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string @@ -448,7 +448,7 @@ typeof InMemoryDurableChatStateStore ### `PreparedDurableInteractionAnswer` -`interface` +`interface` — Define a structured response containing scope, settlement, and intent for durable interactions ```ts interface PreparedDurableInteractionAnswer @@ -472,7 +472,7 @@ interface PreparedDurableInteractionAnswer ### `stablePlanReceipt` -`function` +`function` — Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision ```ts (scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick value is "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids"… @@ -72,7 +72,7 @@ readonly ["opencode", "claude-code", "nanoclaw", "kimi-code", "codex", "amp", "f ### `ResolvedSessionHarness` -`interface` +`interface` — Represent resolved session state including harness, lock status, and swap attempt flag ```ts interface ResolvedSessionHarness @@ -88,7 +88,7 @@ interface ResolvedSessionHarness ### `ResolveSessionHarnessInput` -`interface` +`interface` — Resolve input options to determine the appropriate session harness to use ```ts interface ResolveSessionHarnessInput diff --git a/docs/api/index.md b/docs/api/index.md index 85e16d5..c0e10dc 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -8,7 +8,7 @@ Source: `src/index.ts` ### `AddCaptionOperation` -`interface` +`interface` — Add a caption with optional language, timing, and track placement details ```ts interface AddCaptionOperation @@ -16,7 +16,7 @@ interface AddCaptionOperation ### `AddCitationArgs` -`interface` +`interface` — Define arguments required to add a citation including path, quote, and optional label ```ts interface AddCitationArgs @@ -24,7 +24,7 @@ interface AddCitationArgs ### `AddCitationResult` -`interface` +`interface` — Represent the result of adding a citation including its identifier and location path ```ts interface AddCitationResult @@ -32,7 +32,7 @@ interface AddCitationResult ### `AddElementOperation` -`interface` +`interface` — Define an operation to add a scene element to a page with optional index and parent group ```ts interface AddElementOperation @@ -40,7 +40,7 @@ interface AddElementOperation ### `AddPageOperation` -`interface` +`interface` — Define an operation to add a new page with an optional position and caller-minted page ID ```ts interface AddPageOperation @@ -104,7 +104,7 @@ interface AgentKnowledgeConfig ### `AgentRuntime` -`interface` +`interface` — Resolve and stream tool execution loops with final results and intermediate events for agent runtime ```ts interface AgentRuntime @@ -128,7 +128,7 @@ interface AgentTaxonomyConfig ### `AgentTurnOptions` -`interface` +`interface` — Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers ```ts interface AgentTurnOptions @@ -176,7 +176,7 @@ interface ApplyDataOperation ### `applyDurableInteractionAnswer` -`function` +`function` — Resolve and record the outcome and answers of a durable interaction within the given store and scope ```ts (store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: "declined" | "accepted", answers?: R… @@ -184,7 +184,7 @@ interface ApplyDataOperation ### `applyDurableInteractionAsk` -`function` +`function` — Resolve and upsert a durable interaction ask in the store with optional event and timing parameters ```ts (store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde… @@ -192,7 +192,7 @@ interface ApplyDataOperation ### `applyDurableInteractionCancel` -`function` +`function` — Resolve cancellation of a durable interaction with optional reason and event details ```ts (store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… @@ -224,7 +224,7 @@ interface ApplyDataOperation ### `ApplySceneOptions` -`interface` +`interface` — Resolve element ID conflicts by providing fresh unique identifiers during scene application ```ts interface ApplySceneOptions @@ -232,7 +232,7 @@ interface ApplySceneOptions ### `applySequenceOperation` -`function` +`function` — Apply a sequence operation to update the store and timeline asynchronously ```ts (store: SequenceStore, timeline: SequenceTimeline, op: SequenceOperation, ctx: SequenceOperationContext) => Promise<...> @@ -248,7 +248,7 @@ interface ApplySceneOptions ### `ApprovalEvent` -`interface` +`interface` — Describe an approval event with action details, user info, and optional edited fields ```ts interface ApprovalEvent @@ -256,7 +256,7 @@ interface ApprovalEvent ### `ApprovalEventSchema` -`const` +`const` — Validate approval event data including asset, action, user, timestamp, and optional fields ```ts ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEnum<{ scheduled: "scheduled"; approved:… @@ -280,7 +280,7 @@ interface AppToolDefinition ### `AppToolDescriptor` -`interface` +`interface` — Describe an application tool with its name, unique key, and description ```ts interface AppToolDescriptor @@ -312,7 +312,7 @@ interface AppToolMcpServer ### `AppToolName` -`type` +`type` — Resolve a valid application tool name from the predefined list of tool names ```ts type AppToolName @@ -360,7 +360,7 @@ interface AppToolTaxonomy ### `asRecord` -`function` +`function` — Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined ```ts (value: unknown) => JsonRecord | undefined @@ -368,7 +368,7 @@ interface AppToolTaxonomy ### `assertClipFitsSequence` -`function` +`function` — Validate that a clip's start and duration fit within the sequence duration without overflow ```ts (input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; label: string; }) => void @@ -376,7 +376,7 @@ interface AppToolTaxonomy ### `assertColor` -`function` +`function` — Validate that a string is a hex, rgb(a), or 'transparent' color and throw an error if not ```ts (value: string, label: string) => void @@ -392,7 +392,7 @@ interface AppToolTaxonomy ### `assertFinite` -`function` +`function` — Assert that a value is a finite number and throw an error with a label if not ```ts (value: number, label: string) => void @@ -416,7 +416,7 @@ interface AppToolTaxonomy ### `assertPositiveFinite` -`function` +`function` — Assert that a value is a positive finite number and throw an error with a label if not ```ts (value: number, label: string) => void @@ -456,7 +456,7 @@ interface AppToolTaxonomy ### `AssetContentMap` -`type` +`type` — Map asset keys to their corresponding content types for various media and copy formats ```ts type AssetContentMap @@ -464,7 +464,7 @@ type AssetContentMap ### `AssetFormat` -`type` +`type` — Define valid asset format strings for various media and copy types ```ts type AssetFormat @@ -472,7 +472,7 @@ type AssetFormat ### `AssetSpec` -`interface` +`interface` — Define the structure and metadata for an asset including its format, brand, content, and status ```ts interface AssetSpec @@ -480,7 +480,7 @@ interface AssetSpec ### `AssetStatus` -`type` +`type` — Define possible states representing the lifecycle status of an asset ```ts type AssetStatus @@ -488,7 +488,7 @@ type AssetStatus ### `AssetVariant` -`interface` +`interface` — Describe an asset variant with identification, approval status, and edit history details ```ts interface AssetVariant @@ -496,7 +496,7 @@ interface AssetVariant ### `asString` -`function` +`function` — Resolve a non-empty string from a value or return undefined ```ts (value: unknown) => string | undefined @@ -536,7 +536,7 @@ interface AssetVariant ### `attachReasoningEffort` -`function` +`function` — Attach a specified reasoning effort level to an agent profile for a given harness ```ts (profile: AgentProfile, harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-dro… @@ -544,7 +544,7 @@ interface AssetVariant ### `AuthenticatedSandboxUser` -`interface` +`interface` — Represent an authenticated user within a sandbox environment with a unique identifier ```ts interface AuthenticatedSandboxUser @@ -552,7 +552,7 @@ interface AuthenticatedSandboxUser ### `AuthenticateOptions` -`interface` +`interface` — Define options to verify bearer tokens and customize authentication header names ```ts interface AuthenticateOptions @@ -568,7 +568,7 @@ interface AuthenticateOptions ### `bearerSubprotocolToken` -`function` +`function` — Resolve and decode a bearer token from a comma-separated subprotocol string or return null ```ts (value: string | null) => string | null @@ -576,7 +576,7 @@ interface AuthenticateOptions ### `bearerToken` -`function` +`function` — Extract the token from a bearer authorization string or return null if invalid or missing ```ts (value: string | null) => string | null @@ -584,7 +584,7 @@ interface AuthenticateOptions ### `BeforeInteractionAnswerArgs` -`interface` +`interface` — Describe the arguments provided before processing an interaction answer including request, body, and connection details ```ts interface BeforeInteractionAnswerArgs @@ -592,7 +592,7 @@ interface BeforeInteractionAnswerArgs ### `BindSlotOperation` -`interface` +`interface` — Define an operation to bind or unbind a unique slot to an element on a specific page ```ts interface BindSlotOperation @@ -616,7 +616,7 @@ interface BindSlotOperation ### `Bounds` -`interface` +`interface` — Define rectangular boundaries with position and size properties ```ts interface Bounds @@ -624,7 +624,7 @@ interface Bounds ### `boundsIntersect` -`function` +`function` — Determine if two rectangular bounds overlap or intersect each other ```ts (a: Bounds, b: Bounds) => boolean @@ -632,7 +632,7 @@ interface Bounds ### `BrandTokens` -`interface` +`interface` — Define brand identity tokens including colors, font, logo, business name, and voice ```ts interface BrandTokens @@ -640,7 +640,7 @@ interface BrandTokens ### `BrandTokensSchema` -`const` +`const` — Validate brand token properties including colors, font, logo URL, business name, and voice ```ts ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodString; fontFamily: ZodString; logoUrl: ZodO… @@ -664,7 +664,7 @@ interface BrokerTokenMinter ### `BrokerTokenProvider` -`interface` +`interface` — Provide and refresh broker bearer tokens, allowing forced token invalidation ```ts interface BrokerTokenProvider @@ -672,7 +672,7 @@ interface BrokerTokenProvider ### `BrokerTokenProviderOptions` -`interface` +`interface` — Define options for configuring a broker token provider including client credentials and token management settings ```ts interface BrokerTokenProviderOptions @@ -688,7 +688,7 @@ interface BrokerTokenProviderOptions ### `BufferedTurnEvent` -`interface` +`interface` — Represent a buffered turn event with a sequence number and serialized event data ```ts interface BufferedTurnEvent @@ -696,7 +696,7 @@ interface BufferedTurnEvent ### `BufferedTurnOptions` -`interface` +`interface` — Define options for buffering and flushing turn events with optional live client delivery and event coalescing ```ts interface BufferedTurnOptions @@ -728,7 +728,7 @@ interface BufferedTurnTap ### `buildAppToolMcpServers` -`function` +`function` — Build a mapping of MCP server profiles keyed by tool identifiers from provided options ```ts (options: BuildAppToolMcpServersOptions) => Record @@ -736,7 +736,7 @@ interface BufferedTurnTap ### `BuildAppToolMcpServersOptions` -`interface` +`interface` — Define options for building MCP server configurations in the app tool environment ```ts interface BuildAppToolMcpServersOptions @@ -776,7 +776,7 @@ interface BuildAppToolsOptions ### `BuildCaptionChunksOptions` -`interface` +`interface` — Define options to configure caption chunk size, duration, and frame rate constraints ```ts interface BuildCaptionChunksOptions @@ -816,7 +816,7 @@ interface BuildCaptionChunksOptions ### `BuildDesignCanvasMcpServerEntryOptions` -`type` +`type` — Build scoped MCP server entry options for the design canvas environment ```ts type BuildDesignCanvasMcpServerEntryOptions @@ -848,7 +848,7 @@ type BuildDesignCanvasMcpServerEntryOptions ### `BuildHttpMcpServerOptions` -`interface` +`interface` — Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description ```ts interface BuildHttpMcpServerOptions @@ -864,7 +864,7 @@ interface BuildHttpMcpServerOptions ### `BuildMcpServerOptions` -`interface` +`interface` — Define configuration options required to build an MCP server including tool, baseUrl, token, and context ```ts interface BuildMcpServerOptions @@ -888,7 +888,7 @@ interface BuildMcpServerOptions ### `BuildRedactedDocumentOptions` -`interface` +`interface` — Define options to encrypt text and specify patterns for redacting sensitive document content ```ts interface BuildRedactedDocumentOptions @@ -896,7 +896,7 @@ interface BuildRedactedDocumentOptions ### `buildSandboxRuntimeProxyHeaders` -`function` +`function` — Build proxy headers for sandbox runtime including authorization and forwarded headers ```ts (source: Headers, sandboxApiKey: string, forwardHeaders?: string[]) => Headers @@ -904,7 +904,7 @@ interface BuildRedactedDocumentOptions ### `buildSandboxToolFileMounts` -`function` +`function` — Build file mounts for sandbox tools based on provided options and tool configurations ```ts (options: BuildSandboxToolFileMountsOptions) => AgentProfileFileMount[] @@ -912,7 +912,7 @@ interface BuildRedactedDocumentOptions ### `BuildSandboxToolFileMountsOptions` -`interface` +`interface` — Define options for building sandbox tool file mounts including tool specifications and paths ```ts interface BuildSandboxToolFileMountsOptions @@ -920,7 +920,7 @@ interface BuildSandboxToolFileMountsOptions ### `buildSandboxToolPathSetupScript` -`function` +`function` — Build a shell script that sets up and exports the sandbox tool binary directory in user profiles ```ts (options: SandboxToolPathOptions) => string @@ -944,7 +944,7 @@ interface BuildSandboxToolFileMountsOptions ### `BuildSequencesMcpServerEntryOptions` -`type` +`type` — Extend ScopedMcpServerEntryOptions to configure MCP server entry options for sequence building ```ts type BuildSequencesMcpServerEntryOptions @@ -960,7 +960,7 @@ type BuildSequencesMcpServerEntryOptions ### `buildUserTextParts` -`function` +`function` — Build an array of text parts with optional turn ID for user input ```ts (text: string, turnId: string | undefined) => JsonRecord[] @@ -1008,7 +1008,7 @@ type BuildSequencesMcpServerEntryOptions ### `CANVAS_ELEMENT_KINDS` -`const` +`const` — Provide a readonly array of string identifiers representing canvas element kinds ```ts readonly string[] @@ -1016,7 +1016,7 @@ readonly string[] ### `CANVAS_MCP_TOOL_NAMES` -`const` +`const` — Extract names of all tools from the CANVAS_MCP_TOOLS array ```ts string[] @@ -1024,7 +1024,7 @@ string[] ### `CANVAS_MCP_TOOLS` -`const` +`const` — Provide a collection of MCP tool definitions for manipulating and querying the design canvas environment ```ts McpToolDefinition[] @@ -1040,7 +1040,7 @@ interface CanvasRenderPalette ### `CapabilityTokenOptions` -`interface` +`interface` — Define options for creating and verifying capability tokens including secret and prefix ```ts interface CapabilityTokenOptions @@ -1072,7 +1072,7 @@ interface CaptionCoverageEntry ### `CaptionExportOptions` -`interface` +`interface` — Define options to export captions filtered by an optional BCP-47 language tag ```ts interface CaptionExportOptions @@ -1080,7 +1080,7 @@ interface CaptionExportOptions ### `CaptionTargetResolution` -`type` +`type` — Resolve caption target by specifying an existing track or creating a new one with language and name ```ts type CaptionTargetResolution @@ -1096,7 +1096,7 @@ type CaptionTargetResolution ### `CatalogModel` -`interface` +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags ```ts interface CatalogModel @@ -1104,7 +1104,7 @@ interface CatalogModel ### `CertifiedDelivery` -`interface` +`interface` — Resolve and manage certified profiles with refresh and composition capabilities ```ts interface CertifiedDelivery @@ -1112,7 +1112,7 @@ interface CertifiedDelivery ### `CertifiedDeliveryConfig` -`interface` +`interface` — Define configuration options for delivering certified artifacts to a specified tenant target ```ts interface CertifiedDeliveryConfig @@ -1128,7 +1128,7 @@ readonly ChannelPreset[] ### `ChannelPreset` -`interface` +`interface` — Define a preset configuration for a channel including its id, label, width, and height ```ts interface ChannelPreset @@ -1136,7 +1136,7 @@ interface ChannelPreset ### `ChannelPresetId` -`type` +`type` — Resolve a valid channel preset identifier from the predefined channel presets array ```ts type ChannelPresetId @@ -1144,7 +1144,7 @@ type ChannelPresetId ### `ChannelScaleResult` -`interface` +`interface` — Define the pixel ratio and horizontal offset for scaling a Konva stage to a channel preset size ```ts interface ChannelScaleResult @@ -1176,7 +1176,7 @@ interface ChatFilePart ### `ChatImagePart` -`interface` +`interface` — Define properties for an image part within a chat message including optional metadata fields ```ts interface ChatImagePart @@ -1192,7 +1192,7 @@ interface ChatInteraction ### `ChatInteractionField` -`type` +`type` — Resolve a chat interaction field excluding select types or including chat select fields ```ts type ChatInteractionField @@ -1208,7 +1208,7 @@ interface ChatInteractionPart ### `ChatInteractionStatus` -`type` +`type` — Define possible statuses representing the state of a chat interaction ```ts type ChatInteractionStatus @@ -1232,7 +1232,7 @@ interface ChatMentionPart ### `ChatMessagePart` -`type` +`type` — Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions ```ts type ChatMessagePart @@ -1264,7 +1264,7 @@ type ChatPlan ### `ChatPlanPart` -`type` +`type` — Resolve a chat plan part by aliasing it to the persisted chat plan part type ```ts type ChatPlanPart @@ -1288,7 +1288,7 @@ type ChatPlanStatus ### `ChatReasoningPart` -`interface` +`interface` — Define a reasoning part of a chat with text content and optional metadata fields ```ts interface ChatReasoningPart @@ -1296,7 +1296,7 @@ interface ChatReasoningPart ### `ChatSelectField` -`type` +`type` — Extract select-type interaction fields and optionally allow custom values ```ts type ChatSelectField @@ -1304,7 +1304,7 @@ type ChatSelectField ### `ChatStepFinishPart` -`interface` +`interface` — Define a chat step finish part indicating completion with optional reason, tokens, and cost ```ts interface ChatStepFinishPart @@ -1328,7 +1328,7 @@ class ChatStoreInputError ### `ChatSubtaskPart` -`interface` +`interface` — Define a subtask part of a chat with prompt, description, agent, and optional identifier ```ts interface ChatSubtaskPart @@ -1344,7 +1344,7 @@ interface ChatTextPart ### `ChatToolPart` -`interface` +`interface` — Define a chat component representing a tool with its state and optional call identifier ```ts interface ChatToolPart @@ -1352,7 +1352,7 @@ interface ChatToolPart ### `ChatToolState` -`interface` +`interface` — Describe the current state and data of a chat tool including status, input, output, and metadata ```ts interface ChatToolState @@ -1408,7 +1408,7 @@ interface ChatUsageTokens ### `clampClipDuration` -`function` +`function` — Clamp clip duration to fit within sequence bounds and minimum length constraints ```ts (input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number @@ -1416,7 +1416,7 @@ interface ChatUsageTokens ### `clampClipStart` -`function` +`function` — Clamp the clip start frame within the valid range of the sequence duration and clip length ```ts (input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number @@ -1424,7 +1424,7 @@ interface ChatUsageTokens ### `classifySeveredStream` -`function` +`function` — Resolve the severed stream event to a corresponding sandbox step transition or null ```ts (event: unknown) => SandboxStepTransition | null @@ -1480,7 +1480,7 @@ interface ChatUsageTokens ### `CompleteMissionInput` -`interface` +`interface` — Define input parameters to complete a mission with status and optional summary ```ts interface CompleteMissionInput @@ -1528,7 +1528,7 @@ interface CompletionVerdict ### `ComposerAnswerDelivery` -`interface` +`interface` — Define the structure for delivering answers linked to a specific chat interaction and field ```ts interface ComposerAnswerDelivery @@ -1536,7 +1536,7 @@ interface ComposerAnswerDelivery ### `ConsentUrlInput` -`interface` +`interface` — Define input parameters required to generate a consent URL for OAuth authorization ```ts interface ConsentUrlInput @@ -1544,7 +1544,7 @@ interface ConsentUrlInput ### `ContactSheetEntry` -`interface` +`interface` — Describe a single entry in a contact sheet with timing and media source details ```ts interface ContactSheetEntry @@ -1552,7 +1552,7 @@ interface ContactSheetEntry ### `ContactSheetManifest` -`interface` +`interface` — Define the structure for a contact sheet manifest including metadata and entries ```ts interface ContactSheetManifest @@ -1560,7 +1560,7 @@ interface ContactSheetManifest ### `ConversionMetrics` -`interface` +`interface` — Define metrics for tracking impressions, clicks, conversions, and related rates ```ts interface ConversionMetrics @@ -1568,7 +1568,7 @@ interface ConversionMetrics ### `ConversionMetricsSchema` -`const` +`const` — Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields ```ts ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; ctr: ZodNumber; cvr: ZodNumber; }, $stri… @@ -1576,7 +1576,7 @@ ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; c ### `CookieOptions` -`interface` +`interface` — Define options for configuring cookie attributes and behavior ```ts interface CookieOptions @@ -1584,7 +1584,7 @@ interface CookieOptions ### `CopyContent` -`interface` +`interface` — Define the structure for content with headline, body, platform, and optional hashtags and character count ```ts interface CopyContent @@ -1592,7 +1592,7 @@ interface CopyContent ### `CopyContentSchema` -`const` +`const` — Validate and parse copy content with headline, body, optional hashtags, platform, and character count ```ts ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional>; platform: ZodEnum<{ x: "x… @@ -1600,7 +1600,7 @@ ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional TurnEventStore @@ -1688,7 +1688,7 @@ interface CreateAgentRuntimeOptions ### `createDesignCanvasMcpHandler` -`function` +`function` — Create a request handler for the design canvas MCP tool with specified options ```ts (opts: CreateDesignCanvasMcpHandlerOptions) => (request: Request) => Promise @@ -1696,7 +1696,7 @@ interface CreateAgentRuntimeOptions ### `CreateDesignCanvasMcpHandlerOptions` -`interface` +`interface` — Define options for creating a design canvas MCP handler including store, ID minting, and optional server info ```ts interface CreateDesignCanvasMcpHandlerOptions @@ -1712,7 +1712,7 @@ interface CreateDesignCanvasMcpHandlerOptions ### `createDurableChatScope` -`function` +`function` — Create a durable chat scope from a non-empty string value ```ts (value: string) => DurableChatScope @@ -1736,7 +1736,7 @@ interface CreateDesignCanvasMcpHandlerOptions ### `CreateDurableInteractionRoutePersistenceOptions` -`type` +`type` — Define options for durable interaction route persistence with reconciliation guarantees and authority functions ```ts type CreateDurableInteractionRoutePersistenceOptions @@ -1752,7 +1752,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `createDurablePlanRoutes` -`function` +`function` — Build durable plan routes with authorization and effect handling based on provided options ```ts (options: DurablePlanRouteOptions) => DurablePlanRoutes @@ -1760,7 +1760,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `createEmptyDocument` -`function` +`function` — Create a new empty SceneDocument with a title and optional initial page settings ```ts (title: string, page?: NewPageOptions | undefined) => SceneDocument @@ -1784,7 +1784,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `createInMemoryDurableChatStateStore` -`function` +`function` — Create an in-memory durable chat state store for managing chat session data efficiently ```ts () => InMemoryDurableChatStateStore @@ -1800,7 +1800,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `createInteractionAnswerRoute` -`function` +`function` — Create an interaction answer route that handles listing and resolving interaction requests ```ts (options: InteractionAnswerRouteOptions) => InteractionAnswerRoute @@ -1816,7 +1816,7 @@ type CreateDurableInteractionRoutePersistenceOptions ### `CreateKnowledgeLoopDeps` -`interface` +`interface` — Define dependencies required to create and run a knowledge processing loop ```ts interface CreateKnowledgeLoopDeps @@ -1840,7 +1840,7 @@ interface CreateKnowledgeLoopDeps ### `CreateMcpToolHandlerOptions` -`interface` +`interface` — Define options for creating a handler that manages MCP tools with environment support ```ts interface CreateMcpToolHandlerOptions @@ -1856,7 +1856,7 @@ interface CreateMcpToolHandlerOptions ### `createMissionEngine` -`function` +`function` — Create a mission engine configured with options to manage mission execution and error handling ```ts (options: MissionEngineOptions) => MissionEngine @@ -1864,7 +1864,7 @@ interface CreateMcpToolHandlerOptions ### `CreateMissionInput` -`interface` +`interface` — Define input parameters for creating a mission including optional deterministic id and unique plan steps ```ts interface CreateMissionInput @@ -1872,7 +1872,7 @@ interface CreateMissionInput ### `createMissionService` -`function` +`function` — Create a mission service that manages mission records and audit events with customizable options ```ts (options: MissionServiceOptions) => MissionService @@ -1896,7 +1896,7 @@ interface CreateMissionInput ### `createPage` -`function` +`function` — Create a new ScenePage with specified options and a unique identifier ```ts (options: NewPageOptions, id: string) => ScenePage @@ -1904,7 +1904,7 @@ interface CreateMissionInput ### `createPlatformBalanceManager` -`function` +`function` — Create a platform balance manager to handle user plan limits and state based on provided options ```ts (opts: PlatformBalanceManagerOptions) => PlatformBalanceManager @@ -1976,7 +1976,7 @@ interface CreateMissionInput ### `createSandboxTerminalToken` -`function` +`function` — Generate a sandbox terminal token for a given subject with specified options ```ts (subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise @@ -1984,7 +1984,7 @@ interface CreateMissionInput ### `createSequencesMcpHandler` -`function` +`function` — Create a handler to process MCP sequence requests with optional playhead frame and server info ```ts (opts: CreateSequencesMcpHandlerOptions) => (request: Request) => Promise @@ -1992,7 +1992,7 @@ interface CreateMissionInput ### `CreateSequencesMcpHandlerOptions` -`interface` +`interface` — Define options for creating sequences MCP handler including store, playhead frame, and server info ```ts interface CreateSequencesMcpHandlerOptions @@ -2016,7 +2016,7 @@ interface CreateSequencesMcpHandlerOptions ### `CreateTangleRouterModelConfigOptions` -`interface` +`interface` — Define configuration options for creating a Tangle router model including API key and model details ```ts interface CreateTangleRouterModelConfigOptions @@ -2040,7 +2040,7 @@ interface CreateTangleRouterModelConfigOptions ### `CreateTrackOperation` -`interface` +`interface` — Define an operation to create a new sequence track with a specified kind and name ```ts interface CreateTrackOperation @@ -2048,7 +2048,7 @@ interface CreateTrackOperation ### `createWorkspaceKeyManager` -`function` +`function` — Create a workspace key manager that handles key provisioning and budget tracking ```ts (opts: WorkspaceKeyManagerOptions) => WorkspaceKeyManager @@ -2056,7 +2056,7 @@ interface CreateTrackOperation ### `createWorkspaceSandboxConnectionHandler` -`function` +`function` — Create a handler to resolve workspace sandbox connections with user and access validation ```ts (opts: WorkspaceSandboxConnectionHandlerOptions) => ({ request, params… @@ -2064,7 +2064,7 @@ interface CreateTrackOperation ### `createWorkspaceSandboxManager` -`function` +`function` — Create a manager to handle workspace sandbox instances with client and options configuration ```ts (opts: WorkspaceSandboxManagerOptions ({ request, params }: WorkspaceSandboxRuntimeProxyArgs) => Promis… @@ -2120,7 +2120,7 @@ interface D1PreparedLike ### `darkTheme` -`const` +`const` — Define a dark color scheme for the Agent app interface with specific background and foreground hues ```ts AgentAppTheme @@ -2160,7 +2160,7 @@ AgentAppTheme ### `dedupeQuestionInteractionsByContent` -`function` +`function` — Remove duplicate question interactions based on their content signature to ensure uniqueness ```ts (interactions: ChatInteraction[]) => ChatInteraction[] @@ -2184,7 +2184,7 @@ Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", s ### `DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION` -`const` +`const` — Describe the live visual asset editor capabilities for the current design document using CSS pixel coordinates ```ts "Live visual asset editor for the current design document: read scene state, add/move/resize/delete elements, manage pa… @@ -2192,7 +2192,7 @@ Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", s ### `DEFAULT_HARNESS` -`const` +`const` — Define the default harness to use for code execution and testing environments ```ts "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes" | "forge"… @@ -2200,7 +2200,7 @@ Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", s ### `DEFAULT_HEADER_NAMES` -`const` +`const` — Provide default HTTP header names for user, workspace, and thread identification ```ts ToolHeaderNames @@ -2224,7 +2224,7 @@ readonly RedactionPattern[] ### `DEFAULT_SANDBOX_RESOURCES` -`const` +`const` — Define default resource limits and settings for sandbox environments ```ts SandboxResourceConfig @@ -2232,7 +2232,7 @@ SandboxResourceConfig ### `DEFAULT_SEQUENCES_MCP_DESCRIPTION` -`const` +`const` — Describe live timeline editor features for current video sequence including clip and caption management ```ts "Live timeline editor for the current video sequence: read timeline state, place/move/trim/split clips, add captions, m… @@ -2240,7 +2240,7 @@ SandboxResourceConfig ### `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR` -`const` +`const` — Define the default environment variable name for Tangle billing enforcement ```ts "TANGLE_BILLING_ENFORCEMENT" @@ -2248,7 +2248,7 @@ SandboxResourceConfig ### `DEFAULT_TANGLE_ROUTER_BASE_URL` -`const` +`const` — Provide the default base URL for the Tangle router API endpoint ```ts "https://router.tangle.tools/v1" @@ -2296,7 +2296,7 @@ SandboxResourceConfig ### `DeleteClipOperation` -`interface` +`interface` — Represent a delete clip operation with a specified clip identifier ```ts interface DeleteClipOperation @@ -2304,7 +2304,7 @@ interface DeleteClipOperation ### `DeleteElementOperation` -`interface` +`interface` — Resolve deletion of a specific element from a page by its identifiers ```ts interface DeleteElementOperation @@ -2312,7 +2312,7 @@ interface DeleteElementOperation ### `DeletePageOperation` -`interface` +`interface` — Represent a delete page operation with a specified page identifier ```ts interface DeletePageOperation @@ -2320,7 +2320,7 @@ interface DeletePageOperation ### `deleteSecret` -`function` +`function` — Delete a secret by name from the given secret store and return the operation outcome ```ts (store: SecretStore, name: string) => Promise> @@ -2352,7 +2352,7 @@ interface DeriveKeyOptions ### `DesignCanvasMcpServerInfo` -`interface` +`interface` — Describe design canvas MCP server information including name and version ```ts interface DesignCanvasMcpServerInfo @@ -2360,7 +2360,7 @@ interface DesignCanvasMcpServerInfo ### `DesignCanvasMcpToolEnv` -`interface` +`interface` — Define the environment for MCP tool with a scene store and ID minting function ```ts interface DesignCanvasMcpToolEnv @@ -2368,7 +2368,7 @@ interface DesignCanvasMcpToolEnv ### `detectInteractiveQuestion` -`function` +`function` — Resolve the interactive question text from a structured event or return null if none found ```ts (event: unknown) => string | null @@ -2392,7 +2392,7 @@ interface DesignCanvasMcpToolEnv ### `DispatchOptions` -`interface` +`interface` — Define options for dispatching tools including handlers, taxonomy, custom tools, and approval policies ```ts interface DispatchOptions @@ -2400,7 +2400,7 @@ interface DispatchOptions ### `DistributionSummary` -`interface` +`interface` — Summarize key statistics of a numerical distribution including count, min, percentiles, and max ```ts interface DistributionSummary @@ -2408,7 +2408,7 @@ interface DistributionSummary ### `driveSandboxTurn` -`function` +`function` — Resolve a sandbox turn by processing a message with given configuration and options ```ts (shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options: DriveSandboxTurnOptio… @@ -2416,7 +2416,7 @@ interface DistributionSummary ### `DriveSandboxTurnOptions` -`interface` +`interface` — Define options to manage deterministic session resumption and turn idempotency in sandboxed drive turns ```ts interface DriveSandboxTurnOptions @@ -2440,7 +2440,7 @@ interface DrizzleSqliteCoreLike ### `DuplicatePageOperation` -`interface` +`interface` — Define an operation to duplicate a page with a new caller-specified page ID ```ts interface DuplicatePageOperation @@ -2448,7 +2448,7 @@ interface DuplicatePageOperation ### `DurableAnswerIntentJournal` -`type` +`type` — Provide durable methods to manage the lifecycle of answer intents in a plan store ```ts type DurableAnswerIntentJournal @@ -2456,7 +2456,7 @@ type DurableAnswerIntentJournal ### `DurableAnswerIntentRecord` -`interface` +`interface` — Define the structure for recording durable answer intent details and their states ```ts interface DurableAnswerIntentRecord @@ -2464,7 +2464,7 @@ interface DurableAnswerIntentRecord ### `DurableAnswerIntentState` -`type` +`type` — Define possible states for a durable answer intent lifecycle ```ts type DurableAnswerIntentState @@ -2472,7 +2472,7 @@ type DurableAnswerIntentState ### `DurableChatConflictError` -`class` +`class` — Represent conflict errors occurring in durable chat state management ```ts class DurableChatConflictError @@ -2488,7 +2488,7 @@ class DurableChatError ### `DurableChatErrorCode` -`type` +`type` — Define error codes representing possible Durable Chat failure scenarios ```ts type DurableChatErrorCode @@ -2496,7 +2496,7 @@ type DurableChatErrorCode ### `DurableChatEventProjection` -`interface` +`interface` — Resolve chat events and materialize their state into durable records ```ts interface DurableChatEventProjection @@ -2504,7 +2504,7 @@ interface DurableChatEventProjection ### `DurableChatGoneError` -`class` +`class` — Represent durable chat errors indicating the chat plan is no longer available ```ts class DurableChatGoneError @@ -2520,7 +2520,7 @@ type DurableChatScope ### `durableChatScopeKey` -`function` +`function` — Resolve a valid durable chat scope key from the given scope input ```ts (scope: DurableChatScope) => string @@ -2536,7 +2536,7 @@ type DurableChatStateStore ### `DurableChatUnavailableError` -`class` +`class` — Represent unavailable durable chat authority errors with status code 503 ```ts class DurableChatUnavailableError @@ -2544,7 +2544,7 @@ class DurableChatUnavailableError ### `DurableFollowUpReceipt` -`interface` +`interface` — Define a durable receipt capturing stable identifiers and state for follow-up decisions ```ts interface DurableFollowUpReceipt @@ -2552,7 +2552,7 @@ interface DurableFollowUpReceipt ### `DurableInteractionAcknowledgement` -`interface` +`interface` — Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields ```ts interface DurableInteractionAcknowledgement @@ -2560,7 +2560,7 @@ interface DurableInteractionAcknowledgement ### `DurableInteractionGuarantee` -`type` +`type` — Define interaction durability levels to specify reconciliation or best-effort guarantees ```ts type DurableInteractionGuarantee @@ -2576,7 +2576,7 @@ type DurableInteractionGuarantee ### `DurableInteractionProjection` -`interface` +`interface` — Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag ```ts interface DurableInteractionProjection @@ -2584,7 +2584,7 @@ interface DurableInteractionProjection ### `DurableInteractionProjectionAdapter` -`interface` +`interface` — Define methods to manage durable interaction projections including upsert, cancel, and materialize operations ```ts interface DurableInteractionProjectionAdapter @@ -2592,7 +2592,7 @@ interface DurableInteractionProjectionAdapter ### `DurableInteractionRouteArgs` -`interface` +`interface` — Define arguments for durable interaction routes including a stable caller-created attempt key ```ts interface DurableInteractionRouteArgs @@ -2608,7 +2608,7 @@ interface DurableInteractionRoutePersistence ### `DurableInteractionSettlement` -`interface` +`interface` — Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents ```ts interface DurableInteractionSettlement @@ -2616,7 +2616,7 @@ interface DurableInteractionSettlement ### `DurableInteractionSettlementFactoryOptions` -`interface` +`interface` — Define options for creating durable interaction settlement factories including store and optional reconcile authority ```ts interface DurableInteractionSettlementFactoryOptions @@ -2624,7 +2624,7 @@ interface DurableInteractionSettlementFactoryOptions ### `DurableInteractionSettlementOptions` -`interface` +`interface` — Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider ```ts interface DurableInteractionSettlementOptions @@ -2640,7 +2640,7 @@ interface DurablePlanAuthority ### `DurablePlanAuthorityCurrentResult` -`interface` +`interface` — Represent the current authoritative state and optional receipt of a durable plan authority ```ts interface DurablePlanAuthorityCurrentResult @@ -2648,7 +2648,7 @@ interface DurablePlanAuthorityCurrentResult ### `DurablePlanAuthorityDecision` -`type` +`type` — Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions ```ts type DurablePlanAuthorityDecision @@ -2656,7 +2656,7 @@ type DurablePlanAuthorityDecision ### `DurablePlanAuthorityResult` -`interface` +`interface` — Describe the outcome of an authority's durable plan decision including follow-up and metadata ```ts interface DurablePlanAuthorityResult @@ -2664,7 +2664,7 @@ interface DurablePlanAuthorityResult ### `DurablePlanAuthorization` -`type` +`type` — Resolve authorization status for durable plans using scopes, responses, or nullish values ```ts type DurablePlanAuthorization @@ -2672,7 +2672,7 @@ type DurablePlanAuthorization ### `DurablePlanCommandJournal` -`type` +`type` — Pick essential methods to manage and record durable plan command operations ```ts type DurablePlanCommandJournal @@ -2680,7 +2680,7 @@ type DurablePlanCommandJournal ### `DurablePlanCommandKey` -`type` +`type` — Represent a unique identifier key for durable plan commands ```ts type DurablePlanCommandKey @@ -2688,7 +2688,7 @@ type DurablePlanCommandKey ### `DurablePlanCommandRecord` -`interface` +`interface` — Define the structure for recording durable plan commands with associated metadata and state information ```ts interface DurablePlanCommandRecord @@ -2696,7 +2696,7 @@ interface DurablePlanCommandRecord ### `DurablePlanCommandState` -`type` +`type` — Define possible states for a durable plan command in its lifecycle ```ts type DurablePlanCommandState @@ -2704,7 +2704,7 @@ type DurablePlanCommandState ### `DurablePlanDecision` -`type` +`type` — Represent durable plan outcomes as either approved or rejected ```ts type DurablePlanDecision @@ -2712,7 +2712,7 @@ type DurablePlanDecision ### `DurablePlanEffectRecord` -`interface` +`interface` — Define the structure for recording the state and metadata of a durable plan effect ```ts interface DurablePlanEffectRecord @@ -2728,7 +2728,7 @@ type DurablePlanProjection ### `DurablePlanRouteAuthorizeArgs` -`interface` +`interface` — Define arguments for authorizing durable plan route requests with operation and optional plan ID ```ts interface DurablePlanRouteAuthorizeArgs @@ -2736,7 +2736,7 @@ interface DurablePlanRouteAuthorizeArgs ### `DurablePlanRouteOptions` -`interface` +`interface` — Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling ```ts interface DurablePlanRouteOptions @@ -2744,7 +2744,7 @@ interface DurablePlanRouteOptions ### `DurablePlanRoutes` -`interface` +`interface` — Define routes handling durable plan requests with current and decide methods ```ts interface DurablePlanRoutes @@ -2752,7 +2752,7 @@ interface DurablePlanRoutes ### `DurablePlanStateStore` -`type` +`type` — Represent durable storage for plan state management with persistence and reliability guarantees ```ts type DurablePlanStateStore @@ -2760,7 +2760,7 @@ type DurablePlanStateStore ### `DurablePlanStore` -`interface` +`interface` — Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context ```ts interface DurablePlanStore @@ -2784,7 +2784,7 @@ interface DurablePlanStore ### `EllipseElement` -`interface` +`interface` — Define properties for an ellipse element including dimensions, fill, and optional stroke details ```ts interface EllipseElement @@ -2792,7 +2792,7 @@ interface EllipseElement ### `EmailBodySection` -`interface` +`interface` — Define the structure for the body section of an email containing plain text content ```ts interface EmailBodySection @@ -2800,7 +2800,7 @@ interface EmailBodySection ### `EmailContent` -`interface` +`interface` — Define the structure for email content including subject, optional preheader, and sections ```ts interface EmailContent @@ -2808,7 +2808,7 @@ interface EmailContent ### `EmailContentSchema` -`const` +`const` — Validate and parse email content objects with subject, optional preheader, and sections ```ts ZodObject<{ subject: ZodString; preheader: ZodOptional; sections: ZodArray; sections: Zod ### `EmailCtaSection` -`interface` +`interface` — Define a call-to-action section with label, URL, and optional subtext for email content ```ts interface EmailCtaSection @@ -2824,7 +2824,7 @@ interface EmailCtaSection ### `EmailDividerSection` -`interface` +`interface` — Define a section representing a divider in an email layout ```ts interface EmailDividerSection @@ -2832,7 +2832,7 @@ interface EmailDividerSection ### `EmailFeatureSection` -`interface` +`interface` — Define a feature section with headline, description, and optional image for email content ```ts interface EmailFeatureSection @@ -2840,7 +2840,7 @@ interface EmailFeatureSection ### `EmailHeroSection` -`interface` +`interface` — Define the structure for a hero section in an email with headline, image, and call-to-action fields ```ts interface EmailHeroSection @@ -2848,7 +2848,7 @@ interface EmailHeroSection ### `EmailSection` -`type` +`type` — Define a union type representing different sections of an email template ```ts type EmailSection @@ -2856,7 +2856,7 @@ type EmailSection ### `EmailTestimonialSection` -`interface` +`interface` — Define the structure for an email testimonial section with quote, author, and optional details ```ts interface EmailTestimonialSection @@ -2864,7 +2864,7 @@ interface EmailTestimonialSection ### `encodeEvent` -`function` +`function` — Encode a StreamEvent object into a Uint8Array using the provided TextEncoder ```ts (encoder: TextEncoder, event: StreamEvent) => Uint8Array @@ -2872,7 +2872,7 @@ interface EmailTestimonialSection ### `encodeSandboxRuntimePath` -`function` +`function` — Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments ```ts (runtimePath: string) => string | null @@ -2904,7 +2904,7 @@ interface EmailTestimonialSection ### `ensureWorkspaceSandbox` -`function` +`function` — Resolve or create a workspace sandbox instance with optional reuse and progress tracking ```ts (shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions) => Promise @@ -2912,7 +2912,7 @@ interface EmailTestimonialSection ### `EnsureWorkspaceSandboxOptions` -`interface` +`interface` — Define options for ensuring a workspace sandbox with provisioning and progress handling ```ts interface EnsureWorkspaceSandboxOptions @@ -2936,7 +2936,7 @@ interface EnsureWorkspaceSandboxOptions ### `estimateTextHeight` -`function` +`function` — Estimate the height of multiline text based on font size and line height ```ts (element: Pick) => number @@ -2944,7 +2944,7 @@ interface EnsureWorkspaceSandboxOptions ### `ExpiringCapabilityTokenOptions` -`interface` +`interface` — Define options for capability tokens that expire after a specified lifetime in milliseconds ```ts interface ExpiringCapabilityTokenOptions @@ -2952,7 +2952,7 @@ interface ExpiringCapabilityTokenOptions ### `EXPORT_PRESETS` -`const` +`const` — Provide predefined export configurations for various social media and image formats ```ts Record @@ -2960,7 +2960,7 @@ Record ### `ExportCropRect` -`interface` +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds ```ts interface ExportCropRect @@ -2968,7 +2968,7 @@ interface ExportCropRect ### `ExportFormat` -`type` +`type` — Define supported image export formats as PNG or JPEG ```ts type ExportFormat @@ -2984,7 +2984,7 @@ interface ExportPreset ### `ExtendSequenceOperation` -`interface` +`interface` — Define an operation to extend a sequence by a specified number of frames ```ts interface ExtendSequenceOperation @@ -3016,7 +3016,7 @@ interface ExtendSequenceOperation ### `fieldAcceptsFreeText` -`function` +`function` — Determine if a chat interaction field allows free text input ```ts (field: ChatInteractionField) => boolean @@ -3024,7 +3024,7 @@ interface ExtendSequenceOperation ### `finalizeAssistantParts` -`function` +`function` — Resolve and clean up assistant parts by terminalizing and collapsing redundant segments ```ts (partOrder: string[], partMap: Map, finalText: string) => JsonRecord[] @@ -3040,7 +3040,7 @@ interface ExtendSequenceOperation ### `findCanvasMcpTool` -`function` +`function` — Find the canvas MCP tool definition matching the given name or return undefined ```ts (name: string) => McpToolDefinition | undefined @@ -3064,7 +3064,7 @@ interface ExtendSequenceOperation ### `findPreset` -`function` +`function` — Resolve a size preset by its identifier or return null if not found ```ts (id: string) => SizePreset | null @@ -3072,7 +3072,7 @@ interface ExtendSequenceOperation ### `findSequenceMcpTool` -`function` +`function` — Resolve the SequenceMcpToolDefinition matching the given name or return undefined ```ts (name: string) => SequenceMcpToolDefinition | undefined @@ -3080,7 +3080,7 @@ interface ExtendSequenceOperation ### `flattenHistory` -`function` +`function` — Build a single string combining conversation history and the current user message ```ts (message: string, history?: { role: "user" | "assistant"; content: string; }[] | undefined) => string @@ -3096,7 +3096,7 @@ interface FlowSpan ### `FlowTrace` -`interface` +`interface` — Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls ```ts interface FlowTrace @@ -3112,7 +3112,7 @@ interface FlowTrace ### `formatSeconds` -`function` +`function` — Format a number of seconds into a string with integer or two-decimal precision suffix s ```ts (seconds: number) => string @@ -3128,7 +3128,7 @@ interface FlowTrace ### `framesToSeconds` -`function` +`function` — Convert a frame count to seconds based on the given frames per second rate ```ts (frames: number, fps: number) => number @@ -3136,7 +3136,7 @@ interface FlowTrace ### `getClient` -`function` +`function` — Resolve a synchronous sandbox client from provided runtime configuration credentials ```ts (shell: SandboxRuntimeConfig) => SandboxClient @@ -3144,7 +3144,7 @@ interface FlowTrace ### `getPartKey` -`function` +`function` — Resolve a unique key string for a part based on its type and identifying properties ```ts (part: JsonRecord) => string @@ -3152,7 +3152,7 @@ interface FlowTrace ### `GroupElement` -`interface` +`interface` — Define a group element that contains multiple child scene elements ```ts interface GroupElement @@ -3160,7 +3160,7 @@ interface GroupElement ### `GroupElementsOperation` -`interface` +`interface` — Group elements by grouping two or more sibling elements in their current z-order under a new group ID ```ts interface GroupElementsOperation @@ -3176,7 +3176,7 @@ interface GroupElementsOperation ### `HandleToolRequestOptions` -`interface` +`interface` — Define options for handling tool requests including tool identification and token verification ```ts interface HandleToolRequestOptions @@ -3184,7 +3184,7 @@ interface HandleToolRequestOptions ### `Harness` -`type` +`type` — Resolve a valid harness identifier from the predefined KNOWN_HARNESSES array ```ts type Harness @@ -3208,7 +3208,7 @@ type Harness ### `HttpHeadProbeConfig` -`interface` +`interface` — Define configuration options for performing an HTTP HEAD probe to check URL availability ```ts interface HttpHeadProbeConfig @@ -3224,7 +3224,7 @@ class HubExecClient ### `HubExecClientOptions` -`interface` +`interface` — Define configuration options for initializing a Hub execution client ```ts interface HubExecClientOptions @@ -3248,7 +3248,7 @@ type HubExecResult ### `HubInvokeDeps` -`interface` +`interface` — Define dependencies for invoking hub operations including API key resolution and optional configuration ```ts interface HubInvokeDeps @@ -3256,7 +3256,7 @@ interface HubInvokeDeps ### `HubInvokeInput` -`interface` +`interface` — Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments ```ts interface HubInvokeInput @@ -3264,7 +3264,7 @@ interface HubInvokeInput ### `HubInvokeOutcome` -`interface` +`interface` — Describe the outcome of a hub invocation including status and response body ```ts interface HubInvokeOutcome @@ -3272,7 +3272,7 @@ interface HubInvokeOutcome ### `ImageBackground` -`type` +`type` — Define image background styles as color, gradient, or image with optional overlay settings ```ts type ImageBackground @@ -3280,7 +3280,7 @@ type ImageBackground ### `ImageContent` -`interface` +`interface` — Define the structure for image content containing an array of image slides ```ts interface ImageContent @@ -3288,7 +3288,7 @@ interface ImageContent ### `ImageContentSchema` -`const` +`const` — Validate image content with an array of one or more slides containing background details ```ts ZodObject<{ slides: ZodArray; valu… @@ -3296,7 +3296,7 @@ ZodObject<{ slides: ZodArray string @@ -3544,7 +3544,7 @@ type InteractionRequestWire ### `InteractionRouteLogger` -`type` +`type` — Provide logging methods for warnings and errors in interaction routes ```ts type InteractionRouteLogger @@ -3568,7 +3568,7 @@ type InteractionRouteLogger ### `isAppToolName` -`function` +`function` — Determine if a string matches a valid application tool name ```ts (name: string) => name is "submit_proposal" | "schedule_followup" | "render_ui" | "add_citation" @@ -3584,7 +3584,7 @@ type InteractionRouteLogger ### `isChatInteractionPart` -`function` +`function` — Resolve whether a ChatMessagePart is a ChatInteractionPart based on its type property ```ts (part: ChatMessagePart) => part is ChatInteractionPart @@ -3600,7 +3600,7 @@ type InteractionRouteLogger ### `isChatPlanPart` -`function` +`function` — Resolve whether a chat message part is a persisted chat plan part ```ts (part: ChatMessagePart) => part is ChatPlanPersistedPart @@ -3608,7 +3608,7 @@ type InteractionRouteLogger ### `isChatStepFinishPart` -`function` +`function` — Determine if a chat message part represents the completion of a chat step ```ts (part: ChatMessagePart) => part is ChatStepFinishPart @@ -3616,7 +3616,7 @@ type InteractionRouteLogger ### `isChatTextPart` -`function` +`function` — Resolve whether a chat message part is a text part based on its type property ```ts (part: ChatMessagePart) => part is ChatTextPart @@ -3624,7 +3624,7 @@ type InteractionRouteLogger ### `isChatToolPart` -`function` +`function` — Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property ```ts (part: ChatMessagePart) => part is ChatToolPart @@ -3632,7 +3632,7 @@ type InteractionRouteLogger ### `isHarness` -`function` +`function` — Determine if a value is a recognized harness string identifier ```ts (value: unknown) => value is "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids"… @@ -3664,7 +3664,7 @@ type InteractionRouteLogger ### `isRenderableInteractionKind` -`function` +`function` — Resolve if the given interaction kind is renderable within the application context ```ts (kind: string) => boolean @@ -3696,7 +3696,7 @@ type InteractionRouteLogger ### `isTangleExecutionKeyError` -`function` +`function` — Identify whether an error is a TangleExecutionKeyError based on its properties and type ```ts (error: unknown) => error is TangleExecutionKeyError @@ -3704,7 +3704,7 @@ type InteractionRouteLogger ### `isTerminalInteractionStatus` -`function` +`function` — Resolve if the interaction status is a terminal state excluding pending ```ts (status: ChatInteractionStatus) => boolean @@ -3712,7 +3712,7 @@ type InteractionRouteLogger ### `isTerminalPromptEvent` -`function` +`function` — Determine if an event is a terminal prompt event with type 'result' or 'done ```ts (event: unknown) => boolean @@ -3728,7 +3728,7 @@ type JsonObject ### `JsonRecord` -`type` +`type` — Represent a JSON-compatible object with string keys and values of any type ```ts type JsonRecord @@ -3768,7 +3768,7 @@ interface KnowledgeDecider ### `KnowledgeDeciderInput` -`interface` +`interface` — Define the input parameters required to decide knowledge proposals within an agent-knowledge loop ```ts interface KnowledgeDeciderInput @@ -3776,7 +3776,7 @@ interface KnowledgeDeciderInput ### `KnowledgeDecision` -`interface` +`interface` — Define a decision containing a candidate and the gate's verdict on that candidate ```ts interface KnowledgeDecision @@ -3816,7 +3816,7 @@ interface KnowledgeLoopDriver ### `KnowledgeRequirementSpec` -`interface` +`interface` — Define the criteria and conditions required to satisfy a specific knowledge requirement ```ts interface KnowledgeRequirementSpec @@ -3824,7 +3824,7 @@ interface KnowledgeRequirementSpec ### `KnowledgeSignal` -`interface` +`interface` — Define a signal representing knowledge with confidence level and optional supporting evidence ```ts interface KnowledgeSignal @@ -3864,7 +3864,7 @@ interface KvLike ### `LanguageFanoutOptions` -`interface` +`interface` — Define options to specify target languages and an optional source language for fan-out operations ```ts interface LanguageFanoutOptions @@ -3880,7 +3880,7 @@ interface LanguageFanoutOptions ### `lightTheme` -`const` +`const` — Define a light color theme with specific background, foreground, and accent color values ```ts AgentAppTheme @@ -3888,7 +3888,7 @@ AgentAppTheme ### `LineElement` -`interface` +`interface` — Define a line element with points, stroke, stroke width, and optional dash pattern ```ts interface LineElement @@ -3912,7 +3912,7 @@ interface LineElement ### `LivenessProbeConfig` -`interface` +`interface` — Define configuration for liveness probes including sidecar process pattern and optional timeouts ```ts interface LivenessProbeConfig @@ -4016,7 +4016,7 @@ readonly ["2025-06-18", "2025-03-26", "2024-11-05"] ### `McpProtocolVersion` -`type` +`type` — Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array ```ts type McpProtocolVersion @@ -4024,7 +4024,7 @@ type McpProtocolVersion ### `McpServerInfo` -`interface` +`interface` — Describe the structure of server information including name and version ```ts interface McpServerInfo @@ -4040,7 +4040,7 @@ interface McpToolDefinition ### `MemberSyncSeam` -`interface` +`interface` — Map workspace roles to corresponding sandbox permission levels ```ts interface MemberSyncSeam @@ -4064,7 +4064,7 @@ interface MemberSyncSeam ### `mergeExtraMcp` -`function` +`function` — Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys ```ts (appToolMcp: Record, baseProfileMcp: Record, extra: Recor… @@ -4088,7 +4088,7 @@ interface MemberSyncSeam ### `mergePersistedPart` -`function` +`function` — Merge incoming JSON with existing persisted data, applying delta for text types when provided ```ts (existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string | undefined) => JsonRecord @@ -4104,7 +4104,7 @@ interface MemberSyncSeam ### `messageHasTurnId` -`function` +`function` — Resolve whether a message contains any part with the specified turn ID ```ts (message: PersistedChatMessageForTurn, turnId: string) => boolean @@ -4128,7 +4128,7 @@ interface MemberSyncSeam ### `mintTerminalProxyToken` -`function` +`function` — Generate a signed token for TerminalProxyIdentity with an expiration based on TTL milliseconds ```ts (secret: string, identity: TerminalProxyIdentity, ttlMs?: number, now?: () => number) => Promise string | undefined @@ -4496,7 +4496,7 @@ MissionEventSink ### `normalizePersistedPart` -`function` +`function` — Normalize a persisted part object by standardizing its structure and fields ```ts (rawPart: JsonRecord) => JsonRecord | null @@ -4504,7 +4504,7 @@ MissionEventSink ### `normalizePlanDecision` -`function` +`function` — Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs ```ts (value: unknown) => DurablePlanDecision | null @@ -4512,7 +4512,7 @@ MissionEventSink ### `normalizeTime` -`function` +`function` — Resolve time properties from various keys into a normalized record with numeric start and end fields ```ts (value: unknown) => JsonRecord | undefined @@ -4520,7 +4520,7 @@ MissionEventSink ### `normalizeToolEvent` -`function` +`function` — Normalize tool-related events into a standardized message.part.updated format ```ts (event: StreamEvent) => StreamEvent @@ -4528,7 +4528,7 @@ MissionEventSink ### `NoticeKind` -`type` +`type` — Define specific string literals representing different kinds of notices ```ts type NoticeKind @@ -4544,7 +4544,7 @@ type NoticeKind ### `noticePartKey` -`function` +`function` — Generate a unique key string for a notice using the given identifier ```ts (id: string) => string @@ -4552,7 +4552,7 @@ type NoticeKind ### `NoticePersistedPart` -`type` +`type` — Define a persisted notice part with type, id, kind, and text properties ```ts type NoticePersistedPart @@ -4592,7 +4592,7 @@ interface ObjectStore ### `OpenAICompatStreamTurnOptions` -`interface` +`interface` — Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools ```ts interface OpenAICompatStreamTurnOptions @@ -4616,7 +4616,7 @@ interface OpenAIStreamChunk ### `OtioClip` -`interface` +`interface` — Define a clip object with metadata, source range, and media reference according to OTIO schema ```ts interface OtioClip @@ -4624,7 +4624,7 @@ interface OtioClip ### `OtioExternalReference` -`interface` +`interface` — Define the structure for an external media reference with schema, URL, and optional time range ```ts interface OtioExternalReference @@ -4632,7 +4632,7 @@ interface OtioExternalReference ### `OtioGap` -`interface` +`interface` — Define the structure for a gap element with schema, name, and source time range properties ```ts interface OtioGap @@ -4640,7 +4640,7 @@ interface OtioGap ### `OtioMissingReference` -`interface` +`interface` — Represent missing references in OTIO with a fixed schema identifier ```ts interface OtioMissingReference @@ -4648,7 +4648,7 @@ interface OtioMissingReference ### `OtioRationalTime` -`interface` +`interface` — Represent a rational time value with a specific rate and numeric value for OTIO schema ```ts interface OtioRationalTime @@ -4656,7 +4656,7 @@ interface OtioRationalTime ### `OtioStack` -`interface` +`interface` — Represent a stack container holding a named collection of OtioTrack children ```ts interface OtioStack @@ -4664,7 +4664,7 @@ interface OtioStack ### `OtioTimeline` -`interface` +`interface` — Define the structure of a timeline with metadata, tracks, and global start time in OTIO format ```ts interface OtioTimeline @@ -4672,7 +4672,7 @@ interface OtioTimeline ### `OtioTimeRange` -`interface` +`interface` — Define a time range with a start time and duration using OtioRationalTime values ```ts interface OtioTimeRange @@ -4680,7 +4680,7 @@ interface OtioTimeRange ### `OtioTrack` -`interface` +`interface` — Define a track containing video or audio clips with metadata and child elements ```ts interface OtioTrack @@ -4688,7 +4688,7 @@ interface OtioTrack ### `Outcome` -`type` +`type` — Represent success or failure of an operation with corresponding value or error information ```ts type Outcome @@ -4736,7 +4736,7 @@ interface ParsedIntegrationAction ### `ParsedMission` -`interface` +`interface` — Describe a mission with a title and an ordered list of parsed steps ```ts interface ParsedMission @@ -4744,7 +4744,7 @@ interface ParsedMission ### `ParsedMissionStep` -`interface` +`interface` — Define the structure representing a parsed mission step with id, kind, and intent fields ```ts interface ParsedMissionStep @@ -4760,7 +4760,7 @@ interface ParsedMissionStep ### `ParseInteractionAnswersResult` -`type` +`type` — Resolve the result of parsing interaction answers with success status and corresponding data or error message ```ts type ParseInteractionAnswersResult @@ -4768,7 +4768,7 @@ type ParseInteractionAnswersResult ### `parseInteractionCancel` -`function` +`function` — Parse interaction cancel data and return success status with parsed value or error message ```ts (data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;… @@ -4784,7 +4784,7 @@ type ParseInteractionAnswersResult ### `ParseInteractionResult` -`type` +`type` — Resolve interaction parsing outcome as success with value or failure with error message ```ts type ParseInteractionResult @@ -4808,7 +4808,7 @@ type ParseInteractionResult ### `ParseMissionBlocksOptions` -`interface` +`interface` — Define options to specify allowed lowercase step kinds for parsing mission blocks ```ts interface ParseMissionBlocksOptions @@ -4824,7 +4824,7 @@ interface ParseMissionBlocksOptions ### `ParsePlanSubmittedResult` -`type` +`type` — Resolve the result of parsing a plan submission into success with value or failure with error ```ts type ParsePlanSubmittedResult @@ -4864,7 +4864,7 @@ type PeekWorkspaceSandboxOutcome ### `PersistedChatMessageForTurn` -`interface` +`interface` — Define the structure of a chat message stored for a specific conversation turn ```ts interface PersistedChatMessageForTurn @@ -4880,7 +4880,7 @@ interface PersistedChatMessageForTurn ### `persistedPartToPlan` -`function` +`function` — Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan ```ts (part: Record) => ChatPlan | null @@ -4888,7 +4888,7 @@ interface PersistedChatMessageForTurn ### `PlaceClipOperation` -`interface` +`interface` — Define an operation to place a media clip with timing, track, and playback options ```ts interface PlaceClipOperation @@ -4904,7 +4904,7 @@ interface PlaceClipOperation ### `planAuthorityIdempotencyKey` -`function` +`function` — Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision ```ts (scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string @@ -4912,7 +4912,7 @@ interface PlaceClipOperation ### `planCommandKey` -`function` +`function` — Generate a unique key string for a plan command using plan ID, revision, and decision ```ts (planId: string, revision: number, decision: DurablePlanDecision) => string @@ -4920,7 +4920,7 @@ interface PlaceClipOperation ### `planEffectKey` -`function` +`function` — Generate a unique string key representing the effect of a plan decision within a given scope and revision ```ts (scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string @@ -4928,7 +4928,7 @@ interface PlaceClipOperation ### `planFollowUpTurnId` -`function` +`function` — Generate a unique follow-up turn ID based on the plan ID and its outcome ```ts (planId: string, outcome: "approved" | "rejected") => string @@ -4960,7 +4960,7 @@ type PlanOutcome ### `planPartKey` -`function` +`function` — Generate a unique key string for a given plan identifier ```ts (planId: string) => string @@ -4968,7 +4968,7 @@ type PlanOutcome ### `planRevisionKey` -`function` +`function` — Generate a unique key string for a plan based on its ID and revision number ```ts (planId: string, revision: number) => string @@ -4976,7 +4976,7 @@ type PlanOutcome ### `planToPersistedPart` -`function` +`function` — Resolve a ChatPlan into its persisted part representation for storage or transmission ```ts (plan: ChatPlan) => ChatPlanPersistedPart @@ -4992,7 +4992,7 @@ interface PlatformBalanceInfo ### `PlatformBalanceManager` -`interface` +`interface` — Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking ```ts interface PlatformBalanceManager @@ -5000,7 +5000,7 @@ interface PlatformBalanceManager ### `PlatformBalanceManagerOptions` -`interface` +`interface` — Define configuration options for managing platform balance based on billing plans ```ts interface PlatformBalanceManagerOptions @@ -5064,7 +5064,7 @@ interface PreflightReport ### `PreparedDurableInteractionAnswer` -`interface` +`interface` — Define a structured response containing scope, settlement, and intent for durable interactions ```ts interface PreparedDurableInteractionAnswer @@ -5088,7 +5088,7 @@ readonly string[] ### `PresetBillingOptions` -`interface` +`interface` — Define preset billing options including database, provisioner, encryption key, budget, and optional settings ```ts interface PresetBillingOptions @@ -5096,7 +5096,7 @@ interface PresetBillingOptions ### `PresetKnowledgeAccessorOptions` -`interface` +`interface` — Define options for accessing preset knowledge scoped to a specific workspace and configuration ```ts interface PresetKnowledgeAccessorOptions @@ -5104,7 +5104,7 @@ interface PresetKnowledgeAccessorOptions ### `PresetToolHandlerOptions` -`interface` +`interface` — Define configuration options for handling preset tools including database, vault, and optional utilities ```ts interface PresetToolHandlerOptions @@ -5128,7 +5128,7 @@ interface ProducedState ### `ProfileComposeOptions` -`interface` +`interface` — Define options for composing a user profile including prompts, files, servers, and name ```ts interface ProfileComposeOptions @@ -5136,7 +5136,7 @@ interface ProfileComposeOptions ### `PromptInputPart` -`type` +`type` — Extract a single element type from the array parameter of SandboxInstance's streamPrompt method ```ts type PromptInputPart @@ -5144,7 +5144,7 @@ type PromptInputPart ### `ProviderResolutionConfig` -`interface` +`interface` — Define configuration options for resolving a provider and its model with optional API keys and routing details ```ts interface ProviderResolutionConfig @@ -5184,7 +5184,7 @@ interface ProvisionProfileSection ### `PumpBufferedTurnOptions` -`interface` +`interface` — Define options to pump data from an asynchronous iterable source with buffered turn control ```ts interface PumpBufferedTurnOptions @@ -5208,7 +5208,7 @@ interface PutObjectOptions ### `QueueExportOperation` -`interface` +`interface` — Define the structure for a queue export operation with format and optional metadata ```ts interface QueueExportOperation @@ -5240,7 +5240,7 @@ interface R2LikeObjectHead ### `RateLimitResult` -`interface` +`interface` — Describe the outcome of a rate limit check including allowance, remaining count, and reset time ```ts interface RateLimitResult @@ -5264,7 +5264,7 @@ interface RateLimitResult ### `readSecret` -`function` +`function` — Resolve a secret value from the store by its name and return the outcome asynchronously ```ts (store: SecretStore, name: string) => Promise> @@ -5296,7 +5296,7 @@ interface RateLimitResult ### `RectElement` -`interface` +`interface` — Define a rectangular scene element with size, fill, optional stroke, and corner radius properties ```ts interface RectElement @@ -5312,7 +5312,7 @@ type RedactedDocSegment ### `RedactedDocument` -`interface` +`interface` — Define a document composed of multiple redacted content segments ```ts interface RedactedDocument @@ -5328,7 +5328,7 @@ interface RedactedDocument ### `RedactForIngestionOptions` -`interface` +`interface` — Define options to customize sensitive data redaction patterns and key names for ingestion ```ts interface RedactForIngestionOptions @@ -5368,7 +5368,7 @@ interface RedactionSpan ### `RenderUiArgs` -`interface` +`interface` — Define arguments required to render a UI including title and schema ```ts interface RenderUiArgs @@ -5376,7 +5376,7 @@ interface RenderUiArgs ### `RenderUiResult` -`interface` +`interface` — Describe the result of rendering UI including the artifact path and exact persisted content ```ts interface RenderUiResult @@ -5392,7 +5392,7 @@ interface RenderUiResult ### `ReorderElementOperation` -`interface` +`interface` — Resolve an operation to reorder an element within its current owner by specifying the target index ```ts interface ReorderElementOperation @@ -5400,7 +5400,7 @@ interface ReorderElementOperation ### `ReorderPageOperation` -`interface` +`interface` — Represent an operation to reorder a page by moving it to a specified index ```ts interface ReorderPageOperation @@ -5416,7 +5416,7 @@ interface ReorderPageOperation ### `ReplayTurnEventsOptions` -`interface` +`interface` — Define options for replaying turn events with control over sequence, polling, and timeout ```ts interface ReplayTurnEventsOptions @@ -5424,7 +5424,7 @@ interface ReplayTurnEventsOptions ### `RequestContext` -`interface` +`interface` — Define the context of a request including IP address, user agent, timestamp, and request ID ```ts interface RequestContext @@ -5440,7 +5440,7 @@ interface RequestContext ### `requireElement` -`function` +`function` — Resolve and return the element, its owner array, and index from the page by element ID ```ts (page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; } @@ -5448,7 +5448,7 @@ interface RequestContext ### `requirePage` -`function` +`function` — Resolve and return a page by ID from a document or throw an error if not found ```ts (document: SceneDocument, pageId: string) => ScenePage @@ -5464,7 +5464,7 @@ interface RequestContext ### `resetClientCache` -`function` +`function` — Reset the client cache to clear stored data and force fresh retrieval ```ts () => void @@ -5488,7 +5488,7 @@ interface RequestContext ### `resolveChatTurn` -`function` +`function` — Resolve a chat turn by determining message reuse and constructing user message parts ```ts (input: { existingMessages: PersistedChatMessageForTurn[]; userContent: string; turnId?: string | undefined; }) => Reso… @@ -5504,7 +5504,7 @@ interface ResolvedAgentProfile ### `ResolvedChatTurn` -`interface` +`interface` — Represent a chat turn with resolved user message insertion and prior message context ```ts interface ResolvedChatTurn @@ -5512,7 +5512,7 @@ interface ResolvedChatTurn ### `ResolvedModel` -`interface` +`interface` — Represent a fully configured model with optional API key and base URL for sandbox platform integration ```ts interface ResolvedModel @@ -5520,7 +5520,7 @@ interface ResolvedModel ### `ResolvedSessionHarness` -`interface` +`interface` — Represent resolved session state including harness, lock status, and swap attempt flag ```ts interface ResolvedSessionHarness @@ -5528,7 +5528,7 @@ interface ResolvedSessionHarness ### `ResolvedTangleExecutionKey` -`interface` +`interface` — Define a resolved key combining an API key with its Tangle execution source ```ts interface ResolvedTangleExecutionKey @@ -5536,7 +5536,7 @@ interface ResolvedTangleExecutionKey ### `ResolvedToolCapabilities` -`interface` +`interface` — Describe resolved capabilities including proposal types and product tool groups to expose ```ts interface ResolvedToolCapabilities @@ -5552,7 +5552,7 @@ interface ResolvedToolCapabilities ### `ResolveInteractionConnectionArgs` -`interface` +`interface` — Define arguments required to resolve interaction connections based on request and intent ```ts interface ResolveInteractionConnectionArgs @@ -5560,7 +5560,7 @@ interface ResolveInteractionConnectionArgs ### `resolveModel` -`function` +`function` — Resolve and return the appropriate model configuration based on provider settings and optional overrides ```ts (config: ProviderResolutionConfig | undefined, override?: { model?: string | undefined; modelApiKey?: string | undefine… @@ -5568,7 +5568,7 @@ interface ResolveInteractionConnectionArgs ### `ResolveModelOptions` -`interface` +`interface` — Resolve options for model configuration including environment variables and default router base URL ```ts interface ResolveModelOptions @@ -5584,7 +5584,7 @@ interface ResolveModelOptions ### `resolveSandboxClientCredentials` -`function` +`function` — Resolve sandbox client credentials based on environment and provided options asynchronously ```ts (options?: ResolveSandboxClientCredentialsOptions) => Promise @@ -5592,7 +5592,7 @@ interface ResolveModelOptions ### `ResolveSandboxClientCredentialsOptions` -`interface` +`interface` — Resolve options for obtaining sandbox client credentials from environment variables and classification ```ts interface ResolveSandboxClientCredentialsOptions @@ -5608,7 +5608,7 @@ interface ResolveSandboxClientCredentialsOptions ### `ResolveSessionHarnessInput` -`interface` +`interface` — Resolve input options to determine the appropriate session harness to use ```ts interface ResolveSessionHarnessInput @@ -5624,7 +5624,7 @@ interface ResolveSessionHarnessInput ### `ResolveTangleDevOrUserKeyOptions` -`interface` +`interface` — Resolve options for retrieving a Tangle developer or user API key based on environment and context ```ts interface ResolveTangleDevOrUserKeyOptions @@ -5632,7 +5632,7 @@ interface ResolveTangleDevOrUserKeyOptions ### `resolveTangleExecutionEnvironment` -`function` +`function` — Resolve the current Tangle execution environment based on provided or process environment variables ```ts (env?: Record) => TangleExecutionEnvironment @@ -5656,7 +5656,7 @@ interface ResolveTangleDevOrUserKeyOptions ### `ResolveToolCapabilitiesOptions` -`interface` +`interface` — Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs ```ts interface ResolveToolCapabilitiesOptions @@ -5664,7 +5664,7 @@ interface ResolveToolCapabilitiesOptions ### `resolveToolId` -`function` +`function` — Resolve a unique tool identifier from various possible properties or generate a fallback ID ```ts (part: JsonRecord) => string @@ -5672,7 +5672,7 @@ interface ResolveToolCapabilitiesOptions ### `resolveToolName` -`function` +`function` — Resolve the tool name from a JSON record using tool, name, or a default value ```ts (part: JsonRecord) => string @@ -5688,7 +5688,7 @@ interface ResolveToolCapabilitiesOptions ### `resolveUserTangleExecutionKeyForUser` -`function` +`function` — Resolve the Tangle execution key for a specified user using provided environment and API key options ```ts (opts: ResolveUserTangleExecutionKeyForUserOptions) => Promise @@ -5696,7 +5696,7 @@ interface ResolveToolCapabilitiesOptions ### `ResolveUserTangleExecutionKeyForUserOptions` -`interface` +`interface` — Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters ```ts interface ResolveUserTangleExecutionKeyForUserOptions @@ -5704,7 +5704,7 @@ interface ResolveUserTangleExecutionKeyForUserOptions ### `ResolveUserTangleExecutionKeyOptions` -`interface` +`interface` — Resolve options for retrieving user API keys within a specific Tangle execution environment ```ts interface ResolveUserTangleExecutionKeyOptions @@ -5736,7 +5736,7 @@ class RetryableStepError ### `RevealResult` -`interface` +`interface` — Describe the outcome of a reveal operation including success status, value, and failure reason ```ts interface RevealResult @@ -5752,7 +5752,7 @@ interface RevealResult ### `RevealSpanOptions` -`interface` +`interface` — Define options to decrypt, authorize, and audit the reveal of a span segment ```ts interface RevealSpanOptions @@ -5776,7 +5776,7 @@ interface RevealSpanOptions ### `RouterChatProbeConfig` -`interface` +`interface` — Define configuration options for probing an LLM router with authentication and model details ```ts interface RouterChatProbeConfig @@ -5808,7 +5808,7 @@ interface RouterModel ### `runSandboxPrompt` -`function` +`function` — Resolve a sandbox prompt by streaming and aggregating message parts into a complete string ```ts (shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… @@ -5816,7 +5816,7 @@ interface RouterModel ### `runSandboxToolPathSetup` -`function` +`function` — Resolve the sandbox environment PATH setup by executing the configuration script with given options ```ts (box: SandboxInstance, options: SandboxToolPathOptions) => Promise> @@ -5832,7 +5832,7 @@ type RuntimeEventLike ### `RuntimeExecutorOptions` -`interface` +`interface` — Define options for executing runtime tasks with a trusted per-turn context ```ts interface RuntimeExecutorOptions @@ -5848,7 +5848,7 @@ interface RuntimeExecutorOptions ### `SandboxApiCredentials` -`interface` +`interface` — Define credentials required to access the sandbox API environment ```ts interface SandboxApiCredentials @@ -5864,7 +5864,7 @@ interface SandboxApiCredentials ### `SandboxAuthProbeConfig` -`interface` +`interface` — Define configuration options for probing sandbox authentication endpoints ```ts interface SandboxAuthProbeConfig @@ -5872,7 +5872,7 @@ interface SandboxAuthProbeConfig ### `SandboxBuildContext` -`interface` +`interface` — Define the context for building a sandbox including workspace, integrations, and optional user ID ```ts interface SandboxBuildContext @@ -5880,7 +5880,7 @@ interface SandboxBuildContext ### `SandboxClientCredentials` -`interface` +`interface` — Define client credentials for accessing the sandbox environment with API key and base URL ```ts interface SandboxClientCredentials @@ -5904,7 +5904,7 @@ type SandboxDispatch ### `SandboxDispatchDoneResult` -`interface` +`interface` — Define the result of a completed sandbox dispatch including artifact reference and optional cost details ```ts interface SandboxDispatchDoneResult @@ -5920,7 +5920,7 @@ interface SandboxDispatchInProgressResult ### `SandboxDispatchInput` -`interface` +`interface` — Define input parameters for dispatching a mission step in the sandbox environment ```ts interface SandboxDispatchInput @@ -5928,7 +5928,7 @@ interface SandboxDispatchInput ### `SandboxDispatchResult` -`type` +`type` — Resolve the result of a sandbox dispatch as done or in progress ```ts type SandboxDispatchResult @@ -5944,7 +5944,7 @@ interface SandboxExecChannel ### `SandboxExecOptions` -`interface` +`interface` — Define options to execute code within a sandbox environment with optional session control ```ts interface SandboxExecOptions @@ -5952,7 +5952,7 @@ interface SandboxExecOptions ### `SandboxFileBytesOutcome` -`type` +`type` — Represent the outcome of reading sandbox file bytes with success status and corresponding data or error ```ts type SandboxFileBytesOutcome @@ -5960,7 +5960,7 @@ type SandboxFileBytesOutcome ### `SandboxFileSizeOutcome` -`type` +`type` — Resolve the outcome of a sandbox file size check with success status and value or error message ```ts type SandboxFileSizeOutcome @@ -5968,7 +5968,7 @@ type SandboxFileSizeOutcome ### `SandboxPermissionLevel` -`type` +`type` — Define permission levels for sandbox access and control ```ts type SandboxPermissionLevel @@ -5976,7 +5976,7 @@ type SandboxPermissionLevel ### `SandboxResourceConfig` -`interface` +`interface` — Define configuration parameters for sandbox resource allocation and lifecycle management ```ts interface SandboxResourceConfig @@ -5984,7 +5984,7 @@ interface SandboxResourceConfig ### `SandboxRestoreSpec` -`interface` +`interface` — Define the specification for restoring a sandbox from a snapshot or another sandbox ID ```ts interface SandboxRestoreSpec @@ -5992,7 +5992,7 @@ interface SandboxRestoreSpec ### `SandboxRuntimeAuthRefreshError` -`class` +`class` — Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name ```ts class SandboxRuntimeAuthRefreshError @@ -6000,7 +6000,7 @@ class SandboxRuntimeAuthRefreshError ### `SandboxRuntimeConfig` -`interface` +`interface` — Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions ```ts interface SandboxRuntimeConfig @@ -6008,7 +6008,7 @@ interface SandboxRuntimeConfig ### `SandboxRuntimeConnection` -`interface` +`interface` — Define a connection configuration for sandbox runtime including URL and optional server-side auth token ```ts interface SandboxRuntimeConnection @@ -6016,7 +6016,7 @@ interface SandboxRuntimeConnection ### `SandboxScope` -`interface` +`interface` — Define a scope containing workspace and optional user identifiers for sandbox environments ```ts interface SandboxScope @@ -6024,7 +6024,7 @@ interface SandboxScope ### `SandboxStepTransition` -`type` +`type` — Define transitions marking the start or finish of a sandbox step with associated details ```ts type SandboxStepTransition @@ -6032,7 +6032,7 @@ type SandboxStepTransition ### `SandboxTerminalTokenOptions` -`interface` +`interface` — Define options for generating a sandbox terminal token including secret and expiration settings ```ts interface SandboxTerminalTokenOptions @@ -6040,7 +6040,7 @@ interface SandboxTerminalTokenOptions ### `SandboxTerminalTokenResult` -`interface` +`interface` — Provide token and expiration details for a sandbox terminal session ```ts interface SandboxTerminalTokenResult @@ -6048,7 +6048,7 @@ interface SandboxTerminalTokenResult ### `SandboxTerminalTokenSubject` -`type` +`type` — Resolve the identity type used for sandbox terminal token subjects ```ts type SandboxTerminalTokenSubject @@ -6056,7 +6056,7 @@ type SandboxTerminalTokenSubject ### `SandboxTerminalWsMatch` -`interface` +`interface` — Define the structure for matching a sandbox terminal WebSocket with workspace and path details ```ts interface SandboxTerminalWsMatch @@ -6064,7 +6064,7 @@ interface SandboxTerminalWsMatch ### `sandboxToolBinDir` -`function` +`function` — Resolve the binary directory path for a sandbox tool based on provided options ```ts (options: SandboxToolPathOptions) => string @@ -6072,7 +6072,7 @@ interface SandboxTerminalWsMatch ### `sandboxToolPath` -`function` +`function` — Resolve the file system path to a specified sandbox tool based on given options ```ts (options: SandboxToolPathOptions & { toolName: string; }) => string @@ -6080,7 +6080,7 @@ interface SandboxTerminalWsMatch ### `SandboxToolPathOptions` -`interface` +`interface` — Define options for resolving sandbox tool paths including appName, baseDir, and binDir ```ts interface SandboxToolPathOptions @@ -6088,7 +6088,7 @@ interface SandboxToolPathOptions ### `sandboxToolRootDir` -`function` +`function` — Resolve the root directory path for a sandbox tool based on provided options ```ts (options: SandboxToolPathOptions) => string @@ -6096,7 +6096,7 @@ interface SandboxToolPathOptions ### `SandboxToolSpec` -`interface` +`interface` — Define the specification for a sandbox tool including its name, content, and optional executability ```ts interface SandboxToolSpec @@ -6136,7 +6136,7 @@ type SatisfiedByRule ### `SCENE_ELEMENT_KINDS` -`const` +`const` — Define all valid kinds of scene elements used in the application ```ts readonly ("text" | "image" | "rect" | "video" | "ellipse" | "line" | "group")[] @@ -6144,7 +6144,7 @@ readonly ("text" | "image" | "rect" | "video" | "ellipse" | "line" | "group")[] ### `SCENE_OPERATION_TYPES` -`const` +`const` — Define all valid operation types for scene manipulation in the application ```ts readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | "group_elements" | "ungroup_element" | "… @@ -6152,7 +6152,7 @@ readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | " ### `SCENE_SCHEMA_VERSION` -`const` +`const` — Define the current version number of the scene schema ```ts 1 @@ -6160,7 +6160,7 @@ readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | " ### `SceneApplyResult` -`type` +`type` — Represent the result of applying changes to a scene as an element, page, or entire document ```ts type SceneApplyResult @@ -6176,7 +6176,7 @@ type SceneAttrsPatch ### `SceneDecision` -`interface` +`interface` — Define the structure for decisions made within a scene including type, instructions, and metadata ```ts interface SceneDecision @@ -6184,7 +6184,7 @@ interface SceneDecision ### `SceneDocument` -`interface` +`interface` — Define the structure and properties of a scene document including version, title, pages, settings, and metadata ```ts interface SceneDocument @@ -6192,7 +6192,7 @@ interface SceneDocument ### `SceneDocumentRecord` -`interface` +`interface` — Represent a scene document with its current revision number for version tracking ```ts interface SceneDocumentRecord @@ -6200,7 +6200,7 @@ interface SceneDocumentRecord ### `SceneElement` -`type` +`type` — Represent a graphical element in a scene including shapes, text, media, or groups ```ts type SceneElement @@ -6216,7 +6216,7 @@ interface SceneElementBase ### `SceneElementKind` -`type` +`type` — Extract the kind property from a SceneElement to identify its element type ```ts type SceneElementKind @@ -6224,7 +6224,7 @@ type SceneElementKind ### `SceneExportFormat` -`type` +`type` — Define supported formats for exporting a scene including image and JSON options ```ts type SceneExportFormat @@ -6232,7 +6232,7 @@ type SceneExportFormat ### `SceneExportRecord` -`interface` +`interface` — Describe a scene export with its status, format, metadata, and result information ```ts interface SceneExportRecord @@ -6240,7 +6240,7 @@ interface SceneExportRecord ### `SceneOperation` -`type` +`type` — Represent operations that modify scenes by adding, updating, reordering, grouping, or deleting elements and pages ```ts type SceneOperation @@ -6248,7 +6248,7 @@ type SceneOperation ### `SceneOperationType` -`type` +`type` — Extract the type property from a SceneOperation to represent its operation type ```ts type SceneOperationType @@ -6256,7 +6256,7 @@ type SceneOperationType ### `ScenePage` -`interface` +`interface` — Define the structure and properties of a scene page including layout, background, and elements ```ts interface ScenePage @@ -6264,7 +6264,7 @@ interface ScenePage ### `ScenePlan` -`interface` +`interface` — Define a plan summarizing a scene with its description and associated operations ```ts interface ScenePlan @@ -6272,7 +6272,7 @@ interface ScenePlan ### `SceneSettings` -`interface` +`interface` — Define settings for scene export including print conversion factor for unit calculations ```ts interface SceneSettings @@ -6280,7 +6280,7 @@ interface SceneSettings ### `SceneStore` -`interface` +`interface` — Manage scene documents, decisions, and exports with atomic save and revision control ```ts interface SceneStore @@ -6296,7 +6296,7 @@ interface SceneStoreScope ### `ScheduleFollowupArgs` -`interface` +`interface` — Define arguments required to schedule a follow-up with optional priority ```ts interface ScheduleFollowupArgs @@ -6304,7 +6304,7 @@ interface ScheduleFollowupArgs ### `ScheduleFollowupResult` -`interface` +`interface` — Define the result structure for scheduling a follow-up with unique identification and due date ```ts interface ScheduleFollowupResult @@ -6320,7 +6320,7 @@ interface ScopedMcpServerEntryOptions ### `ScopedTokenResult` -`interface` +`interface` — Represent a token with its expiration date and associated scope ```ts interface ScopedTokenResult @@ -6328,7 +6328,7 @@ interface ScopedTokenResult ### `secondsToFrames` -`function` +`function` — Convert seconds to the nearest whole number of frames based on frames per second ```ts (seconds: number, fps: number) => number @@ -6336,7 +6336,7 @@ interface ScopedTokenResult ### `SecretStore` -`interface` +`interface` — Define methods to create, update, retrieve, and delete secrets asynchronously ```ts interface SecretStore @@ -6344,7 +6344,7 @@ interface SecretStore ### `secretStoreFromClient` -`function` +`function` — Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell ```ts (shell: SandboxRuntimeConfig) => SecretStore @@ -6352,7 +6352,7 @@ interface SecretStore ### `SecurityHeaderOptions` -`interface` +`interface` — Define options for configuring security-related HTTP headers including disclaimers and retention labels ```ts interface SecurityHeaderOptions @@ -6360,7 +6360,7 @@ interface SecurityHeaderOptions ### `SEQUENCE_EXPORT_FORMATS` -`const` +`const` — Define supported export formats for sequence outputs including video, subtitle, and metadata types ```ts readonly ["mp4", "otio", "xml", "edl", "vtt", "srt", "contact_sheet"] @@ -6368,7 +6368,7 @@ readonly ["mp4", "otio", "xml", "edl", "vtt", "srt", "contact_sheet"] ### `SEQUENCE_MCP_TOOLS` -`const` +`const` — Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations ```ts readonly SequenceMcpToolDefinition[] @@ -6376,7 +6376,7 @@ readonly SequenceMcpToolDefinition[] ### `SEQUENCE_MEDIA_KINDS` -`const` +`const` — Define the allowed media kinds for sequences including video, image, and audio ```ts readonly ["video", "image", "audio"] @@ -6384,7 +6384,7 @@ readonly ["video", "image", "audio"] ### `SEQUENCE_OPERATION_TYPES` -`const` +`const` — List all valid sequence operation types used in editing workflows ```ts readonly ("place_clip" | "add_caption" | "move_clip" | "trim_clip" | "split_clip" | "set_clip_text" | "set_clip_disable… @@ -6392,7 +6392,7 @@ readonly ("place_clip" | "add_caption" | "move_clip" | "trim_clip" | "split_clip ### `SEQUENCE_TRACK_KINDS` -`const` +`const` — Define immutable sequence track kinds for video, audio, caption, reference, and agent ```ts readonly ["video", "audio", "caption", "reference", "agent"] @@ -6408,7 +6408,7 @@ type SequenceApplyResult ### `SequenceClip` -`interface` +`interface` — Define properties for a media sequence clip including timing, source, track, and caption details ```ts interface SequenceClip @@ -6424,7 +6424,7 @@ interface SequenceClipMedia ### `SequenceClipPatch` -`interface` +`interface` — Define optional properties to update or patch a sequence clip's attributes in a timeline ```ts interface SequenceClipPatch @@ -6440,7 +6440,7 @@ interface SequenceDecision ### `SequenceExportFormat` -`type` +`type` — Define export formats available for sequence data including video, subtitle, and metadata types ```ts type SequenceExportFormat @@ -6448,7 +6448,7 @@ type SequenceExportFormat ### `SequenceExportRecord` -`interface` +`interface` — Describe a record representing the export details and status of a sequence ```ts interface SequenceExportRecord @@ -6456,7 +6456,7 @@ interface SequenceExportRecord ### `SequenceExportStatus` -`type` +`type` — Represent export status of a sequence as queued, processing, completed, failed, or cancelled ```ts type SequenceExportStatus @@ -6472,7 +6472,7 @@ interface SequenceFrameSnapshot ### `SequenceMcpToolDefinition` -`interface` +`interface` — Define a tool with metadata and a run method for processing input within a specific environment ```ts interface SequenceMcpToolDefinition @@ -6488,7 +6488,7 @@ interface SequenceMcpToolEnv ### `SequenceMediaKind` -`type` +`type` — Define media types allowed in a sequence including video, image, and audio ```ts type SequenceMediaKind @@ -6496,7 +6496,7 @@ type SequenceMediaKind ### `SequenceMeta` -`interface` +`interface` — Describe metadata and properties of a media sequence including dimensions, duration, and status ```ts interface SequenceMeta @@ -6504,7 +6504,7 @@ interface SequenceMeta ### `SequenceOperation` -`type` +`type` — Represent sequence editing actions for manipulating clips, tracks, captions, and exports ```ts type SequenceOperation @@ -6520,7 +6520,7 @@ interface SequenceOperationContext ### `SequenceOperationType` -`type` +`type` — Extract the type of operation from a sequence operation object ```ts type SequenceOperationType @@ -6544,7 +6544,7 @@ readonly ["2025-06-18", "2025-03-26", "2024-11-05"] ### `SequencesMcpServerInfo` -`interface` +`interface` — Describe server information including name and version for Sequences MCP integration ```ts interface SequencesMcpServerInfo @@ -6552,7 +6552,7 @@ interface SequencesMcpServerInfo ### `SequenceStatus` -`type` +`type` — Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived ```ts type SequenceStatus @@ -6560,7 +6560,7 @@ type SequenceStatus ### `SequenceStore` -`interface` +`interface` — Manage sequences by providing methods to get timelines, clips, and modify tracks and clips ```ts interface SequenceStore @@ -6584,7 +6584,7 @@ interface SequenceTimeline ### `SequenceTrack` -`interface` +`interface` — Define properties and state for a sequence track including id, kind, name, order, and flags ```ts interface SequenceTrack @@ -6608,7 +6608,7 @@ type SequenceTrackKind ### `SetAttrsOperation` -`interface` +`interface` — Define an operation to update attributes of a specific element on a page ```ts interface SetAttrsOperation @@ -6616,7 +6616,7 @@ interface SetAttrsOperation ### `SetClipDisabledOperation` -`interface` +`interface` — Define an operation to enable or disable a clip by its identifier ```ts interface SetClipDisabledOperation @@ -6624,7 +6624,7 @@ interface SetClipDisabledOperation ### `SetClipTextOperation` -`interface` +`interface` — Resolve an operation to set clipboard text with optional language and clip identifier ```ts interface SetClipTextOperation @@ -6632,7 +6632,7 @@ interface SetClipTextOperation ### `SetDocumentTitleOperation` -`interface` +`interface` — Define an operation to set the document title to a specified string ```ts interface SetDocumentTitleOperation @@ -6640,7 +6640,7 @@ interface SetDocumentTitleOperation ### `SetPageGuidesOperation` -`interface` +`interface` — Resolve an operation to set guides on a specific page by its identifier ```ts interface SetPageGuidesOperation @@ -6648,7 +6648,7 @@ interface SetPageGuidesOperation ### `SetPagePropsOperation` -`interface` +`interface` — Define an operation to set or update properties of a page including size, background, and bleed ```ts interface SetPagePropsOperation @@ -6656,7 +6656,7 @@ interface SetPagePropsOperation ### `SetStepStatusPatch` -`interface` +`interface` — Define a patch to update the status and optional metadata of a step in a process ```ts interface SetStepStatusPatch @@ -6664,7 +6664,7 @@ interface SetStepStatusPatch ### `SharedBillingState` -`interface` +`interface` — Define shared billing state including user ID, plan, balances, concurrency, and overage permission ```ts interface SharedBillingState @@ -6688,7 +6688,7 @@ interface SidecarInteractionsConnection ### `SidecarInteractionsError` -`interface` +`interface` — Describe error details including code, message, and upstream HTTP status for sidecar interactions ```ts interface SidecarInteractionsError @@ -6696,7 +6696,7 @@ interface SidecarInteractionsError ### `SidecarInteractionsResult` -`type` +`type` — Represent the outcome of sidecar interactions with success or error details ```ts type SidecarInteractionsResult @@ -6720,7 +6720,7 @@ interface SignObjectUrlArgs ### `SIZE_PRESETS` -`const` +`const` — Provide predefined size presets for social, presentation, and print categories ```ts readonly SizePreset[] @@ -6728,7 +6728,7 @@ readonly SizePreset[] ### `SizePreset` -`interface` +`interface` — Define size presets with identifiers, labels, categories, and dimensions for various media types ```ts interface SizePreset @@ -6736,7 +6736,7 @@ interface SizePreset ### `SlotFillKind` -`type` +`type` — Define allowed string literals representing different slot fill kinds ```ts type SlotFillKind @@ -6768,7 +6768,7 @@ type SlotFillKind ### `SplitClipOperation` -`interface` +`interface` — Split a clip at a specified frame inside the clip to create two separate segments ```ts interface SplitClipOperation @@ -6776,7 +6776,7 @@ interface SplitClipOperation ### `splitDeferredProfileFiles` -`function` +`function` — Split profile files into inline deferred files and a lean profile without them ```ts (profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; } @@ -6784,7 +6784,7 @@ interface SplitClipOperation ### `stablePlanReceipt` -`function` +`function` — Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision ```ts (scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick Promise> @@ -6928,7 +6928,7 @@ interface StreamAppToolLoopOptions ### `StreamEvent` -`interface` +`interface` — Define an event object carrying a type and optional JSON data payload ```ts interface StreamEvent @@ -6944,7 +6944,7 @@ type StreamLoopYield ### `streamSandboxPrompt` -`function` +`function` — Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options ```ts (shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… @@ -6952,7 +6952,7 @@ type StreamLoopYield ### `StreamSandboxPromptOptions` -`interface` +`interface` — Define options for configuring and controlling a streaming sandbox prompt session ```ts interface StreamSandboxPromptOptions @@ -6960,7 +6960,7 @@ interface StreamSandboxPromptOptions ### `SubmitProposalArgs` -`interface` +`interface` — Define the arguments required to submit a proposal including type, title, description, and approval status ```ts interface SubmitProposalArgs @@ -6968,7 +6968,7 @@ interface SubmitProposalArgs ### `SubmitProposalResult` -`interface` +`interface` — Describe the result of submitting a proposal including deduplication and execution status ```ts interface SubmitProposalResult @@ -6976,7 +6976,7 @@ interface SubmitProposalResult ### `summarize` -`function` +`function` — Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max ```ts (values: number[]) => DistributionSummary @@ -7024,7 +7024,7 @@ type SurfacePermissionValue ### `SurfaceRegistry` -`interface` +`interface` — Resolve and build the overlay for a given surface kind within a turn context ```ts interface SurfaceRegistry @@ -7032,7 +7032,7 @@ interface SurfaceRegistry ### `syncSandboxMemberAdd` -`function` +`function` — Resolve adding a user with a specific role to a sandbox and return the operation outcome ```ts (box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> @@ -7040,7 +7040,7 @@ interface SurfaceRegistry ### `syncSandboxMemberRemove` -`function` +`function` — Remove a member from the sandbox while preserving their home directory and handle the outcome ```ts (box: SandboxInstance, userId: string) => Promise> @@ -7048,7 +7048,7 @@ interface SurfaceRegistry ### `syncSandboxMemberRole` -`function` +`function` — Synchronize a sandbox member's role by updating permissions based on the provided role mapping ```ts (box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> @@ -7056,7 +7056,7 @@ interface SurfaceRegistry ### `TangleBillingEnforcementOptions` -`interface` +`interface` — Define options for configuring billing enforcement environment variables and overrides ```ts interface TangleBillingEnforcementOptions @@ -7064,7 +7064,7 @@ interface TangleBillingEnforcementOptions ### `TangleExecutionEnvironment` -`type` +`type` — Define the environment context for executing Tangle operations ```ts type TangleExecutionEnvironment @@ -7072,7 +7072,7 @@ type TangleExecutionEnvironment ### `TangleExecutionKeyError` -`class` +`class` — Represent execution key errors with specific codes and HTTP status information ```ts class TangleExecutionKeyError @@ -7080,7 +7080,7 @@ class TangleExecutionKeyError ### `TangleExecutionKeyErrorCode` -`type` +`type` — Define error codes for Tangle execution key issues related to API key and account connection ```ts type TangleExecutionKeyErrorCode @@ -7088,7 +7088,7 @@ type TangleExecutionKeyErrorCode ### `tangleExecutionKeyHttpError` -`function` +`function` — Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null ```ts (error: unknown) => TangleExecutionKeyHttpError | null @@ -7096,7 +7096,7 @@ type TangleExecutionKeyErrorCode ### `TangleExecutionKeyHttpError` -`interface` +`interface` — Represent HTTP error response containing status, error message, and specific error code ```ts interface TangleExecutionKeyHttpError @@ -7104,7 +7104,7 @@ interface TangleExecutionKeyHttpError ### `TangleExecutionKeySource` -`type` +`type` — Resolve the source of the Tangle execution key as either local environment or user input ```ts type TangleExecutionKeySource @@ -7136,7 +7136,7 @@ interface TcloudKeyClient ### `TemplateSlot` -`interface` +`interface` — Define a slot template specifying its name, page, element, and fill characteristics ```ts interface TemplateSlot @@ -7160,7 +7160,7 @@ interface TemplateSlot ### `terminalizeDanglingToolParts` -`function` +`function` — Resolve dangling tool parts into terminal forms within the given JSON records array ```ts (parts: JsonRecord[]) => JsonRecord[] @@ -7168,7 +7168,7 @@ interface TemplateSlot ### `TerminalProxyIdentity` -`interface` +`interface` — Define identity details for a terminal proxy including user, workspace, and sandbox identifiers ```ts interface TerminalProxyIdentity @@ -7176,7 +7176,7 @@ interface TerminalProxyIdentity ### `terminalTokenFromRequest` -`function` +`function` — Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields ```ts (headers: Headers) => string | null @@ -7184,7 +7184,7 @@ interface TerminalProxyIdentity ### `TextElement` -`interface` +`interface` — Define properties for a text element including content, style, alignment, and layout parameters ```ts interface TextElement @@ -7200,7 +7200,7 @@ interface TextElement ### `ThemeContractMiss` -`interface` +`interface` — Describe a missing theme contract variable and where it was referenced ```ts interface ThemeContractMiss @@ -7208,7 +7208,7 @@ interface ThemeContractMiss ### `ThemeContractOptions` -`interface` +`interface` — Define options for scanning source directories and CSS token files in a theme contract ```ts interface ThemeContractOptions @@ -7216,7 +7216,7 @@ interface ThemeContractOptions ### `ThemeContractResult` -`interface` +`interface` — Describe the result of validating a theme contract including success status and missing items ```ts interface ThemeContractResult @@ -7240,7 +7240,7 @@ interface ThemeContractResult ### `TimedEvent` -`interface` +`interface` — Represent a timed event with a timestamp and associated event data ```ts interface TimedEvent @@ -7256,7 +7256,7 @@ interface TimedEvent ### `TimelineClipBounds` -`interface` +`interface` — Define the start frame and duration in frames for a timeline clip's bounds ```ts interface TimelineClipBounds @@ -7264,7 +7264,7 @@ interface TimelineClipBounds ### `TimelineInterval` -`interface` +`interface` — Define a time range with inclusive start and end frame numbers ```ts interface TimelineInterval @@ -7288,7 +7288,7 @@ interface TimelineInterval ### `ToolAuthResult` -`type` +`type` — Represent the result of tool authentication with success context or failure response ```ts type ToolAuthResult @@ -7368,7 +7368,7 @@ interface TranscriptSegment ### `TrimClipOperation` -`interface` +`interface` — Define an operation to trim a clip by adjusting its start, duration, and optional source in/out points ```ts interface TrimClipOperation @@ -7376,7 +7376,7 @@ interface TrimClipOperation ### `trimOrNull` -`function` +`function` — Resolve a string by trimming whitespace or returning null if empty or undefined ```ts (value: string | null | undefined) => string | null @@ -7400,7 +7400,7 @@ interface TrimClipOperation ### `TurnEventStore` -`interface` +`interface` — Manage and query turn events and their lifecycle statuses within a scoped event store ```ts interface TurnEventStore @@ -7416,7 +7416,7 @@ type TurnStatus ### `UngroupElementOperation` -`interface` +`interface` — Resolve an operation to ungroup elements within a specified page and group context ```ts interface UngroupElementOperation @@ -7432,7 +7432,7 @@ interface UngroupElementOperation ### `validateAddCaption` -`function` +`function` — Validate the parameters and context of an AddCaptionOperation within a sequence timeline ```ts (timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext) => void @@ -7448,7 +7448,7 @@ interface UngroupElementOperation ### `validateCreateTrack` -`function` +`function` — Validate that a CreateTrackOperation has a supported kind and a non-empty name ```ts (operation: CreateTrackOperation) => void @@ -7456,7 +7456,7 @@ interface UngroupElementOperation ### `validateDeleteClip` -`function` +`function` — Validate that the clip to delete exists and is mutable in the given timeline ```ts (timeline: SequenceTimeline, operation: DeleteClipOperation) => void @@ -7464,7 +7464,7 @@ interface UngroupElementOperation ### `validateExtendSequence` -`function` +`function` — Validate that the extend sequence operation has a positive duration and exceeds the last clip end frame ```ts (timeline: SequenceTimeline, operation: ExtendSequenceOperation) => void @@ -7480,7 +7480,7 @@ interface UngroupElementOperation ### `validateMoveClip` -`function` +`function` — Validate that a clip move operation is within bounds and targets a compatible unlocked track ```ts (timeline: SequenceTimeline, operation: MoveClipOperation) => void @@ -7488,7 +7488,7 @@ interface UngroupElementOperation ### `validatePlaceClip` -`function` +`function` — Validate the properties and constraints of a PlaceClipOperation within a SequenceTimeline ```ts (timeline: SequenceTimeline, operation: PlaceClipOperation) => void @@ -7496,7 +7496,7 @@ interface UngroupElementOperation ### `validateQueueExport` -`function` +`function` — Validate that the queue export operation uses a supported export format ```ts (operation: QueueExportOperation) => void @@ -7504,7 +7504,7 @@ interface UngroupElementOperation ### `validateSceneOperation` -`function` +`function` — Validate a scene operation against the document to ensure it meets required constraints ```ts (document: SceneDocument, operation: SceneOperation) => void @@ -7512,7 +7512,7 @@ interface UngroupElementOperation ### `validateSceneOperations` -`function` +`function` — Validate each scene operation against the document and throw detailed errors for invalid operations ```ts (document: SceneDocument, operations: SceneOperation[]) => void @@ -7520,7 +7520,7 @@ interface UngroupElementOperation ### `validateSequenceOperation` -`function` +`function` — Validate a sequence operation against the timeline and context to ensure correctness ```ts (timeline: SequenceTimeline, operation: SequenceOperation, ctx: SequenceOperationContext) => void @@ -7528,7 +7528,7 @@ interface UngroupElementOperation ### `validateSequenceOperations` -`function` +`function` — Validate each operation in a sequence against the timeline and context, throwing detailed errors on failure ```ts (timeline: SequenceTimeline, operations: SequenceOperation[], ctx: SequenceOperationContext) => void @@ -7536,7 +7536,7 @@ interface UngroupElementOperation ### `validateSetClipDisabled` -`function` +`function` — Validate that the clip can be disabled within the given timeline and operation constraints ```ts (timeline: SequenceTimeline, operation: SetClipDisabledOperation) => void @@ -7544,7 +7544,7 @@ interface UngroupElementOperation ### `validateSetClipText` -`function` +`function` — Validate that a SetClipTextOperation targets a caption clip with non-empty text and valid language tag ```ts (timeline: SequenceTimeline, operation: SetClipTextOperation) => void @@ -7560,7 +7560,7 @@ interface UngroupElementOperation ### `validateSplitClip` -`function` +`function` — Validate that a split operation on a clip is within valid frame boundaries and conditions ```ts (timeline: SequenceTimeline, operation: SplitClipOperation) => void @@ -7568,7 +7568,7 @@ interface UngroupElementOperation ### `validateTrimClip` -`function` +`function` — Validate that a trim clip operation respects timeline bounds and source frame constraints ```ts (timeline: SequenceTimeline, operation: TrimClipOperation) => void @@ -7624,7 +7624,7 @@ type VerifyObjectUrlResult ### `verifySandboxTerminalToken` -`function` +`function` — Verify the validity of a sandbox terminal token against the expected identity and options ```ts (token: string, expected: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise @@ -7632,7 +7632,7 @@ type VerifyObjectUrlResult ### `verifyTerminalProxyToken` -`function` +`function` — Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp ```ts (secret: string, token: string, expected: TerminalProxyIdentity, now?: () => number) => Promise @@ -7640,7 +7640,7 @@ type VerifyObjectUrlResult ### `VideoCaption` -`interface` +`interface` — Define video caption segments with start and end times and associated text content ```ts interface VideoCaption @@ -7648,7 +7648,7 @@ interface VideoCaption ### `VideoContent` -`interface` +`interface` — Describe video content including duration, scenes, optional audio, captions, and rendered URL ```ts interface VideoContent @@ -7656,7 +7656,7 @@ interface VideoContent ### `VideoContentSchema` -`const` +`const` — Define the schema for validating video content including duration, scenes, audio, captions, and rendered URL ```ts ZodObject<{ durationSeconds: ZodNumber; scenes: ZodArray Promise> diff --git a/docs/api/intakes-api.md b/docs/api/intakes-api.md index dc11b1f..0854a26 100644 --- a/docs/api/intakes-api.md +++ b/docs/api/intakes-api.md @@ -24,7 +24,7 @@ interface CurrentIntakeView ### `IntakeApiOptions` -`interface` +`interface` — Define configuration options for initializing the intake API with store and graph components ```ts interface IntakeApiOptions diff --git a/docs/api/intakes-drizzle.md b/docs/api/intakes-drizzle.md index 0fa3b14..c5e22f7 100644 --- a/docs/api/intakes-drizzle.md +++ b/docs/api/intakes-drizzle.md @@ -24,7 +24,7 @@ type AnyIntakeTables ### `CreateIntakeTablesOptions` -`interface` +`interface` — Define options for creating intake tables including user and optional workspace references ```ts interface CreateIntakeTablesOptions @@ -40,7 +40,7 @@ interface CreateIntakeTablesOptions ### `CreateProjectIntakeStoreOptions` -`interface` +`interface` — Define options required to create a project intake store including database, table, graph, and workspace ID ```ts interface CreateProjectIntakeStoreOptions @@ -56,7 +56,7 @@ interface CreateProjectIntakeStoreOptions ### `CreateUserIntakeStoreOptions` -`interface` +`interface` — Define options required to create a user intake store for onboarding data collection ```ts interface CreateUserIntakeStoreOptions @@ -80,7 +80,7 @@ class IntakeError ### `IntakeErrorCode` -`type` +`type` — Define error codes representing specific intake validation failures ```ts type IntakeErrorCode @@ -120,7 +120,7 @@ type IntakeTables ### `ProjectIntakeRow` -`type` +`type` — Resolve the selected data structure for a project intake table row ```ts type ProjectIntakeRow @@ -128,7 +128,7 @@ type ProjectIntakeRow ### `ProjectIntakeTable` -`type` +`type` — Resolve the structure and data of the project intake table from the factory function ```ts type ProjectIntakeTable @@ -136,7 +136,7 @@ type ProjectIntakeTable ### `UserIntakeRow` -`type` +`type` — Infer and represent a selected row from the UserIntakeTable data structure ```ts type UserIntakeRow @@ -144,7 +144,7 @@ type UserIntakeRow ### `UserIntakeTable` -`type` +`type` — Resolve the structure and data of a user intake table based on the createUserIntakeTable function ```ts type UserIntakeTable diff --git a/docs/api/intakes-react-lazy.md b/docs/api/intakes-react-lazy.md index 677d650..b26241b 100644 --- a/docs/api/intakes-react-lazy.md +++ b/docs/api/intakes-react-lazy.md @@ -8,7 +8,7 @@ Source: `src/intakes-react/lazy.tsx` ### `IntakeInterviewLazy` -`function` +`function` — Load IntakeInterview component lazily to optimize initial application rendering ```ts LazyExoticComponent<({ view: initialView, onAnswer, onComplete, onDone, onNotice, }: IntakeInterviewProps) => Element> @@ -16,7 +16,7 @@ LazyExoticComponent<({ view: initialView, onAnswer, onComplete, onDone, onNotice ### `IntakeInterviewProps` -`interface` +`interface` — Define properties and callbacks for managing the intake interview flow and user interactions ```ts interface IntakeInterviewProps diff --git a/docs/api/intakes-react.md b/docs/api/intakes-react.md index a59c31c..74b334c 100644 --- a/docs/api/intakes-react.md +++ b/docs/api/intakes-react.md @@ -16,7 +16,7 @@ Source: `src/intakes-react/index.ts` ### `IntakeInterviewProps` -`interface` +`interface` — Define properties and callbacks for managing the intake interview flow and user interactions ```ts interface IntakeInterviewProps diff --git a/docs/api/intakes.md b/docs/api/intakes.md index 2ca79a6..d9ff2f2 100644 --- a/docs/api/intakes.md +++ b/docs/api/intakes.md @@ -16,7 +16,7 @@ type AnswerRejectionReason ### `AnswerValidationResult` -`interface` +`interface` — Describe validation outcome of an answer including success status and optional rejection reason ```ts interface AnswerValidationResult diff --git a/docs/api/integrations.md b/docs/api/integrations.md index f9825a7..b2eedb2 100644 --- a/docs/api/integrations.md +++ b/docs/api/integrations.md @@ -16,7 +16,7 @@ class HubExecClient ### `HubExecClientOptions` -`interface` +`interface` — Define configuration options for initializing a Hub execution client ```ts interface HubExecClientOptions @@ -40,7 +40,7 @@ type HubExecResult ### `HubInvokeDeps` -`interface` +`interface` — Define dependencies for invoking hub operations including API key resolution and optional configuration ```ts interface HubInvokeDeps @@ -48,7 +48,7 @@ interface HubInvokeDeps ### `HubInvokeInput` -`interface` +`interface` — Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments ```ts interface HubInvokeInput @@ -56,7 +56,7 @@ interface HubInvokeInput ### `HubInvokeOutcome` -`interface` +`interface` — Describe the outcome of a hub invocation including status and response body ```ts interface HubInvokeOutcome diff --git a/docs/api/interactions.md b/docs/api/interactions.md index b311157..5fcbdf3 100644 --- a/docs/api/interactions.md +++ b/docs/api/interactions.md @@ -8,7 +8,7 @@ Source: `src/interactions/index.ts` ### `BeforeInteractionAnswerArgs` -`interface` +`interface` — Describe the arguments provided before processing an interaction answer including request, body, and connection details ```ts interface BeforeInteractionAnswerArgs @@ -40,7 +40,7 @@ interface ChatInteraction ### `ChatInteractionField` -`type` +`type` — Resolve a chat interaction field excluding select types or including chat select fields ```ts type ChatInteractionField @@ -48,7 +48,7 @@ type ChatInteractionField ### `ChatInteractionStatus` -`type` +`type` — Define possible statuses representing the state of a chat interaction ```ts type ChatInteractionStatus @@ -56,7 +56,7 @@ type ChatInteractionStatus ### `ChatSelectField` -`type` +`type` — Extract select-type interaction fields and optionally allow custom values ```ts type ChatSelectField @@ -80,7 +80,7 @@ type ChatSelectField ### `ComposerAnswerDelivery` -`interface` +`interface` — Define the structure for delivering answers linked to a specific chat interaction and field ```ts interface ComposerAnswerDelivery @@ -88,7 +88,7 @@ interface ComposerAnswerDelivery ### `createInteractionAnswerRoute` -`function` +`function` — Create an interaction answer route that handles listing and resolving interaction requests ```ts (options: InteractionAnswerRouteOptions) => InteractionAnswerRoute @@ -96,7 +96,7 @@ interface ComposerAnswerDelivery ### `dedupeQuestionInteractionsByContent` -`function` +`function` — Remove duplicate question interactions based on their content signature to ensure uniqueness ```ts (interactions: ChatInteraction[]) => ChatInteraction[] @@ -104,7 +104,7 @@ interface ComposerAnswerDelivery ### `DurableInteractionRouteArgs` -`interface` +`interface` — Define arguments for durable interaction routes including a stable caller-created attempt key ```ts interface DurableInteractionRouteArgs @@ -120,7 +120,7 @@ interface DurableInteractionRoutePersistence ### `fieldAcceptsFreeText` -`function` +`function` — Determine if a chat interaction field allows free text input ```ts (field: ChatInteractionField) => boolean @@ -152,7 +152,7 @@ interface DurableInteractionRoutePersistence ### `InteractionAnswerBodyValidation` -`type` +`type` — Validate interaction answer body and return success with data or failure with error message ```ts type InteractionAnswerBodyValidation @@ -160,7 +160,7 @@ type InteractionAnswerBodyValidation ### `InteractionAnswerRoute` -`interface` +`interface` — Define routes to list outstanding interactions and resolve answers for live turns ```ts interface InteractionAnswerRoute @@ -168,7 +168,7 @@ interface InteractionAnswerRoute ### `InteractionAnswerRouteOptions` -`interface` +`interface` — Define options to authenticate, authorize, and manage persistence for interaction answer routes ```ts interface InteractionAnswerRouteOptions @@ -176,7 +176,7 @@ interface InteractionAnswerRouteOptions ### `InteractionAnswers` -`type` +`type` — Map interaction identifiers to their corresponding answer values ```ts type InteractionAnswers @@ -192,7 +192,7 @@ type InteractionAnswerValue ### `InteractionCancelData` -`interface` +`interface` — Describe data required to cancel an interaction including its identifier and optional reason ```ts interface InteractionCancelData @@ -200,7 +200,7 @@ interface InteractionCancelData ### `InteractionClientOutcome` -`type` +`type` — Define possible outcomes for an interaction client as accepted or declined ```ts type InteractionClientOutcome @@ -240,7 +240,7 @@ type InteractionOutcome ### `interactionPartKey` -`function` +`function` — Generate a unique key string for an interaction using the given identifier ```ts (id: string) => string @@ -272,7 +272,7 @@ type InteractionRequestWire ### `InteractionRouteLogger` -`type` +`type` — Provide logging methods for warnings and errors in interaction routes ```ts type InteractionRouteLogger @@ -288,7 +288,7 @@ type InteractionRouteLogger ### `isRenderableInteractionKind` -`function` +`function` — Resolve if the given interaction kind is renderable within the application context ```ts (kind: string) => boolean @@ -304,7 +304,7 @@ type InteractionRouteLogger ### `isTerminalInteractionStatus` -`function` +`function` — Resolve if the interaction status is a terminal state excluding pending ```ts (status: ChatInteractionStatus) => boolean @@ -328,7 +328,7 @@ type InteractionRouteLogger ### `NoticeKind` -`type` +`type` — Define specific string literals representing different kinds of notices ```ts type NoticeKind @@ -344,7 +344,7 @@ type NoticeKind ### `noticePartKey` -`function` +`function` — Generate a unique key string for a notice using the given identifier ```ts (id: string) => string @@ -352,7 +352,7 @@ type NoticeKind ### `NoticePersistedPart` -`type` +`type` — Define a persisted notice part with type, id, kind, and text properties ```ts type NoticePersistedPart @@ -368,7 +368,7 @@ type NoticePersistedPart ### `ParseInteractionAnswersResult` -`type` +`type` — Resolve the result of parsing interaction answers with success status and corresponding data or error message ```ts type ParseInteractionAnswersResult @@ -376,7 +376,7 @@ type ParseInteractionAnswersResult ### `parseInteractionCancel` -`function` +`function` — Parse interaction cancel data and return success status with parsed value or error message ```ts (data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;… @@ -392,7 +392,7 @@ type ParseInteractionAnswersResult ### `ParseInteractionResult` -`type` +`type` — Resolve interaction parsing outcome as success with value or failure with error message ```ts type ParseInteractionResult @@ -416,7 +416,7 @@ type ParseInteractionResult ### `ResolveInteractionConnectionArgs` -`interface` +`interface` — Define arguments required to resolve interaction connections based on request and intent ```ts interface ResolveInteractionConnectionArgs @@ -440,7 +440,7 @@ interface SidecarInteractionsConnection ### `SidecarInteractionsError` -`interface` +`interface` — Describe error details including code, message, and upstream HTTP status for sidecar interactions ```ts interface SidecarInteractionsError @@ -448,7 +448,7 @@ interface SidecarInteractionsError ### `SidecarInteractionsResult` -`type` +`type` — Represent the outcome of sidecar interactions with success or error details ```ts type SidecarInteractionsResult diff --git a/docs/api/knowledge-loop.md b/docs/api/knowledge-loop.md index 6ea033f..ae996e3 100644 --- a/docs/api/knowledge-loop.md +++ b/docs/api/knowledge-loop.md @@ -16,7 +16,7 @@ Source: `src/knowledge-loop/index.ts` ### `CreateKnowledgeLoopDeps` -`interface` +`interface` — Define dependencies required to create and run a knowledge processing loop ```ts interface CreateKnowledgeLoopDeps @@ -48,7 +48,7 @@ interface KnowledgeDecider ### `KnowledgeDeciderInput` -`interface` +`interface` — Define the input parameters required to decide knowledge proposals within an agent-knowledge loop ```ts interface KnowledgeDeciderInput @@ -56,7 +56,7 @@ interface KnowledgeDeciderInput ### `KnowledgeDecision` -`interface` +`interface` — Define a decision containing a candidate and the gate's verdict on that candidate ```ts interface KnowledgeDecision diff --git a/docs/api/knowledge.md b/docs/api/knowledge.md index 53cbc00..6d5d630 100644 --- a/docs/api/knowledge.md +++ b/docs/api/knowledge.md @@ -24,7 +24,7 @@ Source: `src/knowledge/index.ts` ### `KnowledgeRequirementSpec` -`interface` +`interface` — Define the criteria and conditions required to satisfy a specific knowledge requirement ```ts interface KnowledgeRequirementSpec @@ -32,7 +32,7 @@ interface KnowledgeRequirementSpec ### `KnowledgeSignal` -`interface` +`interface` — Define a signal representing knowledge with confidence level and optional supporting evidence ```ts interface KnowledgeSignal diff --git a/docs/api/missions.md b/docs/api/missions.md index 65ef5bf..ad91ba9 100644 --- a/docs/api/missions.md +++ b/docs/api/missions.md @@ -40,7 +40,7 @@ Source: `src/missions/index.ts` ### `CompleteMissionInput` -`interface` +`interface` — Define input parameters to complete a mission with status and optional summary ```ts interface CompleteMissionInput @@ -56,7 +56,7 @@ interface CompleteMissionInput ### `createMissionEngine` -`function` +`function` — Create a mission engine configured with options to manage mission execution and error handling ```ts (options: MissionEngineOptions) => MissionEngine @@ -64,7 +64,7 @@ interface CompleteMissionInput ### `CreateMissionInput` -`interface` +`interface` — Define input parameters for creating a mission including optional deterministic id and unique plan steps ```ts interface CreateMissionInput @@ -72,7 +72,7 @@ interface CreateMissionInput ### `createMissionService` -`function` +`function` — Create a mission service that manages mission records and audit events with customizable options ```ts (options: MissionServiceOptions) => MissionService @@ -88,7 +88,7 @@ readonly string[] ### `InMemoryMissionStore` -`interface` +`interface` — Define an in-memory mission store that tracks events and allows direct record writes ```ts interface InMemoryMissionStore @@ -152,7 +152,7 @@ class MissionConcurrencyError ### `MissionCostLedger` -`interface` +`interface` — Define the structure for tracking mission token usage, cost, duration, and LLM call counts ```ts interface MissionCostLedger @@ -160,7 +160,7 @@ interface MissionCostLedger ### `MissionEngine` -`interface` +`interface` — Resolve mission plan steps with concurrency control and durable state management ```ts interface MissionEngine @@ -168,7 +168,7 @@ interface MissionEngine ### `MissionEngineOptions` -`interface` +`interface` — Define configuration options for initializing and controlling the mission engine behavior ```ts interface MissionEngineOptions @@ -176,7 +176,7 @@ interface MissionEngineOptions ### `MissionEventSink` -`interface` +`interface` — Handle mission stream events by processing emitted MissionStreamEvent objects ```ts interface MissionEventSink @@ -184,7 +184,7 @@ interface MissionEventSink ### `MissionGateKind` -`type` +`type` — Define mission gate categories as step, budget, or volume ```ts type MissionGateKind @@ -192,7 +192,7 @@ type MissionGateKind ### `MissionGateOptions` -`interface` +`interface` — Define configuration options for mission gating including approvals, step classification, and action limits ```ts interface MissionGateOptions @@ -216,7 +216,7 @@ type MissionOutcome ### `MissionPlanRunOptions` -`interface` +`interface` — Define options to control mission plan execution with optional pre-step veto logic ```ts interface MissionPlanRunOptions @@ -240,7 +240,7 @@ interface MissionRecord ### `MissionService` -`interface` +`interface` — Define methods to create, retrieve, and update missions with controlled engine binding and metadata merging ```ts interface MissionService @@ -248,7 +248,7 @@ interface MissionService ### `MissionServiceOptions` -`interface` +`interface` — Define options for configuring mission service behavior including storage, time, and ID generation ```ts interface MissionServiceOptions @@ -272,7 +272,7 @@ type MissionStatus ### `MissionStep` -`interface` +`interface` — Define the structure and state details of a mission step within a workflow system ```ts interface MissionStep @@ -288,7 +288,7 @@ interface MissionStepState ### `MissionStepStatus` -`type` +`type` — Define possible statuses for a mission step during its execution lifecycle ```ts type MissionStepStatus @@ -312,7 +312,7 @@ type MissionStreamEvent ### `MissionStreamStatus` -`type` +`type` — Define possible statuses representing the current state of a mission stream ```ts type MissionStreamStatus @@ -328,7 +328,7 @@ interface MissionStreamStep ### `MissionStreamStepStatus` -`type` +`type` — Define possible status values for a mission stream step ```ts type MissionStreamStepStatus @@ -360,7 +360,7 @@ MissionEventSink ### `ParsedMission` -`interface` +`interface` — Describe a mission with a title and an ordered list of parsed steps ```ts interface ParsedMission @@ -368,7 +368,7 @@ interface ParsedMission ### `ParsedMissionStep` -`interface` +`interface` — Define the structure representing a parsed mission step with id, kind, and intent fields ```ts interface ParsedMissionStep @@ -384,7 +384,7 @@ interface ParsedMissionStep ### `ParseMissionBlocksOptions` -`interface` +`interface` — Define options to specify allowed lowercase step kinds for parsing mission blocks ```ts interface ParseMissionBlocksOptions @@ -432,7 +432,7 @@ type SandboxDispatch ### `SandboxDispatchDoneResult` -`interface` +`interface` — Define the result of a completed sandbox dispatch including artifact reference and optional cost details ```ts interface SandboxDispatchDoneResult @@ -448,7 +448,7 @@ interface SandboxDispatchInProgressResult ### `SandboxDispatchInput` -`interface` +`interface` — Define input parameters for dispatching a mission step in the sandbox environment ```ts interface SandboxDispatchInput @@ -456,7 +456,7 @@ interface SandboxDispatchInput ### `SandboxDispatchResult` -`type` +`type` — Resolve the result of a sandbox dispatch as done or in progress ```ts type SandboxDispatchResult @@ -464,7 +464,7 @@ type SandboxDispatchResult ### `SetStepStatusPatch` -`interface` +`interface` — Define a patch to update the status and optional metadata of a step in a process ```ts interface SetStepStatusPatch diff --git a/docs/api/model-resolution.md b/docs/api/model-resolution.md index 9bc8261..88602be 100644 --- a/docs/api/model-resolution.md +++ b/docs/api/model-resolution.md @@ -8,7 +8,7 @@ Source: `src/model-resolution/index.ts` ### `catalogIdsForModel` -`function` +`function` — Resolve unique catalog IDs associated with a given model including its canonical form if applicable ```ts (model: ModelInfo) => string[] @@ -16,7 +16,7 @@ Source: `src/model-resolution/index.ts` ### `ChatModelSource` -`type` +`type` — Define possible origins for the chat model configuration values ```ts type ChatModelSource @@ -24,7 +24,7 @@ type ChatModelSource ### `ChatModelValidationFailure` -`interface` +`interface` — Describe a failed chat model validation result with an error message ```ts interface ChatModelValidationFailure @@ -32,7 +32,7 @@ interface ChatModelValidationFailure ### `ChatModelValidationResult` -`type` +`type` — Resolve the outcome of validating a chat model as either success or failure ```ts type ChatModelValidationResult @@ -40,7 +40,7 @@ type ChatModelValidationResult ### `ChatModelValidationSuccess` -`interface` +`interface` — Represent successful chat model validation with a true status and a validated string value ```ts interface ChatModelValidationSuccess @@ -48,7 +48,7 @@ interface ChatModelValidationSuccess ### `cleanModelId` -`function` +`function` — Resolve and return a trimmed string model ID or undefined for invalid or empty input ```ts (value: unknown) => string | undefined @@ -56,7 +56,7 @@ interface ChatModelValidationSuccess ### `isWellFormedModelId` -`function` +`function` — Validate if a model ID string conforms to length and character format requirements ```ts (modelId: string) => boolean @@ -88,7 +88,7 @@ interface ModelInfo ### `ResolveChatModelInput` -`interface` +`interface` — Resolve the effective chat model input by prioritizing request, workspace, environment, and default models ```ts interface ResolveChatModelInput @@ -96,7 +96,7 @@ interface ResolveChatModelInput ### `ResolvedChatModel` -`interface` +`interface` — Resolve a chat model with its identifier and source information ```ts interface ResolvedChatModel @@ -112,7 +112,7 @@ interface ResolvedChatModel ### `ValidateChatModelIdInput` -`interface` +`interface` — Define input parameters for validating chat model IDs with optional allowlist and catalog access details ```ts interface ValidateChatModelIdInput diff --git a/docs/api/plans.md b/docs/api/plans.md index 2f7bc33..94a5cc8 100644 --- a/docs/api/plans.md +++ b/docs/api/plans.md @@ -48,7 +48,7 @@ type ChatPlanStatus ### `ParsePlanSubmittedResult` -`type` +`type` — Resolve the result of parsing a plan submission into success with value or failure with error ```ts type ParsePlanSubmittedResult @@ -56,7 +56,7 @@ type ParsePlanSubmittedResult ### `persistedPartToPlan` -`function` +`function` — Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan ```ts (part: Record) => ChatPlan | null @@ -72,7 +72,7 @@ type ParsePlanSubmittedResult ### `planFollowUpTurnId` -`function` +`function` — Generate a unique follow-up turn ID based on the plan ID and its outcome ```ts (planId: string, outcome: "approved" | "rejected") => string @@ -80,7 +80,7 @@ type ParsePlanSubmittedResult ### `planPartKey` -`function` +`function` — Generate a unique key string for a given plan identifier ```ts (planId: string) => string @@ -88,7 +88,7 @@ type ParsePlanSubmittedResult ### `planRevisionKey` -`function` +`function` — Generate a unique key string for a plan based on its ID and revision number ```ts (planId: string, revision: number) => string @@ -96,7 +96,7 @@ type ParsePlanSubmittedResult ### `planToPersistedPart` -`function` +`function` — Resolve a ChatPlan into its persisted part representation for storage or transmission ```ts (plan: ChatPlan) => ChatPlanPersistedPart diff --git a/docs/api/platform.md b/docs/api/platform.md index c1daa77..54de32c 100644 --- a/docs/api/platform.md +++ b/docs/api/platform.md @@ -8,7 +8,7 @@ Source: `src/platform/index.ts` ### `AdminGuardOptions` -`interface` +`interface` — Define options to resolve user session and control access based on allowed admin emails ```ts interface AdminGuardOptions @@ -24,7 +24,7 @@ interface AdminGuardOptions ### `AssertBillableBalanceOptions` -`interface` +`interface` — Define options to assert and customize billable balance enforcement behavior ```ts interface AssertBillableBalanceOptions @@ -32,7 +32,7 @@ interface AssertBillableBalanceOptions ### `AuthGuard` -`interface` +`interface` — Resolve user authentication and session requirements for page and API requests ```ts interface AuthGuard @@ -40,7 +40,7 @@ interface AuthGuard ### `AuthGuardOptions` -`interface` +`interface` — Define options for configuring authentication guard behavior and session retrieval ```ts interface AuthGuardOptions @@ -48,7 +48,7 @@ interface AuthGuardOptions ### `BetterAuthSessionCookieMinterOptions` -`interface` +`interface` — Define options to customize warning behavior for shadowed cookie names in authentication sessions ```ts interface BetterAuthSessionCookieMinterOptions @@ -64,7 +64,7 @@ interface BetterAuthSessionCookieSource ### `BillableBalanceState` -`interface` +`interface` — Describe the billable balance state including overage permission and remaining USD balance ```ts interface BillableBalanceState @@ -80,7 +80,7 @@ interface BillableBalanceState ### `createAuthGuard` -`function` +`function` — Create an authentication guard that enforces session presence and handles unauthorized access responses ```ts (opts: AuthGuardOptions) => AuthGuard @@ -96,7 +96,7 @@ interface BillableBalanceState ### `createHubProxyRoutes` -`function` +`function` — Resolve hub proxy routes with authentication and error handling based on the given context ```ts (ctx: HubProxyContext) => HubProxyRoutes @@ -104,7 +104,7 @@ interface BillableBalanceState ### `createPlatformBillingHttp` -`function` +`function` — Create a PlatformBillingHttp instance configured with given options and default behaviors ```ts (opts: PlatformBillingHttpOptions) => PlatformBillingHttp @@ -128,7 +128,7 @@ interface BillableBalanceState ### `createTangleSsoHandlers` -`function` +`function` — Create Tangle SSO handlers to manage authentication state, callbacks, and session cookies ```ts (opts: TangleSsoHandlerOptions) => TangleSsoHandlers @@ -144,7 +144,7 @@ interface BillableBalanceState ### `DEFAULT_TANGLE_TIER_POLICY` -`const` +`const` — Define default concurrency and overage policies for each TanglePlanTier level ```ts Record @@ -176,7 +176,7 @@ Record ### `GuardResolution` -`type` +`type` — Resolve a value or an HTTP response indicating failure in a guarded operation ```ts type GuardResolution @@ -192,7 +192,7 @@ interface HubClientLike ### `HubProxyContext` -`interface` +`interface` — Define methods to require user ID, get bearer token, and create a hub client bound to the bearer ```ts interface HubProxyContext @@ -200,7 +200,7 @@ interface HubProxyContext ### `HubProxyRouteArgs` -`interface` +`interface` — Define arguments for configuring a proxy route with request and optional parameters ```ts interface HubProxyRouteArgs @@ -208,7 +208,7 @@ interface HubProxyRouteArgs ### `HubProxyRoutes` -`interface` +`interface` — Define routes for hub proxy handling catalog, connections, healthchecks, and authorization actions ```ts interface HubProxyRoutes @@ -272,7 +272,7 @@ interface HubProxyRoutes ### `PlatformBalanceSnapshot` -`interface` +`interface` — Describe the platform balance and lifetime spending with an optional update timestamp ```ts interface PlatformBalanceSnapshot @@ -280,7 +280,7 @@ interface PlatformBalanceSnapshot ### `PlatformBillingHttp` -`interface` +`interface` — Define methods to interact with platform billing endpoints using user or service authentication ```ts interface PlatformBillingHttp @@ -288,7 +288,7 @@ interface PlatformBillingHttp ### `PlatformBillingHttpError` -`class` +`class` — Represent platform billing HTTP errors with status code and detailed message ```ts class PlatformBillingHttpError @@ -296,7 +296,7 @@ class PlatformBillingHttpError ### `PlatformBillingHttpOptions` -`interface` +`interface` — Define HTTP options for platform billing including base URL, service token, product slug, fetch implementation, and timeout ```ts interface PlatformBillingHttpOptions @@ -304,7 +304,7 @@ interface PlatformBillingHttpOptions ### `PlatformIdentityStore` -`interface` +`interface` — Define a contract for resolving platform identities based on user identifiers ```ts interface PlatformIdentityStore @@ -312,7 +312,7 @@ interface PlatformIdentityStore ### `PlatformSubscriptionInfo` -`interface` +`interface` — Describe subscription tier and status information for a platform user ```ts interface PlatformSubscriptionInfo @@ -320,7 +320,7 @@ interface PlatformSubscriptionInfo ### `PlatformUsageProductRow` -`interface` +`interface` — Describe a product's usage and spending metrics on the platform ```ts interface PlatformUsageProductRow @@ -344,7 +344,7 @@ interface ProductEntitlement ### `ResolvedTangleHubBearer` -`interface` +`interface` — Represent a resolved bearer token with its associated TangleHub bearer source ```ts interface ResolvedTangleHubBearer @@ -360,7 +360,7 @@ interface ResolvedTangleHubBearer ### `resolveUserTangleHubBearerForUser` -`function` +`function` — Resolve the TangleHub bearer token for a specified user based on provided options ```ts (opts: ResolveUserTangleHubBearerForUserOptions) => Promise @@ -368,7 +368,7 @@ interface ResolvedTangleHubBearer ### `ResolveUserTangleHubBearerForUserOptions` -`interface` +`interface` — Resolve options for retrieving a TangleHub bearer token for a specified user ```ts interface ResolveUserTangleHubBearerForUserOptions @@ -376,7 +376,7 @@ interface ResolveUserTangleHubBearerForUserOptions ### `ResolveUserTangleHubBearerOptions` -`interface` +`interface` — Resolve options required to obtain a user's TangleHub bearer token including environment and API key retrieval ```ts interface ResolveUserTangleHubBearerOptions @@ -384,7 +384,7 @@ interface ResolveUserTangleHubBearerOptions ### `SeatBillingFlagOptions` -`interface` +`interface` — Define options to configure seat billing flag environment variables and override flag name ```ts interface SeatBillingFlagOptions @@ -416,7 +416,7 @@ type SeatStatus ### `SsoStateConfig` -`interface` +`interface` — Define configuration options for managing SSO state including secret, lifetime, and clock injection ```ts interface SsoStateConfig @@ -424,7 +424,7 @@ interface SsoStateConfig ### `TangleBearerMissingError` -`class` +`class` — Represent missing Tangle platform link error for a specified user ID ```ts class TangleBearerMissingError @@ -440,7 +440,7 @@ type TangleHubBearerSource ### `TanglePlanTier` -`type` +`type` — Define available subscription tiers for the TanglePlan service ```ts type TanglePlanTier @@ -464,7 +464,7 @@ interface TangleSsoAuthClient ### `TangleSsoExchangeResult` -`interface` +`interface` — Describe the result of exchanging SSO credentials including API key, user info, and optional plan details ```ts interface TangleSsoExchangeResult @@ -472,7 +472,7 @@ interface TangleSsoExchangeResult ### `TangleSsoHandlerOptions` -`interface` +`interface` — Define configuration options for handling Tangle SSO authentication and session management ```ts interface TangleSsoHandlerOptions @@ -480,7 +480,7 @@ interface TangleSsoHandlerOptions ### `TangleSsoHandlers` -`interface` +`interface` — Define handlers for SSO start and callback routes managing authentication flow and session cookies ```ts interface TangleSsoHandlers @@ -504,7 +504,7 @@ class TangleSsoUserCreateError ### `TangleTierPolicy` -`interface` +`interface` — Define policy settings for concurrency and overage allowance in a tangle tier ```ts interface TangleTierPolicy @@ -512,7 +512,7 @@ interface TangleTierPolicy ### `TangleTierState` -`interface` +`interface` — Describe the state of a Tangle plan tier including subscription, balance, spending, and concurrency details ```ts interface TangleTierState diff --git a/docs/api/preflight.md b/docs/api/preflight.md index a9495af..0dd2965 100644 --- a/docs/api/preflight.md +++ b/docs/api/preflight.md @@ -24,7 +24,7 @@ Source: `src/preflight/index.ts` ### `HttpHeadProbeConfig` -`interface` +`interface` — Define configuration options for performing an HTTP HEAD probe to check URL availability ```ts interface HttpHeadProbeConfig @@ -72,7 +72,7 @@ interface PreflightReport ### `RouterChatProbeConfig` -`interface` +`interface` — Define configuration options for probing an LLM router with authentication and model details ```ts interface RouterChatProbeConfig @@ -96,7 +96,7 @@ interface RouterChatProbeConfig ### `SandboxAuthProbeConfig` -`interface` +`interface` — Define configuration options for probing sandbox authentication endpoints ```ts interface SandboxAuthProbeConfig diff --git a/docs/api/preset-cloudflare.md b/docs/api/preset-cloudflare.md index e8df19e..0f2522d 100644 --- a/docs/api/preset-cloudflare.md +++ b/docs/api/preset-cloudflare.md @@ -104,7 +104,7 @@ readonly string[] ### `PresetBillingOptions` -`interface` +`interface` — Define preset billing options including database, provisioner, encryption key, budget, and optional settings ```ts interface PresetBillingOptions @@ -112,7 +112,7 @@ interface PresetBillingOptions ### `PresetKnowledgeAccessorOptions` -`interface` +`interface` — Define options for accessing preset knowledge scoped to a specific workspace and configuration ```ts interface PresetKnowledgeAccessorOptions @@ -120,7 +120,7 @@ interface PresetKnowledgeAccessorOptions ### `PresetToolHandlerOptions` -`interface` +`interface` — Define configuration options for handling preset tools including database, vault, and optional utilities ```ts interface PresetToolHandlerOptions diff --git a/docs/api/redact.md b/docs/api/redact.md index 7eac2cb..8192a49 100644 --- a/docs/api/redact.md +++ b/docs/api/redact.md @@ -16,7 +16,7 @@ Source: `src/redact/index.ts` ### `BuildRedactedDocumentOptions` -`interface` +`interface` — Define options to encrypt text and specify patterns for redacting sensitive document content ```ts interface BuildRedactedDocumentOptions @@ -56,7 +56,7 @@ type RedactedDocSegment ### `RedactedDocument` -`interface` +`interface` — Define a document composed of multiple redacted content segments ```ts interface RedactedDocument @@ -72,7 +72,7 @@ interface RedactedDocument ### `RedactForIngestionOptions` -`interface` +`interface` — Define options to customize sensitive data redaction patterns and key names for ingestion ```ts interface RedactForIngestionOptions @@ -96,7 +96,7 @@ interface RedactionSpan ### `RevealResult` -`interface` +`interface` — Describe the outcome of a reveal operation including success status, value, and failure reason ```ts interface RevealResult @@ -112,7 +112,7 @@ interface RevealResult ### `RevealSpanOptions` -`interface` +`interface` — Define options to decrypt, authorize, and audit the reveal of a span segment ```ts interface RevealSpanOptions diff --git a/docs/api/run.md b/docs/api/run.md index 7b73b6b..1840391 100644 --- a/docs/api/run.md +++ b/docs/api/run.md @@ -8,7 +8,7 @@ Source: `src/run/index.ts` ### `ExecutionMode` -`type` +`type` — Define execution mode as either router or sandbox ```ts type ExecutionMode @@ -32,7 +32,7 @@ type ExecutionMode ### `ProfileHarness` -`type` +`type` — Resolve a ProfileHarness as a Harness, RouterHarness, null, or undefined value ```ts type ProfileHarness @@ -56,7 +56,7 @@ type ProfileHarness ### `RouterHarness` -`type` +`type` — Provide a type alias for the ROUTER_HARNESS constant to enable consistent router harness usage ```ts type RouterHarness diff --git a/docs/api/runtime.md b/docs/api/runtime.md index 39d14d2..0e8c705 100644 --- a/docs/api/runtime.md +++ b/docs/api/runtime.md @@ -8,7 +8,7 @@ Source: `src/runtime/index.ts` ### `AgentRuntime` -`interface` +`interface` — Resolve and stream tool execution loops with final results and intermediate events for agent runtime ```ts interface AgentRuntime @@ -24,7 +24,7 @@ interface AgentRuntimeModelConfig ### `AgentTurnOptions` -`interface` +`interface` — Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers ```ts interface AgentTurnOptions @@ -56,7 +56,7 @@ interface AppToolLoopOptions ### `CatalogModel` -`interface` +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags ```ts interface CatalogModel @@ -64,7 +64,7 @@ interface CatalogModel ### `CertifiedDelivery` -`interface` +`interface` — Resolve and manage certified profiles with refresh and composition capabilities ```ts interface CertifiedDelivery @@ -72,7 +72,7 @@ interface CertifiedDelivery ### `CertifiedDeliveryConfig` -`interface` +`interface` — Define configuration options for delivering certified artifacts to a specified tenant target ```ts interface CertifiedDeliveryConfig @@ -88,7 +88,7 @@ interface CertifiedDeliveryConfig ### `CreateAgentRuntimeOptions` -`interface` +`interface` — Define options for creating an agent runtime including model config and optional profile transformation ```ts interface CreateAgentRuntimeOptions @@ -128,7 +128,7 @@ interface CreateAgentRuntimeOptions ### `CreateTangleRouterModelConfigOptions` -`interface` +`interface` — Define configuration options for creating a Tangle router model including API key and model details ```ts interface CreateTangleRouterModelConfigOptions @@ -136,7 +136,7 @@ interface CreateTangleRouterModelConfigOptions ### `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR` -`const` +`const` — Define the default environment variable name for Tangle billing enforcement ```ts "TANGLE_BILLING_ENFORCEMENT" @@ -144,7 +144,7 @@ interface CreateTangleRouterModelConfigOptions ### `DEFAULT_TANGLE_ROUTER_BASE_URL` -`const` +`const` — Provide the default base URL for the Tangle router API endpoint ```ts "https://router.tangle.tools/v1" @@ -176,7 +176,7 @@ interface CreateTangleRouterModelConfigOptions ### `isTangleExecutionKeyError` -`function` +`function` — Identify whether an error is a TangleExecutionKeyError based on its properties and type ```ts (error: unknown) => error is TangleExecutionKeyError @@ -224,7 +224,7 @@ interface LoopToolCall ### `ModelCatalog` -`interface` +`interface` — Define a catalog containing models with a default ID and fetch timestamp ```ts interface ModelCatalog @@ -240,7 +240,7 @@ interface ModelCatalog ### `OpenAICompatStreamTurnOptions` -`interface` +`interface` — Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools ```ts interface OpenAICompatStreamTurnOptions @@ -264,7 +264,7 @@ interface ResolvedAgentProfile ### `ResolvedTangleExecutionKey` -`interface` +`interface` — Define a resolved key combining an API key with its Tangle execution source ```ts interface ResolvedTangleExecutionKey @@ -272,7 +272,7 @@ interface ResolvedTangleExecutionKey ### `ResolveModelOptions` -`interface` +`interface` — Resolve options for model configuration including environment variables and default router base URL ```ts interface ResolveModelOptions @@ -288,7 +288,7 @@ interface ResolveModelOptions ### `ResolveTangleDevOrUserKeyOptions` -`interface` +`interface` — Resolve options for retrieving a Tangle developer or user API key based on environment and context ```ts interface ResolveTangleDevOrUserKeyOptions @@ -296,7 +296,7 @@ interface ResolveTangleDevOrUserKeyOptions ### `resolveTangleExecutionEnvironment` -`function` +`function` — Resolve the current Tangle execution environment based on provided or process environment variables ```ts (env?: Record) => TangleExecutionEnvironment @@ -320,7 +320,7 @@ interface ResolveTangleDevOrUserKeyOptions ### `resolveUserTangleExecutionKeyForUser` -`function` +`function` — Resolve the Tangle execution key for a specified user using provided environment and API key options ```ts (opts: ResolveUserTangleExecutionKeyForUserOptions) => Promise @@ -328,7 +328,7 @@ interface ResolveTangleDevOrUserKeyOptions ### `ResolveUserTangleExecutionKeyForUserOptions` -`interface` +`interface` — Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters ```ts interface ResolveUserTangleExecutionKeyForUserOptions @@ -336,7 +336,7 @@ interface ResolveUserTangleExecutionKeyForUserOptions ### `ResolveUserTangleExecutionKeyOptions` -`interface` +`interface` — Resolve options for retrieving user API keys within a specific Tangle execution environment ```ts interface ResolveUserTangleExecutionKeyOptions @@ -424,7 +424,7 @@ type SurfacePermissionValue ### `SurfaceRegistry` -`interface` +`interface` — Resolve and build the overlay for a given surface kind within a turn context ```ts interface SurfaceRegistry @@ -432,7 +432,7 @@ interface SurfaceRegistry ### `TangleBillingEnforcementOptions` -`interface` +`interface` — Define options for configuring billing enforcement environment variables and overrides ```ts interface TangleBillingEnforcementOptions @@ -440,7 +440,7 @@ interface TangleBillingEnforcementOptions ### `TangleExecutionEnvironment` -`type` +`type` — Define the environment context for executing Tangle operations ```ts type TangleExecutionEnvironment @@ -448,7 +448,7 @@ type TangleExecutionEnvironment ### `TangleExecutionKeyError` -`class` +`class` — Represent execution key errors with specific codes and HTTP status information ```ts class TangleExecutionKeyError @@ -456,7 +456,7 @@ class TangleExecutionKeyError ### `TangleExecutionKeyErrorCode` -`type` +`type` — Define error codes for Tangle execution key issues related to API key and account connection ```ts type TangleExecutionKeyErrorCode @@ -464,7 +464,7 @@ type TangleExecutionKeyErrorCode ### `tangleExecutionKeyHttpError` -`function` +`function` — Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null ```ts (error: unknown) => TangleExecutionKeyHttpError | null @@ -472,7 +472,7 @@ type TangleExecutionKeyErrorCode ### `TangleExecutionKeyHttpError` -`interface` +`interface` — Represent HTTP error response containing status, error message, and specific error code ```ts interface TangleExecutionKeyHttpError @@ -480,7 +480,7 @@ interface TangleExecutionKeyHttpError ### `TangleExecutionKeySource` -`type` +`type` — Resolve the source of the Tangle execution key as either local environment or user input ```ts type TangleExecutionKeySource @@ -528,7 +528,7 @@ type ToolLoopStopReason ### `trimOrNull` -`function` +`function` — Resolve a string by trimming whitespace or returning null if empty or undefined ```ts (value: string | null | undefined) => string | null diff --git a/docs/api/sandbox.md b/docs/api/sandbox.md index 694744e..706d7cf 100644 --- a/docs/api/sandbox.md +++ b/docs/api/sandbox.md @@ -8,7 +8,7 @@ Source: `src/sandbox/index.ts` ### `AppToolDescriptor` -`interface` +`interface` — Describe an application tool with its name, unique key, and description ```ts interface AppToolDescriptor @@ -32,7 +32,7 @@ interface AppToolDescriptor ### `attachReasoningEffort` -`function` +`function` — Attach a specified reasoning effort level to an agent profile for a given harness ```ts (profile: AgentProfile, harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-dro… @@ -40,7 +40,7 @@ interface AppToolDescriptor ### `AuthenticatedSandboxUser` -`interface` +`interface` — Represent an authenticated user within a sandbox environment with a unique identifier ```ts interface AuthenticatedSandboxUser @@ -48,7 +48,7 @@ interface AuthenticatedSandboxUser ### `bearerSubprotocolToken` -`function` +`function` — Resolve and decode a bearer token from a comma-separated subprotocol string or return null ```ts (value: string | null) => string | null @@ -56,7 +56,7 @@ interface AuthenticatedSandboxUser ### `bearerToken` -`function` +`function` — Extract the token from a bearer authorization string or return null if invalid or missing ```ts (value: string | null) => string | null @@ -64,7 +64,7 @@ interface AuthenticatedSandboxUser ### `buildAppToolMcpServers` -`function` +`function` — Build a mapping of MCP server profiles keyed by tool identifiers from provided options ```ts (options: BuildAppToolMcpServersOptions) => Record @@ -72,7 +72,7 @@ interface AuthenticatedSandboxUser ### `BuildAppToolMcpServersOptions` -`interface` +`interface` — Define options for building MCP server configurations in the app tool environment ```ts interface BuildAppToolMcpServersOptions @@ -80,7 +80,7 @@ interface BuildAppToolMcpServersOptions ### `buildSandboxRuntimeProxyHeaders` -`function` +`function` — Build proxy headers for sandbox runtime including authorization and forwarded headers ```ts (source: Headers, sandboxApiKey: string, forwardHeaders?: string[]) => Headers @@ -88,7 +88,7 @@ interface BuildAppToolMcpServersOptions ### `buildSandboxToolFileMounts` -`function` +`function` — Build file mounts for sandbox tools based on provided options and tool configurations ```ts (options: BuildSandboxToolFileMountsOptions) => AgentProfileFileMount[] @@ -96,7 +96,7 @@ interface BuildAppToolMcpServersOptions ### `BuildSandboxToolFileMountsOptions` -`interface` +`interface` — Define options for building sandbox tool file mounts including tool specifications and paths ```ts interface BuildSandboxToolFileMountsOptions @@ -104,7 +104,7 @@ interface BuildSandboxToolFileMountsOptions ### `buildSandboxToolPathSetupScript` -`function` +`function` — Build a shell script that sets up and exports the sandbox tool binary directory in user profiles ```ts (options: SandboxToolPathOptions) => string @@ -112,7 +112,7 @@ interface BuildSandboxToolFileMountsOptions ### `classifySeveredStream` -`function` +`function` — Resolve the severed stream event to a corresponding sandbox step transition or null ```ts (event: unknown) => SandboxStepTransition | null @@ -120,7 +120,7 @@ interface BuildSandboxToolFileMountsOptions ### `createSandboxTerminalToken` -`function` +`function` — Generate a sandbox terminal token for a given subject with specified options ```ts (subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise @@ -128,7 +128,7 @@ interface BuildSandboxToolFileMountsOptions ### `createWorkspaceSandboxConnectionHandler` -`function` +`function` — Create a handler to resolve workspace sandbox connections with user and access validation ```ts (opts: WorkspaceSandboxConnectionHandlerOptions) => ({ request, params… @@ -136,7 +136,7 @@ interface BuildSandboxToolFileMountsOptions ### `createWorkspaceSandboxManager` -`function` +`function` — Create a manager to handle workspace sandbox instances with client and options configuration ```ts (opts: WorkspaceSandboxManagerOptions ({ request, params }: WorkspaceSandboxRuntimeProxyArgs) => Promis… @@ -160,7 +160,7 @@ interface BuildSandboxToolFileMountsOptions ### `DEFAULT_SANDBOX_RESOURCES` -`const` +`const` — Define default resource limits and settings for sandbox environments ```ts SandboxResourceConfig @@ -176,7 +176,7 @@ SandboxResourceConfig ### `deleteSecret` -`function` +`function` — Delete a secret by name from the given secret store and return the operation outcome ```ts (store: SecretStore, name: string) => Promise> @@ -184,7 +184,7 @@ SandboxResourceConfig ### `detectInteractiveQuestion` -`function` +`function` — Resolve the interactive question text from a structured event or return null if none found ```ts (event: unknown) => string | null @@ -192,7 +192,7 @@ SandboxResourceConfig ### `driveSandboxTurn` -`function` +`function` — Resolve a sandbox turn by processing a message with given configuration and options ```ts (shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options: DriveSandboxTurnOptio… @@ -200,7 +200,7 @@ SandboxResourceConfig ### `DriveSandboxTurnOptions` -`interface` +`interface` — Define options to manage deterministic session resumption and turn idempotency in sandboxed drive turns ```ts interface DriveSandboxTurnOptions @@ -208,7 +208,7 @@ interface DriveSandboxTurnOptions ### `encodeSandboxRuntimePath` -`function` +`function` — Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments ```ts (runtimePath: string) => string | null @@ -216,7 +216,7 @@ interface DriveSandboxTurnOptions ### `ensureWorkspaceSandbox` -`function` +`function` — Resolve or create a workspace sandbox instance with optional reuse and progress tracking ```ts (shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions) => Promise @@ -224,7 +224,7 @@ interface DriveSandboxTurnOptions ### `EnsureWorkspaceSandboxOptions` -`interface` +`interface` — Define options for ensuring a workspace sandbox with provisioning and progress handling ```ts interface EnsureWorkspaceSandboxOptions @@ -248,7 +248,7 @@ interface EnsureWorkspaceSandboxOptions ### `flattenHistory` -`function` +`function` — Build a single string combining conversation history and the current user message ```ts (message: string, history?: { role: "user" | "assistant"; content: string; }[] | undefined) => string @@ -256,7 +256,7 @@ interface EnsureWorkspaceSandboxOptions ### `getClient` -`function` +`function` — Resolve a synchronous sandbox client from provided runtime configuration credentials ```ts (shell: SandboxRuntimeConfig) => SandboxClient @@ -272,7 +272,7 @@ interface EnsureWorkspaceSandboxOptions ### `isTerminalPromptEvent` -`function` +`function` — Determine if an event is a terminal prompt event with type 'result' or 'done ```ts (event: unknown) => boolean @@ -280,7 +280,7 @@ interface EnsureWorkspaceSandboxOptions ### `LivenessProbeConfig` -`interface` +`interface` — Define configuration for liveness probes including sidecar process pattern and optional timeouts ```ts interface LivenessProbeConfig @@ -296,7 +296,7 @@ interface LivenessProbeConfig ### `MemberSyncSeam` -`interface` +`interface` — Map workspace roles to corresponding sandbox permission levels ```ts interface MemberSyncSeam @@ -304,7 +304,7 @@ interface MemberSyncSeam ### `mergeExtraMcp` -`function` +`function` — Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys ```ts (appToolMcp: Record, baseProfileMcp: Record, extra: Recor… @@ -328,7 +328,7 @@ interface MemberSyncSeam ### `mintTerminalProxyToken` -`function` +`function` — Generate a signed token for TerminalProxyIdentity with an expiration based on TTL milliseconds ```ts (secret: string, identity: TerminalProxyIdentity, ttlMs?: number, now?: () => number) => Promise Promise> @@ -424,7 +424,7 @@ interface ProvisionProfileSection ### `resetClientCache` -`function` +`function` — Reset the client cache to clear stored data and force fresh retrieval ```ts () => void @@ -432,7 +432,7 @@ interface ProvisionProfileSection ### `ResolvedModel` -`interface` +`interface` — Represent a fully configured model with optional API key and base URL for sandbox platform integration ```ts interface ResolvedModel @@ -440,7 +440,7 @@ interface ResolvedModel ### `resolveModel` -`function` +`function` — Resolve and return the appropriate model configuration based on provider settings and optional overrides ```ts (config: ProviderResolutionConfig | undefined, override?: { model?: string | undefined; modelApiKey?: string | undefine… @@ -448,7 +448,7 @@ interface ResolvedModel ### `resolveSandboxClientCredentials` -`function` +`function` — Resolve sandbox client credentials based on environment and provided options asynchronously ```ts (options?: ResolveSandboxClientCredentialsOptions) => Promise @@ -456,7 +456,7 @@ interface ResolvedModel ### `ResolveSandboxClientCredentialsOptions` -`interface` +`interface` — Resolve options for obtaining sandbox client credentials from environment variables and classification ```ts interface ResolveSandboxClientCredentialsOptions @@ -464,7 +464,7 @@ interface ResolveSandboxClientCredentialsOptions ### `runSandboxPrompt` -`function` +`function` — Resolve a sandbox prompt by streaming and aggregating message parts into a complete string ```ts (shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… @@ -472,7 +472,7 @@ interface ResolveSandboxClientCredentialsOptions ### `runSandboxToolPathSetup` -`function` +`function` — Resolve the sandbox environment PATH setup by executing the configuration script with given options ```ts (box: SandboxInstance, options: SandboxToolPathOptions) => Promise> @@ -480,7 +480,7 @@ interface ResolveSandboxClientCredentialsOptions ### `SandboxApiCredentials` -`interface` +`interface` — Define credentials required to access the sandbox API environment ```ts interface SandboxApiCredentials @@ -488,7 +488,7 @@ interface SandboxApiCredentials ### `SandboxBuildContext` -`interface` +`interface` — Define the context for building a sandbox including workspace, integrations, and optional user ID ```ts interface SandboxBuildContext @@ -496,7 +496,7 @@ interface SandboxBuildContext ### `SandboxClientCredentials` -`interface` +`interface` — Define client credentials for accessing the sandbox environment with API key and base URL ```ts interface SandboxClientCredentials @@ -520,7 +520,7 @@ interface SandboxExecChannel ### `SandboxExecOptions` -`interface` +`interface` — Define options to execute code within a sandbox environment with optional session control ```ts interface SandboxExecOptions @@ -528,7 +528,7 @@ interface SandboxExecOptions ### `SandboxFileBytesOutcome` -`type` +`type` — Represent the outcome of reading sandbox file bytes with success status and corresponding data or error ```ts type SandboxFileBytesOutcome @@ -536,7 +536,7 @@ type SandboxFileBytesOutcome ### `SandboxFileSizeOutcome` -`type` +`type` — Resolve the outcome of a sandbox file size check with success status and value or error message ```ts type SandboxFileSizeOutcome @@ -544,7 +544,7 @@ type SandboxFileSizeOutcome ### `SandboxPermissionLevel` -`type` +`type` — Define permission levels for sandbox access and control ```ts type SandboxPermissionLevel @@ -552,7 +552,7 @@ type SandboxPermissionLevel ### `SandboxResourceConfig` -`interface` +`interface` — Define configuration parameters for sandbox resource allocation and lifecycle management ```ts interface SandboxResourceConfig @@ -560,7 +560,7 @@ interface SandboxResourceConfig ### `SandboxRestoreSpec` -`interface` +`interface` — Define the specification for restoring a sandbox from a snapshot or another sandbox ID ```ts interface SandboxRestoreSpec @@ -568,7 +568,7 @@ interface SandboxRestoreSpec ### `SandboxRuntimeAuthRefreshError` -`class` +`class` — Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name ```ts class SandboxRuntimeAuthRefreshError @@ -576,7 +576,7 @@ class SandboxRuntimeAuthRefreshError ### `SandboxRuntimeConfig` -`interface` +`interface` — Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions ```ts interface SandboxRuntimeConfig @@ -584,7 +584,7 @@ interface SandboxRuntimeConfig ### `SandboxRuntimeConnection` -`interface` +`interface` — Define a connection configuration for sandbox runtime including URL and optional server-side auth token ```ts interface SandboxRuntimeConnection @@ -592,7 +592,7 @@ interface SandboxRuntimeConnection ### `SandboxScope` -`interface` +`interface` — Define a scope containing workspace and optional user identifiers for sandbox environments ```ts interface SandboxScope @@ -600,7 +600,7 @@ interface SandboxScope ### `SandboxStepTransition` -`type` +`type` — Define transitions marking the start or finish of a sandbox step with associated details ```ts type SandboxStepTransition @@ -608,7 +608,7 @@ type SandboxStepTransition ### `SandboxTerminalTokenOptions` -`interface` +`interface` — Define options for generating a sandbox terminal token including secret and expiration settings ```ts interface SandboxTerminalTokenOptions @@ -616,7 +616,7 @@ interface SandboxTerminalTokenOptions ### `SandboxTerminalTokenResult` -`interface` +`interface` — Provide token and expiration details for a sandbox terminal session ```ts interface SandboxTerminalTokenResult @@ -624,7 +624,7 @@ interface SandboxTerminalTokenResult ### `SandboxTerminalTokenSubject` -`type` +`type` — Resolve the identity type used for sandbox terminal token subjects ```ts type SandboxTerminalTokenSubject @@ -632,7 +632,7 @@ type SandboxTerminalTokenSubject ### `SandboxTerminalWsMatch` -`interface` +`interface` — Define the structure for matching a sandbox terminal WebSocket with workspace and path details ```ts interface SandboxTerminalWsMatch @@ -640,7 +640,7 @@ interface SandboxTerminalWsMatch ### `sandboxToolBinDir` -`function` +`function` — Resolve the binary directory path for a sandbox tool based on provided options ```ts (options: SandboxToolPathOptions) => string @@ -648,7 +648,7 @@ interface SandboxTerminalWsMatch ### `sandboxToolPath` -`function` +`function` — Resolve the file system path to a specified sandbox tool based on given options ```ts (options: SandboxToolPathOptions & { toolName: string; }) => string @@ -656,7 +656,7 @@ interface SandboxTerminalWsMatch ### `SandboxToolPathOptions` -`interface` +`interface` — Define options for resolving sandbox tool paths including appName, baseDir, and binDir ```ts interface SandboxToolPathOptions @@ -664,7 +664,7 @@ interface SandboxToolPathOptions ### `sandboxToolRootDir` -`function` +`function` — Resolve the root directory path for a sandbox tool based on provided options ```ts (options: SandboxToolPathOptions) => string @@ -672,7 +672,7 @@ interface SandboxToolPathOptions ### `SandboxToolSpec` -`interface` +`interface` — Define the specification for a sandbox tool including its name, content, and optional executability ```ts interface SandboxToolSpec @@ -680,7 +680,7 @@ interface SandboxToolSpec ### `ScopedTokenResult` -`interface` +`interface` — Represent a token with its expiration date and associated scope ```ts interface ScopedTokenResult @@ -688,7 +688,7 @@ interface ScopedTokenResult ### `SecretStore` -`interface` +`interface` — Define methods to create, update, retrieve, and delete secrets asynchronously ```ts interface SecretStore @@ -696,7 +696,7 @@ interface SecretStore ### `secretStoreFromClient` -`function` +`function` — Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell ```ts (shell: SandboxRuntimeConfig) => SecretStore @@ -712,7 +712,7 @@ interface SecretStore ### `splitDeferredProfileFiles` -`function` +`function` — Split profile files into inline deferred files and a lean profile without them ```ts (profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; } @@ -728,7 +728,7 @@ interface SecretStore ### `StoppedSandboxResumeFailure` -`interface` +`interface` — Describe the failure details when resuming a stopped sandbox instance ```ts interface StoppedSandboxResumeFailure @@ -736,7 +736,7 @@ interface StoppedSandboxResumeFailure ### `StoppedSandboxResumeRecovery` -`interface` +`interface` — Define the structure for resuming a stopped sandbox with replacement key and optional restore options ```ts interface StoppedSandboxResumeRecovery @@ -752,7 +752,7 @@ interface StorageConfig ### `storeSecret` -`function` +`function` — Resolve storing a secret by creating or updating it in the given SecretStore ```ts (store: SecretStore, name: string, value: string) => Promise> @@ -760,7 +760,7 @@ interface StorageConfig ### `streamSandboxPrompt` -`function` +`function` — Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options ```ts (shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… @@ -768,7 +768,7 @@ interface StorageConfig ### `StreamSandboxPromptOptions` -`interface` +`interface` — Define options for configuring and controlling a streaming sandbox prompt session ```ts interface StreamSandboxPromptOptions @@ -776,7 +776,7 @@ interface StreamSandboxPromptOptions ### `syncSandboxMemberAdd` -`function` +`function` — Resolve adding a user with a specific role to a sandbox and return the operation outcome ```ts (box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> @@ -784,7 +784,7 @@ interface StreamSandboxPromptOptions ### `syncSandboxMemberRemove` -`function` +`function` — Remove a member from the sandbox while preserving their home directory and handle the outcome ```ts (box: SandboxInstance, userId: string) => Promise> @@ -792,7 +792,7 @@ interface StreamSandboxPromptOptions ### `syncSandboxMemberRole` -`function` +`function` — Synchronize a sandbox member's role by updating permissions based on the provided role mapping ```ts (box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> @@ -800,7 +800,7 @@ interface StreamSandboxPromptOptions ### `TerminalProxyIdentity` -`interface` +`interface` — Define identity details for a terminal proxy including user, workspace, and sandbox identifiers ```ts interface TerminalProxyIdentity @@ -808,7 +808,7 @@ interface TerminalProxyIdentity ### `terminalTokenFromRequest` -`function` +`function` — Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields ```ts (headers: Headers) => string | null @@ -816,7 +816,7 @@ interface TerminalProxyIdentity ### `verifySandboxTerminalToken` -`function` +`function` — Verify the validity of a sandbox terminal token against the expected identity and options ```ts (token: string, expected: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise @@ -824,7 +824,7 @@ interface TerminalProxyIdentity ### `verifyTerminalProxyToken` -`function` +`function` — Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp ```ts (secret: string, token: string, expected: TerminalProxyIdentity, now?: () => number) => Promise @@ -832,7 +832,7 @@ interface TerminalProxyIdentity ### `WorkspaceSandboxConnectionArgs` -`interface` +`interface` — Define arguments required to establish a workspace sandbox connection ```ts interface WorkspaceSandboxConnectionArgs @@ -840,7 +840,7 @@ interface WorkspaceSandboxConnectionArgs ### `WorkspaceSandboxConnectionHandlerOptions` -`interface` +`interface` — Define options to handle workspace sandbox connections with user authentication and access control ```ts interface WorkspaceSandboxConnectionHandlerOptions @@ -848,7 +848,7 @@ interface WorkspaceSandboxConnectionHandlerOptions ### `WorkspaceSandboxEnsureContext` -`interface` +`interface` — Define the context containing workspace and user identifiers for sandbox environment operations ```ts interface WorkspaceSandboxEnsureContext @@ -856,7 +856,7 @@ interface WorkspaceSandboxEnsureContext ### `WorkspaceSandboxInstanceLike` -`interface` +`interface` — Define the shape of a workspace sandbox instance including its connection details and status ```ts interface WorkspaceSandboxInstanceLike @@ -864,7 +864,7 @@ interface WorkspaceSandboxInstanceLike ### `WorkspaceSandboxManager` -`interface` +`interface` — Manage workspace sandboxes by ensuring their creation and retrieval for specified users ```ts interface WorkspaceSandboxManager @@ -872,7 +872,7 @@ interface WorkspaceSandboxManager ### `WorkspaceSandboxManagerOptions` -`interface` +`interface` — Define configuration options for managing and interacting with workspace sandboxes ```ts interface WorkspaceSandboxManagerOptions @@ -880,7 +880,7 @@ interface WorkspaceSandboxManagerOptions ### `WorkspaceSandboxRuntimeProxyArgs` -`interface` +`interface` — Define arguments for proxying runtime requests within a workspace sandbox environment ```ts interface WorkspaceSandboxRuntimeProxyArgs @@ -888,7 +888,7 @@ interface WorkspaceSandboxRuntimeProxyArgs ### `WorkspaceSandboxRuntimeProxyHandlerOptions` -`interface` +`interface` — Define options for handling workspace sandbox runtime proxy including user, access, credentials, and connection retrieval ```ts interface WorkspaceSandboxRuntimeProxyHandlerOptions @@ -896,7 +896,7 @@ interface WorkspaceSandboxRuntimeProxyHandlerOptions ### `WorkspaceSandboxTerminalUpgradeHandlerOptions` -`interface` +`interface` — Define options to handle user authentication, workspace access, and sandbox API credential retrieval ```ts interface WorkspaceSandboxTerminalUpgradeHandlerOptions @@ -904,7 +904,7 @@ interface WorkspaceSandboxTerminalUpgradeHandlerOptions ### `WriteProfileFilesOptions` -`interface` +`interface` — Define options to control execution timeout, pacing, and retry behavior when writing profile files ```ts interface WriteProfileFilesOptions @@ -912,7 +912,7 @@ interface WriteProfileFilesOptions ### `writeProfileFilesToBox` -`function` +`function` — Write profile files to a sandbox with pacing, retries, and optional execution timeout handling ```ts (box: SandboxInstance, files: AgentProfileFileMount[], options?: WriteProfileFilesOptions) => Promise> diff --git a/docs/api/sequences-drizzle.md b/docs/api/sequences-drizzle.md index 2a12c5c..6c04a65 100644 --- a/docs/api/sequences-drizzle.md +++ b/docs/api/sequences-drizzle.md @@ -8,7 +8,7 @@ Source: `src/sequences/drizzle.ts` ### `createDrizzleSequenceStore` -`function` +`function` — Create a sequence store scoped to a specific sequence and workspace with database access and media resolution ```ts (options: CreateDrizzleSequenceStoreOptions) => SequenceStore @@ -16,7 +16,7 @@ Source: `src/sequences/drizzle.ts` ### `CreateDrizzleSequenceStoreOptions` -`interface` +`interface` — Define options for creating a Drizzle sequence store including database, tables, scope, and media resolver ```ts interface CreateDrizzleSequenceStoreOptions @@ -24,7 +24,7 @@ interface CreateDrizzleSequenceStoreOptions ### `createSequenceTables` -`function` +`function` — Build SQLite sequence tables with defined columns and relationships based on provided options ```ts (opts: CreateSequenceTablesOptions) => { sequences: SQLiteTableWithColumns<{ name: "sequence"; schema: undefined; colum… @@ -32,7 +32,7 @@ interface CreateDrizzleSequenceStoreOptions ### `CreateSequenceTablesOptions` -`interface` +`interface` — Define options for creating sequence-related database tables including workspace and user tables ```ts interface CreateSequenceTablesOptions @@ -40,7 +40,7 @@ interface CreateSequenceTablesOptions ### `SequenceClipRow` -`type` +`type` — Resolve the selected fields of sequence clips from the sequence tables data structure ```ts type SequenceClipRow @@ -56,7 +56,7 @@ type SequenceDatabase ### `SequenceDecisionRow` -`type` +`type` — Resolve a sequence decision row from the sequenceDecisions table data ```ts type SequenceDecisionRow @@ -64,7 +64,7 @@ type SequenceDecisionRow ### `SequenceExportRow` -`type` +`type` — Resolve a row type representing exported sequence data from sequenceExports table ```ts type SequenceExportRow @@ -88,7 +88,7 @@ type SequenceParentTable ### `SequenceRow` -`type` +`type` — Resolve a sequence row by inferring the selected fields from the sequences table ```ts type SequenceRow @@ -96,7 +96,7 @@ type SequenceRow ### `SequenceTables` -`type` +`type` — Resolve sequence tables by invoking the createSequenceTables factory function ```ts type SequenceTables @@ -104,7 +104,7 @@ type SequenceTables ### `SequenceTrackRow` -`type` +`type` — Resolve the selected sequence track row from the sequenceTracks table ```ts type SequenceTrackRow diff --git a/docs/api/sequences-react.md b/docs/api/sequences-react.md index 9628435..09e0684 100644 --- a/docs/api/sequences-react.md +++ b/docs/api/sequences-react.md @@ -8,7 +8,7 @@ Source: `src/sequences-react/index.ts` ### `addCaptionCommand` -`function` +`function` — Resolve a command to add a caption to a specified caption track within a timeline ```ts (input: AddCaptionInput) => TimelineCommand @@ -16,7 +16,7 @@ Source: `src/sequences-react/index.ts` ### `AddCaptionInput` -`interface` +`interface` — Define input parameters for adding a caption clip to a sequence timeline ```ts interface AddCaptionInput @@ -32,7 +32,7 @@ interface AddCaptionInput ### `ApplySnapOptions` -`interface` +`interface` — Define options to configure snapping behavior including zoom, threshold, and exclusion criteria ```ts interface ApplySnapOptions @@ -136,7 +136,7 @@ interface ClipTrimCommit ### `CommandStack` -`interface` +`interface` — Manage and track command execution with undo, redo, state subscription, and timeline reset capabilities ```ts interface CommandStack @@ -168,7 +168,7 @@ interface CommandStack ### `createCommandStack` -`function` +`function` — Create a command stack managing undo and redo operations for a given timeline ```ts (initial: SequenceTimeline) => CommandStack @@ -192,7 +192,7 @@ interface CommandStack ### `createPlaybackClock` -`function` +`function` — Create a playback clock that manages frame timing and playback state based on configuration ```ts (config: PlaybackClockConfig) => PlaybackClock @@ -208,7 +208,7 @@ interface CommandStack ### `createWhisperTranscriptionProvider` -`function` +`function` — Create a Whisper-based transcription provider with optional model configuration ```ts (opts?: { model?: string | undefined; } | undefined) => TranscriptionProvider @@ -216,7 +216,7 @@ interface CommandStack ### `createZoomMath` -`function` +`function` — Create a ZoomMath object that validates config and calculates zoom ratio within bounds ```ts (config: ZoomMathConfig) => ZoomMath @@ -224,7 +224,7 @@ interface CommandStack ### `DEFAULT_MAX_MEDIA_ELEMENTS` -`const` +`const` — Define the default maximum number of media elements allowed in a collection ```ts 4 @@ -232,7 +232,7 @@ interface CommandStack ### `DEFAULT_TIMELINE_LABELS` -`const` +`const` — Provide default labels and accessibility text for timeline editor UI elements ```ts Required @@ -240,7 +240,7 @@ Required ### `DEFAULT_WHISPER_MODEL` -`const` +`const` — Provide the default Whisper model identifier for ONNX community large v3 turbo ```ts "onnx-community/whisper-large-v3-turbo" @@ -256,7 +256,7 @@ Required ### `DeleteClipInput` -`interface` +`interface` — Define input parameters required to delete a clip from a sequence timeline ```ts interface DeleteClipInput @@ -280,7 +280,7 @@ interface EditorTimelineState ### `FrameRect` -`interface` +`interface` — Define a rectangular frame with position and size properties x, y, width, and height ```ts interface FrameRect @@ -336,7 +336,7 @@ interface LetterboxRect ### `MediaElementPool` -`interface` +`interface` — Manage a pool of media elements to acquire, check, count, and dispose resources efficiently ```ts interface MediaElementPool @@ -360,7 +360,7 @@ interface MediaElementPool ### `MoveClipInput` -`interface` +`interface` — Define input parameters to move a clip within a timeline including optional track and resolver ```ts interface MoveClipInput @@ -384,7 +384,7 @@ interface MoveDragInput ### `needsSeek` -`function` +`function` — Determine if seeking is required based on the difference between current and target times ```ts (currentTimeSeconds: number, targetSeconds: number) => boolean @@ -400,7 +400,7 @@ interface MoveDragInput ### `placeClipCommand` -`function` +`function` — Resolve and validate clip placement parameters to create a timeline command ```ts (input: PlaceClipInput) => TimelineCommand @@ -408,7 +408,7 @@ interface MoveDragInput ### `PlaceClipInput` -`interface` +`interface` — Define input parameters required to place a clip within a sequence timeline ```ts interface PlaceClipInput @@ -424,7 +424,7 @@ interface PlaybackClock ### `PlaybackClockConfig` -`interface` +`interface` — Define configuration settings for playback clock including frames per second and total duration frames ```ts interface PlaybackClockConfig @@ -432,7 +432,7 @@ interface PlaybackClockConfig ### `PooledElementLease` -`interface` +`interface` — Manage a leased element from a pool and release it to enable LRU eviction ```ts interface PooledElementLease @@ -504,7 +504,7 @@ LazyExoticComponent<(props: TimelineEditorProps) => Element> ### `SetClipTextInput` -`interface` +`interface` — Define input parameters for setting text and optional language on a specific clip in a timeline ```ts interface SetClipTextInput @@ -536,7 +536,7 @@ interface SnapIndicatorLineProps ### `SnapPoint` -`interface` +`interface` — Define a point in a timeline where snapping occurs based on frame and kind ```ts interface SnapPoint @@ -544,7 +544,7 @@ interface SnapPoint ### `SnapResult` -`interface` +`interface` — Describe the result of snapping a point to a frame including success status and snapped point details ```ts interface SnapResult @@ -560,7 +560,7 @@ interface SnapResult ### `SplitClipInput` -`interface` +`interface` — Define input parameters for splitting a clip at a specific frame within a timeline ```ts interface SplitClipInput @@ -608,7 +608,7 @@ interface TimelineEditorLabels ### `TimelineEditorProps` -`interface` +`interface` — Define properties and callbacks for editing and applying operations on a sequence timeline ```ts interface TimelineEditorProps @@ -728,7 +728,7 @@ interface TimelineTrackRowProps ### `ToggleClipDisabledInput` -`interface` +`interface` — Define input parameters to toggle the disabled state of a clip within a timeline ```ts interface ToggleClipDisabledInput @@ -744,7 +744,7 @@ interface TranscriptionProvider ### `TranscriptionSegment` -`interface` +`interface` — Represent a segment of transcription with text and start and end times in seconds ```ts interface TranscriptionSegment @@ -760,7 +760,7 @@ interface TranscriptionSegment ### `TrimClipInput` -`interface` +`interface` — Define input parameters for trimming a clip within a sequence timeline ```ts interface TrimClipInput @@ -832,7 +832,7 @@ interface WaveformData ### `WhisperOutput` -`interface` +`interface` — Define the structure for transcribed text output with optional segmented chunks ```ts interface WhisperOutput @@ -864,7 +864,7 @@ interface ZoomMath ### `ZoomMathConfig` -`interface` +`interface` — Define configuration settings for minimum and maximum zoom levels ```ts interface ZoomMathConfig diff --git a/docs/api/sequences.md b/docs/api/sequences.md index c905a63..2a3e9bd 100644 --- a/docs/api/sequences.md +++ b/docs/api/sequences.md @@ -8,7 +8,7 @@ Source: `src/sequences/index.ts` ### `AddCaptionOperation` -`interface` +`interface` — Add a caption with optional language, timing, and track placement details ```ts interface AddCaptionOperation @@ -16,7 +16,7 @@ interface AddCaptionOperation ### `applySequenceOperation` -`function` +`function` — Apply a sequence operation to update the store and timeline asynchronously ```ts (store: SequenceStore, timeline: SequenceTimeline, op: SequenceOperation, ctx: SequenceOperationContext) => Promise<...> @@ -32,7 +32,7 @@ interface AddCaptionOperation ### `assertClipFitsSequence` -`function` +`function` — Validate that a clip's start and duration fit within the sequence duration without overflow ```ts (input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; label: string; }) => void @@ -56,7 +56,7 @@ interface AddCaptionOperation ### `BuildCaptionChunksOptions` -`interface` +`interface` — Define options to configure caption chunk size, duration, and frame rate constraints ```ts interface BuildCaptionChunksOptions @@ -96,7 +96,7 @@ interface BuildCaptionChunksOptions ### `BuildSequencesMcpServerEntryOptions` -`type` +`type` — Extend ScopedMcpServerEntryOptions to configure MCP server entry options for sequence building ```ts type BuildSequencesMcpServerEntryOptions @@ -144,7 +144,7 @@ interface CaptionCoverageEntry ### `CaptionExportOptions` -`interface` +`interface` — Define options to export captions filtered by an optional BCP-47 language tag ```ts interface CaptionExportOptions @@ -152,7 +152,7 @@ interface CaptionExportOptions ### `CaptionTargetResolution` -`type` +`type` — Resolve caption target by specifying an existing track or creating a new one with language and name ```ts type CaptionTargetResolution @@ -176,7 +176,7 @@ type CaptionTargetResolution ### `clampClipDuration` -`function` +`function` — Clamp clip duration to fit within sequence bounds and minimum length constraints ```ts (input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number @@ -184,7 +184,7 @@ type CaptionTargetResolution ### `clampClipStart` -`function` +`function` — Clamp the clip start frame within the valid range of the sequence duration and clip length ```ts (input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number @@ -192,7 +192,7 @@ type CaptionTargetResolution ### `ContactSheetEntry` -`interface` +`interface` — Describe a single entry in a contact sheet with timing and media source details ```ts interface ContactSheetEntry @@ -200,7 +200,7 @@ interface ContactSheetEntry ### `ContactSheetManifest` -`interface` +`interface` — Define the structure for a contact sheet manifest including metadata and entries ```ts interface ContactSheetManifest @@ -208,7 +208,7 @@ interface ContactSheetManifest ### `createSequencesMcpHandler` -`function` +`function` — Create a handler to process MCP sequence requests with optional playhead frame and server info ```ts (opts: CreateSequencesMcpHandlerOptions) => (request: Request) => Promise @@ -216,7 +216,7 @@ interface ContactSheetManifest ### `CreateSequencesMcpHandlerOptions` -`interface` +`interface` — Define options for creating sequences MCP handler including store, playhead frame, and server info ```ts interface CreateSequencesMcpHandlerOptions @@ -224,7 +224,7 @@ interface CreateSequencesMcpHandlerOptions ### `CreateTrackOperation` -`interface` +`interface` — Define an operation to create a new sequence track with a specified kind and name ```ts interface CreateTrackOperation @@ -232,7 +232,7 @@ interface CreateTrackOperation ### `DEFAULT_SEQUENCES_MCP_DESCRIPTION` -`const` +`const` — Describe live timeline editor features for current video sequence including clip and caption management ```ts "Live timeline editor for the current video sequence: read timeline state, place/move/trim/split clips, add captions, m… @@ -240,7 +240,7 @@ interface CreateTrackOperation ### `DeleteClipOperation` -`interface` +`interface` — Represent a delete clip operation with a specified clip identifier ```ts interface DeleteClipOperation @@ -248,7 +248,7 @@ interface DeleteClipOperation ### `ExtendSequenceOperation` -`interface` +`interface` — Define an operation to extend a sequence by a specified number of frames ```ts interface ExtendSequenceOperation @@ -256,7 +256,7 @@ interface ExtendSequenceOperation ### `findSequenceMcpTool` -`function` +`function` — Resolve the SequenceMcpToolDefinition matching the given name or return undefined ```ts (name: string) => SequenceMcpToolDefinition | undefined @@ -264,7 +264,7 @@ interface ExtendSequenceOperation ### `formatSeconds` -`function` +`function` — Format a number of seconds into a string with integer or two-decimal precision suffix s ```ts (seconds: number) => string @@ -280,7 +280,7 @@ interface ExtendSequenceOperation ### `framesToSeconds` -`function` +`function` — Convert a frame count to seconds based on the given frames per second rate ```ts (frames: number, fps: number) => number @@ -288,7 +288,7 @@ interface ExtendSequenceOperation ### `LanguageFanoutOptions` -`interface` +`interface` — Define options to specify target languages and an optional source language for fan-out operations ```ts interface LanguageFanoutOptions @@ -320,7 +320,7 @@ interface LanguageFanoutOptions ### `MoveClipOperation` -`interface` +`interface` — Resolve an operation to move a clip to a new start frame and optional track ```ts interface MoveClipOperation @@ -328,7 +328,7 @@ interface MoveClipOperation ### `NewSequenceClip` -`interface` +`interface` — Define properties for a new sequence clip including timing, labels, and optional metadata ```ts interface NewSequenceClip @@ -336,7 +336,7 @@ interface NewSequenceClip ### `NewSequenceDecision` -`interface` +`interface` — Define the structure for a new sequence decision with optional metadata and acceptance status ```ts interface NewSequenceDecision @@ -344,7 +344,7 @@ interface NewSequenceDecision ### `NewSequenceTrack` -`interface` +`interface` — Define properties for a new sequence track including kind, name, and optional sort order ```ts interface NewSequenceTrack @@ -360,7 +360,7 @@ interface NewSequenceTrack ### `OtioClip` -`interface` +`interface` — Define a clip object with metadata, source range, and media reference according to OTIO schema ```ts interface OtioClip @@ -368,7 +368,7 @@ interface OtioClip ### `OtioExternalReference` -`interface` +`interface` — Define the structure for an external media reference with schema, URL, and optional time range ```ts interface OtioExternalReference @@ -376,7 +376,7 @@ interface OtioExternalReference ### `OtioGap` -`interface` +`interface` — Define the structure for a gap element with schema, name, and source time range properties ```ts interface OtioGap @@ -384,7 +384,7 @@ interface OtioGap ### `OtioMissingReference` -`interface` +`interface` — Represent missing references in OTIO with a fixed schema identifier ```ts interface OtioMissingReference @@ -392,7 +392,7 @@ interface OtioMissingReference ### `OtioRationalTime` -`interface` +`interface` — Represent a rational time value with a specific rate and numeric value for OTIO schema ```ts interface OtioRationalTime @@ -400,7 +400,7 @@ interface OtioRationalTime ### `OtioStack` -`interface` +`interface` — Represent a stack container holding a named collection of OtioTrack children ```ts interface OtioStack @@ -408,7 +408,7 @@ interface OtioStack ### `OtioTimeline` -`interface` +`interface` — Define the structure of a timeline with metadata, tracks, and global start time in OTIO format ```ts interface OtioTimeline @@ -416,7 +416,7 @@ interface OtioTimeline ### `OtioTimeRange` -`interface` +`interface` — Define a time range with a start time and duration using OtioRationalTime values ```ts interface OtioTimeRange @@ -424,7 +424,7 @@ interface OtioTimeRange ### `OtioTrack` -`interface` +`interface` — Define a track containing video or audio clips with metadata and child elements ```ts interface OtioTrack @@ -440,7 +440,7 @@ interface OtioTrack ### `PlaceClipOperation` -`interface` +`interface` — Define an operation to place a media clip with timing, track, and playback options ```ts interface PlaceClipOperation @@ -456,7 +456,7 @@ interface PlaceClipOperation ### `QueueExportOperation` -`interface` +`interface` — Define the structure for a queue export operation with format and optional metadata ```ts interface QueueExportOperation @@ -488,7 +488,7 @@ interface QueueExportOperation ### `secondsToFrames` -`function` +`function` — Convert seconds to the nearest whole number of frames based on frames per second ```ts (seconds: number, fps: number) => number @@ -496,7 +496,7 @@ interface QueueExportOperation ### `SEQUENCE_EXPORT_FORMATS` -`const` +`const` — Define supported export formats for sequence outputs including video, subtitle, and metadata types ```ts readonly ["mp4", "otio", "xml", "edl", "vtt", "srt", "contact_sheet"] @@ -504,7 +504,7 @@ readonly ["mp4", "otio", "xml", "edl", "vtt", "srt", "contact_sheet"] ### `SEQUENCE_MCP_TOOLS` -`const` +`const` — Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations ```ts readonly SequenceMcpToolDefinition[] @@ -512,7 +512,7 @@ readonly SequenceMcpToolDefinition[] ### `SEQUENCE_MEDIA_KINDS` -`const` +`const` — Define the allowed media kinds for sequences including video, image, and audio ```ts readonly ["video", "image", "audio"] @@ -520,7 +520,7 @@ readonly ["video", "image", "audio"] ### `SEQUENCE_OPERATION_TYPES` -`const` +`const` — List all valid sequence operation types used in editing workflows ```ts readonly ("place_clip" | "add_caption" | "move_clip" | "trim_clip" | "split_clip" | "set_clip_text" | "set_clip_disable… @@ -528,7 +528,7 @@ readonly ("place_clip" | "add_caption" | "move_clip" | "trim_clip" | "split_clip ### `SEQUENCE_TRACK_KINDS` -`const` +`const` — Define immutable sequence track kinds for video, audio, caption, reference, and agent ```ts readonly ["video", "audio", "caption", "reference", "agent"] @@ -544,7 +544,7 @@ type SequenceApplyResult ### `SequenceClip` -`interface` +`interface` — Define properties for a media sequence clip including timing, source, track, and caption details ```ts interface SequenceClip @@ -560,7 +560,7 @@ interface SequenceClipMedia ### `SequenceClipPatch` -`interface` +`interface` — Define optional properties to update or patch a sequence clip's attributes in a timeline ```ts interface SequenceClipPatch @@ -576,7 +576,7 @@ interface SequenceDecision ### `SequenceExportFormat` -`type` +`type` — Define export formats available for sequence data including video, subtitle, and metadata types ```ts type SequenceExportFormat @@ -584,7 +584,7 @@ type SequenceExportFormat ### `SequenceExportRecord` -`interface` +`interface` — Describe a record representing the export details and status of a sequence ```ts interface SequenceExportRecord @@ -592,7 +592,7 @@ interface SequenceExportRecord ### `SequenceExportStatus` -`type` +`type` — Represent export status of a sequence as queued, processing, completed, failed, or cancelled ```ts type SequenceExportStatus @@ -608,7 +608,7 @@ interface SequenceFrameSnapshot ### `SequenceMcpToolDefinition` -`interface` +`interface` — Define a tool with metadata and a run method for processing input within a specific environment ```ts interface SequenceMcpToolDefinition @@ -624,7 +624,7 @@ interface SequenceMcpToolEnv ### `SequenceMediaKind` -`type` +`type` — Define media types allowed in a sequence including video, image, and audio ```ts type SequenceMediaKind @@ -632,7 +632,7 @@ type SequenceMediaKind ### `SequenceMeta` -`interface` +`interface` — Describe metadata and properties of a media sequence including dimensions, duration, and status ```ts interface SequenceMeta @@ -640,7 +640,7 @@ interface SequenceMeta ### `SequenceOperation` -`type` +`type` — Represent sequence editing actions for manipulating clips, tracks, captions, and exports ```ts type SequenceOperation @@ -656,7 +656,7 @@ interface SequenceOperationContext ### `SequenceOperationType` -`type` +`type` — Extract the type of operation from a sequence operation object ```ts type SequenceOperationType @@ -680,7 +680,7 @@ readonly ["2025-06-18", "2025-03-26", "2024-11-05"] ### `SequencesMcpServerInfo` -`interface` +`interface` — Describe server information including name and version for Sequences MCP integration ```ts interface SequencesMcpServerInfo @@ -688,7 +688,7 @@ interface SequencesMcpServerInfo ### `SequenceStatus` -`type` +`type` — Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived ```ts type SequenceStatus @@ -696,7 +696,7 @@ type SequenceStatus ### `SequenceStore` -`interface` +`interface` — Manage sequences by providing methods to get timelines, clips, and modify tracks and clips ```ts interface SequenceStore @@ -720,7 +720,7 @@ interface SequenceTimeline ### `SequenceTrack` -`interface` +`interface` — Define properties and state for a sequence track including id, kind, name, order, and flags ```ts interface SequenceTrack @@ -736,7 +736,7 @@ type SequenceTrackKind ### `SetClipDisabledOperation` -`interface` +`interface` — Define an operation to enable or disable a clip by its identifier ```ts interface SetClipDisabledOperation @@ -744,7 +744,7 @@ interface SetClipDisabledOperation ### `SetClipTextOperation` -`interface` +`interface` — Resolve an operation to set clipboard text with optional language and clip identifier ```ts interface SetClipTextOperation @@ -760,7 +760,7 @@ interface SetClipTextOperation ### `SplitClipOperation` -`interface` +`interface` — Split a clip at a specified frame inside the clip to create two separate segments ```ts interface SplitClipOperation @@ -768,7 +768,7 @@ interface SplitClipOperation ### `TimelineClipBounds` -`interface` +`interface` — Define the start frame and duration in frames for a timeline clip's bounds ```ts interface TimelineClipBounds @@ -776,7 +776,7 @@ interface TimelineClipBounds ### `TimelineInterval` -`interface` +`interface` — Define a time range with inclusive start and end frame numbers ```ts interface TimelineInterval @@ -800,7 +800,7 @@ interface TranscriptSegment ### `TrimClipOperation` -`interface` +`interface` — Define an operation to trim a clip by adjusting its start, duration, and optional source in/out points ```ts interface TrimClipOperation @@ -808,7 +808,7 @@ interface TrimClipOperation ### `validateAddCaption` -`function` +`function` — Validate the parameters and context of an AddCaptionOperation within a sequence timeline ```ts (timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext) => void @@ -816,7 +816,7 @@ interface TrimClipOperation ### `validateCreateTrack` -`function` +`function` — Validate that a CreateTrackOperation has a supported kind and a non-empty name ```ts (operation: CreateTrackOperation) => void @@ -824,7 +824,7 @@ interface TrimClipOperation ### `validateDeleteClip` -`function` +`function` — Validate that the clip to delete exists and is mutable in the given timeline ```ts (timeline: SequenceTimeline, operation: DeleteClipOperation) => void @@ -832,7 +832,7 @@ interface TrimClipOperation ### `validateExtendSequence` -`function` +`function` — Validate that the extend sequence operation has a positive duration and exceeds the last clip end frame ```ts (timeline: SequenceTimeline, operation: ExtendSequenceOperation) => void @@ -840,7 +840,7 @@ interface TrimClipOperation ### `validateMoveClip` -`function` +`function` — Validate that a clip move operation is within bounds and targets a compatible unlocked track ```ts (timeline: SequenceTimeline, operation: MoveClipOperation) => void @@ -848,7 +848,7 @@ interface TrimClipOperation ### `validatePlaceClip` -`function` +`function` — Validate the properties and constraints of a PlaceClipOperation within a SequenceTimeline ```ts (timeline: SequenceTimeline, operation: PlaceClipOperation) => void @@ -856,7 +856,7 @@ interface TrimClipOperation ### `validateQueueExport` -`function` +`function` — Validate that the queue export operation uses a supported export format ```ts (operation: QueueExportOperation) => void @@ -864,7 +864,7 @@ interface TrimClipOperation ### `validateSequenceOperation` -`function` +`function` — Validate a sequence operation against the timeline and context to ensure correctness ```ts (timeline: SequenceTimeline, operation: SequenceOperation, ctx: SequenceOperationContext) => void @@ -872,7 +872,7 @@ interface TrimClipOperation ### `validateSequenceOperations` -`function` +`function` — Validate each operation in a sequence against the timeline and context, throwing detailed errors on failure ```ts (timeline: SequenceTimeline, operations: SequenceOperation[], ctx: SequenceOperationContext) => void @@ -880,7 +880,7 @@ interface TrimClipOperation ### `validateSetClipDisabled` -`function` +`function` — Validate that the clip can be disabled within the given timeline and operation constraints ```ts (timeline: SequenceTimeline, operation: SetClipDisabledOperation) => void @@ -888,7 +888,7 @@ interface TrimClipOperation ### `validateSetClipText` -`function` +`function` — Validate that a SetClipTextOperation targets a caption clip with non-empty text and valid language tag ```ts (timeline: SequenceTimeline, operation: SetClipTextOperation) => void @@ -896,7 +896,7 @@ interface TrimClipOperation ### `validateSplitClip` -`function` +`function` — Validate that a split operation on a clip is within valid frame boundaries and conditions ```ts (timeline: SequenceTimeline, operation: SplitClipOperation) => void @@ -904,7 +904,7 @@ interface TrimClipOperation ### `validateTrimClip` -`function` +`function` — Validate that a trim clip operation respects timeline bounds and source frame constraints ```ts (timeline: SequenceTimeline, operation: TrimClipOperation) => void diff --git a/docs/api/store.md b/docs/api/store.md index 9448a98..7b053a3 100644 --- a/docs/api/store.md +++ b/docs/api/store.md @@ -32,7 +32,7 @@ interface DatabaseProvider ### `DatabaseProviderOptions` -`interface` +`interface` — Define options for configuring database provider behavior including error messaging ```ts interface DatabaseProviderOptions @@ -40,7 +40,7 @@ interface DatabaseProviderOptions ### `KVGetWithMetadataResult` -`interface` +`interface` — Resolve a key-value pair retrieval including its associated metadata and value ```ts interface KVGetWithMetadataResult @@ -48,7 +48,7 @@ interface KVGetWithMetadataResult ### `KVListResult` -`interface` +`interface` — Describe the result of listing keys with completion status and optional pagination cursor ```ts interface KVListResult @@ -56,7 +56,7 @@ interface KVListResult ### `KVPutOptions` -`interface` +`interface` — Define options for storing a key-value pair with expiration and metadata settings ```ts interface KVPutOptions @@ -64,7 +64,7 @@ interface KVPutOptions ### `KVStore` -`interface` +`interface` — Define a key-value store interface for asynchronous data retrieval, storage, deletion, and listing ```ts interface KVStore diff --git a/docs/api/stream.md b/docs/api/stream.md index 0b82099..a21eedf 100644 --- a/docs/api/stream.md +++ b/docs/api/stream.md @@ -8,7 +8,7 @@ Source: `src/stream/index.ts` ### `asRecord` -`function` +`function` — Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined ```ts (value: unknown) => JsonRecord | undefined @@ -16,7 +16,7 @@ Source: `src/stream/index.ts` ### `asString` -`function` +`function` — Resolve a non-empty string from a value or return undefined ```ts (value: unknown) => string | undefined @@ -32,7 +32,7 @@ Source: `src/stream/index.ts` ### `BufferedTurnEvent` -`interface` +`interface` — Represent a buffered turn event with a sequence number and serialized event data ```ts interface BufferedTurnEvent @@ -40,7 +40,7 @@ interface BufferedTurnEvent ### `BufferedTurnOptions` -`interface` +`interface` — Define options for buffering and flushing turn events with optional live client delivery and event coalescing ```ts interface BufferedTurnOptions @@ -56,7 +56,7 @@ interface BufferedTurnTap ### `buildUserTextParts` -`function` +`function` — Build an array of text parts with optional turn ID for user input ```ts (text: string, turnId: string | undefined) => JsonRecord[] @@ -96,7 +96,7 @@ interface BufferedTurnTap ### `createD1TurnEventStore` -`function` +`function` — Resolve a TurnEventStore that appends and reads turn events using a D1-like database interface ```ts (db: D1LikeForTurns) => TurnEventStore @@ -120,7 +120,7 @@ interface D1LikeForTurns ### `encodeEvent` -`function` +`function` — Encode a StreamEvent object into a Uint8Array using the provided TextEncoder ```ts (encoder: TextEncoder, event: StreamEvent) => Uint8Array @@ -128,7 +128,7 @@ interface D1LikeForTurns ### `finalizeAssistantParts` -`function` +`function` — Resolve and clean up assistant parts by terminalizing and collapsing redundant segments ```ts (partOrder: string[], partMap: Map, finalText: string) => JsonRecord[] @@ -144,7 +144,7 @@ interface D1LikeForTurns ### `getPartKey` -`function` +`function` — Resolve a unique key string for a part based on its type and identifying properties ```ts (part: JsonRecord) => string @@ -152,7 +152,7 @@ interface D1LikeForTurns ### `JsonRecord` -`type` +`type` — Represent a JSON-compatible object with string keys and values of any type ```ts type JsonRecord @@ -160,7 +160,7 @@ type JsonRecord ### `mergePersistedPart` -`function` +`function` — Merge incoming JSON with existing persisted data, applying delta for text types when provided ```ts (existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string | undefined) => JsonRecord @@ -168,7 +168,7 @@ type JsonRecord ### `messageHasTurnId` -`function` +`function` — Resolve whether a message contains any part with the specified turn ID ```ts (message: PersistedChatMessageForTurn, turnId: string) => boolean @@ -176,7 +176,7 @@ type JsonRecord ### `MISSING_TOOL_TERMINAL_ERROR` -`const` +`const` — Resolve errors when a tool fails to report a terminal result before the assistant turn ends ```ts "Tool did not report a terminal result before the assistant turn completed." @@ -184,7 +184,7 @@ type JsonRecord ### `MISSING_TOOL_TERMINAL_REASON` -`const` +`const` — Provide the reason identifier for a missing tool in the terminal environment ```ts "missing-tool-terminal" @@ -192,7 +192,7 @@ type JsonRecord ### `normalizeClientTurnId` -`function` +`function` — Normalize and validate a client turn ID string ensuring it meets format and length requirements ```ts (value: unknown) => string | undefined @@ -200,7 +200,7 @@ type JsonRecord ### `normalizePersistedPart` -`function` +`function` — Normalize a persisted part object by standardizing its structure and fields ```ts (rawPart: JsonRecord) => JsonRecord | null @@ -208,7 +208,7 @@ type JsonRecord ### `normalizeTime` -`function` +`function` — Resolve time properties from various keys into a normalized record with numeric start and end fields ```ts (value: unknown) => JsonRecord | undefined @@ -216,7 +216,7 @@ type JsonRecord ### `normalizeToolEvent` -`function` +`function` — Normalize tool-related events into a standardized message.part.updated format ```ts (event: StreamEvent) => StreamEvent @@ -224,7 +224,7 @@ type JsonRecord ### `PersistedChatMessageForTurn` -`interface` +`interface` — Define the structure of a chat message stored for a specific conversation turn ```ts interface PersistedChatMessageForTurn @@ -240,7 +240,7 @@ interface PersistedChatMessageForTurn ### `PumpBufferedTurnOptions` -`interface` +`interface` — Define options to pump data from an asynchronous iterable source with buffered turn control ```ts interface PumpBufferedTurnOptions @@ -256,7 +256,7 @@ interface PumpBufferedTurnOptions ### `ReplayTurnEventsOptions` -`interface` +`interface` — Define options for replaying turn events with control over sequence, polling, and timeout ```ts interface ReplayTurnEventsOptions @@ -264,7 +264,7 @@ interface ReplayTurnEventsOptions ### `resolveChatTurn` -`function` +`function` — Resolve a chat turn by determining message reuse and constructing user message parts ```ts (input: { existingMessages: PersistedChatMessageForTurn[]; userContent: string; turnId?: string | undefined; }) => Reso… @@ -272,7 +272,7 @@ interface ReplayTurnEventsOptions ### `ResolvedChatTurn` -`interface` +`interface` — Represent a chat turn with resolved user message insertion and prior message context ```ts interface ResolvedChatTurn @@ -280,7 +280,7 @@ interface ResolvedChatTurn ### `resolveToolId` -`function` +`function` — Resolve a unique tool identifier from various possible properties or generate a fallback ID ```ts (part: JsonRecord) => string @@ -288,7 +288,7 @@ interface ResolvedChatTurn ### `resolveToolName` -`function` +`function` — Resolve the tool name from a JSON record using tool, name, or a default value ```ts (part: JsonRecord) => string @@ -296,7 +296,7 @@ interface ResolvedChatTurn ### `StreamEvent` -`interface` +`interface` — Define an event object carrying a type and optional JSON data payload ```ts interface StreamEvent @@ -320,7 +320,7 @@ interface StreamEvent ### `terminalizeDanglingToolParts` -`function` +`function` — Resolve dangling tool parts into terminal forms within the given JSON records array ```ts (parts: JsonRecord[]) => JsonRecord[] @@ -344,7 +344,7 @@ interface StreamEvent ### `TurnEventStore` -`interface` +`interface` — Manage and query turn events and their lifecycle statuses within a scoped event store ```ts interface TurnEventStore diff --git a/docs/api/studio-react.md b/docs/api/studio-react.md index c4c34c9..30cf833 100644 --- a/docs/api/studio-react.md +++ b/docs/api/studio-react.md @@ -208,7 +208,7 @@ interface StudioWorkspaceProps ### `TYPE_CONFIG` -`const` +`const` — Map type keys to their corresponding configuration objects including labels, icons, and colors ```ts Record @@ -216,7 +216,7 @@ Record ### `TypeConfig` -`interface` +`interface` — Define configuration options for a type including label, icon, and color properties ```ts interface TypeConfig @@ -224,7 +224,7 @@ interface TypeConfig ### `typeConfigFor` -`function` +`function` — Resolve the configuration object for a given type or return the default image configuration ```ts (type: string) => TypeConfig diff --git a/docs/api/studio.md b/docs/api/studio.md index d848b0c..a35ce21 100644 --- a/docs/api/studio.md +++ b/docs/api/studio.md @@ -8,7 +8,7 @@ Source: `src/studio/index.ts` ### `buildGenerationRequestBody` -`function` +`function` — Build the request body object for a generation operation from provided fields ```ts (fields: GenerationRequestFields) => Record @@ -16,7 +16,7 @@ Source: `src/studio/index.ts` ### `buildPublishPackage` -`function` +`function` — Build a PublishPackage object from caption, description, mentions, cadence, and destinations inputs ```ts ({ caption, postDescription, mentions, cadence, destinations, }: { caption: string; postDescription: string; mentions:… @@ -24,7 +24,7 @@ Source: `src/studio/index.ts` ### `CADENCES` -`const` +`const` — Provide an array of predefined cadence options for scheduling or approval processes ```ts string[] @@ -32,7 +32,7 @@ string[] ### `DESTINATIONS` -`const` +`const` — List available social media platforms with their publishing fields and provider identifiers ```ts PublishDestination[] @@ -40,7 +40,7 @@ PublishDestination[] ### `failedOptimisticGeneration` -`function` +`function` — Mark a generation as failed with updated status and error information ```ts (generation: Generation) => Generation @@ -48,7 +48,7 @@ PublishDestination[] ### `Generation` -`interface` +`interface` — Define the structure for a generation entity including its metadata and creation details ```ts interface Generation @@ -56,7 +56,7 @@ interface Generation ### `GENERATION_TYPES` -`const` +`const` — Provide an array of supported generation types for media and content processing ```ts readonly GenerationType[] @@ -64,7 +64,7 @@ readonly GenerationType[] ### `generationError` -`function` +`function` — Resolve and return the first user-safe error message from generation metadata or null if none exist ```ts (generation: Generation) => string | null @@ -72,7 +72,7 @@ readonly GenerationType[] ### `generationMergeKey` -`function` +`function` — Resolve a unique merge key from a generation using batch slot or client request ID ```ts (generation: Generation) => string | null @@ -80,7 +80,7 @@ readonly GenerationType[] ### `GenerationRequestFields` -`interface` +`interface` — Define fields required to configure and request various types of media generation ```ts interface GenerationRequestFields @@ -88,7 +88,7 @@ interface GenerationRequestFields ### `generationStatus` -`function` +`function` — Resolve the current status of a generation based on its metadata and result fields ```ts (generation: Generation) => GenerationStatus @@ -96,7 +96,7 @@ interface GenerationRequestFields ### `GenerationStatus` -`type` +`type` — Define possible states representing the progress of a generation process ```ts type GenerationStatus @@ -104,7 +104,7 @@ type GenerationStatus ### `GenerationType` -`type` +`type` — Define generation categories for media including image, video, speech, avatar, and transcription ```ts type GenerationType @@ -112,7 +112,7 @@ type GenerationType ### `generationVaultPath` -`function` +`function` — Resolve the vault path string from a Generation object or return null if unavailable ```ts (generation: Generation) => string | null @@ -120,7 +120,7 @@ type GenerationType ### `isDestinationConnected` -`function` +`function` — Determine if a destination has any active connections in the given list of studio integration connections ```ts (destination: PublishDestination, connections: StudioIntegrationConnection[]) => boolean @@ -128,7 +128,7 @@ type GenerationType ### `isGenerationType` -`function` +`function` — Resolve whether a string value matches a valid GenerationType ```ts (value: string) => value is GenerationType @@ -136,7 +136,7 @@ type GenerationType ### `isLocalGeneration` -`function` +`function` — Determine if a generation ID indicates a local generation ```ts (generation: Generation) => boolean @@ -144,7 +144,7 @@ type GenerationType ### `isPublishPackage` -`function` +`function` — Determine if a value conforms to the PublishPackage structure with optional metadata fields ```ts (value: unknown) => value is { caption?: string | undefined; description?: string | undefined; mentions?: string[] | un… @@ -152,7 +152,7 @@ type GenerationType ### `latestBatchOf` -`function` +`function` — Resolve and return the latest batch of generations grouped and sorted by client request ID and output index ```ts (generations: Generation[]) => Generation[] @@ -160,7 +160,7 @@ type GenerationType ### `MAX_IMAGE_COUNT` -`const` +`const` — Define the maximum number of images allowed for upload or display ```ts 4 @@ -168,7 +168,7 @@ type GenerationType ### `MediaModelCatalogResponse` -`interface` +`interface` — Represent media model catalog with default values, model options, and optional error message ```ts interface MediaModelCatalogResponse @@ -176,7 +176,7 @@ interface MediaModelCatalogResponse ### `MediaModelOption` -`interface` +`interface` — Describe media model option properties including id, name, type, status, and optional provider and reason ```ts interface MediaModelOption @@ -184,7 +184,7 @@ interface MediaModelOption ### `MediaModelStatus` -`type` +`type` — Define possible status values for a media model's availability and accessibility ```ts type MediaModelStatus @@ -192,7 +192,7 @@ type MediaModelStatus ### `mergeLiveGeneration` -`function` +`function` — Merge a new generation into the current list by replacing or prepending it based on matching keys ```ts (current: Generation[], generation: Generation) => Generation[] @@ -200,7 +200,7 @@ type MediaModelStatus ### `mergeLoaderAndLive` -`function` +`function` — Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs ```ts (loader: Generation[], live: Generation[]) => Generation[] @@ -208,7 +208,7 @@ type MediaModelStatus ### `MIN_IMAGE_COUNT` -`const` +`const` — Define the minimum number of images required for processing or validation ```ts 1 @@ -216,7 +216,7 @@ type MediaModelStatus ### `modelMessage` -`function` +`function` — Resolve the appropriate status message for a media model based on loading state and availability ```ts (model: MediaModelOption | undefined, loading: boolean, count: number) => string | null @@ -224,7 +224,7 @@ type MediaModelStatus ### `normalizeImageCount` -`function` +`function` — Normalize a value to a finite integer within the allowed image count range ```ts (value: unknown) => number @@ -232,7 +232,7 @@ type MediaModelStatus ### `optimisticGeneration` -`function` +`function` — Generate content optimistically based on input parameters and optional model and output details ```ts ({ type, prompt, model, clientRequestId, outputIndex, outputCount, }: { type: GenerationType; prompt: string; model?: s… @@ -240,7 +240,7 @@ type MediaModelStatus ### `outputPathFor` -`function` +`function` — Resolve the output directory path based on the specified generation type ```ts (type: GenerationType) => string @@ -248,7 +248,7 @@ type MediaModelStatus ### `preferredModelId` -`function` +`function` — Resolve the preferred model ID for a given generation type from the media model catalog ```ts (type: GenerationType, catalog: MediaModelCatalogResponse | null) => string | undefined @@ -256,7 +256,7 @@ type MediaModelStatus ### `PublishDestination` -`interface` +`interface` — Define a destination for publishing content with identifiers, label, provider IDs, and fields ```ts interface PublishDestination @@ -264,7 +264,7 @@ interface PublishDestination ### `PublishPackage` -`interface` +`interface` — Define the structure for configuring package publishing details and evaluation criteria ```ts interface PublishPackage @@ -272,7 +272,7 @@ interface PublishPackage ### `relativeTime` -`function` +`function` — Resolve a human-readable relative time string from a given date or return an empty string if null ```ts (date: Date | null) => string @@ -280,7 +280,7 @@ interface PublishPackage ### `selectedModelsWithDefaults` -`function` +`function` — Resolve selected models by applying defaults for missing or unavailable entries in the catalog ```ts (current: Partial>, catalog: MediaModelCatalogResponse) => Partial string diff --git a/docs/api/tangle.md b/docs/api/tangle.md index 15ecd56..8464807 100644 --- a/docs/api/tangle.md +++ b/docs/api/tangle.md @@ -24,7 +24,7 @@ interface BrokerTokenMinter ### `BrokerTokenProvider` -`interface` +`interface` — Provide and refresh broker bearer tokens, allowing forced token invalidation ```ts interface BrokerTokenProvider @@ -32,7 +32,7 @@ interface BrokerTokenProvider ### `BrokerTokenProviderOptions` -`interface` +`interface` — Define options for configuring a broker token provider including client credentials and token management settings ```ts interface BrokerTokenProviderOptions @@ -48,7 +48,7 @@ interface BrokerTokenProviderOptions ### `ConsentUrlInput` -`interface` +`interface` — Define input parameters required to generate a consent URL for OAuth authorization ```ts interface ConsentUrlInput diff --git a/docs/api/teams-drizzle.md b/docs/api/teams-drizzle.md index 3ddd084..c648538 100644 --- a/docs/api/teams-drizzle.md +++ b/docs/api/teams-drizzle.md @@ -8,7 +8,7 @@ Source: `src/teams/drizzle.ts` ### `CreateAccessOptions` -`interface` +`interface` — Define options required to create access with database, tables, and workspace table references ```ts interface CreateAccessOptions @@ -16,7 +16,7 @@ interface CreateAccessOptions ### `createEnsurePersonalOrganization` -`function` +`function` — Ensure a user has a personal organization by creating or retrieving it as needed ```ts (opts: CreatePersonalOrganizationOptions) => (user: EnsurePersonalOrganizationUser) => Promise OrganizationAccessApi @@ -32,7 +32,7 @@ interface CreateAccessOptions ### `CreateOrganizationAccessOptions` -`interface` +`interface` — Define options required to create access for an organization including database and tables ```ts interface CreateOrganizationAccessOptions @@ -40,7 +40,7 @@ interface CreateOrganizationAccessOptions ### `CreatePersonalOrganizationOptions` -`interface` +`interface` — Define options required to create a personal organization including database and tables references ```ts interface CreatePersonalOrganizationOptions @@ -48,7 +48,7 @@ interface CreatePersonalOrganizationOptions ### `createTeamTables` -`function` +`function` — Build SQLite tables for organizations and related team structures using provided options ```ts (opts: CreateTeamTablesOptions) => { organizations: SQLiteTableWithColumns<{ name: "organization"; schema: undefined; c… @@ -56,7 +56,7 @@ interface CreatePersonalOrganizationOptions ### `CreateTeamTablesOptions` -`interface` +`interface` — Define options specifying user and workspace tables for creating team-related tables ```ts interface CreateTeamTablesOptions @@ -64,7 +64,7 @@ interface CreateTeamTablesOptions ### `createWorkspaceAccess` -`function` +`function` — Create workspace access API to manage user roles and permissions within a workspace ```ts (opts: CreateAccessOptions) => WorkspaceAccessApi @@ -72,7 +72,7 @@ interface CreateTeamTablesOptions ### `createWorkspaceInvitationTable` -`function` +`function` — Build a workspace invitation table with defined columns and foreign key constraints ```ts (opts: CreateWorkspaceInvitationTableOptions) => { workspaceInvitations: SQLiteTableWithColumns<{ name: "workspace_invi… @@ -80,7 +80,7 @@ interface CreateTeamTablesOptions ### `CreateWorkspaceInvitationTableOptions` -`interface` +`interface` — Define options for creating a workspace invitation table with user, workspace, and organization references ```ts interface CreateWorkspaceInvitationTableOptions @@ -88,7 +88,7 @@ interface CreateWorkspaceInvitationTableOptions ### `EnsurePersonalOrganizationUser` -`interface` +`interface` — Define the structure for a user within a personal organization context ```ts interface EnsurePersonalOrganizationUser @@ -96,7 +96,7 @@ interface EnsurePersonalOrganizationUser ### `OrganizationAccess` -`interface` +`interface` — Define access details linking an organization, its member, and the member's role ```ts interface OrganizationAccess @@ -104,7 +104,7 @@ interface OrganizationAccess ### `OrganizationAccessApi` -`interface` +`interface` — Define methods to retrieve and enforce user access levels within an organization ```ts interface OrganizationAccessApi @@ -112,7 +112,7 @@ interface OrganizationAccessApi ### `OrganizationMemberRow` -`type` +`type` — Resolve the structure of an organization member row from the team tables selection ```ts type OrganizationMemberRow @@ -120,7 +120,7 @@ type OrganizationMemberRow ### `OrganizationRow` -`type` +`type` — Resolve the structure of an organization row from the organizations table in TeamTables ```ts type OrganizationRow @@ -128,7 +128,7 @@ type OrganizationRow ### `PersonalOrganizationResult` -`interface` +`interface` — Describe a personal organization result including organization, member, and role details ```ts interface PersonalOrganizationResult @@ -152,7 +152,7 @@ type TeamParentTable ### `TeamTables` -`type` +`type` — Resolve team tables by deriving the return type of createTeamTables ```ts type TeamTables @@ -160,7 +160,7 @@ type TeamTables ### `UserWorkspaceSummary` -`interface` +`interface` — Describe a user's workspace details including organization and role information ```ts interface UserWorkspaceSummary @@ -168,7 +168,7 @@ interface UserWorkspaceSummary ### `WorkspaceAccess` -`interface` +`interface` — Define access details including workspace data, organization info, member info, and role within workspace ```ts interface WorkspaceAccess @@ -176,7 +176,7 @@ interface WorkspaceAccess ### `WorkspaceAccessApi` -`interface` +`interface` — Define methods to retrieve and enforce user access permissions within workspaces ```ts interface WorkspaceAccessApi @@ -192,7 +192,7 @@ interface WorkspaceAccessTable ### `WorkspaceInvitationRow` -`type` +`type` — Resolve the structure of a workspace invitation row from the workspaceInvitations table ```ts type WorkspaceInvitationRow @@ -200,7 +200,7 @@ type WorkspaceInvitationRow ### `WorkspaceInvitationTables` -`type` +`type` — Resolve the structure of workspace invitation tables from the creation function ```ts type WorkspaceInvitationTables @@ -208,7 +208,7 @@ type WorkspaceInvitationTables ### `WorkspaceMemberRow` -`type` +`type` — Resolve a workspace member row with selected fields from the workspaceMembers table ```ts type WorkspaceMemberRow diff --git a/docs/api/teams-invitations-api.md b/docs/api/teams-invitations-api.md index 2856ee5..f5ea7ef 100644 --- a/docs/api/teams-invitations-api.md +++ b/docs/api/teams-invitations-api.md @@ -24,7 +24,7 @@ interface EnforceSeatSeam ### `InvitationOutcome` -`type` +`type` — Resolve the result of an invitation as success with a value or failure with status and error details ```ts type InvitationOutcome @@ -32,7 +32,7 @@ type InvitationOutcome ### `InvitationPreview` -`interface` +`interface` — Describe the structure of an invitation preview with workspace, email, permissions, status, and expiration details ```ts interface InvitationPreview @@ -40,7 +40,7 @@ interface InvitationPreview ### `InvitationsApiOptions` -`interface` +`interface` — Define configuration options required to manage workspace invitations and related data sources ```ts interface InvitationsApiOptions @@ -88,7 +88,7 @@ interface SendInvitationEmailInput ### `SendInvitationEmailResult` -`type` +`type` — Represent the outcome of sending an invitation email with success status and optional error message ```ts type SendInvitationEmailResult @@ -96,7 +96,7 @@ type SendInvitationEmailResult ### `SendInvitationEmailSeam` -`interface` +`interface` — Resolve sending an invitation email and return the result asynchronously ```ts interface SendInvitationEmailSeam @@ -104,7 +104,7 @@ interface SendInvitationEmailSeam ### `WorkspaceInvitationView` -`interface` +`interface` — Represent a workspace invitation with details about inviter, permissions, status, and timestamps ```ts interface WorkspaceInvitationView diff --git a/docs/api/teams-members-api.md b/docs/api/teams-members-api.md index f906177..bb132fa 100644 --- a/docs/api/teams-members-api.md +++ b/docs/api/teams-members-api.md @@ -24,7 +24,7 @@ interface EnforceSeatSeam ### `MemberListEntry` -`interface` +`interface` — Define the structure of a workspace member entry with identification, role, and status details ```ts interface MemberListEntry @@ -40,7 +40,7 @@ interface MembersApiActor ### `MembersApiOptions` -`interface` +`interface` — Define configuration options for managing team members and workspace access APIs ```ts interface MembersApiOptions diff --git a/docs/api/teams-react-lazy.md b/docs/api/teams-react-lazy.md index e184b1b..51ec9a2 100644 --- a/docs/api/teams-react-lazy.md +++ b/docs/api/teams-react-lazy.md @@ -8,7 +8,7 @@ Source: `src/teams-react/lazy.tsx` ### `InvitationsPanelLazy` -`function` +`function` — Load InvitationsPanel component lazily to optimize initial rendering performance ```ts LazyExoticComponent<({ invitations, currentRole, onInvite, onResend, onRevoke, onCopy, onNotice, }: InvitationsPanelPro… @@ -16,7 +16,7 @@ LazyExoticComponent<({ invitations, currentRole, onInvite, onResend, onRevoke, o ### `InvitationsPanelProps` -`interface` +`interface` — Define properties and callbacks for managing workspace invitations and user roles ```ts interface InvitationsPanelProps @@ -24,7 +24,7 @@ interface InvitationsPanelProps ### `InviteAcceptPageLazy` -`function` +`function` — Load InviteAcceptPage component lazily for optimized code splitting and performance ```ts LazyExoticComponent<({ details, onAccept, onNavigate, onResendVerification }: InviteAcceptPageProps) => Element> @@ -32,7 +32,7 @@ LazyExoticComponent<({ details, onAccept, onNavigate, onResendVerification }: In ### `InviteAcceptPageProps` -`interface` +`interface` — Define properties and callbacks for handling invite acceptance and navigation actions on the invite page ```ts interface InviteAcceptPageProps @@ -40,7 +40,7 @@ interface InviteAcceptPageProps ### `MembersPanelLazy` -`function` +`function` — Load MembersPanel component lazily to optimize initial rendering performance ```ts LazyExoticComponent<({ members, currentRole, onInvite, onChangeRole, onRemove, onNotice, showInviteForm, }: MembersPane… @@ -48,7 +48,7 @@ LazyExoticComponent<({ members, currentRole, onInvite, onChangeRole, onRemove, o ### `MembersPanelProps` -`interface` +`interface` — Define properties and callbacks for managing members and their roles in a workspace panel ```ts interface MembersPanelProps diff --git a/docs/api/teams-react.md b/docs/api/teams-react.md index 7f3bc29..30a9309 100644 --- a/docs/api/teams-react.md +++ b/docs/api/teams-react.md @@ -16,7 +16,7 @@ Source: `src/teams-react/index.ts` ### `InvitationsPanelProps` -`interface` +`interface` — Define properties and callbacks for managing workspace invitations and user roles ```ts interface InvitationsPanelProps @@ -32,7 +32,7 @@ interface InvitationView ### `InviteAcceptDetails` -`interface` +`interface` — Describe details of an accepted invite including status, workspace, inviter, role, emails, and expiration ```ts interface InviteAcceptDetails @@ -48,7 +48,7 @@ interface InviteAcceptDetails ### `InviteAcceptPageProps` -`interface` +`interface` — Define properties and callbacks for handling invite acceptance and navigation actions on the invite page ```ts interface InviteAcceptPageProps @@ -56,7 +56,7 @@ interface InviteAcceptPageProps ### `InviteAcceptStatus` -`type` +`type` — Define possible statuses for the acceptance state of an invitation ```ts type InviteAcceptStatus @@ -72,7 +72,7 @@ type InviteAcceptStatus ### `MembersPanelProps` -`interface` +`interface` — Define properties and callbacks for managing members and their roles in a workspace panel ```ts interface MembersPanelProps diff --git a/docs/api/teams-resend.md b/docs/api/teams-resend.md index a0353b8..454588d 100644 --- a/docs/api/teams-resend.md +++ b/docs/api/teams-resend.md @@ -16,7 +16,7 @@ Source: `src/teams/resend.ts` ### `ResendInvitationSenderOptions` -`interface` +`interface` — Define options for sending a resend invitation including sender address and optional API key ```ts interface ResendInvitationSenderOptions diff --git a/docs/api/teams.md b/docs/api/teams.md index d5913f3..2617250 100644 --- a/docs/api/teams.md +++ b/docs/api/teams.md @@ -8,7 +8,7 @@ Source: `src/teams/index.ts` ### `ASSIGNABLE_WORKSPACE_ROLES` -`const` +`const` — Define the list of roles that can be assigned within a workspace ```ts readonly ["viewer", "editor", "admin"] @@ -16,7 +16,7 @@ readonly ["viewer", "editor", "admin"] ### `AssignableWorkspaceRole` -`type` +`type` — Resolve the set of roles that can be assigned within a workspace ```ts type AssignableWorkspaceRole @@ -48,7 +48,7 @@ type AssignableWorkspaceRole ### `getInvitationExpiresAt` -`function` +`function` — Calculate the expiration date of an invitation based on the given or current date ```ts (now?: Date) => Date @@ -72,7 +72,7 @@ type AssignableWorkspaceRole ### `INVITATION_EXPIRY_DAYS` -`const` +`const` — Define the number of days before an invitation expires ```ts 7 @@ -80,7 +80,7 @@ type AssignableWorkspaceRole ### `InvitationEmailBrand` -`interface` +`interface` — Define the structure for an invitation email brand including the RFC-5322 From header ```ts interface InvitationEmailBrand @@ -88,7 +88,7 @@ interface InvitationEmailBrand ### `InvitationEmailStatus` -`type` +`type` — Define possible statuses for the sending state of an invitation email ```ts type InvitationEmailStatus @@ -104,7 +104,7 @@ type InvitationPermission ### `InvitationStatus` -`type` +`type` — Define possible states for an invitation's lifecycle including pending, accepted, expired, and revoked ```ts type InvitationStatus @@ -112,7 +112,7 @@ type InvitationStatus ### `InviteRejectionReason` -`type` +`type` — Define possible reasons for rejecting an invite including acceptance, expiration, or email mismatch ```ts type InviteRejectionReason @@ -128,7 +128,7 @@ interface InviteTokenState ### `inviteUrlForToken` -`function` +`function` — Generate an invite URL by combining the origin with an encoded token ```ts (origin: string, token: string) => string @@ -136,7 +136,7 @@ interface InviteTokenState ### `InviteValidationResult` -`interface` +`interface` — Represent the outcome of validating an invite with success status and optional rejection reason ```ts interface InviteValidationResult @@ -144,7 +144,7 @@ interface InviteValidationResult ### `isAssignableWorkspaceRole` -`function` +`function` — Determine if a value is a valid assignable workspace role among viewer, editor, or admin ```ts (value: unknown) => value is "viewer" | "editor" | "admin" @@ -160,7 +160,7 @@ interface InviteValidationResult ### `normalizeInvitationEmail` -`function` +`function` — Normalize an invitation email by trimming whitespace and converting to lowercase ```ts (email: string) => string @@ -168,7 +168,7 @@ interface InviteValidationResult ### `ORGANIZATION_ROLE_RANK` -`const` +`const` — Map organization roles to their hierarchical rank for permission and access control purposes ```ts Record<"admin" | "owner" | "member" | "billing", number> @@ -176,7 +176,7 @@ Record<"admin" | "owner" | "member" | "billing", number> ### `ORGANIZATION_ROLES` -`const` +`const` — Define the set of fixed roles available within an organization ```ts readonly ["owner", "admin", "member", "billing"] @@ -184,7 +184,7 @@ readonly ["owner", "admin", "member", "billing"] ### `OrganizationRole` -`type` +`type` — Resolve a role string from the predefined list of organization roles ```ts type OrganizationRole @@ -200,7 +200,7 @@ type OrganizationRole ### `parseInvitationPermission` -`function` +`function` — Resolve invitation permission from a string or return null if invalid ```ts (value: string | undefined) => "viewer" | "editor" | "admin" | null @@ -208,7 +208,7 @@ type OrganizationRole ### `RenderedInvitationEmail` -`interface` +`interface` — Define the structure of a fully rendered invitation email with sender, subject, and content fields ```ts interface RenderedInvitationEmail @@ -224,7 +224,7 @@ interface RenderedInvitationEmail ### `RenderInvitationEmailInput` -`interface` +`interface` — Define input data required to render an invitation email template ```ts interface RenderInvitationEmailInput @@ -240,7 +240,7 @@ interface RenderInvitationEmailInput ### `SandboxWorkspaceRole` -`type` +`type` — Define user roles available within a sandbox workspace environment ```ts type SandboxWorkspaceRole @@ -256,7 +256,7 @@ type SandboxWorkspaceRole ### `WORKSPACE_ROLE_RANK` -`const` +`const` — Map workspace roles to their corresponding hierarchical rank values ```ts Record<"viewer" | "editor" | "admin" | "owner", number> @@ -272,7 +272,7 @@ readonly ["viewer", "editor", "admin", "owner"] ### `WorkspaceCollaborationAccess` -`type` +`type` — Define access levels for workspace collaboration as either read or write ```ts type WorkspaceCollaborationAccess @@ -280,7 +280,7 @@ type WorkspaceCollaborationAccess ### `WorkspaceRole` -`type` +`type` — Resolve the union type of all possible workspace role string literals from WORKSPACE_ROLES array ```ts type WorkspaceRole @@ -288,7 +288,7 @@ type WorkspaceRole ### `workspaceRoleToCollaborationAccess` -`function` +`function` — Map a workspace role to the corresponding collaboration access level ```ts (role: "viewer" | "editor" | "admin" | "owner") => WorkspaceCollaborationAccess @@ -296,7 +296,7 @@ type WorkspaceRole ### `workspaceRoleToSandboxRole` -`function` +`function` — Map a workspace role to its corresponding sandbox workspace role ```ts (role: "viewer" | "editor" | "admin" | "owner") => SandboxWorkspaceRole diff --git a/docs/api/theme-contract.md b/docs/api/theme-contract.md index 4d62eeb..d40014a 100644 --- a/docs/api/theme-contract.md +++ b/docs/api/theme-contract.md @@ -16,7 +16,7 @@ Source: `src/theme-contract/index.ts` ### `ThemeContractMiss` -`interface` +`interface` — Describe a missing theme contract variable and where it was referenced ```ts interface ThemeContractMiss @@ -24,7 +24,7 @@ interface ThemeContractMiss ### `ThemeContractOptions` -`interface` +`interface` — Define options for scanning source directories and CSS token files in a theme contract ```ts interface ThemeContractOptions @@ -32,7 +32,7 @@ interface ThemeContractOptions ### `ThemeContractResult` -`interface` +`interface` — Describe the result of validating a theme contract including success status and missing items ```ts interface ThemeContractResult diff --git a/docs/api/theme-tailwind-preset.md b/docs/api/theme-tailwind-preset.md index 3f610b4..08eeb1f 100644 --- a/docs/api/theme-tailwind-preset.md +++ b/docs/api/theme-tailwind-preset.md @@ -8,7 +8,7 @@ Source: `src/theme/tailwind-preset.ts` ### `default` -`const` +`const` — Define a preset configuration for dark mode and extended theme colors with foreground variants ```ts { darkMode: [string, string]; theme: { extend: { colors: { background: string; foreground: string; border: string; inpu… diff --git a/docs/api/theme.md b/docs/api/theme.md index b3e39ec..ebc037d 100644 --- a/docs/api/theme.md +++ b/docs/api/theme.md @@ -24,7 +24,7 @@ interface CanvasRenderPalette ### `darkTheme` -`const` +`const` — Define a dark color scheme for the Agent app interface with specific background and foreground hues ```ts AgentAppTheme @@ -32,7 +32,7 @@ AgentAppTheme ### `lightTheme` -`const` +`const` — Define a light color theme with specific background, foreground, and accent color values ```ts AgentAppTheme diff --git a/docs/api/tools.md b/docs/api/tools.md index 09fc365..dcdc7d9 100644 --- a/docs/api/tools.md +++ b/docs/api/tools.md @@ -8,7 +8,7 @@ Source: `src/tools/index.ts` ### `AddCitationArgs` -`interface` +`interface` — Define arguments required to add a citation including path, quote, and optional label ```ts interface AddCitationArgs @@ -16,7 +16,7 @@ interface AddCitationArgs ### `AddCitationResult` -`interface` +`interface` — Represent the result of adding a citation including its identifier and location path ```ts interface AddCitationResult @@ -64,7 +64,7 @@ interface AppToolMcpServer ### `AppToolName` -`type` +`type` — Resolve a valid application tool name from the predefined list of tool names ```ts type AppToolName @@ -104,7 +104,7 @@ interface AppToolTaxonomy ### `AuthenticateOptions` -`interface` +`interface` — Define options to verify bearer tokens and customize authentication header names ```ts interface AuthenticateOptions @@ -152,7 +152,7 @@ interface BuildAppToolsOptions ### `BuildHttpMcpServerOptions` -`interface` +`interface` — Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description ```ts interface BuildHttpMcpServerOptions @@ -160,7 +160,7 @@ interface BuildHttpMcpServerOptions ### `BuildMcpServerOptions` -`interface` +`interface` — Define configuration options required to build an MCP server including tool, baseUrl, token, and context ```ts interface BuildMcpServerOptions @@ -176,7 +176,7 @@ interface BuildMcpServerOptions ### `CapabilityTokenOptions` -`interface` +`interface` — Define options for creating and verifying capability tokens including secret and prefix ```ts interface CapabilityTokenOptions @@ -216,7 +216,7 @@ interface CapabilityTokenOptions ### `CreateMcpToolHandlerOptions` -`interface` +`interface` — Define options for creating a handler that manages MCP tools with environment support ```ts interface CreateMcpToolHandlerOptions @@ -240,7 +240,7 @@ Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", s ### `DEFAULT_HEADER_NAMES` -`const` +`const` — Provide default HTTP header names for user, workspace, and thread identification ```ts ToolHeaderNames @@ -264,7 +264,7 @@ ToolHeaderNames ### `DispatchOptions` -`interface` +`interface` — Define options for dispatching tools including handlers, taxonomy, custom tools, and approval policies ```ts interface DispatchOptions @@ -272,7 +272,7 @@ interface DispatchOptions ### `ExpiringCapabilityTokenOptions` -`interface` +`interface` — Define options for capability tokens that expire after a specified lifetime in milliseconds ```ts interface ExpiringCapabilityTokenOptions @@ -296,7 +296,7 @@ interface ExpiringCapabilityTokenOptions ### `HandleToolRequestOptions` -`interface` +`interface` — Define options for handling tool requests including tool identification and token verification ```ts interface HandleToolRequestOptions @@ -304,7 +304,7 @@ interface HandleToolRequestOptions ### `isAppToolName` -`function` +`function` — Determine if a string matches a valid application tool name ```ts (name: string) => name is "submit_proposal" | "schedule_followup" | "render_ui" | "add_citation" @@ -320,7 +320,7 @@ readonly ["2025-06-18", "2025-03-26", "2024-11-05"] ### `McpProtocolVersion` -`type` +`type` — Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array ```ts type McpProtocolVersion @@ -328,7 +328,7 @@ type McpProtocolVersion ### `McpServerInfo` -`interface` +`interface` — Describe the structure of server information including name and version ```ts interface McpServerInfo @@ -368,7 +368,7 @@ interface OpenAIFunctionTool ### `RenderUiArgs` -`interface` +`interface` — Define arguments required to render a UI including title and schema ```ts interface RenderUiArgs @@ -376,7 +376,7 @@ interface RenderUiArgs ### `RenderUiResult` -`interface` +`interface` — Describe the result of rendering UI including the artifact path and exact persisted content ```ts interface RenderUiResult @@ -384,7 +384,7 @@ interface RenderUiResult ### `ResolvedToolCapabilities` -`interface` +`interface` — Describe resolved capabilities including proposal types and product tool groups to expose ```ts interface ResolvedToolCapabilities @@ -400,7 +400,7 @@ interface ResolvedToolCapabilities ### `ResolveToolCapabilitiesOptions` -`interface` +`interface` — Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs ```ts interface ResolveToolCapabilitiesOptions @@ -416,7 +416,7 @@ interface ResolveToolCapabilitiesOptions ### `RuntimeExecutorOptions` -`interface` +`interface` — Define options for executing runtime tasks with a trusted per-turn context ```ts interface RuntimeExecutorOptions @@ -424,7 +424,7 @@ interface RuntimeExecutorOptions ### `ScheduleFollowupArgs` -`interface` +`interface` — Define arguments required to schedule a follow-up with optional priority ```ts interface ScheduleFollowupArgs @@ -432,7 +432,7 @@ interface ScheduleFollowupArgs ### `ScheduleFollowupResult` -`interface` +`interface` — Define the result structure for scheduling a follow-up with unique identification and due date ```ts interface ScheduleFollowupResult @@ -448,7 +448,7 @@ interface ScopedMcpServerEntryOptions ### `SubmitProposalArgs` -`interface` +`interface` — Define the arguments required to submit a proposal including type, title, description, and approval status ```ts interface SubmitProposalArgs @@ -456,7 +456,7 @@ interface SubmitProposalArgs ### `SubmitProposalResult` -`interface` +`interface` — Describe the result of submitting a proposal including deduplication and execution status ```ts interface SubmitProposalResult @@ -464,7 +464,7 @@ interface SubmitProposalResult ### `ToolAuthResult` -`type` +`type` — Represent the result of tool authentication with success context or failure response ```ts type ToolAuthResult diff --git a/docs/api/trace.md b/docs/api/trace.md index 2b0b9bd..3517026 100644 --- a/docs/api/trace.md +++ b/docs/api/trace.md @@ -48,7 +48,7 @@ Source: `src/trace/index.ts` ### `DistributionSummary` -`interface` +`interface` — Summarize key statistics of a numerical distribution including count, min, percentiles, and max ```ts interface DistributionSummary @@ -64,7 +64,7 @@ interface FlowSpan ### `FlowTrace` -`interface` +`interface` — Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls ```ts interface FlowTrace @@ -88,7 +88,7 @@ interface LoopTraceEventLike ### `MissionFlowStep` -`interface` +`interface` — Define a step in a mission flow with id, intent, optional status, start time, and duration ```ts interface MissionFlowStep @@ -128,7 +128,7 @@ interface MissionTraceContext ### `StepSpanContext` -`interface` +`interface` — Define context information for a step span including trace, span, and parent span identifiers ```ts interface StepSpanContext @@ -136,7 +136,7 @@ interface StepSpanContext ### `summarize` -`function` +`function` — Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max ```ts (values: number[]) => DistributionSummary @@ -144,7 +144,7 @@ interface StepSpanContext ### `TimedEvent` -`interface` +`interface` — Represent a timed event with a timestamp and associated event data ```ts interface TimedEvent diff --git a/docs/api/turn-stream.md b/docs/api/turn-stream.md index 452e398..9d5ec7b 100644 --- a/docs/api/turn-stream.md +++ b/docs/api/turn-stream.md @@ -8,7 +8,7 @@ Source: `src/turn-stream/index.ts` ### `acquireDurableTurnLock` -`function` +`function` — Acquire a durable turn lock in the specified namespace with given input parameters ```ts (namespace: TurnStreamNamespaceLike, input: AcquireDurableTurnLockInput) => Promise @@ -16,7 +16,7 @@ Source: `src/turn-stream/index.ts` ### `AcquireDurableTurnLockInput` -`interface` +`interface` — Define input parameters required to acquire a durable turn lock in a workspace thread context ```ts interface AcquireDurableTurnLockInput @@ -88,7 +88,7 @@ number ### `CreateDurableTurnLockOptions` -`interface` +`interface` — Define options for creating a durable turn lock with customizable scope and identification methods ```ts interface CreateDurableTurnLockOptions @@ -104,7 +104,7 @@ interface CreateDurableTurnLockOptions ### `createSegmentStore` -`function` +`function` — Create a SegmentStore with initialized segments and no active execution ID ```ts () => SegmentStore @@ -112,7 +112,7 @@ interface CreateDurableTurnLockOptions ### `createTurnLock` -`function` +`function` — Create a durable turn lock object with timing and scope based on input parameters ```ts (input: TurnLockAcquireInput, now: number, ttlMs?: number) => DurableTurnLock @@ -128,7 +128,7 @@ interface CreateDurableTurnLockOptions ### `CreateTurnStreamUpgradeHandlerOptions` -`interface` +`interface` — Define options for creating a TURN stream upgrade handler including namespace, path, and authorization logic ```ts interface CreateTurnStreamUpgradeHandlerOptions @@ -176,7 +176,7 @@ interface DurableTurnLock ### `MemoryTurnStreamChannel` -`interface` +`interface` — Define an in-memory channel for streaming turn-based data with viewer socket connection support ```ts interface MemoryTurnStreamChannel @@ -184,7 +184,7 @@ interface MemoryTurnStreamChannel ### `MemoryTurnStreamHarness` -`interface` +`interface` — Provide an interface to manage channels and namespaces for memory-based turn stream testing ```ts interface MemoryTurnStreamHarness @@ -216,7 +216,7 @@ interface MemoryTurnStreamSocket ### `ReconcileStaleDurableTurnLockOptions` -`interface` +`interface` — Define options to reconcile stale durable turn locks with context, namespace, workspace, and active lock details ```ts interface ReconcileStaleDurableTurnLockOptions @@ -224,7 +224,7 @@ interface ReconcileStaleDurableTurnLockOptions ### `releaseDurableTurnLock` -`function` +`function` — Release a durable turn lock and indicate if the release was successful or deferred ```ts (namespace: TurnStreamNamespaceLike, input: TurnLockReleaseInput) => Promise<{ released: boolean; deferred?: boolean |… @@ -240,7 +240,7 @@ interface ReconcileStaleDurableTurnLockOptions ### `ReleaseInterruptedDurableTurnLockInput` -`interface` +`interface` — Define input parameters to release an interrupted durable turn lock in a workspace or thread ```ts interface ReleaseInterruptedDurableTurnLockInput @@ -256,7 +256,7 @@ interface ReleaseInterruptedDurableTurnLockInput ### `scopeIndexChannelKey` -`function` +`function` — Generate a unique channel key string based on the provided scope identifier ```ts (scopeId: string) => string @@ -264,7 +264,7 @@ interface ReleaseInterruptedDurableTurnLockInput ### `SegmentStore` -`interface` +`interface` — Define a store managing segments and tracking the active execution identifier ```ts interface SegmentStore @@ -272,7 +272,7 @@ interface SegmentStore ### `threadChannelKey` -`function` +`function` — Generate a unique string key combining workspace and thread identifiers ```ts (workspaceId: string, threadId: string) => string @@ -288,7 +288,7 @@ number ### `TURN_STREAM_PATHS` -`const` +`const` — Provide constant paths for managing chat turn streams and locks ```ts { readonly broadcast: "/broadcast"; readonly lockAcquire: "/chat-turn-lock/acquire"; readonly lockRelease: "/chat-turn-… @@ -312,7 +312,7 @@ number ### `TurnLockAcquireInput` -`interface` +`interface` — Define input parameters required to acquire a turn-based lock in a workspace thread ```ts interface TurnLockAcquireInput @@ -320,7 +320,7 @@ interface TurnLockAcquireInput ### `TurnLockAcquireResult` -`type` +`type` — Resolve the result of attempting to acquire a turn lock indicating success or active lock status ```ts type TurnLockAcquireResult @@ -352,7 +352,7 @@ interface TurnLockInterruptedReleaseInput ### `TurnLockReleaseInput` -`interface` +`interface` — Define input parameters required to release a turn lock in a specific workspace thread ```ts interface TurnLockReleaseInput @@ -360,7 +360,7 @@ interface TurnLockReleaseInput ### `TurnLockScope` -`type` +`type` — Define the scope level for acquiring a turn lock within thread or workspace contexts ```ts type TurnLockScope @@ -384,7 +384,7 @@ type TurnLockSeamResult ### `TurnSegment` -`interface` +`interface` — Represent a segment of a turn containing events, sequence limit, and terminal status ```ts interface TurnSegment @@ -392,7 +392,7 @@ interface TurnSegment ### `turnStorageChannelKey` -`function` +`function` — Generate a storage channel key string for a given turn identifier ```ts (turnId: string) => string @@ -400,7 +400,7 @@ interface TurnSegment ### `TurnStreamDO` -`class` +`class` — Manage per-turn segments and track active threads with durable event storage ```ts class TurnStreamDO @@ -408,7 +408,7 @@ class TurnStreamDO ### `TurnStreamDOOptions` -`interface` +`interface` — Define options to override default TTL and event limits for TURN stream DO operations ```ts interface TurnStreamDOOptions @@ -456,7 +456,7 @@ interface TurnStreamStorage ### `TurnStreamStubLike` -`interface` +`interface` — Resolve a stub interface for handling fetch requests with optional initialization parameters ```ts interface TurnStreamStubLike @@ -464,7 +464,7 @@ interface TurnStreamStubLike ### `TurnStreamUpgradeAuthorization` -`type` +`type` — Represent success or failure of a TURN stream upgrade authorization with optional response data ```ts type TurnStreamUpgradeAuthorization @@ -472,7 +472,7 @@ type TurnStreamUpgradeAuthorization ### `workspaceChannelKey` -`function` +`function` — Generate a unique channel key based on the given workspace identifier ```ts (workspaceId: string) => string diff --git a/docs/api/vault-lazy.md b/docs/api/vault-lazy.md index ec336e9..e1799af 100644 --- a/docs/api/vault-lazy.md +++ b/docs/api/vault-lazy.md @@ -8,7 +8,7 @@ Source: `src/vault/lazy.tsx` ### `VaultPaneLazy` -`function` +`function` — Resolve VaultPane component lazily to optimize loading and improve performance ```ts LazyExoticComponent<(props: VaultPaneProps) => Element> @@ -16,7 +16,7 @@ LazyExoticComponent<(props: VaultPaneProps) => Element> ### `VaultPaneProps` -`interface` +`interface` — Define the properties and render methods for the vault pane UI components ```ts interface VaultPaneProps diff --git a/docs/api/vault.md b/docs/api/vault.md index 9d72d0a..402e25c 100644 --- a/docs/api/vault.md +++ b/docs/api/vault.md @@ -112,7 +112,7 @@ type VaultOperationPhase ### `VaultPaneProps` -`interface` +`interface` — Define the properties and render methods for the vault pane UI components ```ts interface VaultPaneProps diff --git a/docs/api/web-react-terminal.md b/docs/api/web-react-terminal.md index 71f478c..ae73d5e 100644 --- a/docs/api/web-react-terminal.md +++ b/docs/api/web-react-terminal.md @@ -8,7 +8,7 @@ Source: `src/web-react/terminal.ts` ### `SandboxTerminalConnection` -`interface` +`interface` — Define the connection details and status for a sandbox terminal session ```ts interface SandboxTerminalConnection @@ -16,7 +16,7 @@ interface SandboxTerminalConnection ### `SandboxTerminalConnectionResponse` -`interface` +`interface` — Define the response structure for a sandbox terminal connection including URLs, token, status, and errors ```ts interface SandboxTerminalConnectionResponse @@ -48,7 +48,7 @@ type TerminalStatusTone ### `useSandboxTerminalConnection` -`function` +`function` — Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling ```ts (opts: UseSandboxTerminalConnectionOptions) => UseSandboxTerminalConnectionResult @@ -56,7 +56,7 @@ type TerminalStatusTone ### `UseSandboxTerminalConnectionOptions` -`interface` +`interface` — Define options for configuring a sandbox terminal connection including workspace ID and connection parameters ```ts interface UseSandboxTerminalConnectionOptions @@ -64,7 +64,7 @@ interface UseSandboxTerminalConnectionOptions ### `UseSandboxTerminalConnectionResult` -`interface` +`interface` — Resolve sandbox terminal connection status and provide a method to initiate the connection ```ts interface UseSandboxTerminalConnectionResult diff --git a/docs/api/web-react.md b/docs/api/web-react.md index 508769c..1c2c550 100644 --- a/docs/api/web-react.md +++ b/docs/api/web-react.md @@ -168,7 +168,7 @@ type AttachmentFileResult ### `CatalogModel` -`interface` +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags ```ts interface CatalogModel @@ -232,7 +232,7 @@ interface ChatEmptyDoor ### `ChatEmptyStateProps` -`interface` +`interface` — Define properties for rendering the chat empty state with customizable text and starting doors ```ts interface ChatEmptyStateProps @@ -248,7 +248,7 @@ interface ChatInteraction ### `ChatInteractionField` -`type` +`type` — Resolve a chat interaction field excluding select types or including chat select fields ```ts type ChatInteractionField @@ -256,7 +256,7 @@ type ChatInteractionField ### `ChatInteractionRestoreMode` -`type` +`type` — Define modes for restoring chat interactions with legacy or durable strategies ```ts type ChatInteractionRestoreMode @@ -264,7 +264,7 @@ type ChatInteractionRestoreMode ### `ChatInteractionStatus` -`type` +`type` — Define possible statuses representing the state of a chat interaction ```ts type ChatInteractionStatus @@ -288,7 +288,7 @@ interface ChatMentionPart ### `ChatMessageMetrics` -`interface` +`interface` — Describe metrics related to a chat message including model, token counts, and duration ```ts interface ChatMessageMetrics @@ -312,7 +312,7 @@ type ChatMessageSegment ### `ChatMessagesProps` -`interface` +`interface` — Define properties for rendering chat messages with optional models, markdown, extras, and durable cards ```ts interface ChatMessagesProps @@ -320,7 +320,7 @@ interface ChatMessagesProps ### `ChatSelectField` -`type` +`type` — Extract select-type interaction fields and optionally allow custom values ```ts type ChatSelectField @@ -328,7 +328,7 @@ type ChatSelectField ### `ChatStreamCallbacks` -`interface` +`interface` — Define callbacks to handle events and data during a chat streaming session ```ts interface ChatStreamCallbacks @@ -336,7 +336,7 @@ interface ChatStreamCallbacks ### `ChatStreamToolCall` -`interface` +`interface` — Define the structure for a chat tool call including optional ID, name, and arguments object ```ts interface ChatStreamToolCall @@ -344,7 +344,7 @@ interface ChatStreamToolCall ### `ChatStreamToolResult` -`interface` +`interface` — Describe the result of a chat stream tool including its outcome and optional metadata fields ```ts interface ChatStreamToolResult @@ -352,7 +352,7 @@ interface ChatStreamToolResult ### `ChatToolCallInfo` -`interface` +`interface` — Describe the structure and state of a tool call within a chat interaction ```ts interface ChatToolCallInfo @@ -368,7 +368,7 @@ interface ChatTurnFilePartInput ### `ChatTurnPartInput` -`type` +`type` — Resolve input as either a text part or a file part of a chat turn ```ts type ChatTurnPartInput @@ -392,7 +392,7 @@ interface ChatTurnRequestPayload ### `ChatUiMessage` -`interface` +`interface` — Describe the structure and properties of a chat message with roles, content, and optional metadata ```ts interface ChatUiMessage @@ -416,7 +416,7 @@ interface ChatUiMessage ### `ComposerAnswerDelivery` -`interface` +`interface` — Define the structure for delivering answers linked to a specific chat interaction and field ```ts interface ComposerAnswerDelivery @@ -456,7 +456,7 @@ interface ComposerMentionProp ### `ConsumeChatStreamResult` -`interface` +`interface` — Represent the result of consuming a chat stream including turn ID and content reception status ```ts interface ConsumeChatStreamResult @@ -488,7 +488,7 @@ interface ConsumeChatStreamResult ### `createMemoryInteractionAttemptStore` -`function` +`function` — Create an in-memory store to manage interaction attempts keyed by ID and signature ```ts () => InteractionAttemptStore @@ -496,7 +496,7 @@ interface ConsumeChatStreamResult ### `createSessionInteractionAttemptStore` -`function` +`function` — Create a session-based store to manage interaction attempts using provided storage and optional namespace ```ts (storage: Pick, namespace?: string) => InteractionAttemptStore @@ -504,7 +504,7 @@ interface ConsumeChatStreamResult ### `dedupeQuestionInteractionsByContent` -`function` +`function` — Remove duplicate question interactions based on their content signature to ensure uniqueness ```ts (interactions: ChatInteraction[]) => ChatInteraction[] @@ -608,7 +608,7 @@ interface DurableChatCardsProps ### `DurableInteractionAnswerSubmitterOptions` -`interface` +`interface` — Define options for submitting durable interaction answers with attempt tracking and optional key creation ```ts interface DurableInteractionAnswerSubmitterOptions @@ -632,7 +632,7 @@ interface DurablePlanCardProps ### `DurablePlanClientError` -`class` +`class` — Represent errors from DurablePlanClient operations including status, code, and current plan details ```ts class DurablePlanClientError @@ -640,7 +640,7 @@ class DurablePlanClientError ### `DurablePlanCurrentInput` -`interface` +`interface` — Define input parameters for retrieving the current durable plan including optional revision number ```ts interface DurablePlanCurrentInput @@ -648,7 +648,7 @@ interface DurablePlanCurrentInput ### `DurablePlanDecision` -`type` +`type` — Represent durable plan decisions as either approved or rejected ```ts type DurablePlanDecision @@ -656,7 +656,7 @@ type DurablePlanDecision ### `DurablePlanDecisionClient` -`interface` +`interface` — Define methods to obtain and decide durable plan decisions asynchronously ```ts interface DurablePlanDecisionClient @@ -664,7 +664,7 @@ interface DurablePlanDecisionClient ### `DurablePlanDecisionClientOptions` -`interface` +`interface` — Define configuration options for creating a durable plan decision client ```ts interface DurablePlanDecisionClientOptions @@ -672,7 +672,7 @@ interface DurablePlanDecisionClientOptions ### `DurablePlanDecisionInput` -`interface` +`interface` — Define input parameters for making a durable plan decision including optional feedback ```ts interface DurablePlanDecisionInput @@ -680,7 +680,7 @@ interface DurablePlanDecisionInput ### `DurablePlanDecisionResult` -`interface` +`interface` — Describe the result of a durable plan decision including plan details and pending statuses ```ts interface DurablePlanDecisionResult @@ -720,7 +720,7 @@ interface EffortPickerProps ### `fieldAcceptsFreeText` -`function` +`function` — Determine if a chat interaction field allows free text input ```ts (field: ChatInteractionField) => boolean @@ -736,7 +736,7 @@ interface EffortPickerProps ### `FieldValues` -`type` +`type` — Define a record mapping field names to objects with optional selected, text, and custom string arrays or values ```ts type FieldValues @@ -752,7 +752,7 @@ type FieldValues ### `FileIndexReadyResponse` -`interface` +`interface` — Describe a ready file index response with workspace-relative entries and truncation status ```ts interface FileIndexReadyResponse @@ -760,7 +760,7 @@ interface FileIndexReadyResponse ### `FileIndexResponse` -`type` +`type` — Resolve a response indicating the file index is either ready or warming up ```ts type FileIndexResponse @@ -888,7 +888,7 @@ number ### `INTERACTION_SUBMIT_TIMEOUT_MESSAGE` -`const` +`const` — Provide the timeout message displayed when the agent cannot be reached during interaction submission ```ts "Could not reach the agent. Try again." @@ -896,7 +896,7 @@ number ### `INTERACTION_SUBMIT_TIMEOUT_MS` -`const` +`const` — Define the timeout duration in milliseconds for submitting an interaction ```ts 30000 @@ -912,7 +912,7 @@ number ### `InteractionAnswers` -`type` +`type` — Map interaction identifiers to their corresponding answer values ```ts type InteractionAnswers @@ -928,7 +928,7 @@ interface InteractionAnswerSubmission ### `InteractionAnswerSubmitterOptions` -`interface` +`interface` — Define options for submitting interaction answers including URL, body, timeout, and fetch implementation ```ts interface InteractionAnswerSubmitterOptions @@ -944,7 +944,7 @@ type InteractionAnswerValue ### `InteractionAttemptStore` -`interface` +`interface` — Manage storage and retrieval of interaction attempt keys by interaction and submission identifiers ```ts interface InteractionAttemptStore @@ -968,7 +968,7 @@ type InteractionBadgeVariant ### `InteractionCancelData` -`interface` +`interface` — Describe data required to cancel an interaction including its identifier and optional reason ```ts interface InteractionCancelData @@ -1000,7 +1000,7 @@ type InteractionOutcome ### `interactionPartKey` -`function` +`function` — Generate a unique key string for an interaction using the given identifier ```ts (id: string) => string @@ -1072,7 +1072,7 @@ type InteractionRequestWire ### `interactionSubmissionSignature` -`function` +`function` — Generate a stable string signature from an interaction answer submission ```ts (submission: InteractionAnswerSubmission) => string @@ -1080,7 +1080,7 @@ type InteractionRequestWire ### `InteractionSubmitResult` -`type` +`type` — Resolve the result of an interaction submission indicating success or failure with details ```ts type InteractionSubmitResult @@ -1112,7 +1112,7 @@ type InteractionSubmitResult ### `isLateAnswerableStatus` -`function` +`function` — Determine if a status is late answerable by checking if it is expired or cancelled ```ts (status: ChatInteractionStatus) => boolean @@ -1120,7 +1120,7 @@ type InteractionSubmitResult ### `isRenderableInteractionKind` -`function` +`function` — Resolve if the given interaction kind is renderable within the application context ```ts (kind: string) => boolean @@ -1136,7 +1136,7 @@ type InteractionSubmitResult ### `isTerminalInteractionStatus` -`function` +`function` — Resolve if the interaction status is a terminal state excluding pending ```ts (status: ChatInteractionStatus) => boolean @@ -1272,7 +1272,7 @@ interface ModelPickerProps ### `NoticeKind` -`type` +`type` — Define specific string literals representing different kinds of notices ```ts type NoticeKind @@ -1288,7 +1288,7 @@ type NoticeKind ### `noticePartKey` -`function` +`function` — Generate a unique key string for a notice using the given identifier ```ts (id: string) => string @@ -1296,7 +1296,7 @@ type NoticeKind ### `NoticePersistedPart` -`type` +`type` — Define a persisted notice part with type, id, kind, and text properties ```ts type NoticePersistedPart @@ -1312,7 +1312,7 @@ type NoticePersistedPart ### `ParseInteractionAnswersResult` -`type` +`type` — Resolve the result of parsing interaction answers with success status and corresponding data or error message ```ts type ParseInteractionAnswersResult @@ -1320,7 +1320,7 @@ type ParseInteractionAnswersResult ### `parseInteractionCancel` -`function` +`function` — Parse interaction cancel data and return success status with parsed value or error message ```ts (data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;… @@ -1336,7 +1336,7 @@ type ParseInteractionAnswersResult ### `ParseInteractionResult` -`type` +`type` — Resolve interaction parsing outcome as success with value or failure with error message ```ts type ParseInteractionResult @@ -1360,7 +1360,7 @@ type ParseInteractionResult ### `ProducerErrorEvent` -`interface` +`interface` — Represent an error event emitted by a producer containing message, code, and optional details ```ts interface ProducerErrorEvent @@ -1368,7 +1368,7 @@ interface ProducerErrorEvent ### `ProducerNoticeEvent` -`interface` +`interface` — Define the structure for a producer notice event with type, id, kind, and text fields ```ts interface ProducerNoticeEvent @@ -1376,7 +1376,7 @@ interface ProducerNoticeEvent ### `ProducerPassthroughEvent` -`interface` +`interface` — Define an event carrying passthrough data with flexible properties for producer communication ```ts interface ProducerPassthroughEvent @@ -1392,7 +1392,7 @@ type ProducerPassthroughEventType ### `ProducerReasoningEvent` -`interface` +`interface` — Define an event representing reasoning output with a fixed type and associated text ```ts interface ProducerReasoningEvent @@ -1400,7 +1400,7 @@ interface ProducerReasoningEvent ### `ProducerTextEvent` -`interface` +`interface` — Represent a text event produced by a source with a fixed type and associated text content ```ts interface ProducerTextEvent @@ -1408,7 +1408,7 @@ interface ProducerTextEvent ### `ProducerToolCallEvent` -`interface` +`interface` — Represent an event triggered by a producer tool call with its identifier, name, and arguments ```ts interface ProducerToolCallEvent @@ -1416,7 +1416,7 @@ interface ProducerToolCallEvent ### `ProducerToolResultEvent` -`interface` +`interface` — Describe the structure of an event representing the result of a producer tool call ```ts interface ProducerToolResultEvent @@ -1424,7 +1424,7 @@ interface ProducerToolResultEvent ### `ProducerUsageEvent` -`interface` +`interface` — Describe usage event with prompt and completion token counts for a producer ```ts interface ProducerUsageEvent @@ -1432,7 +1432,7 @@ interface ProducerUsageEvent ### `ProducerWireEvent` -`type` +`type` — Represent events emitted by a producer during its operation for processing and handling ```ts type ProducerWireEvent @@ -1440,7 +1440,7 @@ type ProducerWireEvent ### `ProposalApprovalHandlers` -`interface` +`interface` — Handle approval and rejection actions for proposals with asynchronous support ```ts interface ProposalApprovalHandlers @@ -1520,7 +1520,7 @@ interface QuestionOptionListProps ### `RestoreChatInteractionsOptions` -`interface` +`interface` — Define options to control how chat interactions are restored during the restore process ```ts interface RestoreChatInteractionsOptions @@ -1536,7 +1536,7 @@ interface RestoreChatInteractionsOptions ### `RunDrillInProps` -`interface` +`interface` — Define properties required to run a drill and handle its closure event ```ts interface RunDrillInProps @@ -1544,7 +1544,7 @@ interface RunDrillInProps ### `SandboxTerminalConnection` -`interface` +`interface` — Define the connection details and status for a sandbox terminal session ```ts interface SandboxTerminalConnection @@ -1552,7 +1552,7 @@ interface SandboxTerminalConnection ### `SandboxTerminalConnectionResponse` -`interface` +`interface` — Define the response structure for a sandbox terminal connection including URLs, token, status, and errors ```ts interface SandboxTerminalConnectionResponse @@ -1584,7 +1584,7 @@ interface SeatPaywallProps ### `SmoothRevealOptions` -`interface` +`interface` — Define configuration options for controlling smooth text reveal animation rates ```ts interface SmoothRevealOptions @@ -1600,7 +1600,7 @@ interface SmoothRevealOptions ### `StreamChatOptions` -`interface` +`interface` — Define options for managing and resuming streaming chat interactions with callbacks ```ts interface StreamChatOptions @@ -1680,7 +1680,7 @@ interface ToolRunStep ### `useChatInteractions` -`function` +`function` — Manage chat interactions state with upsert, cancel, resolve, and restore capabilities ```ts (options?: RestoreChatInteractionsOptions) => UseChatInteractionsResult @@ -1688,7 +1688,7 @@ interface ToolRunStep ### `UseChatInteractionsOptions` -`type` +`type` — Resolve options for restoring chat interactions from previous sessions ```ts type UseChatInteractionsOptions @@ -1696,7 +1696,7 @@ type UseChatInteractionsOptions ### `UseChatInteractionsResult` -`interface` +`interface` — Resolve and manage chat interactions with methods to update, cancel, mark resolved, and restore state ```ts interface UseChatInteractionsResult @@ -1712,7 +1712,7 @@ interface UseChatInteractionsResult ### `UseComposerAttachmentsOptions` -`interface` +`interface` — Define options for configuring file upload behavior and handling in a composer component ```ts interface UseComposerAttachmentsOptions @@ -1720,7 +1720,7 @@ interface UseComposerAttachmentsOptions ### `UseComposerAttachmentsResult` -`interface` +`interface` — Provide staged file chips, ready attachments, and methods to add, retry, or drop composer files ```ts interface UseComposerAttachmentsResult @@ -1736,7 +1736,7 @@ interface UseComposerAttachmentsResult ### `UseDurablePlanFlowOptions` -`interface` +`interface` — Define options to configure durable plan flow with plan, client, and optional callbacks ```ts interface UseDurablePlanFlowOptions @@ -1744,7 +1744,7 @@ interface UseDurablePlanFlowOptions ### `UseDurablePlanFlowResult` -`interface` +`interface` — Define the result and actions for managing a durable plan flow including decisions, restoration, and error handling ```ts interface UseDurablePlanFlowResult @@ -1752,7 +1752,7 @@ interface UseDurablePlanFlowResult ### `useFileMentions` -`function` +`function` — Resolve and manage file mention data with configurable fetching and state handling ```ts (options: UseFileMentionsOptions) => UseFileMentionsResult @@ -1760,7 +1760,7 @@ interface UseDurablePlanFlowResult ### `UseFileMentionsOptions` -`interface` +`interface` — Define options for configuring file mention fetching, caching, and display behavior ```ts interface UseFileMentionsOptions @@ -1768,7 +1768,7 @@ interface UseFileMentionsOptions ### `UseFileMentionsResult` -`interface` +`interface` — Provide properties and methods to manage and refresh file mentions in a composer interface ```ts interface UseFileMentionsResult @@ -1792,7 +1792,7 @@ interface UseFileMentionsResult ### `useSandboxTerminalConnection` -`function` +`function` — Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling ```ts (opts: UseSandboxTerminalConnectionOptions) => UseSandboxTerminalConnectionResult @@ -1800,7 +1800,7 @@ interface UseFileMentionsResult ### `UseSandboxTerminalConnectionOptions` -`interface` +`interface` — Define options for configuring a sandbox terminal connection including workspace ID and connection parameters ```ts interface UseSandboxTerminalConnectionOptions @@ -1808,7 +1808,7 @@ interface UseSandboxTerminalConnectionOptions ### `UseSandboxTerminalConnectionResult` -`interface` +`interface` — Resolve sandbox terminal connection status and provide a method to initiate the connection ```ts interface UseSandboxTerminalConnectionResult diff --git a/docs/api/web.md b/docs/api/web.md index c1b124e..3f19e83 100644 --- a/docs/api/web.md +++ b/docs/api/web.md @@ -40,7 +40,7 @@ Source: `src/web/index.ts` ### `CookieOptions` -`interface` +`interface` — Define options for configuring cookie attributes and behavior ```ts interface CookieOptions @@ -80,7 +80,7 @@ interface KvLike ### `RateLimitResult` -`interface` +`interface` — Describe the outcome of a rate limit check including allowance, remaining count, and reset time ```ts interface RateLimitResult @@ -96,7 +96,7 @@ interface RateLimitResult ### `RequestContext` -`interface` +`interface` — Define the context of a request including IP address, user agent, timestamp, and request ID ```ts interface RequestContext @@ -112,7 +112,7 @@ interface RequestContext ### `SecurityHeaderOptions` -`interface` +`interface` — Define options for configuring security-related HTTP headers including disclaimers and retention labels ```ts interface SecurityHeaderOptions diff --git a/src/app-auth/index.ts b/src/app-auth/index.ts index 3c212e8..65a1e47 100644 --- a/src/app-auth/index.ts +++ b/src/app-auth/index.ts @@ -45,6 +45,7 @@ export interface AppAuthEmailClient { } } +/** Define email configuration for app authentication including client, sender, verification, and warning options */ export interface AppAuthEmailConfig { /** A Resend-style client, or a lazy getter returning null when the API key * is absent (the products' dev default — mail is skipped with a warning, @@ -66,6 +67,7 @@ export interface AppAuthSocialProviderConfig { clientSecret?: string } +/** Define social authentication configuration options for GitHub and Google providers */ export interface AppAuthSocialConfig { github?: AppAuthSocialProviderConfig google?: AppAuthSocialProviderConfig @@ -99,6 +101,7 @@ export interface AppAuthSsoConfig { log?: (message: string, error?: unknown) => void } +/** Define the structure for application authentication data including users, sessions, accounts, and verifications */ export interface AppAuthSchema { users: unknown sessions: unknown @@ -106,6 +109,7 @@ export interface AppAuthSchema { verifications: unknown } +/** Define configuration settings for app authentication including app name, base URL, secrets, and trusted origins */ export interface AppAuthConfig { /** Product name — used in email subjects and as the cookie-prefix default. */ appName: string @@ -163,6 +167,7 @@ export interface AppAuthSession { user: User } +/** Define authentication guard with session retrieval and optional SSO handlers for app requests */ export interface AppAuth extends AuthGuard { auth: AppAuthInstance /** `auth.api.getSession` over a `Request` — the seam the guards consume. */ diff --git a/src/assets/schema.ts b/src/assets/schema.ts index 9241c18..d63a1d8 100644 --- a/src/assets/schema.ts +++ b/src/assets/schema.ts @@ -3,6 +3,7 @@ import type { AssetSpec, AssetFormat } from './types' // --- Brand --- +/** Validate brand token properties including colors, font, logo URL, business name, and voice */ export const BrandTokensSchema = z.object({ primaryColor: z.string(), accentColor: z.string(), @@ -64,6 +65,7 @@ const EmailSectionSchema = z.discriminatedUnion('type', [ EmailDividerSectionSchema, ]) +/** Validate and parse email content objects with subject, optional preheader, and sections */ export const EmailContentSchema = z.object({ subject: z.string(), preheader: z.string().optional(), @@ -130,6 +132,7 @@ const ImageSlideSchema = z.object({ layers: z.array(ImageLayerSchema), }) +/** Validate image content with an array of one or more slides containing background details */ export const ImageContentSchema = z.object({ slides: z.array(ImageSlideSchema).min(1), }) @@ -178,6 +181,7 @@ const VideoCaptionSchema = z.object({ text: z.string(), }) +/** Define the schema for validating video content including duration, scenes, audio, captions, and rendered URL */ export const VideoContentSchema = z.object({ durationSeconds: z.number().positive(), scenes: z.array(VideoSceneSchema).min(1), @@ -188,6 +192,7 @@ export const VideoContentSchema = z.object({ // --- Copy --- +/** Validate and parse copy content with headline, body, optional hashtags, platform, and character count */ export const CopyContentSchema = z.object({ headline: z.string(), body: z.string(), @@ -198,6 +203,7 @@ export const CopyContentSchema = z.object({ // --- Approval --- +/** Validate approval event data including asset, action, user, timestamp, and optional fields */ export const ApprovalEventSchema = z.object({ assetId: z.string(), variantId: z.string().optional(), @@ -207,6 +213,7 @@ export const ApprovalEventSchema = z.object({ timestamp: z.string(), }) +/** Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields */ export const ConversionMetricsSchema = z.object({ impressions: z.number().nonnegative(), clicks: z.number().nonnegative(), diff --git a/src/assets/types.ts b/src/assets/types.ts index 4ff7cb6..d642e19 100644 --- a/src/assets/types.ts +++ b/src/assets/types.ts @@ -1,3 +1,4 @@ +/** Define brand identity tokens including colors, font, logo, business name, and voice */ export interface BrandTokens { primaryColor: string accentColor: string @@ -8,6 +9,7 @@ export interface BrandTokens { voice: string } +/** Define valid asset format strings for various media and copy types */ export type AssetFormat = | 'email' | 'image:feed' @@ -19,6 +21,7 @@ export type AssetFormat = | 'copy:headline' | 'copy:sms' +/** Define possible states representing the lifecycle status of an asset */ export type AssetStatus = | 'draft' | 'pending_review' @@ -29,6 +32,7 @@ export type AssetStatus = // --- Email --- +/** Define the structure for a hero section in an email with headline, image, and call-to-action fields */ export interface EmailHeroSection { type: 'hero' headline: string @@ -38,11 +42,13 @@ export interface EmailHeroSection { ctaUrl?: string } +/** Define the structure for the body section of an email containing plain text content */ export interface EmailBodySection { type: 'body' text: string } +/** Define a feature section with headline, description, and optional image for email content */ export interface EmailFeatureSection { type: 'feature' headline: string @@ -50,6 +56,7 @@ export interface EmailFeatureSection { imageUrl?: string } +/** Define the structure for an email testimonial section with quote, author, and optional details */ export interface EmailTestimonialSection { type: 'testimonial' quote: string @@ -58,6 +65,7 @@ export interface EmailTestimonialSection { avatarUrl?: string } +/** Define a call-to-action section with label, URL, and optional subtext for email content */ export interface EmailCtaSection { type: 'cta' label: string @@ -65,10 +73,12 @@ export interface EmailCtaSection { subtext?: string } +/** Define a section representing a divider in an email layout */ export interface EmailDividerSection { type: 'divider' } +/** Define a union type representing different sections of an email template */ export type EmailSection = | EmailHeroSection | EmailBodySection @@ -77,6 +87,7 @@ export type EmailSection = | EmailCtaSection | EmailDividerSection +/** Define the structure for email content including subject, optional preheader, and sections */ export interface EmailContent { subject: string preheader?: string @@ -85,8 +96,10 @@ export interface EmailContent { // --- Image --- +/** Define image layer categories for text, image, shape, or logo elements */ export type ImageLayerType = 'text' | 'image' | 'shape' | 'logo' +/** Define properties for a text layer with position, style, and alignment options in an image */ export interface ImageTextLayer { type: 'text' text: string @@ -99,6 +112,7 @@ export interface ImageTextLayer { align?: 'left' | 'center' | 'right' } +/** Define properties for an image layer including position, size, URL, and optional opacity */ export interface ImageImageLayer { type: 'image' url: string @@ -109,6 +123,7 @@ export interface ImageImageLayer { opacity?: number } +/** Define properties for a shape layer representing rectangular or circular image elements */ export interface ImageShapeLayer { type: 'shape' shape: 'rect' | 'circle' | 'rounded-rect' @@ -120,6 +135,7 @@ export interface ImageShapeLayer { opacity?: number } +/** Define properties for positioning and sizing a logo image layer in a layout */ export interface ImageLogoLayer { type: 'logo' x: number @@ -127,24 +143,29 @@ export interface ImageLogoLayer { width?: number } +/** Resolve a union type representing different kinds of image layers */ export type ImageLayer = ImageTextLayer | ImageImageLayer | ImageShapeLayer | ImageLogoLayer +/** Define image background styles as color, gradient, or image with optional overlay settings */ export type ImageBackground = | { type: 'color'; value: string } | { type: 'gradient'; from: string; to: string; direction?: string } | { type: 'image'; url: string; overlay?: string; overlayOpacity?: number } +/** Define the structure for an image slide with a background and multiple layers */ export interface ImageSlide { background: ImageBackground layers: ImageLayer[] } +/** Define the structure for image content containing an array of image slides */ export interface ImageContent { slides: ImageSlide[] } // --- Video --- +/** Define properties for a video scene displaying animated text with optional background and effects */ export interface VideoTextAnimationScene { type: 'text-animation' durationSeconds: number @@ -154,6 +175,7 @@ export interface VideoTextAnimationScene { background?: ImageBackground } +/** Define a scene that reveals an image with optional caption over a specified duration */ export interface VideoImageRevealScene { type: 'image-reveal' durationSeconds: number @@ -161,12 +183,14 @@ export interface VideoImageRevealScene { caption?: string } +/** Define a video slide scene with duration and associated image slide details */ export interface VideoSlideScene { type: 'slide' durationSeconds: number slide: ImageSlide } +/** Define a countdown scene with duration, start time, and optional label for video sequences */ export interface VideoCountdownScene { type: 'countdown' durationSeconds: number @@ -174,18 +198,21 @@ export interface VideoCountdownScene { label?: string } +/** Resolve a video scene as one of several specific animation or reveal types */ export type VideoScene = | VideoTextAnimationScene | VideoImageRevealScene | VideoSlideScene | VideoCountdownScene +/** Define video caption segments with start and end times and associated text content */ export interface VideoCaption { startSeconds: number endSeconds: number text: string } +/** Describe video content including duration, scenes, optional audio, captions, and rendered URL */ export interface VideoContent { durationSeconds: number scenes: VideoScene[] @@ -196,8 +223,10 @@ export interface VideoContent { // --- Copy --- +/** Define platform options for copy content across various social media and communication channels */ export type CopyPlatform = 'instagram' | 'tiktok' | 'x' | 'linkedin' | 'sms' | 'email-subject' +/** Define the structure for content with headline, body, platform, and optional hashtags and character count */ export interface CopyContent { headline: string body: string @@ -208,6 +237,7 @@ export interface CopyContent { // --- Core spec --- +/** Map asset keys to their corresponding content types for various media and copy formats */ export type AssetContentMap = { email: EmailContent 'image:feed': ImageContent @@ -220,6 +250,7 @@ export type AssetContentMap = { 'copy:sms': CopyContent } +/** Define the structure and metadata for an asset including its format, brand, content, and status */ export interface AssetSpec { id: string workspaceId: string @@ -235,6 +266,7 @@ export interface AssetSpec { // --- Variants & approval --- +/** Describe an asset variant with identification, approval status, and edit history details */ export interface AssetVariant { id: string parentId: string @@ -245,6 +277,7 @@ export interface AssetVariant { editLog: ApprovalEvent[] } +/** Describe an approval event with action details, user info, and optional edited fields */ export interface ApprovalEvent { assetId: string variantId?: string @@ -254,6 +287,7 @@ export interface ApprovalEvent { timestamp: string } +/** Define metrics for tracking impressions, clicks, conversions, and related rates */ export interface ConversionMetrics { impressions: number clicks: number diff --git a/src/assistant/client.ts b/src/assistant/client.ts index ed1fbd1..ef4e30b 100644 --- a/src/assistant/client.ts +++ b/src/assistant/client.ts @@ -42,6 +42,7 @@ export interface AssistantClientConfig { headers?: () => Record; } +/** Define options for an assistant model including identifier, label, pricing, and context tokens */ export interface AssistantModelOption { slug: string; label: string; @@ -51,6 +52,7 @@ export interface AssistantModelOption { contextTokens?: number; } +/** Define the structure for assistant model options including a default model slug and available models */ export interface AssistantModels { /** The slug the server uses when a turn selects no model. */ default: string | null; @@ -90,10 +92,12 @@ export type ThreadHistoryResult = | { status: "gone" } | { status: "error" }; +/** Represent the outcome of a confirmation process with success or failure details */ export type ConfirmResult = | { ok: true; output: unknown; retryable?: boolean } | { ok: false; error: string }; +/** Represent invalid client input errors with a specific code INVALID_REQUEST */ export class AssistantClientInputError extends Error { readonly code = "INVALID_REQUEST"; } diff --git a/src/assistant/types.ts b/src/assistant/types.ts index 8183570..159baf9 100644 --- a/src/assistant/types.ts +++ b/src/assistant/types.ts @@ -7,6 +7,7 @@ import type { ReactNode } from "react"; +/** Define delivery modes for assistant interaction as either steering or queue */ export type AssistantDeliveryMode = "steering" | "queue"; /** Request body for `POST /api/v1/assistant/chat`. */ @@ -24,6 +25,7 @@ export interface ChatRequest { // --- Server SSE event payloads (one per `event:` name) ---------------------- +/** Describe the structure of data representing a thread event with optional model information */ export interface ThreadEventData { threadId: string; turnId: string; @@ -31,6 +33,7 @@ export interface ThreadEventData { model?: string | null; } +/** Define data structure representing a delta event with associated text content */ export interface DeltaEventData { text: string; } @@ -52,6 +55,7 @@ export interface ToolCallEventData { args?: Record; } +/** Describe event data emitted after a tool execution completes with success or error details */ export interface ToolResultEventData { callId: string; name: string; @@ -96,6 +100,7 @@ export interface ConnectRequirementResult { connected: boolean; } +/** Describe the data structure for events proposing tool usage with optional integration requirements */ export interface ToolProposalEventData { /** Null only if the server has no proposal store wired (tools then unusable). */ proposalId: string | null; @@ -107,6 +112,7 @@ export interface ToolProposalEventData { requirements?: ConnectionRequirement[]; } +/** Describe usage event data including tokens, cost, balance, duration, and replay status */ export interface UsageEventData { promptTokens: number | null; completionTokens: number | null; @@ -119,6 +125,7 @@ export interface UsageEventData { replayed?: boolean; } +/** Describe the data emitted when a process turn completes including status and optional flags */ export interface DoneEventData { turnId: string; status: string; @@ -128,6 +135,7 @@ export interface DoneEventData { capped?: boolean; } +/** Describe error event data including code and message fields */ export interface ErrorEventData { code: string; message: string; @@ -184,6 +192,7 @@ export interface ConfirmedResult { args?: unknown; } +/** Define the structure and properties of a chat message including optional tool activity details */ export interface ChatMessage { id: string; role: ChatRole; @@ -218,6 +227,7 @@ export interface PendingProposal { retryError?: string | null; } +/** Describe usage cost, balance, token counts, duration, and replay status for a settled turn */ export interface UsageInfo { costUsd: number | null; balanceUsd: number | null; diff --git a/src/assistant/useAssistantChat.ts b/src/assistant/useAssistantChat.ts index 133384d..daf87c6 100644 --- a/src/assistant/useAssistantChat.ts +++ b/src/assistant/useAssistantChat.ts @@ -25,6 +25,7 @@ import type { PendingProposal, } from "./types"; +/** Define options for configuring how the assistant sends messages */ export interface AssistantSendOptions { deliveryMode?: AssistantDeliveryMode; } @@ -79,6 +80,7 @@ function uuid(): string { return crypto.randomUUID(); } +/** Define the structure and behavior of an assistant chat session with state, model selection, and message handling */ export interface AssistantChat { state: AssistantState; /** Proposal ids whose confirmation is currently in flight (for disabling). */ @@ -110,6 +112,7 @@ export interface AssistantChat { restoring: boolean; } +/** Manage assistant chat state and interactions for a given user ID with optional configurations */ export function useAssistantChat( userId: string | null, options?: UseAssistantChatOptions, diff --git a/src/assistant/useAssistantModels.ts b/src/assistant/useAssistantModels.ts index d3fd3f7..53eeb28 100644 --- a/src/assistant/useAssistantModels.ts +++ b/src/assistant/useAssistantModels.ts @@ -44,6 +44,7 @@ function cacheFor(client: AssistantClient): ModelCache { return entry; } +/** Resolve and return the current assistant models from the per-client cache with immediate client swap updates */ export function useAssistantModels(): AssistantModels { const client = useAssistantClient(); // The per-client cache is the source of truth; `bump` just forces a re-read diff --git a/src/assistant/useAssistantThreads.ts b/src/assistant/useAssistantThreads.ts index 88cbf39..13b4cab 100644 --- a/src/assistant/useAssistantThreads.ts +++ b/src/assistant/useAssistantThreads.ts @@ -17,6 +17,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import type { AssistantClient, AssistantThreadSummary } from "./client"; import { useAssistantClient } from "./client-context"; +/** Manage and interact with a list of assistant threads including loading, refreshing, and removing threads */ export interface AssistantThreads { threads: AssistantThreadSummary[]; loading: boolean; @@ -44,6 +45,7 @@ interface ThreadsState { ownerClient: AssistantClient | null; } +/** Resolve and manage assistant threads state for a given user including pending deletions and refresh logic */ export function useAssistantThreads(userId: string | null): AssistantThreads { const client = useAssistantClient(); const userRef = useRef(userId); diff --git a/src/billing/index.ts b/src/billing/index.ts index f982b8e..39a753b 100644 --- a/src/billing/index.ts +++ b/src/billing/index.ts @@ -97,6 +97,7 @@ export interface KeyCrypto { decrypt(encrypted: string): Promise } +/** Define configuration options for managing workspace keys including provisioning, storage, and cryptography */ export interface WorkspaceKeyManagerOptions { provisioner: KeyProvisioner store: WorkspaceKeyStore @@ -109,6 +110,7 @@ export interface WorkspaceKeyManagerOptions { product?: string } +/** Describe usage and budget details for a workspace model key including expiration and exhaustion status */ export interface WorkspaceModelKeyUsage { keyId: string budgetUsd: number @@ -118,6 +120,7 @@ export interface WorkspaceModelKeyUsage { exhausted: boolean } +/** Manage workspace keys by ensuring, rotating, and tracking usage of active child-key secrets */ export interface WorkspaceKeyManager { /** The workspace's active child-key secret, provisioning one if absent/expired. */ ensureKey(workspaceId: string, opts?: { budgetUsd?: number }): Promise @@ -217,6 +220,7 @@ export interface PlatformBillingClient { deduct(input: { platformUserId: string; amountUsd: number; type: string; description: string; referenceId: string }): Promise } +/** Define shared billing state including user ID, plan, balances, concurrency, and overage permission */ export interface SharedBillingState { /** Platform user id, or null when the user has no Tangle SSO account. */ platformUserId: string | null @@ -228,6 +232,7 @@ export interface SharedBillingState { overageAllowed: boolean } +/** Define configuration options for managing platform balance based on billing plans */ export interface PlatformBalanceManagerOptions { client: PlatformBillingClient /** Plan → limits map (the product's pricing). */ @@ -238,6 +243,7 @@ export interface PlatformBalanceManagerOptions { productSlug: string } +/** Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking */ export interface PlatformBalanceManager { /** Resolve the user's plan + balance. Unlinked or platform-outage users fail * CLOSED: free plan, zero remaining balance — a billable run is never started @@ -253,6 +259,7 @@ export interface PlatformBalanceManager { getProductUsage(userId: string): Promise<{ spentUsd: number; transactionCount: number }> } +/** Create a platform balance manager to handle user plan limits and state based on provided options */ export function createPlatformBalanceManager( opts: PlatformBalanceManagerOptions, ): PlatformBalanceManager { @@ -317,6 +324,7 @@ export function createPlatformBalanceManager( return { getState, canStartBillableTurn, deduct, getProductUsage } } +/** Create a workspace key manager that handles key provisioning and budget tracking */ export function createWorkspaceKeyManager(opts: WorkspaceKeyManagerOptions): WorkspaceKeyManager { const clock = opts.now ?? (() => new Date()) const product = opts.product ?? 'router' diff --git a/src/brand-extraction/map.ts b/src/brand-extraction/map.ts index a319b02..8796eb4 100644 --- a/src/brand-extraction/map.ts +++ b/src/brand-extraction/map.ts @@ -30,6 +30,7 @@ function isGreyish(hex: string): boolean { return max - min < 18 } +/** Define a color palette with background, surface, text, and accent colors for UI elements */ export interface DecidedPalette { /** Lightest neutral — page background. */ background?: string @@ -80,6 +81,7 @@ export function decidePalette(palette: BrandColor[]): DecidedPalette { return result } +/** Define font selections for display and body text with optional BrandFont properties */ export interface DecidedFonts { display?: BrandFont body?: BrandFont diff --git a/src/brand-extraction/types.ts b/src/brand-extraction/types.ts index 88b83fa..710f883 100644 --- a/src/brand-extraction/types.ts +++ b/src/brand-extraction/types.ts @@ -102,6 +102,7 @@ export type FetchLike = (url: string, init?: { signal?: AbortSignal; headers?: R headers?: { get(name: string): string | null } }> +/** Define options for extracting brand kit data including HTML input, fetch method, timeout, and list limits */ export interface ExtractBrandKitOptions { /** Raw HTML for the page. When supplied, no network fetch happens — used by * tests and by callers that already hold the HTML. */ diff --git a/src/brand/index.tsx b/src/brand/index.tsx index c373d09..a20a8e8 100644 --- a/src/brand/index.tsx +++ b/src/brand/index.tsx @@ -17,6 +17,7 @@ */ import type { ReactNode } from 'react' +/** Define properties to customize the logo variant, size, style, and icon display options */ export interface LogoProps { /** Reserved for future lockups; only the default ('sandbox') exists today. */ variant?: 'sandbox' @@ -114,6 +115,7 @@ export function Logo({ variant = 'sandbox', size = 'md', className, iconOnly = f ) } +/** Define properties for a brand header including optional title, children, and CSS class name */ export interface BrandHeaderProps { /** Product name rendered next to the knot. Omit for a mark-only header. */ title?: string diff --git a/src/chat-routes/attachment-upload.ts b/src/chat-routes/attachment-upload.ts index e2b8f80..b4806ab 100644 --- a/src/chat-routes/attachment-upload.ts +++ b/src/chat-routes/attachment-upload.ts @@ -53,6 +53,7 @@ export type AttachmentUploadAuthorization = | { ok: true; scopeId: string; writeAttachment?: WriteAttachmentFn } | { ok: false; response: Response } +/** Define options to authorize, write, and limit attachment uploads in a route */ export interface CreateAttachmentUploadRouteOptions { /** Authenticate the caller, rate-limit, and resolve the store scope * (workspace/tenant id) — never a query param. */ @@ -93,6 +94,7 @@ function attachmentUploadError(status: number, code: string, message: string, pa ) } +/** Resolve an attachment upload route handler with customizable limits and validation options */ export function createAttachmentUploadRoute( options: CreateAttachmentUploadRouteOptions, ): (request: Request) => Promise { diff --git a/src/chat-routes/attachment-validation.ts b/src/chat-routes/attachment-validation.ts index ad4619d..d9cf66e 100644 --- a/src/chat-routes/attachment-validation.ts +++ b/src/chat-routes/attachment-validation.ts @@ -85,6 +85,7 @@ const EXTENSION_IMPLIES_SNIFFED_MIME: Readonly> = { pdf: 'application/pdf', } +/** Represent the result of checking an attachment's type with success or specific failure details */ export type AttachmentTypeCheckResult = | { succeeded: true } | { succeeded: false; code: 'attachment_type_mismatch' | 'attachment_type_not_allowed'; message: string } diff --git a/src/chat-routes/detached-turn.ts b/src/chat-routes/detached-turn.ts index a4ef710..0c7f22b 100644 --- a/src/chat-routes/detached-turn.ts +++ b/src/chat-routes/detached-turn.ts @@ -51,6 +51,7 @@ export interface DetachedTurnFinal { parts?: DetachedTurnParts } +/** Define options for managing and projecting a detached turn event stream in a session */ export interface DetachedTurnOptions { store: TurnEventStore turnId: string @@ -93,6 +94,7 @@ export interface DetachedTurnOptions { log?: (message: string, meta?: Record) => void } +/** Describe the result of a detached turn including state, text, parts, usage, and optional error or cache flag */ export interface DetachedTurnResult { /** `completed` — clean drain: persist + bill. `failed` — a terminal error * event, including the producer's structured `sandbox.stream_failed` event diff --git a/src/chat-routes/dispatch-parts.ts b/src/chat-routes/dispatch-parts.ts index 097b689..ffb8f87 100644 --- a/src/chat-routes/dispatch-parts.ts +++ b/src/chat-routes/dispatch-parts.ts @@ -39,6 +39,7 @@ import type { ReadAttachmentFn } from './attachment-store' export type { PromptInputPart } +/** Resolve the outcome of dispatching parts with success status and corresponding value or error message */ export type DispatchPartsOutcome = | { succeeded: true; value: PromptInputPart[] } | { succeeded: false; error: string } @@ -49,6 +50,7 @@ type SandboxMentionReadOutcome = | { succeeded: true; value: { size: number; base64?: string } } | { succeeded: false; error: string } +/** Resolve sandbox mention details by reading from a specified path with optional byte reading */ export type ReadSandboxMentionFn = ( box: SandboxExecChannel, absolutePath: string, @@ -95,6 +97,7 @@ function violatesUrlPathXor(part: PromptInputPart): boolean { return hasUrl === hasPath } +/** Build input parameters for dispatching chat message parts including text, attachments, mentions, and history */ export interface BuildDispatchPartsInput { text: string attachments: ChatAttachmentPart[] @@ -142,6 +145,7 @@ function readResultToBase64(read: { base64?: string; bytes?: Uint8Array }): stri return undefined } +/** Build dispatch parts from input by resolving mentions, paths, and applying size constraints asynchronously */ export async function buildDispatchParts(input: BuildDispatchPartsInput): Promise { const readMention = input.readSandboxMention ?? readSandboxMention const resolveMentionPath = input.resolveMentionPath ?? input.resolveAttachmentPath diff --git a/src/chat-routes/durable-projection.ts b/src/chat-routes/durable-projection.ts index ac1c07d..953974b 100644 --- a/src/chat-routes/durable-projection.ts +++ b/src/chat-routes/durable-projection.ts @@ -1,11 +1,13 @@ import { getPartKey, mergePersistedPart, type StreamEvent } from '../stream/index' import type { ChatTurnRouteProducer } from './turn-routes' +/** Resolve chat route events and materialize their durable state records */ export interface ChatRouteDurableProjection { observe(event: unknown): void | Promise materialize(): Array> | Promise>> } +/** Log chat route projection messages with optional metadata for durable processing */ export type ChatRouteDurableProjectionLogger = (message: string, meta?: Record) => void diff --git a/src/chat-routes/file-index.ts b/src/chat-routes/file-index.ts index 7a1be69..88a8d04 100644 --- a/src/chat-routes/file-index.ts +++ b/src/chat-routes/file-index.ts @@ -41,6 +41,7 @@ export interface SandboxFileTreeSource { tree(path: string, options?: { maxDepth?: number }): Promise } +/** Describe a ready file index response with workspace-relative entries and truncation status */ export interface FileIndexReadyResponse { status: 'ready' /** Workspace-relative entries. Same shape as `FileMention` (`./wire`) so a @@ -63,6 +64,7 @@ export interface FileIndexWarmingResponse { status: 'warming' } +/** Resolve a response indicating the file index is either ready or warming up */ export type FileIndexResponse = FileIndexReadyResponse | FileIndexWarmingResponse /** Short-TTL cache seam so repeat popover opens in the same session don't @@ -73,6 +75,7 @@ export interface FileIndexCache { put(key: string, value: FileIndexReadyResponse, options?: { ttlSeconds?: number }): Promise | void } +/** Define authorization details and parameters for indexing a file workspace with optional caching and ignore rules */ export type FileIndexAuthorization = | { status: 'ready' @@ -90,6 +93,7 @@ export type FileIndexAuthorization = | { status: 'warming' } | { status: 'denied'; response: Response } +/** Define options to authorize and configure sandbox file index route behavior */ export interface CreateSandboxFileIndexRouteOptions { /** Authenticate the caller, resolve the sandbox `fs` handle, and signal a * cold box — never provisions or waits. */ @@ -188,6 +192,7 @@ function escapeRegExp(value: string): string { return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') } +/** Resolve a sandbox file index route with authorization, caching, and configurable depth and entries limits */ export function createSandboxFileIndexRoute( options: CreateSandboxFileIndexRouteOptions, ): (request: Request) => Promise { diff --git a/src/chat-routes/promote-file-part.ts b/src/chat-routes/promote-file-part.ts index ee85b28..b55e182 100644 --- a/src/chat-routes/promote-file-part.ts +++ b/src/chat-routes/promote-file-part.ts @@ -32,6 +32,7 @@ import { formatBytes } from './wire' /** Default ceiling on a promoted file's raw (pre-encoding) byte size. */ export const PROMOTE_MAX_FILE_BYTES = 10 * 1024 * 1024 +/** Define the structure for a raw file part with optional metadata and media type information */ export interface RawAgentFilePart { type: 'file' id?: string @@ -43,6 +44,7 @@ export interface RawAgentFilePart { url?: string } +/** Resolve the result of promoting a file part with success status and relevant data or error details */ export type PromoteFilePartResult = | { succeeded: true; part: ChatAttachmentPart } | { succeeded: false; filename: string; reason: string } @@ -249,6 +251,7 @@ function defaultBuildAttachmentPath(args: AttachmentPathArgs): string { return `uploads/agent/${args.date}/${base}-${args.hash8}${extension}` } +/** Define options for promoting a part of an agent file within a specific session and scope */ export interface PromoteAgentFilePartOptions { raw: RawAgentFilePart /** The turn's box — required only to promote a sandbox-path part; a `data:` @@ -270,6 +273,7 @@ export interface PromoteAgentFilePartOptions { now?: () => Date } +/** Promote a part of an agent file with optional byte limits and MIME type detection */ export async function promoteAgentFilePart(options: PromoteAgentFilePartOptions): Promise { const maxBytes = options.maxBytes ?? PROMOTE_MAX_FILE_BYTES const sniffMime = options.sniffMime ?? sniffMimeFromName diff --git a/src/chat-routes/resolve-attachments.ts b/src/chat-routes/resolve-attachments.ts index beded9f..873ef90 100644 --- a/src/chat-routes/resolve-attachments.ts +++ b/src/chat-routes/resolve-attachments.ts @@ -21,6 +21,7 @@ import { attachmentInputToPart, type ChatAttachmentPart } from '../chat-store/pa import type { ReadAttachmentFn } from './attachment-store' import { ATTACHMENT_MAX_COUNT, MAX_ATTACHMENT_TOTAL_BYTES, attachmentTotalSizeErrorMessage } from './attachment-validation' +/** Resolve the result of chat attachment processing with success status and corresponding data or error */ export type ResolveChatAttachmentsResult = | { succeeded: true; value: ChatAttachmentPart[] } | { succeeded: false; error: string } @@ -126,6 +127,7 @@ function parseAttachmentInput( return { succeeded: true, value: { path, name, size, mediaType, kind } } } +/** Define options to resolve and validate chat attachments with size, count, and path constraints */ export interface ResolveChatAttachmentsOptions { /** The product's workspace/tenant key, passed to `readAttachment`. */ scopeId: string diff --git a/src/chat-routes/sandbox-producer.ts b/src/chat-routes/sandbox-producer.ts index 7469b15..100b898 100644 --- a/src/chat-routes/sandbox-producer.ts +++ b/src/chat-routes/sandbox-producer.ts @@ -62,6 +62,7 @@ export type FilePartPromotionOutcome = | { succeeded: true; part: Record; key?: string } | { succeeded: false; reason: string; part?: Record; key?: string } +/** Define options for producing sandbox chat events with rendering and interaction controls */ export interface SandboxChatProducerOptions { /** The raw sandbox event stream (e.g. `streamSandboxPrompt(...)`). */ events: AsyncIterable @@ -239,6 +240,7 @@ function sandboxStreamFailureDiagnostic(error: unknown): { return { userMessage, failureNote } } +/** Create a sandbox chat producer that manages chat turn routing with logging and interaction rendering options */ export function createSandboxChatProducer(options: SandboxChatProducerOptions): ChatTurnRouteProducer { const log = options.log ?? ((message, meta) => console.error(message, meta ?? '')) const renderable = options.isRenderableInteraction ?? isRenderableInteractionKind diff --git a/src/chat-routes/stale-turn-lock.ts b/src/chat-routes/stale-turn-lock.ts index 02da042..7d1516b 100644 --- a/src/chat-routes/stale-turn-lock.ts +++ b/src/chat-routes/stale-turn-lock.ts @@ -91,6 +91,7 @@ export const DEFAULT_STALE_TURN_LOCK_GRACE_MS = 5 * 60 * 1000 */ export const DEFAULT_TERMINAL_TURN_LOCK_GRACE_MS = 60 * 1000 +/** Resolve options for probing and releasing stale TURN locks based on lock start time and sandbox state */ export interface ReconcileStaleTurnLockOptions { /** When the held lock was acquired (epoch ms). The grace period is measured * from here, so it must be the LOCK's start, not the turn's. */ @@ -127,6 +128,7 @@ export interface ReconcileStaleTurnLockOptions { now?(): number } +/** Describe the outcome of reconciling a stale turn lock including release status and diagnostics */ export interface ReconcileStaleTurnLockResult { released: boolean /** Why the policy decided what it did — the probe's own diagnostics on the diff --git a/src/chat-routes/turn-routes.ts b/src/chat-routes/turn-routes.ts index dcac13f..542f758 100644 --- a/src/chat-routes/turn-routes.ts +++ b/src/chat-routes/turn-routes.ts @@ -116,6 +116,7 @@ export interface ChatTurnRouteProducer extends ChatTurnProducer { model?: string } +/** Resolve authorization status and context for a chat turn including tenant and user identification */ export type ChatTurnAuthorization = | { ok: true @@ -133,6 +134,7 @@ export type ChatTurnAuthorization = } | { ok: false; response: Response } +/** Define arguments required to authorize a chat turn based on intent and request details */ export interface ChatTurnAuthorizeArgs { request: Request intent: 'turn' | 'replay' | 'running' @@ -144,6 +146,7 @@ export interface ChatTurnAuthorizeArgs { threadId?: string } +/** Define the arguments required to produce a chat turn with context and messaging details */ export interface ChatTurnProduceArgs { request: Request body: ChatTurnRequestPayload @@ -218,14 +221,17 @@ interface ChatTurnLifecycleBase { turnStreamId: string context: TContext } +/** Define lifecycle start event with context and timestamp for a chat turn */ export interface ChatTurnLifecycleStart extends ChatTurnLifecycleBase { startedAt: number } +/** Define the structure representing the completion state of a chat turn lifecycle with usage data */ export interface ChatTurnLifecycleComplete extends ChatTurnLifecycleBase { finalText: string usage: ChatTurnUsage durationMs: number } +/** Represent an error occurring during a chat turn lifecycle with context and duration information */ export interface ChatTurnLifecycleError extends ChatTurnLifecycleBase { error: unknown durationMs: number @@ -243,6 +249,7 @@ export interface ChatTurnLifecycle { onTurnError?(info: ChatTurnLifecycleError): void | Promise } +/** Define options to configure chat turn routes including authorization, storage, and event buffering */ export interface CreateChatTurnRoutesOptions { /** Names the product in `deriveExecutionId` so retries land on the same * substrate execution. */ @@ -323,6 +330,7 @@ export interface CreateChatTurnRoutesOptions { log?: (message: string, meta?: Record) => void } +/** Define routes to run, replay, and list running chat turns with streaming and reconnect support */ export interface ChatTurnRoutes { /** POST — run one turn, streaming NDJSON. First line is * `{type:'turn', turnId}` (the replay handle); the rest is the engine's @@ -479,6 +487,7 @@ async function* withStreamHeartbeat( // ── the factory ──────────────────────────────────────────────────────────── +/** Build chat turn routes to handle and validate incoming chat requests with optional logging */ export function createChatTurnRoutes( options: CreateChatTurnRoutesOptions, ): ChatTurnRoutes { diff --git a/src/chat-routes/upload.ts b/src/chat-routes/upload.ts index 1bcca3f..0c00d0c 100644 --- a/src/chat-routes/upload.ts +++ b/src/chat-routes/upload.ts @@ -41,6 +41,7 @@ export interface SandboxUploadSink { write(path: string, content: string, options?: { encoding?: 'utf8' | 'base64' }): Promise } +/** Resolve upload authorization status and provide upload destination or error response */ export type UploadAuthorization = | { ok: true @@ -52,6 +53,7 @@ export type UploadAuthorization = } | { ok: false; response: Response } +/** Define options to authorize uploads and configure file size limits and upload directory */ export interface CreateUploadRouteOptions { /** Authenticate the caller and resolve the sandbox file sink (usually * `ensureWorkspaceSandbox(...)` → `box.fs`). */ @@ -85,6 +87,7 @@ export function sanitizeUploadFilename(name: string): string { const BASE64_CHUNK = 0x8000 +/** Convert a Uint8Array of bytes into a base64-encoded string */ export function bytesToBase64(bytes: Uint8Array): string { let binary = '' for (let offset = 0; offset < bytes.length; offset += BASE64_CHUNK) { @@ -97,6 +100,7 @@ function uploadError(status: number, code: string, error: string): Response { return Response.json({ code, error }, { status }) } +/** Create an upload route handler that authorizes requests and processes file uploads with size limits */ export function createUploadRoute(options: CreateUploadRouteOptions): (request: Request) => Promise { const inlineMaxBytes = options.inlineMaxBytes ?? UPLOAD_INLINE_MAX_BYTES const maxFileBytes = options.maxFileBytes ?? UPLOAD_MAX_FILE_BYTES diff --git a/src/chat-routes/wire.ts b/src/chat-routes/wire.ts index 63aed02..2ac9e5c 100644 --- a/src/chat-routes/wire.ts +++ b/src/chat-routes/wire.ts @@ -27,20 +27,24 @@ export interface ChatTurnFilePartInput { content?: string } +/** Resolve input as either a text part or a file part of a chat turn */ export type ChatTurnPartInput = ChatTurnTextPartInput | ChatTurnFilePartInput // ── producer stream vocabulary ─────────────────────────────────────────────── +/** Represent a text event produced by a source with a fixed type and associated text content */ export interface ProducerTextEvent { type: 'text' text: string } +/** Define an event representing reasoning output with a fixed type and associated text */ export interface ProducerReasoningEvent { type: 'reasoning' text: string } +/** Represent an event triggered by a producer tool call with its identifier, name, and arguments */ export interface ProducerToolCallEvent { type: 'tool_call' call: { @@ -50,6 +54,7 @@ export interface ProducerToolCallEvent { } } +/** Describe the structure of an event representing the result of a producer tool call */ export interface ProducerToolResultEvent { type: 'tool_result' toolCallId: string @@ -61,6 +66,7 @@ export interface ProducerToolResultEvent { } } +/** Describe usage event with prompt and completion token counts for a producer */ export interface ProducerUsageEvent { type: 'usage' usage: { @@ -69,6 +75,7 @@ export interface ProducerUsageEvent { } } +/** Define the structure for a producer notice event with type, id, kind, and text fields */ export interface ProducerNoticeEvent { type: 'notice' id: string @@ -77,6 +84,7 @@ export interface ProducerNoticeEvent { text: string } +/** Represent an error event emitted by a producer containing message, code, and optional details */ export interface ProducerErrorEvent { type: 'error' data: { @@ -100,6 +108,7 @@ export type ProducerPassthroughEventType = | 'session.run.failed' | 'turn_status' +/** Define an event carrying passthrough data with flexible properties for producer communication */ export interface ProducerPassthroughEvent { type: ProducerPassthroughEventType data?: Record @@ -107,6 +116,7 @@ export interface ProducerPassthroughEvent { [key: string]: unknown } +/** Represent events emitted by a producer during its operation for processing and handling */ export type ProducerWireEvent = | ProducerTextEvent | ProducerReasoningEvent @@ -189,6 +199,7 @@ export function chatTurnRequestInit(payload: ChatTurnRequestPayload): RequestIni // (same fail-loud-at-the-choke-point style as /sandbox's provision-payload and // env-size gates). +/** Define the maximum byte size allowed for inline parts in data processing */ export const INLINE_PARTS_MAX_BYTES = 950_000 // ── dispatch (parts[]) budget vocabulary ──────────────────────────────────── @@ -253,6 +264,7 @@ export function formatBytes(bytes: number): string { return `${Math.round(bytes / 1024)}KB` } +/** Represent errors for invalid chat turn inputs with status and code properties */ export class ChatTurnInputError extends Error { constructor(message: string, readonly status = 400, readonly code = 'INVALID_CHAT_TURN') { super(message) @@ -269,6 +281,7 @@ function partByteSize(part: ChatTurnPartInput): number { return bytes } +/** Calculate the total byte size of an array of chat turn parts */ export function promptPartsByteSize(parts: ChatTurnPartInput[]): number { return parts.reduce((total, part) => total + partByteSize(part), 0) } @@ -347,6 +360,7 @@ export function mentionKindForPath(path: string): ChatMentionKind { return mediaTypeForMentionPath(path) ? 'image' : 'file' } +/** Define options to resolve mention paths when converting file mentions to parts */ export interface FileMentionsToPartsOptions { /** Resolve a mention's workspace-relative path to the absolute path the * dispatched part should carry (e.g. a host prefixing the in-box vault @@ -408,6 +422,7 @@ const MAX_MENTION_NAME_LENGTH = 256 /** Longest mention path accepted. */ const MAX_MENTION_PATH_LENGTH = 1024 +/** Represent the result of a sandbox mention path check indicating success or failure with an error message */ export type SandboxMentionPathCheck = | { succeeded: true } | { succeeded: false; error: string } diff --git a/src/chat-store/parts.ts b/src/chat-store/parts.ts index bd34a15..14f2fab 100644 --- a/src/chat-store/parts.ts +++ b/src/chat-store/parts.ts @@ -89,6 +89,7 @@ export interface ChatTextPart { id?: string } +/** Define a reasoning part of a chat with text content and optional metadata fields */ export interface ChatReasoningPart { type: 'reasoning' text: string @@ -101,6 +102,7 @@ export interface ChatReasoningPart { * terminal form `/stream`'s `normalizePersistedPart` settles on. */ export type ChatToolStatus = 'pending' | 'running' | 'completed' | 'error' | 'failed' +/** Describe the current state and data of a chat tool including status, input, output, and metadata */ export interface ChatToolState { status: ChatToolStatus input?: unknown @@ -111,6 +113,7 @@ export interface ChatToolState { time?: ChatPartTime } +/** Define a chat component representing a tool with its state and optional call identifier */ export interface ChatToolPart { type: 'tool' id: string @@ -135,6 +138,7 @@ export interface ChatFilePart { content?: string } +/** Define properties for an image part within a chat message including optional metadata fields */ export interface ChatImagePart { type: 'image' filename?: string @@ -144,6 +148,7 @@ export interface ChatImagePart { path?: string } +/** Define a subtask part of a chat with prompt, description, agent, and optional identifier */ export interface ChatSubtaskPart { type: 'subtask' prompt: string @@ -172,6 +177,7 @@ export interface ChatUsageTokens { } } +/** Define a chat step finish part indicating completion with optional reason, tokens, and cost */ export interface ChatStepFinishPart { type: 'step-finish' reason?: string @@ -193,6 +199,7 @@ export interface ChatInteractionPart { cancelReason?: string } +/** Resolve a chat plan part by aliasing it to the persisted chat plan part type */ export type ChatPlanPart = ChatPlanPersistedPart /** Persisted one-line transcript notice — byte-matches `noticePart` in @@ -236,6 +243,7 @@ type _StoredNoticePartFeedsCodec = MutuallyAssignable type _StoredPlanPartFeedsCodec = MutuallyAssignable +/** Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions */ export type ChatMessagePart = | ChatTextPart | ChatReasoningPart @@ -322,22 +330,27 @@ function toChatMessagePart(part: Record): ChatMessagePart | nul } } +/** Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property */ export function isChatToolPart(part: ChatMessagePart): part is ChatToolPart { return part.type === 'tool' } +/** Resolve whether a chat message part is a text part based on its type property */ export function isChatTextPart(part: ChatMessagePart): part is ChatTextPart { return part.type === 'text' } +/** Resolve whether a ChatMessagePart is a ChatInteractionPart based on its type property */ export function isChatInteractionPart(part: ChatMessagePart): part is ChatInteractionPart { return part.type === 'interaction' } +/** Resolve whether a chat message part is a persisted chat plan part */ export function isChatPlanPart(part: ChatMessagePart): part is ChatPlanPart { return part.type === 'plan' } +/** Determine if a chat message part represents the completion of a chat step */ export function isChatStepFinishPart(part: ChatMessagePart): part is ChatStepFinishPart { return part.type === 'step-finish' } diff --git a/src/chat-store/schema.ts b/src/chat-store/schema.ts index b4b624e..97e4455 100644 --- a/src/chat-store/schema.ts +++ b/src/chat-store/schema.ts @@ -46,6 +46,7 @@ import type { ChatMessagePart } from './parts' /** A product table referenced by FK — only the `id` column is touched. */ export type ChatParentTable = AnySQLiteTable & { id: AnySQLiteColumn } +/** Define options to customize chat thread and message table creation including workspace and naming prefixes */ export interface CreateChatTablesOptions< TThreadExtras extends Record = {}, TMessageExtras extends Record = {}, @@ -73,6 +74,7 @@ const createdAt = () => integer('created_at', { mode: 'timestamp' }).notNull().d const updatedAt = () => integer('updated_at', { mode: 'timestamp' }).notNull().default(sql`(unixepoch())`) +/** Build chat-related SQLite tables with customizable thread and message columns */ export function createChatTables< TThreadExtras extends Record = {}, TMessageExtras extends Record = {}, @@ -135,7 +137,11 @@ export function createChatTables< */ export type ChatTables = ReturnType> +/** Resolve the selected fields of a chat thread row from the chat threads table */ export type ChatThreadRow = ChatTables['threads']['$inferSelect'] +/** Resolve the selected structure of a chat message row from the messages table */ export type ChatMessageRow = ChatTables['messages']['$inferSelect'] +/** Resolve the type for inserting a new chat thread row into the threads table */ export type NewChatThreadRow = ChatTables['threads']['$inferInsert'] +/** Resolve the type for inserting a new chat message row into the messages table */ export type NewChatMessageRow = ChatTables['messages']['$inferInsert'] diff --git a/src/chat-store/store.ts b/src/chat-store/store.ts index 5c1a5b3..4ea80a0 100644 --- a/src/chat-store/store.ts +++ b/src/chat-store/store.ts @@ -33,6 +33,7 @@ export type ChatDatabase = BaseSQLiteDatabase<'sync' | 'async', any, any> & { * users or roles itself. */ export type WorkspaceAccessCheck = (workspaceId: string) => void | Promise +/** Define input parameters for listing threads within a workspace with pagination options */ export interface ListThreadsInput { workspaceId: string /** Clamped to 1..200; default 50 (legal's list route semantics). */ @@ -41,6 +42,7 @@ export interface ListThreadsInput { offset?: number } +/** Represent a paginated collection of chat threads with total count and pagination details */ export interface ListThreadsResult { threads: TThread[] total: number @@ -48,6 +50,7 @@ export interface ListThreadsResult { offset: number } +/** Define input parameters required to create a new thread in a workspace */ export interface CreateThreadInput { workspaceId: string /** Title source when `title` is absent: first non-empty line, 80-char cap @@ -63,6 +66,7 @@ export interface CreateThreadInput { extras?: Record } +/** Define input parameters for appending a message to a chat thread with optional metadata */ export interface AppendMessageInput { threadId: string role: 'user' | 'assistant' | 'system' | 'tool' @@ -80,17 +84,20 @@ export interface AppendMessageInput { extras?: Record } +/** Define options to configure message listing with optional limit and offset parameters */ export interface ListMessagesOptions { limit?: number offset?: number } +/** Define input for bulk deleting threads with access checks per workspace */ export interface BulkDeleteThreadsInput { ids: string[] /** Called once per distinct workspace the ids touch, before ANY delete. */ assertAccess: WorkspaceAccessCheck } +/** Manage chat threads and messages with operations for listing, creating, updating, and deleting data */ export interface ChatStore { listThreads(input: ListThreadsInput): Promise> getThread(threadId: string): Promise @@ -135,6 +142,7 @@ function clampOffset(offset: number | undefined): number { return Math.max(value, 0) } +/** Create a chat store managing threads and messages based on the provided database and tables */ export function createChatStore( db: ChatDatabase, tables: TTables, diff --git a/src/design-canvas-react/components/layer-tree.ts b/src/design-canvas-react/components/layer-tree.ts index b4ec446..6e3d2dd 100644 --- a/src/design-canvas-react/components/layer-tree.ts +++ b/src/design-canvas-react/components/layer-tree.ts @@ -6,6 +6,7 @@ import type { SceneElement, ScenePage } from '../../design-canvas/model' +/** Describe a layer row with its element, depth, grouping, ownership, and parent group details */ export interface LayerRow { element: SceneElement depth: number diff --git a/src/design-canvas-react/components/ruler-math.ts b/src/design-canvas-react/components/ruler-math.ts index 3505273..79b52e7 100644 --- a/src/design-canvas-react/components/ruler-math.ts +++ b/src/design-canvas-react/components/ruler-math.ts @@ -13,6 +13,7 @@ * values (10, 50, 100, 500…) are always available as label boundaries. */ const TICK_STEP_CANDIDATES_PX = [1, 2, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000] as const +/** Define spacing and visibility rules for major and minor ticks in a coordinate system */ export interface TickStep { /** Document-coordinate step between major ticks. */ major: number @@ -58,6 +59,7 @@ export function selectTickStep(input: { return { major, minor, drawMinor } } +/** Define a ruler tick with a position and optional label for measurement markings */ export interface RulerTick { /** Position in document coordinates. */ position: number diff --git a/src/design-canvas-react/components/transform-math.ts b/src/design-canvas-react/components/transform-math.ts index c2906e9..a0f2f20 100644 --- a/src/design-canvas-react/components/transform-math.ts +++ b/src/design-canvas-react/components/transform-math.ts @@ -25,6 +25,7 @@ export interface TransformerNode { rotation: number } +/** Define baked node attributes including position, size, and rotation with collapsed scale */ export interface BakedNodeAttrs { x: number y: number diff --git a/src/design-canvas-react/contracts.ts b/src/design-canvas-react/contracts.ts index e0943e9..481a014 100644 --- a/src/design-canvas-react/contracts.ts +++ b/src/design-canvas-react/contracts.ts @@ -19,6 +19,7 @@ import type { CanvasRenderPalette } from '../theme/theme' // Engine: state + command stack // --------------------------------------------------------------------------- +/** Define the state of the editor scene including document, view settings, and selection details */ export interface EditorSceneState { document: SceneDocument activePageId: string @@ -35,6 +36,7 @@ export interface EditorSceneState { showBleed: boolean } +/** Define a command with execution, undo, and operation methods for scene editing and persistence */ export interface SceneCommand { label: string execute(state: EditorSceneState): EditorSceneState @@ -49,6 +51,7 @@ export interface SceneCommand { inverseOperations(): SceneOperation[] } +/** Manage and track scene commands with undo, redo, and state subscription capabilities */ export interface SceneCommandStack { execute(command: SceneCommand): void /** Apply the top-of-done-stack inverse and return the command (callers use @@ -88,19 +91,23 @@ export interface SceneCommandStack { // Engine: snapping // --------------------------------------------------------------------------- +/** Define snap target categories for aligning elements within a layout system */ export type SnapTargetKind = 'grid' | 'element-edge' | 'element-center' | 'page-edge' | 'page-center' | 'guide' +/** Define a target position and kind for snapping elements on a page */ export interface SnapTarget { /** Page-coordinate position of the snap line. */ position: number kind: SnapTargetKind } +/** Define vertical and horizontal collections of snap targets for alignment purposes */ export interface SnapTargets { vertical: SnapTarget[] horizontal: SnapTarget[] } +/** Define the result of a snap operation including coordinates and active snap lines */ export interface SnapResult { x: number y: number @@ -109,6 +116,7 @@ export interface SnapResult { activeHorizontal: SnapTarget | null } +/** Resolve snapping targets and apply snapping logic to moving elements within the editor scene */ export interface SnapEngine { /** Collect targets for a gesture: other elements' edges/centers, page * edges/center, saved guides, and grid lines when enabled. `excludeIds` @@ -122,6 +130,7 @@ export interface SnapEngine { // Engine: zoom + pan // --------------------------------------------------------------------------- +/** Define methods and properties to calculate zoom and pan transformations between document and screen coordinates */ export interface ZoomPanMath { minZoom: number maxZoom: number @@ -138,6 +147,7 @@ export interface ZoomPanMath { // Components: the editor's public props // --------------------------------------------------------------------------- +/** Resolve the result of applying a scene update including revision and optional normalized document */ export interface ApplySceneResult { rev: number /** Present when the server re-minted ids or normalized the document; the @@ -171,6 +181,7 @@ export interface ExportTriggerOptions { */ export type DesignCanvasMode = 'edit' | 'review' +/** Define properties and callbacks for configuring and controlling the design canvas editor */ export interface DesignCanvasProps { document: SceneDocument /** Revision the document was loaded at; threaded through saves. */ diff --git a/src/design-canvas-react/engine/command-stack.ts b/src/design-canvas-react/engine/command-stack.ts index 5a341bf..e772038 100644 --- a/src/design-canvas-react/engine/command-stack.ts +++ b/src/design-canvas-react/engine/command-stack.ts @@ -43,6 +43,7 @@ export interface SceneCommandStackWithReapply extends SceneCommandStack { reundo(command: SceneCommand): void } +/** Create a command stack for scene editing with reapply capabilities based on the given document and page ID */ export function createSceneCommandStack(document: SceneDocument, activePageId: string): SceneCommandStackWithReapply { let state: EditorSceneState = { document, diff --git a/src/design-canvas-react/engine/commands.ts b/src/design-canvas-react/engine/commands.ts index 9a27918..fb06272 100644 --- a/src/design-canvas-react/engine/commands.ts +++ b/src/design-canvas-react/engine/commands.ts @@ -43,6 +43,7 @@ function applyOp(state: EditorSceneState, op: SceneOperation): EditorSceneState // add_element / inverse = delete_element // --------------------------------------------------------------------------- +/** Define input parameters for adding a scene element with optional index and parent group ID */ export interface AddElementInput { pageId: string element: SceneElement @@ -52,6 +53,7 @@ export interface AddElementInput { parentGroupId?: string } +/** Create a command to add an element to a scene with optional positioning and grouping */ export function addElementCommand(input: AddElementInput): SceneCommand { const addOp: SceneOperation = { type: 'add_element', @@ -79,6 +81,7 @@ export function addElementCommand(input: AddElementInput): SceneCommand { // set_attrs — THE gesture command (one undo step per drag/transform) // --------------------------------------------------------------------------- +/** Define input parameters for setting element attributes within a specific page context */ export interface SetAttrsInput { pageId: string elementId: string @@ -88,6 +91,7 @@ export interface SetAttrsInput { priorAttrs: SceneAttrsPatch } +/** Create a command to set attributes on a scene element with undo capability */ export function setAttrsCommand(input: SetAttrsInput): SceneCommand { const forwardOp: SceneOperation = { type: 'set_attrs', @@ -115,6 +119,7 @@ export function setAttrsCommand(input: SetAttrsInput): SceneCommand { // multi-select set_attrs — N set_attrs ops, one undo step // --------------------------------------------------------------------------- +/** Define an entry linking page and element IDs with current and prior scene attribute patches */ export interface MultiSetAttrsEntry { pageId: string elementId: string @@ -122,6 +127,7 @@ export interface MultiSetAttrsEntry { priorAttrs: SceneAttrsPatch } +/** Build a scene command to set multiple attributes on elements across pages */ export function multiSetAttrsCommand(entries: MultiSetAttrsEntry[]): SceneCommand { if (entries.length === 0) throw new Error('multiSetAttrsCommand: entries must not be empty') @@ -151,12 +157,14 @@ export function multiSetAttrsCommand(entries: MultiSetAttrsEntry[]): SceneComman // reorder_element // --------------------------------------------------------------------------- +/** Define input parameters to reorder an element within a page */ export interface ReorderElementInput { pageId: string elementId: string toIndex: number } +/** Resolve a command to reorder an element within a scene by moving it to a specified index */ export function reorderElementCommand(input: ReorderElementInput): SceneCommand { // Capture the element's current index at construction for the inverse let capturedFromIndex: number | null = null @@ -210,12 +218,14 @@ export function reorderElementCommand(input: ReorderElementInput): SceneCommand // delete_element / inverse = add_element (full snapshot + index + parent) // --------------------------------------------------------------------------- +/** Define input parameters required to delete an element from a specific page in a document */ export interface DeleteElementInput { document: SceneDocument pageId: string elementId: string } +/** Resolve a command to delete an element from a specified page in the document */ export function deleteElementCommand(input: DeleteElementInput): SceneCommand { const page = requirePage(input.document, input.pageId) const { element, owner, index } = requireElement(page, input.elementId) @@ -273,6 +283,7 @@ function findGroupWithChildren(elements: SceneElement[], target: SceneElement[]) // group_elements / inverse = ungroup_element // --------------------------------------------------------------------------- +/** Define input parameters for grouping elements within a scene document on a specific page */ export interface GroupElementsInput { document: SceneDocument pageId: string @@ -281,6 +292,7 @@ export interface GroupElementsInput { name?: string } +/** Create a command to group multiple elements into a single group within a scene */ export function groupElementsCommand(input: GroupElementsInput): SceneCommand { if (input.elementIds.length < 2) { throw new Error('groupElementsCommand: requires ≥ 2 elementIds') @@ -321,12 +333,14 @@ export function groupElementsCommand(input: GroupElementsInput): SceneCommand { // ungroup_element / inverse = group_elements (re-using original ids) // --------------------------------------------------------------------------- +/** Define input parameters required to ungroup elements within a specific page and group */ export interface UngroupElementInput { document: SceneDocument pageId: string groupId: string } +/** Resolve a command to ungroup a group element into its child elements within a scene */ export function ungroupElementCommand(input: UngroupElementInput): SceneCommand { const page = requirePage(input.document, input.pageId) const { element } = requireElement(page, input.groupId) @@ -367,12 +381,14 @@ export function ungroupElementCommand(input: UngroupElementInput): SceneCommand // Page commands // --------------------------------------------------------------------------- +/** Define input parameters for adding a new page with optional settings and position index */ export interface AddPageInput { pageId: string options?: import('../../design-canvas/model').NewPageOptions index?: number } +/** Create a command to add a page with optional settings and index in the scene */ export function addPageCommand(input: AddPageInput): SceneCommand { const addOp: SceneOperation = { type: 'add_page', @@ -399,6 +415,7 @@ export function addPageCommand(input: AddPageInput): SceneCommand { } } +/** Define input parameters required to duplicate a page within a scene document */ export interface DuplicatePageInput { document: SceneDocument sourcePageId: string @@ -406,6 +423,7 @@ export interface DuplicatePageInput { pageId: string } +/** Create a command to duplicate a page and prepare its deletion operation in the scene */ export function duplicatePageCommand(input: DuplicatePageInput): SceneCommand { requirePage(input.document, input.sourcePageId) @@ -432,11 +450,13 @@ export function duplicatePageCommand(input: DuplicatePageInput): SceneCommand { } } +/** Define input parameters required to delete a page from a scene document */ export interface DeletePageInput { document: SceneDocument pageId: string } +/** Delete a page from a document ensuring it is not the last remaining page */ export function deletePageCommand(input: DeletePageInput): SceneCommand { if (input.document.pages.length <= 1) { throw new Error('deletePageCommand: cannot delete the last page') @@ -501,11 +521,13 @@ export function deletePageCommand(input: DeletePageInput): SceneCommand { } } +/** Define input parameters to reorder a page by specifying its ID and target index */ export interface ReorderPageInput { pageId: string toIndex: number } +/** Create a command to reorder a page to a specified index within a scene */ export function reorderPageCommand(input: ReorderPageInput): SceneCommand { let capturedFromIndex: number | null = null @@ -541,6 +563,7 @@ export function reorderPageCommand(input: ReorderPageInput): SceneCommand { } } +/** Define input parameters for setting properties on a specific page within a scene document */ export interface SetPagePropsInput { document: SceneDocument pageId: string @@ -553,6 +576,7 @@ export interface SetPagePropsInput { } } +/** Build a command to update page properties based on the provided input */ export function setPagePropsCommand(input: SetPagePropsInput): SceneCommand { const page = requirePage(input.document, input.pageId) const prior: NonNullable = { @@ -580,12 +604,14 @@ export function setPagePropsCommand(input: SetPagePropsInput): SceneCommand { } } +/** Define input parameters for setting guides on a specific page within a document */ export interface SetPageGuidesInput { document: SceneDocument pageId: string guides: import('../../design-canvas/model').PageGuides } +/** Create a command to update page guides with undo support */ export function setPageGuidesCommand(input: SetPageGuidesInput): SceneCommand { const page = requirePage(input.document, input.pageId) const priorGuides = structuredClone(page.guides) @@ -614,6 +640,7 @@ export function setPageGuidesCommand(input: SetPageGuidesInput): SceneCommand { // bind_slot // --------------------------------------------------------------------------- +/** Define input parameters for binding a slot within a scene document element */ export interface BindSlotInput { document: SceneDocument pageId: string @@ -621,6 +648,7 @@ export interface BindSlotInput { slot: string | null } +/** Bind a slot to an element within a page and generate the corresponding scene command */ export function bindSlotCommand(input: BindSlotInput): SceneCommand { const page = requirePage(input.document, input.pageId) const { element } = requireElement(page, input.elementId) @@ -652,11 +680,13 @@ export function bindSlotCommand(input: BindSlotInput): SceneCommand { // set_document_title // --------------------------------------------------------------------------- +/** Define input parameters for setting the title of a scene document */ export interface SetDocumentTitleInput { document: SceneDocument title: string } +/** Resolve a command to rename a document title with undo and redo operations */ export function setDocumentTitleCommand(input: SetDocumentTitleInput): SceneCommand { const priorTitle = input.document.title diff --git a/src/design-canvas-react/engine/selection.ts b/src/design-canvas-react/engine/selection.ts index c05e15c..1f1fd04 100644 --- a/src/design-canvas-react/engine/selection.ts +++ b/src/design-canvas-react/engine/selection.ts @@ -62,6 +62,7 @@ function pointInBounds(b: Bounds, x: number, y: number): boolean { return x >= b.x && x <= b.x + b.width && y >= b.y && y <= b.y + b.height } +/** Define options to configure marquee selection behavior including containment requirements */ export interface MarqueeSelectOptions { /** When true, the element's AABB must be fully inside the marquee; default is * intersection (any overlap selects). */ @@ -120,6 +121,7 @@ function boundsContain(outer: Bounds, inner: Bounds): boolean { const NUDGE_NORMAL_PX = 1 const NUDGE_SHIFT_PX = 10 +/** Represent horizontal and vertical displacement values for nudging elements */ export interface NudgeDelta { dx: number dy: number diff --git a/src/design-canvas-react/engine/snap.ts b/src/design-canvas-react/engine/snap.ts index 46d9c72..baa1abc 100644 --- a/src/design-canvas-react/engine/snap.ts +++ b/src/design-canvas-react/engine/snap.ts @@ -26,6 +26,7 @@ const KIND_PRIORITY: Record = { 'grid': 5, } +/** Build a SnapEngine instance to manage snapping targets and behavior within an editor scene */ export function createSnapEngine(): SnapEngine { return { collectTargets(state: EditorSceneState, excludeIds: string[]): SnapTargets { diff --git a/src/design-canvas-react/engine/zoom-pan.ts b/src/design-canvas-react/engine/zoom-pan.ts index e05f594..ecf2df7 100644 --- a/src/design-canvas-react/engine/zoom-pan.ts +++ b/src/design-canvas-react/engine/zoom-pan.ts @@ -11,11 +11,13 @@ import type { ZoomPanMath } from '../contracts' +/** Define configuration options for minimum and maximum zoom levels in a zoom-pan interface */ export interface ZoomPanConfig { minZoom: number maxZoom: number } +/** Create zoom and pan math utilities enforcing valid zoom range constraints */ export function createZoomPanMath(config: ZoomPanConfig): ZoomPanMath { const { minZoom, maxZoom } = config if (!Number.isFinite(minZoom) || minZoom <= 0) { diff --git a/src/design-canvas-react/export-math.ts b/src/design-canvas-react/export-math.ts index 0b5d8d8..4a8df43 100644 --- a/src/design-canvas-react/export-math.ts +++ b/src/design-canvas-react/export-math.ts @@ -37,6 +37,7 @@ export function isExportHiddenNodeName(name: string): boolean { // Crop rect + pixel ratio resolution // --------------------------------------------------------------------------- +/** Define parameters required to resolve export settings including crop, pixel ratio, type, and quality */ export interface ResolvedExportParams { cropRect: ExportCropRect pixelRatio: number diff --git a/src/design-canvas-react/export.ts b/src/design-canvas-react/export.ts index 2f93ae0..ce500ac 100644 --- a/src/design-canvas-react/export.ts +++ b/src/design-canvas-react/export.ts @@ -59,6 +59,7 @@ interface KonvaStageLike { // Raster export // --------------------------------------------------------------------------- +/** Define options to export a page as a data URL with format, pixel ratio, bleed, and preset settings */ export interface ExportPageDataUrlOptions { format: 'png' | 'jpeg' pixelRatio?: number diff --git a/src/design-canvas/apply.ts b/src/design-canvas/apply.ts index a2e47c9..8539ae1 100644 --- a/src/design-canvas/apply.ts +++ b/src/design-canvas/apply.ts @@ -64,6 +64,7 @@ import { validateSceneOperations } from './validate' // Result types // --------------------------------------------------------------------------- +/** Represent the result of applying changes to a scene as an element, page, or entire document */ export type SceneApplyResult = | { kind: 'element'; pageId: string; element: SceneElement } | { kind: 'page'; page: ScenePage } @@ -73,6 +74,7 @@ export type SceneApplyResult = // Options // --------------------------------------------------------------------------- +/** Resolve element ID conflicts by providing fresh unique identifiers during scene application */ export interface ApplySceneOptions { /** * Provides fresh ids when duplicate_page re-mints element ids. Never called @@ -144,6 +146,7 @@ function isStaleRevError(err: unknown): boolean { return err instanceof Error && /stale rev/i.test(err.message) } +/** Resolve and apply a scene plan to the store with specified actor context and generate results */ export async function storeApplyScenePlan( store: SceneStore, plan: ScenePlan, diff --git a/src/design-canvas/drizzle-store.ts b/src/design-canvas/drizzle-store.ts index ed209d8..d579e4c 100644 --- a/src/design-canvas/drizzle-store.ts +++ b/src/design-canvas/drizzle-store.ts @@ -37,6 +37,7 @@ import type { * and schema generics so better-sqlite3, D1, and libsql handles all fit. */ export type DesignCanvasDatabase = BaseSQLiteDatabase<'sync' | 'async', any, any> +/** Define options for creating a Drizzle scene store including database, tables, and scope */ export interface CreateDrizzleSceneStoreOptions { db: DesignCanvasDatabase tables: DesignCanvasTables @@ -45,6 +46,7 @@ export interface CreateDrizzleSceneStoreOptions { const DEFAULT_LIST_LIMIT = 50 +/** Create a scene store configured with database tables and scoped to a specific document and workspace */ export function createDrizzleSceneStore(options: CreateDrizzleSceneStoreOptions): SceneStore { const { db, tables, scope } = options const { designDocuments, designDecisions, designExports } = tables diff --git a/src/design-canvas/export-presets.ts b/src/design-canvas/export-presets.ts index 8bf6b73..0afebce 100644 --- a/src/design-canvas/export-presets.ts +++ b/src/design-canvas/export-presets.ts @@ -14,6 +14,7 @@ import type { Bounds, PageBleed, ScenePage } from './model' +/** Define size presets with identifiers, labels, categories, and dimensions for various media types */ export interface SizePreset { id: string label: string @@ -22,6 +23,7 @@ export interface SizePreset { height: number } +/** Provide predefined size presets for social, presentation, and print categories */ export const SIZE_PRESETS: readonly SizePreset[] = [ // Social { id: 'instagram-square', label: 'Instagram — Square', category: 'social', width: 1080, height: 1080 }, @@ -42,6 +44,7 @@ export const SIZE_PRESETS: readonly SizePreset[] = [ { id: 'us-letter-portrait', label: 'US Letter Portrait', category: 'print', width: 850, height: 1100 }, ] as const +/** Resolve a size preset by its identifier or return null if not found */ export function findPreset(id: string): SizePreset | null { return SIZE_PRESETS.find((p) => p.id === id) ?? null } @@ -56,6 +59,7 @@ export function matchPreset(width: number, height: number): SizePreset | null { // Export quality presets // --------------------------------------------------------------------------- +/** Define supported image export formats as PNG or JPEG */ export type ExportFormat = 'png' | 'jpeg' /** @@ -78,6 +82,7 @@ export interface ExportPreset { format: ExportFormat } +/** Provide predefined export configurations for various social media and image formats */ export const EXPORT_PRESETS: Record = { 'instagram-square': { name: 'Instagram square (1080×1080)', @@ -133,6 +138,7 @@ export const EXPORT_PRESETS: Record = { // Crop + scale math (pure, no canvas context) // --------------------------------------------------------------------------- +/** Define crop rectangle coordinates and dimensions for exporting content within page bounds */ export interface ExportCropRect { /** Page-coordinate origin. Negative when bleed extends outside page bounds. */ x: number @@ -185,6 +191,7 @@ export function scaleForPreset(preset: ExportPreset, cropRect: ExportCropRect): // Channel-size presets (fixed output resolutions for the export UI) // --------------------------------------------------------------------------- +/** Define a preset configuration for a channel including its id, label, width, and height */ export interface ChannelPreset { id: string label: string @@ -208,6 +215,7 @@ export const CHANNEL_PRESETS: readonly ChannelPreset[] = [ { id: 'a4_print_2480x3508', label: 'A4 Print (2480×3508 · 300 dpi)', width: 2480, height: 3508 }, ] as const +/** Resolve a valid channel preset identifier from the predefined channel presets array */ export type ChannelPresetId = (typeof CHANNEL_PRESETS)[number]['id'] /** Throws when the id is unknown — callers should only pass ids sourced from @@ -226,6 +234,7 @@ export function requireChannelPreset(id: string): ChannelPreset { // Letterbox scale math (page → channel preset, centered contain) // --------------------------------------------------------------------------- +/** Define the pixel ratio and horizontal offset for scaling a Konva stage to a channel preset size */ export interface ChannelScaleResult { /** * Konva stage pixelRatio: the stage logical size stays at page dimensions; diff --git a/src/design-canvas/mcp-entry.ts b/src/design-canvas/mcp-entry.ts index d8598a4..432313e 100644 --- a/src/design-canvas/mcp-entry.ts +++ b/src/design-canvas/mcp-entry.ts @@ -10,9 +10,11 @@ import { buildScopedMcpServerEntry } from '../tools/mcp' import type { AppToolMcpServer, ScopedMcpServerEntryOptions } from '../tools/mcp' +/** Describe the live visual asset editor capabilities for the current design document using CSS pixel coordinates */ export const DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION = 'Live visual asset editor for the current design document: read scene state, add/move/resize/delete elements, manage pages, bind template slots, apply data, and queue exports. All coordinates are CSS pixels.' +/** Build scoped MCP server entry options for the design canvas environment */ export type BuildDesignCanvasMcpServerEntryOptions = ScopedMcpServerEntryOptions /** Build the `AgentProfileMcpServer`-shaped entry for the design-canvas channel. */ diff --git a/src/design-canvas/mcp-handler.ts b/src/design-canvas/mcp-handler.ts index 00ceaba..9051415 100644 --- a/src/design-canvas/mcp-handler.ts +++ b/src/design-canvas/mcp-handler.ts @@ -20,11 +20,13 @@ import { CANVAS_MCP_TOOLS } from './mcp-tools' import type { DesignCanvasMcpToolEnv } from './mcp-tools' import { createMcpToolHandler } from '../tools/mcp-rpc' +/** Describe design canvas MCP server information including name and version */ export interface DesignCanvasMcpServerInfo { name: string version: string } +/** Define options for creating a design canvas MCP handler including store, ID minting, and optional server info */ export interface CreateDesignCanvasMcpHandlerOptions { /** Already scoped + authorized for one (workspace, document, actor). */ store: SceneStore @@ -35,6 +37,7 @@ export interface CreateDesignCanvasMcpHandlerOptions { serverInfo?: DesignCanvasMcpServerInfo } +/** Create a request handler for the design canvas MCP tool with specified options */ export function createDesignCanvasMcpHandler( opts: CreateDesignCanvasMcpHandlerOptions, ): (request: Request) => Promise { diff --git a/src/design-canvas/mcp-tools.ts b/src/design-canvas/mcp-tools.ts index bc24c98..f974196 100644 --- a/src/design-canvas/mcp-tools.ts +++ b/src/design-canvas/mcp-tools.ts @@ -34,6 +34,7 @@ import type { McpToolDefinition } from '../tools/mcp-rpc' // Tool env // --------------------------------------------------------------------------- +/** Define the environment for MCP tool with a scene store and ID minting function */ export interface DesignCanvasMcpToolEnv { store: SceneStore mintId: () => string @@ -220,6 +221,7 @@ const colorProp = (label: string) => ({ type: 'string', description: `${label} // Tool implementations // --------------------------------------------------------------------------- +/** Provide a collection of MCP tool definitions for manipulating and querying the design canvas environment */ const CANVAS_MCP_TOOLS: McpToolDefinition[] = [ // ─── read ──────────────────────────────────────────────────────────────── @@ -1003,11 +1005,14 @@ const CANVAS_MCP_TOOLS: McpToolDefinition[] = [ export { CANVAS_MCP_TOOLS } +/** Find the canvas MCP tool definition matching the given name or return undefined */ export function findCanvasMcpTool( name: string, ): McpToolDefinition | undefined { return CANVAS_MCP_TOOLS.find((tool) => tool.name === name) } +/** Extract names of all tools from the CANVAS_MCP_TOOLS array */ export const CANVAS_MCP_TOOL_NAMES = CANVAS_MCP_TOOLS.map((t) => t.name) +/** Provide a readonly array of string identifiers representing canvas element kinds */ export const CANVAS_ELEMENT_KINDS: readonly string[] = SCENE_ELEMENT_KINDS diff --git a/src/design-canvas/model.ts b/src/design-canvas/model.ts index 2c0a2a0..e49d2f7 100644 --- a/src/design-canvas/model.ts +++ b/src/design-canvas/model.ts @@ -15,8 +15,10 @@ import { assertMediaUrl } from '../web' +/** Define the current version number of the scene schema */ export const SCENE_SCHEMA_VERSION = 1 +/** Define the structure and properties of a scene document including version, title, pages, settings, and metadata */ export interface SceneDocument { schemaVersion: typeof SCENE_SCHEMA_VERSION title: string @@ -25,6 +27,7 @@ export interface SceneDocument { metadata: Record } +/** Define settings for scene export including print conversion factor for unit calculations */ export interface SceneSettings { /** Print conversion factor for mm↔px math at export; 96 = CSS default. */ dpi: number @@ -45,6 +48,7 @@ export interface PageGuides { horizontal: number[] } +/** Define the structure and properties of a scene page including layout, background, and elements */ export interface ScenePage { id: string name: string @@ -78,6 +82,7 @@ export interface SceneElementBase { slot?: string } +/** Define a rectangular scene element with size, fill, optional stroke, and corner radius properties */ export interface RectElement extends SceneElementBase { kind: 'rect' width: number @@ -88,6 +93,7 @@ export interface RectElement extends SceneElementBase { cornerRadius?: number } +/** Define properties for an ellipse element including dimensions, fill, and optional stroke details */ export interface EllipseElement extends SceneElementBase { kind: 'ellipse' width: number @@ -97,6 +103,7 @@ export interface EllipseElement extends SceneElementBase { strokeWidth?: number } +/** Define a line element with points, stroke, stroke width, and optional dash pattern */ export interface LineElement extends SceneElementBase { kind: 'line' /** Flat [x0, y0, x1, y1, ...] relative to (x, y); ≥ 2 points. */ @@ -106,6 +113,7 @@ export interface LineElement extends SceneElementBase { dash?: number[] } +/** Define properties for a text element including content, style, alignment, and layout parameters */ export interface TextElement extends SceneElementBase { kind: 'text' text: string @@ -120,6 +128,7 @@ export interface TextElement extends SceneElementBase { letterSpacing: number } +/** Define properties for an image element including source, dimensions, and fit mode */ export interface ImageElement extends SceneElementBase { kind: 'image' width: number @@ -141,11 +150,13 @@ export interface VideoElement extends SceneElementBase { posterSrc?: string } +/** Define a group element that contains multiple child scene elements */ export interface GroupElement extends SceneElementBase { kind: 'group' children: SceneElement[] } +/** Represent a graphical element in a scene including shapes, text, media, or groups */ export type SceneElement = | RectElement | EllipseElement @@ -155,8 +166,10 @@ export type SceneElement = | VideoElement | GroupElement +/** Extract the kind property from a SceneElement to identify its element type */ export type SceneElementKind = SceneElement['kind'] +/** Define all valid kinds of scene elements used in the application */ export const SCENE_ELEMENT_KINDS: readonly SceneElementKind[] = [ 'rect', 'ellipse', 'line', 'text', 'image', 'video', 'group', ] as const @@ -165,6 +178,7 @@ export const SCENE_ELEMENT_KINDS: readonly SceneElementKind[] = [ // Geometry // --------------------------------------------------------------------------- +/** Define rectangular boundaries with position and size properties */ export interface Bounds { x: number y: number @@ -214,6 +228,7 @@ export function elementExtent(element: SceneElement): { width: number; height: n } } +/** Estimate the height of multiline text based on font size and line height */ export function estimateTextHeight(element: Pick): number { const lines = element.text.length === 0 ? 1 : element.text.split('\n').length return lines * element.fontSize * element.lineHeight @@ -243,6 +258,7 @@ export function elementAabb(element: SceneElement): Bounds { return { x: element.x + minX, y: element.y + minY, width: maxX - minX, height: maxY - minY } } +/** Determine if two rectangular bounds overlap or intersect each other */ export function boundsIntersect(a: Bounds, b: Bounds): boolean { return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y } @@ -251,6 +267,7 @@ export function boundsIntersect(a: Bounds, b: Bounds): boolean { // Lookup + traversal // --------------------------------------------------------------------------- +/** Resolve and return a page by ID from a document or throw an error if not found */ export function requirePage(document: SceneDocument, pageId: string): ScenePage { const page = document.pages.find((candidate) => candidate.id === pageId) if (!page) throw new Error(`page ${pageId} not found in document`) @@ -273,6 +290,7 @@ export function findElement(page: ScenePage, elementId: string): { element: Scen return null } +/** Resolve and return the element, its owner array, and index from the page by element ID */ export function requireElement(page: ScenePage, elementId: string): { element: SceneElement; owner: SceneElement[]; index: number } { const found = findElement(page, elementId) if (!found) throw new Error(`element ${elementId} not found on page ${page.id}`) @@ -301,6 +319,7 @@ export function collectSlots(document: SceneDocument): Map } +/** Define an operation to set the document title to a specified string */ export interface SetDocumentTitleOperation { type: 'set_document_title' title: string } +/** Represent operations that modify scenes by adding, updating, reordering, grouping, or deleting elements and pages */ export type SceneOperation = | AddElementOperation | SetAttrsOperation @@ -166,13 +181,16 @@ export type SceneOperation = | ApplyDataOperation | SetDocumentTitleOperation +/** Define a plan summarizing a scene with its description and associated operations */ export interface ScenePlan { summary: string operations: SceneOperation[] } +/** Extract the type property from a SceneOperation to represent its operation type */ export type SceneOperationType = SceneOperation['type'] +/** Define all valid operation types for scene manipulation in the application */ export const SCENE_OPERATION_TYPES: readonly SceneOperationType[] = [ 'add_element', 'set_attrs', diff --git a/src/design-canvas/schema.ts b/src/design-canvas/schema.ts index 35b3d05..61ec548 100644 --- a/src/design-canvas/schema.ts +++ b/src/design-canvas/schema.ts @@ -21,6 +21,7 @@ import type { SceneDocument } from './model' /** A product table referenced by FK — only the `id` column is touched. */ export type DesignCanvasParentTable = AnySQLiteTable & { id: AnySQLiteColumn } +/** Define options for creating design canvas tables including workspace and user table configurations */ export interface CreateDesignCanvasTablesOptions { workspaceTable: DesignCanvasParentTable userTable: DesignCanvasParentTable @@ -34,6 +35,7 @@ const createdAt = () => integer('created_at', { mode: 'timestamp' }).notNull().d const updatedAt = () => integer('updated_at', { mode: 'timestamp' }).notNull().default(sql`(unixepoch())`) +/** Build SQLite tables for design documents with workspace and user references */ export function createDesignCanvasTables(opts: CreateDesignCanvasTablesOptions) { const { workspaceTable, userTable } = opts @@ -88,8 +90,12 @@ export function createDesignCanvasTables(opts: CreateDesignCanvasTablesOptions) return { designDocuments, designDecisions, designExports } } +/** Resolve the structure and data of design canvas tables for rendering and manipulation */ export type DesignCanvasTables = ReturnType +/** Resolve the selected structure of a design document row from design canvas tables */ export type DesignDocumentRow = DesignCanvasTables['designDocuments']['$inferSelect'] +/** Resolve a design decision row from the design decisions table selection */ export type DesignDecisionRow = DesignCanvasTables['designDecisions']['$inferSelect'] +/** Resolve the selected fields of designExports from DesignCanvasTables */ export type DesignExportRow = DesignCanvasTables['designExports']['$inferSelect'] diff --git a/src/design-canvas/store.ts b/src/design-canvas/store.ts index 80ce448..d1239d5 100644 --- a/src/design-canvas/store.ts +++ b/src/design-canvas/store.ts @@ -14,12 +14,14 @@ import type { SceneDocument } from './model' +/** Represent a scene document with its current revision number for version tracking */ export interface SceneDocumentRecord { document: SceneDocument /** Monotonic revision; increments on every successful save. */ rev: number } +/** Define the structure for decisions made within a scene including type, instructions, and metadata */ export interface SceneDecision { id: string kind: 'human_edit' | 'agent_edit' | 'agent_proposal' | 'export' | 'note' @@ -29,6 +31,7 @@ export interface SceneDecision { createdAt: Date } +/** Define the structure for decisions related to creating a new scene with instructions and optional details */ export interface NewSceneDecision { kind: SceneDecision['kind'] instruction: string @@ -36,8 +39,10 @@ export interface NewSceneDecision { metadata?: Record } +/** Define supported formats for exporting a scene including image and JSON options */ export type SceneExportFormat = 'png' | 'jpeg' | 'json' +/** Describe a scene export with its status, format, metadata, and result information */ export interface SceneExportRecord { id: string format: SceneExportFormat @@ -47,6 +52,7 @@ export interface SceneExportRecord { createdAt: Date } +/** Manage scene documents, decisions, and exports with atomic save and revision control */ export interface SceneStore { /** Current document + revision. */ getDocument(): Promise diff --git a/src/design-canvas/templates.ts b/src/design-canvas/templates.ts index 0acd535..b10cfad 100644 --- a/src/design-canvas/templates.ts +++ b/src/design-canvas/templates.ts @@ -27,8 +27,10 @@ import { // Slot surface // --------------------------------------------------------------------------- +/** Define allowed string literals representing different slot fill kinds */ export type SlotFillKind = 'text' | 'src' | 'color' +/** Define a slot template specifying its name, page, element, and fill characteristics */ export interface TemplateSlot { name: string pageId: string @@ -94,6 +96,7 @@ export function validateBindings( // Template instantiation // --------------------------------------------------------------------------- +/** Define options for instantiating a document with title, optional bindings, and custom id minting */ export interface InstantiateOptions { /** Human-readable title for the new document. */ title: string diff --git a/src/design-canvas/validate.ts b/src/design-canvas/validate.ts index 4b98f66..c3ea04c 100644 --- a/src/design-canvas/validate.ts +++ b/src/design-canvas/validate.ts @@ -54,6 +54,7 @@ import type { // Public entry // --------------------------------------------------------------------------- +/** Validate each scene operation against the document and throw detailed errors for invalid operations */ export function validateSceneOperations(document: SceneDocument, operations: SceneOperation[]): void { operations.forEach((operation, index) => { try { @@ -65,6 +66,7 @@ export function validateSceneOperations(document: SceneDocument, operations: Sce }) } +/** Validate a scene operation against the document to ensure it meets required constraints */ export function validateSceneOperation(document: SceneDocument, operation: SceneOperation): void { switch (operation.type) { case 'add_element': diff --git a/src/durable-chat/adapters.ts b/src/durable-chat/adapters.ts index 08c7029..07d59e4 100644 --- a/src/durable-chat/adapters.ts +++ b/src/durable-chat/adapters.ts @@ -30,6 +30,7 @@ import { planToPersistedPart, } from '../plans/index' +/** Define methods to manage durable interaction projections including upsert, cancel, and materialize operations */ export interface DurableInteractionProjectionAdapter { upsertAsk(request: InteractionRequestWire): Promise cancel(cancel: InteractionCancelData): Promise @@ -81,6 +82,7 @@ export function createDurableInteractionProjectionAdapter(options: { } } +/** Resolve chat events and materialize their state into durable records */ export interface DurableChatEventProjection { observe(event: unknown): void | Promise materialize(): Array> | Promise>> @@ -152,6 +154,7 @@ export function createDurableChatEventProjection(options: { } } +/** Define a structured response containing scope, settlement, and intent for durable interactions */ export interface PreparedDurableInteractionAnswer { scope: DurableChatScope settlement: DurableInteractionSettlement @@ -164,6 +167,7 @@ interface DurableInteractionRoutePersistenceBase { now?: () => string } +/** Define options for durable interaction route persistence with reconciliation guarantees and authority functions */ export type CreateDurableInteractionRoutePersistenceOptions = | (DurableInteractionRoutePersistenceBase & { guarantee: 'reconciled' diff --git a/src/durable-chat/errors.ts b/src/durable-chat/errors.ts index 80d32b8..bd5d36a 100644 --- a/src/durable-chat/errors.ts +++ b/src/durable-chat/errors.ts @@ -1,3 +1,4 @@ +/** Define error codes representing possible Durable Chat failure scenarios */ export type DurableChatErrorCode = | 'DURABLE_CHAT_BAD_REQUEST' | 'DURABLE_CHAT_UNAUTHORIZED' @@ -21,6 +22,7 @@ export class DurableChatError extends Error { } } +/** Represent conflict errors occurring in durable chat state management */ export class DurableChatConflictError extends DurableChatError { constructor(message = 'durable chat state conflict', details?: unknown) { super('DURABLE_CHAT_CONFLICT', message, 409, details) @@ -28,6 +30,7 @@ export class DurableChatConflictError extends DurableChatError { } } +/** Represent unavailable durable chat authority errors with status code 503 */ export class DurableChatUnavailableError extends DurableChatError { constructor(message = 'durable chat authority unavailable', details?: unknown) { super('DURABLE_CHAT_UNAVAILABLE', message, 503, details) @@ -35,6 +38,7 @@ export class DurableChatUnavailableError extends DurableChatError { } } +/** Represent durable chat errors indicating the chat plan is no longer available */ export class DurableChatGoneError extends DurableChatError { constructor(message = 'durable chat plan is gone', details?: unknown) { super('DURABLE_CHAT_GONE', message, 410, details) diff --git a/src/durable-chat/interactions.ts b/src/durable-chat/interactions.ts index f7609eb..25bf542 100644 --- a/src/durable-chat/interactions.ts +++ b/src/durable-chat/interactions.ts @@ -120,6 +120,7 @@ export async function recordDurableInteractionAnswer( }) } +/** Define options for creating durable interaction settlement factories including store and optional reconcile authority */ export interface DurableInteractionSettlementFactoryOptions extends DurableInteractionSettlementOptions { store: DurablePlanStore /** Optional authority lookup used by `reconcile`; returning null leaves the @@ -199,6 +200,9 @@ export function durableInteractionIntentKey(scope: DurableChatScope, interaction return intentKey(scope, interactionId, attemptKey) } +/** Resolve and upsert a durable interaction ask in the store with optional event and timing parameters */ export const applyDurableInteractionAsk = upsertDurableInteractionAsk +/** Resolve cancellation of a durable interaction with optional reason and event details */ export const applyDurableInteractionCancel = recordDurableInteractionCancel +/** Resolve and record the outcome and answers of a durable interaction within the given store and scope */ export const applyDurableInteractionAnswer = recordDurableInteractionAnswer diff --git a/src/durable-chat/memory.ts b/src/durable-chat/memory.ts index 0c5f5a8..61b46dd 100644 --- a/src/durable-chat/memory.ts +++ b/src/durable-chat/memory.ts @@ -289,6 +289,7 @@ export class InMemoryDurableChatStateStore implements DurablePlanStore { * store rather than a state store. Both names refer to the same non-production * reference implementation. */ export const InMemoryDurableChatStore = InMemoryDurableChatStateStore +/** Create an in-memory durable chat state store for managing chat session data efficiently */ export function createInMemoryDurableChatStateStore(): InMemoryDurableChatStateStore { return new InMemoryDurableChatStateStore() } diff --git a/src/durable-chat/plan-routes.ts b/src/durable-chat/plan-routes.ts index 5139e5d..431873a 100644 --- a/src/durable-chat/plan-routes.ts +++ b/src/durable-chat/plan-routes.ts @@ -21,6 +21,7 @@ import { } from './types' import { canTransitionPlanStatus, planFollowUpTurnId } from '../plans/index' +/** Resolve authorization status for durable plans using scopes, responses, or nullish values */ export type DurablePlanAuthorization = | DurableChatScope | { scope: DurableChatScope } @@ -28,12 +29,14 @@ export type DurablePlanAuthorization = | null | undefined +/** Define arguments for authorizing durable plan route requests with operation and optional plan ID */ export interface DurablePlanRouteAuthorizeArgs { request: Request operation: 'current' | 'decide' planId?: string } +/** Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling */ export interface DurablePlanRouteOptions { store: DurablePlanStore authority: DurablePlanAuthority @@ -52,6 +55,7 @@ export interface DurablePlanRouteOptions { logger?: Pick } +/** Define routes handling durable plan requests with current and decide methods */ export interface DurablePlanRoutes { current(request: Request): Promise decide(request: Request): Promise @@ -132,6 +136,7 @@ function recoverReceipt( }) } +/** Build durable plan routes with authorization and effect handling based on provided options */ export function createDurablePlanRoutes(options: DurablePlanRouteOptions): DurablePlanRoutes { const now = options.now ?? (() => new Date().toISOString()) const logger = options.logger ?? console diff --git a/src/durable-chat/types.ts b/src/durable-chat/types.ts index a03fe6c..0a58884 100644 --- a/src/durable-chat/types.ts +++ b/src/durable-chat/types.ts @@ -12,17 +12,21 @@ import type { ChatPlan, ChatPlanStatus } from '../plans/index' * an identity or scope from the request body. */ export type DurableChatScope = string & { readonly __durableChatScope: unique symbol } +/** Create a durable chat scope from a non-empty string value */ export function createDurableChatScope(value: string): DurableChatScope { if (typeof value !== 'string' || value.trim() === '') throw new TypeError('durable chat scope must be a non-empty string') return value as DurableChatScope } +/** Resolve a valid durable chat scope key from the given scope input */ export function durableChatScopeKey(scope: DurableChatScope): string { if (typeof scope !== 'string' || scope.length === 0) throw new TypeError('durable chat scope is required') return scope } +/** Represent durable plan outcomes as either approved or rejected */ export type DurablePlanDecision = 'approved' | 'rejected' +/** Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions */ export type DurablePlanAuthorityDecision = DurablePlanDecision | 'approve' | 'reject' /** Projection retained by a durable store. It is intentionally compatible @@ -32,14 +36,17 @@ export type DurablePlanProjection = ChatPlan & { decidedBy?: string } +/** Represent a unique identifier key for durable plan commands */ export type DurablePlanCommandKey = string +/** Define possible states for a durable plan command in its lifecycle */ export type DurablePlanCommandState = | 'claimed' | 'authority_committed' | 'finalized' | 'conflicted' +/** Define the structure for recording durable plan commands with associated metadata and state information */ export interface DurablePlanCommandRecord { scope: DurableChatScope planId: string @@ -54,12 +61,14 @@ export interface DurablePlanCommandRecord { conflict?: string } +/** Represent the current authoritative state and optional receipt of a durable plan authority */ export interface DurablePlanAuthorityCurrentResult { /** Authoritative state. `null` means the authority has forgotten the plan. */ plan: DurablePlanProjection | null receipt?: DurableFollowUpReceipt } +/** Define a durable receipt capturing stable identifiers and state for follow-up decisions */ export interface DurableFollowUpReceipt { /** Stable for a scope + plan + revision + decision. */ receiptId: string @@ -72,6 +81,7 @@ export interface DurableFollowUpReceipt { authorityIdempotencyKey: string } +/** Describe the outcome of an authority's durable plan decision including follow-up and metadata */ export interface DurablePlanAuthorityResult { /** Authority's final plan projection. */ plan: DurablePlanProjection @@ -101,6 +111,7 @@ export interface DurablePlanAuthority { }): Promise } +/** Define the structure for recording the state and metadata of a durable plan effect */ export interface DurablePlanEffectRecord { effectKey: string scope: DurableChatScope @@ -113,6 +124,7 @@ export interface DurablePlanEffectRecord { error?: string } +/** Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context */ export interface DurablePlanStore { getPlanProjection(scope: DurableChatScope, planId: string, revision?: number): Promise putPlanProjection(scope: DurableChatScope, projection: DurablePlanProjection): Promise @@ -151,10 +163,14 @@ export interface DurablePlanStore { /** Alias used by adapters that store all durable chat state in one port. */ export type DurableChatStateStore = DurablePlanStore +/** Represent durable storage for plan state management with persistence and reliability guarantees */ export type DurablePlanStateStore = DurablePlanStore +/** Pick essential methods to manage and record durable plan command operations */ export type DurablePlanCommandJournal = Pick +/** Provide durable methods to manage the lifecycle of answer intents in a plan store */ export type DurableAnswerIntentJournal = Pick +/** Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag */ export interface DurableInteractionProjection extends ChatInteraction { /** Sequence/event identity used to make ask replays idempotent. */ eventId?: string @@ -164,8 +180,10 @@ export interface DurableInteractionProjection extends ChatInteraction { updatedAt?: string } +/** Define possible states for a durable answer intent lifecycle */ export type DurableAnswerIntentState = 'prepared' | 'acknowledged' | 'finalized' | 'aborted' +/** Define the structure for recording durable answer intent details and their states */ export interface DurableAnswerIntentRecord { scope: DurableChatScope interactionId: string @@ -181,6 +199,7 @@ export interface DurableAnswerIntentRecord { error?: string } +/** Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields */ export interface DurableInteractionAcknowledgement { acknowledged: true authorityId?: string @@ -188,8 +207,10 @@ export interface DurableInteractionAcknowledgement { at?: string } +/** Define interaction durability levels to specify reconciliation or best-effort guarantees */ export type DurableInteractionGuarantee = 'reconciled' | 'best-effort' +/** Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider */ export interface DurableInteractionSettlementOptions { /** Caller-created and stable across retries/reconnects. */ attemptKey: string @@ -197,6 +218,7 @@ export interface DurableInteractionSettlementOptions { now?: () => string } +/** Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents */ export interface DurableInteractionSettlement { prepare(scope: DurableChatScope, interactionId: string, outcome: 'accepted' | 'declined', data?: Record): Promise acknowledge(scope: DurableChatScope, intentKey: string, acknowledgement?: Omit): Promise @@ -205,24 +227,29 @@ export interface DurableInteractionSettlement { reconcile(scope: DurableChatScope, intentKey: string): Promise } +/** Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs */ export function normalizePlanDecision(value: unknown): DurablePlanDecision | null { if (value === 'approved' || value === 'approve') return 'approved' if (value === 'rejected' || value === 'reject') return 'rejected' return null } +/** Generate a unique key string for a plan command using plan ID, revision, and decision */ export function planCommandKey(planId: string, revision: number, decision: DurablePlanDecision): string { return `plan:${encodeURIComponent(planId)}:${revision}:${decision}` } +/** Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision */ export function planAuthorityIdempotencyKey(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision): string { return `durable-plan:${encodeURIComponent(durableChatScopeKey(scope))}:${encodeURIComponent(planId)}:${revision}:${decision}` } +/** Generate a unique string key representing the effect of a plan decision within a given scope and revision */ export function planEffectKey(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision): string { return `after-decision:${encodeURIComponent(durableChatScopeKey(scope))}:${encodeURIComponent(planId)}:${revision}:${decision}` } +/** Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision */ export function stablePlanReceipt( scope: DurableChatScope, planId: string, diff --git a/src/harness/index.ts b/src/harness/index.ts index fa990b9..c341258 100644 --- a/src/harness/index.ts +++ b/src/harness/index.ts @@ -47,12 +47,15 @@ export const KNOWN_HARNESSES = [ 'cli-base', ] as const +/** Resolve a valid harness identifier from the predefined KNOWN_HARNESSES array */ export type Harness = (typeof KNOWN_HARNESSES)[number] +/** Define the default harness to use for code execution and testing environments */ export const DEFAULT_HARNESS: Harness = 'opencode' const HARNESS_SET: ReadonlySet = new Set(KNOWN_HARNESSES) +/** Determine if a value is a recognized harness string identifier */ export function isHarness(value: unknown): value is Harness { return typeof value === 'string' && HARNESS_SET.has(value) } @@ -62,6 +65,7 @@ export function coerceHarness(value: unknown, fallback: Harness = DEFAULT_HARNES return isHarness(value) ? value : fallback } +/** Resolve input options to determine the appropriate session harness to use */ export interface ResolveSessionHarnessInput { /** The harness already locked to this session (recorded at its first turn). */ sessionHarness?: unknown @@ -73,6 +77,7 @@ export interface ResolveSessionHarnessInput { fallback?: Harness } +/** Represent resolved session state including harness, lock status, and swap attempt flag */ export interface ResolvedSessionHarness { /** The harness to actually run — the locked one when the session already has it. */ harness: Harness diff --git a/src/intakes-react/contracts.ts b/src/intakes-react/contracts.ts index c63215c..e336407 100644 --- a/src/intakes-react/contracts.ts +++ b/src/intakes-react/contracts.ts @@ -19,6 +19,7 @@ export interface IntakeView { progress: { answered: number; total: number } } +/** Define properties and callbacks for managing the intake interview flow and user interactions */ export interface IntakeInterviewProps { view: IntakeView /** diff --git a/src/intakes-react/lazy.tsx b/src/intakes-react/lazy.tsx index a1bc9a9..264206a 100644 --- a/src/intakes-react/lazy.tsx +++ b/src/intakes-react/lazy.tsx @@ -10,6 +10,7 @@ import type { IntakeInterviewProps } from './contracts' export type { IntakeInterviewProps } +/** Load IntakeInterview component lazily to optimize initial application rendering */ export const IntakeInterviewLazy = lazy( () => import('./components/IntakeInterview').then((m) => ({ default: m.IntakeInterview })), ) diff --git a/src/intakes/api.ts b/src/intakes/api.ts index 4c6e083..5e0724f 100644 --- a/src/intakes/api.ts +++ b/src/intakes/api.ts @@ -40,6 +40,7 @@ export interface CurrentIntakeView { progress: { answered: number; total: number } } +/** Define configuration options for initializing the intake API with store and graph components */ export interface IntakeApiOptions { store: IntakeStore graph: IntakeGraph diff --git a/src/intakes/drizzle/schema.ts b/src/intakes/drizzle/schema.ts index 83bc912..c605c96 100644 --- a/src/intakes/drizzle/schema.ts +++ b/src/intakes/drizzle/schema.ts @@ -29,6 +29,7 @@ import type { AnySQLiteColumn, AnySQLiteTable } from 'drizzle-orm/sqlite-core' /** A product table referenced by FK — only the `id` column is touched. */ export type IntakeParentTable = AnySQLiteTable & { id: AnySQLiteColumn } +/** Define options for creating intake tables including user and optional workspace references */ export interface CreateIntakeTablesOptions { /** The product's user table — user-intake rows reference `userTable.id`. */ userTable: IntakeParentTable @@ -98,7 +99,9 @@ export function createIntakeTables( return result as IntakeTables } +/** Resolve the structure and data of a user intake table based on the createUserIntakeTable function */ export type UserIntakeTable = ReturnType +/** Resolve the structure and data of the project intake table from the factory function */ export type ProjectIntakeTable = ReturnType /** @@ -113,5 +116,7 @@ export type IntakeTables = /** The union table shape, for code that handles either scope generically. */ export type AnyIntakeTables = { userIntake: UserIntakeTable; projectIntake?: ProjectIntakeTable } +/** Infer and represent a selected row from the UserIntakeTable data structure */ export type UserIntakeRow = UserIntakeTable['$inferSelect'] +/** Resolve the selected data structure for a project intake table row */ export type ProjectIntakeRow = ProjectIntakeTable['$inferSelect'] diff --git a/src/intakes/drizzle/store.ts b/src/intakes/drizzle/store.ts index b2709b4..5f25a5a 100644 --- a/src/intakes/drizzle/store.ts +++ b/src/intakes/drizzle/store.ts @@ -50,6 +50,7 @@ export interface IntakeState { completedAt: Date | null } +/** Define error codes representing specific intake validation failures */ export type IntakeErrorCode = 'invalid-answer' | 'unknown-question' | 'incomplete' | 'stale-graph' /** Thrown by store mutations on a refused write — callers map it to a 4xx. */ @@ -172,6 +173,7 @@ function createScopedStore(opts: ScopedStoreOptions): IntakeStore { return { get, save, complete } } +/** Define options required to create a user intake store for onboarding data collection */ export interface CreateUserIntakeStoreOptions { db: IntakeDatabase /** The user-intake table from createIntakeTables. */ @@ -194,6 +196,7 @@ export function createUserIntakeStore(opts: CreateUserIntakeStoreOptions): Intak }) } +/** Define options required to create a project intake store including database, table, graph, and workspace ID */ export interface CreateProjectIntakeStoreOptions { db: IntakeDatabase /** The project-intake table from createIntakeTables (workspace scope). */ diff --git a/src/intakes/model.ts b/src/intakes/model.ts index 183e3ed..9258201 100644 --- a/src/intakes/model.ts +++ b/src/intakes/model.ts @@ -96,6 +96,7 @@ export type AnswerRejectionReason = | 'invalid-email' | 'unknown-question' +/** Describe validation outcome of an answer including success status and optional rejection reason */ export interface AnswerValidationResult { ok: boolean reason?: AnswerRejectionReason diff --git a/src/integrations/index.ts b/src/integrations/index.ts index 4946c7e..9a09d2b 100644 --- a/src/integrations/index.ts +++ b/src/integrations/index.ts @@ -29,6 +29,7 @@ export type HubExecResult = | { succeeded: true; result: unknown } | { succeeded: false; code: HubExecErrorCode; message: string; approval?: unknown } +/** Define configuration options for initializing a Hub execution client */ export interface HubExecClientOptions { /** Platform base URL (e.g. `TANGLE_PLATFORM_URL`). */ baseUrl: string @@ -116,16 +117,19 @@ export class HubExecClient { } } +/** Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments */ export interface HubInvokeInput { userId: string /** The MCP tool name the agent called (`int___`). */ toolName: string args?: Record } +/** Describe the outcome of a hub invocation including status and response body */ export interface HubInvokeOutcome { status: number body: Record } +/** Define dependencies for invoking hub operations including API key resolution and optional configuration */ export interface HubInvokeDeps { /** Resolve the user's Tangle API key (the hub principal bearer). Required — * the product binds its own session-key resolver. Null → user not linked. */ diff --git a/src/interactions/contract.ts b/src/interactions/contract.ts index 2bd9da6..5f4e269 100644 --- a/src/interactions/contract.ts +++ b/src/interactions/contract.ts @@ -35,6 +35,7 @@ export const INTERACTION_RESOLVED_EVENT = 'interaction.resolved' as const * A pure default; a product may substitute its own renderable set. */ const RENDERABLE_INTERACTION_KINDS: ReadonlySet = new Set(['question', 'plan']) +/** Resolve if the given interaction kind is renderable within the application context */ export function isRenderableInteractionKind(kind: string): boolean { return RENDERABLE_INTERACTION_KINDS.has(kind) } @@ -54,9 +55,11 @@ export function isSafeInteractionFieldKey(key: string): boolean { // its write-in input, and `parseInteractionRequest` returns the RAW payload // (schema-validated, not schema-parsed) so the flag survives. +/** Extract select-type interaction fields and optionally allow custom values */ export type ChatSelectField = Extract & { allowCustom?: boolean } +/** Resolve a chat interaction field excluding select types or including chat select fields */ export type ChatInteractionField = Exclude | ChatSelectField /** `InteractionRequest` whose select fields may carry `allowCustom`. */ @@ -67,6 +70,7 @@ export type InteractionRequestWire = Omit & { // --------------------------------------------------------------------------- // Interaction lifecycle +/** Define possible statuses representing the state of a chat interaction */ export type ChatInteractionStatus = 'pending' | 'answered' | 'declined' | 'cancelled' | 'expired' /** Accepted field selections keyed by answer-spec field name. */ @@ -74,8 +78,10 @@ export type ChatInteractionStatus = 'pending' | 'answered' | 'declined' | 'cance * wider scalar union is additive and lets durable stores preserve text, * numeric, and boolean answer fields without coercion. */ export type InteractionAnswerValue = string | number | boolean | string[] +/** Map interaction identifiers to their corresponding answer values */ export type InteractionAnswers = Record +/** Resolve the result of parsing interaction answers with success status and corresponding data or error message */ export type ParseInteractionAnswersResult = | { succeeded: true; value: InteractionAnswers } | { succeeded: false; error: string } @@ -114,6 +120,7 @@ export interface ChatInteraction { cancelReason?: string } +/** Resolve if the interaction status is a terminal state excluding pending */ export function isTerminalInteractionStatus(status: ChatInteractionStatus): boolean { return status !== 'pending' } @@ -157,6 +164,7 @@ export function questionInteractionContentSignature(interaction: ChatInteraction })) } +/** Remove duplicate question interactions based on their content signature to ensure uniqueness */ export function dedupeQuestionInteractionsByContent(interactions: ChatInteraction[]): ChatInteraction[] { const seen = new Set() return interactions.filter((interaction) => { @@ -172,6 +180,7 @@ export function dedupeQuestionInteractionsByContent(interactions: ChatInteractio // Wire parsing — typed outcomes, fail loud at the caller (log + skip; never a // half-rendered card). +/** Resolve interaction parsing outcome as success with value or failure with error message */ export type ParseInteractionResult = | { succeeded: true; value: InteractionRequestWire } | { succeeded: false; error: string } @@ -191,11 +200,13 @@ export function parseInteractionRequest(data: Record | undefine return { succeeded: true, value: request as InteractionRequestWire } } +/** Describe data required to cancel an interaction including its identifier and optional reason */ export interface InteractionCancelData { id: string reason?: string } +/** Parse interaction cancel data and return success status with parsed value or error message */ export function parseInteractionCancel( data: Record | undefined, ): { succeeded: true; value: InteractionCancelData } | { succeeded: false; error: string } { @@ -211,12 +222,14 @@ export function parseInteractionCancel( // decides what it means. No interpretation here; the sidecar validates answers // fail-closed (invalid free text on an option-only ask → 400). +/** Determine if a chat interaction field allows free text input */ export function fieldAcceptsFreeText(field: ChatInteractionField): boolean { if (field.type === 'text') return true if (field.type === 'select') return (field as ChatSelectField).allowCustom === true return false } +/** Define the structure for delivering answers linked to a specific chat interaction and field */ export interface ComposerAnswerDelivery { interactionId: string field: ChatInteractionField @@ -249,14 +262,17 @@ export function composerAnswerData(field: ChatInteractionField, text: string): I // Part keys + codecs (persisted `messages.parts` entries and live stream parts // share these shapes). +/** Generate a unique key string for an interaction using the given identifier */ export function interactionPartKey(id: string): string { return `interaction:${id}` } +/** Generate a unique key string for a notice using the given identifier */ export function noticePartKey(id: string): string { return `notice:${id}` } +/** Define specific string literals representing different kinds of notices */ export type NoticeKind = 'warning' | 'auto-declined' /** @@ -279,6 +295,7 @@ export type InteractionPersistedPart = { cancelReason?: string } +/** Define a persisted notice part with type, id, kind, and text properties */ export type NoticePersistedPart = { type: 'notice' id: string diff --git a/src/interactions/route.ts b/src/interactions/route.ts index 03b058b..928dd3c 100644 --- a/src/interactions/route.ts +++ b/src/interactions/route.ts @@ -41,8 +41,10 @@ import { // A client resolves an ask by answering (`accepted`) or refusing (`declined`). // Withdrawal (`cancelled`) is an agent/broker outcome delivered via the // `interaction.cancel` event, never a client POST, so it is not accepted here. +/** Define possible outcomes for an interaction client as accepted or declined */ export type InteractionClientOutcome = 'accepted' | 'declined' +/** Validate interaction answer body and return success with data or failure with error message */ export type InteractionAnswerBodyValidation = | { ok: true; id: string; outcome: InteractionClientOutcome; data?: InteractionData } | { ok: false; error: string } @@ -76,6 +78,7 @@ export function validateInteractionAnswerBody(body: Record): In return { ok: true, id, outcome, data } } +/** Provide logging methods for warnings and errors in interaction routes */ export type InteractionRouteLogger = Pick /** Sidecar error → the client-actionable contract. Every "the ask is gone" @@ -119,6 +122,7 @@ export type InteractionConnectionResolution = | { ok: false; response: Response } | { ok: false; unavailable: string } +/** Define arguments required to resolve interaction connections based on request and intent */ export interface ResolveInteractionConnectionArgs { request: Request intent: 'list' | 'answer' @@ -127,6 +131,7 @@ export interface ResolveInteractionConnectionArgs { body?: Record } +/** Describe the arguments provided before processing an interaction answer including request, body, and connection details */ export interface BeforeInteractionAnswerArgs { request: Request /** Original parsed body, including product routing fields. */ @@ -141,6 +146,7 @@ export interface BeforeInteractionAnswerArgs { duplicateRequests: InteractionRequestWire[] } +/** Define arguments for durable interaction routes including a stable caller-created attempt key */ export interface DurableInteractionRouteArgs extends BeforeInteractionAnswerArgs { /** Caller-created opaque identifier, stable across an ambiguous retry. */ attemptKey: string @@ -170,6 +176,7 @@ export interface DurableInteractionRoutePersistence { fail?(args: DurableInteractionRouteArgs & { prepared: TPrepared; error: unknown }): void | Promise } +/** Define options to authenticate, authorize, and manage persistence for interaction answer routes */ export interface InteractionAnswerRouteOptions { /** Authenticate + authorize the caller and resolve the sidecar connection. * This is the only product-supplied step: session auth, workspace/thread @@ -184,6 +191,7 @@ export interface InteractionAnswerRouteOptions { logger?: InteractionRouteLogger } +/** Define routes to list outstanding interactions and resolve answers for live turns */ export interface InteractionAnswerRoute { /** GET — outstanding interactions for a live turn. Failures return an empty * list with an explicit `unavailable` code: the caller is a best-effort @@ -196,6 +204,7 @@ export interface InteractionAnswerRoute { answer: (request: Request) => Promise } +/** Create an interaction answer route that handles listing and resolving interaction requests */ export function createInteractionAnswerRoute(options: InteractionAnswerRouteOptions): InteractionAnswerRoute { const logger = options.logger ?? console diff --git a/src/interactions/sidecar.ts b/src/interactions/sidecar.ts index 5883fcd..7cf80a0 100644 --- a/src/interactions/sidecar.ts +++ b/src/interactions/sidecar.ts @@ -12,6 +12,7 @@ import type { InteractionData, InteractionOutcome, InteractionRequestWire } from './contract' +/** Describe error details including code, message, and upstream HTTP status for sidecar interactions */ export interface SidecarInteractionsError { code: string message: string @@ -19,6 +20,7 @@ export interface SidecarInteractionsError { status: number } +/** Represent the outcome of sidecar interactions with success or error details */ export type SidecarInteractionsResult = | { succeeded: true; value: T } | { succeeded: false; error: SidecarInteractionsError } diff --git a/src/knowledge-loop/index.ts b/src/knowledge-loop/index.ts index fa9d425..99e0b89 100644 --- a/src/knowledge-loop/index.ts +++ b/src/knowledge-loop/index.ts @@ -110,6 +110,7 @@ export interface KnowledgeDecider { (input: KnowledgeDeciderInput): Promise | KnowledgeDecision } +/** Define the input parameters required to decide knowledge proposals within an agent-knowledge loop */ export interface KnowledgeDeciderInput { /** The agent-knowledge loop context for this iteration. */ context: KnowledgeResearchLoopContext @@ -125,6 +126,7 @@ export interface KnowledgeDeciderInput { driver?: KnowledgeLoopDriver } +/** Define a decision containing a candidate and the gate's verdict on that candidate */ export interface KnowledgeDecision { /** The candidate the policy produced (may be empty to end the loop). */ candidate: KnowledgeCandidate @@ -146,6 +148,7 @@ export interface KnowledgeLoopDriver { }): Promise<{ finalText: string }> } +/** Define dependencies required to create and run a knowledge processing loop */ export interface CreateKnowledgeLoopDeps { /** * The knowledge-base root the loop reads/writes (an agent-knowledge layout). diff --git a/src/knowledge/index.ts b/src/knowledge/index.ts index c9b2a24..17735d2 100644 --- a/src/knowledge/index.ts +++ b/src/knowledge/index.ts @@ -38,6 +38,7 @@ export type SatisfiedByRule = | { anyOf: SatisfiedByRule[] } | { allOf: SatisfiedByRule[] } +/** Define the criteria and conditions required to satisfy a specific knowledge requirement */ export interface KnowledgeRequirementSpec { id: string description: string @@ -66,6 +67,7 @@ export interface KnowledgeStateAccessor { count: (query: { table: string; where?: string; statusIn?: string[] }) => number | Promise } +/** Define a signal representing knowledge with confidence level and optional supporting evidence */ export interface KnowledgeSignal { confidence: number evidence?: string diff --git a/src/missions/engine.ts b/src/missions/engine.ts index de89969..d734fb1 100644 --- a/src/missions/engine.ts +++ b/src/missions/engine.ts @@ -43,12 +43,14 @@ import { noopEventSink, type MissionEventSink, type MissionStreamEvent } from '. */ export type SandboxDispatch = (input: SandboxDispatchInput) => Promise +/** Define input parameters for dispatching a mission step in the sandbox environment */ export interface SandboxDispatchInput { mission: MissionRecord step: MissionStep stepIndex: number } +/** Define the result of a completed sandbox dispatch including artifact reference and optional cost details */ export interface SandboxDispatchDoneResult { kind?: 'done' /** Small pointer at the produced artifact/output (vault path, asset id, exec @@ -78,6 +80,7 @@ export interface SandboxDispatchInProgressResult { sublabel?: string } +/** Resolve the result of a sandbox dispatch as done or in progress */ export type SandboxDispatchResult = SandboxDispatchDoneResult | SandboxDispatchInProgressResult /** Outcome of running a single step. `cached` distinguishes a replay/skip @@ -102,6 +105,7 @@ type StepGateOutcome = | { kind: 'continue' } | { kind: 'halted'; status: MissionStatus; reason: string } +/** Define options to control mission plan execution with optional pre-step veto logic */ export interface MissionPlanRunOptions { /** Pre-step veto (kill switch, schedule window). A non-null return pauses the * mission with that reason before the step's side effect starts. */ @@ -138,6 +142,7 @@ export class RetryableStepError extends Error { * the gated step; everything else keeps the mission parked. */ export type MissionProposalResolution = 'pending' | 'approved' | 'rejected' | 'executed' | 'ignored' +/** Define mission gate categories as step, budget, or volume */ export type MissionGateKind = 'step' | 'budget' | 'volume' /** Product classification of one step. Returned by @@ -184,6 +189,7 @@ export interface MissionApprovalsPort { countExternalActionProposals(missionId: string): Promise } +/** Define configuration options for mission gating including approvals, step classification, and action limits */ export interface MissionGateOptions { approvals: MissionApprovalsPort /** Which steps need human approval, and as what. Return null for an ungated @@ -194,6 +200,7 @@ export interface MissionGateOptions { externalActionCap?: number } +/** Define configuration options for initializing and controlling the mission engine behavior */ export interface MissionEngineOptions { service: MissionService /** Per-step USD estimate. Load-bearing twice: the budget gate parks on it @@ -216,6 +223,7 @@ export interface MissionEngineOptions { nonFatalStepKinds?: readonly string[] } +/** Resolve mission plan steps with concurrency control and durable state management */ export interface MissionEngine { /** Run exactly one plan step. Idempotent: re-invoking for a step already * `done` returns the cached pointer without re-dispatching. A lost guarded @@ -299,6 +307,7 @@ function terminalMissionEvent( } } +/** Create a mission engine configured with options to manage mission execution and error handling */ export function createMissionEngine(options: MissionEngineOptions): MissionEngine { const { service, estimateStepCostUsd, gates } = options const sink = options.sink ?? noopEventSink diff --git a/src/missions/events.ts b/src/missions/events.ts index a27ddb0..c29d838 100644 --- a/src/missions/events.ts +++ b/src/missions/events.ts @@ -19,6 +19,7 @@ import type { StepAgentActivity } from './agent-activity' +/** Handle mission stream events by processing emitted MissionStreamEvent objects */ export interface MissionEventSink { emit(event: MissionStreamEvent): void } @@ -41,6 +42,7 @@ export interface MissionStreamStep { status: MissionStreamStepStatus } +/** Define possible status values for a mission stream step */ export type MissionStreamStepStatus = | 'pending' | 'running' @@ -48,6 +50,7 @@ export type MissionStreamStepStatus = | 'failed' | 'waiting_approval' +/** Define possible statuses representing the current state of a mission stream */ export type MissionStreamStatus = | 'scheduled' | 'running' diff --git a/src/missions/plan-parse.ts b/src/missions/plan-parse.ts index d177321..d69679a 100644 --- a/src/missions/plan-parse.ts +++ b/src/missions/plan-parse.ts @@ -26,17 +26,20 @@ export const DEFAULT_MISSION_STEP_KINDS: readonly string[] = [ 'best-effort', ] +/** Define the structure representing a parsed mission step with id, kind, and intent fields */ export interface ParsedMissionStep { id: string kind: string intent: string } +/** Describe a mission with a title and an ordered list of parsed steps */ export interface ParsedMission { title: string steps: ParsedMissionStep[] } +/** Define options to specify allowed lowercase step kinds for parsing mission blocks */ export interface ParseMissionBlocksOptions { /** Allowed step kinds (lowercase). Default {@link DEFAULT_MISSION_STEP_KINDS}. */ kinds?: readonly string[] diff --git a/src/missions/service.ts b/src/missions/service.ts index 0f8a145..28b3d8d 100644 --- a/src/missions/service.ts +++ b/src/missions/service.ts @@ -29,8 +29,10 @@ export type MissionStatus = | 'aborted' | 'cancelled' +/** Define possible statuses for a mission step during its execution lifecycle */ export type MissionStepStatus = 'pending' | 'running' | 'waiting_approval' | 'done' | 'failed' +/** Define the structure and state details of a mission step within a workflow system */ export interface MissionStep { id: string /** What the step should accomplish — an intent, never an implementation. */ @@ -49,6 +51,7 @@ export interface MissionStep { resultRef?: string } +/** Define the structure for tracking mission token usage, cost, duration, and LLM call counts */ export interface MissionCostLedger { tokensIn: number tokensOut: number @@ -209,6 +212,7 @@ const ZERO_LEDGER: MissionCostLedger = { llmCalls: 0, } +/** Define input parameters for creating a mission including optional deterministic id and unique plan steps */ export interface CreateMissionInput { /** Explicit row id. Omit to use the service's id generator. Pass a * DETERMINISTIC id (derived from the originating turn) when the caller may @@ -239,6 +243,7 @@ export interface CreateMissionInput { extras?: Record } +/** Define a patch to update the status and optional metadata of a step in a process */ export interface SetStepStatusPatch { sublabel?: string resultRef?: string @@ -257,11 +262,13 @@ export interface SetStepStatusPatch { } } +/** Define input parameters to complete a mission with status and optional summary */ export interface CompleteMissionInput { ok: boolean summary?: string } +/** Define methods to create, retrieve, and update missions with controlled engine binding and metadata merging */ export interface MissionService { createMission(input: CreateMissionInput): Promise getMission(id: string): Promise @@ -302,6 +309,7 @@ export interface MissionService { complete(id: string, input: CompleteMissionInput): Promise> } +/** Define options for configuring mission service behavior including storage, time, and ID generation */ export interface MissionServiceOptions { store: MissionStorePort /** Injectable clock (epoch ms). Default `Date.now`. */ @@ -325,6 +333,7 @@ function lostRace(id: string): MissionOutcome { return { succeeded: false, error: `Mission ${id} changed concurrently`, conflict: true } } +/** Create a mission service that manages mission records and audit events with customizable options */ export function createMissionService(options: MissionServiceOptions): MissionService { const { store } = options const now = options.now ?? (() => Date.now()) @@ -658,6 +667,7 @@ export function createMissionService(options: MissionServiceOptions): MissionSer // ── in-memory store ────────────────────────────────────────────────────────── +/** Define an in-memory mission store that tracks events and allows direct record writes */ export interface InMemoryMissionStore extends MissionStorePort { /** The full audit trail, append order. */ events(): MissionAuditEvent[] diff --git a/src/model-resolution/index.ts b/src/model-resolution/index.ts index 8e46dee..67a1465 100644 --- a/src/model-resolution/index.ts +++ b/src/model-resolution/index.ts @@ -33,28 +33,34 @@ function canonicalModelId(model: ModelInfo): string { return provider ? `${provider}/${model.id}` : model.id } +/** Define possible origins for the chat model configuration values */ export type ChatModelSource = 'request' | 'workspace' | 'env' | 'default' +/** Resolve a chat model with its identifier and source information */ export interface ResolvedChatModel { model: string source: ChatModelSource } +/** Represent successful chat model validation with a true status and a validated string value */ export interface ChatModelValidationSuccess { succeeded: true value: string } +/** Describe a failed chat model validation result with an error message */ export interface ChatModelValidationFailure { succeeded: false error: string } +/** Resolve the outcome of validating a chat model as either success or failure */ export type ChatModelValidationResult = ChatModelValidationSuccess | ChatModelValidationFailure /** The catalog-fetch boundary: maps a router base URL to the raw model list. */ export type LoadModels = (routerBaseUrl: string) => Promise +/** Resolve the effective chat model input by prioritizing request, workspace, environment, and default models */ export interface ResolveChatModelInput { /** Per-request override (highest precedence). */ requestModel?: string @@ -79,6 +85,7 @@ export function resolveChatModel(input: ResolveChatModelInput): ResolvedChatMode return { model: input.defaultModel, source: 'default' } } +/** Define input parameters for validating chat model IDs with optional allowlist and catalog access details */ export interface ValidateChatModelIdInput { /** Ids accepted without a catalog round-trip (defaults + operator-trusted). */ allowlist?: Iterable @@ -144,17 +151,20 @@ export async function validateChatModelId( return { succeeded: false, error: `Model is not available: ${cleaned}` } } +/** Resolve and return a trimmed string model ID or undefined for invalid or empty input */ export function cleanModelId(value: unknown): string | undefined { if (typeof value !== 'string') return undefined const trimmed = value.trim() return trimmed.length > 0 ? trimmed : undefined } +/** Validate if a model ID string conforms to length and character format requirements */ export function isWellFormedModelId(modelId: string): boolean { if (modelId.length > 200) return false return /^[A-Za-z0-9._/@:-]+$/.test(modelId) } +/** Resolve unique catalog IDs associated with a given model including its canonical form if applicable */ export function catalogIdsForModel(model: ModelInfo): string[] { const ids = new Set() if (typeof model.id === 'string' && model.id.trim()) ids.add(model.id.trim()) diff --git a/src/plans/index.ts b/src/plans/index.ts index e2c68fc..e94c192 100644 --- a/src/plans/index.ts +++ b/src/plans/index.ts @@ -39,6 +39,7 @@ export type ChatPlan = ChatPlanBase & ( /** Canonical transcript part for one durable plan. */ export type ChatPlanPersistedPart = ChatPlan & { type: 'plan' } +/** Resolve the result of parsing a plan submission into success with value or failure with error */ export type ParsePlanSubmittedResult = | { succeeded: true; value: ChatPlan } | { succeeded: false; error: string } @@ -120,14 +121,17 @@ function parsePlan(record: Record, defaultStatus?: ChatPlanStat : null } +/** Generate a unique key string for a given plan identifier */ export function planPartKey(planId: string): string { return `plan:${planId}` } +/** Generate a unique key string for a plan based on its ID and revision number */ export function planRevisionKey(planId: string, revision: number): string { return `plan:${planId}:revision:${revision}` } +/** Generate a unique follow-up turn ID based on the plan ID and its outcome */ export function planFollowUpTurnId(planId: string, outcome: 'approved' | 'rejected'): string { return `plan:${planId}:${outcome}` } @@ -140,10 +144,12 @@ export function canTransitionPlanStatus(from: ChatPlanStatus, to: ChatPlanStatus return false } +/** Resolve a ChatPlan into its persisted part representation for storage or transmission */ export function planToPersistedPart(plan: ChatPlan): ChatPlanPersistedPart { return { type: 'plan', ...plan } } +/** Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan */ export function persistedPartToPlan(part: Record): ChatPlan | null { if (String(part.type ?? '') !== 'plan') return null return parsePlan(part) diff --git a/src/platform/billing.ts b/src/platform/billing.ts index ba581e2..0e6ec5e 100644 --- a/src/platform/billing.ts +++ b/src/platform/billing.ts @@ -11,6 +11,7 @@ import type { PlatformBillingClient, PlatformIdentity } from '../billing/index' +/** Define available subscription tiers for the TanglePlan service */ export type TanglePlanTier = 'free' | 'pro' | 'enterprise' /** 'pro' | 'enterprise' pass through; anything else (null, unknown) → 'free'. */ @@ -18,6 +19,7 @@ export function normalizeTanglePlanTier(plan: string | null | undefined): Tangle return plan === 'pro' || plan === 'enterprise' ? plan : 'free' } +/** Represent platform billing HTTP errors with status code and detailed message */ export class PlatformBillingHttpError extends Error { constructor( readonly status: number, @@ -37,6 +39,7 @@ export function isPlatformBillingHttpError(error: unknown): error is PlatformBil ) } +/** Define HTTP options for platform billing including base URL, service token, product slug, fetch implementation, and timeout */ export interface PlatformBillingHttpOptions { /** Platform root, e.g. https://id.tangle.tools (trailing slashes stripped). */ baseUrl: string @@ -50,17 +53,20 @@ export interface PlatformBillingHttpOptions { timeoutMs?: number } +/** Describe subscription tier and status information for a platform user */ export interface PlatformSubscriptionInfo { tier: TanglePlanTier status: string | null } +/** Describe the platform balance and lifetime spending with an optional update timestamp */ export interface PlatformBalanceSnapshot { balance: number lifetimeSpent: number updatedAt?: string } +/** Describe a product's usage and spending metrics on the platform */ export interface PlatformUsageProductRow { product: string | null totalSpent: number @@ -93,6 +99,7 @@ export interface ProductEntitlement { onFreeTier: boolean } +/** Define methods to interact with platform billing endpoints using user or service authentication */ export interface PlatformBillingHttp { /** GET /v1/plans/current (user bearer). */ getSubscription(userApiKey: string): Promise @@ -116,6 +123,7 @@ export interface PlatformBillingHttp { seatCheckoutUrl(productId: string): string } +/** Create a PlatformBillingHttp instance configured with given options and default behaviors */ export function createPlatformBillingHttp(opts: PlatformBillingHttpOptions): PlatformBillingHttp { const baseUrl = opts.baseUrl.replace(/\/+$/, '') if (!baseUrl) throw new Error('PlatformBillingHttpOptions.baseUrl is required') @@ -247,17 +255,20 @@ export function seatCheckoutUrl(baseUrl: string, productId: string): string { // ── Tier policy + composed state ──────────────────────────────────────────── +/** Define policy settings for concurrency and overage allowance in a tangle tier */ export interface TangleTierPolicy { concurrency: number overageAllowed: boolean } +/** Define default concurrency and overage policies for each TanglePlanTier level */ export const DEFAULT_TANGLE_TIER_POLICY: Record = { free: { concurrency: 1, overageAllowed: false }, pro: { concurrency: Number.POSITIVE_INFINITY, overageAllowed: true }, enterprise: { concurrency: Number.POSITIVE_INFINITY, overageAllowed: true }, } +/** Describe the state of a Tangle plan tier including subscription, balance, spending, and concurrency details */ export interface TangleTierState { tier: TanglePlanTier subscriptionStatus: string | null @@ -313,6 +324,7 @@ export const FREE_TIER_SPEND_CAP_USD = 2 */ export const DEFAULT_SEAT_BILLING_ENABLED_ENV_VAR = 'SEAT_BILLING_ENABLED' +/** Define options to configure seat billing flag environment variables and override flag name */ export interface SeatBillingFlagOptions { env?: Record /** Override the flag name; default {@link DEFAULT_SEAT_BILLING_ENABLED_ENV_VAR}. */ @@ -378,6 +390,7 @@ export function isProductEntitled(ent: ProductEntitlement): boolean { // ── Bridge onto the /billing seam ─────────────────────────────────────────── +/** Define a contract for resolving platform identities based on user identifiers */ export interface PlatformIdentityStore { resolveIdentity(userId: string): Promise } diff --git a/src/platform/guards.ts b/src/platform/guards.ts index 6a817fe..a0cd511 100644 --- a/src/platform/guards.ts +++ b/src/platform/guards.ts @@ -8,6 +8,7 @@ import { isTangleBillingEnforcementDisabled } from '../runtime/model' +/** Define options for configuring authentication guard behavior and session retrieval */ export interface AuthGuardOptions { /** e.g. a better-auth `auth.api.getSession` wrapped by the app. */ getSession(request: Request): Promise @@ -15,6 +16,7 @@ export interface AuthGuardOptions { loginPath?: string } +/** Resolve user authentication and session requirements for page and API requests */ export interface AuthGuard { /** Page guard — throws a 302 redirect Response to `loginPath`. */ requireUser(request: Request): Promise @@ -25,6 +27,7 @@ export interface AuthGuard { getOptionalSession(request: Request): Promise } +/** Create an authentication guard that enforces session presence and handles unauthorized access responses */ export function createAuthGuard(opts: AuthGuardOptions): AuthGuard { const loginPath = opts.loginPath ?? '/login' @@ -47,6 +50,7 @@ export function createAuthGuard(opts: AuthGuardOptions): AuthG } } +/** Resolve a value or an HTTP response indicating failure in a guarded operation */ export type GuardResolution = { ok: true; value: T } | { ok: false; response: Response } /** @@ -73,6 +77,7 @@ export function parseAdminEmails(raw: string | null | undefined): string[] { .filter(Boolean) } +/** Define options to resolve user session and control access based on allowed admin emails */ export interface AdminGuardOptions { requireUser(request: Request): Promise emailOf(session: Session): string | null | undefined @@ -93,11 +98,13 @@ export function createAdminGuard(opts: AdminGuardOptions): (re } } +/** Describe the billable balance state including overage permission and remaining USD balance */ export interface BillableBalanceState { overageAllowed: boolean remainingBalanceUsd: number } +/** Define options to assert and customize billable balance enforcement behavior */ export interface AssertBillableBalanceOptions { env?: Record /** App-specific enforcement override flag (e.g. 'GTM_BILLING_ENFORCEMENT'), diff --git a/src/platform/hub.ts b/src/platform/hub.ts index bfac09a..a9e4d3c 100644 --- a/src/platform/hub.ts +++ b/src/platform/hub.ts @@ -15,11 +15,13 @@ import { /** Hub bearer provenance mirrors the execution-key source union. */ export type TangleHubBearerSource = TangleExecutionKeySource +/** Represent a resolved bearer token with its associated TangleHub bearer source */ export interface ResolvedTangleHubBearer { bearer: string source: TangleHubBearerSource } +/** Resolve options required to obtain a user's TangleHub bearer token including environment and API key retrieval */ export interface ResolveUserTangleHubBearerOptions { userId: string /** Deployment context. Only local development may use env credentials. */ @@ -30,6 +32,7 @@ export interface ResolveUserTangleHubBearerOptions { getUserApiKey: () => string | null | undefined | Promise } +/** Resolve options for retrieving a TangleHub bearer token for a specified user */ export interface ResolveUserTangleHubBearerForUserOptions { userId: UserId environment?: TangleExecutionEnvironment @@ -37,6 +40,7 @@ export interface ResolveUserTangleHubBearerForUserOptions { getUserApiKey: (userId: UserId) => string | null | undefined | Promise } +/** Represent missing Tangle platform link error for a specified user ID */ export class TangleBearerMissingError extends Error { constructor(readonly userId: string) { super(`No Tangle platform link for user ${userId}`) @@ -64,6 +68,7 @@ export async function resolveUserTangleHubBearer( throw new TangleBearerMissingError(opts.userId) } +/** Resolve the TangleHub bearer token for a specified user based on provided options */ export async function resolveUserTangleHubBearerForUser( opts: ResolveUserTangleHubBearerForUserOptions, ): Promise { @@ -108,6 +113,7 @@ export interface HubClientLike { listHealthchecks(): Promise } +/** Define methods to require user ID, get bearer token, and create a hub client bound to the bearer */ export interface HubProxyContext { /** Resolve the authenticated user id. Throw the app's own auth Response / * redirect to reject — it propagates untouched. */ @@ -118,11 +124,13 @@ export interface HubProxyContext { createHubClient(bearer: string): HubClientLike } +/** Define arguments for configuring a proxy route with request and optional parameters */ export interface HubProxyRouteArgs { request: Request params?: Record } +/** Define routes for hub proxy handling catalog, connections, healthchecks, and authorization actions */ export interface HubProxyRoutes { /** GET → `{ catalog }`. */ catalog(args: HubProxyRouteArgs): Promise @@ -144,6 +152,7 @@ interface StartAuthBody { requestedScopes?: string[] } +/** Resolve hub proxy routes with authentication and error handling based on the given context */ export function createHubProxyRoutes(ctx: HubProxyContext): HubProxyRoutes { /** Auth runs OUTSIDE the proxy try/catch so the app's auth throw (redirect * Response etc.) is never swallowed; bearer + platform errors are mapped. */ diff --git a/src/platform/sso.ts b/src/platform/sso.ts index d589b04..dc929bf 100644 --- a/src/platform/sso.ts +++ b/src/platform/sso.ts @@ -17,6 +17,7 @@ const DEFAULT_SESSION_COOKIE = 'better-auth.session_token' // ── Signed state ──────────────────────────────────────────────────────────── +/** Define configuration options for managing SSO state including secret, lifetime, and clock injection */ export interface SsoStateConfig { /** HMAC-SHA256 secret (e.g. the app's auth secret). */ secret: string @@ -81,6 +82,7 @@ export async function verifySignedSsoState(state: string, config: SsoStateConfig // ── Seams ─────────────────────────────────────────────────────────────────── +/** Describe the result of exchanging SSO credentials including API key, user info, and optional plan details */ export interface TangleSsoExchangeResult { apiKey: string user: { id: string; email: string; name?: string | null } @@ -191,6 +193,7 @@ export interface BetterAuthSessionCookieSource { }> } +/** Define options to customize warning behavior for shadowed cookie names in authentication sessions */ export interface BetterAuthSessionCookieMinterOptions { /** Receives the shadowed-cookie-name warning (see below). Default * console.warn. */ @@ -261,6 +264,7 @@ export function createBetterAuthSessionCookieMinter( // ── Handlers ──────────────────────────────────────────────────────────────── +/** Define configuration options for handling Tangle SSO authentication and session management */ export interface TangleSsoHandlerOptions { auth: TangleSsoAuthClient store: TangleSsoAccountStore @@ -306,6 +310,7 @@ export interface TangleSsoHandlerOptions { now?: () => number } +/** Define handlers for SSO start and callback routes managing authentication flow and session cookies */ export interface TangleSsoHandlers { /** GET start route: mint + sign state, set the state cookie, 302 to the * platform authorize URL. `?redirect=` carries the post-login path. */ @@ -357,6 +362,7 @@ function parseStateCookiePayload(raw: string | null): StateCookiePayload | null } } +/** Create Tangle SSO handlers to manage authentication state, callbacks, and session cookies */ export function createTangleSsoHandlers(opts: TangleSsoHandlerOptions): TangleSsoHandlers { if (!opts.stateSecret) throw new Error('TangleSsoHandlerOptions.stateSecret is required') if (!opts.callbackUrl) throw new Error('TangleSsoHandlerOptions.callbackUrl is required') diff --git a/src/preflight/index.ts b/src/preflight/index.ts index 1787c79..b2353c5 100644 --- a/src/preflight/index.ts +++ b/src/preflight/index.ts @@ -179,6 +179,7 @@ function trimTrailingSlash(url: string): string { // --- Standard probe builders -------------------------------------------------- +/** Define configuration options for probing an LLM router with authentication and model details */ export interface RouterChatProbeConfig { /** LLM router base URL (LiteLLM / OpenAI-compatible), e.g. `https://router…`. */ baseUrl: string @@ -233,6 +234,7 @@ export function routerChatProbe(config: RouterChatProbeConfig): PreflightProbe { } } +/** Define configuration options for probing sandbox authentication endpoints */ export interface SandboxAuthProbeConfig { /** Sandbox API base URL. */ baseUrl: string @@ -277,6 +279,7 @@ export function sandboxAuthProbe(config: SandboxAuthProbeConfig): PreflightProbe } } +/** Define configuration options for performing an HTTP HEAD probe to check URL availability */ export interface HttpHeadProbeConfig { /** Probe name in the report. */ name: string diff --git a/src/preset-cloudflare/index.ts b/src/preset-cloudflare/index.ts index 9a7f3bd..925f5ff 100644 --- a/src/preset-cloudflare/index.ts +++ b/src/preset-cloudflare/index.ts @@ -285,6 +285,7 @@ export function createPresetDrizzleSchema(d: DrizzleSqliteCoreLike) { * Cloudflare `KVNamespace` satisfies it. Artifacts are stored under their path. */ export type VaultKv = KvLike +/** Define configuration options for handling preset tools including database, vault, and optional utilities */ export interface PresetToolHandlerOptions { /** The D1 database (Cloudflare `D1Database` satisfies {@link D1Like}). */ db: D1Like @@ -405,6 +406,7 @@ export function createPresetToolHandlers(opts: PresetToolHandlerOptions): AppToo // D1-backed KnowledgeStateAccessor // --------------------------------------------------------------------------- +/** Define options for accessing preset knowledge scoped to a specific workspace and configuration */ export interface PresetKnowledgeAccessorOptions { db: D1Like /** The active workspace — every `count` is scoped to it. */ @@ -523,6 +525,7 @@ export function createPresetWorkspaceKeyStore(db: D1Like): WorkspaceKeyStore { } } +/** Define preset billing options including database, provisioner, encryption key, budget, and optional settings */ export interface PresetBillingOptions { db: D1Like /** The key provisioner (`@tangle-network/tcloud`'s client satisfies it structurally). */ diff --git a/src/redact/index.ts b/src/redact/index.ts index 4eb75cf..cf81fc3 100644 --- a/src/redact/index.ts +++ b/src/redact/index.ts @@ -51,6 +51,7 @@ const SENSITIVE_KEYS = new Set([ 'phone', ]) +/** Define options to customize sensitive data redaction patterns and key names for ingestion */ export interface RedactForIngestionOptions { /** Extra patterns appended to {@link DEFAULT_REDACTION_PATTERNS} for the * string-level scrub (e.g. credit-card). Additive — defaults still apply. */ @@ -203,10 +204,12 @@ export type RedactedDocSegment = | { type: 'text'; text: string } | { type: 'redacted'; id: string; kind: string; cipher: string } +/** Define a document composed of multiple redacted content segments */ export interface RedactedDocument { segments: RedactedDocSegment[] } +/** Define options to encrypt text and specify patterns for redacting sensitive document content */ export interface BuildRedactedDocumentOptions { /** Encrypt one original span value. Wire it to `agent-app/crypto` * (`encryptWithKey` / `createFieldCrypto`). The cipher is what's stored. */ @@ -237,6 +240,7 @@ export async function buildRedactedDocument( return { segments } } +/** Define options to decrypt, authorize, and audit the reveal of a span segment */ export interface RevealSpanOptions { /** Decrypt a span cipher. Wire to `agent-app/crypto` (`decryptWithKey`). */ decrypt: (cipher: string) => string | Promise @@ -246,6 +250,7 @@ export interface RevealSpanOptions { onReveal?: (segment: { id: string; kind: string }) => void | Promise } +/** Describe the outcome of a reveal operation including success status, value, and failure reason */ export interface RevealResult { ok: boolean value?: string diff --git a/src/run/index.ts b/src/run/index.ts index 9599747..404766f 100644 --- a/src/run/index.ts +++ b/src/run/index.ts @@ -18,13 +18,16 @@ import { KNOWN_HARNESSES, type Harness } from '../harness/index' +/** Define execution mode as either router or sandbox */ export type ExecutionMode = 'router' | 'sandbox' /** The router pseudo-harness — the absence of a sandbox backend. Not a member * of `KNOWN_HARNESSES`; callers may pass it explicitly instead of null. */ export const ROUTER_HARNESS = 'router' as const +/** Provide a type alias for the ROUTER_HARNESS constant to enable consistent router harness usage */ export type RouterHarness = typeof ROUTER_HARNESS +/** Resolve a ProfileHarness as a Harness, RouterHarness, null, or undefined value */ export type ProfileHarness = Harness | RouterHarness | null | undefined /** diff --git a/src/runtime/agent.ts b/src/runtime/agent.ts index 64ea899..97c1111 100644 --- a/src/runtime/agent.ts +++ b/src/runtime/agent.ts @@ -73,6 +73,7 @@ export interface ResolvedAgentProfile { extraTools: unknown[] } +/** Define options for creating an agent runtime including model config and optional profile transformation */ export interface CreateAgentRuntimeOptions { /** The model endpoint the turns stream from. */ model: AgentRuntimeModelConfig @@ -105,6 +106,7 @@ export interface CreateAgentRuntimeOptions { isOtherExecutableTool?: (toolName: string) => boolean } +/** Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers */ export interface AgentTurnOptions { /** The trusted per-turn context (who/where the turn runs as). */ ctx: AppToolContext @@ -116,6 +118,7 @@ export interface AgentTurnOptions { onProduced?: (event: AppToolProducedEvent) => void } +/** Resolve and stream tool execution loops with final results and intermediate events for agent runtime */ export interface AgentRuntime { /** Run the bounded tool loop to completion; resolve with final text + every * executed tool outcome. */ diff --git a/src/runtime/certified-delivery.ts b/src/runtime/certified-delivery.ts index 22793f9..5c93c86 100644 --- a/src/runtime/certified-delivery.ts +++ b/src/runtime/certified-delivery.ts @@ -32,6 +32,7 @@ import type { ResolvedAgentProfile } from './agent' const defaultRefreshMs = 300_000 +/** Define configuration options for delivering certified artifacts to a specified tenant target */ export interface CertifiedDeliveryConfig { /** The tenant target whose certified artifacts to deliver (the agent id). */ target: string @@ -45,6 +46,7 @@ export interface CertifiedDeliveryConfig { fetchImpl?: typeof fetch } +/** Resolve and manage certified profiles with refresh and composition capabilities */ export interface CertifiedDelivery { /** The `composeProfile` transform to pass to `createAgentRuntime`. Applies the * cached certified profile to the base surfaces; refreshes on the cadence. */ diff --git a/src/runtime/model-catalog.ts b/src/runtime/model-catalog.ts index 07edbde..d3b459b 100644 --- a/src/runtime/model-catalog.ts +++ b/src/runtime/model-catalog.ts @@ -40,6 +40,7 @@ export interface RouterModel { } } +/** Define the structure and capabilities of a catalog item with optional pricing and feature flags */ export interface CatalogModel { id: string name: string @@ -52,6 +53,7 @@ export interface CatalogModel { featured: boolean } +/** Define a catalog containing models with a default ID and fetch timestamp */ export interface ModelCatalog { defaultModelId: string | null fetchedAt: string diff --git a/src/runtime/model.ts b/src/runtime/model.ts index 505163e..9a2501c 100644 --- a/src/runtime/model.ts +++ b/src/runtime/model.ts @@ -17,12 +17,16 @@ export interface TangleModelConfig { baseUrl: string } +/** Define the environment context for executing Tangle operations */ export type TangleExecutionEnvironment = 'development' | 'staging' | 'production' | 'test' +/** Resolve the source of the Tangle execution key as either local environment or user input */ export type TangleExecutionKeySource = 'local-env' | 'user' +/** Define error codes for Tangle execution key issues related to API key and account connection */ export type TangleExecutionKeyErrorCode = | 'local_tangle_api_key_required' | 'tangle_account_not_connected' +/** Resolve options for model configuration including environment variables and default router base URL */ export interface ResolveModelOptions { /** Env to read (defaults to process.env). */ env?: Record @@ -30,6 +34,7 @@ export interface ResolveModelOptions { defaultRouterBaseUrl?: string } +/** Resolve options for retrieving user API keys within a specific Tangle execution environment */ export interface ResolveUserTangleExecutionKeyOptions { /** Deployment context. Only local development may fall back to env keys. */ environment?: TangleExecutionEnvironment @@ -39,6 +44,7 @@ export interface ResolveUserTangleExecutionKeyOptions { getUserApiKey: () => string | null | undefined | Promise } +/** Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters */ export interface ResolveUserTangleExecutionKeyForUserOptions { userId: UserId environment?: TangleExecutionEnvironment @@ -46,11 +52,13 @@ export interface ResolveUserTangleExecutionKeyForUserOptions { getUserApiKey: (userId: UserId) => string | null | undefined | Promise } +/** Define a resolved key combining an API key with its Tangle execution source */ export interface ResolvedTangleExecutionKey { apiKey: string source: TangleExecutionKeySource } +/** Resolve options for retrieving a Tangle developer or user API key based on environment and context */ export interface ResolveTangleDevOrUserKeyOptions { /** Deployment context. Only local development may use the env key. */ environment?: TangleExecutionEnvironment @@ -60,6 +68,7 @@ export interface ResolveTangleDevOrUserKeyOptions { getUserApiKey: () => string | null | undefined | Promise } +/** Represent HTTP error response containing status, error message, and specific error code */ export interface TangleExecutionKeyHttpError { status: number body: { @@ -68,12 +77,14 @@ export interface TangleExecutionKeyHttpError { } } +/** Define configuration options for creating a Tangle router model including API key and model details */ export interface CreateTangleRouterModelConfigOptions { apiKey: string model: string baseUrl?: string } +/** Define options for configuring billing enforcement environment variables and overrides */ export interface TangleBillingEnforcementOptions { /** Env to read (defaults to process.env). */ env?: Record @@ -84,7 +95,9 @@ export interface TangleBillingEnforcementOptions { enforcementEnvVar?: string } +/** Provide the default base URL for the Tangle router API endpoint */ export const DEFAULT_TANGLE_ROUTER_BASE_URL = 'https://router.tangle.tools/v1' +/** Define the default environment variable name for Tangle billing enforcement */ export const DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR = 'TANGLE_BILLING_ENFORCEMENT' function requireEnv(env: Record, name: string): string { @@ -93,6 +106,7 @@ function requireEnv(env: Record, name: string): stri return value } +/** Resolve a string by trimming whitespace or returning null if empty or undefined */ export function trimOrNull(value: string | null | undefined): string | null { const trimmed = value?.trim() return trimmed ? trimmed : null @@ -102,6 +116,7 @@ function isTangleExecutionKeyErrorCode(value: unknown): value is TangleExecution return value === 'local_tangle_api_key_required' || value === 'tangle_account_not_connected' } +/** Represent execution key errors with specific codes and HTTP status information */ export class TangleExecutionKeyError extends Error { readonly code: TangleExecutionKeyErrorCode readonly status: number @@ -114,6 +129,7 @@ export class TangleExecutionKeyError extends Error { } } +/** Identify whether an error is a TangleExecutionKeyError based on its properties and type */ export function isTangleExecutionKeyError(error: unknown): error is TangleExecutionKeyError { return error instanceof TangleExecutionKeyError || ( @@ -126,6 +142,7 @@ export function isTangleExecutionKeyError(error: unknown): error is TangleExecut ) } +/** Resolve the current Tangle execution environment based on provided or process environment variables */ export function resolveTangleExecutionEnvironment( env: Record = process.env as Record, ): TangleExecutionEnvironment { @@ -158,6 +175,7 @@ export function isTangleBillingEnforcementDisabled( return resolveTangleExecutionEnvironment(env) === 'development' } +/** Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null */ export function tangleExecutionKeyHttpError(error: unknown): TangleExecutionKeyHttpError | null { if (!isTangleExecutionKeyError(error)) return null return { @@ -223,6 +241,7 @@ export async function resolveUserTangleExecutionKey( ) } +/** Resolve the Tangle execution key for a specified user using provided environment and API key options */ export async function resolveUserTangleExecutionKeyForUser( opts: ResolveUserTangleExecutionKeyForUserOptions, ): Promise { diff --git a/src/runtime/openai-stream.ts b/src/runtime/openai-stream.ts index b3cc0ac..5242957 100644 --- a/src/runtime/openai-stream.ts +++ b/src/runtime/openai-stream.ts @@ -96,6 +96,7 @@ function safeParse(s: string): Record { } } +/** Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools */ export interface OpenAICompatStreamTurnOptions { /** OpenAI-compat base URL (e.g. the Tangle Router `https://router.tangle.tools/v1`). */ baseUrl: string diff --git a/src/runtime/surface-profile.ts b/src/runtime/surface-profile.ts index d387d8f..03d3c4f 100644 --- a/src/runtime/surface-profile.ts +++ b/src/runtime/surface-profile.ts @@ -83,6 +83,7 @@ export function defineSurfaceKind(opts: { return { kind: opts.kind, build: opts.build } } +/** Resolve and build the overlay for a given surface kind within a turn context */ export interface SurfaceRegistry { /** Build the overlay for one turn. Throws on an unknown kind — an unknown * surface is a routing bug (client and server registries drifted), and diff --git a/src/sandbox/binary-read.ts b/src/sandbox/binary-read.ts index 8902ca5..aff0ed1 100644 --- a/src/sandbox/binary-read.ts +++ b/src/sandbox/binary-read.ts @@ -23,15 +23,18 @@ export interface SandboxExecChannel { ): Promise<{ stdout: string; stderr: string; exitCode: number }> } +/** Define options to execute code within a sandbox environment with optional session control */ export interface SandboxExecOptions { /** Run inside a named session rather than the box's default one. */ sessionId?: string } +/** Resolve the outcome of a sandbox file size check with success status and value or error message */ export type SandboxFileSizeOutcome = | { succeeded: true; value: number } | { succeeded: false; error: string } +/** Represent the outcome of reading sandbox file bytes with success status and corresponding data or error */ export type SandboxFileBytesOutcome = | { succeeded: true; value: { bytes: Uint8Array; size: number } } | { succeeded: false; error: string } diff --git a/src/sandbox/index.ts b/src/sandbox/index.ts index ff53466..9609e1d 100644 --- a/src/sandbox/index.ts +++ b/src/sandbox/index.ts @@ -29,6 +29,7 @@ import { ok, fail, type Outcome } from './outcome' export type { Outcome } from './outcome' export * from './binary-read' +/** Define client credentials for accessing the sandbox environment with API key and base URL */ export interface SandboxClientCredentials { apiKey: string baseUrl: string @@ -41,6 +42,7 @@ export interface SandboxClientCredentials { */ export type SandboxCredentialEnvironment = TangleExecutionEnvironment +/** Resolve options for obtaining sandbox client credentials from environment variables and classification */ export interface ResolveSandboxClientCredentialsOptions { /** * Environment object to read from. Defaults to process.env when available. @@ -141,6 +143,7 @@ function resolveDirectSandboxCredentials( return null } +/** Resolve sandbox client credentials based on environment and provided options asynchronously */ export async function resolveSandboxClientCredentials( options: ResolveSandboxClientCredentialsOptions = {}, ): Promise { @@ -178,6 +181,7 @@ export async function resolveSandboxClientCredentials( ) } +/** Define configuration parameters for sandbox resource allocation and lifecycle management */ export interface SandboxResourceConfig { image: string cpuCores: number @@ -187,6 +191,7 @@ export interface SandboxResourceConfig { idleTimeoutSeconds: number } +/** Define configuration options for resolving a provider and its model with optional API keys and routing details */ export interface ProviderResolutionConfig { routerBaseUrl?: string apiKey?: string @@ -204,6 +209,7 @@ export interface ProviderResolutionConfig { allowKeylessModel?: boolean } +/** Define the context for building a sandbox including workspace, integrations, and optional user ID */ export interface SandboxBuildContext { workspaceId: string connectedIntegrationIds: string[] @@ -215,17 +221,20 @@ export type { StorageConfig } // Scope handed to per-identity seams. workspaceId is always present; userId is // present when the lifecycle op carries one. Workspace-keyed products ignore userId. +/** Define a scope containing workspace and optional user identifiers for sandbox environments */ export interface SandboxScope { workspaceId: string userId?: string } // Snapshot RESTORE-on-create. Returned alongside storage; undefined => fresh box. +/** Define the specification for restoring a sandbox from a snapshot or another sandbox ID */ export interface SandboxRestoreSpec { fromSnapshot: string fromSandboxId: string } +/** Describe the failure details when resuming a stopped sandbox instance */ export interface StoppedSandboxResumeFailure { box: SandboxInstance error: Error @@ -233,6 +242,7 @@ export interface StoppedSandboxResumeFailure { boxKey: string } +/** Define the structure for resuming a stopped sandbox with replacement key and optional restore options */ export interface StoppedSandboxResumeRecovery { // Used for both the replacement sandbox name and idempotency key. replacementBoxKey: string @@ -243,12 +253,14 @@ export interface StoppedSandboxResumeRecovery { // Reuse health gate + sidecar liveness. The exec+timeout-race is generic; the // sidecarProcessPattern is harness-specific (which process is the live sidecar), // so it is a closure. Absent => no liveness probe (reuse on metadata.harness match). +/** Define configuration for liveness probes including sidecar process pattern and optional timeouts */ export interface LivenessProbeConfig { sidecarProcessPattern: (harness: Harness) => string execTimeoutMs?: number psTimeoutMs?: number } +/** Define options for composing a user profile including prompts, files, servers, and name */ export interface ProfileComposeOptions { systemPrompt?: string extraFiles?: AgentProfileFileMount[] @@ -256,6 +268,7 @@ export interface ProfileComposeOptions { name?: string } +/** Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions */ export interface SandboxRuntimeConfig { // Widened to accept an optional scope and be async so a per-user key can be // minted. The sync, no-arg form still satisfies the type (back-compat). @@ -316,6 +329,7 @@ export interface SandboxRuntimeConfig { deferProfileFiles?: boolean } +/** Define default resource limits and settings for sandbox environments */ export const DEFAULT_SANDBOX_RESOURCES: SandboxResourceConfig = { image: 'universal', cpuCores: 2, @@ -344,6 +358,7 @@ function getClientFromCreds(creds: SandboxClientCredentials): Sandbox { // Sync client for non-scoped callers (secretStoreFromClient etc.). Resolves // credentials with no scope; throws if the seam returns a Promise — scoped // products must use the async ensureWorkspaceSandbox path. +/** Resolve a synchronous sandbox client from provided runtime configuration credentials */ export function getClient(shell: SandboxRuntimeConfig): Sandbox { const creds = shell.credentials() if (creds && typeof (creds as Promise).then === 'function') { @@ -353,16 +368,19 @@ export function getClient(shell: SandboxRuntimeConfig): Sandbox { return getClientFromCreds(creds as SandboxClientCredentials) } +/** Reset the client cache to clear stored data and force fresh retrieval */ export function resetClientCache(): void { _cached = null } +/** Describe an application tool with its name, unique key, and description */ export interface AppToolDescriptor { tool: AppToolName key: string description: string } +/** Define options for building MCP server configurations in the app tool environment */ export interface BuildAppToolMcpServersOptions { tools: AppToolDescriptor[] baseUrl: string @@ -371,6 +389,7 @@ export interface BuildAppToolMcpServersOptions { headerNames?: ToolHeaderNames } +/** Build a mapping of MCP server profiles keyed by tool identifiers from provided options */ export function buildAppToolMcpServers( options: BuildAppToolMcpServersOptions, ): Record { @@ -388,6 +407,7 @@ export function buildAppToolMcpServers( return entries } +/** Define options for ensuring a workspace sandbox with provisioning and progress handling */ export interface EnsureWorkspaceSandboxOptions { workspaceId: string userId?: string @@ -414,18 +434,21 @@ function shellSingleQuote(value: string): string { return `'${value.replace(/'/g, `'\\''`)}'` } +/** Define the specification for a sandbox tool including its name, content, and optional executability */ export interface SandboxToolSpec { name: string content: string executable?: boolean } +/** Define options for resolving sandbox tool paths including appName, baseDir, and binDir */ export interface SandboxToolPathOptions { appName: string baseDir?: string binDir?: string } +/** Define options for building sandbox tool file mounts including tool specifications and paths */ export interface BuildSandboxToolFileMountsOptions extends SandboxToolPathOptions { tools: readonly SandboxToolSpec[] } @@ -449,6 +472,7 @@ function normalizeSandboxToolDir(value: string, label: string): string { return dir === '' ? '/' : dir } +/** Resolve the root directory path for a sandbox tool based on provided options */ export function sandboxToolRootDir(options: SandboxToolPathOptions): string { const appName = normalizeSandboxToolSegment(options.appName, 'sandbox tool appName') const baseDir = normalizeSandboxToolDir( @@ -458,17 +482,20 @@ export function sandboxToolRootDir(options: SandboxToolPathOptions): string { return `${baseDir}/${appName}` } +/** Resolve the binary directory path for a sandbox tool based on provided options */ export function sandboxToolBinDir(options: SandboxToolPathOptions): string { normalizeSandboxToolSegment(options.appName, 'sandbox tool appName') if (options.binDir) return normalizeSandboxToolDir(options.binDir, 'sandbox tool binDir') return `${sandboxToolRootDir(options)}/bin` } +/** Resolve the file system path to a specified sandbox tool based on given options */ export function sandboxToolPath(options: SandboxToolPathOptions & { toolName: string }): string { const toolName = normalizeSandboxToolSegment(options.toolName, 'sandbox tool name') return `${sandboxToolBinDir(options)}/${toolName}` } +/** Build file mounts for sandbox tools based on provided options and tool configurations */ export function buildSandboxToolFileMounts( options: BuildSandboxToolFileMountsOptions, ): AgentProfileFileMount[] { @@ -482,6 +509,7 @@ export function buildSandboxToolFileMounts( }) } +/** Build a shell script that sets up and exports the sandbox tool binary directory in user profiles */ export function buildSandboxToolPathSetupScript(options: SandboxToolPathOptions): string { const binDir = sandboxToolBinDir(options) const exportLine = `export PATH=${binDir}:$PATH` @@ -498,6 +526,7 @@ export function buildSandboxToolPathSetupScript(options: SandboxToolPathOptions) ].join('\n') } +/** Resolve the sandbox environment PATH setup by executing the configuration script with given options */ export async function runSandboxToolPathSetup( box: SandboxInstance, options: SandboxToolPathOptions, @@ -537,6 +566,7 @@ function shellPath(path: string): string { // written into a running box and the rest (non-inline refs that the // orchestrator must resolve, so they stay in the create payload). Returns the // inline set to defer and a profile copy with those inline files removed. +/** Split profile files into inline deferred files and a lean profile without them */ export function splitDeferredProfileFiles( profile: AgentProfile, ): { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[] } { @@ -741,6 +771,7 @@ function deferredProfileWriteFailed(stage: 'new' | 'reused' | 'resumed', name: s type ExistingBoxStage = 'reused' | 'resumed' +/** Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name */ export class SandboxRuntimeAuthRefreshError extends Error { constructor(stage: ExistingBoxStage, name: string, detail: string, cause?: unknown) { super(`${stage} sandbox auth refresh failed for ${name}: ${detail}`, { cause }) @@ -765,6 +796,7 @@ export class SandboxRuntimeAuthRefreshError extends Error { // exec-plane request can never park the caller (and thus never park provisioning). // A small pace between execs keeps the burst rate below the proxy throttle that // triggers the hang. +/** Define options to control execution timeout, pacing, and retry behavior when writing profile files */ export interface WriteProfileFilesOptions { // Hard ceiling per exec (ms). A hung/wedged exec is abandoned and retried. execTimeoutMs?: number @@ -809,6 +841,7 @@ function fileApiSupportsMode(box: SandboxInstance): boolean { return fs?.supportsWriteMode === true } +/** Write profile files to a sandbox with pacing, retries, and optional execution timeout handling */ export async function writeProfileFilesToBox( box: SandboxInstance, files: AgentProfileFileMount[], @@ -1477,6 +1510,7 @@ export async function peekWorkspaceSandbox( return { status: 'running', box: match } } +/** Resolve or create a workspace sandbox instance with optional reuse and progress tracking */ export async function ensureWorkspaceSandbox( shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions, @@ -1704,6 +1738,7 @@ export async function ensureWorkspaceSandbox( return box } +/** Represent a fully configured model with optional API key and base URL for sandbox platform integration */ export interface ResolvedModel { model: string provider: string @@ -1713,6 +1748,7 @@ export interface ResolvedModel { baseUrl?: string } +/** Resolve and return the appropriate model configuration based on provider settings and optional overrides */ export function resolveModel( config: ProviderResolutionConfig | undefined, override?: { model?: string; modelApiKey?: string }, @@ -1741,6 +1777,7 @@ export function resolveModel( // but the published package does not re-export the PromptInputPart type by name from // any of its entry points, so it's derived structurally off the method signature // itself — this stays in lockstep with the SDK's actual accepted shape. +/** Extract a single element type from the array parameter of SandboxInstance's streamPrompt method */ export type PromptInputPart = Extract< Parameters[0], readonly unknown[] @@ -1754,6 +1791,7 @@ function historyTranscript( .join('\n\n') } +/** Build a single string combining conversation history and the current user message */ export function flattenHistory( message: string, history?: Array<{ role: 'user' | 'assistant'; content: string }>, @@ -1782,6 +1820,7 @@ export function mergeHistoryIntoParts( return merged } +/** Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys */ export function mergeExtraMcp( appToolMcp: Record, baseProfileMcp: Record, @@ -1795,6 +1834,7 @@ export function mergeExtraMcp( return { ...appToolMcp, ...(extra ?? {}) } } +/** Attach a specified reasoning effort level to an agent profile for a given harness */ export function attachReasoningEffort( profile: AgentProfile, harness: Harness, @@ -1813,6 +1853,7 @@ export function attachReasoningEffort( } } +/** Define options for configuring and controlling a streaming sandbox prompt session */ export interface StreamSandboxPromptOptions { sessionId?: string executionId?: string @@ -1850,6 +1891,7 @@ export interface StreamSandboxPromptOptions { type StreamPromptOptions = Parameters[1] +/** Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options */ export async function* streamSandboxPrompt( shell: SandboxRuntimeConfig, box: SandboxInstance, @@ -1918,6 +1960,7 @@ export async function* streamSandboxPrompt( } } +/** Resolve a sandbox prompt by streaming and aggregating message parts into a complete string */ export async function runSandboxPrompt( shell: SandboxRuntimeConfig, box: SandboxInstance, @@ -1955,12 +1998,15 @@ export async function runSandboxPrompt( // @tangle-network/sandbox). The product's role-mapping seam must produce one of // these; binding the seam's return type to the union makes a wrong mapping a // compile error rather than a runtime 400 from the orchestrator. +/** Define permission levels for sandbox access and control */ export type SandboxPermissionLevel = 'owner' | 'admin' | 'developer' | 'viewer' +/** Map workspace roles to corresponding sandbox permission levels */ export interface MemberSyncSeam { roleToSandboxRole: (workspaceRole: string) => SandboxPermissionLevel } +/** Resolve adding a user with a specific role to a sandbox and return the operation outcome */ export async function syncSandboxMemberAdd( box: SandboxInstance, seam: MemberSyncSeam, @@ -1975,6 +2021,7 @@ export async function syncSandboxMemberAdd( } } +/** Remove a member from the sandbox while preserving their home directory and handle the outcome */ export async function syncSandboxMemberRemove( box: SandboxInstance, userId: string, @@ -1987,6 +2034,7 @@ export async function syncSandboxMemberRemove( } } +/** Synchronize a sandbox member's role by updating permissions based on the provided role mapping */ export async function syncSandboxMemberRole( box: SandboxInstance, seam: MemberSyncSeam, @@ -2001,6 +2049,7 @@ export async function syncSandboxMemberRole( } } +/** Define methods to create, update, retrieve, and delete secrets asynchronously */ export interface SecretStore { create: (name: string, value: string) => Promise update: (name: string, value: string) => Promise @@ -2008,6 +2057,7 @@ export interface SecretStore { delete: (name: string) => Promise } +/** Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell */ export function secretStoreFromClient(shell: SandboxRuntimeConfig): SecretStore { const client = getClient(shell) return { @@ -2024,6 +2074,7 @@ export function secretStoreFromClient(shell: SandboxRuntimeConfig): SecretStore } } +/** Resolve storing a secret by creating or updating it in the given SecretStore */ export async function storeSecret( store: SecretStore, name: string, @@ -2042,6 +2093,7 @@ export async function storeSecret( } } +/** Resolve a secret value from the store by its name and return the outcome asynchronously */ export async function readSecret(store: SecretStore, name: string): Promise> { try { return ok(await store.get(name)) @@ -2050,6 +2102,7 @@ export async function readSecret(store: SecretStore, name: string): Promise> { try { await store.delete(name) @@ -2059,6 +2112,7 @@ export async function deleteSecret(store: SecretStore, name: string): Promise | null { return v && typeof v === 'object' && !Array.isArray(v) ? (v as Record) : null } +/** Resolve the severed stream event to a corresponding sandbox step transition or null */ export function classifySeveredStream(event: unknown): SandboxStepTransition | null { const root = asPlainRecord(event) if (!root || root.type !== 'message.part.updated') return null @@ -2183,6 +2241,7 @@ export function classifySeveredStream(event: unknown): SandboxStepTransition | n return { kind: 'step-finish', reason, severed: SEVERED_FINISH_REASONS.has(reason) } } +/** Determine if an event is a terminal prompt event with type 'result' or 'done */ export function isTerminalPromptEvent(event: unknown): boolean { const t = asPlainRecord(event)?.type return t === 'result' || t === 'done' @@ -2190,6 +2249,7 @@ export function isTerminalPromptEvent(event: unknown): boolean { // Interactive-question detector. Returns the question text or null. Used by // streamSandboxPrompt when disallowQuestions is set. +/** Resolve the interactive question text from a structured event or return null if none found */ export function detectInteractiveQuestion(event: unknown): string | null { const root = asPlainRecord(event) if (!root) return null diff --git a/src/sandbox/outcome.ts b/src/sandbox/outcome.ts index a848891..4f23e1e 100644 --- a/src/sandbox/outcome.ts +++ b/src/sandbox/outcome.ts @@ -2,6 +2,7 @@ // leaf so both index.ts and terminal-proxy-token.ts import it instead of // re-declaring the type (index.ts re-exports * from terminal-proxy-token, so // the token module cannot import from index without a cycle). +/** Represent success or failure of an operation with corresponding value or error information */ export type Outcome = | { succeeded: true; value: T } | { succeeded: false; error: Error } diff --git a/src/sandbox/terminal-proxy-token.ts b/src/sandbox/terminal-proxy-token.ts index 13050cc..f560035 100644 --- a/src/sandbox/terminal-proxy-token.ts +++ b/src/sandbox/terminal-proxy-token.ts @@ -8,6 +8,7 @@ import { ok, fail, type Outcome } from './outcome' // Terminal-proxy HMAC token. Identity tuple is generic; the secret comes from a // closure (fail-loud if absent). +/** Define identity details for a terminal proxy including user, workspace, and sandbox identifiers */ export interface TerminalProxyIdentity { userId: string workspaceId: string @@ -16,6 +17,7 @@ export interface TerminalProxyIdentity { const TERMINAL_PROXY_TOKEN_TTL_MS = 15 * 60 * 1000 +/** Generate a signed token for TerminalProxyIdentity with an expiration based on TTL milliseconds */ export async function mintTerminalProxyToken( secret: string, identity: TerminalProxyIdentity, @@ -33,6 +35,7 @@ export async function mintTerminalProxyToken( return ok({ token: `${encoded}.${sig}`, expiresAt }) } +/** Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp */ export async function verifyTerminalProxyToken( secret: string, token: string, diff --git a/src/sandbox/workspace-terminal.ts b/src/sandbox/workspace-terminal.ts index c729dd7..ab3154e 100644 --- a/src/sandbox/workspace-terminal.ts +++ b/src/sandbox/workspace-terminal.ts @@ -5,6 +5,7 @@ import { type TerminalProxyIdentity, } from './terminal-proxy-token' +/** Define the shape of a workspace sandbox instance including its connection details and status */ export interface WorkspaceSandboxInstanceLike { id: string name?: string @@ -23,11 +24,13 @@ export interface WorkspaceSandboxInstanceLike { // concrete `ensureWorkspaceSandbox` in ./index, which is bound to the // @tangle-network/sandbox client). Kept as a public export — external // consumers compose it; removing it would be a breaking change. +/** Define the context containing workspace and user identifiers for sandbox environment operations */ export interface WorkspaceSandboxEnsureContext { workspaceId: string userId: string } +/** Define configuration options for managing and interacting with workspace sandboxes */ export interface WorkspaceSandboxManagerOptions { getClient: (ctx: WorkspaceSandboxEnsureContext) => Promise | TClient nameForWorkspace: (workspaceId: string, ctx: WorkspaceSandboxEnsureContext) => string @@ -45,6 +48,7 @@ export interface WorkspaceSandboxManagerOptions void } +/** Manage workspace sandboxes by ensuring their creation and retrieval for specified users */ export interface WorkspaceSandboxManager { ensureWorkspaceSandbox: ( workspaceId: string, @@ -53,6 +57,7 @@ export interface WorkspaceSandboxManager Promise } +/** Create a manager to handle workspace sandbox instances with client and options configuration */ export function createWorkspaceSandboxManager( opts: WorkspaceSandboxManagerOptions, ): WorkspaceSandboxManager { @@ -91,14 +96,17 @@ export function createWorkspaceSandboxManager number } +/** Resolve the identity type used for sandbox terminal token subjects */ export type SandboxTerminalTokenSubject = TerminalProxyIdentity +/** Provide token and expiration details for a sandbox terminal session */ export interface SandboxTerminalTokenResult { token: string expiresAt: Date @@ -113,6 +121,7 @@ const BEARER_SUBPROTOCOL_PREFIX = 'bearer.' // in-flight browser terminal sessions right after rollout. const LEGACY_TERMINAL_TOKEN_PREFIX = 'sbxt_' +/** Generate a sandbox terminal token for a given subject with specified options */ export async function createSandboxTerminalToken( subject: SandboxTerminalTokenSubject, opts: SandboxTerminalTokenOptions, @@ -128,6 +137,7 @@ export async function createSandboxTerminalToken( return minted.value } +/** Verify the validity of a sandbox terminal token against the expected identity and options */ export async function verifySandboxTerminalToken( token: string, expected: SandboxTerminalTokenSubject, @@ -142,10 +152,12 @@ export async function verifySandboxTerminalToken( return verifyTerminalProxyToken(secret ?? '', normalized, expected, now) } +/** Represent an authenticated user within a sandbox environment with a unique identifier */ export interface AuthenticatedSandboxUser { id: string } +/** Define options to handle workspace sandbox connections with user authentication and access control */ export interface WorkspaceSandboxConnectionHandlerOptions { requireUser: (request: Request) => Promise requireWorkspaceAccess: (args: { request: Request; userId: string; workspaceId: string }) => Promise @@ -156,6 +168,7 @@ export interface WorkspaceSandboxConnectionHandlerOptions( opts: WorkspaceSandboxConnectionHandlerOptions, ) { @@ -235,17 +249,20 @@ export function createWorkspaceSandboxConnectionHandler Promise requireWorkspaceAccess: (args: { request: Request; userId: string; workspaceId: string; sandboxId: string }) => Promise @@ -256,6 +273,7 @@ export interface WorkspaceSandboxRuntimeProxyHandlerOptions { forwardHeaders?: string[] } +/** Define arguments for proxying runtime requests within a workspace sandbox environment */ export interface WorkspaceSandboxRuntimeProxyArgs { request: Request params: { @@ -265,6 +283,7 @@ export interface WorkspaceSandboxRuntimeProxyArgs { } } +/** Create a proxy handler to resolve sandbox runtime requests with user and workspace access validation */ export function createWorkspaceSandboxRuntimeProxyHandler(opts: WorkspaceSandboxRuntimeProxyHandlerOptions) { return async function handleWorkspaceSandboxRuntimeProxy({ request, params }: WorkspaceSandboxRuntimeProxyArgs): Promise { const user = await opts.requireUser(request) @@ -348,6 +367,7 @@ export function createWorkspaceSandboxRuntimeProxyHandler(opts: WorkspaceSandbox const SANDBOX_TERMINAL_WS_PATHNAME = /^\/api\/workspaces\/([^/]+)\/sandbox\/runtime\/([^/]+)\/(terminals\/[^/]+\/ws)$/ +/** Define the structure for matching a sandbox terminal WebSocket with workspace and path details */ export interface SandboxTerminalWsMatch { workspaceId: string sandboxId: string @@ -383,6 +403,7 @@ export function isSandboxTerminalWsUpgrade(request: Request): boolean { } } +/** Define options to handle user authentication, workspace access, and sandbox API credential retrieval */ export interface WorkspaceSandboxTerminalUpgradeHandlerOptions { requireUser: (request: Request) => Promise requireWorkspaceAccess: (args: { request: Request; userId: string; workspaceId: string; sandboxId: string }) => Promise @@ -458,6 +479,7 @@ export function createWorkspaceSandboxTerminalUpgradeHandler(opts: WorkspaceSand const DEFAULT_RUNTIME_PROXY_HEADERS = ['accept', 'content-type', 'last-event-id', 'x-session-id'] +/** Build proxy headers for sandbox runtime including authorization and forwarded headers */ export function buildSandboxRuntimeProxyHeaders(source: Headers, sandboxApiKey: string, forwardHeaders = DEFAULT_RUNTIME_PROXY_HEADERS): Headers { const headers = new Headers() headers.set('Authorization', `Bearer ${sandboxApiKey}`) @@ -468,12 +490,14 @@ export function buildSandboxRuntimeProxyHeaders(source: Headers, sandboxApiKey: return headers } +/** Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments */ export function encodeSandboxRuntimePath(runtimePath: string): string | null { const segments = runtimePath.split('/') if (segments.some((segment) => !segment || segment === '.' || segment === '..')) return null return segments.map((segment) => encodeURIComponent(segment)).join('/') } +/** Extract the token from a bearer authorization string or return null if invalid or missing */ export function bearerToken(value: string | null): string | null { if (!value) return null const trimmed = value.trim() @@ -486,6 +510,7 @@ export function bearerToken(value: string | null): string | null { return trimmed } +/** Resolve and decode a bearer token from a comma-separated subprotocol string or return null */ export function bearerSubprotocolToken(value: string | null): string | null { if (!value) return null for (const part of value.split(',')) { @@ -503,6 +528,7 @@ export function bearerSubprotocolToken(value: string | null): string | null { return null } +/** Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields */ export function terminalTokenFromRequest(headers: Headers): string | null { return bearerToken(headers.get('Authorization')) ?? bearerSubprotocolToken(headers.get('Sec-WebSocket-Protocol')) } diff --git a/src/sequences-react/contracts.ts b/src/sequences-react/contracts.ts index a8494f5..10e17ce 100644 --- a/src/sequences-react/contracts.ts +++ b/src/sequences-react/contracts.ts @@ -42,6 +42,7 @@ export interface EditorTimelineState { scrollLeft: number } +/** Manage and track command execution with undo, redo, state subscription, and timeline reset capabilities */ export interface CommandStack { execute(command: TimelineCommand): void undo(): void @@ -68,11 +69,13 @@ export interface ZoomMath { maxZoom: number } +/** Define a point in a timeline where snapping occurs based on frame and kind */ export interface SnapPoint { frame: number kind: 'clip-start' | 'clip-end' | 'playhead' | 'sequence-end' } +/** Describe the result of snapping a point to a frame including success status and snapped point details */ export interface SnapResult { frame: number snapped: boolean @@ -120,6 +123,7 @@ export interface WaveformData { durationSeconds: number } +/** Represent a segment of transcription with text and start and end times in seconds */ export interface TranscriptionSegment { text: string startSeconds: number @@ -169,6 +173,7 @@ export interface TimelineEditorLabels { ghostCaptionLane?: string } +/** Define properties and callbacks for editing and applying operations on a sequence timeline */ export interface TimelineEditorProps { timeline: SequenceTimeline canWrite: boolean @@ -206,6 +211,7 @@ export interface TimelineEditorProps { className?: string } +/** Provide default labels and accessibility text for timeline editor UI elements */ export const DEFAULT_TIMELINE_LABELS: Required = { splitClip: 'Split here', splitClipAriaLabel: 'Split clip at playhead', diff --git a/src/sequences-react/engine/command-stack.ts b/src/sequences-react/engine/command-stack.ts index d5335b2..c18fe26 100644 --- a/src/sequences-react/engine/command-stack.ts +++ b/src/sequences-react/engine/command-stack.ts @@ -17,6 +17,7 @@ import type { CommandStack, EditorTimelineState, TimelineCommand } from '../cont /** Oldest entries are dropped past this bound; redo is cleared on execute. */ export const COMMAND_HISTORY_LIMIT = 200 +/** Create a command stack managing undo and redo operations for a given timeline */ export function createCommandStack(initial: SequenceTimeline): CommandStack { /** View fields start at their neutral values; the host layer owns volatile * view state and treats these as initials, not a live channel. */ diff --git a/src/sequences-react/engine/commands.ts b/src/sequences-react/engine/commands.ts index 0b385df..7a08101 100644 --- a/src/sequences-react/engine/commands.ts +++ b/src/sequences-react/engine/commands.ts @@ -99,6 +99,7 @@ function removeClip(state: EditorTimelineState, clipId: string, context: string) // move_clip // --------------------------------------------------------------------------- +/** Define input parameters to move a clip within a timeline including optional track and resolver */ export interface MoveClipInput { timeline: SequenceTimeline clipId: string @@ -145,6 +146,7 @@ export function moveClipCommand(input: MoveClipInput): TimelineCommand { // trim_clip // --------------------------------------------------------------------------- +/** Define input parameters for trimming a clip within a sequence timeline */ export interface TrimClipInput { timeline: SequenceTimeline clipId: string @@ -197,6 +199,7 @@ export function trimClipCommand(input: TrimClipInput): TimelineCommand { // place_clip // --------------------------------------------------------------------------- +/** Define input parameters required to place a clip within a sequence timeline */ export interface PlaceClipInput { timeline: SequenceTimeline /** Caller-minted optimistic id for the local clip (see module header). */ @@ -214,6 +217,7 @@ export interface PlaceClipInput { resolveClipId?: ClipIdResolver } +/** Resolve and validate clip placement parameters to create a timeline command */ export function placeClipCommand(input: PlaceClipInput): TimelineCommand { const context = 'place_clip' assertNewClipId(input.timeline, input.clipId, context) @@ -271,6 +275,7 @@ export function placeClipCommand(input: PlaceClipInput): TimelineCommand { // delete_clip // --------------------------------------------------------------------------- +/** Define input parameters required to delete a clip from a sequence timeline */ export interface DeleteClipInput { timeline: SequenceTimeline clipId: string @@ -336,6 +341,7 @@ export function deleteClipCommand(input: DeleteClipInput): TimelineCommand { // split_clip // --------------------------------------------------------------------------- +/** Define input parameters for splitting a clip at a specific frame within a timeline */ export interface SplitClipInput { timeline: SequenceTimeline clipId: string @@ -409,6 +415,7 @@ export function splitClipCommand(input: SplitClipInput): TimelineCommand { // add_caption // --------------------------------------------------------------------------- +/** Define input parameters for adding a caption clip to a sequence timeline */ export interface AddCaptionInput { timeline: SequenceTimeline /** Caller-minted optimistic id for the local caption clip. */ @@ -423,6 +430,7 @@ export interface AddCaptionInput { resolveClipId?: ClipIdResolver } +/** Resolve a command to add a caption to a specified caption track within a timeline */ export function addCaptionCommand(input: AddCaptionInput): TimelineCommand { const context = 'add_caption' assertNewClipId(input.timeline, input.clipId, context) @@ -477,6 +485,7 @@ export function addCaptionCommand(input: AddCaptionInput): TimelineCommand { // set_clip_text // --------------------------------------------------------------------------- +/** Define input parameters for setting text and optional language on a specific clip in a timeline */ export interface SetClipTextInput { timeline: SequenceTimeline clipId: string @@ -542,6 +551,7 @@ export function setClipTextCommand(input: SetClipTextInput): TimelineCommand { // set_clip_disabled (toggle) // --------------------------------------------------------------------------- +/** Define input parameters to toggle the disabled state of a clip within a timeline */ export interface ToggleClipDisabledInput { timeline: SequenceTimeline clipId: string diff --git a/src/sequences-react/engine/playback.ts b/src/sequences-react/engine/playback.ts index 99c4368..6cb97b2 100644 --- a/src/sequences-react/engine/playback.ts +++ b/src/sequences-react/engine/playback.ts @@ -11,6 +11,7 @@ import type { PlaybackClock } from '../contracts' +/** Define configuration settings for playback clock including frames per second and total duration frames */ export interface PlaybackClockConfig { fps: number durationFrames: number @@ -43,6 +44,7 @@ function now(): number { return perf.now() } +/** Create a playback clock that manages frame timing and playback state based on configuration */ export function createPlaybackClock(config: PlaybackClockConfig): PlaybackClock { if (!Number.isInteger(config.fps) || config.fps <= 0) { throw new Error(`fps must be a positive integer, got ${config.fps}`) diff --git a/src/sequences-react/engine/snap.ts b/src/sequences-react/engine/snap.ts index 616921f..23fca1f 100644 --- a/src/sequences-react/engine/snap.ts +++ b/src/sequences-react/engine/snap.ts @@ -30,6 +30,7 @@ export function collectSnapPoints(timeline: SequenceTimeline, playheadFrame: num return points.sort((a, b) => a.frame - b.frame || a.kind.localeCompare(b.kind)) } +/** Define options to configure snapping behavior including zoom, threshold, and exclusion criteria */ export interface ApplySnapOptions { /** Pixels per frame — converts the pixel threshold into frames. */ zoom: number diff --git a/src/sequences-react/engine/zoom.ts b/src/sequences-react/engine/zoom.ts index ab5b03c..b684321 100644 --- a/src/sequences-react/engine/zoom.ts +++ b/src/sequences-react/engine/zoom.ts @@ -7,11 +7,13 @@ import type { ZoomMath } from '../contracts' +/** Define configuration settings for minimum and maximum zoom levels */ export interface ZoomMathConfig { minZoom: number maxZoom: number } +/** Create a ZoomMath object that validates config and calculates zoom ratio within bounds */ export function createZoomMath(config: ZoomMathConfig): ZoomMath { const { minZoom, maxZoom } = config if (!Number.isFinite(minZoom) || minZoom <= 0) { diff --git a/src/sequences-react/media/frame-provider.ts b/src/sequences-react/media/frame-provider.ts index 621592c..9330e1b 100644 --- a/src/sequences-react/media/frame-provider.ts +++ b/src/sequences-react/media/frame-provider.ts @@ -11,6 +11,7 @@ import type { VideoFrameProvider } from '../contracts' +/** Define the default maximum number of media elements allowed in a collection */ export const DEFAULT_MAX_MEDIA_ELEMENTS = 4 /** Half a frame at 30fps. Seeks closer than this repaint the decoder's @@ -21,6 +22,7 @@ export const SEEK_TOLERANCE_SECONDS = 1 / 60 * the draw REJECTS rather than painting whatever frame happens to be up. */ export const SEEK_TIMEOUT_MS = 5_000 +/** Define a rectangular frame with position and size properties x, y, width, and height */ export interface FrameRect { x: number y: number @@ -52,6 +54,7 @@ export function containFitRect( } } +/** Determine if seeking is required based on the difference between current and target times */ export function needsSeek(currentTimeSeconds: number, targetSeconds: number): boolean { return Math.abs(currentTimeSeconds - targetSeconds) >= SEEK_TOLERANCE_SECONDS } @@ -60,12 +63,14 @@ export function needsSeek(currentTimeSeconds: number, targetSeconds: number): bo // LRU element pool // --------------------------------------------------------------------------- +/** Manage a leased element from a pool and release it to enable LRU eviction */ export interface PooledElementLease { element: T /** Unpins the element; idle elements become LRU-evictable. Idempotent. */ release(): void } +/** Manage a pool of media elements to acquire, check, count, and dispose resources efficiently */ export interface MediaElementPool { acquire(url: string): PooledElementLease has(url: string): boolean diff --git a/src/sequences-react/media/transcription.ts b/src/sequences-react/media/transcription.ts index e982801..c95783c 100644 --- a/src/sequences-react/media/transcription.ts +++ b/src/sequences-react/media/transcription.ts @@ -10,6 +10,7 @@ import type { TranscriptionProvider, TranscriptionSegment } from '../contracts' import type { AudioBufferLike } from './waveform' +/** Provide the default Whisper model identifier for ONNX community large v3 turbo */ export const DEFAULT_WHISPER_MODEL = 'onnx-community/whisper-large-v3-turbo' /** Whisper models are trained on 16 kHz mono — decoding through a 16 kHz @@ -24,6 +25,7 @@ interface WhisperChunk { timestamp: [number, number | null] } +/** Define the structure for transcribed text output with optional segmented chunks */ export interface WhisperOutput { text: string chunks?: WhisperChunk[] @@ -124,6 +126,7 @@ async function fetchMonoAudio(mediaUrl: string): Promise<{ samples: Float32Array return { samples: mixdownToMono(decoded), durationSeconds: decoded.duration } } +/** Create a Whisper-based transcription provider with optional model configuration */ export function createWhisperTranscriptionProvider(opts?: { model?: string }): TranscriptionProvider { const model = opts?.model ?? DEFAULT_WHISPER_MODEL let availability: boolean | null = null diff --git a/src/sequences/apply.ts b/src/sequences/apply.ts index e176748..9bfc28a 100644 --- a/src/sequences/apply.ts +++ b/src/sequences/apply.ts @@ -72,6 +72,7 @@ export async function applySequenceOperations( return results } +/** Apply a sequence operation to update the store and timeline asynchronously */ export async function applySequenceOperation( store: SequenceStore, timeline: SequenceTimeline, diff --git a/src/sequences/captions.ts b/src/sequences/captions.ts index cd7c471..732212f 100644 --- a/src/sequences/captions.ts +++ b/src/sequences/captions.ts @@ -33,6 +33,7 @@ export interface CaptionChunk { durationFrames: number } +/** Define options to configure caption chunk size, duration, and frame rate constraints */ export interface BuildCaptionChunksOptions { /** Upper bound on words per caption; segments split on word boundaries. */ maxWordsPerChunk?: number @@ -147,6 +148,7 @@ export function normalizeLanguageTag(tag: string): string { return normalized } +/** Define options to specify target languages and an optional source language for fan-out operations */ export interface LanguageFanoutOptions { languages: string[] /** Excluded from the plan (exact normalized match only — 'en' does not diff --git a/src/sequences/drizzle-store.ts b/src/sequences/drizzle-store.ts index cdadefe..0c022a3 100644 --- a/src/sequences/drizzle-store.ts +++ b/src/sequences/drizzle-store.ts @@ -54,6 +54,7 @@ export type SequenceDatabase = BaseSQLiteDatabase<'sync' | 'async', any, any> * of clip rows. Keyed by clip id; clips absent from the map carry no media. */ export type SequenceMediaResolver = (clipRows: SequenceClipRow[]) => Promise> +/** Define options for creating a Drizzle sequence store including database, tables, scope, and media resolver */ export interface CreateDrizzleSequenceStoreOptions { db: SequenceDatabase tables: SequenceTables @@ -63,6 +64,7 @@ export interface CreateDrizzleSequenceStoreOptions { const DEFAULT_LIST_LIMIT = 50 +/** Create a sequence store scoped to a specific sequence and workspace with database access and media resolution */ export function createDrizzleSequenceStore(options: CreateDrizzleSequenceStoreOptions): SequenceStore { const { db, tables, scope, resolveMedia } = options const { sequences, sequenceTracks, sequenceClips, sequenceDecisions, sequenceExports } = tables diff --git a/src/sequences/exports.ts b/src/sequences/exports.ts index 83ad9e8..895fc29 100644 --- a/src/sequences/exports.ts +++ b/src/sequences/exports.ts @@ -29,6 +29,7 @@ import { // Captions: SRT / WebVTT // --------------------------------------------------------------------------- +/** Define options to export captions filtered by an optional BCP-47 language tag */ export interface CaptionExportOptions { /** BCP-47 tag; matched case-insensitively against `clip.language`. Clips * with no language never match a language-scoped export. */ @@ -167,18 +168,21 @@ function frameToEdlTimecode(frame: number, fps: number): string { // OpenTimelineIO // --------------------------------------------------------------------------- +/** Represent a rational time value with a specific rate and numeric value for OTIO schema */ export interface OtioRationalTime { OTIO_SCHEMA: 'RationalTime.1' rate: number value: number } +/** Define a time range with a start time and duration using OtioRationalTime values */ export interface OtioTimeRange { OTIO_SCHEMA: 'TimeRange.1' start_time: OtioRationalTime duration: OtioRationalTime } +/** Define the structure for an external media reference with schema, URL, and optional time range */ export interface OtioExternalReference { OTIO_SCHEMA: 'ExternalReference.1' target_url: string @@ -186,16 +190,19 @@ export interface OtioExternalReference { available_range: OtioTimeRange | null } +/** Represent missing references in OTIO with a fixed schema identifier */ export interface OtioMissingReference { OTIO_SCHEMA: 'MissingReference.1' } +/** Define the structure for a gap element with schema, name, and source time range properties */ export interface OtioGap { OTIO_SCHEMA: 'Gap.1' name: string source_range: OtioTimeRange } +/** Define a clip object with metadata, source range, and media reference according to OTIO schema */ export interface OtioClip { OTIO_SCHEMA: 'Clip.2' name: string @@ -204,6 +211,7 @@ export interface OtioClip { metadata: Record } +/** Define a track containing video or audio clips with metadata and child elements */ export interface OtioTrack { OTIO_SCHEMA: 'Track.1' name: string @@ -212,12 +220,14 @@ export interface OtioTrack { children: Array } +/** Represent a stack container holding a named collection of OtioTrack children */ export interface OtioStack { OTIO_SCHEMA: 'Stack.1' name: string children: OtioTrack[] } +/** Define the structure of a timeline with metadata, tracks, and global start time in OTIO format */ export interface OtioTimeline { OTIO_SCHEMA: 'Timeline.1' name: string @@ -342,6 +352,7 @@ function timeRange(startValue: number, durationValue: number, rate: number): Oti // Contact-sheet manifest // --------------------------------------------------------------------------- +/** Describe a single entry in a contact sheet with timing and media source details */ export interface ContactSheetEntry { clipId: string trackId: string @@ -358,6 +369,7 @@ export interface ContactSheetEntry { mediaKind: SequenceMediaKind } +/** Define the structure for a contact sheet manifest including metadata and entries */ export interface ContactSheetManifest { sequenceId: string title: string diff --git a/src/sequences/mcp-entry.ts b/src/sequences/mcp-entry.ts index b9cead9..a8a9b61 100644 --- a/src/sequences/mcp-entry.ts +++ b/src/sequences/mcp-entry.ts @@ -10,9 +10,11 @@ import { buildScopedMcpServerEntry } from '../tools/mcp' import type { AppToolMcpServer, ScopedMcpServerEntryOptions } from '../tools/mcp' +/** Describe live timeline editor features for current video sequence including clip and caption management */ export const DEFAULT_SEQUENCES_MCP_DESCRIPTION = 'Live timeline editor for the current video sequence: read timeline state, place/move/trim/split clips, add captions, manage tracks, and queue exports. All times are seconds.' +/** Extend ScopedMcpServerEntryOptions to configure MCP server entry options for sequence building */ export type BuildSequencesMcpServerEntryOptions = ScopedMcpServerEntryOptions /** Build the `AgentProfileMcpServer`-shaped entry for the sequences channel. */ diff --git a/src/sequences/mcp-handler.ts b/src/sequences/mcp-handler.ts index 11c8930..c605ff3 100644 --- a/src/sequences/mcp-handler.ts +++ b/src/sequences/mcp-handler.ts @@ -28,11 +28,13 @@ import type { McpToolDefinition } from '../tools/mcp-rpc' * name to keep the public surface stable without a second source of truth. */ export { MCP_PROTOCOL_VERSIONS as SEQUENCES_MCP_PROTOCOL_VERSIONS } from '../tools/mcp-rpc' +/** Describe server information including name and version for Sequences MCP integration */ export interface SequencesMcpServerInfo { name: string version: string } +/** Define options for creating sequences MCP handler including store, playhead frame, and server info */ export interface CreateSequencesMcpHandlerOptions { /** Already scoped + authorized for one (workspace, sequence, actor). */ store: SequenceStore @@ -42,6 +44,7 @@ export interface CreateSequencesMcpHandlerOptions { serverInfo?: SequencesMcpServerInfo } +/** Create a handler to process MCP sequence requests with optional playhead frame and server info */ export function createSequencesMcpHandler( opts: CreateSequencesMcpHandlerOptions, ): (request: Request) => Promise { diff --git a/src/sequences/mcp-tools.ts b/src/sequences/mcp-tools.ts index e40c96b..39369e5 100644 --- a/src/sequences/mcp-tools.ts +++ b/src/sequences/mcp-tools.ts @@ -51,6 +51,7 @@ export interface SequenceMcpToolEnv { playheadFrame: number } +/** Define a tool with metadata and a run method for processing input within a specific environment */ export interface SequenceMcpToolDefinition { name: string description: string @@ -62,10 +63,13 @@ export interface SequenceMcpToolDefinition { // Enumerations (value-level twins of the model's type unions) // --------------------------------------------------------------------------- +/** Define supported export formats for sequence outputs including video, subtitle, and metadata types */ export const SEQUENCE_EXPORT_FORMATS = ['mp4', 'otio', 'xml', 'edl', 'vtt', 'srt', 'contact_sheet'] as const satisfies readonly SequenceExportFormat[] +/** Define immutable sequence track kinds for video, audio, caption, reference, and agent */ export const SEQUENCE_TRACK_KINDS = ['video', 'audio', 'caption', 'reference', 'agent'] as const satisfies readonly SequenceTrackKind[] +/** Define the allowed media kinds for sequences including video, image, and audio */ export const SEQUENCE_MEDIA_KINDS = ['video', 'image', 'audio'] as const satisfies readonly SequenceMediaKind[] /** Largest accepted `add_captions` batch — bounds one decision row / one @@ -361,6 +365,7 @@ const CLIP_ID_SCHEMA = { type: 'string', description: 'Clip id from get_timeline // The registry // --------------------------------------------------------------------------- +/** Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations */ export const SEQUENCE_MCP_TOOLS: readonly SequenceMcpToolDefinition[] = [ { name: 'get_timeline_state', @@ -780,6 +785,7 @@ export const SEQUENCE_MCP_TOOLS: readonly SequenceMcpToolDefinition[] = [ }, ] +/** Resolve the SequenceMcpToolDefinition matching the given name or return undefined */ export function findSequenceMcpTool(name: string): SequenceMcpToolDefinition | undefined { return SEQUENCE_MCP_TOOLS.find((tool) => tool.name === name) } diff --git a/src/sequences/model.ts b/src/sequences/model.ts index bb7c023..873b6ec 100644 --- a/src/sequences/model.ts +++ b/src/sequences/model.ts @@ -18,14 +18,19 @@ export const MIN_SEQUENCE_CLIP_FRAMES = 1 * agent-decision lane rendered as markers, never as media. */ export type SequenceTrackKind = 'video' | 'audio' | 'caption' | 'reference' | 'agent' +/** Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived */ export type SequenceStatus = 'draft' | 'active' | 'exporting' | 'archived' +/** Define export formats available for sequence data including video, subtitle, and metadata types */ export type SequenceExportFormat = 'mp4' | 'otio' | 'xml' | 'edl' | 'vtt' | 'srt' | 'contact_sheet' +/** Represent export status of a sequence as queued, processing, completed, failed, or cancelled */ export type SequenceExportStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'cancelled' +/** Define media types allowed in a sequence including video, image, and audio */ export type SequenceMediaKind = 'video' | 'image' | 'audio' +/** Describe metadata and properties of a media sequence including dimensions, duration, and status */ export interface SequenceMeta { id: string title: string @@ -38,6 +43,7 @@ export interface SequenceMeta { metadata: Record } +/** Define properties and state for a sequence track including id, kind, name, order, and flags */ export interface SequenceTrack { id: string kind: SequenceTrackKind @@ -60,6 +66,7 @@ export interface SequenceClipMedia { providerStatus?: 'queued' | 'processing' | 'completed' | 'failed' } +/** Define properties for a media sequence clip including timing, source, track, and caption details */ export interface SequenceClip { id: string trackId: string @@ -97,6 +104,7 @@ export interface SequenceDecision { createdAt: Date } +/** Describe a record representing the export details and status of a sequence */ export interface SequenceExportRecord { id: string format: SequenceExportFormat @@ -129,18 +137,21 @@ export interface SequenceFrameSnapshot { // Frame math // --------------------------------------------------------------------------- +/** Convert seconds to the nearest whole number of frames based on frames per second */ export function secondsToFrames(seconds: number, fps: number): number { if (!Number.isFinite(seconds) || seconds < 0) throw new Error('seconds must be a non-negative finite number') assertFps(fps) return Math.round(seconds * fps) } +/** Convert a frame count to seconds based on the given frames per second rate */ export function framesToSeconds(frames: number, fps: number): number { if (!Number.isInteger(frames) || frames < 0) throw new Error('frames must be a non-negative integer') assertFps(fps) return frames / fps } +/** Format a number of seconds into a string with integer or two-decimal precision suffix s */ export function formatSeconds(seconds: number): string { return Number.isInteger(seconds) ? `${seconds}s` : `${seconds.toFixed(2)}s` } @@ -156,16 +167,19 @@ export function formatTimecode(frames: number, fps: number): string { return `${minutes}:${String(seconds).padStart(2, '0')}.${String(residualFrames).padStart(2, '0')}` } +/** Define the start frame and duration in frames for a timeline clip's bounds */ export interface TimelineClipBounds { startFrame: number durationFrames: number } +/** Define a time range with inclusive start and end frame numbers */ export interface TimelineInterval { startFrame: number endFrame: number } +/** Clamp the clip start frame within the valid range of the sequence duration and clip length */ export function clampClipStart(input: { startFrame: number durationFrames: number @@ -176,6 +190,7 @@ export function clampClipStart(input: { return Math.max(0, Math.min(input.sequenceDurationFrames - input.durationFrames, input.startFrame)) } +/** Clamp clip duration to fit within sequence bounds and minimum length constraints */ export function clampClipDuration(input: { startFrame: number durationFrames: number @@ -188,6 +203,7 @@ export function clampClipDuration(input: { return Math.max(MIN_SEQUENCE_CLIP_FRAMES, Math.min(input.durationFrames, input.sequenceDurationFrames - input.startFrame)) } +/** Validate that a clip's start and duration fit within the sequence duration without overflow */ export function assertClipFitsSequence(input: { startFrame: number durationFrames: number diff --git a/src/sequences/operations.ts b/src/sequences/operations.ts index 1558f44..749c994 100644 --- a/src/sequences/operations.ts +++ b/src/sequences/operations.ts @@ -14,6 +14,7 @@ import type { SequenceExportFormat, SequenceTrackKind } from './model' +/** Define an operation to place a media clip with timing, track, and playback options */ export interface PlaceClipOperation { type: 'place_clip' /** Omitted → first unlocked track matching the media kind. */ @@ -35,6 +36,7 @@ export interface PlaceClipOperation { metadata?: Record } +/** Add a caption with optional language, timing, and track placement details */ export interface AddCaptionOperation { type: 'add_caption' text: string @@ -48,6 +50,7 @@ export interface AddCaptionOperation { trackId?: string } +/** Resolve an operation to move a clip to a new start frame and optional track */ export interface MoveClipOperation { type: 'move_clip' clipId: string @@ -55,6 +58,7 @@ export interface MoveClipOperation { trackId?: string } +/** Define an operation to trim a clip by adjusting its start, duration, and optional source in/out points */ export interface TrimClipOperation { type: 'trim_clip' clipId: string @@ -69,6 +73,7 @@ export interface TrimClipOperation { sourceOutFrame?: number | null } +/** Split a clip at a specified frame inside the clip to create two separate segments */ export interface SplitClipOperation { type: 'split_clip' clipId: string @@ -76,6 +81,7 @@ export interface SplitClipOperation { atFrame: number } +/** Resolve an operation to set clipboard text with optional language and clip identifier */ export interface SetClipTextOperation { type: 'set_clip_text' clipId: string @@ -83,34 +89,40 @@ export interface SetClipTextOperation { language?: string } +/** Define an operation to enable or disable a clip by its identifier */ export interface SetClipDisabledOperation { type: 'set_clip_disabled' clipId: string disabled: boolean } +/** Represent a delete clip operation with a specified clip identifier */ export interface DeleteClipOperation { type: 'delete_clip' clipId: string } +/** Define an operation to create a new sequence track with a specified kind and name */ export interface CreateTrackOperation { type: 'create_track' kind: SequenceTrackKind name: string } +/** Define an operation to extend a sequence by a specified number of frames */ export interface ExtendSequenceOperation { type: 'extend_sequence' durationFrames: number } +/** Define the structure for a queue export operation with format and optional metadata */ export interface QueueExportOperation { type: 'queue_export' format: SequenceExportFormat metadata?: Record } +/** Represent sequence editing actions for manipulating clips, tracks, captions, and exports */ export type SequenceOperation = | PlaceClipOperation | AddCaptionOperation @@ -131,8 +143,10 @@ export interface SequencePlan { operations: SequenceOperation[] } +/** Extract the type of operation from a sequence operation object */ export type SequenceOperationType = SequenceOperation['type'] +/** List all valid sequence operation types used in editing workflows */ export const SEQUENCE_OPERATION_TYPES: readonly SequenceOperationType[] = [ 'place_clip', 'add_caption', diff --git a/src/sequences/schema.ts b/src/sequences/schema.ts index c2af318..9670720 100644 --- a/src/sequences/schema.ts +++ b/src/sequences/schema.ts @@ -22,6 +22,7 @@ import type { AnySQLiteColumn, AnySQLiteTable } from 'drizzle-orm/sqlite-core' /** A product table referenced by FK — only the `id` column is touched. */ export type SequenceParentTable = AnySQLiteTable & { id: AnySQLiteColumn } +/** Define options for creating sequence-related database tables including workspace and user tables */ export interface CreateSequenceTablesOptions { workspaceTable: SequenceParentTable userTable: SequenceParentTable @@ -37,6 +38,7 @@ const createdAt = () => integer('created_at', { mode: 'timestamp' }).notNull().d const updatedAt = () => integer('updated_at', { mode: 'timestamp' }).notNull().default(sql`(unixepoch())`) +/** Build SQLite sequence tables with defined columns and relationships based on provided options */ export function createSequenceTables(opts: CreateSequenceTablesOptions) { const { workspaceTable, userTable, generationTable, assetTable } = opts @@ -142,10 +144,16 @@ export function createSequenceTables(opts: CreateSequenceTablesOptions) { return { sequences, sequenceTracks, sequenceClips, sequenceDecisions, sequenceExports } } +/** Resolve sequence tables by invoking the createSequenceTables factory function */ export type SequenceTables = ReturnType +/** Resolve a sequence row by inferring the selected fields from the sequences table */ export type SequenceRow = SequenceTables['sequences']['$inferSelect'] +/** Resolve the selected sequence track row from the sequenceTracks table */ export type SequenceTrackRow = SequenceTables['sequenceTracks']['$inferSelect'] +/** Resolve the selected fields of sequence clips from the sequence tables data structure */ export type SequenceClipRow = SequenceTables['sequenceClips']['$inferSelect'] +/** Resolve a sequence decision row from the sequenceDecisions table data */ export type SequenceDecisionRow = SequenceTables['sequenceDecisions']['$inferSelect'] +/** Resolve a row type representing exported sequence data from sequenceExports table */ export type SequenceExportRow = SequenceTables['sequenceExports']['$inferSelect'] diff --git a/src/sequences/store.ts b/src/sequences/store.ts index 709b868..419e369 100644 --- a/src/sequences/store.ts +++ b/src/sequences/store.ts @@ -24,12 +24,14 @@ import type { SequenceTrackKind, } from './model' +/** Define properties for a new sequence track including kind, name, and optional sort order */ export interface NewSequenceTrack { kind: SequenceTrackKind name: string sortOrder?: number } +/** Define properties for a new sequence clip including timing, labels, and optional metadata */ export interface NewSequenceClip { trackId: string label: string @@ -44,6 +46,7 @@ export interface NewSequenceClip { metadata?: Record } +/** Define optional properties to update or patch a sequence clip's attributes in a timeline */ export interface SequenceClipPatch { trackId?: string label?: string @@ -57,6 +60,7 @@ export interface SequenceClipPatch { metadata?: Record } +/** Define the structure for a new sequence decision with optional metadata and acceptance status */ export interface NewSequenceDecision { clipId?: string | null kind: SequenceDecision['kind'] @@ -66,6 +70,7 @@ export interface NewSequenceDecision { metadata?: Record } +/** Manage sequences by providing methods to get timelines, clips, and modify tracks and clips */ export interface SequenceStore { /** Full aggregate: sequence meta + tracks + clips with resolved media. */ getTimeline(): Promise diff --git a/src/sequences/validate.ts b/src/sequences/validate.ts index 1a15ab2..4cc62c7 100644 --- a/src/sequences/validate.ts +++ b/src/sequences/validate.ts @@ -79,6 +79,7 @@ const MEDIA_KINDS: Record = { * without shipping a full registry. */ const LANGUAGE_TAG = /^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$/ +/** Validate each operation in a sequence against the timeline and context, throwing detailed errors on failure */ export function validateSequenceOperations( timeline: SequenceTimeline, operations: SequenceOperation[], @@ -95,6 +96,7 @@ export function validateSequenceOperations( }) } +/** Validate a sequence operation against the timeline and context to ensure correctness */ export function validateSequenceOperation( timeline: SequenceTimeline, operation: SequenceOperation, @@ -132,6 +134,7 @@ export function validateSequenceOperation( } } +/** Validate the properties and constraints of a PlaceClipOperation within a SequenceTimeline */ export function validatePlaceClip(timeline: SequenceTimeline, operation: PlaceClipOperation): void { if (operation.label.trim().length === 0) throw new Error('label must be non-empty') if (operation.media) { @@ -148,6 +151,7 @@ export function validatePlaceClip(timeline: SequenceTimeline, operation: PlaceCl resolvePlaceClipTrack(timeline, operation) } +/** Validate the parameters and context of an AddCaptionOperation within a sequence timeline */ export function validateAddCaption( timeline: SequenceTimeline, operation: AddCaptionOperation, @@ -169,6 +173,7 @@ export function validateAddCaption( } } +/** Validate that a clip move operation is within bounds and targets a compatible unlocked track */ export function validateMoveClip(timeline: SequenceTimeline, operation: MoveClipOperation): void { const { clip, track } = requireMutableClip(timeline, operation.clipId) assertOperationBounds(timeline, { startFrame: operation.startFrame, durationFrames: clip.durationFrames }) @@ -181,6 +186,7 @@ export function validateMoveClip(timeline: SequenceTimeline, operation: MoveClip } } +/** Validate that a trim clip operation respects timeline bounds and source frame constraints */ export function validateTrimClip(timeline: SequenceTimeline, operation: TrimClipOperation): void { const { clip } = requireMutableClip(timeline, operation.clipId) if (operation.sourceInFrame !== undefined) assertSourceInFrame(operation.sourceInFrame) @@ -194,6 +200,7 @@ export function validateTrimClip(timeline: SequenceTimeline, operation: TrimClip assertSourceWindow(sourceInFrame, sourceOutFrame, operation.durationFrames) } +/** Validate that a split operation on a clip is within valid frame boundaries and conditions */ export function validateSplitClip(timeline: SequenceTimeline, operation: SplitClipOperation): void { const { clip } = requireMutableClip(timeline, operation.clipId) if (!Number.isInteger(operation.atFrame)) throw new Error('atFrame must be an integer') @@ -208,6 +215,7 @@ export function validateSplitClip(timeline: SequenceTimeline, operation: SplitCl } } +/** Validate that a SetClipTextOperation targets a caption clip with non-empty text and valid language tag */ export function validateSetClipText(timeline: SequenceTimeline, operation: SetClipTextOperation): void { const { track } = requireMutableClip(timeline, operation.clipId) if (track.kind !== 'caption') { @@ -219,19 +227,23 @@ export function validateSetClipText(timeline: SequenceTimeline, operation: SetCl if (operation.language !== undefined) assertLanguageTag(operation.language) } +/** Validate that the clip can be disabled within the given timeline and operation constraints */ export function validateSetClipDisabled(timeline: SequenceTimeline, operation: SetClipDisabledOperation): void { requireMutableClip(timeline, operation.clipId) } +/** Validate that the clip to delete exists and is mutable in the given timeline */ export function validateDeleteClip(timeline: SequenceTimeline, operation: DeleteClipOperation): void { requireMutableClip(timeline, operation.clipId) } +/** Validate that a CreateTrackOperation has a supported kind and a non-empty name */ export function validateCreateTrack(operation: CreateTrackOperation): void { if (!(operation.kind in TRACK_KINDS)) throw new Error(`unsupported track kind ${JSON.stringify(operation.kind)}`) if (operation.name.trim().length === 0) throw new Error('name must be non-empty') } +/** Validate that the extend sequence operation has a positive duration and exceeds the last clip end frame */ export function validateExtendSequence(timeline: SequenceTimeline, operation: ExtendSequenceOperation): void { if (!Number.isInteger(operation.durationFrames) || operation.durationFrames <= 0) { throw new Error('durationFrames must be a positive integer') @@ -242,6 +254,7 @@ export function validateExtendSequence(timeline: SequenceTimeline, operation: Ex } } +/** Validate that the queue export operation uses a supported export format */ export function validateQueueExport(operation: QueueExportOperation): void { if (!(operation.format in EXPORT_FORMATS)) { throw new Error(`unsupported export format ${JSON.stringify(operation.format)}`) @@ -429,6 +442,7 @@ function describeJsonValue(value: unknown): string { // Resolution helpers — shared with ./apply // --------------------------------------------------------------------------- +/** Resolve caption target by specifying an existing track or creating a new one with language and name */ export type CaptionTargetResolution = | { kind: 'existing'; track: SequenceTrack } | { kind: 'create'; language: string; name: string } diff --git a/src/store/index.ts b/src/store/index.ts index b97f1c9..44b1b7b 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -28,6 +28,7 @@ export interface DatabaseProvider { reset(): void } +/** Define options for configuring database provider behavior including error messaging */ export interface DatabaseProviderOptions { /** Error thrown when `db` is accessed before injection. Keep the product's * existing wording so callers see a familiar message. */ @@ -80,23 +81,27 @@ export function createDatabaseProvider( // `KVNamespace` satisfies it structurally, so prod passes the binding unchanged, // and `createInMemoryKV()` supplies the portable adapter for sandbox/eval. +/** Describe the result of listing keys with completion status and optional pagination cursor */ export interface KVListResult { keys: { name: string }[] list_complete: boolean cursor?: string } +/** Define options for storing a key-value pair with expiration and metadata settings */ export interface KVPutOptions { expiration?: number expirationTtl?: number metadata?: unknown } +/** Resolve a key-value pair retrieval including its associated metadata and value */ export interface KVGetWithMetadataResult { value: string | null metadata: unknown | null } +/** Define a key-value store interface for asynchronous data retrieval, storage, deletion, and listing */ export interface KVStore { get(key: string): Promise /** Read a value with its stored metadata (e.g. the vault's encrypted/hasPII flags). */ diff --git a/src/stream/stream-normalizer.ts b/src/stream/stream-normalizer.ts index 6d96001..971544d 100644 --- a/src/stream/stream-normalizer.ts +++ b/src/stream/stream-normalizer.ts @@ -11,23 +11,28 @@ import { type ChatPlanStatus, } from '../plans/index' +/** Represent a JSON-compatible object with string keys and values of any type */ export type JsonRecord = Record +/** Define an event object carrying a type and optional JSON data payload */ export interface StreamEvent { type: string data?: JsonRecord } +/** Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined */ export function asRecord(value: unknown): JsonRecord | undefined { return value && typeof value === 'object' && !Array.isArray(value) ? value as JsonRecord : undefined } +/** Resolve a non-empty string from a value or return undefined */ export function asString(value: unknown): string | undefined { return typeof value === 'string' && value.length > 0 ? value : undefined } +/** Resolve a unique tool identifier from various possible properties or generate a fallback ID */ export function resolveToolId(part: JsonRecord): string { return String( part.id ?? @@ -41,10 +46,12 @@ export function resolveToolId(part: JsonRecord): string { ) } +/** Resolve the tool name from a JSON record using tool, name, or a default value */ export function resolveToolName(part: JsonRecord): string { return String(part.tool ?? part.name ?? 'tool') } +/** Resolve time properties from various keys into a normalized record with numeric start and end fields */ export function normalizeTime(value: unknown): JsonRecord | undefined { const record = asRecord(value) if (!record) return undefined @@ -59,6 +66,7 @@ export function normalizeTime(value: unknown): JsonRecord | undefined { } } +/** Normalize tool-related events into a standardized message.part.updated format */ export function normalizeToolEvent(event: StreamEvent): StreamEvent { if (event.type === 'tool_call' || event.type === 'tool.call') { const data = event.data ?? {} @@ -97,6 +105,7 @@ export function normalizeToolEvent(event: StreamEvent): StreamEvent { return event } +/** Normalize a persisted part object by standardizing its structure and fields */ export function normalizePersistedPart(rawPart: JsonRecord): JsonRecord | null { const type = String(rawPart.type ?? '') @@ -225,6 +234,7 @@ export function attachmentPartKey(path: string): string { return `attachment:${path}` } +/** Resolve a unique key string for a part based on its type and identifying properties */ export function getPartKey(part: JsonRecord): string { const type = String(part.type ?? 'unknown') if (type === 'tool') { @@ -251,6 +261,7 @@ function overlayDefined(base: JsonRecord, patch: JsonRecord): JsonRecord { return out } +/** Merge incoming JSON with existing persisted data, applying delta for text types when provided */ export function mergePersistedPart(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string): JsonRecord { const type = String(incoming.type ?? '') if (!existing) { @@ -346,7 +357,9 @@ export function mergePersistedPart(existing: JsonRecord | undefined, incoming: J return incoming } +/** Resolve errors when a tool fails to report a terminal result before the assistant turn ends */ export const MISSING_TOOL_TERMINAL_ERROR = 'Tool did not report a terminal result before the assistant turn completed.' +/** Provide the reason identifier for a missing tool in the terminal environment */ export const MISSING_TOOL_TERMINAL_REASON = 'missing-tool-terminal' /** Closes a tool part left `running` when a stream ended abnormally: settles @@ -375,6 +388,7 @@ export function terminalizeDanglingToolPart(part: JsonRecord): JsonRecord { } } +/** Resolve dangling tool parts into terminal forms within the given JSON records array */ export function terminalizeDanglingToolParts(parts: JsonRecord[]): JsonRecord[] { return parts.map(terminalizeDanglingToolPart) } @@ -472,6 +486,7 @@ function assembleAssistantParts( .map((part) => (part === lastTextPart ? { ...part, text: finalText } : part)) } +/** Resolve and clean up assistant parts by terminalizing and collapsing redundant segments */ export function finalizeAssistantParts( partOrder: string[], partMap: Map, @@ -515,6 +530,7 @@ export function terminalizeDanglingAssistantToolUpdates( return updates } +/** Encode a StreamEvent object into a Uint8Array using the provided TextEncoder */ export function encodeEvent(encoder: TextEncoder, event: StreamEvent): Uint8Array { return encoder.encode(`${JSON.stringify(event)}\n`) } diff --git a/src/stream/turn-buffer.ts b/src/stream/turn-buffer.ts index ee1e40a..126aebc 100644 --- a/src/stream/turn-buffer.ts +++ b/src/stream/turn-buffer.ts @@ -18,12 +18,14 @@ export type TurnStatus = 'running' | 'complete' | 'error' +/** Represent a buffered turn event with a sequence number and serialized event data */ export interface BufferedTurnEvent { seq: number /** The serialized event line (JSON string, no trailing newline). */ event: string } +/** Manage and query turn events and their lifecycle statuses within a scoped event store */ export interface TurnEventStore { append(turnId: string, events: BufferedTurnEvent[]): Promise read(turnId: string, fromSeq: number): Promise @@ -119,6 +121,7 @@ export function coalesceChatStreamEvents(events: unknown[]): unknown[] { // ── buffering core (the tap) ──────────────────────────────────────────────── +/** Define options for buffering and flushing turn events with optional live client delivery and event coalescing */ export interface BufferedTurnOptions { store: TurnEventStore turnId: string @@ -218,6 +221,7 @@ export function createBufferedTurnTap(opts: BufferedTurnOptions): BufferedTurnTa // ── pump (producer side) ────────────────────────────────────────────────── +/** Define options to pump data from an asynchronous iterable source with buffered turn control */ export interface PumpBufferedTurnOptions extends BufferedTurnOptions { source: AsyncIterable } @@ -243,6 +247,7 @@ export async function pumpBufferedTurn(opts: PumpBufferedTurnOptions): Promise> | null } +/** Represent a chat turn with resolved user message insertion and prior message context */ export interface ResolvedChatTurn { turnIndex: number shouldInsertUserMessage: boolean @@ -14,6 +16,7 @@ export interface ResolvedChatTurn { userParts: JsonRecord[] } +/** Normalize and validate a client turn ID string ensuring it meets format and length requirements */ export function normalizeClientTurnId(value: unknown): string | undefined { if (value === undefined || value === null) return undefined if (typeof value !== 'string') throw new Error('turnId must be a string') @@ -26,12 +29,14 @@ export function normalizeClientTurnId(value: unknown): string | undefined { return trimmed } +/** Build an array of text parts with optional turn ID for user input */ export function buildUserTextParts(text: string, turnId: string | undefined): JsonRecord[] { const part: JsonRecord = { type: 'text', text } if (turnId) part.turnId = turnId return [part] } +/** Resolve whether a message contains any part with the specified turn ID */ export function messageHasTurnId(message: PersistedChatMessageForTurn, turnId: string): boolean { for (const part of message.parts ?? []) { if (part && typeof part === 'object' && String(part.turnId ?? '') === turnId) { @@ -41,6 +46,7 @@ export function messageHasTurnId(message: PersistedChatMessageForTurn, turnId: s return false } +/** Resolve a chat turn by determining message reuse and constructing user message parts */ export function resolveChatTurn(input: { existingMessages: PersistedChatMessageForTurn[] userContent: string diff --git a/src/studio-react/type-config.ts b/src/studio-react/type-config.ts index 1c3c4a6..4c442cb 100644 --- a/src/studio-react/type-config.ts +++ b/src/studio-react/type-config.ts @@ -1,5 +1,6 @@ import { Film, FileText, Image, Mic, Video } from 'lucide-react' +/** Define configuration options for a type including label, icon, and color properties */ export interface TypeConfig { label: string icon: typeof Image @@ -9,6 +10,7 @@ export interface TypeConfig { const IMAGE: TypeConfig = { label: 'Image', icon: Image, color: 'bg-blue-500/10 text-blue-600 border-blue-500/20' } // string-keyed so list cards can index by Generation.type +/** Map type keys to their corresponding configuration objects including labels, icons, and colors */ export const TYPE_CONFIG: Record = { image: IMAGE, video: { label: 'Video', icon: Video, color: 'bg-red-500/10 text-red-600 border-red-500/20' }, @@ -20,6 +22,7 @@ export const TYPE_CONFIG: Record = { // Safe lookup for an arbitrary `Generation.type` — always defined (the table is // declared `Record`, so a raw index is `T | undefined`). Falls back // to the image config, matching the prior `?? TYPE_CONFIG.image` call sites. +/** Resolve the configuration object for a given type or return the default image configuration */ export function typeConfigFor(type: string): TypeConfig { return TYPE_CONFIG[type] ?? IMAGE } diff --git a/src/studio/generation.ts b/src/studio/generation.ts index cf651bd..48d3b66 100644 --- a/src/studio/generation.ts +++ b/src/studio/generation.ts @@ -4,18 +4,23 @@ // design-system package. A sandbox-ui `IntegrationConnection` is assignable to // this; `connectorId` is optional because the engine type leaves it undefined // for connections established without a named connector. +/** Define the structure for a studio integration connection with status and provider identifiers */ export interface StudioIntegrationConnection { status: string providerId: string connectorId?: string } +/** Define generation categories for media including image, video, speech, avatar, and transcription */ export type GenerationType = 'image' | 'video' | 'speech' | 'avatar' | 'transcription' +/** Define possible states representing the progress of a generation process */ export type GenerationStatus = 'pending' | 'running' | 'succeeded' | 'failed' +/** Define possible status values for a media model's availability and accessibility */ export type MediaModelStatus = 'available' | 'limited' | 'unavailable' +/** Define the structure for a generation entity including its metadata and creation details */ export interface Generation { id: string type: string @@ -27,6 +32,7 @@ export interface Generation { metadata: Record | null } +/** Describe media model option properties including id, name, type, status, and optional provider and reason */ export interface MediaModelOption { id: string name: string @@ -36,12 +42,14 @@ export interface MediaModelOption { reason?: string } +/** Represent media model catalog with default values, model options, and optional error message */ export interface MediaModelCatalogResponse { defaults: Record models: Record error?: string } +/** Define the structure for configuring package publishing details and evaluation criteria */ export interface PublishPackage { caption: string description: string @@ -55,6 +63,7 @@ export interface PublishPackage { } } +/** Define a destination for publishing content with identifiers, label, provider IDs, and fields */ export interface PublishDestination { id: string label: string @@ -63,12 +72,15 @@ export interface PublishDestination { } // Order drives the type filter tabs and the composer segmented control +/** Provide an array of supported generation types for media and content processing */ export const GENERATION_TYPES: readonly GenerationType[] = ['image', 'video', 'avatar', 'speech', 'transcription'] +/** Resolve whether a string value matches a valid GenerationType */ export function isGenerationType(value: string): value is GenerationType { return (GENERATION_TYPES as readonly string[]).includes(value) } +/** List available social media platforms with their publishing fields and provider identifiers */ export const DESTINATIONS: PublishDestination[] = [ { id: 'instagram', label: 'Instagram', providerIds: ['instagram'], fields: 'Caption, hashtags, crop' }, { id: 'tiktok', label: 'TikTok', providerIds: ['tiktok'], fields: 'Caption, audio note, vertical video' }, @@ -77,11 +89,15 @@ export const DESTINATIONS: PublishDestination[] = [ { id: 'x', label: 'X', providerIds: ['twitter'], fields: 'Short copy, mentions, thread option' }, ] +/** Provide an array of predefined cadence options for scheduling or approval processes */ export const CADENCES = ['Manual approval', 'Publish now', 'Daily creative drop', 'Weekly series'] +/** Define the minimum number of images required for processing or validation */ export const MIN_IMAGE_COUNT = 1 +/** Define the maximum number of images allowed for upload or display */ export const MAX_IMAGE_COUNT = 4 +/** Resolve a human-readable relative time string from a given date or return an empty string if null */ export function relativeTime(date: Date | null): string { if (!date) return '' const now = Date.now() @@ -96,6 +112,7 @@ export function relativeTime(date: Date | null): string { return new Date(date).toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) } +/** Resolve the output directory path based on the specified generation type */ export function outputPathFor(type: GenerationType): string { if (type === 'image') return 'generated/images' if (type === 'video') return 'generated/videos' @@ -104,11 +121,13 @@ export function outputPathFor(type: GenerationType): string { return 'generated/transcripts' } +/** Resolve the vault path string from a Generation object or return null if unavailable */ export function generationVaultPath(generation: Generation): string | null { const value = generation.metadata?.vaultPath return typeof value === 'string' && value.trim() ? value.trim() : null } +/** Build a PublishPackage object from caption, description, mentions, cadence, and destinations inputs */ export function buildPublishPackage({ caption, postDescription, @@ -150,6 +169,7 @@ export function buildPublishPackage({ } } +/** Determine if a value conforms to the PublishPackage structure with optional metadata fields */ export function isPublishPackage(value: unknown): value is { caption?: string; description?: string; mentions?: string[]; destinations?: string[]; cadence?: string } { if (!value || typeof value !== 'object') return false const publishPackage = value as { @@ -170,6 +190,7 @@ export function isPublishPackage(value: unknown): value is { caption?: string; d ) } +/** Determine if a destination has any active connections in the given list of studio integration connections */ export function isDestinationConnected( destination: PublishDestination, connections: StudioIntegrationConnection[], @@ -179,6 +200,7 @@ export function isDestinationConnected( || (connection.connectorId !== undefined && destination.providerIds.includes(connection.connectorId)))) } +/** Resolve selected models by applying defaults for missing or unavailable entries in the catalog */ export function selectedModelsWithDefaults( current: Partial>, catalog: MediaModelCatalogResponse, @@ -197,6 +219,7 @@ export function selectedModelsWithDefaults( return next } +/** Resolve the preferred model ID for a given generation type from the media model catalog */ export function preferredModelId(type: GenerationType, catalog: MediaModelCatalogResponse | null): string | undefined { if (!catalog) return undefined const models = catalog.models[type] ?? [] @@ -206,6 +229,7 @@ export function preferredModelId(type: GenerationType, catalog: MediaModelCatalo ?? models[0]?.id } +/** Resolve the appropriate status message for a media model based on loading state and availability */ export function modelMessage(model: MediaModelOption | undefined, loading: boolean, count: number): string | null { if (loading) return 'Loading media models...' if (count === 0) return 'No models are available for this media type.' @@ -215,6 +239,7 @@ export function modelMessage(model: MediaModelOption | undefined, loading: boole return null } +/** Define fields required to configure and request various types of media generation */ export interface GenerationRequestFields { workspaceId: string clientRequestId: string @@ -232,6 +257,7 @@ export interface GenerationRequestFields { } // image.count must already be normalized — it is also the optimistic-card count on the caller side +/** Build the request body object for a generation operation from provided fields */ export function buildGenerationRequestBody(fields: GenerationRequestFields): Record { const body: Record = { workspaceId: fields.workspaceId, @@ -277,6 +303,7 @@ export function buildGenerationRequestBody(fields: GenerationRequestFields): Rec return body } +/** Resolve the current status of a generation based on its metadata and result fields */ export function generationStatus(generation: Generation): GenerationStatus { const metadata = generation.metadata ?? {} const status = typeof metadata.generationStatus === 'string' ? metadata.generationStatus : '' @@ -284,6 +311,7 @@ export function generationStatus(generation: Generation): GenerationStatus { return generation.result ? 'succeeded' : 'pending' } +/** Resolve and return the first user-safe error message from generation metadata or null if none exist */ export function generationError(generation: Generation): string | null { const metadata = generation.metadata ?? {} if (typeof metadata.providerError === 'string' && metadata.providerError.trim()) { @@ -310,10 +338,12 @@ function generationBatchSlotKey(generation: Generation): string | null { : null } +/** Resolve a unique merge key from a generation using batch slot or client request ID */ export function generationMergeKey(generation: Generation): string | null { return generationBatchSlotKey(generation) ?? generationClientRequestId(generation) } +/** Merge a new generation into the current list by replacing or prepending it based on matching keys */ export function mergeLiveGeneration(current: Generation[], generation: Generation): Generation[] { const mergeKey = generationMergeKey(generation) const existingIndex = current.findIndex((item) => ( @@ -333,6 +363,7 @@ export function mergeLiveGeneration(current: Generation[], generation: Generatio // represents — deduped by BOTH id and merge key so a server row and its // optimistic twin never both appear. Returns `loader` unchanged when nothing is // live. Drives the canvas, library, and polling off one list. +/** Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs */ export function mergeLoaderAndLive(loader: Generation[], live: Generation[]): Generation[] { if (live.length === 0) return loader const leading = live.map((generation) => { @@ -354,6 +385,7 @@ export function mergeLoaderAndLive(loader: Generation[], live: Generation[]): Ge ] } +/** Determine if a generation ID indicates a local generation */ export function isLocalGeneration(generation: Generation): boolean { return generation.id.startsWith('local-') } @@ -366,6 +398,7 @@ function generationOutputIndex(generation: Generation): number { // The most-recent run: all generations sharing the leading item's clientRequestId // (a multi-image batch), ordered by output slot. Falls back to the single leading // item when no request id is present. Drives the result canvas. +/** Resolve and return the latest batch of generations grouped and sorted by client request ID and output index */ export function latestBatchOf(generations: Generation[]): Generation[] { const first = generations[0] if (!first) return [] @@ -376,6 +409,7 @@ export function latestBatchOf(generations: Generation[]): Generation[] { return [...batch].sort((a, b) => generationOutputIndex(a) - generationOutputIndex(b)) } +/** Resolve a user-safe generation message by filtering sensitive or error-related content */ export function userSafeGenerationMessage(message?: string): string { if (!message) return 'Generation failed' if (/Tangle API key is invalid or expired/i.test(message)) return message @@ -385,6 +419,7 @@ export function userSafeGenerationMessage(message?: string): string { return message } +/** Generate content optimistically based on input parameters and optional model and output details */ export function optimisticGeneration({ type, prompt, @@ -420,6 +455,7 @@ export function optimisticGeneration({ } } +/** Mark a generation as failed with updated status and error information */ export function failedOptimisticGeneration(generation: Generation): Generation { return { ...generation, @@ -431,6 +467,7 @@ export function failedOptimisticGeneration(generation: Generation): Generation { } } +/** Normalize a value to a finite integer within the allowed image count range */ export function normalizeImageCount(value: unknown): number { const numeric = typeof value === 'number' ? value : Number(value) if (!Number.isFinite(numeric)) return MIN_IMAGE_COUNT diff --git a/src/tangle/index.ts b/src/tangle/index.ts index 46bbce0..3092391 100644 --- a/src/tangle/index.ts +++ b/src/tangle/index.ts @@ -40,6 +40,7 @@ export interface BrokerTokenMinter { mintBrokerToken(input: { clientId: string; clientSecret: string; grantId: string; ttlSeconds?: number }): Promise } +/** Define input parameters required to generate a consent URL for OAuth authorization */ export interface ConsentUrlInput { /** Platform base URL (e.g. https://id.tangle.tools). */ endpoint: string @@ -72,6 +73,7 @@ export function buildConsentUrl(input: ConsentUrlInput): string { return `${base}/cross-site/app-consent?${params.toString()}` } +/** Define options for configuring a broker token provider including client credentials and token management settings */ export interface BrokerTokenProviderOptions { client: BrokerTokenMinter clientId: string @@ -87,6 +89,7 @@ export interface BrokerTokenProviderOptions { now?: () => number } +/** Provide and refresh broker bearer tokens, allowing forced token invalidation */ export interface BrokerTokenProvider { /** A valid `sk-tan-broker-` bearer, minting/refreshing as needed. */ getToken(): Promise diff --git a/src/teams-react/contracts.ts b/src/teams-react/contracts.ts index f578007..ce411ee 100644 --- a/src/teams-react/contracts.ts +++ b/src/teams-react/contracts.ts @@ -22,6 +22,7 @@ export interface MemberView { inherited?: boolean } +/** Define properties and callbacks for managing members and their roles in a workspace panel */ export interface MembersPanelProps { members: MemberView[] /** The viewer's effective role — gates which controls are interactive. */ @@ -55,6 +56,7 @@ export interface InvitationView { inviteUrl: string } +/** Define properties and callbacks for managing workspace invitations and user roles */ export interface InvitationsPanelProps { invitations: InvitationView[] /** The viewer's effective role — gates whether the invite controls are interactive. */ @@ -71,8 +73,10 @@ export interface InvitationsPanelProps { onNotice?(notice: { kind: 'success' | 'error'; message: string }): void } +/** Define possible statuses for the acceptance state of an invitation */ export type InviteAcceptStatus = 'pending' | 'invalid' | 'already-accepted' | 'expired' | 'revoked' +/** Describe details of an accepted invite including status, workspace, inviter, role, emails, and expiration */ export interface InviteAcceptDetails { status: InviteAcceptStatus /** Workspace the invite grants access to. */ @@ -91,6 +95,7 @@ export interface InviteAcceptDetails { needsEmailVerification?: boolean } +/** Define properties and callbacks for handling invite acceptance and navigation actions on the invite page */ export interface InviteAcceptPageProps { details: InviteAcceptDetails /** Accept the invite; resolve with the workspace to navigate to. */ diff --git a/src/teams-react/lazy.tsx b/src/teams-react/lazy.tsx index 9c8e29a..0619909 100644 --- a/src/teams-react/lazy.tsx +++ b/src/teams-react/lazy.tsx @@ -10,14 +10,17 @@ import type { MembersPanelProps, InvitationsPanelProps, InviteAcceptPageProps } export type { MembersPanelProps, InvitationsPanelProps, InviteAcceptPageProps } +/** Load MembersPanel component lazily to optimize initial rendering performance */ export const MembersPanelLazy = lazy( () => import('./components/MembersPanel').then((m) => ({ default: m.MembersPanel })), ) +/** Load InvitationsPanel component lazily to optimize initial rendering performance */ export const InvitationsPanelLazy = lazy( () => import('./components/InvitationsPanel').then((m) => ({ default: m.InvitationsPanel })), ) +/** Load InviteAcceptPage component lazily for optimized code splitting and performance */ export const InviteAcceptPageLazy = lazy( () => import('./components/InviteAcceptPage').then((m) => ({ default: m.InviteAcceptPage })), ) diff --git a/src/teams/drizzle/access.ts b/src/teams/drizzle/access.ts index 1036934..67207ae 100644 --- a/src/teams/drizzle/access.ts +++ b/src/teams/drizzle/access.ts @@ -45,6 +45,7 @@ export interface WorkspaceAccessTable { updatedAt: any } +/** Define options required to create access with database, tables, and workspace table references */ export interface CreateAccessOptions { db: TeamDatabase tables: TeamTables @@ -52,6 +53,7 @@ export interface CreateAccessOptions { workspaceTable: TeamParentTable & WorkspaceAccessTable } +/** Define access details including workspace data, organization info, member info, and role within workspace */ export interface WorkspaceAccess { workspace: Record organization: OrganizationRow @@ -59,18 +61,21 @@ export interface WorkspaceAccess { role: WorkspaceRole } +/** Describe a user's workspace details including organization and role information */ export interface UserWorkspaceSummary extends Record { organizationId: string organizationName: string role: WorkspaceRole } +/** Define methods to retrieve and enforce user access permissions within workspaces */ export interface WorkspaceAccessApi { getWorkspaceAccess(workspaceId: string, userId: string, minRole?: WorkspaceRole): Promise requireWorkspaceAccess(workspaceId: string, userId: string, minRole?: WorkspaceRole): Promise listUserWorkspaces(userId: string): Promise } +/** Create workspace access API to manage user roles and permissions within a workspace */ export function createWorkspaceAccess(opts: CreateAccessOptions): WorkspaceAccessApi { const { db, tables, workspaceTable } = opts const { organizations, organizationMembers, workspaceMembers } = tables @@ -165,22 +170,26 @@ export function createWorkspaceAccess(opts: CreateAccessOptions): WorkspaceAcces return { getWorkspaceAccess, requireWorkspaceAccess, listUserWorkspaces } } +/** Define access details linking an organization, its member, and the member's role */ export interface OrganizationAccess { organization: OrganizationRow member: OrganizationMemberRow role: OrganizationRole } +/** Define methods to retrieve and enforce user access levels within an organization */ export interface OrganizationAccessApi { getOrganizationAccess(organizationId: string, userId: string, minRole?: OrganizationRole): Promise requireOrganizationAccess(organizationId: string, userId: string, minRole?: OrganizationRole): Promise } +/** Define options required to create access for an organization including database and tables */ export interface CreateOrganizationAccessOptions { db: TeamDatabase tables: TeamTables } +/** Resolve organization access API with specified database and table options */ export function createOrganizationAccess(opts: CreateOrganizationAccessOptions): OrganizationAccessApi { const { db, tables } = opts const { organizations, organizationMembers } = tables diff --git a/src/teams/drizzle/invitations-schema.ts b/src/teams/drizzle/invitations-schema.ts index 3cf7330..091e50e 100644 --- a/src/teams/drizzle/invitations-schema.ts +++ b/src/teams/drizzle/invitations-schema.ts @@ -19,6 +19,7 @@ import { sql } from 'drizzle-orm' import { index, integer, sqliteTable, text, uniqueIndex } from 'drizzle-orm/sqlite-core' import type { TeamParentTable } from './schema' +/** Define options for creating a workspace invitation table with user, workspace, and organization references */ export interface CreateWorkspaceInvitationTableOptions { /** The product's user table — `invitedByUserId` references `userTable.id`. */ userTable: TeamParentTable @@ -28,6 +29,7 @@ export interface CreateWorkspaceInvitationTableOptions { organizationTable: TeamParentTable } +/** Build a workspace invitation table with defined columns and foreign key constraints */ export function createWorkspaceInvitationTable(opts: CreateWorkspaceInvitationTableOptions) { const { userTable, workspaceTable, organizationTable } = opts @@ -56,5 +58,7 @@ export function createWorkspaceInvitationTable(opts: CreateWorkspaceInvitationTa return { workspaceInvitations } } +/** Resolve the structure of workspace invitation tables from the creation function */ export type WorkspaceInvitationTables = ReturnType +/** Resolve the structure of a workspace invitation row from the workspaceInvitations table */ export type WorkspaceInvitationRow = WorkspaceInvitationTables['workspaceInvitations']['$inferSelect'] diff --git a/src/teams/drizzle/personal-organization.ts b/src/teams/drizzle/personal-organization.ts index fc11685..4291444 100644 --- a/src/teams/drizzle/personal-organization.ts +++ b/src/teams/drizzle/personal-organization.ts @@ -23,23 +23,27 @@ import type { OrganizationRole } from '../roles' import type { TeamDatabase } from './access' import type { OrganizationMemberRow, OrganizationRow, TeamTables } from './schema' +/** Define the structure for a user within a personal organization context */ export interface EnsurePersonalOrganizationUser { id: string name?: string | null email?: string | null } +/** Describe a personal organization result including organization, member, and role details */ export interface PersonalOrganizationResult { organization: OrganizationRow member: OrganizationMemberRow role: OrganizationRole } +/** Define options required to create a personal organization including database and tables references */ export interface CreatePersonalOrganizationOptions { db: TeamDatabase tables: TeamTables } +/** Ensure a user has a personal organization by creating or retrieving it as needed */ export function createEnsurePersonalOrganization(opts: CreatePersonalOrganizationOptions) { const { db, tables } = opts const { organizations, organizationMembers } = tables diff --git a/src/teams/drizzle/schema.ts b/src/teams/drizzle/schema.ts index 6686119..1e0a3eb 100644 --- a/src/teams/drizzle/schema.ts +++ b/src/teams/drizzle/schema.ts @@ -26,6 +26,7 @@ import type { AnySQLiteColumn, AnySQLiteTable } from 'drizzle-orm/sqlite-core' /** A product table referenced by FK — only the `id` column is touched. */ export type TeamParentTable = AnySQLiteTable & { id: AnySQLiteColumn } +/** Define options specifying user and workspace tables for creating team-related tables */ export interface CreateTeamTablesOptions { /** The product's user table — org/member rows reference `userTable.id`. */ userTable: TeamParentTable @@ -39,6 +40,7 @@ const createdAt = () => integer('created_at', { mode: 'timestamp' }).notNull().d const updatedAt = () => integer('updated_at', { mode: 'timestamp' }).notNull().default(sql`(unixepoch())`) +/** Build SQLite tables for organizations and related team structures using provided options */ export function createTeamTables(opts: CreateTeamTablesOptions) { const { userTable, workspaceTable } = opts @@ -87,8 +89,12 @@ export function createTeamTables(opts: CreateTeamTablesOptions) { return { organizations, organizationMembers, workspaceMembers } } +/** Resolve team tables by deriving the return type of createTeamTables */ export type TeamTables = ReturnType +/** Resolve the structure of an organization row from the organizations table in TeamTables */ export type OrganizationRow = TeamTables['organizations']['$inferSelect'] +/** Resolve the structure of an organization member row from the team tables selection */ export type OrganizationMemberRow = TeamTables['organizationMembers']['$inferSelect'] +/** Resolve a workspace member row with selected fields from the workspaceMembers table */ export type WorkspaceMemberRow = TeamTables['workspaceMembers']['$inferSelect'] diff --git a/src/teams/invitations-api.ts b/src/teams/invitations-api.ts index 16dcc63..a59c2a0 100644 --- a/src/teams/invitations-api.ts +++ b/src/teams/invitations-api.ts @@ -55,7 +55,9 @@ export interface SendInvitationEmailInput { inviteUrl: string expiresAt: Date } +/** Represent the outcome of sending an invitation email with success status and optional error message */ export type SendInvitationEmailResult = { succeeded: true } | { succeeded: false; error: string } +/** Resolve sending an invitation email and return the result asynchronously */ export interface SendInvitationEmailSeam { (input: SendInvitationEmailInput): Promise } @@ -73,6 +75,7 @@ export interface InvitationWorkspaceTable { name: any } +/** Define configuration options required to manage workspace invitations and related data sources */ export interface InvitationsApiOptions { db: TeamDatabase tables: TeamTables @@ -91,6 +94,7 @@ export interface InvitationsApiOptions { productDisplayName?: string } +/** Represent a workspace invitation with details about inviter, permissions, status, and timestamps */ export interface WorkspaceInvitationView { id: string workspaceId: string @@ -109,6 +113,7 @@ export interface WorkspaceInvitationView { lastSentAt: Date | null } +/** Describe the structure of an invitation preview with workspace, email, permissions, status, and expiration details */ export interface InvitationPreview { workspaceId: string workspaceName: string @@ -119,6 +124,7 @@ export interface InvitationPreview { expiresAt: Date } +/** Resolve the result of an invitation as success with a value or failure with status and error details */ export type InvitationOutcome = | { succeeded: true; value: T } | { succeeded: false; status: number; error: string } diff --git a/src/teams/invitations.ts b/src/teams/invitations.ts index e8240e2..57b4472 100644 --- a/src/teams/invitations.ts +++ b/src/teams/invitations.ts @@ -16,22 +16,28 @@ import type { AssignableWorkspaceRole } from './roles' /** The role an invitation grants — the assignable workspace ladder (never owner). */ export type InvitationPermission = AssignableWorkspaceRole +/** Define possible states for an invitation's lifecycle including pending, accepted, expired, and revoked */ export type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked' +/** Define possible statuses for the sending state of an invitation email */ export type InvitationEmailStatus = 'not_sent' | 'sent' | 'failed' +/** Define the number of days before an invitation expires */ export const INVITATION_EXPIRY_DAYS = 7 const INVITATION_PERMISSIONS = ['admin', 'editor', 'viewer'] as const const TOKEN_BYTE_LENGTH = 32 +/** Normalize an invitation email by trimming whitespace and converting to lowercase */ export function normalizeInvitationEmail(email: string): string { return email.trim().toLowerCase() } +/** Resolve invitation permission from a string or return null if invalid */ export function parseInvitationPermission(value: string | undefined): InvitationPermission | null { return INVITATION_PERMISSIONS.includes(value as InvitationPermission) ? (value as InvitationPermission) : null } +/** Calculate the expiration date of an invitation based on the given or current date */ export function getInvitationExpiresAt(now: Date = new Date()): Date { return new Date(now.getTime() + INVITATION_EXPIRY_DAYS * 24 * 60 * 60 * 1000) } @@ -48,12 +54,14 @@ export function generateInvitationToken(): string { return `inv_${btoa(token).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/g, '')}` } +/** Generate an invite URL by combining the origin with an encoded token */ export function inviteUrlForToken(origin: string, token: string): string { return `${origin.replace(/\/+$/, '')}/invite/${encodeURIComponent(token)}` } // ── email template (pure; no transport) ── +/** Define input data required to render an invitation email template */ export interface RenderInvitationEmailInput { to: string workspaceName: string @@ -63,11 +71,13 @@ export interface RenderInvitationEmailInput { expiresAt: Date } +/** Define the structure for an invitation email brand including the RFC-5322 From header */ export interface InvitationEmailBrand { /** RFC-5322 From header, e.g. `GTM Agent `. */ fromAddress: string } +/** Define the structure of a fully rendered invitation email with sender, subject, and content fields */ export interface RenderedInvitationEmail { from: string subject: string diff --git a/src/teams/invite.ts b/src/teams/invite.ts index d4fc7b0..1d63e22 100644 --- a/src/teams/invite.ts +++ b/src/teams/invite.ts @@ -36,8 +36,10 @@ export interface InviteTokenState { expiresAt?: Date | number | null } +/** Define possible reasons for rejecting an invite including acceptance, expiration, or email mismatch */ export type InviteRejectionReason = 'already-accepted' | 'expired' | 'email-mismatch' +/** Represent the outcome of validating an invite with success status and optional rejection reason */ export interface InviteValidationResult { ok: boolean reason?: InviteRejectionReason diff --git a/src/teams/members-api.ts b/src/teams/members-api.ts index 04590d6..4687635 100644 --- a/src/teams/members-api.ts +++ b/src/teams/members-api.ts @@ -96,6 +96,7 @@ export interface MemberSyncSeam { remove?(input: { workspaceId: string; userId: string }): Promise | void } +/** Define configuration options for managing team members and workspace access APIs */ export interface MembersApiOptions { db: TeamDatabase tables: TeamTables @@ -109,6 +110,7 @@ export interface MembersApiOptions { memberSyncSeam?: MemberSyncSeam } +/** Define the structure of a workspace member entry with identification, role, and status details */ export interface MemberListEntry { id: string userId: string | null diff --git a/src/teams/resend.ts b/src/teams/resend.ts index e2b56dc..bcba1c4 100644 --- a/src/teams/resend.ts +++ b/src/teams/resend.ts @@ -15,6 +15,7 @@ import { Resend } from 'resend' import { renderInvitationEmail } from './invitations' import type { SendInvitationEmailSeam } from './invitations-api' +/** Define options for sending a resend invitation including sender address and optional API key */ export interface ResendInvitationSenderOptions { /** RFC-5322 From header, e.g. `GTM Agent `. */ from: string diff --git a/src/teams/roles.ts b/src/teams/roles.ts index 2ec72dc..46e6e79 100644 --- a/src/teams/roles.ts +++ b/src/teams/roles.ts @@ -16,17 +16,25 @@ */ export const WORKSPACE_ROLES = ['viewer', 'editor', 'admin', 'owner'] as const +/** Resolve the union type of all possible workspace role string literals from WORKSPACE_ROLES array */ export type WorkspaceRole = typeof WORKSPACE_ROLES[number] +/** Define the list of roles that can be assigned within a workspace */ export const ASSIGNABLE_WORKSPACE_ROLES = ['viewer', 'editor', 'admin'] as const +/** Resolve the set of roles that can be assigned within a workspace */ export type AssignableWorkspaceRole = typeof ASSIGNABLE_WORKSPACE_ROLES[number] +/** Define the set of fixed roles available within an organization */ export const ORGANIZATION_ROLES = ['owner', 'admin', 'member', 'billing'] as const +/** Resolve a role string from the predefined list of organization roles */ export type OrganizationRole = typeof ORGANIZATION_ROLES[number] +/** Define access levels for workspace collaboration as either read or write */ export type WorkspaceCollaborationAccess = 'read' | 'write' +/** Define user roles available within a sandbox workspace environment */ export type SandboxWorkspaceRole = 'owner' | 'admin' | 'developer' | 'viewer' +/** Map workspace roles to their corresponding hierarchical rank values */ export const WORKSPACE_ROLE_RANK: Record = { viewer: 0, editor: 1, @@ -34,6 +42,7 @@ export const WORKSPACE_ROLE_RANK: Record = { owner: 3, } +/** Map organization roles to their hierarchical rank for permission and access control purposes */ export const ORGANIZATION_ROLE_RANK: Record = { member: 0, billing: 1, @@ -51,6 +60,7 @@ export function hasOrganizationRole(actual: OrganizationRole, minimum: Organizat return ORGANIZATION_ROLE_RANK[actual] >= ORGANIZATION_ROLE_RANK[minimum] } +/** Determine if a value is a valid assignable workspace role among viewer, editor, or admin */ export function isAssignableWorkspaceRole(value: unknown): value is AssignableWorkspaceRole { return typeof value === 'string' && ASSIGNABLE_WORKSPACE_ROLES.includes(value as AssignableWorkspaceRole) } @@ -81,10 +91,12 @@ export function canManageWorkspaceMemberRole(actorRole: WorkspaceRole, targetRol return actorRole === 'owner' || !hasWorkspaceRole(targetRole, actorRole) } +/** Map a workspace role to the corresponding collaboration access level */ export function workspaceRoleToCollaborationAccess(role: WorkspaceRole): WorkspaceCollaborationAccess { return role === 'viewer' ? 'read' : 'write' } +/** Map a workspace role to its corresponding sandbox workspace role */ export function workspaceRoleToSandboxRole(role: WorkspaceRole): SandboxWorkspaceRole { const mapping: Record = { owner: 'owner', diff --git a/src/theme-contract/index.ts b/src/theme-contract/index.ts index 122833a..c69eb78 100644 --- a/src/theme-contract/index.ts +++ b/src/theme-contract/index.ts @@ -50,6 +50,7 @@ import { type Dirent, existsSync, readFileSync, readdirSync } from 'node:fs' import { join, relative } from 'node:path' import { fileURLToPath } from 'node:url' +/** Define options for scanning source directories and CSS token files in a theme contract */ export interface ThemeContractOptions { /** Consumer source directories to scan for token references (recursively). */ srcDirs: string[] @@ -72,6 +73,7 @@ export interface ThemeContractOptions { allowlist?: string[] } +/** Describe a missing theme contract variable and where it was referenced */ export interface ThemeContractMiss { /** The undefined custom property, e.g. `--popover`. */ varName: string @@ -83,6 +85,7 @@ export interface ThemeContractMiss { referencedIn: string } +/** Describe the result of validating a theme contract including success status and missing items */ export interface ThemeContractResult { ok: boolean missing: ThemeContractMiss[] diff --git a/src/theme/tailwind-preset.ts b/src/theme/tailwind-preset.ts index b31b6d1..d4b23d6 100644 --- a/src/theme/tailwind-preset.ts +++ b/src/theme/tailwind-preset.ts @@ -17,6 +17,7 @@ const withForeground = (name: string) => ({ foreground: `hsl(var(--${name}-foreground))`, }) +/** Define a preset configuration for dark mode and extended theme colors with foreground variants */ const agentAppPreset = { darkMode: ['class', '[data-theme="dark"]'] as [string, string], theme: { diff --git a/src/theme/theme.ts b/src/theme/theme.ts index 9d24040..d871e07 100644 --- a/src/theme/theme.ts +++ b/src/theme/theme.ts @@ -69,6 +69,7 @@ export interface CanvasRenderPalette { brokenStroke: string } +/** Define a light color theme with specific background, foreground, and accent color values */ export const lightTheme: AgentAppTheme = { background: '0 0% 100%', foreground: '0 0% 5%', @@ -109,6 +110,7 @@ export const lightTheme: AgentAppTheme = { }, } +/** Define a dark color scheme for the Agent app interface with specific background and foreground hues */ export const darkTheme: AgentAppTheme = { background: '240 8% 5%', foreground: '240 6% 93%', diff --git a/src/tools/auth.ts b/src/tools/auth.ts index fafd92d..2a7274e 100644 --- a/src/tools/auth.ts +++ b/src/tools/auth.ts @@ -11,12 +11,14 @@ export interface ToolHeaderNames { threadId: string } +/** Provide default HTTP header names for user, workspace, and thread identification */ export const DEFAULT_HEADER_NAMES: ToolHeaderNames = { userId: 'X-Agent-App-User-Id', workspaceId: 'X-Agent-App-Workspace-Id', threadId: 'X-Agent-App-Thread-Id', } +/** Define options to verify bearer tokens and customize authentication header names */ export interface AuthenticateOptions { /** Verify the bearer capability token belongs to `userId`. The product's * HMAC/JWT impl — the seam that keeps token crypto out of this package. */ @@ -24,6 +26,7 @@ export interface AuthenticateOptions { headerNames?: ToolHeaderNames } +/** Represent the result of tool authentication with success context or failure response */ export type ToolAuthResult = | { ok: true; ctx: AppToolContext } | { ok: false; response: Response } diff --git a/src/tools/capability.ts b/src/tools/capability.ts index d847347..3df0337 100644 --- a/src/tools/capability.ts +++ b/src/tools/capability.ts @@ -22,6 +22,7 @@ import { hmacSha256Base64Url, } from '../crypto/web-token' +/** Define options for creating and verifying capability tokens including secret and prefix */ export interface CapabilityTokenOptions { /** Shared HMAC secret. When absent, mint returns undefined / verify returns false. */ secret?: string @@ -49,6 +50,7 @@ export async function verifyCapabilityToken(userId: string, token: string, opts: return constantTimeEqual(token, expected) } +/** Define options for capability tokens that expire after a specified lifetime in milliseconds */ export interface ExpiringCapabilityTokenOptions extends CapabilityTokenOptions { /** Token lifetime. Expired tokens verify false regardless of signature. */ expiresInMs: number diff --git a/src/tools/dispatch.ts b/src/tools/dispatch.ts index 96cdcbf..18cedaa 100644 --- a/src/tools/dispatch.ts +++ b/src/tools/dispatch.ts @@ -9,6 +9,7 @@ import type { AppToolTaxonomy, } from './types' +/** Define options for dispatching tools including handlers, taxonomy, custom tools, and approval policies */ export interface DispatchOptions { handlers: AppToolHandlers taxonomy: AppToolTaxonomy diff --git a/src/tools/gating.ts b/src/tools/gating.ts index 4e2ee17..db987a8 100644 --- a/src/tools/gating.ts +++ b/src/tools/gating.ts @@ -30,6 +30,7 @@ export interface ToolCapability { toolGroups?: readonly string[] } +/** Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs */ export interface ResolveToolCapabilitiesOptions { taxonomy: AppToolTaxonomy /** The product's full capability registry. */ @@ -44,6 +45,7 @@ export interface ResolveToolCapabilitiesOptions { baseProposalTypes?: readonly string[] } +/** Describe resolved capabilities including proposal types and product tool groups to expose */ export interface ResolvedToolCapabilities { /** Proposal types to keep — feed to {@link restrictTaxonomy}. */ proposalTypes: string[] diff --git a/src/tools/http.ts b/src/tools/http.ts index d15f797..31981f6 100644 --- a/src/tools/http.ts +++ b/src/tools/http.ts @@ -3,6 +3,7 @@ import { dispatchAppTool, outcomeStatus, type DispatchOptions } from './dispatch import type { AppToolName } from './openai' import type { AppToolDefinition } from './registry' +/** Define options for handling tool requests including tool identification and token verification */ export interface HandleToolRequestOptions extends DispatchOptions { /** Which app tool this route serves — a built-in name or a product-registered * {@link AppToolDefinition} (auto-added to `customTools` for dispatch). */ diff --git a/src/tools/mcp-rpc.ts b/src/tools/mcp-rpc.ts index c7f885f..0d72774 100644 --- a/src/tools/mcp-rpc.ts +++ b/src/tools/mcp-rpc.ts @@ -18,10 +18,12 @@ */ export const MCP_PROTOCOL_VERSIONS = ['2025-06-18', '2025-03-26', '2024-11-05'] as const +/** Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array */ export type McpProtocolVersion = (typeof MCP_PROTOCOL_VERSIONS)[number] const LATEST_PROTOCOL_VERSION: McpProtocolVersion = MCP_PROTOCOL_VERSIONS[0] +/** Describe the structure of server information including name and version */ export interface McpServerInfo { name: string version: string @@ -38,6 +40,7 @@ export interface McpToolDefinition> { run(args: Record, env: TEnv): Promise } +/** Define options for creating a handler that manages MCP tools with environment support */ export interface CreateMcpToolHandlerOptions> { serverInfo: McpServerInfo /** Full tool list; order IS the tools/list order. */ diff --git a/src/tools/mcp.ts b/src/tools/mcp.ts index 3be45c8..e76a885 100644 --- a/src/tools/mcp.ts +++ b/src/tools/mcp.ts @@ -24,6 +24,7 @@ export interface AppToolMcpServer { metadata: { description: string } } +/** Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description */ export interface BuildHttpMcpServerOptions { /** Route path on the app the sandbox POSTs to (e.g. `/api/tools/propose`). */ path: string @@ -130,6 +131,7 @@ export function buildScopedMcpServerEntry( } } +/** Define configuration options required to build an MCP server including tool, baseUrl, token, and context */ export interface BuildMcpServerOptions { /** A built-in app tool name, or a product-registered {@link AppToolDefinition}. * A custom tool supplies its route via `AppToolDefinition.path` (or `paths`). */ diff --git a/src/tools/openai.ts b/src/tools/openai.ts index 35122af..1741ce0 100644 --- a/src/tools/openai.ts +++ b/src/tools/openai.ts @@ -3,9 +3,11 @@ import type { AppToolTaxonomy, BuildAppToolsOptions } from './types' /** The four canonical app-tool names. Stable identifiers the model calls in * both the sandbox (MCP server name) and runtime (function-tool name) paths. */ export const APP_TOOL_NAMES = ['submit_proposal', 'schedule_followup', 'render_ui', 'add_citation'] as const +/** Resolve a valid application tool name from the predefined list of tool names */ export type AppToolName = (typeof APP_TOOL_NAMES)[number] const NAME_SET = new Set(APP_TOOL_NAMES) +/** Determine if a string matches a valid application tool name */ export function isAppToolName(name: string): name is AppToolName { return NAME_SET.has(name) } diff --git a/src/tools/runtime.ts b/src/tools/runtime.ts index da650ce..76c13c3 100644 --- a/src/tools/runtime.ts +++ b/src/tools/runtime.ts @@ -9,6 +9,7 @@ export type AppToolRuntimeExecutor = (call: { args: Record }) => Promise +/** Define options for executing runtime tasks with a trusted per-turn context */ export interface RuntimeExecutorOptions extends DispatchOptions { /** The trusted per-turn context — supplied directly (not from headers), since * the runtime path has no HTTP request. */ diff --git a/src/tools/types.ts b/src/tools/types.ts index 7f8af34..7ee54b7 100644 --- a/src/tools/types.ts +++ b/src/tools/types.ts @@ -55,6 +55,7 @@ export interface BuildAppToolsOptions { customTools?: readonly import('./registry').AppToolDefinition[] } +/** Define the arguments required to submit a proposal including type, title, description, and approval status */ export interface SubmitProposalArgs { type: string title: string @@ -64,6 +65,7 @@ export interface SubmitProposalArgs { * true. Products don't set this; dispatch owns it — fail-closed. */ regulated?: boolean } +/** Describe the result of submitting a proposal including deduplication and execution status */ export interface SubmitProposalResult { proposalId: string /** True when an identical (workspace, title) proposal already existed. */ @@ -77,21 +79,25 @@ export interface SubmitProposalResult { [extra: string]: unknown } +/** Define arguments required to schedule a follow-up with optional priority */ export interface ScheduleFollowupArgs { title: string dueDate: string priority?: string } +/** Define the result structure for scheduling a follow-up with unique identification and due date */ export interface ScheduleFollowupResult { id: string dueDate: string deduped: boolean } +/** Define arguments required to render a UI including title and schema */ export interface RenderUiArgs { title: string schema: unknown } +/** Describe the result of rendering UI including the artifact path and exact persisted content */ export interface RenderUiResult { /** The persisted artifact path. */ path: string @@ -100,11 +106,13 @@ export interface RenderUiResult { content: string } +/** Define arguments required to add a citation including path, quote, and optional label */ export interface AddCitationArgs { path: string quote: string label?: string } +/** Represent the result of adding a citation including its identifier and location path */ export interface AddCitationResult { citationId: string path: string diff --git a/src/trace/flow-types.ts b/src/trace/flow-types.ts index 40a17de..1058125 100644 --- a/src/trace/flow-types.ts +++ b/src/trace/flow-types.ts @@ -14,6 +14,7 @@ export interface FlowSpan { meta?: Record } +/** Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls */ export interface FlowTrace { spans: FlowSpan[] totalMs: number diff --git a/src/trace/index.ts b/src/trace/index.ts index d11a8c0..deae762 100644 --- a/src/trace/index.ts +++ b/src/trace/index.ts @@ -20,6 +20,7 @@ export * from './mission-flow' import type { FlowSpan, FlowTrace } from './flow-types' +/** Represent a timed event with a timestamp and associated event data */ export interface TimedEvent { /** ms since turn start (`_t` stamped by pumpBufferedTurn). */ t: number @@ -155,6 +156,7 @@ export function renderWaterfall(trace: FlowTrace, opts?: { width?: number }): st return lines.join('\n') } +/** Summarize key statistics of a numerical distribution including count, min, percentiles, and max */ export interface DistributionSummary { n: number min: number @@ -163,6 +165,7 @@ export interface DistributionSummary { max: number } +/** Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max */ export function summarize(values: number[]): DistributionSummary { const sorted = [...values].sort((a, b) => a - b) const q = (p: number) => sorted[Math.min(sorted.length - 1, Math.floor(p * sorted.length))] ?? 0 diff --git a/src/trace/mission-flow.ts b/src/trace/mission-flow.ts index f6633c3..f68ceb1 100644 --- a/src/trace/mission-flow.ts +++ b/src/trace/mission-flow.ts @@ -236,6 +236,7 @@ export function stepActivityFlowTrace( } } +/** Define a step in a mission flow with id, intent, optional status, start time, and duration */ export interface MissionFlowStep { id: string intent: string diff --git a/src/trace/mission-trace.ts b/src/trace/mission-trace.ts index 3a0873a..1fc6d62 100644 --- a/src/trace/mission-trace.ts +++ b/src/trace/mission-trace.ts @@ -22,6 +22,7 @@ export interface MissionTraceContext { rootSpanId: string } +/** Define context information for a step span including trace, span, and parent span identifiers */ export interface StepSpanContext { traceId: string /** 16-hex span id of this step attempt (or any nested unit of work). */ diff --git a/src/turn-stream/adapters.ts b/src/turn-stream/adapters.ts index 8991f06..296ecb5 100644 --- a/src/turn-stream/adapters.ts +++ b/src/turn-stream/adapters.ts @@ -35,6 +35,7 @@ import { // ── structural namespace ──────────────────────────────────────────────────── +/** Resolve a stub interface for handling fetch requests with optional initialization parameters */ export interface TurnStreamStubLike { fetch(input: Request | string, init?: RequestInit): Promise } @@ -132,6 +133,7 @@ export function createDurableObjectTurnEventStore(namespace: TurnStreamNamespace // ── lock primitives (usable outside the route seam too) ───────────────────── +/** Define input parameters required to acquire a durable turn lock in a workspace thread context */ export interface AcquireDurableTurnLockInput { workspaceId: string threadId: string @@ -142,6 +144,7 @@ export interface AcquireDurableTurnLockInput { lockId?: string } +/** Acquire a durable turn lock in the specified namespace with given input parameters */ export async function acquireDurableTurnLock( namespace: TurnStreamNamespaceLike, input: AcquireDurableTurnLockInput, @@ -158,6 +161,7 @@ export async function acquireDurableTurnLock( return result.body } +/** Release a durable turn lock and indicate if the release was successful or deferred */ export async function releaseDurableTurnLock( namespace: TurnStreamNamespaceLike, input: TurnLockReleaseInput, @@ -166,6 +170,7 @@ export async function releaseDurableTurnLock( return postJsonOk(namespace, key, TURN_STREAM_PATHS.lockRelease, input) } +/** Define input parameters to release an interrupted durable turn lock in a workspace or thread */ export interface ReleaseInterruptedDurableTurnLockInput { workspaceId: string threadId: string @@ -198,6 +203,7 @@ export async function releaseInterruptedDurableTurnLock( // ── stale-lock reconciliation against the DO ──────────────────────────────── +/** Define options to reconcile stale durable turn locks with context, namespace, workspace, and active lock details */ export interface ReconcileStaleDurableTurnLockOptions extends Pick< ReconcileStaleTurnLockOptions, @@ -252,6 +258,7 @@ export type TurnLockSeamResult = | { acquired: true; handle?: unknown } | { acquired: false; response: Response } +/** Define options for creating a durable turn lock with customizable scope and identification methods */ export interface CreateDurableTurnLockOptions { namespace: TurnStreamNamespaceLike /** Which lane serializes this turn: `'workspace'` (shared sandbox — one @@ -433,8 +440,10 @@ export async function broadcastThreadCreated( // ── WebSocket upgrade forwarder (worker entry) ────────────────────────────── +/** Represent success or failure of a TURN stream upgrade authorization with optional response data */ export type TurnStreamUpgradeAuthorization = { ok: true } | { ok: false; response: Response } +/** Define options for creating a TURN stream upgrade handler including namespace, path, and authorization logic */ export interface CreateTurnStreamUpgradeHandlerOptions { namespace: TurnStreamNamespaceLike /** The worker route serving the stream. Default `/api/session-stream`. */ diff --git a/src/turn-stream/core.ts b/src/turn-stream/core.ts index 0ae5491..dfa1fe2 100644 --- a/src/turn-stream/core.ts +++ b/src/turn-stream/core.ts @@ -42,12 +42,15 @@ export function isTerminalRunEvent(type: string): boolean { // scope `scope:${scopeId}` — running-turn index for a thread, // backing `TurnEventStore.listRunning`. +/** Define the scope level for acquiring a turn lock within thread or workspace contexts */ export type TurnLockScope = 'thread' | 'workspace' +/** Generate a unique string key combining workspace and thread identifiers */ export function threadChannelKey(workspaceId: string, threadId: string): string { return `${workspaceId}:${threadId}` } +/** Generate a unique channel key based on the given workspace identifier */ export function workspaceChannelKey(workspaceId: string): string { return workspaceId } @@ -60,22 +63,26 @@ export function turnLockChannelKey(workspaceId: string, threadId: string, scope: return scope === 'workspace' ? workspaceChannelKey(workspaceId) : threadChannelKey(workspaceId, threadId) } +/** Generate a storage channel key string for a given turn identifier */ export function turnStorageChannelKey(turnId: string): string { return `turn:${turnId}` } +/** Generate a unique channel key string based on the provided scope identifier */ export function scopeIndexChannelKey(scopeId: string): string { return `scope:${scopeId}` } // ── segment store (reconnect replay over a live socket) ───────────────────── +/** Represent a segment of a turn containing events, sequence limit, and terminal status */ export interface TurnSegment { events: TurnStreamEvent[] maxSeq: number terminal: boolean } +/** Define a store managing segments and tracking the active execution identifier */ export interface SegmentStore { segments: Map activeExecutionId: string | null @@ -93,6 +100,7 @@ export const MAX_RECENT_CREATED = 50 * `end` broadcast can't leave a permanently-stuck "responding" dot. */ export const ACTIVITY_TTL_MS = 15 * 60 * 1000 +/** Create a SegmentStore with initialized segments and no active execution ID */ export function createSegmentStore(): SegmentStore { return { segments: new Map(), activeExecutionId: null } } @@ -186,6 +194,7 @@ export interface DurableTurnLock { releasePending?: boolean } +/** Define input parameters required to acquire a turn-based lock in a workspace thread */ export interface TurnLockAcquireInput { workspaceId: string threadId: string @@ -195,10 +204,12 @@ export interface TurnLockAcquireInput { turnId?: string } +/** Resolve the result of attempting to acquire a turn lock indicating success or active lock status */ export type TurnLockAcquireResult = | { acquired: true; lock: DurableTurnLock } | { acquired: false; active: DurableTurnLock } +/** Define input parameters required to release a turn lock in a specific workspace thread */ export interface TurnLockReleaseInput { workspaceId: string threadId: string @@ -228,6 +239,7 @@ export function activeTurnLock(stored: DurableTurnLock | undefined, now: number) return lock.expiresAt > now ? lock : null } +/** Create a durable turn lock object with timing and scope based on input parameters */ export function createTurnLock(input: TurnLockAcquireInput, now: number, ttlMs = TURN_LOCK_TTL_MS): DurableTurnLock { return { workspaceId: input.workspaceId, @@ -283,6 +295,7 @@ export function interruptedReleaseApplies( // existed there, so a product deletes its fork by re-pointing a binding, not // by re-speaking a protocol. +/** Provide constant paths for managing chat turn streams and locks */ export const TURN_STREAM_PATHS = { broadcast: '/broadcast', lockAcquire: '/chat-turn-lock/acquire', diff --git a/src/turn-stream/do.ts b/src/turn-stream/do.ts index ab71952..96e4ca0 100644 --- a/src/turn-stream/do.ts +++ b/src/turn-stream/do.ts @@ -130,6 +130,7 @@ const MAX_SCOPE_TURNS = 100 // ── the DO ────────────────────────────────────────────────────────────────── +/** Define options to override default TTL and event limits for TURN stream DO operations */ export interface TurnStreamDOOptions { /** Override {@link TURN_LOCK_TTL_MS}. */ lockTtlMs?: number @@ -139,6 +140,7 @@ export interface TurnStreamDOOptions { activityTtlMs?: number } +/** Manage per-turn segments and track active threads with durable event storage */ export class TurnStreamDO { protected readonly state: TurnStreamDOState protected readonly env: unknown diff --git a/src/turn-stream/memory.ts b/src/turn-stream/memory.ts index fbed53f..cc0b0cf 100644 --- a/src/turn-stream/memory.ts +++ b/src/turn-stream/memory.ts @@ -40,6 +40,7 @@ export interface MemoryTurnStreamSocket extends TurnStreamSocket { readonly closed: boolean } +/** Define an in-memory channel for streaming turn-based data with viewer socket connection support */ export interface MemoryTurnStreamChannel { /** Attach a viewer socket to this channel (bypasses the HTTP 101 — the * upgrade handshake is Cloudflare-runtime-only) and run its `sync`. */ @@ -47,6 +48,7 @@ export interface MemoryTurnStreamChannel { readonly instance: TurnStreamDO } +/** Provide an interface to manage channels and namespaces for memory-based turn stream testing */ export interface MemoryTurnStreamHarness { namespace: TurnStreamNamespaceLike /** The channel (creating its DO instance if needed) for a channel key — diff --git a/src/vault/contracts.ts b/src/vault/contracts.ts index 6d5e39b..7062202 100644 --- a/src/vault/contracts.ts +++ b/src/vault/contracts.ts @@ -150,6 +150,7 @@ export interface VaultDockToggle { /** The two editor surfaces the pane switches between for editable text files. */ export type VaultEditorMode = 'rich' | 'source' +/** Define the properties and render methods for the vault pane UI components */ export interface VaultPaneProps { /** Product-owned data access. */ port: VaultDataPort diff --git a/src/vault/lazy.tsx b/src/vault/lazy.tsx index 799eace..5369bb7 100644 --- a/src/vault/lazy.tsx +++ b/src/vault/lazy.tsx @@ -10,6 +10,7 @@ import type { VaultPaneProps } from './contracts' export type { VaultPaneProps } +/** Resolve VaultPane component lazily to optimize loading and improve performance */ export const VaultPaneLazy = lazy( () => import('./VaultPane').then((m) => ({ default: m.VaultPane })), ) diff --git a/src/web-react/chat-stream.ts b/src/web-react/chat-stream.ts index 0ee3eda..8776d42 100644 --- a/src/web-react/chat-stream.ts +++ b/src/web-react/chat-stream.ts @@ -63,12 +63,14 @@ export { type FileIndexWarmingResponse, } from '../chat-routes/file-index' +/** Define the structure for a chat tool call including optional ID, name, and arguments object */ export interface ChatStreamToolCall { toolCallId?: string toolName: string args: Record } +/** Describe the result of a chat stream tool including its outcome and optional metadata fields */ export interface ChatStreamToolResult { toolCallId?: string toolName?: string @@ -76,6 +78,7 @@ export interface ChatStreamToolResult { outcome: { ok: boolean; result?: unknown; code?: string; message?: string } } +/** Define callbacks to handle events and data during a chat streaming session */ export interface ChatStreamCallbacks { onTurnId?: (turnId: string) => void onText?: (delta: string) => void @@ -108,6 +111,7 @@ export interface ChatStreamCallbacks { onPlan?: (plan: ChatPlan) => void } +/** Represent the result of consuming a chat stream including turn ID and content reception status */ export interface ConsumeChatStreamResult { turnId: string | null /** True when any text/reasoning/tool activity was received. */ @@ -308,6 +312,7 @@ export async function consumeChatStream( return { turnId, receivedContent } } +/** Define options for managing and resuming streaming chat interactions with callbacks */ export interface StreamChatOptions { /** Start the turn (POST the chat request); must return a streaming Response. */ start: () => Promise diff --git a/src/web-react/durable-interaction-submit.ts b/src/web-react/durable-interaction-submit.ts index bc357c6..158d6df 100644 --- a/src/web-react/durable-interaction-submit.ts +++ b/src/web-react/durable-interaction-submit.ts @@ -7,6 +7,7 @@ import { type SubmitInteractionAnswer, } from './interaction-card-support' +/** Manage storage and retrieval of interaction attempt keys by interaction and submission identifiers */ export interface InteractionAttemptStore { get(interactionId: string, submissionSignature: string): string | null set(interactionId: string, submissionSignature: string, attemptKey: string): void @@ -28,6 +29,7 @@ function storedAttempts(storage: Pick, key: string): Record< } } +/** Create a session-based store to manage interaction attempts using provided storage and optional namespace */ export function createSessionInteractionAttemptStore( storage: Pick, namespace = 'agent-app:interaction-attempt', @@ -50,6 +52,7 @@ export function createSessionInteractionAttemptStore( } } +/** Create an in-memory store to manage interaction attempts keyed by ID and signature */ export function createMemoryInteractionAttemptStore(): InteractionAttemptStore { const attempts = new Map() const key = (id: string, signature: string) => `${id}\u0000${signature}` @@ -68,10 +71,12 @@ function stableValue(value: unknown): unknown { .map(([key, nested]) => [key, stableValue(nested)])) } +/** Generate a stable string signature from an interaction answer submission */ export function interactionSubmissionSignature(submission: InteractionAnswerSubmission): string { return JSON.stringify(stableValue(submission)) } +/** Define options for submitting durable interaction answers with attempt tracking and optional key creation */ export interface DurableInteractionAnswerSubmitterOptions extends InteractionAnswerSubmitterOptions { attempts: InteractionAttemptStore createAttemptKey?: () => string diff --git a/src/web-react/durable-plan-flow.ts b/src/web-react/durable-plan-flow.ts index e6ed5fe..d19eca5 100644 --- a/src/web-react/durable-plan-flow.ts +++ b/src/web-react/durable-plan-flow.ts @@ -1,6 +1,7 @@ import { useCallback, useEffect, useRef, useState } from 'react' import type { ChatPlan } from '../plans/index' +/** Represent durable plan decisions as either approved or rejected */ export type DurablePlanDecision = 'approved' | 'rejected' /** Stable authority receipt for the follow-up turn dispatched by a plan @@ -14,6 +15,7 @@ export interface DurablePlanFollowUpReceipt { state: string } +/** Describe the result of a durable plan decision including plan details and pending statuses */ export interface DurablePlanDecisionResult { plan: ChatPlan followUp?: DurablePlanFollowUpReceipt @@ -22,6 +24,7 @@ export interface DurablePlanDecisionResult { effectPending?: boolean } +/** Define input parameters for making a durable plan decision including optional feedback */ export interface DurablePlanDecisionInput { planId: string revision: number @@ -29,16 +32,19 @@ export interface DurablePlanDecisionInput { feedback?: string } +/** Define input parameters for retrieving the current durable plan including optional revision number */ export interface DurablePlanCurrentInput { planId: string revision?: number } +/** Define methods to obtain and decide durable plan decisions asynchronously */ export interface DurablePlanDecisionClient { current: (input: DurablePlanCurrentInput) => Promise decide: (input: DurablePlanDecisionInput) => Promise } +/** Represent errors from DurablePlanClient operations including status, code, and current plan details */ export class DurablePlanClientError extends Error { constructor( message: string, @@ -51,6 +57,7 @@ export class DurablePlanClientError extends Error { } } +/** Define configuration options for creating a durable plan decision client */ export interface DurablePlanDecisionClientOptions { url: string | ((input: DurablePlanCurrentInput | DurablePlanDecisionInput) => string) body?: Record | ((input: DurablePlanDecisionInput) => Record) @@ -153,6 +160,7 @@ export function createDurablePlanDecisionClient( } } +/** Define options to configure durable plan flow with plan, client, and optional callbacks */ export interface UseDurablePlanFlowOptions { plan: ChatPlan client: DurablePlanDecisionClient @@ -161,6 +169,7 @@ export interface UseDurablePlanFlowOptions { onUpdated?: (plan: ChatPlan) => void } +/** Define the result and actions for managing a durable plan flow including decisions, restoration, and error handling */ export interface UseDurablePlanFlowResult { plan: ChatPlan deciding: DurablePlanDecision | null diff --git a/src/web-react/index.tsx b/src/web-react/index.tsx index 6fdf9c5..16cac56 100644 --- a/src/web-react/index.tsx +++ b/src/web-react/index.tsx @@ -66,6 +66,7 @@ export type { CatalogModel } from '../runtime/model-catalog' // ── metrics helpers ─────────────────────────────────────────────────────── +/** Describe metrics related to a chat message including model, token counts, and duration */ export interface ChatMessageMetrics { modelUsed?: string promptTokens?: number @@ -112,6 +113,7 @@ export interface ToolRunRecord { steps: ToolRunStep[] } +/** Define properties required to run a drill and handle its closure event */ export interface RunDrillInProps { run: ToolRunRecord onClose: () => void @@ -178,6 +180,7 @@ export function RunDrillIn({ run, onClose }: RunDrillInProps) { // ── ChatMessages ────────────────────────────────────────────────────────── +/** Describe the structure and state of a tool call within a chat interaction */ export interface ChatToolCallInfo { id: string name: string @@ -207,6 +210,7 @@ export type ChatMessageSegment = | { kind: 'text'; content: string } | { kind: 'tool'; call: ChatToolCallInfo } +/** Describe the structure and properties of a chat message with roles, content, and optional metadata */ export interface ChatUiMessage extends ChatMessageMetrics { id: string role: 'user' | 'assistant' | 'system' @@ -222,6 +226,7 @@ export interface ChatUiMessage extends ChatMessageMetrics { parts?: Array> } +/** Define properties for rendering chat messages with optional models, markdown, extras, and durable cards */ export interface ChatMessagesProps { messages: ChatUiMessage[] /** Catalogue models, for per-message cost from pricing. Pass [] to skip cost. */ @@ -279,6 +284,7 @@ export interface ChatEmptyDoor { onSelect: () => void } +/** Define properties for rendering the chat empty state with customizable text and starting doors */ export interface ChatEmptyStateProps { /** Product name shown next to the Tangle mark. Default "Agent". */ productName?: string @@ -332,6 +338,7 @@ export function ChatEmptyState({ ) } +/** Handle approval and rejection actions for proposals with asynchronous support */ export interface ProposalApprovalHandlers { onApprove: (proposalId: string, toolCallId: string) => void | Promise onReject: (proposalId: string, toolCallId: string) => void | Promise diff --git a/src/web-react/interaction-card-support.ts b/src/web-react/interaction-card-support.ts index 01465b7..5e99f90 100644 --- a/src/web-react/interaction-card-support.ts +++ b/src/web-react/interaction-card-support.ts @@ -44,6 +44,7 @@ export function interactionTerminalNotes( // --------------------------------------------------------------------------- // Answer building +/** Define a record mapping field names to objects with optional selected, text, and custom string arrays or values */ export type FieldValues = Record /** Converts acknowledged, persisted answers back into the local field state @@ -108,6 +109,7 @@ export function buildAnswerData(fields: ChatInteractionField[], values: FieldVal // a NEW chat turn carrying the question context, so the user's typed answer is // never dropped on the floor. +/** Determine if a status is late answerable by checking if it is expired or cancelled */ export function isLateAnswerableStatus(status: ChatInteractionStatus): boolean { return status === 'expired' || status === 'cancelled' } @@ -159,7 +161,9 @@ export function lateAnswerMessage(interaction: ChatInteraction, data: Interactio // --------------------------------------------------------------------------- // Submit plumbing +/** Define the timeout duration in milliseconds for submitting an interaction */ export const INTERACTION_SUBMIT_TIMEOUT_MS = 30_000 +/** Provide the timeout message displayed when the agent cannot be reached during interaction submission */ export const INTERACTION_SUBMIT_TIMEOUT_MESSAGE = 'Could not reach the agent. Try again.' /** One card submission: which ask, resolved how, with what answers. */ @@ -169,6 +173,7 @@ export interface InteractionAnswerSubmission { data?: InteractionData } +/** Resolve the result of an interaction submission indicating success or failure with details */ export type InteractionSubmitResult = | { ok: true } | { ok: false; expired: boolean; message: string } @@ -194,6 +199,7 @@ export async function responseErrorMessage(res: Response): Promise<{ code?: stri return { message: `Answer failed (${res.status})` } } +/** Define options for submitting interaction answers including URL, body, timeout, and fetch implementation */ export interface InteractionAnswerSubmitterOptions { /** The product's answer route (the POST half of `createInteractionAnswerRoute`). * A function when the URL carries the session (e.g. `/api/sessions/${id}/interactions`). */ diff --git a/src/web-react/sandbox-terminal.ts b/src/web-react/sandbox-terminal.ts index c703e50..0a47c71 100644 --- a/src/web-react/sandbox-terminal.ts +++ b/src/web-react/sandbox-terminal.ts @@ -1,5 +1,6 @@ import { useCallback, useEffect, useRef, useState } from 'react' +/** Define the connection details and status for a sandbox terminal session */ export interface SandboxTerminalConnection { runtimeUrl: string | null sidecarUrl: string | null @@ -11,6 +12,7 @@ export interface SandboxTerminalConnection { sandboxId?: string } +/** Define the response structure for a sandbox terminal connection including URLs, token, status, and errors */ export interface SandboxTerminalConnectionResponse { runtimeUrl?: string sidecarUrl?: string @@ -21,6 +23,7 @@ export interface SandboxTerminalConnectionResponse { sandboxId?: string } +/** Define options for configuring a sandbox terminal connection including workspace ID and connection parameters */ export interface UseSandboxTerminalConnectionOptions { workspaceId: string connectionUrl?: string | ((workspaceId: string) => string) @@ -30,6 +33,7 @@ export interface UseSandboxTerminalConnectionOptions { tokenRefreshSkewMs?: number } +/** Resolve sandbox terminal connection status and provide a method to initiate the connection */ export interface UseSandboxTerminalConnectionResult extends SandboxTerminalConnection { connect: () => Promise } @@ -48,6 +52,7 @@ const EMPTY_CONNECTION: SandboxTerminalConnection = { loading: false, } +/** Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling */ export function useSandboxTerminalConnection(opts: UseSandboxTerminalConnectionOptions): UseSandboxTerminalConnectionResult { const [conn, setConn] = useState(EMPTY_CONNECTION) const mountedRef = useRef(false) diff --git a/src/web-react/smooth-text.ts b/src/web-react/smooth-text.ts index 0e2ec0e..0aed635 100644 --- a/src/web-react/smooth-text.ts +++ b/src/web-react/smooth-text.ts @@ -10,6 +10,7 @@ import { useEffect, useRef, useState } from 'react' +/** Define configuration options for controlling smooth text reveal animation rates */ export interface SmoothRevealOptions { /** Baseline reveal rate when nearly caught up. Default 90 chars/s. */ baseCharsPerSecond?: number diff --git a/src/web-react/use-chat-interactions.ts b/src/web-react/use-chat-interactions.ts index f852d30..f692315 100644 --- a/src/web-react/use-chat-interactions.ts +++ b/src/web-react/use-chat-interactions.ts @@ -109,8 +109,10 @@ export function terminalizePendingChatInteractions( return list.map((item) => (item.status === 'pending' ? { ...item, status } : item)) } +/** Define modes for restoring chat interactions with legacy or durable strategies */ export type ChatInteractionRestoreMode = 'legacy' | 'durable' +/** Define options to control how chat interactions are restored during the restore process */ export interface RestoreChatInteractionsOptions { /** * `legacy` settles pending asks absent from the sidecar list as answered, @@ -168,6 +170,7 @@ export function hydrateChatInteractions( return persisted.reduce(upsertChatInteraction, list) } +/** Resolve and manage chat interactions with methods to update, cancel, mark resolved, and restore state */ export interface UseChatInteractionsResult { /** All known interactions, insertion-ordered. */ interactions: ChatInteraction[] @@ -189,8 +192,10 @@ export interface UseChatInteractionsResult { reset: () => void } +/** Resolve options for restoring chat interactions from previous sessions */ export type UseChatInteractionsOptions = RestoreChatInteractionsOptions +/** Manage chat interactions state with upsert, cancel, resolve, and restore capabilities */ export function useChatInteractions(options: UseChatInteractionsOptions = {}): UseChatInteractionsResult { const [interactions, setInteractions] = useState([]) diff --git a/src/web-react/use-composer-attachments.ts b/src/web-react/use-composer-attachments.ts index 1694f3c..e8ed3f8 100644 --- a/src/web-react/use-composer-attachments.ts +++ b/src/web-react/use-composer-attachments.ts @@ -65,6 +65,7 @@ interface StagedAttachment { errorMessage?: string } +/** Define options for configuring file upload behavior and handling in a composer component */ export interface UseComposerAttachmentsOptions { /** Simple upload target: every file POSTs here. Ignored when * `buildUploadRequest` is provided. */ @@ -100,6 +101,7 @@ export interface UseComposerAttachmentsOptions { enabled?: boolean } +/** Provide staged file chips, ready attachments, and methods to add, retry, or drop composer files */ export interface UseComposerAttachmentsResult { /** Chip models for `ChatComposer`'s `pendingFiles` prop, one per staged * file — `kind` is always `'file'` (agent-app's `ComposerFile.kind` diff --git a/src/web-react/use-file-mentions.ts b/src/web-react/use-file-mentions.ts index 42fc0fb..fe824c3 100644 --- a/src/web-react/use-file-mentions.ts +++ b/src/web-react/use-file-mentions.ts @@ -120,6 +120,7 @@ export const INDEX_REFRESH_AFTER_MS = 5 * 60 * 1000 * Loading/warming/error states have their own copy — see `emptyTextFor`. */ export const DEFAULT_MENTION_EMPTY_TEXT = 'No matching files' +/** Define options for configuring file mention fetching, caching, and display behavior */ export interface UseFileMentionsOptions { /** GET endpoint returning `FileIndexResponse` (a `createSandboxFileIndexRoute`). */ indexUrl: string @@ -135,6 +136,7 @@ export interface UseFileMentionsOptions { emptyText?: string } +/** Provide properties and methods to manage and refresh file mentions in a composer interface */ export interface UseFileMentionsResult { /** Spread straight into `AgentComposer`'s `mention` prop. */ mention: ComposerMentionProp @@ -167,6 +169,7 @@ function emptyTextFor(state: IndexState, fallback: string): string { } } +/** Resolve and manage file mention data with configurable fetching and state handling */ export function useFileMentions(options: UseFileMentionsOptions): UseFileMentionsResult { const { indexUrl, diff --git a/src/web/index.ts b/src/web/index.ts index 7902f6b..fd60b01 100644 --- a/src/web/index.ts +++ b/src/web/index.ts @@ -32,6 +32,7 @@ export function requireString(body: JsonObject, field: string): string | Respons return v } +/** Define the context of a request including IP address, user agent, timestamp, and request ID */ export interface RequestContext { ipAddress: string userAgent: string @@ -60,6 +61,7 @@ export interface KvLike { put(key: string, value: string, options?: { expirationTtl?: number }): Promise } +/** Describe the outcome of a rate limit check including allowance, remaining count, and reset time */ export interface RateLimitResult { allowed: boolean remaining: number @@ -117,6 +119,7 @@ function parseRateLimitState(raw: string | null): number[] | typeof POISONED_STA return parsed.filter((t): t is number => typeof t === 'number' && Number.isFinite(t)) } +/** Define options for configuring cookie attributes and behavior */ export interface CookieOptions { name: string /** Default '/'. */ @@ -167,6 +170,7 @@ export function readCookieValue(cookieHeader: string | null, name: string): stri return null } +/** Define options for configuring security-related HTTP headers including disclaimers and retention labels */ export interface SecurityHeaderOptions { /** Product disclaimer (e.g. "AI-powered tool. Not legal advice."). Omitted if absent. */ disclaimer?: string From 75086e474d8234de274dcff29c2268f956995644 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 24 Jul 2026 13:56:37 -0600 Subject: [PATCH 2/3] test(codemap): raise freshness-gate timeout above vitest's 5s default The generator's --check spawns a full source walk; with the JSDoc pass it now exceeds the 5000ms default in CI. Bump to 60s (it's a subprocess, not hot code). --- tests/codemap-fresh.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/codemap-fresh.test.ts b/tests/codemap-fresh.test.ts index 5f69ee5..fd4964b 100644 --- a/tests/codemap-fresh.test.ts +++ b/tests/codemap-fresh.test.ts @@ -19,9 +19,11 @@ const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..') const script = join(repoRoot, 'scripts', 'gen-codemap.mjs') describe('codemap freshness', () => { + // Spawns the generator over the whole source tree; the walk scales with the + // number of documented exports, so give it well over vitest's 5s default. it('committed docs/CODEMAP.md + docs/api/*.md match the current source', () => { const res = spawnSync(process.execPath, [script, '--check'], { encoding: 'utf8' }) const detail = `${res.stdout ?? ''}${res.stderr ?? ''}`.trim() expect(res.status, `codemap --check failed — run \`pnpm docs:gen\` and commit:\n${detail}`).toBe(0) - }) + }, 60_000) }) From 10bdc01cbd22cdc40da492c108173ed6ec4a1580 Mon Sep 17 00:00:00 2001 From: Drew Stone Date: Fri, 24 Jul 2026 14:01:34 -0600 Subject: [PATCH 3/3] chore(docs): trim app-specific features from the root barrel + dogfood agent-docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Trim — `/sequences` and `/design-canvas` are app-specific FEATURE surfaces (timeline editing, a design canvas), not shell mechanism every product wants. Removed from the root barrel; they stay importable as subpaths (`@tangle-network/agent-app/sequences`, `/design-canvas`). Keeps the root entry to shared mechanism instead of every product's features. `/studio` was already subpath-only. (Breaking only for a ROOT import of those symbols — switch to the subpath, which is the documented convention.) 2. Dogfood — agent-app now generates its docs with `@tangle-network/agent-docs` instead of the bespoke `scripts/gen-codemap.mjs` (deleted). `docs:gen` → `agent-docs`; the freshness gate runs `agent-docs --check`; docs/ now also carries `llms.txt` + `llms-full.txt` + `codemap.json` (the agent-readable surface). Deletes the first fleet copy of the generator. --- docs/CODEMAP.md | 12 +- docs/api/app-auth.md | 2 +- docs/api/assets.md | 2 +- docs/api/assistant.md | 2 +- docs/api/billing.md | 2 +- docs/api/brand-extraction.md | 2 +- docs/api/brand.md | 2 +- docs/api/catalog.md | 2 +- docs/api/chat-routes.md | 2 +- docs/api/chat-store.md | 2 +- docs/api/composer.md | 2 +- docs/api/config.md | 2 +- docs/api/crypto.md | 2 +- docs/api/design-canvas-drizzle.md | 2 +- docs/api/design-canvas-react-engine.md | 2 +- docs/api/design-canvas-react-lazy.md | 2 +- docs/api/design-canvas-react.md | 2 +- docs/api/design-canvas.md | 8 +- docs/api/durable-chat.md | 2 +- docs/api/eval-campaign.md | 2 +- docs/api/eval.md | 2 +- docs/api/harness.md | 2 +- docs/api/index.md | 1962 +- docs/api/intakes-api.md | 2 +- docs/api/intakes-drizzle.md | 2 +- docs/api/intakes-react-lazy.md | 2 +- docs/api/intakes-react.md | 2 +- docs/api/intakes.md | 2 +- docs/api/integrations.md | 2 +- docs/api/interactions.md | 2 +- docs/api/knowledge-loop.md | 2 +- docs/api/knowledge.md | 2 +- docs/api/missions.md | 2 +- docs/api/model-resolution.md | 2 +- docs/api/object-store.md | 2 +- docs/api/plans.md | 2 +- docs/api/platform.md | 2 +- docs/api/preflight.md | 2 +- docs/api/preset-cloudflare.md | 2 +- docs/api/profile.md | 2 +- docs/api/prompt.md | 2 +- docs/api/redact.md | 2 +- docs/api/run.md | 2 +- docs/api/runtime.md | 2 +- docs/api/sandbox.md | 2 +- docs/api/sequences-drizzle.md | 2 +- docs/api/sequences-react.md | 2 +- docs/api/sequences.md | 2 +- docs/api/skills-placement.md | 2 +- docs/api/skills.md | 2 +- docs/api/store.md | 2 +- docs/api/stream.md | 2 +- docs/api/studio-react.md | 2 +- docs/api/studio.md | 2 +- docs/api/tangle.md | 2 +- docs/api/teams-drizzle.md | 2 +- docs/api/teams-invitations-api.md | 2 +- docs/api/teams-members-api.md | 2 +- docs/api/teams-react-lazy.md | 2 +- docs/api/teams-react.md | 2 +- docs/api/teams-resend.md | 2 +- docs/api/teams.md | 2 +- docs/api/theme-contract-cli.md | 2 +- docs/api/theme-contract.md | 2 +- docs/api/theme-tailwind-preset.md | 2 +- docs/api/theme.md | 2 +- docs/api/tools.md | 2 +- docs/api/trace.md | 2 +- docs/api/turn-stream.md | 2 +- docs/api/vault-lazy.md | 2 +- docs/api/vault.md | 2 +- docs/api/web-react-terminal.md | 2 +- docs/api/web-react.md | 2 +- docs/api/web.md | 2 +- docs/codemap.json | 19383 +++++++++++++++++ docs/llms-full.txt | 25186 +++++++++++++++++++++++ docs/llms.txt | 81 + package.json | 3 +- pnpm-lock.yaml | 14 + scripts/gen-codemap.mjs | 282 - src/index.ts | 15 +- tests/codemap-fresh.test.ts | 23 +- 82 files changed, 44883 insertions(+), 2228 deletions(-) create mode 100644 docs/codemap.json create mode 100644 docs/llms-full.txt create mode 100644 docs/llms.txt delete mode 100644 scripts/gen-codemap.mjs diff --git a/docs/CODEMAP.md b/docs/CODEMAP.md index 2da0514..005e91c 100644 --- a/docs/CODEMAP.md +++ b/docs/CODEMAP.md @@ -1,12 +1,12 @@ - + # agent-app code map -_73 published subpaths — source of truth: `tsup.config.ts` `entry`. Regenerate with `pnpm docs:gen`._ +_73 entries — tsup.config `entry`. Regenerate with `agent-docs`._ -| Subpath | Exports | Depends on (siblings) | +| Entry | Exports | Depends on | |---|---|---| -| [`.`](api/index.md) | 982 | `assets`, `assistant`, `billing`, `brand`, `brand-extraction`, `chat-routes`, `chat-store`, `config`, `crypto`, `design-canvas`, `design-canvas-react`, `durable-chat`, `eval`, `eval-campaign`, `harness`, `intakes`, `intakes-react`, `integrations`, `interactions`, `knowledge`, `knowledge-loop`, `missions`, `model-resolution`, `object-store`, `plans`, `platform`, `preflight`, `preset-cloudflare`, `profile`, `prompt`, `redact`, `run`, `runtime`, `sandbox`, `sequences`, `sequences-react`, `skills`, `skills-placement`, `store`, `stream`, `studio`, `studio-react`, `tangle`, `teams`, `teams-react`, `theme`, `theme-contract`, `tools`, `trace`, `turn-stream`, `vault`, `web`, `web-react` | +| [`.`](api/index.md) | 766 | `assets`, `assistant`, `billing`, `brand`, `brand-extraction`, `chat-routes`, `chat-store`, `config`, `crypto`, `design-canvas`, `design-canvas-react`, `durable-chat`, `eval`, `eval-campaign`, `harness`, `intakes`, `intakes-react`, `integrations`, `interactions`, `knowledge`, `knowledge-loop`, `missions`, `model-resolution`, `object-store`, `plans`, `platform`, `preflight`, `preset-cloudflare`, `profile`, `prompt`, `redact`, `run`, `runtime`, `sandbox`, `sequences`, `sequences-react`, `skills`, `skills-placement`, `store`, `stream`, `studio`, `studio-react`, `tangle`, `teams`, `teams-react`, `theme`, `theme-contract`, `tools`, `trace`, `turn-stream`, `vault`, `web`, `web-react` | | [`./app-auth`](api/app-auth.md) | 11 | `platform` | | [`./assets`](api/assets.md) | 43 | — | | [`./assistant`](api/assistant.md) | 55 | `runtime`, `web-react` | @@ -84,11 +84,11 @@ _73 published subpaths — source of truth: `tsup.config.ts` `entry`. Regenerate ## `.` -Source: `src/index.ts` · 982 exports +Source: `src/index.ts` · 766 exports Depends on: `assets`, `assistant`, `billing`, `brand`, `brand-extraction`, `chat-routes`, `chat-store`, `config`, `crypto`, `design-canvas`, `design-canvas-react`, `durable-chat`, `eval`, `eval-campaign`, `harness`, `intakes`, `intakes-react`, `integrations`, `interactions`, `knowledge`, `knowledge-loop`, `missions`, `model-resolution`, `object-store`, `plans`, `platform`, `preflight`, `preset-cloudflare`, `profile`, `prompt`, `redact`, `run`, `runtime`, `sandbox`, `sequences`, `sequences-react`, `skills`, `skills-placement`, `store`, `stream`, `studio`, `studio-react`, `tangle`, `teams`, `teams-react`, `theme`, `theme-contract`, `tools`, `trace`, `turn-stream`, `vault`, `web`, `web-react` -`AddCaptionOperation`, `AddCitationArgs`, `AddCitationResult`, `AddElementOperation`, `AddPageOperation`, `addSecurityHeaders`, `AgentAppConfig`, `agentAppConfigJsonSchema`, `AgentAppTheme`, `AgentIdentityConfig`, `AgentIntegrationsConfig`, `AgentKnowledgeConfig`, `AgentRuntime`, `AgentRuntimeModelConfig`, `AgentTaxonomyConfig`, `AgentTurnOptions`, `AgentUiConfig`, `AnySurfaceKind`, `APP_TOOL_NAMES`, `applyBindingsToDocument`, `ApplyDataOperation`, `applyDurableInteractionAnswer`, `applyDurableInteractionAsk`, `applyDurableInteractionCancel`, `applyMissionEvent`, `applySceneOperation`, `applySceneOperations`, `ApplySceneOptions`, `applySequenceOperation`, `applySequenceOperations`, `ApprovalEvent`, `ApprovalEventSchema`, `AppToolContext`, `AppToolDefinition`, `AppToolDescriptor`, `AppToolHandlers`, `AppToolLoopOptions`, `AppToolMcpServer`, `AppToolName`, `AppToolOutcome`, `AppToolProducedEvent`, `AppToolRuntimeExecutor`, `AppToolTaxonomy`, `asMissionStreamEvent`, `asRecord`, `assertClipFitsSequence`, `assertColor`, `assertEnvWithinLimits`, `assertFinite`, `assertHarnessModelCompatible`, `assertMediaUrl`, `assertPositiveFinite`, `assertProvisionPayloadWithinCap`, `assertSafeKeySegment`, `assertSceneMediaSrc`, `assertSequenceMediaUrl`, `AssetContentMap`, `AssetFormat`, `AssetSpec`, `AssetStatus`, `AssetVariant`, `asString`, `attachmentInputToPart`, `attachmentKindForMime`, `attachmentPartKey`, `attachmentPartsFromMessageParts`, `attachReasoningEffort`, `AuthenticatedSandboxUser`, `AuthenticateOptions`, `authenticateToolRequest`, `bearerSubprotocolToken`, `bearerToken`, `BeforeInteractionAnswerArgs`, `BindSlotOperation`, `bleedAwareExportBounds`, `bleedAwareExportRect`, `Bounds`, `boundsIntersect`, `BrandTokens`, `BrandTokensSchema`, `BrokerToken`, `BrokerTokenMinter`, `BrokerTokenProvider`, `BrokerTokenProviderOptions`, `budgetGateProposalId`, `BufferedTurnEvent`, `BufferedTurnOptions`, `BufferedTurnTap`, `buildAgentMissionPlan`, `buildAppToolMcpServer`, `buildAppToolMcpServers`, `BuildAppToolMcpServersOptions`, `buildAppToolOpenAITools`, `BuildAppToolsOptions`, `buildAttachmentPromptBlock`, `buildCaptionChunks`, `BuildCaptionChunksOptions`, `buildCatalog`, `buildConsentUrl`, `buildContactSheetManifest`, `buildDesignCanvasMcpServerEntry`, `BuildDesignCanvasMcpServerEntryOptions`, `buildEdl`, `buildFlowTrace`, `buildHttpMcpServer`, `BuildHttpMcpServerOptions`, `buildKnowledgeRequirements`, `BuildMcpServerOptions`, `buildOtio`, `buildRedactedDocument`, `BuildRedactedDocumentOptions`, `buildSandboxRuntimeProxyHeaders`, `buildSandboxToolFileMounts`, `BuildSandboxToolFileMountsOptions`, `buildSandboxToolPathSetupScript`, `buildScopedMcpServerEntry`, `buildSequencesMcpServerEntry`, `BuildSequencesMcpServerEntryOptions`, `buildSrt`, `buildUserTextParts`, `buildVtt`, `BULK_DELETE_MAX_THREADS`, `cancelStatusFor`, `canTransitionInteractionStatus`, `canTransitionPlanStatus`, `CANVAS_ELEMENT_KINDS`, `CANVAS_MCP_TOOL_NAMES`, `CANVAS_MCP_TOOLS`, `CanvasRenderPalette`, `CapabilityTokenOptions`, `CaptionChunk`, `captionCoverage`, `CaptionCoverageEntry`, `CaptionExportOptions`, `CaptionTargetResolution`, `captionTrackNameForLanguage`, `CatalogModel`, `CertifiedDelivery`, `CertifiedDeliveryConfig`, `CHANNEL_PRESETS`, `ChannelPreset`, `ChannelPresetId`, `ChannelScaleResult`, `ChatAttachmentKind`, `ChatAttachmentPart`, `ChatFilePart`, `ChatImagePart`, `ChatInteraction`, `ChatInteractionField`, `ChatInteractionPart`, `ChatInteractionStatus`, `ChatMentionKind`, `ChatMentionPart`, `ChatMessagePart`, `ChatNoticePart`, `ChatPartTime`, `ChatPlan`, `ChatPlanPart`, `ChatPlanPersistedPart`, `ChatPlanStatus`, `ChatReasoningPart`, `ChatSelectField`, `ChatStepFinishPart`, `ChatStepStartPart`, `ChatStoreInputError`, `ChatSubtaskPart`, `ChatTextPart`, `ChatToolPart`, `ChatToolState`, `ChatToolStatus`, `ChatUsageTokens`, `checkRateLimit`, `checkThemeContract`, `childSpanContext`, `chooseCaptionPlacement`, `clampClipDuration`, `clampClipStart`, `classifySeveredStream`, `clearCookieHeader`, `coalesceChatStreamEvents`, `coalesceDeltas`, `coerceHarness`, `collapseRedundantTextParts`, `collectSlots`, `CompleteMissionInput`, `CompletionRequirement`, `CompletionVerdict`, `composeMissionFlowTrace`, `composerAnswerData`, `composerAnswerDeliveries`, `ComposerAnswerDelivery`, `ConsentUrlInput`, `ContactSheetEntry`, `ContactSheetManifest`, `ConversionMetrics`, `ConversionMetricsSchema`, `CookieOptions`, `CopyContent`, `CopyContentSchema`, `CopyPlatform`, `CorrectnessChecker`, `createAgentRuntime`, `CreateAgentRuntimeOptions`, `createAppToolRuntimeExecutor`, `createBrokerTokenProvider`, `createBufferedTurnTap`, `createCapabilityToken`, `createCertifiedDelivery`, `createD1KnowledgeStateAccessor`, `createD1TurnEventStore`, `createDesignCanvasMcpHandler`, `CreateDesignCanvasMcpHandlerOptions`, `createDurableChatEventProjection`, `createDurableChatScope`, `createDurableInteractionProjectionAdapter`, `createDurableInteractionRoutePersistence`, `CreateDurableInteractionRoutePersistenceOptions`, `createDurableInteractionSettlement`, `createDurablePlanRoutes`, `createEmptyDocument`, `createExpiringCapabilityToken`, `createFieldCrypto`, `createInMemoryDurableChatStateStore`, `createInMemoryMissionStore`, `createInteractionAnswerRoute`, `createKnowledgeLoop`, `CreateKnowledgeLoopDeps`, `createLlmCorrectnessChecker`, `createMcpToolHandler`, `CreateMcpToolHandlerOptions`, `createMemoryTurnEventStore`, `createMissionEngine`, `CreateMissionInput`, `createMissionService`, `createMissionTraceContext`, `createOpenAICompatStreamTurn`, `createPage`, `createPlatformBalanceManager`, `createPresetDrizzleSchema`, `createPresetFieldCrypto`, `createPresetToolHandlers`, `createPresetWorkspaceKeyManager`, `createPresetWorkspaceKeyStore`, `createProxiedArtifactRoute`, `createR2ObjectStore`, `createReviewerDecider`, `createSandboxTerminalToken`, `createSequencesMcpHandler`, `CreateSequencesMcpHandlerOptions`, `createSurfaceRegistry`, `createTangleRouterModelConfig`, `CreateTangleRouterModelConfigOptions`, `createTcloudKeyProvisioner`, `createTokenRecallChecker`, `CreateTrackOperation`, `createWorkspaceKeyManager`, `createWorkspaceSandboxConnectionHandler`, `createWorkspaceSandboxManager`, `createWorkspaceSandboxRuntimeProxyHandler`, `createWorkspaceSandboxTerminalUpgradeHandler`, `customToolToOpenAI`, `D1Like`, `D1LikeForTurns`, `D1PreparedLike`, `darkTheme`, `decodeHexKey`, `decryptAesGcm`, `decryptBytes`, `decryptWithKey`, `dedupeQuestionInteractionsByContent`, `DEFAULT_APP_TOOL_PATHS`, `DEFAULT_ATTACHMENT_PROMPT_HEADER`, `DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION`, `DEFAULT_HARNESS`, `DEFAULT_HEADER_NAMES`, `DEFAULT_MISSION_STEP_KINDS`, `DEFAULT_REDACTION_PATTERNS`, `DEFAULT_SANDBOX_RESOURCES`, `DEFAULT_SEQUENCES_MCP_DESCRIPTION`, `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR`, `DEFAULT_TANGLE_ROUTER_BASE_URL`, `deferredCorpusHash`, `defineAgentApp`, `defineAppTool`, `defineSurfaceKind`, `delegationActivityToFlowSpans`, `DeleteClipOperation`, `DeleteElementOperation`, `DeletePageOperation`, `deleteSecret`, `deriveKey`, `DeriveKeyOptions`, `deriveSignals`, `DesignCanvasMcpServerInfo`, `DesignCanvasMcpToolEnv`, `detectInteractiveQuestion`, `detectSpans`, `dispatchAppTool`, `DispatchOptions`, `DistributionSummary`, `driveSandboxTurn`, `DriveSandboxTurnOptions`, `DrizzleColumnLike`, `DrizzleSqliteCoreLike`, `DuplicatePageOperation`, `DurableAnswerIntentJournal`, `DurableAnswerIntentRecord`, `DurableAnswerIntentState`, `DurableChatConflictError`, `DurableChatError`, `DurableChatErrorCode`, `DurableChatEventProjection`, `DurableChatGoneError`, `DurableChatScope`, `durableChatScopeKey`, `DurableChatStateStore`, `DurableChatUnavailableError`, `DurableFollowUpReceipt`, `DurableInteractionAcknowledgement`, `DurableInteractionGuarantee`, `durableInteractionIntentKey`, `DurableInteractionProjection`, `DurableInteractionProjectionAdapter`, `DurableInteractionRouteArgs`, `DurableInteractionRoutePersistence`, `DurableInteractionSettlement`, `DurableInteractionSettlementFactoryOptions`, `DurableInteractionSettlementOptions`, `DurablePlanAuthority`, `DurablePlanAuthorityCurrentResult`, `DurablePlanAuthorityDecision`, `DurablePlanAuthorityResult`, `DurablePlanAuthorization`, `DurablePlanCommandJournal`, `DurablePlanCommandKey`, `DurablePlanCommandRecord`, `DurablePlanCommandState`, `DurablePlanDecision`, `DurablePlanEffectRecord`, `DurablePlanProjection`, `DurablePlanRouteAuthorizeArgs`, `DurablePlanRouteOptions`, `DurablePlanRoutes`, `DurablePlanStateStore`, `DurablePlanStore`, `elementAabb`, `elementExtent`, `EllipseElement`, `EmailBodySection`, `EmailContent`, `EmailContentSchema`, `EmailCtaSection`, `EmailDividerSection`, `EmailFeatureSection`, `EmailHeroSection`, `EmailSection`, `EmailTestimonialSection`, `encodeEvent`, `encodeSandboxRuntimePath`, `encryptAesGcm`, `encryptBytes`, `encryptWithKey`, `ensureWorkspaceSandbox`, `EnsureWorkspaceSandboxOptions`, `ENV_TOTAL_MAX_BYTES`, `ENV_VALUE_MAX_BYTES`, `estimateTextHeight`, `ExpiringCapabilityTokenOptions`, `EXPORT_PRESETS`, `ExportCropRect`, `ExportFormat`, `ExportPreset`, `ExtendSequenceOperation`, `extractProducedState`, `extractRequestContext`, `fetchModelCatalog`, `fieldAcceptsFreeText`, `finalizeAssistantParts`, `finalizePendingInteractionParts`, `findCanvasMcpTool`, `findCustomTool`, `findElement`, `findPreset`, `findSequenceMcpTool`, `flattenHistory`, `FlowSpan`, `FlowTrace`, `formatPreflightReport`, `formatSeconds`, `formatTimecode`, `framesToSeconds`, `getClient`, `getPartKey`, `GroupElement`, `GroupElementsOperation`, `handleAppToolRequest`, `HandleToolRequestOptions`, `Harness`, `historyContentWithAttachments`, `httpHeadProbe`, `HttpHeadProbeConfig`, `HubExecClient`, `HubExecClientOptions`, `HubExecErrorCode`, `HubExecResult`, `HubInvokeDeps`, `HubInvokeInput`, `HubInvokeOutcome`, `ImageBackground`, `ImageContent`, `ImageContentSchema`, `ImageElement`, `ImageImageLayer`, `ImageLayer`, `ImageLayerType`, `ImageLogoLayer`, `ImageShapeLayer`, `ImageSlide`, `ImageTextLayer`, `InMemoryDurableChatStateStore`, `InMemoryDurableChatStore`, `InMemoryMissionStore`, `InstantiateOptions`, `instantiateTemplate`, `INTERACTION_CANCEL_EVENT`, `INTERACTION_EVENT`, `INTERACTION_RESOLVED_EVENT`, `InteractionAnswerBodyValidation`, `InteractionAnswerRoute`, `InteractionAnswerRouteOptions`, `InteractionAnswers`, `InteractionAnswerValue`, `InteractionCancelData`, `InteractionClientOutcome`, `InteractionConnectionResolution`, `InteractionData`, `interactionFromWireRequest`, `InteractionOutcome`, `interactionPartKey`, `InteractionPersistedPart`, `InteractionRequest`, `InteractionRequestWire`, `InteractionRouteLogger`, `interactionToPersistedPart`, `invokeIntegrationHub`, `isAppToolName`, `isChatAttachmentPart`, `isChatInteractionPart`, `isChatMentionPart`, `isChatPlanPart`, `isChatStepFinishPart`, `isChatTextPart`, `isChatToolPart`, `isHarness`, `isMissionStopRequested`, `isMissionTerminal`, `isModelCompatibleWithHarness`, `isRenderableInteractionKind`, `isSafeInteractionFieldKey`, `isSandboxTerminalWsUpgrade`, `isTangleBillingEnforcementDisabled`, `isTangleExecutionKeyError`, `isTerminalInteractionStatus`, `isTerminalPromptEvent`, `JsonObject`, `JsonRecord`, `KeyCrypto`, `KeyProvisioner`, `KnowledgeCandidate`, `KnowledgeDecider`, `KnowledgeDeciderInput`, `KnowledgeDecision`, `KnowledgeGateVerdict`, `KnowledgeLoop`, `KnowledgeLoopConfig`, `KnowledgeLoopDriver`, `KnowledgeRequirementSpec`, `KnowledgeSignal`, `KnowledgeSourceSpec`, `KnowledgeStateAccessor`, `KNOWN_HARNESSES`, `KvLike`, `LanguageFanoutOptions`, `lastClipEndFrame`, `lightTheme`, `LineElement`, `listSessionInteractions`, `listTemplateSlots`, `LivenessProbeConfig`, `LoopAssistantToolCall`, `LoopEvent`, `LoopMessage`, `LoopToolCall`, `LoopTraceEventLike`, `loopTraceEventsToFlowSpans`, `mapInteractionRespondFailure`, `maskSpans`, `matchPreset`, `matchSandboxTerminalWsPath`, `MAX_CAPTION_BATCH`, `MCP_PROTOCOL_VERSIONS`, `McpProtocolVersion`, `McpServerInfo`, `McpToolDefinition`, `MemberSyncSeam`, `mentionInputToPart`, `mentionPartsFromMessageParts`, `mergeExtraMcp`, `mergeHistoryIntoParts`, `mergeMissionState`, `mergePersistedPart`, `mergeSurfaceOverlay`, `messageHasTurnId`, `MIN_SEQUENCE_CLIP_FRAMES`, `mintSandboxScopedToken`, `mintTerminalProxyToken`, `MISSING_TOOL_TERMINAL_ERROR`, `MISSING_TOOL_TERMINAL_REASON`, `MISSION_CONTROL_CHANNEL_ID`, `MissionApprovalsPort`, `MissionAuditEvent`, `MissionConcurrencyError`, `MissionCostLedger`, `MissionEngine`, `MissionEngineOptions`, `MissionEventSink`, `MissionFlowStep`, `MissionGateKind`, `MissionGateOptions`, `MissionGateProposal`, `MissionOutcome`, `MissionPlanRunOptions`, `MissionProposalResolution`, `MissionRecord`, `MissionService`, `MissionServiceOptions`, `MissionState`, `MissionStatus`, `MissionStep`, `MissionStepState`, `MissionStepStatus`, `MissionStorePort`, `MissionStreamEvent`, `MissionStreamStatus`, `MissionStreamStep`, `MissionStreamStepStatus`, `MissionTraceContext`, `MissionUpdateGuard`, `MissionUpdatePatch`, `ModelCatalog`, `modelProvider`, `MoveClipOperation`, `NewPageOptions`, `NewSceneDecision`, `NewSequenceClip`, `NewSequenceDecision`, `NewSequenceTrack`, `noopEventSink`, `normalizeClientTurnId`, `normalizeLanguageTag`, `normalizeModelId`, `normalizePersistedPart`, `normalizePlanDecision`, `normalizeTime`, `normalizeToolEvent`, `NoticeKind`, `noticePart`, `noticePartKey`, `NoticePersistedPart`, `ObjectBody`, `objectKey`, `ObjectKeyParts`, `ObjectStore`, `OpenAICompatStreamTurnOptions`, `OpenAIFunctionTool`, `OpenAIStreamChunk`, `OtioClip`, `OtioExternalReference`, `OtioGap`, `OtioMissingReference`, `OtioRationalTime`, `OtioStack`, `OtioTimeline`, `OtioTimeRange`, `OtioTrack`, `Outcome`, `outcomeStatus`, `PageBleed`, `PageGuides`, `parseAssetSpec`, `ParsedIntegrationAction`, `ParsedMission`, `ParsedMissionStep`, `parseInteractionAnswers`, `ParseInteractionAnswersResult`, `parseInteractionCancel`, `parseInteractionRequest`, `ParseInteractionResult`, `parseJsonObjectBody`, `parseMissionBlocks`, `ParseMissionBlocksOptions`, `parsePlanSubmittedEvent`, `ParsePlanSubmittedResult`, `parseSequenceOperations`, `parseSessionStreamEnvelope`, `peekWorkspaceSandbox`, `PeekWorkspaceSandboxOutcome`, `PersistedChatMessageForTurn`, `persistedPartToInteraction`, `persistedPartToPlan`, `PlaceClipOperation`, `PLAN_SUBMITTED_EVENT`, `planAuthorityIdempotencyKey`, `planCommandKey`, `planEffectKey`, `planFollowUpTurnId`, `planLanguageFanout`, `PlanLimit`, `PlanOutcome`, `planPartKey`, `planRevisionKey`, `planToPersistedPart`, `PlatformBalanceInfo`, `PlatformBalanceManager`, `PlatformBalanceManagerOptions`, `PlatformBillingClient`, `PlatformIdentity`, `PlatformProductUsage`, `PreflightProbe`, `PreflightProbeResult`, `PreflightProbeVerdict`, `PreflightReport`, `PreparedDurableInteractionAnswer`, `PRESET_MIGRATION_SQL`, `PRESET_TABLES`, `PresetBillingOptions`, `PresetKnowledgeAccessorOptions`, `PresetToolHandlerOptions`, `producedFromToolEvents`, `ProducedState`, `ProfileComposeOptions`, `PromptInputPart`, `ProviderResolutionConfig`, `PROVISION_PAYLOAD_MAX_BYTES`, `ProvisionPayloadSections`, `ProvisionProfileSection`, `pumpBufferedTurn`, `PumpBufferedTurnOptions`, `PutObjectOptions`, `questionInteractionContentSignature`, `QueueExportOperation`, `R2LikeBucket`, `R2LikeObjectBody`, `R2LikeObjectHead`, `RateLimitResult`, `readCookieValue`, `readSandboxBinaryBytes`, `readSecret`, `readToolArgs`, `recordDurableInteractionAnswer`, `recordDurableInteractionCancel`, `RectElement`, `RedactedDocSegment`, `RedactedDocument`, `redactForIngestion`, `RedactForIngestionOptions`, `RedactionPattern`, `RedactionSpan`, `reduceMissionEvents`, `renderHistogram`, `RenderUiArgs`, `RenderUiResult`, `renderWaterfall`, `ReorderElementOperation`, `ReorderPageOperation`, `replayTurnEvents`, `ReplayTurnEventsOptions`, `RequestContext`, `requireChannelPreset`, `requireElement`, `requirePage`, `requireString`, `resetClientCache`, `resolveCaptionPlacement`, `resolveCaptionTarget`, `resolveChatTurn`, `ResolvedAgentProfile`, `ResolvedChatTurn`, `ResolvedModel`, `ResolvedSessionHarness`, `ResolvedTangleExecutionKey`, `ResolvedToolCapabilities`, `resolveIntegrationAction`, `ResolveInteractionConnectionArgs`, `resolveModel`, `ResolveModelOptions`, `resolvePlaceClipTrack`, `resolveSandboxClientCredentials`, `ResolveSandboxClientCredentialsOptions`, `resolveSessionHarness`, `ResolveSessionHarnessInput`, `resolveTangleDevOrUserKey`, `ResolveTangleDevOrUserKeyOptions`, `resolveTangleExecutionEnvironment`, `resolveTangleModelConfig`, `resolveToolCapabilities`, `ResolveToolCapabilitiesOptions`, `resolveToolId`, `resolveToolName`, `resolveUserTangleExecutionKey`, `resolveUserTangleExecutionKeyForUser`, `ResolveUserTangleExecutionKeyForUserOptions`, `ResolveUserTangleExecutionKeyOptions`, `respondToSessionInteraction`, `restrictTaxonomy`, `RetryableStepError`, `RevealResult`, `revealSpan`, `RevealSpanOptions`, `reviewCandidate`, `routerChatProbe`, `RouterChatProbeConfig`, `RouterModel`, `runAppToolLoop`, `runPreflight`, `runSandboxPrompt`, `runSandboxToolPathSetup`, `RuntimeEventLike`, `RuntimeExecutorOptions`, `safeParseAssetSpec`, `SandboxApiCredentials`, `sandboxAuthProbe`, `SandboxAuthProbeConfig`, `SandboxBuildContext`, `SandboxClientCredentials`, `SandboxCredentialEnvironment`, `SandboxDispatch`, `SandboxDispatchDoneResult`, `SandboxDispatchInProgressResult`, `SandboxDispatchInput`, `SandboxDispatchResult`, `SandboxExecChannel`, `SandboxExecOptions`, `SandboxFileBytesOutcome`, `SandboxFileSizeOutcome`, `SandboxPermissionLevel`, `SandboxResourceConfig`, `SandboxRestoreSpec`, `SandboxRuntimeAuthRefreshError`, `SandboxRuntimeConfig`, `SandboxRuntimeConnection`, `SandboxScope`, `SandboxStepTransition`, `SandboxTerminalTokenOptions`, `SandboxTerminalTokenResult`, `SandboxTerminalTokenSubject`, `SandboxTerminalWsMatch`, `sandboxToolBinDir`, `sandboxToolPath`, `SandboxToolPathOptions`, `sandboxToolRootDir`, `SandboxToolSpec`, `SatisfiedBy`, `SatisfiedByRule`, `scaleForPreset`, `scalePageForChannelPreset`, `SCENE_ELEMENT_KINDS`, `SCENE_OPERATION_TYPES`, `SCENE_SCHEMA_VERSION`, `SceneApplyResult`, `SceneAttrsPatch`, `SceneDecision`, `SceneDocument`, `SceneDocumentRecord`, `SceneElement`, `SceneElementBase`, `SceneElementKind`, `SceneExportFormat`, `SceneExportRecord`, `SceneOperation`, `SceneOperationType`, `ScenePage`, `ScenePlan`, `SceneSettings`, `SceneStore`, `SceneStoreScope`, `ScheduleFollowupArgs`, `ScheduleFollowupResult`, `ScopedMcpServerEntryOptions`, `ScopedTokenResult`, `secondsToFrames`, `SecretStore`, `secretStoreFromClient`, `SecurityHeaderOptions`, `SEQUENCE_EXPORT_FORMATS`, `SEQUENCE_MCP_TOOLS`, `SEQUENCE_MEDIA_KINDS`, `SEQUENCE_OPERATION_TYPES`, `SEQUENCE_TRACK_KINDS`, `SequenceApplyResult`, `SequenceClip`, `SequenceClipMedia`, `SequenceClipPatch`, `SequenceDecision`, `SequenceExportFormat`, `SequenceExportRecord`, `SequenceExportStatus`, `SequenceFrameSnapshot`, `SequenceMcpToolDefinition`, `SequenceMcpToolEnv`, `SequenceMediaKind`, `SequenceMeta`, `SequenceOperation`, `SequenceOperationContext`, `SequenceOperationType`, `SequencePlan`, `SEQUENCES_MCP_PROTOCOL_VERSIONS`, `SequencesMcpServerInfo`, `SequenceStatus`, `SequenceStore`, `SequenceStoreScope`, `SequenceTimeline`, `SequenceTrack`, `SequenceTrackKind`, `serializeCookie`, `SetAttrsOperation`, `SetClipDisabledOperation`, `SetClipTextOperation`, `SetDocumentTitleOperation`, `SetPageGuidesOperation`, `SetPagePropsOperation`, `SetStepStatusPatch`, `SharedBillingState`, `shellQuote`, `SidecarInteractionsConnection`, `SidecarInteractionsError`, `SidecarInteractionsResult`, `signObjectUrl`, `SignObjectUrlArgs`, `SIZE_PRESETS`, `SizePreset`, `SlotFillKind`, `snapHarnessToModel`, `snapModelToHarness`, `snapshotFrame`, `SplitClipOperation`, `splitDeferredProfileFiles`, `stablePlanReceipt`, `stampInteractionAnswers`, `statSandboxFileSize`, `stepActivityFlowTrace`, `stepAgentActivity`, `StepAgentActivity`, `StepGateClassification`, `stepGateProposalId`, `StepOutcome`, `StepSpanContext`, `StoppedSandboxResumeFailure`, `StoppedSandboxResumeRecovery`, `StorableHarnessPartKind`, `StorageConfig`, `storeApplyScenePlan`, `storeSecret`, `streamAppToolLoop`, `StreamAppToolLoopOptions`, `StreamEvent`, `StreamLoopYield`, `streamSandboxPrompt`, `StreamSandboxPromptOptions`, `SubmitProposalArgs`, `SubmitProposalResult`, `summarize`, `SurfaceKindDefinition`, `SurfaceMcpServer`, `SurfaceMergeBase`, `SurfaceOverlay`, `SurfacePermissionValue`, `SurfaceRegistry`, `syncSandboxMemberAdd`, `syncSandboxMemberRemove`, `syncSandboxMemberRole`, `TangleBillingEnforcementOptions`, `TangleExecutionEnvironment`, `TangleExecutionKeyError`, `TangleExecutionKeyErrorCode`, `tangleExecutionKeyHttpError`, `TangleExecutionKeyHttpError`, `TangleExecutionKeySource`, `TangleModelConfig`, `TaskGold`, `TcloudKeyClient`, `TemplateSlot`, `terminalizeDanglingAssistantToolUpdates`, `terminalizeDanglingToolPart`, `terminalizeDanglingToolParts`, `TerminalProxyIdentity`, `terminalTokenFromRequest`, `TextElement`, `themeColor`, `ThemeContractMiss`, `ThemeContractOptions`, `ThemeContractResult`, `themeToCssVars`, `threadTitleFromMessage`, `TimedEvent`, `timedEventsFromLines`, `TimelineClipBounds`, `TimelineInterval`, `toChatMessageParts`, `toLoopEvents`, `ToolAuthResult`, `ToolCapability`, `ToolHeaderNames`, `ToolInputError`, `ToolLoopEvent`, `ToolLoopResult`, `ToolLoopStopReason`, `traceEnv`, `trackIntervals`, `TranscriptSegment`, `TrimClipOperation`, `trimOrNull`, `TURN_EVENTS_MIGRATION_SQL`, `TURN_STATUS_SCOPE_MIGRATION_SQL`, `TurnEventStore`, `TurnStatus`, `UngroupElementOperation`, `upsertDurableInteractionAsk`, `validateAddCaption`, `validateBindings`, `validateCreateTrack`, `validateDeleteClip`, `validateExtendSequence`, `validateInteractionAnswerBody`, `validateMoveClip`, `validatePlaceClip`, `validateQueueExport`, `validateSceneOperation`, `validateSceneOperations`, `validateSequenceOperation`, `validateSequenceOperations`, `validateSetClipDisabled`, `validateSetClipText`, `validateSlotValue`, `validateSplitClip`, `validateTrimClip`, `VaultKv`, `verifyCapabilityToken`, `verifyCompletion`, `verifyExpiringCapabilityToken`, `verifyObjectUrl`, `VerifyObjectUrlResult`, `verifySandboxTerminalToken`, `verifyTerminalProxyToken`, `VideoCaption`, `VideoContent`, `VideoContentSchema`, `VideoCountdownScene`, `VideoElement`, `VideoImageRevealScene`, `VideoScene`, `VideoSlideScene`, `VideoTextAnimationScene`, `volumeGateProposalId`, `weightedComposite`, `WithAgentActivity`, `WorkspaceKeyManager`, `WorkspaceKeyManagerOptions`, `WorkspaceKeyRecord`, `WorkspaceKeyStore`, `WorkspaceModelKeyUsage`, `WorkspaceSandboxConnectionArgs`, `WorkspaceSandboxConnectionHandlerOptions`, `WorkspaceSandboxEnsureContext`, `WorkspaceSandboxInstanceLike`, `WorkspaceSandboxManager`, `WorkspaceSandboxManagerOptions`, `WorkspaceSandboxRuntimeProxyArgs`, `WorkspaceSandboxRuntimeProxyHandlerOptions`, `WorkspaceSandboxTerminalUpgradeHandlerOptions`, `WriteProfileFilesOptions`, `writeProfileFilesToBox` +`AddCitationArgs`, `AddCitationResult`, `addSecurityHeaders`, `AgentAppConfig`, `agentAppConfigJsonSchema`, `AgentAppTheme`, `AgentIdentityConfig`, `AgentIntegrationsConfig`, `AgentKnowledgeConfig`, `AgentRuntime`, `AgentRuntimeModelConfig`, `AgentTaxonomyConfig`, `AgentTurnOptions`, `AgentUiConfig`, `AnySurfaceKind`, `APP_TOOL_NAMES`, `applyDurableInteractionAnswer`, `applyDurableInteractionAsk`, `applyDurableInteractionCancel`, `applyMissionEvent`, `ApprovalEvent`, `ApprovalEventSchema`, `AppToolContext`, `AppToolDefinition`, `AppToolDescriptor`, `AppToolHandlers`, `AppToolLoopOptions`, `AppToolMcpServer`, `AppToolName`, `AppToolOutcome`, `AppToolProducedEvent`, `AppToolRuntimeExecutor`, `AppToolTaxonomy`, `asMissionStreamEvent`, `asRecord`, `assertEnvWithinLimits`, `assertHarnessModelCompatible`, `assertMediaUrl`, `assertProvisionPayloadWithinCap`, `assertSafeKeySegment`, `AssetContentMap`, `AssetFormat`, `AssetSpec`, `AssetStatus`, `AssetVariant`, `asString`, `attachmentInputToPart`, `attachmentKindForMime`, `attachmentPartKey`, `attachmentPartsFromMessageParts`, `attachReasoningEffort`, `AuthenticatedSandboxUser`, `AuthenticateOptions`, `authenticateToolRequest`, `bearerSubprotocolToken`, `bearerToken`, `BeforeInteractionAnswerArgs`, `BrandTokens`, `BrandTokensSchema`, `BrokerToken`, `BrokerTokenMinter`, `BrokerTokenProvider`, `BrokerTokenProviderOptions`, `budgetGateProposalId`, `BufferedTurnEvent`, `BufferedTurnOptions`, `BufferedTurnTap`, `buildAgentMissionPlan`, `buildAppToolMcpServer`, `buildAppToolMcpServers`, `BuildAppToolMcpServersOptions`, `buildAppToolOpenAITools`, `BuildAppToolsOptions`, `buildAttachmentPromptBlock`, `buildCatalog`, `buildConsentUrl`, `buildFlowTrace`, `buildHttpMcpServer`, `BuildHttpMcpServerOptions`, `buildKnowledgeRequirements`, `BuildMcpServerOptions`, `buildRedactedDocument`, `BuildRedactedDocumentOptions`, `buildSandboxRuntimeProxyHeaders`, `buildSandboxToolFileMounts`, `BuildSandboxToolFileMountsOptions`, `buildSandboxToolPathSetupScript`, `buildScopedMcpServerEntry`, `buildUserTextParts`, `BULK_DELETE_MAX_THREADS`, `cancelStatusFor`, `canTransitionInteractionStatus`, `canTransitionPlanStatus`, `CanvasRenderPalette`, `CapabilityTokenOptions`, `CatalogModel`, `CertifiedDelivery`, `CertifiedDeliveryConfig`, `ChatAttachmentKind`, `ChatAttachmentPart`, `ChatFilePart`, `ChatImagePart`, `ChatInteraction`, `ChatInteractionField`, `ChatInteractionPart`, `ChatInteractionStatus`, `ChatMentionKind`, `ChatMentionPart`, `ChatMessagePart`, `ChatNoticePart`, `ChatPartTime`, `ChatPlan`, `ChatPlanPart`, `ChatPlanPersistedPart`, `ChatPlanStatus`, `ChatReasoningPart`, `ChatSelectField`, `ChatStepFinishPart`, `ChatStepStartPart`, `ChatStoreInputError`, `ChatSubtaskPart`, `ChatTextPart`, `ChatToolPart`, `ChatToolState`, `ChatToolStatus`, `ChatUsageTokens`, `checkRateLimit`, `checkThemeContract`, `childSpanContext`, `classifySeveredStream`, `clearCookieHeader`, `coalesceChatStreamEvents`, `coalesceDeltas`, `coerceHarness`, `collapseRedundantTextParts`, `CompleteMissionInput`, `CompletionRequirement`, `CompletionVerdict`, `composeMissionFlowTrace`, `composerAnswerData`, `composerAnswerDeliveries`, `ComposerAnswerDelivery`, `ConsentUrlInput`, `ConversionMetrics`, `ConversionMetricsSchema`, `CookieOptions`, `CopyContent`, `CopyContentSchema`, `CopyPlatform`, `CorrectnessChecker`, `createAgentRuntime`, `CreateAgentRuntimeOptions`, `createAppToolRuntimeExecutor`, `createBrokerTokenProvider`, `createBufferedTurnTap`, `createCapabilityToken`, `createCertifiedDelivery`, `createD1KnowledgeStateAccessor`, `createD1TurnEventStore`, `createDurableChatEventProjection`, `createDurableChatScope`, `createDurableInteractionProjectionAdapter`, `createDurableInteractionRoutePersistence`, `CreateDurableInteractionRoutePersistenceOptions`, `createDurableInteractionSettlement`, `createDurablePlanRoutes`, `createExpiringCapabilityToken`, `createFieldCrypto`, `createInMemoryDurableChatStateStore`, `createInMemoryMissionStore`, `createInteractionAnswerRoute`, `createKnowledgeLoop`, `CreateKnowledgeLoopDeps`, `createLlmCorrectnessChecker`, `createMcpToolHandler`, `CreateMcpToolHandlerOptions`, `createMemoryTurnEventStore`, `createMissionEngine`, `CreateMissionInput`, `createMissionService`, `createMissionTraceContext`, `createOpenAICompatStreamTurn`, `createPlatformBalanceManager`, `createPresetDrizzleSchema`, `createPresetFieldCrypto`, `createPresetToolHandlers`, `createPresetWorkspaceKeyManager`, `createPresetWorkspaceKeyStore`, `createProxiedArtifactRoute`, `createR2ObjectStore`, `createReviewerDecider`, `createSandboxTerminalToken`, `createSurfaceRegistry`, `createTangleRouterModelConfig`, `CreateTangleRouterModelConfigOptions`, `createTcloudKeyProvisioner`, `createTokenRecallChecker`, `createWorkspaceKeyManager`, `createWorkspaceSandboxConnectionHandler`, `createWorkspaceSandboxManager`, `createWorkspaceSandboxRuntimeProxyHandler`, `createWorkspaceSandboxTerminalUpgradeHandler`, `customToolToOpenAI`, `D1Like`, `D1LikeForTurns`, `D1PreparedLike`, `darkTheme`, `decodeHexKey`, `decryptAesGcm`, `decryptBytes`, `decryptWithKey`, `dedupeQuestionInteractionsByContent`, `DEFAULT_APP_TOOL_PATHS`, `DEFAULT_ATTACHMENT_PROMPT_HEADER`, `DEFAULT_HARNESS`, `DEFAULT_HEADER_NAMES`, `DEFAULT_MISSION_STEP_KINDS`, `DEFAULT_REDACTION_PATTERNS`, `DEFAULT_SANDBOX_RESOURCES`, `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR`, `DEFAULT_TANGLE_ROUTER_BASE_URL`, `deferredCorpusHash`, `defineAgentApp`, `defineAppTool`, `defineSurfaceKind`, `delegationActivityToFlowSpans`, `deleteSecret`, `deriveKey`, `DeriveKeyOptions`, `deriveSignals`, `detectInteractiveQuestion`, `detectSpans`, `dispatchAppTool`, `DispatchOptions`, `DistributionSummary`, `driveSandboxTurn`, `DriveSandboxTurnOptions`, `DrizzleColumnLike`, `DrizzleSqliteCoreLike`, `DurableAnswerIntentJournal`, `DurableAnswerIntentRecord`, `DurableAnswerIntentState`, `DurableChatConflictError`, `DurableChatError`, `DurableChatErrorCode`, `DurableChatEventProjection`, `DurableChatGoneError`, `DurableChatScope`, `durableChatScopeKey`, `DurableChatStateStore`, `DurableChatUnavailableError`, `DurableFollowUpReceipt`, `DurableInteractionAcknowledgement`, `DurableInteractionGuarantee`, `durableInteractionIntentKey`, `DurableInteractionProjection`, `DurableInteractionProjectionAdapter`, `DurableInteractionRouteArgs`, `DurableInteractionRoutePersistence`, `DurableInteractionSettlement`, `DurableInteractionSettlementFactoryOptions`, `DurableInteractionSettlementOptions`, `DurablePlanAuthority`, `DurablePlanAuthorityCurrentResult`, `DurablePlanAuthorityDecision`, `DurablePlanAuthorityResult`, `DurablePlanAuthorization`, `DurablePlanCommandJournal`, `DurablePlanCommandKey`, `DurablePlanCommandRecord`, `DurablePlanCommandState`, `DurablePlanDecision`, `DurablePlanEffectRecord`, `DurablePlanProjection`, `DurablePlanRouteAuthorizeArgs`, `DurablePlanRouteOptions`, `DurablePlanRoutes`, `DurablePlanStateStore`, `DurablePlanStore`, `EmailBodySection`, `EmailContent`, `EmailContentSchema`, `EmailCtaSection`, `EmailDividerSection`, `EmailFeatureSection`, `EmailHeroSection`, `EmailSection`, `EmailTestimonialSection`, `encodeEvent`, `encodeSandboxRuntimePath`, `encryptAesGcm`, `encryptBytes`, `encryptWithKey`, `ensureWorkspaceSandbox`, `EnsureWorkspaceSandboxOptions`, `ENV_TOTAL_MAX_BYTES`, `ENV_VALUE_MAX_BYTES`, `ExpiringCapabilityTokenOptions`, `extractProducedState`, `extractRequestContext`, `fetchModelCatalog`, `fieldAcceptsFreeText`, `finalizeAssistantParts`, `finalizePendingInteractionParts`, `findCustomTool`, `flattenHistory`, `FlowSpan`, `FlowTrace`, `formatPreflightReport`, `getClient`, `getPartKey`, `handleAppToolRequest`, `HandleToolRequestOptions`, `Harness`, `historyContentWithAttachments`, `httpHeadProbe`, `HttpHeadProbeConfig`, `HubExecClient`, `HubExecClientOptions`, `HubExecErrorCode`, `HubExecResult`, `HubInvokeDeps`, `HubInvokeInput`, `HubInvokeOutcome`, `ImageBackground`, `ImageContent`, `ImageContentSchema`, `ImageImageLayer`, `ImageLayer`, `ImageLayerType`, `ImageLogoLayer`, `ImageShapeLayer`, `ImageSlide`, `ImageTextLayer`, `InMemoryDurableChatStateStore`, `InMemoryDurableChatStore`, `InMemoryMissionStore`, `INTERACTION_CANCEL_EVENT`, `INTERACTION_EVENT`, `INTERACTION_RESOLVED_EVENT`, `InteractionAnswerBodyValidation`, `InteractionAnswerRoute`, `InteractionAnswerRouteOptions`, `InteractionAnswers`, `InteractionAnswerValue`, `InteractionCancelData`, `InteractionClientOutcome`, `InteractionConnectionResolution`, `InteractionData`, `interactionFromWireRequest`, `InteractionOutcome`, `interactionPartKey`, `InteractionPersistedPart`, `InteractionRequest`, `InteractionRequestWire`, `InteractionRouteLogger`, `interactionToPersistedPart`, `invokeIntegrationHub`, `isAppToolName`, `isChatAttachmentPart`, `isChatInteractionPart`, `isChatMentionPart`, `isChatPlanPart`, `isChatStepFinishPart`, `isChatTextPart`, `isChatToolPart`, `isHarness`, `isMissionStopRequested`, `isMissionTerminal`, `isModelCompatibleWithHarness`, `isRenderableInteractionKind`, `isSafeInteractionFieldKey`, `isSandboxTerminalWsUpgrade`, `isTangleBillingEnforcementDisabled`, `isTangleExecutionKeyError`, `isTerminalInteractionStatus`, `isTerminalPromptEvent`, `JsonObject`, `JsonRecord`, `KeyCrypto`, `KeyProvisioner`, `KnowledgeCandidate`, `KnowledgeDecider`, `KnowledgeDeciderInput`, `KnowledgeDecision`, `KnowledgeGateVerdict`, `KnowledgeLoop`, `KnowledgeLoopConfig`, `KnowledgeLoopDriver`, `KnowledgeRequirementSpec`, `KnowledgeSignal`, `KnowledgeSourceSpec`, `KnowledgeStateAccessor`, `KNOWN_HARNESSES`, `KvLike`, `lightTheme`, `listSessionInteractions`, `LivenessProbeConfig`, `LoopAssistantToolCall`, `LoopEvent`, `LoopMessage`, `LoopToolCall`, `LoopTraceEventLike`, `loopTraceEventsToFlowSpans`, `mapInteractionRespondFailure`, `maskSpans`, `matchSandboxTerminalWsPath`, `MCP_PROTOCOL_VERSIONS`, `McpProtocolVersion`, `McpServerInfo`, `McpToolDefinition`, `MemberSyncSeam`, `mentionInputToPart`, `mentionPartsFromMessageParts`, `mergeExtraMcp`, `mergeHistoryIntoParts`, `mergeMissionState`, `mergePersistedPart`, `mergeSurfaceOverlay`, `messageHasTurnId`, `mintSandboxScopedToken`, `mintTerminalProxyToken`, `MISSING_TOOL_TERMINAL_ERROR`, `MISSING_TOOL_TERMINAL_REASON`, `MISSION_CONTROL_CHANNEL_ID`, `MissionApprovalsPort`, `MissionAuditEvent`, `MissionConcurrencyError`, `MissionCostLedger`, `MissionEngine`, `MissionEngineOptions`, `MissionEventSink`, `MissionFlowStep`, `MissionGateKind`, `MissionGateOptions`, `MissionGateProposal`, `MissionOutcome`, `MissionPlanRunOptions`, `MissionProposalResolution`, `MissionRecord`, `MissionService`, `MissionServiceOptions`, `MissionState`, `MissionStatus`, `MissionStep`, `MissionStepState`, `MissionStepStatus`, `MissionStorePort`, `MissionStreamEvent`, `MissionStreamStatus`, `MissionStreamStep`, `MissionStreamStepStatus`, `MissionTraceContext`, `MissionUpdateGuard`, `MissionUpdatePatch`, `ModelCatalog`, `modelProvider`, `noopEventSink`, `normalizeClientTurnId`, `normalizeModelId`, `normalizePersistedPart`, `normalizePlanDecision`, `normalizeTime`, `normalizeToolEvent`, `NoticeKind`, `noticePart`, `noticePartKey`, `NoticePersistedPart`, `ObjectBody`, `objectKey`, `ObjectKeyParts`, `ObjectStore`, `OpenAICompatStreamTurnOptions`, `OpenAIFunctionTool`, `OpenAIStreamChunk`, `Outcome`, `outcomeStatus`, `parseAssetSpec`, `ParsedIntegrationAction`, `ParsedMission`, `ParsedMissionStep`, `parseInteractionAnswers`, `ParseInteractionAnswersResult`, `parseInteractionCancel`, `parseInteractionRequest`, `ParseInteractionResult`, `parseJsonObjectBody`, `parseMissionBlocks`, `ParseMissionBlocksOptions`, `parsePlanSubmittedEvent`, `ParsePlanSubmittedResult`, `parseSessionStreamEnvelope`, `peekWorkspaceSandbox`, `PeekWorkspaceSandboxOutcome`, `PersistedChatMessageForTurn`, `persistedPartToInteraction`, `persistedPartToPlan`, `PLAN_SUBMITTED_EVENT`, `planAuthorityIdempotencyKey`, `planCommandKey`, `planEffectKey`, `planFollowUpTurnId`, `PlanLimit`, `PlanOutcome`, `planPartKey`, `planRevisionKey`, `planToPersistedPart`, `PlatformBalanceInfo`, `PlatformBalanceManager`, `PlatformBalanceManagerOptions`, `PlatformBillingClient`, `PlatformIdentity`, `PlatformProductUsage`, `PreflightProbe`, `PreflightProbeResult`, `PreflightProbeVerdict`, `PreflightReport`, `PreparedDurableInteractionAnswer`, `PRESET_MIGRATION_SQL`, `PRESET_TABLES`, `PresetBillingOptions`, `PresetKnowledgeAccessorOptions`, `PresetToolHandlerOptions`, `producedFromToolEvents`, `ProducedState`, `ProfileComposeOptions`, `PromptInputPart`, `ProviderResolutionConfig`, `PROVISION_PAYLOAD_MAX_BYTES`, `ProvisionPayloadSections`, `ProvisionProfileSection`, `pumpBufferedTurn`, `PumpBufferedTurnOptions`, `PutObjectOptions`, `questionInteractionContentSignature`, `R2LikeBucket`, `R2LikeObjectBody`, `R2LikeObjectHead`, `RateLimitResult`, `readCookieValue`, `readSandboxBinaryBytes`, `readSecret`, `readToolArgs`, `recordDurableInteractionAnswer`, `recordDurableInteractionCancel`, `RedactedDocSegment`, `RedactedDocument`, `redactForIngestion`, `RedactForIngestionOptions`, `RedactionPattern`, `RedactionSpan`, `reduceMissionEvents`, `renderHistogram`, `RenderUiArgs`, `RenderUiResult`, `renderWaterfall`, `replayTurnEvents`, `ReplayTurnEventsOptions`, `RequestContext`, `requireString`, `resetClientCache`, `resolveChatTurn`, `ResolvedAgentProfile`, `ResolvedChatTurn`, `ResolvedModel`, `ResolvedSessionHarness`, `ResolvedTangleExecutionKey`, `ResolvedToolCapabilities`, `resolveIntegrationAction`, `ResolveInteractionConnectionArgs`, `resolveModel`, `ResolveModelOptions`, `resolveSandboxClientCredentials`, `ResolveSandboxClientCredentialsOptions`, `resolveSessionHarness`, `ResolveSessionHarnessInput`, `resolveTangleDevOrUserKey`, `ResolveTangleDevOrUserKeyOptions`, `resolveTangleExecutionEnvironment`, `resolveTangleModelConfig`, `resolveToolCapabilities`, `ResolveToolCapabilitiesOptions`, `resolveToolId`, `resolveToolName`, `resolveUserTangleExecutionKey`, `resolveUserTangleExecutionKeyForUser`, `ResolveUserTangleExecutionKeyForUserOptions`, `ResolveUserTangleExecutionKeyOptions`, `respondToSessionInteraction`, `restrictTaxonomy`, `RetryableStepError`, `RevealResult`, `revealSpan`, `RevealSpanOptions`, `reviewCandidate`, `routerChatProbe`, `RouterChatProbeConfig`, `RouterModel`, `runAppToolLoop`, `runPreflight`, `runSandboxPrompt`, `runSandboxToolPathSetup`, `RuntimeEventLike`, `RuntimeExecutorOptions`, `safeParseAssetSpec`, `SandboxApiCredentials`, `sandboxAuthProbe`, `SandboxAuthProbeConfig`, `SandboxBuildContext`, `SandboxClientCredentials`, `SandboxCredentialEnvironment`, `SandboxDispatch`, `SandboxDispatchDoneResult`, `SandboxDispatchInProgressResult`, `SandboxDispatchInput`, `SandboxDispatchResult`, `SandboxExecChannel`, `SandboxExecOptions`, `SandboxFileBytesOutcome`, `SandboxFileSizeOutcome`, `SandboxPermissionLevel`, `SandboxResourceConfig`, `SandboxRestoreSpec`, `SandboxRuntimeAuthRefreshError`, `SandboxRuntimeConfig`, `SandboxRuntimeConnection`, `SandboxScope`, `SandboxStepTransition`, `SandboxTerminalTokenOptions`, `SandboxTerminalTokenResult`, `SandboxTerminalTokenSubject`, `SandboxTerminalWsMatch`, `sandboxToolBinDir`, `sandboxToolPath`, `SandboxToolPathOptions`, `sandboxToolRootDir`, `SandboxToolSpec`, `SatisfiedBy`, `SatisfiedByRule`, `ScheduleFollowupArgs`, `ScheduleFollowupResult`, `ScopedMcpServerEntryOptions`, `ScopedTokenResult`, `SecretStore`, `secretStoreFromClient`, `SecurityHeaderOptions`, `serializeCookie`, `SetStepStatusPatch`, `SharedBillingState`, `shellQuote`, `SidecarInteractionsConnection`, `SidecarInteractionsError`, `SidecarInteractionsResult`, `signObjectUrl`, `SignObjectUrlArgs`, `snapHarnessToModel`, `snapModelToHarness`, `splitDeferredProfileFiles`, `stablePlanReceipt`, `stampInteractionAnswers`, `statSandboxFileSize`, `stepActivityFlowTrace`, `stepAgentActivity`, `StepAgentActivity`, `StepGateClassification`, `stepGateProposalId`, `StepOutcome`, `StepSpanContext`, `StoppedSandboxResumeFailure`, `StoppedSandboxResumeRecovery`, `StorableHarnessPartKind`, `StorageConfig`, `storeSecret`, `streamAppToolLoop`, `StreamAppToolLoopOptions`, `StreamEvent`, `StreamLoopYield`, `streamSandboxPrompt`, `StreamSandboxPromptOptions`, `SubmitProposalArgs`, `SubmitProposalResult`, `summarize`, `SurfaceKindDefinition`, `SurfaceMcpServer`, `SurfaceMergeBase`, `SurfaceOverlay`, `SurfacePermissionValue`, `SurfaceRegistry`, `syncSandboxMemberAdd`, `syncSandboxMemberRemove`, `syncSandboxMemberRole`, `TangleBillingEnforcementOptions`, `TangleExecutionEnvironment`, `TangleExecutionKeyError`, `TangleExecutionKeyErrorCode`, `tangleExecutionKeyHttpError`, `TangleExecutionKeyHttpError`, `TangleExecutionKeySource`, `TangleModelConfig`, `TaskGold`, `TcloudKeyClient`, `terminalizeDanglingAssistantToolUpdates`, `terminalizeDanglingToolPart`, `terminalizeDanglingToolParts`, `TerminalProxyIdentity`, `terminalTokenFromRequest`, `themeColor`, `ThemeContractMiss`, `ThemeContractOptions`, `ThemeContractResult`, `themeToCssVars`, `threadTitleFromMessage`, `TimedEvent`, `timedEventsFromLines`, `toChatMessageParts`, `toLoopEvents`, `ToolAuthResult`, `ToolCapability`, `ToolHeaderNames`, `ToolInputError`, `ToolLoopEvent`, `ToolLoopResult`, `ToolLoopStopReason`, `traceEnv`, `trimOrNull`, `TURN_EVENTS_MIGRATION_SQL`, `TURN_STATUS_SCOPE_MIGRATION_SQL`, `TurnEventStore`, `TurnStatus`, `upsertDurableInteractionAsk`, `validateInteractionAnswerBody`, `VaultKv`, `verifyCapabilityToken`, `verifyCompletion`, `verifyExpiringCapabilityToken`, `verifyObjectUrl`, `VerifyObjectUrlResult`, `verifySandboxTerminalToken`, `verifyTerminalProxyToken`, `VideoCaption`, `VideoContent`, `VideoContentSchema`, `VideoCountdownScene`, `VideoImageRevealScene`, `VideoScene`, `VideoSlideScene`, `VideoTextAnimationScene`, `volumeGateProposalId`, `weightedComposite`, `WithAgentActivity`, `WorkspaceKeyManager`, `WorkspaceKeyManagerOptions`, `WorkspaceKeyRecord`, `WorkspaceKeyStore`, `WorkspaceModelKeyUsage`, `WorkspaceSandboxConnectionArgs`, `WorkspaceSandboxConnectionHandlerOptions`, `WorkspaceSandboxEnsureContext`, `WorkspaceSandboxInstanceLike`, `WorkspaceSandboxManager`, `WorkspaceSandboxManagerOptions`, `WorkspaceSandboxRuntimeProxyArgs`, `WorkspaceSandboxRuntimeProxyHandlerOptions`, `WorkspaceSandboxTerminalUpgradeHandlerOptions`, `WriteProfileFilesOptions`, `writeProfileFilesToBox` [Full API →](api/index.md) diff --git a/docs/api/app-auth.md b/docs/api/app-auth.md index 649110a..2e24bdd 100644 --- a/docs/api/app-auth.md +++ b/docs/api/app-auth.md @@ -1,4 +1,4 @@ - + # `./app-auth` diff --git a/docs/api/assets.md b/docs/api/assets.md index df96a14..833a143 100644 --- a/docs/api/assets.md +++ b/docs/api/assets.md @@ -1,4 +1,4 @@ - + # `./assets` diff --git a/docs/api/assistant.md b/docs/api/assistant.md index 6d51355..cdde3c7 100644 --- a/docs/api/assistant.md +++ b/docs/api/assistant.md @@ -1,4 +1,4 @@ - + # `./assistant` diff --git a/docs/api/billing.md b/docs/api/billing.md index 9c9b6c9..85d8318 100644 --- a/docs/api/billing.md +++ b/docs/api/billing.md @@ -1,4 +1,4 @@ - + # `./billing` diff --git a/docs/api/brand-extraction.md b/docs/api/brand-extraction.md index 7f131aa..28ecf94 100644 --- a/docs/api/brand-extraction.md +++ b/docs/api/brand-extraction.md @@ -1,4 +1,4 @@ - + # `./brand-extraction` diff --git a/docs/api/brand.md b/docs/api/brand.md index 5766c01..0bbb88f 100644 --- a/docs/api/brand.md +++ b/docs/api/brand.md @@ -1,4 +1,4 @@ - + # `./brand` diff --git a/docs/api/catalog.md b/docs/api/catalog.md index 04719ec..3cf1c04 100644 --- a/docs/api/catalog.md +++ b/docs/api/catalog.md @@ -1,4 +1,4 @@ - + # `./catalog` diff --git a/docs/api/chat-routes.md b/docs/api/chat-routes.md index d7b4ccd..b49b0f7 100644 --- a/docs/api/chat-routes.md +++ b/docs/api/chat-routes.md @@ -1,4 +1,4 @@ - + # `./chat-routes` diff --git a/docs/api/chat-store.md b/docs/api/chat-store.md index 6e5abc1..1b886f7 100644 --- a/docs/api/chat-store.md +++ b/docs/api/chat-store.md @@ -1,4 +1,4 @@ - + # `./chat-store` diff --git a/docs/api/composer.md b/docs/api/composer.md index f1e1c62..2ef5c4b 100644 --- a/docs/api/composer.md +++ b/docs/api/composer.md @@ -1,4 +1,4 @@ - + # `./composer` diff --git a/docs/api/config.md b/docs/api/config.md index a67d00e..af67bfc 100644 --- a/docs/api/config.md +++ b/docs/api/config.md @@ -1,4 +1,4 @@ - + # `./config` diff --git a/docs/api/crypto.md b/docs/api/crypto.md index 305978c..75ca39b 100644 --- a/docs/api/crypto.md +++ b/docs/api/crypto.md @@ -1,4 +1,4 @@ - + # `./crypto` diff --git a/docs/api/design-canvas-drizzle.md b/docs/api/design-canvas-drizzle.md index 0831b51..390212f 100644 --- a/docs/api/design-canvas-drizzle.md +++ b/docs/api/design-canvas-drizzle.md @@ -1,4 +1,4 @@ - + # `./design-canvas/drizzle` diff --git a/docs/api/design-canvas-react-engine.md b/docs/api/design-canvas-react-engine.md index 3b46a70..8bff853 100644 --- a/docs/api/design-canvas-react-engine.md +++ b/docs/api/design-canvas-react-engine.md @@ -1,4 +1,4 @@ - + # `./design-canvas-react/engine` diff --git a/docs/api/design-canvas-react-lazy.md b/docs/api/design-canvas-react-lazy.md index 94d90ec..69abfcb 100644 --- a/docs/api/design-canvas-react-lazy.md +++ b/docs/api/design-canvas-react-lazy.md @@ -1,4 +1,4 @@ - + # `./design-canvas-react/lazy` diff --git a/docs/api/design-canvas-react.md b/docs/api/design-canvas-react.md index 4fb759c..bac0a26 100644 --- a/docs/api/design-canvas-react.md +++ b/docs/api/design-canvas-react.md @@ -1,4 +1,4 @@ - + # `./design-canvas-react` diff --git a/docs/api/design-canvas.md b/docs/api/design-canvas.md index 22f2531..5b0a937 100644 --- a/docs/api/design-canvas.md +++ b/docs/api/design-canvas.md @@ -1,4 +1,4 @@ - + # `./design-canvas` @@ -211,7 +211,7 @@ interface ChannelScaleResult `function` — All slot names declared across the document — the template's fillable surface. ```ts -(document: SceneDocument) => Map Map v… +(slotName: string, elementKind: "text" | "image" | "rect" | "ellipse" | "line" | "video" | "group", value: string) => v… ``` ### `VideoElement` diff --git a/docs/api/durable-chat.md b/docs/api/durable-chat.md index add0129..f1c1e36 100644 --- a/docs/api/durable-chat.md +++ b/docs/api/durable-chat.md @@ -1,4 +1,4 @@ - + # `./durable-chat` diff --git a/docs/api/eval-campaign.md b/docs/api/eval-campaign.md index b773983..026da2f 100644 --- a/docs/api/eval-campaign.md +++ b/docs/api/eval-campaign.md @@ -1,4 +1,4 @@ - + # `./eval-campaign` diff --git a/docs/api/eval.md b/docs/api/eval.md index e19afc2..eaa8316 100644 --- a/docs/api/eval.md +++ b/docs/api/eval.md @@ -1,4 +1,4 @@ - + # `./eval` diff --git a/docs/api/harness.md b/docs/api/harness.md index eaaf8a6..4ea1a47 100644 --- a/docs/api/harness.md +++ b/docs/api/harness.md @@ -1,4 +1,4 @@ - + # `./harness` diff --git a/docs/api/index.md b/docs/api/index.md index c0e10dc..232b1c7 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -1,18 +1,10 @@ - + # `.` Source: `src/index.ts` -982 exports. - -### `AddCaptionOperation` - -`interface` — Add a caption with optional language, timing, and track placement details - -```ts -interface AddCaptionOperation -``` +766 exports. ### `AddCitationArgs` @@ -30,22 +22,6 @@ interface AddCitationArgs interface AddCitationResult ``` -### `AddElementOperation` - -`interface` — Define an operation to add a scene element to a page with optional index and parent group - -```ts -interface AddElementOperation -``` - -### `AddPageOperation` - -`interface` — Define an operation to add a new page with an optional position and caller-minted page ID - -```ts -interface AddPageOperation -``` - ### `addSecurityHeaders` `function` — Set standard security headers on a response (HSTS, nosniff, frame-options, referrer-policy, XSS) + optional product disclaimer/retention. @@ -158,22 +134,6 @@ type AnySurfaceKind readonly ["submit_proposal", "schedule_followup", "render_ui", "add_citation"] ``` -### `applyBindingsToDocument` - -`function` — Applies slot bindings to a document in place (mutates a deep copy produced by the caller). - -```ts -(document: SceneDocument, bindings: Record) => SceneDocument -``` - -### `ApplyDataOperation` - -`interface` — Fill slots with data — text slots take strings, image/video slots take src URLs. - -```ts -interface ApplyDataOperation -``` - ### `applyDurableInteractionAnswer` `function` — Resolve and record the outcome and answers of a durable interaction within the given store and scope @@ -206,46 +166,6 @@ interface ApplyDataOperation (prev: MissionState | undefined, event: MissionStreamEvent) => MissionState ``` -### `applySceneOperation` - -`function` — Apply a single operation to a document and return the new document. - -```ts -(document: SceneDocument, operation: SceneOperation) => SceneDocument -``` - -### `applySceneOperations` - -`function` — Full form: returns the new document AND per-op results. - -```ts -{ (document: SceneDocument, operations: SceneOperation[], options: ApplySceneOptions): { document: SceneDocument; resul… -``` - -### `ApplySceneOptions` - -`interface` — Resolve element ID conflicts by providing fresh unique identifiers during scene application - -```ts -interface ApplySceneOptions -``` - -### `applySequenceOperation` - -`function` — Apply a sequence operation to update the store and timeline asynchronously - -```ts -(store: SequenceStore, timeline: SequenceTimeline, op: SequenceOperation, ctx: SequenceOperationContext) => Promise<...> -``` - -### `applySequenceOperations` - -`function` — The batch path every dispatcher (the MCP tools, a product's editor persistence route) funnels through: fetch the timeline, validate the WHOLE batch against pre-state, then apply in order with a timel… - -```ts -(store: SequenceStore, operations: SequenceOperation[], ctx: SequenceOperationContext) => Promise -``` - ### `ApprovalEvent` `interface` — Describe an approval event with action details, user info, and optional edited fields @@ -366,22 +286,6 @@ interface AppToolTaxonomy (value: unknown) => JsonRecord | undefined ``` -### `assertClipFitsSequence` - -`function` — Validate that a clip's start and duration fit within the sequence duration without overflow - -```ts -(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; label: string; }) => void -``` - -### `assertColor` - -`function` — Validate that a string is a hex, rgb(a), or 'transparent' color and throw an error if not - -```ts -(value: string, label: string) => void -``` - ### `assertEnvWithinLimits` `function` — Throw when any single env value exceeds {@link ENV_VALUE_MAX_BYTES} or the whole env block exceeds {@link ENV_TOTAL_MAX_BYTES}, naming the offending variable. @@ -390,14 +294,6 @@ interface AppToolTaxonomy (env: Record) => void ``` -### `assertFinite` - -`function` — Assert that a value is a finite number and throw an error with a label if not - -```ts -(value: number, label: string) => void -``` - ### `assertHarnessModelCompatible` `function` — Fail-loud server guard: throw when a harness is asked to run a model it can't. @@ -414,14 +310,6 @@ interface AppToolTaxonomy (url: string, what?: string) => void ``` -### `assertPositiveFinite` - -`function` — Assert that a value is a positive finite number and throw an error with a label if not - -```ts -(value: number, label: string) => void -``` - ### `assertProvisionPayloadWithinCap` `function` — Throw when the serialized provision payload exceeds {@link PROVISION_PAYLOAD_MAX_BYTES}. @@ -438,22 +326,6 @@ interface AppToolTaxonomy (s: string) => string ``` -### `assertSceneMediaSrc` - -`function` — Media boundary rule shared with sequences: remote http(s) or a rooted /api/ path — never sandbox-local files or data:/blob: blobs. - -```ts -(value: string, label: string) => void -``` - -### `assertSequenceMediaUrl` - -`function` — Media references must be provider URLs or app-served paths. - -```ts -(url: string) => void -``` - ### `AssetContentMap` `type` — Map asset keys to their corresponding content types for various media and copy formats @@ -590,46 +462,6 @@ interface AuthenticateOptions interface BeforeInteractionAnswerArgs ``` -### `BindSlotOperation` - -`interface` — Define an operation to bind or unbind a unique slot to an element on a specific page - -```ts -interface BindSlotOperation -``` - -### `bleedAwareExportBounds` - -`function` — Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins. - -```ts -(page: ScenePage, includeBleed: boolean) => ExportCropRect -``` - -### `bleedAwareExportRect` - -`function` — Export rectangle in page coordinates that includes bleed margins when present. - -```ts -(page: Pick) => Bounds -``` - -### `Bounds` - -`interface` — Define rectangular boundaries with position and size properties - -```ts -interface Bounds -``` - -### `boundsIntersect` - -`function` — Determine if two rectangular bounds overlap or intersect each other - -```ts -(a: Bounds, b: Bounds) => boolean -``` - ### `BrandTokens` `interface` — Define brand identity tokens including colors, font, logo, business name, and voice @@ -766,22 +598,6 @@ interface BuildAppToolsOptions (atts: readonly Pick[], header?: string) => string ``` -### `buildCaptionChunks` - -`function` — Split transcript segments into caption chunks. - -```ts -(segments: TranscriptSegment[], opts: BuildCaptionChunksOptions) => CaptionChunk[] -``` - -### `BuildCaptionChunksOptions` - -`interface` — Define options to configure caption chunk size, duration, and frame rate constraints - -```ts -interface BuildCaptionChunksOptions -``` - ### `buildCatalog` `function` — Pure catalogue pipeline. @@ -798,38 +614,6 @@ interface BuildCaptionChunksOptions (input: ConsentUrlInput) => string ``` -### `buildContactSheetManifest` - -`function` — One sample frame per enabled video-track clip with resolved, completed media — the product side renders the actual sheet (needs ffmpeg/canvas). - -```ts -(timeline: SequenceTimeline) => ContactSheetManifest -``` - -### `buildDesignCanvasMcpServerEntry` - -`function` — Build the `AgentProfileMcpServer`-shaped entry for the design-canvas channel. - -```ts -(opts: ScopedMcpServerEntryOptions) => AppToolMcpServer -``` - -### `BuildDesignCanvasMcpServerEntryOptions` - -`type` — Build scoped MCP server entry options for the design canvas environment - -```ts -type BuildDesignCanvasMcpServerEntryOptions -``` - -### `buildEdl` - -`function` — CMX3600-style EDL: one event per enabled video/audio clip in record-start order. - -```ts -(timeline: SequenceTimeline) => string -``` - ### `buildFlowTrace` `function` — Derive a span trace from timestamped turn events. @@ -870,14 +654,6 @@ interface BuildHttpMcpServerOptions interface BuildMcpServerOptions ``` -### `buildOtio` - -`function` — OpenTimelineIO `Timeline.1` document. - -```ts -(timeline: SequenceTimeline) => OtioTimeline -``` - ### `buildRedactedDocument` `function` — Split `text` into text + redacted segments, encrypting each redacted span's original. @@ -934,30 +710,6 @@ interface BuildSandboxToolFileMountsOptions (opts: ScopedMcpServerEntryOptions & { label: string; defaultDescription: string; }) => AppToolMcpServer ``` -### `buildSequencesMcpServerEntry` - -`function` — Build the `AgentProfileMcpServer`-shaped entry for the sequences channel. - -```ts -(opts: ScopedMcpServerEntryOptions) => AppToolMcpServer -``` - -### `BuildSequencesMcpServerEntryOptions` - -`type` — Extend ScopedMcpServerEntryOptions to configure MCP server entry options for sequence building - -```ts -type BuildSequencesMcpServerEntryOptions -``` - -### `buildSrt` - -`function` — Numbered SubRip cues from caption-track clips, in timeline order. - -```ts -(timeline: SequenceTimeline, opts?: CaptionExportOptions) => string -``` - ### `buildUserTextParts` `function` — Build an array of text parts with optional turn ID for user input @@ -966,14 +718,6 @@ type BuildSequencesMcpServerEntryOptions (text: string, turnId: string | undefined) => JsonRecord[] ``` -### `buildVtt` - -`function` — WebVTT with numbered cue identifiers; same filtering and frame math as `buildSrt`, dot millisecond separator per the VTT grammar. - -```ts -(timeline: SequenceTimeline, opts?: CaptionExportOptions) => string -``` - ### `BULK_DELETE_MAX_THREADS` `const` — Bounds a single bulk-delete request's write set; product surfaces cap thread lists at far fewer, so a larger batch is a malformed or hostile request. @@ -1006,30 +750,6 @@ type BuildSequencesMcpServerEntryOptions (from: ChatPlanStatus, to: ChatPlanStatus) => boolean ``` -### `CANVAS_ELEMENT_KINDS` - -`const` — Provide a readonly array of string identifiers representing canvas element kinds - -```ts -readonly string[] -``` - -### `CANVAS_MCP_TOOL_NAMES` - -`const` — Extract names of all tools from the CANVAS_MCP_TOOLS array - -```ts -string[] -``` - -### `CANVAS_MCP_TOOLS` - -`const` — Provide a collection of MCP tool definitions for manipulating and querying the design canvas environment - -```ts -McpToolDefinition[] -``` - ### `CanvasRenderPalette` `interface` — Colors the Konva design-canvas paints directly. @@ -1046,54 +766,6 @@ interface CanvasRenderPalette interface CapabilityTokenOptions ``` -### `CaptionChunk` - -`interface` — One caption clip's worth of text with its timeline bounds. - -```ts -interface CaptionChunk -``` - -### `captionCoverage` - -`function` — Per-language caption coverage over [0, durationFrames). - -```ts -(timeline: SequenceTimeline) => CaptionCoverageEntry[] -``` - -### `CaptionCoverageEntry` - -`interface` — Coverage for one caption language across the sequence. - -```ts -interface CaptionCoverageEntry -``` - -### `CaptionExportOptions` - -`interface` — Define options to export captions filtered by an optional BCP-47 language tag - -```ts -interface CaptionExportOptions -``` - -### `CaptionTargetResolution` - -`type` — Resolve caption target by specifying an existing track or creating a new one with language and name - -```ts -type CaptionTargetResolution -``` - -### `captionTrackNameForLanguage` - -`function` — Naming convention for auto-created per-language caption tracks. - -```ts -(language: string) => string -``` - ### `CatalogModel` `interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags @@ -1118,38 +790,6 @@ interface CertifiedDelivery interface CertifiedDeliveryConfig ``` -### `CHANNEL_PRESETS` - -`const` — Fixed output resolution presets for the channel/platform export dialog. - -```ts -readonly ChannelPreset[] -``` - -### `ChannelPreset` - -`interface` — Define a preset configuration for a channel including its id, label, width, and height - -```ts -interface ChannelPreset -``` - -### `ChannelPresetId` - -`type` — Resolve a valid channel preset identifier from the predefined channel presets array - -```ts -type ChannelPresetId -``` - -### `ChannelScaleResult` - -`interface` — Define the pixel ratio and horizontal offset for scaling a Konva stage to a channel preset size - -```ts -interface ChannelScaleResult -``` - ### `ChatAttachmentKind` `type` — The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (… @@ -1398,30 +1038,6 @@ interface ChatUsageTokens (parent: MissionTraceContext | StepSpanContext, seed?: string | undefined) => StepSpanContext ``` -### `chooseCaptionPlacement` - -`function` — Place a caption near the playhead inside FREE space only — the caption track never double-books. - -```ts -(input: { playheadFrame: number; fps: number; sequenceDurationFrames: number; occupiedIntervals: TimelineInterval[]; })… -``` - -### `clampClipDuration` - -`function` — Clamp clip duration to fit within sequence bounds and minimum length constraints - -```ts -(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number -``` - -### `clampClipStart` - -`function` — Clamp the clip start frame within the valid range of the sequence duration and clip length - -```ts -(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number -``` - ### `classifySeveredStream` `function` — Resolve the severed stream event to a corresponding sandbox step transition or null @@ -1470,14 +1086,6 @@ interface ChatUsageTokens (parts: JsonRecord[]) => JsonRecord[] ``` -### `collectSlots` - -`function` — All slot names declared across the document — the template's fillable surface. - -```ts -(document: SceneDocument) => Map TurnEventStore ``` -### `createDesignCanvasMcpHandler` - -`function` — Create a request handler for the design canvas MCP tool with specified options - -```ts -(opts: CreateDesignCanvasMcpHandlerOptions) => (request: Request) => Promise -``` - -### `CreateDesignCanvasMcpHandlerOptions` - -`interface` — Define options for creating a design canvas MCP handler including store, ID minting, and optional server info - -```ts -interface CreateDesignCanvasMcpHandlerOptions -``` - ### `createDurableChatEventProjection` `function` — Event projector usable with any `ChatTurnRouteProducer` through `withDurableChatProjection`. @@ -1758,14 +1334,6 @@ type CreateDurableInteractionRoutePersistenceOptions (options: DurablePlanRouteOptions) => DurablePlanRoutes ``` -### `createEmptyDocument` - -`function` — Create a new empty SceneDocument with a title and optional initial page settings - -```ts -(title: string, page?: NewPageOptions | undefined) => SceneDocument -``` - ### `createExpiringCapabilityToken` `function` — Mint an EXPIRING capability token: `.` where the payload carries `{ sub, exp, n }` (subject, epoch-ms expiry, random nonce) and the signature is HMAC-SHA256 over the… @@ -1894,14 +1462,6 @@ interface CreateMissionInput (opts: OpenAICompatStreamTurnOptions) => (messages: ToolLoopMessage[]) => AsyncIterable ``` -### `createPage` - -`function` — Create a new ScenePage with specified options and a unique identifier - -```ts -(options: NewPageOptions, id: string) => ScenePage -``` - ### `createPlatformBalanceManager` `function` — Create a platform balance manager to handle user plan limits and state based on provided options @@ -1982,22 +1542,6 @@ interface CreateMissionInput (subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise ``` -### `createSequencesMcpHandler` - -`function` — Create a handler to process MCP sequence requests with optional playhead frame and server info - -```ts -(opts: CreateSequencesMcpHandlerOptions) => (request: Request) => Promise -``` - -### `CreateSequencesMcpHandlerOptions` - -`interface` — Define options for creating sequences MCP handler including store, playhead frame, and server info - -```ts -interface CreateSequencesMcpHandlerOptions -``` - ### `createSurfaceRegistry` `function` — Assemble the product's surface registry from its registered kinds. @@ -2038,14 +1582,6 @@ interface CreateTangleRouterModelConfigOptions (opts?: { minRecall?: number | undefined; minContentLength?: number | undefined; }) => (requirement: CompletionRequirem… ``` -### `CreateTrackOperation` - -`interface` — Define an operation to create a new sequence track with a specified kind and name - -```ts -interface CreateTrackOperation -``` - ### `createWorkspaceKeyManager` `function` — Create a workspace key manager that handles key provisioning and budget tracking @@ -2182,14 +1718,6 @@ Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", s "Attached files (already saved to the workspace vault — read them from these paths):" ``` -### `DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION` - -`const` — Describe the live visual asset editor capabilities for the current design document using CSS pixel coordinates - -```ts -"Live visual asset editor for the current design document: read scene state, add/move/resize/delete elements, manage pa… -``` - ### `DEFAULT_HARNESS` `const` — Define the default harness to use for code execution and testing environments @@ -2230,14 +1758,6 @@ readonly RedactionPattern[] SandboxResourceConfig ``` -### `DEFAULT_SEQUENCES_MCP_DESCRIPTION` - -`const` — Describe live timeline editor features for current video sequence including clip and caption management - -```ts -"Live timeline editor for the current video sequence: read timeline state, place/move/trim/split clips, add captions, m… -``` - ### `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR` `const` — Define the default environment variable name for Tangle billing enforcement @@ -2294,30 +1814,6 @@ SandboxResourceConfig (activity: StepAgentActivity[], turnStartMs: number, opts?: { nowMs?: number | undefined; } | undefined) => FlowSpan[] ``` -### `DeleteClipOperation` - -`interface` — Represent a delete clip operation with a specified clip identifier - -```ts -interface DeleteClipOperation -``` - -### `DeleteElementOperation` - -`interface` — Resolve deletion of a specific element from a page by its identifiers - -```ts -interface DeleteElementOperation -``` - -### `DeletePageOperation` - -`interface` — Represent a delete page operation with a specified page identifier - -```ts -interface DeletePageOperation -``` - ### `deleteSecret` `function` — Delete a secret by name from the given secret store and return the operation outcome @@ -2350,22 +1846,6 @@ interface DeriveKeyOptions (specs: KnowledgeRequirementSpec[], ctx: KnowledgeStateAccessor) => Promise> ``` -### `DesignCanvasMcpServerInfo` - -`interface` — Describe design canvas MCP server information including name and version - -```ts -interface DesignCanvasMcpServerInfo -``` - -### `DesignCanvasMcpToolEnv` - -`interface` — Define the environment for MCP tool with a scene store and ID minting function - -```ts -interface DesignCanvasMcpToolEnv -``` - ### `detectInteractiveQuestion` `function` — Resolve the interactive question text from a structured event or return null if none found @@ -2438,14 +1918,6 @@ interface DrizzleColumnLike interface DrizzleSqliteCoreLike ``` -### `DuplicatePageOperation` - -`interface` — Define an operation to duplicate a page with a new caller-specified page ID - -```ts -interface DuplicatePageOperation -``` - ### `DurableAnswerIntentJournal` `type` — Provide durable methods to manage the lifecycle of answer intents in a plan store @@ -2766,30 +2238,6 @@ type DurablePlanStateStore interface DurablePlanStore ``` -### `elementAabb` - -`function` — Axis-aligned bounding box in the parent's coordinate space, accounting for rotation about the element's top-left origin. - -```ts -(element: SceneElement) => Bounds -``` - -### `elementExtent` - -`function` — Unrotated local extent of an element (line/group derive from content). - -```ts -(element: SceneElement) => { width: number; height: number; } -``` - -### `EllipseElement` - -`interface` — Define properties for an ellipse element including dimensions, fill, and optional stroke details - -```ts -interface EllipseElement -``` - ### `EmailBodySection` `interface` — Define the structure for the body section of an email containing plain text content @@ -2934,14 +2382,6 @@ interface EnsureWorkspaceSandboxOptions 120000 ``` -### `estimateTextHeight` - -`function` — Estimate the height of multiline text based on font size and line height - -```ts -(element: Pick) => number -``` - ### `ExpiringCapabilityTokenOptions` `interface` — Define options for capability tokens that expire after a specified lifetime in milliseconds @@ -2950,46 +2390,6 @@ interface EnsureWorkspaceSandboxOptions interface ExpiringCapabilityTokenOptions ``` -### `EXPORT_PRESETS` - -`const` — Provide predefined export configurations for various social media and image formats - -```ts -Record -``` - -### `ExportCropRect` - -`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds - -```ts -interface ExportCropRect -``` - -### `ExportFormat` - -`type` — Define supported image export formats as PNG or JPEG - -```ts -type ExportFormat -``` - -### `ExportPreset` - -`interface` — Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag. - -```ts -interface ExportPreset -``` - -### `ExtendSequenceOperation` - -`interface` — Define an operation to extend a sequence by a specified number of frames - -```ts -interface ExtendSequenceOperation -``` - ### `extractProducedState` `function` — Normalize a run's runtime event stream into `ProducedState`. @@ -3038,14 +2438,6 @@ interface ExtendSequenceOperation (parts: JsonRecord[], outcome: "answered" | "expired") => JsonRecord[] ``` -### `findCanvasMcpTool` - -`function` — Find the canvas MCP tool definition matching the given name or return undefined - -```ts -(name: string) => McpToolDefinition | undefined -``` - ### `findCustomTool` `function` — Find a registered custom tool by the name the model called. @@ -3054,30 +2446,6 @@ interface ExtendSequenceOperation (name: string, tools: readonly AppToolDefinition>[] | undefined) => AppToolDefinition { element: SceneElement; owner: SceneElement[]; index: number; } | null -``` - -### `findPreset` - -`function` — Resolve a size preset by its identifier or return null if not found - -```ts -(id: string) => SizePreset | null -``` - -### `findSequenceMcpTool` - -`function` — Resolve the SequenceMcpToolDefinition matching the given name or return undefined - -```ts -(name: string) => SequenceMcpToolDefinition | undefined -``` - ### `flattenHistory` `function` — Build a single string combining conversation history and the current user message @@ -3110,30 +2478,6 @@ interface FlowTrace (report: PreflightReport) => string ``` -### `formatSeconds` - -`function` — Format a number of seconds into a string with integer or two-decimal precision suffix s - -```ts -(seconds: number) => string -``` - -### `formatTimecode` - -`function` — `m:ss.ff` timecode for UI and agent-readable frame references. - -```ts -(frames: number, fps: number) => string -``` - -### `framesToSeconds` - -`function` — Convert a frame count to seconds based on the given frames per second rate - -```ts -(frames: number, fps: number) => number -``` - ### `getClient` `function` — Resolve a synchronous sandbox client from provided runtime configuration credentials @@ -3150,22 +2494,6 @@ interface FlowTrace (part: JsonRecord) => string ``` -### `GroupElement` - -`interface` — Define a group element that contains multiple child scene elements - -```ts -interface GroupElement -``` - -### `GroupElementsOperation` - -`interface` — Group elements by grouping two or more sibling elements in their current z-order under a new group ID - -```ts -interface GroupElementsOperation -``` - ### `handleAppToolRequest` `function` — Handle one app-tool HTTP request end to end — the sandbox MCP path. @@ -3294,14 +2622,6 @@ interface ImageContent ZodObject<{ slides: ZodArray; valu… ``` -### `ImageElement` - -`interface` — Define properties for an image element including source, dimensions, and fit mode - -```ts -interface ImageElement -``` - ### `ImageImageLayer` `interface` — Define properties for an image layer including position, size, URL, and optional opacity @@ -3382,22 +2702,6 @@ typeof InMemoryDurableChatStateStore interface InMemoryMissionStore ``` -### `InstantiateOptions` - -`interface` — Define options for instantiating a document with title, optional bindings, and custom id minting - -```ts -interface InstantiateOptions -``` - -### `instantiateTemplate` - -`function` — Produces a new `SceneDocument` from a template: 1. - -```ts -(document: SceneDocument, options: InstantiateOptions) => SceneDocument -``` - ### `INTERACTION_CANCEL_EVENT` `const` — Sidecar → client: the ask was withdrawn; data = `{ id, reason? @@ -3862,22 +3166,6 @@ readonly ["opencode", "claude-code", "nanoclaw", "kimi-code", "codex", "amp", "f interface KvLike ``` -### `LanguageFanoutOptions` - -`interface` — Define options to specify target languages and an optional source language for fan-out operations - -```ts -interface LanguageFanoutOptions -``` - -### `lastClipEndFrame` - -`function` — Last occupied frame across all clips — the floor for `extend_sequence`. - -```ts -(timeline: SequenceTimeline) => number -``` - ### `lightTheme` `const` — Define a light color theme with specific background, foreground, and accent color values @@ -3886,14 +3174,6 @@ interface LanguageFanoutOptions AgentAppTheme ``` -### `LineElement` - -`interface` — Define a line element with points, stroke, stroke width, and optional dash pattern - -```ts -interface LineElement -``` - ### `listSessionInteractions` `function` — Outstanding (unanswered) interactions for the session — the sidecar's registry is authoritative, so this is the reconnect/reload source of truth. @@ -3902,14 +3182,6 @@ interface LineElement (connection: SidecarInteractionsConnection) => Promise> ``` -### `listTemplateSlots` - -`function` — Wraps `collectSlots` with kind-aware fill typing so callers know WHAT to put in each slot without inspecting the element tree themselves. - -```ts -(document: SceneDocument) => TemplateSlot[] -``` - ### `LivenessProbeConfig` `interface` — Define configuration for liveness probes including sidecar process pattern and optional timeouts @@ -3982,14 +3254,6 @@ interface LoopTraceEventLike (text: string, patterns?: readonly RedactionPattern[]) => string ``` -### `matchPreset` - -`function` — Match a (width, height) pair against the preset table. - -```ts -(width: number, height: number) => SizePreset | null -``` - ### `matchSandboxTerminalWsPath` `function` — Parse a same-origin terminal-WS pathname into its parts, or `null` when the path is not a sandbox terminal WebSocket. @@ -3998,14 +3262,6 @@ interface LoopTraceEventLike (pathname: string) => SandboxTerminalWsMatch | null ``` -### `MAX_CAPTION_BATCH` - -`const` — Largest accepted `add_captions` batch — bounds one decision row / one validation pass to a size the store can absorb in a single request. - -```ts -500 -``` - ### `MCP_PROTOCOL_VERSIONS` `const` — Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server. @@ -4110,14 +3366,6 @@ interface MemberSyncSeam (message: PersistedChatMessageForTurn, turnId: string) => boolean ``` -### `MIN_SEQUENCE_CLIP_FRAMES` - -`const` — Frame-accurate sequence timeline model — the product-agnostic spine of the sequences surface. - -```ts -1 -``` - ### `mintSandboxScopedToken` `function` — Mint a scoped token for an already-provisioned box (e.g. @@ -4414,54 +3662,6 @@ interface ModelCatalog (modelId: string) => string | null ``` -### `MoveClipOperation` - -`interface` — Resolve an operation to move a clip to a new start frame and optional track - -```ts -interface MoveClipOperation -``` - -### `NewPageOptions` - -`interface` — Define options to configure a new page including name, dimensions, and background color - -```ts -interface NewPageOptions -``` - -### `NewSceneDecision` - -`interface` — Define the structure for decisions related to creating a new scene with instructions and optional details - -```ts -interface NewSceneDecision -``` - -### `NewSequenceClip` - -`interface` — Define properties for a new sequence clip including timing, labels, and optional metadata - -```ts -interface NewSequenceClip -``` - -### `NewSequenceDecision` - -`interface` — Define the structure for a new sequence decision with optional metadata and acceptance status - -```ts -interface NewSequenceDecision -``` - -### `NewSequenceTrack` - -`interface` — Define properties for a new sequence track including kind, name, and optional sort order - -```ts -interface NewSequenceTrack -``` - ### `noopEventSink` `const` — A sink that drops every event — the engine default when no live channel is wired (and the unit-test default). @@ -4478,14 +3678,6 @@ MissionEventSink (value: unknown) => string | undefined ``` -### `normalizeLanguageTag` - -`function` — Normalize a BCP-47 tag to conventional casing: primary subtag lowercase, 4-letter script subtags Title Case, 2-letter region subtags UPPER, all other subtags lowercase. - -```ts -(tag: string) => string -``` - ### `normalizeModelId` `function` — Strip provider prefix, :free suffix, and trailing date stamps. @@ -4614,108 +3806,20 @@ interface OpenAIFunctionTool interface OpenAIStreamChunk ``` -### `OtioClip` +### `Outcome` -`interface` — Define a clip object with metadata, source range, and media reference according to OTIO schema +`type` — Represent success or failure of an operation with corresponding value or error information ```ts -interface OtioClip +type Outcome ``` -### `OtioExternalReference` +### `outcomeStatus` -`interface` — Define the structure for an external media reference with schema, URL, and optional time range +`function` — HTTP status for a failed outcome — the handler's `ToolInputError.status` when present, else 400 for a validation reject. ```ts -interface OtioExternalReference -``` - -### `OtioGap` - -`interface` — Define the structure for a gap element with schema, name, and source time range properties - -```ts -interface OtioGap -``` - -### `OtioMissingReference` - -`interface` — Represent missing references in OTIO with a fixed schema identifier - -```ts -interface OtioMissingReference -``` - -### `OtioRationalTime` - -`interface` — Represent a rational time value with a specific rate and numeric value for OTIO schema - -```ts -interface OtioRationalTime -``` - -### `OtioStack` - -`interface` — Represent a stack container holding a named collection of OtioTrack children - -```ts -interface OtioStack -``` - -### `OtioTimeline` - -`interface` — Define the structure of a timeline with metadata, tracks, and global start time in OTIO format - -```ts -interface OtioTimeline -``` - -### `OtioTimeRange` - -`interface` — Define a time range with a start time and duration using OtioRationalTime values - -```ts -interface OtioTimeRange -``` - -### `OtioTrack` - -`interface` — Define a track containing video or audio clips with metadata and child elements - -```ts -interface OtioTrack -``` - -### `Outcome` - -`type` — Represent success or failure of an operation with corresponding value or error information - -```ts -type Outcome -``` - -### `outcomeStatus` - -`function` — HTTP status for a failed outcome — the handler's `ToolInputError.status` when present, else 400 for a validation reject. - -```ts -(outcome: { ok: false; code: string; message: string; status?: number | undefined; }) => number -``` - -### `PageBleed` - -`interface` — Per-side bleed extents in px, drawn OUTSIDE the page bounds. - -```ts -interface PageBleed -``` - -### `PageGuides` - -`interface` — Saved ruler guides, in page coordinates. - -```ts -interface PageGuides +(outcome: { ok: false; code: string; message: string; status?: number | undefined; }) => number ``` ### `parseAssetSpec` @@ -4830,14 +3934,6 @@ interface ParseMissionBlocksOptions type ParsePlanSubmittedResult ``` -### `parseSequenceOperations` - -`function` — Shape-gate untrusted JSON (a product's `onApplyOperations` route body) into `SequenceOperation[]` BEFORE `validateSequenceOperations` sees it. - -```ts -(input: unknown) => SequenceOperation[] -``` - ### `parseSessionStreamEnvelope` `function` — Reconstruct the flat MissionStreamEvent from a broadcast envelope of shape `{ type, data: { ...missionFields } }` (transports may also stamp routing fields like workspaceId/threadId into `data`). @@ -4886,14 +3982,6 @@ interface PersistedChatMessageForTurn (part: Record) => ChatPlan | null ``` -### `PlaceClipOperation` - -`interface` — Define an operation to place a media clip with timing, track, and playback options - -```ts -interface PlaceClipOperation -``` - ### `PLAN_SUBMITTED_EVENT` `const` — Durable-plan application-shell contract. @@ -4934,14 +4022,6 @@ interface PlaceClipOperation (planId: string, outcome: "approved" | "rejected") => string ``` -### `planLanguageFanout` - -`function` — Plan which caption languages to generate: normalized, deduped (first occurrence wins), source excluded. - -```ts -(opts: LanguageFanoutOptions) => string[] -``` - ### `PlanLimit` `interface` — Plan limits — a PARAMETER per product (dollar allowance, concurrency, overage policy). @@ -5206,14 +4286,6 @@ interface PutObjectOptions (interaction: ChatInteraction) => string | null ``` -### `QueueExportOperation` - -`interface` — Define the structure for a queue export operation with format and optional metadata - -```ts -interface QueueExportOperation -``` - ### `R2LikeBucket` `interface` — The minimal slice of Cloudflare's `R2Bucket` this module calls. @@ -5294,14 +4366,6 @@ interface RateLimitResult (store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… ``` -### `RectElement` - -`interface` — Define a rectangular scene element with size, fill, optional stroke, and corner radius properties - -```ts -interface RectElement -``` - ### `RedactedDocSegment` `type` — A redacted document segment: literal text, or a masked span with the original kept ENCRYPTED for an authorized reveal. @@ -5390,22 +4454,6 @@ interface RenderUiResult (trace: FlowTrace, opts?: { width?: number | undefined; } | undefined) => string ``` -### `ReorderElementOperation` - -`interface` — Resolve an operation to reorder an element within its current owner by specifying the target index - -```ts -interface ReorderElementOperation -``` - -### `ReorderPageOperation` - -`interface` — Represent an operation to reorder a page by moving it to a specified index - -```ts -interface ReorderPageOperation -``` - ### `replayTurnEvents` `function` — Yield buffered events after `fromSeq`, then keep polling while the turn is still 'running' until it completes, errors, or times out. @@ -5430,30 +4478,6 @@ interface ReplayTurnEventsOptions interface RequestContext ``` -### `requireChannelPreset` - -`function` — Throws when the id is unknown — callers should only pass ids sourced from `CHANNEL_PRESETS`. - -```ts -(id: string) => ChannelPreset -``` - -### `requireElement` - -`function` — Resolve and return the element, its owner array, and index from the page by element ID - -```ts -(page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; } -``` - -### `requirePage` - -`function` — Resolve and return a page by ID from a document or throw an error if not found - -```ts -(document: SceneDocument, pageId: string) => ScenePage -``` - ### `requireString` `function` — Narrow one required string field, 400 if missing/empty. @@ -5470,22 +4494,6 @@ interface RequestContext () => void ``` -### `resolveCaptionPlacement` - -`function` — Caption bounds. - -```ts -(timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext, targetTrackId: string | nul… -``` - -### `resolveCaptionTarget` - -`function` — Target caption track for an `add_caption`. - -```ts -(timeline: SequenceTimeline, operation: AddCaptionOperation) => CaptionTargetResolution -``` - ### `resolveChatTurn` `function` — Resolve a chat turn by determining message reuse and constructing user message parts @@ -5574,14 +4582,6 @@ interface ResolveInteractionConnectionArgs interface ResolveModelOptions ``` -### `resolvePlaceClipTrack` - -`function` — Target track for a `place_clip`. - -```ts -(timeline: SequenceTimeline, operation: PlaceClipOperation) => SequenceTrack -``` - ### `resolveSandboxClientCredentials` `function` — Resolve sandbox client credentials based on environment and provided options asynchronously @@ -6118,815 +5118,295 @@ type SatisfiedBy type SatisfiedByRule ``` -### `scaleForPreset` +### `ScheduleFollowupArgs` -`function` — Pixel ratio for stage.toDataURL given a crop rect and an export preset. +`interface` — Define arguments required to schedule a follow-up with optional priority ```ts -(preset: ExportPreset, cropRect: ExportCropRect) => number +interface ScheduleFollowupArgs ``` -### `scalePageForChannelPreset` +### `ScheduleFollowupResult` -`function` — Computes the Konva stage parameters to render `page` centered inside `channelPreset` without cropping (contain / letterbox). +`interface` — Define the result structure for scheduling a follow-up with unique identification and due date ```ts -(page: Pick, channelPreset: ChannelPreset) => ChannelScaleResult +interface ScheduleFollowupResult ``` -### `SCENE_ELEMENT_KINDS` +### `ScopedMcpServerEntryOptions` -`const` — Define all valid kinds of scene elements used in the application +`interface` — Options for a per-document/scoped MCP channel entry (design-canvas, sequences, …). ```ts -readonly ("text" | "image" | "rect" | "video" | "ellipse" | "line" | "group")[] +interface ScopedMcpServerEntryOptions ``` -### `SCENE_OPERATION_TYPES` +### `ScopedTokenResult` -`const` — Define all valid operation types for scene manipulation in the application +`interface` — Represent a token with its expiration date and associated scope ```ts -readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | "group_elements" | "ungroup_element" | "… +interface ScopedTokenResult ``` -### `SCENE_SCHEMA_VERSION` +### `SecretStore` -`const` — Define the current version number of the scene schema +`interface` — Define methods to create, update, retrieve, and delete secrets asynchronously ```ts -1 +interface SecretStore ``` -### `SceneApplyResult` +### `secretStoreFromClient` -`type` — Represent the result of applying changes to a scene as an element, page, or entire document +`function` — Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell ```ts -type SceneApplyResult +(shell: SandboxRuntimeConfig) => SecretStore ``` -### `SceneAttrsPatch` +### `SecurityHeaderOptions` -`type` — Per-kind attribute patch. +`interface` — Define options for configuring security-related HTTP headers including disclaimers and retention labels ```ts -type SceneAttrsPatch +interface SecurityHeaderOptions ``` -### `SceneDecision` +### `serializeCookie` -`interface` — Define the structure for decisions made within a scene including type, instructions, and metadata +`function` — Serialize a Set-Cookie header value: `name=encodeURIComponent(value)` plus attributes in Path / HttpOnly / SameSite / Max-Age / Secure order. ```ts -interface SceneDecision +(value: string, opts: CookieOptions) => string ``` -### `SceneDocument` +### `SetStepStatusPatch` -`interface` — Define the structure and properties of a scene document including version, title, pages, settings, and metadata +`interface` — Define a patch to update the status and optional metadata of a step in a process ```ts -interface SceneDocument +interface SetStepStatusPatch ``` -### `SceneDocumentRecord` +### `SharedBillingState` -`interface` — Represent a scene document with its current revision number for version tracking +`interface` — Define shared billing state including user ID, plan, balances, concurrency, and overage permission ```ts -interface SceneDocumentRecord +interface SharedBillingState ``` -### `SceneElement` +### `shellQuote` -`type` — Represent a graphical element in a scene including shapes, text, media, or groups +`function` — Wraps a value in single quotes for `sh`, closing and reopening the quote around each embedded quote (`'` → `'"'"'`). ```ts -type SceneElement +(value: string) => string ``` -### `SceneElementBase` +### `SidecarInteractionsConnection` -`interface` — Attributes every element carries. +`interface` — Where and how to reach one session's interaction registry. ```ts -interface SceneElementBase +interface SidecarInteractionsConnection ``` -### `SceneElementKind` +### `SidecarInteractionsError` -`type` — Extract the kind property from a SceneElement to identify its element type +`interface` — Describe error details including code, message, and upstream HTTP status for sidecar interactions ```ts -type SceneElementKind +interface SidecarInteractionsError ``` -### `SceneExportFormat` +### `SidecarInteractionsResult` -`type` — Define supported formats for exporting a scene including image and JSON options +`type` — Represent the outcome of sidecar interactions with success or error details ```ts -type SceneExportFormat +type SidecarInteractionsResult ``` -### `SceneExportRecord` +### `signObjectUrl` -`interface` — Describe a scene export with its status, format, metadata, and result information +`function` — Mint a signed query string (`?key=…&exp=…&sig=…`) authorizing a download of `key` until `exp`. ```ts -interface SceneExportRecord +({ key, exp, secret }: SignObjectUrlArgs) => Promise ``` -### `SceneOperation` +### `SignObjectUrlArgs` -`type` — Represent operations that modify scenes by adding, updating, reordering, grouping, or deleting elements and pages +`interface` — Arguments to {@link signObjectUrl}. ```ts -type SceneOperation +interface SignObjectUrlArgs ``` -### `SceneOperationType` +### `snapHarnessToModel` -`type` — Extract the type property from a SceneOperation to represent its operation type +`function` — Keep the harness when it can run `modelId`; else the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode. ```ts -type SceneOperationType +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… ``` -### `ScenePage` +### `snapModelToHarness` -`interface` — Define the structure and properties of a scene page including layout, background, and elements +`function` — Keep `modelId` when the harness can run it; else the harness's best compatible catalog id (preferred patterns in order, highest version). ```ts -interface ScenePage +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… ``` -### `ScenePlan` +### `splitDeferredProfileFiles` -`interface` — Define a plan summarizing a scene with its description and associated operations +`function` — Split profile files into inline deferred files and a lean profile without them ```ts -interface ScenePlan +(profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; } ``` -### `SceneSettings` +### `stablePlanReceipt` -`interface` — Define settings for scene export including print conversion factor for unit calculations +`function` — Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision ```ts -interface SceneSettings +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick[], answersByInteractionId: Readonly>) => Record Promise… ``` -### `ScheduleFollowupResult` +### `stepAgentActivity` -`interface` — Define the result structure for scheduling a follow-up with unique identification and due date +`function` — Re-validate an `agentActivity` lane that crossed a JSON boundary. ```ts -interface ScheduleFollowupResult +(step: object) => StepAgentActivity[] ``` -### `ScopedMcpServerEntryOptions` +### `StepAgentActivity` -`interface` — Options for a per-document/scoped MCP channel entry (design-canvas, sequences, …). +`interface` — Canonical shape for the per-step agent-activity lane — the delegated runs (delegation MCP registry entries) a mission step spawned, journaled onto the step so a live UI can render "what the agent is… ```ts -interface ScopedMcpServerEntryOptions +interface StepAgentActivity ``` -### `ScopedTokenResult` +### `StepGateClassification` -`interface` — Represent a token with its expiration date and associated scope +`interface` — Product classification of one step. ```ts -interface ScopedTokenResult +interface StepGateClassification ``` -### `secondsToFrames` +### `stepGateProposalId` -`function` — Convert seconds to the nearest whole number of frames based on frames per second +`function` — Deterministic proposal id for a step-classification gate. ```ts -(seconds: number, fps: number) => number +(missionId: string, stepId: string) => string ``` -### `SecretStore` +### `StepOutcome` -`interface` — Define methods to create, update, retrieve, and delete secrets asynchronously +`type` — Outcome of running a single step. ```ts -interface SecretStore +type StepOutcome ``` -### `secretStoreFromClient` +### `StepSpanContext` -`function` — Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell +`interface` — Define context information for a step span including trace, span, and parent span identifiers ```ts -(shell: SandboxRuntimeConfig) => SecretStore +interface StepSpanContext ``` -### `SecurityHeaderOptions` +### `StoppedSandboxResumeFailure` -`interface` — Define options for configuring security-related HTTP headers including disclaimers and retention labels +`interface` — Describe the failure details when resuming a stopped sandbox instance ```ts -interface SecurityHeaderOptions +interface StoppedSandboxResumeFailure ``` -### `SEQUENCE_EXPORT_FORMATS` +### `StoppedSandboxResumeRecovery` -`const` — Define supported export formats for sequence outputs including video, subtitle, and metadata types +`interface` — Define the structure for resuming a stopped sandbox with replacement key and optional restore options ```ts -readonly ["mp4", "otio", "xml", "edl", "vtt", "srt", "contact_sheet"] +interface StoppedSandboxResumeRecovery ``` -### `SEQUENCE_MCP_TOOLS` +### `StorableHarnessPartKind` -`const` — Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations +`type` — Every canonical harness wire-part kind must be storable — compile-time guarantee that a new agent-interface part kind cannot silently fall out of the persisted vocabulary. ```ts -readonly SequenceMcpToolDefinition[] +type StorableHarnessPartKind ``` -### `SEQUENCE_MEDIA_KINDS` +### `StorageConfig` -`const` — Define the allowed media kinds for sequences including video, image, and audio +`interface` — S3-compatible storage provider configuration (BYOS3 - Bring Your Own S3). ```ts -readonly ["video", "image", "audio"] +interface StorageConfig ``` -### `SEQUENCE_OPERATION_TYPES` +### `storeSecret` -`const` — List all valid sequence operation types used in editing workflows +`function` — Resolve storing a secret by creating or updating it in the given SecretStore ```ts -readonly ("place_clip" | "add_caption" | "move_clip" | "trim_clip" | "split_clip" | "set_clip_text" | "set_clip_disable… +(store: SecretStore, name: string, value: string) => Promise> ``` -### `SEQUENCE_TRACK_KINDS` +### `streamAppToolLoop` -`const` — Define immutable sequence track kinds for video, audio, caption, reference, and agent +`function` — Streaming bounded tool loop: yields each raw turn event (the caller maps + telemetries + re-emits it) and each executed `tool_result`; emits one `capped` if it stops for any non-completed reason with… ```ts -readonly ["video", "audio", "caption", "reference", "agent"] +(opts: StreamToolLoopOptions) => AsyncGenerator, void, unknown> ``` -### `SequenceApplyResult` +### `StreamAppToolLoopOptions` -`type` — The entity an operation changed, for the MCP layer to serialize back to the agent. +`interface` ```ts -type SequenceApplyResult +interface StreamAppToolLoopOptions ``` -### `SequenceClip` - -`interface` — Define properties for a media sequence clip including timing, source, track, and caption details - -```ts -interface SequenceClip -``` - -### `SequenceClipMedia` - -`interface` — Resolved playable media behind a clip. - -```ts -interface SequenceClipMedia -``` - -### `SequenceClipPatch` - -`interface` — Define optional properties to update or patch a sequence clip's attributes in a timeline - -```ts -interface SequenceClipPatch -``` - -### `SequenceDecision` - -`interface` — One entry in the sequence's decision log — human edits, agent proposals, agent edits, exports, and notes all land here so the edit history is a single auditable lane. - -```ts -interface SequenceDecision -``` - -### `SequenceExportFormat` - -`type` — Define export formats available for sequence data including video, subtitle, and metadata types - -```ts -type SequenceExportFormat -``` - -### `SequenceExportRecord` - -`interface` — Describe a record representing the export details and status of a sequence - -```ts -interface SequenceExportRecord -``` - -### `SequenceExportStatus` - -`type` — Represent export status of a sequence as queued, processing, completed, failed, or cancelled - -```ts -type SequenceExportStatus -``` - -### `SequenceFrameSnapshot` - -`interface` — What is on screen/audible at a single frame — the answer shape for "what is happening at 0:34". - -```ts -interface SequenceFrameSnapshot -``` - -### `SequenceMcpToolDefinition` - -`interface` — Define a tool with metadata and a run method for processing input within a specific environment - -```ts -interface SequenceMcpToolDefinition -``` - -### `SequenceMcpToolEnv` - -`interface` — Everything one tool invocation needs. - -```ts -interface SequenceMcpToolEnv -``` - -### `SequenceMediaKind` - -`type` — Define media types allowed in a sequence including video, image, and audio - -```ts -type SequenceMediaKind -``` - -### `SequenceMeta` - -`interface` — Describe metadata and properties of a media sequence including dimensions, duration, and status - -```ts -interface SequenceMeta -``` - -### `SequenceOperation` - -`type` — Represent sequence editing actions for manipulating clips, tracks, captions, and exports - -```ts -type SequenceOperation -``` - -### `SequenceOperationContext` - -`interface` — Editor/agent context an operation is resolved against. - -```ts -interface SequenceOperationContext -``` - -### `SequenceOperationType` - -`type` — Extract the type of operation from a sequence operation object - -```ts -type SequenceOperationType -``` - -### `SequencePlan` - -`interface` — A batch of operations with the agent's stated intent — the decision-log unit for agent edits. - -```ts -interface SequencePlan -``` - -### `SEQUENCES_MCP_PROTOCOL_VERSIONS` - -`const` — Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server. - -```ts -readonly ["2025-06-18", "2025-03-26", "2024-11-05"] -``` - -### `SequencesMcpServerInfo` - -`interface` — Describe server information including name and version for Sequences MCP integration - -```ts -interface SequencesMcpServerInfo -``` - -### `SequenceStatus` - -`type` — Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived - -```ts -type SequenceStatus -``` - -### `SequenceStore` - -`interface` — Manage sequences by providing methods to get timelines, clips, and modify tracks and clips - -```ts -interface SequenceStore -``` - -### `SequenceStoreScope` - -`interface` — Per-request scope a product binds when constructing its store. - -```ts -interface SequenceStoreScope -``` - -### `SequenceTimeline` - -`interface` — The full timeline aggregate — what `get_timeline_state` returns and what every operation validates against. - -```ts -interface SequenceTimeline -``` - -### `SequenceTrack` - -`interface` — Define properties and state for a sequence track including id, kind, name, order, and flags - -```ts -interface SequenceTrack -``` - -### `SequenceTrackKind` - -`type` — Track kinds. - -```ts -type SequenceTrackKind -``` - -### `serializeCookie` - -`function` — Serialize a Set-Cookie header value: `name=encodeURIComponent(value)` plus attributes in Path / HttpOnly / SameSite / Max-Age / Secure order. - -```ts -(value: string, opts: CookieOptions) => string -``` - -### `SetAttrsOperation` - -`interface` — Define an operation to update attributes of a specific element on a page - -```ts -interface SetAttrsOperation -``` - -### `SetClipDisabledOperation` - -`interface` — Define an operation to enable or disable a clip by its identifier - -```ts -interface SetClipDisabledOperation -``` - -### `SetClipTextOperation` - -`interface` — Resolve an operation to set clipboard text with optional language and clip identifier - -```ts -interface SetClipTextOperation -``` - -### `SetDocumentTitleOperation` - -`interface` — Define an operation to set the document title to a specified string - -```ts -interface SetDocumentTitleOperation -``` - -### `SetPageGuidesOperation` - -`interface` — Resolve an operation to set guides on a specific page by its identifier - -```ts -interface SetPageGuidesOperation -``` - -### `SetPagePropsOperation` - -`interface` — Define an operation to set or update properties of a page including size, background, and bleed - -```ts -interface SetPagePropsOperation -``` - -### `SetStepStatusPatch` - -`interface` — Define a patch to update the status and optional metadata of a step in a process - -```ts -interface SetStepStatusPatch -``` - -### `SharedBillingState` - -`interface` — Define shared billing state including user ID, plan, balances, concurrency, and overage permission - -```ts -interface SharedBillingState -``` - -### `shellQuote` - -`function` — Wraps a value in single quotes for `sh`, closing and reopening the quote around each embedded quote (`'` → `'"'"'`). - -```ts -(value: string) => string -``` - -### `SidecarInteractionsConnection` - -`interface` — Where and how to reach one session's interaction registry. - -```ts -interface SidecarInteractionsConnection -``` - -### `SidecarInteractionsError` - -`interface` — Describe error details including code, message, and upstream HTTP status for sidecar interactions - -```ts -interface SidecarInteractionsError -``` - -### `SidecarInteractionsResult` - -`type` — Represent the outcome of sidecar interactions with success or error details - -```ts -type SidecarInteractionsResult -``` - -### `signObjectUrl` - -`function` — Mint a signed query string (`?key=…&exp=…&sig=…`) authorizing a download of `key` until `exp`. - -```ts -({ key, exp, secret }: SignObjectUrlArgs) => Promise -``` - -### `SignObjectUrlArgs` - -`interface` — Arguments to {@link signObjectUrl}. - -```ts -interface SignObjectUrlArgs -``` - -### `SIZE_PRESETS` - -`const` — Provide predefined size presets for social, presentation, and print categories - -```ts -readonly SizePreset[] -``` - -### `SizePreset` - -`interface` — Define size presets with identifiers, labels, categories, and dimensions for various media types - -```ts -interface SizePreset -``` - -### `SlotFillKind` - -`type` — Define allowed string literals representing different slot fill kinds - -```ts -type SlotFillKind -``` - -### `snapHarnessToModel` - -`function` — Keep the harness when it can run `modelId`; else the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode. - -```ts -(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… -``` - -### `snapModelToHarness` - -`function` — Keep `modelId` when the harness can run it; else the harness's best compatible catalog id (preferred patterns in order, highest version). - -```ts -(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… -``` - -### `snapshotFrame` - -`function` — Resolve everything active at one frame — the core of `get_frame_at_time`. - -```ts -(timeline: SequenceTimeline, frame: number) => SequenceFrameSnapshot -``` - -### `SplitClipOperation` - -`interface` — Split a clip at a specified frame inside the clip to create two separate segments - -```ts -interface SplitClipOperation -``` - -### `splitDeferredProfileFiles` - -`function` — Split profile files into inline deferred files and a lean profile without them - -```ts -(profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; } -``` - -### `stablePlanReceipt` - -`function` — Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision - -```ts -(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick[], answersByInteractionId: Readonly>) => Record Promise… -``` - -### `stepAgentActivity` - -`function` — Re-validate an `agentActivity` lane that crossed a JSON boundary. - -```ts -(step: object) => StepAgentActivity[] -``` - -### `StepAgentActivity` - -`interface` — Canonical shape for the per-step agent-activity lane — the delegated runs (delegation MCP registry entries) a mission step spawned, journaled onto the step so a live UI can render "what the agent is… - -```ts -interface StepAgentActivity -``` - -### `StepGateClassification` - -`interface` — Product classification of one step. - -```ts -interface StepGateClassification -``` - -### `stepGateProposalId` - -`function` — Deterministic proposal id for a step-classification gate. - -```ts -(missionId: string, stepId: string) => string -``` - -### `StepOutcome` - -`type` — Outcome of running a single step. - -```ts -type StepOutcome -``` - -### `StepSpanContext` - -`interface` — Define context information for a step span including trace, span, and parent span identifiers - -```ts -interface StepSpanContext -``` - -### `StoppedSandboxResumeFailure` - -`interface` — Describe the failure details when resuming a stopped sandbox instance - -```ts -interface StoppedSandboxResumeFailure -``` - -### `StoppedSandboxResumeRecovery` - -`interface` — Define the structure for resuming a stopped sandbox with replacement key and optional restore options - -```ts -interface StoppedSandboxResumeRecovery -``` - -### `StorableHarnessPartKind` - -`type` — Every canonical harness wire-part kind must be storable — compile-time guarantee that a new agent-interface part kind cannot silently fall out of the persisted vocabulary. - -```ts -type StorableHarnessPartKind -``` - -### `StorageConfig` - -`interface` — S3-compatible storage provider configuration (BYOS3 - Bring Your Own S3). - -```ts -interface StorageConfig -``` - -### `storeApplyScenePlan` - -`function` — Resolve and apply a scene plan to the store with specified actor context and generate results - -```ts -(store: SceneStore, plan: ScenePlan, opts: { actorKind: "human_edit" | "agent_edit" | "agent_proposal" | "export" | "no… -``` - -### `storeSecret` - -`function` — Resolve storing a secret by creating or updating it in the given SecretStore - -```ts -(store: SecretStore, name: string, value: string) => Promise> -``` - -### `streamAppToolLoop` - -`function` — Streaming bounded tool loop: yields each raw turn event (the caller maps + telemetries + re-emits it) and each executed `tool_result`; emits one `capped` if it stops for any non-completed reason with… - -```ts -(opts: StreamToolLoopOptions) => AsyncGenerator, void, unknown> -``` - -### `StreamAppToolLoopOptions` - -`interface` - -```ts -interface StreamAppToolLoopOptions -``` - -### `StreamEvent` +### `StreamEvent` `interface` — Define an event object carrying a type and optional JSON data payload @@ -7134,14 +5614,6 @@ interface TaskGold interface TcloudKeyClient ``` -### `TemplateSlot` - -`interface` — Define a slot template specifying its name, page, element, and fill characteristics - -```ts -interface TemplateSlot -``` - ### `terminalizeDanglingAssistantToolUpdates` `function` — Finalizes, then folds each synthetic tool settlement back into `partMap` and returns just those updates — the shape a streaming loop needs to emit closing `message.part.updated` frames for tools the… @@ -7182,14 +5654,6 @@ interface TerminalProxyIdentity (headers: Headers) => string | null ``` -### `TextElement` - -`interface` — Define properties for a text element including content, style, alignment, and layout parameters - -```ts -interface TextElement -``` - ### `themeColor` `function` — Wrap a channel triple in `hsl()`; pass through values already in a color form. @@ -7254,22 +5718,6 @@ interface TimedEvent (lines: string[]) => TimedEvent[] ``` -### `TimelineClipBounds` - -`interface` — Define the start frame and duration in frames for a timeline clip's bounds - -```ts -interface TimelineClipBounds -``` - -### `TimelineInterval` - -`interface` — Define a time range with inclusive start and end frame numbers - -```ts -interface TimelineInterval -``` - ### `toChatMessageParts` `function` — The typed projection at the `/stream` → `/chat-store` boundary. @@ -7350,30 +5798,6 @@ type ToolLoopStopReason (ctx: MissionTraceContext | StepSpanContext) => { TRACE_ID: string; PARENT_SPAN_ID: string; } ``` -### `trackIntervals` - -`function` — Occupied intervals on one track, for placement collision checks. - -```ts -(timeline: SequenceTimeline, trackId: string) => TimelineInterval[] -``` - -### `TranscriptSegment` - -`interface` — Server twin of `TranscriptionSegment` (../sequences-react/contracts) — structurally identical so react-side transcription output feeds `buildCaptionChunks` without mapping. - -```ts -interface TranscriptSegment -``` - -### `TrimClipOperation` - -`interface` — Define an operation to trim a clip by adjusting its start, duration, and optional source in/out points - -```ts -interface TrimClipOperation -``` - ### `trimOrNull` `function` — Resolve a string by trimming whitespace or returning null if empty or undefined @@ -7414,14 +5838,6 @@ interface TurnEventStore type TurnStatus ``` -### `UngroupElementOperation` - -`interface` — Resolve an operation to ungroup elements within a specified page and group context - -```ts -interface UngroupElementOperation -``` - ### `upsertDurableInteractionAsk` `function` — Apply an ask event. @@ -7430,46 +5846,6 @@ interface UngroupElementOperation (store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde… ``` -### `validateAddCaption` - -`function` — Validate the parameters and context of an AddCaptionOperation within a sequence timeline - -```ts -(timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext) => void -``` - -### `validateBindings` - -`function` — Preflight check: every key in `bindings` must name a slot in the document. - -```ts -(document: SceneDocument, bindings: Record) => string[] -``` - -### `validateCreateTrack` - -`function` — Validate that a CreateTrackOperation has a supported kind and a non-empty name - -```ts -(operation: CreateTrackOperation) => void -``` - -### `validateDeleteClip` - -`function` — Validate that the clip to delete exists and is mutable in the given timeline - -```ts -(timeline: SequenceTimeline, operation: DeleteClipOperation) => void -``` - -### `validateExtendSequence` - -`function` — Validate that the extend sequence operation has a positive duration and exceeds the last clip end frame - -```ts -(timeline: SequenceTimeline, operation: ExtendSequenceOperation) => void -``` - ### `validateInteractionAnswerBody` `function` — Validates the client POST body: `{ id, outcome, data? @@ -7478,102 +5854,6 @@ interface UngroupElementOperation (body: Record) => InteractionAnswerBodyValidation ``` -### `validateMoveClip` - -`function` — Validate that a clip move operation is within bounds and targets a compatible unlocked track - -```ts -(timeline: SequenceTimeline, operation: MoveClipOperation) => void -``` - -### `validatePlaceClip` - -`function` — Validate the properties and constraints of a PlaceClipOperation within a SequenceTimeline - -```ts -(timeline: SequenceTimeline, operation: PlaceClipOperation) => void -``` - -### `validateQueueExport` - -`function` — Validate that the queue export operation uses a supported export format - -```ts -(operation: QueueExportOperation) => void -``` - -### `validateSceneOperation` - -`function` — Validate a scene operation against the document to ensure it meets required constraints - -```ts -(document: SceneDocument, operation: SceneOperation) => void -``` - -### `validateSceneOperations` - -`function` — Validate each scene operation against the document and throw detailed errors for invalid operations - -```ts -(document: SceneDocument, operations: SceneOperation[]) => void -``` - -### `validateSequenceOperation` - -`function` — Validate a sequence operation against the timeline and context to ensure correctness - -```ts -(timeline: SequenceTimeline, operation: SequenceOperation, ctx: SequenceOperationContext) => void -``` - -### `validateSequenceOperations` - -`function` — Validate each operation in a sequence against the timeline and context, throwing detailed errors on failure - -```ts -(timeline: SequenceTimeline, operations: SequenceOperation[], ctx: SequenceOperationContext) => void -``` - -### `validateSetClipDisabled` - -`function` — Validate that the clip can be disabled within the given timeline and operation constraints - -```ts -(timeline: SequenceTimeline, operation: SetClipDisabledOperation) => void -``` - -### `validateSetClipText` - -`function` — Validate that a SetClipTextOperation targets a caption clip with non-empty text and valid language tag - -```ts -(timeline: SequenceTimeline, operation: SetClipTextOperation) => void -``` - -### `validateSlotValue` - -`function` — Validates that a slot binding value matches the slot element's kind. - -```ts -(slotName: string, elementKind: "text" | "image" | "rect" | "video" | "ellipse" | "line" | "group", value: string) => v… -``` - -### `validateSplitClip` - -`function` — Validate that a split operation on a clip is within valid frame boundaries and conditions - -```ts -(timeline: SequenceTimeline, operation: SplitClipOperation) => void -``` - -### `validateTrimClip` - -`function` — Validate that a trim clip operation respects timeline bounds and source frame constraints - -```ts -(timeline: SequenceTimeline, operation: TrimClipOperation) => void -``` - ### `VaultKv` `type` — The KV-backed vault. @@ -7670,14 +5950,6 @@ ZodObject<{ durationSeconds: ZodNumber; scenes: ZodArray + # `./intakes/api` diff --git a/docs/api/intakes-drizzle.md b/docs/api/intakes-drizzle.md index c5e22f7..bed482d 100644 --- a/docs/api/intakes-drizzle.md +++ b/docs/api/intakes-drizzle.md @@ -1,4 +1,4 @@ - + # `./intakes/drizzle` diff --git a/docs/api/intakes-react-lazy.md b/docs/api/intakes-react-lazy.md index b26241b..e2c4daf 100644 --- a/docs/api/intakes-react-lazy.md +++ b/docs/api/intakes-react-lazy.md @@ -1,4 +1,4 @@ - + # `./intakes-react/lazy` diff --git a/docs/api/intakes-react.md b/docs/api/intakes-react.md index 74b334c..edc0581 100644 --- a/docs/api/intakes-react.md +++ b/docs/api/intakes-react.md @@ -1,4 +1,4 @@ - + # `./intakes-react` diff --git a/docs/api/intakes.md b/docs/api/intakes.md index d9ff2f2..922e416 100644 --- a/docs/api/intakes.md +++ b/docs/api/intakes.md @@ -1,4 +1,4 @@ - + # `./intakes` diff --git a/docs/api/integrations.md b/docs/api/integrations.md index b2eedb2..c324ad7 100644 --- a/docs/api/integrations.md +++ b/docs/api/integrations.md @@ -1,4 +1,4 @@ - + # `./integrations` diff --git a/docs/api/interactions.md b/docs/api/interactions.md index 5fcbdf3..620be74 100644 --- a/docs/api/interactions.md +++ b/docs/api/interactions.md @@ -1,4 +1,4 @@ - + # `./interactions` diff --git a/docs/api/knowledge-loop.md b/docs/api/knowledge-loop.md index ae996e3..226db7d 100644 --- a/docs/api/knowledge-loop.md +++ b/docs/api/knowledge-loop.md @@ -1,4 +1,4 @@ - + # `./knowledge-loop` diff --git a/docs/api/knowledge.md b/docs/api/knowledge.md index 6d5d630..bbe1fc4 100644 --- a/docs/api/knowledge.md +++ b/docs/api/knowledge.md @@ -1,4 +1,4 @@ - + # `./knowledge` diff --git a/docs/api/missions.md b/docs/api/missions.md index ad91ba9..270fdbb 100644 --- a/docs/api/missions.md +++ b/docs/api/missions.md @@ -1,4 +1,4 @@ - + # `./missions` diff --git a/docs/api/model-resolution.md b/docs/api/model-resolution.md index 88602be..46f7798 100644 --- a/docs/api/model-resolution.md +++ b/docs/api/model-resolution.md @@ -1,4 +1,4 @@ - + # `./model-resolution` diff --git a/docs/api/object-store.md b/docs/api/object-store.md index 31955eb..d928cc0 100644 --- a/docs/api/object-store.md +++ b/docs/api/object-store.md @@ -1,4 +1,4 @@ - + # `./object-store` diff --git a/docs/api/plans.md b/docs/api/plans.md index 94a5cc8..03a75a9 100644 --- a/docs/api/plans.md +++ b/docs/api/plans.md @@ -1,4 +1,4 @@ - + # `./plans` diff --git a/docs/api/platform.md b/docs/api/platform.md index 54de32c..58d2c75 100644 --- a/docs/api/platform.md +++ b/docs/api/platform.md @@ -1,4 +1,4 @@ - + # `./platform` diff --git a/docs/api/preflight.md b/docs/api/preflight.md index 0dd2965..77a91f4 100644 --- a/docs/api/preflight.md +++ b/docs/api/preflight.md @@ -1,4 +1,4 @@ - + # `./preflight` diff --git a/docs/api/preset-cloudflare.md b/docs/api/preset-cloudflare.md index 0f2522d..e8dd4b7 100644 --- a/docs/api/preset-cloudflare.md +++ b/docs/api/preset-cloudflare.md @@ -1,4 +1,4 @@ - + # `./preset-cloudflare` diff --git a/docs/api/profile.md b/docs/api/profile.md index 2e75a48..7f3ffcd 100644 --- a/docs/api/profile.md +++ b/docs/api/profile.md @@ -1,4 +1,4 @@ - + # `./profile` diff --git a/docs/api/prompt.md b/docs/api/prompt.md index 5e9dfda..5bbaa92 100644 --- a/docs/api/prompt.md +++ b/docs/api/prompt.md @@ -1,4 +1,4 @@ - + # `./prompt` diff --git a/docs/api/redact.md b/docs/api/redact.md index 8192a49..1b013b7 100644 --- a/docs/api/redact.md +++ b/docs/api/redact.md @@ -1,4 +1,4 @@ - + # `./redact` diff --git a/docs/api/run.md b/docs/api/run.md index 1840391..8854dd0 100644 --- a/docs/api/run.md +++ b/docs/api/run.md @@ -1,4 +1,4 @@ - + # `./run` diff --git a/docs/api/runtime.md b/docs/api/runtime.md index 0e8c705..33800f1 100644 --- a/docs/api/runtime.md +++ b/docs/api/runtime.md @@ -1,4 +1,4 @@ - + # `./runtime` diff --git a/docs/api/sandbox.md b/docs/api/sandbox.md index 706d7cf..cbae099 100644 --- a/docs/api/sandbox.md +++ b/docs/api/sandbox.md @@ -1,4 +1,4 @@ - + # `./sandbox` diff --git a/docs/api/sequences-drizzle.md b/docs/api/sequences-drizzle.md index 6c04a65..19cb7fa 100644 --- a/docs/api/sequences-drizzle.md +++ b/docs/api/sequences-drizzle.md @@ -1,4 +1,4 @@ - + # `./sequences/drizzle` diff --git a/docs/api/sequences-react.md b/docs/api/sequences-react.md index 09e0684..eda266c 100644 --- a/docs/api/sequences-react.md +++ b/docs/api/sequences-react.md @@ -1,4 +1,4 @@ - + # `./sequences-react` diff --git a/docs/api/sequences.md b/docs/api/sequences.md index 2a3e9bd..b924281 100644 --- a/docs/api/sequences.md +++ b/docs/api/sequences.md @@ -1,4 +1,4 @@ - + # `./sequences` diff --git a/docs/api/skills-placement.md b/docs/api/skills-placement.md index 97335b0..ea0ce49 100644 --- a/docs/api/skills-placement.md +++ b/docs/api/skills-placement.md @@ -1,4 +1,4 @@ - + # `./skills-placement` diff --git a/docs/api/skills.md b/docs/api/skills.md index 72cb4d9..8a03fbc 100644 --- a/docs/api/skills.md +++ b/docs/api/skills.md @@ -1,4 +1,4 @@ - + # `./skills` diff --git a/docs/api/store.md b/docs/api/store.md index 7b053a3..5139dfc 100644 --- a/docs/api/store.md +++ b/docs/api/store.md @@ -1,4 +1,4 @@ - + # `./store` diff --git a/docs/api/stream.md b/docs/api/stream.md index a21eedf..69be1fb 100644 --- a/docs/api/stream.md +++ b/docs/api/stream.md @@ -1,4 +1,4 @@ - + # `./stream` diff --git a/docs/api/studio-react.md b/docs/api/studio-react.md index 30cf833..289bd9e 100644 --- a/docs/api/studio-react.md +++ b/docs/api/studio-react.md @@ -1,4 +1,4 @@ - + # `./studio-react` diff --git a/docs/api/studio.md b/docs/api/studio.md index a35ce21..fd6b983 100644 --- a/docs/api/studio.md +++ b/docs/api/studio.md @@ -1,4 +1,4 @@ - + # `./studio` diff --git a/docs/api/tangle.md b/docs/api/tangle.md index 8464807..376d727 100644 --- a/docs/api/tangle.md +++ b/docs/api/tangle.md @@ -1,4 +1,4 @@ - + # `./tangle` diff --git a/docs/api/teams-drizzle.md b/docs/api/teams-drizzle.md index c648538..458cd65 100644 --- a/docs/api/teams-drizzle.md +++ b/docs/api/teams-drizzle.md @@ -1,4 +1,4 @@ - + # `./teams/drizzle` diff --git a/docs/api/teams-invitations-api.md b/docs/api/teams-invitations-api.md index f5ea7ef..36858b2 100644 --- a/docs/api/teams-invitations-api.md +++ b/docs/api/teams-invitations-api.md @@ -1,4 +1,4 @@ - + # `./teams/invitations-api` diff --git a/docs/api/teams-members-api.md b/docs/api/teams-members-api.md index bb132fa..379b101 100644 --- a/docs/api/teams-members-api.md +++ b/docs/api/teams-members-api.md @@ -1,4 +1,4 @@ - + # `./teams/members-api` diff --git a/docs/api/teams-react-lazy.md b/docs/api/teams-react-lazy.md index 51ec9a2..76a7b7b 100644 --- a/docs/api/teams-react-lazy.md +++ b/docs/api/teams-react-lazy.md @@ -1,4 +1,4 @@ - + # `./teams-react/lazy` diff --git a/docs/api/teams-react.md b/docs/api/teams-react.md index 30a9309..cca31ba 100644 --- a/docs/api/teams-react.md +++ b/docs/api/teams-react.md @@ -1,4 +1,4 @@ - + # `./teams-react` diff --git a/docs/api/teams-resend.md b/docs/api/teams-resend.md index 454588d..cdda2d7 100644 --- a/docs/api/teams-resend.md +++ b/docs/api/teams-resend.md @@ -1,4 +1,4 @@ - + # `./teams/resend` diff --git a/docs/api/teams.md b/docs/api/teams.md index 2617250..e5d9c73 100644 --- a/docs/api/teams.md +++ b/docs/api/teams.md @@ -1,4 +1,4 @@ - + # `./teams` diff --git a/docs/api/theme-contract-cli.md b/docs/api/theme-contract-cli.md index 73f9f9d..558a909 100644 --- a/docs/api/theme-contract-cli.md +++ b/docs/api/theme-contract-cli.md @@ -1,4 +1,4 @@ - + # `./theme-contract/cli` diff --git a/docs/api/theme-contract.md b/docs/api/theme-contract.md index d40014a..cbba18f 100644 --- a/docs/api/theme-contract.md +++ b/docs/api/theme-contract.md @@ -1,4 +1,4 @@ - + # `./theme-contract` diff --git a/docs/api/theme-tailwind-preset.md b/docs/api/theme-tailwind-preset.md index 08eeb1f..3e0a2b5 100644 --- a/docs/api/theme-tailwind-preset.md +++ b/docs/api/theme-tailwind-preset.md @@ -1,4 +1,4 @@ - + # `./theme/tailwind-preset` diff --git a/docs/api/theme.md b/docs/api/theme.md index ebc037d..8785f38 100644 --- a/docs/api/theme.md +++ b/docs/api/theme.md @@ -1,4 +1,4 @@ - + # `./theme` diff --git a/docs/api/tools.md b/docs/api/tools.md index dcdc7d9..5dd08f2 100644 --- a/docs/api/tools.md +++ b/docs/api/tools.md @@ -1,4 +1,4 @@ - + # `./tools` diff --git a/docs/api/trace.md b/docs/api/trace.md index 3517026..d6418e3 100644 --- a/docs/api/trace.md +++ b/docs/api/trace.md @@ -1,4 +1,4 @@ - + # `./trace` diff --git a/docs/api/turn-stream.md b/docs/api/turn-stream.md index 9d5ec7b..2c463b0 100644 --- a/docs/api/turn-stream.md +++ b/docs/api/turn-stream.md @@ -1,4 +1,4 @@ - + # `./turn-stream` diff --git a/docs/api/vault-lazy.md b/docs/api/vault-lazy.md index e1799af..89dbe47 100644 --- a/docs/api/vault-lazy.md +++ b/docs/api/vault-lazy.md @@ -1,4 +1,4 @@ - + # `./vault/lazy` diff --git a/docs/api/vault.md b/docs/api/vault.md index 402e25c..d249d87 100644 --- a/docs/api/vault.md +++ b/docs/api/vault.md @@ -1,4 +1,4 @@ - + # `./vault` diff --git a/docs/api/web-react-terminal.md b/docs/api/web-react-terminal.md index ae73d5e..1c88375 100644 --- a/docs/api/web-react-terminal.md +++ b/docs/api/web-react-terminal.md @@ -1,4 +1,4 @@ - + # `./web-react/terminal` diff --git a/docs/api/web-react.md b/docs/api/web-react.md index 1c2c550..5fcc3ae 100644 --- a/docs/api/web-react.md +++ b/docs/api/web-react.md @@ -1,4 +1,4 @@ - + # `./web-react` diff --git a/docs/api/web.md b/docs/api/web.md index 3f19e83..b013a65 100644 --- a/docs/api/web.md +++ b/docs/api/web.md @@ -1,4 +1,4 @@ - + # `./web` diff --git a/docs/codemap.json b/docs/codemap.json new file mode 100644 index 0000000..02a5243 --- /dev/null +++ b/docs/codemap.json @@ -0,0 +1,19383 @@ +{ + "generator": "agent-docs", + "title": "agent-app", + "source": "tsup.config `entry`", + "slug": "tangle-network/agent-app", + "entries": [ + { + "id": ".", + "source": "src/index.ts", + "dependsOn": [ + "assets", + "assistant", + "billing", + "brand", + "brand-extraction", + "chat-routes", + "chat-store", + "config", + "crypto", + "design-canvas", + "design-canvas-react", + "durable-chat", + "eval", + "eval-campaign", + "harness", + "intakes", + "intakes-react", + "integrations", + "interactions", + "knowledge", + "knowledge-loop", + "missions", + "model-resolution", + "object-store", + "plans", + "platform", + "preflight", + "preset-cloudflare", + "profile", + "prompt", + "redact", + "run", + "runtime", + "sandbox", + "sequences", + "sequences-react", + "skills", + "skills-placement", + "store", + "stream", + "studio", + "studio-react", + "tangle", + "teams", + "teams-react", + "theme", + "theme-contract", + "tools", + "trace", + "turn-stream", + "vault", + "web", + "web-react" + ], + "error": null, + "exports": [ + { + "name": "AddCitationArgs", + "kind": "interface", + "signature": "interface AddCitationArgs", + "doc": "Define arguments required to add a citation including path, quote, and optional label" + }, + { + "name": "AddCitationResult", + "kind": "interface", + "signature": "interface AddCitationResult", + "doc": "Represent the result of adding a citation including its identifier and location path" + }, + { + "name": "addSecurityHeaders", + "kind": "function", + "signature": "(response: Response, opts?: SecurityHeaderOptions) => Response", + "doc": "Set standard security headers on a response (HSTS, nosniff, frame-options, referrer-policy, XSS) + optional product disclaimer/retention." + }, + { + "name": "AgentAppConfig", + "kind": "interface", + "signature": "interface AgentAppConfig", + "doc": "The declarative domain surface of a Tangle agent product." + }, + { + "name": "agentAppConfigJsonSchema", + "kind": "const", + "signature": "{ readonly $schema: \"https://json-schema.org/draft/2020-12/schema\"; readonly $id: \"https://tangle.tools/schemas/agent-a…", + "doc": "Machine-readable JSON Schema (draft 2020-12) for {@link AgentAppConfig}." + }, + { + "name": "AgentAppTheme", + "kind": "interface", + "signature": "interface AgentAppTheme", + "doc": "Typed mirror of tokens.css for runtime/JS theming." + }, + { + "name": "AgentIdentityConfig", + "kind": "interface", + "signature": "interface AgentIdentityConfig", + "doc": "Who the agent is, as data." + }, + { + "name": "AgentIntegrationsConfig", + "kind": "interface", + "signature": "interface AgentIntegrationsConfig", + "doc": "Which integrations the product enables, as data." + }, + { + "name": "AgentKnowledgeConfig", + "kind": "interface", + "signature": "interface AgentKnowledgeConfig", + "doc": "The knowledge surface, as data." + }, + { + "name": "AgentRuntime", + "kind": "interface", + "signature": "interface AgentRuntime", + "doc": "Resolve and stream tool execution loops with final results and intermediate events for agent runtime" + }, + { + "name": "AgentRuntimeModelConfig", + "kind": "interface", + "signature": "interface AgentRuntimeModelConfig", + "doc": "OpenAI-compatible model endpoint (Tangle Router / tcloud / any compat provider)." + }, + { + "name": "AgentTaxonomyConfig", + "kind": "interface", + "signature": "interface AgentTaxonomyConfig", + "doc": "The proposal taxonomy, as data." + }, + { + "name": "AgentTurnOptions", + "kind": "interface", + "signature": "interface AgentTurnOptions", + "doc": "Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers" + }, + { + "name": "AgentUiConfig", + "kind": "interface", + "signature": "interface AgentUiConfig", + "doc": "UI capability flags, as data." + }, + { + "name": "AnySurfaceKind", + "kind": "type", + "signature": "type AnySurfaceKind", + "doc": "The variance-erased form a registry accepts (`build` is contravariant in `TCtx`, so every concrete definition is assignable to this)." + }, + { + "name": "APP_TOOL_NAMES", + "kind": "const", + "signature": "readonly [\"submit_proposal\", \"schedule_followup\", \"render_ui\", \"add_citation\"]", + "doc": "The four canonical app-tool names." + }, + { + "name": "applyDurableInteractionAnswer", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: \"declined\" | \"accepted\", answers?: R…", + "doc": "Resolve and record the outcome and answers of a durable interaction within the given store and scope" + }, + { + "name": "applyDurableInteractionAsk", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde…", + "doc": "Resolve and upsert a durable interaction ask in the store with optional event and timing parameters" + }, + { + "name": "applyDurableInteractionCancel", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even…", + "doc": "Resolve cancellation of a durable interaction with optional reason and event details" + }, + { + "name": "applyMissionEvent", + "kind": "function", + "signature": "(prev: MissionState | undefined, event: MissionStreamEvent) => MissionState", + "doc": "Fold one event into one mission's state." + }, + { + "name": "ApprovalEvent", + "kind": "interface", + "signature": "interface ApprovalEvent", + "doc": "Describe an approval event with action details, user info, and optional edited fields" + }, + { + "name": "ApprovalEventSchema", + "kind": "const", + "signature": "ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEnum<{ scheduled: \"scheduled\"; approved:…", + "doc": "Validate approval event data including asset, action, user, timestamp, and optional fields" + }, + { + "name": "AppToolContext", + "kind": "interface", + "signature": "interface AppToolContext", + "doc": "Server-set, trusted per-turn context." + }, + { + "name": "AppToolDefinition", + "kind": "interface", + "signature": "interface AppToolDefinition", + "doc": "A product-defined app tool — the open registration seam." + }, + { + "name": "AppToolDescriptor", + "kind": "interface", + "signature": "interface AppToolDescriptor", + "doc": "Describe an application tool with its name, unique key, and description" + }, + { + "name": "AppToolHandlers", + "kind": "interface", + "signature": "interface AppToolHandlers", + "doc": "The domain seam." + }, + { + "name": "AppToolLoopOptions", + "kind": "interface", + "signature": "interface AppToolLoopOptions", + "doc": null + }, + { + "name": "AppToolMcpServer", + "kind": "interface", + "signature": "interface AppToolMcpServer", + "doc": "The portable MCP server entry the sandbox SDK accepts (transport + url + headers)." + }, + { + "name": "AppToolName", + "kind": "type", + "signature": "type AppToolName", + "doc": "Resolve a valid application tool name from the predefined list of tool names" + }, + { + "name": "AppToolOutcome", + "kind": "type", + "signature": "type AppToolOutcome", + "doc": "Outcome of one tool dispatch — structurally identical to the agent-runtime tool-loop's `ToolCallOutcome`, so a dispatched outcome folds straight into the loop's `role: 'tool'` result message." + }, + { + "name": "AppToolProducedEvent", + "kind": "type", + "signature": "type AppToolProducedEvent", + "doc": "Produced-state events the runtime executor emits at the real side-effect site, so a consumer's eval/completion oracle credits a persisted proposal or artifact." + }, + { + "name": "AppToolRuntimeExecutor", + "kind": "type", + "signature": "type AppToolRuntimeExecutor", + "doc": "Executes an app-tool call the model emits on the agent-runtime chat path." + }, + { + "name": "AppToolTaxonomy", + "kind": "interface", + "signature": "interface AppToolTaxonomy", + "doc": "The product's proposal taxonomy — the only domain-specific vocabulary the generic layer needs (to validate `submit_proposal.type` and label the regulated subset)." + }, + { + "name": "asMissionStreamEvent", + "kind": "function", + "signature": "(value: unknown) => MissionStreamEvent | null", + "doc": "Narrow an arbitrary channel payload to a MissionStreamEvent." + }, + { + "name": "asRecord", + "kind": "function", + "signature": "(value: unknown) => JsonRecord | undefined", + "doc": "Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined" + }, + { + "name": "assertEnvWithinLimits", + "kind": "function", + "signature": "(env: Record) => void", + "doc": "Throw when any single env value exceeds {@link ENV_VALUE_MAX_BYTES} or the whole env block exceeds {@link ENV_TOTAL_MAX_BYTES}, naming the offending variable." + }, + { + "name": "assertHarnessModelCompatible", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Fail-loud server guard: throw when a harness is asked to run a model it can't." + }, + { + "name": "assertMediaUrl", + "kind": "function", + "signature": "(url: string, what?: string) => void", + "doc": "Canonical media-reference boundary shared by every surface that persists a media url (sequences clips, design-canvas image/video src)." + }, + { + "name": "assertProvisionPayloadWithinCap", + "kind": "function", + "signature": "(payload: ProvisionPayloadSections) => void", + "doc": "Throw when the serialized provision payload exceeds {@link PROVISION_PAYLOAD_MAX_BYTES}." + }, + { + "name": "assertSafeKeySegment", + "kind": "function", + "signature": "(s: string) => string", + "doc": "Assert a single object-key path SEGMENT (an operator id, customer id, or upload id) is safe to interpolate into a key, and return it." + }, + { + "name": "AssetContentMap", + "kind": "type", + "signature": "type AssetContentMap", + "doc": "Map asset keys to their corresponding content types for various media and copy formats" + }, + { + "name": "AssetFormat", + "kind": "type", + "signature": "type AssetFormat", + "doc": "Define valid asset format strings for various media and copy types" + }, + { + "name": "AssetSpec", + "kind": "interface", + "signature": "interface AssetSpec", + "doc": "Define the structure and metadata for an asset including its format, brand, content, and status" + }, + { + "name": "AssetStatus", + "kind": "type", + "signature": "type AssetStatus", + "doc": "Define possible states representing the lifecycle status of an asset" + }, + { + "name": "AssetVariant", + "kind": "interface", + "signature": "interface AssetVariant", + "doc": "Describe an asset variant with identification, approval status, and edit history details" + }, + { + "name": "asString", + "kind": "function", + "signature": "(value: unknown) => string | undefined", + "doc": "Resolve a non-empty string from a value or return undefined" + }, + { + "name": "attachmentInputToPart", + "kind": "function", + "signature": "(input: ChatAttachmentInput) => ChatAttachmentPart", + "doc": "Drop absent/empty optional fields rather than persisting `undefined`/`''` — keeps stored parts minimal." + }, + { + "name": "attachmentKindForMime", + "kind": "function", + "signature": "(mime?: string | undefined) => ChatAttachmentKind", + "doc": "`image` for any `image/*` mime, `file` for everything else (including an absent/empty mime) — the same split the composer and the persisted-part discriminant both key on." + }, + { + "name": "attachmentPartKey", + "kind": "function", + "signature": "(path: string) => string", + "doc": "Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it." + }, + { + "name": "attachmentPartsFromMessageParts", + "kind": "function", + "signature": "(parts: readonly Record[] | null | undefined) => ChatAttachmentPart[]", + "doc": "Every attachment part on one message's stored `parts`, in stored order." + }, + { + "name": "attachReasoningEffort", + "kind": "function", + "signature": "(profile: AgentProfile, harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-dro…", + "doc": "Attach a specified reasoning effort level to an agent profile for a given harness" + }, + { + "name": "AuthenticatedSandboxUser", + "kind": "interface", + "signature": "interface AuthenticatedSandboxUser", + "doc": "Represent an authenticated user within a sandbox environment with a unique identifier" + }, + { + "name": "AuthenticateOptions", + "kind": "interface", + "signature": "interface AuthenticateOptions", + "doc": "Define options to verify bearer tokens and customize authentication header names" + }, + { + "name": "authenticateToolRequest", + "kind": "function", + "signature": "(request: Request, opts: AuthenticateOptions) => Promise", + "doc": "Recover + verify the trusted context for a tool request." + }, + { + "name": "bearerSubprotocolToken", + "kind": "function", + "signature": "(value: string | null) => string | null", + "doc": "Resolve and decode a bearer token from a comma-separated subprotocol string or return null" + }, + { + "name": "bearerToken", + "kind": "function", + "signature": "(value: string | null) => string | null", + "doc": "Extract the token from a bearer authorization string or return null if invalid or missing" + }, + { + "name": "BeforeInteractionAnswerArgs", + "kind": "interface", + "signature": "interface BeforeInteractionAnswerArgs", + "doc": "Describe the arguments provided before processing an interaction answer including request, body, and connection details" + }, + { + "name": "BrandTokens", + "kind": "interface", + "signature": "interface BrandTokens", + "doc": "Define brand identity tokens including colors, font, logo, business name, and voice" + }, + { + "name": "BrandTokensSchema", + "kind": "const", + "signature": "ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodString; fontFamily: ZodString; logoUrl: ZodO…", + "doc": "Validate brand token properties including colors, font, logo URL, business name, and voice" + }, + { + "name": "BrokerToken", + "kind": "interface", + "signature": "interface BrokerToken", + "doc": "A single-use hub bearer minted from a durable grant — mirrors `@tangle-network/agent-integrations`'s `BrokerToken`." + }, + { + "name": "BrokerTokenMinter", + "kind": "interface", + "signature": "interface BrokerTokenMinter", + "doc": "The one method the provider needs — `TangleAppsClient` satisfies it structurally, so `createBrokerTokenProvider({ client: tangleAppsClient, … })` type-checks without importing the concrete class." + }, + { + "name": "BrokerTokenProvider", + "kind": "interface", + "signature": "interface BrokerTokenProvider", + "doc": "Provide and refresh broker bearer tokens, allowing forced token invalidation" + }, + { + "name": "BrokerTokenProviderOptions", + "kind": "interface", + "signature": "interface BrokerTokenProviderOptions", + "doc": "Define options for configuring a broker token provider including client credentials and token management settings" + }, + { + "name": "budgetGateProposalId", + "kind": "function", + "signature": "(missionId: string, stepId: string) => string", + "doc": "Deterministic proposal id for a budget-overrun override." + }, + { + "name": "BufferedTurnEvent", + "kind": "interface", + "signature": "interface BufferedTurnEvent", + "doc": "Represent a buffered turn event with a sequence number and serialized event data" + }, + { + "name": "BufferedTurnOptions", + "kind": "interface", + "signature": "interface BufferedTurnOptions", + "doc": "Define options for buffering and flushing turn events with optional live client delivery and event coalescing" + }, + { + "name": "BufferedTurnTap", + "kind": "interface", + "signature": "interface BufferedTurnTap", + "doc": "A push-driven buffer for a turn whose producer the caller does NOT own." + }, + { + "name": "buildAgentMissionPlan", + "kind": "function", + "signature": "(steps: ParsedMissionStep[]) => MissionStep[]", + "doc": "Materialize parsed steps into the engine's MissionStep[] shape." + }, + { + "name": "buildAppToolMcpServer", + "kind": "function", + "signature": "(opts: BuildMcpServerOptions) => AppToolMcpServer", + "doc": "Build one app-tool MCP server entry — a thin wrapper over {@link buildHttpMcpServer} that resolves the tool's route path." + }, + { + "name": "buildAppToolMcpServers", + "kind": "function", + "signature": "(options: BuildAppToolMcpServersOptions) => Record", + "doc": "Build a mapping of MCP server profiles keyed by tool identifiers from provided options" + }, + { + "name": "BuildAppToolMcpServersOptions", + "kind": "interface", + "signature": "interface BuildAppToolMcpServersOptions", + "doc": "Define options for building MCP server configurations in the app tool environment" + }, + { + "name": "buildAppToolOpenAITools", + "kind": "function", + "signature": "(taxonomy: AppToolTaxonomy, opts?: BuildAppToolsOptions | undefined) => OpenAIFunctionTool[]", + "doc": "Build the four app tools in OpenAI function-tool shape." + }, + { + "name": "BuildAppToolsOptions", + "kind": "interface", + "signature": "interface BuildAppToolsOptions", + "doc": "Optional overrides for {@link buildAppToolOpenAITools }." + }, + { + "name": "buildAttachmentPromptBlock", + "kind": "function", + "signature": "(atts: readonly Pick[], header?: string) => string", + "doc": "The agent-facing pointer block appended to the dispatched prompt — never persisted in `message.content`." + }, + { + "name": "buildCatalog", + "kind": "function", + "signature": "(raw: RouterModel[], opts?: { preferredDefault?: string | undefined; } | undefined) => ModelCatalog", + "doc": "Pure catalogue pipeline." + }, + { + "name": "buildConsentUrl", + "kind": "function", + "signature": "(input: ConsentUrlInput) => string", + "doc": "Build the URL to send the user to for the one-time app-consent." + }, + { + "name": "buildFlowTrace", + "kind": "function", + "signature": "(events: TimedEvent[], opts?: { pricing?: { prompt?: string | number | undefined; completion?: string | number | undefi…", + "doc": "Derive a span trace from timestamped turn events." + }, + { + "name": "buildHttpMcpServer", + "kind": "function", + "signature": "(opts: BuildHttpMcpServerOptions) => AppToolMcpServer", + "doc": "Build ONE HTTP MCP server entry — the generic agent→app bridge." + }, + { + "name": "BuildHttpMcpServerOptions", + "kind": "interface", + "signature": "interface BuildHttpMcpServerOptions", + "doc": "Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description" + }, + { + "name": "buildKnowledgeRequirements", + "kind": "function", + "signature": "(specs: KnowledgeRequirementSpec[], signals?: Record) => KnowledgeRequirement[]", + "doc": "Map specs -> the runtime's `KnowledgeRequirement[]`, folding in per-spec confidence from `signals` (default 0)." + }, + { + "name": "BuildMcpServerOptions", + "kind": "interface", + "signature": "interface BuildMcpServerOptions", + "doc": "Define configuration options required to build an MCP server including tool, baseUrl, token, and context" + }, + { + "name": "buildRedactedDocument", + "kind": "function", + "signature": "(text: string, options: BuildRedactedDocumentOptions) => Promise", + "doc": "Split `text` into text + redacted segments, encrypting each redacted span's original." + }, + { + "name": "BuildRedactedDocumentOptions", + "kind": "interface", + "signature": "interface BuildRedactedDocumentOptions", + "doc": "Define options to encrypt text and specify patterns for redacting sensitive document content" + }, + { + "name": "buildSandboxRuntimeProxyHeaders", + "kind": "function", + "signature": "(source: Headers, sandboxApiKey: string, forwardHeaders?: string[]) => Headers", + "doc": "Build proxy headers for sandbox runtime including authorization and forwarded headers" + }, + { + "name": "buildSandboxToolFileMounts", + "kind": "function", + "signature": "(options: BuildSandboxToolFileMountsOptions) => AgentProfileFileMount[]", + "doc": "Build file mounts for sandbox tools based on provided options and tool configurations" + }, + { + "name": "BuildSandboxToolFileMountsOptions", + "kind": "interface", + "signature": "interface BuildSandboxToolFileMountsOptions", + "doc": "Define options for building sandbox tool file mounts including tool specifications and paths" + }, + { + "name": "buildSandboxToolPathSetupScript", + "kind": "function", + "signature": "(options: SandboxToolPathOptions) => string", + "doc": "Build a shell script that sets up and exports the sandbox tool binary directory in user profiles" + }, + { + "name": "buildScopedMcpServerEntry", + "kind": "function", + "signature": "(opts: ScopedMcpServerEntryOptions & { label: string; defaultDescription: string; }) => AppToolMcpServer", + "doc": "Build the `AgentProfileMcpServer`-shaped entry for a scoped, per-resource MCP channel." + }, + { + "name": "buildUserTextParts", + "kind": "function", + "signature": "(text: string, turnId: string | undefined) => JsonRecord[]", + "doc": "Build an array of text parts with optional turn ID for user input" + }, + { + "name": "BULK_DELETE_MAX_THREADS", + "kind": "const", + "signature": "200", + "doc": "Bounds a single bulk-delete request's write set; product surfaces cap thread lists at far fewer, so a larger batch is a malformed or hostile request." + }, + { + "name": "cancelStatusFor", + "kind": "function", + "signature": "(reason: string | undefined) => ChatInteractionStatus", + "doc": "Maps an `interaction.cancel` reason to the card's terminal status." + }, + { + "name": "canTransitionInteractionStatus", + "kind": "function", + "signature": "(from: ChatInteractionStatus, to: ChatInteractionStatus) => boolean", + "doc": "Statuses only move forward (pending → terminal); a replayed/stale `pending` must never resurrect a resolved card." + }, + { + "name": "canTransitionPlanStatus", + "kind": "function", + "signature": "(from: ChatPlanStatus, to: ChatPlanStatus) => boolean", + "doc": "Plan status is monotonic: only a pending plan can settle." + }, + { + "name": "CanvasRenderPalette", + "kind": "interface", + "signature": "interface CanvasRenderPalette", + "doc": "Colors the Konva design-canvas paints directly." + }, + { + "name": "CapabilityTokenOptions", + "kind": "interface", + "signature": "interface CapabilityTokenOptions", + "doc": "Define options for creating and verifying capability tokens including secret and prefix" + }, + { + "name": "CatalogModel", + "kind": "interface", + "signature": "interface CatalogModel", + "doc": "Define the structure and capabilities of a catalog item with optional pricing and feature flags" + }, + { + "name": "CertifiedDelivery", + "kind": "interface", + "signature": "interface CertifiedDelivery", + "doc": "Resolve and manage certified profiles with refresh and composition capabilities" + }, + { + "name": "CertifiedDeliveryConfig", + "kind": "interface", + "signature": "interface CertifiedDeliveryConfig", + "doc": "Define configuration options for delivering certified artifacts to a specified tenant target" + }, + { + "name": "ChatAttachmentKind", + "kind": "type", + "signature": "type ChatAttachmentKind", + "doc": "The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (…" + }, + { + "name": "ChatAttachmentPart", + "kind": "interface", + "signature": "interface ChatAttachmentPart", + "doc": "Persisted attachment part: structurally an attachment-flavored `ChatFilePart` / `ChatImagePart` (`path` + `name` promoted to required) rather than a separate union member — see the section note above." + }, + { + "name": "ChatFilePart", + "kind": "interface", + "signature": "interface ChatFilePart", + "doc": "Union of the sidecar's legacy (path-based) and AI-SDK (url-based) file shapes; response-side every field besides `type` is optional." + }, + { + "name": "ChatImagePart", + "kind": "interface", + "signature": "interface ChatImagePart", + "doc": "Define properties for an image part within a chat message including optional metadata fields" + }, + { + "name": "ChatInteraction", + "kind": "interface", + "signature": "interface ChatInteraction", + "doc": "The client/persisted view of one ask." + }, + { + "name": "ChatInteractionField", + "kind": "type", + "signature": "type ChatInteractionField", + "doc": "Resolve a chat interaction field excluding select types or including chat select fields" + }, + { + "name": "ChatInteractionPart", + "kind": "interface", + "signature": "interface ChatInteractionPart", + "doc": "Persisted human-in-the-loop ask — byte-matches `interactionToPersistedPart` in `/web-react`'s chat-interactions contract." + }, + { + "name": "ChatInteractionStatus", + "kind": "type", + "signature": "type ChatInteractionStatus", + "doc": "Define possible statuses representing the state of a chat interaction" + }, + { + "name": "ChatMentionKind", + "kind": "type", + "signature": "type ChatMentionKind", + "doc": "The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value." + }, + { + "name": "ChatMentionPart", + "kind": "interface", + "signature": "interface ChatMentionPart", + "doc": "A file the user `@`-mentioned on this turn: a workspace-relative path into the sandbox, never bytes." + }, + { + "name": "ChatMessagePart", + "kind": "type", + "signature": "type ChatMessagePart", + "doc": "Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions" + }, + { + "name": "ChatNoticePart", + "kind": "interface", + "signature": "interface ChatNoticePart", + "doc": "Persisted one-line transcript notice — byte-matches `noticePart` in `/web-react`'s chat-interactions contract." + }, + { + "name": "ChatPartTime", + "kind": "interface", + "signature": "interface ChatPartTime", + "doc": "Start/end wall-clock millis, as normalized by `/stream`'s `normalizeTime`." + }, + { + "name": "ChatPlan", + "kind": "type", + "signature": "type ChatPlan", + "doc": "Browser/persisted projection of the sandbox SDK's durable-plan union." + }, + { + "name": "ChatPlanPart", + "kind": "type", + "signature": "type ChatPlanPart", + "doc": "Resolve a chat plan part by aliasing it to the persisted chat plan part type" + }, + { + "name": "ChatPlanPersistedPart", + "kind": "type", + "signature": "type ChatPlanPersistedPart", + "doc": "Canonical transcript part for one durable plan." + }, + { + "name": "ChatPlanStatus", + "kind": "type", + "signature": "type ChatPlanStatus", + "doc": "Sandbox plan lifecycle." + }, + { + "name": "ChatReasoningPart", + "kind": "interface", + "signature": "interface ChatReasoningPart", + "doc": "Define a reasoning part of a chat with text content and optional metadata fields" + }, + { + "name": "ChatSelectField", + "kind": "type", + "signature": "type ChatSelectField", + "doc": "Extract select-type interaction fields and optionally allow custom values" + }, + { + "name": "ChatStepFinishPart", + "kind": "interface", + "signature": "interface ChatStepFinishPart", + "doc": "Define a chat step finish part indicating completion with optional reason, tokens, and cost" + }, + { + "name": "ChatStepStartPart", + "kind": "interface", + "signature": "interface ChatStepStartPart", + "doc": "OpenCode step-boundary marker — no renderable text; preserved so mappers never coerce it into a \"[object Object]\" text part." + }, + { + "name": "ChatStoreInputError", + "kind": "class", + "signature": "class ChatStoreInputError", + "doc": "Invalid caller input (missing/oversized ids, empty title)." + }, + { + "name": "ChatSubtaskPart", + "kind": "interface", + "signature": "interface ChatSubtaskPart", + "doc": "Define a subtask part of a chat with prompt, description, agent, and optional identifier" + }, + { + "name": "ChatTextPart", + "kind": "interface", + "signature": "interface ChatTextPart", + "doc": "`id` is the harness's per-segment identity; absent on legacy/router parts, which collapse to a single logical text stream." + }, + { + "name": "ChatToolPart", + "kind": "interface", + "signature": "interface ChatToolPart", + "doc": "Define a chat component representing a tool with its state and optional call identifier" + }, + { + "name": "ChatToolState", + "kind": "interface", + "signature": "interface ChatToolState", + "doc": "Describe the current state and data of a chat tool including status, input, output, and metadata" + }, + { + "name": "ChatToolStatus", + "kind": "type", + "signature": "type ChatToolStatus", + "doc": "Superset of the sidecar's status enum (`pending|running|completed|failed`) and agent-interface's `ToolState` statuses; `error` is the persisted terminal form `/stream`'s `normalizePersistedPart` sett…" + }, + { + "name": "ChatUsageTokens", + "kind": "interface", + "signature": "interface ChatUsageTokens", + "doc": "Per-step usage receipt as the harness reports it (sidecar `StepFinishPartSchema`)." + }, + { + "name": "checkRateLimit", + "kind": "function", + "signature": "(kv: KvLike, key: string, limit: number, windowSeconds: number) => Promise", + "doc": "KV-backed sliding-window rate limit." + }, + { + "name": "checkThemeContract", + "kind": "function", + "signature": "(opts: ThemeContractOptions) => ThemeContractResult", + "doc": "Check that every theme token a consumer's source references is actually defined in the CSS that consumer ships." + }, + { + "name": "childSpanContext", + "kind": "function", + "signature": "(parent: MissionTraceContext | StepSpanContext, seed?: string | undefined) => StepSpanContext", + "doc": "Derive a child span context under `parent` — one per step attempt (seed e.g." + }, + { + "name": "classifySeveredStream", + "kind": "function", + "signature": "(event: unknown) => SandboxStepTransition | null", + "doc": "Resolve the severed stream event to a corresponding sandbox step transition or null" + }, + { + "name": "clearCookieHeader", + "kind": "function", + "signature": "(opts: Omit) => string", + "doc": "Set-Cookie header value that deletes the cookie (empty value, Max-Age=0)." + }, + { + "name": "coalesceChatStreamEvents", + "kind": "function", + "signature": "(events: unknown[]) => unknown[]", + "doc": "Coalesce consecutive `message.part.updated` deltas for the SAME part into one event." + }, + { + "name": "coalesceDeltas", + "kind": "function", + "signature": "(events: unknown[]) => unknown[]", + "doc": "Merge consecutive text/reasoning deltas of the same type into one event." + }, + { + "name": "coerceHarness", + "kind": "function", + "signature": "(value: unknown, fallback?: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\"…", + "doc": "Coerce an arbitrary value to a known harness, falling back (default `opencode`)." + }, + { + "name": "collapseRedundantTextParts", + "kind": "function", + "signature": "(parts: JsonRecord[]) => JsonRecord[]", + "doc": "Collapses text-part artifacts of unstable upstream segment identity: the same text arriving under two keys (id-less delta stream, then an id-bearing snapshot) folds into two segments, and interleaved…" + }, + { + "name": "CompleteMissionInput", + "kind": "interface", + "signature": "interface CompleteMissionInput", + "doc": "Define input parameters to complete a mission with status and optional summary" + }, + { + "name": "CompletionRequirement", + "kind": "interface", + "signature": "interface CompletionRequirement", + "doc": null + }, + { + "name": "CompletionVerdict", + "kind": "interface", + "signature": "interface CompletionVerdict", + "doc": "Extends the substrate verdict spine: `valid` = `fullyComplete` and `score` = `completionRate` — derived in `completionVerdict()`, the one place those equalities hold by construction." + }, + { + "name": "composeMissionFlowTrace", + "kind": "function", + "signature": "(input: { steps: MissionFlowStep[]; activity?: Record | undefined; startedAt?: number | un…", + "doc": "Compose a mission-wide FlowTrace: one 'pipeline' span per step, the step's delegated runs ('tool' spans, from `activity[stepId]`) beneath it." + }, + { + "name": "composerAnswerData", + "kind": "function", + "signature": "(field: ChatInteractionField, text: string) => Record", + "doc": "Shapes composer text into the respond payload for the routed field (select answers are string arrays on the wire; text answers are strings)." + }, + { + "name": "composerAnswerDeliveries", + "kind": "function", + "signature": "(pending: ChatInteraction[]) => ComposerAnswerDelivery[]", + "doc": "One delivery per pending ask: the first free-text-capable field, else the first field." + }, + { + "name": "ComposerAnswerDelivery", + "kind": "interface", + "signature": "interface ComposerAnswerDelivery", + "doc": "Define the structure for delivering answers linked to a specific chat interaction and field" + }, + { + "name": "ConsentUrlInput", + "kind": "interface", + "signature": "interface ConsentUrlInput", + "doc": "Define input parameters required to generate a consent URL for OAuth authorization" + }, + { + "name": "ConversionMetrics", + "kind": "interface", + "signature": "interface ConversionMetrics", + "doc": "Define metrics for tracking impressions, clicks, conversions, and related rates" + }, + { + "name": "ConversionMetricsSchema", + "kind": "const", + "signature": "ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; ctr: ZodNumber; cvr: ZodNumber; }, $stri…", + "doc": "Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields" + }, + { + "name": "CookieOptions", + "kind": "interface", + "signature": "interface CookieOptions", + "doc": "Define options for configuring cookie attributes and behavior" + }, + { + "name": "CopyContent", + "kind": "interface", + "signature": "interface CopyContent", + "doc": "Define the structure for content with headline, body, platform, and optional hashtags and character count" + }, + { + "name": "CopyContentSchema", + "kind": "const", + "signature": "ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional>; platform: ZodEnum<{ x: \"x…", + "doc": "Validate and parse copy content with headline, body, optional hashtags, platform, and character count" + }, + { + "name": "CopyPlatform", + "kind": "type", + "signature": "type CopyPlatform", + "doc": "Define platform options for copy content across various social media and communication channels" + }, + { + "name": "CorrectnessChecker", + "kind": "type", + "signature": "type CorrectnessChecker", + "doc": "Decides whether a produced item's content actually fulfils a requirement." + }, + { + "name": "createAgentRuntime", + "kind": "function", + "signature": "(opts: CreateAgentRuntimeOptions) => AgentRuntime", + "doc": "Create an in-process agent runtime for one agent." + }, + { + "name": "CreateAgentRuntimeOptions", + "kind": "interface", + "signature": "interface CreateAgentRuntimeOptions", + "doc": "Define options for creating an agent runtime including model config and optional profile transformation" + }, + { + "name": "createAppToolRuntimeExecutor", + "kind": "function", + "signature": "(opts: RuntimeExecutorOptions) => AppToolRuntimeExecutor", + "doc": "Build the runtime executor for one turn." + }, + { + "name": "createBrokerTokenProvider", + "kind": "function", + "signature": "(opts: BrokerTokenProviderOptions) => BrokerTokenProvider", + "doc": "Cache + auto-refresh a broker token for one grant." + }, + { + "name": "createBufferedTurnTap", + "kind": "function", + "signature": "(opts: BufferedTurnOptions) => BufferedTurnTap", + "doc": "The buffering core." + }, + { + "name": "createCapabilityToken", + "kind": "function", + "signature": "(userId: string, opts: CapabilityTokenOptions) => Promise", + "doc": "Mint a capability token for `userId`, or `undefined` when no secret is configured (fail-closed — the caller omits the MCP server rather than fake it)." + }, + { + "name": "createCertifiedDelivery", + "kind": "function", + "signature": "(config: CertifiedDeliveryConfig) => CertifiedDelivery", + "doc": "Build a certified-delivery transform for one agent target." + }, + { + "name": "createD1KnowledgeStateAccessor", + "kind": "function", + "signature": "(opts: PresetKnowledgeAccessorOptions) => KnowledgeStateAccessor", + "doc": "The {@link KnowledgeStateAccessor} over the preset D1 schema — the seam that lets the declarative `satisfiedBy` rules resolve with ZERO consumer code: - `config(path)` reads the supplied workspace co…" + }, + { + "name": "createD1TurnEventStore", + "kind": "function", + "signature": "(db: D1LikeForTurns) => TurnEventStore", + "doc": "Resolve a TurnEventStore that appends and reads turn events using a D1-like database interface" + }, + { + "name": "createDurableChatEventProjection", + "kind": "function", + "signature": "(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableChatEventP…", + "doc": "Event projector usable with any `ChatTurnRouteProducer` through `withDurableChatProjection`." + }, + { + "name": "createDurableChatScope", + "kind": "function", + "signature": "(value: string) => DurableChatScope", + "doc": "Create a durable chat scope from a non-empty string value" + }, + { + "name": "createDurableInteractionProjectionAdapter", + "kind": "function", + "signature": "(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableInteractio…", + "doc": "Binds an authorized durable scope/store to interaction lifecycle events." + }, + { + "name": "createDurableInteractionRoutePersistence", + "kind": "function", + "signature": "(options: CreateDurableInteractionRoutePersistenceOptions) => DurableInteractionRoutePersistence DurableInteractionSettlement", + "doc": "Additive answer settlement primitive for wiring into `/interactions`." + }, + { + "name": "createDurablePlanRoutes", + "kind": "function", + "signature": "(options: DurablePlanRouteOptions) => DurablePlanRoutes", + "doc": "Build durable plan routes with authorization and effect handling based on provided options" + }, + { + "name": "createExpiringCapabilityToken", + "kind": "function", + "signature": "(subject: string, opts: ExpiringCapabilityTokenOptions) => Promise", + "doc": "Mint an EXPIRING capability token: `.` where the payload carries `{ sub, exp, n }` (subject, epoch-ms expiry, random nonce) and the signature is HMAC-SHA256 over the…" + }, + { + "name": "createFieldCrypto", + "kind": "function", + "signature": "(key: string | (() => string)) => { encrypt(s: string): Promise; decrypt(s: string): Promise; }", + "doc": "Build a {@link import ('../billing').KeyCrypto}-compatible pair bound to a key (or a key-resolver, for env-backed keys resolved per call)." + }, + { + "name": "createInMemoryDurableChatStateStore", + "kind": "function", + "signature": "() => InMemoryDurableChatStateStore", + "doc": "Create an in-memory durable chat state store for managing chat session data efficiently" + }, + { + "name": "createInMemoryMissionStore", + "kind": "function", + "signature": "() => InMemoryMissionStore", + "doc": "In-memory {@link MissionStorePort} — the portable backend for tests and sandbox/eval shells." + }, + { + "name": "createInteractionAnswerRoute", + "kind": "function", + "signature": "(options: InteractionAnswerRouteOptions) => InteractionAnswerRoute", + "doc": "Create an interaction answer route that handles listing and resolving interaction requests" + }, + { + "name": "createKnowledgeLoop", + "kind": "function", + "signature": "(knowledge: AgentKnowledgeConfig, deps: CreateKnowledgeLoopDeps) => KnowledgeLoop", + "doc": "Build a runnable knowledge-acquisition loop from the product's `AgentKnowledgeConfig` and a small set of seams." + }, + { + "name": "CreateKnowledgeLoopDeps", + "kind": "interface", + "signature": "interface CreateKnowledgeLoopDeps", + "doc": "Define dependencies required to create and run a knowledge processing loop" + }, + { + "name": "createLlmCorrectnessChecker", + "kind": "function", + "signature": "(tc: TCloud, opts?: LlmCorrectnessCheckerOpts | undefined) => CorrectnessChecker", + "doc": "Production `CorrectnessChecker` — one LLM call per matched artifact, deterministic (temperature 0), structured JSON out." + }, + { + "name": "createMcpToolHandler", + "kind": "function", + "signature": ">(opts: CreateMcpToolHandlerOptions) => (request: Request) => Promise", + "doc": "Build a request handler for a tools-only MCP server." + }, + { + "name": "CreateMcpToolHandlerOptions", + "kind": "interface", + "signature": "interface CreateMcpToolHandlerOptions", + "doc": "Define options for creating a handler that manages MCP tools with environment support" + }, + { + "name": "createMemoryTurnEventStore", + "kind": "function", + "signature": "() => TurnEventStore", + "doc": "In-memory store for tests and keyless local dev." + }, + { + "name": "createMissionEngine", + "kind": "function", + "signature": "(options: MissionEngineOptions) => MissionEngine", + "doc": "Create a mission engine configured with options to manage mission execution and error handling" + }, + { + "name": "CreateMissionInput", + "kind": "interface", + "signature": "interface CreateMissionInput", + "doc": "Define input parameters for creating a mission including optional deterministic id and unique plan steps" + }, + { + "name": "createMissionService", + "kind": "function", + "signature": "(options: MissionServiceOptions) => MissionService", + "doc": "Create a mission service that manages mission records and audit events with customizable options" + }, + { + "name": "createMissionTraceContext", + "kind": "function", + "signature": "(missionId?: string | undefined) => MissionTraceContext", + "doc": "Mint a mission's trace context." + }, + { + "name": "createOpenAICompatStreamTurn", + "kind": "function", + "signature": "(opts: OpenAICompatStreamTurnOptions) => (messages: ToolLoopMessage[]) => AsyncIterable", + "doc": "Build a `streamTurn` that calls an OpenAI-compatible `/chat/completions` endpoint (Tangle Router / tcloud / any compat provider) with `stream: true` and yields `LoopEvent`s via {@link toLoopEvents}." + }, + { + "name": "createPlatformBalanceManager", + "kind": "function", + "signature": "(opts: PlatformBalanceManagerOptions) => PlatformBalanceManager", + "doc": "Create a platform balance manager to handle user plan limits and state based on provided options" + }, + { + "name": "createPresetDrizzleSchema", + "kind": "function", + "signature": "(d: DrizzleSqliteCoreLike) => { proposals: unknown; knowledge: unknown; deadlines: unknown; workspaceKeys: unknown; }", + "doc": "Build the typed Drizzle schema for the preset, given the consumer's `drizzle-orm/sqlite-core` module." + }, + { + "name": "createPresetFieldCrypto", + "kind": "function", + "signature": "(key: string | (() => string)) => KeyCrypto", + "doc": "Build the {@link KeyCrypto} the billing key store uses — AES-256-GCM field crypto bound to the product's 64-char-hex `ENCRYPTION_KEY` (or a resolver)." + }, + { + "name": "createPresetToolHandlers", + "kind": "function", + "signature": "(opts: PresetToolHandlerOptions) => AppToolHandlers", + "doc": "The default {@link AppToolHandlers} for the house stack: - `submit_proposal` → insert a `proposals` row (`status='pending'`), deduped on (workspace, title) so a retried turn doesn't double-queue." + }, + { + "name": "createPresetWorkspaceKeyManager", + "kind": "function", + "signature": "(opts: PresetBillingOptions) => WorkspaceKeyManager", + "doc": "Stand up the per-workspace budget-capped {@link WorkspaceKeyManager} on the house stack: the preset `workspace_keys` D1 store + AES-GCM field crypto + the consumer's tcloud provisioner." + }, + { + "name": "createPresetWorkspaceKeyStore", + "kind": "function", + "signature": "(db: D1Like) => WorkspaceKeyStore", + "doc": "The {@link WorkspaceKeyStore} over the preset `workspace_keys` table — the persistence seam the per-workspace key manager needs." + }, + { + "name": "createProxiedArtifactRoute", + "kind": "function", + "signature": "({ store, secret, }: { store: ObjectStore; secret: string; }) => (request: Request) => Promise", + "doc": "Build a download handler that verifies a signed request and STREAMS the object back with a conservative, non-executable content type." + }, + { + "name": "createR2ObjectStore", + "kind": "function", + "signature": "({ bucket }: { bucket: R2LikeBucket; }) => ObjectStore", + "doc": "Map the {@link ObjectStore} port onto an R2 bucket 1:1." + }, + { + "name": "createReviewerDecider", + "kind": "function", + "signature": "(propose: (input: KnowledgeDeciderInput) => KnowledgeCandidate | Promise) => KnowledgeDecider", + "doc": "Wrap a candidate-producing policy in the default reviewer gate." + }, + { + "name": "createSandboxTerminalToken", + "kind": "function", + "signature": "(subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise", + "doc": "Generate a sandbox terminal token for a given subject with specified options" + }, + { + "name": "createSurfaceRegistry", + "kind": "function", + "signature": "(kinds: readonly AnySurfaceKind[]) => SurfaceRegistry", + "doc": "Assemble the product's surface registry from its registered kinds." + }, + { + "name": "createTangleRouterModelConfig", + "kind": "function", + "signature": "(opts: CreateTangleRouterModelConfigOptions) => TangleModelConfig", + "doc": "Build an OpenAI-compatible Tangle Router model config from an already resolved execution key." + }, + { + "name": "CreateTangleRouterModelConfigOptions", + "kind": "interface", + "signature": "interface CreateTangleRouterModelConfigOptions", + "doc": "Define configuration options for creating a Tangle router model including API key and model details" + }, + { + "name": "createTcloudKeyProvisioner", + "kind": "function", + "signature": "(client: TcloudKeyClient) => KeyProvisioner", + "doc": "Adapt the tcloud SDK client to {@link KeyProvisioner} — the typed seam that replaces the `as unknown as KeyProvisioner` cast every consumer otherwise repeats." + }, + { + "name": "createTokenRecallChecker", + "kind": "function", + "signature": "(opts?: { minRecall?: number | undefined; minContentLength?: number | undefined; }) => (requirement: CompletionRequirem…", + "doc": "A deterministic `CorrectnessChecker` (agent-eval exports only `createLlmCorrectnessChecker`)." + }, + { + "name": "createWorkspaceKeyManager", + "kind": "function", + "signature": "(opts: WorkspaceKeyManagerOptions) => WorkspaceKeyManager", + "doc": "Create a workspace key manager that handles key provisioning and budget tracking" + }, + { + "name": "createWorkspaceSandboxConnectionHandler", + "kind": "function", + "signature": "(opts: WorkspaceSandboxConnectionHandlerOptions) => ({ request, params…", + "doc": "Create a handler to resolve workspace sandbox connections with user and access validation" + }, + { + "name": "createWorkspaceSandboxManager", + "kind": "function", + "signature": "(opts: WorkspaceSandboxManagerOptions ({ request, params }: WorkspaceSandboxRuntimeProxyArgs) => Promis…", + "doc": "Create a proxy handler to resolve sandbox runtime requests with user and workspace access validation" + }, + { + "name": "createWorkspaceSandboxTerminalUpgradeHandler", + "kind": "function", + "signature": "(opts: WorkspaceSandboxTerminalUpgradeHandlerOptions) => (request: Request) => Promise", + "doc": "Build a Worker-entry handler that proxies a sandbox terminal WebSocket upgrade to the sandbox API runtime proxy." + }, + { + "name": "customToolToOpenAI", + "kind": "function", + "signature": "(def: AppToolDefinition>) => OpenAIFunctionTool", + "doc": "The OpenAI function-tool def for a custom tool — appended to the built-ins by `buildAppToolOpenAITools`." + }, + { + "name": "D1Like", + "kind": "interface", + "signature": "interface D1Like", + "doc": "The D1 surface the preset needs." + }, + { + "name": "D1LikeForTurns", + "kind": "interface", + "signature": "interface D1LikeForTurns", + "doc": "Minimal structural D1 contract (Cloudflare `D1Database` satisfies it)." + }, + { + "name": "D1PreparedLike", + "kind": "interface", + "signature": "interface D1PreparedLike", + "doc": "A prepared, bound D1 statement." + }, + { + "name": "darkTheme", + "kind": "const", + "signature": "AgentAppTheme", + "doc": "Define a dark color scheme for the Agent app interface with specific background and foreground hues" + }, + { + "name": "decodeHexKey", + "kind": "function", + "signature": "(keyHex: string) => Uint8Array", + "doc": "Validate + decode a 64-char hex key to 32 bytes." + }, + { + "name": "decryptAesGcm", + "kind": "function", + "signature": "(encrypted: string, keyHex: string) => Promise", + "doc": "Decrypt a base64(iv ‖ ciphertext ‖ tag) string under `keyHex`." + }, + { + "name": "decryptBytes", + "kind": "function", + "signature": "(data: ArrayBuffer, key: CryptoKey) => Promise", + "doc": "Decrypt binary data (IV ‖ ciphertext ‖ tag) under a derived `CryptoKey`." + }, + { + "name": "decryptWithKey", + "kind": "function", + "signature": "(encoded: string, key: CryptoKey) => Promise", + "doc": "Decrypt a base64(iv ‖ ct ‖ tag) string under a derived `CryptoKey`." + }, + { + "name": "dedupeQuestionInteractionsByContent", + "kind": "function", + "signature": "(interactions: ChatInteraction[]) => ChatInteraction[]", + "doc": "Remove duplicate question interactions based on their content signature to ensure uniqueness" + }, + { + "name": "DEFAULT_APP_TOOL_PATHS", + "kind": "const", + "signature": "Record<\"submit_proposal\" | \"schedule_followup\" | \"render_ui\" | \"add_citation\", string>", + "doc": "Default route path each app tool is served at." + }, + { + "name": "DEFAULT_ATTACHMENT_PROMPT_HEADER", + "kind": "const", + "signature": "\"Attached files (already saved to the workspace vault — read them from these paths):\"", + "doc": "gtm's exact default header for {@link buildAttachmentPromptBlock} — kept byte-identical because it feeds dispatched prompts (gtm-agent#618 reproduces the prompt bytes through this module)." + }, + { + "name": "DEFAULT_HARNESS", + "kind": "const", + "signature": "\"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\" | \"forge\"…", + "doc": "Define the default harness to use for code execution and testing environments" + }, + { + "name": "DEFAULT_HEADER_NAMES", + "kind": "const", + "signature": "ToolHeaderNames", + "doc": "Provide default HTTP header names for user, workspace, and thread identification" + }, + { + "name": "DEFAULT_MISSION_STEP_KINDS", + "kind": "const", + "signature": "readonly string[]", + "doc": "Default step-kind vocabulary." + }, + { + "name": "DEFAULT_REDACTION_PATTERNS", + "kind": "const", + "signature": "readonly RedactionPattern[]", + "doc": "The default deterministic patterns." + }, + { + "name": "DEFAULT_SANDBOX_RESOURCES", + "kind": "const", + "signature": "SandboxResourceConfig", + "doc": "Define default resource limits and settings for sandbox environments" + }, + { + "name": "DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR", + "kind": "const", + "signature": "\"TANGLE_BILLING_ENFORCEMENT\"", + "doc": "Define the default environment variable name for Tangle billing enforcement" + }, + { + "name": "DEFAULT_TANGLE_ROUTER_BASE_URL", + "kind": "const", + "signature": "\"https://router.tangle.tools/v1\"", + "doc": "Provide the default base URL for the Tangle router API endpoint" + }, + { + "name": "deferredCorpusHash", + "kind": "function", + "signature": "(files: AgentProfileFileMount[]) => string", + "doc": "Stable content hash of the deferred file corpus (path + inline content)." + }, + { + "name": "defineAgentApp", + "kind": "function", + "signature": "(config: T) => T", + "doc": "Identity helper: returns its argument unchanged, but anchors inference so a coding agent authoring a config gets full autocomplete + type-checking from a single import." + }, + { + "name": "defineAppTool", + "kind": "function", + "signature": ">(def: AppToolDefinition) => AppToolDefinition", + "doc": "Validate + brand a product tool definition." + }, + { + "name": "defineSurfaceKind", + "kind": "function", + "signature": "(opts: { kind: string; build: (ctx: TCtx) => SurfaceOverlay | Promise; }) => SurfaceKindDefinitio…", + "doc": "Declare one surface kind." + }, + { + "name": "delegationActivityToFlowSpans", + "kind": "function", + "signature": "(activity: StepAgentActivity[], turnStartMs: number, opts?: { nowMs?: number | undefined; } | undefined) => FlowSpan[]", + "doc": "One 'tool' FlowSpan per delegation, positioned relative to `turnStartMs` (the epoch-ms origin of the trace — usually the step or mission start)." + }, + { + "name": "deleteSecret", + "kind": "function", + "signature": "(store: SecretStore, name: string) => Promise>", + "doc": "Delete a secret by name from the given secret store and return the operation outcome" + }, + { + "name": "deriveKey", + "kind": "function", + "signature": "(secret: string, opts: DeriveKeyOptions) => Promise", + "doc": "Derive an AES-256-GCM `CryptoKey` from a secret string via PBKDF2." + }, + { + "name": "DeriveKeyOptions", + "kind": "interface", + "signature": "interface DeriveKeyOptions", + "doc": "--- Passphrase-derived key path (PBKDF2 → AES-256-GCM CryptoKey) --- The `encryptAesGcm`/`decryptAesGcm` path takes a raw 64-char-hex key." + }, + { + "name": "deriveSignals", + "kind": "function", + "signature": "(specs: KnowledgeRequirementSpec[], ctx: KnowledgeStateAccessor) => Promise>", + "doc": "Score every spec from workspace state." + }, + { + "name": "detectInteractiveQuestion", + "kind": "function", + "signature": "(event: unknown) => string | null", + "doc": "Resolve the interactive question text from a structured event or return null if none found" + }, + { + "name": "detectSpans", + "kind": "function", + "signature": "(text: string, patterns?: readonly RedactionPattern[]) => RedactionSpan[]", + "doc": "Find non-overlapping PII spans in `text`." + }, + { + "name": "dispatchAppTool", + "kind": "function", + "signature": "(toolName: string, rawArgs: Record, ctx: AppToolContext, opts: DispatchOptions) => Promise string", + "doc": "Resolve a valid durable chat scope key from the given scope input" + }, + { + "name": "DurableChatStateStore", + "kind": "type", + "signature": "type DurableChatStateStore", + "doc": "Alias used by adapters that store all durable chat state in one port." + }, + { + "name": "DurableChatUnavailableError", + "kind": "class", + "signature": "class DurableChatUnavailableError", + "doc": "Represent unavailable durable chat authority errors with status code 503" + }, + { + "name": "DurableFollowUpReceipt", + "kind": "interface", + "signature": "interface DurableFollowUpReceipt", + "doc": "Define a durable receipt capturing stable identifiers and state for follow-up decisions" + }, + { + "name": "DurableInteractionAcknowledgement", + "kind": "interface", + "signature": "interface DurableInteractionAcknowledgement", + "doc": "Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields" + }, + { + "name": "DurableInteractionGuarantee", + "kind": "type", + "signature": "type DurableInteractionGuarantee", + "doc": "Define interaction durability levels to specify reconciliation or best-effort guarantees" + }, + { + "name": "durableInteractionIntentKey", + "kind": "function", + "signature": "(scope: DurableChatScope, interactionId: string, attemptKey: string) => string", + "doc": "Stable key helper exported for products implementing their own settlement loop." + }, + { + "name": "DurableInteractionProjection", + "kind": "interface", + "signature": "interface DurableInteractionProjection", + "doc": "Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag" + }, + { + "name": "DurableInteractionProjectionAdapter", + "kind": "interface", + "signature": "interface DurableInteractionProjectionAdapter", + "doc": "Define methods to manage durable interaction projections including upsert, cancel, and materialize operations" + }, + { + "name": "DurableInteractionRouteArgs", + "kind": "interface", + "signature": "interface DurableInteractionRouteArgs", + "doc": "Define arguments for durable interaction routes including a stable caller-created attempt key" + }, + { + "name": "DurableInteractionRoutePersistence", + "kind": "interface", + "signature": "interface DurableInteractionRoutePersistence", + "doc": "Crash-recoverable persistence lifecycle for the answer route." + }, + { + "name": "DurableInteractionSettlement", + "kind": "interface", + "signature": "interface DurableInteractionSettlement", + "doc": "Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents" + }, + { + "name": "DurableInteractionSettlementFactoryOptions", + "kind": "interface", + "signature": "interface DurableInteractionSettlementFactoryOptions", + "doc": "Define options for creating durable interaction settlement factories including store and optional reconcile authority" + }, + { + "name": "DurableInteractionSettlementOptions", + "kind": "interface", + "signature": "interface DurableInteractionSettlementOptions", + "doc": "Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider" + }, + { + "name": "DurablePlanAuthority", + "kind": "interface", + "signature": "interface DurablePlanAuthority", + "doc": "Structural port to Sandbox (or another durable plan authority)." + }, + { + "name": "DurablePlanAuthorityCurrentResult", + "kind": "interface", + "signature": "interface DurablePlanAuthorityCurrentResult", + "doc": "Represent the current authoritative state and optional receipt of a durable plan authority" + }, + { + "name": "DurablePlanAuthorityDecision", + "kind": "type", + "signature": "type DurablePlanAuthorityDecision", + "doc": "Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions" + }, + { + "name": "DurablePlanAuthorityResult", + "kind": "interface", + "signature": "interface DurablePlanAuthorityResult", + "doc": "Describe the outcome of an authority's durable plan decision including follow-up and metadata" + }, + { + "name": "DurablePlanAuthorization", + "kind": "type", + "signature": "type DurablePlanAuthorization", + "doc": "Resolve authorization status for durable plans using scopes, responses, or nullish values" + }, + { + "name": "DurablePlanCommandJournal", + "kind": "type", + "signature": "type DurablePlanCommandJournal", + "doc": "Pick essential methods to manage and record durable plan command operations" + }, + { + "name": "DurablePlanCommandKey", + "kind": "type", + "signature": "type DurablePlanCommandKey", + "doc": "Represent a unique identifier key for durable plan commands" + }, + { + "name": "DurablePlanCommandRecord", + "kind": "interface", + "signature": "interface DurablePlanCommandRecord", + "doc": "Define the structure for recording durable plan commands with associated metadata and state information" + }, + { + "name": "DurablePlanCommandState", + "kind": "type", + "signature": "type DurablePlanCommandState", + "doc": "Define possible states for a durable plan command in its lifecycle" + }, + { + "name": "DurablePlanDecision", + "kind": "type", + "signature": "type DurablePlanDecision", + "doc": "Represent durable plan outcomes as either approved or rejected" + }, + { + "name": "DurablePlanEffectRecord", + "kind": "interface", + "signature": "interface DurablePlanEffectRecord", + "doc": "Define the structure for recording the state and metadata of a durable plan effect" + }, + { + "name": "DurablePlanProjection", + "kind": "type", + "signature": "type DurablePlanProjection", + "doc": "Projection retained by a durable store." + }, + { + "name": "DurablePlanRouteAuthorizeArgs", + "kind": "interface", + "signature": "interface DurablePlanRouteAuthorizeArgs", + "doc": "Define arguments for authorizing durable plan route requests with operation and optional plan ID" + }, + { + "name": "DurablePlanRouteOptions", + "kind": "interface", + "signature": "interface DurablePlanRouteOptions", + "doc": "Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling" + }, + { + "name": "DurablePlanRoutes", + "kind": "interface", + "signature": "interface DurablePlanRoutes", + "doc": "Define routes handling durable plan requests with current and decide methods" + }, + { + "name": "DurablePlanStateStore", + "kind": "type", + "signature": "type DurablePlanStateStore", + "doc": "Represent durable storage for plan state management with persistence and reliability guarantees" + }, + { + "name": "DurablePlanStore", + "kind": "interface", + "signature": "interface DurablePlanStore", + "doc": "Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context" + }, + { + "name": "EmailBodySection", + "kind": "interface", + "signature": "interface EmailBodySection", + "doc": "Define the structure for the body section of an email containing plain text content" + }, + { + "name": "EmailContent", + "kind": "interface", + "signature": "interface EmailContent", + "doc": "Define the structure for email content including subject, optional preheader, and sections" + }, + { + "name": "EmailContentSchema", + "kind": "const", + "signature": "ZodObject<{ subject: ZodString; preheader: ZodOptional; sections: ZodArray Uint8Array", + "doc": "Encode a StreamEvent object into a Uint8Array using the provided TextEncoder" + }, + { + "name": "encodeSandboxRuntimePath", + "kind": "function", + "signature": "(runtimePath: string) => string | null", + "doc": "Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments" + }, + { + "name": "encryptAesGcm", + "kind": "function", + "signature": "(plaintext: string, keyHex: string) => Promise", + "doc": "Encrypt `plaintext` with AES-256-GCM under `keyHex`." + }, + { + "name": "encryptBytes", + "kind": "function", + "signature": "(data: ArrayBuffer, key: CryptoKey) => Promise", + "doc": "Encrypt binary data under a derived `CryptoKey`." + }, + { + "name": "encryptWithKey", + "kind": "function", + "signature": "(plaintext: string, key: CryptoKey) => Promise", + "doc": "Encrypt `plaintext` under a derived `CryptoKey`." + }, + { + "name": "ensureWorkspaceSandbox", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions) => Promise", + "doc": "Resolve or create a workspace sandbox instance with optional reuse and progress tracking" + }, + { + "name": "EnsureWorkspaceSandboxOptions", + "kind": "interface", + "signature": "interface EnsureWorkspaceSandboxOptions", + "doc": "Define options for ensuring a workspace sandbox with provisioning and progress handling" + }, + { + "name": "ENV_TOTAL_MAX_BYTES", + "kind": "const", + "signature": "200000", + "doc": "Total env gate: the whole environment block shares the payload budget with the profile; past 200 KB the provision body cannot stay under the cap." + }, + { + "name": "ENV_VALUE_MAX_BYTES", + "kind": "const", + "signature": "120000", + "doc": "Per-variable env gate: the kernel rejects any single `NAME=value` env entry over MAX_ARG_STRLEN (131072 bytes) with E2BIG, killing every exec inside the box." + }, + { + "name": "ExpiringCapabilityTokenOptions", + "kind": "interface", + "signature": "interface ExpiringCapabilityTokenOptions", + "doc": "Define options for capability tokens that expire after a specified lifetime in milliseconds" + }, + { + "name": "extractProducedState", + "kind": "function", + "signature": "(events: readonly RuntimeEventLike[]) => ProducedState", + "doc": "Normalize a run's runtime event stream into `ProducedState`." + }, + { + "name": "extractRequestContext", + "kind": "function", + "signature": "(request: Request) => RequestContext", + "doc": "Extract request context for audit trails." + }, + { + "name": "fetchModelCatalog", + "kind": "function", + "signature": "(cfg: { baseUrl: string; apiKey: string; preferredDefault?: string | undefined; }) => Promise", + "doc": "Fetch the router model list and build the catalogue, with an in-isolate cache (TTL 5 min)." + }, + { + "name": "fieldAcceptsFreeText", + "kind": "function", + "signature": "(field: ChatInteractionField) => boolean", + "doc": "Determine if a chat interaction field allows free text input" + }, + { + "name": "finalizeAssistantParts", + "kind": "function", + "signature": "(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[]", + "doc": "Resolve and clean up assistant parts by terminalizing and collapsing redundant segments" + }, + { + "name": "finalizePendingInteractionParts", + "kind": "function", + "signature": "(parts: JsonRecord[], outcome: \"answered\" | \"expired\") => JsonRecord[]", + "doc": "Settles still-pending interaction parts at persist time." + }, + { + "name": "findCustomTool", + "kind": "function", + "signature": "(name: string, tools: readonly AppToolDefinition>[] | undefined) => AppToolDefinition string", + "doc": "Build a single string combining conversation history and the current user message" + }, + { + "name": "FlowSpan", + "kind": "interface", + "signature": "interface FlowSpan", + "doc": "The shared FlowSpan / FlowTrace data shapes — the LEAF both the trace barrel (`./index`, which builds + renders them) and the delegation converters (`./mission-flow`, which emit them) import, so neit…" + }, + { + "name": "FlowTrace", + "kind": "interface", + "signature": "interface FlowTrace", + "doc": "Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls" + }, + { + "name": "formatPreflightReport", + "kind": "function", + "signature": "(report: PreflightReport) => string", + "doc": "Render a report as an aligned, operator-readable table + verdict line." + }, + { + "name": "getClient", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig) => SandboxClient", + "doc": "Resolve a synchronous sandbox client from provided runtime configuration credentials" + }, + { + "name": "getPartKey", + "kind": "function", + "signature": "(part: JsonRecord) => string", + "doc": "Resolve a unique key string for a part based on its type and identifying properties" + }, + { + "name": "handleAppToolRequest", + "kind": "function", + "signature": "(request: Request, opts: HandleToolRequestOptions) => Promise", + "doc": "Handle one app-tool HTTP request end to end — the sandbox MCP path." + }, + { + "name": "HandleToolRequestOptions", + "kind": "interface", + "signature": "interface HandleToolRequestOptions", + "doc": "Define options for handling tool requests including tool identification and token verification" + }, + { + "name": "Harness", + "kind": "type", + "signature": "type Harness", + "doc": "Resolve a valid harness identifier from the predefined KNOWN_HARNESSES array" + }, + { + "name": "historyContentWithAttachments", + "kind": "function", + "signature": "(message: { content: string; parts?: readonly Record[] | null | undefined; }, header?: string | undefi…", + "doc": "History projection for a persisted message: `content` unchanged when it carries no attachment parts, else the block is appended once." + }, + { + "name": "httpHeadProbe", + "kind": "function", + "signature": "(config: HttpHeadProbeConfig) => PreflightProbe", + "doc": "Probe a plain reachability endpoint (e.g." + }, + { + "name": "HttpHeadProbeConfig", + "kind": "interface", + "signature": "interface HttpHeadProbeConfig", + "doc": "Define configuration options for performing an HTTP HEAD probe to check URL availability" + }, + { + "name": "HubExecClient", + "kind": "class", + "signature": "class HubExecClient", + "doc": "Typed client over the platform hub `/v1/hub/exec`." + }, + { + "name": "HubExecClientOptions", + "kind": "interface", + "signature": "interface HubExecClientOptions", + "doc": "Define configuration options for initializing a Hub execution client" + }, + { + "name": "HubExecErrorCode", + "kind": "type", + "signature": "type HubExecErrorCode", + "doc": "`{ success: false }` codes the hub returns on `/exec`." + }, + { + "name": "HubExecResult", + "kind": "type", + "signature": "type HubExecResult", + "doc": "Outcome of a hub `/exec` call." + }, + { + "name": "HubInvokeDeps", + "kind": "interface", + "signature": "interface HubInvokeDeps", + "doc": "Define dependencies for invoking hub operations including API key resolution and optional configuration" + }, + { + "name": "HubInvokeInput", + "kind": "interface", + "signature": "interface HubInvokeInput", + "doc": "Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments" + }, + { + "name": "HubInvokeOutcome", + "kind": "interface", + "signature": "interface HubInvokeOutcome", + "doc": "Describe the outcome of a hub invocation including status and response body" + }, + { + "name": "ImageBackground", + "kind": "type", + "signature": "type ImageBackground", + "doc": "Define image background styles as color, gradient, or image with optional overlay settings" + }, + { + "name": "ImageContent", + "kind": "interface", + "signature": "interface ImageContent", + "doc": "Define the structure for image content containing an array of image slides" + }, + { + "name": "ImageContentSchema", + "kind": "const", + "signature": "ZodObject<{ slides: ZodArray; valu…", + "doc": "Validate image content with an array of one or more slides containing background details" + }, + { + "name": "ImageImageLayer", + "kind": "interface", + "signature": "interface ImageImageLayer", + "doc": "Define properties for an image layer including position, size, URL, and optional opacity" + }, + { + "name": "ImageLayer", + "kind": "type", + "signature": "type ImageLayer", + "doc": "Resolve a union type representing different kinds of image layers" + }, + { + "name": "ImageLayerType", + "kind": "type", + "signature": "type ImageLayerType", + "doc": "Define image layer categories for text, image, shape, or logo elements" + }, + { + "name": "ImageLogoLayer", + "kind": "interface", + "signature": "interface ImageLogoLayer", + "doc": "Define properties for positioning and sizing a logo image layer in a layout" + }, + { + "name": "ImageShapeLayer", + "kind": "interface", + "signature": "interface ImageShapeLayer", + "doc": "Define properties for a shape layer representing rectangular or circular image elements" + }, + { + "name": "ImageSlide", + "kind": "interface", + "signature": "interface ImageSlide", + "doc": "Define the structure for an image slide with a background and multiple layers" + }, + { + "name": "ImageTextLayer", + "kind": "interface", + "signature": "interface ImageTextLayer", + "doc": "Define properties for a text layer with position, style, and alignment options in an image" + }, + { + "name": "InMemoryDurableChatStateStore", + "kind": "class", + "signature": "class InMemoryDurableChatStateStore", + "doc": "Reference adapter for tests and local development." + }, + { + "name": "InMemoryDurableChatStore", + "kind": "const", + "signature": "typeof InMemoryDurableChatStateStore", + "doc": "Short aliases retained for adapter authors who call this a durable chat store rather than a state store." + }, + { + "name": "InMemoryMissionStore", + "kind": "interface", + "signature": "interface InMemoryMissionStore", + "doc": "Define an in-memory mission store that tracks events and allows direct record writes" + }, + { + "name": "INTERACTION_CANCEL_EVENT", + "kind": "const", + "signature": "\"interaction.cancel\"", + "doc": "Sidecar → client: the ask was withdrawn; data = `{ id, reason?" + }, + { + "name": "INTERACTION_EVENT", + "kind": "const", + "signature": "\"interaction\"", + "doc": "Sidecar → client: the agent raised an ask; data = `{ request }`." + }, + { + "name": "INTERACTION_RESOLVED_EVENT", + "kind": "const", + "signature": "\"interaction.resolved\"", + "doc": "An ask was answered; data = `{ id, status }`." + }, + { + "name": "InteractionAnswerBodyValidation", + "kind": "type", + "signature": "type InteractionAnswerBodyValidation", + "doc": "Validate interaction answer body and return success with data or failure with error message" + }, + { + "name": "InteractionAnswerRoute", + "kind": "interface", + "signature": "interface InteractionAnswerRoute", + "doc": "Define routes to list outstanding interactions and resolve answers for live turns" + }, + { + "name": "InteractionAnswerRouteOptions", + "kind": "interface", + "signature": "interface InteractionAnswerRouteOptions", + "doc": "Define options to authenticate, authorize, and manage persistence for interaction answer routes" + }, + { + "name": "InteractionAnswers", + "kind": "type", + "signature": "type InteractionAnswers", + "doc": "Map interaction identifiers to their corresponding answer values" + }, + { + "name": "InteractionAnswerValue", + "kind": "type", + "signature": "type InteractionAnswerValue", + "doc": "Accepted answer values." + }, + { + "name": "InteractionCancelData", + "kind": "interface", + "signature": "interface InteractionCancelData", + "doc": "Describe data required to cancel an interaction including its identifier and optional reason" + }, + { + "name": "InteractionClientOutcome", + "kind": "type", + "signature": "type InteractionClientOutcome", + "doc": "Define possible outcomes for an interaction client as accepted or declined" + }, + { + "name": "InteractionConnectionResolution", + "kind": "type", + "signature": "type InteractionConnectionResolution", + "doc": "The product seam's verdict for one request." + }, + { + "name": "InteractionData", + "kind": "type", + "signature": "type InteractionData", + "doc": null + }, + { + "name": "interactionFromWireRequest", + "kind": "function", + "signature": "(request: InteractionRequestWire) => ChatInteraction", + "doc": "Reads a wire request into the client's pending `ChatInteraction`." + }, + { + "name": "InteractionOutcome", + "kind": "type", + "signature": "type InteractionOutcome", + "doc": null + }, + { + "name": "interactionPartKey", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Generate a unique key string for an interaction using the given identifier" + }, + { + "name": "InteractionPersistedPart", + "kind": "type", + "signature": "type InteractionPersistedPart", + "doc": "Persisted-part shapes the codecs below produce — the SAME rows `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the source so a product pushing them into a `ChatMessagePart[]` t…" + }, + { + "name": "InteractionRequest", + "kind": "type", + "signature": "type InteractionRequest", + "doc": null + }, + { + "name": "InteractionRequestWire", + "kind": "type", + "signature": "type InteractionRequestWire", + "doc": "`InteractionRequest` whose select fields may carry `allowCustom`." + }, + { + "name": "InteractionRouteLogger", + "kind": "type", + "signature": "type InteractionRouteLogger", + "doc": "Provide logging methods for warnings and errors in interaction routes" + }, + { + "name": "interactionToPersistedPart", + "kind": "function", + "signature": "(request: InteractionRequestWire, status: ChatInteractionStatus, cancelReason?: string | undefined, answers?: Interacti…", + "doc": "Builds the persisted/streamed `interaction` part from a wire request." + }, + { + "name": "invokeIntegrationHub", + "kind": "function", + "signature": "(input: HubInvokeInput, deps: HubInvokeDeps) => Promise", + "doc": "Resolve + execute one integration tool call through the hub: resolve the per-user bearer, map the MCP tool name to the hub action path, forward to `/v1/hub/exec`, and shape the route response (200 ok…" + }, + { + "name": "isAppToolName", + "kind": "function", + "signature": "(name: string) => name is \"submit_proposal\" | \"schedule_followup\" | \"render_ui\" | \"add_citation\"", + "doc": "Determine if a string matches a valid application tool name" + }, + { + "name": "isChatAttachmentPart", + "kind": "function", + "signature": "(part: unknown) => part is ChatAttachmentPart", + "doc": "True for any `image`/`file` part carrying a non-empty string `path`." + }, + { + "name": "isChatInteractionPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatInteractionPart", + "doc": "Resolve whether a ChatMessagePart is a ChatInteractionPart based on its type property" + }, + { + "name": "isChatMentionPart", + "kind": "function", + "signature": "(part: unknown) => part is ChatMentionPart", + "doc": "Widened to `unknown` — unlike its siblings this guard also runs over raw untyped stored rows (a transcript renderer reads `message.parts` before the typed projection), which is exactly what {@link me…" + }, + { + "name": "isChatPlanPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatPlanPersistedPart", + "doc": "Resolve whether a chat message part is a persisted chat plan part" + }, + { + "name": "isChatStepFinishPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatStepFinishPart", + "doc": "Determine if a chat message part represents the completion of a chat step" + }, + { + "name": "isChatTextPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatTextPart", + "doc": "Resolve whether a chat message part is a text part based on its type property" + }, + { + "name": "isChatToolPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatToolPart", + "doc": "Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property" + }, + { + "name": "isHarness", + "kind": "function", + "signature": "(value: unknown) => value is \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\"…", + "doc": "Determine if a value is a recognized harness string identifier" + }, + { + "name": "isMissionStopRequested", + "kind": "function", + "signature": "(mission: MissionRecord) => boolean", + "doc": "The cooperative kill switch: a stop request rides metadata so it survives any status and is honored by the engine before the next side effect." + }, + { + "name": "isMissionTerminal", + "kind": "function", + "signature": "(status: MissionStatus) => boolean", + "doc": "Statuses a mission can never leave — the run is done." + }, + { + "name": "isModelCompatibleWithHarness", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Provider-less ids (sentinels like \"default\", or a session's own config) are compatible everywhere — every harness honors its own configuration." + }, + { + "name": "isRenderableInteractionKind", + "kind": "function", + "signature": "(kind: string) => boolean", + "doc": "Resolve if the given interaction kind is renderable within the application context" + }, + { + "name": "isSafeInteractionFieldKey", + "kind": "function", + "signature": "(key: string) => boolean", + "doc": "Answer/field keys the sidecar will accept: identifier-safe and never a prototype-pollution vector." + }, + { + "name": "isSandboxTerminalWsUpgrade", + "kind": "function", + "signature": "(request: Request) => boolean", + "doc": "True when `request` is a WebSocket upgrade for a sandbox terminal path." + }, + { + "name": "isTangleBillingEnforcementDisabled", + "kind": "function", + "signature": "(opts?: TangleBillingEnforcementOptions) => boolean", + "doc": "Shared policy for agent products that bill through the Tangle Platform." + }, + { + "name": "isTangleExecutionKeyError", + "kind": "function", + "signature": "(error: unknown) => error is TangleExecutionKeyError", + "doc": "Identify whether an error is a TangleExecutionKeyError based on its properties and type" + }, + { + "name": "isTerminalInteractionStatus", + "kind": "function", + "signature": "(status: ChatInteractionStatus) => boolean", + "doc": "Resolve if the interaction status is a terminal state excluding pending" + }, + { + "name": "isTerminalPromptEvent", + "kind": "function", + "signature": "(event: unknown) => boolean", + "doc": "Determine if an event is a terminal prompt event with type 'result' or 'done" + }, + { + "name": "JsonObject", + "kind": "type", + "signature": "type JsonObject", + "doc": "Web-boundary utilities every agent app's routes hand-roll: JSON body parsing + narrowing, request-context extraction (real client IP behind Cloudflare), a KV-backed sliding-window rate limiter, and s…" + }, + { + "name": "JsonRecord", + "kind": "type", + "signature": "type JsonRecord", + "doc": "Represent a JSON-compatible object with string keys and values of any type" + }, + { + "name": "KeyCrypto", + "kind": "interface", + "signature": "interface KeyCrypto", + "doc": "Secret encryption seam (the app's at-rest crypto)." + }, + { + "name": "KeyProvisioner", + "kind": "interface", + "signature": "interface KeyProvisioner", + "doc": "The key-provisioning operations the key manager needs." + }, + { + "name": "KnowledgeCandidate", + "kind": "interface", + "signature": "interface KnowledgeCandidate", + "doc": "A research candidate the decider evaluates before the loop applies it." + }, + { + "name": "KnowledgeDecider", + "kind": "interface", + "signature": "interface KnowledgeDecider", + "doc": "The pluggable acquisition policy." + }, + { + "name": "KnowledgeDeciderInput", + "kind": "interface", + "signature": "interface KnowledgeDeciderInput", + "doc": "Define the input parameters required to decide knowledge proposals within an agent-knowledge loop" + }, + { + "name": "KnowledgeDecision", + "kind": "interface", + "signature": "interface KnowledgeDecision", + "doc": "Define a decision containing a candidate and the gate's verdict on that candidate" + }, + { + "name": "KnowledgeGateVerdict", + "kind": "interface", + "signature": "interface KnowledgeGateVerdict", + "doc": "The verdict a gate returns for one candidate." + }, + { + "name": "KnowledgeLoop", + "kind": "interface", + "signature": "interface KnowledgeLoop", + "doc": "The handle `createKnowledgeLoop` returns." + }, + { + "name": "KnowledgeLoopConfig", + "kind": "interface", + "signature": "interface KnowledgeLoopConfig", + "doc": "The knowledge-acquisition loop config — the goal the researcher pursues and the gate it must clear before the loop is considered satisfied." + }, + { + "name": "KnowledgeLoopDriver", + "kind": "interface", + "signature": "interface KnowledgeLoopDriver", + "doc": "The agent-runtime turn driver seam." + }, + { + "name": "KnowledgeRequirementSpec", + "kind": "interface", + "signature": "interface KnowledgeRequirementSpec", + "doc": "Define the criteria and conditions required to satisfy a specific knowledge requirement" + }, + { + "name": "KnowledgeSignal", + "kind": "interface", + "signature": "interface KnowledgeSignal", + "doc": "Define a signal representing knowledge with confidence level and optional supporting evidence" + }, + { + "name": "KnowledgeSourceSpec", + "kind": "interface", + "signature": "interface KnowledgeSourceSpec", + "doc": "A knowledge source the acquisition loop / researcher may draw on." + }, + { + "name": "KnowledgeStateAccessor", + "kind": "interface", + "signature": "interface KnowledgeStateAccessor", + "doc": "The single seam a backend implements." + }, + { + "name": "KNOWN_HARNESSES", + "kind": "const", + "signature": "readonly [\"opencode\", \"claude-code\", \"nanoclaw\", \"kimi-code\", \"codex\", \"amp\", \"factory-droids\", \"pi\", \"hermes\", \"forge\"…", + "doc": "The known coding-agent backends." + }, + { + "name": "KvLike", + "kind": "interface", + "signature": "interface KvLike", + "doc": "Minimal KV contract (Cloudflare `KVNamespace` satisfies it structurally)." + }, + { + "name": "lightTheme", + "kind": "const", + "signature": "AgentAppTheme", + "doc": "Define a light color theme with specific background, foreground, and accent color values" + }, + { + "name": "listSessionInteractions", + "kind": "function", + "signature": "(connection: SidecarInteractionsConnection) => Promise>", + "doc": "Outstanding (unanswered) interactions for the session — the sidecar's registry is authoritative, so this is the reconnect/reload source of truth." + }, + { + "name": "LivenessProbeConfig", + "kind": "interface", + "signature": "interface LivenessProbeConfig", + "doc": "Define configuration for liveness probes including sidecar process pattern and optional timeouts" + }, + { + "name": "LoopAssistantToolCall", + "kind": "interface", + "signature": "interface LoopAssistantToolCall", + "doc": "One OpenAI-shaped tool-call entry carried on an assistant message." + }, + { + "name": "LoopEvent", + "kind": "type", + "signature": "type LoopEvent", + "doc": "Events the app's OpenAI-compat stream adapter ({@link toLoopEvents }) yields." + }, + { + "name": "LoopMessage", + "kind": "type", + "signature": "type LoopMessage", + "doc": "A message in the running conversation the loop sends to `streamTurn`." + }, + { + "name": "LoopToolCall", + "kind": "interface", + "signature": "interface LoopToolCall", + "doc": "Bounded turn-level tool-dispatch loop." + }, + { + "name": "LoopTraceEventLike", + "kind": "interface", + "signature": "interface LoopTraceEventLike", + "doc": "Structural mirror of agent-runtime's `LoopTraceEvent` — same fields, no import, so journals parsed from JSON feed straight in." + }, + { + "name": "loopTraceEventsToFlowSpans", + "kind": "function", + "signature": "(events: LoopTraceEventLike[]) => FlowSpan[]", + "doc": "Reconstruct one delegation's loop → round → iteration tree from its journaled LoopTraceEvents, as FlowSpans relative to `loop.started` (or the first event)." + }, + { + "name": "mapInteractionRespondFailure", + "kind": "function", + "signature": "(error: SidecarInteractionsError, logger?: InteractionRouteLogger) => Response", + "doc": "Sidecar error → the client-actionable contract." + }, + { + "name": "maskSpans", + "kind": "function", + "signature": "(text: string, patterns?: readonly RedactionPattern[]) => string", + "doc": "Replace only the PII substrings in `text`, preserving everything around them (the `mask-spans` string mode)." + }, + { + "name": "matchSandboxTerminalWsPath", + "kind": "function", + "signature": "(pathname: string) => SandboxTerminalWsMatch | null", + "doc": "Parse a same-origin terminal-WS pathname into its parts, or `null` when the path is not a sandbox terminal WebSocket." + }, + { + "name": "MCP_PROTOCOL_VERSIONS", + "kind": "const", + "signature": "readonly [\"2025-06-18\", \"2025-03-26\", \"2024-11-05\"]", + "doc": "Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server." + }, + { + "name": "McpProtocolVersion", + "kind": "type", + "signature": "type McpProtocolVersion", + "doc": "Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array" + }, + { + "name": "McpServerInfo", + "kind": "interface", + "signature": "interface McpServerInfo", + "doc": "Describe the structure of server information including name and version" + }, + { + "name": "McpToolDefinition", + "kind": "interface", + "signature": "interface McpToolDefinition", + "doc": "One tool entry in the registry the handler owns." + }, + { + "name": "MemberSyncSeam", + "kind": "interface", + "signature": "interface MemberSyncSeam", + "doc": "Map workspace roles to corresponding sandbox permission levels" + }, + { + "name": "mentionInputToPart", + "kind": "function", + "signature": "(input: FileMention) => ChatMentionPart", + "doc": "A validated wire mention (`parseFileMentions` in `/chat-routes`) as the part the turn route persists." + }, + { + "name": "mentionPartsFromMessageParts", + "kind": "function", + "signature": "(parts: readonly Record[] | readonly ChatMessagePart[] | null | undefined) => ChatMentionPart[]", + "doc": "Every mention part on one message, in stored order." + }, + { + "name": "mergeExtraMcp", + "kind": "function", + "signature": "(appToolMcp: Record, baseProfileMcp: Record, extra: Recor…", + "doc": "Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys" + }, + { + "name": "mergeHistoryIntoParts", + "kind": "function", + "signature": "(parts: PromptInputPart[], history?: { role: \"user\" | \"assistant\"; content: string; }[] | undefined) => PromptInputPart…", + "doc": "History-aware equivalent of flattenHistory for multimodal prompt parts: the transcript is folded into the first text part (image/file parts carry no text to prepend to) rather than replacing the mess…" + }, + { + "name": "mergeMissionState", + "kind": "function", + "signature": "(live: MissionState | undefined, seed: MissionState) => MissionState", + "doc": "Merge a loader SEED into the live state for one mission, advancing through the SAME monotonic clamps the event reducer uses." + }, + { + "name": "mergePersistedPart", + "kind": "function", + "signature": "(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string | undefined) => JsonRecord", + "doc": "Merge incoming JSON with existing persisted data, applying delta for text types when provided" + }, + { + "name": "mergeSurfaceOverlay", + "kind": "function", + "signature": "(base: TBase, overlay: SurfaceOverlay) => TBase & SurfaceMergeBase", + "doc": "Merge one surface overlay into a base profile, returning a new object (the base is never mutated; untouched nested records are shared by reference)." + }, + { + "name": "messageHasTurnId", + "kind": "function", + "signature": "(message: PersistedChatMessageForTurn, turnId: string) => boolean", + "doc": "Resolve whether a message contains any part with the specified turn ID" + }, + { + "name": "mintSandboxScopedToken", + "kind": "function", + "signature": "(box: SandboxInstance, options: { scope: ScopedTokenScope; sessionId?: string | undefined; ttlMinutes?: number | undefi…", + "doc": "Mint a scoped token for an already-provisioned box (e.g." + }, + { + "name": "mintTerminalProxyToken", + "kind": "function", + "signature": "(secret: string, identity: TerminalProxyIdentity, ttlMs?: number, now?: () => number) => Promise string | null", + "doc": "Provider prefix of a canonical model id (`anthropic/claude-…` → `anthropic`), or null." + }, + { + "name": "noopEventSink", + "kind": "const", + "signature": "MissionEventSink", + "doc": "A sink that drops every event — the engine default when no live channel is wired (and the unit-test default)." + }, + { + "name": "normalizeClientTurnId", + "kind": "function", + "signature": "(value: unknown) => string | undefined", + "doc": "Normalize and validate a client turn ID string ensuring it meets format and length requirements" + }, + { + "name": "normalizeModelId", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Strip provider prefix, :free suffix, and trailing date stamps." + }, + { + "name": "normalizePersistedPart", + "kind": "function", + "signature": "(rawPart: JsonRecord) => JsonRecord | null", + "doc": "Normalize a persisted part object by standardizing its structure and fields" + }, + { + "name": "normalizePlanDecision", + "kind": "function", + "signature": "(value: unknown) => DurablePlanDecision | null", + "doc": "Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs" + }, + { + "name": "normalizeTime", + "kind": "function", + "signature": "(value: unknown) => JsonRecord | undefined", + "doc": "Resolve time properties from various keys into a normalized record with numeric start and end fields" + }, + { + "name": "normalizeToolEvent", + "kind": "function", + "signature": "(event: StreamEvent) => StreamEvent", + "doc": "Normalize tool-related events into a standardized message.part.updated format" + }, + { + "name": "NoticeKind", + "kind": "type", + "signature": "type NoticeKind", + "doc": "Define specific string literals representing different kinds of notices" + }, + { + "name": "noticePart", + "kind": "function", + "signature": "(noticeKind: NoticeKind, id: string, text: string) => NoticePersistedPart", + "doc": "Builds the persisted/streamed `notice` part — a one-line transcript notice explaining an out-of-band event (warning, auto-declined interaction)." + }, + { + "name": "noticePartKey", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Generate a unique key string for a notice using the given identifier" + }, + { + "name": "NoticePersistedPart", + "kind": "type", + "signature": "type NoticePersistedPart", + "doc": "Define a persisted notice part with type, id, kind, and text properties" + }, + { + "name": "ObjectBody", + "kind": "interface", + "signature": "interface ObjectBody", + "doc": "A retrieved object." + }, + { + "name": "objectKey", + "kind": "function", + "signature": "({ operatorId, customerId, uploadId, filename }: ObjectKeyParts) => string", + "doc": "Build the canonical object key: `operator/customer/upload-filename`." + }, + { + "name": "ObjectKeyParts", + "kind": "interface", + "signature": "interface ObjectKeyParts", + "doc": "Inputs to {@link objectKey}." + }, + { + "name": "ObjectStore", + "kind": "interface", + "signature": "interface ObjectStore", + "doc": "Portable object-store port." + }, + { + "name": "OpenAICompatStreamTurnOptions", + "kind": "interface", + "signature": "interface OpenAICompatStreamTurnOptions", + "doc": "Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools" + }, + { + "name": "OpenAIFunctionTool", + "kind": "interface", + "signature": "interface OpenAIFunctionTool", + "doc": "A minimal OpenAI Chat Completions function-tool shape — structurally compatible with `@tangle-network/agent-runtime`'s `OpenAIChatTool` without importing it (keeps this package runtime-free)." + }, + { + "name": "OpenAIStreamChunk", + "kind": "interface", + "signature": "interface OpenAIStreamChunk", + "doc": "Minimal OpenAI Chat Completions streaming chunk (structural — no `openai` dep)." + }, + { + "name": "Outcome", + "kind": "type", + "signature": "type Outcome", + "doc": "Represent success or failure of an operation with corresponding value or error information" + }, + { + "name": "outcomeStatus", + "kind": "function", + "signature": "(outcome: { ok: false; code: string; message: string; status?: number | undefined; }) => number", + "doc": "HTTP status for a failed outcome — the handler's `ToolInputError.status` when present, else 400 for a validation reject." + }, + { + "name": "parseAssetSpec", + "kind": "function", + "signature": "(raw: unknown) => AssetSpec", + "doc": "Validates an unknown value as an AssetSpec, including format-specific content validation." + }, + { + "name": "ParsedIntegrationAction", + "kind": "interface", + "signature": "interface ParsedIntegrationAction", + "doc": "The provider/connector/action a hub action path addresses, plus the dotted `path` the hub `/exec` endpoint expects." + }, + { + "name": "ParsedMission", + "kind": "interface", + "signature": "interface ParsedMission", + "doc": "Describe a mission with a title and an ordered list of parsed steps" + }, + { + "name": "ParsedMissionStep", + "kind": "interface", + "signature": "interface ParsedMissionStep", + "doc": "Define the structure representing a parsed mission step with id, kind, and intent fields" + }, + { + "name": "parseInteractionAnswers", + "kind": "function", + "signature": "(value: unknown) => ParseInteractionAnswersResult", + "doc": "Strictly validates and copies persisted answer selections." + }, + { + "name": "ParseInteractionAnswersResult", + "kind": "type", + "signature": "type ParseInteractionAnswersResult", + "doc": "Resolve the result of parsing interaction answers with success status and corresponding data or error message" + }, + { + "name": "parseInteractionCancel", + "kind": "function", + "signature": "(data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;…", + "doc": "Parse interaction cancel data and return success status with parsed value or error message" + }, + { + "name": "parseInteractionRequest", + "kind": "function", + "signature": "(data: Record | undefined) => ParseInteractionResult", + "doc": "Parses an `interaction` event's data (`{ request }`)." + }, + { + "name": "ParseInteractionResult", + "kind": "type", + "signature": "type ParseInteractionResult", + "doc": "Resolve interaction parsing outcome as success with value or failure with error message" + }, + { + "name": "parseJsonObjectBody", + "kind": "function", + "signature": "(request: Request) => Promise<[JsonObject, null] | [null, Response]>", + "doc": "Parse + object-narrow a Request body." + }, + { + "name": "parseMissionBlocks", + "kind": "function", + "signature": "(fullContent: string, options?: ParseMissionBlocksOptions) => ParsedMission[]", + "doc": "Parse every well-formed `:::mission` block." + }, + { + "name": "ParseMissionBlocksOptions", + "kind": "interface", + "signature": "interface ParseMissionBlocksOptions", + "doc": "Define options to specify allowed lowercase step kinds for parsing mission blocks" + }, + { + "name": "parsePlanSubmittedEvent", + "kind": "function", + "signature": "(event: unknown) => ParsePlanSubmittedResult", + "doc": "Parses both direct sandbox events (`data.plan`) and session envelopes (`properties.plan`)." + }, + { + "name": "ParsePlanSubmittedResult", + "kind": "type", + "signature": "type ParsePlanSubmittedResult", + "doc": "Resolve the result of parsing a plan submission into success with value or failure with error" + }, + { + "name": "parseSessionStreamEnvelope", + "kind": "function", + "signature": "(raw: unknown) => MissionStreamEvent | null", + "doc": "Reconstruct the flat MissionStreamEvent from a broadcast envelope of shape `{ type, data: { ...missionFields } }` (transports may also stamp routing fields like workspaceId/threadId into `data`)." + }, + { + "name": "peekWorkspaceSandbox", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, options: { workspaceId: string; userId?: string | undefined; }) => Promise) => ChatInteraction | null", + "doc": "Reads a persisted/streamed `interaction` part back into a `ChatInteraction`." + }, + { + "name": "persistedPartToPlan", + "kind": "function", + "signature": "(part: Record) => ChatPlan | null", + "doc": "Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan" + }, + { + "name": "PLAN_SUBMITTED_EVENT", + "kind": "const", + "signature": "\"plan.submitted\"", + "doc": "Durable-plan application-shell contract." + }, + { + "name": "planAuthorityIdempotencyKey", + "kind": "function", + "signature": "(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string", + "doc": "Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision" + }, + { + "name": "planCommandKey", + "kind": "function", + "signature": "(planId: string, revision: number, decision: DurablePlanDecision) => string", + "doc": "Generate a unique key string for a plan command using plan ID, revision, and decision" + }, + { + "name": "planEffectKey", + "kind": "function", + "signature": "(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string", + "doc": "Generate a unique string key representing the effect of a plan decision within a given scope and revision" + }, + { + "name": "planFollowUpTurnId", + "kind": "function", + "signature": "(planId: string, outcome: \"approved\" | \"rejected\") => string", + "doc": "Generate a unique follow-up turn ID based on the plan ID and its outcome" + }, + { + "name": "PlanLimit", + "kind": "interface", + "signature": "interface PlanLimit", + "doc": "Plan limits — a PARAMETER per product (dollar allowance, concurrency, overage policy)." + }, + { + "name": "PlanOutcome", + "kind": "type", + "signature": "type PlanOutcome", + "doc": "Outcome of running the whole plan from the cursor to the end." + }, + { + "name": "planPartKey", + "kind": "function", + "signature": "(planId: string) => string", + "doc": "Generate a unique key string for a given plan identifier" + }, + { + "name": "planRevisionKey", + "kind": "function", + "signature": "(planId: string, revision: number) => string", + "doc": "Generate a unique key string for a plan based on its ID and revision number" + }, + { + "name": "planToPersistedPart", + "kind": "function", + "signature": "(plan: ChatPlan) => ChatPlanPersistedPart", + "doc": "Resolve a ChatPlan into its persisted part representation for storage or transmission" + }, + { + "name": "PlatformBalanceInfo", + "kind": "interface", + "signature": "interface PlatformBalanceInfo", + "doc": "Spendable balance for a platform user." + }, + { + "name": "PlatformBalanceManager", + "kind": "interface", + "signature": "interface PlatformBalanceManager", + "doc": "Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking" + }, + { + "name": "PlatformBalanceManagerOptions", + "kind": "interface", + "signature": "interface PlatformBalanceManagerOptions", + "doc": "Define configuration options for managing platform balance based on billing plans" + }, + { + "name": "PlatformBillingClient", + "kind": "interface", + "signature": "interface PlatformBillingClient", + "doc": "The platform billing transport — the product wires these to id.tangle.tools (or any balance backend)." + }, + { + "name": "PlatformIdentity", + "kind": "interface", + "signature": "interface PlatformIdentity", + "doc": "A user's resolved platform identity (from the app's SSO account store)." + }, + { + "name": "PlatformProductUsage", + "kind": "interface", + "signature": "interface PlatformProductUsage", + "doc": "Per-product spend aggregate." + }, + { + "name": "PreflightProbe", + "kind": "interface", + "signature": "interface PreflightProbe", + "doc": "A liveness probe." + }, + { + "name": "PreflightProbeResult", + "kind": "interface", + "signature": "interface PreflightProbeResult", + "doc": "One probe's outcome." + }, + { + "name": "PreflightProbeVerdict", + "kind": "interface", + "signature": "interface PreflightProbeVerdict", + "doc": "Per-probe verdict enriched with the resolved criticality and measured latency." + }, + { + "name": "PreflightReport", + "kind": "interface", + "signature": "interface PreflightReport", + "doc": "Aggregate of every probe verdict plus the overall pass/fail decision." + }, + { + "name": "PreparedDurableInteractionAnswer", + "kind": "interface", + "signature": "interface PreparedDurableInteractionAnswer", + "doc": "Define a structured response containing scope, settlement, and intent for durable interactions" + }, + { + "name": "PRESET_MIGRATION_SQL", + "kind": "const", + "signature": "readonly string[]", + "doc": "Plain DDL for the preset schema — run by a consumer to create the tables with ZERO drizzle (`for (const sql of PRESET_MIGRATION_SQL) await db.prepare(sql).run()`, or paste into a `.sql` migration)." + }, + { + "name": "PRESET_TABLES", + "kind": "const", + "signature": "{ readonly proposals: { readonly name: \"proposals\"; readonly columns: { readonly id: \"id\"; readonly workspaceId: \"works…", + "doc": "The preset table + column names — the contract the DDL, Drizzle schema, handlers, and accessor share." + }, + { + "name": "PresetBillingOptions", + "kind": "interface", + "signature": "interface PresetBillingOptions", + "doc": "Define preset billing options including database, provisioner, encryption key, budget, and optional settings" + }, + { + "name": "PresetKnowledgeAccessorOptions", + "kind": "interface", + "signature": "interface PresetKnowledgeAccessorOptions", + "doc": "Define options for accessing preset knowledge scoped to a specific workspace and configuration" + }, + { + "name": "PresetToolHandlerOptions", + "kind": "interface", + "signature": "interface PresetToolHandlerOptions", + "doc": "Define configuration options for handling preset tools including database, vault, and optional utilities" + }, + { + "name": "producedFromToolEvents", + "kind": "function", + "signature": "(events: readonly AppToolProducedEvent[]) => RuntimeEventLike[]", + "doc": "Bridge the app-tool side channel's produced events into the runtime-event shape agent-eval's `extractProducedState` reads." + }, + { + "name": "ProducedState", + "kind": "interface", + "signature": "interface ProducedState", + "doc": "Everything observable about what a run actually produced." + }, + { + "name": "ProfileComposeOptions", + "kind": "interface", + "signature": "interface ProfileComposeOptions", + "doc": "Define options for composing a user profile including prompts, files, servers, and name" + }, + { + "name": "PromptInputPart", + "kind": "type", + "signature": "type PromptInputPart", + "doc": "Extract a single element type from the array parameter of SandboxInstance's streamPrompt method" + }, + { + "name": "ProviderResolutionConfig", + "kind": "interface", + "signature": "interface ProviderResolutionConfig", + "doc": "Define configuration options for resolving a provider and its model with optional API keys and routing details" + }, + { + "name": "PROVISION_PAYLOAD_MAX_BYTES", + "kind": "const", + "signature": "240000", + "doc": "Gate on the provision body: the platform orchestrator caps the create payload at 256 KiB; 240 KB leaves headroom for transport framing." + }, + { + "name": "ProvisionPayloadSections", + "kind": "interface", + "signature": "interface ProvisionPayloadSections", + "doc": "The provision-payload sections the size gates need to see." + }, + { + "name": "ProvisionProfileSection", + "kind": "interface", + "signature": "interface ProvisionProfileSection", + "doc": "Structural slice of the profile the payload gate reads: it only measures the profile's serialized size and names `resources.files` in the breakdown, so callers composing a payload outside the SDK (pr…" + }, + { + "name": "pumpBufferedTurn", + "kind": "function", + "signature": "(opts: PumpBufferedTurnOptions) => Promise", + "doc": "Drive a turn to completion regardless of the live client, when you OWN the producer as an `AsyncIterable`." + }, + { + "name": "PumpBufferedTurnOptions", + "kind": "interface", + "signature": "interface PumpBufferedTurnOptions", + "doc": "Define options to pump data from an asynchronous iterable source with buffered turn control" + }, + { + "name": "PutObjectOptions", + "kind": "interface", + "signature": "interface PutObjectOptions", + "doc": "Options for a single {@link ObjectStore.put}." + }, + { + "name": "questionInteractionContentSignature", + "kind": "function", + "signature": "(interaction: ChatInteraction) => string | null", + "doc": "Content identity for duplicate safety nets." + }, + { + "name": "R2LikeBucket", + "kind": "interface", + "signature": "interface R2LikeBucket", + "doc": "The minimal slice of Cloudflare's `R2Bucket` this module calls." + }, + { + "name": "R2LikeObjectBody", + "kind": "interface", + "signature": "interface R2LikeObjectBody", + "doc": "Body shape of a retrieved object (structural match of R2's `R2ObjectBody`)." + }, + { + "name": "R2LikeObjectHead", + "kind": "interface", + "signature": "interface R2LikeObjectHead", + "doc": "Head/metadata shape of a stored object (structural match of R2's `R2Object`)." + }, + { + "name": "RateLimitResult", + "kind": "interface", + "signature": "interface RateLimitResult", + "doc": "Describe the outcome of a rate limit check including allowance, remaining count, and reset time" + }, + { + "name": "readCookieValue", + "kind": "function", + "signature": "(cookieHeader: string | null, name: string) => string | null", + "doc": "Read + decode one cookie from a Cookie request header; null when absent." + }, + { + "name": "readSandboxBinaryBytes", + "kind": "function", + "signature": "(box: SandboxExecChannel, absolutePath: string, expectedSize: number, options?: SandboxExecOptions | undefined) => Prom…", + "doc": "Reads a sandbox file as base64 and decodes it, verifying the decoded byte length against `expectedSize` (from a prior {@link statSandboxFileSize})." + }, + { + "name": "readSecret", + "kind": "function", + "signature": "(store: SecretStore, name: string) => Promise>", + "doc": "Resolve a secret value from the store by its name and return the outcome asynchronously" + }, + { + "name": "readToolArgs", + "kind": "function", + "signature": "(request: Request) => Promise", + "doc": "Read a tool's argument object from the request body, tolerant of MCP host aliases (`args` / `arguments`) or a bare body." + }, + { + "name": "recordDurableInteractionAnswer", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: \"declined\" | \"accepted\", answers?: R…", + "doc": "Record an accepted/declined answer in the projection." + }, + { + "name": "recordDurableInteractionCancel", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even…", + "doc": "Apply a cancel event." + }, + { + "name": "RedactedDocSegment", + "kind": "type", + "signature": "type RedactedDocSegment", + "doc": "A redacted document segment: literal text, or a masked span with the original kept ENCRYPTED for an authorized reveal." + }, + { + "name": "RedactedDocument", + "kind": "interface", + "signature": "interface RedactedDocument", + "doc": "Define a document composed of multiple redacted content segments" + }, + { + "name": "redactForIngestion", + "kind": "function", + "signature": "(value: unknown, options?: RedactForIngestionOptions) => unknown", + "doc": "One-way PII scrub for telemetry/ingestion." + }, + { + "name": "RedactForIngestionOptions", + "kind": "interface", + "signature": "interface RedactForIngestionOptions", + "doc": "Define options to customize sensitive data redaction patterns and key names for ingestion" + }, + { + "name": "RedactionPattern", + "kind": "interface", + "signature": "interface RedactionPattern", + "doc": "A named PII pattern." + }, + { + "name": "RedactionSpan", + "kind": "interface", + "signature": "interface RedactionSpan", + "doc": "A detected PII span in a source string." + }, + { + "name": "reduceMissionEvents", + "kind": "function", + "signature": "(events: MissionStreamEvent[], seed?: Map | undefined) => Map", + "doc": "Fold a whole event sequence into a Map." + }, + { + "name": "renderHistogram", + "kind": "function", + "signature": "(values: number[], opts?: { buckets?: number | undefined; width?: number | undefined; unit?: string | undefined; format…", + "doc": "ASCII histogram for multi-run samples (eval latencies, costs, scores)." + }, + { + "name": "RenderUiArgs", + "kind": "interface", + "signature": "interface RenderUiArgs", + "doc": "Define arguments required to render a UI including title and schema" + }, + { + "name": "RenderUiResult", + "kind": "interface", + "signature": "interface RenderUiResult", + "doc": "Describe the result of rendering UI including the artifact path and exact persisted content" + }, + { + "name": "renderWaterfall", + "kind": "function", + "signature": "(trace: FlowTrace, opts?: { width?: number | undefined; } | undefined) => string", + "doc": "ASCII waterfall cascade — the default artifact for explaining a flow." + }, + { + "name": "replayTurnEvents", + "kind": "function", + "signature": "(opts: ReplayTurnEventsOptions) => AsyncGenerator", + "doc": "Yield buffered events after `fromSeq`, then keep polling while the turn is still 'running' until it completes, errors, or times out." + }, + { + "name": "ReplayTurnEventsOptions", + "kind": "interface", + "signature": "interface ReplayTurnEventsOptions", + "doc": "Define options for replaying turn events with control over sequence, polling, and timeout" + }, + { + "name": "RequestContext", + "kind": "interface", + "signature": "interface RequestContext", + "doc": "Define the context of a request including IP address, user agent, timestamp, and request ID" + }, + { + "name": "requireString", + "kind": "function", + "signature": "(body: JsonObject, field: string) => string | Response", + "doc": "Narrow one required string field, 400 if missing/empty." + }, + { + "name": "resetClientCache", + "kind": "function", + "signature": "() => void", + "doc": "Reset the client cache to clear stored data and force fresh retrieval" + }, + { + "name": "resolveChatTurn", + "kind": "function", + "signature": "(input: { existingMessages: PersistedChatMessageForTurn[]; userContent: string; turnId?: string | undefined; }) => Reso…", + "doc": "Resolve a chat turn by determining message reuse and constructing user message parts" + }, + { + "name": "ResolvedAgentProfile", + "kind": "interface", + "signature": "interface ResolvedAgentProfile", + "doc": "The agent's resolved profile surfaces for one turn — the things a delivered / certified `AgentProfile` can change." + }, + { + "name": "ResolvedChatTurn", + "kind": "interface", + "signature": "interface ResolvedChatTurn", + "doc": "Represent a chat turn with resolved user message insertion and prior message context" + }, + { + "name": "ResolvedModel", + "kind": "interface", + "signature": "interface ResolvedModel", + "doc": "Represent a fully configured model with optional API key and base URL for sandbox platform integration" + }, + { + "name": "ResolvedSessionHarness", + "kind": "interface", + "signature": "interface ResolvedSessionHarness", + "doc": "Represent resolved session state including harness, lock status, and swap attempt flag" + }, + { + "name": "ResolvedTangleExecutionKey", + "kind": "interface", + "signature": "interface ResolvedTangleExecutionKey", + "doc": "Define a resolved key combining an API key with its Tangle execution source" + }, + { + "name": "ResolvedToolCapabilities", + "kind": "interface", + "signature": "interface ResolvedToolCapabilities", + "doc": "Describe resolved capabilities including proposal types and product tool groups to expose" + }, + { + "name": "resolveIntegrationAction", + "kind": "function", + "signature": "(toolName: string) => ParsedIntegrationAction | undefined", + "doc": "Resolve an MCP tool name (the opaque `int_…` catalog name the agent calls) into the dotted hub action path." + }, + { + "name": "ResolveInteractionConnectionArgs", + "kind": "interface", + "signature": "interface ResolveInteractionConnectionArgs", + "doc": "Define arguments required to resolve interaction connections based on request and intent" + }, + { + "name": "resolveModel", + "kind": "function", + "signature": "(config: ProviderResolutionConfig | undefined, override?: { model?: string | undefined; modelApiKey?: string | undefine…", + "doc": "Resolve and return the appropriate model configuration based on provider settings and optional overrides" + }, + { + "name": "ResolveModelOptions", + "kind": "interface", + "signature": "interface ResolveModelOptions", + "doc": "Resolve options for model configuration including environment variables and default router base URL" + }, + { + "name": "resolveSandboxClientCredentials", + "kind": "function", + "signature": "(options?: ResolveSandboxClientCredentialsOptions) => Promise", + "doc": "Resolve sandbox client credentials based on environment and provided options asynchronously" + }, + { + "name": "ResolveSandboxClientCredentialsOptions", + "kind": "interface", + "signature": "interface ResolveSandboxClientCredentialsOptions", + "doc": "Resolve options for obtaining sandbox client credentials from environment variables and classification" + }, + { + "name": "resolveSessionHarness", + "kind": "function", + "signature": "(input?: ResolveSessionHarnessInput) => ResolvedSessionHarness", + "doc": "Resolve the harness for a turn, enforcing the session lock." + }, + { + "name": "ResolveSessionHarnessInput", + "kind": "interface", + "signature": "interface ResolveSessionHarnessInput", + "doc": "Resolve input options to determine the appropriate session harness to use" + }, + { + "name": "resolveTangleDevOrUserKey", + "kind": "function", + "signature": "(opts: ResolveTangleDevOrUserKeyOptions) => Promise", + "doc": "Shared dev-aware Tangle key resolution." + }, + { + "name": "ResolveTangleDevOrUserKeyOptions", + "kind": "interface", + "signature": "interface ResolveTangleDevOrUserKeyOptions", + "doc": "Resolve options for retrieving a Tangle developer or user API key based on environment and context" + }, + { + "name": "resolveTangleExecutionEnvironment", + "kind": "function", + "signature": "(env?: Record) => TangleExecutionEnvironment", + "doc": "Resolve the current Tangle execution environment based on provided or process environment variables" + }, + { + "name": "resolveTangleModelConfig", + "kind": "function", + "signature": "(opts?: ResolveModelOptions) => TangleModelConfig", + "doc": "Resolve the model config from env." + }, + { + "name": "resolveToolCapabilities", + "kind": "function", + "signature": "(opts: ResolveToolCapabilitiesOptions) => ResolvedToolCapabilities", + "doc": "Resolve an enabled capability-id set against a taxonomy into the concrete tool surface." + }, + { + "name": "ResolveToolCapabilitiesOptions", + "kind": "interface", + "signature": "interface ResolveToolCapabilitiesOptions", + "doc": "Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs" + }, + { + "name": "resolveToolId", + "kind": "function", + "signature": "(part: JsonRecord) => string", + "doc": "Resolve a unique tool identifier from various possible properties or generate a fallback ID" + }, + { + "name": "resolveToolName", + "kind": "function", + "signature": "(part: JsonRecord) => string", + "doc": "Resolve the tool name from a JSON record using tool, name, or a default value" + }, + { + "name": "resolveUserTangleExecutionKey", + "kind": "function", + "signature": "(opts: ResolveUserTangleExecutionKeyOptions) => Promise", + "doc": "Resolve the user-facing Tangle API key for model execution." + }, + { + "name": "resolveUserTangleExecutionKeyForUser", + "kind": "function", + "signature": "(opts: ResolveUserTangleExecutionKeyForUserOptions) => Promise", + "doc": "Resolve the Tangle execution key for a specified user using provided environment and API key options" + }, + { + "name": "ResolveUserTangleExecutionKeyForUserOptions", + "kind": "interface", + "signature": "interface ResolveUserTangleExecutionKeyForUserOptions", + "doc": "Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters" + }, + { + "name": "ResolveUserTangleExecutionKeyOptions", + "kind": "interface", + "signature": "interface ResolveUserTangleExecutionKeyOptions", + "doc": "Resolve options for retrieving user API keys within a specific Tangle execution environment" + }, + { + "name": "respondToSessionInteraction", + "kind": "function", + "signature": "(connection: SidecarInteractionsConnection, response: { id: string; outcome: \"declined\" | \"cancelled\" | \"accepted\"; dat…", + "doc": "Resolves one interaction." + }, + { + "name": "restrictTaxonomy", + "kind": "function", + "signature": "(taxonomy: AppToolTaxonomy, allowed: readonly string[]) => AppToolTaxonomy", + "doc": "Restrict a taxonomy to a subset of proposal types, intersecting the regulated subset too — the regulated label survives restriction, so a narrowed agent can never launder a regulated type into an unr…" + }, + { + "name": "RetryableStepError", + "kind": "class", + "signature": "class RetryableStepError", + "doc": "Thrown by a {@link SandboxDispatch} for a TRANSIENT failure (platform blip, exec-time network fault) that should be re-attempted." + }, + { + "name": "RevealResult", + "kind": "interface", + "signature": "interface RevealResult", + "doc": "Describe the outcome of a reveal operation including success status, value, and failure reason" + }, + { + "name": "revealSpan", + "kind": "function", + "signature": "(doc: RedactedDocument, spanId: string, options: RevealSpanOptions) => Promise", + "doc": "Reveal one redacted span's original, gated + audited." + }, + { + "name": "RevealSpanOptions", + "kind": "interface", + "signature": "interface RevealSpanOptions", + "doc": "Define options to decrypt, authorize, and audit the reveal of a span segment" + }, + { + "name": "reviewCandidate", + "kind": "function", + "signature": "(candidate: KnowledgeCandidate, minConfidence: number) => KnowledgeGateVerdict", + "doc": "The default gate — agent-knowledge's propose-don't-apply reviewer posture as a confidence threshold." + }, + { + "name": "routerChatProbe", + "kind": "function", + "signature": "(config: RouterChatProbeConfig) => PreflightProbe", + "doc": "Probe an OpenAI-compatible LLM router with one cheap `POST /chat/completions` (`max_tokens: 1`)." + }, + { + "name": "RouterChatProbeConfig", + "kind": "interface", + "signature": "interface RouterChatProbeConfig", + "doc": "Define configuration options for probing an LLM router with authentication and model details" + }, + { + "name": "RouterModel", + "kind": "interface", + "signature": "interface RouterModel", + "doc": "Model catalogue — computed live from the Tangle Router, never hand-curated." + }, + { + "name": "runAppToolLoop", + "kind": "function", + "signature": "(opts: RunToolLoopOptions) => Promise", + "doc": "Run the bounded tool loop and return the final text + every executed tool outcome." + }, + { + "name": "runPreflight", + "kind": "function", + "signature": "(probes: PreflightProbe[]) => Promise", + "doc": "Run every probe (concurrently), time each, and fold into a report." + }, + { + "name": "runSandboxPrompt", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO…", + "doc": "Resolve a sandbox prompt by streaming and aggregating message parts into a complete string" + }, + { + "name": "runSandboxToolPathSetup", + "kind": "function", + "signature": "(box: SandboxInstance, options: SandboxToolPathOptions) => Promise>", + "doc": "Resolve the sandbox environment PATH setup by executing the configuration script with given options" + }, + { + "name": "RuntimeEventLike", + "kind": "type", + "signature": "type RuntimeEventLike", + "doc": "The subset of runtime stream events `extractProducedState` consumes." + }, + { + "name": "RuntimeExecutorOptions", + "kind": "interface", + "signature": "interface RuntimeExecutorOptions", + "doc": "Define options for executing runtime tasks with a trusted per-turn context" + }, + { + "name": "safeParseAssetSpec", + "kind": "function", + "signature": "(raw: unknown) => AssetSpec | null", + "doc": "Safe parse — returns null instead of throwing." + }, + { + "name": "SandboxApiCredentials", + "kind": "interface", + "signature": "interface SandboxApiCredentials", + "doc": "Define credentials required to access the sandbox API environment" + }, + { + "name": "sandboxAuthProbe", + "kind": "function", + "signature": "(config: SandboxAuthProbeConfig) => PreflightProbe", + "doc": "Probe the sandbox API with a cheap authed `GET /v1/sandboxes?limit=1`." + }, + { + "name": "SandboxAuthProbeConfig", + "kind": "interface", + "signature": "interface SandboxAuthProbeConfig", + "doc": "Define configuration options for probing sandbox authentication endpoints" + }, + { + "name": "SandboxBuildContext", + "kind": "interface", + "signature": "interface SandboxBuildContext", + "doc": "Define the context for building a sandbox including workspace, integrations, and optional user ID" + }, + { + "name": "SandboxClientCredentials", + "kind": "interface", + "signature": "interface SandboxClientCredentials", + "doc": "Define client credentials for accessing the sandbox environment with API key and base URL" + }, + { + "name": "SandboxCredentialEnvironment", + "kind": "type", + "signature": "type SandboxCredentialEnvironment", + "doc": "Sandbox credential policy reuses the canonical execution-environment union (development/test/staging/production) so env classification stays in one place (see resolveTangleExecutionEnvironment in run…" + }, + { + "name": "SandboxDispatch", + "kind": "type", + "signature": "type SandboxDispatch", + "doc": "A side-effecting unit of per-step work." + }, + { + "name": "SandboxDispatchDoneResult", + "kind": "interface", + "signature": "interface SandboxDispatchDoneResult", + "doc": "Define the result of a completed sandbox dispatch including artifact reference and optional cost details" + }, + { + "name": "SandboxDispatchInProgressResult", + "kind": "interface", + "signature": "interface SandboxDispatchInProgressResult", + "doc": "The dispatched step's detached session is still executing on the platform." + }, + { + "name": "SandboxDispatchInput", + "kind": "interface", + "signature": "interface SandboxDispatchInput", + "doc": "Define input parameters for dispatching a mission step in the sandbox environment" + }, + { + "name": "SandboxDispatchResult", + "kind": "type", + "signature": "type SandboxDispatchResult", + "doc": "Resolve the result of a sandbox dispatch as done or in progress" + }, + { + "name": "SandboxExecChannel", + "kind": "interface", + "signature": "interface SandboxExecChannel", + "doc": "The `box.exec` surface these helpers use — structural, so a caller can pass the sandbox SDK's `SandboxInstance` directly or a narrower test double." + }, + { + "name": "SandboxExecOptions", + "kind": "interface", + "signature": "interface SandboxExecOptions", + "doc": "Define options to execute code within a sandbox environment with optional session control" + }, + { + "name": "SandboxFileBytesOutcome", + "kind": "type", + "signature": "type SandboxFileBytesOutcome", + "doc": "Represent the outcome of reading sandbox file bytes with success status and corresponding data or error" + }, + { + "name": "SandboxFileSizeOutcome", + "kind": "type", + "signature": "type SandboxFileSizeOutcome", + "doc": "Resolve the outcome of a sandbox file size check with success status and value or error message" + }, + { + "name": "SandboxPermissionLevel", + "kind": "type", + "signature": "type SandboxPermissionLevel", + "doc": "Define permission levels for sandbox access and control" + }, + { + "name": "SandboxResourceConfig", + "kind": "interface", + "signature": "interface SandboxResourceConfig", + "doc": "Define configuration parameters for sandbox resource allocation and lifecycle management" + }, + { + "name": "SandboxRestoreSpec", + "kind": "interface", + "signature": "interface SandboxRestoreSpec", + "doc": "Define the specification for restoring a sandbox from a snapshot or another sandbox ID" + }, + { + "name": "SandboxRuntimeAuthRefreshError", + "kind": "class", + "signature": "class SandboxRuntimeAuthRefreshError", + "doc": "Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name" + }, + { + "name": "SandboxRuntimeConfig", + "kind": "interface", + "signature": "interface SandboxRuntimeConfig", + "doc": "Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions" + }, + { + "name": "SandboxRuntimeConnection", + "kind": "interface", + "signature": "interface SandboxRuntimeConnection", + "doc": "Define a connection configuration for sandbox runtime including URL and optional server-side auth token" + }, + { + "name": "SandboxScope", + "kind": "interface", + "signature": "interface SandboxScope", + "doc": "Define a scope containing workspace and optional user identifiers for sandbox environments" + }, + { + "name": "SandboxStepTransition", + "kind": "type", + "signature": "type SandboxStepTransition", + "doc": "Define transitions marking the start or finish of a sandbox step with associated details" + }, + { + "name": "SandboxTerminalTokenOptions", + "kind": "interface", + "signature": "interface SandboxTerminalTokenOptions", + "doc": "Define options for generating a sandbox terminal token including secret and expiration settings" + }, + { + "name": "SandboxTerminalTokenResult", + "kind": "interface", + "signature": "interface SandboxTerminalTokenResult", + "doc": "Provide token and expiration details for a sandbox terminal session" + }, + { + "name": "SandboxTerminalTokenSubject", + "kind": "type", + "signature": "type SandboxTerminalTokenSubject", + "doc": "Resolve the identity type used for sandbox terminal token subjects" + }, + { + "name": "SandboxTerminalWsMatch", + "kind": "interface", + "signature": "interface SandboxTerminalWsMatch", + "doc": "Define the structure for matching a sandbox terminal WebSocket with workspace and path details" + }, + { + "name": "sandboxToolBinDir", + "kind": "function", + "signature": "(options: SandboxToolPathOptions) => string", + "doc": "Resolve the binary directory path for a sandbox tool based on provided options" + }, + { + "name": "sandboxToolPath", + "kind": "function", + "signature": "(options: SandboxToolPathOptions & { toolName: string; }) => string", + "doc": "Resolve the file system path to a specified sandbox tool based on given options" + }, + { + "name": "SandboxToolPathOptions", + "kind": "interface", + "signature": "interface SandboxToolPathOptions", + "doc": "Define options for resolving sandbox tool paths including appName, baseDir, and binDir" + }, + { + "name": "sandboxToolRootDir", + "kind": "function", + "signature": "(options: SandboxToolPathOptions) => string", + "doc": "Resolve the root directory path for a sandbox tool based on provided options" + }, + { + "name": "SandboxToolSpec", + "kind": "interface", + "signature": "interface SandboxToolSpec", + "doc": "Define the specification for a sandbox tool including its name, content, and optional executability" + }, + { + "name": "SatisfiedBy", + "kind": "type", + "signature": "type SatisfiedBy", + "doc": "What kind of produced state can satisfy a requirement structurally." + }, + { + "name": "SatisfiedByRule", + "kind": "type", + "signature": "type SatisfiedByRule", + "doc": "A declarative rule for satisfying a requirement from workspace state." + }, + { + "name": "ScheduleFollowupArgs", + "kind": "interface", + "signature": "interface ScheduleFollowupArgs", + "doc": "Define arguments required to schedule a follow-up with optional priority" + }, + { + "name": "ScheduleFollowupResult", + "kind": "interface", + "signature": "interface ScheduleFollowupResult", + "doc": "Define the result structure for scheduling a follow-up with unique identification and due date" + }, + { + "name": "ScopedMcpServerEntryOptions", + "kind": "interface", + "signature": "interface ScopedMcpServerEntryOptions", + "doc": "Options for a per-document/scoped MCP channel entry (design-canvas, sequences, …)." + }, + { + "name": "ScopedTokenResult", + "kind": "interface", + "signature": "interface ScopedTokenResult", + "doc": "Represent a token with its expiration date and associated scope" + }, + { + "name": "SecretStore", + "kind": "interface", + "signature": "interface SecretStore", + "doc": "Define methods to create, update, retrieve, and delete secrets asynchronously" + }, + { + "name": "secretStoreFromClient", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig) => SecretStore", + "doc": "Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell" + }, + { + "name": "SecurityHeaderOptions", + "kind": "interface", + "signature": "interface SecurityHeaderOptions", + "doc": "Define options for configuring security-related HTTP headers including disclaimers and retention labels" + }, + { + "name": "serializeCookie", + "kind": "function", + "signature": "(value: string, opts: CookieOptions) => string", + "doc": "Serialize a Set-Cookie header value: `name=encodeURIComponent(value)` plus attributes in Path / HttpOnly / SameSite / Max-Age / Secure order." + }, + { + "name": "SetStepStatusPatch", + "kind": "interface", + "signature": "interface SetStepStatusPatch", + "doc": "Define a patch to update the status and optional metadata of a step in a process" + }, + { + "name": "SharedBillingState", + "kind": "interface", + "signature": "interface SharedBillingState", + "doc": "Define shared billing state including user ID, plan, balances, concurrency, and overage permission" + }, + { + "name": "shellQuote", + "kind": "function", + "signature": "(value: string) => string", + "doc": "Wraps a value in single quotes for `sh`, closing and reopening the quote around each embedded quote (`'` → `'\"'\"'`)." + }, + { + "name": "SidecarInteractionsConnection", + "kind": "interface", + "signature": "interface SidecarInteractionsConnection", + "doc": "Where and how to reach one session's interaction registry." + }, + { + "name": "SidecarInteractionsError", + "kind": "interface", + "signature": "interface SidecarInteractionsError", + "doc": "Describe error details including code, message, and upstream HTTP status for sidecar interactions" + }, + { + "name": "SidecarInteractionsResult", + "kind": "type", + "signature": "type SidecarInteractionsResult", + "doc": "Represent the outcome of sidecar interactions with success or error details" + }, + { + "name": "signObjectUrl", + "kind": "function", + "signature": "({ key, exp, secret }: SignObjectUrlArgs) => Promise", + "doc": "Mint a signed query string (`?key=…&exp=…&sig=…`) authorizing a download of `key` until `exp`." + }, + { + "name": "SignObjectUrlArgs", + "kind": "interface", + "signature": "interface SignObjectUrlArgs", + "doc": "Arguments to {@link signObjectUrl}." + }, + { + "name": "snapHarnessToModel", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Keep the harness when it can run `modelId`; else the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode." + }, + { + "name": "snapModelToHarness", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Keep `modelId` when the harness can run it; else the harness's best compatible catalog id (preferred patterns in order, highest version)." + }, + { + "name": "splitDeferredProfileFiles", + "kind": "function", + "signature": "(profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; }", + "doc": "Split profile files into inline deferred files and a lean profile without them" + }, + { + "name": "stablePlanReceipt", + "kind": "function", + "signature": "(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick[], answersByInteractionId: Readonly>) => Record Promise…", + "doc": "A single step's activity lane as its own FlowTrace — what a per-step drill-in renders." + }, + { + "name": "stepAgentActivity", + "kind": "function", + "signature": "(step: object) => StepAgentActivity[]", + "doc": "Re-validate an `agentActivity` lane that crossed a JSON boundary." + }, + { + "name": "StepAgentActivity", + "kind": "interface", + "signature": "interface StepAgentActivity", + "doc": "Canonical shape for the per-step agent-activity lane — the delegated runs (delegation MCP registry entries) a mission step spawned, journaled onto the step so a live UI can render \"what the agent is…" + }, + { + "name": "StepGateClassification", + "kind": "interface", + "signature": "interface StepGateClassification", + "doc": "Product classification of one step." + }, + { + "name": "stepGateProposalId", + "kind": "function", + "signature": "(missionId: string, stepId: string) => string", + "doc": "Deterministic proposal id for a step-classification gate." + }, + { + "name": "StepOutcome", + "kind": "type", + "signature": "type StepOutcome", + "doc": "Outcome of running a single step." + }, + { + "name": "StepSpanContext", + "kind": "interface", + "signature": "interface StepSpanContext", + "doc": "Define context information for a step span including trace, span, and parent span identifiers" + }, + { + "name": "StoppedSandboxResumeFailure", + "kind": "interface", + "signature": "interface StoppedSandboxResumeFailure", + "doc": "Describe the failure details when resuming a stopped sandbox instance" + }, + { + "name": "StoppedSandboxResumeRecovery", + "kind": "interface", + "signature": "interface StoppedSandboxResumeRecovery", + "doc": "Define the structure for resuming a stopped sandbox with replacement key and optional restore options" + }, + { + "name": "StorableHarnessPartKind", + "kind": "type", + "signature": "type StorableHarnessPartKind", + "doc": "Every canonical harness wire-part kind must be storable — compile-time guarantee that a new agent-interface part kind cannot silently fall out of the persisted vocabulary." + }, + { + "name": "StorageConfig", + "kind": "interface", + "signature": "interface StorageConfig", + "doc": "S3-compatible storage provider configuration (BYOS3 - Bring Your Own S3)." + }, + { + "name": "storeSecret", + "kind": "function", + "signature": "(store: SecretStore, name: string, value: string) => Promise>", + "doc": "Resolve storing a secret by creating or updating it in the given SecretStore" + }, + { + "name": "streamAppToolLoop", + "kind": "function", + "signature": "(opts: StreamToolLoopOptions) => AsyncGenerator, void, unknown>", + "doc": "Streaming bounded tool loop: yields each raw turn event (the caller maps + telemetries + re-emits it) and each executed `tool_result`; emits one `capped` if it stops for any non-completed reason with…" + }, + { + "name": "StreamAppToolLoopOptions", + "kind": "interface", + "signature": "interface StreamAppToolLoopOptions", + "doc": null + }, + { + "name": "StreamEvent", + "kind": "interface", + "signature": "interface StreamEvent", + "doc": "Define an event object carrying a type and optional JSON data payload" + }, + { + "name": "StreamLoopYield", + "kind": "type", + "signature": "type StreamLoopYield", + "doc": null + }, + { + "name": "streamSandboxPrompt", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO…", + "doc": "Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options" + }, + { + "name": "StreamSandboxPromptOptions", + "kind": "interface", + "signature": "interface StreamSandboxPromptOptions", + "doc": "Define options for configuring and controlling a streaming sandbox prompt session" + }, + { + "name": "SubmitProposalArgs", + "kind": "interface", + "signature": "interface SubmitProposalArgs", + "doc": "Define the arguments required to submit a proposal including type, title, description, and approval status" + }, + { + "name": "SubmitProposalResult", + "kind": "interface", + "signature": "interface SubmitProposalResult", + "doc": "Describe the result of submitting a proposal including deduplication and execution status" + }, + { + "name": "summarize", + "kind": "function", + "signature": "(values: number[]) => DistributionSummary", + "doc": "Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max" + }, + { + "name": "SurfaceKindDefinition", + "kind": "interface", + "signature": "interface SurfaceKindDefinition", + "doc": "One registered surface kind." + }, + { + "name": "SurfaceMcpServer", + "kind": "type", + "signature": "type SurfaceMcpServer", + "doc": "The only MCP entry shape an overlay may carry: the server-built bridge entry from ../tools/mcp (transport, url, headers, and capability token all assembled server-side)." + }, + { + "name": "SurfaceMergeBase", + "kind": "interface", + "signature": "interface SurfaceMergeBase", + "doc": "Base-profile slice the merge reads/writes." + }, + { + "name": "SurfaceOverlay", + "kind": "interface", + "signature": "interface SurfaceOverlay", + "doc": "What one surface contributes to the agent profile for a single turn." + }, + { + "name": "SurfacePermissionValue", + "kind": "type", + "signature": "type SurfacePermissionValue", + "doc": "Sandbox permission posture values, ranked deny > ask > allow for merging." + }, + { + "name": "SurfaceRegistry", + "kind": "interface", + "signature": "interface SurfaceRegistry", + "doc": "Resolve and build the overlay for a given surface kind within a turn context" + }, + { + "name": "syncSandboxMemberAdd", + "kind": "function", + "signature": "(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise>", + "doc": "Resolve adding a user with a specific role to a sandbox and return the operation outcome" + }, + { + "name": "syncSandboxMemberRemove", + "kind": "function", + "signature": "(box: SandboxInstance, userId: string) => Promise>", + "doc": "Remove a member from the sandbox while preserving their home directory and handle the outcome" + }, + { + "name": "syncSandboxMemberRole", + "kind": "function", + "signature": "(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise>", + "doc": "Synchronize a sandbox member's role by updating permissions based on the provided role mapping" + }, + { + "name": "TangleBillingEnforcementOptions", + "kind": "interface", + "signature": "interface TangleBillingEnforcementOptions", + "doc": "Define options for configuring billing enforcement environment variables and overrides" + }, + { + "name": "TangleExecutionEnvironment", + "kind": "type", + "signature": "type TangleExecutionEnvironment", + "doc": "Define the environment context for executing Tangle operations" + }, + { + "name": "TangleExecutionKeyError", + "kind": "class", + "signature": "class TangleExecutionKeyError", + "doc": "Represent execution key errors with specific codes and HTTP status information" + }, + { + "name": "TangleExecutionKeyErrorCode", + "kind": "type", + "signature": "type TangleExecutionKeyErrorCode", + "doc": "Define error codes for Tangle execution key issues related to API key and account connection" + }, + { + "name": "tangleExecutionKeyHttpError", + "kind": "function", + "signature": "(error: unknown) => TangleExecutionKeyHttpError | null", + "doc": "Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null" + }, + { + "name": "TangleExecutionKeyHttpError", + "kind": "interface", + "signature": "interface TangleExecutionKeyHttpError", + "doc": "Represent HTTP error response containing status, error message, and specific error code" + }, + { + "name": "TangleExecutionKeySource", + "kind": "type", + "signature": "type TangleExecutionKeySource", + "doc": "Resolve the source of the Tangle execution key as either local environment or user input" + }, + { + "name": "TangleModelConfig", + "kind": "interface", + "signature": "interface TangleModelConfig", + "doc": "Resolve the model config a Tangle agent's sandbox/runtime runs on." + }, + { + "name": "TaskGold", + "kind": "interface", + "signature": "interface TaskGold", + "doc": null + }, + { + "name": "TcloudKeyClient", + "kind": "interface", + "signature": "interface TcloudKeyClient", + "doc": "The subset of the `@tangle-network/tcloud` `TCloudClient` the provisioner uses — declared with METHOD syntax so the real client (whose `product` is a narrow union and whose budgets are `number | null…" + }, + { + "name": "terminalizeDanglingAssistantToolUpdates", + "kind": "function", + "signature": "(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[]", + "doc": "Finalizes, then folds each synthetic tool settlement back into `partMap` and returns just those updates — the shape a streaming loop needs to emit closing `message.part.updated` frames for tools the…" + }, + { + "name": "terminalizeDanglingToolPart", + "kind": "function", + "signature": "(part: JsonRecord) => JsonRecord", + "doc": "Closes a tool part left `running` when a stream ended abnormally: settles it as a terminal `error` and stamps `state.metadata.terminalized` so the synthetic settlement is distinguishable from a real…" + }, + { + "name": "terminalizeDanglingToolParts", + "kind": "function", + "signature": "(parts: JsonRecord[]) => JsonRecord[]", + "doc": "Resolve dangling tool parts into terminal forms within the given JSON records array" + }, + { + "name": "TerminalProxyIdentity", + "kind": "interface", + "signature": "interface TerminalProxyIdentity", + "doc": "Define identity details for a terminal proxy including user, workspace, and sandbox identifiers" + }, + { + "name": "terminalTokenFromRequest", + "kind": "function", + "signature": "(headers: Headers) => string | null", + "doc": "Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields" + }, + { + "name": "themeColor", + "kind": "function", + "signature": "(value: string) => string", + "doc": "Wrap a channel triple in `hsl()`; pass through values already in a color form." + }, + { + "name": "ThemeContractMiss", + "kind": "interface", + "signature": "interface ThemeContractMiss", + "doc": "Describe a missing theme contract variable and where it was referenced" + }, + { + "name": "ThemeContractOptions", + "kind": "interface", + "signature": "interface ThemeContractOptions", + "doc": "Define options for scanning source directories and CSS token files in a theme contract" + }, + { + "name": "ThemeContractResult", + "kind": "interface", + "signature": "interface ThemeContractResult", + "doc": "Describe the result of validating a theme contract including success status and missing items" + }, + { + "name": "themeToCssVars", + "kind": "function", + "signature": "(theme: AgentAppTheme) => Record", + "doc": "Map a theme to the full CSS-variable set (shadcn triples + canvas/sequences aliases + canvas surface)." + }, + { + "name": "threadTitleFromMessage", + "kind": "function", + "signature": "(message: string) => string", + "doc": "Thread titles come from the first message — keep the list scannable by storing only its first non-empty line, capped at 80 chars, never the whole multi-page prompt." + }, + { + "name": "TimedEvent", + "kind": "interface", + "signature": "interface TimedEvent", + "doc": "Represent a timed event with a timestamp and associated event data" + }, + { + "name": "timedEventsFromLines", + "kind": "function", + "signature": "(lines: string[]) => TimedEvent[]", + "doc": "Parse stored turn-event lines (JSON strings with `_t`) into TimedEvents." + }, + { + "name": "toChatMessageParts", + "kind": "function", + "signature": "(parts: Record[]) => ChatMessagePart[]", + "doc": "The typed projection at the `/stream` → `/chat-store` boundary." + }, + { + "name": "toLoopEvents", + "kind": "function", + "signature": "(chunks: AsyncIterable) => AsyncIterable", + "doc": "Map an OpenAI-compat streaming chunk iterator to `LoopEvent`s: each content delta → a `text` event; tool-call deltas are accumulated by index across chunks and emitted as one complete `tool_call` eve…" + }, + { + "name": "ToolAuthResult", + "kind": "type", + "signature": "type ToolAuthResult", + "doc": "Represent the result of tool authentication with success context or failure response" + }, + { + "name": "ToolCapability", + "kind": "interface", + "signature": "interface ToolCapability", + "doc": "One toggleable tool group in a product's capability registry." + }, + { + "name": "ToolHeaderNames", + "kind": "interface", + "signature": "interface ToolHeaderNames", + "doc": "Header names carrying the server-set per-turn context + the capability token." + }, + { + "name": "ToolInputError", + "kind": "class", + "signature": "class ToolInputError", + "doc": "A correctable bad-input error a tool handler throws; the HTTP layer maps it to a 4xx with the code, the runtime layer to a failed tool_result." + }, + { + "name": "ToolLoopEvent", + "kind": "type", + "signature": "type ToolLoopEvent", + "doc": null + }, + { + "name": "ToolLoopResult", + "kind": "interface", + "signature": "interface ToolLoopResult", + "doc": null + }, + { + "name": "ToolLoopStopReason", + "kind": "type", + "signature": "type ToolLoopStopReason", + "doc": "Why the loop stopped." + }, + { + "name": "traceEnv", + "kind": "function", + "signature": "(ctx: MissionTraceContext | StepSpanContext) => { TRACE_ID: string; PARENT_SPAN_ID: string; }", + "doc": "The env pair a delegation subprocess inherits — agent-runtime's `readTraceContextFromEnv` reads exactly these names." + }, + { + "name": "trimOrNull", + "kind": "function", + "signature": "(value: string | null | undefined) => string | null", + "doc": "Resolve a string by trimming whitespace or returning null if empty or undefined" + }, + { + "name": "TURN_EVENTS_MIGRATION_SQL", + "kind": "const", + "signature": "\"\\nCREATE TABLE IF NOT EXISTS turn_events (\\n turnId TEXT NOT NULL,\\n seq INTEGER NOT NULL,\\n event TEXT NOT NULL,\\n PR…", + "doc": "Schema for the D1 store — append to the product's migrations." + }, + { + "name": "TURN_STATUS_SCOPE_MIGRATION_SQL", + "kind": "const", + "signature": "\"ALTER TABLE turn_status ADD COLUMN scopeId TEXT;\"", + "doc": "For deployments whose `turn_status` table predates `scopeId`/`listRunning` — run once to add the column (the CREATE above already includes it for new deployments)." + }, + { + "name": "TurnEventStore", + "kind": "interface", + "signature": "interface TurnEventStore", + "doc": "Manage and query turn events and their lifecycle statuses within a scoped event store" + }, + { + "name": "TurnStatus", + "kind": "type", + "signature": "type TurnStatus", + "doc": "Resumable chat turns — the router-path answer to \"streams resume on disconnect\" (issue #27)." + }, + { + "name": "upsertDurableInteractionAsk", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde…", + "doc": "Apply an ask event." + }, + { + "name": "validateInteractionAnswerBody", + "kind": "function", + "signature": "(body: Record) => InteractionAnswerBodyValidation", + "doc": "Validates the client POST body: `{ id, outcome, data?" + }, + { + "name": "VaultKv", + "kind": "type", + "signature": "type VaultKv", + "doc": "The KV-backed vault." + }, + { + "name": "verifyCapabilityToken", + "kind": "function", + "signature": "(userId: string, token: string, opts: CapabilityTokenOptions) => Promise", + "doc": "Verify a capability token against `userId`." + }, + { + "name": "verifyCompletion", + "kind": "function", + "signature": "(gold: TaskGold, state: ProducedState, checkCorrectness: CorrectnessChecker) => Promise", + "doc": "Verify whether a run completed the task." + }, + { + "name": "verifyExpiringCapabilityToken", + "kind": "function", + "signature": "(subject: string, token: string, opts: CapabilityTokenOptions & { now?: (() => number) | undefined; }) => Promise Promise", + "doc": "Verify a signed download request." + }, + { + "name": "VerifyObjectUrlResult", + "kind": "type", + "signature": "type VerifyObjectUrlResult", + "doc": "Result of {@link verifyObjectUrl}: the canonical key on success, nothing distinguishing on failure (so a rejection leaks no detail)." + }, + { + "name": "verifySandboxTerminalToken", + "kind": "function", + "signature": "(token: string, expected: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise", + "doc": "Verify the validity of a sandbox terminal token against the expected identity and options" + }, + { + "name": "verifyTerminalProxyToken", + "kind": "function", + "signature": "(secret: string, token: string, expected: TerminalProxyIdentity, now?: () => number) => Promise", + "doc": "Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp" + }, + { + "name": "VideoCaption", + "kind": "interface", + "signature": "interface VideoCaption", + "doc": "Define video caption segments with start and end times and associated text content" + }, + { + "name": "VideoContent", + "kind": "interface", + "signature": "interface VideoContent", + "doc": "Describe video content including duration, scenes, optional audio, captions, and rendered URL" + }, + { + "name": "VideoContentSchema", + "kind": "const", + "signature": "ZodObject<{ durationSeconds: ZodNumber; scenes: ZodArray string", + "doc": "Deterministic proposal id for an external-action volume-cap override." + }, + { + "name": "weightedComposite", + "kind": "function", + "signature": "(input: WeightedCompositeInput) => WeightedCompositeResult", + "doc": "Weighted composite over judge dimensions: `Σ(score_d · w_d) / Σ(w_d)` across the weighted dimensions." + }, + { + "name": "WithAgentActivity", + "kind": "type", + "signature": "type WithAgentActivity", + "doc": "Step state extended with the activity lane a loader/seed route attaches." + }, + { + "name": "WorkspaceKeyManager", + "kind": "interface", + "signature": "interface WorkspaceKeyManager", + "doc": "Manage workspace keys by ensuring, rotating, and tracking usage of active child-key secrets" + }, + { + "name": "WorkspaceKeyManagerOptions", + "kind": "interface", + "signature": "interface WorkspaceKeyManagerOptions", + "doc": "Define configuration options for managing workspace keys including provisioning, storage, and cryptography" + }, + { + "name": "WorkspaceKeyRecord", + "kind": "interface", + "signature": "interface WorkspaceKeyRecord", + "doc": "A stored child-key record (the app's row, shape-normalized)." + }, + { + "name": "WorkspaceKeyStore", + "kind": "interface", + "signature": "interface WorkspaceKeyStore", + "doc": "Persistence seam — the product implements this against its own D1 table." + }, + { + "name": "WorkspaceModelKeyUsage", + "kind": "interface", + "signature": "interface WorkspaceModelKeyUsage", + "doc": "Describe usage and budget details for a workspace model key including expiration and exhaustion status" + }, + { + "name": "WorkspaceSandboxConnectionArgs", + "kind": "interface", + "signature": "interface WorkspaceSandboxConnectionArgs", + "doc": "Define arguments required to establish a workspace sandbox connection" + }, + { + "name": "WorkspaceSandboxConnectionHandlerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxConnectionHandlerOptions", + "doc": "Define options to handle workspace sandbox connections with user authentication and access control" + }, + { + "name": "WorkspaceSandboxEnsureContext", + "kind": "interface", + "signature": "interface WorkspaceSandboxEnsureContext", + "doc": "Define the context containing workspace and user identifiers for sandbox environment operations" + }, + { + "name": "WorkspaceSandboxInstanceLike", + "kind": "interface", + "signature": "interface WorkspaceSandboxInstanceLike", + "doc": "Define the shape of a workspace sandbox instance including its connection details and status" + }, + { + "name": "WorkspaceSandboxManager", + "kind": "interface", + "signature": "interface WorkspaceSandboxManager", + "doc": "Manage workspace sandboxes by ensuring their creation and retrieval for specified users" + }, + { + "name": "WorkspaceSandboxManagerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxManagerOptions", + "doc": "Define configuration options for managing and interacting with workspace sandboxes" + }, + { + "name": "WorkspaceSandboxRuntimeProxyArgs", + "kind": "interface", + "signature": "interface WorkspaceSandboxRuntimeProxyArgs", + "doc": "Define arguments for proxying runtime requests within a workspace sandbox environment" + }, + { + "name": "WorkspaceSandboxRuntimeProxyHandlerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxRuntimeProxyHandlerOptions", + "doc": "Define options for handling workspace sandbox runtime proxy including user, access, credentials, and connection retrieval" + }, + { + "name": "WorkspaceSandboxTerminalUpgradeHandlerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxTerminalUpgradeHandlerOptions", + "doc": "Define options to handle user authentication, workspace access, and sandbox API credential retrieval" + }, + { + "name": "WriteProfileFilesOptions", + "kind": "interface", + "signature": "interface WriteProfileFilesOptions", + "doc": "Define options to control execution timeout, pacing, and retry behavior when writing profile files" + }, + { + "name": "writeProfileFilesToBox", + "kind": "function", + "signature": "(box: SandboxInstance, files: AgentProfileFileMount[], options?: WriteProfileFilesOptions) => Promise>", + "doc": "Write profile files to a sandbox with pacing, retries, and optional execution timeout handling" + } + ] + }, + { + "id": "./app-auth", + "source": "src/app-auth/index.ts", + "dependsOn": [ + "platform" + ], + "error": null, + "exports": [ + { + "name": "AppAuth", + "kind": "interface", + "signature": "interface AppAuth", + "doc": "Define authentication guard with session retrieval and optional SSO handlers for app requests" + }, + { + "name": "AppAuthConfig", + "kind": "interface", + "signature": "interface AppAuthConfig", + "doc": "Define configuration settings for app authentication including app name, base URL, secrets, and trusted origins" + }, + { + "name": "AppAuthEmailClient", + "kind": "interface", + "signature": "interface AppAuthEmailClient", + "doc": "Structural slice of a Resend-style client — no `resend` import." + }, + { + "name": "AppAuthEmailConfig", + "kind": "interface", + "signature": "interface AppAuthEmailConfig", + "doc": "Define email configuration for app authentication including client, sender, verification, and warning options" + }, + { + "name": "AppAuthInstance", + "kind": "type", + "signature": "type AppAuthInstance", + "doc": "The configured better-auth instance, typed at better-auth's base surface (`handler`, `api`, `$context`, `$Infer`)." + }, + { + "name": "AppAuthSchema", + "kind": "interface", + "signature": "interface AppAuthSchema", + "doc": "Define the structure for application authentication data including users, sessions, accounts, and verifications" + }, + { + "name": "AppAuthSession", + "kind": "interface", + "signature": "interface AppAuthSession", + "doc": "What `getSession`/guards resolve: better-auth's base session + user rows." + }, + { + "name": "AppAuthSocialConfig", + "kind": "interface", + "signature": "interface AppAuthSocialConfig", + "doc": "Define social authentication configuration options for GitHub and Google providers" + }, + { + "name": "AppAuthSocialProviderConfig", + "kind": "interface", + "signature": "interface AppAuthSocialProviderConfig", + "doc": "Env-shaped: pass the env vars straight through; the provider is registered only when BOTH values are non-empty, so unset env disables it." + }, + { + "name": "AppAuthSsoConfig", + "kind": "interface", + "signature": "interface AppAuthSsoConfig", + "doc": "Cross-site Tangle SSO wiring." + }, + { + "name": "createAppAuth", + "kind": "function", + "signature": "(config: AppAuthConfig) => AppAuth", + "doc": "Build the product's better-auth instance plus the request-boundary helpers: `getSession` (Request → session|null), the `createAuthGuard` quartet (`requireUser` 302, `requireApiUser` JSON 401, `requir…" + } + ] + }, + { + "id": "./assets", + "source": "src/assets/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "ApprovalEvent", + "kind": "interface", + "signature": "interface ApprovalEvent", + "doc": "Describe an approval event with action details, user info, and optional edited fields" + }, + { + "name": "ApprovalEventSchema", + "kind": "const", + "signature": "ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEnum<{ scheduled: \"scheduled\"; approved:…", + "doc": "Validate approval event data including asset, action, user, timestamp, and optional fields" + }, + { + "name": "AssetContentMap", + "kind": "type", + "signature": "type AssetContentMap", + "doc": "Map asset keys to their corresponding content types for various media and copy formats" + }, + { + "name": "AssetFormat", + "kind": "type", + "signature": "type AssetFormat", + "doc": "Define valid asset format strings for various media and copy types" + }, + { + "name": "AssetSpec", + "kind": "interface", + "signature": "interface AssetSpec", + "doc": "Define the structure and metadata for an asset including its format, brand, content, and status" + }, + { + "name": "AssetStatus", + "kind": "type", + "signature": "type AssetStatus", + "doc": "Define possible states representing the lifecycle status of an asset" + }, + { + "name": "AssetVariant", + "kind": "interface", + "signature": "interface AssetVariant", + "doc": "Describe an asset variant with identification, approval status, and edit history details" + }, + { + "name": "BrandTokens", + "kind": "interface", + "signature": "interface BrandTokens", + "doc": "Define brand identity tokens including colors, font, logo, business name, and voice" + }, + { + "name": "BrandTokensSchema", + "kind": "const", + "signature": "ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodString; fontFamily: ZodString; logoUrl: ZodO…", + "doc": "Validate brand token properties including colors, font, logo URL, business name, and voice" + }, + { + "name": "ConversionMetrics", + "kind": "interface", + "signature": "interface ConversionMetrics", + "doc": "Define metrics for tracking impressions, clicks, conversions, and related rates" + }, + { + "name": "ConversionMetricsSchema", + "kind": "const", + "signature": "ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; ctr: ZodNumber; cvr: ZodNumber; }, $stri…", + "doc": "Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields" + }, + { + "name": "CopyContent", + "kind": "interface", + "signature": "interface CopyContent", + "doc": "Define the structure for content with headline, body, platform, and optional hashtags and character count" + }, + { + "name": "CopyContentSchema", + "kind": "const", + "signature": "ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional>; platform: ZodEnum<{ x: \"x…", + "doc": "Validate and parse copy content with headline, body, optional hashtags, platform, and character count" + }, + { + "name": "CopyPlatform", + "kind": "type", + "signature": "type CopyPlatform", + "doc": "Define platform options for copy content across various social media and communication channels" + }, + { + "name": "EmailBodySection", + "kind": "interface", + "signature": "interface EmailBodySection", + "doc": "Define the structure for the body section of an email containing plain text content" + }, + { + "name": "EmailContent", + "kind": "interface", + "signature": "interface EmailContent", + "doc": "Define the structure for email content including subject, optional preheader, and sections" + }, + { + "name": "EmailContentSchema", + "kind": "const", + "signature": "ZodObject<{ subject: ZodString; preheader: ZodOptional; sections: ZodArray; valu…", + "doc": "Validate image content with an array of one or more slides containing background details" + }, + { + "name": "ImageImageLayer", + "kind": "interface", + "signature": "interface ImageImageLayer", + "doc": "Define properties for an image layer including position, size, URL, and optional opacity" + }, + { + "name": "ImageLayer", + "kind": "type", + "signature": "type ImageLayer", + "doc": "Resolve a union type representing different kinds of image layers" + }, + { + "name": "ImageLayerType", + "kind": "type", + "signature": "type ImageLayerType", + "doc": "Define image layer categories for text, image, shape, or logo elements" + }, + { + "name": "ImageLogoLayer", + "kind": "interface", + "signature": "interface ImageLogoLayer", + "doc": "Define properties for positioning and sizing a logo image layer in a layout" + }, + { + "name": "ImageShapeLayer", + "kind": "interface", + "signature": "interface ImageShapeLayer", + "doc": "Define properties for a shape layer representing rectangular or circular image elements" + }, + { + "name": "ImageSlide", + "kind": "interface", + "signature": "interface ImageSlide", + "doc": "Define the structure for an image slide with a background and multiple layers" + }, + { + "name": "ImageTextLayer", + "kind": "interface", + "signature": "interface ImageTextLayer", + "doc": "Define properties for a text layer with position, style, and alignment options in an image" + }, + { + "name": "parseAssetSpec", + "kind": "function", + "signature": "(raw: unknown) => AssetSpec", + "doc": "Validates an unknown value as an AssetSpec, including format-specific content validation." + }, + { + "name": "safeParseAssetSpec", + "kind": "function", + "signature": "(raw: unknown) => AssetSpec | null", + "doc": "Safe parse — returns null instead of throwing." + }, + { + "name": "VideoCaption", + "kind": "interface", + "signature": "interface VideoCaption", + "doc": "Define video caption segments with start and end times and associated text content" + }, + { + "name": "VideoContent", + "kind": "interface", + "signature": "interface VideoContent", + "doc": "Describe video content including duration, scenes, optional audio, captions, and rendered URL" + }, + { + "name": "VideoContentSchema", + "kind": "const", + "signature": "ZodObject<{ durationSeconds: ZodNumber; scenes: ZodArray AdaptedTranscript", + "doc": "Fold the transcript view into web-react `ChatUiMessage[]`: each user message is 1:1; the assistant/`tool`/`status` messages between two user turns collapse into one assistant message whose ordered `s…" + }, + { + "name": "AssistantChat", + "kind": "interface", + "signature": "interface AssistantChat", + "doc": "Define the structure and behavior of an assistant chat session with state, model selection, and message handling" + }, + { + "name": "AssistantClient", + "kind": "interface", + "signature": "interface AssistantClient", + "doc": "The assistant network surface, bound to one host's transport config." + }, + { + "name": "AssistantClientConfig", + "kind": "interface", + "signature": "interface AssistantClientConfig", + "doc": "Host-supplied transport configuration for {@link createAssistantClient}." + }, + { + "name": "AssistantClientInputError", + "kind": "class", + "signature": "class AssistantClientInputError", + "doc": "Represent invalid client input errors with a specific code INVALID_REQUEST" + }, + { + "name": "AssistantClientProvider", + "kind": "function", + "signature": "({ client, children, }: { client: AssistantClient; children: ReactNode; }) => Element", + "doc": null + }, + { + "name": "AssistantDeliveryMode", + "kind": "type", + "signature": "type AssistantDeliveryMode", + "doc": "Define delivery modes for assistant interaction as either steering or queue" + }, + { + "name": "AssistantDock", + "kind": "function", + "signature": "({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement…", + "doc": null + }, + { + "name": "AssistantDockProps", + "kind": "interface", + "signature": "interface AssistantDockProps", + "doc": null + }, + { + "name": "assistantIsThinking", + "kind": "function", + "signature": "(state: AssistantState) => boolean", + "doc": "True while a turn is streaming but the model hasn't emitted its first answer token yet — drives the \"thinking\" affordance so a reasoning gap reads as working, not a frozen panel." + }, + { + "name": "AssistantLauncher", + "kind": "interface", + "signature": "interface AssistantLauncher", + "doc": null + }, + { + "name": "AssistantLauncherProvider", + "kind": "function", + "signature": "({ children, }: { children: ReactNode; }) => Element", + "doc": null + }, + { + "name": "AssistantModelOption", + "kind": "interface", + "signature": "interface AssistantModelOption", + "doc": "Define options for an assistant model including identifier, label, pricing, and context tokens" + }, + { + "name": "AssistantModels", + "kind": "interface", + "signature": "interface AssistantModels", + "doc": "Define the structure for assistant model options including a default model slug and available models" + }, + { + "name": "AssistantModelsResult", + "kind": "interface", + "signature": "interface AssistantModelsResult", + "doc": "Outcome of a model-list fetch." + }, + { + "name": "AssistantPanel", + "kind": "function", + "signature": "({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRende…", + "doc": null + }, + { + "name": "AssistantPanelProps", + "kind": "interface", + "signature": "interface AssistantPanelProps", + "doc": null + }, + { + "name": "AssistantSendOptions", + "kind": "interface", + "signature": "interface AssistantSendOptions", + "doc": "Define options for configuring how the assistant sends messages" + }, + { + "name": "AssistantStreamEvent", + "kind": "type", + "signature": "type AssistantStreamEvent", + "doc": "Discriminated union the stream reader hands to the reducer." + }, + { + "name": "AssistantThreads", + "kind": "interface", + "signature": "interface AssistantThreads", + "doc": "Manage and interact with a list of assistant threads including loading, refreshing, and removing threads" + }, + { + "name": "AssistantThreadSummary", + "kind": "interface", + "signature": "interface AssistantThreadSummary", + "doc": "One past conversation in the history switcher." + }, + { + "name": "AssistantTranscript", + "kind": "function", + "signature": "({ view, renderMarkdown, toolRenderers, renderConfirmedResult, emptyState, }: AssistantTranscriptProps) => Element", + "doc": "Render the assistant conversation with web-react's `ChatMessages`." + }, + { + "name": "AssistantTranscriptProps", + "kind": "interface", + "signature": "interface AssistantTranscriptProps", + "doc": null + }, + { + "name": "AssistantTranscriptView", + "kind": "interface", + "signature": "interface AssistantTranscriptView", + "doc": "The transcript slice handed to a host-supplied `renderTranscript` (see {@link AssistantPanelProps })." + }, + { + "name": "ChatMessage", + "kind": "interface", + "signature": "interface ChatMessage", + "doc": "Define the structure and properties of a chat message including optional tool activity details" + }, + { + "name": "ChatRequest", + "kind": "interface", + "signature": "interface ChatRequest", + "doc": "Request body for `POST /api/v1/assistant/chat`." + }, + { + "name": "ChatRole", + "kind": "type", + "signature": "type ChatRole", + "doc": "A `tool` message is the inline activity chip for a read-only tool the agent ran during a turn (e.g." + }, + { + "name": "ConfirmedResult", + "kind": "interface", + "signature": "interface ConfirmedResult", + "doc": "The result of a CONFIRMED mutating tool, retained on the resolving `status` message so a host can render it prominently (e.g." + }, + { + "name": "ConfirmResult", + "kind": "type", + "signature": "type ConfirmResult", + "doc": "Represent the outcome of a confirmation process with success or failure details" + }, + { + "name": "ConnectionRequirement", + "kind": "interface", + "signature": "interface ConnectionRequirement", + "doc": "A connection a proposed workflow references, and whether the user has it connected right now." + }, + { + "name": "ConnectionRequirementKind", + "kind": "type", + "signature": "type ConnectionRequirementKind", + "doc": "What kind of connection a requirement names — drives the card's label and connect target." + }, + { + "name": "ConnectRequirementResult", + "kind": "interface", + "signature": "interface ConnectRequirementResult", + "doc": "Outcome of a host-driven, in-place connect for a single proposal requirement (see {@link AssistantDockProps.onConnectRequirement })." + }, + { + "name": "createAssistantClient", + "kind": "function", + "signature": "(config: AssistantClientConfig) => AssistantClient", + "doc": "Build an assistant client bound to one host's transport." + }, + { + "name": "DeltaEventData", + "kind": "interface", + "signature": "interface DeltaEventData", + "doc": "Define data structure representing a delta event with associated text content" + }, + { + "name": "DoneEventData", + "kind": "interface", + "signature": "interface DoneEventData", + "doc": "Describe the data emitted when a process turn completes including status and optional flags" + }, + { + "name": "ErrorEventData", + "kind": "interface", + "signature": "interface ErrorEventData", + "doc": "Describe error event data including code and message fields" + }, + { + "name": "PendingProposal", + "kind": "interface", + "signature": "interface PendingProposal", + "doc": "A mutating action the assistant proposed, awaiting the user's confirmation." + }, + { + "name": "ProposalCard", + "kind": "function", + "signature": "({ proposal, confirming, onConfirm, onCancel, navigate, onConnect, renderGraph, renderProviderIcon, }: ProposalCardProp…", + "doc": null + }, + { + "name": "ProposalCardProps", + "kind": "interface", + "signature": "interface ProposalCardProps", + "doc": null + }, + { + "name": "ReasoningEventData", + "kind": "interface", + "signature": "interface ReasoningEventData", + "doc": "A chunk of the model's reasoning/thinking, streamed BEFORE the answer for reasoning models." + }, + { + "name": "ThreadEventData", + "kind": "interface", + "signature": "interface ThreadEventData", + "doc": "Describe the structure of data representing a thread event with optional model information" + }, + { + "name": "ThreadHistoryResult", + "kind": "type", + "signature": "type ThreadHistoryResult", + "doc": "Outcome of a thread-history restore." + }, + { + "name": "ToolActivityStatus", + "kind": "type", + "signature": "type ToolActivityStatus", + "doc": "Live status of a tool-activity chip." + }, + { + "name": "ToolCallEventData", + "kind": "interface", + "signature": "interface ToolCallEventData", + "doc": "Emitted when a read-only tool STARTS running, before its result." + }, + { + "name": "ToolOutcome", + "kind": "type", + "signature": "type ToolOutcome", + "doc": "The outcome of a finished read-only tool, retained on the chip so a renderer can show the result body (not just the name + status)." + }, + { + "name": "ToolProposalEventData", + "kind": "interface", + "signature": "interface ToolProposalEventData", + "doc": "Describe the data structure for events proposing tool usage with optional integration requirements" + }, + { + "name": "ToolResultEventData", + "kind": "interface", + "signature": "interface ToolResultEventData", + "doc": "Describe event data emitted after a tool execution completes with success or error details" + }, + { + "name": "UsageEventData", + "kind": "interface", + "signature": "interface UsageEventData", + "doc": "Describe usage event data including tokens, cost, balance, duration, and replay status" + }, + { + "name": "UsageInfo", + "kind": "interface", + "signature": "interface UsageInfo", + "doc": "Describe usage cost, balance, token counts, duration, and replay status for a settled turn" + }, + { + "name": "useAssistantChat", + "kind": "function", + "signature": "(userId: string | null, options?: UseAssistantChatOptions | undefined) => AssistantChat", + "doc": "Manage assistant chat state and interactions for a given user ID with optional configurations" + }, + { + "name": "UseAssistantChatOptions", + "kind": "interface", + "signature": "interface UseAssistantChatOptions", + "doc": "Host integration callbacks for {@link useAssistantChat}." + }, + { + "name": "useAssistantClient", + "kind": "function", + "signature": "() => AssistantClient", + "doc": "The assistant client for the current host." + }, + { + "name": "useAssistantLauncher", + "kind": "function", + "signature": "() => AssistantLauncher", + "doc": null + }, + { + "name": "useAssistantModels", + "kind": "function", + "signature": "() => AssistantModels", + "doc": "Resolve and return the current assistant models from the per-client cache with immediate client swap updates" + }, + { + "name": "useAssistantThreads", + "kind": "function", + "signature": "(userId: string | null) => AssistantThreads", + "doc": "Resolve and manage assistant threads state for a given user including pending deletions and refresh logic" + } + ] + }, + { + "id": "./billing", + "source": "src/billing/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "createPlatformBalanceManager", + "kind": "function", + "signature": "(opts: PlatformBalanceManagerOptions) => PlatformBalanceManager", + "doc": "Create a platform balance manager to handle user plan limits and state based on provided options" + }, + { + "name": "createTcloudKeyProvisioner", + "kind": "function", + "signature": "(client: TcloudKeyClient) => KeyProvisioner", + "doc": "Adapt the tcloud SDK client to {@link KeyProvisioner} — the typed seam that replaces the `as unknown as KeyProvisioner` cast every consumer otherwise repeats." + }, + { + "name": "createWorkspaceKeyManager", + "kind": "function", + "signature": "(opts: WorkspaceKeyManagerOptions) => WorkspaceKeyManager", + "doc": "Create a workspace key manager that handles key provisioning and budget tracking" + }, + { + "name": "KeyCrypto", + "kind": "interface", + "signature": "interface KeyCrypto", + "doc": "Secret encryption seam (the app's at-rest crypto)." + }, + { + "name": "KeyProvisioner", + "kind": "interface", + "signature": "interface KeyProvisioner", + "doc": "The key-provisioning operations the key manager needs." + }, + { + "name": "PlanLimit", + "kind": "interface", + "signature": "interface PlanLimit", + "doc": "Plan limits — a PARAMETER per product (dollar allowance, concurrency, overage policy)." + }, + { + "name": "PlatformBalanceInfo", + "kind": "interface", + "signature": "interface PlatformBalanceInfo", + "doc": "Spendable balance for a platform user." + }, + { + "name": "PlatformBalanceManager", + "kind": "interface", + "signature": "interface PlatformBalanceManager", + "doc": "Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking" + }, + { + "name": "PlatformBalanceManagerOptions", + "kind": "interface", + "signature": "interface PlatformBalanceManagerOptions", + "doc": "Define configuration options for managing platform balance based on billing plans" + }, + { + "name": "PlatformBillingClient", + "kind": "interface", + "signature": "interface PlatformBillingClient", + "doc": "The platform billing transport — the product wires these to id.tangle.tools (or any balance backend)." + }, + { + "name": "PlatformIdentity", + "kind": "interface", + "signature": "interface PlatformIdentity", + "doc": "A user's resolved platform identity (from the app's SSO account store)." + }, + { + "name": "PlatformProductUsage", + "kind": "interface", + "signature": "interface PlatformProductUsage", + "doc": "Per-product spend aggregate." + }, + { + "name": "SharedBillingState", + "kind": "interface", + "signature": "interface SharedBillingState", + "doc": "Define shared billing state including user ID, plan, balances, concurrency, and overage permission" + }, + { + "name": "TcloudKeyClient", + "kind": "interface", + "signature": "interface TcloudKeyClient", + "doc": "The subset of the `@tangle-network/tcloud` `TCloudClient` the provisioner uses — declared with METHOD syntax so the real client (whose `product` is a narrow union and whose budgets are `number | null…" + }, + { + "name": "WorkspaceKeyManager", + "kind": "interface", + "signature": "interface WorkspaceKeyManager", + "doc": "Manage workspace keys by ensuring, rotating, and tracking usage of active child-key secrets" + }, + { + "name": "WorkspaceKeyManagerOptions", + "kind": "interface", + "signature": "interface WorkspaceKeyManagerOptions", + "doc": "Define configuration options for managing workspace keys including provisioning, storage, and cryptography" + }, + { + "name": "WorkspaceKeyRecord", + "kind": "interface", + "signature": "interface WorkspaceKeyRecord", + "doc": "A stored child-key record (the app's row, shape-normalized)." + }, + { + "name": "WorkspaceKeyStore", + "kind": "interface", + "signature": "interface WorkspaceKeyStore", + "doc": "Persistence seam — the product implements this against its own D1 table." + }, + { + "name": "WorkspaceModelKeyUsage", + "kind": "interface", + "signature": "interface WorkspaceModelKeyUsage", + "doc": "Describe usage and budget details for a workspace model key including expiration and exhaustion status" + } + ] + }, + { + "id": "./brand", + "source": "src/brand/index.tsx", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "BrandHeader", + "kind": "function", + "signature": "({ title, children, className }: BrandHeaderProps) => Element", + "doc": "Shared app-shell header: icon-only Tangle knot + optional product title on the left, caller-supplied nav/actions on the right." + }, + { + "name": "BrandHeaderProps", + "kind": "interface", + "signature": "interface BrandHeaderProps", + "doc": "Define properties for a brand header including optional title, children, and CSS class name" + }, + { + "name": "Logo", + "kind": "function", + "signature": "({ variant, size, className, iconOnly }: LogoProps) => Element", + "doc": "Full Tangle lockup (knot + wordmark) or, with `iconOnly`, just the knot." + }, + { + "name": "LogoProps", + "kind": "interface", + "signature": "interface LogoProps", + "doc": "Define properties to customize the logo variant, size, style, and icon display options" + }, + { + "name": "TangleKnot", + "kind": "function", + "signature": "({ size, className }: { size?: number | undefined; className?: string | undefined; }) => Element", + "doc": "Icon-only Tangle knot, brand gradient, theme-independent." + } + ] + }, + { + "id": "./brand-extraction", + "source": "src/brand-extraction/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "BrandColor", + "kind": "interface", + "signature": "interface BrandColor", + "doc": "A color extracted from the page, with where it was seen." + }, + { + "name": "BrandExtractionResult", + "kind": "type", + "signature": "type BrandExtractionResult", + "doc": "Typed outcome." + }, + { + "name": "BrandFont", + "kind": "interface", + "signature": "interface BrandFont", + "doc": "A font-family discovered in CSS, with role inference." + }, + { + "name": "BrandImage", + "kind": "interface", + "signature": "interface BrandImage", + "doc": "A prominent product / hero image candidate (not a logo)." + }, + { + "name": "BrandKit", + "kind": "interface", + "signature": "interface BrandKit", + "doc": "The full extracted kit." + }, + { + "name": "BrandLogoCandidate", + "kind": "interface", + "signature": "interface BrandLogoCandidate", + "doc": "A logo / brand-mark candidate discovered on a page." + }, + { + "name": "decideBrandKit", + "kind": "function", + "signature": "(kit: BrandKit) => DecidedBrandKit", + "doc": "Collapse a raw BrandKit into decided roles — the shape a product persists." + }, + { + "name": "DecidedBrandKit", + "kind": "interface", + "signature": "interface DecidedBrandKit", + "doc": "Everything a confirmation step needs from a kit, with roles decided." + }, + { + "name": "DecidedFonts", + "kind": "interface", + "signature": "interface DecidedFonts", + "doc": "Define font selections for display and body text with optional BrandFont properties" + }, + { + "name": "DecidedPalette", + "kind": "interface", + "signature": "interface DecidedPalette", + "doc": "Define a color palette with background, surface, text, and accent colors for UI elements" + }, + { + "name": "decideFonts", + "kind": "function", + "signature": "(fonts: BrandFont[]) => DecidedFonts", + "doc": "Pick a display and body font from the ranked list." + }, + { + "name": "decidePalette", + "kind": "function", + "signature": "(palette: BrandColor[]) => DecidedPalette", + "doc": "Assign palette roles from the ranked colors." + }, + { + "name": "extractBrandKit", + "kind": "function", + "signature": "(url: string, options?: ExtractBrandKitOptions) => Promise", + "doc": "Fetch a website (or use supplied HTML) and extract its BrandKit." + }, + { + "name": "ExtractBrandKitOptions", + "kind": "interface", + "signature": "interface ExtractBrandKitOptions", + "doc": "Define options for extracting brand kit data including HTML input, fetch method, timeout, and list limits" + }, + { + "name": "FetchLike", + "kind": "type", + "signature": "type FetchLike", + "doc": "Fetch boundary, injectable so callers (Workers, Node, tests) supply their own fetch and so tests can run fully offline against fixture HTML." + }, + { + "name": "luminance", + "kind": "function", + "signature": "(hex: string) => number", + "doc": "Relative luminance (0..1) of an #rrggbb(aa) hex — for light/dark sorting." + }, + { + "name": "normalizeColor", + "kind": "function", + "signature": "(raw: string) => string | null", + "doc": "Normalize any CSS color literal to #rrggbb / #rrggbbaa hex, or null." + }, + { + "name": "normalizeSiteUrl", + "kind": "function", + "signature": "(raw: string) => string | null", + "doc": "Normalize a user-supplied site URL: add https:// when scheme-less, validate." + }, + { + "name": "parseBrandKit", + "kind": "function", + "signature": "(html: string, sourceUrl: string, maxPerList?: number) => BrandKit", + "doc": "Parse already-fetched HTML into a BrandKit." + } + ] + }, + { + "id": "./catalog", + "source": "src/catalog/index.ts", + "dependsOn": [ + "runtime" + ], + "error": null, + "exports": [ + { + "name": "buildCatalog", + "kind": "function", + "signature": "(raw: RouterModel[], opts?: { preferredDefault?: string | undefined; } | undefined) => ModelCatalog", + "doc": "Pure catalogue pipeline." + }, + { + "name": "CatalogModel", + "kind": "interface", + "signature": "interface CatalogModel", + "doc": "Define the structure and capabilities of a catalog item with optional pricing and feature flags" + }, + { + "name": "fetchModelCatalog", + "kind": "function", + "signature": "(cfg: { baseUrl: string; apiKey: string; preferredDefault?: string | undefined; }) => Promise", + "doc": "Fetch the router model list and build the catalogue, with an in-isolate cache (TTL 5 min)." + }, + { + "name": "ModelCatalog", + "kind": "interface", + "signature": "interface ModelCatalog", + "doc": "Define a catalog containing models with a default ID and fetch timestamp" + }, + { + "name": "normalizeModelId", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Strip provider prefix, :free suffix, and trailing date stamps." + }, + { + "name": "RouterModel", + "kind": "interface", + "signature": "interface RouterModel", + "doc": "Model catalogue — computed live from the Tangle Router, never hand-curated." + } + ] + }, + { + "id": "./chat-routes", + "source": "src/chat-routes/index.ts", + "dependsOn": [ + "chat-store", + "interactions", + "plans", + "sandbox", + "stream", + "web" + ], + "error": null, + "exports": [ + { + "name": "ALLOWED_ATTACHMENT_SNIFFED_MIMES", + "kind": "const", + "signature": "ReadonlySet", + "doc": "Sniffed-mime counterpart of `ATTACHMENT_ACCEPT`: the binary formats `sniffBinary` can identify from magic bytes among the accepted types." + }, + { + "name": "assertPromptPartsWithinCap", + "kind": "function", + "signature": "(parts: ChatTurnPartInput[], maxBytes?: number) => void", + "doc": "Throws `ChatTurnInputError` (413) when the parts' inline payload would blow the gateway cap." + }, + { + "name": "ATTACHMENT_ACCEPT", + "kind": "const", + "signature": "\"image/*,.pdf,.txt,.md,.csv,.json,.yaml,.yml,.html\"", + "doc": "Accept list for the composer file picker + type validation, same grammar as the native `` attribute." + }, + { + "name": "ATTACHMENT_MAX_COUNT", + "kind": "const", + "signature": "10", + "doc": "Most files a single request may carry: the composer staging cap, the upload route's per-request cap, and the chat body's `attachments` cap." + }, + { + "name": "AttachmentPathArgs", + "kind": "interface", + "signature": "interface AttachmentPathArgs", + "doc": "Arguments handed to a {@link PromoteAgentFilePartOptions.buildAttachmentPath} override — everything needed to place the file deterministically." + }, + { + "name": "AttachmentPathCheck", + "kind": "type", + "signature": "type AttachmentPathCheck", + "doc": "Verdict of a path check: OK, or a rejection naming why." + }, + { + "name": "AttachmentReadResult", + "kind": "type", + "signature": "type AttachmentReadResult", + "doc": "The result of reading one stored attachment." + }, + { + "name": "attachmentSizeErrorMessage", + "kind": "function", + "signature": "(name: string, actualBytes: number, limitBytes: number) => string", + "doc": "Human-readable error naming both the actual size and the limit that was exceeded." + }, + { + "name": "attachmentTotalSizeErrorMessage", + "kind": "function", + "signature": "(totalBytes: number, limitBytes: number) => string", + "doc": "Human-readable error for a chat message whose combined attachments exceed the aggregate raw-byte ceiling." + }, + { + "name": "AttachmentTypeCheckResult", + "kind": "type", + "signature": "type AttachmentTypeCheckResult", + "doc": "Represent the result of checking an attachment's type with success or specific failure details" + }, + { + "name": "AttachmentUploadAuthorization", + "kind": "type", + "signature": "type AttachmentUploadAuthorization", + "doc": "Outcome of the injected `authorize` seam: auth + rate limiting + scope resolution, all in one place so a 429 rides `{ok:false, response}` exactly like a 401 does — this factory has no rate-limit opin…" + }, + { + "name": "AttachmentWriteResult", + "kind": "type", + "signature": "type AttachmentWriteResult", + "doc": "Outcome of persisting one attachment." + }, + { + "name": "base64WireLen", + "kind": "function", + "signature": "(byteLen: number) => number", + "doc": "Size a base64-encoded string occupies on the wire given the raw (pre-encoding) byte length: base64 packs 3 raw bytes into 4 output characters, rounded up to the next multiple of 4." + }, + { + "name": "buildDispatchParts", + "kind": "function", + "signature": "(input: BuildDispatchPartsInput) => Promise", + "doc": "Build dispatch parts from input by resolving mentions, paths, and applying size constraints asynchronously" + }, + { + "name": "BuildDispatchPartsInput", + "kind": "interface", + "signature": "interface BuildDispatchPartsInput", + "doc": "Build input parameters for dispatching chat message parts including text, attachments, mentions, and history" + }, + { + "name": "buildMentionPromptBlock", + "kind": "function", + "signature": "(mentions: readonly Pick[]) => string", + "doc": "The agent-facing pointer block appended to the dispatched prompt — never persisted in message `content`." + }, + { + "name": "bytesToBase64", + "kind": "function", + "signature": "(bytes: Uint8Array) => string", + "doc": "Convert a Uint8Array of bytes into a base64-encoded string" + }, + { + "name": "ChatAttachmentInput", + "kind": "interface", + "signature": "interface ChatAttachmentInput", + "doc": "`POST` turn-body entry describing a file already uploaded to the product's store (vault/object-store) — distinct from an inline {@link * ChatTurnFilePartInput} (which carries bytes) and from a {@link…" + }, + { + "name": "ChatAttachmentKind", + "kind": "type", + "signature": "type ChatAttachmentKind", + "doc": "The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (…" + }, + { + "name": "ChatMentionKind", + "kind": "type", + "signature": "type ChatMentionKind", + "doc": "The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value." + }, + { + "name": "ChatRouteDurableProjection", + "kind": "interface", + "signature": "interface ChatRouteDurableProjection", + "doc": "Resolve chat route events and materialize their durable state records" + }, + { + "name": "ChatRouteDurableProjectionLogger", + "kind": "type", + "signature": "type ChatRouteDurableProjectionLogger", + "doc": "Log chat route projection messages with optional metadata for durable processing" + }, + { + "name": "ChatTurnAuthorization", + "kind": "type", + "signature": "type ChatTurnAuthorization", + "doc": "Resolve authorization status and context for a chat turn including tenant and user identification" + }, + { + "name": "ChatTurnAuthorizeArgs", + "kind": "interface", + "signature": "interface ChatTurnAuthorizeArgs", + "doc": "Define arguments required to authorize a chat turn based on intent and request details" + }, + { + "name": "ChatTurnFilePartInput", + "kind": "interface", + "signature": "interface ChatTurnFilePartInput", + "doc": "A non-text prompt part the upload route hands back and the client echoes on send." + }, + { + "name": "ChatTurnGateResult", + "kind": "type", + "signature": "type ChatTurnGateResult", + "doc": "Pre-turn readiness verdict — proceed, or short-circuit with the product's own `Response` (e.g." + }, + { + "name": "ChatTurnHeartbeat", + "kind": "interface", + "signature": "interface ChatTurnHeartbeat", + "doc": "Keepalive emitted while the producer is quiet (long tool calls, first-token wait) so client watchdogs stay re-armed." + }, + { + "name": "ChatTurnInputError", + "kind": "class", + "signature": "class ChatTurnInputError", + "doc": "Represent errors for invalid chat turn inputs with status and code properties" + }, + { + "name": "ChatTurnInputPatch", + "kind": "interface", + "signature": "interface ChatTurnInputPatch", + "doc": "Patch a `beforeTurn` hook returns to augment the producer's input." + }, + { + "name": "ChatTurnLifecycle", + "kind": "interface", + "signature": "interface ChatTurnLifecycle", + "doc": "Deterministic run telemetry: `onTurnStart` fires before the producer runs; exactly one of `onTurnComplete` / `onTurnError` fires after the turn settles, always after `onTurnStart`." + }, + { + "name": "ChatTurnLifecycleComplete", + "kind": "interface", + "signature": "interface ChatTurnLifecycleComplete", + "doc": "Define the structure representing the completion state of a chat turn lifecycle with usage data" + }, + { + "name": "ChatTurnLifecycleError", + "kind": "interface", + "signature": "interface ChatTurnLifecycleError", + "doc": "Represent an error occurring during a chat turn lifecycle with context and duration information" + }, + { + "name": "ChatTurnLifecycleStart", + "kind": "interface", + "signature": "interface ChatTurnLifecycleStart", + "doc": "Define lifecycle start event with context and timestamp for a chat turn" + }, + { + "name": "ChatTurnLock", + "kind": "interface", + "signature": "interface ChatTurnLock", + "doc": "Async acquire/release wrapped around the turn." + }, + { + "name": "ChatTurnLockResult", + "kind": "type", + "signature": "type ChatTurnLockResult", + "doc": "Single-flight lock verdict — acquired (with an opaque handle passed back to `release`), or already held (short-circuit with the product's 409-style `Response`)." + }, + { + "name": "ChatTurnMessageStore", + "kind": "interface", + "signature": "interface ChatTurnMessageStore", + "doc": "What the route persists — a structural subset of `/chat-store`'s `ChatStore`, so `createChatStore(db, tables)` satisfies it directly and a product with its own persistence adapts without importing dr…" + }, + { + "name": "ChatTurnPartInput", + "kind": "type", + "signature": "type ChatTurnPartInput", + "doc": "Resolve input as either a text part or a file part of a chat turn" + }, + { + "name": "ChatTurnProduceArgs", + "kind": "interface", + "signature": "interface ChatTurnProduceArgs", + "doc": "Define the arguments required to produce a chat turn with context and messaging details" + }, + { + "name": "chatTurnRequestInit", + "kind": "function", + "signature": "(payload: ChatTurnRequestPayload) => RequestInit", + "doc": "`fetch` init for the turn route — the one place the client wire shape is serialized, so composer glue and products never drift from the server's parser." + }, + { + "name": "ChatTurnRequestPayload", + "kind": "interface", + "signature": "interface ChatTurnRequestPayload", + "doc": "POST body for the turn route." + }, + { + "name": "ChatTurnRouteProducer", + "kind": "interface", + "signature": "interface ChatTurnRouteProducer", + "doc": "`ChatTurnProducer` plus the persisted projection the assembly reads after drain." + }, + { + "name": "ChatTurnRoutes", + "kind": "interface", + "signature": "interface ChatTurnRoutes", + "doc": "Define routes to run, replay, and list running chat turns with streaming and reconnect support" + }, + { + "name": "ChatTurnTextPartInput", + "kind": "interface", + "signature": "interface ChatTurnTextPartInput", + "doc": "Wire contract between the chat client (composer + `streamChatTurn`) and the assembled server vertical (`createChatTurnRoutes`)." + }, + { + "name": "ChatTurnUsage", + "kind": "interface", + "signature": "interface ChatTurnUsage", + "doc": "Usage receipt persisted onto the assistant message (the flattened `step-finish` shape `/chat-store`'s columns mirror)." + }, + { + "name": "checkAttachmentType", + "kind": "function", + "signature": "(fileName: string, sniff: SniffResult, allowed?: ReadonlySet) => AttachmentTypeCheckResult", + "doc": "Cross-check a filename's extension against its sniffed content." + }, + { + "name": "createAttachmentUploadRoute", + "kind": "function", + "signature": "(options: CreateAttachmentUploadRouteOptions) => (request: Request) => Promise", + "doc": "Resolve an attachment upload route handler with customizable limits and validation options" + }, + { + "name": "CreateAttachmentUploadRouteOptions", + "kind": "interface", + "signature": "interface CreateAttachmentUploadRouteOptions", + "doc": "Define options to authorize, write, and limit attachment uploads in a route" + }, + { + "name": "createChatTurnRoutes", + "kind": "function", + "signature": "(options: CreateChatTurnRoutesOptions) => ChatTurnRoutes", + "doc": "Build chat turn routes to handle and validate incoming chat requests with optional logging" + }, + { + "name": "CreateChatTurnRoutesOptions", + "kind": "interface", + "signature": "interface CreateChatTurnRoutesOptions", + "doc": "Define options to configure chat turn routes including authorization, storage, and event buffering" + }, + { + "name": "createSandboxChatProducer", + "kind": "function", + "signature": "(options: SandboxChatProducerOptions) => ChatTurnRouteProducer", + "doc": "Create a sandbox chat producer that manages chat turn routing with logging and interaction rendering options" + }, + { + "name": "createSandboxFileIndexRoute", + "kind": "function", + "signature": "(options: CreateSandboxFileIndexRouteOptions) => (request: Request) => Promise", + "doc": "Resolve a sandbox file index route with authorization, caching, and configurable depth and entries limits" + }, + { + "name": "CreateSandboxFileIndexRouteOptions", + "kind": "interface", + "signature": "interface CreateSandboxFileIndexRouteOptions", + "doc": "Define options to authorize and configure sandbox file index route behavior" + }, + { + "name": "createUploadRoute", + "kind": "function", + "signature": "(options: CreateUploadRouteOptions) => (request: Request) => Promise", + "doc": "Create an upload route handler that authorizes requests and processes file uploads with size limits" + }, + { + "name": "CreateUploadRouteOptions", + "kind": "interface", + "signature": "interface CreateUploadRouteOptions", + "doc": "Define options to authorize uploads and configure file size limits and upload directory" + }, + { + "name": "DEFAULT_STALE_TURN_LOCK_GRACE_MS", + "kind": "const", + "signature": "number", + "doc": "Minimum age a lock must reach before the \"sandbox unreachable ⇒ nothing can be running\" fallback may force-release it." + }, + { + "name": "DEFAULT_TERMINAL_TURN_LOCK_GRACE_MS", + "kind": "const", + "signature": "number", + "doc": "Minimum age a lock must reach before a TERMINAL session verdict may release it." + }, + { + "name": "defaultValidateAttachmentPath", + "kind": "function", + "signature": "(path: string) => AttachmentPathCheck", + "doc": "Default path validator when a caller supplies none." + }, + { + "name": "DetachedTurnFinal", + "kind": "interface", + "signature": "interface DetachedTurnFinal", + "doc": "Authoritative final receipt for a turn that finished server-side, or whose live stream carried no usage (some harness paths only expose tokens via the completed-turn record, e.g." + }, + { + "name": "DetachedTurnOptions", + "kind": "interface", + "signature": "interface DetachedTurnOptions", + "doc": "Define options for managing and projecting a detached turn event stream in a session" + }, + { + "name": "DetachedTurnParts", + "kind": "type", + "signature": "type DetachedTurnParts", + "doc": "The normalized structured message body (tool-call / file / plan / interaction parts) that `/chat-store` persists as the durable assistant row — the same shape `createSandboxChatProducer().assistantPa…" + }, + { + "name": "DetachedTurnResult", + "kind": "interface", + "signature": "interface DetachedTurnResult", + "doc": "Describe the result of a detached turn including state, text, parts, usage, and optional error or cache flag" + }, + { + "name": "DISPATCH_MAX_MEDIA_PARTS", + "kind": "const", + "signature": "24", + "doc": "Product-side cap on media parts per dispatch (current turn + carried history), well under {@link DISPATCH_MAX_PARTS}." + }, + { + "name": "DISPATCH_MAX_PARTS", + "kind": "const", + "signature": "64", + "doc": "Sidecar's hard cap on the `parts` array of one prompt request — a dispatch must never assemble more parts than this or the whole turn 400s." + }, + { + "name": "DISPATCH_REQUEST_MAX_BYTES", + "kind": "const", + "signature": "number", + "doc": "Hard cap on the whole `/prompt` request body as it crosses the sandbox proxy — smaller in practice than a raw-file write cap because a dispatch carries several inline parts plus the flattened history…" + }, + { + "name": "DISPATCH_STRUCTURAL_RESERVE_BYTES", + "kind": "const", + "signature": "number", + "doc": "Bytes reserved off the top of {@link DISPATCH_REQUEST_MAX_BYTES} for the JSON structure around the parts array (keys, delimiters, per-part `type`/`filename`/`mediaType` fields) that {@link base64Wire…" + }, + { + "name": "DispatchPartsOutcome", + "kind": "type", + "signature": "type DispatchPartsOutcome", + "doc": "Resolve the outcome of dispatching parts with success status and corresponding value or error message" + }, + { + "name": "FileIndexAuthorization", + "kind": "type", + "signature": "type FileIndexAuthorization", + "doc": "Define authorization details and parameters for indexing a file workspace with optional caching and ignore rules" + }, + { + "name": "FileIndexCache", + "kind": "interface", + "signature": "interface FileIndexCache", + "doc": "Short-TTL cache seam so repeat popover opens in the same session don't re-scan the workspace." + }, + { + "name": "FileIndexReadyResponse", + "kind": "interface", + "signature": "interface FileIndexReadyResponse", + "doc": "Describe a ready file index response with workspace-relative entries and truncation status" + }, + { + "name": "FileIndexResponse", + "kind": "type", + "signature": "type FileIndexResponse", + "doc": "Resolve a response indicating the file index is either ready or warming up" + }, + { + "name": "FileIndexWarmingResponse", + "kind": "interface", + "signature": "interface FileIndexWarmingResponse", + "doc": "Cold-box answer: no provisioning happened, no files were scanned." + }, + { + "name": "FileMention", + "kind": "interface", + "signature": "interface FileMention", + "doc": "A file mention resolved from the composer's `@`-picker: the workspace-relative path plus enough metadata to build a prompt part and pointer text." + }, + { + "name": "fileMentionsToParts", + "kind": "function", + "signature": "(mentions: readonly FileMention[], opts?: FileMentionsToPartsOptions) => ChatTurnFilePartInput[]", + "doc": "Maps resolved file mentions to path-only `ChatTurnFilePartInput`s — `image` vs `file` by extension, and always a `path`, never a `url` (the url/path XOR invariant: a mention is a sandbox path referen…" + }, + { + "name": "FileMentionsToPartsOptions", + "kind": "interface", + "signature": "interface FileMentionsToPartsOptions", + "doc": "Define options to resolve mention paths when converting file mentions to parts" + }, + { + "name": "FilePartPromotionOutcome", + "kind": "type", + "signature": "type FilePartPromotionOutcome", + "doc": "Outcome of a `promoteFilePart` attempt." + }, + { + "name": "formatBytes", + "kind": "function", + "signature": "(bytes: number) => string", + "doc": "Render a raw byte count as a human-readable size (`512B`, `3KB`, `12MB 500KB`)." + }, + { + "name": "INLINE_PARTS_MAX_BYTES", + "kind": "const", + "signature": "950000", + "doc": "Define the maximum byte size allowed for inline parts in data processing" + }, + { + "name": "MAX_ATTACHMENT_TOTAL_BYTES", + "kind": "const", + "signature": "number", + "doc": "Aggregate raw-byte ceiling across one message's attachments." + }, + { + "name": "MAX_BINARY_ATTACHMENT_BYTES", + "kind": "const", + "signature": "number", + "doc": "Ceiling on a binary attachment's raw (pre-encoding) byte size." + }, + { + "name": "MAX_TEXT_ATTACHMENT_BYTES", + "kind": "const", + "signature": "number", + "doc": "Ceiling on a text attachment's raw byte size." + }, + { + "name": "mediaTypeForMentionPath", + "kind": "function", + "signature": "(path: string) => string | undefined", + "doc": "The `image/*` mime for a mention path by extension, or `undefined` for anything not in the known image set (dispatched as `type: 'file'`)." + }, + { + "name": "MENTION_MAX_COUNT", + "kind": "const", + "signature": "16", + "doc": "Hard cap on mentions per turn." + }, + { + "name": "mentionKindForPath", + "kind": "function", + "signature": "(path: string) => ChatMentionKind", + "doc": "`image` when the path's extension is in the known image set (the same table {@link mediaTypeForMentionPath} reads), `file` otherwise." + }, + { + "name": "parseChatTurnParts", + "kind": "function", + "signature": "(raw: unknown) => ChatTurnFilePartInput[]", + "doc": "Validates the untyped `parts` array off the wire." + }, + { + "name": "parseFileMentions", + "kind": "function", + "signature": "(raw: unknown) => FileMention[]", + "doc": "Validates the untyped `mentions` array off the wire, mirroring {@link parseChatTurnParts}: the typed list, or `ChatTurnInputError` (400) naming the offending entry." + }, + { + "name": "ProducerErrorEvent", + "kind": "interface", + "signature": "interface ProducerErrorEvent", + "doc": "Represent an error event emitted by a producer containing message, code, and optional details" + }, + { + "name": "ProducerNoticeEvent", + "kind": "interface", + "signature": "interface ProducerNoticeEvent", + "doc": "Define the structure for a producer notice event with type, id, kind, and text fields" + }, + { + "name": "ProducerPassthroughEvent", + "kind": "interface", + "signature": "interface ProducerPassthroughEvent", + "doc": "Define an event carrying passthrough data with flexible properties for producer communication" + }, + { + "name": "ProducerPassthroughEventType", + "kind": "type", + "signature": "type ProducerPassthroughEventType", + "doc": "Stable raw lifecycle/interaction/plan/route events forwarded unchanged." + }, + { + "name": "ProducerReasoningEvent", + "kind": "interface", + "signature": "interface ProducerReasoningEvent", + "doc": "Define an event representing reasoning output with a fixed type and associated text" + }, + { + "name": "ProducerTextEvent", + "kind": "interface", + "signature": "interface ProducerTextEvent", + "doc": "Represent a text event produced by a source with a fixed type and associated text content" + }, + { + "name": "ProducerToolCallEvent", + "kind": "interface", + "signature": "interface ProducerToolCallEvent", + "doc": "Represent an event triggered by a producer tool call with its identifier, name, and arguments" + }, + { + "name": "ProducerToolResultEvent", + "kind": "interface", + "signature": "interface ProducerToolResultEvent", + "doc": "Describe the structure of an event representing the result of a producer tool call" + }, + { + "name": "ProducerUsageEvent", + "kind": "interface", + "signature": "interface ProducerUsageEvent", + "doc": "Describe usage event with prompt and completion token counts for a producer" + }, + { + "name": "ProducerWireEvent", + "kind": "type", + "signature": "type ProducerWireEvent", + "doc": "Represent events emitted by a producer during its operation for processing and handling" + }, + { + "name": "PROMOTE_MAX_FILE_BYTES", + "kind": "const", + "signature": "number", + "doc": "Default ceiling on a promoted file's raw (pre-encoding) byte size." + }, + { + "name": "promoteAgentFilePart", + "kind": "function", + "signature": "(options: PromoteAgentFilePartOptions) => Promise", + "doc": "Promote a part of an agent file with optional byte limits and MIME type detection" + }, + { + "name": "PromoteAgentFilePartOptions", + "kind": "interface", + "signature": "interface PromoteAgentFilePartOptions", + "doc": "Define options for promoting a part of an agent file within a specific session and scope" + }, + { + "name": "PromoteFilePartResult", + "kind": "type", + "signature": "type PromoteFilePartResult", + "doc": "Resolve the result of promoting a file part with success status and relevant data or error details" + }, + { + "name": "PromptInputPart", + "kind": "type", + "signature": "type PromptInputPart", + "doc": "Extract a single element type from the array parameter of SandboxInstance's streamPrompt method" + }, + { + "name": "promptPartsByteSize", + "kind": "function", + "signature": "(parts: ChatTurnPartInput[]) => number", + "doc": "Calculate the total byte size of an array of chat turn parts" + }, + { + "name": "RawAgentFilePart", + "kind": "interface", + "signature": "interface RawAgentFilePart", + "doc": "Define the structure for a raw file part with optional metadata and media type information" + }, + { + "name": "ReadAttachmentFn", + "kind": "type", + "signature": "type ReadAttachmentFn", + "doc": "Read one stored attachment for `scopeId` (the product's workspace/tenant key) at its store-relative `path`." + }, + { + "name": "ReadSandboxMentionFn", + "kind": "type", + "signature": "type ReadSandboxMentionFn", + "doc": "Resolve sandbox mention details by reading from a specified path with optional byte reading" + }, + { + "name": "reconcileStaleTurnLock", + "kind": "function", + "signature": "(options: ReconcileStaleTurnLockOptions) => Promise", + "doc": "Decide whether a held lock is stale and, if so, release it." + }, + { + "name": "ReconcileStaleTurnLockOptions", + "kind": "interface", + "signature": "interface ReconcileStaleTurnLockOptions", + "doc": "Resolve options for probing and releasing stale TURN locks based on lock start time and sandbox state" + }, + { + "name": "ReconcileStaleTurnLockResult", + "kind": "interface", + "signature": "interface ReconcileStaleTurnLockResult", + "doc": "Describe the outcome of reconciling a stale turn lock including release status and diagnostics" + }, + { + "name": "resolveChatAttachments", + "kind": "function", + "signature": "(value: unknown, options: ResolveChatAttachmentsOptions) => Promise", + "doc": "Validate and resolve a turn body's `attachments` field into persistable parts." + }, + { + "name": "ResolveChatAttachmentsOptions", + "kind": "interface", + "signature": "interface ResolveChatAttachmentsOptions", + "doc": "Define options to resolve and validate chat attachments with size, count, and path constraints" + }, + { + "name": "ResolveChatAttachmentsResult", + "kind": "type", + "signature": "type ResolveChatAttachmentsResult", + "doc": "Resolve the result of chat attachment processing with success status and corresponding data or error" + }, + { + "name": "runDetachedTurn", + "kind": "function", + "signature": "(opts: DetachedTurnOptions) => Promise", + "doc": "Stream a detached turn into the live turn-event buffer, durably." + }, + { + "name": "SandboxChatProducerOptions", + "kind": "interface", + "signature": "interface SandboxChatProducerOptions", + "doc": "Define options for producing sandbox chat events with rendering and interaction controls" + }, + { + "name": "SandboxFileTreeSource", + "kind": "interface", + "signature": "interface SandboxFileTreeSource", + "doc": "Structural match of the sandbox SDK's `box.fs` tree surface." + }, + { + "name": "SandboxMentionPathCheck", + "kind": "type", + "signature": "type SandboxMentionPathCheck", + "doc": "Represent the result of a sandbox mention path check indicating success or failure with an error message" + }, + { + "name": "SandboxTreeFile", + "kind": "interface", + "signature": "interface SandboxTreeFile", + "doc": "One entry from a structural `tree()` scan." + }, + { + "name": "SandboxTreeResult", + "kind": "interface", + "signature": "interface SandboxTreeResult", + "doc": "Structural match of the sandbox SDK's `box.fs.tree` result shape (`FileTreeResult`)." + }, + { + "name": "SandboxUploadSink", + "kind": "interface", + "signature": "interface SandboxUploadSink", + "doc": "Structural match of the sandbox SDK's `box.fs` write surface (v0.10.5+: `encoding: 'base64'` is the worker-safe binary path)." + }, + { + "name": "sanitizeAttachmentFileName", + "kind": "function", + "signature": "(name: string) => string", + "doc": "Rewrite a filename into the store-path charset (`A-Za-z0-9._-` per segment) — attachment paths double as store keys, sandbox file paths, and in-message path references, none of which tolerate spaces…" + }, + { + "name": "sanitizeUploadFilename", + "kind": "function", + "signature": "(name: string) => string", + "doc": "Path-safe file name: basename only, conservative charset, length-capped." + }, + { + "name": "sniffBinary", + "kind": "function", + "signature": "(bytes: Uint8Array) => SniffResult", + "doc": "Decide whether uploaded bytes are binary or text, and identify the mime type when it can be determined from content." + }, + { + "name": "sniffMimeFromName", + "kind": "function", + "signature": "(filename: string) => string", + "doc": "Default MIME hook: extension → mime, or `text/plain` for the unknown." + }, + { + "name": "SniffResult", + "kind": "interface", + "signature": "interface SniffResult", + "doc": "Content-based binary/text classification, shared by the attachment upload route (server) and the composer's client-side pre-validation (browser) — both sides must agree on what counts as binary befor…" + }, + { + "name": "StaleTurnLockSandboxProbeResult", + "kind": "type", + "signature": "type StaleTurnLockSandboxProbeResult", + "doc": "Where the box is, as far as the caller can see." + }, + { + "name": "StaleTurnLockSessionProbeResult", + "kind": "type", + "signature": "type StaleTurnLockSessionProbeResult", + "doc": "What the thing running the turn says about it." + }, + { + "name": "UPLOAD_INLINE_MAX_BYTES", + "kind": "const", + "signature": "number", + "doc": "700 KiB: base64 inflates ~4/3, so an inline part stays comfortably under the ~1 MiB gateway body cap alongside the JSON envelope." + }, + { + "name": "UPLOAD_MAX_FILE_BYTES", + "kind": "const", + "signature": "number", + "doc": "8 MiB default ceiling per file — one base64 `write` call handles it." + }, + { + "name": "UploadAuthorization", + "kind": "type", + "signature": "type UploadAuthorization", + "doc": "Resolve upload authorization status and provide upload destination or error response" + }, + { + "name": "UploadedChatFile", + "kind": "interface", + "signature": "interface UploadedChatFile", + "doc": "One uploaded file, ready for the composer chip and the turn body." + }, + { + "name": "validateSandboxMentionPath", + "kind": "function", + "signature": "(path: unknown) => SandboxMentionPathCheck", + "doc": "Validate a workspace-relative sandbox mention path." + }, + { + "name": "withDurableChatProjection", + "kind": "function", + "signature": "(producer: ChatTurnRouteProducer, projection: ChatRouteDurableProjection, log?: ChatRouteDurableProjectionLogger) => Ch…", + "doc": "Adds durable lifecycle projection to any producer lane without moving its transport into agent-app." + }, + { + "name": "WriteAttachmentFn", + "kind": "type", + "signature": "type WriteAttachmentFn", + "doc": "Persist `content` for `scopeId` at `path`." + } + ] + }, + { + "id": "./chat-store", + "source": "src/chat-store/index.ts", + "dependsOn": [ + "chat-routes", + "interactions", + "plans", + "stream", + "web-react" + ], + "error": null, + "exports": [ + { + "name": "AppendMessageInput", + "kind": "interface", + "signature": "interface AppendMessageInput", + "doc": "Define input parameters for appending a message to a chat thread with optional metadata" + }, + { + "name": "attachmentInputToPart", + "kind": "function", + "signature": "(input: ChatAttachmentInput) => ChatAttachmentPart", + "doc": "Drop absent/empty optional fields rather than persisting `undefined`/`''` — keeps stored parts minimal." + }, + { + "name": "attachmentKindForMime", + "kind": "function", + "signature": "(mime?: string | undefined) => ChatAttachmentKind", + "doc": "`image` for any `image/*` mime, `file` for everything else (including an absent/empty mime) — the same split the composer and the persisted-part discriminant both key on." + }, + { + "name": "attachmentPartKey", + "kind": "function", + "signature": "(path: string) => string", + "doc": "Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it." + }, + { + "name": "attachmentPartsFromMessageParts", + "kind": "function", + "signature": "(parts: readonly Record[] | null | undefined) => ChatAttachmentPart[]", + "doc": "Every attachment part on one message's stored `parts`, in stored order." + }, + { + "name": "buildAttachmentPromptBlock", + "kind": "function", + "signature": "(atts: readonly Pick[], header?: string) => string", + "doc": "The agent-facing pointer block appended to the dispatched prompt — never persisted in `message.content`." + }, + { + "name": "BULK_DELETE_MAX_THREADS", + "kind": "const", + "signature": "200", + "doc": "Bounds a single bulk-delete request's write set; product surfaces cap thread lists at far fewer, so a larger batch is a malformed or hostile request." + }, + { + "name": "BulkDeleteThreadsInput", + "kind": "interface", + "signature": "interface BulkDeleteThreadsInput", + "doc": "Define input for bulk deleting threads with access checks per workspace" + }, + { + "name": "ChatAttachmentKind", + "kind": "type", + "signature": "type ChatAttachmentKind", + "doc": "The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (…" + }, + { + "name": "ChatAttachmentPart", + "kind": "interface", + "signature": "interface ChatAttachmentPart", + "doc": "Persisted attachment part: structurally an attachment-flavored `ChatFilePart` / `ChatImagePart` (`path` + `name` promoted to required) rather than a separate union member — see the section note above." + }, + { + "name": "ChatDatabase", + "kind": "type", + "signature": "type ChatDatabase", + "doc": "Any SQLite drizzle database — `any` erases the driver-specific run-result and schema generics so better-sqlite3, D1, and libsql handles all fit." + }, + { + "name": "ChatFilePart", + "kind": "interface", + "signature": "interface ChatFilePart", + "doc": "Union of the sidecar's legacy (path-based) and AI-SDK (url-based) file shapes; response-side every field besides `type` is optional." + }, + { + "name": "ChatImagePart", + "kind": "interface", + "signature": "interface ChatImagePart", + "doc": "Define properties for an image part within a chat message including optional metadata fields" + }, + { + "name": "ChatInteractionPart", + "kind": "interface", + "signature": "interface ChatInteractionPart", + "doc": "Persisted human-in-the-loop ask — byte-matches `interactionToPersistedPart` in `/web-react`'s chat-interactions contract." + }, + { + "name": "ChatMentionKind", + "kind": "type", + "signature": "type ChatMentionKind", + "doc": "The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value." + }, + { + "name": "ChatMentionPart", + "kind": "interface", + "signature": "interface ChatMentionPart", + "doc": "A file the user `@`-mentioned on this turn: a workspace-relative path into the sandbox, never bytes." + }, + { + "name": "ChatMessagePart", + "kind": "type", + "signature": "type ChatMessagePart", + "doc": "Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions" + }, + { + "name": "ChatMessageRow", + "kind": "type", + "signature": "type ChatMessageRow", + "doc": "Resolve the selected structure of a chat message row from the messages table" + }, + { + "name": "ChatNoticePart", + "kind": "interface", + "signature": "interface ChatNoticePart", + "doc": "Persisted one-line transcript notice — byte-matches `noticePart` in `/web-react`'s chat-interactions contract." + }, + { + "name": "ChatParentTable", + "kind": "type", + "signature": "type ChatParentTable", + "doc": "A product table referenced by FK — only the `id` column is touched." + }, + { + "name": "ChatPartTime", + "kind": "interface", + "signature": "interface ChatPartTime", + "doc": "Start/end wall-clock millis, as normalized by `/stream`'s `normalizeTime`." + }, + { + "name": "ChatPlanPart", + "kind": "type", + "signature": "type ChatPlanPart", + "doc": "Resolve a chat plan part by aliasing it to the persisted chat plan part type" + }, + { + "name": "ChatReasoningPart", + "kind": "interface", + "signature": "interface ChatReasoningPart", + "doc": "Define a reasoning part of a chat with text content and optional metadata fields" + }, + { + "name": "ChatStepFinishPart", + "kind": "interface", + "signature": "interface ChatStepFinishPart", + "doc": "Define a chat step finish part indicating completion with optional reason, tokens, and cost" + }, + { + "name": "ChatStepStartPart", + "kind": "interface", + "signature": "interface ChatStepStartPart", + "doc": "OpenCode step-boundary marker — no renderable text; preserved so mappers never coerce it into a \"[object Object]\" text part." + }, + { + "name": "ChatStore", + "kind": "interface", + "signature": "interface ChatStore", + "doc": "Manage chat threads and messages with operations for listing, creating, updating, and deleting data" + }, + { + "name": "ChatStoreInputError", + "kind": "class", + "signature": "class ChatStoreInputError", + "doc": "Invalid caller input (missing/oversized ids, empty title)." + }, + { + "name": "ChatSubtaskPart", + "kind": "interface", + "signature": "interface ChatSubtaskPart", + "doc": "Define a subtask part of a chat with prompt, description, agent, and optional identifier" + }, + { + "name": "ChatTables", + "kind": "type", + "signature": "type ChatTables", + "doc": "The base (no-extras) table pair, pinned via an instantiation expression: `ReturnType` on the bare generic substitutes the extras params with their CONSTRAINT (`Record(db: ChatDatabase, tables: TTables) => ChatStore = {}, TMessageExtras extends Record[] | null | undefined; }, header?: string | undefi…", + "doc": "History projection for a persisted message: `content` unchanged when it carries no attachment parts, else the block is appended once." + }, + { + "name": "isChatAttachmentPart", + "kind": "function", + "signature": "(part: unknown) => part is ChatAttachmentPart", + "doc": "True for any `image`/`file` part carrying a non-empty string `path`." + }, + { + "name": "isChatInteractionPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatInteractionPart", + "doc": "Resolve whether a ChatMessagePart is a ChatInteractionPart based on its type property" + }, + { + "name": "isChatMentionPart", + "kind": "function", + "signature": "(part: unknown) => part is ChatMentionPart", + "doc": "Widened to `unknown` — unlike its siblings this guard also runs over raw untyped stored rows (a transcript renderer reads `message.parts` before the typed projection), which is exactly what {@link me…" + }, + { + "name": "isChatPlanPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatPlanPersistedPart", + "doc": "Resolve whether a chat message part is a persisted chat plan part" + }, + { + "name": "isChatStepFinishPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatStepFinishPart", + "doc": "Determine if a chat message part represents the completion of a chat step" + }, + { + "name": "isChatTextPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatTextPart", + "doc": "Resolve whether a chat message part is a text part based on its type property" + }, + { + "name": "isChatToolPart", + "kind": "function", + "signature": "(part: ChatMessagePart) => part is ChatToolPart", + "doc": "Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property" + }, + { + "name": "ListMessagesOptions", + "kind": "interface", + "signature": "interface ListMessagesOptions", + "doc": "Define options to configure message listing with optional limit and offset parameters" + }, + { + "name": "ListThreadsInput", + "kind": "interface", + "signature": "interface ListThreadsInput", + "doc": "Define input parameters for listing threads within a workspace with pagination options" + }, + { + "name": "ListThreadsResult", + "kind": "interface", + "signature": "interface ListThreadsResult", + "doc": "Represent a paginated collection of chat threads with total count and pagination details" + }, + { + "name": "mentionInputToPart", + "kind": "function", + "signature": "(input: FileMention) => ChatMentionPart", + "doc": "A validated wire mention (`parseFileMentions` in `/chat-routes`) as the part the turn route persists." + }, + { + "name": "mentionPartsFromMessageParts", + "kind": "function", + "signature": "(parts: readonly Record[] | readonly ChatMessagePart[] | null | undefined) => ChatMentionPart[]", + "doc": "Every mention part on one message, in stored order." + }, + { + "name": "NewChatMessageRow", + "kind": "type", + "signature": "type NewChatMessageRow", + "doc": "Resolve the type for inserting a new chat message row into the messages table" + }, + { + "name": "NewChatThreadRow", + "kind": "type", + "signature": "type NewChatThreadRow", + "doc": "Resolve the type for inserting a new chat thread row into the threads table" + }, + { + "name": "StorableHarnessPartKind", + "kind": "type", + "signature": "type StorableHarnessPartKind", + "doc": "Every canonical harness wire-part kind must be storable — compile-time guarantee that a new agent-interface part kind cannot silently fall out of the persisted vocabulary." + }, + { + "name": "threadTitleFromMessage", + "kind": "function", + "signature": "(message: string) => string", + "doc": "Thread titles come from the first message — keep the list scannable by storing only its first non-empty line, capped at 80 chars, never the whole multi-page prompt." + }, + { + "name": "toChatMessageParts", + "kind": "function", + "signature": "(parts: Record[]) => ChatMessagePart[]", + "doc": "The typed projection at the `/stream` → `/chat-store` boundary." + }, + { + "name": "WorkspaceAccessCheck", + "kind": "type", + "signature": "type WorkspaceAccessCheck", + "doc": "Product-injected access check." + } + ] + }, + { + "id": "./composer", + "source": "src/composer/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "AgentComposer", + "kind": "function", + "signature": "({ value, onChange, onSubmit, placeholder, disabled, busy, onCancel, harness, profile, model, reasoning, context, contr…", + "doc": "The canonical agent chat input: one rounded surface holding an auto-growing textarea, the embedded control strip (profile · harness · model · effort) at the bottom-left, and the send button at the bo…" + }, + { + "name": "AgentComposerProps", + "kind": "interface", + "signature": "interface AgentComposerProps", + "doc": null + }, + { + "name": "AgentProfileCapability", + "kind": "interface", + "signature": "interface AgentProfileCapability", + "doc": "A selectable tool group offered by the create/edit form." + }, + { + "name": "AgentProfileDraft", + "kind": "interface", + "signature": "interface AgentProfileDraft", + "doc": "The editable shape the create/edit form emits." + }, + { + "name": "AgentProfileOption", + "kind": "interface", + "signature": "interface AgentProfileOption", + "doc": "An agent profile: a named bundle of toolset + persona layered over the same model and session." + }, + { + "name": "AgentProfilePicker", + "kind": "function", + "signature": "({ value, onChange, profiles, capabilities, onCreate, onUpdate, onDelete, disabled, className, side, }: AgentProfilePic…", + "doc": "Agent / mode switcher styled to match the chat control strip's pills (harness, model, effort)." + }, + { + "name": "AgentProfilePickerProps", + "kind": "interface", + "signature": "interface AgentProfilePickerProps", + "doc": null + }, + { + "name": "AgentSessionControls", + "kind": "function", + "signature": "({ harness, profile, model, reasoning, filterModelsToHarness, trailing, className, context, layout, menuPlacement, }: A…", + "doc": "Compact control strip for an agent chat composer: harness, model, and thinking-effort pickers in one row." + }, + { + "name": "AgentSessionControlsProps", + "kind": "interface", + "signature": "interface AgentSessionControlsProps", + "doc": null + }, + { + "name": "AgentSessionHarnessControl", + "kind": "interface", + "signature": "interface AgentSessionHarnessControl", + "doc": null + }, + { + "name": "AgentSessionModelControl", + "kind": "interface", + "signature": "interface AgentSessionModelControl", + "doc": null + }, + { + "name": "AgentSessionProfileControl", + "kind": "interface", + "signature": "interface AgentSessionProfileControl", + "doc": "Agent-profile (mode / toolset / persona) selection." + }, + { + "name": "AgentSessionReasoningControl", + "kind": "interface", + "signature": "interface AgentSessionReasoningControl", + "doc": null + }, + { + "name": "DEFAULT_REASONING_LEVEL_OPTIONS", + "kind": "const", + "signature": "readonly ReasoningLevelOption[]", + "doc": null + }, + { + "name": "HarnessType", + "kind": "type", + "signature": "type HarnessType", + "doc": "The execution runner for an agent — WHICH runtime materializes and runs an `AgentProfile`." + }, + { + "name": "isModelCompatibleWithHarness", + "kind": "function", + "signature": "(harness: HarnessType, modelId: string) => boolean", + "doc": "Whether `harness` can run `modelId`." + }, + { + "name": "ModelInfo", + "kind": "interface", + "signature": "interface ModelInfo", + "doc": "Wire-format model entry as returned by `/v1/models` on the Tangle Router (and most OpenAI-compatible gateways)." + }, + { + "name": "ReasoningLevel", + "kind": "type", + "signature": "type ReasoningLevel", + "doc": "A reasoning selection: `auto` is a UI-only sentinel (\"let the harness/model default decide\", sends no explicit override); every other value is the canonical `ReasoningEffort` from `@tangle-network/ag…" + }, + { + "name": "ReasoningLevelOption", + "kind": "interface", + "signature": "interface ReasoningLevelOption", + "doc": null + }, + { + "name": "ReasoningLevelPicker", + "kind": "function", + "signature": "({ value, onChange, disabled, className, triggerClassName, options, available, side, avoidCollisions, }: ReasoningLevel…", + "doc": null + }, + { + "name": "snapHarnessToModel", + "kind": "function", + "signature": "(harness: HarnessType, modelId: string) => HarnessType", + "doc": "Keep the harness when it can run `modelId`; otherwise return the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to the router-backed `opencode` f…" + }, + { + "name": "snapModelToHarness", + "kind": "function", + "signature": "(harness: HarnessType, modelId: string, models: readonly ModelInfo[]) => string", + "doc": "Keeps `modelId` when the harness can run it; otherwise returns the harness's best compatible model from the loaded catalog (preferred patterns in order, highest version within a pattern)." + } + ] + }, + { + "id": "./config", + "source": "src/config/index.ts", + "dependsOn": [ + "knowledge", + "runtime" + ], + "error": null, + "exports": [ + { + "name": "AgentAppConfig", + "kind": "interface", + "signature": "interface AgentAppConfig", + "doc": "The declarative domain surface of a Tangle agent product." + }, + { + "name": "agentAppConfigJsonSchema", + "kind": "const", + "signature": "{ readonly $schema: \"https://json-schema.org/draft/2020-12/schema\"; readonly $id: \"https://tangle.tools/schemas/agent-a…", + "doc": "Machine-readable JSON Schema (draft 2020-12) for {@link AgentAppConfig}." + }, + { + "name": "AgentIdentityConfig", + "kind": "interface", + "signature": "interface AgentIdentityConfig", + "doc": "Who the agent is, as data." + }, + { + "name": "AgentIntegrationsConfig", + "kind": "interface", + "signature": "interface AgentIntegrationsConfig", + "doc": "Which integrations the product enables, as data." + }, + { + "name": "AgentKnowledgeConfig", + "kind": "interface", + "signature": "interface AgentKnowledgeConfig", + "doc": "The knowledge surface, as data." + }, + { + "name": "AgentTaxonomyConfig", + "kind": "interface", + "signature": "interface AgentTaxonomyConfig", + "doc": "The proposal taxonomy, as data." + }, + { + "name": "AgentUiConfig", + "kind": "interface", + "signature": "interface AgentUiConfig", + "doc": "UI capability flags, as data." + }, + { + "name": "defineAgentApp", + "kind": "function", + "signature": "(config: T) => T", + "doc": "Identity helper: returns its argument unchanged, but anchors inference so a coding agent authoring a config gets full autocomplete + type-checking from a single import." + }, + { + "name": "KnowledgeLoopConfig", + "kind": "interface", + "signature": "interface KnowledgeLoopConfig", + "doc": "The knowledge-acquisition loop config — the goal the researcher pursues and the gate it must clear before the loop is considered satisfied." + }, + { + "name": "KnowledgeRequirementSpec", + "kind": "interface", + "signature": "interface KnowledgeRequirementSpec", + "doc": "Define the criteria and conditions required to satisfy a specific knowledge requirement" + }, + { + "name": "KnowledgeSourceSpec", + "kind": "interface", + "signature": "interface KnowledgeSourceSpec", + "doc": "A knowledge source the acquisition loop / researcher may draw on." + }, + { + "name": "SatisfiedByRule", + "kind": "type", + "signature": "type SatisfiedByRule", + "doc": "A declarative rule for satisfying a requirement from workspace state." + }, + { + "name": "TangleModelConfig", + "kind": "interface", + "signature": "interface TangleModelConfig", + "doc": "Resolve the model config a Tangle agent's sandbox/runtime runs on." + } + ] + }, + { + "id": "./crypto", + "source": "src/crypto/index.ts", + "dependsOn": [ + "billing" + ], + "error": null, + "exports": [ + { + "name": "createFieldCrypto", + "kind": "function", + "signature": "(key: string | (() => string)) => { encrypt(s: string): Promise; decrypt(s: string): Promise; }", + "doc": "Build a {@link import ('../billing').KeyCrypto}-compatible pair bound to a key (or a key-resolver, for env-backed keys resolved per call)." + }, + { + "name": "decodeHexKey", + "kind": "function", + "signature": "(keyHex: string) => Uint8Array", + "doc": "Validate + decode a 64-char hex key to 32 bytes." + }, + { + "name": "decryptAesGcm", + "kind": "function", + "signature": "(encrypted: string, keyHex: string) => Promise", + "doc": "Decrypt a base64(iv ‖ ciphertext ‖ tag) string under `keyHex`." + }, + { + "name": "decryptBytes", + "kind": "function", + "signature": "(data: ArrayBuffer, key: CryptoKey) => Promise", + "doc": "Decrypt binary data (IV ‖ ciphertext ‖ tag) under a derived `CryptoKey`." + }, + { + "name": "decryptWithKey", + "kind": "function", + "signature": "(encoded: string, key: CryptoKey) => Promise", + "doc": "Decrypt a base64(iv ‖ ct ‖ tag) string under a derived `CryptoKey`." + }, + { + "name": "deriveKey", + "kind": "function", + "signature": "(secret: string, opts: DeriveKeyOptions) => Promise", + "doc": "Derive an AES-256-GCM `CryptoKey` from a secret string via PBKDF2." + }, + { + "name": "DeriveKeyOptions", + "kind": "interface", + "signature": "interface DeriveKeyOptions", + "doc": "--- Passphrase-derived key path (PBKDF2 → AES-256-GCM CryptoKey) --- The `encryptAesGcm`/`decryptAesGcm` path takes a raw 64-char-hex key." + }, + { + "name": "encryptAesGcm", + "kind": "function", + "signature": "(plaintext: string, keyHex: string) => Promise", + "doc": "Encrypt `plaintext` with AES-256-GCM under `keyHex`." + }, + { + "name": "encryptBytes", + "kind": "function", + "signature": "(data: ArrayBuffer, key: CryptoKey) => Promise", + "doc": "Encrypt binary data under a derived `CryptoKey`." + }, + { + "name": "encryptWithKey", + "kind": "function", + "signature": "(plaintext: string, key: CryptoKey) => Promise", + "doc": "Encrypt `plaintext` under a derived `CryptoKey`." + } + ] + }, + { + "id": "./design-canvas", + "source": "src/design-canvas/index.ts", + "dependsOn": [ + "tools", + "web" + ], + "error": null, + "exports": [ + { + "name": "AddElementOperation", + "kind": "interface", + "signature": "interface AddElementOperation", + "doc": "Define an operation to add a scene element to a page with optional index and parent group" + }, + { + "name": "AddPageOperation", + "kind": "interface", + "signature": "interface AddPageOperation", + "doc": "Define an operation to add a new page with an optional position and caller-minted page ID" + }, + { + "name": "applyBindingsToDocument", + "kind": "function", + "signature": "(document: SceneDocument, bindings: Record) => SceneDocument", + "doc": "Applies slot bindings to a document in place (mutates a deep copy produced by the caller)." + }, + { + "name": "ApplyDataOperation", + "kind": "interface", + "signature": "interface ApplyDataOperation", + "doc": "Fill slots with data — text slots take strings, image/video slots take src URLs." + }, + { + "name": "applySceneOperation", + "kind": "function", + "signature": "(document: SceneDocument, operation: SceneOperation) => SceneDocument", + "doc": "Apply a single operation to a document and return the new document." + }, + { + "name": "applySceneOperations", + "kind": "function", + "signature": "{ (document: SceneDocument, operations: SceneOperation[], options: ApplySceneOptions): { document: SceneDocument; resul…", + "doc": "Full form: returns the new document AND per-op results." + }, + { + "name": "ApplySceneOptions", + "kind": "interface", + "signature": "interface ApplySceneOptions", + "doc": "Resolve element ID conflicts by providing fresh unique identifiers during scene application" + }, + { + "name": "assertColor", + "kind": "function", + "signature": "(value: string, label: string) => void", + "doc": "Validate that a string is a hex, rgb(a), or 'transparent' color and throw an error if not" + }, + { + "name": "assertFinite", + "kind": "function", + "signature": "(value: number, label: string) => void", + "doc": "Assert that a value is a finite number and throw an error with a label if not" + }, + { + "name": "assertPositiveFinite", + "kind": "function", + "signature": "(value: number, label: string) => void", + "doc": "Assert that a value is a positive finite number and throw an error with a label if not" + }, + { + "name": "assertSceneMediaSrc", + "kind": "function", + "signature": "(value: string, label: string) => void", + "doc": "Media boundary rule shared with sequences: remote http(s) or a rooted /api/ path — never sandbox-local files or data:/blob: blobs." + }, + { + "name": "BindSlotOperation", + "kind": "interface", + "signature": "interface BindSlotOperation", + "doc": "Define an operation to bind or unbind a unique slot to an element on a specific page" + }, + { + "name": "bleedAwareExportBounds", + "kind": "function", + "signature": "(page: ScenePage, includeBleed: boolean) => ExportCropRect", + "doc": "Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins." + }, + { + "name": "bleedAwareExportRect", + "kind": "function", + "signature": "(page: Pick) => Bounds", + "doc": "Export rectangle in page coordinates that includes bleed margins when present." + }, + { + "name": "Bounds", + "kind": "interface", + "signature": "interface Bounds", + "doc": "Define rectangular boundaries with position and size properties" + }, + { + "name": "boundsIntersect", + "kind": "function", + "signature": "(a: Bounds, b: Bounds) => boolean", + "doc": "Determine if two rectangular bounds overlap or intersect each other" + }, + { + "name": "buildDesignCanvasMcpServerEntry", + "kind": "function", + "signature": "(opts: ScopedMcpServerEntryOptions) => AppToolMcpServer", + "doc": "Build the `AgentProfileMcpServer`-shaped entry for the design-canvas channel." + }, + { + "name": "BuildDesignCanvasMcpServerEntryOptions", + "kind": "type", + "signature": "type BuildDesignCanvasMcpServerEntryOptions", + "doc": "Build scoped MCP server entry options for the design canvas environment" + }, + { + "name": "CANVAS_ELEMENT_KINDS", + "kind": "const", + "signature": "readonly string[]", + "doc": "Provide a readonly array of string identifiers representing canvas element kinds" + }, + { + "name": "CANVAS_MCP_TOOL_NAMES", + "kind": "const", + "signature": "string[]", + "doc": "Extract names of all tools from the CANVAS_MCP_TOOLS array" + }, + { + "name": "CANVAS_MCP_TOOLS", + "kind": "const", + "signature": "McpToolDefinition[]", + "doc": "Provide a collection of MCP tool definitions for manipulating and querying the design canvas environment" + }, + { + "name": "CHANNEL_PRESETS", + "kind": "const", + "signature": "readonly ChannelPreset[]", + "doc": "Fixed output resolution presets for the channel/platform export dialog." + }, + { + "name": "ChannelPreset", + "kind": "interface", + "signature": "interface ChannelPreset", + "doc": "Define a preset configuration for a channel including its id, label, width, and height" + }, + { + "name": "ChannelPresetId", + "kind": "type", + "signature": "type ChannelPresetId", + "doc": "Resolve a valid channel preset identifier from the predefined channel presets array" + }, + { + "name": "ChannelScaleResult", + "kind": "interface", + "signature": "interface ChannelScaleResult", + "doc": "Define the pixel ratio and horizontal offset for scaling a Konva stage to a channel preset size" + }, + { + "name": "collectSlots", + "kind": "function", + "signature": "(document: SceneDocument) => Map (request: Request) => Promise", + "doc": "Create a request handler for the design canvas MCP tool with specified options" + }, + { + "name": "CreateDesignCanvasMcpHandlerOptions", + "kind": "interface", + "signature": "interface CreateDesignCanvasMcpHandlerOptions", + "doc": "Define options for creating a design canvas MCP handler including store, ID minting, and optional server info" + }, + { + "name": "createEmptyDocument", + "kind": "function", + "signature": "(title: string, page?: NewPageOptions | undefined) => SceneDocument", + "doc": "Create a new empty SceneDocument with a title and optional initial page settings" + }, + { + "name": "createPage", + "kind": "function", + "signature": "(options: NewPageOptions, id: string) => ScenePage", + "doc": "Create a new ScenePage with specified options and a unique identifier" + }, + { + "name": "DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION", + "kind": "const", + "signature": "\"Live visual asset editor for the current design document: read scene state, add/move/resize/delete elements, manage pa…", + "doc": "Describe the live visual asset editor capabilities for the current design document using CSS pixel coordinates" + }, + { + "name": "DeleteElementOperation", + "kind": "interface", + "signature": "interface DeleteElementOperation", + "doc": "Resolve deletion of a specific element from a page by its identifiers" + }, + { + "name": "DeletePageOperation", + "kind": "interface", + "signature": "interface DeletePageOperation", + "doc": "Represent a delete page operation with a specified page identifier" + }, + { + "name": "DesignCanvasMcpServerInfo", + "kind": "interface", + "signature": "interface DesignCanvasMcpServerInfo", + "doc": "Describe design canvas MCP server information including name and version" + }, + { + "name": "DesignCanvasMcpToolEnv", + "kind": "interface", + "signature": "interface DesignCanvasMcpToolEnv", + "doc": "Define the environment for MCP tool with a scene store and ID minting function" + }, + { + "name": "DuplicatePageOperation", + "kind": "interface", + "signature": "interface DuplicatePageOperation", + "doc": "Define an operation to duplicate a page with a new caller-specified page ID" + }, + { + "name": "elementAabb", + "kind": "function", + "signature": "(element: SceneElement) => Bounds", + "doc": "Axis-aligned bounding box in the parent's coordinate space, accounting for rotation about the element's top-left origin." + }, + { + "name": "elementExtent", + "kind": "function", + "signature": "(element: SceneElement) => { width: number; height: number; }", + "doc": "Unrotated local extent of an element (line/group derive from content)." + }, + { + "name": "EllipseElement", + "kind": "interface", + "signature": "interface EllipseElement", + "doc": "Define properties for an ellipse element including dimensions, fill, and optional stroke details" + }, + { + "name": "estimateTextHeight", + "kind": "function", + "signature": "(element: Pick) => number", + "doc": "Estimate the height of multiline text based on font size and line height" + }, + { + "name": "EXPORT_PRESETS", + "kind": "const", + "signature": "Record", + "doc": "Provide predefined export configurations for various social media and image formats" + }, + { + "name": "ExportCropRect", + "kind": "interface", + "signature": "interface ExportCropRect", + "doc": "Define crop rectangle coordinates and dimensions for exporting content within page bounds" + }, + { + "name": "ExportFormat", + "kind": "type", + "signature": "type ExportFormat", + "doc": "Define supported image export formats as PNG or JPEG" + }, + { + "name": "ExportPreset", + "kind": "interface", + "signature": "interface ExportPreset", + "doc": "Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag." + }, + { + "name": "findCanvasMcpTool", + "kind": "function", + "signature": "(name: string) => McpToolDefinition | undefined", + "doc": "Find the canvas MCP tool definition matching the given name or return undefined" + }, + { + "name": "findElement", + "kind": "function", + "signature": "(page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; } | null", + "doc": "Depth-first search across a page including group children." + }, + { + "name": "findPreset", + "kind": "function", + "signature": "(id: string) => SizePreset | null", + "doc": "Resolve a size preset by its identifier or return null if not found" + }, + { + "name": "GroupElement", + "kind": "interface", + "signature": "interface GroupElement", + "doc": "Define a group element that contains multiple child scene elements" + }, + { + "name": "GroupElementsOperation", + "kind": "interface", + "signature": "interface GroupElementsOperation", + "doc": "Group elements by grouping two or more sibling elements in their current z-order under a new group ID" + }, + { + "name": "ImageElement", + "kind": "interface", + "signature": "interface ImageElement", + "doc": "Define properties for an image element including source, dimensions, and fit mode" + }, + { + "name": "InstantiateOptions", + "kind": "interface", + "signature": "interface InstantiateOptions", + "doc": "Define options for instantiating a document with title, optional bindings, and custom id minting" + }, + { + "name": "instantiateTemplate", + "kind": "function", + "signature": "(document: SceneDocument, options: InstantiateOptions) => SceneDocument", + "doc": "Produces a new `SceneDocument` from a template: 1." + }, + { + "name": "LineElement", + "kind": "interface", + "signature": "interface LineElement", + "doc": "Define a line element with points, stroke, stroke width, and optional dash pattern" + }, + { + "name": "listTemplateSlots", + "kind": "function", + "signature": "(document: SceneDocument) => TemplateSlot[]", + "doc": "Wraps `collectSlots` with kind-aware fill typing so callers know WHAT to put in each slot without inspecting the element tree themselves." + }, + { + "name": "matchPreset", + "kind": "function", + "signature": "(width: number, height: number) => SizePreset | null", + "doc": "Match a (width, height) pair against the preset table." + }, + { + "name": "NewPageOptions", + "kind": "interface", + "signature": "interface NewPageOptions", + "doc": "Define options to configure a new page including name, dimensions, and background color" + }, + { + "name": "NewSceneDecision", + "kind": "interface", + "signature": "interface NewSceneDecision", + "doc": "Define the structure for decisions related to creating a new scene with instructions and optional details" + }, + { + "name": "PageBleed", + "kind": "interface", + "signature": "interface PageBleed", + "doc": "Per-side bleed extents in px, drawn OUTSIDE the page bounds." + }, + { + "name": "PageGuides", + "kind": "interface", + "signature": "interface PageGuides", + "doc": "Saved ruler guides, in page coordinates." + }, + { + "name": "RectElement", + "kind": "interface", + "signature": "interface RectElement", + "doc": "Define a rectangular scene element with size, fill, optional stroke, and corner radius properties" + }, + { + "name": "ReorderElementOperation", + "kind": "interface", + "signature": "interface ReorderElementOperation", + "doc": "Resolve an operation to reorder an element within its current owner by specifying the target index" + }, + { + "name": "ReorderPageOperation", + "kind": "interface", + "signature": "interface ReorderPageOperation", + "doc": "Represent an operation to reorder a page by moving it to a specified index" + }, + { + "name": "requireChannelPreset", + "kind": "function", + "signature": "(id: string) => ChannelPreset", + "doc": "Throws when the id is unknown — callers should only pass ids sourced from `CHANNEL_PRESETS`." + }, + { + "name": "requireElement", + "kind": "function", + "signature": "(page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; }", + "doc": "Resolve and return the element, its owner array, and index from the page by element ID" + }, + { + "name": "requirePage", + "kind": "function", + "signature": "(document: SceneDocument, pageId: string) => ScenePage", + "doc": "Resolve and return a page by ID from a document or throw an error if not found" + }, + { + "name": "scaleForPreset", + "kind": "function", + "signature": "(preset: ExportPreset, cropRect: ExportCropRect) => number", + "doc": "Pixel ratio for stage.toDataURL given a crop rect and an export preset." + }, + { + "name": "scalePageForChannelPreset", + "kind": "function", + "signature": "(page: Pick, channelPreset: ChannelPreset) => ChannelScaleResult", + "doc": "Computes the Konva stage parameters to render `page` centered inside `channelPreset` without cropping (contain / letterbox)." + }, + { + "name": "SCENE_ELEMENT_KINDS", + "kind": "const", + "signature": "readonly (\"text\" | \"image\" | \"rect\" | \"ellipse\" | \"line\" | \"video\" | \"group\")[]", + "doc": "Define all valid kinds of scene elements used in the application" + }, + { + "name": "SCENE_OPERATION_TYPES", + "kind": "const", + "signature": "readonly (\"add_element\" | \"set_attrs\" | \"reorder_element\" | \"delete_element\" | \"group_elements\" | \"ungroup_element\" | \"…", + "doc": "Define all valid operation types for scene manipulation in the application" + }, + { + "name": "SCENE_SCHEMA_VERSION", + "kind": "const", + "signature": "1", + "doc": "Define the current version number of the scene schema" + }, + { + "name": "SceneApplyResult", + "kind": "type", + "signature": "type SceneApplyResult", + "doc": "Represent the result of applying changes to a scene as an element, page, or entire document" + }, + { + "name": "SceneAttrsPatch", + "kind": "type", + "signature": "type SceneAttrsPatch", + "doc": "Per-kind attribute patch." + }, + { + "name": "SceneDecision", + "kind": "interface", + "signature": "interface SceneDecision", + "doc": "Define the structure for decisions made within a scene including type, instructions, and metadata" + }, + { + "name": "SceneDocument", + "kind": "interface", + "signature": "interface SceneDocument", + "doc": "Define the structure and properties of a scene document including version, title, pages, settings, and metadata" + }, + { + "name": "SceneDocumentRecord", + "kind": "interface", + "signature": "interface SceneDocumentRecord", + "doc": "Represent a scene document with its current revision number for version tracking" + }, + { + "name": "SceneElement", + "kind": "type", + "signature": "type SceneElement", + "doc": "Represent a graphical element in a scene including shapes, text, media, or groups" + }, + { + "name": "SceneElementBase", + "kind": "interface", + "signature": "interface SceneElementBase", + "doc": "Attributes every element carries." + }, + { + "name": "SceneElementKind", + "kind": "type", + "signature": "type SceneElementKind", + "doc": "Extract the kind property from a SceneElement to identify its element type" + }, + { + "name": "SceneExportFormat", + "kind": "type", + "signature": "type SceneExportFormat", + "doc": "Define supported formats for exporting a scene including image and JSON options" + }, + { + "name": "SceneExportRecord", + "kind": "interface", + "signature": "interface SceneExportRecord", + "doc": "Describe a scene export with its status, format, metadata, and result information" + }, + { + "name": "SceneOperation", + "kind": "type", + "signature": "type SceneOperation", + "doc": "Represent operations that modify scenes by adding, updating, reordering, grouping, or deleting elements and pages" + }, + { + "name": "SceneOperationType", + "kind": "type", + "signature": "type SceneOperationType", + "doc": "Extract the type property from a SceneOperation to represent its operation type" + }, + { + "name": "ScenePage", + "kind": "interface", + "signature": "interface ScenePage", + "doc": "Define the structure and properties of a scene page including layout, background, and elements" + }, + { + "name": "ScenePlan", + "kind": "interface", + "signature": "interface ScenePlan", + "doc": "Define a plan summarizing a scene with its description and associated operations" + }, + { + "name": "SceneSettings", + "kind": "interface", + "signature": "interface SceneSettings", + "doc": "Define settings for scene export including print conversion factor for unit calculations" + }, + { + "name": "SceneStore", + "kind": "interface", + "signature": "interface SceneStore", + "doc": "Manage scene documents, decisions, and exports with atomic save and revision control" + }, + { + "name": "SceneStoreScope", + "kind": "interface", + "signature": "interface SceneStoreScope", + "doc": "Per-request scope a product binds at store construction; decision and export rows attribute to the acting user — never trusted from tool args." + }, + { + "name": "SetAttrsOperation", + "kind": "interface", + "signature": "interface SetAttrsOperation", + "doc": "Define an operation to update attributes of a specific element on a page" + }, + { + "name": "SetDocumentTitleOperation", + "kind": "interface", + "signature": "interface SetDocumentTitleOperation", + "doc": "Define an operation to set the document title to a specified string" + }, + { + "name": "SetPageGuidesOperation", + "kind": "interface", + "signature": "interface SetPageGuidesOperation", + "doc": "Resolve an operation to set guides on a specific page by its identifier" + }, + { + "name": "SetPagePropsOperation", + "kind": "interface", + "signature": "interface SetPagePropsOperation", + "doc": "Define an operation to set or update properties of a page including size, background, and bleed" + }, + { + "name": "SIZE_PRESETS", + "kind": "const", + "signature": "readonly SizePreset[]", + "doc": "Provide predefined size presets for social, presentation, and print categories" + }, + { + "name": "SizePreset", + "kind": "interface", + "signature": "interface SizePreset", + "doc": "Define size presets with identifiers, labels, categories, and dimensions for various media types" + }, + { + "name": "SlotFillKind", + "kind": "type", + "signature": "type SlotFillKind", + "doc": "Define allowed string literals representing different slot fill kinds" + }, + { + "name": "storeApplyScenePlan", + "kind": "function", + "signature": "(store: SceneStore, plan: ScenePlan, opts: { actorKind: \"human_edit\" | \"agent_edit\" | \"agent_proposal\" | \"export\" | \"no…", + "doc": "Resolve and apply a scene plan to the store with specified actor context and generate results" + }, + { + "name": "TemplateSlot", + "kind": "interface", + "signature": "interface TemplateSlot", + "doc": "Define a slot template specifying its name, page, element, and fill characteristics" + }, + { + "name": "TextElement", + "kind": "interface", + "signature": "interface TextElement", + "doc": "Define properties for a text element including content, style, alignment, and layout parameters" + }, + { + "name": "UngroupElementOperation", + "kind": "interface", + "signature": "interface UngroupElementOperation", + "doc": "Resolve an operation to ungroup elements within a specified page and group context" + }, + { + "name": "validateBindings", + "kind": "function", + "signature": "(document: SceneDocument, bindings: Record) => string[]", + "doc": "Preflight check: every key in `bindings` must name a slot in the document." + }, + { + "name": "validateSceneOperation", + "kind": "function", + "signature": "(document: SceneDocument, operation: SceneOperation) => void", + "doc": "Validate a scene operation against the document to ensure it meets required constraints" + }, + { + "name": "validateSceneOperations", + "kind": "function", + "signature": "(document: SceneDocument, operations: SceneOperation[]) => void", + "doc": "Validate each scene operation against the document and throw detailed errors for invalid operations" + }, + { + "name": "validateSlotValue", + "kind": "function", + "signature": "(slotName: string, elementKind: \"text\" | \"image\" | \"rect\" | \"ellipse\" | \"line\" | \"video\" | \"group\", value: string) => v…", + "doc": "Validates that a slot binding value matches the slot element's kind." + }, + { + "name": "VideoElement", + "kind": "interface", + "signature": "interface VideoElement", + "doc": "Video placed on a canvas renders and exports as its poster frame — motion belongs to the sequences surface; this keeps video assets placeable in static layouts (e.g." + } + ] + }, + { + "id": "./design-canvas-react", + "source": "src/design-canvas-react/index.ts", + "dependsOn": [ + "brand", + "design-canvas", + "theme" + ], + "error": null, + "exports": [ + { + "name": "addElementCommand", + "kind": "function", + "signature": "(input: AddElementInput) => SceneCommand", + "doc": "Create a command to add an element to a scene with optional positioning and grouping" + }, + { + "name": "AddElementInput", + "kind": "interface", + "signature": "interface AddElementInput", + "doc": "Define input parameters for adding a scene element with optional index and parent group ID" + }, + { + "name": "addPageCommand", + "kind": "function", + "signature": "(input: AddPageInput) => SceneCommand", + "doc": "Create a command to add a page with optional settings and index in the scene" + }, + { + "name": "AddPageInput", + "kind": "interface", + "signature": "interface AddPageInput", + "doc": "Define input parameters for adding a new page with optional settings and position index" + }, + { + "name": "ApplySceneResult", + "kind": "interface", + "signature": "interface ApplySceneResult", + "doc": "Resolve the result of applying a scene update including revision and optional normalized document" + }, + { + "name": "BakedNodeAttrs", + "kind": "interface", + "signature": "interface BakedNodeAttrs", + "doc": "Define baked node attributes including position, size, and rotation with collapsed scale" + }, + { + "name": "bakeLineTransform", + "kind": "function", + "signature": "(node: TransformerNode & { points: number[]; }) => BakedNodeAttrs & { points: number[]; }", + "doc": "Lines store points as a flat [x0, y0, x1, y1, ...] array relative to the line element's (x, y)." + }, + { + "name": "bakeRectTransform", + "kind": "function", + "signature": "(node: TransformerNode) => BakedNodeAttrs", + "doc": "Collapse Konva scaleX/scaleY into width/height so the model always stores true pixel dimensions." + }, + { + "name": "bakeTextTransform", + "kind": "function", + "signature": "(node: TransformerNode & { fontSize: number; }) => BakedNodeAttrs & { fontSize: number; }", + "doc": "Text nodes have a fixed wrap width; scaling that width is what the transformer controls." + }, + { + "name": "bindSlotCommand", + "kind": "function", + "signature": "(input: BindSlotInput) => SceneCommand", + "doc": "Bind a slot to an element within a page and generate the corresponding scene command" + }, + { + "name": "BindSlotInput", + "kind": "interface", + "signature": "interface BindSlotInput", + "doc": "Define input parameters for binding a slot within a scene document element" + }, + { + "name": "bleedAwareExportBounds", + "kind": "function", + "signature": "(page: ScenePage, includeBleed: boolean) => ExportCropRect", + "doc": "Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins." + }, + { + "name": "BTN", + "kind": "const", + "signature": "\"flex h-7 w-7 items-center justify-center rounded border border-[var(--border-default)] text-[var(--text-secondary)] tr…", + "doc": "28px square (h-7) — used by the main toolbar." + }, + { + "name": "BTN_ACTIVE", + "kind": "const", + "signature": "string", + "doc": null + }, + { + "name": "BTN_SM", + "kind": "const", + "signature": "\"flex h-6 w-6 items-center justify-center rounded border border-[var(--border-default)] text-[var(--text-secondary)] tr…", + "doc": "24px square (h-6) — used by the zoom controls and pages strip." + }, + { + "name": "BTN_SM_ACTIVE", + "kind": "const", + "signature": "string", + "doc": null + }, + { + "name": "buildInsertImageOp", + "kind": "function", + "signature": "(src: string, naturalSize: { width: number; height: number; }, page: InsertPageGeometry) => SceneOperation", + "doc": "Build an `add_element` op placing an image, fitted and centered on the page." + }, + { + "name": "buildRulerTicks", + "kind": "function", + "signature": "(input: { documentLength: number; step: TickStep; }) => RulerTick[]", + "doc": "Generate all ticks visible in a ruler of `documentLength` document-px, given the current tick step." + }, + { + "name": "CanvasEmptyState", + "kind": "function", + "signature": "({ onStartTemplate, onAddElement, onAskAgent, title, subtitle, className, }: CanvasEmptyStateProps) => Element", + "doc": "The three-door empty state." + }, + { + "name": "CanvasEmptyStateProps", + "kind": "interface", + "signature": "interface CanvasEmptyStateProps", + "doc": null + }, + { + "name": "CanvasInsertPanel", + "kind": "function", + "signature": "({ canWrite, page, onInsert, onUploadImage, loadGenerations, templates, accept, className, }: CanvasInsertPanelProps) =…", + "doc": null + }, + { + "name": "CanvasInsertPanelProps", + "kind": "interface", + "signature": "interface CanvasInsertPanelProps", + "doc": null + }, + { + "name": "centeredPosition", + "kind": "function", + "signature": "(width: number, height: number, pageWidth: number, pageHeight: number) => { x: number; y: number; }", + "doc": "Top-left position that centers a (width, height) box on the page." + }, + { + "name": "collectGridTargets", + "kind": "function", + "signature": "(bounds: Bounds, gridSize: number, page: ScenePage, thresholdDocPx: number) => { vertical: SnapTarget[]; horizontal: Sn…", + "doc": "Generate grid line targets within a neighborhood around the moving bounds." + }, + { + "name": "createSceneCommandStack", + "kind": "function", + "signature": "(document: SceneDocument, activePageId: string) => SceneCommandStackWithReapply", + "doc": "Create a command stack for scene editing with reapply capabilities based on the given document and page ID" + }, + { + "name": "createSnapEngine", + "kind": "function", + "signature": "() => SnapEngine", + "doc": "Build a SnapEngine instance to manage snapping targets and behavior within an editor scene" + }, + { + "name": "createZoomPanMath", + "kind": "function", + "signature": "(config: ZoomPanConfig) => ZoomPanMath", + "doc": "Create zoom and pan math utilities enforcing valid zoom range constraints" + }, + { + "name": "DEFAULT_INSERT_TEMPLATES", + "kind": "const", + "signature": "readonly InsertTemplate[]", + "doc": "The built-in starter templates (heading, body text, rectangle, ellipse)." + }, + { + "name": "deleteElementCommand", + "kind": "function", + "signature": "(input: DeleteElementInput) => SceneCommand", + "doc": "Resolve a command to delete an element from a specified page in the document" + }, + { + "name": "DeleteElementInput", + "kind": "interface", + "signature": "interface DeleteElementInput", + "doc": "Define input parameters required to delete an element from a specific page in a document" + }, + { + "name": "deletePageCommand", + "kind": "function", + "signature": "(input: DeletePageInput) => SceneCommand", + "doc": "Delete a page from a document ensuring it is not the last remaining page" + }, + { + "name": "DeletePageInput", + "kind": "interface", + "signature": "interface DeletePageInput", + "doc": "Define input parameters required to delete a page from a scene document" + }, + { + "name": "DesignCanvas", + "kind": "function", + "signature": "({ document: initialDocument, rev: initialRev, canWrite, mode, onApplyOperations, onSelectionChange, renderAgentPanel,…", + "doc": null + }, + { + "name": "DesignCanvasChromeLazy", + "kind": "function", + "signature": "LazyExoticComponent<({ document: initialDocument, rev: initialRev, canWrite, mode, onApplyOperations, onSelectionChange…", + "doc": "Raw chrome only — use when supplying a custom renderWorkspace/renderThumbnail." + }, + { + "name": "DesignCanvasEditor", + "kind": "function", + "signature": "(props: DesignCanvasProps) => Element", + "doc": "Mount this component to get the full editor: toolbar, rulers, layers panel, pages strip, zoom controls, and the Konva canvas — all sharing one command stack so undo/redo and selection are coherent ac…" + }, + { + "name": "DesignCanvasFullProps", + "kind": "interface", + "signature": "interface DesignCanvasFullProps", + "doc": "Callers inject a workspace renderer so this chrome stays Konva-free." + }, + { + "name": "DesignCanvasLazy", + "kind": "function", + "signature": "LazyExoticComponent<(props: DesignCanvasProps) => Element>", + "doc": "Batteries-included editor: chrome + workspace on one shared stack." + }, + { + "name": "DesignCanvasMode", + "kind": "type", + "signature": "type DesignCanvasMode", + "doc": "Editor capability mode." + }, + { + "name": "DesignCanvasProps", + "kind": "interface", + "signature": "interface DesignCanvasProps", + "doc": "Define properties and callbacks for configuring and controlling the design canvas editor" + }, + { + "name": "documentCropToStageCoords", + "kind": "function", + "signature": "(cropRect: ExportCropRect, stageScale: number, stageX: number, stageY: number) => { x: number; y: number; width: number…", + "doc": "Build the toDataURL crop rect translated to stage output coordinates." + }, + { + "name": "downloadDataUrl", + "kind": "function", + "signature": "(dataUrl: string, filename: string) => void", + "doc": "Trigger a browser download for a data URL." + }, + { + "name": "DUPLICATE_OFFSET", + "kind": "const", + "signature": "NudgeDelta", + "doc": "Document-px offset applied to duplicated elements so the copy is visually separated from the original (matching common design-tool convention)." + }, + { + "name": "duplicatePageCommand", + "kind": "function", + "signature": "(input: DuplicatePageInput) => SceneCommand", + "doc": "Create a command to duplicate a page and prepare its deletion operation in the scene" + }, + { + "name": "DuplicatePageInput", + "kind": "interface", + "signature": "interface DuplicatePageInput", + "doc": "Define input parameters required to duplicate a page within a scene document" + }, + { + "name": "EditorSceneState", + "kind": "interface", + "signature": "interface EditorSceneState", + "doc": "Define the state of the editor scene including document, view settings, and selection details" + }, + { + "name": "ElementNode", + "kind": "function", + "signature": "MemoExoticComponent<(props: ElementNodeProps) => Element | null>", + "doc": "Memoized so a `stack.notify()` (fired ~120/s during a pan/marquee) that re-renders WorkspaceView does NOT re-render every element." + }, + { + "name": "ElementNodeProps", + "kind": "interface", + "signature": "interface ElementNodeProps", + "doc": null + }, + { + "name": "ExportControl", + "kind": "function", + "signature": "({ defaults, onExport, className }: ExportControlProps) => Element", + "doc": null + }, + { + "name": "ExportControlProps", + "kind": "interface", + "signature": "interface ExportControlProps", + "doc": null + }, + { + "name": "ExportCropRect", + "kind": "interface", + "signature": "interface ExportCropRect", + "doc": "Define crop rectangle coordinates and dimensions for exporting content within page bounds" + }, + { + "name": "exportDocumentJson", + "kind": "function", + "signature": "(document: SceneDocument) => string", + "doc": "Serialize a scene document to pretty-printed JSON with schemaVersion asserted." + }, + { + "name": "exportPageDataUrl", + "kind": "function", + "signature": "(stage: KonvaStageLike, page: ScenePage, opts: ExportPageDataUrlOptions) => Promise", + "doc": "Render a single page to a data URL." + }, + { + "name": "ExportPageDataUrlOptions", + "kind": "interface", + "signature": "interface ExportPageDataUrlOptions", + "doc": "Define options to export a page as a data URL with format, pixel ratio, bleed, and preset settings" + }, + { + "name": "ExportPreset", + "kind": "interface", + "signature": "interface ExportPreset", + "doc": "Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag." + }, + { + "name": "ExportTriggerOptions", + "kind": "interface", + "signature": "interface ExportTriggerOptions", + "doc": "What the chrome's Export control collects and hands to the workspace's export callback." + }, + { + "name": "ExportViewSnapshot", + "kind": "interface", + "signature": "interface ExportViewSnapshot", + "doc": "Minimal snapshot of stage view state that export.ts saves before mutating zoom/pan/visibility and restores afterward." + }, + { + "name": "fittedSize", + "kind": "function", + "signature": "(naturalW: number, naturalH: number, pageWidth: number, pageHeight: number) => { width: number; height: number; }", + "doc": "Fit (naturalW, naturalH) under a max-dimension cap (further bounded by the page), preserving aspect ratio." + }, + { + "name": "flattenLayerTree", + "kind": "function", + "signature": "(page: ScenePage) => LayerRow[]", + "doc": "Flatten `page.elements` into display order for the layers panel." + }, + { + "name": "formatRulerLabel", + "kind": "function", + "signature": "(value: number) => string", + "doc": "Format a document-px position as a compact label: integers stay whole, decimals are rounded to 1 place." + }, + { + "name": "GridLayer", + "kind": "function", + "signature": "({ pageWidth, pageHeight, gridSize, zoom, panX, panY, color, opacity, }: GridLayerProps) => Element | null", + "doc": null + }, + { + "name": "GridLayerProps", + "kind": "interface", + "signature": "interface GridLayerProps", + "doc": null + }, + { + "name": "groupElementsCommand", + "kind": "function", + "signature": "(input: GroupElementsInput) => SceneCommand", + "doc": "Create a command to group multiple elements into a single group within a scene" + }, + { + "name": "GroupElementsInput", + "kind": "interface", + "signature": "interface GroupElementsInput", + "doc": "Define input parameters for grouping elements within a scene document on a specific page" + }, + { + "name": "hitTestPoint", + "kind": "function", + "signature": "(page: ScenePage, x: number, y: number) => string | null", + "doc": "Top-most selectable element whose AABB contains the document-space point, or null when the point is over empty space." + }, + { + "name": "IconButton", + "kind": "function", + "signature": "ForwardRefExoticComponent>", + "doc": null + }, + { + "name": "IconButtonProps", + "kind": "interface", + "signature": "interface IconButtonProps", + "doc": null + }, + { + "name": "identifyTaintedSrc", + "kind": "function", + "signature": "(imageSrcs: readonly { name: string; src: string; }[]) => string | null", + "doc": "Walk image nodes to find the src of any that may have caused a SecurityError when the stage called toDataURL." + }, + { + "name": "InsertGeneration", + "kind": "interface", + "signature": "interface InsertGeneration", + "doc": "An already-generated image the panel can offer for one-click insertion." + }, + { + "name": "InsertPageGeometry", + "kind": "interface", + "signature": "interface InsertPageGeometry", + "doc": "Active page geometry an insert lands into — drives centering and fitting." + }, + { + "name": "InsertTemplate", + "kind": "interface", + "signature": "interface InsertTemplate", + "doc": "A template the insert panel can drop without the agent." + }, + { + "name": "isCrossOriginSrc", + "kind": "function", + "signature": "(src: string) => boolean", + "doc": "Heuristic: a src is potentially cross-origin when it is an absolute http(s) URL." + }, + { + "name": "isExportHiddenNodeName", + "kind": "function", + "signature": "(name: string) => boolean", + "doc": "Returns true for any Konva node that must be hidden during export." + }, + { + "name": "LayerRow", + "kind": "interface", + "signature": "interface LayerRow", + "doc": "Describe a layer row with its element, depth, grouping, ownership, and parent group details" + }, + { + "name": "LAYERS_PANEL_ROW_LIMIT", + "kind": "const", + "signature": "500", + "doc": "The maximum number of rows the layers panel renders before truncating." + }, + { + "name": "LayersPanel", + "kind": "function", + "signature": "({ page, selectedElementIds, canWrite, onSetAttrs, onReorder, onSelect }: LayersPanelProps) => Element", + "doc": null + }, + { + "name": "LayersPanelProps", + "kind": "interface", + "signature": "interface LayersPanelProps", + "doc": null + }, + { + "name": "marqueeSelect", + "kind": "function", + "signature": "(page: ScenePage, rect: Bounds, opts?: MarqueeSelectOptions) => string[]", + "doc": "Returns the ids of selectable elements on `page` whose AABB intersects (or is contained by) `rect`." + }, + { + "name": "MarqueeSelectOptions", + "kind": "interface", + "signature": "interface MarqueeSelectOptions", + "doc": "Define options to configure marquee selection behavior including containment requirements" + }, + { + "name": "MAX_INSERT_DIMENSION", + "kind": "const", + "signature": "600", + "doc": "Largest dimension (document px) a freshly inserted element is fitted to, before the page-size cap applies." + }, + { + "name": "mintElementId", + "kind": "function", + "signature": "() => string", + "doc": "Mint a DOM-safe element id." + }, + { + "name": "multiSetAttrsCommand", + "kind": "function", + "signature": "(entries: MultiSetAttrsEntry[]) => SceneCommand", + "doc": "Build a scene command to set multiple attributes on elements across pages" + }, + { + "name": "MultiSetAttrsEntry", + "kind": "interface", + "signature": "interface MultiSetAttrsEntry", + "doc": "Define an entry linking page and element IDs with current and prior scene attribute patches" + }, + { + "name": "nudgeDelta", + "kind": "function", + "signature": "(key: \"ArrowLeft\" | \"ArrowRight\" | \"ArrowUp\" | \"ArrowDown\", shift: boolean) => NudgeDelta", + "doc": "Map an arrow key to a document-px delta." + }, + { + "name": "NudgeDelta", + "kind": "interface", + "signature": "interface NudgeDelta", + "doc": "Represent horizontal and vertical displacement values for nudging elements" + }, + { + "name": "PagesStrip", + "kind": "function", + "signature": "({ pages, activePageId, canWrite, renderThumbnail, onSelectPage, onAddPage, onDuplicatePage, onDeletePage, onReorderPag…", + "doc": null + }, + { + "name": "PagesStripProps", + "kind": "interface", + "signature": "interface PagesStripProps", + "doc": null + }, + { + "name": "reorderElementCommand", + "kind": "function", + "signature": "(input: ReorderElementInput) => SceneCommand", + "doc": "Resolve a command to reorder an element within a scene by moving it to a specified index" + }, + { + "name": "ReorderElementInput", + "kind": "interface", + "signature": "interface ReorderElementInput", + "doc": "Define input parameters to reorder an element within a page" + }, + { + "name": "reorderPageCommand", + "kind": "function", + "signature": "(input: ReorderPageInput) => SceneCommand", + "doc": "Create a command to reorder a page to a specified index within a scene" + }, + { + "name": "ReorderPageInput", + "kind": "interface", + "signature": "interface ReorderPageInput", + "doc": "Define input parameters to reorder a page by specifying its ID and target index" + }, + { + "name": "ResolvedExportParams", + "kind": "interface", + "signature": "interface ResolvedExportParams", + "doc": "Define parameters required to resolve export settings including crop, pixel ratio, type, and quality" + }, + { + "name": "resolveExportParams", + "kind": "function", + "signature": "(page: ScenePage, opts: { format: \"png\" | \"jpeg\"; pixelRatio?: number | undefined; includeBleed?: boolean | undefined;…", + "doc": "Resolve the full set of toDataURL params from a page, format, pixel ratio, bleed flag, and optional preset." + }, + { + "name": "Rulers", + "kind": "function", + "signature": "({ pageWidth, pageHeight, zoom, scrollLeft, scrollTop, showRulers, guides, onGuidesChange }: RulersProps) => Element |…", + "doc": null + }, + { + "name": "RulersProps", + "kind": "interface", + "signature": "interface RulersProps", + "doc": null + }, + { + "name": "RulerTick", + "kind": "interface", + "signature": "interface RulerTick", + "doc": "Define a ruler tick with a position and optional label for measurement markings" + }, + { + "name": "scaleForPreset", + "kind": "function", + "signature": "(preset: ExportPreset, cropRect: ExportCropRect) => number", + "doc": "Pixel ratio for stage.toDataURL given a crop rect and an export preset." + }, + { + "name": "SCENE_COMMAND_HISTORY_LIMIT", + "kind": "const", + "signature": "200", + "doc": "Oldest entries are dropped past this bound; redo stack is cleared on execute." + }, + { + "name": "SceneCommand", + "kind": "interface", + "signature": "interface SceneCommand", + "doc": "Define a command with execution, undo, and operation methods for scene editing and persistence" + }, + { + "name": "SceneCommandStack", + "kind": "interface", + "signature": "interface SceneCommandStack", + "doc": "Manage and track scene commands with undo, redo, and state subscription capabilities" + }, + { + "name": "SceneCommandStackWithReapply", + "kind": "interface", + "signature": "interface SceneCommandStackWithReapply", + "doc": "The base {@link SceneCommandStack} plus the two command-specific recovery primitives the undo/redo persistence path needs." + }, + { + "name": "SelectionLayer", + "kind": "function", + "signature": "({ stageRef, selectedIds, selectedElements, canWrite, onTransformEnd, pageId, render, }: SelectionLayerProps) => Element", + "doc": null + }, + { + "name": "SelectionLayerProps", + "kind": "interface", + "signature": "interface SelectionLayerProps", + "doc": null + }, + { + "name": "selectTickStep", + "kind": "function", + "signature": "(input: { zoom: number; minMajorSpacingPx?: number | undefined; minMinorSpacingPx?: number | undefined; }) => TickStep", + "doc": "Select the major tick step that keeps major ticks ≥ minMajorSpacingPx apart at the given zoom." + }, + { + "name": "setAttrsCommand", + "kind": "function", + "signature": "(input: SetAttrsInput) => SceneCommand", + "doc": "Create a command to set attributes on a scene element with undo capability" + }, + { + "name": "SetAttrsInput", + "kind": "interface", + "signature": "interface SetAttrsInput", + "doc": "Define input parameters for setting element attributes within a specific page context" + }, + { + "name": "setDocumentTitleCommand", + "kind": "function", + "signature": "(input: SetDocumentTitleInput) => SceneCommand", + "doc": "Resolve a command to rename a document title with undo and redo operations" + }, + { + "name": "SetDocumentTitleInput", + "kind": "interface", + "signature": "interface SetDocumentTitleInput", + "doc": "Define input parameters for setting the title of a scene document" + }, + { + "name": "setPageGuidesCommand", + "kind": "function", + "signature": "(input: SetPageGuidesInput) => SceneCommand", + "doc": "Create a command to update page guides with undo support" + }, + { + "name": "SetPageGuidesInput", + "kind": "interface", + "signature": "interface SetPageGuidesInput", + "doc": "Define input parameters for setting guides on a specific page within a document" + }, + { + "name": "setPagePropsCommand", + "kind": "function", + "signature": "(input: SetPagePropsInput) => SceneCommand", + "doc": "Build a command to update page properties based on the provided input" + }, + { + "name": "SetPagePropsInput", + "kind": "interface", + "signature": "interface SetPagePropsInput", + "doc": "Define input parameters for setting properties on a specific page within a scene document" + }, + { + "name": "SnapEngine", + "kind": "interface", + "signature": "interface SnapEngine", + "doc": "Resolve snapping targets and apply snapping logic to moving elements within the editor scene" + }, + { + "name": "SnapResult", + "kind": "interface", + "signature": "interface SnapResult", + "doc": "Define the result of a snap operation including coordinates and active snap lines" + }, + { + "name": "SnapTarget", + "kind": "interface", + "signature": "interface SnapTarget", + "doc": "Define a target position and kind for snapping elements on a page" + }, + { + "name": "SnapTargetKind", + "kind": "type", + "signature": "type SnapTargetKind", + "doc": "Define snap target categories for aligning elements within a layout system" + }, + { + "name": "SnapTargets", + "kind": "interface", + "signature": "interface SnapTargets", + "doc": "Define vertical and horizontal collections of snap targets for alignment purposes" + }, + { + "name": "TickStep", + "kind": "interface", + "signature": "interface TickStep", + "doc": "Define spacing and visibility rules for major and minor ticks in a coordinate system" + }, + { + "name": "Toolbar", + "kind": "function", + "signature": "({ page, selectedElements, canWrite, mode, canUndo, canRedo, gridEnabled, snapEnabled, showRulers, showBleed, onUndo, o…", + "doc": null + }, + { + "name": "ToolbarProps", + "kind": "interface", + "signature": "interface ToolbarProps", + "doc": null + }, + { + "name": "TransformerNode", + "kind": "interface", + "signature": "interface TransformerNode", + "doc": "Pure geometry helpers extracted from component drag/transform logic so every interactive math path is unit-testable without Konva or a DOM." + }, + { + "name": "ungroupElementCommand", + "kind": "function", + "signature": "(input: UngroupElementInput) => SceneCommand", + "doc": "Resolve a command to ungroup a group element into its child elements within a scene" + }, + { + "name": "UngroupElementInput", + "kind": "interface", + "signature": "interface UngroupElementInput", + "doc": "Define input parameters required to ungroup elements within a specific page and group" + }, + { + "name": "Workspace", + "kind": "function", + "signature": "(props: DesignCanvasProps) => Element | null", + "doc": "Self-contained Konva workspace that creates its own command stack." + }, + { + "name": "WorkspaceView", + "kind": "function", + "signature": "({ canWrite, onApplyOperations, onSelectionChange, className, stack, activePage, onFitRef, onExport, onExportRef, fitOn…", + "doc": null + }, + { + "name": "WorkspaceViewProps", + "kind": "interface", + "signature": "interface WorkspaceViewProps", + "doc": null + }, + { + "name": "ZoomControls", + "kind": "function", + "signature": "({ zoom, onZoom, onFit, fitLabel }: ZoomControlsProps) => Element", + "doc": null + }, + { + "name": "ZoomControlsProps", + "kind": "interface", + "signature": "interface ZoomControlsProps", + "doc": null + }, + { + "name": "ZoomPanConfig", + "kind": "interface", + "signature": "interface ZoomPanConfig", + "doc": "Define configuration options for minimum and maximum zoom levels in a zoom-pan interface" + }, + { + "name": "ZoomPanMath", + "kind": "interface", + "signature": "interface ZoomPanMath", + "doc": "Define methods and properties to calculate zoom and pan transformations between document and screen coordinates" + } + ] + }, + { + "id": "./design-canvas-react/engine", + "source": "src/design-canvas-react/engine.ts", + "dependsOn": [ + "brand", + "design-canvas", + "theme" + ], + "error": null, + "exports": [ + { + "name": "addElementCommand", + "kind": "function", + "signature": "(input: AddElementInput) => SceneCommand", + "doc": "Create a command to add an element to a scene with optional positioning and grouping" + }, + { + "name": "AddElementInput", + "kind": "interface", + "signature": "interface AddElementInput", + "doc": "Define input parameters for adding a scene element with optional index and parent group ID" + }, + { + "name": "addPageCommand", + "kind": "function", + "signature": "(input: AddPageInput) => SceneCommand", + "doc": "Create a command to add a page with optional settings and index in the scene" + }, + { + "name": "AddPageInput", + "kind": "interface", + "signature": "interface AddPageInput", + "doc": "Define input parameters for adding a new page with optional settings and position index" + }, + { + "name": "ApplySceneResult", + "kind": "interface", + "signature": "interface ApplySceneResult", + "doc": "Resolve the result of applying a scene update including revision and optional normalized document" + }, + { + "name": "bindSlotCommand", + "kind": "function", + "signature": "(input: BindSlotInput) => SceneCommand", + "doc": "Bind a slot to an element within a page and generate the corresponding scene command" + }, + { + "name": "BindSlotInput", + "kind": "interface", + "signature": "interface BindSlotInput", + "doc": "Define input parameters for binding a slot within a scene document element" + }, + { + "name": "bleedAwareExportBounds", + "kind": "function", + "signature": "(page: ScenePage, includeBleed: boolean) => ExportCropRect", + "doc": "Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins." + }, + { + "name": "buildInsertImageOp", + "kind": "function", + "signature": "(src: string, naturalSize: { width: number; height: number; }, page: InsertPageGeometry) => SceneOperation", + "doc": "Build an `add_element` op placing an image, fitted and centered on the page." + }, + { + "name": "centeredPosition", + "kind": "function", + "signature": "(width: number, height: number, pageWidth: number, pageHeight: number) => { x: number; y: number; }", + "doc": "Top-left position that centers a (width, height) box on the page." + }, + { + "name": "collectGridTargets", + "kind": "function", + "signature": "(bounds: Bounds, gridSize: number, page: ScenePage, thresholdDocPx: number) => { vertical: SnapTarget[]; horizontal: Sn…", + "doc": "Generate grid line targets within a neighborhood around the moving bounds." + }, + { + "name": "createSceneCommandStack", + "kind": "function", + "signature": "(document: SceneDocument, activePageId: string) => SceneCommandStackWithReapply", + "doc": "Create a command stack for scene editing with reapply capabilities based on the given document and page ID" + }, + { + "name": "createSnapEngine", + "kind": "function", + "signature": "() => SnapEngine", + "doc": "Build a SnapEngine instance to manage snapping targets and behavior within an editor scene" + }, + { + "name": "createZoomPanMath", + "kind": "function", + "signature": "(config: ZoomPanConfig) => ZoomPanMath", + "doc": "Create zoom and pan math utilities enforcing valid zoom range constraints" + }, + { + "name": "DEFAULT_INSERT_TEMPLATES", + "kind": "const", + "signature": "readonly InsertTemplate[]", + "doc": "The built-in starter templates (heading, body text, rectangle, ellipse)." + }, + { + "name": "deleteElementCommand", + "kind": "function", + "signature": "(input: DeleteElementInput) => SceneCommand", + "doc": "Resolve a command to delete an element from a specified page in the document" + }, + { + "name": "DeleteElementInput", + "kind": "interface", + "signature": "interface DeleteElementInput", + "doc": "Define input parameters required to delete an element from a specific page in a document" + }, + { + "name": "deletePageCommand", + "kind": "function", + "signature": "(input: DeletePageInput) => SceneCommand", + "doc": "Delete a page from a document ensuring it is not the last remaining page" + }, + { + "name": "DeletePageInput", + "kind": "interface", + "signature": "interface DeletePageInput", + "doc": "Define input parameters required to delete a page from a scene document" + }, + { + "name": "DesignCanvasMode", + "kind": "type", + "signature": "type DesignCanvasMode", + "doc": "Editor capability mode." + }, + { + "name": "DesignCanvasProps", + "kind": "interface", + "signature": "interface DesignCanvasProps", + "doc": "Define properties and callbacks for configuring and controlling the design canvas editor" + }, + { + "name": "documentCropToStageCoords", + "kind": "function", + "signature": "(cropRect: ExportCropRect, stageScale: number, stageX: number, stageY: number) => { x: number; y: number; width: number…", + "doc": "Build the toDataURL crop rect translated to stage output coordinates." + }, + { + "name": "DUPLICATE_OFFSET", + "kind": "const", + "signature": "NudgeDelta", + "doc": "Document-px offset applied to duplicated elements so the copy is visually separated from the original (matching common design-tool convention)." + }, + { + "name": "duplicatePageCommand", + "kind": "function", + "signature": "(input: DuplicatePageInput) => SceneCommand", + "doc": "Create a command to duplicate a page and prepare its deletion operation in the scene" + }, + { + "name": "DuplicatePageInput", + "kind": "interface", + "signature": "interface DuplicatePageInput", + "doc": "Define input parameters required to duplicate a page within a scene document" + }, + { + "name": "EditorSceneState", + "kind": "interface", + "signature": "interface EditorSceneState", + "doc": "Define the state of the editor scene including document, view settings, and selection details" + }, + { + "name": "ExportCropRect", + "kind": "interface", + "signature": "interface ExportCropRect", + "doc": "Define crop rectangle coordinates and dimensions for exporting content within page bounds" + }, + { + "name": "ExportPreset", + "kind": "interface", + "signature": "interface ExportPreset", + "doc": "Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag." + }, + { + "name": "ExportTriggerOptions", + "kind": "interface", + "signature": "interface ExportTriggerOptions", + "doc": "What the chrome's Export control collects and hands to the workspace's export callback." + }, + { + "name": "ExportViewSnapshot", + "kind": "interface", + "signature": "interface ExportViewSnapshot", + "doc": "Minimal snapshot of stage view state that export.ts saves before mutating zoom/pan/visibility and restores afterward." + }, + { + "name": "fittedSize", + "kind": "function", + "signature": "(naturalW: number, naturalH: number, pageWidth: number, pageHeight: number) => { width: number; height: number; }", + "doc": "Fit (naturalW, naturalH) under a max-dimension cap (further bounded by the page), preserving aspect ratio." + }, + { + "name": "groupElementsCommand", + "kind": "function", + "signature": "(input: GroupElementsInput) => SceneCommand", + "doc": "Create a command to group multiple elements into a single group within a scene" + }, + { + "name": "GroupElementsInput", + "kind": "interface", + "signature": "interface GroupElementsInput", + "doc": "Define input parameters for grouping elements within a scene document on a specific page" + }, + { + "name": "hitTestPoint", + "kind": "function", + "signature": "(page: ScenePage, x: number, y: number) => string | null", + "doc": "Top-most selectable element whose AABB contains the document-space point, or null when the point is over empty space." + }, + { + "name": "identifyTaintedSrc", + "kind": "function", + "signature": "(imageSrcs: readonly { name: string; src: string; }[]) => string | null", + "doc": "Walk image nodes to find the src of any that may have caused a SecurityError when the stage called toDataURL." + }, + { + "name": "InsertPageGeometry", + "kind": "interface", + "signature": "interface InsertPageGeometry", + "doc": "Active page geometry an insert lands into — drives centering and fitting." + }, + { + "name": "InsertTemplate", + "kind": "interface", + "signature": "interface InsertTemplate", + "doc": "A template the insert panel can drop without the agent." + }, + { + "name": "isCrossOriginSrc", + "kind": "function", + "signature": "(src: string) => boolean", + "doc": "Heuristic: a src is potentially cross-origin when it is an absolute http(s) URL." + }, + { + "name": "isExportHiddenNodeName", + "kind": "function", + "signature": "(name: string) => boolean", + "doc": "Returns true for any Konva node that must be hidden during export." + }, + { + "name": "marqueeSelect", + "kind": "function", + "signature": "(page: ScenePage, rect: Bounds, opts?: MarqueeSelectOptions) => string[]", + "doc": "Returns the ids of selectable elements on `page` whose AABB intersects (or is contained by) `rect`." + }, + { + "name": "MarqueeSelectOptions", + "kind": "interface", + "signature": "interface MarqueeSelectOptions", + "doc": "Define options to configure marquee selection behavior including containment requirements" + }, + { + "name": "MAX_INSERT_DIMENSION", + "kind": "const", + "signature": "600", + "doc": "Largest dimension (document px) a freshly inserted element is fitted to, before the page-size cap applies." + }, + { + "name": "mintElementId", + "kind": "function", + "signature": "() => string", + "doc": "Mint a DOM-safe element id." + }, + { + "name": "multiSetAttrsCommand", + "kind": "function", + "signature": "(entries: MultiSetAttrsEntry[]) => SceneCommand", + "doc": "Build a scene command to set multiple attributes on elements across pages" + }, + { + "name": "MultiSetAttrsEntry", + "kind": "interface", + "signature": "interface MultiSetAttrsEntry", + "doc": "Define an entry linking page and element IDs with current and prior scene attribute patches" + }, + { + "name": "nudgeDelta", + "kind": "function", + "signature": "(key: \"ArrowLeft\" | \"ArrowRight\" | \"ArrowUp\" | \"ArrowDown\", shift: boolean) => NudgeDelta", + "doc": "Map an arrow key to a document-px delta." + }, + { + "name": "NudgeDelta", + "kind": "interface", + "signature": "interface NudgeDelta", + "doc": "Represent horizontal and vertical displacement values for nudging elements" + }, + { + "name": "reorderElementCommand", + "kind": "function", + "signature": "(input: ReorderElementInput) => SceneCommand", + "doc": "Resolve a command to reorder an element within a scene by moving it to a specified index" + }, + { + "name": "ReorderElementInput", + "kind": "interface", + "signature": "interface ReorderElementInput", + "doc": "Define input parameters to reorder an element within a page" + }, + { + "name": "reorderPageCommand", + "kind": "function", + "signature": "(input: ReorderPageInput) => SceneCommand", + "doc": "Create a command to reorder a page to a specified index within a scene" + }, + { + "name": "ReorderPageInput", + "kind": "interface", + "signature": "interface ReorderPageInput", + "doc": "Define input parameters to reorder a page by specifying its ID and target index" + }, + { + "name": "ResolvedExportParams", + "kind": "interface", + "signature": "interface ResolvedExportParams", + "doc": "Define parameters required to resolve export settings including crop, pixel ratio, type, and quality" + }, + { + "name": "resolveExportParams", + "kind": "function", + "signature": "(page: ScenePage, opts: { format: \"png\" | \"jpeg\"; pixelRatio?: number | undefined; includeBleed?: boolean | undefined;…", + "doc": "Resolve the full set of toDataURL params from a page, format, pixel ratio, bleed flag, and optional preset." + }, + { + "name": "scaleForPreset", + "kind": "function", + "signature": "(preset: ExportPreset, cropRect: ExportCropRect) => number", + "doc": "Pixel ratio for stage.toDataURL given a crop rect and an export preset." + }, + { + "name": "SCENE_COMMAND_HISTORY_LIMIT", + "kind": "const", + "signature": "200", + "doc": "Oldest entries are dropped past this bound; redo stack is cleared on execute." + }, + { + "name": "SceneCommand", + "kind": "interface", + "signature": "interface SceneCommand", + "doc": "Define a command with execution, undo, and operation methods for scene editing and persistence" + }, + { + "name": "SceneCommandStack", + "kind": "interface", + "signature": "interface SceneCommandStack", + "doc": "Manage and track scene commands with undo, redo, and state subscription capabilities" + }, + { + "name": "SceneCommandStackWithReapply", + "kind": "interface", + "signature": "interface SceneCommandStackWithReapply", + "doc": "The base {@link SceneCommandStack} plus the two command-specific recovery primitives the undo/redo persistence path needs." + }, + { + "name": "setAttrsCommand", + "kind": "function", + "signature": "(input: SetAttrsInput) => SceneCommand", + "doc": "Create a command to set attributes on a scene element with undo capability" + }, + { + "name": "SetAttrsInput", + "kind": "interface", + "signature": "interface SetAttrsInput", + "doc": "Define input parameters for setting element attributes within a specific page context" + }, + { + "name": "setDocumentTitleCommand", + "kind": "function", + "signature": "(input: SetDocumentTitleInput) => SceneCommand", + "doc": "Resolve a command to rename a document title with undo and redo operations" + }, + { + "name": "SetDocumentTitleInput", + "kind": "interface", + "signature": "interface SetDocumentTitleInput", + "doc": "Define input parameters for setting the title of a scene document" + }, + { + "name": "setPageGuidesCommand", + "kind": "function", + "signature": "(input: SetPageGuidesInput) => SceneCommand", + "doc": "Create a command to update page guides with undo support" + }, + { + "name": "SetPageGuidesInput", + "kind": "interface", + "signature": "interface SetPageGuidesInput", + "doc": "Define input parameters for setting guides on a specific page within a document" + }, + { + "name": "setPagePropsCommand", + "kind": "function", + "signature": "(input: SetPagePropsInput) => SceneCommand", + "doc": "Build a command to update page properties based on the provided input" + }, + { + "name": "SetPagePropsInput", + "kind": "interface", + "signature": "interface SetPagePropsInput", + "doc": "Define input parameters for setting properties on a specific page within a scene document" + }, + { + "name": "SnapEngine", + "kind": "interface", + "signature": "interface SnapEngine", + "doc": "Resolve snapping targets and apply snapping logic to moving elements within the editor scene" + }, + { + "name": "SnapResult", + "kind": "interface", + "signature": "interface SnapResult", + "doc": "Define the result of a snap operation including coordinates and active snap lines" + }, + { + "name": "SnapTarget", + "kind": "interface", + "signature": "interface SnapTarget", + "doc": "Define a target position and kind for snapping elements on a page" + }, + { + "name": "SnapTargetKind", + "kind": "type", + "signature": "type SnapTargetKind", + "doc": "Define snap target categories for aligning elements within a layout system" + }, + { + "name": "SnapTargets", + "kind": "interface", + "signature": "interface SnapTargets", + "doc": "Define vertical and horizontal collections of snap targets for alignment purposes" + }, + { + "name": "ungroupElementCommand", + "kind": "function", + "signature": "(input: UngroupElementInput) => SceneCommand", + "doc": "Resolve a command to ungroup a group element into its child elements within a scene" + }, + { + "name": "UngroupElementInput", + "kind": "interface", + "signature": "interface UngroupElementInput", + "doc": "Define input parameters required to ungroup elements within a specific page and group" + }, + { + "name": "ZoomPanConfig", + "kind": "interface", + "signature": "interface ZoomPanConfig", + "doc": "Define configuration options for minimum and maximum zoom levels in a zoom-pan interface" + }, + { + "name": "ZoomPanMath", + "kind": "interface", + "signature": "interface ZoomPanMath", + "doc": "Define methods and properties to calculate zoom and pan transformations between document and screen coordinates" + } + ] + }, + { + "id": "./design-canvas-react/lazy", + "source": "src/design-canvas-react/lazy.tsx", + "dependsOn": [ + "brand", + "design-canvas", + "theme" + ], + "error": null, + "exports": [ + { + "name": "DesignCanvasChromeLazy", + "kind": "function", + "signature": "LazyExoticComponent<({ document: initialDocument, rev: initialRev, canWrite, mode, onApplyOperations, onSelectionChange…", + "doc": "Raw chrome only — use when supplying a custom renderWorkspace/renderThumbnail." + }, + { + "name": "DesignCanvasFullProps", + "kind": "interface", + "signature": "interface DesignCanvasFullProps", + "doc": "Callers inject a workspace renderer so this chrome stays Konva-free." + }, + { + "name": "DesignCanvasLazy", + "kind": "function", + "signature": "LazyExoticComponent<(props: DesignCanvasProps) => Element>", + "doc": "Batteries-included editor: chrome + workspace on one shared stack." + }, + { + "name": "DesignCanvasProps", + "kind": "interface", + "signature": "interface DesignCanvasProps", + "doc": "Define properties and callbacks for configuring and controlling the design canvas editor" + } + ] + }, + { + "id": "./design-canvas/drizzle", + "source": "src/design-canvas/drizzle.ts", + "dependsOn": [ + "tools", + "web" + ], + "error": null, + "exports": [ + { + "name": "createDesignCanvasTables", + "kind": "function", + "signature": "(opts: CreateDesignCanvasTablesOptions) => { designDocuments: SQLiteTableWithColumns<{ name: \"design_document\"; schema:…", + "doc": "Build SQLite tables for design documents with workspace and user references" + }, + { + "name": "CreateDesignCanvasTablesOptions", + "kind": "interface", + "signature": "interface CreateDesignCanvasTablesOptions", + "doc": "Define options for creating design canvas tables including workspace and user table configurations" + }, + { + "name": "createDrizzleSceneStore", + "kind": "function", + "signature": "(options: CreateDrizzleSceneStoreOptions) => SceneStore", + "doc": "Create a scene store configured with database tables and scoped to a specific document and workspace" + }, + { + "name": "CreateDrizzleSceneStoreOptions", + "kind": "interface", + "signature": "interface CreateDrizzleSceneStoreOptions", + "doc": "Define options for creating a Drizzle scene store including database, tables, and scope" + }, + { + "name": "DesignCanvasDatabase", + "kind": "type", + "signature": "type DesignCanvasDatabase", + "doc": "Any SQLite drizzle database — `any` erases the driver-specific run-result and schema generics so better-sqlite3, D1, and libsql handles all fit." + }, + { + "name": "DesignCanvasParentTable", + "kind": "type", + "signature": "type DesignCanvasParentTable", + "doc": "A product table referenced by FK — only the `id` column is touched." + }, + { + "name": "DesignCanvasTables", + "kind": "type", + "signature": "type DesignCanvasTables", + "doc": "Resolve the structure and data of design canvas tables for rendering and manipulation" + }, + { + "name": "DesignDecisionRow", + "kind": "type", + "signature": "type DesignDecisionRow", + "doc": "Resolve a design decision row from the design decisions table selection" + }, + { + "name": "DesignDocumentRow", + "kind": "type", + "signature": "type DesignDocumentRow", + "doc": "Resolve the selected structure of a design document row from design canvas tables" + }, + { + "name": "DesignExportRow", + "kind": "type", + "signature": "type DesignExportRow", + "doc": "Resolve the selected fields of designExports from DesignCanvasTables" + } + ] + }, + { + "id": "./durable-chat", + "source": "src/durable-chat/index.ts", + "dependsOn": [ + "interactions", + "plans" + ], + "error": null, + "exports": [ + { + "name": "applyDurableInteractionAnswer", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: \"declined\" | \"accepted\", answers?: R…", + "doc": "Resolve and record the outcome and answers of a durable interaction within the given store and scope" + }, + { + "name": "applyDurableInteractionAsk", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde…", + "doc": "Resolve and upsert a durable interaction ask in the store with optional event and timing parameters" + }, + { + "name": "applyDurableInteractionCancel", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even…", + "doc": "Resolve cancellation of a durable interaction with optional reason and event details" + }, + { + "name": "createDurableChatEventProjection", + "kind": "function", + "signature": "(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableChatEventP…", + "doc": "Event projector usable with any `ChatTurnRouteProducer` through `withDurableChatProjection`." + }, + { + "name": "createDurableChatScope", + "kind": "function", + "signature": "(value: string) => DurableChatScope", + "doc": "Create a durable chat scope from a non-empty string value" + }, + { + "name": "createDurableInteractionProjectionAdapter", + "kind": "function", + "signature": "(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableInteractio…", + "doc": "Binds an authorized durable scope/store to interaction lifecycle events." + }, + { + "name": "createDurableInteractionRoutePersistence", + "kind": "function", + "signature": "(options: CreateDurableInteractionRoutePersistenceOptions) => DurableInteractionRoutePersistence DurableInteractionSettlement", + "doc": "Additive answer settlement primitive for wiring into `/interactions`." + }, + { + "name": "createDurablePlanRoutes", + "kind": "function", + "signature": "(options: DurablePlanRouteOptions) => DurablePlanRoutes", + "doc": "Build durable plan routes with authorization and effect handling based on provided options" + }, + { + "name": "createInMemoryDurableChatStateStore", + "kind": "function", + "signature": "() => InMemoryDurableChatStateStore", + "doc": "Create an in-memory durable chat state store for managing chat session data efficiently" + }, + { + "name": "DurableAnswerIntentJournal", + "kind": "type", + "signature": "type DurableAnswerIntentJournal", + "doc": "Provide durable methods to manage the lifecycle of answer intents in a plan store" + }, + { + "name": "DurableAnswerIntentRecord", + "kind": "interface", + "signature": "interface DurableAnswerIntentRecord", + "doc": "Define the structure for recording durable answer intent details and their states" + }, + { + "name": "DurableAnswerIntentState", + "kind": "type", + "signature": "type DurableAnswerIntentState", + "doc": "Define possible states for a durable answer intent lifecycle" + }, + { + "name": "DurableChatConflictError", + "kind": "class", + "signature": "class DurableChatConflictError", + "doc": "Represent conflict errors occurring in durable chat state management" + }, + { + "name": "DurableChatError", + "kind": "class", + "signature": "class DurableChatError", + "doc": "Typed, fail-loud errors for adapters and route seams." + }, + { + "name": "DurableChatErrorCode", + "kind": "type", + "signature": "type DurableChatErrorCode", + "doc": "Define error codes representing possible Durable Chat failure scenarios" + }, + { + "name": "DurableChatEventProjection", + "kind": "interface", + "signature": "interface DurableChatEventProjection", + "doc": "Resolve chat events and materialize their state into durable records" + }, + { + "name": "DurableChatGoneError", + "kind": "class", + "signature": "class DurableChatGoneError", + "doc": "Represent durable chat errors indicating the chat plan is no longer available" + }, + { + "name": "DurableChatScope", + "kind": "type", + "signature": "type DurableChatScope", + "doc": "An authorization-derived tenant/thread scope." + }, + { + "name": "durableChatScopeKey", + "kind": "function", + "signature": "(scope: DurableChatScope) => string", + "doc": "Resolve a valid durable chat scope key from the given scope input" + }, + { + "name": "DurableChatStateStore", + "kind": "type", + "signature": "type DurableChatStateStore", + "doc": "Alias used by adapters that store all durable chat state in one port." + }, + { + "name": "DurableChatUnavailableError", + "kind": "class", + "signature": "class DurableChatUnavailableError", + "doc": "Represent unavailable durable chat authority errors with status code 503" + }, + { + "name": "DurableFollowUpReceipt", + "kind": "interface", + "signature": "interface DurableFollowUpReceipt", + "doc": "Define a durable receipt capturing stable identifiers and state for follow-up decisions" + }, + { + "name": "DurableInteractionAcknowledgement", + "kind": "interface", + "signature": "interface DurableInteractionAcknowledgement", + "doc": "Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields" + }, + { + "name": "DurableInteractionGuarantee", + "kind": "type", + "signature": "type DurableInteractionGuarantee", + "doc": "Define interaction durability levels to specify reconciliation or best-effort guarantees" + }, + { + "name": "durableInteractionIntentKey", + "kind": "function", + "signature": "(scope: DurableChatScope, interactionId: string, attemptKey: string) => string", + "doc": "Stable key helper exported for products implementing their own settlement loop." + }, + { + "name": "DurableInteractionProjection", + "kind": "interface", + "signature": "interface DurableInteractionProjection", + "doc": "Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag" + }, + { + "name": "DurableInteractionProjectionAdapter", + "kind": "interface", + "signature": "interface DurableInteractionProjectionAdapter", + "doc": "Define methods to manage durable interaction projections including upsert, cancel, and materialize operations" + }, + { + "name": "DurableInteractionSettlement", + "kind": "interface", + "signature": "interface DurableInteractionSettlement", + "doc": "Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents" + }, + { + "name": "DurableInteractionSettlementFactoryOptions", + "kind": "interface", + "signature": "interface DurableInteractionSettlementFactoryOptions", + "doc": "Define options for creating durable interaction settlement factories including store and optional reconcile authority" + }, + { + "name": "DurableInteractionSettlementOptions", + "kind": "interface", + "signature": "interface DurableInteractionSettlementOptions", + "doc": "Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider" + }, + { + "name": "DurablePlanAuthority", + "kind": "interface", + "signature": "interface DurablePlanAuthority", + "doc": "Structural port to Sandbox (or another durable plan authority)." + }, + { + "name": "DurablePlanAuthorityCurrentResult", + "kind": "interface", + "signature": "interface DurablePlanAuthorityCurrentResult", + "doc": "Represent the current authoritative state and optional receipt of a durable plan authority" + }, + { + "name": "DurablePlanAuthorityDecision", + "kind": "type", + "signature": "type DurablePlanAuthorityDecision", + "doc": "Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions" + }, + { + "name": "DurablePlanAuthorityResult", + "kind": "interface", + "signature": "interface DurablePlanAuthorityResult", + "doc": "Describe the outcome of an authority's durable plan decision including follow-up and metadata" + }, + { + "name": "DurablePlanAuthorization", + "kind": "type", + "signature": "type DurablePlanAuthorization", + "doc": "Resolve authorization status for durable plans using scopes, responses, or nullish values" + }, + { + "name": "DurablePlanCommandJournal", + "kind": "type", + "signature": "type DurablePlanCommandJournal", + "doc": "Pick essential methods to manage and record durable plan command operations" + }, + { + "name": "DurablePlanCommandKey", + "kind": "type", + "signature": "type DurablePlanCommandKey", + "doc": "Represent a unique identifier key for durable plan commands" + }, + { + "name": "DurablePlanCommandRecord", + "kind": "interface", + "signature": "interface DurablePlanCommandRecord", + "doc": "Define the structure for recording durable plan commands with associated metadata and state information" + }, + { + "name": "DurablePlanCommandState", + "kind": "type", + "signature": "type DurablePlanCommandState", + "doc": "Define possible states for a durable plan command in its lifecycle" + }, + { + "name": "DurablePlanDecision", + "kind": "type", + "signature": "type DurablePlanDecision", + "doc": "Represent durable plan outcomes as either approved or rejected" + }, + { + "name": "DurablePlanEffectRecord", + "kind": "interface", + "signature": "interface DurablePlanEffectRecord", + "doc": "Define the structure for recording the state and metadata of a durable plan effect" + }, + { + "name": "DurablePlanProjection", + "kind": "type", + "signature": "type DurablePlanProjection", + "doc": "Projection retained by a durable store." + }, + { + "name": "DurablePlanRouteAuthorizeArgs", + "kind": "interface", + "signature": "interface DurablePlanRouteAuthorizeArgs", + "doc": "Define arguments for authorizing durable plan route requests with operation and optional plan ID" + }, + { + "name": "DurablePlanRouteOptions", + "kind": "interface", + "signature": "interface DurablePlanRouteOptions", + "doc": "Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling" + }, + { + "name": "DurablePlanRoutes", + "kind": "interface", + "signature": "interface DurablePlanRoutes", + "doc": "Define routes handling durable plan requests with current and decide methods" + }, + { + "name": "DurablePlanStateStore", + "kind": "type", + "signature": "type DurablePlanStateStore", + "doc": "Represent durable storage for plan state management with persistence and reliability guarantees" + }, + { + "name": "DurablePlanStore", + "kind": "interface", + "signature": "interface DurablePlanStore", + "doc": "Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context" + }, + { + "name": "InMemoryDurableChatStateStore", + "kind": "class", + "signature": "class InMemoryDurableChatStateStore", + "doc": "Reference adapter for tests and local development." + }, + { + "name": "InMemoryDurableChatStore", + "kind": "const", + "signature": "typeof InMemoryDurableChatStateStore", + "doc": "Short aliases retained for adapter authors who call this a durable chat store rather than a state store." + }, + { + "name": "normalizePlanDecision", + "kind": "function", + "signature": "(value: unknown) => DurablePlanDecision | null", + "doc": "Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs" + }, + { + "name": "planAuthorityIdempotencyKey", + "kind": "function", + "signature": "(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string", + "doc": "Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision" + }, + { + "name": "planCommandKey", + "kind": "function", + "signature": "(planId: string, revision: number, decision: DurablePlanDecision) => string", + "doc": "Generate a unique key string for a plan command using plan ID, revision, and decision" + }, + { + "name": "planEffectKey", + "kind": "function", + "signature": "(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string", + "doc": "Generate a unique string key representing the effect of a plan decision within a given scope and revision" + }, + { + "name": "PreparedDurableInteractionAnswer", + "kind": "interface", + "signature": "interface PreparedDurableInteractionAnswer", + "doc": "Define a structured response containing scope, settlement, and intent for durable interactions" + }, + { + "name": "recordDurableInteractionAnswer", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: \"declined\" | \"accepted\", answers?: R…", + "doc": "Record an accepted/declined answer in the projection." + }, + { + "name": "recordDurableInteractionCancel", + "kind": "function", + "signature": "(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even…", + "doc": "Apply a cancel event." + }, + { + "name": "stablePlanReceipt", + "kind": "function", + "signature": "(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick CorrectnessChecker", + "doc": "Production `CorrectnessChecker` — one LLM call per matched artifact, deterministic (temperature 0), structured JSON out." + }, + { + "name": "createTokenRecallChecker", + "kind": "function", + "signature": "(opts?: { minRecall?: number | undefined; minContentLength?: number | undefined; }) => (requirement: CompletionRequirem…", + "doc": "A deterministic `CorrectnessChecker` (agent-eval exports only `createLlmCorrectnessChecker`)." + }, + { + "name": "extractProducedState", + "kind": "function", + "signature": "(events: readonly RuntimeEventLike[]) => ProducedState", + "doc": "Normalize a run's runtime event stream into `ProducedState`." + }, + { + "name": "producedFromToolEvents", + "kind": "function", + "signature": "(events: readonly AppToolProducedEvent[]) => RuntimeEventLike[]", + "doc": "Bridge the app-tool side channel's produced events into the runtime-event shape agent-eval's `extractProducedState` reads." + }, + { + "name": "ProducedState", + "kind": "interface", + "signature": "interface ProducedState", + "doc": "Everything observable about what a run actually produced." + }, + { + "name": "RuntimeEventLike", + "kind": "type", + "signature": "type RuntimeEventLike", + "doc": "The subset of runtime stream events `extractProducedState` consumes." + }, + { + "name": "SatisfiedBy", + "kind": "type", + "signature": "type SatisfiedBy", + "doc": "What kind of produced state can satisfy a requirement structurally." + }, + { + "name": "TaskGold", + "kind": "interface", + "signature": "interface TaskGold", + "doc": null + }, + { + "name": "verifyCompletion", + "kind": "function", + "signature": "(gold: TaskGold, state: ProducedState, checkCorrectness: CorrectnessChecker) => Promise", + "doc": "Verify whether a run completed the task." + }, + { + "name": "weightedComposite", + "kind": "function", + "signature": "(input: WeightedCompositeInput) => WeightedCompositeResult", + "doc": "Weighted composite over judge dimensions: `Σ(score_d · w_d) / Σ(w_d)` across the weighted dimensions." + } + ] + }, + { + "id": "./eval-campaign", + "source": "src/eval-campaign/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "aggregateJudgeVerdicts", + "kind": "function", + "signature": "(verdicts: readonly JudgeVerdict[], dimensionKeys: readonly D[], weights?: Partial(cfg: EnsembleJudgeConfig) => JudgeCo…", + "doc": "Build a `JudgeConfig` whose `score()` fans out `judgeReps` independent `scoreOne` calls and reduces them with the substrate's `aggregateJudgeVerdicts`." + }, + { + "name": "CampaignResult", + "kind": "interface", + "signature": "interface CampaignResult", + "doc": null + }, + { + "name": "defaultProductionGate", + "kind": "function", + "signature": "(options: DefaultProductionGateOptions) => Gate", + "doc": null + }, + { + "name": "DispatchContext", + "kind": "interface", + "signature": "interface DispatchContext", + "doc": "Context handed to every dispatch invocation." + }, + { + "name": "EnsembleAggregate", + "kind": "interface", + "signature": "interface EnsembleAggregate", + "doc": "The aggregated ensemble result." + }, + { + "name": "EnsembleJudgeConfig", + "kind": "interface", + "signature": "interface EnsembleJudgeConfig", + "doc": "Config for {@link buildEnsembleJudge}." + }, + { + "name": "evolutionaryProposer", + "kind": "function", + "signature": "(opts: EvolutionaryProposerOptions) => SurfaceProposer", + "doc": null + }, + { + "name": "Gate", + "kind": "interface", + "signature": "interface Gate", + "doc": "Composable promotion gate." + }, + { + "name": "gepaProposer", + "kind": "function", + "signature": "(opts: GepaProposerOptions) => SurfaceProposer", + "doc": null + }, + { + "name": "JudgeConfig", + "kind": "interface", + "signature": "interface JudgeConfig", + "doc": "Pluggable dimensional scorer." + }, + { + "name": "JudgeDimension", + "kind": "interface", + "signature": "interface JudgeDimension", + "doc": null + }, + { + "name": "JudgeScore", + "kind": "interface", + "signature": "interface JudgeScore", + "doc": "The canonical judge verdict shape — one declaration, shared by campaign judges and the multishot judge runner (which re-exports this type)." + }, + { + "name": "JudgeVerdict", + "kind": "interface", + "signature": "interface JudgeVerdict", + "doc": "One judge's verdict." + }, + { + "name": "LabeledScenarioStore", + "kind": "interface", + "signature": "interface LabeledScenarioStore", + "doc": null + }, + { + "name": "MutableSurface", + "kind": "type", + "signature": "type MutableSurface", + "doc": "The mutable surface a proposer changes." + }, + { + "name": "Mutator", + "kind": "interface", + "signature": "interface Mutator", + "doc": "Stateless surface mutation — given findings + current surface, return N candidate surfaces." + }, + { + "name": "paretoSignificanceGate", + "kind": "function", + "signature": "(options: ParetoSignificanceGateOptions) => Gate(opts: RunCampaignOptions) => Promise(opts: SelfImproveOptions) => Promise(items: readonly TrustItem[], thresholds?: TrustThresholds) => TrustVerdict", + "doc": "Decide whether an ensemble's per-item verdicts are trustworthy enough to believe a lift computed from them." + } + ] + }, + { + "id": "./harness", + "source": "src/harness/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "assertHarnessModelCompatible", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Fail-loud server guard: throw when a harness is asked to run a model it can't." + }, + { + "name": "coerceHarness", + "kind": "function", + "signature": "(value: unknown, fallback?: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\"…", + "doc": "Coerce an arbitrary value to a known harness, falling back (default `opencode`)." + }, + { + "name": "DEFAULT_HARNESS", + "kind": "const", + "signature": "\"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\" | \"forge\"…", + "doc": "Define the default harness to use for code execution and testing environments" + }, + { + "name": "Harness", + "kind": "type", + "signature": "type Harness", + "doc": "Resolve a valid harness identifier from the predefined KNOWN_HARNESSES array" + }, + { + "name": "isHarness", + "kind": "function", + "signature": "(value: unknown) => value is \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\"…", + "doc": "Determine if a value is a recognized harness string identifier" + }, + { + "name": "isModelCompatibleWithHarness", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Provider-less ids (sentinels like \"default\", or a session's own config) are compatible everywhere — every harness honors its own configuration." + }, + { + "name": "KNOWN_HARNESSES", + "kind": "const", + "signature": "readonly [\"opencode\", \"claude-code\", \"nanoclaw\", \"kimi-code\", \"codex\", \"amp\", \"factory-droids\", \"pi\", \"hermes\", \"forge\"…", + "doc": "The known coding-agent backends." + }, + { + "name": "modelProvider", + "kind": "function", + "signature": "(modelId: string) => string | null", + "doc": "Provider prefix of a canonical model id (`anthropic/claude-…` → `anthropic`), or null." + }, + { + "name": "ResolvedSessionHarness", + "kind": "interface", + "signature": "interface ResolvedSessionHarness", + "doc": "Represent resolved session state including harness, lock status, and swap attempt flag" + }, + { + "name": "resolveSessionHarness", + "kind": "function", + "signature": "(input?: ResolveSessionHarnessInput) => ResolvedSessionHarness", + "doc": "Resolve the harness for a turn, enforcing the session lock." + }, + { + "name": "ResolveSessionHarnessInput", + "kind": "interface", + "signature": "interface ResolveSessionHarnessInput", + "doc": "Resolve input options to determine the appropriate session harness to use" + }, + { + "name": "snapHarnessToModel", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Keep the harness when it can run `modelId`; else the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode." + }, + { + "name": "snapModelToHarness", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Keep `modelId` when the harness can run it; else the harness's best compatible catalog id (preferred patterns in order, highest version)." + } + ] + }, + { + "id": "./intakes", + "source": "src/intakes/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "AnswerRejectionReason", + "kind": "type", + "signature": "type AnswerRejectionReason", + "doc": "The reason an answer failed validation." + }, + { + "name": "AnswerValidationResult", + "kind": "interface", + "signature": "interface AnswerValidationResult", + "doc": "Describe validation outcome of an answer including success status and optional rejection reason" + }, + { + "name": "buildContextGatherPrompt", + "kind": "function", + "signature": "(spec: ContextFactSpec, sufficiency: ContextSufficiency) => string", + "doc": "Render the prompt section that mirrors a conversational-gather flow: - \"### Context you already have\" — the known facts, as `label: value`." + }, + { + "name": "computeContextSufficiency", + "kind": "function", + "signature": "(spec: ContextFactSpec, signals: ResolvedContextSignals) => ContextSufficiency", + "doc": "Combine a fact spec with resolved signals into the readiness verdict." + }, + { + "name": "ContextFact", + "kind": "interface", + "signature": "interface ContextFact", + "doc": "One fact the product treats as known context once it has a value." + }, + { + "name": "ContextFactSpec", + "kind": "interface", + "signature": "interface ContextFactSpec", + "doc": "The product's declaration of what context matters: the facts that make up scope, plus optional tool hints appended verbatim to the gather prompt (e.g." + }, + { + "name": "ContextSufficiency", + "kind": "interface", + "signature": "interface ContextSufficiency", + "doc": "The deterministic verdict over the resolved signals." + }, + { + "name": "emptyPayload", + "kind": "function", + "signature": "(graph: IntakeGraph) => IntakePayload", + "doc": "An empty payload for a fresh intake against `graph`." + }, + { + "name": "getQuestion", + "kind": "function", + "signature": "(graph: IntakeGraph, questionId: string) => IntakeQuestion | null", + "doc": "Look up a question by id, or null if the graph has none." + }, + { + "name": "hasAnswer", + "kind": "function", + "signature": "(value: IntakeAnswerValue | undefined) => boolean", + "doc": "True when an answer value is present (not null/undefined/empty)." + }, + { + "name": "IntakeAnswers", + "kind": "type", + "signature": "type IntakeAnswers", + "doc": "A flat map of answers keyed by question id." + }, + { + "name": "IntakeAnswerType", + "kind": "type", + "signature": "type IntakeAnswerType", + "doc": "The kinds of answer a question accepts." + }, + { + "name": "IntakeAnswerValue", + "kind": "type", + "signature": "type IntakeAnswerValue", + "doc": "Any value an answer can hold; the type is validated per-question." + }, + { + "name": "IntakeGraph", + "kind": "interface", + "signature": "interface IntakeGraph", + "doc": "The intake definition: an ordered, addressable set of questions." + }, + { + "name": "IntakeOption", + "kind": "interface", + "signature": "interface IntakeOption", + "doc": "A selectable option for single/multi-select questions." + }, + { + "name": "IntakePayload", + "kind": "interface", + "signature": "interface IntakePayload", + "doc": "The persisted JSON for one intake (the `payload` column)." + }, + { + "name": "intakeProgress", + "kind": "function", + "signature": "(graph: IntakeGraph, answers: IntakeAnswers) => { answered: number; total: number; }", + "doc": "Progress as answered-vs-total over the REACHABLE required questions under the current answers — what a progress bar renders." + }, + { + "name": "IntakeQuestion", + "kind": "interface", + "signature": "interface IntakeQuestion", + "doc": "One question in the graph." + }, + { + "name": "isComplete", + "kind": "function", + "signature": "(graph: IntakeGraph, answers: IntakeAnswers) => boolean", + "doc": "True when every REQUIRED question reachable under the current answers has a valid answer." + }, + { + "name": "KnownFact", + "kind": "interface", + "signature": "interface KnownFact", + "doc": "A resolved fact that has a value — surfaced to the prompt as known context." + }, + { + "name": "markComplete", + "kind": "function", + "signature": "(payload: IntakePayload, at?: Date) => IntakePayload", + "doc": "Stamp the payload complete at `at` (default now)." + }, + { + "name": "MissingFact", + "kind": "interface", + "signature": "interface MissingFact", + "doc": "A required fact with no value — surfaced to the prompt as a gap to close." + }, + { + "name": "nextQuestion", + "kind": "function", + "signature": "(graph: IntakeGraph, answers: IntakeAnswers) => IntakeQuestion | null", + "doc": "The single question to ask next given the answers so far, or null when the interview is done." + }, + { + "name": "payloadComplete", + "kind": "function", + "signature": "(graph: IntakeGraph, payload: IntakePayload) => boolean", + "doc": "True when the payload's answers complete the graph AND the payload was collected against THIS graph." + }, + { + "name": "payloadIsStale", + "kind": "function", + "signature": "(graph: IntakeGraph, payload: IntakePayload) => boolean", + "doc": "True when the payload was collected against a DIFFERENT graph revision." + }, + { + "name": "reachableQuestions", + "kind": "function", + "signature": "(graph: IntakeGraph, answers: IntakeAnswers) => IntakeQuestion[]", + "doc": "The questions reachable under the current answers, in traversal order." + }, + { + "name": "ResolvedContextSignals", + "kind": "interface", + "signature": "interface ResolvedContextSignals", + "doc": "What a product's adapter resolves from its own substrate, ready to combine." + }, + { + "name": "validateAnswer", + "kind": "function", + "signature": "(question: IntakeQuestion, value: IntakeAnswerValue | undefined) => AnswerValidationResult", + "doc": "Validate one answer against its question." + }, + { + "name": "withAnswer", + "kind": "function", + "signature": "(payload: IntakePayload, questionId: string, value: IntakeAnswerValue) => IntakePayload", + "doc": "A copy of `payload` with one answer set (does not mutate the input)." + } + ] + }, + { + "id": "./intakes-react", + "source": "src/intakes-react/index.ts", + "dependsOn": [ + "intakes" + ], + "error": null, + "exports": [ + { + "name": "IntakeInterview", + "kind": "function", + "signature": "({ view: initialView, onAnswer, onComplete, onDone, onNotice, }: IntakeInterviewProps) => Element", + "doc": null + }, + { + "name": "IntakeInterviewProps", + "kind": "interface", + "signature": "interface IntakeInterviewProps", + "doc": "Define properties and callbacks for managing the intake interview flow and user interactions" + }, + { + "name": "IntakeView", + "kind": "interface", + "signature": "interface IntakeView", + "doc": "The state the interview renders — the shape `./intakes/api` returns." + } + ] + }, + { + "id": "./intakes-react/lazy", + "source": "src/intakes-react/lazy.tsx", + "dependsOn": [ + "intakes" + ], + "error": null, + "exports": [ + { + "name": "IntakeInterviewLazy", + "kind": "function", + "signature": "LazyExoticComponent<({ view: initialView, onAnswer, onComplete, onDone, onNotice, }: IntakeInterviewProps) => Element>", + "doc": "Load IntakeInterview component lazily to optimize initial application rendering" + }, + { + "name": "IntakeInterviewProps", + "kind": "interface", + "signature": "interface IntakeInterviewProps", + "doc": "Define properties and callbacks for managing the intake interview flow and user interactions" + } + ] + }, + { + "id": "./intakes/api", + "source": "src/intakes/api.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "createIntakeApi", + "kind": "function", + "signature": "(opts: IntakeApiOptions) => { getCurrentIntake: () => Promise; saveAnswer: (input: { questionId?: string | un…", + "doc": "Build the intake API bound to one store + graph." + }, + { + "name": "CurrentIntakeView", + "kind": "interface", + "signature": "interface CurrentIntakeView", + "doc": "What the client renders: the saved state, the next prompt, and progress." + }, + { + "name": "IntakeApiOptions", + "kind": "interface", + "signature": "interface IntakeApiOptions", + "doc": "Define configuration options for initializing the intake API with store and graph components" + } + ] + }, + { + "id": "./intakes/drizzle", + "source": "src/intakes/drizzle.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "AnyIntakeTables", + "kind": "type", + "signature": "type AnyIntakeTables", + "doc": "The union table shape, for code that handles either scope generically." + }, + { + "name": "createIntakeTables", + "kind": "function", + "signature": "(opts: O) => IntakeTables", + "doc": "Build the intake tables wired to the product's tables." + }, + { + "name": "CreateIntakeTablesOptions", + "kind": "interface", + "signature": "interface CreateIntakeTablesOptions", + "doc": "Define options for creating intake tables including user and optional workspace references" + }, + { + "name": "createProjectIntakeStore", + "kind": "function", + "signature": "(opts: CreateProjectIntakeStoreOptions) => IntakeStore", + "doc": "Build the per-project store, scoped to one workspaceId." + }, + { + "name": "CreateProjectIntakeStoreOptions", + "kind": "interface", + "signature": "interface CreateProjectIntakeStoreOptions", + "doc": "Define options required to create a project intake store including database, table, graph, and workspace ID" + }, + { + "name": "createUserIntakeStore", + "kind": "function", + "signature": "(opts: CreateUserIntakeStoreOptions) => IntakeStore", + "doc": "Build the per-user onboarding store, scoped to one userId." + }, + { + "name": "CreateUserIntakeStoreOptions", + "kind": "interface", + "signature": "interface CreateUserIntakeStoreOptions", + "doc": "Define options required to create a user intake store for onboarding data collection" + }, + { + "name": "IntakeDatabase", + "kind": "type", + "signature": "type IntakeDatabase", + "doc": "Any SQLite drizzle database — `any` erases driver-specific generics so better-sqlite3, D1, and libsql handles all fit." + }, + { + "name": "IntakeError", + "kind": "class", + "signature": "class IntakeError", + "doc": "Thrown by store mutations on a refused write — callers map it to a 4xx." + }, + { + "name": "IntakeErrorCode", + "kind": "type", + "signature": "type IntakeErrorCode", + "doc": "Define error codes representing specific intake validation failures" + }, + { + "name": "IntakeParentTable", + "kind": "type", + "signature": "type IntakeParentTable", + "doc": "A product table referenced by FK — only the `id` column is touched." + }, + { + "name": "IntakeState", + "kind": "interface", + "signature": "interface IntakeState", + "doc": "A loaded intake: the payload plus whether it is complete against the graph." + }, + { + "name": "IntakeStore", + "kind": "interface", + "signature": "interface IntakeStore", + "doc": "The three-method store surface, identical for both scopes." + }, + { + "name": "IntakeTables", + "kind": "type", + "signature": "type IntakeTables", + "doc": "The tables returned for a given options shape: `projectIntake` is present in the type exactly when `workspaceTable` was provided." + }, + { + "name": "ProjectIntakeRow", + "kind": "type", + "signature": "type ProjectIntakeRow", + "doc": "Resolve the selected data structure for a project intake table row" + }, + { + "name": "ProjectIntakeTable", + "kind": "type", + "signature": "type ProjectIntakeTable", + "doc": "Resolve the structure and data of the project intake table from the factory function" + }, + { + "name": "UserIntakeRow", + "kind": "type", + "signature": "type UserIntakeRow", + "doc": "Infer and represent a selected row from the UserIntakeTable data structure" + }, + { + "name": "UserIntakeTable", + "kind": "type", + "signature": "type UserIntakeTable", + "doc": "Resolve the structure and data of a user intake table based on the createUserIntakeTable function" + } + ] + }, + { + "id": "./integrations", + "source": "src/integrations/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "HubExecClient", + "kind": "class", + "signature": "class HubExecClient", + "doc": "Typed client over the platform hub `/v1/hub/exec`." + }, + { + "name": "HubExecClientOptions", + "kind": "interface", + "signature": "interface HubExecClientOptions", + "doc": "Define configuration options for initializing a Hub execution client" + }, + { + "name": "HubExecErrorCode", + "kind": "type", + "signature": "type HubExecErrorCode", + "doc": "`{ success: false }` codes the hub returns on `/exec`." + }, + { + "name": "HubExecResult", + "kind": "type", + "signature": "type HubExecResult", + "doc": "Outcome of a hub `/exec` call." + }, + { + "name": "HubInvokeDeps", + "kind": "interface", + "signature": "interface HubInvokeDeps", + "doc": "Define dependencies for invoking hub operations including API key resolution and optional configuration" + }, + { + "name": "HubInvokeInput", + "kind": "interface", + "signature": "interface HubInvokeInput", + "doc": "Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments" + }, + { + "name": "HubInvokeOutcome", + "kind": "interface", + "signature": "interface HubInvokeOutcome", + "doc": "Describe the outcome of a hub invocation including status and response body" + }, + { + "name": "invokeIntegrationHub", + "kind": "function", + "signature": "(input: HubInvokeInput, deps: HubInvokeDeps) => Promise", + "doc": "Resolve + execute one integration tool call through the hub: resolve the per-user bearer, map the MCP tool name to the hub action path, forward to `/v1/hub/exec`, and shape the route response (200 ok…" + }, + { + "name": "ParsedIntegrationAction", + "kind": "interface", + "signature": "interface ParsedIntegrationAction", + "doc": "The provider/connector/action a hub action path addresses, plus the dotted `path` the hub `/exec` endpoint expects." + }, + { + "name": "resolveIntegrationAction", + "kind": "function", + "signature": "(toolName: string) => ParsedIntegrationAction | undefined", + "doc": "Resolve an MCP tool name (the opaque `int_…` catalog name the agent calls) into the dotted hub action path." + } + ] + }, + { + "id": "./interactions", + "source": "src/interactions/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "BeforeInteractionAnswerArgs", + "kind": "interface", + "signature": "interface BeforeInteractionAnswerArgs", + "doc": "Describe the arguments provided before processing an interaction answer including request, body, and connection details" + }, + { + "name": "cancelStatusFor", + "kind": "function", + "signature": "(reason: string | undefined) => ChatInteractionStatus", + "doc": "Maps an `interaction.cancel` reason to the card's terminal status." + }, + { + "name": "canTransitionInteractionStatus", + "kind": "function", + "signature": "(from: ChatInteractionStatus, to: ChatInteractionStatus) => boolean", + "doc": "Statuses only move forward (pending → terminal); a replayed/stale `pending` must never resurrect a resolved card." + }, + { + "name": "ChatInteraction", + "kind": "interface", + "signature": "interface ChatInteraction", + "doc": "The client/persisted view of one ask." + }, + { + "name": "ChatInteractionField", + "kind": "type", + "signature": "type ChatInteractionField", + "doc": "Resolve a chat interaction field excluding select types or including chat select fields" + }, + { + "name": "ChatInteractionStatus", + "kind": "type", + "signature": "type ChatInteractionStatus", + "doc": "Define possible statuses representing the state of a chat interaction" + }, + { + "name": "ChatSelectField", + "kind": "type", + "signature": "type ChatSelectField", + "doc": "Extract select-type interaction fields and optionally allow custom values" + }, + { + "name": "composerAnswerData", + "kind": "function", + "signature": "(field: ChatInteractionField, text: string) => Record", + "doc": "Shapes composer text into the respond payload for the routed field (select answers are string arrays on the wire; text answers are strings)." + }, + { + "name": "composerAnswerDeliveries", + "kind": "function", + "signature": "(pending: ChatInteraction[]) => ComposerAnswerDelivery[]", + "doc": "One delivery per pending ask: the first free-text-capable field, else the first field." + }, + { + "name": "ComposerAnswerDelivery", + "kind": "interface", + "signature": "interface ComposerAnswerDelivery", + "doc": "Define the structure for delivering answers linked to a specific chat interaction and field" + }, + { + "name": "createInteractionAnswerRoute", + "kind": "function", + "signature": "(options: InteractionAnswerRouteOptions) => InteractionAnswerRoute", + "doc": "Create an interaction answer route that handles listing and resolving interaction requests" + }, + { + "name": "dedupeQuestionInteractionsByContent", + "kind": "function", + "signature": "(interactions: ChatInteraction[]) => ChatInteraction[]", + "doc": "Remove duplicate question interactions based on their content signature to ensure uniqueness" + }, + { + "name": "DurableInteractionRouteArgs", + "kind": "interface", + "signature": "interface DurableInteractionRouteArgs", + "doc": "Define arguments for durable interaction routes including a stable caller-created attempt key" + }, + { + "name": "DurableInteractionRoutePersistence", + "kind": "interface", + "signature": "interface DurableInteractionRoutePersistence", + "doc": "Crash-recoverable persistence lifecycle for the answer route." + }, + { + "name": "fieldAcceptsFreeText", + "kind": "function", + "signature": "(field: ChatInteractionField) => boolean", + "doc": "Determine if a chat interaction field allows free text input" + }, + { + "name": "INTERACTION_CANCEL_EVENT", + "kind": "const", + "signature": "\"interaction.cancel\"", + "doc": "Sidecar → client: the ask was withdrawn; data = `{ id, reason?" + }, + { + "name": "INTERACTION_EVENT", + "kind": "const", + "signature": "\"interaction\"", + "doc": "Sidecar → client: the agent raised an ask; data = `{ request }`." + }, + { + "name": "INTERACTION_RESOLVED_EVENT", + "kind": "const", + "signature": "\"interaction.resolved\"", + "doc": "An ask was answered; data = `{ id, status }`." + }, + { + "name": "InteractionAnswerBodyValidation", + "kind": "type", + "signature": "type InteractionAnswerBodyValidation", + "doc": "Validate interaction answer body and return success with data or failure with error message" + }, + { + "name": "InteractionAnswerRoute", + "kind": "interface", + "signature": "interface InteractionAnswerRoute", + "doc": "Define routes to list outstanding interactions and resolve answers for live turns" + }, + { + "name": "InteractionAnswerRouteOptions", + "kind": "interface", + "signature": "interface InteractionAnswerRouteOptions", + "doc": "Define options to authenticate, authorize, and manage persistence for interaction answer routes" + }, + { + "name": "InteractionAnswers", + "kind": "type", + "signature": "type InteractionAnswers", + "doc": "Map interaction identifiers to their corresponding answer values" + }, + { + "name": "InteractionAnswerValue", + "kind": "type", + "signature": "type InteractionAnswerValue", + "doc": "Accepted answer values." + }, + { + "name": "InteractionCancelData", + "kind": "interface", + "signature": "interface InteractionCancelData", + "doc": "Describe data required to cancel an interaction including its identifier and optional reason" + }, + { + "name": "InteractionClientOutcome", + "kind": "type", + "signature": "type InteractionClientOutcome", + "doc": "Define possible outcomes for an interaction client as accepted or declined" + }, + { + "name": "InteractionConnectionResolution", + "kind": "type", + "signature": "type InteractionConnectionResolution", + "doc": "The product seam's verdict for one request." + }, + { + "name": "InteractionData", + "kind": "type", + "signature": "type InteractionData", + "doc": null + }, + { + "name": "interactionFromWireRequest", + "kind": "function", + "signature": "(request: InteractionRequestWire) => ChatInteraction", + "doc": "Reads a wire request into the client's pending `ChatInteraction`." + }, + { + "name": "InteractionOutcome", + "kind": "type", + "signature": "type InteractionOutcome", + "doc": null + }, + { + "name": "interactionPartKey", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Generate a unique key string for an interaction using the given identifier" + }, + { + "name": "InteractionPersistedPart", + "kind": "type", + "signature": "type InteractionPersistedPart", + "doc": "Persisted-part shapes the codecs below produce — the SAME rows `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the source so a product pushing them into a `ChatMessagePart[]` t…" + }, + { + "name": "InteractionRequest", + "kind": "type", + "signature": "type InteractionRequest", + "doc": null + }, + { + "name": "InteractionRequestWire", + "kind": "type", + "signature": "type InteractionRequestWire", + "doc": "`InteractionRequest` whose select fields may carry `allowCustom`." + }, + { + "name": "InteractionRouteLogger", + "kind": "type", + "signature": "type InteractionRouteLogger", + "doc": "Provide logging methods for warnings and errors in interaction routes" + }, + { + "name": "interactionToPersistedPart", + "kind": "function", + "signature": "(request: InteractionRequestWire, status: ChatInteractionStatus, cancelReason?: string | undefined, answers?: Interacti…", + "doc": "Builds the persisted/streamed `interaction` part from a wire request." + }, + { + "name": "isRenderableInteractionKind", + "kind": "function", + "signature": "(kind: string) => boolean", + "doc": "Resolve if the given interaction kind is renderable within the application context" + }, + { + "name": "isSafeInteractionFieldKey", + "kind": "function", + "signature": "(key: string) => boolean", + "doc": "Answer/field keys the sidecar will accept: identifier-safe and never a prototype-pollution vector." + }, + { + "name": "isTerminalInteractionStatus", + "kind": "function", + "signature": "(status: ChatInteractionStatus) => boolean", + "doc": "Resolve if the interaction status is a terminal state excluding pending" + }, + { + "name": "listSessionInteractions", + "kind": "function", + "signature": "(connection: SidecarInteractionsConnection) => Promise>", + "doc": "Outstanding (unanswered) interactions for the session — the sidecar's registry is authoritative, so this is the reconnect/reload source of truth." + }, + { + "name": "mapInteractionRespondFailure", + "kind": "function", + "signature": "(error: SidecarInteractionsError, logger?: InteractionRouteLogger) => Response", + "doc": "Sidecar error → the client-actionable contract." + }, + { + "name": "NoticeKind", + "kind": "type", + "signature": "type NoticeKind", + "doc": "Define specific string literals representing different kinds of notices" + }, + { + "name": "noticePart", + "kind": "function", + "signature": "(noticeKind: NoticeKind, id: string, text: string) => NoticePersistedPart", + "doc": "Builds the persisted/streamed `notice` part — a one-line transcript notice explaining an out-of-band event (warning, auto-declined interaction)." + }, + { + "name": "noticePartKey", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Generate a unique key string for a notice using the given identifier" + }, + { + "name": "NoticePersistedPart", + "kind": "type", + "signature": "type NoticePersistedPart", + "doc": "Define a persisted notice part with type, id, kind, and text properties" + }, + { + "name": "parseInteractionAnswers", + "kind": "function", + "signature": "(value: unknown) => ParseInteractionAnswersResult", + "doc": "Strictly validates and copies persisted answer selections." + }, + { + "name": "ParseInteractionAnswersResult", + "kind": "type", + "signature": "type ParseInteractionAnswersResult", + "doc": "Resolve the result of parsing interaction answers with success status and corresponding data or error message" + }, + { + "name": "parseInteractionCancel", + "kind": "function", + "signature": "(data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;…", + "doc": "Parse interaction cancel data and return success status with parsed value or error message" + }, + { + "name": "parseInteractionRequest", + "kind": "function", + "signature": "(data: Record | undefined) => ParseInteractionResult", + "doc": "Parses an `interaction` event's data (`{ request }`)." + }, + { + "name": "ParseInteractionResult", + "kind": "type", + "signature": "type ParseInteractionResult", + "doc": "Resolve interaction parsing outcome as success with value or failure with error message" + }, + { + "name": "persistedPartToInteraction", + "kind": "function", + "signature": "(part: Record) => ChatInteraction | null", + "doc": "Reads a persisted/streamed `interaction` part back into a `ChatInteraction`." + }, + { + "name": "questionInteractionContentSignature", + "kind": "function", + "signature": "(interaction: ChatInteraction) => string | null", + "doc": "Content identity for duplicate safety nets." + }, + { + "name": "ResolveInteractionConnectionArgs", + "kind": "interface", + "signature": "interface ResolveInteractionConnectionArgs", + "doc": "Define arguments required to resolve interaction connections based on request and intent" + }, + { + "name": "respondToSessionInteraction", + "kind": "function", + "signature": "(connection: SidecarInteractionsConnection, response: { id: string; outcome: \"declined\" | \"cancelled\" | \"accepted\"; dat…", + "doc": "Resolves one interaction." + }, + { + "name": "SidecarInteractionsConnection", + "kind": "interface", + "signature": "interface SidecarInteractionsConnection", + "doc": "Where and how to reach one session's interaction registry." + }, + { + "name": "SidecarInteractionsError", + "kind": "interface", + "signature": "interface SidecarInteractionsError", + "doc": "Describe error details including code, message, and upstream HTTP status for sidecar interactions" + }, + { + "name": "SidecarInteractionsResult", + "kind": "type", + "signature": "type SidecarInteractionsResult", + "doc": "Represent the outcome of sidecar interactions with success or error details" + }, + { + "name": "stampInteractionAnswers", + "kind": "function", + "signature": "(parts: Record[], answersByInteractionId: Readonly>) => Record) => InteractionAnswerBodyValidation", + "doc": "Validates the client POST body: `{ id, outcome, data?" + } + ] + }, + { + "id": "./knowledge", + "source": "src/knowledge/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "buildKnowledgeRequirements", + "kind": "function", + "signature": "(specs: KnowledgeRequirementSpec[], signals?: Record) => KnowledgeRequirement[]", + "doc": "Map specs -> the runtime's `KnowledgeRequirement[]`, folding in per-spec confidence from `signals` (default 0)." + }, + { + "name": "deriveSignals", + "kind": "function", + "signature": "(specs: KnowledgeRequirementSpec[], ctx: KnowledgeStateAccessor) => Promise>", + "doc": "Score every spec from workspace state." + }, + { + "name": "KnowledgeRequirementSpec", + "kind": "interface", + "signature": "interface KnowledgeRequirementSpec", + "doc": "Define the criteria and conditions required to satisfy a specific knowledge requirement" + }, + { + "name": "KnowledgeSignal", + "kind": "interface", + "signature": "interface KnowledgeSignal", + "doc": "Define a signal representing knowledge with confidence level and optional supporting evidence" + }, + { + "name": "KnowledgeStateAccessor", + "kind": "interface", + "signature": "interface KnowledgeStateAccessor", + "doc": "The single seam a backend implements." + }, + { + "name": "SatisfiedByRule", + "kind": "type", + "signature": "type SatisfiedByRule", + "doc": "A declarative rule for satisfying a requirement from workspace state." + } + ] + }, + { + "id": "./knowledge-loop", + "source": "src/knowledge-loop/index.ts", + "dependsOn": [ + "config" + ], + "error": null, + "exports": [ + { + "name": "createKnowledgeLoop", + "kind": "function", + "signature": "(knowledge: AgentKnowledgeConfig, deps: CreateKnowledgeLoopDeps) => KnowledgeLoop", + "doc": "Build a runnable knowledge-acquisition loop from the product's `AgentKnowledgeConfig` and a small set of seams." + }, + { + "name": "CreateKnowledgeLoopDeps", + "kind": "interface", + "signature": "interface CreateKnowledgeLoopDeps", + "doc": "Define dependencies required to create and run a knowledge processing loop" + }, + { + "name": "createReviewerDecider", + "kind": "function", + "signature": "(propose: (input: KnowledgeDeciderInput) => KnowledgeCandidate | Promise) => KnowledgeDecider", + "doc": "Wrap a candidate-producing policy in the default reviewer gate." + }, + { + "name": "KnowledgeCandidate", + "kind": "interface", + "signature": "interface KnowledgeCandidate", + "doc": "A research candidate the decider evaluates before the loop applies it." + }, + { + "name": "KnowledgeDecider", + "kind": "interface", + "signature": "interface KnowledgeDecider", + "doc": "The pluggable acquisition policy." + }, + { + "name": "KnowledgeDeciderInput", + "kind": "interface", + "signature": "interface KnowledgeDeciderInput", + "doc": "Define the input parameters required to decide knowledge proposals within an agent-knowledge loop" + }, + { + "name": "KnowledgeDecision", + "kind": "interface", + "signature": "interface KnowledgeDecision", + "doc": "Define a decision containing a candidate and the gate's verdict on that candidate" + }, + { + "name": "KnowledgeGateVerdict", + "kind": "interface", + "signature": "interface KnowledgeGateVerdict", + "doc": "The verdict a gate returns for one candidate." + }, + { + "name": "KnowledgeLoop", + "kind": "interface", + "signature": "interface KnowledgeLoop", + "doc": "The handle `createKnowledgeLoop` returns." + }, + { + "name": "KnowledgeLoopDriver", + "kind": "interface", + "signature": "interface KnowledgeLoopDriver", + "doc": "The agent-runtime turn driver seam." + }, + { + "name": "reviewCandidate", + "kind": "function", + "signature": "(candidate: KnowledgeCandidate, minConfidence: number) => KnowledgeGateVerdict", + "doc": "The default gate — agent-knowledge's propose-don't-apply reviewer posture as a confidence threshold." + } + ] + }, + { + "id": "./missions", + "source": "src/missions/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "applyMissionEvent", + "kind": "function", + "signature": "(prev: MissionState | undefined, event: MissionStreamEvent) => MissionState", + "doc": "Fold one event into one mission's state." + }, + { + "name": "asMissionStreamEvent", + "kind": "function", + "signature": "(value: unknown) => MissionStreamEvent | null", + "doc": "Narrow an arbitrary channel payload to a MissionStreamEvent." + }, + { + "name": "budgetGateProposalId", + "kind": "function", + "signature": "(missionId: string, stepId: string) => string", + "doc": "Deterministic proposal id for a budget-overrun override." + }, + { + "name": "buildAgentMissionPlan", + "kind": "function", + "signature": "(steps: ParsedMissionStep[]) => MissionStep[]", + "doc": "Materialize parsed steps into the engine's MissionStep[] shape." + }, + { + "name": "CompleteMissionInput", + "kind": "interface", + "signature": "interface CompleteMissionInput", + "doc": "Define input parameters to complete a mission with status and optional summary" + }, + { + "name": "createInMemoryMissionStore", + "kind": "function", + "signature": "() => InMemoryMissionStore", + "doc": "In-memory {@link MissionStorePort} — the portable backend for tests and sandbox/eval shells." + }, + { + "name": "createMissionEngine", + "kind": "function", + "signature": "(options: MissionEngineOptions) => MissionEngine", + "doc": "Create a mission engine configured with options to manage mission execution and error handling" + }, + { + "name": "CreateMissionInput", + "kind": "interface", + "signature": "interface CreateMissionInput", + "doc": "Define input parameters for creating a mission including optional deterministic id and unique plan steps" + }, + { + "name": "createMissionService", + "kind": "function", + "signature": "(options: MissionServiceOptions) => MissionService", + "doc": "Create a mission service that manages mission records and audit events with customizable options" + }, + { + "name": "DEFAULT_MISSION_STEP_KINDS", + "kind": "const", + "signature": "readonly string[]", + "doc": "Default step-kind vocabulary." + }, + { + "name": "InMemoryMissionStore", + "kind": "interface", + "signature": "interface InMemoryMissionStore", + "doc": "Define an in-memory mission store that tracks events and allows direct record writes" + }, + { + "name": "isMissionStopRequested", + "kind": "function", + "signature": "(mission: MissionRecord) => boolean", + "doc": "The cooperative kill switch: a stop request rides metadata so it survives any status and is honored by the engine before the next side effect." + }, + { + "name": "isMissionTerminal", + "kind": "function", + "signature": "(status: MissionStatus) => boolean", + "doc": "Statuses a mission can never leave — the run is done." + }, + { + "name": "mergeMissionState", + "kind": "function", + "signature": "(live: MissionState | undefined, seed: MissionState) => MissionState", + "doc": "Merge a loader SEED into the live state for one mission, advancing through the SAME monotonic clamps the event reducer uses." + }, + { + "name": "MISSION_CONTROL_CHANNEL_ID", + "kind": "const", + "signature": "\"missions\"", + "doc": "Workspace-wide channel id missions broadcast on (alongside any per-thread channel the product keys)." + }, + { + "name": "MissionApprovalsPort", + "kind": "interface", + "signature": "interface MissionApprovalsPort", + "doc": "Approval persistence seam — the product implements this over its own proposal table and resolution flow." + }, + { + "name": "MissionAuditEvent", + "kind": "interface", + "signature": "interface MissionAuditEvent", + "doc": "One audit-trail row." + }, + { + "name": "MissionConcurrencyError", + "kind": "class", + "signature": "class MissionConcurrencyError", + "doc": "Thrown to make the owner's durable-step wrapper retry." + }, + { + "name": "MissionCostLedger", + "kind": "interface", + "signature": "interface MissionCostLedger", + "doc": "Define the structure for tracking mission token usage, cost, duration, and LLM call counts" + }, + { + "name": "MissionEngine", + "kind": "interface", + "signature": "interface MissionEngine", + "doc": "Resolve mission plan steps with concurrency control and durable state management" + }, + { + "name": "MissionEngineOptions", + "kind": "interface", + "signature": "interface MissionEngineOptions", + "doc": "Define configuration options for initializing and controlling the mission engine behavior" + }, + { + "name": "MissionEventSink", + "kind": "interface", + "signature": "interface MissionEventSink", + "doc": "Handle mission stream events by processing emitted MissionStreamEvent objects" + }, + { + "name": "MissionGateKind", + "kind": "type", + "signature": "type MissionGateKind", + "doc": "Define mission gate categories as step, budget, or volume" + }, + { + "name": "MissionGateOptions", + "kind": "interface", + "signature": "interface MissionGateOptions", + "doc": "Define configuration options for mission gating including approvals, step classification, and action limits" + }, + { + "name": "MissionGateProposal", + "kind": "interface", + "signature": "interface MissionGateProposal", + "doc": "A gate proposal the engine asks the product to persist." + }, + { + "name": "MissionOutcome", + "kind": "type", + "signature": "type MissionOutcome", + "doc": "Discriminated outcome for guarded operations." + }, + { + "name": "MissionPlanRunOptions", + "kind": "interface", + "signature": "interface MissionPlanRunOptions", + "doc": "Define options to control mission plan execution with optional pre-step veto logic" + }, + { + "name": "MissionProposalResolution", + "kind": "type", + "signature": "type MissionProposalResolution", + "doc": "Resolution states a gate proposal can be in." + }, + { + "name": "MissionRecord", + "kind": "interface", + "signature": "interface MissionRecord", + "doc": "The durable mission row, shape-normalized." + }, + { + "name": "MissionService", + "kind": "interface", + "signature": "interface MissionService", + "doc": "Define methods to create, retrieve, and update missions with controlled engine binding and metadata merging" + }, + { + "name": "MissionServiceOptions", + "kind": "interface", + "signature": "interface MissionServiceOptions", + "doc": "Define options for configuring mission service behavior including storage, time, and ID generation" + }, + { + "name": "MissionState", + "kind": "interface", + "signature": "interface MissionState", + "doc": "Live per-mission view the reducer folds events into." + }, + { + "name": "MissionStatus", + "kind": "type", + "signature": "type MissionStatus", + "doc": "Durable mission state — the guarded status machine for a multi-step agent run." + }, + { + "name": "MissionStep", + "kind": "interface", + "signature": "interface MissionStep", + "doc": "Define the structure and state details of a mission step within a workflow system" + }, + { + "name": "MissionStepState", + "kind": "interface", + "signature": "interface MissionStepState", + "doc": "Live per-step view the reducer maintains." + }, + { + "name": "MissionStepStatus", + "kind": "type", + "signature": "type MissionStepStatus", + "doc": "Define possible statuses for a mission step during its execution lifecycle" + }, + { + "name": "MissionStorePort", + "kind": "interface", + "signature": "interface MissionStorePort", + "doc": "Persistence seam — the product implements this over its own tables." + }, + { + "name": "MissionStreamEvent", + "kind": "type", + "signature": "type MissionStreamEvent", + "doc": "Discriminated union of every live mission event." + }, + { + "name": "MissionStreamStatus", + "kind": "type", + "signature": "type MissionStreamStatus", + "doc": "Define possible statuses representing the current state of a mission stream" + }, + { + "name": "MissionStreamStep", + "kind": "interface", + "signature": "interface MissionStreamStep", + "doc": "One plan step as it appears on the wire — only what a live UI needs (`sublabel` updates travel separately via `step.updated` so the snapshot stays small)." + }, + { + "name": "MissionStreamStepStatus", + "kind": "type", + "signature": "type MissionStreamStepStatus", + "doc": "Define possible status values for a mission stream step" + }, + { + "name": "MissionUpdateGuard", + "kind": "interface", + "signature": "interface MissionUpdateGuard", + "doc": "Fields a guarded write compares against the values the caller read." + }, + { + "name": "MissionUpdatePatch", + "kind": "interface", + "signature": "interface MissionUpdatePatch", + "doc": "Fields a guarded write sets when the guard holds." + }, + { + "name": "noopEventSink", + "kind": "const", + "signature": "MissionEventSink", + "doc": "A sink that drops every event — the engine default when no live channel is wired (and the unit-test default)." + }, + { + "name": "ParsedMission", + "kind": "interface", + "signature": "interface ParsedMission", + "doc": "Describe a mission with a title and an ordered list of parsed steps" + }, + { + "name": "ParsedMissionStep", + "kind": "interface", + "signature": "interface ParsedMissionStep", + "doc": "Define the structure representing a parsed mission step with id, kind, and intent fields" + }, + { + "name": "parseMissionBlocks", + "kind": "function", + "signature": "(fullContent: string, options?: ParseMissionBlocksOptions) => ParsedMission[]", + "doc": "Parse every well-formed `:::mission` block." + }, + { + "name": "ParseMissionBlocksOptions", + "kind": "interface", + "signature": "interface ParseMissionBlocksOptions", + "doc": "Define options to specify allowed lowercase step kinds for parsing mission blocks" + }, + { + "name": "parseSessionStreamEnvelope", + "kind": "function", + "signature": "(raw: unknown) => MissionStreamEvent | null", + "doc": "Reconstruct the flat MissionStreamEvent from a broadcast envelope of shape `{ type, data: { ...missionFields } }` (transports may also stamp routing fields like workspaceId/threadId into `data`)." + }, + { + "name": "PlanOutcome", + "kind": "type", + "signature": "type PlanOutcome", + "doc": "Outcome of running the whole plan from the cursor to the end." + }, + { + "name": "reduceMissionEvents", + "kind": "function", + "signature": "(events: MissionStreamEvent[], seed?: Map | undefined) => Map", + "doc": "Fold a whole event sequence into a Map." + }, + { + "name": "RetryableStepError", + "kind": "class", + "signature": "class RetryableStepError", + "doc": "Thrown by a {@link SandboxDispatch} for a TRANSIENT failure (platform blip, exec-time network fault) that should be re-attempted." + }, + { + "name": "SandboxDispatch", + "kind": "type", + "signature": "type SandboxDispatch", + "doc": "A side-effecting unit of per-step work." + }, + { + "name": "SandboxDispatchDoneResult", + "kind": "interface", + "signature": "interface SandboxDispatchDoneResult", + "doc": "Define the result of a completed sandbox dispatch including artifact reference and optional cost details" + }, + { + "name": "SandboxDispatchInProgressResult", + "kind": "interface", + "signature": "interface SandboxDispatchInProgressResult", + "doc": "The dispatched step's detached session is still executing on the platform." + }, + { + "name": "SandboxDispatchInput", + "kind": "interface", + "signature": "interface SandboxDispatchInput", + "doc": "Define input parameters for dispatching a mission step in the sandbox environment" + }, + { + "name": "SandboxDispatchResult", + "kind": "type", + "signature": "type SandboxDispatchResult", + "doc": "Resolve the result of a sandbox dispatch as done or in progress" + }, + { + "name": "SetStepStatusPatch", + "kind": "interface", + "signature": "interface SetStepStatusPatch", + "doc": "Define a patch to update the status and optional metadata of a step in a process" + }, + { + "name": "stepAgentActivity", + "kind": "function", + "signature": "(step: object) => StepAgentActivity[]", + "doc": "Re-validate an `agentActivity` lane that crossed a JSON boundary." + }, + { + "name": "StepAgentActivity", + "kind": "interface", + "signature": "interface StepAgentActivity", + "doc": "Canonical shape for the per-step agent-activity lane — the delegated runs (delegation MCP registry entries) a mission step spawned, journaled onto the step so a live UI can render \"what the agent is…" + }, + { + "name": "StepGateClassification", + "kind": "interface", + "signature": "interface StepGateClassification", + "doc": "Product classification of one step." + }, + { + "name": "stepGateProposalId", + "kind": "function", + "signature": "(missionId: string, stepId: string) => string", + "doc": "Deterministic proposal id for a step-classification gate." + }, + { + "name": "StepOutcome", + "kind": "type", + "signature": "type StepOutcome", + "doc": "Outcome of running a single step." + }, + { + "name": "volumeGateProposalId", + "kind": "function", + "signature": "(missionId: string, stepId: string) => string", + "doc": "Deterministic proposal id for an external-action volume-cap override." + }, + { + "name": "WithAgentActivity", + "kind": "type", + "signature": "type WithAgentActivity", + "doc": "Step state extended with the activity lane a loader/seed route attaches." + } + ] + }, + { + "id": "./model-resolution", + "source": "src/model-resolution/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "catalogIdsForModel", + "kind": "function", + "signature": "(model: ModelInfo) => string[]", + "doc": "Resolve unique catalog IDs associated with a given model including its canonical form if applicable" + }, + { + "name": "ChatModelSource", + "kind": "type", + "signature": "type ChatModelSource", + "doc": "Define possible origins for the chat model configuration values" + }, + { + "name": "ChatModelValidationFailure", + "kind": "interface", + "signature": "interface ChatModelValidationFailure", + "doc": "Describe a failed chat model validation result with an error message" + }, + { + "name": "ChatModelValidationResult", + "kind": "type", + "signature": "type ChatModelValidationResult", + "doc": "Resolve the outcome of validating a chat model as either success or failure" + }, + { + "name": "ChatModelValidationSuccess", + "kind": "interface", + "signature": "interface ChatModelValidationSuccess", + "doc": "Represent successful chat model validation with a true status and a validated string value" + }, + { + "name": "cleanModelId", + "kind": "function", + "signature": "(value: unknown) => string | undefined", + "doc": "Resolve and return a trimmed string model ID or undefined for invalid or empty input" + }, + { + "name": "isWellFormedModelId", + "kind": "function", + "signature": "(modelId: string) => boolean", + "doc": "Validate if a model ID string conforms to length and character format requirements" + }, + { + "name": "LoadModels", + "kind": "type", + "signature": "type LoadModels", + "doc": "The catalog-fetch boundary: maps a router base URL to the raw model list." + }, + { + "name": "ModelInfo", + "kind": "interface", + "signature": "interface ModelInfo", + "doc": "The router /v1/models entry shape this module reads." + }, + { + "name": "resolveChatModel", + "kind": "function", + "signature": "(input: ResolveChatModelInput) => ResolvedChatModel", + "doc": "Resolve the chat-turn model by the one canonical precedence." + }, + { + "name": "ResolveChatModelInput", + "kind": "interface", + "signature": "interface ResolveChatModelInput", + "doc": "Resolve the effective chat model input by prioritizing request, workspace, environment, and default models" + }, + { + "name": "ResolvedChatModel", + "kind": "interface", + "signature": "interface ResolvedChatModel", + "doc": "Resolve a chat model with its identifier and source information" + }, + { + "name": "validateChatModelId", + "kind": "function", + "signature": "(modelId: unknown, input: ValidateChatModelIdInput) => Promise", + "doc": "Fail-closed model-id validation." + }, + { + "name": "ValidateChatModelIdInput", + "kind": "interface", + "signature": "interface ValidateChatModelIdInput", + "doc": "Define input parameters for validating chat model IDs with optional allowlist and catalog access details" + } + ] + }, + { + "id": "./object-store", + "source": "src/object-store/index.ts", + "dependsOn": [ + "crypto" + ], + "error": null, + "exports": [ + { + "name": "assertSafeKeySegment", + "kind": "function", + "signature": "(s: string) => string", + "doc": "Assert a single object-key path SEGMENT (an operator id, customer id, or upload id) is safe to interpolate into a key, and return it." + }, + { + "name": "createProxiedArtifactRoute", + "kind": "function", + "signature": "({ store, secret, }: { store: ObjectStore; secret: string; }) => (request: Request) => Promise", + "doc": "Build a download handler that verifies a signed request and STREAMS the object back with a conservative, non-executable content type." + }, + { + "name": "createR2ObjectStore", + "kind": "function", + "signature": "({ bucket }: { bucket: R2LikeBucket; }) => ObjectStore", + "doc": "Map the {@link ObjectStore} port onto an R2 bucket 1:1." + }, + { + "name": "ObjectBody", + "kind": "interface", + "signature": "interface ObjectBody", + "doc": "A retrieved object." + }, + { + "name": "objectKey", + "kind": "function", + "signature": "({ operatorId, customerId, uploadId, filename }: ObjectKeyParts) => string", + "doc": "Build the canonical object key: `operator/customer/upload-filename`." + }, + { + "name": "ObjectKeyParts", + "kind": "interface", + "signature": "interface ObjectKeyParts", + "doc": "Inputs to {@link objectKey}." + }, + { + "name": "ObjectStore", + "kind": "interface", + "signature": "interface ObjectStore", + "doc": "Portable object-store port." + }, + { + "name": "PutObjectOptions", + "kind": "interface", + "signature": "interface PutObjectOptions", + "doc": "Options for a single {@link ObjectStore.put}." + }, + { + "name": "R2LikeBucket", + "kind": "interface", + "signature": "interface R2LikeBucket", + "doc": "The minimal slice of Cloudflare's `R2Bucket` this module calls." + }, + { + "name": "R2LikeObjectBody", + "kind": "interface", + "signature": "interface R2LikeObjectBody", + "doc": "Body shape of a retrieved object (structural match of R2's `R2ObjectBody`)." + }, + { + "name": "R2LikeObjectHead", + "kind": "interface", + "signature": "interface R2LikeObjectHead", + "doc": "Head/metadata shape of a stored object (structural match of R2's `R2Object`)." + }, + { + "name": "signObjectUrl", + "kind": "function", + "signature": "({ key, exp, secret }: SignObjectUrlArgs) => Promise", + "doc": "Mint a signed query string (`?key=…&exp=…&sig=…`) authorizing a download of `key` until `exp`." + }, + { + "name": "SignObjectUrlArgs", + "kind": "interface", + "signature": "interface SignObjectUrlArgs", + "doc": "Arguments to {@link signObjectUrl}." + }, + { + "name": "verifyObjectUrl", + "kind": "function", + "signature": "(request: Request, { secret }: { secret: string; }) => Promise", + "doc": "Verify a signed download request." + }, + { + "name": "VerifyObjectUrlResult", + "kind": "type", + "signature": "type VerifyObjectUrlResult", + "doc": "Result of {@link verifyObjectUrl}: the canonical key on success, nothing distinguishing on failure (so a rejection leaks no detail)." + } + ] + }, + { + "id": "./plans", + "source": "src/plans/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "canTransitionPlanStatus", + "kind": "function", + "signature": "(from: ChatPlanStatus, to: ChatPlanStatus) => boolean", + "doc": "Plan status is monotonic: only a pending plan can settle." + }, + { + "name": "ChatPlan", + "kind": "type", + "signature": "type ChatPlan", + "doc": "Browser/persisted projection of the sandbox SDK's durable-plan union." + }, + { + "name": "ChatPlanPersistedPart", + "kind": "type", + "signature": "type ChatPlanPersistedPart", + "doc": "Canonical transcript part for one durable plan." + }, + { + "name": "ChatPlanStatus", + "kind": "type", + "signature": "type ChatPlanStatus", + "doc": "Sandbox plan lifecycle." + }, + { + "name": "parsePlanSubmittedEvent", + "kind": "function", + "signature": "(event: unknown) => ParsePlanSubmittedResult", + "doc": "Parses both direct sandbox events (`data.plan`) and session envelopes (`properties.plan`)." + }, + { + "name": "ParsePlanSubmittedResult", + "kind": "type", + "signature": "type ParsePlanSubmittedResult", + "doc": "Resolve the result of parsing a plan submission into success with value or failure with error" + }, + { + "name": "persistedPartToPlan", + "kind": "function", + "signature": "(part: Record) => ChatPlan | null", + "doc": "Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan" + }, + { + "name": "PLAN_SUBMITTED_EVENT", + "kind": "const", + "signature": "\"plan.submitted\"", + "doc": "Durable-plan application-shell contract." + }, + { + "name": "planFollowUpTurnId", + "kind": "function", + "signature": "(planId: string, outcome: \"approved\" | \"rejected\") => string", + "doc": "Generate a unique follow-up turn ID based on the plan ID and its outcome" + }, + { + "name": "planPartKey", + "kind": "function", + "signature": "(planId: string) => string", + "doc": "Generate a unique key string for a given plan identifier" + }, + { + "name": "planRevisionKey", + "kind": "function", + "signature": "(planId: string, revision: number) => string", + "doc": "Generate a unique key string for a plan based on its ID and revision number" + }, + { + "name": "planToPersistedPart", + "kind": "function", + "signature": "(plan: ChatPlan) => ChatPlanPersistedPart", + "doc": "Resolve a ChatPlan into its persisted part representation for storage or transmission" + } + ] + }, + { + "id": "./platform", + "source": "src/platform/index.ts", + "dependsOn": [ + "billing", + "runtime", + "web" + ], + "error": null, + "exports": [ + { + "name": "AdminGuardOptions", + "kind": "interface", + "signature": "interface AdminGuardOptions", + "doc": "Define options to resolve user session and control access based on allowed admin emails" + }, + { + "name": "assertBillableBalance", + "kind": "function", + "signature": "(state: BillableBalanceState, opts?: AssertBillableBalanceOptions) => void", + "doc": "Gate a billable turn: passes when enforcement is disabled (dev default), the tier allows overage, or remaining balance is positive." + }, + { + "name": "AssertBillableBalanceOptions", + "kind": "interface", + "signature": "interface AssertBillableBalanceOptions", + "doc": "Define options to assert and customize billable balance enforcement behavior" + }, + { + "name": "AuthGuard", + "kind": "interface", + "signature": "interface AuthGuard", + "doc": "Resolve user authentication and session requirements for page and API requests" + }, + { + "name": "AuthGuardOptions", + "kind": "interface", + "signature": "interface AuthGuardOptions", + "doc": "Define options for configuring authentication guard behavior and session retrieval" + }, + { + "name": "BetterAuthSessionCookieMinterOptions", + "kind": "interface", + "signature": "interface BetterAuthSessionCookieMinterOptions", + "doc": "Define options to customize warning behavior for shadowed cookie names in authentication sessions" + }, + { + "name": "BetterAuthSessionCookieSource", + "kind": "interface", + "signature": "interface BetterAuthSessionCookieSource", + "doc": "Structural slice of a `betterAuth()` instance — only what cookie minting reads." + }, + { + "name": "BillableBalanceState", + "kind": "interface", + "signature": "interface BillableBalanceState", + "doc": "Describe the billable balance state including overage permission and remaining USD balance" + }, + { + "name": "createAdminGuard", + "kind": "function", + "signature": "(opts: AdminGuardOptions) => (request: Request) => Promise", + "doc": "Non-admins (and empty allowlists) get 404, keeping the route invisible — better than a \"forbidden\" footprint that advertises its existence." + }, + { + "name": "createAuthGuard", + "kind": "function", + "signature": "(opts: AuthGuardOptions) => AuthGuard", + "doc": "Create an authentication guard that enforces session presence and handles unauthorized access responses" + }, + { + "name": "createBetterAuthSessionCookieMinter", + "kind": "function", + "signature": "(auth: BetterAuthSessionCookieSource, options?: BetterAuthSessionCookieMinterOptions) => (args: TangleSsoSessionCookieA…", + "doc": "Canonical `setSessionCookie` wiring for better-auth apps: mint the session Set-Cookie exactly as better-auth's own login flows do — name + attributes from `auth.$context.authCookies.sessionToken` (be…" + }, + { + "name": "createHubProxyRoutes", + "kind": "function", + "signature": "(ctx: HubProxyContext) => HubProxyRoutes", + "doc": "Resolve hub proxy routes with authentication and error handling based on the given context" + }, + { + "name": "createPlatformBillingHttp", + "kind": "function", + "signature": "(opts: PlatformBillingHttpOptions) => PlatformBillingHttp", + "doc": "Create a PlatformBillingHttp instance configured with given options and default behaviors" + }, + { + "name": "createSignedSsoState", + "kind": "function", + "signature": "(config: SsoStateConfig) => Promise", + "doc": "Mint a `..` state value." + }, + { + "name": "createTanglePlatformBillingClient", + "kind": "function", + "signature": "(http: PlatformBillingHttp, identity: PlatformIdentityStore) => PlatformBillingClient", + "doc": "Concrete fetch-backed `PlatformBillingClient` for `createPlatformBalanceManager` (from `/billing`)." + }, + { + "name": "createTangleSsoHandlers", + "kind": "function", + "signature": "(opts: TangleSsoHandlerOptions) => TangleSsoHandlers", + "doc": "Create Tangle SSO handlers to manage authentication state, callbacks, and session cookies" + }, + { + "name": "DEFAULT_SEAT_BILLING_ENABLED_ENV_VAR", + "kind": "const", + "signature": "\"SEAT_BILLING_ENABLED\"", + "doc": "Default name of the per-app feature flag gating seat billing." + }, + { + "name": "DEFAULT_TANGLE_TIER_POLICY", + "kind": "const", + "signature": "Record", + "doc": "Define default concurrency and overage policies for each TanglePlanTier level" + }, + { + "name": "FREE_TIER_SPEND_CAP_USD", + "kind": "const", + "signature": "2", + "doc": "Lifetime free-tier cap: $2 (200¢) cumulative inference spend, expressed in dollars." + }, + { + "name": "getProductEntitlement", + "kind": "function", + "signature": "(http: Pick, userApiKey: string | null | undefined, productId: string, fl…", + "doc": "Read a user's entitlement for one product." + }, + { + "name": "guardResolution", + "kind": "function", + "signature": "(run: () => Promise) => Promise>", + "doc": "Adapt a guard that THROWS a Response (the quartet above — the router convention) to the `{ok: true, value} | {ok: false, response}` resolution shape the route factories take (`/chat-routes` `authoriz…" + }, + { + "name": "GuardResolution", + "kind": "type", + "signature": "type GuardResolution", + "doc": "Resolve a value or an HTTP response indicating failure in a guarded operation" + }, + { + "name": "HubClientLike", + "kind": "interface", + "signature": "interface HubClientLike", + "doc": "Structural subset of the platform hub wire client — extra methods are fine." + }, + { + "name": "HubProxyContext", + "kind": "interface", + "signature": "interface HubProxyContext", + "doc": "Define methods to require user ID, get bearer token, and create a hub client bound to the bearer" + }, + { + "name": "HubProxyRouteArgs", + "kind": "interface", + "signature": "interface HubProxyRouteArgs", + "doc": "Define arguments for configuring a proxy route with request and optional parameters" + }, + { + "name": "HubProxyRoutes", + "kind": "interface", + "signature": "interface HubProxyRoutes", + "doc": "Define routes for hub proxy handling catalog, connections, healthchecks, and authorization actions" + }, + { + "name": "isPlatformBillingHttpError", + "kind": "function", + "signature": "(error: unknown) => error is PlatformBillingHttpError", + "doc": "Structural guard (name + numeric status) — robust across module instances." + }, + { + "name": "isPlatformHubErrorLike", + "kind": "function", + "signature": "(error: unknown) => error is Error & { status: number; code?: string | undefined; }", + "doc": "Structural detection of the platform hub wire error (name + numeric status)." + }, + { + "name": "isProductEntitled", + "kind": "function", + "signature": "(ent: ProductEntitlement) => boolean", + "doc": "Entitled = holds an active seat OR is still inside the free tier." + }, + { + "name": "isSeatBillingEnabled", + "kind": "function", + "signature": "(opts?: SeatBillingFlagOptions) => boolean", + "doc": "Seat billing is OFF unless the flag is explicitly truthy ('true'/'1'/'on'/ 'enabled')." + }, + { + "name": "isTangleBearerMissingError", + "kind": "function", + "signature": "(error: unknown) => error is TangleBearerMissingError", + "doc": "Structural guard (name + userId shape) — robust when the error class is constructed in a different module instance than the one checking it." + }, + { + "name": "normalizeTanglePlanTier", + "kind": "function", + "signature": "(plan: string | null | undefined) => TanglePlanTier", + "doc": "'pro' | 'enterprise' pass through; anything else (null, unknown) → 'free'." + }, + { + "name": "parseAdminEmails", + "kind": "function", + "signature": "(raw: string | null | undefined) => string[]", + "doc": "Comma/whitespace separated → trimmed, lowercased, empties dropped." + }, + { + "name": "PlatformBalanceSnapshot", + "kind": "interface", + "signature": "interface PlatformBalanceSnapshot", + "doc": "Describe the platform balance and lifetime spending with an optional update timestamp" + }, + { + "name": "PlatformBillingHttp", + "kind": "interface", + "signature": "interface PlatformBillingHttp", + "doc": "Define methods to interact with platform billing endpoints using user or service authentication" + }, + { + "name": "PlatformBillingHttpError", + "kind": "class", + "signature": "class PlatformBillingHttpError", + "doc": "Represent platform billing HTTP errors with status code and detailed message" + }, + { + "name": "PlatformBillingHttpOptions", + "kind": "interface", + "signature": "interface PlatformBillingHttpOptions", + "doc": "Define HTTP options for platform billing including base URL, service token, product slug, fetch implementation, and timeout" + }, + { + "name": "PlatformIdentityStore", + "kind": "interface", + "signature": "interface PlatformIdentityStore", + "doc": "Define a contract for resolving platform identities based on user identifiers" + }, + { + "name": "PlatformSubscriptionInfo", + "kind": "interface", + "signature": "interface PlatformSubscriptionInfo", + "doc": "Describe subscription tier and status information for a platform user" + }, + { + "name": "PlatformUsageProductRow", + "kind": "interface", + "signature": "interface PlatformUsageProductRow", + "doc": "Describe a product's usage and spending metrics on the platform" + }, + { + "name": "ProductEntitlement", + "kind": "interface", + "signature": "interface ProductEntitlement", + "doc": "Per-product entitlement snapshot from the platform — the single read that tells a product whether to show its workspace or the seat paywall." + }, + { + "name": "readTangleTierState", + "kind": "function", + "signature": "(http: PlatformBillingHttp, userApiKey: string | null | undefined, policy?: Record) =…", + "doc": "Read subscription + balance and project them onto the tier policy." + }, + { + "name": "ResolvedTangleHubBearer", + "kind": "interface", + "signature": "interface ResolvedTangleHubBearer", + "doc": "Represent a resolved bearer token with its associated TangleHub bearer source" + }, + { + "name": "resolveUserTangleHubBearer", + "kind": "function", + "signature": "(opts: ResolveUserTangleHubBearerOptions) => Promise", + "doc": "Resolve the Tangle bearer used by the integration hub proxy." + }, + { + "name": "resolveUserTangleHubBearerForUser", + "kind": "function", + "signature": "(opts: ResolveUserTangleHubBearerForUserOptions) => Promise", + "doc": "Resolve the TangleHub bearer token for a specified user based on provided options" + }, + { + "name": "ResolveUserTangleHubBearerForUserOptions", + "kind": "interface", + "signature": "interface ResolveUserTangleHubBearerForUserOptions", + "doc": "Resolve options for retrieving a TangleHub bearer token for a specified user" + }, + { + "name": "ResolveUserTangleHubBearerOptions", + "kind": "interface", + "signature": "interface ResolveUserTangleHubBearerOptions", + "doc": "Resolve options required to obtain a user's TangleHub bearer token including environment and API key retrieval" + }, + { + "name": "SeatBillingFlagOptions", + "kind": "interface", + "signature": "interface SeatBillingFlagOptions", + "doc": "Define options to configure seat billing flag environment variables and override flag name" + }, + { + "name": "seatCheckoutUrl", + "kind": "function", + "signature": "(baseUrl: string, productId: string) => string", + "doc": "Platform Stripe checkout URL for a product's $100/mo seat." + }, + { + "name": "SeatStatus", + "kind": "type", + "signature": "type SeatStatus", + "doc": "Lifecycle of a per-product seat subscription, mirroring the Stripe states the platform persists." + }, + { + "name": "signSessionCookieValue", + "kind": "function", + "signature": "(token: string, secret: string) => Promise", + "doc": "Sign a session token to better-call's signed-cookie contract — the value better-auth's `getSignedCookie` verifies: `.` where the signature is the raw HMAC-SHA256 of the token under…" + }, + { + "name": "SsoStateConfig", + "kind": "interface", + "signature": "interface SsoStateConfig", + "doc": "Define configuration options for managing SSO state including secret, lifetime, and clock injection" + }, + { + "name": "TangleBearerMissingError", + "kind": "class", + "signature": "class TangleBearerMissingError", + "doc": "Represent missing Tangle platform link error for a specified user ID" + }, + { + "name": "TangleHubBearerSource", + "kind": "type", + "signature": "type TangleHubBearerSource", + "doc": "Hub bearer provenance mirrors the execution-key source union." + }, + { + "name": "TanglePlanTier", + "kind": "type", + "signature": "type TanglePlanTier", + "doc": "Define available subscription tiers for the TanglePlan service" + }, + { + "name": "TangleSsoAccountStore", + "kind": "interface", + "signature": "interface TangleSsoAccountStore", + "doc": "Account persistence seam." + }, + { + "name": "TangleSsoAuthClient", + "kind": "interface", + "signature": "interface TangleSsoAuthClient", + "doc": "Structural mirror of the platform auth wire client — any object with these two methods satisfies it without this module importing the concrete class." + }, + { + "name": "TangleSsoExchangeResult", + "kind": "interface", + "signature": "interface TangleSsoExchangeResult", + "doc": "Describe the result of exchanging SSO credentials including API key, user info, and optional plan details" + }, + { + "name": "TangleSsoHandlerOptions", + "kind": "interface", + "signature": "interface TangleSsoHandlerOptions", + "doc": "Define configuration options for handling Tangle SSO authentication and session management" + }, + { + "name": "TangleSsoHandlers", + "kind": "interface", + "signature": "interface TangleSsoHandlers", + "doc": "Define handlers for SSO start and callback routes managing authentication flow and session cookies" + }, + { + "name": "TangleSsoSessionCookieArgs", + "kind": "interface", + "signature": "interface TangleSsoSessionCookieArgs", + "doc": "Successful-login context handed to the `setSessionCookie` seam." + }, + { + "name": "TangleSsoUserCreateError", + "kind": "class", + "signature": "class TangleSsoUserCreateError", + "doc": "Thrown by `upsertUserByEmail` when the app-local user row cannot be created; the callback handler maps it to `?error=tangle_user_create_failed`." + }, + { + "name": "TangleTierPolicy", + "kind": "interface", + "signature": "interface TangleTierPolicy", + "doc": "Define policy settings for concurrency and overage allowance in a tangle tier" + }, + { + "name": "TangleTierState", + "kind": "interface", + "signature": "interface TangleTierState", + "doc": "Describe the state of a Tangle plan tier including subscription, balance, spending, and concurrency details" + }, + { + "name": "verifySignedSsoState", + "kind": "function", + "signature": "(state: string, config: SsoStateConfig) => Promise", + "doc": "Verify the MAC (constant-time) and the signed TTL." + } + ] + }, + { + "id": "./preflight", + "source": "src/preflight/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "formatPreflightReport", + "kind": "function", + "signature": "(report: PreflightReport) => string", + "doc": "Render a report as an aligned, operator-readable table + verdict line." + }, + { + "name": "httpHeadProbe", + "kind": "function", + "signature": "(config: HttpHeadProbeConfig) => PreflightProbe", + "doc": "Probe a plain reachability endpoint (e.g." + }, + { + "name": "HttpHeadProbeConfig", + "kind": "interface", + "signature": "interface HttpHeadProbeConfig", + "doc": "Define configuration options for performing an HTTP HEAD probe to check URL availability" + }, + { + "name": "PreflightProbe", + "kind": "interface", + "signature": "interface PreflightProbe", + "doc": "A liveness probe." + }, + { + "name": "PreflightProbeResult", + "kind": "interface", + "signature": "interface PreflightProbeResult", + "doc": "One probe's outcome." + }, + { + "name": "PreflightProbeVerdict", + "kind": "interface", + "signature": "interface PreflightProbeVerdict", + "doc": "Per-probe verdict enriched with the resolved criticality and measured latency." + }, + { + "name": "PreflightReport", + "kind": "interface", + "signature": "interface PreflightReport", + "doc": "Aggregate of every probe verdict plus the overall pass/fail decision." + }, + { + "name": "routerChatProbe", + "kind": "function", + "signature": "(config: RouterChatProbeConfig) => PreflightProbe", + "doc": "Probe an OpenAI-compatible LLM router with one cheap `POST /chat/completions` (`max_tokens: 1`)." + }, + { + "name": "RouterChatProbeConfig", + "kind": "interface", + "signature": "interface RouterChatProbeConfig", + "doc": "Define configuration options for probing an LLM router with authentication and model details" + }, + { + "name": "runPreflight", + "kind": "function", + "signature": "(probes: PreflightProbe[]) => Promise", + "doc": "Run every probe (concurrently), time each, and fold into a report." + }, + { + "name": "sandboxAuthProbe", + "kind": "function", + "signature": "(config: SandboxAuthProbeConfig) => PreflightProbe", + "doc": "Probe the sandbox API with a cheap authed `GET /v1/sandboxes?limit=1`." + }, + { + "name": "SandboxAuthProbeConfig", + "kind": "interface", + "signature": "interface SandboxAuthProbeConfig", + "doc": "Define configuration options for probing sandbox authentication endpoints" + } + ] + }, + { + "id": "./preset-cloudflare", + "source": "src/preset-cloudflare/index.ts", + "dependsOn": [ + "billing", + "crypto", + "knowledge", + "tools", + "web" + ], + "error": null, + "exports": [ + { + "name": "createD1KnowledgeStateAccessor", + "kind": "function", + "signature": "(opts: PresetKnowledgeAccessorOptions) => KnowledgeStateAccessor", + "doc": "The {@link KnowledgeStateAccessor} over the preset D1 schema — the seam that lets the declarative `satisfiedBy` rules resolve with ZERO consumer code: - `config(path)` reads the supplied workspace co…" + }, + { + "name": "createPresetDrizzleSchema", + "kind": "function", + "signature": "(d: DrizzleSqliteCoreLike) => { proposals: unknown; knowledge: unknown; deadlines: unknown; workspaceKeys: unknown; }", + "doc": "Build the typed Drizzle schema for the preset, given the consumer's `drizzle-orm/sqlite-core` module." + }, + { + "name": "createPresetFieldCrypto", + "kind": "function", + "signature": "(key: string | (() => string)) => KeyCrypto", + "doc": "Build the {@link KeyCrypto} the billing key store uses — AES-256-GCM field crypto bound to the product's 64-char-hex `ENCRYPTION_KEY` (or a resolver)." + }, + { + "name": "createPresetToolHandlers", + "kind": "function", + "signature": "(opts: PresetToolHandlerOptions) => AppToolHandlers", + "doc": "The default {@link AppToolHandlers} for the house stack: - `submit_proposal` → insert a `proposals` row (`status='pending'`), deduped on (workspace, title) so a retried turn doesn't double-queue." + }, + { + "name": "createPresetWorkspaceKeyManager", + "kind": "function", + "signature": "(opts: PresetBillingOptions) => WorkspaceKeyManager", + "doc": "Stand up the per-workspace budget-capped {@link WorkspaceKeyManager} on the house stack: the preset `workspace_keys` D1 store + AES-GCM field crypto + the consumer's tcloud provisioner." + }, + { + "name": "createPresetWorkspaceKeyStore", + "kind": "function", + "signature": "(db: D1Like) => WorkspaceKeyStore", + "doc": "The {@link WorkspaceKeyStore} over the preset `workspace_keys` table — the persistence seam the per-workspace key manager needs." + }, + { + "name": "D1Like", + "kind": "interface", + "signature": "interface D1Like", + "doc": "The D1 surface the preset needs." + }, + { + "name": "D1PreparedLike", + "kind": "interface", + "signature": "interface D1PreparedLike", + "doc": "A prepared, bound D1 statement." + }, + { + "name": "DrizzleColumnLike", + "kind": "interface", + "signature": "interface DrizzleColumnLike", + "doc": "A chainable column builder — every modifier returns the builder so calls like `.notNull().default('pending')` typecheck." + }, + { + "name": "DrizzleSqliteCoreLike", + "kind": "interface", + "signature": "interface DrizzleSqliteCoreLike", + "doc": "The shape of a `drizzle-orm/sqlite-core` module — the few builders the preset schema uses." + }, + { + "name": "PRESET_MIGRATION_SQL", + "kind": "const", + "signature": "readonly string[]", + "doc": "Plain DDL for the preset schema — run by a consumer to create the tables with ZERO drizzle (`for (const sql of PRESET_MIGRATION_SQL) await db.prepare(sql).run()`, or paste into a `.sql` migration)." + }, + { + "name": "PRESET_TABLES", + "kind": "const", + "signature": "{ readonly proposals: { readonly name: \"proposals\"; readonly columns: { readonly id: \"id\"; readonly workspaceId: \"works…", + "doc": "The preset table + column names — the contract the DDL, Drizzle schema, handlers, and accessor share." + }, + { + "name": "PresetBillingOptions", + "kind": "interface", + "signature": "interface PresetBillingOptions", + "doc": "Define preset billing options including database, provisioner, encryption key, budget, and optional settings" + }, + { + "name": "PresetKnowledgeAccessorOptions", + "kind": "interface", + "signature": "interface PresetKnowledgeAccessorOptions", + "doc": "Define options for accessing preset knowledge scoped to a specific workspace and configuration" + }, + { + "name": "PresetToolHandlerOptions", + "kind": "interface", + "signature": "interface PresetToolHandlerOptions", + "doc": "Define configuration options for handling preset tools including database, vault, and optional utilities" + }, + { + "name": "VaultKv", + "kind": "type", + "signature": "type VaultKv", + "doc": "The KV-backed vault." + } + ] + }, + { + "id": "./profile", + "source": "src/profile/index.ts", + "dependsOn": [ + "skills" + ], + "error": null, + "exports": [ + { + "name": "assertSkillDeliveryDisjoint", + "kind": "function", + "signature": "(inlineIds: Iterable, mountedIds: Iterable) => void", + "doc": "Throw when the same skill id is delivered both `inline` and `mounted` — the agent would see it twice (once in the prompt body, once as a mounted file it's told to go read), doubling prompt bytes and…" + }, + { + "name": "assertSystemPromptWithinBudget", + "kind": "function", + "signature": "(systemPrompt: string, budget?: ComposeProfileBudget) => void", + "doc": "Enforce {@link ComposeProfileBudget} on a composed system prompt: over budget throws (or warns with `warnOnly`) with the actual size and the top-3 largest sections." + }, + { + "name": "composeAgentProfile", + "kind": "function", + "signature": "(base: AgentProfile, channels?: ProfileChannels, overlay?: ProfileOverlay, budget?: ComposeProfileBudget) => AgentProfi…", + "doc": "Compose a deployable `AgentProfile` from a canonical base plus the four file-mount channels and the overlay overrides." + }, + { + "name": "ComposedSkills", + "kind": "interface", + "signature": "interface ComposedSkills", + "doc": "The output of {@link composeSkills}: the refs to attach to `resources.skills` (empty for `inline`) and the prompt section to fold into the system prompt (already carries its own leading `\\n\\n`, or `'…" + }, + { + "name": "ComposeProfileBudget", + "kind": "interface", + "signature": "interface ComposeProfileBudget", + "doc": "Budget config for the composed system prompt." + }, + { + "name": "composeShellResources", + "kind": "function", + "signature": "(input: ComposeShellResourcesInput) => AgentProfileFileMount[]", + "doc": "Compose every mount channel into one `resources.files`-ready array." + }, + { + "name": "ComposeShellResourcesInput", + "kind": "interface", + "signature": "interface ComposeShellResourcesInput", + "doc": "Inputs to {@link composeShellResources}." + }, + { + "name": "composeSkills", + "kind": "function", + "signature": "(input: ComposeSkillsInput) => ComposedSkills", + "doc": "Build the {@link ComposedSkills} for one delivery mode." + }, + { + "name": "CorpusEntry", + "kind": "interface", + "signature": "interface CorpusEntry", + "doc": "One markdown document discovered from the corpus." + }, + { + "name": "CorpusLoadResult", + "kind": "interface", + "signature": "interface CorpusLoadResult", + "doc": "Outcome of {@link loadMarkdownCorpus}: the entries plus which path produced them, so a caller can fail loud when both are empty rather than silently mounting nothing." + }, + { + "name": "corpusSkills", + "kind": "function", + "signature": "(corpus: CorpusEntry[], anchor: string) => AgentProfileFileMount[]", + "doc": "Project corpus entries onto SDK file mounts at a relative path under `/`." + }, + { + "name": "DEFAULT_MAX_SYSTEM_PROMPT_BYTES", + "kind": "const", + "signature": "40000", + "doc": "Byte budget on the FINAL composed `prompt.systemPrompt`." + }, + { + "name": "EvolvableSectionInput", + "kind": "interface", + "signature": "interface EvolvableSectionInput", + "doc": "Inputs to {@link makeEvolvableSection}." + }, + { + "name": "GlobModules", + "kind": "type", + "signature": "type GlobModules", + "doc": "A Vite eager `?raw` glob result: glob key -> raw file body." + }, + { + "name": "largestPromptSections", + "kind": "function", + "signature": "(prompt: string, top?: number) => { title: string; bytes: number; }[]", + "doc": "Largest markdown-heading-delimited sections of a prompt, by UTF-8 bytes." + }, + { + "name": "LoadCorpusOptions", + "kind": "interface", + "signature": "interface LoadCorpusOptions", + "doc": "Options for {@link loadMarkdownCorpus}." + }, + { + "name": "loadMarkdownCorpus", + "kind": "function", + "signature": "(options: LoadCorpusOptions, importMetaUrl?: string | undefined) => CorpusLoadResult", + "doc": "Load a markdown corpus, preferring a Vite glob-result map and falling back to a Node fs walk." + }, + { + "name": "makeEvolvableSection", + "kind": "function", + "signature": "(input: EvolvableSectionInput) => AgentProfileSection", + "doc": "Build the one evolvable (`evolvable: true`) domain section whose body comes from the product's loader, falling back to the required baseline when the loaded body is empty after stripping comments." + }, + { + "name": "mergeComposedSkills", + "kind": "function", + "signature": "(batches: ComposedSkills[]) => ComposedSkills", + "doc": "Combine multiple {@link ComposedSkills} batches (e.g." + }, + { + "name": "parseCorpusSkills", + "kind": "function", + "signature": "(corpus: CorpusEntry[]) => SkillEntry[]", + "doc": "Map a loaded corpus (see {@link loadMarkdownCorpus}) onto `SkillEntry`s, using each entry's `id` as the fallback when its `SKILL.md` carries no frontmatter `id` of its own." + }, + { + "name": "ParsedSkill", + "kind": "interface", + "signature": "interface ParsedSkill", + "doc": "The result of {@link parseSkillFrontmatter}: the parsed fields, the body with the frontmatter block stripped, and the original untouched text." + }, + { + "name": "parseSkillFrontmatter", + "kind": "function", + "signature": "(raw: string) => ParsedSkill", + "doc": "THE one `SKILL.md` frontmatter parser — hand-rolled, no YAML dependency." + }, + { + "name": "profile", + "kind": "namespace", + "signature": "namespace profile", + "doc": null + }, + { + "name": "ProfileChannels", + "kind": "interface", + "signature": "interface ProfileChannels", + "doc": "The file-mount channels layered onto `resources.files`." + }, + { + "name": "ProfileOverlay", + "kind": "interface", + "signature": "interface ProfileOverlay", + "doc": "Overlay overrides applied on top of the channel mounts." + }, + { + "name": "registrySkills", + "kind": "function", + "signature": "(registry: SkillEntry[], tier?: string) => AgentProfileFileMount[]", + "doc": "Project the registry's free-tier (or `tier`-matched) entries onto SDK file mounts at the harness skill-discovery path." + }, + { + "name": "renderInlineSkills", + "kind": "function", + "signature": "(input: RenderInlineSkillsInput) => string", + "doc": "Render every (tier-filtered) skill's full body inline into the prompt — the `inline` delivery mode." + }, + { + "name": "renderSkillIndex", + "kind": "function", + "signature": "(input: RenderSkillIndexInput) => string", + "doc": "Render a one-line-per-skill INDEX (name, description, and the path to read the full body) — the `mounted` delivery mode's prompt section, paired with {@link skillRefs} putting the actual files on `re…" + }, + { + "name": "SkillDeliveryMode", + "kind": "type", + "signature": "type SkillDeliveryMode", + "doc": "How a skill reaches the agent: `inline` renders its full body into the system prompt; `mounted` puts it on the typed `resources.skills` channel and renders only an index line." + }, + { + "name": "SkillEntry", + "kind": "interface", + "signature": "interface SkillEntry", + "doc": "A hand-authored, tier-gated installable skill." + }, + { + "name": "skillEntryFromMarkdown", + "kind": "function", + "signature": "(raw: string, fallbackId?: string | undefined) => SkillEntry", + "doc": "Build a {@link SkillEntry} from a raw `SKILL.md` body." + }, + { + "name": "SkillFrontmatter", + "kind": "interface", + "signature": "interface SkillFrontmatter", + "doc": "Fields a `SKILL.md` frontmatter block may declare." + }, + { + "name": "skillMountPath", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Harness skill-discovery path the Claude Code backend reads natively." + }, + { + "name": "skillRefs", + "kind": "function", + "signature": "(skills: SkillEntry[], opts?: { tier?: string | undefined; }) => AgentProfileResourceRef[]", + "doc": "Project skills onto the typed `resources.skills` channel (`AgentProfileResourceRef[]`), tier-filtered (same `s.tier === tier` semantics as {@link registrySkills}) when `opts.tier` is given, sorted by…" + }, + { + "name": "stripComments", + "kind": "function", + "signature": "(raw: string) => string", + "doc": "True body of an addendum file with HTML comments stripped — an all-comment placeholder counts as empty, so the loader falls back to the baseline." + }, + { + "name": "UserSkill", + "kind": "interface", + "signature": "interface UserSkill", + "doc": "A per-user / per-workspace skill: an id and an inline `SKILL.md` body." + }, + { + "name": "userSkillMounts", + "kind": "function", + "signature": "(userSkills: UserSkill[]) => AgentProfileFileMount[]", + "doc": "Project per-user skills onto SDK file mounts at the harness skill-discovery path." + } + ] + }, + { + "id": "./prompt", + "source": "src/prompt/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "AssembleResult", + "kind": "type", + "signature": "type AssembleResult", + "doc": "Typed outcome of {@link assembleSystemPrompt}." + }, + { + "name": "assembleSystemPrompt", + "kind": "function", + "signature": "(input: AssembleSystemPromptInput) => AssembleResult", + "doc": "Assemble a system prompt from a base block, an operating directive, and an ordered list of pre-rendered context sections." + }, + { + "name": "AssembleSystemPromptInput", + "kind": "interface", + "signature": "interface AssembleSystemPromptInput", + "doc": "Inputs to {@link assembleSystemPrompt}." + } + ] + }, + { + "id": "./redact", + "source": "src/redact/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "buildRedactedDocument", + "kind": "function", + "signature": "(text: string, options: BuildRedactedDocumentOptions) => Promise", + "doc": "Split `text` into text + redacted segments, encrypting each redacted span's original." + }, + { + "name": "BuildRedactedDocumentOptions", + "kind": "interface", + "signature": "interface BuildRedactedDocumentOptions", + "doc": "Define options to encrypt text and specify patterns for redacting sensitive document content" + }, + { + "name": "DEFAULT_REDACTION_PATTERNS", + "kind": "const", + "signature": "readonly RedactionPattern[]", + "doc": "The default deterministic patterns." + }, + { + "name": "detectSpans", + "kind": "function", + "signature": "(text: string, patterns?: readonly RedactionPattern[]) => RedactionSpan[]", + "doc": "Find non-overlapping PII spans in `text`." + }, + { + "name": "maskSpans", + "kind": "function", + "signature": "(text: string, patterns?: readonly RedactionPattern[]) => string", + "doc": "Replace only the PII substrings in `text`, preserving everything around them (the `mask-spans` string mode)." + }, + { + "name": "RedactedDocSegment", + "kind": "type", + "signature": "type RedactedDocSegment", + "doc": "A redacted document segment: literal text, or a masked span with the original kept ENCRYPTED for an authorized reveal." + }, + { + "name": "RedactedDocument", + "kind": "interface", + "signature": "interface RedactedDocument", + "doc": "Define a document composed of multiple redacted content segments" + }, + { + "name": "redactForIngestion", + "kind": "function", + "signature": "(value: unknown, options?: RedactForIngestionOptions) => unknown", + "doc": "One-way PII scrub for telemetry/ingestion." + }, + { + "name": "RedactForIngestionOptions", + "kind": "interface", + "signature": "interface RedactForIngestionOptions", + "doc": "Define options to customize sensitive data redaction patterns and key names for ingestion" + }, + { + "name": "RedactionPattern", + "kind": "interface", + "signature": "interface RedactionPattern", + "doc": "A named PII pattern." + }, + { + "name": "RedactionSpan", + "kind": "interface", + "signature": "interface RedactionSpan", + "doc": "A detected PII span in a source string." + }, + { + "name": "RevealResult", + "kind": "interface", + "signature": "interface RevealResult", + "doc": "Describe the outcome of a reveal operation including success status, value, and failure reason" + }, + { + "name": "revealSpan", + "kind": "function", + "signature": "(doc: RedactedDocument, spanId: string, options: RevealSpanOptions) => Promise", + "doc": "Reveal one redacted span's original, gated + audited." + }, + { + "name": "RevealSpanOptions", + "kind": "interface", + "signature": "interface RevealSpanOptions", + "doc": "Define options to decrypt, authorize, and audit the reveal of a span segment" + } + ] + }, + { + "id": "./run", + "source": "src/run/index.ts", + "dependsOn": [ + "harness" + ], + "error": null, + "exports": [ + { + "name": "ExecutionMode", + "kind": "type", + "signature": "type ExecutionMode", + "doc": "Define execution mode as either router or sandbox" + }, + { + "name": "executionModeForProfile", + "kind": "function", + "signature": "(profile: ShellProfile) => ExecutionMode", + "doc": "Execution mode for a profile — `harness` omitted/null => router." + }, + { + "name": "isKnownSandboxHarness", + "kind": "function", + "signature": "(harness: ProfileHarness) => harness is \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"fact…", + "doc": "True when `harness` names a sandbox backend the SDK knows about." + }, + { + "name": "ProfileHarness", + "kind": "type", + "signature": "type ProfileHarness", + "doc": "Resolve a ProfileHarness as a Harness, RouterHarness, null, or undefined value" + }, + { + "name": "resolveExecutionMode", + "kind": "function", + "signature": "(harness: ProfileHarness) => ExecutionMode", + "doc": "Infer the execution mode from a profile's harness." + }, + { + "name": "ROUTER_HARNESS", + "kind": "const", + "signature": "\"router\"", + "doc": "The router pseudo-harness — the absence of a sandbox backend." + }, + { + "name": "RouterHarness", + "kind": "type", + "signature": "type RouterHarness", + "doc": "Provide a type alias for the ROUTER_HARNESS constant to enable consistent router harness usage" + }, + { + "name": "runAgent", + "kind": "function", + "signature": "(harness: ProfileHarness, branches: RunAgentBranches) => AsyncGenerator", + "doc": "Route a turn to the branch the harness selects and stream its events through." + }, + { + "name": "RunAgentBranches", + "kind": "interface", + "signature": "interface RunAgentBranches", + "doc": "The two branch runners." + }, + { + "name": "ShellProfile", + "kind": "interface", + "signature": "interface ShellProfile", + "doc": "The superset the dispatch reads: the SDK `AgentProfile` plus the harness discriminator." + } + ] + }, + { + "id": "./runtime", + "source": "src/runtime/index.ts", + "dependsOn": [ + "tools" + ], + "error": null, + "exports": [ + { + "name": "AgentRuntime", + "kind": "interface", + "signature": "interface AgentRuntime", + "doc": "Resolve and stream tool execution loops with final results and intermediate events for agent runtime" + }, + { + "name": "AgentRuntimeModelConfig", + "kind": "interface", + "signature": "interface AgentRuntimeModelConfig", + "doc": "OpenAI-compatible model endpoint (Tangle Router / tcloud / any compat provider)." + }, + { + "name": "AgentTurnOptions", + "kind": "interface", + "signature": "interface AgentTurnOptions", + "doc": "Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers" + }, + { + "name": "AnySurfaceKind", + "kind": "type", + "signature": "type AnySurfaceKind", + "doc": "The variance-erased form a registry accepts (`build` is contravariant in `TCtx`, so every concrete definition is assignable to this)." + }, + { + "name": "AppToolLoopOptions", + "kind": "interface", + "signature": "interface AppToolLoopOptions", + "doc": null + }, + { + "name": "buildCatalog", + "kind": "function", + "signature": "(raw: RouterModel[], opts?: { preferredDefault?: string | undefined; } | undefined) => ModelCatalog", + "doc": "Pure catalogue pipeline." + }, + { + "name": "CatalogModel", + "kind": "interface", + "signature": "interface CatalogModel", + "doc": "Define the structure and capabilities of a catalog item with optional pricing and feature flags" + }, + { + "name": "CertifiedDelivery", + "kind": "interface", + "signature": "interface CertifiedDelivery", + "doc": "Resolve and manage certified profiles with refresh and composition capabilities" + }, + { + "name": "CertifiedDeliveryConfig", + "kind": "interface", + "signature": "interface CertifiedDeliveryConfig", + "doc": "Define configuration options for delivering certified artifacts to a specified tenant target" + }, + { + "name": "createAgentRuntime", + "kind": "function", + "signature": "(opts: CreateAgentRuntimeOptions) => AgentRuntime", + "doc": "Create an in-process agent runtime for one agent." + }, + { + "name": "CreateAgentRuntimeOptions", + "kind": "interface", + "signature": "interface CreateAgentRuntimeOptions", + "doc": "Define options for creating an agent runtime including model config and optional profile transformation" + }, + { + "name": "createCertifiedDelivery", + "kind": "function", + "signature": "(config: CertifiedDeliveryConfig) => CertifiedDelivery", + "doc": "Build a certified-delivery transform for one agent target." + }, + { + "name": "createOpenAICompatStreamTurn", + "kind": "function", + "signature": "(opts: OpenAICompatStreamTurnOptions) => (messages: ToolLoopMessage[]) => AsyncIterable", + "doc": "Build a `streamTurn` that calls an OpenAI-compatible `/chat/completions` endpoint (Tangle Router / tcloud / any compat provider) with `stream: true` and yields `LoopEvent`s via {@link toLoopEvents}." + }, + { + "name": "createSurfaceRegistry", + "kind": "function", + "signature": "(kinds: readonly AnySurfaceKind[]) => SurfaceRegistry", + "doc": "Assemble the product's surface registry from its registered kinds." + }, + { + "name": "createTangleRouterModelConfig", + "kind": "function", + "signature": "(opts: CreateTangleRouterModelConfigOptions) => TangleModelConfig", + "doc": "Build an OpenAI-compatible Tangle Router model config from an already resolved execution key." + }, + { + "name": "CreateTangleRouterModelConfigOptions", + "kind": "interface", + "signature": "interface CreateTangleRouterModelConfigOptions", + "doc": "Define configuration options for creating a Tangle router model including API key and model details" + }, + { + "name": "DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR", + "kind": "const", + "signature": "\"TANGLE_BILLING_ENFORCEMENT\"", + "doc": "Define the default environment variable name for Tangle billing enforcement" + }, + { + "name": "DEFAULT_TANGLE_ROUTER_BASE_URL", + "kind": "const", + "signature": "\"https://router.tangle.tools/v1\"", + "doc": "Provide the default base URL for the Tangle router API endpoint" + }, + { + "name": "defineSurfaceKind", + "kind": "function", + "signature": "(opts: { kind: string; build: (ctx: TCtx) => SurfaceOverlay | Promise; }) => SurfaceKindDefinitio…", + "doc": "Declare one surface kind." + }, + { + "name": "fetchModelCatalog", + "kind": "function", + "signature": "(cfg: { baseUrl: string; apiKey: string; preferredDefault?: string | undefined; }) => Promise", + "doc": "Fetch the router model list and build the catalogue, with an in-isolate cache (TTL 5 min)." + }, + { + "name": "isTangleBillingEnforcementDisabled", + "kind": "function", + "signature": "(opts?: TangleBillingEnforcementOptions) => boolean", + "doc": "Shared policy for agent products that bill through the Tangle Platform." + }, + { + "name": "isTangleExecutionKeyError", + "kind": "function", + "signature": "(error: unknown) => error is TangleExecutionKeyError", + "doc": "Identify whether an error is a TangleExecutionKeyError based on its properties and type" + }, + { + "name": "LoopAssistantToolCall", + "kind": "interface", + "signature": "interface LoopAssistantToolCall", + "doc": "One OpenAI-shaped tool-call entry carried on an assistant message." + }, + { + "name": "LoopEvent", + "kind": "type", + "signature": "type LoopEvent", + "doc": "Events the app's OpenAI-compat stream adapter ({@link toLoopEvents }) yields." + }, + { + "name": "LoopMessage", + "kind": "type", + "signature": "type LoopMessage", + "doc": "A message in the running conversation the loop sends to `streamTurn`." + }, + { + "name": "LoopToolCall", + "kind": "interface", + "signature": "interface LoopToolCall", + "doc": "Bounded turn-level tool-dispatch loop." + }, + { + "name": "mergeSurfaceOverlay", + "kind": "function", + "signature": "(base: TBase, overlay: SurfaceOverlay) => TBase & SurfaceMergeBase", + "doc": "Merge one surface overlay into a base profile, returning a new object (the base is never mutated; untouched nested records are shared by reference)." + }, + { + "name": "ModelCatalog", + "kind": "interface", + "signature": "interface ModelCatalog", + "doc": "Define a catalog containing models with a default ID and fetch timestamp" + }, + { + "name": "normalizeModelId", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Strip provider prefix, :free suffix, and trailing date stamps." + }, + { + "name": "OpenAICompatStreamTurnOptions", + "kind": "interface", + "signature": "interface OpenAICompatStreamTurnOptions", + "doc": "Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools" + }, + { + "name": "OpenAIStreamChunk", + "kind": "interface", + "signature": "interface OpenAIStreamChunk", + "doc": "Minimal OpenAI Chat Completions streaming chunk (structural — no `openai` dep)." + }, + { + "name": "ResolvedAgentProfile", + "kind": "interface", + "signature": "interface ResolvedAgentProfile", + "doc": "The agent's resolved profile surfaces for one turn — the things a delivered / certified `AgentProfile` can change." + }, + { + "name": "ResolvedTangleExecutionKey", + "kind": "interface", + "signature": "interface ResolvedTangleExecutionKey", + "doc": "Define a resolved key combining an API key with its Tangle execution source" + }, + { + "name": "ResolveModelOptions", + "kind": "interface", + "signature": "interface ResolveModelOptions", + "doc": "Resolve options for model configuration including environment variables and default router base URL" + }, + { + "name": "resolveTangleDevOrUserKey", + "kind": "function", + "signature": "(opts: ResolveTangleDevOrUserKeyOptions) => Promise", + "doc": "Shared dev-aware Tangle key resolution." + }, + { + "name": "ResolveTangleDevOrUserKeyOptions", + "kind": "interface", + "signature": "interface ResolveTangleDevOrUserKeyOptions", + "doc": "Resolve options for retrieving a Tangle developer or user API key based on environment and context" + }, + { + "name": "resolveTangleExecutionEnvironment", + "kind": "function", + "signature": "(env?: Record) => TangleExecutionEnvironment", + "doc": "Resolve the current Tangle execution environment based on provided or process environment variables" + }, + { + "name": "resolveTangleModelConfig", + "kind": "function", + "signature": "(opts?: ResolveModelOptions) => TangleModelConfig", + "doc": "Resolve the model config from env." + }, + { + "name": "resolveUserTangleExecutionKey", + "kind": "function", + "signature": "(opts: ResolveUserTangleExecutionKeyOptions) => Promise", + "doc": "Resolve the user-facing Tangle API key for model execution." + }, + { + "name": "resolveUserTangleExecutionKeyForUser", + "kind": "function", + "signature": "(opts: ResolveUserTangleExecutionKeyForUserOptions) => Promise", + "doc": "Resolve the Tangle execution key for a specified user using provided environment and API key options" + }, + { + "name": "ResolveUserTangleExecutionKeyForUserOptions", + "kind": "interface", + "signature": "interface ResolveUserTangleExecutionKeyForUserOptions", + "doc": "Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters" + }, + { + "name": "ResolveUserTangleExecutionKeyOptions", + "kind": "interface", + "signature": "interface ResolveUserTangleExecutionKeyOptions", + "doc": "Resolve options for retrieving user API keys within a specific Tangle execution environment" + }, + { + "name": "RouterModel", + "kind": "interface", + "signature": "interface RouterModel", + "doc": "Model catalogue — computed live from the Tangle Router, never hand-curated." + }, + { + "name": "runAppToolLoop", + "kind": "function", + "signature": "(opts: RunToolLoopOptions) => Promise", + "doc": "Run the bounded tool loop and return the final text + every executed tool outcome." + }, + { + "name": "streamAppToolLoop", + "kind": "function", + "signature": "(opts: StreamToolLoopOptions) => AsyncGenerator, void, unknown>", + "doc": "Streaming bounded tool loop: yields each raw turn event (the caller maps + telemetries + re-emits it) and each executed `tool_result`; emits one `capped` if it stops for any non-completed reason with…" + }, + { + "name": "StreamAppToolLoopOptions", + "kind": "interface", + "signature": "interface StreamAppToolLoopOptions", + "doc": null + }, + { + "name": "StreamLoopYield", + "kind": "type", + "signature": "type StreamLoopYield", + "doc": null + }, + { + "name": "SurfaceKindDefinition", + "kind": "interface", + "signature": "interface SurfaceKindDefinition", + "doc": "One registered surface kind." + }, + { + "name": "SurfaceMcpServer", + "kind": "type", + "signature": "type SurfaceMcpServer", + "doc": "The only MCP entry shape an overlay may carry: the server-built bridge entry from ../tools/mcp (transport, url, headers, and capability token all assembled server-side)." + }, + { + "name": "SurfaceMergeBase", + "kind": "interface", + "signature": "interface SurfaceMergeBase", + "doc": "Base-profile slice the merge reads/writes." + }, + { + "name": "SurfaceOverlay", + "kind": "interface", + "signature": "interface SurfaceOverlay", + "doc": "What one surface contributes to the agent profile for a single turn." + }, + { + "name": "SurfacePermissionValue", + "kind": "type", + "signature": "type SurfacePermissionValue", + "doc": "Sandbox permission posture values, ranked deny > ask > allow for merging." + }, + { + "name": "SurfaceRegistry", + "kind": "interface", + "signature": "interface SurfaceRegistry", + "doc": "Resolve and build the overlay for a given surface kind within a turn context" + }, + { + "name": "TangleBillingEnforcementOptions", + "kind": "interface", + "signature": "interface TangleBillingEnforcementOptions", + "doc": "Define options for configuring billing enforcement environment variables and overrides" + }, + { + "name": "TangleExecutionEnvironment", + "kind": "type", + "signature": "type TangleExecutionEnvironment", + "doc": "Define the environment context for executing Tangle operations" + }, + { + "name": "TangleExecutionKeyError", + "kind": "class", + "signature": "class TangleExecutionKeyError", + "doc": "Represent execution key errors with specific codes and HTTP status information" + }, + { + "name": "TangleExecutionKeyErrorCode", + "kind": "type", + "signature": "type TangleExecutionKeyErrorCode", + "doc": "Define error codes for Tangle execution key issues related to API key and account connection" + }, + { + "name": "tangleExecutionKeyHttpError", + "kind": "function", + "signature": "(error: unknown) => TangleExecutionKeyHttpError | null", + "doc": "Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null" + }, + { + "name": "TangleExecutionKeyHttpError", + "kind": "interface", + "signature": "interface TangleExecutionKeyHttpError", + "doc": "Represent HTTP error response containing status, error message, and specific error code" + }, + { + "name": "TangleExecutionKeySource", + "kind": "type", + "signature": "type TangleExecutionKeySource", + "doc": "Resolve the source of the Tangle execution key as either local environment or user input" + }, + { + "name": "TangleModelConfig", + "kind": "interface", + "signature": "interface TangleModelConfig", + "doc": "Resolve the model config a Tangle agent's sandbox/runtime runs on." + }, + { + "name": "toLoopEvents", + "kind": "function", + "signature": "(chunks: AsyncIterable) => AsyncIterable", + "doc": "Map an OpenAI-compat streaming chunk iterator to `LoopEvent`s: each content delta → a `text` event; tool-call deltas are accumulated by index across chunks and emitted as one complete `tool_call` eve…" + }, + { + "name": "ToolLoopEvent", + "kind": "type", + "signature": "type ToolLoopEvent", + "doc": null + }, + { + "name": "ToolLoopResult", + "kind": "interface", + "signature": "interface ToolLoopResult", + "doc": null + }, + { + "name": "ToolLoopStopReason", + "kind": "type", + "signature": "type ToolLoopStopReason", + "doc": "Why the loop stopped." + }, + { + "name": "trimOrNull", + "kind": "function", + "signature": "(value: string | null | undefined) => string | null", + "doc": "Resolve a string by trimming whitespace or returning null if empty or undefined" + } + ] + }, + { + "id": "./sandbox", + "source": "src/sandbox/index.ts", + "dependsOn": [ + "crypto", + "harness", + "runtime", + "tools" + ], + "error": null, + "exports": [ + { + "name": "AppToolDescriptor", + "kind": "interface", + "signature": "interface AppToolDescriptor", + "doc": "Describe an application tool with its name, unique key, and description" + }, + { + "name": "assertEnvWithinLimits", + "kind": "function", + "signature": "(env: Record) => void", + "doc": "Throw when any single env value exceeds {@link ENV_VALUE_MAX_BYTES} or the whole env block exceeds {@link ENV_TOTAL_MAX_BYTES}, naming the offending variable." + }, + { + "name": "assertProvisionPayloadWithinCap", + "kind": "function", + "signature": "(payload: ProvisionPayloadSections) => void", + "doc": "Throw when the serialized provision payload exceeds {@link PROVISION_PAYLOAD_MAX_BYTES}." + }, + { + "name": "attachReasoningEffort", + "kind": "function", + "signature": "(profile: AgentProfile, harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-dro…", + "doc": "Attach a specified reasoning effort level to an agent profile for a given harness" + }, + { + "name": "AuthenticatedSandboxUser", + "kind": "interface", + "signature": "interface AuthenticatedSandboxUser", + "doc": "Represent an authenticated user within a sandbox environment with a unique identifier" + }, + { + "name": "bearerSubprotocolToken", + "kind": "function", + "signature": "(value: string | null) => string | null", + "doc": "Resolve and decode a bearer token from a comma-separated subprotocol string or return null" + }, + { + "name": "bearerToken", + "kind": "function", + "signature": "(value: string | null) => string | null", + "doc": "Extract the token from a bearer authorization string or return null if invalid or missing" + }, + { + "name": "buildAppToolMcpServers", + "kind": "function", + "signature": "(options: BuildAppToolMcpServersOptions) => Record", + "doc": "Build a mapping of MCP server profiles keyed by tool identifiers from provided options" + }, + { + "name": "BuildAppToolMcpServersOptions", + "kind": "interface", + "signature": "interface BuildAppToolMcpServersOptions", + "doc": "Define options for building MCP server configurations in the app tool environment" + }, + { + "name": "buildSandboxRuntimeProxyHeaders", + "kind": "function", + "signature": "(source: Headers, sandboxApiKey: string, forwardHeaders?: string[]) => Headers", + "doc": "Build proxy headers for sandbox runtime including authorization and forwarded headers" + }, + { + "name": "buildSandboxToolFileMounts", + "kind": "function", + "signature": "(options: BuildSandboxToolFileMountsOptions) => AgentProfileFileMount[]", + "doc": "Build file mounts for sandbox tools based on provided options and tool configurations" + }, + { + "name": "BuildSandboxToolFileMountsOptions", + "kind": "interface", + "signature": "interface BuildSandboxToolFileMountsOptions", + "doc": "Define options for building sandbox tool file mounts including tool specifications and paths" + }, + { + "name": "buildSandboxToolPathSetupScript", + "kind": "function", + "signature": "(options: SandboxToolPathOptions) => string", + "doc": "Build a shell script that sets up and exports the sandbox tool binary directory in user profiles" + }, + { + "name": "classifySeveredStream", + "kind": "function", + "signature": "(event: unknown) => SandboxStepTransition | null", + "doc": "Resolve the severed stream event to a corresponding sandbox step transition or null" + }, + { + "name": "createSandboxTerminalToken", + "kind": "function", + "signature": "(subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise", + "doc": "Generate a sandbox terminal token for a given subject with specified options" + }, + { + "name": "createWorkspaceSandboxConnectionHandler", + "kind": "function", + "signature": "(opts: WorkspaceSandboxConnectionHandlerOptions) => ({ request, params…", + "doc": "Create a handler to resolve workspace sandbox connections with user and access validation" + }, + { + "name": "createWorkspaceSandboxManager", + "kind": "function", + "signature": "(opts: WorkspaceSandboxManagerOptions ({ request, params }: WorkspaceSandboxRuntimeProxyArgs) => Promis…", + "doc": "Create a proxy handler to resolve sandbox runtime requests with user and workspace access validation" + }, + { + "name": "createWorkspaceSandboxTerminalUpgradeHandler", + "kind": "function", + "signature": "(opts: WorkspaceSandboxTerminalUpgradeHandlerOptions) => (request: Request) => Promise", + "doc": "Build a Worker-entry handler that proxies a sandbox terminal WebSocket upgrade to the sandbox API runtime proxy." + }, + { + "name": "DEFAULT_SANDBOX_RESOURCES", + "kind": "const", + "signature": "SandboxResourceConfig", + "doc": "Define default resource limits and settings for sandbox environments" + }, + { + "name": "deferredCorpusHash", + "kind": "function", + "signature": "(files: AgentProfileFileMount[]) => string", + "doc": "Stable content hash of the deferred file corpus (path + inline content)." + }, + { + "name": "deleteSecret", + "kind": "function", + "signature": "(store: SecretStore, name: string) => Promise>", + "doc": "Delete a secret by name from the given secret store and return the operation outcome" + }, + { + "name": "detectInteractiveQuestion", + "kind": "function", + "signature": "(event: unknown) => string | null", + "doc": "Resolve the interactive question text from a structured event or return null if none found" + }, + { + "name": "driveSandboxTurn", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options: DriveSandboxTurnOptio…", + "doc": "Resolve a sandbox turn by processing a message with given configuration and options" + }, + { + "name": "DriveSandboxTurnOptions", + "kind": "interface", + "signature": "interface DriveSandboxTurnOptions", + "doc": "Define options to manage deterministic session resumption and turn idempotency in sandboxed drive turns" + }, + { + "name": "encodeSandboxRuntimePath", + "kind": "function", + "signature": "(runtimePath: string) => string | null", + "doc": "Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments" + }, + { + "name": "ensureWorkspaceSandbox", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions) => Promise", + "doc": "Resolve or create a workspace sandbox instance with optional reuse and progress tracking" + }, + { + "name": "EnsureWorkspaceSandboxOptions", + "kind": "interface", + "signature": "interface EnsureWorkspaceSandboxOptions", + "doc": "Define options for ensuring a workspace sandbox with provisioning and progress handling" + }, + { + "name": "ENV_TOTAL_MAX_BYTES", + "kind": "const", + "signature": "200000", + "doc": "Total env gate: the whole environment block shares the payload budget with the profile; past 200 KB the provision body cannot stay under the cap." + }, + { + "name": "ENV_VALUE_MAX_BYTES", + "kind": "const", + "signature": "120000", + "doc": "Per-variable env gate: the kernel rejects any single `NAME=value` env entry over MAX_ARG_STRLEN (131072 bytes) with E2BIG, killing every exec inside the box." + }, + { + "name": "flattenHistory", + "kind": "function", + "signature": "(message: string, history?: { role: \"user\" | \"assistant\"; content: string; }[] | undefined) => string", + "doc": "Build a single string combining conversation history and the current user message" + }, + { + "name": "getClient", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig) => SandboxClient", + "doc": "Resolve a synchronous sandbox client from provided runtime configuration credentials" + }, + { + "name": "isSandboxTerminalWsUpgrade", + "kind": "function", + "signature": "(request: Request) => boolean", + "doc": "True when `request` is a WebSocket upgrade for a sandbox terminal path." + }, + { + "name": "isTerminalPromptEvent", + "kind": "function", + "signature": "(event: unknown) => boolean", + "doc": "Determine if an event is a terminal prompt event with type 'result' or 'done" + }, + { + "name": "LivenessProbeConfig", + "kind": "interface", + "signature": "interface LivenessProbeConfig", + "doc": "Define configuration for liveness probes including sidecar process pattern and optional timeouts" + }, + { + "name": "matchSandboxTerminalWsPath", + "kind": "function", + "signature": "(pathname: string) => SandboxTerminalWsMatch | null", + "doc": "Parse a same-origin terminal-WS pathname into its parts, or `null` when the path is not a sandbox terminal WebSocket." + }, + { + "name": "MemberSyncSeam", + "kind": "interface", + "signature": "interface MemberSyncSeam", + "doc": "Map workspace roles to corresponding sandbox permission levels" + }, + { + "name": "mergeExtraMcp", + "kind": "function", + "signature": "(appToolMcp: Record, baseProfileMcp: Record, extra: Recor…", + "doc": "Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys" + }, + { + "name": "mergeHistoryIntoParts", + "kind": "function", + "signature": "(parts: PromptInputPart[], history?: { role: \"user\" | \"assistant\"; content: string; }[] | undefined) => PromptInputPart…", + "doc": "History-aware equivalent of flattenHistory for multimodal prompt parts: the transcript is folded into the first text part (image/file parts carry no text to prepend to) rather than replacing the mess…" + }, + { + "name": "mintSandboxScopedToken", + "kind": "function", + "signature": "(box: SandboxInstance, options: { scope: ScopedTokenScope; sessionId?: string | undefined; ttlMinutes?: number | undefi…", + "doc": "Mint a scoped token for an already-provisioned box (e.g." + }, + { + "name": "mintTerminalProxyToken", + "kind": "function", + "signature": "(secret: string, identity: TerminalProxyIdentity, ttlMs?: number, now?: () => number) => Promise Promise Prom…", + "doc": "Reads a sandbox file as base64 and decodes it, verifying the decoded byte length against `expectedSize` (from a prior {@link statSandboxFileSize})." + }, + { + "name": "readSecret", + "kind": "function", + "signature": "(store: SecretStore, name: string) => Promise>", + "doc": "Resolve a secret value from the store by its name and return the outcome asynchronously" + }, + { + "name": "resetClientCache", + "kind": "function", + "signature": "() => void", + "doc": "Reset the client cache to clear stored data and force fresh retrieval" + }, + { + "name": "ResolvedModel", + "kind": "interface", + "signature": "interface ResolvedModel", + "doc": "Represent a fully configured model with optional API key and base URL for sandbox platform integration" + }, + { + "name": "resolveModel", + "kind": "function", + "signature": "(config: ProviderResolutionConfig | undefined, override?: { model?: string | undefined; modelApiKey?: string | undefine…", + "doc": "Resolve and return the appropriate model configuration based on provider settings and optional overrides" + }, + { + "name": "resolveSandboxClientCredentials", + "kind": "function", + "signature": "(options?: ResolveSandboxClientCredentialsOptions) => Promise", + "doc": "Resolve sandbox client credentials based on environment and provided options asynchronously" + }, + { + "name": "ResolveSandboxClientCredentialsOptions", + "kind": "interface", + "signature": "interface ResolveSandboxClientCredentialsOptions", + "doc": "Resolve options for obtaining sandbox client credentials from environment variables and classification" + }, + { + "name": "runSandboxPrompt", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO…", + "doc": "Resolve a sandbox prompt by streaming and aggregating message parts into a complete string" + }, + { + "name": "runSandboxToolPathSetup", + "kind": "function", + "signature": "(box: SandboxInstance, options: SandboxToolPathOptions) => Promise>", + "doc": "Resolve the sandbox environment PATH setup by executing the configuration script with given options" + }, + { + "name": "SandboxApiCredentials", + "kind": "interface", + "signature": "interface SandboxApiCredentials", + "doc": "Define credentials required to access the sandbox API environment" + }, + { + "name": "SandboxBuildContext", + "kind": "interface", + "signature": "interface SandboxBuildContext", + "doc": "Define the context for building a sandbox including workspace, integrations, and optional user ID" + }, + { + "name": "SandboxClientCredentials", + "kind": "interface", + "signature": "interface SandboxClientCredentials", + "doc": "Define client credentials for accessing the sandbox environment with API key and base URL" + }, + { + "name": "SandboxCredentialEnvironment", + "kind": "type", + "signature": "type SandboxCredentialEnvironment", + "doc": "Sandbox credential policy reuses the canonical execution-environment union (development/test/staging/production) so env classification stays in one place (see resolveTangleExecutionEnvironment in run…" + }, + { + "name": "SandboxExecChannel", + "kind": "interface", + "signature": "interface SandboxExecChannel", + "doc": "The `box.exec` surface these helpers use — structural, so a caller can pass the sandbox SDK's `SandboxInstance` directly or a narrower test double." + }, + { + "name": "SandboxExecOptions", + "kind": "interface", + "signature": "interface SandboxExecOptions", + "doc": "Define options to execute code within a sandbox environment with optional session control" + }, + { + "name": "SandboxFileBytesOutcome", + "kind": "type", + "signature": "type SandboxFileBytesOutcome", + "doc": "Represent the outcome of reading sandbox file bytes with success status and corresponding data or error" + }, + { + "name": "SandboxFileSizeOutcome", + "kind": "type", + "signature": "type SandboxFileSizeOutcome", + "doc": "Resolve the outcome of a sandbox file size check with success status and value or error message" + }, + { + "name": "SandboxPermissionLevel", + "kind": "type", + "signature": "type SandboxPermissionLevel", + "doc": "Define permission levels for sandbox access and control" + }, + { + "name": "SandboxResourceConfig", + "kind": "interface", + "signature": "interface SandboxResourceConfig", + "doc": "Define configuration parameters for sandbox resource allocation and lifecycle management" + }, + { + "name": "SandboxRestoreSpec", + "kind": "interface", + "signature": "interface SandboxRestoreSpec", + "doc": "Define the specification for restoring a sandbox from a snapshot or another sandbox ID" + }, + { + "name": "SandboxRuntimeAuthRefreshError", + "kind": "class", + "signature": "class SandboxRuntimeAuthRefreshError", + "doc": "Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name" + }, + { + "name": "SandboxRuntimeConfig", + "kind": "interface", + "signature": "interface SandboxRuntimeConfig", + "doc": "Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions" + }, + { + "name": "SandboxRuntimeConnection", + "kind": "interface", + "signature": "interface SandboxRuntimeConnection", + "doc": "Define a connection configuration for sandbox runtime including URL and optional server-side auth token" + }, + { + "name": "SandboxScope", + "kind": "interface", + "signature": "interface SandboxScope", + "doc": "Define a scope containing workspace and optional user identifiers for sandbox environments" + }, + { + "name": "SandboxStepTransition", + "kind": "type", + "signature": "type SandboxStepTransition", + "doc": "Define transitions marking the start or finish of a sandbox step with associated details" + }, + { + "name": "SandboxTerminalTokenOptions", + "kind": "interface", + "signature": "interface SandboxTerminalTokenOptions", + "doc": "Define options for generating a sandbox terminal token including secret and expiration settings" + }, + { + "name": "SandboxTerminalTokenResult", + "kind": "interface", + "signature": "interface SandboxTerminalTokenResult", + "doc": "Provide token and expiration details for a sandbox terminal session" + }, + { + "name": "SandboxTerminalTokenSubject", + "kind": "type", + "signature": "type SandboxTerminalTokenSubject", + "doc": "Resolve the identity type used for sandbox terminal token subjects" + }, + { + "name": "SandboxTerminalWsMatch", + "kind": "interface", + "signature": "interface SandboxTerminalWsMatch", + "doc": "Define the structure for matching a sandbox terminal WebSocket with workspace and path details" + }, + { + "name": "sandboxToolBinDir", + "kind": "function", + "signature": "(options: SandboxToolPathOptions) => string", + "doc": "Resolve the binary directory path for a sandbox tool based on provided options" + }, + { + "name": "sandboxToolPath", + "kind": "function", + "signature": "(options: SandboxToolPathOptions & { toolName: string; }) => string", + "doc": "Resolve the file system path to a specified sandbox tool based on given options" + }, + { + "name": "SandboxToolPathOptions", + "kind": "interface", + "signature": "interface SandboxToolPathOptions", + "doc": "Define options for resolving sandbox tool paths including appName, baseDir, and binDir" + }, + { + "name": "sandboxToolRootDir", + "kind": "function", + "signature": "(options: SandboxToolPathOptions) => string", + "doc": "Resolve the root directory path for a sandbox tool based on provided options" + }, + { + "name": "SandboxToolSpec", + "kind": "interface", + "signature": "interface SandboxToolSpec", + "doc": "Define the specification for a sandbox tool including its name, content, and optional executability" + }, + { + "name": "ScopedTokenResult", + "kind": "interface", + "signature": "interface ScopedTokenResult", + "doc": "Represent a token with its expiration date and associated scope" + }, + { + "name": "SecretStore", + "kind": "interface", + "signature": "interface SecretStore", + "doc": "Define methods to create, update, retrieve, and delete secrets asynchronously" + }, + { + "name": "secretStoreFromClient", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig) => SecretStore", + "doc": "Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell" + }, + { + "name": "shellQuote", + "kind": "function", + "signature": "(value: string) => string", + "doc": "Wraps a value in single quotes for `sh`, closing and reopening the quote around each embedded quote (`'` → `'\"'\"'`)." + }, + { + "name": "splitDeferredProfileFiles", + "kind": "function", + "signature": "(profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; }", + "doc": "Split profile files into inline deferred files and a lean profile without them" + }, + { + "name": "statSandboxFileSize", + "kind": "function", + "signature": "(box: SandboxExecChannel, absolutePath: string, options?: SandboxExecOptions | undefined) => Promise Promise>", + "doc": "Resolve storing a secret by creating or updating it in the given SecretStore" + }, + { + "name": "streamSandboxPrompt", + "kind": "function", + "signature": "(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO…", + "doc": "Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options" + }, + { + "name": "StreamSandboxPromptOptions", + "kind": "interface", + "signature": "interface StreamSandboxPromptOptions", + "doc": "Define options for configuring and controlling a streaming sandbox prompt session" + }, + { + "name": "syncSandboxMemberAdd", + "kind": "function", + "signature": "(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise>", + "doc": "Resolve adding a user with a specific role to a sandbox and return the operation outcome" + }, + { + "name": "syncSandboxMemberRemove", + "kind": "function", + "signature": "(box: SandboxInstance, userId: string) => Promise>", + "doc": "Remove a member from the sandbox while preserving their home directory and handle the outcome" + }, + { + "name": "syncSandboxMemberRole", + "kind": "function", + "signature": "(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise>", + "doc": "Synchronize a sandbox member's role by updating permissions based on the provided role mapping" + }, + { + "name": "TerminalProxyIdentity", + "kind": "interface", + "signature": "interface TerminalProxyIdentity", + "doc": "Define identity details for a terminal proxy including user, workspace, and sandbox identifiers" + }, + { + "name": "terminalTokenFromRequest", + "kind": "function", + "signature": "(headers: Headers) => string | null", + "doc": "Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields" + }, + { + "name": "verifySandboxTerminalToken", + "kind": "function", + "signature": "(token: string, expected: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise", + "doc": "Verify the validity of a sandbox terminal token against the expected identity and options" + }, + { + "name": "verifyTerminalProxyToken", + "kind": "function", + "signature": "(secret: string, token: string, expected: TerminalProxyIdentity, now?: () => number) => Promise", + "doc": "Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp" + }, + { + "name": "WorkspaceSandboxConnectionArgs", + "kind": "interface", + "signature": "interface WorkspaceSandboxConnectionArgs", + "doc": "Define arguments required to establish a workspace sandbox connection" + }, + { + "name": "WorkspaceSandboxConnectionHandlerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxConnectionHandlerOptions", + "doc": "Define options to handle workspace sandbox connections with user authentication and access control" + }, + { + "name": "WorkspaceSandboxEnsureContext", + "kind": "interface", + "signature": "interface WorkspaceSandboxEnsureContext", + "doc": "Define the context containing workspace and user identifiers for sandbox environment operations" + }, + { + "name": "WorkspaceSandboxInstanceLike", + "kind": "interface", + "signature": "interface WorkspaceSandboxInstanceLike", + "doc": "Define the shape of a workspace sandbox instance including its connection details and status" + }, + { + "name": "WorkspaceSandboxManager", + "kind": "interface", + "signature": "interface WorkspaceSandboxManager", + "doc": "Manage workspace sandboxes by ensuring their creation and retrieval for specified users" + }, + { + "name": "WorkspaceSandboxManagerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxManagerOptions", + "doc": "Define configuration options for managing and interacting with workspace sandboxes" + }, + { + "name": "WorkspaceSandboxRuntimeProxyArgs", + "kind": "interface", + "signature": "interface WorkspaceSandboxRuntimeProxyArgs", + "doc": "Define arguments for proxying runtime requests within a workspace sandbox environment" + }, + { + "name": "WorkspaceSandboxRuntimeProxyHandlerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxRuntimeProxyHandlerOptions", + "doc": "Define options for handling workspace sandbox runtime proxy including user, access, credentials, and connection retrieval" + }, + { + "name": "WorkspaceSandboxTerminalUpgradeHandlerOptions", + "kind": "interface", + "signature": "interface WorkspaceSandboxTerminalUpgradeHandlerOptions", + "doc": "Define options to handle user authentication, workspace access, and sandbox API credential retrieval" + }, + { + "name": "WriteProfileFilesOptions", + "kind": "interface", + "signature": "interface WriteProfileFilesOptions", + "doc": "Define options to control execution timeout, pacing, and retry behavior when writing profile files" + }, + { + "name": "writeProfileFilesToBox", + "kind": "function", + "signature": "(box: SandboxInstance, files: AgentProfileFileMount[], options?: WriteProfileFilesOptions) => Promise>", + "doc": "Write profile files to a sandbox with pacing, retries, and optional execution timeout handling" + } + ] + }, + { + "id": "./sequences", + "source": "src/sequences/index.ts", + "dependsOn": [ + "tools", + "web" + ], + "error": null, + "exports": [ + { + "name": "AddCaptionOperation", + "kind": "interface", + "signature": "interface AddCaptionOperation", + "doc": "Add a caption with optional language, timing, and track placement details" + }, + { + "name": "applySequenceOperation", + "kind": "function", + "signature": "(store: SequenceStore, timeline: SequenceTimeline, op: SequenceOperation, ctx: SequenceOperationContext) => Promise<...>", + "doc": "Apply a sequence operation to update the store and timeline asynchronously" + }, + { + "name": "applySequenceOperations", + "kind": "function", + "signature": "(store: SequenceStore, operations: SequenceOperation[], ctx: SequenceOperationContext) => Promise", + "doc": "The batch path every dispatcher (the MCP tools, a product's editor persistence route) funnels through: fetch the timeline, validate the WHOLE batch against pre-state, then apply in order with a timel…" + }, + { + "name": "assertClipFitsSequence", + "kind": "function", + "signature": "(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; label: string; }) => void", + "doc": "Validate that a clip's start and duration fit within the sequence duration without overflow" + }, + { + "name": "assertSequenceMediaUrl", + "kind": "function", + "signature": "(url: string) => void", + "doc": "Media references must be provider URLs or app-served paths." + }, + { + "name": "buildCaptionChunks", + "kind": "function", + "signature": "(segments: TranscriptSegment[], opts: BuildCaptionChunksOptions) => CaptionChunk[]", + "doc": "Split transcript segments into caption chunks." + }, + { + "name": "BuildCaptionChunksOptions", + "kind": "interface", + "signature": "interface BuildCaptionChunksOptions", + "doc": "Define options to configure caption chunk size, duration, and frame rate constraints" + }, + { + "name": "buildContactSheetManifest", + "kind": "function", + "signature": "(timeline: SequenceTimeline) => ContactSheetManifest", + "doc": "One sample frame per enabled video-track clip with resolved, completed media — the product side renders the actual sheet (needs ffmpeg/canvas)." + }, + { + "name": "buildEdl", + "kind": "function", + "signature": "(timeline: SequenceTimeline) => string", + "doc": "CMX3600-style EDL: one event per enabled video/audio clip in record-start order." + }, + { + "name": "buildOtio", + "kind": "function", + "signature": "(timeline: SequenceTimeline) => OtioTimeline", + "doc": "OpenTimelineIO `Timeline.1` document." + }, + { + "name": "buildSequencesMcpServerEntry", + "kind": "function", + "signature": "(opts: ScopedMcpServerEntryOptions) => AppToolMcpServer", + "doc": "Build the `AgentProfileMcpServer`-shaped entry for the sequences channel." + }, + { + "name": "BuildSequencesMcpServerEntryOptions", + "kind": "type", + "signature": "type BuildSequencesMcpServerEntryOptions", + "doc": "Extend ScopedMcpServerEntryOptions to configure MCP server entry options for sequence building" + }, + { + "name": "buildSrt", + "kind": "function", + "signature": "(timeline: SequenceTimeline, opts?: CaptionExportOptions) => string", + "doc": "Numbered SubRip cues from caption-track clips, in timeline order." + }, + { + "name": "buildVtt", + "kind": "function", + "signature": "(timeline: SequenceTimeline, opts?: CaptionExportOptions) => string", + "doc": "WebVTT with numbered cue identifiers; same filtering and frame math as `buildSrt`, dot millisecond separator per the VTT grammar." + }, + { + "name": "CaptionChunk", + "kind": "interface", + "signature": "interface CaptionChunk", + "doc": "One caption clip's worth of text with its timeline bounds." + }, + { + "name": "captionCoverage", + "kind": "function", + "signature": "(timeline: SequenceTimeline) => CaptionCoverageEntry[]", + "doc": "Per-language caption coverage over [0, durationFrames)." + }, + { + "name": "CaptionCoverageEntry", + "kind": "interface", + "signature": "interface CaptionCoverageEntry", + "doc": "Coverage for one caption language across the sequence." + }, + { + "name": "CaptionExportOptions", + "kind": "interface", + "signature": "interface CaptionExportOptions", + "doc": "Define options to export captions filtered by an optional BCP-47 language tag" + }, + { + "name": "CaptionTargetResolution", + "kind": "type", + "signature": "type CaptionTargetResolution", + "doc": "Resolve caption target by specifying an existing track or creating a new one with language and name" + }, + { + "name": "captionTrackNameForLanguage", + "kind": "function", + "signature": "(language: string) => string", + "doc": "Naming convention for auto-created per-language caption tracks." + }, + { + "name": "chooseCaptionPlacement", + "kind": "function", + "signature": "(input: { playheadFrame: number; fps: number; sequenceDurationFrames: number; occupiedIntervals: TimelineInterval[]; })…", + "doc": "Place a caption near the playhead inside FREE space only — the caption track never double-books." + }, + { + "name": "clampClipDuration", + "kind": "function", + "signature": "(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number", + "doc": "Clamp clip duration to fit within sequence bounds and minimum length constraints" + }, + { + "name": "clampClipStart", + "kind": "function", + "signature": "(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number", + "doc": "Clamp the clip start frame within the valid range of the sequence duration and clip length" + }, + { + "name": "ContactSheetEntry", + "kind": "interface", + "signature": "interface ContactSheetEntry", + "doc": "Describe a single entry in a contact sheet with timing and media source details" + }, + { + "name": "ContactSheetManifest", + "kind": "interface", + "signature": "interface ContactSheetManifest", + "doc": "Define the structure for a contact sheet manifest including metadata and entries" + }, + { + "name": "createSequencesMcpHandler", + "kind": "function", + "signature": "(opts: CreateSequencesMcpHandlerOptions) => (request: Request) => Promise", + "doc": "Create a handler to process MCP sequence requests with optional playhead frame and server info" + }, + { + "name": "CreateSequencesMcpHandlerOptions", + "kind": "interface", + "signature": "interface CreateSequencesMcpHandlerOptions", + "doc": "Define options for creating sequences MCP handler including store, playhead frame, and server info" + }, + { + "name": "CreateTrackOperation", + "kind": "interface", + "signature": "interface CreateTrackOperation", + "doc": "Define an operation to create a new sequence track with a specified kind and name" + }, + { + "name": "DEFAULT_SEQUENCES_MCP_DESCRIPTION", + "kind": "const", + "signature": "\"Live timeline editor for the current video sequence: read timeline state, place/move/trim/split clips, add captions, m…", + "doc": "Describe live timeline editor features for current video sequence including clip and caption management" + }, + { + "name": "DeleteClipOperation", + "kind": "interface", + "signature": "interface DeleteClipOperation", + "doc": "Represent a delete clip operation with a specified clip identifier" + }, + { + "name": "ExtendSequenceOperation", + "kind": "interface", + "signature": "interface ExtendSequenceOperation", + "doc": "Define an operation to extend a sequence by a specified number of frames" + }, + { + "name": "findSequenceMcpTool", + "kind": "function", + "signature": "(name: string) => SequenceMcpToolDefinition | undefined", + "doc": "Resolve the SequenceMcpToolDefinition matching the given name or return undefined" + }, + { + "name": "formatSeconds", + "kind": "function", + "signature": "(seconds: number) => string", + "doc": "Format a number of seconds into a string with integer or two-decimal precision suffix s" + }, + { + "name": "formatTimecode", + "kind": "function", + "signature": "(frames: number, fps: number) => string", + "doc": "`m:ss.ff` timecode for UI and agent-readable frame references." + }, + { + "name": "framesToSeconds", + "kind": "function", + "signature": "(frames: number, fps: number) => number", + "doc": "Convert a frame count to seconds based on the given frames per second rate" + }, + { + "name": "LanguageFanoutOptions", + "kind": "interface", + "signature": "interface LanguageFanoutOptions", + "doc": "Define options to specify target languages and an optional source language for fan-out operations" + }, + { + "name": "lastClipEndFrame", + "kind": "function", + "signature": "(timeline: SequenceTimeline) => number", + "doc": "Last occupied frame across all clips — the floor for `extend_sequence`." + }, + { + "name": "MAX_CAPTION_BATCH", + "kind": "const", + "signature": "500", + "doc": "Largest accepted `add_captions` batch — bounds one decision row / one validation pass to a size the store can absorb in a single request." + }, + { + "name": "MIN_SEQUENCE_CLIP_FRAMES", + "kind": "const", + "signature": "1", + "doc": "Frame-accurate sequence timeline model — the product-agnostic spine of the sequences surface." + }, + { + "name": "MoveClipOperation", + "kind": "interface", + "signature": "interface MoveClipOperation", + "doc": "Resolve an operation to move a clip to a new start frame and optional track" + }, + { + "name": "NewSequenceClip", + "kind": "interface", + "signature": "interface NewSequenceClip", + "doc": "Define properties for a new sequence clip including timing, labels, and optional metadata" + }, + { + "name": "NewSequenceDecision", + "kind": "interface", + "signature": "interface NewSequenceDecision", + "doc": "Define the structure for a new sequence decision with optional metadata and acceptance status" + }, + { + "name": "NewSequenceTrack", + "kind": "interface", + "signature": "interface NewSequenceTrack", + "doc": "Define properties for a new sequence track including kind, name, and optional sort order" + }, + { + "name": "normalizeLanguageTag", + "kind": "function", + "signature": "(tag: string) => string", + "doc": "Normalize a BCP-47 tag to conventional casing: primary subtag lowercase, 4-letter script subtags Title Case, 2-letter region subtags UPPER, all other subtags lowercase." + }, + { + "name": "OtioClip", + "kind": "interface", + "signature": "interface OtioClip", + "doc": "Define a clip object with metadata, source range, and media reference according to OTIO schema" + }, + { + "name": "OtioExternalReference", + "kind": "interface", + "signature": "interface OtioExternalReference", + "doc": "Define the structure for an external media reference with schema, URL, and optional time range" + }, + { + "name": "OtioGap", + "kind": "interface", + "signature": "interface OtioGap", + "doc": "Define the structure for a gap element with schema, name, and source time range properties" + }, + { + "name": "OtioMissingReference", + "kind": "interface", + "signature": "interface OtioMissingReference", + "doc": "Represent missing references in OTIO with a fixed schema identifier" + }, + { + "name": "OtioRationalTime", + "kind": "interface", + "signature": "interface OtioRationalTime", + "doc": "Represent a rational time value with a specific rate and numeric value for OTIO schema" + }, + { + "name": "OtioStack", + "kind": "interface", + "signature": "interface OtioStack", + "doc": "Represent a stack container holding a named collection of OtioTrack children" + }, + { + "name": "OtioTimeline", + "kind": "interface", + "signature": "interface OtioTimeline", + "doc": "Define the structure of a timeline with metadata, tracks, and global start time in OTIO format" + }, + { + "name": "OtioTimeRange", + "kind": "interface", + "signature": "interface OtioTimeRange", + "doc": "Define a time range with a start time and duration using OtioRationalTime values" + }, + { + "name": "OtioTrack", + "kind": "interface", + "signature": "interface OtioTrack", + "doc": "Define a track containing video or audio clips with metadata and child elements" + }, + { + "name": "parseSequenceOperations", + "kind": "function", + "signature": "(input: unknown) => SequenceOperation[]", + "doc": "Shape-gate untrusted JSON (a product's `onApplyOperations` route body) into `SequenceOperation[]` BEFORE `validateSequenceOperations` sees it." + }, + { + "name": "PlaceClipOperation", + "kind": "interface", + "signature": "interface PlaceClipOperation", + "doc": "Define an operation to place a media clip with timing, track, and playback options" + }, + { + "name": "planLanguageFanout", + "kind": "function", + "signature": "(opts: LanguageFanoutOptions) => string[]", + "doc": "Plan which caption languages to generate: normalized, deduped (first occurrence wins), source excluded." + }, + { + "name": "QueueExportOperation", + "kind": "interface", + "signature": "interface QueueExportOperation", + "doc": "Define the structure for a queue export operation with format and optional metadata" + }, + { + "name": "resolveCaptionPlacement", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext, targetTrackId: string | nul…", + "doc": "Caption bounds." + }, + { + "name": "resolveCaptionTarget", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: AddCaptionOperation) => CaptionTargetResolution", + "doc": "Target caption track for an `add_caption`." + }, + { + "name": "resolvePlaceClipTrack", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: PlaceClipOperation) => SequenceTrack", + "doc": "Target track for a `place_clip`." + }, + { + "name": "secondsToFrames", + "kind": "function", + "signature": "(seconds: number, fps: number) => number", + "doc": "Convert seconds to the nearest whole number of frames based on frames per second" + }, + { + "name": "SEQUENCE_EXPORT_FORMATS", + "kind": "const", + "signature": "readonly [\"mp4\", \"otio\", \"xml\", \"edl\", \"vtt\", \"srt\", \"contact_sheet\"]", + "doc": "Define supported export formats for sequence outputs including video, subtitle, and metadata types" + }, + { + "name": "SEQUENCE_MCP_TOOLS", + "kind": "const", + "signature": "readonly SequenceMcpToolDefinition[]", + "doc": "Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations" + }, + { + "name": "SEQUENCE_MEDIA_KINDS", + "kind": "const", + "signature": "readonly [\"video\", \"image\", \"audio\"]", + "doc": "Define the allowed media kinds for sequences including video, image, and audio" + }, + { + "name": "SEQUENCE_OPERATION_TYPES", + "kind": "const", + "signature": "readonly (\"place_clip\" | \"add_caption\" | \"move_clip\" | \"trim_clip\" | \"split_clip\" | \"set_clip_text\" | \"set_clip_disable…", + "doc": "List all valid sequence operation types used in editing workflows" + }, + { + "name": "SEQUENCE_TRACK_KINDS", + "kind": "const", + "signature": "readonly [\"video\", \"audio\", \"caption\", \"reference\", \"agent\"]", + "doc": "Define immutable sequence track kinds for video, audio, caption, reference, and agent" + }, + { + "name": "SequenceApplyResult", + "kind": "type", + "signature": "type SequenceApplyResult", + "doc": "The entity an operation changed, for the MCP layer to serialize back to the agent." + }, + { + "name": "SequenceClip", + "kind": "interface", + "signature": "interface SequenceClip", + "doc": "Define properties for a media sequence clip including timing, source, track, and caption details" + }, + { + "name": "SequenceClipMedia", + "kind": "interface", + "signature": "interface SequenceClipMedia", + "doc": "Resolved playable media behind a clip." + }, + { + "name": "SequenceClipPatch", + "kind": "interface", + "signature": "interface SequenceClipPatch", + "doc": "Define optional properties to update or patch a sequence clip's attributes in a timeline" + }, + { + "name": "SequenceDecision", + "kind": "interface", + "signature": "interface SequenceDecision", + "doc": "One entry in the sequence's decision log — human edits, agent proposals, agent edits, exports, and notes all land here so the edit history is a single auditable lane." + }, + { + "name": "SequenceExportFormat", + "kind": "type", + "signature": "type SequenceExportFormat", + "doc": "Define export formats available for sequence data including video, subtitle, and metadata types" + }, + { + "name": "SequenceExportRecord", + "kind": "interface", + "signature": "interface SequenceExportRecord", + "doc": "Describe a record representing the export details and status of a sequence" + }, + { + "name": "SequenceExportStatus", + "kind": "type", + "signature": "type SequenceExportStatus", + "doc": "Represent export status of a sequence as queued, processing, completed, failed, or cancelled" + }, + { + "name": "SequenceFrameSnapshot", + "kind": "interface", + "signature": "interface SequenceFrameSnapshot", + "doc": "What is on screen/audible at a single frame — the answer shape for \"what is happening at 0:34\"." + }, + { + "name": "SequenceMcpToolDefinition", + "kind": "interface", + "signature": "interface SequenceMcpToolDefinition", + "doc": "Define a tool with metadata and a run method for processing input within a specific environment" + }, + { + "name": "SequenceMcpToolEnv", + "kind": "interface", + "signature": "interface SequenceMcpToolEnv", + "doc": "Everything one tool invocation needs." + }, + { + "name": "SequenceMediaKind", + "kind": "type", + "signature": "type SequenceMediaKind", + "doc": "Define media types allowed in a sequence including video, image, and audio" + }, + { + "name": "SequenceMeta", + "kind": "interface", + "signature": "interface SequenceMeta", + "doc": "Describe metadata and properties of a media sequence including dimensions, duration, and status" + }, + { + "name": "SequenceOperation", + "kind": "type", + "signature": "type SequenceOperation", + "doc": "Represent sequence editing actions for manipulating clips, tracks, captions, and exports" + }, + { + "name": "SequenceOperationContext", + "kind": "interface", + "signature": "interface SequenceOperationContext", + "doc": "Editor/agent context an operation is resolved against." + }, + { + "name": "SequenceOperationType", + "kind": "type", + "signature": "type SequenceOperationType", + "doc": "Extract the type of operation from a sequence operation object" + }, + { + "name": "SequencePlan", + "kind": "interface", + "signature": "interface SequencePlan", + "doc": "A batch of operations with the agent's stated intent — the decision-log unit for agent edits." + }, + { + "name": "SEQUENCES_MCP_PROTOCOL_VERSIONS", + "kind": "const", + "signature": "readonly [\"2025-06-18\", \"2025-03-26\", \"2024-11-05\"]", + "doc": "Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server." + }, + { + "name": "SequencesMcpServerInfo", + "kind": "interface", + "signature": "interface SequencesMcpServerInfo", + "doc": "Describe server information including name and version for Sequences MCP integration" + }, + { + "name": "SequenceStatus", + "kind": "type", + "signature": "type SequenceStatus", + "doc": "Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived" + }, + { + "name": "SequenceStore", + "kind": "interface", + "signature": "interface SequenceStore", + "doc": "Manage sequences by providing methods to get timelines, clips, and modify tracks and clips" + }, + { + "name": "SequenceStoreScope", + "kind": "interface", + "signature": "interface SequenceStoreScope", + "doc": "Per-request scope a product binds when constructing its store." + }, + { + "name": "SequenceTimeline", + "kind": "interface", + "signature": "interface SequenceTimeline", + "doc": "The full timeline aggregate — what `get_timeline_state` returns and what every operation validates against." + }, + { + "name": "SequenceTrack", + "kind": "interface", + "signature": "interface SequenceTrack", + "doc": "Define properties and state for a sequence track including id, kind, name, order, and flags" + }, + { + "name": "SequenceTrackKind", + "kind": "type", + "signature": "type SequenceTrackKind", + "doc": "Track kinds." + }, + { + "name": "SetClipDisabledOperation", + "kind": "interface", + "signature": "interface SetClipDisabledOperation", + "doc": "Define an operation to enable or disable a clip by its identifier" + }, + { + "name": "SetClipTextOperation", + "kind": "interface", + "signature": "interface SetClipTextOperation", + "doc": "Resolve an operation to set clipboard text with optional language and clip identifier" + }, + { + "name": "snapshotFrame", + "kind": "function", + "signature": "(timeline: SequenceTimeline, frame: number) => SequenceFrameSnapshot", + "doc": "Resolve everything active at one frame — the core of `get_frame_at_time`." + }, + { + "name": "SplitClipOperation", + "kind": "interface", + "signature": "interface SplitClipOperation", + "doc": "Split a clip at a specified frame inside the clip to create two separate segments" + }, + { + "name": "TimelineClipBounds", + "kind": "interface", + "signature": "interface TimelineClipBounds", + "doc": "Define the start frame and duration in frames for a timeline clip's bounds" + }, + { + "name": "TimelineInterval", + "kind": "interface", + "signature": "interface TimelineInterval", + "doc": "Define a time range with inclusive start and end frame numbers" + }, + { + "name": "trackIntervals", + "kind": "function", + "signature": "(timeline: SequenceTimeline, trackId: string) => TimelineInterval[]", + "doc": "Occupied intervals on one track, for placement collision checks." + }, + { + "name": "TranscriptSegment", + "kind": "interface", + "signature": "interface TranscriptSegment", + "doc": "Server twin of `TranscriptionSegment` (../sequences-react/contracts) — structurally identical so react-side transcription output feeds `buildCaptionChunks` without mapping." + }, + { + "name": "TrimClipOperation", + "kind": "interface", + "signature": "interface TrimClipOperation", + "doc": "Define an operation to trim a clip by adjusting its start, duration, and optional source in/out points" + }, + { + "name": "validateAddCaption", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext) => void", + "doc": "Validate the parameters and context of an AddCaptionOperation within a sequence timeline" + }, + { + "name": "validateCreateTrack", + "kind": "function", + "signature": "(operation: CreateTrackOperation) => void", + "doc": "Validate that a CreateTrackOperation has a supported kind and a non-empty name" + }, + { + "name": "validateDeleteClip", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: DeleteClipOperation) => void", + "doc": "Validate that the clip to delete exists and is mutable in the given timeline" + }, + { + "name": "validateExtendSequence", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: ExtendSequenceOperation) => void", + "doc": "Validate that the extend sequence operation has a positive duration and exceeds the last clip end frame" + }, + { + "name": "validateMoveClip", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: MoveClipOperation) => void", + "doc": "Validate that a clip move operation is within bounds and targets a compatible unlocked track" + }, + { + "name": "validatePlaceClip", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: PlaceClipOperation) => void", + "doc": "Validate the properties and constraints of a PlaceClipOperation within a SequenceTimeline" + }, + { + "name": "validateQueueExport", + "kind": "function", + "signature": "(operation: QueueExportOperation) => void", + "doc": "Validate that the queue export operation uses a supported export format" + }, + { + "name": "validateSequenceOperation", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: SequenceOperation, ctx: SequenceOperationContext) => void", + "doc": "Validate a sequence operation against the timeline and context to ensure correctness" + }, + { + "name": "validateSequenceOperations", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operations: SequenceOperation[], ctx: SequenceOperationContext) => void", + "doc": "Validate each operation in a sequence against the timeline and context, throwing detailed errors on failure" + }, + { + "name": "validateSetClipDisabled", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: SetClipDisabledOperation) => void", + "doc": "Validate that the clip can be disabled within the given timeline and operation constraints" + }, + { + "name": "validateSetClipText", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: SetClipTextOperation) => void", + "doc": "Validate that a SetClipTextOperation targets a caption clip with non-empty text and valid language tag" + }, + { + "name": "validateSplitClip", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: SplitClipOperation) => void", + "doc": "Validate that a split operation on a clip is within valid frame boundaries and conditions" + }, + { + "name": "validateTrimClip", + "kind": "function", + "signature": "(timeline: SequenceTimeline, operation: TrimClipOperation) => void", + "doc": "Validate that a trim clip operation respects timeline bounds and source frame constraints" + } + ] + }, + { + "id": "./sequences-react", + "source": "src/sequences-react/index.ts", + "dependsOn": [ + "brand", + "sequences" + ], + "error": null, + "exports": [ + { + "name": "addCaptionCommand", + "kind": "function", + "signature": "(input: AddCaptionInput) => TimelineCommand", + "doc": "Resolve a command to add a caption to a specified caption track within a timeline" + }, + { + "name": "AddCaptionInput", + "kind": "interface", + "signature": "interface AddCaptionInput", + "doc": "Define input parameters for adding a caption clip to a sequence timeline" + }, + { + "name": "applySnap", + "kind": "function", + "signature": "(frame: number, points: SnapPoint[], opts: ApplySnapOptions) => SnapResult", + "doc": "Nearest candidate wins; ties keep the first candidate in `points` order (sorted by frame from `collectSnapPoints`, so the lower frame)." + }, + { + "name": "ApplySnapOptions", + "kind": "interface", + "signature": "interface ApplySnapOptions", + "doc": "Define options to configure snapping behavior including zoom, threshold, and exclusion criteria" + }, + { + "name": "AudioBufferLike", + "kind": "interface", + "signature": "interface AudioBufferLike", + "doc": "Structural slice of Web Audio's AudioBuffer so peak math runs on synthetic fixtures in tests and on real decoded buffers in the browser." + }, + { + "name": "BrandMark", + "kind": "function", + "signature": "({ size, className }: BrandMarkProps) => Element", + "doc": null + }, + { + "name": "BrandMarkProps", + "kind": "interface", + "signature": "interface BrandMarkProps", + "doc": null + }, + { + "name": "captionFontPx", + "kind": "function", + "signature": "(canvasCssHeight: number) => number", + "doc": "Caption type scales with the rendered frame, floored so captions stay legible on small previews." + }, + { + "name": "chooseMoveSnap", + "kind": "function", + "signature": "(input: { candidateStartFrame: number; durationFrames: number; startSnap: SnapResult; endSnap: SnapResult; }) => { star…", + "doc": "A move drag snaps whichever clip edge lands closest to a snap point: the start edge directly, or the end edge re-expressed as a start." + }, + { + "name": "classifyMediaUrl", + "kind": "function", + "signature": "(url: string) => \"image\" | \"unknown\" | \"video\"", + "doc": "Extension-based kind classification; 'unknown' defers to a HEAD content-type probe at draw time." + }, + { + "name": "clipChipGeometry", + "kind": "function", + "signature": "(input: { startFrame: number; durationFrames: number; zoom: number; }) => { left: number; width: number; }", + "doc": "Pixel geometry for a clip chip; width floors at 2px so 1-frame clips stay grabbable." + }, + { + "name": "ClipIdResolver", + "kind": "type", + "signature": "type ClipIdResolver", + "doc": "Live local→server clip-id lookup (see module header)." + }, + { + "name": "ClipMoveCommit", + "kind": "interface", + "signature": "interface ClipMoveCommit", + "doc": null + }, + { + "name": "ClipTrimCommit", + "kind": "interface", + "signature": "interface ClipTrimCommit", + "doc": null + }, + { + "name": "collectSnapPoints", + "kind": "function", + "signature": "(timeline: SequenceTimeline, playheadFrame: number) => TimelineSnapPoint[]", + "doc": "Disabled clips still occupy timeline space visually, so their edges remain snap targets." + }, + { + "name": "COMMAND_HISTORY_LIMIT", + "kind": "const", + "signature": "200", + "doc": "Oldest entries are dropped past this bound; redo is cleared on execute." + }, + { + "name": "CommandStack", + "kind": "interface", + "signature": "interface CommandStack", + "doc": "Manage and track command execution with undo, redo, state subscription, and timeline reset capabilities" + }, + { + "name": "compositeCommand", + "kind": "function", + "signature": "(label: string, commands: TimelineCommand[]) => TimelineCommand", + "doc": null + }, + { + "name": "computeWaveform", + "kind": "function", + "signature": "(buffer: AudioBufferLike, bucketCount: number) => WaveformData", + "doc": "One max-abs peak per bucket, taken across all channels." + }, + { + "name": "containFitRect", + "kind": "function", + "signature": "(source: { width: number; height: number; }, dest: FrameRect) => FrameRect", + "doc": "Object-fit 'contain' placement: preserve aspect ratio, fit entirely inside `dest`, center the residual space." + }, + { + "name": "createCommandStack", + "kind": "function", + "signature": "(initial: SequenceTimeline) => CommandStack", + "doc": "Create a command stack managing undo and redo operations for a given timeline" + }, + { + "name": "createImageFrameProvider", + "kind": "function", + "signature": "(opts?: { maxElements?: number | undefined; } | undefined) => VideoFrameProvider", + "doc": "Stills behind the same `VideoFrameProvider` seam — `sourceSeconds` is validated for contract parity but does not affect the painted pixels." + }, + { + "name": "createMediaElementPool", + "kind": "function", + "signature": "(opts: { maxElements: number; create(url: string): T; destroy(element: T, url: string): void; }) => MediaElementPool…", + "doc": "LRU pool of media elements keyed by URL." + }, + { + "name": "createPlaybackClock", + "kind": "function", + "signature": "(config: PlaybackClockConfig) => PlaybackClock", + "doc": "Create a playback clock that manages frame timing and playback state based on configuration" + }, + { + "name": "createVideoElementFrameProvider", + "kind": "function", + "signature": "(opts?: { maxElements?: number | undefined; } | undefined) => VideoFrameProvider", + "doc": "The baseline provider `TimelineEditorProps.frameProvider` defaults to." + }, + { + "name": "createWhisperTranscriptionProvider", + "kind": "function", + "signature": "(opts?: { model?: string | undefined; } | undefined) => TranscriptionProvider", + "doc": "Create a Whisper-based transcription provider with optional model configuration" + }, + { + "name": "createZoomMath", + "kind": "function", + "signature": "(config: ZoomMathConfig) => ZoomMath", + "doc": "Create a ZoomMath object that validates config and calculates zoom ratio within bounds" + }, + { + "name": "DEFAULT_MAX_MEDIA_ELEMENTS", + "kind": "const", + "signature": "4", + "doc": "Define the default maximum number of media elements allowed in a collection" + }, + { + "name": "DEFAULT_TIMELINE_LABELS", + "kind": "const", + "signature": "Required", + "doc": "Provide default labels and accessibility text for timeline editor UI elements" + }, + { + "name": "DEFAULT_WHISPER_MODEL", + "kind": "const", + "signature": "\"onnx-community/whisper-large-v3-turbo\"", + "doc": "Provide the default Whisper model identifier for ONNX community large v3 turbo" + }, + { + "name": "deleteClipCommand", + "kind": "function", + "signature": "(input: DeleteClipInput) => TimelineCommand", + "doc": "Snapshots the full clip at construction so undo restores it exactly." + }, + { + "name": "DeleteClipInput", + "kind": "interface", + "signature": "interface DeleteClipInput", + "doc": "Define input parameters required to delete a clip from a sequence timeline" + }, + { + "name": "drawWaveform", + "kind": "function", + "signature": "(ctx: CanvasRenderingContext2D, data: WaveformData, rect: { x: number; y: number; width: number; height: number; }, col…", + "doc": "Paint mirrored peak bars centered on the rect's midline." + }, + { + "name": "EditorTimelineState", + "kind": "interface", + "signature": "interface EditorTimelineState", + "doc": "Local editor state — the timeline plus volatile view state the server never sees." + }, + { + "name": "FrameRect", + "kind": "interface", + "signature": "interface FrameRect", + "doc": "Define a rectangular frame with position and size properties x, y, width, and height" + }, + { + "name": "framesFromPixelDelta", + "kind": "function", + "signature": "(deltaX: number, zoom: number) => number", + "doc": "Quantize a horizontal pointer delta to whole frames at the current zoom." + }, + { + "name": "frameToPixel", + "kind": "function", + "signature": "(frame: number, view: ViewportTransform) => number", + "doc": "Frame → viewport-relative pixel x." + }, + { + "name": "letterboxRect", + "kind": "function", + "signature": "(input: { containerWidth: number; containerHeight: number; mediaWidth: number; mediaHeight: number; }) => LetterboxRect", + "doc": "Contain-fit a media aspect inside a container, centered with letterbox or pillarbox bars." + }, + { + "name": "LetterboxRect", + "kind": "interface", + "signature": "interface LetterboxRect", + "doc": null + }, + { + "name": "loadWaveform", + "kind": "function", + "signature": "(mediaUrl: string, bucketCount: number, ctx?: AudioContext | undefined) => Promise", + "doc": "Fetch + decode `mediaUrl` and bucket it." + }, + { + "name": "mapWhisperOutput", + "kind": "function", + "signature": "(output: WhisperOutput | WhisperOutput[], durationSeconds: number, mediaUrl: string) => TranscriptionSegment[]", + "doc": "Map whisper chunk output to contract segments." + }, + { + "name": "MediaElementPool", + "kind": "interface", + "signature": "interface MediaElementPool", + "doc": "Manage a pool of media elements to acquire, check, count, and dispose resources efficiently" + }, + { + "name": "mixdownToMono", + "kind": "function", + "signature": "(buffer: AudioBufferLike) => Float32Array", + "doc": "Mean-mixdown to mono." + }, + { + "name": "moveClipCommand", + "kind": "function", + "signature": "(input: MoveClipInput) => TimelineCommand", + "doc": "Drag-move." + }, + { + "name": "MoveClipInput", + "kind": "interface", + "signature": "interface MoveClipInput", + "doc": "Define input parameters to move a clip within a timeline including optional track and resolver" + }, + { + "name": "MoveDragInput", + "kind": "interface", + "signature": "interface MoveDragInput", + "doc": null + }, + { + "name": "moveDragStartFrame", + "kind": "function", + "signature": "(input: MoveDragInput) => number", + "doc": "New start frame for a move drag, clamped so the clip stays fully inside the sequence." + }, + { + "name": "needsSeek", + "kind": "function", + "signature": "(currentTimeSeconds: number, targetSeconds: number) => boolean", + "doc": "Determine if seeking is required based on the difference between current and target times" + }, + { + "name": "pixelToFrame", + "kind": "function", + "signature": "(pixel: number, view: ViewportTransform) => number", + "doc": "Viewport-relative pixel x → integer frame." + }, + { + "name": "placeClipCommand", + "kind": "function", + "signature": "(input: PlaceClipInput) => TimelineCommand", + "doc": "Resolve and validate clip placement parameters to create a timeline command" + }, + { + "name": "PlaceClipInput", + "kind": "interface", + "signature": "interface PlaceClipInput", + "doc": "Define input parameters required to place a clip within a sequence timeline" + }, + { + "name": "PlaybackClock", + "kind": "interface", + "signature": "interface PlaybackClock", + "doc": "rAF-driven playback clock." + }, + { + "name": "PlaybackClockConfig", + "kind": "interface", + "signature": "interface PlaybackClockConfig", + "doc": "Define configuration settings for playback clock including frames per second and total duration frames" + }, + { + "name": "PooledElementLease", + "kind": "interface", + "signature": "interface PooledElementLease", + "doc": "Manage a leased element from a pool and release it to enable LRU eviction" + }, + { + "name": "PreviewCanvas", + "kind": "function", + "signature": "({ timeline, clock, frameProvider, className }: PreviewCanvasProps) => Element", + "doc": null + }, + { + "name": "PreviewCanvasProps", + "kind": "interface", + "signature": "interface PreviewCanvasProps", + "doc": null + }, + { + "name": "SEEK_TIMEOUT_MS", + "kind": "const", + "signature": "5000", + "doc": "A seek that hasn't fired `seeked` after this long is a decode failure — the draw REJECTS rather than painting whatever frame happens to be up." + }, + { + "name": "SEEK_TOLERANCE_SECONDS", + "kind": "const", + "signature": "number", + "doc": "Half a frame at 30fps." + }, + { + "name": "selectTickStepSeconds", + "kind": "function", + "signature": "(input: { zoom: number; fps: number; minSpacingPx?: number | undefined; }) => number", + "doc": "Smallest ruler step whose major ticks sit at least `minSpacingPx` apart at the current zoom; past the table it grows in whole minutes so labels never collide at extreme zoom-out." + }, + { + "name": "SEQUENCE_MEDIA_DRAG_TYPE", + "kind": "const", + "signature": "\"application/x-sequence-media\"", + "doc": null + }, + { + "name": "SequenceTimelineEditorLazy", + "kind": "function", + "signature": "LazyExoticComponent<(props: TimelineEditorProps) => Element>", + "doc": null + }, + { + "name": "setClipTextCommand", + "kind": "function", + "signature": "(input: SetClipTextInput) => TimelineCommand", + "doc": "Requires the clip to already carry text: `set_clip_text` has no \"create\" semantics in the union, and an inverse for a text-less clip would have to invent an empty string." + }, + { + "name": "SetClipTextInput", + "kind": "interface", + "signature": "interface SetClipTextInput", + "doc": "Define input parameters for setting text and optional language on a specific clip in a timeline" + }, + { + "name": "SnapIndicatorLine", + "kind": "function", + "signature": "({ point, zoom }: SnapIndicatorLineProps) => Element | null", + "doc": null + }, + { + "name": "SnapIndicatorLineProps", + "kind": "interface", + "signature": "interface SnapIndicatorLineProps", + "doc": null + }, + { + "name": "snapPixel", + "kind": "function", + "signature": "(value: number, devicePixelRatio: number) => number", + "doc": "Snap a CSS-pixel value to the device pixel grid so 1px timeline rules render crisp on fractional-DPR displays." + }, + { + "name": "SnapPoint", + "kind": "interface", + "signature": "interface SnapPoint", + "doc": "Define a point in a timeline where snapping occurs based on frame and kind" + }, + { + "name": "SnapResult", + "kind": "interface", + "signature": "interface SnapResult", + "doc": "Describe the result of snapping a point to a frame including success status and snapped point details" + }, + { + "name": "splitClipCommand", + "kind": "function", + "signature": "(input: SplitClipInput) => TimelineCommand", + "doc": "Source mapping is 1:1 frames (no rate ramps in the model), so the tail's source in-point is the head's in-point advanced by the head duration." + }, + { + "name": "SplitClipInput", + "kind": "interface", + "signature": "interface SplitClipInput", + "doc": "Define input parameters for splitting a clip at a specific frame within a timeline" + }, + { + "name": "TimelineClipChip", + "kind": "function", + "signature": "(props: TimelineClipChipProps) => Element", + "doc": null + }, + { + "name": "TimelineClipChipProps", + "kind": "interface", + "signature": "interface TimelineClipChipProps", + "doc": null + }, + { + "name": "TimelineCommand", + "kind": "interface", + "signature": "interface TimelineCommand", + "doc": "One undoable edit." + }, + { + "name": "TimelineEditor", + "kind": "function", + "signature": "(props: TimelineEditorProps) => Element", + "doc": null + }, + { + "name": "TimelineEditorLabels", + "kind": "interface", + "signature": "interface TimelineEditorLabels", + "doc": "Overridable copy for the editor's product-facing labels." + }, + { + "name": "TimelineEditorProps", + "kind": "interface", + "signature": "interface TimelineEditorProps", + "doc": "Define properties and callbacks for editing and applying operations on a sequence timeline" + }, + { + "name": "TimelineEmptyState", + "kind": "function", + "signature": "(props: TimelineEmptyStateProps) => Element", + "doc": null + }, + { + "name": "TimelineEmptyStateProps", + "kind": "interface", + "signature": "interface TimelineEmptyStateProps", + "doc": null + }, + { + "name": "TimelineGhostLanes", + "kind": "function", + "signature": "({ laneWidth, videoLabel, captionLabel }: TimelineGhostLanesProps) => Element", + "doc": null + }, + { + "name": "TimelineGhostLanesProps", + "kind": "interface", + "signature": "interface TimelineGhostLanesProps", + "doc": null + }, + { + "name": "TimelinePlayhead", + "kind": "function", + "signature": "({ frame, zoom }: TimelinePlayheadProps) => Element", + "doc": null + }, + { + "name": "TimelinePlayheadProps", + "kind": "interface", + "signature": "interface TimelinePlayheadProps", + "doc": "Playhead overlay for the track area: a full-height line with a triangular cap." + }, + { + "name": "TimelineRuler", + "kind": "function", + "signature": "({ fps, durationFrames, zoom, onScrub }: TimelineRulerProps) => Element", + "doc": null + }, + { + "name": "TimelineRulerProps", + "kind": "interface", + "signature": "interface TimelineRulerProps", + "doc": null + }, + { + "name": "TimelineSmallScreenGate", + "kind": "function", + "signature": "({ labels }: TimelineSmallScreenGateProps) => Element", + "doc": null + }, + { + "name": "TimelineSmallScreenGateProps", + "kind": "interface", + "signature": "interface TimelineSmallScreenGateProps", + "doc": null + }, + { + "name": "TimelineSnapPoint", + "kind": "interface", + "signature": "interface TimelineSnapPoint", + "doc": "Snap point with its owning clip when it came from one, so a drag can exclude the dragged clip's own edges." + }, + { + "name": "TimelineTrackRow", + "kind": "function", + "signature": "(props: TimelineTrackRowProps) => Element", + "doc": null + }, + { + "name": "TimelineTrackRowProps", + "kind": "interface", + "signature": "interface TimelineTrackRowProps", + "doc": null + }, + { + "name": "toggleClipDisabledCommand", + "kind": "function", + "signature": "(input: ToggleClipDisabledInput) => TimelineCommand", + "doc": "The target value is captured at construction (not flipped at execute time) so redo after a rebase applies the same durable op the stack already emitted." + }, + { + "name": "ToggleClipDisabledInput", + "kind": "interface", + "signature": "interface ToggleClipDisabledInput", + "doc": "Define input parameters to toggle the disabled state of a clip within a timeline" + }, + { + "name": "TranscriptionProvider", + "kind": "interface", + "signature": "interface TranscriptionProvider", + "doc": "Whisper-in-a-worker contract." + }, + { + "name": "TranscriptionSegment", + "kind": "interface", + "signature": "interface TranscriptionSegment", + "doc": "Represent a segment of transcription with text and start and end times in seconds" + }, + { + "name": "trimClipCommand", + "kind": "function", + "signature": "(input: TrimClipInput) => TimelineCommand", + "doc": "Trim is strict where move is forgiving: the caller (a trim handle) already knows both edges, so out-of-bounds input is a bug, not a gesture." + }, + { + "name": "TrimClipInput", + "kind": "interface", + "signature": "interface TrimClipInput", + "doc": "Define input parameters for trimming a clip within a sequence timeline" + }, + { + "name": "trimEndDrag", + "kind": "function", + "signature": "(input: TrimEndDragInput) => { durationFrames: number; }", + "doc": "Tail trim: start is invariant; duration is bounded below by the minimum clip length and above by both the sequence end and the remaining source material past the in-point." + }, + { + "name": "TrimEndDragInput", + "kind": "interface", + "signature": "interface TrimEndDragInput", + "doc": null + }, + { + "name": "trimStartDrag", + "kind": "function", + "signature": "(input: TrimStartDragInput) => TrimStartDragResult", + "doc": "Head trim: the clip END is invariant; start slides between two hard walls — it cannot reveal media before source frame 0 (sourceInFrame >= 0) and cannot pass within MIN_SEQUENCE_CLIP_FRAMES of the en…" + }, + { + "name": "TrimStartDragInput", + "kind": "interface", + "signature": "interface TrimStartDragInput", + "doc": null + }, + { + "name": "TrimStartDragResult", + "kind": "interface", + "signature": "interface TrimStartDragResult", + "doc": null + }, + { + "name": "VideoFrameProvider", + "kind": "interface", + "signature": "interface VideoFrameProvider", + "doc": "Supplies decoded frames for preview rendering." + }, + { + "name": "ViewportTransform", + "kind": "interface", + "signature": "interface ViewportTransform", + "doc": "Horizontal viewport: zoom in pixels per frame, scrollLeft in pixels." + }, + { + "name": "WaveformData", + "kind": "interface", + "signature": "interface WaveformData", + "doc": "min/max sample peaks per pixel bucket for waveform rendering." + }, + { + "name": "WhisperOutput", + "kind": "interface", + "signature": "interface WhisperOutput", + "doc": "Define the structure for transcribed text output with optional segmented chunks" + }, + { + "name": "ZoomControl", + "kind": "function", + "signature": "({ zoomMath, zoom, onZoomChange, fitZoom }: ZoomControlProps) => Element", + "doc": null + }, + { + "name": "ZoomControlProps", + "kind": "interface", + "signature": "interface ZoomControlProps", + "doc": null + }, + { + "name": "ZoomMath", + "kind": "interface", + "signature": "interface ZoomMath", + "doc": "Exponential zoom mapping so the slider feels linear across a 10x+ range." + }, + { + "name": "ZoomMathConfig", + "kind": "interface", + "signature": "interface ZoomMathConfig", + "doc": "Define configuration settings for minimum and maximum zoom levels" + } + ] + }, + { + "id": "./sequences/drizzle", + "source": "src/sequences/drizzle.ts", + "dependsOn": [ + "tools", + "web" + ], + "error": null, + "exports": [ + { + "name": "createDrizzleSequenceStore", + "kind": "function", + "signature": "(options: CreateDrizzleSequenceStoreOptions) => SequenceStore", + "doc": "Create a sequence store scoped to a specific sequence and workspace with database access and media resolution" + }, + { + "name": "CreateDrizzleSequenceStoreOptions", + "kind": "interface", + "signature": "interface CreateDrizzleSequenceStoreOptions", + "doc": "Define options for creating a Drizzle sequence store including database, tables, scope, and media resolver" + }, + { + "name": "createSequenceTables", + "kind": "function", + "signature": "(opts: CreateSequenceTablesOptions) => { sequences: SQLiteTableWithColumns<{ name: \"sequence\"; schema: undefined; colum…", + "doc": "Build SQLite sequence tables with defined columns and relationships based on provided options" + }, + { + "name": "CreateSequenceTablesOptions", + "kind": "interface", + "signature": "interface CreateSequenceTablesOptions", + "doc": "Define options for creating sequence-related database tables including workspace and user tables" + }, + { + "name": "SequenceClipRow", + "kind": "type", + "signature": "type SequenceClipRow", + "doc": "Resolve the selected fields of sequence clips from the sequence tables data structure" + }, + { + "name": "SequenceDatabase", + "kind": "type", + "signature": "type SequenceDatabase", + "doc": "Any SQLite drizzle database — `any` erases the driver-specific run-result and schema generics so better-sqlite3, D1, and libsql handles all fit." + }, + { + "name": "SequenceDecisionRow", + "kind": "type", + "signature": "type SequenceDecisionRow", + "doc": "Resolve a sequence decision row from the sequenceDecisions table data" + }, + { + "name": "SequenceExportRow", + "kind": "type", + "signature": "type SequenceExportRow", + "doc": "Resolve a row type representing exported sequence data from sequenceExports table" + }, + { + "name": "SequenceMediaResolver", + "kind": "type", + "signature": "type SequenceMediaResolver", + "doc": "Resolves product-specific media (generation rows, asset rows) for a batch of clip rows." + }, + { + "name": "SequenceParentTable", + "kind": "type", + "signature": "type SequenceParentTable", + "doc": "A product table referenced by FK — only the `id` column is touched." + }, + { + "name": "SequenceRow", + "kind": "type", + "signature": "type SequenceRow", + "doc": "Resolve a sequence row by inferring the selected fields from the sequences table" + }, + { + "name": "SequenceTables", + "kind": "type", + "signature": "type SequenceTables", + "doc": "Resolve sequence tables by invoking the createSequenceTables factory function" + }, + { + "name": "SequenceTrackRow", + "kind": "type", + "signature": "type SequenceTrackRow", + "doc": "Resolve the selected sequence track row from the sequenceTracks table" + } + ] + }, + { + "id": "./skills", + "source": "src/skills/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "assertSkillDeliveryDisjoint", + "kind": "function", + "signature": "(inlineIds: Iterable, mountedIds: Iterable) => void", + "doc": "Throw when the same skill id is delivered both `inline` and `mounted` — the agent would see it twice (once in the prompt body, once as a mounted file it's told to go read), doubling prompt bytes and…" + }, + { + "name": "ComposedSkills", + "kind": "interface", + "signature": "interface ComposedSkills", + "doc": "The output of {@link composeSkills}: the refs to attach to `resources.skills` (empty for `inline`) and the prompt section to fold into the system prompt (already carries its own leading `\\n\\n`, or `'…" + }, + { + "name": "composeShellResources", + "kind": "function", + "signature": "(input: ComposeShellResourcesInput) => AgentProfileFileMount[]", + "doc": "Compose every mount channel into one `resources.files`-ready array." + }, + { + "name": "ComposeShellResourcesInput", + "kind": "interface", + "signature": "interface ComposeShellResourcesInput", + "doc": "Inputs to {@link composeShellResources}." + }, + { + "name": "composeSkills", + "kind": "function", + "signature": "(input: ComposeSkillsInput) => ComposedSkills", + "doc": "Build the {@link ComposedSkills} for one delivery mode." + }, + { + "name": "ComposeSkillsInput", + "kind": "interface", + "signature": "interface ComposeSkillsInput", + "doc": "Inputs to {@link composeSkills}." + }, + { + "name": "CorpusEntry", + "kind": "interface", + "signature": "interface CorpusEntry", + "doc": "One markdown document discovered from the corpus." + }, + { + "name": "CorpusLoadResult", + "kind": "interface", + "signature": "interface CorpusLoadResult", + "doc": "Outcome of {@link loadMarkdownCorpus}: the entries plus which path produced them, so a caller can fail loud when both are empty rather than silently mounting nothing." + }, + { + "name": "corpusSkills", + "kind": "function", + "signature": "(corpus: CorpusEntry[], anchor: string) => AgentProfileFileMount[]", + "doc": "Project corpus entries onto SDK file mounts at a relative path under `/`." + }, + { + "name": "GlobModules", + "kind": "type", + "signature": "type GlobModules", + "doc": "A Vite eager `?raw` glob result: glob key -> raw file body." + }, + { + "name": "LoadCorpusOptions", + "kind": "interface", + "signature": "interface LoadCorpusOptions", + "doc": "Options for {@link loadMarkdownCorpus}." + }, + { + "name": "loadMarkdownCorpus", + "kind": "function", + "signature": "(options: LoadCorpusOptions, importMetaUrl?: string | undefined) => CorpusLoadResult", + "doc": "Load a markdown corpus, preferring a Vite glob-result map and falling back to a Node fs walk." + }, + { + "name": "mergeComposedSkills", + "kind": "function", + "signature": "(batches: ComposedSkills[]) => ComposedSkills", + "doc": "Combine multiple {@link ComposedSkills} batches (e.g." + }, + { + "name": "parseCorpusSkills", + "kind": "function", + "signature": "(corpus: CorpusEntry[]) => SkillEntry[]", + "doc": "Map a loaded corpus (see {@link loadMarkdownCorpus}) onto `SkillEntry`s, using each entry's `id` as the fallback when its `SKILL.md` carries no frontmatter `id` of its own." + }, + { + "name": "ParsedSkill", + "kind": "interface", + "signature": "interface ParsedSkill", + "doc": "The result of {@link parseSkillFrontmatter}: the parsed fields, the body with the frontmatter block stripped, and the original untouched text." + }, + { + "name": "parseSkillFrontmatter", + "kind": "function", + "signature": "(raw: string) => ParsedSkill", + "doc": "THE one `SKILL.md` frontmatter parser — hand-rolled, no YAML dependency." + }, + { + "name": "registrySkills", + "kind": "function", + "signature": "(registry: SkillEntry[], tier?: string) => AgentProfileFileMount[]", + "doc": "Project the registry's free-tier (or `tier`-matched) entries onto SDK file mounts at the harness skill-discovery path." + }, + { + "name": "renderInlineSkills", + "kind": "function", + "signature": "(input: RenderInlineSkillsInput) => string", + "doc": "Render every (tier-filtered) skill's full body inline into the prompt — the `inline` delivery mode." + }, + { + "name": "RenderInlineSkillsInput", + "kind": "interface", + "signature": "interface RenderInlineSkillsInput", + "doc": "Inputs to {@link renderInlineSkills}." + }, + { + "name": "renderSkillIndex", + "kind": "function", + "signature": "(input: RenderSkillIndexInput) => string", + "doc": "Render a one-line-per-skill INDEX (name, description, and the path to read the full body) — the `mounted` delivery mode's prompt section, paired with {@link skillRefs} putting the actual files on `re…" + }, + { + "name": "RenderSkillIndexInput", + "kind": "interface", + "signature": "interface RenderSkillIndexInput", + "doc": "Inputs to {@link renderSkillIndex}." + }, + { + "name": "SkillDeliveryMode", + "kind": "type", + "signature": "type SkillDeliveryMode", + "doc": "How a skill reaches the agent: `inline` renders its full body into the system prompt; `mounted` puts it on the typed `resources.skills` channel and renders only an index line." + }, + { + "name": "SkillEntry", + "kind": "interface", + "signature": "interface SkillEntry", + "doc": "A hand-authored, tier-gated installable skill." + }, + { + "name": "skillEntryFromMarkdown", + "kind": "function", + "signature": "(raw: string, fallbackId?: string | undefined) => SkillEntry", + "doc": "Build a {@link SkillEntry} from a raw `SKILL.md` body." + }, + { + "name": "SkillFrontmatter", + "kind": "interface", + "signature": "interface SkillFrontmatter", + "doc": "Fields a `SKILL.md` frontmatter block may declare." + }, + { + "name": "skillMountPath", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Harness skill-discovery path the Claude Code backend reads natively." + }, + { + "name": "skillRefs", + "kind": "function", + "signature": "(skills: SkillEntry[], opts?: { tier?: string | undefined; }) => AgentProfileResourceRef[]", + "doc": "Project skills onto the typed `resources.skills` channel (`AgentProfileResourceRef[]`), tier-filtered (same `s.tier === tier` semantics as {@link registrySkills}) when `opts.tier` is given, sorted by…" + } + ] + }, + { + "id": "./skills-placement", + "source": "src/skills-placement/index.ts", + "dependsOn": [ + "harness", + "skills" + ], + "error": null, + "exports": [ + { + "name": "ComposedSkills", + "kind": "interface", + "signature": "interface ComposedSkills", + "doc": "The output of {@link composeSkills}: the refs to attach to `resources.skills` (empty for `inline`) and the prompt section to fold into the system prompt (already carries its own leading `\\n\\n`, or `'…" + }, + { + "name": "composeSkillsForHarness", + "kind": "function", + "signature": "(input: ComposeSkillsForHarnessInput) => ComposedSkills", + "doc": "Compose {@link ComposedSkills} for `harness`: `mounted` delivery when the platform names a cwd skill dir for it, `inline` delivery (the automatic fallback that keeps every skill available on every ha…" + }, + { + "name": "ComposeSkillsForHarnessInput", + "kind": "interface", + "signature": "interface ComposeSkillsForHarnessInput", + "doc": "Inputs to {@link composeSkillsForHarness}." + }, + { + "name": "resolveSkillDir", + "kind": "function", + "signature": "(harness: \"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\" | \"hermes\"…", + "doc": "Resolve the cwd-relative skill dir `resources.skills` refs materialize into on `harness` — via the platform's `skillDirForHarness`." + }, + { + "name": "SkillEntry", + "kind": "interface", + "signature": "interface SkillEntry", + "doc": "A hand-authored, tier-gated installable skill." + }, + { + "name": "unsupportedSkillHarnesses", + "kind": "function", + "signature": "(harnesses: Iterable<\"opencode\" | \"claude-code\" | \"nanoclaw\" | \"kimi-code\" | \"codex\" | \"amp\" | \"factory-droids\" | \"pi\"…", + "doc": "Filter `harnesses` down to those with no mounted skill dir (deduped, first-seen order preserved) — the set that must fall back to `inline` delivery, or that a caller should warn about before offering…" + } + ] + }, + { + "id": "./store", + "source": "src/store/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "createDatabaseProvider", + "kind": "function", + "signature": "(options?: DatabaseProviderOptions) => DatabaseProvider", + "doc": "Create a swappable database provider." + }, + { + "name": "createInMemoryKV", + "kind": "function", + "signature": "(initial?: Record | undefined) => KVStore", + "doc": "In-memory {@link KVStore} — the portable vault backend for sandbox/eval runs." + }, + { + "name": "DatabaseProvider", + "kind": "interface", + "signature": "interface DatabaseProvider", + "doc": "Swappable database provider — the seam that decouples the agent's persistence from any one driver." + }, + { + "name": "DatabaseProviderOptions", + "kind": "interface", + "signature": "interface DatabaseProviderOptions", + "doc": "Define options for configuring database provider behavior including error messaging" + }, + { + "name": "KVGetWithMetadataResult", + "kind": "interface", + "signature": "interface KVGetWithMetadataResult", + "doc": "Resolve a key-value pair retrieval including its associated metadata and value" + }, + { + "name": "KVListResult", + "kind": "interface", + "signature": "interface KVListResult", + "doc": "Describe the result of listing keys with completion status and optional pagination cursor" + }, + { + "name": "KVPutOptions", + "kind": "interface", + "signature": "interface KVPutOptions", + "doc": "Define options for storing a key-value pair with expiration and metadata settings" + }, + { + "name": "KVStore", + "kind": "interface", + "signature": "interface KVStore", + "doc": "Define a key-value store interface for asynchronous data retrieval, storage, deletion, and listing" + } + ] + }, + { + "id": "./stream", + "source": "src/stream/index.ts", + "dependsOn": [ + "interactions", + "plans" + ], + "error": null, + "exports": [ + { + "name": "asRecord", + "kind": "function", + "signature": "(value: unknown) => JsonRecord | undefined", + "doc": "Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined" + }, + { + "name": "asString", + "kind": "function", + "signature": "(value: unknown) => string | undefined", + "doc": "Resolve a non-empty string from a value or return undefined" + }, + { + "name": "attachmentPartKey", + "kind": "function", + "signature": "(path: string) => string", + "doc": "Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it." + }, + { + "name": "BufferedTurnEvent", + "kind": "interface", + "signature": "interface BufferedTurnEvent", + "doc": "Represent a buffered turn event with a sequence number and serialized event data" + }, + { + "name": "BufferedTurnOptions", + "kind": "interface", + "signature": "interface BufferedTurnOptions", + "doc": "Define options for buffering and flushing turn events with optional live client delivery and event coalescing" + }, + { + "name": "BufferedTurnTap", + "kind": "interface", + "signature": "interface BufferedTurnTap", + "doc": "A push-driven buffer for a turn whose producer the caller does NOT own." + }, + { + "name": "buildUserTextParts", + "kind": "function", + "signature": "(text: string, turnId: string | undefined) => JsonRecord[]", + "doc": "Build an array of text parts with optional turn ID for user input" + }, + { + "name": "coalesceChatStreamEvents", + "kind": "function", + "signature": "(events: unknown[]) => unknown[]", + "doc": "Coalesce consecutive `message.part.updated` deltas for the SAME part into one event." + }, + { + "name": "coalesceDeltas", + "kind": "function", + "signature": "(events: unknown[]) => unknown[]", + "doc": "Merge consecutive text/reasoning deltas of the same type into one event." + }, + { + "name": "collapseRedundantTextParts", + "kind": "function", + "signature": "(parts: JsonRecord[]) => JsonRecord[]", + "doc": "Collapses text-part artifacts of unstable upstream segment identity: the same text arriving under two keys (id-less delta stream, then an id-bearing snapshot) folds into two segments, and interleaved…" + }, + { + "name": "createBufferedTurnTap", + "kind": "function", + "signature": "(opts: BufferedTurnOptions) => BufferedTurnTap", + "doc": "The buffering core." + }, + { + "name": "createD1TurnEventStore", + "kind": "function", + "signature": "(db: D1LikeForTurns) => TurnEventStore", + "doc": "Resolve a TurnEventStore that appends and reads turn events using a D1-like database interface" + }, + { + "name": "createMemoryTurnEventStore", + "kind": "function", + "signature": "() => TurnEventStore", + "doc": "In-memory store for tests and keyless local dev." + }, + { + "name": "D1LikeForTurns", + "kind": "interface", + "signature": "interface D1LikeForTurns", + "doc": "Minimal structural D1 contract (Cloudflare `D1Database` satisfies it)." + }, + { + "name": "encodeEvent", + "kind": "function", + "signature": "(encoder: TextEncoder, event: StreamEvent) => Uint8Array", + "doc": "Encode a StreamEvent object into a Uint8Array using the provided TextEncoder" + }, + { + "name": "finalizeAssistantParts", + "kind": "function", + "signature": "(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[]", + "doc": "Resolve and clean up assistant parts by terminalizing and collapsing redundant segments" + }, + { + "name": "finalizePendingInteractionParts", + "kind": "function", + "signature": "(parts: JsonRecord[], outcome: \"answered\" | \"expired\") => JsonRecord[]", + "doc": "Settles still-pending interaction parts at persist time." + }, + { + "name": "getPartKey", + "kind": "function", + "signature": "(part: JsonRecord) => string", + "doc": "Resolve a unique key string for a part based on its type and identifying properties" + }, + { + "name": "JsonRecord", + "kind": "type", + "signature": "type JsonRecord", + "doc": "Represent a JSON-compatible object with string keys and values of any type" + }, + { + "name": "mergePersistedPart", + "kind": "function", + "signature": "(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string | undefined) => JsonRecord", + "doc": "Merge incoming JSON with existing persisted data, applying delta for text types when provided" + }, + { + "name": "messageHasTurnId", + "kind": "function", + "signature": "(message: PersistedChatMessageForTurn, turnId: string) => boolean", + "doc": "Resolve whether a message contains any part with the specified turn ID" + }, + { + "name": "MISSING_TOOL_TERMINAL_ERROR", + "kind": "const", + "signature": "\"Tool did not report a terminal result before the assistant turn completed.\"", + "doc": "Resolve errors when a tool fails to report a terminal result before the assistant turn ends" + }, + { + "name": "MISSING_TOOL_TERMINAL_REASON", + "kind": "const", + "signature": "\"missing-tool-terminal\"", + "doc": "Provide the reason identifier for a missing tool in the terminal environment" + }, + { + "name": "normalizeClientTurnId", + "kind": "function", + "signature": "(value: unknown) => string | undefined", + "doc": "Normalize and validate a client turn ID string ensuring it meets format and length requirements" + }, + { + "name": "normalizePersistedPart", + "kind": "function", + "signature": "(rawPart: JsonRecord) => JsonRecord | null", + "doc": "Normalize a persisted part object by standardizing its structure and fields" + }, + { + "name": "normalizeTime", + "kind": "function", + "signature": "(value: unknown) => JsonRecord | undefined", + "doc": "Resolve time properties from various keys into a normalized record with numeric start and end fields" + }, + { + "name": "normalizeToolEvent", + "kind": "function", + "signature": "(event: StreamEvent) => StreamEvent", + "doc": "Normalize tool-related events into a standardized message.part.updated format" + }, + { + "name": "PersistedChatMessageForTurn", + "kind": "interface", + "signature": "interface PersistedChatMessageForTurn", + "doc": "Define the structure of a chat message stored for a specific conversation turn" + }, + { + "name": "pumpBufferedTurn", + "kind": "function", + "signature": "(opts: PumpBufferedTurnOptions) => Promise", + "doc": "Drive a turn to completion regardless of the live client, when you OWN the producer as an `AsyncIterable`." + }, + { + "name": "PumpBufferedTurnOptions", + "kind": "interface", + "signature": "interface PumpBufferedTurnOptions", + "doc": "Define options to pump data from an asynchronous iterable source with buffered turn control" + }, + { + "name": "replayTurnEvents", + "kind": "function", + "signature": "(opts: ReplayTurnEventsOptions) => AsyncGenerator", + "doc": "Yield buffered events after `fromSeq`, then keep polling while the turn is still 'running' until it completes, errors, or times out." + }, + { + "name": "ReplayTurnEventsOptions", + "kind": "interface", + "signature": "interface ReplayTurnEventsOptions", + "doc": "Define options for replaying turn events with control over sequence, polling, and timeout" + }, + { + "name": "resolveChatTurn", + "kind": "function", + "signature": "(input: { existingMessages: PersistedChatMessageForTurn[]; userContent: string; turnId?: string | undefined; }) => Reso…", + "doc": "Resolve a chat turn by determining message reuse and constructing user message parts" + }, + { + "name": "ResolvedChatTurn", + "kind": "interface", + "signature": "interface ResolvedChatTurn", + "doc": "Represent a chat turn with resolved user message insertion and prior message context" + }, + { + "name": "resolveToolId", + "kind": "function", + "signature": "(part: JsonRecord) => string", + "doc": "Resolve a unique tool identifier from various possible properties or generate a fallback ID" + }, + { + "name": "resolveToolName", + "kind": "function", + "signature": "(part: JsonRecord) => string", + "doc": "Resolve the tool name from a JSON record using tool, name, or a default value" + }, + { + "name": "StreamEvent", + "kind": "interface", + "signature": "interface StreamEvent", + "doc": "Define an event object carrying a type and optional JSON data payload" + }, + { + "name": "terminalizeDanglingAssistantToolUpdates", + "kind": "function", + "signature": "(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[]", + "doc": "Finalizes, then folds each synthetic tool settlement back into `partMap` and returns just those updates — the shape a streaming loop needs to emit closing `message.part.updated` frames for tools the…" + }, + { + "name": "terminalizeDanglingToolPart", + "kind": "function", + "signature": "(part: JsonRecord) => JsonRecord", + "doc": "Closes a tool part left `running` when a stream ended abnormally: settles it as a terminal `error` and stamps `state.metadata.terminalized` so the synthetic settlement is distinguishable from a real…" + }, + { + "name": "terminalizeDanglingToolParts", + "kind": "function", + "signature": "(parts: JsonRecord[]) => JsonRecord[]", + "doc": "Resolve dangling tool parts into terminal forms within the given JSON records array" + }, + { + "name": "TURN_EVENTS_MIGRATION_SQL", + "kind": "const", + "signature": "\"\\nCREATE TABLE IF NOT EXISTS turn_events (\\n turnId TEXT NOT NULL,\\n seq INTEGER NOT NULL,\\n event TEXT NOT NULL,\\n PR…", + "doc": "Schema for the D1 store — append to the product's migrations." + }, + { + "name": "TURN_STATUS_SCOPE_MIGRATION_SQL", + "kind": "const", + "signature": "\"ALTER TABLE turn_status ADD COLUMN scopeId TEXT;\"", + "doc": "For deployments whose `turn_status` table predates `scopeId`/`listRunning` — run once to add the column (the CREATE above already includes it for new deployments)." + }, + { + "name": "TurnEventStore", + "kind": "interface", + "signature": "interface TurnEventStore", + "doc": "Manage and query turn events and their lifecycle statuses within a scoped event store" + }, + { + "name": "TurnStatus", + "kind": "type", + "signature": "type TurnStatus", + "doc": "Resumable chat turns — the router-path answer to \"streams resume on disconnect\" (issue #27)." + } + ] + }, + { + "id": "./studio", + "source": "src/studio/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "buildGenerationRequestBody", + "kind": "function", + "signature": "(fields: GenerationRequestFields) => Record", + "doc": "Build the request body object for a generation operation from provided fields" + }, + { + "name": "buildPublishPackage", + "kind": "function", + "signature": "({ caption, postDescription, mentions, cadence, destinations, }: { caption: string; postDescription: string; mentions:…", + "doc": "Build a PublishPackage object from caption, description, mentions, cadence, and destinations inputs" + }, + { + "name": "CADENCES", + "kind": "const", + "signature": "string[]", + "doc": "Provide an array of predefined cadence options for scheduling or approval processes" + }, + { + "name": "DESTINATIONS", + "kind": "const", + "signature": "PublishDestination[]", + "doc": "List available social media platforms with their publishing fields and provider identifiers" + }, + { + "name": "failedOptimisticGeneration", + "kind": "function", + "signature": "(generation: Generation) => Generation", + "doc": "Mark a generation as failed with updated status and error information" + }, + { + "name": "Generation", + "kind": "interface", + "signature": "interface Generation", + "doc": "Define the structure for a generation entity including its metadata and creation details" + }, + { + "name": "GENERATION_TYPES", + "kind": "const", + "signature": "readonly GenerationType[]", + "doc": "Provide an array of supported generation types for media and content processing" + }, + { + "name": "generationError", + "kind": "function", + "signature": "(generation: Generation) => string | null", + "doc": "Resolve and return the first user-safe error message from generation metadata or null if none exist" + }, + { + "name": "generationMergeKey", + "kind": "function", + "signature": "(generation: Generation) => string | null", + "doc": "Resolve a unique merge key from a generation using batch slot or client request ID" + }, + { + "name": "GenerationRequestFields", + "kind": "interface", + "signature": "interface GenerationRequestFields", + "doc": "Define fields required to configure and request various types of media generation" + }, + { + "name": "generationStatus", + "kind": "function", + "signature": "(generation: Generation) => GenerationStatus", + "doc": "Resolve the current status of a generation based on its metadata and result fields" + }, + { + "name": "GenerationStatus", + "kind": "type", + "signature": "type GenerationStatus", + "doc": "Define possible states representing the progress of a generation process" + }, + { + "name": "GenerationType", + "kind": "type", + "signature": "type GenerationType", + "doc": "Define generation categories for media including image, video, speech, avatar, and transcription" + }, + { + "name": "generationVaultPath", + "kind": "function", + "signature": "(generation: Generation) => string | null", + "doc": "Resolve the vault path string from a Generation object or return null if unavailable" + }, + { + "name": "isDestinationConnected", + "kind": "function", + "signature": "(destination: PublishDestination, connections: StudioIntegrationConnection[]) => boolean", + "doc": "Determine if a destination has any active connections in the given list of studio integration connections" + }, + { + "name": "isGenerationType", + "kind": "function", + "signature": "(value: string) => value is GenerationType", + "doc": "Resolve whether a string value matches a valid GenerationType" + }, + { + "name": "isLocalGeneration", + "kind": "function", + "signature": "(generation: Generation) => boolean", + "doc": "Determine if a generation ID indicates a local generation" + }, + { + "name": "isPublishPackage", + "kind": "function", + "signature": "(value: unknown) => value is { caption?: string | undefined; description?: string | undefined; mentions?: string[] | un…", + "doc": "Determine if a value conforms to the PublishPackage structure with optional metadata fields" + }, + { + "name": "latestBatchOf", + "kind": "function", + "signature": "(generations: Generation[]) => Generation[]", + "doc": "Resolve and return the latest batch of generations grouped and sorted by client request ID and output index" + }, + { + "name": "MAX_IMAGE_COUNT", + "kind": "const", + "signature": "4", + "doc": "Define the maximum number of images allowed for upload or display" + }, + { + "name": "MediaModelCatalogResponse", + "kind": "interface", + "signature": "interface MediaModelCatalogResponse", + "doc": "Represent media model catalog with default values, model options, and optional error message" + }, + { + "name": "MediaModelOption", + "kind": "interface", + "signature": "interface MediaModelOption", + "doc": "Describe media model option properties including id, name, type, status, and optional provider and reason" + }, + { + "name": "MediaModelStatus", + "kind": "type", + "signature": "type MediaModelStatus", + "doc": "Define possible status values for a media model's availability and accessibility" + }, + { + "name": "mergeLiveGeneration", + "kind": "function", + "signature": "(current: Generation[], generation: Generation) => Generation[]", + "doc": "Merge a new generation into the current list by replacing or prepending it based on matching keys" + }, + { + "name": "mergeLoaderAndLive", + "kind": "function", + "signature": "(loader: Generation[], live: Generation[]) => Generation[]", + "doc": "Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs" + }, + { + "name": "MIN_IMAGE_COUNT", + "kind": "const", + "signature": "1", + "doc": "Define the minimum number of images required for processing or validation" + }, + { + "name": "modelMessage", + "kind": "function", + "signature": "(model: MediaModelOption | undefined, loading: boolean, count: number) => string | null", + "doc": "Resolve the appropriate status message for a media model based on loading state and availability" + }, + { + "name": "normalizeImageCount", + "kind": "function", + "signature": "(value: unknown) => number", + "doc": "Normalize a value to a finite integer within the allowed image count range" + }, + { + "name": "optimisticGeneration", + "kind": "function", + "signature": "({ type, prompt, model, clientRequestId, outputIndex, outputCount, }: { type: GenerationType; prompt: string; model?: s…", + "doc": "Generate content optimistically based on input parameters and optional model and output details" + }, + { + "name": "outputPathFor", + "kind": "function", + "signature": "(type: GenerationType) => string", + "doc": "Resolve the output directory path based on the specified generation type" + }, + { + "name": "preferredModelId", + "kind": "function", + "signature": "(type: GenerationType, catalog: MediaModelCatalogResponse | null) => string | undefined", + "doc": "Resolve the preferred model ID for a given generation type from the media model catalog" + }, + { + "name": "PublishDestination", + "kind": "interface", + "signature": "interface PublishDestination", + "doc": "Define a destination for publishing content with identifiers, label, provider IDs, and fields" + }, + { + "name": "PublishPackage", + "kind": "interface", + "signature": "interface PublishPackage", + "doc": "Define the structure for configuring package publishing details and evaluation criteria" + }, + { + "name": "relativeTime", + "kind": "function", + "signature": "(date: Date | null) => string", + "doc": "Resolve a human-readable relative time string from a given date or return an empty string if null" + }, + { + "name": "selectedModelsWithDefaults", + "kind": "function", + "signature": "(current: Partial>, catalog: MediaModelCatalogResponse) => Partial string", + "doc": "Resolve a user-safe generation message by filtering sensitive or error-related content" + } + ] + }, + { + "id": "./studio-react", + "source": "src/studio-react/index.tsx", + "dependsOn": [ + "studio" + ], + "error": null, + "exports": [ + { + "name": "AvatarComposer", + "kind": "function", + "signature": "({ audioUrl, imageUrl, avatarId, onAudioUrlChange, onImageUrlChange, onAvatarIdChange, }: { audioUrl: string; imageUrl:…", + "doc": null + }, + { + "name": "ComposerDisclosure", + "kind": "function", + "signature": "({ summary, children }: { summary: ReactNode; children: ReactNode; }) => Element", + "doc": null + }, + { + "name": "ComposerHero", + "kind": "function", + "signature": "({ workspaceId, integrationsHref, canManageIntegrations, align, surfaceClassName, onGenerated, }: { workspaceId?: strin…", + "doc": null + }, + { + "name": "Field", + "kind": "function", + "signature": "({ label, htmlFor, className, children, }: { label: string; htmlFor?: string | undefined; className?: string | undefine…", + "doc": null + }, + { + "name": "filterGenerations", + "kind": "function", + "signature": "(generations: Generation[], typeFilter: string | null) => Generation[]", + "doc": "The visible set for the active type tab (all generations when unfiltered)." + }, + { + "name": "GenerationCard", + "kind": "function", + "signature": "({ generation, onSelect, }: { generation: Generation; onSelect: (generation: Generation) => void; }) => Element", + "doc": null + }, + { + "name": "GenerationDetail", + "kind": "function", + "signature": "({ generation, vaultHref, onNavigate, }: { generation: Generation; vaultHref?: ((filePath?: string | null | undefined)…", + "doc": null + }, + { + "name": "GenerationDetailModal", + "kind": "function", + "signature": "({ generation, vaultHref, onClose, }: { generation: Generation | null; vaultHref?: ((filePath?: string | null | undefin…", + "doc": "Centered detail view for a single generation." + }, + { + "name": "GenerationGrid", + "kind": "function", + "signature": "({ generations, typeFilter, onSelect, }: { generations: Generation[]; typeFilter: string | null; onSelect: (generation:…", + "doc": "Chrome-less asset grid — the `GenerationCard` grid plus its empty state, with no surrounding tabs/stats/sheet chrome." + }, + { + "name": "GenerationStatusBadge", + "kind": "function", + "signature": "({ generation, inline, }: { generation: Generation; inline?: boolean | undefined; }) => Element | null", + "doc": null + }, + { + "name": "ImageComposer", + "kind": "function", + "signature": "({ size, quality, imageCount, onSizeChange, onQualityChange, onImageCountChange, }: { size: string; quality: string; im…", + "doc": null + }, + { + "name": "LibraryDrawer", + "kind": "function", + "signature": "({ open, onOpenChange, generations, totalCost, typeFilter, onFilterChange, vaultHref, selected, onSelect, }: { open: bo…", + "doc": null + }, + { + "name": "LibraryPanel", + "kind": "function", + "signature": "({ generations, totalCost, typeFilter, onFilterChange, onSelect, }: { generations: Generation[]; totalCost: number; typ…", + "doc": "Inline asset gallery — the same filter + stats + card grid as the library drawer's list view, but with no sheet chrome so it can sit on the page beside the composer." + }, + { + "name": "NativeSelect", + "kind": "function", + "signature": "(props: SelectHTMLAttributes) => Element", + "doc": null + }, + { + "name": "PublishPackageComposer", + "kind": "function", + "signature": "({ caption, postDescription, mentions, cadence, selectedDestinations, connections, connectionError, connectionsLoading,…", + "doc": null + }, + { + "name": "ResultCanvas", + "kind": "function", + "signature": "({ batch, onOpenLibrary, onSelect, }: { batch: Generation[]; onOpenLibrary: () => void; onSelect: (generation: Generati…", + "doc": null + }, + { + "name": "SpeechComposer", + "kind": "function", + "signature": "({ voice, onVoiceChange, }: { voice: string; onVoiceChange: (value: string) => void; }) => Element", + "doc": null + }, + { + "name": "Stepper", + "kind": "function", + "signature": "({ value, min, max, onChange, }: { value: number; min: number; max: number; onChange: (value: number) => void; }) => El…", + "doc": null + }, + { + "name": "StudioHeader", + "kind": "function", + "signature": "({ count, onOpenLibrary, canGenerate, }: { count: number; onOpenLibrary: () => void; canGenerate: boolean; }) => Element", + "doc": null + }, + { + "name": "StudioRole", + "kind": "type", + "signature": "type StudioRole", + "doc": null + }, + { + "name": "StudioSheet", + "kind": "function", + "signature": "({ open, onOpenChange, title, children, }: { open: boolean; onOpenChange: (open: boolean) => void; title: string; child…", + "doc": "Right-side overlay sheet built on Radix Dialog — gives focus-trap, scroll-lock, and Escape-to-close for free." + }, + { + "name": "StudioWorkspace", + "kind": "function", + "signature": "({ generations, totalCost, workspaceId, role, generationsEndpoint, vaultHref, integrationsHref, }: StudioWorkspaceProps…", + "doc": "The full studio surface: header + composer + result canvas + library drawer, with the generation orchestrator (merge/poll/revalidate) wired in." + }, + { + "name": "StudioWorkspaceProps", + "kind": "interface", + "signature": "interface StudioWorkspaceProps", + "doc": null + }, + { + "name": "TranscriptionComposer", + "kind": "function", + "signature": "({ audioUrl, language, onAudioUrlChange, onLanguageChange, }: { audioUrl: string; language: string; onAudioUrlChange: (…", + "doc": null + }, + { + "name": "TranscriptionOptions", + "kind": "function", + "signature": "({ responseFormat, temperature, onResponseFormatChange, onTemperatureChange, }: { responseFormat: string; temperature:…", + "doc": null + }, + { + "name": "TYPE_CONFIG", + "kind": "const", + "signature": "Record", + "doc": "Map type keys to their corresponding configuration objects including labels, icons, and colors" + }, + { + "name": "TypeConfig", + "kind": "interface", + "signature": "interface TypeConfig", + "doc": "Define configuration options for a type including label, icon, and color properties" + }, + { + "name": "typeConfigFor", + "kind": "function", + "signature": "(type: string) => TypeConfig", + "doc": "Resolve the configuration object for a given type or return the default image configuration" + }, + { + "name": "useStudioGenerations", + "kind": "function", + "signature": "(loaderGenerations: Generation[], options?: { workspaceId?: string | undefined; generationsEndpoint?: string | undefine…", + "doc": "The generation orchestrator behind a studio surface: it merges the loader's rows with in-flight live generations, computes the latest batch for the canvas, polls running generations until they settle…" + }, + { + "name": "VideoComposer", + "kind": "function", + "signature": "({ duration, resolution, aspectRatio, referenceImageUrl, onDurationChange, onResolutionChange, onAspectRatioChange, onR…", + "doc": null + } + ] + }, + { + "id": "./tangle", + "source": "src/tangle/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "BrokerToken", + "kind": "interface", + "signature": "interface BrokerToken", + "doc": "A single-use hub bearer minted from a durable grant — mirrors `@tangle-network/agent-integrations`'s `BrokerToken`." + }, + { + "name": "BrokerTokenMinter", + "kind": "interface", + "signature": "interface BrokerTokenMinter", + "doc": "The one method the provider needs — `TangleAppsClient` satisfies it structurally, so `createBrokerTokenProvider({ client: tangleAppsClient, … })` type-checks without importing the concrete class." + }, + { + "name": "BrokerTokenProvider", + "kind": "interface", + "signature": "interface BrokerTokenProvider", + "doc": "Provide and refresh broker bearer tokens, allowing forced token invalidation" + }, + { + "name": "BrokerTokenProviderOptions", + "kind": "interface", + "signature": "interface BrokerTokenProviderOptions", + "doc": "Define options for configuring a broker token provider including client credentials and token management settings" + }, + { + "name": "buildConsentUrl", + "kind": "function", + "signature": "(input: ConsentUrlInput) => string", + "doc": "Build the URL to send the user to for the one-time app-consent." + }, + { + "name": "ConsentUrlInput", + "kind": "interface", + "signature": "interface ConsentUrlInput", + "doc": "Define input parameters required to generate a consent URL for OAuth authorization" + }, + { + "name": "createBrokerTokenProvider", + "kind": "function", + "signature": "(opts: BrokerTokenProviderOptions) => BrokerTokenProvider", + "doc": "Cache + auto-refresh a broker token for one grant." + } + ] + }, + { + "id": "./teams", + "source": "src/teams/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "ASSIGNABLE_WORKSPACE_ROLES", + "kind": "const", + "signature": "readonly [\"viewer\", \"editor\", \"admin\"]", + "doc": "Define the list of roles that can be assigned within a workspace" + }, + { + "name": "AssignableWorkspaceRole", + "kind": "type", + "signature": "type AssignableWorkspaceRole", + "doc": "Resolve the set of roles that can be assigned within a workspace" + }, + { + "name": "canManageWorkspaceMemberRole", + "kind": "function", + "signature": "(actorRole: \"viewer\" | \"editor\" | \"admin\" | \"owner\", targetRole: \"viewer\" | \"editor\" | \"admin\" | \"owner\") => boolean", + "doc": "Whether `actorRole` may set/clear a member currently at `targetRole`." + }, + { + "name": "generateInvitationToken", + "kind": "function", + "signature": "() => string", + "doc": "A cryptographically-random, URL-safe invitation token." + }, + { + "name": "generateInviteToken", + "kind": "function", + "signature": "() => string", + "doc": "Cryptographically-random, URL-safe (base64url) invite token." + }, + { + "name": "getInvitationExpiresAt", + "kind": "function", + "signature": "(now?: Date) => Date", + "doc": "Calculate the expiration date of an invitation based on the given or current date" + }, + { + "name": "hasOrganizationRole", + "kind": "function", + "signature": "(actual: \"admin\" | \"owner\" | \"member\" | \"billing\", minimum: \"admin\" | \"owner\" | \"member\" | \"billing\") => boolean", + "doc": "True when `actual` is at least `minimum` on the organization ladder." + }, + { + "name": "hasWorkspaceRole", + "kind": "function", + "signature": "(actual: \"viewer\" | \"editor\" | \"admin\" | \"owner\", minimum: \"viewer\" | \"editor\" | \"admin\" | \"owner\") => boolean", + "doc": "True when `actual` is at least `minimum` on the workspace ladder." + }, + { + "name": "INVITATION_EXPIRY_DAYS", + "kind": "const", + "signature": "7", + "doc": "Define the number of days before an invitation expires" + }, + { + "name": "InvitationEmailBrand", + "kind": "interface", + "signature": "interface InvitationEmailBrand", + "doc": "Define the structure for an invitation email brand including the RFC-5322 From header" + }, + { + "name": "InvitationEmailStatus", + "kind": "type", + "signature": "type InvitationEmailStatus", + "doc": "Define possible statuses for the sending state of an invitation email" + }, + { + "name": "InvitationPermission", + "kind": "type", + "signature": "type InvitationPermission", + "doc": "The role an invitation grants — the assignable workspace ladder (never owner)." + }, + { + "name": "InvitationStatus", + "kind": "type", + "signature": "type InvitationStatus", + "doc": "Define possible states for an invitation's lifecycle including pending, accepted, expired, and revoked" + }, + { + "name": "InviteRejectionReason", + "kind": "type", + "signature": "type InviteRejectionReason", + "doc": "Define possible reasons for rejecting an invite including acceptance, expiration, or email mismatch" + }, + { + "name": "InviteTokenState", + "kind": "interface", + "signature": "interface InviteTokenState", + "doc": "A pending invite row, narrowed to the fields invite acceptance reasons over." + }, + { + "name": "inviteUrlForToken", + "kind": "function", + "signature": "(origin: string, token: string) => string", + "doc": "Generate an invite URL by combining the origin with an encoded token" + }, + { + "name": "InviteValidationResult", + "kind": "interface", + "signature": "interface InviteValidationResult", + "doc": "Represent the outcome of validating an invite with success status and optional rejection reason" + }, + { + "name": "isAssignableWorkspaceRole", + "kind": "function", + "signature": "(value: unknown) => value is \"viewer\" | \"editor\" | \"admin\"", + "doc": "Determine if a value is a valid assignable workspace role among viewer, editor, or admin" + }, + { + "name": "isInviteTokenShape", + "kind": "function", + "signature": "(value: unknown) => value is string", + "doc": "True when `value` has the shape of an invite token (not whether it exists)." + }, + { + "name": "normalizeInvitationEmail", + "kind": "function", + "signature": "(email: string) => string", + "doc": "Normalize an invitation email by trimming whitespace and converting to lowercase" + }, + { + "name": "ORGANIZATION_ROLE_RANK", + "kind": "const", + "signature": "Record<\"admin\" | \"owner\" | \"member\" | \"billing\", number>", + "doc": "Map organization roles to their hierarchical rank for permission and access control purposes" + }, + { + "name": "ORGANIZATION_ROLES", + "kind": "const", + "signature": "readonly [\"owner\", \"admin\", \"member\", \"billing\"]", + "doc": "Define the set of fixed roles available within an organization" + }, + { + "name": "OrganizationRole", + "kind": "type", + "signature": "type OrganizationRole", + "doc": "Resolve a role string from the predefined list of organization roles" + }, + { + "name": "organizationRoleGrantsWorkspaceOwner", + "kind": "function", + "signature": "(role: string | null | undefined) => boolean", + "doc": "Org owners and admins are workspace owners across the whole org." + }, + { + "name": "parseInvitationPermission", + "kind": "function", + "signature": "(value: string | undefined) => \"viewer\" | \"editor\" | \"admin\" | null", + "doc": "Resolve invitation permission from a string or return null if invalid" + }, + { + "name": "RenderedInvitationEmail", + "kind": "interface", + "signature": "interface RenderedInvitationEmail", + "doc": "Define the structure of a fully rendered invitation email with sender, subject, and content fields" + }, + { + "name": "renderInvitationEmail", + "kind": "function", + "signature": "(input: RenderInvitationEmailInput, brand: InvitationEmailBrand) => RenderedInvitationEmail", + "doc": "Render the invitation email body — pure, deterministic, transport-free." + }, + { + "name": "RenderInvitationEmailInput", + "kind": "interface", + "signature": "interface RenderInvitationEmailInput", + "doc": "Define input data required to render an invitation email template" + }, + { + "name": "resolveWorkspaceRole", + "kind": "function", + "signature": "(organizationRole: string | null | undefined, workspaceRole: \"viewer\" | \"editor\" | \"admin\" | \"owner\" | null | undefined…", + "doc": "The effective workspace role a request runs at: org owner/admin → owner of every workspace; otherwise the explicit per-workspace role (or null = no access)." + }, + { + "name": "SandboxWorkspaceRole", + "kind": "type", + "signature": "type SandboxWorkspaceRole", + "doc": "Define user roles available within a sandbox workspace environment" + }, + { + "name": "validateInviteToken", + "kind": "function", + "signature": "(invite: InviteTokenState, opts?: { acceptingEmail?: string | null | undefined; now?: Date | undefined; }) => InviteVal…", + "doc": "Decide whether a loaded invite can be accepted by `acceptingEmail` at `now`." + }, + { + "name": "WORKSPACE_ROLE_RANK", + "kind": "const", + "signature": "Record<\"viewer\" | \"editor\" | \"admin\" | \"owner\", number>", + "doc": "Map workspace roles to their corresponding hierarchical rank values" + }, + { + "name": "WORKSPACE_ROLES", + "kind": "const", + "signature": "readonly [\"viewer\", \"editor\", \"admin\", \"owner\"]", + "doc": "Pure role algebra for the teams capability — the tenancy/membership model shared across the fleet." + }, + { + "name": "WorkspaceCollaborationAccess", + "kind": "type", + "signature": "type WorkspaceCollaborationAccess", + "doc": "Define access levels for workspace collaboration as either read or write" + }, + { + "name": "WorkspaceRole", + "kind": "type", + "signature": "type WorkspaceRole", + "doc": "Resolve the union type of all possible workspace role string literals from WORKSPACE_ROLES array" + }, + { + "name": "workspaceRoleToCollaborationAccess", + "kind": "function", + "signature": "(role: \"viewer\" | \"editor\" | \"admin\" | \"owner\") => WorkspaceCollaborationAccess", + "doc": "Map a workspace role to the corresponding collaboration access level" + }, + { + "name": "workspaceRoleToSandboxRole", + "kind": "function", + "signature": "(role: \"viewer\" | \"editor\" | \"admin\" | \"owner\") => SandboxWorkspaceRole", + "doc": "Map a workspace role to its corresponding sandbox workspace role" + } + ] + }, + { + "id": "./teams-react", + "source": "src/teams-react/index.ts", + "dependsOn": [ + "teams" + ], + "error": null, + "exports": [ + { + "name": "InvitationsPanel", + "kind": "function", + "signature": "({ invitations, currentRole, onInvite, onResend, onRevoke, onCopy, onNotice, }: InvitationsPanelProps) => Element", + "doc": null + }, + { + "name": "InvitationsPanelProps", + "kind": "interface", + "signature": "interface InvitationsPanelProps", + "doc": "Define properties and callbacks for managing workspace invitations and user roles" + }, + { + "name": "InvitationView", + "kind": "interface", + "signature": "interface InvitationView", + "doc": "One invitation row as `InvitationsPanel` renders it — the shape `invitations-api` returns." + }, + { + "name": "InviteAcceptDetails", + "kind": "interface", + "signature": "interface InviteAcceptDetails", + "doc": "Describe details of an accepted invite including status, workspace, inviter, role, emails, and expiration" + }, + { + "name": "InviteAcceptPage", + "kind": "function", + "signature": "({ details, onAccept, onNavigate, onResendVerification }: InviteAcceptPageProps) => Element", + "doc": null + }, + { + "name": "InviteAcceptPageProps", + "kind": "interface", + "signature": "interface InviteAcceptPageProps", + "doc": "Define properties and callbacks for handling invite acceptance and navigation actions on the invite page" + }, + { + "name": "InviteAcceptStatus", + "kind": "type", + "signature": "type InviteAcceptStatus", + "doc": "Define possible statuses for the acceptance state of an invitation" + }, + { + "name": "MembersPanel", + "kind": "function", + "signature": "({ members, currentRole, onInvite, onChangeRole, onRemove, onNotice, showInviteForm, }: MembersPanelProps) => Element", + "doc": null + }, + { + "name": "MembersPanelProps", + "kind": "interface", + "signature": "interface MembersPanelProps", + "doc": "Define properties and callbacks for managing members and their roles in a workspace panel" + }, + { + "name": "MemberView", + "kind": "interface", + "signature": "interface MemberView", + "doc": "One member row as the panel renders it — the shape `members-api` returns." + } + ] + }, + { + "id": "./teams-react/lazy", + "source": "src/teams-react/lazy.tsx", + "dependsOn": [ + "teams" + ], + "error": null, + "exports": [ + { + "name": "InvitationsPanelLazy", + "kind": "function", + "signature": "LazyExoticComponent<({ invitations, currentRole, onInvite, onResend, onRevoke, onCopy, onNotice, }: InvitationsPanelPro…", + "doc": "Load InvitationsPanel component lazily to optimize initial rendering performance" + }, + { + "name": "InvitationsPanelProps", + "kind": "interface", + "signature": "interface InvitationsPanelProps", + "doc": "Define properties and callbacks for managing workspace invitations and user roles" + }, + { + "name": "InviteAcceptPageLazy", + "kind": "function", + "signature": "LazyExoticComponent<({ details, onAccept, onNavigate, onResendVerification }: InviteAcceptPageProps) => Element>", + "doc": "Load InviteAcceptPage component lazily for optimized code splitting and performance" + }, + { + "name": "InviteAcceptPageProps", + "kind": "interface", + "signature": "interface InviteAcceptPageProps", + "doc": "Define properties and callbacks for handling invite acceptance and navigation actions on the invite page" + }, + { + "name": "MembersPanelLazy", + "kind": "function", + "signature": "LazyExoticComponent<({ members, currentRole, onInvite, onChangeRole, onRemove, onNotice, showInviteForm, }: MembersPane…", + "doc": "Load MembersPanel component lazily to optimize initial rendering performance" + }, + { + "name": "MembersPanelProps", + "kind": "interface", + "signature": "interface MembersPanelProps", + "doc": "Define properties and callbacks for managing members and their roles in a workspace panel" + } + ] + }, + { + "id": "./teams/drizzle", + "source": "src/teams/drizzle.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "CreateAccessOptions", + "kind": "interface", + "signature": "interface CreateAccessOptions", + "doc": "Define options required to create access with database, tables, and workspace table references" + }, + { + "name": "createEnsurePersonalOrganization", + "kind": "function", + "signature": "(opts: CreatePersonalOrganizationOptions) => (user: EnsurePersonalOrganizationUser) => Promise OrganizationAccessApi", + "doc": "Resolve organization access API with specified database and table options" + }, + { + "name": "CreateOrganizationAccessOptions", + "kind": "interface", + "signature": "interface CreateOrganizationAccessOptions", + "doc": "Define options required to create access for an organization including database and tables" + }, + { + "name": "CreatePersonalOrganizationOptions", + "kind": "interface", + "signature": "interface CreatePersonalOrganizationOptions", + "doc": "Define options required to create a personal organization including database and tables references" + }, + { + "name": "createTeamTables", + "kind": "function", + "signature": "(opts: CreateTeamTablesOptions) => { organizations: SQLiteTableWithColumns<{ name: \"organization\"; schema: undefined; c…", + "doc": "Build SQLite tables for organizations and related team structures using provided options" + }, + { + "name": "CreateTeamTablesOptions", + "kind": "interface", + "signature": "interface CreateTeamTablesOptions", + "doc": "Define options specifying user and workspace tables for creating team-related tables" + }, + { + "name": "createWorkspaceAccess", + "kind": "function", + "signature": "(opts: CreateAccessOptions) => WorkspaceAccessApi", + "doc": "Create workspace access API to manage user roles and permissions within a workspace" + }, + { + "name": "createWorkspaceInvitationTable", + "kind": "function", + "signature": "(opts: CreateWorkspaceInvitationTableOptions) => { workspaceInvitations: SQLiteTableWithColumns<{ name: \"workspace_invi…", + "doc": "Build a workspace invitation table with defined columns and foreign key constraints" + }, + { + "name": "CreateWorkspaceInvitationTableOptions", + "kind": "interface", + "signature": "interface CreateWorkspaceInvitationTableOptions", + "doc": "Define options for creating a workspace invitation table with user, workspace, and organization references" + }, + { + "name": "EnsurePersonalOrganizationUser", + "kind": "interface", + "signature": "interface EnsurePersonalOrganizationUser", + "doc": "Define the structure for a user within a personal organization context" + }, + { + "name": "OrganizationAccess", + "kind": "interface", + "signature": "interface OrganizationAccess", + "doc": "Define access details linking an organization, its member, and the member's role" + }, + { + "name": "OrganizationAccessApi", + "kind": "interface", + "signature": "interface OrganizationAccessApi", + "doc": "Define methods to retrieve and enforce user access levels within an organization" + }, + { + "name": "OrganizationMemberRow", + "kind": "type", + "signature": "type OrganizationMemberRow", + "doc": "Resolve the structure of an organization member row from the team tables selection" + }, + { + "name": "OrganizationRow", + "kind": "type", + "signature": "type OrganizationRow", + "doc": "Resolve the structure of an organization row from the organizations table in TeamTables" + }, + { + "name": "PersonalOrganizationResult", + "kind": "interface", + "signature": "interface PersonalOrganizationResult", + "doc": "Describe a personal organization result including organization, member, and role details" + }, + { + "name": "TeamDatabase", + "kind": "type", + "signature": "type TeamDatabase", + "doc": "Any SQLite drizzle database — `any` erases driver-specific generics so better-sqlite3, D1, and libsql handles all fit." + }, + { + "name": "TeamParentTable", + "kind": "type", + "signature": "type TeamParentTable", + "doc": "A product table referenced by FK — only the `id` column is touched." + }, + { + "name": "TeamTables", + "kind": "type", + "signature": "type TeamTables", + "doc": "Resolve team tables by deriving the return type of createTeamTables" + }, + { + "name": "UserWorkspaceSummary", + "kind": "interface", + "signature": "interface UserWorkspaceSummary", + "doc": "Describe a user's workspace details including organization and role information" + }, + { + "name": "WorkspaceAccess", + "kind": "interface", + "signature": "interface WorkspaceAccess", + "doc": "Define access details including workspace data, organization info, member info, and role within workspace" + }, + { + "name": "WorkspaceAccessApi", + "kind": "interface", + "signature": "interface WorkspaceAccessApi", + "doc": "Define methods to retrieve and enforce user access permissions within workspaces" + }, + { + "name": "WorkspaceAccessTable", + "kind": "interface", + "signature": "interface WorkspaceAccessTable", + "doc": "The product's workspace table, narrowed to the columns the access joins read." + }, + { + "name": "WorkspaceInvitationRow", + "kind": "type", + "signature": "type WorkspaceInvitationRow", + "doc": "Resolve the structure of a workspace invitation row from the workspaceInvitations table" + }, + { + "name": "WorkspaceInvitationTables", + "kind": "type", + "signature": "type WorkspaceInvitationTables", + "doc": "Resolve the structure of workspace invitation tables from the creation function" + }, + { + "name": "WorkspaceMemberRow", + "kind": "type", + "signature": "type WorkspaceMemberRow", + "doc": "Resolve a workspace member row with selected fields from the workspaceMembers table" + } + ] + }, + { + "id": "./teams/invitations-api", + "source": "src/teams/invitations-api.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "createInvitationsApi", + "kind": "function", + "signature": "(opts: InvitationsApiOptions) => { createInvitation: (input: { workspaceId: string; email: string; permissions: string…", + "doc": "Build the invitations API bound to one product's db/tables/access/seams." + }, + { + "name": "EnforceSeatSeam", + "kind": "interface", + "signature": "interface EnforceSeatSeam", + "doc": "Optional billing seat gate." + }, + { + "name": "InvitationOutcome", + "kind": "type", + "signature": "type InvitationOutcome", + "doc": "Resolve the result of an invitation as success with a value or failure with status and error details" + }, + { + "name": "InvitationPreview", + "kind": "interface", + "signature": "interface InvitationPreview", + "doc": "Describe the structure of an invitation preview with workspace, email, permissions, status, and expiration details" + }, + { + "name": "InvitationsApiOptions", + "kind": "interface", + "signature": "interface InvitationsApiOptions", + "doc": "Define configuration options required to manage workspace invitations and related data sources" + }, + { + "name": "InvitationUserTable", + "kind": "interface", + "signature": "interface InvitationUserTable", + "doc": "The product's user table, narrowed to the columns the queries read." + }, + { + "name": "InvitationWorkspaceTable", + "kind": "interface", + "signature": "interface InvitationWorkspaceTable", + "doc": "The product's workspace table, narrowed to the columns the queries read." + }, + { + "name": "MemberSyncSeam", + "kind": "interface", + "signature": "interface MemberSyncSeam", + "doc": "Optional membership-change propagation to an external system (e.g." + }, + { + "name": "SeatLimitError", + "kind": "class", + "signature": "class SeatLimitError", + "doc": "Thrown by an `enforceSeat` seam to deny an invite; serialized to a 402." + }, + { + "name": "SendInvitationEmailInput", + "kind": "interface", + "signature": "interface SendInvitationEmailInput", + "doc": "The app's mail transport." + }, + { + "name": "SendInvitationEmailResult", + "kind": "type", + "signature": "type SendInvitationEmailResult", + "doc": "Represent the outcome of sending an invitation email with success status and optional error message" + }, + { + "name": "SendInvitationEmailSeam", + "kind": "interface", + "signature": "interface SendInvitationEmailSeam", + "doc": "Resolve sending an invitation email and return the result asynchronously" + }, + { + "name": "WorkspaceInvitationView", + "kind": "interface", + "signature": "interface WorkspaceInvitationView", + "doc": "Represent a workspace invitation with details about inviter, permissions, status, and timestamps" + } + ] + }, + { + "id": "./teams/members-api", + "source": "src/teams/members-api.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "createMembersApi", + "kind": "function", + "signature": "(opts: MembersApiOptions) => { listMembers: (input: { workspaceId: string; actor: MembersApiActor; }) => Promise SendInvitationEmailSeam", + "doc": "Build a `sendInvitationEmail` seam backed by Resend." + }, + { + "name": "ResendInvitationSenderOptions", + "kind": "interface", + "signature": "interface ResendInvitationSenderOptions", + "doc": "Define options for sending a resend invitation including sender address and optional API key" + } + ] + }, + { + "id": "./theme", + "source": "src/theme/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "AgentAppTheme", + "kind": "interface", + "signature": "interface AgentAppTheme", + "doc": "Typed mirror of tokens.css for runtime/JS theming." + }, + { + "name": "CanvasRenderPalette", + "kind": "interface", + "signature": "interface CanvasRenderPalette", + "doc": "Colors the Konva design-canvas paints directly." + }, + { + "name": "darkTheme", + "kind": "const", + "signature": "AgentAppTheme", + "doc": "Define a dark color scheme for the Agent app interface with specific background and foreground hues" + }, + { + "name": "lightTheme", + "kind": "const", + "signature": "AgentAppTheme", + "doc": "Define a light color theme with specific background, foreground, and accent color values" + }, + { + "name": "themeColor", + "kind": "function", + "signature": "(value: string) => string", + "doc": "Wrap a channel triple in `hsl()`; pass through values already in a color form." + }, + { + "name": "themeToCssVars", + "kind": "function", + "signature": "(theme: AgentAppTheme) => Record", + "doc": "Map a theme to the full CSS-variable set (shadcn triples + canvas/sequences aliases + canvas surface)." + } + ] + }, + { + "id": "./theme-contract", + "source": "src/theme-contract/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "checkThemeContract", + "kind": "function", + "signature": "(opts: ThemeContractOptions) => ThemeContractResult", + "doc": "Check that every theme token a consumer's source references is actually defined in the CSS that consumer ships." + }, + { + "name": "ThemeContractMiss", + "kind": "interface", + "signature": "interface ThemeContractMiss", + "doc": "Describe a missing theme contract variable and where it was referenced" + }, + { + "name": "ThemeContractOptions", + "kind": "interface", + "signature": "interface ThemeContractOptions", + "doc": "Define options for scanning source directories and CSS token files in a theme contract" + }, + { + "name": "ThemeContractResult", + "kind": "interface", + "signature": "interface ThemeContractResult", + "doc": "Describe the result of validating a theme contract including success status and missing items" + } + ] + }, + { + "id": "./theme-contract/cli", + "source": "src/theme-contract/cli.ts", + "dependsOn": [], + "error": null, + "exports": [] + }, + { + "id": "./theme/tailwind-preset", + "source": "src/theme/tailwind-preset.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "default", + "kind": "const", + "signature": "{ darkMode: [string, string]; theme: { extend: { colors: { background: string; foreground: string; border: string; inpu…", + "doc": "Define a preset configuration for dark mode and extended theme colors with foreground variants" + } + ] + }, + { + "id": "./tools", + "source": "src/tools/index.ts", + "dependsOn": [ + "crypto", + "eval" + ], + "error": null, + "exports": [ + { + "name": "AddCitationArgs", + "kind": "interface", + "signature": "interface AddCitationArgs", + "doc": "Define arguments required to add a citation including path, quote, and optional label" + }, + { + "name": "AddCitationResult", + "kind": "interface", + "signature": "interface AddCitationResult", + "doc": "Represent the result of adding a citation including its identifier and location path" + }, + { + "name": "APP_TOOL_NAMES", + "kind": "const", + "signature": "readonly [\"submit_proposal\", \"schedule_followup\", \"render_ui\", \"add_citation\"]", + "doc": "The four canonical app-tool names." + }, + { + "name": "AppToolContext", + "kind": "interface", + "signature": "interface AppToolContext", + "doc": "Server-set, trusted per-turn context." + }, + { + "name": "AppToolDefinition", + "kind": "interface", + "signature": "interface AppToolDefinition", + "doc": "A product-defined app tool — the open registration seam." + }, + { + "name": "AppToolHandlers", + "kind": "interface", + "signature": "interface AppToolHandlers", + "doc": "The domain seam." + }, + { + "name": "AppToolMcpServer", + "kind": "interface", + "signature": "interface AppToolMcpServer", + "doc": "The portable MCP server entry the sandbox SDK accepts (transport + url + headers)." + }, + { + "name": "AppToolName", + "kind": "type", + "signature": "type AppToolName", + "doc": "Resolve a valid application tool name from the predefined list of tool names" + }, + { + "name": "AppToolOutcome", + "kind": "type", + "signature": "type AppToolOutcome", + "doc": "Outcome of one tool dispatch — structurally identical to the agent-runtime tool-loop's `ToolCallOutcome`, so a dispatched outcome folds straight into the loop's `role: 'tool'` result message." + }, + { + "name": "AppToolProducedEvent", + "kind": "type", + "signature": "type AppToolProducedEvent", + "doc": "Produced-state events the runtime executor emits at the real side-effect site, so a consumer's eval/completion oracle credits a persisted proposal or artifact." + }, + { + "name": "AppToolRuntimeExecutor", + "kind": "type", + "signature": "type AppToolRuntimeExecutor", + "doc": "Executes an app-tool call the model emits on the agent-runtime chat path." + }, + { + "name": "AppToolTaxonomy", + "kind": "interface", + "signature": "interface AppToolTaxonomy", + "doc": "The product's proposal taxonomy — the only domain-specific vocabulary the generic layer needs (to validate `submit_proposal.type` and label the regulated subset)." + }, + { + "name": "AuthenticateOptions", + "kind": "interface", + "signature": "interface AuthenticateOptions", + "doc": "Define options to verify bearer tokens and customize authentication header names" + }, + { + "name": "authenticateToolRequest", + "kind": "function", + "signature": "(request: Request, opts: AuthenticateOptions) => Promise", + "doc": "Recover + verify the trusted context for a tool request." + }, + { + "name": "buildAppToolMcpServer", + "kind": "function", + "signature": "(opts: BuildMcpServerOptions) => AppToolMcpServer", + "doc": "Build one app-tool MCP server entry — a thin wrapper over {@link buildHttpMcpServer} that resolves the tool's route path." + }, + { + "name": "buildAppToolOpenAITools", + "kind": "function", + "signature": "(taxonomy: AppToolTaxonomy, opts?: BuildAppToolsOptions | undefined) => OpenAIFunctionTool[]", + "doc": "Build the four app tools in OpenAI function-tool shape." + }, + { + "name": "BuildAppToolsOptions", + "kind": "interface", + "signature": "interface BuildAppToolsOptions", + "doc": "Optional overrides for {@link buildAppToolOpenAITools }." + }, + { + "name": "buildHttpMcpServer", + "kind": "function", + "signature": "(opts: BuildHttpMcpServerOptions) => AppToolMcpServer", + "doc": "Build ONE HTTP MCP server entry — the generic agent→app bridge." + }, + { + "name": "BuildHttpMcpServerOptions", + "kind": "interface", + "signature": "interface BuildHttpMcpServerOptions", + "doc": "Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description" + }, + { + "name": "BuildMcpServerOptions", + "kind": "interface", + "signature": "interface BuildMcpServerOptions", + "doc": "Define configuration options required to build an MCP server including tool, baseUrl, token, and context" + }, + { + "name": "buildScopedMcpServerEntry", + "kind": "function", + "signature": "(opts: ScopedMcpServerEntryOptions & { label: string; defaultDescription: string; }) => AppToolMcpServer", + "doc": "Build the `AgentProfileMcpServer`-shaped entry for a scoped, per-resource MCP channel." + }, + { + "name": "CapabilityTokenOptions", + "kind": "interface", + "signature": "interface CapabilityTokenOptions", + "doc": "Define options for creating and verifying capability tokens including secret and prefix" + }, + { + "name": "createAppToolRuntimeExecutor", + "kind": "function", + "signature": "(opts: RuntimeExecutorOptions) => AppToolRuntimeExecutor", + "doc": "Build the runtime executor for one turn." + }, + { + "name": "createCapabilityToken", + "kind": "function", + "signature": "(userId: string, opts: CapabilityTokenOptions) => Promise", + "doc": "Mint a capability token for `userId`, or `undefined` when no secret is configured (fail-closed — the caller omits the MCP server rather than fake it)." + }, + { + "name": "createExpiringCapabilityToken", + "kind": "function", + "signature": "(subject: string, opts: ExpiringCapabilityTokenOptions) => Promise", + "doc": "Mint an EXPIRING capability token: `.` where the payload carries `{ sub, exp, n }` (subject, epoch-ms expiry, random nonce) and the signature is HMAC-SHA256 over the…" + }, + { + "name": "createMcpToolHandler", + "kind": "function", + "signature": ">(opts: CreateMcpToolHandlerOptions) => (request: Request) => Promise", + "doc": "Build a request handler for a tools-only MCP server." + }, + { + "name": "CreateMcpToolHandlerOptions", + "kind": "interface", + "signature": "interface CreateMcpToolHandlerOptions", + "doc": "Define options for creating a handler that manages MCP tools with environment support" + }, + { + "name": "customToolToOpenAI", + "kind": "function", + "signature": "(def: AppToolDefinition>) => OpenAIFunctionTool", + "doc": "The OpenAI function-tool def for a custom tool — appended to the built-ins by `buildAppToolOpenAITools`." + }, + { + "name": "DEFAULT_APP_TOOL_PATHS", + "kind": "const", + "signature": "Record<\"submit_proposal\" | \"schedule_followup\" | \"render_ui\" | \"add_citation\", string>", + "doc": "Default route path each app tool is served at." + }, + { + "name": "DEFAULT_HEADER_NAMES", + "kind": "const", + "signature": "ToolHeaderNames", + "doc": "Provide default HTTP header names for user, workspace, and thread identification" + }, + { + "name": "defineAppTool", + "kind": "function", + "signature": ">(def: AppToolDefinition) => AppToolDefinition", + "doc": "Validate + brand a product tool definition." + }, + { + "name": "dispatchAppTool", + "kind": "function", + "signature": "(toolName: string, rawArgs: Record, ctx: AppToolContext, opts: DispatchOptions) => Promise>[] | undefined) => AppToolDefinition Promise", + "doc": "Handle one app-tool HTTP request end to end — the sandbox MCP path." + }, + { + "name": "HandleToolRequestOptions", + "kind": "interface", + "signature": "interface HandleToolRequestOptions", + "doc": "Define options for handling tool requests including tool identification and token verification" + }, + { + "name": "isAppToolName", + "kind": "function", + "signature": "(name: string) => name is \"submit_proposal\" | \"schedule_followup\" | \"render_ui\" | \"add_citation\"", + "doc": "Determine if a string matches a valid application tool name" + }, + { + "name": "MCP_PROTOCOL_VERSIONS", + "kind": "const", + "signature": "readonly [\"2025-06-18\", \"2025-03-26\", \"2024-11-05\"]", + "doc": "Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server." + }, + { + "name": "McpProtocolVersion", + "kind": "type", + "signature": "type McpProtocolVersion", + "doc": "Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array" + }, + { + "name": "McpServerInfo", + "kind": "interface", + "signature": "interface McpServerInfo", + "doc": "Describe the structure of server information including name and version" + }, + { + "name": "McpToolDefinition", + "kind": "interface", + "signature": "interface McpToolDefinition", + "doc": "One tool entry in the registry the handler owns." + }, + { + "name": "OpenAIFunctionTool", + "kind": "interface", + "signature": "interface OpenAIFunctionTool", + "doc": "A minimal OpenAI Chat Completions function-tool shape — structurally compatible with `@tangle-network/agent-runtime`'s `OpenAIChatTool` without importing it (keeps this package runtime-free)." + }, + { + "name": "outcomeStatus", + "kind": "function", + "signature": "(outcome: { ok: false; code: string; message: string; status?: number | undefined; }) => number", + "doc": "HTTP status for a failed outcome — the handler's `ToolInputError.status` when present, else 400 for a validation reject." + }, + { + "name": "readToolArgs", + "kind": "function", + "signature": "(request: Request) => Promise", + "doc": "Read a tool's argument object from the request body, tolerant of MCP host aliases (`args` / `arguments`) or a bare body." + }, + { + "name": "RenderUiArgs", + "kind": "interface", + "signature": "interface RenderUiArgs", + "doc": "Define arguments required to render a UI including title and schema" + }, + { + "name": "RenderUiResult", + "kind": "interface", + "signature": "interface RenderUiResult", + "doc": "Describe the result of rendering UI including the artifact path and exact persisted content" + }, + { + "name": "ResolvedToolCapabilities", + "kind": "interface", + "signature": "interface ResolvedToolCapabilities", + "doc": "Describe resolved capabilities including proposal types and product tool groups to expose" + }, + { + "name": "resolveToolCapabilities", + "kind": "function", + "signature": "(opts: ResolveToolCapabilitiesOptions) => ResolvedToolCapabilities", + "doc": "Resolve an enabled capability-id set against a taxonomy into the concrete tool surface." + }, + { + "name": "ResolveToolCapabilitiesOptions", + "kind": "interface", + "signature": "interface ResolveToolCapabilitiesOptions", + "doc": "Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs" + }, + { + "name": "restrictTaxonomy", + "kind": "function", + "signature": "(taxonomy: AppToolTaxonomy, allowed: readonly string[]) => AppToolTaxonomy", + "doc": "Restrict a taxonomy to a subset of proposal types, intersecting the regulated subset too — the regulated label survives restriction, so a narrowed agent can never launder a regulated type into an unr…" + }, + { + "name": "RuntimeExecutorOptions", + "kind": "interface", + "signature": "interface RuntimeExecutorOptions", + "doc": "Define options for executing runtime tasks with a trusted per-turn context" + }, + { + "name": "ScheduleFollowupArgs", + "kind": "interface", + "signature": "interface ScheduleFollowupArgs", + "doc": "Define arguments required to schedule a follow-up with optional priority" + }, + { + "name": "ScheduleFollowupResult", + "kind": "interface", + "signature": "interface ScheduleFollowupResult", + "doc": "Define the result structure for scheduling a follow-up with unique identification and due date" + }, + { + "name": "ScopedMcpServerEntryOptions", + "kind": "interface", + "signature": "interface ScopedMcpServerEntryOptions", + "doc": "Options for a per-document/scoped MCP channel entry (design-canvas, sequences, …)." + }, + { + "name": "SubmitProposalArgs", + "kind": "interface", + "signature": "interface SubmitProposalArgs", + "doc": "Define the arguments required to submit a proposal including type, title, description, and approval status" + }, + { + "name": "SubmitProposalResult", + "kind": "interface", + "signature": "interface SubmitProposalResult", + "doc": "Describe the result of submitting a proposal including deduplication and execution status" + }, + { + "name": "ToolAuthResult", + "kind": "type", + "signature": "type ToolAuthResult", + "doc": "Represent the result of tool authentication with success context or failure response" + }, + { + "name": "ToolCapability", + "kind": "interface", + "signature": "interface ToolCapability", + "doc": "One toggleable tool group in a product's capability registry." + }, + { + "name": "ToolHeaderNames", + "kind": "interface", + "signature": "interface ToolHeaderNames", + "doc": "Header names carrying the server-set per-turn context + the capability token." + }, + { + "name": "ToolInputError", + "kind": "class", + "signature": "class ToolInputError", + "doc": "A correctable bad-input error a tool handler throws; the HTTP layer maps it to a 4xx with the code, the runtime layer to a failed tool_result." + }, + { + "name": "verifyCapabilityToken", + "kind": "function", + "signature": "(userId: string, token: string, opts: CapabilityTokenOptions) => Promise", + "doc": "Verify a capability token against `userId`." + }, + { + "name": "verifyExpiringCapabilityToken", + "kind": "function", + "signature": "(subject: string, token: string, opts: CapabilityTokenOptions & { now?: (() => number) | undefined; }) => Promise StepSpanContext", + "doc": "Derive a child span context under `parent` — one per step attempt (seed e.g." + }, + { + "name": "composeMissionFlowTrace", + "kind": "function", + "signature": "(input: { steps: MissionFlowStep[]; activity?: Record | undefined; startedAt?: number | un…", + "doc": "Compose a mission-wide FlowTrace: one 'pipeline' span per step, the step's delegated runs ('tool' spans, from `activity[stepId]`) beneath it." + }, + { + "name": "createMissionTraceContext", + "kind": "function", + "signature": "(missionId?: string | undefined) => MissionTraceContext", + "doc": "Mint a mission's trace context." + }, + { + "name": "delegationActivityToFlowSpans", + "kind": "function", + "signature": "(activity: StepAgentActivity[], turnStartMs: number, opts?: { nowMs?: number | undefined; } | undefined) => FlowSpan[]", + "doc": "One 'tool' FlowSpan per delegation, positioned relative to `turnStartMs` (the epoch-ms origin of the trace — usually the step or mission start)." + }, + { + "name": "DistributionSummary", + "kind": "interface", + "signature": "interface DistributionSummary", + "doc": "Summarize key statistics of a numerical distribution including count, min, percentiles, and max" + }, + { + "name": "FlowSpan", + "kind": "interface", + "signature": "interface FlowSpan", + "doc": "The shared FlowSpan / FlowTrace data shapes — the LEAF both the trace barrel (`./index`, which builds + renders them) and the delegation converters (`./mission-flow`, which emit them) import, so neit…" + }, + { + "name": "FlowTrace", + "kind": "interface", + "signature": "interface FlowTrace", + "doc": "Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls" + }, + { + "name": "LoopTraceEventLike", + "kind": "interface", + "signature": "interface LoopTraceEventLike", + "doc": "Structural mirror of agent-runtime's `LoopTraceEvent` — same fields, no import, so journals parsed from JSON feed straight in." + }, + { + "name": "loopTraceEventsToFlowSpans", + "kind": "function", + "signature": "(events: LoopTraceEventLike[]) => FlowSpan[]", + "doc": "Reconstruct one delegation's loop → round → iteration tree from its journaled LoopTraceEvents, as FlowSpans relative to `loop.started` (or the first event)." + }, + { + "name": "MissionFlowStep", + "kind": "interface", + "signature": "interface MissionFlowStep", + "doc": "Define a step in a mission flow with id, intent, optional status, start time, and duration" + }, + { + "name": "MissionTraceContext", + "kind": "interface", + "signature": "interface MissionTraceContext", + "doc": "Mission trace context — mint + thread the trace ids that join a mission's step attempts and its delegated agent runs into ONE trace tree." + }, + { + "name": "renderHistogram", + "kind": "function", + "signature": "(values: number[], opts?: { buckets?: number | undefined; width?: number | undefined; unit?: string | undefined; format…", + "doc": "ASCII histogram for multi-run samples (eval latencies, costs, scores)." + }, + { + "name": "renderWaterfall", + "kind": "function", + "signature": "(trace: FlowTrace, opts?: { width?: number | undefined; } | undefined) => string", + "doc": "ASCII waterfall cascade — the default artifact for explaining a flow." + }, + { + "name": "stepActivityFlowTrace", + "kind": "function", + "signature": "(activity: StepAgentActivity[], opts?: { startedAt?: number | undefined; nowMs?: number | undefined; } | undefined) =>…", + "doc": "A single step's activity lane as its own FlowTrace — what a per-step drill-in renders." + }, + { + "name": "StepSpanContext", + "kind": "interface", + "signature": "interface StepSpanContext", + "doc": "Define context information for a step span including trace, span, and parent span identifiers" + }, + { + "name": "summarize", + "kind": "function", + "signature": "(values: number[]) => DistributionSummary", + "doc": "Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max" + }, + { + "name": "TimedEvent", + "kind": "interface", + "signature": "interface TimedEvent", + "doc": "Represent a timed event with a timestamp and associated event data" + }, + { + "name": "timedEventsFromLines", + "kind": "function", + "signature": "(lines: string[]) => TimedEvent[]", + "doc": "Parse stored turn-event lines (JSON strings with `_t`) into TimedEvents." + }, + { + "name": "traceEnv", + "kind": "function", + "signature": "(ctx: MissionTraceContext | StepSpanContext) => { TRACE_ID: string; PARENT_SPAN_ID: string; }", + "doc": "The env pair a delegation subprocess inherits — agent-runtime's `readTraceContextFromEnv` reads exactly these names." + } + ] + }, + { + "id": "./turn-stream", + "source": "src/turn-stream/index.ts", + "dependsOn": [ + "chat-routes", + "stream" + ], + "error": null, + "exports": [ + { + "name": "acquireDurableTurnLock", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike, input: AcquireDurableTurnLockInput) => Promise", + "doc": "Acquire a durable turn lock in the specified namespace with given input parameters" + }, + { + "name": "AcquireDurableTurnLockInput", + "kind": "interface", + "signature": "interface AcquireDurableTurnLockInput", + "doc": "Define input parameters required to acquire a durable turn lock in a workspace thread context" + }, + { + "name": "activeTurnLock", + "kind": "function", + "signature": "(stored: DurableTurnLock | undefined, now: number) => DurableTurnLock | null", + "doc": "`stored` is what the DO read from storage; expired locks are dead." + }, + { + "name": "ACTIVITY_TTL_MS", + "kind": "const", + "signature": "number", + "doc": "A responding marker older than this is treated as stale, so a dropped `end` broadcast can't leave a permanently-stuck \"responding\" dot." + }, + { + "name": "appendSegmentEvent", + "kind": "function", + "signature": "(store: SegmentStore, executionId: string, incoming: TurnStreamEvent, maxEvents?: number) => TurnStreamEvent", + "doc": "Append a per-turn event to its execution's segment, assigning a monotonic `seq`." + }, + { + "name": "broadcastThreadCreated", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike, workspaceId: string, thread: { threadId: string; title: string; }) => Promise", + "doc": "Per-workspace marker that a new thread was created, so an already-open history list prepends it without a reload." + }, + { + "name": "broadcastTurnStreamEvent", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike, input: { workspaceId: string; threadId: string; executionId: string; event: { type…", + "doc": "Fan a turn event out to the per-thread channel." + }, + { + "name": "broadcastWorkspaceActivity", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike, workspaceId: string, threadId: string, phase: \"start\" | \"end\") => Promise", + "doc": "Coarse per-workspace marker that a thread's turn started / ended — drives a sidebar \"agent responding\" indicator subscribed once per workspace." + }, + { + "name": "createDurableObjectTurnEventStore", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike) => TurnEventStore", + "doc": "A {@link TurnEventStore} backed by {@link TurnStreamDO } storage — the production implementation of `createChatTurnRoutes`' `turnStore` seam for apps that don't run D1 for turn events (or want replay…" + }, + { + "name": "createDurableTurnLock", + "kind": "function", + "signature": "(options: CreateDurableTurnLockOptions) => { acquire(args: TurnLockSeamArgs): Promise<...…", + "doc": "The vertical's `turnLock` seam on the shared DO: dual-scope single-flight acquire (with one reconcile-then-retry pass when the product supplies a stale-lock reconciler) and cooperative release on set…" + }, + { + "name": "CreateDurableTurnLockOptions", + "kind": "interface", + "signature": "interface CreateDurableTurnLockOptions", + "doc": "Define options for creating a durable turn lock with customizable scope and identification methods" + }, + { + "name": "createMemoryTurnStreamHarness", + "kind": "function", + "signature": "(createInstance?: (state: TurnStreamDOState) => TurnStreamDO, _options?: TurnStreamDOOptions) => MemoryTurnStreamHarness", + "doc": "Build the harness." + }, + { + "name": "createSegmentStore", + "kind": "function", + "signature": "() => SegmentStore", + "doc": "Create a SegmentStore with initialized segments and no active execution ID" + }, + { + "name": "createTurnLock", + "kind": "function", + "signature": "(input: TurnLockAcquireInput, now: number, ttlMs?: number) => DurableTurnLock", + "doc": "Create a durable turn lock object with timing and scope based on input parameters" + }, + { + "name": "createTurnStreamUpgradeHandler", + "kind": "function", + "signature": "(options: CreateTurnStreamUpgradeHandlerOptions) => (request: Request) => Promise", + "doc": "The worker-entry WebSocket forwarder." + }, + { + "name": "CreateTurnStreamUpgradeHandlerOptions", + "kind": "interface", + "signature": "interface CreateTurnStreamUpgradeHandlerOptions", + "doc": "Define options for creating a TURN stream upgrade handler including namespace, path, and authorization logic" + }, + { + "name": "DurableTurnLock", + "kind": "interface", + "signature": "interface DurableTurnLock", + "doc": "The stored single-flight lock." + }, + { + "name": "interruptedReleaseApplies", + "kind": "function", + "signature": "(active: DurableTurnLock, input: { threadId: string; interruptedAt: number; turnId?: string | undefined; }) => boolean", + "doc": "The interrupted/stale release fence." + }, + { + "name": "isTerminalRunEvent", + "kind": "function", + "signature": "(type: string) => boolean", + "doc": "Terminal run markers: they close a turn segment and auto-release the channel's chat-turn lock for the segment's execution." + }, + { + "name": "MAX_RECENT_CREATED", + "kind": "const", + "signature": "50", + "doc": "Recent `thread.created` markers kept for late-connecting sidebars." + }, + { + "name": "MAX_SEGMENT_EVENTS", + "kind": "const", + "signature": "2000", + "doc": "Per-turn replay window." + }, + { + "name": "MemoryTurnStreamChannel", + "kind": "interface", + "signature": "interface MemoryTurnStreamChannel", + "doc": "Define an in-memory channel for streaming turn-based data with viewer socket connection support" + }, + { + "name": "MemoryTurnStreamHarness", + "kind": "interface", + "signature": "interface MemoryTurnStreamHarness", + "doc": "Provide an interface to manage channels and namespaces for memory-based turn stream testing" + }, + { + "name": "MemoryTurnStreamSocket", + "kind": "interface", + "signature": "interface MemoryTurnStreamSocket", + "doc": "A test-side viewer socket: records frames sent by the DO and lets the test drive the `sync` handshake." + }, + { + "name": "pruneStaleThreads", + "kind": "function", + "signature": "(active: Map, now: number, ttlMs: number) => string[]", + "doc": "Remove responding entries (threadId → startedAt) older than `ttlMs`, so a dropped `end` broadcast can't leave a permanently-stuck dot." + }, + { + "name": "reconcileStaleDurableTurnLock", + "kind": "function", + "signature": "(options: ReconcileStaleDurableTurnLockOptions) => Promise<{ released: boolean; diagnostics: Record; }>", + "doc": "`/chat-routes`' `reconcileStaleTurnLock` policy wired to the DO: the product supplies the probes (which box, what its session says), the policy decides, and a release lands as a FENCED interrupted re…" + }, + { + "name": "ReconcileStaleDurableTurnLockOptions", + "kind": "interface", + "signature": "interface ReconcileStaleDurableTurnLockOptions", + "doc": "Define options to reconcile stale durable turn locks with context, namespace, workspace, and active lock details" + }, + { + "name": "releaseDurableTurnLock", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike, input: TurnLockReleaseInput) => Promise<{ released: boolean; deferred?: boolean |…", + "doc": "Release a durable turn lock and indicate if the release was successful or deferred" + }, + { + "name": "releaseInterruptedDurableTurnLock", + "kind": "function", + "signature": "(namespace: TurnStreamNamespaceLike, input: ReleaseInterruptedDurableTurnLockInput) => Promise", + "doc": "Fenced out-of-band release — the DO refuses a successor lock (started after `interruptedAt`) and a turnId mismatch." + }, + { + "name": "ReleaseInterruptedDurableTurnLockInput", + "kind": "interface", + "signature": "interface ReleaseInterruptedDurableTurnLockInput", + "doc": "Define input parameters to release an interrupted durable turn lock in a workspace or thread" + }, + { + "name": "replayActiveSegment", + "kind": "function", + "signature": "(store: SegmentStore, afterSeq: number) => TurnStreamEvent[]", + "doc": "Events of the active, non-terminal turn with `seq > afterSeq` — what a (re)connecting client replays before going live." + }, + { + "name": "scopeIndexChannelKey", + "kind": "function", + "signature": "(scopeId: string) => string", + "doc": "Generate a unique channel key string based on the provided scope identifier" + }, + { + "name": "SegmentStore", + "kind": "interface", + "signature": "interface SegmentStore", + "doc": "Define a store managing segments and tracking the active execution identifier" + }, + { + "name": "threadChannelKey", + "kind": "function", + "signature": "(workspaceId: string, threadId: string) => string", + "doc": "Generate a unique string key combining workspace and thread identifiers" + }, + { + "name": "TURN_LOCK_TTL_MS", + "kind": "const", + "signature": "number", + "doc": "Default lifetime of an unreleased lock." + }, + { + "name": "TURN_STREAM_PATHS", + "kind": "const", + "signature": "{ readonly broadcast: \"/broadcast\"; readonly lockAcquire: \"/chat-turn-lock/acquire\"; readonly lockRelease: \"/chat-turn-…", + "doc": "Provide constant paths for managing chat turn streams and locks" + }, + { + "name": "TURN_STREAM_STORAGE_KEYS", + "kind": "const", + "signature": "{ readonly lock: \"chatTurnLock\"; readonly activeThreads: \"activeThreads\"; readonly turnStatus: \"turnStatus\"; readonly t…", + "doc": "Storage keys inside a DO instance." + }, + { + "name": "turnEventStorageKey", + "kind": "function", + "signature": "(seq: number) => string", + "doc": "Zero-padded seq so DO storage `list({ prefix })` returns rows in replay order without a sort." + }, + { + "name": "TurnLockAcquireInput", + "kind": "interface", + "signature": "interface TurnLockAcquireInput", + "doc": "Define input parameters required to acquire a turn-based lock in a workspace thread" + }, + { + "name": "TurnLockAcquireResult", + "kind": "type", + "signature": "type TurnLockAcquireResult", + "doc": "Resolve the result of attempting to acquire a turn lock indicating success or active lock status" + }, + { + "name": "turnLockChannelKey", + "kind": "function", + "signature": "(workspaceId: string, threadId: string, scope: TurnLockScope) => string", + "doc": "The channel a lock lives on: workspace-scope locks serialize every thread in the workspace (one shared sandbox), thread-scope locks serialize one thread (router lane)." + }, + { + "name": "TurnLockInterruptedReleaseInput", + "kind": "interface", + "signature": "interface TurnLockInterruptedReleaseInput", + "doc": "Fenced out-of-band release (stop button, stale-lock reconciliation)." + }, + { + "name": "turnLockMatchesRelease", + "kind": "function", + "signature": "(active: DurableTurnLock, input: { executionId: string; lockId?: string | undefined; }) => boolean", + "doc": "A cooperative release must present the lock's own identity — both the execution and the lockId minted at acquire — so a retry of a PREVIOUS turn can never release the current one." + }, + { + "name": "TurnLockReleaseInput", + "kind": "interface", + "signature": "interface TurnLockReleaseInput", + "doc": "Define input parameters required to release a turn lock in a specific workspace thread" + }, + { + "name": "TurnLockScope", + "kind": "type", + "signature": "type TurnLockScope", + "doc": "Define the scope level for acquiring a turn lock within thread or workspace contexts" + }, + { + "name": "TurnLockSeamArgs", + "kind": "interface", + "signature": "interface TurnLockSeamArgs", + "doc": "The subset of `ChatTurnProduceArgs` the lock adapter reads — structural, so this module needs no import from `/chat-routes/turn-routes` (which would drag the `agent-runtime` peer into every `/turn-st…" + }, + { + "name": "TurnLockSeamResult", + "kind": "type", + "signature": "type TurnLockSeamResult", + "doc": "Verdict shape of the vertical's `turnLock.acquire`." + }, + { + "name": "TurnSegment", + "kind": "interface", + "signature": "interface TurnSegment", + "doc": "Represent a segment of a turn containing events, sequence limit, and terminal status" + }, + { + "name": "turnStorageChannelKey", + "kind": "function", + "signature": "(turnId: string) => string", + "doc": "Generate a storage channel key string for a given turn identifier" + }, + { + "name": "TurnStreamDO", + "kind": "class", + "signature": "class TurnStreamDO", + "doc": "Manage per-turn segments and track active threads with durable event storage" + }, + { + "name": "TurnStreamDOOptions", + "kind": "interface", + "signature": "interface TurnStreamDOOptions", + "doc": "Define options to override default TTL and event limits for TURN stream DO operations" + }, + { + "name": "TurnStreamDOState", + "kind": "interface", + "signature": "interface TurnStreamDOState", + "doc": "The `DurableObjectState` surface the DO uses." + }, + { + "name": "TurnStreamEvent", + "kind": "interface", + "signature": "interface TurnStreamEvent", + "doc": "One event on a turn-stream channel." + }, + { + "name": "TurnStreamNamespaceLike", + "kind": "interface", + "signature": "interface TurnStreamNamespaceLike", + "doc": "The surface of `DurableObjectNamespace` the adapters use." + }, + { + "name": "TurnStreamSocket", + "kind": "interface", + "signature": "interface TurnStreamSocket", + "doc": "The socket surface the DO touches." + }, + { + "name": "TurnStreamStorage", + "kind": "interface", + "signature": "interface TurnStreamStorage", + "doc": "The storage surface the DO touches (Cloudflare `DurableObjectStorage` satisfies it structurally)." + }, + { + "name": "TurnStreamStubLike", + "kind": "interface", + "signature": "interface TurnStreamStubLike", + "doc": "Resolve a stub interface for handling fetch requests with optional initialization parameters" + }, + { + "name": "TurnStreamUpgradeAuthorization", + "kind": "type", + "signature": "type TurnStreamUpgradeAuthorization", + "doc": "Represent success or failure of a TURN stream upgrade authorization with optional response data" + }, + { + "name": "workspaceChannelKey", + "kind": "function", + "signature": "(workspaceId: string) => string", + "doc": "Generate a unique channel key based on the given workspace identifier" + } + ] + }, + { + "id": "./vault", + "source": "src/vault/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "ConfirmDialog", + "kind": "function", + "signature": "({ open, title, description, confirmLabel, cancelLabel, destructive, confirmDisabled, onConfirm, onCancel, children, }:…", + "doc": null + }, + { + "name": "ConfirmDialogProps", + "kind": "interface", + "signature": "interface ConfirmDialogProps", + "doc": null + }, + { + "name": "VaultArtifactRenderProps", + "kind": "interface", + "signature": "interface VaultArtifactRenderProps", + "doc": "Props the pane passes to the product's artifact renderer (e.g." + }, + { + "name": "VaultDataPort", + "kind": "interface", + "signature": "interface VaultDataPort", + "doc": "The data seam the product owns." + }, + { + "name": "VaultDockRenderProps", + "kind": "interface", + "signature": "interface VaultDockRenderProps", + "doc": "Props the pane passes to the product's optional dock renderer (e.g." + }, + { + "name": "VaultDockToggle", + "kind": "interface", + "signature": "interface VaultDockToggle", + "doc": "Configures the dock toggle VaultPane renders above the artifact pane." + }, + { + "name": "VaultEditorMode", + "kind": "type", + "signature": "type VaultEditorMode", + "doc": "The two editor surfaces the pane switches between for editable text files." + }, + { + "name": "VaultFile", + "kind": "interface", + "signature": "interface VaultFile", + "doc": "A loaded vault file: its text content plus optional preview hints." + }, + { + "name": "VaultMarkdownCodec", + "kind": "interface", + "signature": "interface VaultMarkdownCodec", + "doc": "Optional rich/source codec." + }, + { + "name": "VaultOperation", + "kind": "type", + "signature": "type VaultOperation", + "doc": "The Vault operation that failed at the product-owned data-port seam." + }, + { + "name": "VaultOperationFailure", + "kind": "interface", + "signature": "interface VaultOperationFailure", + "doc": "Structured failure reported to an optional host observer." + }, + { + "name": "VaultOperationPhase", + "kind": "type", + "signature": "type VaultOperationPhase", + "doc": "Whether the operation itself failed or a mutation succeeded but its follow-up tree refresh did not." + }, + { + "name": "VaultPane", + "kind": "function", + "signature": "(props: VaultPaneProps) => Element", + "doc": null + }, + { + "name": "VaultPaneProps", + "kind": "interface", + "signature": "interface VaultPaneProps", + "doc": "Define the properties and render methods for the vault pane UI components" + }, + { + "name": "VaultRichParts", + "kind": "type", + "signature": "type VaultRichParts", + "doc": "The parsed form of a file's rich content." + }, + { + "name": "VaultTreeNode", + "kind": "interface", + "signature": "interface VaultTreeNode", + "doc": "One node in the vault tree." + }, + { + "name": "VaultTreeRenderProps", + "kind": "interface", + "signature": "interface VaultTreeRenderProps", + "doc": "Props the pane passes to the product's tree renderer (e.g." + } + ] + }, + { + "id": "./vault/lazy", + "source": "src/vault/lazy.tsx", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "VaultPaneLazy", + "kind": "function", + "signature": "LazyExoticComponent<(props: VaultPaneProps) => Element>", + "doc": "Resolve VaultPane component lazily to optimize loading and improve performance" + }, + { + "name": "VaultPaneProps", + "kind": "interface", + "signature": "interface VaultPaneProps", + "doc": "Define the properties and render methods for the vault pane UI components" + } + ] + }, + { + "id": "./web", + "source": "src/web/index.ts", + "dependsOn": [], + "error": null, + "exports": [ + { + "name": "addSecurityHeaders", + "kind": "function", + "signature": "(response: Response, opts?: SecurityHeaderOptions) => Response", + "doc": "Set standard security headers on a response (HSTS, nosniff, frame-options, referrer-policy, XSS) + optional product disclaimer/retention." + }, + { + "name": "assertMediaUrl", + "kind": "function", + "signature": "(url: string, what?: string) => void", + "doc": "Canonical media-reference boundary shared by every surface that persists a media url (sequences clips, design-canvas image/video src)." + }, + { + "name": "checkRateLimit", + "kind": "function", + "signature": "(kv: KvLike, key: string, limit: number, windowSeconds: number) => Promise", + "doc": "KV-backed sliding-window rate limit." + }, + { + "name": "clearCookieHeader", + "kind": "function", + "signature": "(opts: Omit) => string", + "doc": "Set-Cookie header value that deletes the cookie (empty value, Max-Age=0)." + }, + { + "name": "CookieOptions", + "kind": "interface", + "signature": "interface CookieOptions", + "doc": "Define options for configuring cookie attributes and behavior" + }, + { + "name": "extractRequestContext", + "kind": "function", + "signature": "(request: Request) => RequestContext", + "doc": "Extract request context for audit trails." + }, + { + "name": "JsonObject", + "kind": "type", + "signature": "type JsonObject", + "doc": "Web-boundary utilities every agent app's routes hand-roll: JSON body parsing + narrowing, request-context extraction (real client IP behind Cloudflare), a KV-backed sliding-window rate limiter, and s…" + }, + { + "name": "KvLike", + "kind": "interface", + "signature": "interface KvLike", + "doc": "Minimal KV contract (Cloudflare `KVNamespace` satisfies it structurally)." + }, + { + "name": "parseJsonObjectBody", + "kind": "function", + "signature": "(request: Request) => Promise<[JsonObject, null] | [null, Response]>", + "doc": "Parse + object-narrow a Request body." + }, + { + "name": "RateLimitResult", + "kind": "interface", + "signature": "interface RateLimitResult", + "doc": "Describe the outcome of a rate limit check including allowance, remaining count, and reset time" + }, + { + "name": "readCookieValue", + "kind": "function", + "signature": "(cookieHeader: string | null, name: string) => string | null", + "doc": "Read + decode one cookie from a Cookie request header; null when absent." + }, + { + "name": "RequestContext", + "kind": "interface", + "signature": "interface RequestContext", + "doc": "Define the context of a request including IP address, user agent, timestamp, and request ID" + }, + { + "name": "requireString", + "kind": "function", + "signature": "(body: JsonObject, field: string) => string | Response", + "doc": "Narrow one required string field, 400 if missing/empty." + }, + { + "name": "SecurityHeaderOptions", + "kind": "interface", + "signature": "interface SecurityHeaderOptions", + "doc": "Define options for configuring security-related HTTP headers including disclaimers and retention labels" + }, + { + "name": "serializeCookie", + "kind": "function", + "signature": "(value: string, opts: CookieOptions) => string", + "doc": "Serialize a Set-Cookie header value: `name=encodeURIComponent(value)` plus attributes in Path / HttpOnly / SameSite / Max-Age / Secure order." + } + ] + }, + { + "id": "./web-react", + "source": "src/web-react/index.tsx", + "dependsOn": [ + "brand", + "chat-routes", + "chat-store", + "harness", + "interactions", + "missions", + "plans", + "runtime", + "trace" + ], + "error": null, + "exports": [ + { + "name": "activityTone", + "kind": "function", + "signature": "(status: string) => ActivityTone", + "doc": "Map a delegation status (free-form string on the wire) to a render tone." + }, + { + "name": "ActivityTone", + "kind": "type", + "signature": "type ActivityTone", + "doc": null + }, + { + "name": "AgentActivityPage", + "kind": "interface", + "signature": "interface AgentActivityPage", + "doc": null + }, + { + "name": "AgentActivityPanel", + "kind": "function", + "signature": "({ fetchActivity, renderMissionRef, title, emptyLabel }: AgentActivityPanelProps) => Element", + "doc": "The standalone cross-context delegation surface: every agent run the product journaled, mission-spawned or not, with status, cost, drill-in, and a mission link slot for promoted delegations." + }, + { + "name": "AgentActivityPanelProps", + "kind": "interface", + "signature": "interface AgentActivityPanelProps", + "doc": null + }, + { + "name": "AgentActivityRecord", + "kind": "interface", + "signature": "interface AgentActivityRecord", + "doc": "A delegation record on the cross-context surface; `missionRef` links a promoted delegation back to the mission/step that spawned it." + }, + { + "name": "AgentSessionControls", + "kind": "function", + "signature": "(props: AgentSessionControlsProps) => Element", + "doc": null + }, + { + "name": "AgentSessionControlsProps", + "kind": "interface", + "signature": "interface AgentSessionControlsProps", + "doc": null + }, + { + "name": "ATTACHMENT_ACCEPT", + "kind": "const", + "signature": "\"image/*,.pdf,.txt,.md,.csv,.json,.yaml,.yml,.html\"", + "doc": "Accept list for the composer file picker + type validation, same grammar as the native `` attribute." + }, + { + "name": "AttachmentFileResult", + "kind": "type", + "signature": "type AttachmentFileResult", + "doc": "Typed outcome of fetching one attachment's raw bytes." + }, + { + "name": "attachmentInputToPart", + "kind": "function", + "signature": "(input: ChatAttachmentInput) => ChatAttachmentPart", + "doc": "Drop absent/empty optional fields rather than persisting `undefined`/`''` — keeps stored parts minimal." + }, + { + "name": "attachmentKindForMime", + "kind": "function", + "signature": "(mime?: string | undefined) => ChatAttachmentKind", + "doc": "`image` for any `image/*` mime, `file` for everything else (including an absent/empty mime) — the same split the composer and the persisted-part discriminant both key on." + }, + { + "name": "attachmentPartKey", + "kind": "function", + "signature": "(path: string) => string", + "doc": "Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it." + }, + { + "name": "attachmentPartsFromMessageParts", + "kind": "function", + "signature": "(parts: readonly Record[] | null | undefined) => ChatAttachmentPart[]", + "doc": "Every attachment part on one message's stored `parts`, in stored order." + }, + { + "name": "base64WireLen", + "kind": "function", + "signature": "(byteLen: number) => number", + "doc": "Size a base64-encoded string occupies on the wire given the raw (pre-encoding) byte length: base64 packs 3 raw bytes into 4 output characters, rounded up to the next multiple of 4." + }, + { + "name": "buildAnswerData", + "kind": "function", + "signature": "(fields: ChatInteractionField[], values: FieldValues) => Record | null", + "doc": "All required fields answered → the respond payload; else null (not submittable yet)." + }, + { + "name": "buildMentionPromptBlock", + "kind": "function", + "signature": "(mentions: readonly Pick[]) => string", + "doc": "The agent-facing pointer block appended to the dispatched prompt — never persisted in message `content`." + }, + { + "name": "cancelChatInteraction", + "kind": "function", + "signature": "(list: ChatInteraction[], cancel: InteractionCancelData) => ChatInteraction[]", + "doc": "Applies an `interaction.cancel` event: only a pending ask moves, to `expired` (reason:\"timeout\") or `cancelled`." + }, + { + "name": "cancelStatusFor", + "kind": "function", + "signature": "(reason: string | undefined) => ChatInteractionStatus", + "doc": "Maps an `interaction.cancel` reason to the card's terminal status." + }, + { + "name": "canTransitionInteractionStatus", + "kind": "function", + "signature": "(from: ChatInteractionStatus, to: ChatInteractionStatus) => boolean", + "doc": "Statuses only move forward (pending → terminal); a replayed/stale `pending` must never resurrect a resolved card." + }, + { + "name": "CatalogModel", + "kind": "interface", + "signature": "interface CatalogModel", + "doc": "Define the structure and capabilities of a catalog item with optional pricing and feature flags" + }, + { + "name": "ChatAttachmentInput", + "kind": "interface", + "signature": "interface ChatAttachmentInput", + "doc": "`POST` turn-body entry describing a file already uploaded to the product's store (vault/object-store) — distinct from an inline {@link * ChatTurnFilePartInput} (which carries bytes) and from a {@link…" + }, + { + "name": "ChatAttachmentKind", + "kind": "type", + "signature": "type ChatAttachmentKind", + "doc": "The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (…" + }, + { + "name": "ChatAttachmentPart", + "kind": "interface", + "signature": "interface ChatAttachmentPart", + "doc": "Persisted attachment part: structurally an attachment-flavored `ChatFilePart` / `ChatImagePart` (`path` + `name` promoted to required) rather than a separate union member — see the section note above." + }, + { + "name": "ChatComposer", + "kind": "function", + "signature": "({ onSend, onSendParts, onCancel, isStreaming, disabled, placeholder, value, onValueChange, initialValue, seed, onSeedA…", + "doc": null + }, + { + "name": "ChatComposerProps", + "kind": "interface", + "signature": "interface ChatComposerProps", + "doc": null + }, + { + "name": "ChatEmptyDoor", + "kind": "interface", + "signature": "interface ChatEmptyDoor", + "doc": "One starting \"door\" in the chat first-run state — a concrete, labeled action (start from a template, do it by hand, ask the agent), not a placeholder." + }, + { + "name": "ChatEmptyState", + "kind": "function", + "signature": "({ productName, headline, subline, doors, }: ChatEmptyStateProps) => Element", + "doc": "Branded chat first-run state: the Tangle mark, a delegation-framed prompt, and up to three concrete doors." + }, + { + "name": "ChatEmptyStateProps", + "kind": "interface", + "signature": "interface ChatEmptyStateProps", + "doc": "Define properties for rendering the chat empty state with customizable text and starting doors" + }, + { + "name": "ChatInteraction", + "kind": "interface", + "signature": "interface ChatInteraction", + "doc": "The client/persisted view of one ask." + }, + { + "name": "ChatInteractionField", + "kind": "type", + "signature": "type ChatInteractionField", + "doc": "Resolve a chat interaction field excluding select types or including chat select fields" + }, + { + "name": "ChatInteractionRestoreMode", + "kind": "type", + "signature": "type ChatInteractionRestoreMode", + "doc": "Define modes for restoring chat interactions with legacy or durable strategies" + }, + { + "name": "ChatInteractionStatus", + "kind": "type", + "signature": "type ChatInteractionStatus", + "doc": "Define possible statuses representing the state of a chat interaction" + }, + { + "name": "ChatMentionKind", + "kind": "type", + "signature": "type ChatMentionKind", + "doc": "The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value." + }, + { + "name": "ChatMentionPart", + "kind": "interface", + "signature": "interface ChatMentionPart", + "doc": "A file the user `@`-mentioned on this turn: a workspace-relative path into the sandbox, never bytes." + }, + { + "name": "ChatMessageMetrics", + "kind": "interface", + "signature": "interface ChatMessageMetrics", + "doc": "Describe metrics related to a chat message including model, token counts, and duration" + }, + { + "name": "ChatMessages", + "kind": "function", + "signature": "({ messages, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, approval, onToolCallCl…", + "doc": "The message thread: one centered column; user messages are right-aligned bubbles with a User label; agent messages carry an Agent meta line with model id, tokens/sec, and cost, plus a collapsible thi…" + }, + { + "name": "ChatMessageSegment", + "kind": "type", + "signature": "type ChatMessageSegment", + "doc": "One ordered piece of an assistant turn: a run of answer text, or a tool call, in the sequence the agent emitted them." + }, + { + "name": "ChatMessagesProps", + "kind": "interface", + "signature": "interface ChatMessagesProps", + "doc": "Define properties for rendering chat messages with optional models, markdown, extras, and durable cards" + }, + { + "name": "ChatSelectField", + "kind": "type", + "signature": "type ChatSelectField", + "doc": "Extract select-type interaction fields and optionally allow custom values" + }, + { + "name": "ChatStreamCallbacks", + "kind": "interface", + "signature": "interface ChatStreamCallbacks", + "doc": "Define callbacks to handle events and data during a chat streaming session" + }, + { + "name": "ChatStreamToolCall", + "kind": "interface", + "signature": "interface ChatStreamToolCall", + "doc": "Define the structure for a chat tool call including optional ID, name, and arguments object" + }, + { + "name": "ChatStreamToolResult", + "kind": "interface", + "signature": "interface ChatStreamToolResult", + "doc": "Describe the result of a chat stream tool including its outcome and optional metadata fields" + }, + { + "name": "ChatToolCallInfo", + "kind": "interface", + "signature": "interface ChatToolCallInfo", + "doc": "Describe the structure and state of a tool call within a chat interaction" + }, + { + "name": "ChatTurnFilePartInput", + "kind": "interface", + "signature": "interface ChatTurnFilePartInput", + "doc": "A non-text prompt part the upload route hands back and the client echoes on send." + }, + { + "name": "ChatTurnPartInput", + "kind": "type", + "signature": "type ChatTurnPartInput", + "doc": "Resolve input as either a text part or a file part of a chat turn" + }, + { + "name": "chatTurnRequestInit", + "kind": "function", + "signature": "(payload: ChatTurnRequestPayload) => RequestInit", + "doc": "`fetch` init for the turn route — the one place the client wire shape is serialized, so composer glue and products never drift from the server's parser." + }, + { + "name": "ChatTurnRequestPayload", + "kind": "interface", + "signature": "interface ChatTurnRequestPayload", + "doc": "POST body for the turn route." + }, + { + "name": "ChatUiMessage", + "kind": "interface", + "signature": "interface ChatUiMessage", + "doc": "Describe the structure and properties of a chat message with roles, content, and optional metadata" + }, + { + "name": "composerAnswerData", + "kind": "function", + "signature": "(field: ChatInteractionField, text: string) => Record", + "doc": "Shapes composer text into the respond payload for the routed field (select answers are string arrays on the wire; text answers are strings)." + }, + { + "name": "composerAnswerDeliveries", + "kind": "function", + "signature": "(pending: ChatInteraction[]) => ComposerAnswerDelivery[]", + "doc": "One delivery per pending ask: the first free-text-capable field, else the first field." + }, + { + "name": "ComposerAnswerDelivery", + "kind": "interface", + "signature": "interface ComposerAnswerDelivery", + "doc": "Define the structure for delivering answers linked to a specific chat interaction and field" + }, + { + "name": "ComposerFile", + "kind": "interface", + "signature": "interface ComposerFile", + "doc": null + }, + { + "name": "ComposerFilePart", + "kind": "interface", + "signature": "interface ComposerFilePart", + "doc": "Prompt-part descriptor an uploaded file carries (the upload route's `UploadedChatFile.part`), echoed back in the turn body on send." + }, + { + "name": "ComposerMentionProp", + "kind": "interface", + "signature": "interface ComposerMentionProp", + "doc": "Mirrors sandbox-ui#184's `AgentComposerProps['mention']` shape — plug the hook's `mention` return value straight into that prop." + }, + { + "name": "consumeChatStream", + "kind": "function", + "signature": "(body: ReadableStream>, cb: ChatStreamCallbacks) => Promise", + "doc": "Drain one NDJSON body into the callbacks." + }, + { + "name": "ConsumeChatStreamResult", + "kind": "interface", + "signature": "interface ConsumeChatStreamResult", + "doc": "Represent the result of consuming a chat stream including turn ID and content reception status" + }, + { + "name": "createDurableInteractionAnswerSubmitter", + "kind": "function", + "signature": "(options: DurableInteractionAnswerSubmitterOptions) => SubmitInteractionAnswer", + "doc": "Answer submitter for a durable interaction route." + }, + { + "name": "createDurablePlanDecisionClient", + "kind": "function", + "signature": "(options: DurablePlanDecisionClientOptions) => DurablePlanDecisionClient", + "doc": "Browser client for the shared durable-plan route." + }, + { + "name": "createInteractionAnswerSubmitter", + "kind": "function", + "signature": "(options: InteractionAnswerSubmitterOptions) => SubmitInteractionAnswer", + "doc": "Builds the `SubmitInteractionAnswer` the cards consume: POSTs `{ ...routingFields, id, outcome, data?" + }, + { + "name": "createMemoryInteractionAttemptStore", + "kind": "function", + "signature": "() => InteractionAttemptStore", + "doc": "Create an in-memory store to manage interaction attempts keyed by ID and signature" + }, + { + "name": "createSessionInteractionAttemptStore", + "kind": "function", + "signature": "(storage: Pick, namespace?: string) => InteractionAttemptStore", + "doc": "Create a session-based store to manage interaction attempts using provided storage and optional namespace" + }, + { + "name": "dedupeQuestionInteractionsByContent", + "kind": "function", + "signature": "(interactions: ChatInteraction[]) => ChatInteraction[]", + "doc": "Remove duplicate question interactions based on their content signature to ensure uniqueness" + }, + { + "name": "DEFAULT_EFFORT_LEVELS", + "kind": "const", + "signature": "readonly EffortLevel[]", + "doc": null + }, + { + "name": "DEFAULT_MENTION_EMPTY_TEXT", + "kind": "const", + "signature": "\"No matching files\"", + "doc": "Popover empty-state copy for a `ready` index whose query matched nothing." + }, + { + "name": "DEFAULT_MENTION_LIMIT", + "kind": "const", + "signature": "20", + "doc": "Max popover results per query — enough to show a useful spread of matches without pushing the fuzzy-filtered list past what a popover can usefully render in one screen." + }, + { + "name": "DISPATCH_MAX_MEDIA_PARTS", + "kind": "const", + "signature": "24", + "doc": "Product-side cap on media parts per dispatch (current turn + carried history), well under {@link DISPATCH_MAX_PARTS}." + }, + { + "name": "DISPATCH_MAX_PARTS", + "kind": "const", + "signature": "64", + "doc": "Sidecar's hard cap on the `parts` array of one prompt request — a dispatch must never assemble more parts than this or the whole turn 400s." + }, + { + "name": "DISPATCH_REQUEST_MAX_BYTES", + "kind": "const", + "signature": "number", + "doc": "Hard cap on the whole `/prompt` request body as it crosses the sandbox proxy — smaller in practice than a raw-file write cap because a dispatch carries several inline parts plus the flattened history…" + }, + { + "name": "DISPATCH_STRUCTURAL_RESERVE_BYTES", + "kind": "const", + "signature": "number", + "doc": "Bytes reserved off the top of {@link DISPATCH_REQUEST_MAX_BYTES} for the JSON structure around the parts array (keys, delimiters, per-part `type`/`filename`/`mediaType` fields) that {@link base64Wire…" + }, + { + "name": "dispatchChatStreamLine", + "kind": "function", + "signature": "(line: string, cb: ChatStreamCallbacks) => { turnId?: string | undefined; receivedContent: boolean; }", + "doc": "Parse one NDJSON line into the callbacks." + }, + { + "name": "DurableChatCard", + "kind": "type", + "signature": "type DurableChatCard", + "doc": null + }, + { + "name": "DurableChatCards", + "kind": "function", + "signature": "({ parts, canWrite, submitInteraction, decidePlan, decidingPlan, planError, onInteractionResolved, onLateAnswer, onReRe…", + "doc": "Ready-to-embed canonical question/plan card lane for persisted assistant parts." + }, + { + "name": "durableChatCardsFromParts", + "kind": "function", + "signature": "(parts: Record[]) => DurableChatCard[]", + "doc": "Converts persisted/live parts to canonical cards." + }, + { + "name": "DurableChatCardsProps", + "kind": "interface", + "signature": "interface DurableChatCardsProps", + "doc": null + }, + { + "name": "DurableInteractionAnswerSubmitterOptions", + "kind": "interface", + "signature": "interface DurableInteractionAnswerSubmitterOptions", + "doc": "Define options for submitting durable interaction answers with attempt tracking and optional key creation" + }, + { + "name": "DurablePlanCard", + "kind": "function", + "signature": "({ plan, canWrite, decide, deciding, error, renderMarkdown, className, }: DurablePlanCardProps) => Element", + "doc": null + }, + { + "name": "DurablePlanCardProps", + "kind": "interface", + "signature": "interface DurablePlanCardProps", + "doc": null + }, + { + "name": "DurablePlanClientError", + "kind": "class", + "signature": "class DurablePlanClientError", + "doc": "Represent errors from DurablePlanClient operations including status, code, and current plan details" + }, + { + "name": "DurablePlanCurrentInput", + "kind": "interface", + "signature": "interface DurablePlanCurrentInput", + "doc": "Define input parameters for retrieving the current durable plan including optional revision number" + }, + { + "name": "DurablePlanDecision", + "kind": "type", + "signature": "type DurablePlanDecision", + "doc": "Represent durable plan decisions as either approved or rejected" + }, + { + "name": "DurablePlanDecisionClient", + "kind": "interface", + "signature": "interface DurablePlanDecisionClient", + "doc": "Define methods to obtain and decide durable plan decisions asynchronously" + }, + { + "name": "DurablePlanDecisionClientOptions", + "kind": "interface", + "signature": "interface DurablePlanDecisionClientOptions", + "doc": "Define configuration options for creating a durable plan decision client" + }, + { + "name": "DurablePlanDecisionInput", + "kind": "interface", + "signature": "interface DurablePlanDecisionInput", + "doc": "Define input parameters for making a durable plan decision including optional feedback" + }, + { + "name": "DurablePlanDecisionResult", + "kind": "interface", + "signature": "interface DurablePlanDecisionResult", + "doc": "Describe the result of a durable plan decision including plan details and pending statuses" + }, + { + "name": "DurablePlanFollowUpReceipt", + "kind": "interface", + "signature": "interface DurablePlanFollowUpReceipt", + "doc": "Stable authority receipt for the follow-up turn dispatched by a plan decision." + }, + { + "name": "EffortLevel", + "kind": "interface", + "signature": "interface EffortLevel", + "doc": "One reasoning-budget level: the engine `id` is unchanged (the value the product sends to the loop); only the user-facing `label` is renamed to the plainer \"how hard should it think\" vocabulary from d…" + }, + { + "name": "EffortPicker", + "kind": "function", + "signature": "({ value, onChange, levels, label }: EffortPickerProps) => Element", + "doc": "Thinking-budget selector pill, styled to match {@link ModelPicker}." + }, + { + "name": "EffortPickerProps", + "kind": "interface", + "signature": "interface EffortPickerProps", + "doc": null + }, + { + "name": "fieldAcceptsFreeText", + "kind": "function", + "signature": "(field: ChatInteractionField) => boolean", + "doc": "Determine if a chat interaction field allows free text input" + }, + { + "name": "fieldAnswer", + "kind": "function", + "signature": "(field: ChatInteractionField, values: FieldValues) => string | number | boolean | string[] | null", + "doc": "The submitted value for one field, or null when it has no answer yet." + }, + { + "name": "FieldValues", + "kind": "type", + "signature": "type FieldValues", + "doc": "Define a record mapping field names to objects with optional selected, text, and custom string arrays or values" + }, + { + "name": "fieldValuesFromAnswers", + "kind": "function", + "signature": "(fields: ChatInteractionField[], answers: InteractionAnswers | undefined) => FieldValues", + "doc": "Converts acknowledged, persisted answers back into the local field state consumed by the shared cards." + }, + { + "name": "FileIndexReadyResponse", + "kind": "interface", + "signature": "interface FileIndexReadyResponse", + "doc": "Describe a ready file index response with workspace-relative entries and truncation status" + }, + { + "name": "FileIndexResponse", + "kind": "type", + "signature": "type FileIndexResponse", + "doc": "Resolve a response indicating the file index is either ready or warming up" + }, + { + "name": "FileIndexWarmingResponse", + "kind": "interface", + "signature": "interface FileIndexWarmingResponse", + "doc": "Cold-box answer: no provisioning happened, no files were scanned." + }, + { + "name": "FileMention", + "kind": "interface", + "signature": "interface FileMention", + "doc": "A file mention resolved from the composer's `@`-picker: the workspace-relative path plus enough metadata to build a prompt part and pointer text." + }, + { + "name": "fileMentionsToParts", + "kind": "function", + "signature": "(mentions: readonly FileMention[], opts?: FileMentionsToPartsOptions) => ChatTurnFilePartInput[]", + "doc": "Maps resolved file mentions to path-only `ChatTurnFilePartInput`s — `image` vs `file` by extension, and always a `path`, never a `url` (the url/path XOR invariant: a mention is a sandbox path referen…" + }, + { + "name": "FlowWaterfall", + "kind": "function", + "signature": "({ trace }: FlowWaterfallProps) => Element | null", + "doc": "Compact proportional waterfall over a FlowTrace — span name, bar, duration per row; total + cost in the footer." + }, + { + "name": "FlowWaterfallProps", + "kind": "interface", + "signature": "interface FlowWaterfallProps", + "doc": null + }, + { + "name": "formatActivityCost", + "kind": "function", + "signature": "(costUsd?: number | undefined) => string | null", + "doc": "\"$0.4000\" under a cent shows 4 decimals; null when unknown/zero." + }, + { + "name": "formatActivityDuration", + "kind": "function", + "signature": "(durationMs?: number | undefined) => string | null", + "doc": "\"8s\" / \"2m 05s\" / \"1h 12m\"; null when unknown." + }, + { + "name": "formatModelCost", + "kind": "function", + "signature": "(msg: ChatMessageMetrics, models: CatalogModel[]) => string | null", + "doc": "\"$0.0042\" from token counts × catalogue per-token pricing; null when unknown." + }, + { + "name": "formatTokensPerSecond", + "kind": "function", + "signature": "(msg: ChatMessageMetrics) => string | null", + "doc": "\"38 tok/s\" from completion tokens over first-token→end duration; null when unknown." + }, + { + "name": "hasSecretField", + "kind": "function", + "signature": "(fields: ChatInteractionField[]) => boolean", + "doc": "Secrets must never leave the sidecar answer channel for the visible chat transcript, so a secret-bearing ask cannot be late-answered." + }, + { + "name": "hydrateChatInteractions", + "kind": "function", + "signature": "(list: ChatInteraction[], persisted: ChatInteraction[]) => ChatInteraction[]", + "doc": "Applies transcript/state-store projections after reload." + }, + { + "name": "INDEX_REFRESH_AFTER_MS", + "kind": "const", + "signature": "number", + "doc": "How long a `ready` index is served before a background refetch — long enough that a full session's worth of popover opens don't repeatedly hit the index endpoint, short enough that a stale listing do…" + }, + { + "name": "INTERACTION_CANCEL_EVENT", + "kind": "const", + "signature": "\"interaction.cancel\"", + "doc": "Sidecar → client: the ask was withdrawn; data = `{ id, reason?" + }, + { + "name": "INTERACTION_EVENT", + "kind": "const", + "signature": "\"interaction\"", + "doc": "Sidecar → client: the agent raised an ask; data = `{ request }`." + }, + { + "name": "INTERACTION_RESOLVED_EVENT", + "kind": "const", + "signature": "\"interaction.resolved\"", + "doc": "An ask was answered; data = `{ id, status }`." + }, + { + "name": "INTERACTION_SUBMIT_TIMEOUT_MESSAGE", + "kind": "const", + "signature": "\"Could not reach the agent. Try again.\"", + "doc": "Provide the timeout message displayed when the agent cannot be reached during interaction submission" + }, + { + "name": "INTERACTION_SUBMIT_TIMEOUT_MS", + "kind": "const", + "signature": "30000", + "doc": "Define the timeout duration in milliseconds for submitting an interaction" + }, + { + "name": "InteractionActionButton", + "kind": "function", + "signature": "({ variant, onClick, disabled, children, }: { variant?: \"primary\" | \"outline\" | undefined; onClick: () => void; disable…", + "doc": null + }, + { + "name": "InteractionAnswers", + "kind": "type", + "signature": "type InteractionAnswers", + "doc": "Map interaction identifiers to their corresponding answer values" + }, + { + "name": "InteractionAnswerSubmission", + "kind": "interface", + "signature": "interface InteractionAnswerSubmission", + "doc": "One card submission: which ask, resolved how, with what answers." + }, + { + "name": "InteractionAnswerSubmitterOptions", + "kind": "interface", + "signature": "interface InteractionAnswerSubmitterOptions", + "doc": "Define options for submitting interaction answers including URL, body, timeout, and fetch implementation" + }, + { + "name": "InteractionAnswerValue", + "kind": "type", + "signature": "type InteractionAnswerValue", + "doc": "Accepted answer values." + }, + { + "name": "InteractionAttemptStore", + "kind": "interface", + "signature": "interface InteractionAttemptStore", + "doc": "Manage storage and retrieval of interaction attempt keys by interaction and submission identifiers" + }, + { + "name": "InteractionBadge", + "kind": "function", + "signature": "({ variant, children }: { variant: InteractionBadgeVariant; children: string; }) => Element", + "doc": null + }, + { + "name": "InteractionBadgeVariant", + "kind": "type", + "signature": "type InteractionBadgeVariant", + "doc": null + }, + { + "name": "InteractionCancelData", + "kind": "interface", + "signature": "interface InteractionCancelData", + "doc": "Describe data required to cancel an interaction including its identifier and optional reason" + }, + { + "name": "InteractionData", + "kind": "type", + "signature": "type InteractionData", + "doc": null + }, + { + "name": "interactionFromWireRequest", + "kind": "function", + "signature": "(request: InteractionRequestWire) => ChatInteraction", + "doc": "Reads a wire request into the client's pending `ChatInteraction`." + }, + { + "name": "InteractionOutcome", + "kind": "type", + "signature": "type InteractionOutcome", + "doc": null + }, + { + "name": "interactionPartKey", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Generate a unique key string for an interaction using the given identifier" + }, + { + "name": "InteractionPersistedPart", + "kind": "type", + "signature": "type InteractionPersistedPart", + "doc": "Persisted-part shapes the codecs below produce — the SAME rows `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the source so a product pushing them into a `ChatMessagePart[]` t…" + }, + { + "name": "InteractionPlanCard", + "kind": "function", + "signature": "({ interaction, canWrite, submitAnswer, onResolved, onReRequest, reRequestLabel, renderMarkdown, className, }: Interact…", + "doc": null + }, + { + "name": "InteractionPlanCardProps", + "kind": "interface", + "signature": "interface InteractionPlanCardProps", + "doc": null + }, + { + "name": "InteractionQuestionCard", + "kind": "function", + "signature": "({ interaction, canWrite, submitAnswer, onResolved, onLateAnswer, className, }: InteractionQuestionCardProps) => Element", + "doc": null + }, + { + "name": "InteractionQuestionCardProps", + "kind": "interface", + "signature": "interface InteractionQuestionCardProps", + "doc": null + }, + { + "name": "InteractionRequest", + "kind": "type", + "signature": "type InteractionRequest", + "doc": null + }, + { + "name": "InteractionRequestWire", + "kind": "type", + "signature": "type InteractionRequestWire", + "doc": "`InteractionRequest` whose select fields may carry `allowCustom`." + }, + { + "name": "interactionStatusLabels", + "kind": "function", + "signature": "(labels: { pending: string; answered: string; declined: string; }) => Record", + "doc": "Status-badge labels for an interaction card." + }, + { + "name": "interactionSubmissionSignature", + "kind": "function", + "signature": "(submission: InteractionAnswerSubmission) => string", + "doc": "Generate a stable string signature from an interaction answer submission" + }, + { + "name": "InteractionSubmitResult", + "kind": "type", + "signature": "type InteractionSubmitResult", + "doc": "Resolve the result of an interaction submission indicating success or failure with details" + }, + { + "name": "interactionTerminalNotes", + "kind": "function", + "signature": "(noun: string, extra?: Partial> | undefined) => Partial part is ChatAttachmentPart", + "doc": "True for any `image`/`file` part carrying a non-empty string `path`." + }, + { + "name": "isLateAnswerableStatus", + "kind": "function", + "signature": "(status: ChatInteractionStatus) => boolean", + "doc": "Determine if a status is late answerable by checking if it is expired or cancelled" + }, + { + "name": "isRenderableInteractionKind", + "kind": "function", + "signature": "(kind: string) => boolean", + "doc": "Resolve if the given interaction kind is renderable within the application context" + }, + { + "name": "isSafeInteractionFieldKey", + "kind": "function", + "signature": "(key: string) => boolean", + "doc": "Answer/field keys the sidecar will accept: identifier-safe and never a prototype-pollution vector." + }, + { + "name": "isTerminalInteractionStatus", + "kind": "function", + "signature": "(status: ChatInteractionStatus) => boolean", + "doc": "Resolve if the interaction status is a terminal state excluding pending" + }, + { + "name": "lateAnswerMessage", + "kind": "function", + "signature": "(interaction: ChatInteraction, data: Record) => string", + "doc": "Renders the late answer as a self-contained chat message: the original question, its context, and the user's answer(s)." + }, + { + "name": "loadAttachmentFile", + "kind": "function", + "signature": "(url: string, fetchFile?: (url: string) => Promise) => Promise", + "doc": "Fetches (and caches) the raw bytes behind one attachment url." + }, + { + "name": "mediaTypeForMentionPath", + "kind": "function", + "signature": "(path: string) => string | undefined", + "doc": "The `image/*` mime for a mention path by extension, or `undefined` for anything not in the known image set (dispatched as `type: 'file'`)." + }, + { + "name": "mentionInputToPart", + "kind": "function", + "signature": "(input: FileMention) => ChatMentionPart", + "doc": "A validated wire mention (`parseFileMentions` in `/chat-routes`) as the part the turn route persists." + }, + { + "name": "MentionItem", + "kind": "interface", + "signature": "interface MentionItem", + "doc": "Mirrors sandbox-ui#184's `MentionItem` — the atomic pill's payload." + }, + { + "name": "mentionKindForPath", + "kind": "function", + "signature": "(path: string) => ChatMentionKind", + "doc": "`image` when the path's extension is in the known image set (the same table {@link mediaTypeForMentionPath} reads), `file` otherwise." + }, + { + "name": "mentionPartsFromMessageParts", + "kind": "function", + "signature": "(parts: readonly Record[] | readonly ChatMessagePart[] | null | undefined) => ChatMentionPart[]", + "doc": "Every mention part on one message, in stored order." + }, + { + "name": "MentionTextSegment", + "kind": "interface", + "signature": "interface MentionTextSegment", + "doc": "One run of a segmented message: literal prose, or a matched mention with the part that produced it." + }, + { + "name": "mergeActivityPages", + "kind": "function", + "signature": "(existing: AgentActivityRecord[], incoming: AgentActivityRecord[]) => AgentActivityRecord[]", + "doc": "Fold a fetched page into the held rows: dedupe by `taskId` with the incoming row winning (a refresh re-fetches the head page, so newer snapshots of in-flight runs replace stale ones), newest `started…" + }, + { + "name": "MessageAttachments", + "kind": "function", + "signature": "({ parts, resolveFileUrl, justify, fetchFile }: MessageAttachmentsProps) => ReactNode", + "doc": "Renders a message's attachment parts as a row of image thumbnails and file chips." + }, + { + "name": "MessageAttachmentsProps", + "kind": "interface", + "signature": "interface MessageAttachmentsProps", + "doc": null + }, + { + "name": "MissionActivityLane", + "kind": "function", + "signature": "({ activity, startedAt, nowMs }: MissionActivityLaneProps) => Element | null", + "doc": "Collapsed sub-rows under a mission step — one row per delegated run — expanding to the step's waterfall." + }, + { + "name": "MissionActivityLaneProps", + "kind": "interface", + "signature": "interface MissionActivityLaneProps", + "doc": null + }, + { + "name": "ModelPicker", + "kind": "function", + "signature": "({ value, onChange, models, loading, renderProviderBadge, recommendedLabel, priorityGroup }: ModelPickerProps) => Eleme…", + "doc": "Searchable model picker pill + popover: a featured/recommended section first, then per-provider groups in catalogue order (the server already sorts providers by tier)." + }, + { + "name": "ModelPickerProps", + "kind": "interface", + "signature": "interface ModelPickerProps", + "doc": null + }, + { + "name": "nextRevealCount", + "kind": "function", + "signature": "(shown: number, targetLength: number, dtMs: number, opts?: SmoothRevealOptions) => number", + "doc": "Pure reveal step: how many characters should be visible after `dtMs`." + }, + { + "name": "NoticeKind", + "kind": "type", + "signature": "type NoticeKind", + "doc": "Define specific string literals representing different kinds of notices" + }, + { + "name": "noticePart", + "kind": "function", + "signature": "(noticeKind: NoticeKind, id: string, text: string) => NoticePersistedPart", + "doc": "Builds the persisted/streamed `notice` part — a one-line transcript notice explaining an out-of-band event (warning, auto-declined interaction)." + }, + { + "name": "noticePartKey", + "kind": "function", + "signature": "(id: string) => string", + "doc": "Generate a unique key string for a notice using the given identifier" + }, + { + "name": "NoticePersistedPart", + "kind": "type", + "signature": "type NoticePersistedPart", + "doc": "Define a persisted notice part with type, id, kind, and text properties" + }, + { + "name": "parseInteractionAnswers", + "kind": "function", + "signature": "(value: unknown) => ParseInteractionAnswersResult", + "doc": "Strictly validates and copies persisted answer selections." + }, + { + "name": "ParseInteractionAnswersResult", + "kind": "type", + "signature": "type ParseInteractionAnswersResult", + "doc": "Resolve the result of parsing interaction answers with success status and corresponding data or error message" + }, + { + "name": "parseInteractionCancel", + "kind": "function", + "signature": "(data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;…", + "doc": "Parse interaction cancel data and return success status with parsed value or error message" + }, + { + "name": "parseInteractionRequest", + "kind": "function", + "signature": "(data: Record | undefined) => ParseInteractionResult", + "doc": "Parses an `interaction` event's data (`{ request }`)." + }, + { + "name": "ParseInteractionResult", + "kind": "type", + "signature": "type ParseInteractionResult", + "doc": "Resolve interaction parsing outcome as success with value or failure with error message" + }, + { + "name": "pendingApprovalOf", + "kind": "function", + "signature": "(call: ChatToolCallInfo) => { proposalId: string; } | null", + "doc": "Extract `{proposalId, status}` from a tool outcome when it is a proposal awaiting human approval; null otherwise." + }, + { + "name": "persistedPartToInteraction", + "kind": "function", + "signature": "(part: Record) => ChatInteraction | null", + "doc": "Reads a persisted/streamed `interaction` part back into a `ChatInteraction`." + }, + { + "name": "ProducerErrorEvent", + "kind": "interface", + "signature": "interface ProducerErrorEvent", + "doc": "Represent an error event emitted by a producer containing message, code, and optional details" + }, + { + "name": "ProducerNoticeEvent", + "kind": "interface", + "signature": "interface ProducerNoticeEvent", + "doc": "Define the structure for a producer notice event with type, id, kind, and text fields" + }, + { + "name": "ProducerPassthroughEvent", + "kind": "interface", + "signature": "interface ProducerPassthroughEvent", + "doc": "Define an event carrying passthrough data with flexible properties for producer communication" + }, + { + "name": "ProducerPassthroughEventType", + "kind": "type", + "signature": "type ProducerPassthroughEventType", + "doc": "Stable raw lifecycle/interaction/plan/route events forwarded unchanged." + }, + { + "name": "ProducerReasoningEvent", + "kind": "interface", + "signature": "interface ProducerReasoningEvent", + "doc": "Define an event representing reasoning output with a fixed type and associated text" + }, + { + "name": "ProducerTextEvent", + "kind": "interface", + "signature": "interface ProducerTextEvent", + "doc": "Represent a text event produced by a source with a fixed type and associated text content" + }, + { + "name": "ProducerToolCallEvent", + "kind": "interface", + "signature": "interface ProducerToolCallEvent", + "doc": "Represent an event triggered by a producer tool call with its identifier, name, and arguments" + }, + { + "name": "ProducerToolResultEvent", + "kind": "interface", + "signature": "interface ProducerToolResultEvent", + "doc": "Describe the structure of an event representing the result of a producer tool call" + }, + { + "name": "ProducerUsageEvent", + "kind": "interface", + "signature": "interface ProducerUsageEvent", + "doc": "Describe usage event with prompt and completion token counts for a producer" + }, + { + "name": "ProducerWireEvent", + "kind": "type", + "signature": "type ProducerWireEvent", + "doc": "Represent events emitted by a producer during its operation for processing and handling" + }, + { + "name": "ProposalApprovalHandlers", + "kind": "interface", + "signature": "interface ProposalApprovalHandlers", + "doc": "Handle approval and rejection actions for proposals with asynchronous support" + }, + { + "name": "ProviderLogo", + "kind": "function", + "signature": "({ provider, size }: ProviderLogoProps) => ReactNode", + "doc": "Real brand mark when we have one; tinted monogram otherwise." + }, + { + "name": "ProviderLogoProps", + "kind": "interface", + "signature": "interface ProviderLogoProps", + "doc": null + }, + { + "name": "questionInteractionContentSignature", + "kind": "function", + "signature": "(interaction: ChatInteraction) => string | null", + "doc": "Content identity for duplicate safety nets." + }, + { + "name": "QuestionOptionList", + "kind": "function", + "signature": "({ groupName, idPrefix, options, multi, selectedValues, disabled, onToggle, }: QuestionOptionListProps) => Element", + "doc": "The radio/checkbox option rows for a select field." + }, + { + "name": "QuestionOptionListProps", + "kind": "interface", + "signature": "interface QuestionOptionListProps", + "doc": null + }, + { + "name": "rankFileMentions", + "kind": "function", + "signature": "(files: readonly FileMention[], query: string, limit: number) => FileMention[]", + "doc": "Ranks `files` against `query` (case-insensitive), capped to `limit`: name-prefix matches first, then name-substring, then path-substring." + }, + { + "name": "resolveChatInteraction", + "kind": "function", + "signature": "(list: ChatInteraction[], id: string, status: \"answered\" | \"declined\" | \"cancelled\" | \"expired\", answers?: InteractionA…", + "doc": "Marks one ask resolved locally (the card's `onResolved`)." + }, + { + "name": "responseErrorMessage", + "kind": "function", + "signature": "(res: Response) => Promise<{ code?: string | undefined; message: string; }>", + "doc": "Extracts the most specific error message a route returned." + }, + { + "name": "restoreChatInteractions", + "kind": "function", + "signature": "(list: ChatInteraction[], outstanding: InteractionRequestWire[], options?: RestoreChatInteractionsOptions) => ChatInter…", + "doc": "Reload restore from the answer route's GET list." + }, + { + "name": "RestoreChatInteractionsOptions", + "kind": "interface", + "signature": "interface RestoreChatInteractionsOptions", + "doc": "Define options to control how chat interactions are restored during the restore process" + }, + { + "name": "RunDrillIn", + "kind": "function", + "signature": "({ run, onClose }: RunDrillInProps) => Element", + "doc": "Readonly side panel showing a retained tool run's transcript — the \"drill into what the sandbox actually did\" view." + }, + { + "name": "RunDrillInProps", + "kind": "interface", + "signature": "interface RunDrillInProps", + "doc": "Define properties required to run a drill and handle its closure event" + }, + { + "name": "SandboxTerminalConnection", + "kind": "interface", + "signature": "interface SandboxTerminalConnection", + "doc": "Define the connection details and status for a sandbox terminal session" + }, + { + "name": "SandboxTerminalConnectionResponse", + "kind": "interface", + "signature": "interface SandboxTerminalConnectionResponse", + "doc": "Define the response structure for a sandbox terminal connection including URLs, token, status, and errors" + }, + { + "name": "SeatPaywall", + "kind": "function", + "signature": "({ product, onCheckout, priceUsd, includedUsageUsd, tagline, ctaLabel, benefits, footnote, }: SeatPaywallProps) => Reac…", + "doc": "Centered card paywall." + }, + { + "name": "SeatPaywallProps", + "kind": "interface", + "signature": "interface SeatPaywallProps", + "doc": null + }, + { + "name": "segmentMentionContent", + "kind": "function", + "signature": "(content: string, parts: readonly ChatMentionPart[]) => { segments: MentionTextSegment[]; matched: Set…", + "doc": "Split a message's text into plain-text and mention segments by matching `@` runs against that message's own mention parts." + }, + { + "name": "SmoothRevealOptions", + "kind": "interface", + "signature": "interface SmoothRevealOptions", + "doc": "Define configuration options for controlling smooth text reveal animation rates" + }, + { + "name": "stampInteractionAnswers", + "kind": "function", + "signature": "(parts: Record[], answersByInteractionId: Readonly>) => Record Promise", + "doc": "Run one chat turn with automatic single-shot resume: if the transport drops mid-turn and the server announced a turnId, reset and replay the buffered turn." + }, + { + "name": "SubmitInteractionAnswer", + "kind": "type", + "signature": "type SubmitInteractionAnswer", + "doc": "The cards' only side-effect seam: POST one resolution, report the normalized outcome." + }, + { + "name": "tabTerminalConnectionId", + "kind": "function", + "signature": "(storageKey?: string) => string", + "doc": "Stable-per-tab, unique-per-client terminal connection id." + }, + { + "name": "terminalizePendingChatInteractions", + "kind": "function", + "signature": "(list: ChatInteraction[], status: \"answered\" | \"expired\") => ChatInteraction[]", + "doc": "Settles every still-pending ask when the turn ends: `answered` for a turn that completed cleanly, `expired` for one that failed." + }, + { + "name": "ToolDetailRenderers", + "kind": "type", + "signature": "type ToolDetailRenderers", + "doc": "Per-tool custom detail renderers for the expanded card body — keyed by tool name." + }, + { + "name": "ToolRunRecord", + "kind": "interface", + "signature": "interface ToolRunRecord", + "doc": "A retained tool run keyed by the parent message's toolCallId." + }, + { + "name": "ToolRunStep", + "kind": "interface", + "signature": "interface ToolRunStep", + "doc": "One step of a retained tool run (e.g." + }, + { + "name": "triggerAttachmentDownload", + "kind": "function", + "signature": "(name: string, blob: Blob) => { ok: true; } | { ok: false; message: string; }", + "doc": "Drives an anchor-click download from an already-resolved blob." + }, + { + "name": "upsertChatInteraction", + "kind": "function", + "signature": "(list: ChatInteraction[], interaction: ChatInteraction) => ChatInteraction[]", + "doc": "Insert or update one interaction." + }, + { + "name": "useChatInteractions", + "kind": "function", + "signature": "(options?: RestoreChatInteractionsOptions) => UseChatInteractionsResult", + "doc": "Manage chat interactions state with upsert, cancel, resolve, and restore capabilities" + }, + { + "name": "UseChatInteractionsOptions", + "kind": "type", + "signature": "type UseChatInteractionsOptions", + "doc": "Resolve options for restoring chat interactions from previous sessions" + }, + { + "name": "UseChatInteractionsResult", + "kind": "interface", + "signature": "interface UseChatInteractionsResult", + "doc": "Resolve and manage chat interactions with methods to update, cancel, mark resolved, and restore state" + }, + { + "name": "useComposerAttachments", + "kind": "function", + "signature": "(options: UseComposerAttachmentsOptions) => UseComposerAttachmentsResult", + "doc": "Owns the composer's attachment lifecycle: validate selected/dropped/pasted files against the shared limits, upload each accepted file to the product's store (one request per file), and track every fi…" + }, + { + "name": "UseComposerAttachmentsOptions", + "kind": "interface", + "signature": "interface UseComposerAttachmentsOptions", + "doc": "Define options for configuring file upload behavior and handling in a composer component" + }, + { + "name": "UseComposerAttachmentsResult", + "kind": "interface", + "signature": "interface UseComposerAttachmentsResult", + "doc": "Provide staged file chips, ready attachments, and methods to add, retry, or drop composer files" + }, + { + "name": "useDurablePlanFlow", + "kind": "function", + "signature": "(options: UseDurablePlanFlowOptions) => UseDurablePlanFlowResult", + "doc": "Shared plan decision controller." + }, + { + "name": "UseDurablePlanFlowOptions", + "kind": "interface", + "signature": "interface UseDurablePlanFlowOptions", + "doc": "Define options to configure durable plan flow with plan, client, and optional callbacks" + }, + { + "name": "UseDurablePlanFlowResult", + "kind": "interface", + "signature": "interface UseDurablePlanFlowResult", + "doc": "Define the result and actions for managing a durable plan flow including decisions, restoration, and error handling" + }, + { + "name": "useFileMentions", + "kind": "function", + "signature": "(options: UseFileMentionsOptions) => UseFileMentionsResult", + "doc": "Resolve and manage file mention data with configurable fetching and state handling" + }, + { + "name": "UseFileMentionsOptions", + "kind": "interface", + "signature": "interface UseFileMentionsOptions", + "doc": "Define options for configuring file mention fetching, caching, and display behavior" + }, + { + "name": "UseFileMentionsResult", + "kind": "interface", + "signature": "interface UseFileMentionsResult", + "doc": "Provide properties and methods to manage and refresh file mentions in a composer interface" + }, + { + "name": "usePending", + "kind": "function", + "signature": "() => { pending: boolean; run: (action: () => void | Promise) => void; }", + "doc": "Guard an async action against double-submit." + }, + { + "name": "usePopover", + "kind": "function", + "signature": "(open: boolean, setOpen: (open: boolean) => void) => { containerRef: RefObject; triggerRef: RefO…", + "doc": "Keyboard + pointer model for a trigger-and-popover pair, dependency-free." + }, + { + "name": "useSandboxTerminalConnection", + "kind": "function", + "signature": "(opts: UseSandboxTerminalConnectionOptions) => UseSandboxTerminalConnectionResult", + "doc": "Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling" + }, + { + "name": "UseSandboxTerminalConnectionOptions", + "kind": "interface", + "signature": "interface UseSandboxTerminalConnectionOptions", + "doc": "Define options for configuring a sandbox terminal connection including workspace ID and connection parameters" + }, + { + "name": "UseSandboxTerminalConnectionResult", + "kind": "interface", + "signature": "interface UseSandboxTerminalConnectionResult", + "doc": "Resolve sandbox terminal connection status and provide a method to initiate the connection" + }, + { + "name": "useSmoothText", + "kind": "function", + "signature": "(target: string, enabled: boolean, opts?: SmoothRevealOptions | undefined) => string", + "doc": "Animate `target` text into view." + }, + { + "name": "useThinkingSeconds", + "kind": "function", + "signature": "(active: boolean) => number", + "doc": "Whole seconds elapsed while `active`, ticking once a second." + }, + { + "name": "waterfallLayout", + "kind": "function", + "signature": "(trace: FlowTrace) => WaterfallRow[]", + "doc": "Project a FlowTrace into proportional bar geometry for {@link FlowWaterfall}." + }, + { + "name": "WaterfallRow", + "kind": "interface", + "signature": "interface WaterfallRow", + "doc": null + } + ] + }, + { + "id": "./web-react/terminal", + "source": "src/web-react/terminal.ts", + "dependsOn": [ + "brand", + "chat-routes", + "chat-store", + "harness", + "interactions", + "missions", + "plans", + "runtime", + "trace" + ], + "error": null, + "exports": [ + { + "name": "SandboxTerminalConnection", + "kind": "interface", + "signature": "interface SandboxTerminalConnection", + "doc": "Define the connection details and status for a sandbox terminal session" + }, + { + "name": "SandboxTerminalConnectionResponse", + "kind": "interface", + "signature": "interface SandboxTerminalConnectionResponse", + "doc": "Define the response structure for a sandbox terminal connection including URLs, token, status, and errors" + }, + { + "name": "tabTerminalConnectionId", + "kind": "function", + "signature": "(storageKey?: string) => string", + "doc": "Stable-per-tab, unique-per-client terminal connection id." + }, + { + "name": "TerminalStatusDisplay", + "kind": "interface", + "signature": "interface TerminalStatusDisplay", + "doc": null + }, + { + "name": "TerminalStatusTone", + "kind": "type", + "signature": "type TerminalStatusTone", + "doc": null + }, + { + "name": "useSandboxTerminalConnection", + "kind": "function", + "signature": "(opts: UseSandboxTerminalConnectionOptions) => UseSandboxTerminalConnectionResult", + "doc": "Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling" + }, + { + "name": "UseSandboxTerminalConnectionOptions", + "kind": "interface", + "signature": "interface UseSandboxTerminalConnectionOptions", + "doc": "Define options for configuring a sandbox terminal connection including workspace ID and connection parameters" + }, + { + "name": "UseSandboxTerminalConnectionResult", + "kind": "interface", + "signature": "interface UseSandboxTerminalConnectionResult", + "doc": "Resolve sandbox terminal connection status and provide a method to initiate the connection" + }, + { + "name": "WorkspaceTerminalPanel", + "kind": "function", + "signature": "({ connection, connectionId, title, subtitle, isActive, onRetry, statusDisplay, headerExtra, className, }: WorkspaceTer…", + "doc": null + }, + { + "name": "WorkspaceTerminalPanelProps", + "kind": "interface", + "signature": "interface WorkspaceTerminalPanelProps", + "doc": null + } + ] + } + ] +} diff --git a/docs/llms-full.txt b/docs/llms-full.txt new file mode 100644 index 0000000..bcd5404 --- /dev/null +++ b/docs/llms-full.txt @@ -0,0 +1,25186 @@ +# agent-app — full API surface + +> Application-shell framework for Tangle agent products: a bounded tool loop, the structured agent→app tool side channel, integration-hub client, per-workspace billing, and crypto — composed over the Tangle agent substrate through typed seams. + +_Generated by agent-docs from tsup.config `entry`; 73 entries, every export with its signature. Regenerate with `agent-docs`._ + +## `.` + +Source: `src/index.ts` · depends on `assets`, `assistant`, `billing`, `brand`, `brand-extraction`, `chat-routes`, `chat-store`, `config`, `crypto`, `design-canvas`, `design-canvas-react`, `durable-chat`, `eval`, `eval-campaign`, `harness`, `intakes`, `intakes-react`, `integrations`, `interactions`, `knowledge`, `knowledge-loop`, `missions`, `model-resolution`, `object-store`, `plans`, `platform`, `preflight`, `preset-cloudflare`, `profile`, `prompt`, `redact`, `run`, `runtime`, `sandbox`, `sequences`, `sequences-react`, `skills`, `skills-placement`, `store`, `stream`, `studio`, `studio-react`, `tangle`, `teams`, `teams-react`, `theme`, `theme-contract`, `tools`, `trace`, `turn-stream`, `vault`, `web`, `web-react` + +### `AddCitationArgs` + +`interface` — Define arguments required to add a citation including path, quote, and optional label + +```ts +interface AddCitationArgs +``` + +### `AddCitationResult` + +`interface` — Represent the result of adding a citation including its identifier and location path + +```ts +interface AddCitationResult +``` + +### `addSecurityHeaders` + +`function` — Set standard security headers on a response (HSTS, nosniff, frame-options, referrer-policy, XSS) + optional product disclaimer/retention. + +```ts +(response: Response, opts?: SecurityHeaderOptions) => Response +``` + +### `AgentAppConfig` + +`interface` — The declarative domain surface of a Tangle agent product. + +```ts +interface AgentAppConfig +``` + +### `agentAppConfigJsonSchema` + +`const` — Machine-readable JSON Schema (draft 2020-12) for {@link AgentAppConfig}. + +```ts +{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://tangle.tools/schemas/agent-a… +``` + +### `AgentAppTheme` + +`interface` — Typed mirror of tokens.css for runtime/JS theming. + +```ts +interface AgentAppTheme +``` + +### `AgentIdentityConfig` + +`interface` — Who the agent is, as data. + +```ts +interface AgentIdentityConfig +``` + +### `AgentIntegrationsConfig` + +`interface` — Which integrations the product enables, as data. + +```ts +interface AgentIntegrationsConfig +``` + +### `AgentKnowledgeConfig` + +`interface` — The knowledge surface, as data. + +```ts +interface AgentKnowledgeConfig +``` + +### `AgentRuntime` + +`interface` — Resolve and stream tool execution loops with final results and intermediate events for agent runtime + +```ts +interface AgentRuntime +``` + +### `AgentRuntimeModelConfig` + +`interface` — OpenAI-compatible model endpoint (Tangle Router / tcloud / any compat provider). + +```ts +interface AgentRuntimeModelConfig +``` + +### `AgentTaxonomyConfig` + +`interface` — The proposal taxonomy, as data. + +```ts +interface AgentTaxonomyConfig +``` + +### `AgentTurnOptions` + +`interface` — Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers + +```ts +interface AgentTurnOptions +``` + +### `AgentUiConfig` + +`interface` — UI capability flags, as data. + +```ts +interface AgentUiConfig +``` + +### `AnySurfaceKind` + +`type` — The variance-erased form a registry accepts (`build` is contravariant in `TCtx`, so every concrete definition is assignable to this). + +```ts +type AnySurfaceKind +``` + +### `APP_TOOL_NAMES` + +`const` — The four canonical app-tool names. + +```ts +readonly ["submit_proposal", "schedule_followup", "render_ui", "add_citation"] +``` + +### `applyDurableInteractionAnswer` + +`function` — Resolve and record the outcome and answers of a durable interaction within the given store and scope + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: "declined" | "accepted", answers?: R… +``` + +### `applyDurableInteractionAsk` + +`function` — Resolve and upsert a durable interaction ask in the store with optional event and timing parameters + +```ts +(store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde… +``` + +### `applyDurableInteractionCancel` + +`function` — Resolve cancellation of a durable interaction with optional reason and event details + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… +``` + +### `applyMissionEvent` + +`function` — Fold one event into one mission's state. + +```ts +(prev: MissionState | undefined, event: MissionStreamEvent) => MissionState +``` + +### `ApprovalEvent` + +`interface` — Describe an approval event with action details, user info, and optional edited fields + +```ts +interface ApprovalEvent +``` + +### `ApprovalEventSchema` + +`const` — Validate approval event data including asset, action, user, timestamp, and optional fields + +```ts +ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEnum<{ scheduled: "scheduled"; approved:… +``` + +### `AppToolContext` + +`interface` — Server-set, trusted per-turn context. + +```ts +interface AppToolContext +``` + +### `AppToolDefinition` + +`interface` — A product-defined app tool — the open registration seam. + +```ts +interface AppToolDefinition +``` + +### `AppToolDescriptor` + +`interface` — Describe an application tool with its name, unique key, and description + +```ts +interface AppToolDescriptor +``` + +### `AppToolHandlers` + +`interface` — The domain seam. + +```ts +interface AppToolHandlers +``` + +### `AppToolLoopOptions` + +`interface` + +```ts +interface AppToolLoopOptions +``` + +### `AppToolMcpServer` + +`interface` — The portable MCP server entry the sandbox SDK accepts (transport + url + headers). + +```ts +interface AppToolMcpServer +``` + +### `AppToolName` + +`type` — Resolve a valid application tool name from the predefined list of tool names + +```ts +type AppToolName +``` + +### `AppToolOutcome` + +`type` — Outcome of one tool dispatch — structurally identical to the agent-runtime tool-loop's `ToolCallOutcome`, so a dispatched outcome folds straight into the loop's `role: 'tool'` result message. + +```ts +type AppToolOutcome +``` + +### `AppToolProducedEvent` + +`type` — Produced-state events the runtime executor emits at the real side-effect site, so a consumer's eval/completion oracle credits a persisted proposal or artifact. + +```ts +type AppToolProducedEvent +``` + +### `AppToolRuntimeExecutor` + +`type` — Executes an app-tool call the model emits on the agent-runtime chat path. + +```ts +type AppToolRuntimeExecutor +``` + +### `AppToolTaxonomy` + +`interface` — The product's proposal taxonomy — the only domain-specific vocabulary the generic layer needs (to validate `submit_proposal.type` and label the regulated subset). + +```ts +interface AppToolTaxonomy +``` + +### `asMissionStreamEvent` + +`function` — Narrow an arbitrary channel payload to a MissionStreamEvent. + +```ts +(value: unknown) => MissionStreamEvent | null +``` + +### `asRecord` + +`function` — Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined + +```ts +(value: unknown) => JsonRecord | undefined +``` + +### `assertEnvWithinLimits` + +`function` — Throw when any single env value exceeds {@link ENV_VALUE_MAX_BYTES} or the whole env block exceeds {@link ENV_TOTAL_MAX_BYTES}, naming the offending variable. + +```ts +(env: Record) => void +``` + +### `assertHarnessModelCompatible` + +`function` — Fail-loud server guard: throw when a harness is asked to run a model it can't. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `assertMediaUrl` + +`function` — Canonical media-reference boundary shared by every surface that persists a media url (sequences clips, design-canvas image/video src). + +```ts +(url: string, what?: string) => void +``` + +### `assertProvisionPayloadWithinCap` + +`function` — Throw when the serialized provision payload exceeds {@link PROVISION_PAYLOAD_MAX_BYTES}. + +```ts +(payload: ProvisionPayloadSections) => void +``` + +### `assertSafeKeySegment` + +`function` — Assert a single object-key path SEGMENT (an operator id, customer id, or upload id) is safe to interpolate into a key, and return it. + +```ts +(s: string) => string +``` + +### `AssetContentMap` + +`type` — Map asset keys to their corresponding content types for various media and copy formats + +```ts +type AssetContentMap +``` + +### `AssetFormat` + +`type` — Define valid asset format strings for various media and copy types + +```ts +type AssetFormat +``` + +### `AssetSpec` + +`interface` — Define the structure and metadata for an asset including its format, brand, content, and status + +```ts +interface AssetSpec +``` + +### `AssetStatus` + +`type` — Define possible states representing the lifecycle status of an asset + +```ts +type AssetStatus +``` + +### `AssetVariant` + +`interface` — Describe an asset variant with identification, approval status, and edit history details + +```ts +interface AssetVariant +``` + +### `asString` + +`function` — Resolve a non-empty string from a value or return undefined + +```ts +(value: unknown) => string | undefined +``` + +### `attachmentInputToPart` + +`function` — Drop absent/empty optional fields rather than persisting `undefined`/`''` — keeps stored parts minimal. + +```ts +(input: ChatAttachmentInput) => ChatAttachmentPart +``` + +### `attachmentKindForMime` + +`function` — `image` for any `image/*` mime, `file` for everything else (including an absent/empty mime) — the same split the composer and the persisted-part discriminant both key on. + +```ts +(mime?: string | undefined) => ChatAttachmentKind +``` + +### `attachmentPartKey` + +`function` — Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it. + +```ts +(path: string) => string +``` + +### `attachmentPartsFromMessageParts` + +`function` — Every attachment part on one message's stored `parts`, in stored order. + +```ts +(parts: readonly Record[] | null | undefined) => ChatAttachmentPart[] +``` + +### `attachReasoningEffort` + +`function` — Attach a specified reasoning effort level to an agent profile for a given harness + +```ts +(profile: AgentProfile, harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-dro… +``` + +### `AuthenticatedSandboxUser` + +`interface` — Represent an authenticated user within a sandbox environment with a unique identifier + +```ts +interface AuthenticatedSandboxUser +``` + +### `AuthenticateOptions` + +`interface` — Define options to verify bearer tokens and customize authentication header names + +```ts +interface AuthenticateOptions +``` + +### `authenticateToolRequest` + +`function` — Recover + verify the trusted context for a tool request. + +```ts +(request: Request, opts: AuthenticateOptions) => Promise +``` + +### `bearerSubprotocolToken` + +`function` — Resolve and decode a bearer token from a comma-separated subprotocol string or return null + +```ts +(value: string | null) => string | null +``` + +### `bearerToken` + +`function` — Extract the token from a bearer authorization string or return null if invalid or missing + +```ts +(value: string | null) => string | null +``` + +### `BeforeInteractionAnswerArgs` + +`interface` — Describe the arguments provided before processing an interaction answer including request, body, and connection details + +```ts +interface BeforeInteractionAnswerArgs +``` + +### `BrandTokens` + +`interface` — Define brand identity tokens including colors, font, logo, business name, and voice + +```ts +interface BrandTokens +``` + +### `BrandTokensSchema` + +`const` — Validate brand token properties including colors, font, logo URL, business name, and voice + +```ts +ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodString; fontFamily: ZodString; logoUrl: ZodO… +``` + +### `BrokerToken` + +`interface` — A single-use hub bearer minted from a durable grant — mirrors `@tangle-network/agent-integrations`'s `BrokerToken`. + +```ts +interface BrokerToken +``` + +### `BrokerTokenMinter` + +`interface` — The one method the provider needs — `TangleAppsClient` satisfies it structurally, so `createBrokerTokenProvider({ client: tangleAppsClient, … })` type-checks without importing the concrete class. + +```ts +interface BrokerTokenMinter +``` + +### `BrokerTokenProvider` + +`interface` — Provide and refresh broker bearer tokens, allowing forced token invalidation + +```ts +interface BrokerTokenProvider +``` + +### `BrokerTokenProviderOptions` + +`interface` — Define options for configuring a broker token provider including client credentials and token management settings + +```ts +interface BrokerTokenProviderOptions +``` + +### `budgetGateProposalId` + +`function` — Deterministic proposal id for a budget-overrun override. + +```ts +(missionId: string, stepId: string) => string +``` + +### `BufferedTurnEvent` + +`interface` — Represent a buffered turn event with a sequence number and serialized event data + +```ts +interface BufferedTurnEvent +``` + +### `BufferedTurnOptions` + +`interface` — Define options for buffering and flushing turn events with optional live client delivery and event coalescing + +```ts +interface BufferedTurnOptions +``` + +### `BufferedTurnTap` + +`interface` — A push-driven buffer for a turn whose producer the caller does NOT own. + +```ts +interface BufferedTurnTap +``` + +### `buildAgentMissionPlan` + +`function` — Materialize parsed steps into the engine's MissionStep[] shape. + +```ts +(steps: ParsedMissionStep[]) => MissionStep[] +``` + +### `buildAppToolMcpServer` + +`function` — Build one app-tool MCP server entry — a thin wrapper over {@link buildHttpMcpServer} that resolves the tool's route path. + +```ts +(opts: BuildMcpServerOptions) => AppToolMcpServer +``` + +### `buildAppToolMcpServers` + +`function` — Build a mapping of MCP server profiles keyed by tool identifiers from provided options + +```ts +(options: BuildAppToolMcpServersOptions) => Record +``` + +### `BuildAppToolMcpServersOptions` + +`interface` — Define options for building MCP server configurations in the app tool environment + +```ts +interface BuildAppToolMcpServersOptions +``` + +### `buildAppToolOpenAITools` + +`function` — Build the four app tools in OpenAI function-tool shape. + +```ts +(taxonomy: AppToolTaxonomy, opts?: BuildAppToolsOptions | undefined) => OpenAIFunctionTool[] +``` + +### `BuildAppToolsOptions` + +`interface` — Optional overrides for {@link buildAppToolOpenAITools }. + +```ts +interface BuildAppToolsOptions +``` + +### `buildAttachmentPromptBlock` + +`function` — The agent-facing pointer block appended to the dispatched prompt — never persisted in `message.content`. + +```ts +(atts: readonly Pick[], header?: string) => string +``` + +### `buildCatalog` + +`function` — Pure catalogue pipeline. + +```ts +(raw: RouterModel[], opts?: { preferredDefault?: string | undefined; } | undefined) => ModelCatalog +``` + +### `buildConsentUrl` + +`function` — Build the URL to send the user to for the one-time app-consent. + +```ts +(input: ConsentUrlInput) => string +``` + +### `buildFlowTrace` + +`function` — Derive a span trace from timestamped turn events. + +```ts +(events: TimedEvent[], opts?: { pricing?: { prompt?: string | number | undefined; completion?: string | number | undefi… +``` + +### `buildHttpMcpServer` + +`function` — Build ONE HTTP MCP server entry — the generic agent→app bridge. + +```ts +(opts: BuildHttpMcpServerOptions) => AppToolMcpServer +``` + +### `BuildHttpMcpServerOptions` + +`interface` — Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description + +```ts +interface BuildHttpMcpServerOptions +``` + +### `buildKnowledgeRequirements` + +`function` — Map specs -> the runtime's `KnowledgeRequirement[]`, folding in per-spec confidence from `signals` (default 0). + +```ts +(specs: KnowledgeRequirementSpec[], signals?: Record) => KnowledgeRequirement[] +``` + +### `BuildMcpServerOptions` + +`interface` — Define configuration options required to build an MCP server including tool, baseUrl, token, and context + +```ts +interface BuildMcpServerOptions +``` + +### `buildRedactedDocument` + +`function` — Split `text` into text + redacted segments, encrypting each redacted span's original. + +```ts +(text: string, options: BuildRedactedDocumentOptions) => Promise +``` + +### `BuildRedactedDocumentOptions` + +`interface` — Define options to encrypt text and specify patterns for redacting sensitive document content + +```ts +interface BuildRedactedDocumentOptions +``` + +### `buildSandboxRuntimeProxyHeaders` + +`function` — Build proxy headers for sandbox runtime including authorization and forwarded headers + +```ts +(source: Headers, sandboxApiKey: string, forwardHeaders?: string[]) => Headers +``` + +### `buildSandboxToolFileMounts` + +`function` — Build file mounts for sandbox tools based on provided options and tool configurations + +```ts +(options: BuildSandboxToolFileMountsOptions) => AgentProfileFileMount[] +``` + +### `BuildSandboxToolFileMountsOptions` + +`interface` — Define options for building sandbox tool file mounts including tool specifications and paths + +```ts +interface BuildSandboxToolFileMountsOptions +``` + +### `buildSandboxToolPathSetupScript` + +`function` — Build a shell script that sets up and exports the sandbox tool binary directory in user profiles + +```ts +(options: SandboxToolPathOptions) => string +``` + +### `buildScopedMcpServerEntry` + +`function` — Build the `AgentProfileMcpServer`-shaped entry for a scoped, per-resource MCP channel. + +```ts +(opts: ScopedMcpServerEntryOptions & { label: string; defaultDescription: string; }) => AppToolMcpServer +``` + +### `buildUserTextParts` + +`function` — Build an array of text parts with optional turn ID for user input + +```ts +(text: string, turnId: string | undefined) => JsonRecord[] +``` + +### `BULK_DELETE_MAX_THREADS` + +`const` — Bounds a single bulk-delete request's write set; product surfaces cap thread lists at far fewer, so a larger batch is a malformed or hostile request. + +```ts +200 +``` + +### `cancelStatusFor` + +`function` — Maps an `interaction.cancel` reason to the card's terminal status. + +```ts +(reason: string | undefined) => ChatInteractionStatus +``` + +### `canTransitionInteractionStatus` + +`function` — Statuses only move forward (pending → terminal); a replayed/stale `pending` must never resurrect a resolved card. + +```ts +(from: ChatInteractionStatus, to: ChatInteractionStatus) => boolean +``` + +### `canTransitionPlanStatus` + +`function` — Plan status is monotonic: only a pending plan can settle. + +```ts +(from: ChatPlanStatus, to: ChatPlanStatus) => boolean +``` + +### `CanvasRenderPalette` + +`interface` — Colors the Konva design-canvas paints directly. + +```ts +interface CanvasRenderPalette +``` + +### `CapabilityTokenOptions` + +`interface` — Define options for creating and verifying capability tokens including secret and prefix + +```ts +interface CapabilityTokenOptions +``` + +### `CatalogModel` + +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags + +```ts +interface CatalogModel +``` + +### `CertifiedDelivery` + +`interface` — Resolve and manage certified profiles with refresh and composition capabilities + +```ts +interface CertifiedDelivery +``` + +### `CertifiedDeliveryConfig` + +`interface` — Define configuration options for delivering certified artifacts to a specified tenant target + +```ts +interface CertifiedDeliveryConfig +``` + +### `ChatAttachmentKind` + +`type` — The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (… + +```ts +type ChatAttachmentKind +``` + +### `ChatAttachmentPart` + +`interface` — Persisted attachment part: structurally an attachment-flavored `ChatFilePart` / `ChatImagePart` (`path` + `name` promoted to required) rather than a separate union member — see the section note above. + +```ts +interface ChatAttachmentPart +``` + +### `ChatFilePart` + +`interface` — Union of the sidecar's legacy (path-based) and AI-SDK (url-based) file shapes; response-side every field besides `type` is optional. + +```ts +interface ChatFilePart +``` + +### `ChatImagePart` + +`interface` — Define properties for an image part within a chat message including optional metadata fields + +```ts +interface ChatImagePart +``` + +### `ChatInteraction` + +`interface` — The client/persisted view of one ask. + +```ts +interface ChatInteraction +``` + +### `ChatInteractionField` + +`type` — Resolve a chat interaction field excluding select types or including chat select fields + +```ts +type ChatInteractionField +``` + +### `ChatInteractionPart` + +`interface` — Persisted human-in-the-loop ask — byte-matches `interactionToPersistedPart` in `/web-react`'s chat-interactions contract. + +```ts +interface ChatInteractionPart +``` + +### `ChatInteractionStatus` + +`type` — Define possible statuses representing the state of a chat interaction + +```ts +type ChatInteractionStatus +``` + +### `ChatMentionKind` + +`type` — The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value. + +```ts +type ChatMentionKind +``` + +### `ChatMentionPart` + +`interface` — A file the user `@`-mentioned on this turn: a workspace-relative path into the sandbox, never bytes. + +```ts +interface ChatMentionPart +``` + +### `ChatMessagePart` + +`type` — Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions + +```ts +type ChatMessagePart +``` + +### `ChatNoticePart` + +`interface` — Persisted one-line transcript notice — byte-matches `noticePart` in `/web-react`'s chat-interactions contract. + +```ts +interface ChatNoticePart +``` + +### `ChatPartTime` + +`interface` — Start/end wall-clock millis, as normalized by `/stream`'s `normalizeTime`. + +```ts +interface ChatPartTime +``` + +### `ChatPlan` + +`type` — Browser/persisted projection of the sandbox SDK's durable-plan union. + +```ts +type ChatPlan +``` + +### `ChatPlanPart` + +`type` — Resolve a chat plan part by aliasing it to the persisted chat plan part type + +```ts +type ChatPlanPart +``` + +### `ChatPlanPersistedPart` + +`type` — Canonical transcript part for one durable plan. + +```ts +type ChatPlanPersistedPart +``` + +### `ChatPlanStatus` + +`type` — Sandbox plan lifecycle. + +```ts +type ChatPlanStatus +``` + +### `ChatReasoningPart` + +`interface` — Define a reasoning part of a chat with text content and optional metadata fields + +```ts +interface ChatReasoningPart +``` + +### `ChatSelectField` + +`type` — Extract select-type interaction fields and optionally allow custom values + +```ts +type ChatSelectField +``` + +### `ChatStepFinishPart` + +`interface` — Define a chat step finish part indicating completion with optional reason, tokens, and cost + +```ts +interface ChatStepFinishPart +``` + +### `ChatStepStartPart` + +`interface` — OpenCode step-boundary marker — no renderable text; preserved so mappers never coerce it into a "[object Object]" text part. + +```ts +interface ChatStepStartPart +``` + +### `ChatStoreInputError` + +`class` — Invalid caller input (missing/oversized ids, empty title). + +```ts +class ChatStoreInputError +``` + +### `ChatSubtaskPart` + +`interface` — Define a subtask part of a chat with prompt, description, agent, and optional identifier + +```ts +interface ChatSubtaskPart +``` + +### `ChatTextPart` + +`interface` — `id` is the harness's per-segment identity; absent on legacy/router parts, which collapse to a single logical text stream. + +```ts +interface ChatTextPart +``` + +### `ChatToolPart` + +`interface` — Define a chat component representing a tool with its state and optional call identifier + +```ts +interface ChatToolPart +``` + +### `ChatToolState` + +`interface` — Describe the current state and data of a chat tool including status, input, output, and metadata + +```ts +interface ChatToolState +``` + +### `ChatToolStatus` + +`type` — Superset of the sidecar's status enum (`pending|running|completed|failed`) and agent-interface's `ToolState` statuses; `error` is the persisted terminal form `/stream`'s `normalizePersistedPart` sett… + +```ts +type ChatToolStatus +``` + +### `ChatUsageTokens` + +`interface` — Per-step usage receipt as the harness reports it (sidecar `StepFinishPartSchema`). + +```ts +interface ChatUsageTokens +``` + +### `checkRateLimit` + +`function` — KV-backed sliding-window rate limit. + +```ts +(kv: KvLike, key: string, limit: number, windowSeconds: number) => Promise +``` + +### `checkThemeContract` + +`function` — Check that every theme token a consumer's source references is actually defined in the CSS that consumer ships. + +```ts +(opts: ThemeContractOptions) => ThemeContractResult +``` + +### `childSpanContext` + +`function` — Derive a child span context under `parent` — one per step attempt (seed e.g. + +```ts +(parent: MissionTraceContext | StepSpanContext, seed?: string | undefined) => StepSpanContext +``` + +### `classifySeveredStream` + +`function` — Resolve the severed stream event to a corresponding sandbox step transition or null + +```ts +(event: unknown) => SandboxStepTransition | null +``` + +### `clearCookieHeader` + +`function` — Set-Cookie header value that deletes the cookie (empty value, Max-Age=0). + +```ts +(opts: Omit) => string +``` + +### `coalesceChatStreamEvents` + +`function` — Coalesce consecutive `message.part.updated` deltas for the SAME part into one event. + +```ts +(events: unknown[]) => unknown[] +``` + +### `coalesceDeltas` + +`function` — Merge consecutive text/reasoning deltas of the same type into one event. + +```ts +(events: unknown[]) => unknown[] +``` + +### `coerceHarness` + +`function` — Coerce an arbitrary value to a known harness, falling back (default `opencode`). + +```ts +(value: unknown, fallback?: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids"… +``` + +### `collapseRedundantTextParts` + +`function` — Collapses text-part artifacts of unstable upstream segment identity: the same text arriving under two keys (id-less delta stream, then an id-bearing snapshot) folds into two segments, and interleaved… + +```ts +(parts: JsonRecord[]) => JsonRecord[] +``` + +### `CompleteMissionInput` + +`interface` — Define input parameters to complete a mission with status and optional summary + +```ts +interface CompleteMissionInput +``` + +### `CompletionRequirement` + +`interface` + +```ts +interface CompletionRequirement +``` + +### `CompletionVerdict` + +`interface` — Extends the substrate verdict spine: `valid` = `fullyComplete` and `score` = `completionRate` — derived in `completionVerdict()`, the one place those equalities hold by construction. + +```ts +interface CompletionVerdict +``` + +### `composeMissionFlowTrace` + +`function` — Compose a mission-wide FlowTrace: one 'pipeline' span per step, the step's delegated runs ('tool' spans, from `activity[stepId]`) beneath it. + +```ts +(input: { steps: MissionFlowStep[]; activity?: Record | undefined; startedAt?: number | un… +``` + +### `composerAnswerData` + +`function` — Shapes composer text into the respond payload for the routed field (select answers are string arrays on the wire; text answers are strings). + +```ts +(field: ChatInteractionField, text: string) => Record +``` + +### `composerAnswerDeliveries` + +`function` — One delivery per pending ask: the first free-text-capable field, else the first field. + +```ts +(pending: ChatInteraction[]) => ComposerAnswerDelivery[] +``` + +### `ComposerAnswerDelivery` + +`interface` — Define the structure for delivering answers linked to a specific chat interaction and field + +```ts +interface ComposerAnswerDelivery +``` + +### `ConsentUrlInput` + +`interface` — Define input parameters required to generate a consent URL for OAuth authorization + +```ts +interface ConsentUrlInput +``` + +### `ConversionMetrics` + +`interface` — Define metrics for tracking impressions, clicks, conversions, and related rates + +```ts +interface ConversionMetrics +``` + +### `ConversionMetricsSchema` + +`const` — Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields + +```ts +ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; ctr: ZodNumber; cvr: ZodNumber; }, $stri… +``` + +### `CookieOptions` + +`interface` — Define options for configuring cookie attributes and behavior + +```ts +interface CookieOptions +``` + +### `CopyContent` + +`interface` — Define the structure for content with headline, body, platform, and optional hashtags and character count + +```ts +interface CopyContent +``` + +### `CopyContentSchema` + +`const` — Validate and parse copy content with headline, body, optional hashtags, platform, and character count + +```ts +ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional>; platform: ZodEnum<{ x: "x… +``` + +### `CopyPlatform` + +`type` — Define platform options for copy content across various social media and communication channels + +```ts +type CopyPlatform +``` + +### `CorrectnessChecker` + +`type` — Decides whether a produced item's content actually fulfils a requirement. + +```ts +type CorrectnessChecker +``` + +### `createAgentRuntime` + +`function` — Create an in-process agent runtime for one agent. + +```ts +(opts: CreateAgentRuntimeOptions) => AgentRuntime +``` + +### `CreateAgentRuntimeOptions` + +`interface` — Define options for creating an agent runtime including model config and optional profile transformation + +```ts +interface CreateAgentRuntimeOptions +``` + +### `createAppToolRuntimeExecutor` + +`function` — Build the runtime executor for one turn. + +```ts +(opts: RuntimeExecutorOptions) => AppToolRuntimeExecutor +``` + +### `createBrokerTokenProvider` + +`function` — Cache + auto-refresh a broker token for one grant. + +```ts +(opts: BrokerTokenProviderOptions) => BrokerTokenProvider +``` + +### `createBufferedTurnTap` + +`function` — The buffering core. + +```ts +(opts: BufferedTurnOptions) => BufferedTurnTap +``` + +### `createCapabilityToken` + +`function` — Mint a capability token for `userId`, or `undefined` when no secret is configured (fail-closed — the caller omits the MCP server rather than fake it). + +```ts +(userId: string, opts: CapabilityTokenOptions) => Promise +``` + +### `createCertifiedDelivery` + +`function` — Build a certified-delivery transform for one agent target. + +```ts +(config: CertifiedDeliveryConfig) => CertifiedDelivery +``` + +### `createD1KnowledgeStateAccessor` + +`function` — The {@link KnowledgeStateAccessor} over the preset D1 schema — the seam that lets the declarative `satisfiedBy` rules resolve with ZERO consumer code: - `config(path)` reads the supplied workspace co… + +```ts +(opts: PresetKnowledgeAccessorOptions) => KnowledgeStateAccessor +``` + +### `createD1TurnEventStore` + +`function` — Resolve a TurnEventStore that appends and reads turn events using a D1-like database interface + +```ts +(db: D1LikeForTurns) => TurnEventStore +``` + +### `createDurableChatEventProjection` + +`function` — Event projector usable with any `ChatTurnRouteProducer` through `withDurableChatProjection`. + +```ts +(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableChatEventP… +``` + +### `createDurableChatScope` + +`function` — Create a durable chat scope from a non-empty string value + +```ts +(value: string) => DurableChatScope +``` + +### `createDurableInteractionProjectionAdapter` + +`function` — Binds an authorized durable scope/store to interaction lifecycle events. + +```ts +(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableInteractio… +``` + +### `createDurableInteractionRoutePersistence` + +`function` — Ready-to-use bridge from `/interactions` to the durable state port. + +```ts +(options: CreateDurableInteractionRoutePersistenceOptions) => DurableInteractionRoutePersistence DurableInteractionSettlement +``` + +### `createDurablePlanRoutes` + +`function` — Build durable plan routes with authorization and effect handling based on provided options + +```ts +(options: DurablePlanRouteOptions) => DurablePlanRoutes +``` + +### `createExpiringCapabilityToken` + +`function` — Mint an EXPIRING capability token: `.` where the payload carries `{ sub, exp, n }` (subject, epoch-ms expiry, random nonce) and the signature is HMAC-SHA256 over the… + +```ts +(subject: string, opts: ExpiringCapabilityTokenOptions) => Promise +``` + +### `createFieldCrypto` + +`function` — Build a {@link import ('../billing').KeyCrypto}-compatible pair bound to a key (or a key-resolver, for env-backed keys resolved per call). + +```ts +(key: string | (() => string)) => { encrypt(s: string): Promise; decrypt(s: string): Promise; } +``` + +### `createInMemoryDurableChatStateStore` + +`function` — Create an in-memory durable chat state store for managing chat session data efficiently + +```ts +() => InMemoryDurableChatStateStore +``` + +### `createInMemoryMissionStore` + +`function` — In-memory {@link MissionStorePort} — the portable backend for tests and sandbox/eval shells. + +```ts +() => InMemoryMissionStore +``` + +### `createInteractionAnswerRoute` + +`function` — Create an interaction answer route that handles listing and resolving interaction requests + +```ts +(options: InteractionAnswerRouteOptions) => InteractionAnswerRoute +``` + +### `createKnowledgeLoop` + +`function` — Build a runnable knowledge-acquisition loop from the product's `AgentKnowledgeConfig` and a small set of seams. + +```ts +(knowledge: AgentKnowledgeConfig, deps: CreateKnowledgeLoopDeps) => KnowledgeLoop +``` + +### `CreateKnowledgeLoopDeps` + +`interface` — Define dependencies required to create and run a knowledge processing loop + +```ts +interface CreateKnowledgeLoopDeps +``` + +### `createLlmCorrectnessChecker` + +`function` — Production `CorrectnessChecker` — one LLM call per matched artifact, deterministic (temperature 0), structured JSON out. + +```ts +(tc: TCloud, opts?: LlmCorrectnessCheckerOpts | undefined) => CorrectnessChecker +``` + +### `createMcpToolHandler` + +`function` — Build a request handler for a tools-only MCP server. + +```ts +>(opts: CreateMcpToolHandlerOptions) => (request: Request) => Promise +``` + +### `CreateMcpToolHandlerOptions` + +`interface` — Define options for creating a handler that manages MCP tools with environment support + +```ts +interface CreateMcpToolHandlerOptions +``` + +### `createMemoryTurnEventStore` + +`function` — In-memory store for tests and keyless local dev. + +```ts +() => TurnEventStore +``` + +### `createMissionEngine` + +`function` — Create a mission engine configured with options to manage mission execution and error handling + +```ts +(options: MissionEngineOptions) => MissionEngine +``` + +### `CreateMissionInput` + +`interface` — Define input parameters for creating a mission including optional deterministic id and unique plan steps + +```ts +interface CreateMissionInput +``` + +### `createMissionService` + +`function` — Create a mission service that manages mission records and audit events with customizable options + +```ts +(options: MissionServiceOptions) => MissionService +``` + +### `createMissionTraceContext` + +`function` — Mint a mission's trace context. + +```ts +(missionId?: string | undefined) => MissionTraceContext +``` + +### `createOpenAICompatStreamTurn` + +`function` — Build a `streamTurn` that calls an OpenAI-compatible `/chat/completions` endpoint (Tangle Router / tcloud / any compat provider) with `stream: true` and yields `LoopEvent`s via {@link toLoopEvents}. + +```ts +(opts: OpenAICompatStreamTurnOptions) => (messages: ToolLoopMessage[]) => AsyncIterable +``` + +### `createPlatformBalanceManager` + +`function` — Create a platform balance manager to handle user plan limits and state based on provided options + +```ts +(opts: PlatformBalanceManagerOptions) => PlatformBalanceManager +``` + +### `createPresetDrizzleSchema` + +`function` — Build the typed Drizzle schema for the preset, given the consumer's `drizzle-orm/sqlite-core` module. + +```ts +(d: DrizzleSqliteCoreLike) => { proposals: unknown; knowledge: unknown; deadlines: unknown; workspaceKeys: unknown; } +``` + +### `createPresetFieldCrypto` + +`function` — Build the {@link KeyCrypto} the billing key store uses — AES-256-GCM field crypto bound to the product's 64-char-hex `ENCRYPTION_KEY` (or a resolver). + +```ts +(key: string | (() => string)) => KeyCrypto +``` + +### `createPresetToolHandlers` + +`function` — The default {@link AppToolHandlers} for the house stack: - `submit_proposal` → insert a `proposals` row (`status='pending'`), deduped on (workspace, title) so a retried turn doesn't double-queue. + +```ts +(opts: PresetToolHandlerOptions) => AppToolHandlers +``` + +### `createPresetWorkspaceKeyManager` + +`function` — Stand up the per-workspace budget-capped {@link WorkspaceKeyManager} on the house stack: the preset `workspace_keys` D1 store + AES-GCM field crypto + the consumer's tcloud provisioner. + +```ts +(opts: PresetBillingOptions) => WorkspaceKeyManager +``` + +### `createPresetWorkspaceKeyStore` + +`function` — The {@link WorkspaceKeyStore} over the preset `workspace_keys` table — the persistence seam the per-workspace key manager needs. + +```ts +(db: D1Like) => WorkspaceKeyStore +``` + +### `createProxiedArtifactRoute` + +`function` — Build a download handler that verifies a signed request and STREAMS the object back with a conservative, non-executable content type. + +```ts +({ store, secret, }: { store: ObjectStore; secret: string; }) => (request: Request) => Promise +``` + +### `createR2ObjectStore` + +`function` — Map the {@link ObjectStore} port onto an R2 bucket 1:1. + +```ts +({ bucket }: { bucket: R2LikeBucket; }) => ObjectStore +``` + +### `createReviewerDecider` + +`function` — Wrap a candidate-producing policy in the default reviewer gate. + +```ts +(propose: (input: KnowledgeDeciderInput) => KnowledgeCandidate | Promise) => KnowledgeDecider +``` + +### `createSandboxTerminalToken` + +`function` — Generate a sandbox terminal token for a given subject with specified options + +```ts +(subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise +``` + +### `createSurfaceRegistry` + +`function` — Assemble the product's surface registry from its registered kinds. + +```ts +(kinds: readonly AnySurfaceKind[]) => SurfaceRegistry +``` + +### `createTangleRouterModelConfig` + +`function` — Build an OpenAI-compatible Tangle Router model config from an already resolved execution key. + +```ts +(opts: CreateTangleRouterModelConfigOptions) => TangleModelConfig +``` + +### `CreateTangleRouterModelConfigOptions` + +`interface` — Define configuration options for creating a Tangle router model including API key and model details + +```ts +interface CreateTangleRouterModelConfigOptions +``` + +### `createTcloudKeyProvisioner` + +`function` — Adapt the tcloud SDK client to {@link KeyProvisioner} — the typed seam that replaces the `as unknown as KeyProvisioner` cast every consumer otherwise repeats. + +```ts +(client: TcloudKeyClient) => KeyProvisioner +``` + +### `createTokenRecallChecker` + +`function` — A deterministic `CorrectnessChecker` (agent-eval exports only `createLlmCorrectnessChecker`). + +```ts +(opts?: { minRecall?: number | undefined; minContentLength?: number | undefined; }) => (requirement: CompletionRequirem… +``` + +### `createWorkspaceKeyManager` + +`function` — Create a workspace key manager that handles key provisioning and budget tracking + +```ts +(opts: WorkspaceKeyManagerOptions) => WorkspaceKeyManager +``` + +### `createWorkspaceSandboxConnectionHandler` + +`function` — Create a handler to resolve workspace sandbox connections with user and access validation + +```ts +(opts: WorkspaceSandboxConnectionHandlerOptions) => ({ request, params… +``` + +### `createWorkspaceSandboxManager` + +`function` — Create a manager to handle workspace sandbox instances with client and options configuration + +```ts +(opts: WorkspaceSandboxManagerOptions ({ request, params }: WorkspaceSandboxRuntimeProxyArgs) => Promis… +``` + +### `createWorkspaceSandboxTerminalUpgradeHandler` + +`function` — Build a Worker-entry handler that proxies a sandbox terminal WebSocket upgrade to the sandbox API runtime proxy. + +```ts +(opts: WorkspaceSandboxTerminalUpgradeHandlerOptions) => (request: Request) => Promise +``` + +### `customToolToOpenAI` + +`function` — The OpenAI function-tool def for a custom tool — appended to the built-ins by `buildAppToolOpenAITools`. + +```ts +(def: AppToolDefinition>) => OpenAIFunctionTool +``` + +### `D1Like` + +`interface` — The D1 surface the preset needs. + +```ts +interface D1Like +``` + +### `D1LikeForTurns` + +`interface` — Minimal structural D1 contract (Cloudflare `D1Database` satisfies it). + +```ts +interface D1LikeForTurns +``` + +### `D1PreparedLike` + +`interface` — A prepared, bound D1 statement. + +```ts +interface D1PreparedLike +``` + +### `darkTheme` + +`const` — Define a dark color scheme for the Agent app interface with specific background and foreground hues + +```ts +AgentAppTheme +``` + +### `decodeHexKey` + +`function` — Validate + decode a 64-char hex key to 32 bytes. + +```ts +(keyHex: string) => Uint8Array +``` + +### `decryptAesGcm` + +`function` — Decrypt a base64(iv ‖ ciphertext ‖ tag) string under `keyHex`. + +```ts +(encrypted: string, keyHex: string) => Promise +``` + +### `decryptBytes` + +`function` — Decrypt binary data (IV ‖ ciphertext ‖ tag) under a derived `CryptoKey`. + +```ts +(data: ArrayBuffer, key: CryptoKey) => Promise +``` + +### `decryptWithKey` + +`function` — Decrypt a base64(iv ‖ ct ‖ tag) string under a derived `CryptoKey`. + +```ts +(encoded: string, key: CryptoKey) => Promise +``` + +### `dedupeQuestionInteractionsByContent` + +`function` — Remove duplicate question interactions based on their content signature to ensure uniqueness + +```ts +(interactions: ChatInteraction[]) => ChatInteraction[] +``` + +### `DEFAULT_APP_TOOL_PATHS` + +`const` — Default route path each app tool is served at. + +```ts +Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", string> +``` + +### `DEFAULT_ATTACHMENT_PROMPT_HEADER` + +`const` — gtm's exact default header for {@link buildAttachmentPromptBlock} — kept byte-identical because it feeds dispatched prompts (gtm-agent#618 reproduces the prompt bytes through this module). + +```ts +"Attached files (already saved to the workspace vault — read them from these paths):" +``` + +### `DEFAULT_HARNESS` + +`const` — Define the default harness to use for code execution and testing environments + +```ts +"opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes" | "forge"… +``` + +### `DEFAULT_HEADER_NAMES` + +`const` — Provide default HTTP header names for user, workspace, and thread identification + +```ts +ToolHeaderNames +``` + +### `DEFAULT_MISSION_STEP_KINDS` + +`const` — Default step-kind vocabulary. + +```ts +readonly string[] +``` + +### `DEFAULT_REDACTION_PATTERNS` + +`const` — The default deterministic patterns. + +```ts +readonly RedactionPattern[] +``` + +### `DEFAULT_SANDBOX_RESOURCES` + +`const` — Define default resource limits and settings for sandbox environments + +```ts +SandboxResourceConfig +``` + +### `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR` + +`const` — Define the default environment variable name for Tangle billing enforcement + +```ts +"TANGLE_BILLING_ENFORCEMENT" +``` + +### `DEFAULT_TANGLE_ROUTER_BASE_URL` + +`const` — Provide the default base URL for the Tangle router API endpoint + +```ts +"https://router.tangle.tools/v1" +``` + +### `deferredCorpusHash` + +`function` — Stable content hash of the deferred file corpus (path + inline content). + +```ts +(files: AgentProfileFileMount[]) => string +``` + +### `defineAgentApp` + +`function` — Identity helper: returns its argument unchanged, but anchors inference so a coding agent authoring a config gets full autocomplete + type-checking from a single import. + +```ts +(config: T) => T +``` + +### `defineAppTool` + +`function` — Validate + brand a product tool definition. + +```ts +>(def: AppToolDefinition) => AppToolDefinition +``` + +### `defineSurfaceKind` + +`function` — Declare one surface kind. + +```ts +(opts: { kind: string; build: (ctx: TCtx) => SurfaceOverlay | Promise; }) => SurfaceKindDefinitio… +``` + +### `delegationActivityToFlowSpans` + +`function` — One 'tool' FlowSpan per delegation, positioned relative to `turnStartMs` (the epoch-ms origin of the trace — usually the step or mission start). + +```ts +(activity: StepAgentActivity[], turnStartMs: number, opts?: { nowMs?: number | undefined; } | undefined) => FlowSpan[] +``` + +### `deleteSecret` + +`function` — Delete a secret by name from the given secret store and return the operation outcome + +```ts +(store: SecretStore, name: string) => Promise> +``` + +### `deriveKey` + +`function` — Derive an AES-256-GCM `CryptoKey` from a secret string via PBKDF2. + +```ts +(secret: string, opts: DeriveKeyOptions) => Promise +``` + +### `DeriveKeyOptions` + +`interface` — --- Passphrase-derived key path (PBKDF2 → AES-256-GCM CryptoKey) --- The `encryptAesGcm`/`decryptAesGcm` path takes a raw 64-char-hex key. + +```ts +interface DeriveKeyOptions +``` + +### `deriveSignals` + +`function` — Score every spec from workspace state. + +```ts +(specs: KnowledgeRequirementSpec[], ctx: KnowledgeStateAccessor) => Promise> +``` + +### `detectInteractiveQuestion` + +`function` — Resolve the interactive question text from a structured event or return null if none found + +```ts +(event: unknown) => string | null +``` + +### `detectSpans` + +`function` — Find non-overlapping PII spans in `text`. + +```ts +(text: string, patterns?: readonly RedactionPattern[]) => RedactionSpan[] +``` + +### `dispatchAppTool` + +`function` — The ONE place an app-tool call is validated, dispatched to the product's handler, and turned into an {@link AppToolOutcome} + produced events. + +```ts +(toolName: string, rawArgs: Record, ctx: AppToolContext, opts: DispatchOptions) => Promise string +``` + +### `DurableChatStateStore` + +`type` — Alias used by adapters that store all durable chat state in one port. + +```ts +type DurableChatStateStore +``` + +### `DurableChatUnavailableError` + +`class` — Represent unavailable durable chat authority errors with status code 503 + +```ts +class DurableChatUnavailableError +``` + +### `DurableFollowUpReceipt` + +`interface` — Define a durable receipt capturing stable identifiers and state for follow-up decisions + +```ts +interface DurableFollowUpReceipt +``` + +### `DurableInteractionAcknowledgement` + +`interface` — Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields + +```ts +interface DurableInteractionAcknowledgement +``` + +### `DurableInteractionGuarantee` + +`type` — Define interaction durability levels to specify reconciliation or best-effort guarantees + +```ts +type DurableInteractionGuarantee +``` + +### `durableInteractionIntentKey` + +`function` — Stable key helper exported for products implementing their own settlement loop. + +```ts +(scope: DurableChatScope, interactionId: string, attemptKey: string) => string +``` + +### `DurableInteractionProjection` + +`interface` — Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag + +```ts +interface DurableInteractionProjection +``` + +### `DurableInteractionProjectionAdapter` + +`interface` — Define methods to manage durable interaction projections including upsert, cancel, and materialize operations + +```ts +interface DurableInteractionProjectionAdapter +``` + +### `DurableInteractionRouteArgs` + +`interface` — Define arguments for durable interaction routes including a stable caller-created attempt key + +```ts +interface DurableInteractionRouteArgs +``` + +### `DurableInteractionRoutePersistence` + +`interface` — Crash-recoverable persistence lifecycle for the answer route. + +```ts +interface DurableInteractionRoutePersistence +``` + +### `DurableInteractionSettlement` + +`interface` — Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents + +```ts +interface DurableInteractionSettlement +``` + +### `DurableInteractionSettlementFactoryOptions` + +`interface` — Define options for creating durable interaction settlement factories including store and optional reconcile authority + +```ts +interface DurableInteractionSettlementFactoryOptions +``` + +### `DurableInteractionSettlementOptions` + +`interface` — Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider + +```ts +interface DurableInteractionSettlementOptions +``` + +### `DurablePlanAuthority` + +`interface` — Structural port to Sandbox (or another durable plan authority). + +```ts +interface DurablePlanAuthority +``` + +### `DurablePlanAuthorityCurrentResult` + +`interface` — Represent the current authoritative state and optional receipt of a durable plan authority + +```ts +interface DurablePlanAuthorityCurrentResult +``` + +### `DurablePlanAuthorityDecision` + +`type` — Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions + +```ts +type DurablePlanAuthorityDecision +``` + +### `DurablePlanAuthorityResult` + +`interface` — Describe the outcome of an authority's durable plan decision including follow-up and metadata + +```ts +interface DurablePlanAuthorityResult +``` + +### `DurablePlanAuthorization` + +`type` — Resolve authorization status for durable plans using scopes, responses, or nullish values + +```ts +type DurablePlanAuthorization +``` + +### `DurablePlanCommandJournal` + +`type` — Pick essential methods to manage and record durable plan command operations + +```ts +type DurablePlanCommandJournal +``` + +### `DurablePlanCommandKey` + +`type` — Represent a unique identifier key for durable plan commands + +```ts +type DurablePlanCommandKey +``` + +### `DurablePlanCommandRecord` + +`interface` — Define the structure for recording durable plan commands with associated metadata and state information + +```ts +interface DurablePlanCommandRecord +``` + +### `DurablePlanCommandState` + +`type` — Define possible states for a durable plan command in its lifecycle + +```ts +type DurablePlanCommandState +``` + +### `DurablePlanDecision` + +`type` — Represent durable plan outcomes as either approved or rejected + +```ts +type DurablePlanDecision +``` + +### `DurablePlanEffectRecord` + +`interface` — Define the structure for recording the state and metadata of a durable plan effect + +```ts +interface DurablePlanEffectRecord +``` + +### `DurablePlanProjection` + +`type` — Projection retained by a durable store. + +```ts +type DurablePlanProjection +``` + +### `DurablePlanRouteAuthorizeArgs` + +`interface` — Define arguments for authorizing durable plan route requests with operation and optional plan ID + +```ts +interface DurablePlanRouteAuthorizeArgs +``` + +### `DurablePlanRouteOptions` + +`interface` — Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling + +```ts +interface DurablePlanRouteOptions +``` + +### `DurablePlanRoutes` + +`interface` — Define routes handling durable plan requests with current and decide methods + +```ts +interface DurablePlanRoutes +``` + +### `DurablePlanStateStore` + +`type` — Represent durable storage for plan state management with persistence and reliability guarantees + +```ts +type DurablePlanStateStore +``` + +### `DurablePlanStore` + +`interface` — Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context + +```ts +interface DurablePlanStore +``` + +### `EmailBodySection` + +`interface` — Define the structure for the body section of an email containing plain text content + +```ts +interface EmailBodySection +``` + +### `EmailContent` + +`interface` — Define the structure for email content including subject, optional preheader, and sections + +```ts +interface EmailContent +``` + +### `EmailContentSchema` + +`const` — Validate and parse email content objects with subject, optional preheader, and sections + +```ts +ZodObject<{ subject: ZodString; preheader: ZodOptional; sections: ZodArray Uint8Array +``` + +### `encodeSandboxRuntimePath` + +`function` — Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments + +```ts +(runtimePath: string) => string | null +``` + +### `encryptAesGcm` + +`function` — Encrypt `plaintext` with AES-256-GCM under `keyHex`. + +```ts +(plaintext: string, keyHex: string) => Promise +``` + +### `encryptBytes` + +`function` — Encrypt binary data under a derived `CryptoKey`. + +```ts +(data: ArrayBuffer, key: CryptoKey) => Promise +``` + +### `encryptWithKey` + +`function` — Encrypt `plaintext` under a derived `CryptoKey`. + +```ts +(plaintext: string, key: CryptoKey) => Promise +``` + +### `ensureWorkspaceSandbox` + +`function` — Resolve or create a workspace sandbox instance with optional reuse and progress tracking + +```ts +(shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions) => Promise +``` + +### `EnsureWorkspaceSandboxOptions` + +`interface` — Define options for ensuring a workspace sandbox with provisioning and progress handling + +```ts +interface EnsureWorkspaceSandboxOptions +``` + +### `ENV_TOTAL_MAX_BYTES` + +`const` — Total env gate: the whole environment block shares the payload budget with the profile; past 200 KB the provision body cannot stay under the cap. + +```ts +200000 +``` + +### `ENV_VALUE_MAX_BYTES` + +`const` — Per-variable env gate: the kernel rejects any single `NAME=value` env entry over MAX_ARG_STRLEN (131072 bytes) with E2BIG, killing every exec inside the box. + +```ts +120000 +``` + +### `ExpiringCapabilityTokenOptions` + +`interface` — Define options for capability tokens that expire after a specified lifetime in milliseconds + +```ts +interface ExpiringCapabilityTokenOptions +``` + +### `extractProducedState` + +`function` — Normalize a run's runtime event stream into `ProducedState`. + +```ts +(events: readonly RuntimeEventLike[]) => ProducedState +``` + +### `extractRequestContext` + +`function` — Extract request context for audit trails. + +```ts +(request: Request) => RequestContext +``` + +### `fetchModelCatalog` + +`function` — Fetch the router model list and build the catalogue, with an in-isolate cache (TTL 5 min). + +```ts +(cfg: { baseUrl: string; apiKey: string; preferredDefault?: string | undefined; }) => Promise +``` + +### `fieldAcceptsFreeText` + +`function` — Determine if a chat interaction field allows free text input + +```ts +(field: ChatInteractionField) => boolean +``` + +### `finalizeAssistantParts` + +`function` — Resolve and clean up assistant parts by terminalizing and collapsing redundant segments + +```ts +(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[] +``` + +### `finalizePendingInteractionParts` + +`function` — Settles still-pending interaction parts at persist time. + +```ts +(parts: JsonRecord[], outcome: "answered" | "expired") => JsonRecord[] +``` + +### `findCustomTool` + +`function` — Find a registered custom tool by the name the model called. + +```ts +(name: string, tools: readonly AppToolDefinition>[] | undefined) => AppToolDefinition string +``` + +### `FlowSpan` + +`interface` — The shared FlowSpan / FlowTrace data shapes — the LEAF both the trace barrel (`./index`, which builds + renders them) and the delegation converters (`./mission-flow`, which emit them) import, so neit… + +```ts +interface FlowSpan +``` + +### `FlowTrace` + +`interface` — Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls + +```ts +interface FlowTrace +``` + +### `formatPreflightReport` + +`function` — Render a report as an aligned, operator-readable table + verdict line. + +```ts +(report: PreflightReport) => string +``` + +### `getClient` + +`function` — Resolve a synchronous sandbox client from provided runtime configuration credentials + +```ts +(shell: SandboxRuntimeConfig) => SandboxClient +``` + +### `getPartKey` + +`function` — Resolve a unique key string for a part based on its type and identifying properties + +```ts +(part: JsonRecord) => string +``` + +### `handleAppToolRequest` + +`function` — Handle one app-tool HTTP request end to end — the sandbox MCP path. + +```ts +(request: Request, opts: HandleToolRequestOptions) => Promise +``` + +### `HandleToolRequestOptions` + +`interface` — Define options for handling tool requests including tool identification and token verification + +```ts +interface HandleToolRequestOptions +``` + +### `Harness` + +`type` — Resolve a valid harness identifier from the predefined KNOWN_HARNESSES array + +```ts +type Harness +``` + +### `historyContentWithAttachments` + +`function` — History projection for a persisted message: `content` unchanged when it carries no attachment parts, else the block is appended once. + +```ts +(message: { content: string; parts?: readonly Record[] | null | undefined; }, header?: string | undefi… +``` + +### `httpHeadProbe` + +`function` — Probe a plain reachability endpoint (e.g. + +```ts +(config: HttpHeadProbeConfig) => PreflightProbe +``` + +### `HttpHeadProbeConfig` + +`interface` — Define configuration options for performing an HTTP HEAD probe to check URL availability + +```ts +interface HttpHeadProbeConfig +``` + +### `HubExecClient` + +`class` — Typed client over the platform hub `/v1/hub/exec`. + +```ts +class HubExecClient +``` + +### `HubExecClientOptions` + +`interface` — Define configuration options for initializing a Hub execution client + +```ts +interface HubExecClientOptions +``` + +### `HubExecErrorCode` + +`type` — `{ success: false }` codes the hub returns on `/exec`. + +```ts +type HubExecErrorCode +``` + +### `HubExecResult` + +`type` — Outcome of a hub `/exec` call. + +```ts +type HubExecResult +``` + +### `HubInvokeDeps` + +`interface` — Define dependencies for invoking hub operations including API key resolution and optional configuration + +```ts +interface HubInvokeDeps +``` + +### `HubInvokeInput` + +`interface` — Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments + +```ts +interface HubInvokeInput +``` + +### `HubInvokeOutcome` + +`interface` — Describe the outcome of a hub invocation including status and response body + +```ts +interface HubInvokeOutcome +``` + +### `ImageBackground` + +`type` — Define image background styles as color, gradient, or image with optional overlay settings + +```ts +type ImageBackground +``` + +### `ImageContent` + +`interface` — Define the structure for image content containing an array of image slides + +```ts +interface ImageContent +``` + +### `ImageContentSchema` + +`const` — Validate image content with an array of one or more slides containing background details + +```ts +ZodObject<{ slides: ZodArray; valu… +``` + +### `ImageImageLayer` + +`interface` — Define properties for an image layer including position, size, URL, and optional opacity + +```ts +interface ImageImageLayer +``` + +### `ImageLayer` + +`type` — Resolve a union type representing different kinds of image layers + +```ts +type ImageLayer +``` + +### `ImageLayerType` + +`type` — Define image layer categories for text, image, shape, or logo elements + +```ts +type ImageLayerType +``` + +### `ImageLogoLayer` + +`interface` — Define properties for positioning and sizing a logo image layer in a layout + +```ts +interface ImageLogoLayer +``` + +### `ImageShapeLayer` + +`interface` — Define properties for a shape layer representing rectangular or circular image elements + +```ts +interface ImageShapeLayer +``` + +### `ImageSlide` + +`interface` — Define the structure for an image slide with a background and multiple layers + +```ts +interface ImageSlide +``` + +### `ImageTextLayer` + +`interface` — Define properties for a text layer with position, style, and alignment options in an image + +```ts +interface ImageTextLayer +``` + +### `InMemoryDurableChatStateStore` + +`class` — Reference adapter for tests and local development. + +```ts +class InMemoryDurableChatStateStore +``` + +### `InMemoryDurableChatStore` + +`const` — Short aliases retained for adapter authors who call this a durable chat store rather than a state store. + +```ts +typeof InMemoryDurableChatStateStore +``` + +### `InMemoryMissionStore` + +`interface` — Define an in-memory mission store that tracks events and allows direct record writes + +```ts +interface InMemoryMissionStore +``` + +### `INTERACTION_CANCEL_EVENT` + +`const` — Sidecar → client: the ask was withdrawn; data = `{ id, reason? + +```ts +"interaction.cancel" +``` + +### `INTERACTION_EVENT` + +`const` — Sidecar → client: the agent raised an ask; data = `{ request }`. + +```ts +"interaction" +``` + +### `INTERACTION_RESOLVED_EVENT` + +`const` — An ask was answered; data = `{ id, status }`. + +```ts +"interaction.resolved" +``` + +### `InteractionAnswerBodyValidation` + +`type` — Validate interaction answer body and return success with data or failure with error message + +```ts +type InteractionAnswerBodyValidation +``` + +### `InteractionAnswerRoute` + +`interface` — Define routes to list outstanding interactions and resolve answers for live turns + +```ts +interface InteractionAnswerRoute +``` + +### `InteractionAnswerRouteOptions` + +`interface` — Define options to authenticate, authorize, and manage persistence for interaction answer routes + +```ts +interface InteractionAnswerRouteOptions +``` + +### `InteractionAnswers` + +`type` — Map interaction identifiers to their corresponding answer values + +```ts +type InteractionAnswers +``` + +### `InteractionAnswerValue` + +`type` — Accepted answer values. + +```ts +type InteractionAnswerValue +``` + +### `InteractionCancelData` + +`interface` — Describe data required to cancel an interaction including its identifier and optional reason + +```ts +interface InteractionCancelData +``` + +### `InteractionClientOutcome` + +`type` — Define possible outcomes for an interaction client as accepted or declined + +```ts +type InteractionClientOutcome +``` + +### `InteractionConnectionResolution` + +`type` — The product seam's verdict for one request. + +```ts +type InteractionConnectionResolution +``` + +### `InteractionData` + +`type` + +```ts +type InteractionData +``` + +### `interactionFromWireRequest` + +`function` — Reads a wire request into the client's pending `ChatInteraction`. + +```ts +(request: InteractionRequestWire) => ChatInteraction +``` + +### `InteractionOutcome` + +`type` + +```ts +type InteractionOutcome +``` + +### `interactionPartKey` + +`function` — Generate a unique key string for an interaction using the given identifier + +```ts +(id: string) => string +``` + +### `InteractionPersistedPart` + +`type` — Persisted-part shapes the codecs below produce — the SAME rows `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the source so a product pushing them into a `ChatMessagePart[]` t… + +```ts +type InteractionPersistedPart +``` + +### `InteractionRequest` + +`type` + +```ts +type InteractionRequest +``` + +### `InteractionRequestWire` + +`type` — `InteractionRequest` whose select fields may carry `allowCustom`. + +```ts +type InteractionRequestWire +``` + +### `InteractionRouteLogger` + +`type` — Provide logging methods for warnings and errors in interaction routes + +```ts +type InteractionRouteLogger +``` + +### `interactionToPersistedPart` + +`function` — Builds the persisted/streamed `interaction` part from a wire request. + +```ts +(request: InteractionRequestWire, status: ChatInteractionStatus, cancelReason?: string | undefined, answers?: Interacti… +``` + +### `invokeIntegrationHub` + +`function` — Resolve + execute one integration tool call through the hub: resolve the per-user bearer, map the MCP tool name to the hub action path, forward to `/v1/hub/exec`, and shape the route response (200 ok… + +```ts +(input: HubInvokeInput, deps: HubInvokeDeps) => Promise +``` + +### `isAppToolName` + +`function` — Determine if a string matches a valid application tool name + +```ts +(name: string) => name is "submit_proposal" | "schedule_followup" | "render_ui" | "add_citation" +``` + +### `isChatAttachmentPart` + +`function` — True for any `image`/`file` part carrying a non-empty string `path`. + +```ts +(part: unknown) => part is ChatAttachmentPart +``` + +### `isChatInteractionPart` + +`function` — Resolve whether a ChatMessagePart is a ChatInteractionPart based on its type property + +```ts +(part: ChatMessagePart) => part is ChatInteractionPart +``` + +### `isChatMentionPart` + +`function` — Widened to `unknown` — unlike its siblings this guard also runs over raw untyped stored rows (a transcript renderer reads `message.parts` before the typed projection), which is exactly what {@link me… + +```ts +(part: unknown) => part is ChatMentionPart +``` + +### `isChatPlanPart` + +`function` — Resolve whether a chat message part is a persisted chat plan part + +```ts +(part: ChatMessagePart) => part is ChatPlanPersistedPart +``` + +### `isChatStepFinishPart` + +`function` — Determine if a chat message part represents the completion of a chat step + +```ts +(part: ChatMessagePart) => part is ChatStepFinishPart +``` + +### `isChatTextPart` + +`function` — Resolve whether a chat message part is a text part based on its type property + +```ts +(part: ChatMessagePart) => part is ChatTextPart +``` + +### `isChatToolPart` + +`function` — Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property + +```ts +(part: ChatMessagePart) => part is ChatToolPart +``` + +### `isHarness` + +`function` — Determine if a value is a recognized harness string identifier + +```ts +(value: unknown) => value is "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids"… +``` + +### `isMissionStopRequested` + +`function` — The cooperative kill switch: a stop request rides metadata so it survives any status and is honored by the engine before the next side effect. + +```ts +(mission: MissionRecord) => boolean +``` + +### `isMissionTerminal` + +`function` — Statuses a mission can never leave — the run is done. + +```ts +(status: MissionStatus) => boolean +``` + +### `isModelCompatibleWithHarness` + +`function` — Provider-less ids (sentinels like "default", or a session's own config) are compatible everywhere — every harness honors its own configuration. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `isRenderableInteractionKind` + +`function` — Resolve if the given interaction kind is renderable within the application context + +```ts +(kind: string) => boolean +``` + +### `isSafeInteractionFieldKey` + +`function` — Answer/field keys the sidecar will accept: identifier-safe and never a prototype-pollution vector. + +```ts +(key: string) => boolean +``` + +### `isSandboxTerminalWsUpgrade` + +`function` — True when `request` is a WebSocket upgrade for a sandbox terminal path. + +```ts +(request: Request) => boolean +``` + +### `isTangleBillingEnforcementDisabled` + +`function` — Shared policy for agent products that bill through the Tangle Platform. + +```ts +(opts?: TangleBillingEnforcementOptions) => boolean +``` + +### `isTangleExecutionKeyError` + +`function` — Identify whether an error is a TangleExecutionKeyError based on its properties and type + +```ts +(error: unknown) => error is TangleExecutionKeyError +``` + +### `isTerminalInteractionStatus` + +`function` — Resolve if the interaction status is a terminal state excluding pending + +```ts +(status: ChatInteractionStatus) => boolean +``` + +### `isTerminalPromptEvent` + +`function` — Determine if an event is a terminal prompt event with type 'result' or 'done + +```ts +(event: unknown) => boolean +``` + +### `JsonObject` + +`type` — Web-boundary utilities every agent app's routes hand-roll: JSON body parsing + narrowing, request-context extraction (real client IP behind Cloudflare), a KV-backed sliding-window rate limiter, and s… + +```ts +type JsonObject +``` + +### `JsonRecord` + +`type` — Represent a JSON-compatible object with string keys and values of any type + +```ts +type JsonRecord +``` + +### `KeyCrypto` + +`interface` — Secret encryption seam (the app's at-rest crypto). + +```ts +interface KeyCrypto +``` + +### `KeyProvisioner` + +`interface` — The key-provisioning operations the key manager needs. + +```ts +interface KeyProvisioner +``` + +### `KnowledgeCandidate` + +`interface` — A research candidate the decider evaluates before the loop applies it. + +```ts +interface KnowledgeCandidate +``` + +### `KnowledgeDecider` + +`interface` — The pluggable acquisition policy. + +```ts +interface KnowledgeDecider +``` + +### `KnowledgeDeciderInput` + +`interface` — Define the input parameters required to decide knowledge proposals within an agent-knowledge loop + +```ts +interface KnowledgeDeciderInput +``` + +### `KnowledgeDecision` + +`interface` — Define a decision containing a candidate and the gate's verdict on that candidate + +```ts +interface KnowledgeDecision +``` + +### `KnowledgeGateVerdict` + +`interface` — The verdict a gate returns for one candidate. + +```ts +interface KnowledgeGateVerdict +``` + +### `KnowledgeLoop` + +`interface` — The handle `createKnowledgeLoop` returns. + +```ts +interface KnowledgeLoop +``` + +### `KnowledgeLoopConfig` + +`interface` — The knowledge-acquisition loop config — the goal the researcher pursues and the gate it must clear before the loop is considered satisfied. + +```ts +interface KnowledgeLoopConfig +``` + +### `KnowledgeLoopDriver` + +`interface` — The agent-runtime turn driver seam. + +```ts +interface KnowledgeLoopDriver +``` + +### `KnowledgeRequirementSpec` + +`interface` — Define the criteria and conditions required to satisfy a specific knowledge requirement + +```ts +interface KnowledgeRequirementSpec +``` + +### `KnowledgeSignal` + +`interface` — Define a signal representing knowledge with confidence level and optional supporting evidence + +```ts +interface KnowledgeSignal +``` + +### `KnowledgeSourceSpec` + +`interface` — A knowledge source the acquisition loop / researcher may draw on. + +```ts +interface KnowledgeSourceSpec +``` + +### `KnowledgeStateAccessor` + +`interface` — The single seam a backend implements. + +```ts +interface KnowledgeStateAccessor +``` + +### `KNOWN_HARNESSES` + +`const` — The known coding-agent backends. + +```ts +readonly ["opencode", "claude-code", "nanoclaw", "kimi-code", "codex", "amp", "factory-droids", "pi", "hermes", "forge"… +``` + +### `KvLike` + +`interface` — Minimal KV contract (Cloudflare `KVNamespace` satisfies it structurally). + +```ts +interface KvLike +``` + +### `lightTheme` + +`const` — Define a light color theme with specific background, foreground, and accent color values + +```ts +AgentAppTheme +``` + +### `listSessionInteractions` + +`function` — Outstanding (unanswered) interactions for the session — the sidecar's registry is authoritative, so this is the reconnect/reload source of truth. + +```ts +(connection: SidecarInteractionsConnection) => Promise> +``` + +### `LivenessProbeConfig` + +`interface` — Define configuration for liveness probes including sidecar process pattern and optional timeouts + +```ts +interface LivenessProbeConfig +``` + +### `LoopAssistantToolCall` + +`interface` — One OpenAI-shaped tool-call entry carried on an assistant message. + +```ts +interface LoopAssistantToolCall +``` + +### `LoopEvent` + +`type` — Events the app's OpenAI-compat stream adapter ({@link toLoopEvents }) yields. + +```ts +type LoopEvent +``` + +### `LoopMessage` + +`type` — A message in the running conversation the loop sends to `streamTurn`. + +```ts +type LoopMessage +``` + +### `LoopToolCall` + +`interface` — Bounded turn-level tool-dispatch loop. + +```ts +interface LoopToolCall +``` + +### `LoopTraceEventLike` + +`interface` — Structural mirror of agent-runtime's `LoopTraceEvent` — same fields, no import, so journals parsed from JSON feed straight in. + +```ts +interface LoopTraceEventLike +``` + +### `loopTraceEventsToFlowSpans` + +`function` — Reconstruct one delegation's loop → round → iteration tree from its journaled LoopTraceEvents, as FlowSpans relative to `loop.started` (or the first event). + +```ts +(events: LoopTraceEventLike[]) => FlowSpan[] +``` + +### `mapInteractionRespondFailure` + +`function` — Sidecar error → the client-actionable contract. + +```ts +(error: SidecarInteractionsError, logger?: InteractionRouteLogger) => Response +``` + +### `maskSpans` + +`function` — Replace only the PII substrings in `text`, preserving everything around them (the `mask-spans` string mode). + +```ts +(text: string, patterns?: readonly RedactionPattern[]) => string +``` + +### `matchSandboxTerminalWsPath` + +`function` — Parse a same-origin terminal-WS pathname into its parts, or `null` when the path is not a sandbox terminal WebSocket. + +```ts +(pathname: string) => SandboxTerminalWsMatch | null +``` + +### `MCP_PROTOCOL_VERSIONS` + +`const` — Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server. + +```ts +readonly ["2025-06-18", "2025-03-26", "2024-11-05"] +``` + +### `McpProtocolVersion` + +`type` — Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array + +```ts +type McpProtocolVersion +``` + +### `McpServerInfo` + +`interface` — Describe the structure of server information including name and version + +```ts +interface McpServerInfo +``` + +### `McpToolDefinition` + +`interface` — One tool entry in the registry the handler owns. + +```ts +interface McpToolDefinition +``` + +### `MemberSyncSeam` + +`interface` — Map workspace roles to corresponding sandbox permission levels + +```ts +interface MemberSyncSeam +``` + +### `mentionInputToPart` + +`function` — A validated wire mention (`parseFileMentions` in `/chat-routes`) as the part the turn route persists. + +```ts +(input: FileMention) => ChatMentionPart +``` + +### `mentionPartsFromMessageParts` + +`function` — Every mention part on one message, in stored order. + +```ts +(parts: readonly Record[] | readonly ChatMessagePart[] | null | undefined) => ChatMentionPart[] +``` + +### `mergeExtraMcp` + +`function` — Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys + +```ts +(appToolMcp: Record, baseProfileMcp: Record, extra: Recor… +``` + +### `mergeHistoryIntoParts` + +`function` — History-aware equivalent of flattenHistory for multimodal prompt parts: the transcript is folded into the first text part (image/file parts carry no text to prepend to) rather than replacing the mess… + +```ts +(parts: PromptInputPart[], history?: { role: "user" | "assistant"; content: string; }[] | undefined) => PromptInputPart… +``` + +### `mergeMissionState` + +`function` — Merge a loader SEED into the live state for one mission, advancing through the SAME monotonic clamps the event reducer uses. + +```ts +(live: MissionState | undefined, seed: MissionState) => MissionState +``` + +### `mergePersistedPart` + +`function` — Merge incoming JSON with existing persisted data, applying delta for text types when provided + +```ts +(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string | undefined) => JsonRecord +``` + +### `mergeSurfaceOverlay` + +`function` — Merge one surface overlay into a base profile, returning a new object (the base is never mutated; untouched nested records are shared by reference). + +```ts +(base: TBase, overlay: SurfaceOverlay) => TBase & SurfaceMergeBase +``` + +### `messageHasTurnId` + +`function` — Resolve whether a message contains any part with the specified turn ID + +```ts +(message: PersistedChatMessageForTurn, turnId: string) => boolean +``` + +### `mintSandboxScopedToken` + +`function` — Mint a scoped token for an already-provisioned box (e.g. + +```ts +(box: SandboxInstance, options: { scope: ScopedTokenScope; sessionId?: string | undefined; ttlMinutes?: number | undefi… +``` + +### `mintTerminalProxyToken` + +`function` — Generate a signed token for TerminalProxyIdentity with an expiration based on TTL milliseconds + +```ts +(secret: string, identity: TerminalProxyIdentity, ttlMs?: number, now?: () => number) => Promise string | null +``` + +### `noopEventSink` + +`const` — A sink that drops every event — the engine default when no live channel is wired (and the unit-test default). + +```ts +MissionEventSink +``` + +### `normalizeClientTurnId` + +`function` — Normalize and validate a client turn ID string ensuring it meets format and length requirements + +```ts +(value: unknown) => string | undefined +``` + +### `normalizeModelId` + +`function` — Strip provider prefix, :free suffix, and trailing date stamps. + +```ts +(id: string) => string +``` + +### `normalizePersistedPart` + +`function` — Normalize a persisted part object by standardizing its structure and fields + +```ts +(rawPart: JsonRecord) => JsonRecord | null +``` + +### `normalizePlanDecision` + +`function` — Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs + +```ts +(value: unknown) => DurablePlanDecision | null +``` + +### `normalizeTime` + +`function` — Resolve time properties from various keys into a normalized record with numeric start and end fields + +```ts +(value: unknown) => JsonRecord | undefined +``` + +### `normalizeToolEvent` + +`function` — Normalize tool-related events into a standardized message.part.updated format + +```ts +(event: StreamEvent) => StreamEvent +``` + +### `NoticeKind` + +`type` — Define specific string literals representing different kinds of notices + +```ts +type NoticeKind +``` + +### `noticePart` + +`function` — Builds the persisted/streamed `notice` part — a one-line transcript notice explaining an out-of-band event (warning, auto-declined interaction). + +```ts +(noticeKind: NoticeKind, id: string, text: string) => NoticePersistedPart +``` + +### `noticePartKey` + +`function` — Generate a unique key string for a notice using the given identifier + +```ts +(id: string) => string +``` + +### `NoticePersistedPart` + +`type` — Define a persisted notice part with type, id, kind, and text properties + +```ts +type NoticePersistedPart +``` + +### `ObjectBody` + +`interface` — A retrieved object. + +```ts +interface ObjectBody +``` + +### `objectKey` + +`function` — Build the canonical object key: `operator/customer/upload-filename`. + +```ts +({ operatorId, customerId, uploadId, filename }: ObjectKeyParts) => string +``` + +### `ObjectKeyParts` + +`interface` — Inputs to {@link objectKey}. + +```ts +interface ObjectKeyParts +``` + +### `ObjectStore` + +`interface` — Portable object-store port. + +```ts +interface ObjectStore +``` + +### `OpenAICompatStreamTurnOptions` + +`interface` — Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools + +```ts +interface OpenAICompatStreamTurnOptions +``` + +### `OpenAIFunctionTool` + +`interface` — A minimal OpenAI Chat Completions function-tool shape — structurally compatible with `@tangle-network/agent-runtime`'s `OpenAIChatTool` without importing it (keeps this package runtime-free). + +```ts +interface OpenAIFunctionTool +``` + +### `OpenAIStreamChunk` + +`interface` — Minimal OpenAI Chat Completions streaming chunk (structural — no `openai` dep). + +```ts +interface OpenAIStreamChunk +``` + +### `Outcome` + +`type` — Represent success or failure of an operation with corresponding value or error information + +```ts +type Outcome +``` + +### `outcomeStatus` + +`function` — HTTP status for a failed outcome — the handler's `ToolInputError.status` when present, else 400 for a validation reject. + +```ts +(outcome: { ok: false; code: string; message: string; status?: number | undefined; }) => number +``` + +### `parseAssetSpec` + +`function` — Validates an unknown value as an AssetSpec, including format-specific content validation. + +```ts +(raw: unknown) => AssetSpec +``` + +### `ParsedIntegrationAction` + +`interface` — The provider/connector/action a hub action path addresses, plus the dotted `path` the hub `/exec` endpoint expects. + +```ts +interface ParsedIntegrationAction +``` + +### `ParsedMission` + +`interface` — Describe a mission with a title and an ordered list of parsed steps + +```ts +interface ParsedMission +``` + +### `ParsedMissionStep` + +`interface` — Define the structure representing a parsed mission step with id, kind, and intent fields + +```ts +interface ParsedMissionStep +``` + +### `parseInteractionAnswers` + +`function` — Strictly validates and copies persisted answer selections. + +```ts +(value: unknown) => ParseInteractionAnswersResult +``` + +### `ParseInteractionAnswersResult` + +`type` — Resolve the result of parsing interaction answers with success status and corresponding data or error message + +```ts +type ParseInteractionAnswersResult +``` + +### `parseInteractionCancel` + +`function` — Parse interaction cancel data and return success status with parsed value or error message + +```ts +(data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;… +``` + +### `parseInteractionRequest` + +`function` — Parses an `interaction` event's data (`{ request }`). + +```ts +(data: Record | undefined) => ParseInteractionResult +``` + +### `ParseInteractionResult` + +`type` — Resolve interaction parsing outcome as success with value or failure with error message + +```ts +type ParseInteractionResult +``` + +### `parseJsonObjectBody` + +`function` — Parse + object-narrow a Request body. + +```ts +(request: Request) => Promise<[JsonObject, null] | [null, Response]> +``` + +### `parseMissionBlocks` + +`function` — Parse every well-formed `:::mission` block. + +```ts +(fullContent: string, options?: ParseMissionBlocksOptions) => ParsedMission[] +``` + +### `ParseMissionBlocksOptions` + +`interface` — Define options to specify allowed lowercase step kinds for parsing mission blocks + +```ts +interface ParseMissionBlocksOptions +``` + +### `parsePlanSubmittedEvent` + +`function` — Parses both direct sandbox events (`data.plan`) and session envelopes (`properties.plan`). + +```ts +(event: unknown) => ParsePlanSubmittedResult +``` + +### `ParsePlanSubmittedResult` + +`type` — Resolve the result of parsing a plan submission into success with value or failure with error + +```ts +type ParsePlanSubmittedResult +``` + +### `parseSessionStreamEnvelope` + +`function` — Reconstruct the flat MissionStreamEvent from a broadcast envelope of shape `{ type, data: { ...missionFields } }` (transports may also stamp routing fields like workspaceId/threadId into `data`). + +```ts +(raw: unknown) => MissionStreamEvent | null +``` + +### `peekWorkspaceSandbox` + +`function` — Read-only twin of {@link ensureWorkspaceSandbox}: report whether a workspace's box exists and is running, WITHOUT provisioning, resuming, or bootstrapping anything. + +```ts +(shell: SandboxRuntimeConfig, options: { workspaceId: string; userId?: string | undefined; }) => Promise) => ChatInteraction | null +``` + +### `persistedPartToPlan` + +`function` — Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan + +```ts +(part: Record) => ChatPlan | null +``` + +### `PLAN_SUBMITTED_EVENT` + +`const` — Durable-plan application-shell contract. + +```ts +"plan.submitted" +``` + +### `planAuthorityIdempotencyKey` + +`function` — Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision + +```ts +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string +``` + +### `planCommandKey` + +`function` — Generate a unique key string for a plan command using plan ID, revision, and decision + +```ts +(planId: string, revision: number, decision: DurablePlanDecision) => string +``` + +### `planEffectKey` + +`function` — Generate a unique string key representing the effect of a plan decision within a given scope and revision + +```ts +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string +``` + +### `planFollowUpTurnId` + +`function` — Generate a unique follow-up turn ID based on the plan ID and its outcome + +```ts +(planId: string, outcome: "approved" | "rejected") => string +``` + +### `PlanLimit` + +`interface` — Plan limits — a PARAMETER per product (dollar allowance, concurrency, overage policy). + +```ts +interface PlanLimit +``` + +### `PlanOutcome` + +`type` — Outcome of running the whole plan from the cursor to the end. + +```ts +type PlanOutcome +``` + +### `planPartKey` + +`function` — Generate a unique key string for a given plan identifier + +```ts +(planId: string) => string +``` + +### `planRevisionKey` + +`function` — Generate a unique key string for a plan based on its ID and revision number + +```ts +(planId: string, revision: number) => string +``` + +### `planToPersistedPart` + +`function` — Resolve a ChatPlan into its persisted part representation for storage or transmission + +```ts +(plan: ChatPlan) => ChatPlanPersistedPart +``` + +### `PlatformBalanceInfo` + +`interface` — Spendable balance for a platform user. + +```ts +interface PlatformBalanceInfo +``` + +### `PlatformBalanceManager` + +`interface` — Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking + +```ts +interface PlatformBalanceManager +``` + +### `PlatformBalanceManagerOptions` + +`interface` — Define configuration options for managing platform balance based on billing plans + +```ts +interface PlatformBalanceManagerOptions +``` + +### `PlatformBillingClient` + +`interface` — The platform billing transport — the product wires these to id.tangle.tools (or any balance backend). + +```ts +interface PlatformBillingClient +``` + +### `PlatformIdentity` + +`interface` — A user's resolved platform identity (from the app's SSO account store). + +```ts +interface PlatformIdentity +``` + +### `PlatformProductUsage` + +`interface` — Per-product spend aggregate. + +```ts +interface PlatformProductUsage +``` + +### `PreflightProbe` + +`interface` — A liveness probe. + +```ts +interface PreflightProbe +``` + +### `PreflightProbeResult` + +`interface` — One probe's outcome. + +```ts +interface PreflightProbeResult +``` + +### `PreflightProbeVerdict` + +`interface` — Per-probe verdict enriched with the resolved criticality and measured latency. + +```ts +interface PreflightProbeVerdict +``` + +### `PreflightReport` + +`interface` — Aggregate of every probe verdict plus the overall pass/fail decision. + +```ts +interface PreflightReport +``` + +### `PreparedDurableInteractionAnswer` + +`interface` — Define a structured response containing scope, settlement, and intent for durable interactions + +```ts +interface PreparedDurableInteractionAnswer +``` + +### `PRESET_MIGRATION_SQL` + +`const` — Plain DDL for the preset schema — run by a consumer to create the tables with ZERO drizzle (`for (const sql of PRESET_MIGRATION_SQL) await db.prepare(sql).run()`, or paste into a `.sql` migration). + +```ts +readonly string[] +``` + +### `PRESET_TABLES` + +`const` — The preset table + column names — the contract the DDL, Drizzle schema, handlers, and accessor share. + +```ts +{ readonly proposals: { readonly name: "proposals"; readonly columns: { readonly id: "id"; readonly workspaceId: "works… +``` + +### `PresetBillingOptions` + +`interface` — Define preset billing options including database, provisioner, encryption key, budget, and optional settings + +```ts +interface PresetBillingOptions +``` + +### `PresetKnowledgeAccessorOptions` + +`interface` — Define options for accessing preset knowledge scoped to a specific workspace and configuration + +```ts +interface PresetKnowledgeAccessorOptions +``` + +### `PresetToolHandlerOptions` + +`interface` — Define configuration options for handling preset tools including database, vault, and optional utilities + +```ts +interface PresetToolHandlerOptions +``` + +### `producedFromToolEvents` + +`function` — Bridge the app-tool side channel's produced events into the runtime-event shape agent-eval's `extractProducedState` reads. + +```ts +(events: readonly AppToolProducedEvent[]) => RuntimeEventLike[] +``` + +### `ProducedState` + +`interface` — Everything observable about what a run actually produced. + +```ts +interface ProducedState +``` + +### `ProfileComposeOptions` + +`interface` — Define options for composing a user profile including prompts, files, servers, and name + +```ts +interface ProfileComposeOptions +``` + +### `PromptInputPart` + +`type` — Extract a single element type from the array parameter of SandboxInstance's streamPrompt method + +```ts +type PromptInputPart +``` + +### `ProviderResolutionConfig` + +`interface` — Define configuration options for resolving a provider and its model with optional API keys and routing details + +```ts +interface ProviderResolutionConfig +``` + +### `PROVISION_PAYLOAD_MAX_BYTES` + +`const` — Gate on the provision body: the platform orchestrator caps the create payload at 256 KiB; 240 KB leaves headroom for transport framing. + +```ts +240000 +``` + +### `ProvisionPayloadSections` + +`interface` — The provision-payload sections the size gates need to see. + +```ts +interface ProvisionPayloadSections +``` + +### `ProvisionProfileSection` + +`interface` — Structural slice of the profile the payload gate reads: it only measures the profile's serialized size and names `resources.files` in the breakdown, so callers composing a payload outside the SDK (pr… + +```ts +interface ProvisionProfileSection +``` + +### `pumpBufferedTurn` + +`function` — Drive a turn to completion regardless of the live client, when you OWN the producer as an `AsyncIterable`. + +```ts +(opts: PumpBufferedTurnOptions) => Promise +``` + +### `PumpBufferedTurnOptions` + +`interface` — Define options to pump data from an asynchronous iterable source with buffered turn control + +```ts +interface PumpBufferedTurnOptions +``` + +### `PutObjectOptions` + +`interface` — Options for a single {@link ObjectStore.put}. + +```ts +interface PutObjectOptions +``` + +### `questionInteractionContentSignature` + +`function` — Content identity for duplicate safety nets. + +```ts +(interaction: ChatInteraction) => string | null +``` + +### `R2LikeBucket` + +`interface` — The minimal slice of Cloudflare's `R2Bucket` this module calls. + +```ts +interface R2LikeBucket +``` + +### `R2LikeObjectBody` + +`interface` — Body shape of a retrieved object (structural match of R2's `R2ObjectBody`). + +```ts +interface R2LikeObjectBody +``` + +### `R2LikeObjectHead` + +`interface` — Head/metadata shape of a stored object (structural match of R2's `R2Object`). + +```ts +interface R2LikeObjectHead +``` + +### `RateLimitResult` + +`interface` — Describe the outcome of a rate limit check including allowance, remaining count, and reset time + +```ts +interface RateLimitResult +``` + +### `readCookieValue` + +`function` — Read + decode one cookie from a Cookie request header; null when absent. + +```ts +(cookieHeader: string | null, name: string) => string | null +``` + +### `readSandboxBinaryBytes` + +`function` — Reads a sandbox file as base64 and decodes it, verifying the decoded byte length against `expectedSize` (from a prior {@link statSandboxFileSize}). + +```ts +(box: SandboxExecChannel, absolutePath: string, expectedSize: number, options?: SandboxExecOptions | undefined) => Prom… +``` + +### `readSecret` + +`function` — Resolve a secret value from the store by its name and return the outcome asynchronously + +```ts +(store: SecretStore, name: string) => Promise> +``` + +### `readToolArgs` + +`function` — Read a tool's argument object from the request body, tolerant of MCP host aliases (`args` / `arguments`) or a bare body. + +```ts +(request: Request) => Promise +``` + +### `recordDurableInteractionAnswer` + +`function` — Record an accepted/declined answer in the projection. + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: "declined" | "accepted", answers?: R… +``` + +### `recordDurableInteractionCancel` + +`function` — Apply a cancel event. + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… +``` + +### `RedactedDocSegment` + +`type` — A redacted document segment: literal text, or a masked span with the original kept ENCRYPTED for an authorized reveal. + +```ts +type RedactedDocSegment +``` + +### `RedactedDocument` + +`interface` — Define a document composed of multiple redacted content segments + +```ts +interface RedactedDocument +``` + +### `redactForIngestion` + +`function` — One-way PII scrub for telemetry/ingestion. + +```ts +(value: unknown, options?: RedactForIngestionOptions) => unknown +``` + +### `RedactForIngestionOptions` + +`interface` — Define options to customize sensitive data redaction patterns and key names for ingestion + +```ts +interface RedactForIngestionOptions +``` + +### `RedactionPattern` + +`interface` — A named PII pattern. + +```ts +interface RedactionPattern +``` + +### `RedactionSpan` + +`interface` — A detected PII span in a source string. + +```ts +interface RedactionSpan +``` + +### `reduceMissionEvents` + +`function` — Fold a whole event sequence into a Map. + +```ts +(events: MissionStreamEvent[], seed?: Map | undefined) => Map +``` + +### `renderHistogram` + +`function` — ASCII histogram for multi-run samples (eval latencies, costs, scores). + +```ts +(values: number[], opts?: { buckets?: number | undefined; width?: number | undefined; unit?: string | undefined; format… +``` + +### `RenderUiArgs` + +`interface` — Define arguments required to render a UI including title and schema + +```ts +interface RenderUiArgs +``` + +### `RenderUiResult` + +`interface` — Describe the result of rendering UI including the artifact path and exact persisted content + +```ts +interface RenderUiResult +``` + +### `renderWaterfall` + +`function` — ASCII waterfall cascade — the default artifact for explaining a flow. + +```ts +(trace: FlowTrace, opts?: { width?: number | undefined; } | undefined) => string +``` + +### `replayTurnEvents` + +`function` — Yield buffered events after `fromSeq`, then keep polling while the turn is still 'running' until it completes, errors, or times out. + +```ts +(opts: ReplayTurnEventsOptions) => AsyncGenerator +``` + +### `ReplayTurnEventsOptions` + +`interface` — Define options for replaying turn events with control over sequence, polling, and timeout + +```ts +interface ReplayTurnEventsOptions +``` + +### `RequestContext` + +`interface` — Define the context of a request including IP address, user agent, timestamp, and request ID + +```ts +interface RequestContext +``` + +### `requireString` + +`function` — Narrow one required string field, 400 if missing/empty. + +```ts +(body: JsonObject, field: string) => string | Response +``` + +### `resetClientCache` + +`function` — Reset the client cache to clear stored data and force fresh retrieval + +```ts +() => void +``` + +### `resolveChatTurn` + +`function` — Resolve a chat turn by determining message reuse and constructing user message parts + +```ts +(input: { existingMessages: PersistedChatMessageForTurn[]; userContent: string; turnId?: string | undefined; }) => Reso… +``` + +### `ResolvedAgentProfile` + +`interface` — The agent's resolved profile surfaces for one turn — the things a delivered / certified `AgentProfile` can change. + +```ts +interface ResolvedAgentProfile +``` + +### `ResolvedChatTurn` + +`interface` — Represent a chat turn with resolved user message insertion and prior message context + +```ts +interface ResolvedChatTurn +``` + +### `ResolvedModel` + +`interface` — Represent a fully configured model with optional API key and base URL for sandbox platform integration + +```ts +interface ResolvedModel +``` + +### `ResolvedSessionHarness` + +`interface` — Represent resolved session state including harness, lock status, and swap attempt flag + +```ts +interface ResolvedSessionHarness +``` + +### `ResolvedTangleExecutionKey` + +`interface` — Define a resolved key combining an API key with its Tangle execution source + +```ts +interface ResolvedTangleExecutionKey +``` + +### `ResolvedToolCapabilities` + +`interface` — Describe resolved capabilities including proposal types and product tool groups to expose + +```ts +interface ResolvedToolCapabilities +``` + +### `resolveIntegrationAction` + +`function` — Resolve an MCP tool name (the opaque `int_…` catalog name the agent calls) into the dotted hub action path. + +```ts +(toolName: string) => ParsedIntegrationAction | undefined +``` + +### `ResolveInteractionConnectionArgs` + +`interface` — Define arguments required to resolve interaction connections based on request and intent + +```ts +interface ResolveInteractionConnectionArgs +``` + +### `resolveModel` + +`function` — Resolve and return the appropriate model configuration based on provider settings and optional overrides + +```ts +(config: ProviderResolutionConfig | undefined, override?: { model?: string | undefined; modelApiKey?: string | undefine… +``` + +### `ResolveModelOptions` + +`interface` — Resolve options for model configuration including environment variables and default router base URL + +```ts +interface ResolveModelOptions +``` + +### `resolveSandboxClientCredentials` + +`function` — Resolve sandbox client credentials based on environment and provided options asynchronously + +```ts +(options?: ResolveSandboxClientCredentialsOptions) => Promise +``` + +### `ResolveSandboxClientCredentialsOptions` + +`interface` — Resolve options for obtaining sandbox client credentials from environment variables and classification + +```ts +interface ResolveSandboxClientCredentialsOptions +``` + +### `resolveSessionHarness` + +`function` — Resolve the harness for a turn, enforcing the session lock. + +```ts +(input?: ResolveSessionHarnessInput) => ResolvedSessionHarness +``` + +### `ResolveSessionHarnessInput` + +`interface` — Resolve input options to determine the appropriate session harness to use + +```ts +interface ResolveSessionHarnessInput +``` + +### `resolveTangleDevOrUserKey` + +`function` — Shared dev-aware Tangle key resolution. + +```ts +(opts: ResolveTangleDevOrUserKeyOptions) => Promise +``` + +### `ResolveTangleDevOrUserKeyOptions` + +`interface` — Resolve options for retrieving a Tangle developer or user API key based on environment and context + +```ts +interface ResolveTangleDevOrUserKeyOptions +``` + +### `resolveTangleExecutionEnvironment` + +`function` — Resolve the current Tangle execution environment based on provided or process environment variables + +```ts +(env?: Record) => TangleExecutionEnvironment +``` + +### `resolveTangleModelConfig` + +`function` — Resolve the model config from env. + +```ts +(opts?: ResolveModelOptions) => TangleModelConfig +``` + +### `resolveToolCapabilities` + +`function` — Resolve an enabled capability-id set against a taxonomy into the concrete tool surface. + +```ts +(opts: ResolveToolCapabilitiesOptions) => ResolvedToolCapabilities +``` + +### `ResolveToolCapabilitiesOptions` + +`interface` — Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs + +```ts +interface ResolveToolCapabilitiesOptions +``` + +### `resolveToolId` + +`function` — Resolve a unique tool identifier from various possible properties or generate a fallback ID + +```ts +(part: JsonRecord) => string +``` + +### `resolveToolName` + +`function` — Resolve the tool name from a JSON record using tool, name, or a default value + +```ts +(part: JsonRecord) => string +``` + +### `resolveUserTangleExecutionKey` + +`function` — Resolve the user-facing Tangle API key for model execution. + +```ts +(opts: ResolveUserTangleExecutionKeyOptions) => Promise +``` + +### `resolveUserTangleExecutionKeyForUser` + +`function` — Resolve the Tangle execution key for a specified user using provided environment and API key options + +```ts +(opts: ResolveUserTangleExecutionKeyForUserOptions) => Promise +``` + +### `ResolveUserTangleExecutionKeyForUserOptions` + +`interface` — Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters + +```ts +interface ResolveUserTangleExecutionKeyForUserOptions +``` + +### `ResolveUserTangleExecutionKeyOptions` + +`interface` — Resolve options for retrieving user API keys within a specific Tangle execution environment + +```ts +interface ResolveUserTangleExecutionKeyOptions +``` + +### `respondToSessionInteraction` + +`function` — Resolves one interaction. + +```ts +(connection: SidecarInteractionsConnection, response: { id: string; outcome: "declined" | "cancelled" | "accepted"; dat… +``` + +### `restrictTaxonomy` + +`function` — Restrict a taxonomy to a subset of proposal types, intersecting the regulated subset too — the regulated label survives restriction, so a narrowed agent can never launder a regulated type into an unr… + +```ts +(taxonomy: AppToolTaxonomy, allowed: readonly string[]) => AppToolTaxonomy +``` + +### `RetryableStepError` + +`class` — Thrown by a {@link SandboxDispatch} for a TRANSIENT failure (platform blip, exec-time network fault) that should be re-attempted. + +```ts +class RetryableStepError +``` + +### `RevealResult` + +`interface` — Describe the outcome of a reveal operation including success status, value, and failure reason + +```ts +interface RevealResult +``` + +### `revealSpan` + +`function` — Reveal one redacted span's original, gated + audited. + +```ts +(doc: RedactedDocument, spanId: string, options: RevealSpanOptions) => Promise +``` + +### `RevealSpanOptions` + +`interface` — Define options to decrypt, authorize, and audit the reveal of a span segment + +```ts +interface RevealSpanOptions +``` + +### `reviewCandidate` + +`function` — The default gate — agent-knowledge's propose-don't-apply reviewer posture as a confidence threshold. + +```ts +(candidate: KnowledgeCandidate, minConfidence: number) => KnowledgeGateVerdict +``` + +### `routerChatProbe` + +`function` — Probe an OpenAI-compatible LLM router with one cheap `POST /chat/completions` (`max_tokens: 1`). + +```ts +(config: RouterChatProbeConfig) => PreflightProbe +``` + +### `RouterChatProbeConfig` + +`interface` — Define configuration options for probing an LLM router with authentication and model details + +```ts +interface RouterChatProbeConfig +``` + +### `RouterModel` + +`interface` — Model catalogue — computed live from the Tangle Router, never hand-curated. + +```ts +interface RouterModel +``` + +### `runAppToolLoop` + +`function` — Run the bounded tool loop and return the final text + every executed tool outcome. + +```ts +(opts: RunToolLoopOptions) => Promise +``` + +### `runPreflight` + +`function` — Run every probe (concurrently), time each, and fold into a report. + +```ts +(probes: PreflightProbe[]) => Promise +``` + +### `runSandboxPrompt` + +`function` — Resolve a sandbox prompt by streaming and aggregating message parts into a complete string + +```ts +(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… +``` + +### `runSandboxToolPathSetup` + +`function` — Resolve the sandbox environment PATH setup by executing the configuration script with given options + +```ts +(box: SandboxInstance, options: SandboxToolPathOptions) => Promise> +``` + +### `RuntimeEventLike` + +`type` — The subset of runtime stream events `extractProducedState` consumes. + +```ts +type RuntimeEventLike +``` + +### `RuntimeExecutorOptions` + +`interface` — Define options for executing runtime tasks with a trusted per-turn context + +```ts +interface RuntimeExecutorOptions +``` + +### `safeParseAssetSpec` + +`function` — Safe parse — returns null instead of throwing. + +```ts +(raw: unknown) => AssetSpec | null +``` + +### `SandboxApiCredentials` + +`interface` — Define credentials required to access the sandbox API environment + +```ts +interface SandboxApiCredentials +``` + +### `sandboxAuthProbe` + +`function` — Probe the sandbox API with a cheap authed `GET /v1/sandboxes?limit=1`. + +```ts +(config: SandboxAuthProbeConfig) => PreflightProbe +``` + +### `SandboxAuthProbeConfig` + +`interface` — Define configuration options for probing sandbox authentication endpoints + +```ts +interface SandboxAuthProbeConfig +``` + +### `SandboxBuildContext` + +`interface` — Define the context for building a sandbox including workspace, integrations, and optional user ID + +```ts +interface SandboxBuildContext +``` + +### `SandboxClientCredentials` + +`interface` — Define client credentials for accessing the sandbox environment with API key and base URL + +```ts +interface SandboxClientCredentials +``` + +### `SandboxCredentialEnvironment` + +`type` — Sandbox credential policy reuses the canonical execution-environment union (development/test/staging/production) so env classification stays in one place (see resolveTangleExecutionEnvironment in run… + +```ts +type SandboxCredentialEnvironment +``` + +### `SandboxDispatch` + +`type` — A side-effecting unit of per-step work. + +```ts +type SandboxDispatch +``` + +### `SandboxDispatchDoneResult` + +`interface` — Define the result of a completed sandbox dispatch including artifact reference and optional cost details + +```ts +interface SandboxDispatchDoneResult +``` + +### `SandboxDispatchInProgressResult` + +`interface` — The dispatched step's detached session is still executing on the platform. + +```ts +interface SandboxDispatchInProgressResult +``` + +### `SandboxDispatchInput` + +`interface` — Define input parameters for dispatching a mission step in the sandbox environment + +```ts +interface SandboxDispatchInput +``` + +### `SandboxDispatchResult` + +`type` — Resolve the result of a sandbox dispatch as done or in progress + +```ts +type SandboxDispatchResult +``` + +### `SandboxExecChannel` + +`interface` — The `box.exec` surface these helpers use — structural, so a caller can pass the sandbox SDK's `SandboxInstance` directly or a narrower test double. + +```ts +interface SandboxExecChannel +``` + +### `SandboxExecOptions` + +`interface` — Define options to execute code within a sandbox environment with optional session control + +```ts +interface SandboxExecOptions +``` + +### `SandboxFileBytesOutcome` + +`type` — Represent the outcome of reading sandbox file bytes with success status and corresponding data or error + +```ts +type SandboxFileBytesOutcome +``` + +### `SandboxFileSizeOutcome` + +`type` — Resolve the outcome of a sandbox file size check with success status and value or error message + +```ts +type SandboxFileSizeOutcome +``` + +### `SandboxPermissionLevel` + +`type` — Define permission levels for sandbox access and control + +```ts +type SandboxPermissionLevel +``` + +### `SandboxResourceConfig` + +`interface` — Define configuration parameters for sandbox resource allocation and lifecycle management + +```ts +interface SandboxResourceConfig +``` + +### `SandboxRestoreSpec` + +`interface` — Define the specification for restoring a sandbox from a snapshot or another sandbox ID + +```ts +interface SandboxRestoreSpec +``` + +### `SandboxRuntimeAuthRefreshError` + +`class` — Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name + +```ts +class SandboxRuntimeAuthRefreshError +``` + +### `SandboxRuntimeConfig` + +`interface` — Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions + +```ts +interface SandboxRuntimeConfig +``` + +### `SandboxRuntimeConnection` + +`interface` — Define a connection configuration for sandbox runtime including URL and optional server-side auth token + +```ts +interface SandboxRuntimeConnection +``` + +### `SandboxScope` + +`interface` — Define a scope containing workspace and optional user identifiers for sandbox environments + +```ts +interface SandboxScope +``` + +### `SandboxStepTransition` + +`type` — Define transitions marking the start or finish of a sandbox step with associated details + +```ts +type SandboxStepTransition +``` + +### `SandboxTerminalTokenOptions` + +`interface` — Define options for generating a sandbox terminal token including secret and expiration settings + +```ts +interface SandboxTerminalTokenOptions +``` + +### `SandboxTerminalTokenResult` + +`interface` — Provide token and expiration details for a sandbox terminal session + +```ts +interface SandboxTerminalTokenResult +``` + +### `SandboxTerminalTokenSubject` + +`type` — Resolve the identity type used for sandbox terminal token subjects + +```ts +type SandboxTerminalTokenSubject +``` + +### `SandboxTerminalWsMatch` + +`interface` — Define the structure for matching a sandbox terminal WebSocket with workspace and path details + +```ts +interface SandboxTerminalWsMatch +``` + +### `sandboxToolBinDir` + +`function` — Resolve the binary directory path for a sandbox tool based on provided options + +```ts +(options: SandboxToolPathOptions) => string +``` + +### `sandboxToolPath` + +`function` — Resolve the file system path to a specified sandbox tool based on given options + +```ts +(options: SandboxToolPathOptions & { toolName: string; }) => string +``` + +### `SandboxToolPathOptions` + +`interface` — Define options for resolving sandbox tool paths including appName, baseDir, and binDir + +```ts +interface SandboxToolPathOptions +``` + +### `sandboxToolRootDir` + +`function` — Resolve the root directory path for a sandbox tool based on provided options + +```ts +(options: SandboxToolPathOptions) => string +``` + +### `SandboxToolSpec` + +`interface` — Define the specification for a sandbox tool including its name, content, and optional executability + +```ts +interface SandboxToolSpec +``` + +### `SatisfiedBy` + +`type` — What kind of produced state can satisfy a requirement structurally. + +```ts +type SatisfiedBy +``` + +### `SatisfiedByRule` + +`type` — A declarative rule for satisfying a requirement from workspace state. + +```ts +type SatisfiedByRule +``` + +### `ScheduleFollowupArgs` + +`interface` — Define arguments required to schedule a follow-up with optional priority + +```ts +interface ScheduleFollowupArgs +``` + +### `ScheduleFollowupResult` + +`interface` — Define the result structure for scheduling a follow-up with unique identification and due date + +```ts +interface ScheduleFollowupResult +``` + +### `ScopedMcpServerEntryOptions` + +`interface` — Options for a per-document/scoped MCP channel entry (design-canvas, sequences, …). + +```ts +interface ScopedMcpServerEntryOptions +``` + +### `ScopedTokenResult` + +`interface` — Represent a token with its expiration date and associated scope + +```ts +interface ScopedTokenResult +``` + +### `SecretStore` + +`interface` — Define methods to create, update, retrieve, and delete secrets asynchronously + +```ts +interface SecretStore +``` + +### `secretStoreFromClient` + +`function` — Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell + +```ts +(shell: SandboxRuntimeConfig) => SecretStore +``` + +### `SecurityHeaderOptions` + +`interface` — Define options for configuring security-related HTTP headers including disclaimers and retention labels + +```ts +interface SecurityHeaderOptions +``` + +### `serializeCookie` + +`function` — Serialize a Set-Cookie header value: `name=encodeURIComponent(value)` plus attributes in Path / HttpOnly / SameSite / Max-Age / Secure order. + +```ts +(value: string, opts: CookieOptions) => string +``` + +### `SetStepStatusPatch` + +`interface` — Define a patch to update the status and optional metadata of a step in a process + +```ts +interface SetStepStatusPatch +``` + +### `SharedBillingState` + +`interface` — Define shared billing state including user ID, plan, balances, concurrency, and overage permission + +```ts +interface SharedBillingState +``` + +### `shellQuote` + +`function` — Wraps a value in single quotes for `sh`, closing and reopening the quote around each embedded quote (`'` → `'"'"'`). + +```ts +(value: string) => string +``` + +### `SidecarInteractionsConnection` + +`interface` — Where and how to reach one session's interaction registry. + +```ts +interface SidecarInteractionsConnection +``` + +### `SidecarInteractionsError` + +`interface` — Describe error details including code, message, and upstream HTTP status for sidecar interactions + +```ts +interface SidecarInteractionsError +``` + +### `SidecarInteractionsResult` + +`type` — Represent the outcome of sidecar interactions with success or error details + +```ts +type SidecarInteractionsResult +``` + +### `signObjectUrl` + +`function` — Mint a signed query string (`?key=…&exp=…&sig=…`) authorizing a download of `key` until `exp`. + +```ts +({ key, exp, secret }: SignObjectUrlArgs) => Promise +``` + +### `SignObjectUrlArgs` + +`interface` — Arguments to {@link signObjectUrl}. + +```ts +interface SignObjectUrlArgs +``` + +### `snapHarnessToModel` + +`function` — Keep the harness when it can run `modelId`; else the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `snapModelToHarness` + +`function` — Keep `modelId` when the harness can run it; else the harness's best compatible catalog id (preferred patterns in order, highest version). + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `splitDeferredProfileFiles` + +`function` — Split profile files into inline deferred files and a lean profile without them + +```ts +(profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; } +``` + +### `stablePlanReceipt` + +`function` — Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision + +```ts +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick[], answersByInteractionId: Readonly>) => Record Promise… +``` + +### `stepAgentActivity` + +`function` — Re-validate an `agentActivity` lane that crossed a JSON boundary. + +```ts +(step: object) => StepAgentActivity[] +``` + +### `StepAgentActivity` + +`interface` — Canonical shape for the per-step agent-activity lane — the delegated runs (delegation MCP registry entries) a mission step spawned, journaled onto the step so a live UI can render "what the agent is… + +```ts +interface StepAgentActivity +``` + +### `StepGateClassification` + +`interface` — Product classification of one step. + +```ts +interface StepGateClassification +``` + +### `stepGateProposalId` + +`function` — Deterministic proposal id for a step-classification gate. + +```ts +(missionId: string, stepId: string) => string +``` + +### `StepOutcome` + +`type` — Outcome of running a single step. + +```ts +type StepOutcome +``` + +### `StepSpanContext` + +`interface` — Define context information for a step span including trace, span, and parent span identifiers + +```ts +interface StepSpanContext +``` + +### `StoppedSandboxResumeFailure` + +`interface` — Describe the failure details when resuming a stopped sandbox instance + +```ts +interface StoppedSandboxResumeFailure +``` + +### `StoppedSandboxResumeRecovery` + +`interface` — Define the structure for resuming a stopped sandbox with replacement key and optional restore options + +```ts +interface StoppedSandboxResumeRecovery +``` + +### `StorableHarnessPartKind` + +`type` — Every canonical harness wire-part kind must be storable — compile-time guarantee that a new agent-interface part kind cannot silently fall out of the persisted vocabulary. + +```ts +type StorableHarnessPartKind +``` + +### `StorageConfig` + +`interface` — S3-compatible storage provider configuration (BYOS3 - Bring Your Own S3). + +```ts +interface StorageConfig +``` + +### `storeSecret` + +`function` — Resolve storing a secret by creating or updating it in the given SecretStore + +```ts +(store: SecretStore, name: string, value: string) => Promise> +``` + +### `streamAppToolLoop` + +`function` — Streaming bounded tool loop: yields each raw turn event (the caller maps + telemetries + re-emits it) and each executed `tool_result`; emits one `capped` if it stops for any non-completed reason with… + +```ts +(opts: StreamToolLoopOptions) => AsyncGenerator, void, unknown> +``` + +### `StreamAppToolLoopOptions` + +`interface` + +```ts +interface StreamAppToolLoopOptions +``` + +### `StreamEvent` + +`interface` — Define an event object carrying a type and optional JSON data payload + +```ts +interface StreamEvent +``` + +### `StreamLoopYield` + +`type` + +```ts +type StreamLoopYield +``` + +### `streamSandboxPrompt` + +`function` — Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options + +```ts +(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… +``` + +### `StreamSandboxPromptOptions` + +`interface` — Define options for configuring and controlling a streaming sandbox prompt session + +```ts +interface StreamSandboxPromptOptions +``` + +### `SubmitProposalArgs` + +`interface` — Define the arguments required to submit a proposal including type, title, description, and approval status + +```ts +interface SubmitProposalArgs +``` + +### `SubmitProposalResult` + +`interface` — Describe the result of submitting a proposal including deduplication and execution status + +```ts +interface SubmitProposalResult +``` + +### `summarize` + +`function` — Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max + +```ts +(values: number[]) => DistributionSummary +``` + +### `SurfaceKindDefinition` + +`interface` — One registered surface kind. + +```ts +interface SurfaceKindDefinition +``` + +### `SurfaceMcpServer` + +`type` — The only MCP entry shape an overlay may carry: the server-built bridge entry from ../tools/mcp (transport, url, headers, and capability token all assembled server-side). + +```ts +type SurfaceMcpServer +``` + +### `SurfaceMergeBase` + +`interface` — Base-profile slice the merge reads/writes. + +```ts +interface SurfaceMergeBase +``` + +### `SurfaceOverlay` + +`interface` — What one surface contributes to the agent profile for a single turn. + +```ts +interface SurfaceOverlay +``` + +### `SurfacePermissionValue` + +`type` — Sandbox permission posture values, ranked deny > ask > allow for merging. + +```ts +type SurfacePermissionValue +``` + +### `SurfaceRegistry` + +`interface` — Resolve and build the overlay for a given surface kind within a turn context + +```ts +interface SurfaceRegistry +``` + +### `syncSandboxMemberAdd` + +`function` — Resolve adding a user with a specific role to a sandbox and return the operation outcome + +```ts +(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> +``` + +### `syncSandboxMemberRemove` + +`function` — Remove a member from the sandbox while preserving their home directory and handle the outcome + +```ts +(box: SandboxInstance, userId: string) => Promise> +``` + +### `syncSandboxMemberRole` + +`function` — Synchronize a sandbox member's role by updating permissions based on the provided role mapping + +```ts +(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> +``` + +### `TangleBillingEnforcementOptions` + +`interface` — Define options for configuring billing enforcement environment variables and overrides + +```ts +interface TangleBillingEnforcementOptions +``` + +### `TangleExecutionEnvironment` + +`type` — Define the environment context for executing Tangle operations + +```ts +type TangleExecutionEnvironment +``` + +### `TangleExecutionKeyError` + +`class` — Represent execution key errors with specific codes and HTTP status information + +```ts +class TangleExecutionKeyError +``` + +### `TangleExecutionKeyErrorCode` + +`type` — Define error codes for Tangle execution key issues related to API key and account connection + +```ts +type TangleExecutionKeyErrorCode +``` + +### `tangleExecutionKeyHttpError` + +`function` — Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null + +```ts +(error: unknown) => TangleExecutionKeyHttpError | null +``` + +### `TangleExecutionKeyHttpError` + +`interface` — Represent HTTP error response containing status, error message, and specific error code + +```ts +interface TangleExecutionKeyHttpError +``` + +### `TangleExecutionKeySource` + +`type` — Resolve the source of the Tangle execution key as either local environment or user input + +```ts +type TangleExecutionKeySource +``` + +### `TangleModelConfig` + +`interface` — Resolve the model config a Tangle agent's sandbox/runtime runs on. + +```ts +interface TangleModelConfig +``` + +### `TaskGold` + +`interface` + +```ts +interface TaskGold +``` + +### `TcloudKeyClient` + +`interface` — The subset of the `@tangle-network/tcloud` `TCloudClient` the provisioner uses — declared with METHOD syntax so the real client (whose `product` is a narrow union and whose budgets are `number | null… + +```ts +interface TcloudKeyClient +``` + +### `terminalizeDanglingAssistantToolUpdates` + +`function` — Finalizes, then folds each synthetic tool settlement back into `partMap` and returns just those updates — the shape a streaming loop needs to emit closing `message.part.updated` frames for tools the… + +```ts +(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[] +``` + +### `terminalizeDanglingToolPart` + +`function` — Closes a tool part left `running` when a stream ended abnormally: settles it as a terminal `error` and stamps `state.metadata.terminalized` so the synthetic settlement is distinguishable from a real… + +```ts +(part: JsonRecord) => JsonRecord +``` + +### `terminalizeDanglingToolParts` + +`function` — Resolve dangling tool parts into terminal forms within the given JSON records array + +```ts +(parts: JsonRecord[]) => JsonRecord[] +``` + +### `TerminalProxyIdentity` + +`interface` — Define identity details for a terminal proxy including user, workspace, and sandbox identifiers + +```ts +interface TerminalProxyIdentity +``` + +### `terminalTokenFromRequest` + +`function` — Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields + +```ts +(headers: Headers) => string | null +``` + +### `themeColor` + +`function` — Wrap a channel triple in `hsl()`; pass through values already in a color form. + +```ts +(value: string) => string +``` + +### `ThemeContractMiss` + +`interface` — Describe a missing theme contract variable and where it was referenced + +```ts +interface ThemeContractMiss +``` + +### `ThemeContractOptions` + +`interface` — Define options for scanning source directories and CSS token files in a theme contract + +```ts +interface ThemeContractOptions +``` + +### `ThemeContractResult` + +`interface` — Describe the result of validating a theme contract including success status and missing items + +```ts +interface ThemeContractResult +``` + +### `themeToCssVars` + +`function` — Map a theme to the full CSS-variable set (shadcn triples + canvas/sequences aliases + canvas surface). + +```ts +(theme: AgentAppTheme) => Record +``` + +### `threadTitleFromMessage` + +`function` — Thread titles come from the first message — keep the list scannable by storing only its first non-empty line, capped at 80 chars, never the whole multi-page prompt. + +```ts +(message: string) => string +``` + +### `TimedEvent` + +`interface` — Represent a timed event with a timestamp and associated event data + +```ts +interface TimedEvent +``` + +### `timedEventsFromLines` + +`function` — Parse stored turn-event lines (JSON strings with `_t`) into TimedEvents. + +```ts +(lines: string[]) => TimedEvent[] +``` + +### `toChatMessageParts` + +`function` — The typed projection at the `/stream` → `/chat-store` boundary. + +```ts +(parts: Record[]) => ChatMessagePart[] +``` + +### `toLoopEvents` + +`function` — Map an OpenAI-compat streaming chunk iterator to `LoopEvent`s: each content delta → a `text` event; tool-call deltas are accumulated by index across chunks and emitted as one complete `tool_call` eve… + +```ts +(chunks: AsyncIterable) => AsyncIterable +``` + +### `ToolAuthResult` + +`type` — Represent the result of tool authentication with success context or failure response + +```ts +type ToolAuthResult +``` + +### `ToolCapability` + +`interface` — One toggleable tool group in a product's capability registry. + +```ts +interface ToolCapability +``` + +### `ToolHeaderNames` + +`interface` — Header names carrying the server-set per-turn context + the capability token. + +```ts +interface ToolHeaderNames +``` + +### `ToolInputError` + +`class` — A correctable bad-input error a tool handler throws; the HTTP layer maps it to a 4xx with the code, the runtime layer to a failed tool_result. + +```ts +class ToolInputError +``` + +### `ToolLoopEvent` + +`type` + +```ts +type ToolLoopEvent +``` + +### `ToolLoopResult` + +`interface` + +```ts +interface ToolLoopResult +``` + +### `ToolLoopStopReason` + +`type` — Why the loop stopped. + +```ts +type ToolLoopStopReason +``` + +### `traceEnv` + +`function` — The env pair a delegation subprocess inherits — agent-runtime's `readTraceContextFromEnv` reads exactly these names. + +```ts +(ctx: MissionTraceContext | StepSpanContext) => { TRACE_ID: string; PARENT_SPAN_ID: string; } +``` + +### `trimOrNull` + +`function` — Resolve a string by trimming whitespace or returning null if empty or undefined + +```ts +(value: string | null | undefined) => string | null +``` + +### `TURN_EVENTS_MIGRATION_SQL` + +`const` — Schema for the D1 store — append to the product's migrations. + +```ts +"\nCREATE TABLE IF NOT EXISTS turn_events (\n turnId TEXT NOT NULL,\n seq INTEGER NOT NULL,\n event TEXT NOT NULL,\n PR… +``` + +### `TURN_STATUS_SCOPE_MIGRATION_SQL` + +`const` — For deployments whose `turn_status` table predates `scopeId`/`listRunning` — run once to add the column (the CREATE above already includes it for new deployments). + +```ts +"ALTER TABLE turn_status ADD COLUMN scopeId TEXT;" +``` + +### `TurnEventStore` + +`interface` — Manage and query turn events and their lifecycle statuses within a scoped event store + +```ts +interface TurnEventStore +``` + +### `TurnStatus` + +`type` — Resumable chat turns — the router-path answer to "streams resume on disconnect" (issue #27). + +```ts +type TurnStatus +``` + +### `upsertDurableInteractionAsk` + +`function` — Apply an ask event. + +```ts +(store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde… +``` + +### `validateInteractionAnswerBody` + +`function` — Validates the client POST body: `{ id, outcome, data? + +```ts +(body: Record) => InteractionAnswerBodyValidation +``` + +### `VaultKv` + +`type` — The KV-backed vault. + +```ts +type VaultKv +``` + +### `verifyCapabilityToken` + +`function` — Verify a capability token against `userId`. + +```ts +(userId: string, token: string, opts: CapabilityTokenOptions) => Promise +``` + +### `verifyCompletion` + +`function` — Verify whether a run completed the task. + +```ts +(gold: TaskGold, state: ProducedState, checkCorrectness: CorrectnessChecker) => Promise +``` + +### `verifyExpiringCapabilityToken` + +`function` — Verify an expiring token against `subject`: prefix, payload integrity, subject match, and expiry all checked; returns false (never throws) on any failure including a malformed payload. + +```ts +(subject: string, token: string, opts: CapabilityTokenOptions & { now?: (() => number) | undefined; }) => Promise Promise +``` + +### `VerifyObjectUrlResult` + +`type` — Result of {@link verifyObjectUrl}: the canonical key on success, nothing distinguishing on failure (so a rejection leaks no detail). + +```ts +type VerifyObjectUrlResult +``` + +### `verifySandboxTerminalToken` + +`function` — Verify the validity of a sandbox terminal token against the expected identity and options + +```ts +(token: string, expected: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise +``` + +### `verifyTerminalProxyToken` + +`function` — Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp + +```ts +(secret: string, token: string, expected: TerminalProxyIdentity, now?: () => number) => Promise +``` + +### `VideoCaption` + +`interface` — Define video caption segments with start and end times and associated text content + +```ts +interface VideoCaption +``` + +### `VideoContent` + +`interface` — Describe video content including duration, scenes, optional audio, captions, and rendered URL + +```ts +interface VideoContent +``` + +### `VideoContentSchema` + +`const` — Define the schema for validating video content including duration, scenes, audio, captions, and rendered URL + +```ts +ZodObject<{ durationSeconds: ZodNumber; scenes: ZodArray string +``` + +### `weightedComposite` + +`function` — Weighted composite over judge dimensions: `Σ(score_d · w_d) / Σ(w_d)` across the weighted dimensions. + +```ts +(input: WeightedCompositeInput) => WeightedCompositeResult +``` + +### `WithAgentActivity` + +`type` — Step state extended with the activity lane a loader/seed route attaches. + +```ts +type WithAgentActivity +``` + +### `WorkspaceKeyManager` + +`interface` — Manage workspace keys by ensuring, rotating, and tracking usage of active child-key secrets + +```ts +interface WorkspaceKeyManager +``` + +### `WorkspaceKeyManagerOptions` + +`interface` — Define configuration options for managing workspace keys including provisioning, storage, and cryptography + +```ts +interface WorkspaceKeyManagerOptions +``` + +### `WorkspaceKeyRecord` + +`interface` — A stored child-key record (the app's row, shape-normalized). + +```ts +interface WorkspaceKeyRecord +``` + +### `WorkspaceKeyStore` + +`interface` — Persistence seam — the product implements this against its own D1 table. + +```ts +interface WorkspaceKeyStore +``` + +### `WorkspaceModelKeyUsage` + +`interface` — Describe usage and budget details for a workspace model key including expiration and exhaustion status + +```ts +interface WorkspaceModelKeyUsage +``` + +### `WorkspaceSandboxConnectionArgs` + +`interface` — Define arguments required to establish a workspace sandbox connection + +```ts +interface WorkspaceSandboxConnectionArgs +``` + +### `WorkspaceSandboxConnectionHandlerOptions` + +`interface` — Define options to handle workspace sandbox connections with user authentication and access control + +```ts +interface WorkspaceSandboxConnectionHandlerOptions +``` + +### `WorkspaceSandboxEnsureContext` + +`interface` — Define the context containing workspace and user identifiers for sandbox environment operations + +```ts +interface WorkspaceSandboxEnsureContext +``` + +### `WorkspaceSandboxInstanceLike` + +`interface` — Define the shape of a workspace sandbox instance including its connection details and status + +```ts +interface WorkspaceSandboxInstanceLike +``` + +### `WorkspaceSandboxManager` + +`interface` — Manage workspace sandboxes by ensuring their creation and retrieval for specified users + +```ts +interface WorkspaceSandboxManager +``` + +### `WorkspaceSandboxManagerOptions` + +`interface` — Define configuration options for managing and interacting with workspace sandboxes + +```ts +interface WorkspaceSandboxManagerOptions +``` + +### `WorkspaceSandboxRuntimeProxyArgs` + +`interface` — Define arguments for proxying runtime requests within a workspace sandbox environment + +```ts +interface WorkspaceSandboxRuntimeProxyArgs +``` + +### `WorkspaceSandboxRuntimeProxyHandlerOptions` + +`interface` — Define options for handling workspace sandbox runtime proxy including user, access, credentials, and connection retrieval + +```ts +interface WorkspaceSandboxRuntimeProxyHandlerOptions +``` + +### `WorkspaceSandboxTerminalUpgradeHandlerOptions` + +`interface` — Define options to handle user authentication, workspace access, and sandbox API credential retrieval + +```ts +interface WorkspaceSandboxTerminalUpgradeHandlerOptions +``` + +### `WriteProfileFilesOptions` + +`interface` — Define options to control execution timeout, pacing, and retry behavior when writing profile files + +```ts +interface WriteProfileFilesOptions +``` + +### `writeProfileFilesToBox` + +`function` — Write profile files to a sandbox with pacing, retries, and optional execution timeout handling + +```ts +(box: SandboxInstance, files: AgentProfileFileMount[], options?: WriteProfileFilesOptions) => Promise> +``` + + +## `./app-auth` + +Source: `src/app-auth/index.ts` · depends on `platform` + +### `AppAuth` + +`interface` — Define authentication guard with session retrieval and optional SSO handlers for app requests + +```ts +interface AppAuth +``` + +### `AppAuthConfig` + +`interface` — Define configuration settings for app authentication including app name, base URL, secrets, and trusted origins + +```ts +interface AppAuthConfig +``` + +### `AppAuthEmailClient` + +`interface` — Structural slice of a Resend-style client — no `resend` import. + +```ts +interface AppAuthEmailClient +``` + +### `AppAuthEmailConfig` + +`interface` — Define email configuration for app authentication including client, sender, verification, and warning options + +```ts +interface AppAuthEmailConfig +``` + +### `AppAuthInstance` + +`type` — The configured better-auth instance, typed at better-auth's base surface (`handler`, `api`, `$context`, `$Infer`). + +```ts +type AppAuthInstance +``` + +### `AppAuthSchema` + +`interface` — Define the structure for application authentication data including users, sessions, accounts, and verifications + +```ts +interface AppAuthSchema +``` + +### `AppAuthSession` + +`interface` — What `getSession`/guards resolve: better-auth's base session + user rows. + +```ts +interface AppAuthSession +``` + +### `AppAuthSocialConfig` + +`interface` — Define social authentication configuration options for GitHub and Google providers + +```ts +interface AppAuthSocialConfig +``` + +### `AppAuthSocialProviderConfig` + +`interface` — Env-shaped: pass the env vars straight through; the provider is registered only when BOTH values are non-empty, so unset env disables it. + +```ts +interface AppAuthSocialProviderConfig +``` + +### `AppAuthSsoConfig` + +`interface` — Cross-site Tangle SSO wiring. + +```ts +interface AppAuthSsoConfig +``` + +### `createAppAuth` + +`function` — Build the product's better-auth instance plus the request-boundary helpers: `getSession` (Request → session|null), the `createAuthGuard` quartet (`requireUser` 302, `requireApiUser` JSON 401, `requir… + +```ts +(config: AppAuthConfig) => AppAuth +``` + + +## `./assets` + +Source: `src/assets/index.ts` + +### `ApprovalEvent` + +`interface` — Describe an approval event with action details, user info, and optional edited fields + +```ts +interface ApprovalEvent +``` + +### `ApprovalEventSchema` + +`const` — Validate approval event data including asset, action, user, timestamp, and optional fields + +```ts +ZodObject<{ assetId: ZodString; variantId: ZodOptional; action: ZodEnum<{ scheduled: "scheduled"; approved:… +``` + +### `AssetContentMap` + +`type` — Map asset keys to their corresponding content types for various media and copy formats + +```ts +type AssetContentMap +``` + +### `AssetFormat` + +`type` — Define valid asset format strings for various media and copy types + +```ts +type AssetFormat +``` + +### `AssetSpec` + +`interface` — Define the structure and metadata for an asset including its format, brand, content, and status + +```ts +interface AssetSpec +``` + +### `AssetStatus` + +`type` — Define possible states representing the lifecycle status of an asset + +```ts +type AssetStatus +``` + +### `AssetVariant` + +`interface` — Describe an asset variant with identification, approval status, and edit history details + +```ts +interface AssetVariant +``` + +### `BrandTokens` + +`interface` — Define brand identity tokens including colors, font, logo, business name, and voice + +```ts +interface BrandTokens +``` + +### `BrandTokensSchema` + +`const` — Validate brand token properties including colors, font, logo URL, business name, and voice + +```ts +ZodObject<{ primaryColor: ZodString; accentColor: ZodString; textColor: ZodString; fontFamily: ZodString; logoUrl: ZodO… +``` + +### `ConversionMetrics` + +`interface` — Define metrics for tracking impressions, clicks, conversions, and related rates + +```ts +interface ConversionMetrics +``` + +### `ConversionMetricsSchema` + +`const` — Validate conversion metrics with nonnegative impressions, clicks, conversions, CTR, and CVR fields + +```ts +ZodObject<{ impressions: ZodNumber; clicks: ZodNumber; conversions: ZodNumber; ctr: ZodNumber; cvr: ZodNumber; }, $stri… +``` + +### `CopyContent` + +`interface` — Define the structure for content with headline, body, platform, and optional hashtags and character count + +```ts +interface CopyContent +``` + +### `CopyContentSchema` + +`const` — Validate and parse copy content with headline, body, optional hashtags, platform, and character count + +```ts +ZodObject<{ headline: ZodString; body: ZodString; hashtags: ZodOptional>; platform: ZodEnum<{ x: "x… +``` + +### `CopyPlatform` + +`type` — Define platform options for copy content across various social media and communication channels + +```ts +type CopyPlatform +``` + +### `EmailBodySection` + +`interface` — Define the structure for the body section of an email containing plain text content + +```ts +interface EmailBodySection +``` + +### `EmailContent` + +`interface` — Define the structure for email content including subject, optional preheader, and sections + +```ts +interface EmailContent +``` + +### `EmailContentSchema` + +`const` — Validate and parse email content objects with subject, optional preheader, and sections + +```ts +ZodObject<{ subject: ZodString; preheader: ZodOptional; sections: ZodArray; valu… +``` + +### `ImageImageLayer` + +`interface` — Define properties for an image layer including position, size, URL, and optional opacity + +```ts +interface ImageImageLayer +``` + +### `ImageLayer` + +`type` — Resolve a union type representing different kinds of image layers + +```ts +type ImageLayer +``` + +### `ImageLayerType` + +`type` — Define image layer categories for text, image, shape, or logo elements + +```ts +type ImageLayerType +``` + +### `ImageLogoLayer` + +`interface` — Define properties for positioning and sizing a logo image layer in a layout + +```ts +interface ImageLogoLayer +``` + +### `ImageShapeLayer` + +`interface` — Define properties for a shape layer representing rectangular or circular image elements + +```ts +interface ImageShapeLayer +``` + +### `ImageSlide` + +`interface` — Define the structure for an image slide with a background and multiple layers + +```ts +interface ImageSlide +``` + +### `ImageTextLayer` + +`interface` — Define properties for a text layer with position, style, and alignment options in an image + +```ts +interface ImageTextLayer +``` + +### `parseAssetSpec` + +`function` — Validates an unknown value as an AssetSpec, including format-specific content validation. + +```ts +(raw: unknown) => AssetSpec +``` + +### `safeParseAssetSpec` + +`function` — Safe parse — returns null instead of throwing. + +```ts +(raw: unknown) => AssetSpec | null +``` + +### `VideoCaption` + +`interface` — Define video caption segments with start and end times and associated text content + +```ts +interface VideoCaption +``` + +### `VideoContent` + +`interface` — Describe video content including duration, scenes, optional audio, captions, and rendered URL + +```ts +interface VideoContent +``` + +### `VideoContentSchema` + +`const` — Define the schema for validating video content including duration, scenes, audio, captions, and rendered URL + +```ts +ZodObject<{ durationSeconds: ZodNumber; scenes: ZodArray AdaptedTranscript +``` + +### `AssistantChat` + +`interface` — Define the structure and behavior of an assistant chat session with state, model selection, and message handling + +```ts +interface AssistantChat +``` + +### `AssistantClient` + +`interface` — The assistant network surface, bound to one host's transport config. + +```ts +interface AssistantClient +``` + +### `AssistantClientConfig` + +`interface` — Host-supplied transport configuration for {@link createAssistantClient}. + +```ts +interface AssistantClientConfig +``` + +### `AssistantClientInputError` + +`class` — Represent invalid client input errors with a specific code INVALID_REQUEST + +```ts +class AssistantClientInputError +``` + +### `AssistantClientProvider` + +`function` + +```ts +({ client, children, }: { client: AssistantClient; children: ReactNode; }) => Element +``` + +### `AssistantDeliveryMode` + +`type` — Define delivery modes for assistant interaction as either steering or queue + +```ts +type AssistantDeliveryMode +``` + +### `AssistantDock` + +`function` + +```ts +({ userId, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, onWorkflowMutation, onConnectRequirement… +``` + +### `AssistantDockProps` + +`interface` + +```ts +interface AssistantDockProps +``` + +### `assistantIsThinking` + +`function` — True while a turn is streaming but the model hasn't emitted its first answer token yet — drives the "thinking" affordance so a reasoning gap reads as working, not a frozen panel. + +```ts +(state: AssistantState) => boolean +``` + +### `AssistantLauncher` + +`interface` + +```ts +interface AssistantLauncher +``` + +### `AssistantLauncherProvider` + +`function` + +```ts +({ children, }: { children: ReactNode; }) => Element +``` + +### `AssistantModelOption` + +`interface` — Define options for an assistant model including identifier, label, pricing, and context tokens + +```ts +interface AssistantModelOption +``` + +### `AssistantModels` + +`interface` — Define the structure for assistant model options including a default model slug and available models + +```ts +interface AssistantModels +``` + +### `AssistantModelsResult` + +`interface` — Outcome of a model-list fetch. + +```ts +interface AssistantModelsResult +``` + +### `AssistantPanel` + +`function` + +```ts +({ chat, userId, onClose, navigate, balanceUsd, formatMoney, renderGraph, renderProviderIcon, renderMarkdown, toolRende… +``` + +### `AssistantPanelProps` + +`interface` + +```ts +interface AssistantPanelProps +``` + +### `AssistantSendOptions` + +`interface` — Define options for configuring how the assistant sends messages + +```ts +interface AssistantSendOptions +``` + +### `AssistantStreamEvent` + +`type` — Discriminated union the stream reader hands to the reducer. + +```ts +type AssistantStreamEvent +``` + +### `AssistantThreads` + +`interface` — Manage and interact with a list of assistant threads including loading, refreshing, and removing threads + +```ts +interface AssistantThreads +``` + +### `AssistantThreadSummary` + +`interface` — One past conversation in the history switcher. + +```ts +interface AssistantThreadSummary +``` + +### `AssistantTranscript` + +`function` — Render the assistant conversation with web-react's `ChatMessages`. + +```ts +({ view, renderMarkdown, toolRenderers, renderConfirmedResult, emptyState, }: AssistantTranscriptProps) => Element +``` + +### `AssistantTranscriptProps` + +`interface` + +```ts +interface AssistantTranscriptProps +``` + +### `AssistantTranscriptView` + +`interface` — The transcript slice handed to a host-supplied `renderTranscript` (see {@link AssistantPanelProps }). + +```ts +interface AssistantTranscriptView +``` + +### `ChatMessage` + +`interface` — Define the structure and properties of a chat message including optional tool activity details + +```ts +interface ChatMessage +``` + +### `ChatRequest` + +`interface` — Request body for `POST /api/v1/assistant/chat`. + +```ts +interface ChatRequest +``` + +### `ChatRole` + +`type` — A `tool` message is the inline activity chip for a read-only tool the agent ran during a turn (e.g. + +```ts +type ChatRole +``` + +### `ConfirmedResult` + +`interface` — The result of a CONFIRMED mutating tool, retained on the resolving `status` message so a host can render it prominently (e.g. + +```ts +interface ConfirmedResult +``` + +### `ConfirmResult` + +`type` — Represent the outcome of a confirmation process with success or failure details + +```ts +type ConfirmResult +``` + +### `ConnectionRequirement` + +`interface` — A connection a proposed workflow references, and whether the user has it connected right now. + +```ts +interface ConnectionRequirement +``` + +### `ConnectionRequirementKind` + +`type` — What kind of connection a requirement names — drives the card's label and connect target. + +```ts +type ConnectionRequirementKind +``` + +### `ConnectRequirementResult` + +`interface` — Outcome of a host-driven, in-place connect for a single proposal requirement (see {@link AssistantDockProps.onConnectRequirement }). + +```ts +interface ConnectRequirementResult +``` + +### `createAssistantClient` + +`function` — Build an assistant client bound to one host's transport. + +```ts +(config: AssistantClientConfig) => AssistantClient +``` + +### `DeltaEventData` + +`interface` — Define data structure representing a delta event with associated text content + +```ts +interface DeltaEventData +``` + +### `DoneEventData` + +`interface` — Describe the data emitted when a process turn completes including status and optional flags + +```ts +interface DoneEventData +``` + +### `ErrorEventData` + +`interface` — Describe error event data including code and message fields + +```ts +interface ErrorEventData +``` + +### `PendingProposal` + +`interface` — A mutating action the assistant proposed, awaiting the user's confirmation. + +```ts +interface PendingProposal +``` + +### `ProposalCard` + +`function` + +```ts +({ proposal, confirming, onConfirm, onCancel, navigate, onConnect, renderGraph, renderProviderIcon, }: ProposalCardProp… +``` + +### `ProposalCardProps` + +`interface` + +```ts +interface ProposalCardProps +``` + +### `ReasoningEventData` + +`interface` — A chunk of the model's reasoning/thinking, streamed BEFORE the answer for reasoning models. + +```ts +interface ReasoningEventData +``` + +### `ThreadEventData` + +`interface` — Describe the structure of data representing a thread event with optional model information + +```ts +interface ThreadEventData +``` + +### `ThreadHistoryResult` + +`type` — Outcome of a thread-history restore. + +```ts +type ThreadHistoryResult +``` + +### `ToolActivityStatus` + +`type` — Live status of a tool-activity chip. + +```ts +type ToolActivityStatus +``` + +### `ToolCallEventData` + +`interface` — Emitted when a read-only tool STARTS running, before its result. + +```ts +interface ToolCallEventData +``` + +### `ToolOutcome` + +`type` — The outcome of a finished read-only tool, retained on the chip so a renderer can show the result body (not just the name + status). + +```ts +type ToolOutcome +``` + +### `ToolProposalEventData` + +`interface` — Describe the data structure for events proposing tool usage with optional integration requirements + +```ts +interface ToolProposalEventData +``` + +### `ToolResultEventData` + +`interface` — Describe event data emitted after a tool execution completes with success or error details + +```ts +interface ToolResultEventData +``` + +### `UsageEventData` + +`interface` — Describe usage event data including tokens, cost, balance, duration, and replay status + +```ts +interface UsageEventData +``` + +### `UsageInfo` + +`interface` — Describe usage cost, balance, token counts, duration, and replay status for a settled turn + +```ts +interface UsageInfo +``` + +### `useAssistantChat` + +`function` — Manage assistant chat state and interactions for a given user ID with optional configurations + +```ts +(userId: string | null, options?: UseAssistantChatOptions | undefined) => AssistantChat +``` + +### `UseAssistantChatOptions` + +`interface` — Host integration callbacks for {@link useAssistantChat}. + +```ts +interface UseAssistantChatOptions +``` + +### `useAssistantClient` + +`function` — The assistant client for the current host. + +```ts +() => AssistantClient +``` + +### `useAssistantLauncher` + +`function` + +```ts +() => AssistantLauncher +``` + +### `useAssistantModels` + +`function` — Resolve and return the current assistant models from the per-client cache with immediate client swap updates + +```ts +() => AssistantModels +``` + +### `useAssistantThreads` + +`function` — Resolve and manage assistant threads state for a given user including pending deletions and refresh logic + +```ts +(userId: string | null) => AssistantThreads +``` + + +## `./billing` + +Source: `src/billing/index.ts` + +### `createPlatformBalanceManager` + +`function` — Create a platform balance manager to handle user plan limits and state based on provided options + +```ts +(opts: PlatformBalanceManagerOptions) => PlatformBalanceManager +``` + +### `createTcloudKeyProvisioner` + +`function` — Adapt the tcloud SDK client to {@link KeyProvisioner} — the typed seam that replaces the `as unknown as KeyProvisioner` cast every consumer otherwise repeats. + +```ts +(client: TcloudKeyClient) => KeyProvisioner +``` + +### `createWorkspaceKeyManager` + +`function` — Create a workspace key manager that handles key provisioning and budget tracking + +```ts +(opts: WorkspaceKeyManagerOptions) => WorkspaceKeyManager +``` + +### `KeyCrypto` + +`interface` — Secret encryption seam (the app's at-rest crypto). + +```ts +interface KeyCrypto +``` + +### `KeyProvisioner` + +`interface` — The key-provisioning operations the key manager needs. + +```ts +interface KeyProvisioner +``` + +### `PlanLimit` + +`interface` — Plan limits — a PARAMETER per product (dollar allowance, concurrency, overage policy). + +```ts +interface PlanLimit +``` + +### `PlatformBalanceInfo` + +`interface` — Spendable balance for a platform user. + +```ts +interface PlatformBalanceInfo +``` + +### `PlatformBalanceManager` + +`interface` — Manage user plans and balances including state retrieval, billing authorization, deduction, and usage tracking + +```ts +interface PlatformBalanceManager +``` + +### `PlatformBalanceManagerOptions` + +`interface` — Define configuration options for managing platform balance based on billing plans + +```ts +interface PlatformBalanceManagerOptions +``` + +### `PlatformBillingClient` + +`interface` — The platform billing transport — the product wires these to id.tangle.tools (or any balance backend). + +```ts +interface PlatformBillingClient +``` + +### `PlatformIdentity` + +`interface` — A user's resolved platform identity (from the app's SSO account store). + +```ts +interface PlatformIdentity +``` + +### `PlatformProductUsage` + +`interface` — Per-product spend aggregate. + +```ts +interface PlatformProductUsage +``` + +### `SharedBillingState` + +`interface` — Define shared billing state including user ID, plan, balances, concurrency, and overage permission + +```ts +interface SharedBillingState +``` + +### `TcloudKeyClient` + +`interface` — The subset of the `@tangle-network/tcloud` `TCloudClient` the provisioner uses — declared with METHOD syntax so the real client (whose `product` is a narrow union and whose budgets are `number | null… + +```ts +interface TcloudKeyClient +``` + +### `WorkspaceKeyManager` + +`interface` — Manage workspace keys by ensuring, rotating, and tracking usage of active child-key secrets + +```ts +interface WorkspaceKeyManager +``` + +### `WorkspaceKeyManagerOptions` + +`interface` — Define configuration options for managing workspace keys including provisioning, storage, and cryptography + +```ts +interface WorkspaceKeyManagerOptions +``` + +### `WorkspaceKeyRecord` + +`interface` — A stored child-key record (the app's row, shape-normalized). + +```ts +interface WorkspaceKeyRecord +``` + +### `WorkspaceKeyStore` + +`interface` — Persistence seam — the product implements this against its own D1 table. + +```ts +interface WorkspaceKeyStore +``` + +### `WorkspaceModelKeyUsage` + +`interface` — Describe usage and budget details for a workspace model key including expiration and exhaustion status + +```ts +interface WorkspaceModelKeyUsage +``` + + +## `./brand` + +Source: `src/brand/index.tsx` + +### `BrandHeader` + +`function` — Shared app-shell header: icon-only Tangle knot + optional product title on the left, caller-supplied nav/actions on the right. + +```ts +({ title, children, className }: BrandHeaderProps) => Element +``` + +### `BrandHeaderProps` + +`interface` — Define properties for a brand header including optional title, children, and CSS class name + +```ts +interface BrandHeaderProps +``` + +### `Logo` + +`function` — Full Tangle lockup (knot + wordmark) or, with `iconOnly`, just the knot. + +```ts +({ variant, size, className, iconOnly }: LogoProps) => Element +``` + +### `LogoProps` + +`interface` — Define properties to customize the logo variant, size, style, and icon display options + +```ts +interface LogoProps +``` + +### `TangleKnot` + +`function` — Icon-only Tangle knot, brand gradient, theme-independent. + +```ts +({ size, className }: { size?: number | undefined; className?: string | undefined; }) => Element +``` + + +## `./brand-extraction` + +Source: `src/brand-extraction/index.ts` + +### `BrandColor` + +`interface` — A color extracted from the page, with where it was seen. + +```ts +interface BrandColor +``` + +### `BrandExtractionResult` + +`type` — Typed outcome. + +```ts +type BrandExtractionResult +``` + +### `BrandFont` + +`interface` — A font-family discovered in CSS, with role inference. + +```ts +interface BrandFont +``` + +### `BrandImage` + +`interface` — A prominent product / hero image candidate (not a logo). + +```ts +interface BrandImage +``` + +### `BrandKit` + +`interface` — The full extracted kit. + +```ts +interface BrandKit +``` + +### `BrandLogoCandidate` + +`interface` — A logo / brand-mark candidate discovered on a page. + +```ts +interface BrandLogoCandidate +``` + +### `decideBrandKit` + +`function` — Collapse a raw BrandKit into decided roles — the shape a product persists. + +```ts +(kit: BrandKit) => DecidedBrandKit +``` + +### `DecidedBrandKit` + +`interface` — Everything a confirmation step needs from a kit, with roles decided. + +```ts +interface DecidedBrandKit +``` + +### `DecidedFonts` + +`interface` — Define font selections for display and body text with optional BrandFont properties + +```ts +interface DecidedFonts +``` + +### `DecidedPalette` + +`interface` — Define a color palette with background, surface, text, and accent colors for UI elements + +```ts +interface DecidedPalette +``` + +### `decideFonts` + +`function` — Pick a display and body font from the ranked list. + +```ts +(fonts: BrandFont[]) => DecidedFonts +``` + +### `decidePalette` + +`function` — Assign palette roles from the ranked colors. + +```ts +(palette: BrandColor[]) => DecidedPalette +``` + +### `extractBrandKit` + +`function` — Fetch a website (or use supplied HTML) and extract its BrandKit. + +```ts +(url: string, options?: ExtractBrandKitOptions) => Promise +``` + +### `ExtractBrandKitOptions` + +`interface` — Define options for extracting brand kit data including HTML input, fetch method, timeout, and list limits + +```ts +interface ExtractBrandKitOptions +``` + +### `FetchLike` + +`type` — Fetch boundary, injectable so callers (Workers, Node, tests) supply their own fetch and so tests can run fully offline against fixture HTML. + +```ts +type FetchLike +``` + +### `luminance` + +`function` — Relative luminance (0..1) of an #rrggbb(aa) hex — for light/dark sorting. + +```ts +(hex: string) => number +``` + +### `normalizeColor` + +`function` — Normalize any CSS color literal to #rrggbb / #rrggbbaa hex, or null. + +```ts +(raw: string) => string | null +``` + +### `normalizeSiteUrl` + +`function` — Normalize a user-supplied site URL: add https:// when scheme-less, validate. + +```ts +(raw: string) => string | null +``` + +### `parseBrandKit` + +`function` — Parse already-fetched HTML into a BrandKit. + +```ts +(html: string, sourceUrl: string, maxPerList?: number) => BrandKit +``` + + +## `./catalog` + +Source: `src/catalog/index.ts` · depends on `runtime` + +### `buildCatalog` + +`function` — Pure catalogue pipeline. + +```ts +(raw: RouterModel[], opts?: { preferredDefault?: string | undefined; } | undefined) => ModelCatalog +``` + +### `CatalogModel` + +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags + +```ts +interface CatalogModel +``` + +### `fetchModelCatalog` + +`function` — Fetch the router model list and build the catalogue, with an in-isolate cache (TTL 5 min). + +```ts +(cfg: { baseUrl: string; apiKey: string; preferredDefault?: string | undefined; }) => Promise +``` + +### `ModelCatalog` + +`interface` — Define a catalog containing models with a default ID and fetch timestamp + +```ts +interface ModelCatalog +``` + +### `normalizeModelId` + +`function` — Strip provider prefix, :free suffix, and trailing date stamps. + +```ts +(id: string) => string +``` + +### `RouterModel` + +`interface` — Model catalogue — computed live from the Tangle Router, never hand-curated. + +```ts +interface RouterModel +``` + + +## `./chat-routes` + +Source: `src/chat-routes/index.ts` · depends on `chat-store`, `interactions`, `plans`, `sandbox`, `stream`, `web` + +### `ALLOWED_ATTACHMENT_SNIFFED_MIMES` + +`const` — Sniffed-mime counterpart of `ATTACHMENT_ACCEPT`: the binary formats `sniffBinary` can identify from magic bytes among the accepted types. + +```ts +ReadonlySet +``` + +### `assertPromptPartsWithinCap` + +`function` — Throws `ChatTurnInputError` (413) when the parts' inline payload would blow the gateway cap. + +```ts +(parts: ChatTurnPartInput[], maxBytes?: number) => void +``` + +### `ATTACHMENT_ACCEPT` + +`const` — Accept list for the composer file picker + type validation, same grammar as the native `` attribute. + +```ts +"image/*,.pdf,.txt,.md,.csv,.json,.yaml,.yml,.html" +``` + +### `ATTACHMENT_MAX_COUNT` + +`const` — Most files a single request may carry: the composer staging cap, the upload route's per-request cap, and the chat body's `attachments` cap. + +```ts +10 +``` + +### `AttachmentPathArgs` + +`interface` — Arguments handed to a {@link PromoteAgentFilePartOptions.buildAttachmentPath} override — everything needed to place the file deterministically. + +```ts +interface AttachmentPathArgs +``` + +### `AttachmentPathCheck` + +`type` — Verdict of a path check: OK, or a rejection naming why. + +```ts +type AttachmentPathCheck +``` + +### `AttachmentReadResult` + +`type` — The result of reading one stored attachment. + +```ts +type AttachmentReadResult +``` + +### `attachmentSizeErrorMessage` + +`function` — Human-readable error naming both the actual size and the limit that was exceeded. + +```ts +(name: string, actualBytes: number, limitBytes: number) => string +``` + +### `attachmentTotalSizeErrorMessage` + +`function` — Human-readable error for a chat message whose combined attachments exceed the aggregate raw-byte ceiling. + +```ts +(totalBytes: number, limitBytes: number) => string +``` + +### `AttachmentTypeCheckResult` + +`type` — Represent the result of checking an attachment's type with success or specific failure details + +```ts +type AttachmentTypeCheckResult +``` + +### `AttachmentUploadAuthorization` + +`type` — Outcome of the injected `authorize` seam: auth + rate limiting + scope resolution, all in one place so a 429 rides `{ok:false, response}` exactly like a 401 does — this factory has no rate-limit opin… + +```ts +type AttachmentUploadAuthorization +``` + +### `AttachmentWriteResult` + +`type` — Outcome of persisting one attachment. + +```ts +type AttachmentWriteResult +``` + +### `base64WireLen` + +`function` — Size a base64-encoded string occupies on the wire given the raw (pre-encoding) byte length: base64 packs 3 raw bytes into 4 output characters, rounded up to the next multiple of 4. + +```ts +(byteLen: number) => number +``` + +### `buildDispatchParts` + +`function` — Build dispatch parts from input by resolving mentions, paths, and applying size constraints asynchronously + +```ts +(input: BuildDispatchPartsInput) => Promise +``` + +### `BuildDispatchPartsInput` + +`interface` — Build input parameters for dispatching chat message parts including text, attachments, mentions, and history + +```ts +interface BuildDispatchPartsInput +``` + +### `buildMentionPromptBlock` + +`function` — The agent-facing pointer block appended to the dispatched prompt — never persisted in message `content`. + +```ts +(mentions: readonly Pick[]) => string +``` + +### `bytesToBase64` + +`function` — Convert a Uint8Array of bytes into a base64-encoded string + +```ts +(bytes: Uint8Array) => string +``` + +### `ChatAttachmentInput` + +`interface` — `POST` turn-body entry describing a file already uploaded to the product's store (vault/object-store) — distinct from an inline {@link * ChatTurnFilePartInput} (which carries bytes) and from a {@link… + +```ts +interface ChatAttachmentInput +``` + +### `ChatAttachmentKind` + +`type` — The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (… + +```ts +type ChatAttachmentKind +``` + +### `ChatMentionKind` + +`type` — The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value. + +```ts +type ChatMentionKind +``` + +### `ChatRouteDurableProjection` + +`interface` — Resolve chat route events and materialize their durable state records + +```ts +interface ChatRouteDurableProjection +``` + +### `ChatRouteDurableProjectionLogger` + +`type` — Log chat route projection messages with optional metadata for durable processing + +```ts +type ChatRouteDurableProjectionLogger +``` + +### `ChatTurnAuthorization` + +`type` — Resolve authorization status and context for a chat turn including tenant and user identification + +```ts +type ChatTurnAuthorization +``` + +### `ChatTurnAuthorizeArgs` + +`interface` — Define arguments required to authorize a chat turn based on intent and request details + +```ts +interface ChatTurnAuthorizeArgs +``` + +### `ChatTurnFilePartInput` + +`interface` — A non-text prompt part the upload route hands back and the client echoes on send. + +```ts +interface ChatTurnFilePartInput +``` + +### `ChatTurnGateResult` + +`type` — Pre-turn readiness verdict — proceed, or short-circuit with the product's own `Response` (e.g. + +```ts +type ChatTurnGateResult +``` + +### `ChatTurnHeartbeat` + +`interface` — Keepalive emitted while the producer is quiet (long tool calls, first-token wait) so client watchdogs stay re-armed. + +```ts +interface ChatTurnHeartbeat +``` + +### `ChatTurnInputError` + +`class` — Represent errors for invalid chat turn inputs with status and code properties + +```ts +class ChatTurnInputError +``` + +### `ChatTurnInputPatch` + +`interface` — Patch a `beforeTurn` hook returns to augment the producer's input. + +```ts +interface ChatTurnInputPatch +``` + +### `ChatTurnLifecycle` + +`interface` — Deterministic run telemetry: `onTurnStart` fires before the producer runs; exactly one of `onTurnComplete` / `onTurnError` fires after the turn settles, always after `onTurnStart`. + +```ts +interface ChatTurnLifecycle +``` + +### `ChatTurnLifecycleComplete` + +`interface` — Define the structure representing the completion state of a chat turn lifecycle with usage data + +```ts +interface ChatTurnLifecycleComplete +``` + +### `ChatTurnLifecycleError` + +`interface` — Represent an error occurring during a chat turn lifecycle with context and duration information + +```ts +interface ChatTurnLifecycleError +``` + +### `ChatTurnLifecycleStart` + +`interface` — Define lifecycle start event with context and timestamp for a chat turn + +```ts +interface ChatTurnLifecycleStart +``` + +### `ChatTurnLock` + +`interface` — Async acquire/release wrapped around the turn. + +```ts +interface ChatTurnLock +``` + +### `ChatTurnLockResult` + +`type` — Single-flight lock verdict — acquired (with an opaque handle passed back to `release`), or already held (short-circuit with the product's 409-style `Response`). + +```ts +type ChatTurnLockResult +``` + +### `ChatTurnMessageStore` + +`interface` — What the route persists — a structural subset of `/chat-store`'s `ChatStore`, so `createChatStore(db, tables)` satisfies it directly and a product with its own persistence adapts without importing dr… + +```ts +interface ChatTurnMessageStore +``` + +### `ChatTurnPartInput` + +`type` — Resolve input as either a text part or a file part of a chat turn + +```ts +type ChatTurnPartInput +``` + +### `ChatTurnProduceArgs` + +`interface` — Define the arguments required to produce a chat turn with context and messaging details + +```ts +interface ChatTurnProduceArgs +``` + +### `chatTurnRequestInit` + +`function` — `fetch` init for the turn route — the one place the client wire shape is serialized, so composer glue and products never drift from the server's parser. + +```ts +(payload: ChatTurnRequestPayload) => RequestInit +``` + +### `ChatTurnRequestPayload` + +`interface` — POST body for the turn route. + +```ts +interface ChatTurnRequestPayload +``` + +### `ChatTurnRouteProducer` + +`interface` — `ChatTurnProducer` plus the persisted projection the assembly reads after drain. + +```ts +interface ChatTurnRouteProducer +``` + +### `ChatTurnRoutes` + +`interface` — Define routes to run, replay, and list running chat turns with streaming and reconnect support + +```ts +interface ChatTurnRoutes +``` + +### `ChatTurnTextPartInput` + +`interface` — Wire contract between the chat client (composer + `streamChatTurn`) and the assembled server vertical (`createChatTurnRoutes`). + +```ts +interface ChatTurnTextPartInput +``` + +### `ChatTurnUsage` + +`interface` — Usage receipt persisted onto the assistant message (the flattened `step-finish` shape `/chat-store`'s columns mirror). + +```ts +interface ChatTurnUsage +``` + +### `checkAttachmentType` + +`function` — Cross-check a filename's extension against its sniffed content. + +```ts +(fileName: string, sniff: SniffResult, allowed?: ReadonlySet) => AttachmentTypeCheckResult +``` + +### `createAttachmentUploadRoute` + +`function` — Resolve an attachment upload route handler with customizable limits and validation options + +```ts +(options: CreateAttachmentUploadRouteOptions) => (request: Request) => Promise +``` + +### `CreateAttachmentUploadRouteOptions` + +`interface` — Define options to authorize, write, and limit attachment uploads in a route + +```ts +interface CreateAttachmentUploadRouteOptions +``` + +### `createChatTurnRoutes` + +`function` — Build chat turn routes to handle and validate incoming chat requests with optional logging + +```ts +(options: CreateChatTurnRoutesOptions) => ChatTurnRoutes +``` + +### `CreateChatTurnRoutesOptions` + +`interface` — Define options to configure chat turn routes including authorization, storage, and event buffering + +```ts +interface CreateChatTurnRoutesOptions +``` + +### `createSandboxChatProducer` + +`function` — Create a sandbox chat producer that manages chat turn routing with logging and interaction rendering options + +```ts +(options: SandboxChatProducerOptions) => ChatTurnRouteProducer +``` + +### `createSandboxFileIndexRoute` + +`function` — Resolve a sandbox file index route with authorization, caching, and configurable depth and entries limits + +```ts +(options: CreateSandboxFileIndexRouteOptions) => (request: Request) => Promise +``` + +### `CreateSandboxFileIndexRouteOptions` + +`interface` — Define options to authorize and configure sandbox file index route behavior + +```ts +interface CreateSandboxFileIndexRouteOptions +``` + +### `createUploadRoute` + +`function` — Create an upload route handler that authorizes requests and processes file uploads with size limits + +```ts +(options: CreateUploadRouteOptions) => (request: Request) => Promise +``` + +### `CreateUploadRouteOptions` + +`interface` — Define options to authorize uploads and configure file size limits and upload directory + +```ts +interface CreateUploadRouteOptions +``` + +### `DEFAULT_STALE_TURN_LOCK_GRACE_MS` + +`const` — Minimum age a lock must reach before the "sandbox unreachable ⇒ nothing can be running" fallback may force-release it. + +```ts +number +``` + +### `DEFAULT_TERMINAL_TURN_LOCK_GRACE_MS` + +`const` — Minimum age a lock must reach before a TERMINAL session verdict may release it. + +```ts +number +``` + +### `defaultValidateAttachmentPath` + +`function` — Default path validator when a caller supplies none. + +```ts +(path: string) => AttachmentPathCheck +``` + +### `DetachedTurnFinal` + +`interface` — Authoritative final receipt for a turn that finished server-side, or whose live stream carried no usage (some harness paths only expose tokens via the completed-turn record, e.g. + +```ts +interface DetachedTurnFinal +``` + +### `DetachedTurnOptions` + +`interface` — Define options for managing and projecting a detached turn event stream in a session + +```ts +interface DetachedTurnOptions +``` + +### `DetachedTurnParts` + +`type` — The normalized structured message body (tool-call / file / plan / interaction parts) that `/chat-store` persists as the durable assistant row — the same shape `createSandboxChatProducer().assistantPa… + +```ts +type DetachedTurnParts +``` + +### `DetachedTurnResult` + +`interface` — Describe the result of a detached turn including state, text, parts, usage, and optional error or cache flag + +```ts +interface DetachedTurnResult +``` + +### `DISPATCH_MAX_MEDIA_PARTS` + +`const` — Product-side cap on media parts per dispatch (current turn + carried history), well under {@link DISPATCH_MAX_PARTS}. + +```ts +24 +``` + +### `DISPATCH_MAX_PARTS` + +`const` — Sidecar's hard cap on the `parts` array of one prompt request — a dispatch must never assemble more parts than this or the whole turn 400s. + +```ts +64 +``` + +### `DISPATCH_REQUEST_MAX_BYTES` + +`const` — Hard cap on the whole `/prompt` request body as it crosses the sandbox proxy — smaller in practice than a raw-file write cap because a dispatch carries several inline parts plus the flattened history… + +```ts +number +``` + +### `DISPATCH_STRUCTURAL_RESERVE_BYTES` + +`const` — Bytes reserved off the top of {@link DISPATCH_REQUEST_MAX_BYTES} for the JSON structure around the parts array (keys, delimiters, per-part `type`/`filename`/`mediaType` fields) that {@link base64Wire… + +```ts +number +``` + +### `DispatchPartsOutcome` + +`type` — Resolve the outcome of dispatching parts with success status and corresponding value or error message + +```ts +type DispatchPartsOutcome +``` + +### `FileIndexAuthorization` + +`type` — Define authorization details and parameters for indexing a file workspace with optional caching and ignore rules + +```ts +type FileIndexAuthorization +``` + +### `FileIndexCache` + +`interface` — Short-TTL cache seam so repeat popover opens in the same session don't re-scan the workspace. + +```ts +interface FileIndexCache +``` + +### `FileIndexReadyResponse` + +`interface` — Describe a ready file index response with workspace-relative entries and truncation status + +```ts +interface FileIndexReadyResponse +``` + +### `FileIndexResponse` + +`type` — Resolve a response indicating the file index is either ready or warming up + +```ts +type FileIndexResponse +``` + +### `FileIndexWarmingResponse` + +`interface` — Cold-box answer: no provisioning happened, no files were scanned. + +```ts +interface FileIndexWarmingResponse +``` + +### `FileMention` + +`interface` — A file mention resolved from the composer's `@`-picker: the workspace-relative path plus enough metadata to build a prompt part and pointer text. + +```ts +interface FileMention +``` + +### `fileMentionsToParts` + +`function` — Maps resolved file mentions to path-only `ChatTurnFilePartInput`s — `image` vs `file` by extension, and always a `path`, never a `url` (the url/path XOR invariant: a mention is a sandbox path referen… + +```ts +(mentions: readonly FileMention[], opts?: FileMentionsToPartsOptions) => ChatTurnFilePartInput[] +``` + +### `FileMentionsToPartsOptions` + +`interface` — Define options to resolve mention paths when converting file mentions to parts + +```ts +interface FileMentionsToPartsOptions +``` + +### `FilePartPromotionOutcome` + +`type` — Outcome of a `promoteFilePart` attempt. + +```ts +type FilePartPromotionOutcome +``` + +### `formatBytes` + +`function` — Render a raw byte count as a human-readable size (`512B`, `3KB`, `12MB 500KB`). + +```ts +(bytes: number) => string +``` + +### `INLINE_PARTS_MAX_BYTES` + +`const` — Define the maximum byte size allowed for inline parts in data processing + +```ts +950000 +``` + +### `MAX_ATTACHMENT_TOTAL_BYTES` + +`const` — Aggregate raw-byte ceiling across one message's attachments. + +```ts +number +``` + +### `MAX_BINARY_ATTACHMENT_BYTES` + +`const` — Ceiling on a binary attachment's raw (pre-encoding) byte size. + +```ts +number +``` + +### `MAX_TEXT_ATTACHMENT_BYTES` + +`const` — Ceiling on a text attachment's raw byte size. + +```ts +number +``` + +### `mediaTypeForMentionPath` + +`function` — The `image/*` mime for a mention path by extension, or `undefined` for anything not in the known image set (dispatched as `type: 'file'`). + +```ts +(path: string) => string | undefined +``` + +### `MENTION_MAX_COUNT` + +`const` — Hard cap on mentions per turn. + +```ts +16 +``` + +### `mentionKindForPath` + +`function` — `image` when the path's extension is in the known image set (the same table {@link mediaTypeForMentionPath} reads), `file` otherwise. + +```ts +(path: string) => ChatMentionKind +``` + +### `parseChatTurnParts` + +`function` — Validates the untyped `parts` array off the wire. + +```ts +(raw: unknown) => ChatTurnFilePartInput[] +``` + +### `parseFileMentions` + +`function` — Validates the untyped `mentions` array off the wire, mirroring {@link parseChatTurnParts}: the typed list, or `ChatTurnInputError` (400) naming the offending entry. + +```ts +(raw: unknown) => FileMention[] +``` + +### `ProducerErrorEvent` + +`interface` — Represent an error event emitted by a producer containing message, code, and optional details + +```ts +interface ProducerErrorEvent +``` + +### `ProducerNoticeEvent` + +`interface` — Define the structure for a producer notice event with type, id, kind, and text fields + +```ts +interface ProducerNoticeEvent +``` + +### `ProducerPassthroughEvent` + +`interface` — Define an event carrying passthrough data with flexible properties for producer communication + +```ts +interface ProducerPassthroughEvent +``` + +### `ProducerPassthroughEventType` + +`type` — Stable raw lifecycle/interaction/plan/route events forwarded unchanged. + +```ts +type ProducerPassthroughEventType +``` + +### `ProducerReasoningEvent` + +`interface` — Define an event representing reasoning output with a fixed type and associated text + +```ts +interface ProducerReasoningEvent +``` + +### `ProducerTextEvent` + +`interface` — Represent a text event produced by a source with a fixed type and associated text content + +```ts +interface ProducerTextEvent +``` + +### `ProducerToolCallEvent` + +`interface` — Represent an event triggered by a producer tool call with its identifier, name, and arguments + +```ts +interface ProducerToolCallEvent +``` + +### `ProducerToolResultEvent` + +`interface` — Describe the structure of an event representing the result of a producer tool call + +```ts +interface ProducerToolResultEvent +``` + +### `ProducerUsageEvent` + +`interface` — Describe usage event with prompt and completion token counts for a producer + +```ts +interface ProducerUsageEvent +``` + +### `ProducerWireEvent` + +`type` — Represent events emitted by a producer during its operation for processing and handling + +```ts +type ProducerWireEvent +``` + +### `PROMOTE_MAX_FILE_BYTES` + +`const` — Default ceiling on a promoted file's raw (pre-encoding) byte size. + +```ts +number +``` + +### `promoteAgentFilePart` + +`function` — Promote a part of an agent file with optional byte limits and MIME type detection + +```ts +(options: PromoteAgentFilePartOptions) => Promise +``` + +### `PromoteAgentFilePartOptions` + +`interface` — Define options for promoting a part of an agent file within a specific session and scope + +```ts +interface PromoteAgentFilePartOptions +``` + +### `PromoteFilePartResult` + +`type` — Resolve the result of promoting a file part with success status and relevant data or error details + +```ts +type PromoteFilePartResult +``` + +### `PromptInputPart` + +`type` — Extract a single element type from the array parameter of SandboxInstance's streamPrompt method + +```ts +type PromptInputPart +``` + +### `promptPartsByteSize` + +`function` — Calculate the total byte size of an array of chat turn parts + +```ts +(parts: ChatTurnPartInput[]) => number +``` + +### `RawAgentFilePart` + +`interface` — Define the structure for a raw file part with optional metadata and media type information + +```ts +interface RawAgentFilePart +``` + +### `ReadAttachmentFn` + +`type` — Read one stored attachment for `scopeId` (the product's workspace/tenant key) at its store-relative `path`. + +```ts +type ReadAttachmentFn +``` + +### `ReadSandboxMentionFn` + +`type` — Resolve sandbox mention details by reading from a specified path with optional byte reading + +```ts +type ReadSandboxMentionFn +``` + +### `reconcileStaleTurnLock` + +`function` — Decide whether a held lock is stale and, if so, release it. + +```ts +(options: ReconcileStaleTurnLockOptions) => Promise +``` + +### `ReconcileStaleTurnLockOptions` + +`interface` — Resolve options for probing and releasing stale TURN locks based on lock start time and sandbox state + +```ts +interface ReconcileStaleTurnLockOptions +``` + +### `ReconcileStaleTurnLockResult` + +`interface` — Describe the outcome of reconciling a stale turn lock including release status and diagnostics + +```ts +interface ReconcileStaleTurnLockResult +``` + +### `resolveChatAttachments` + +`function` — Validate and resolve a turn body's `attachments` field into persistable parts. + +```ts +(value: unknown, options: ResolveChatAttachmentsOptions) => Promise +``` + +### `ResolveChatAttachmentsOptions` + +`interface` — Define options to resolve and validate chat attachments with size, count, and path constraints + +```ts +interface ResolveChatAttachmentsOptions +``` + +### `ResolveChatAttachmentsResult` + +`type` — Resolve the result of chat attachment processing with success status and corresponding data or error + +```ts +type ResolveChatAttachmentsResult +``` + +### `runDetachedTurn` + +`function` — Stream a detached turn into the live turn-event buffer, durably. + +```ts +(opts: DetachedTurnOptions) => Promise +``` + +### `SandboxChatProducerOptions` + +`interface` — Define options for producing sandbox chat events with rendering and interaction controls + +```ts +interface SandboxChatProducerOptions +``` + +### `SandboxFileTreeSource` + +`interface` — Structural match of the sandbox SDK's `box.fs` tree surface. + +```ts +interface SandboxFileTreeSource +``` + +### `SandboxMentionPathCheck` + +`type` — Represent the result of a sandbox mention path check indicating success or failure with an error message + +```ts +type SandboxMentionPathCheck +``` + +### `SandboxTreeFile` + +`interface` — One entry from a structural `tree()` scan. + +```ts +interface SandboxTreeFile +``` + +### `SandboxTreeResult` + +`interface` — Structural match of the sandbox SDK's `box.fs.tree` result shape (`FileTreeResult`). + +```ts +interface SandboxTreeResult +``` + +### `SandboxUploadSink` + +`interface` — Structural match of the sandbox SDK's `box.fs` write surface (v0.10.5+: `encoding: 'base64'` is the worker-safe binary path). + +```ts +interface SandboxUploadSink +``` + +### `sanitizeAttachmentFileName` + +`function` — Rewrite a filename into the store-path charset (`A-Za-z0-9._-` per segment) — attachment paths double as store keys, sandbox file paths, and in-message path references, none of which tolerate spaces… + +```ts +(name: string) => string +``` + +### `sanitizeUploadFilename` + +`function` — Path-safe file name: basename only, conservative charset, length-capped. + +```ts +(name: string) => string +``` + +### `sniffBinary` + +`function` — Decide whether uploaded bytes are binary or text, and identify the mime type when it can be determined from content. + +```ts +(bytes: Uint8Array) => SniffResult +``` + +### `sniffMimeFromName` + +`function` — Default MIME hook: extension → mime, or `text/plain` for the unknown. + +```ts +(filename: string) => string +``` + +### `SniffResult` + +`interface` — Content-based binary/text classification, shared by the attachment upload route (server) and the composer's client-side pre-validation (browser) — both sides must agree on what counts as binary befor… + +```ts +interface SniffResult +``` + +### `StaleTurnLockSandboxProbeResult` + +`type` — Where the box is, as far as the caller can see. + +```ts +type StaleTurnLockSandboxProbeResult +``` + +### `StaleTurnLockSessionProbeResult` + +`type` — What the thing running the turn says about it. + +```ts +type StaleTurnLockSessionProbeResult +``` + +### `UPLOAD_INLINE_MAX_BYTES` + +`const` — 700 KiB: base64 inflates ~4/3, so an inline part stays comfortably under the ~1 MiB gateway body cap alongside the JSON envelope. + +```ts +number +``` + +### `UPLOAD_MAX_FILE_BYTES` + +`const` — 8 MiB default ceiling per file — one base64 `write` call handles it. + +```ts +number +``` + +### `UploadAuthorization` + +`type` — Resolve upload authorization status and provide upload destination or error response + +```ts +type UploadAuthorization +``` + +### `UploadedChatFile` + +`interface` — One uploaded file, ready for the composer chip and the turn body. + +```ts +interface UploadedChatFile +``` + +### `validateSandboxMentionPath` + +`function` — Validate a workspace-relative sandbox mention path. + +```ts +(path: unknown) => SandboxMentionPathCheck +``` + +### `withDurableChatProjection` + +`function` — Adds durable lifecycle projection to any producer lane without moving its transport into agent-app. + +```ts +(producer: ChatTurnRouteProducer, projection: ChatRouteDurableProjection, log?: ChatRouteDurableProjectionLogger) => Ch… +``` + +### `WriteAttachmentFn` + +`type` — Persist `content` for `scopeId` at `path`. + +```ts +type WriteAttachmentFn +``` + + +## `./chat-store` + +Source: `src/chat-store/index.ts` · depends on `chat-routes`, `interactions`, `plans`, `stream`, `web-react` + +### `AppendMessageInput` + +`interface` — Define input parameters for appending a message to a chat thread with optional metadata + +```ts +interface AppendMessageInput +``` + +### `attachmentInputToPart` + +`function` — Drop absent/empty optional fields rather than persisting `undefined`/`''` — keeps stored parts minimal. + +```ts +(input: ChatAttachmentInput) => ChatAttachmentPart +``` + +### `attachmentKindForMime` + +`function` — `image` for any `image/*` mime, `file` for everything else (including an absent/empty mime) — the same split the composer and the persisted-part discriminant both key on. + +```ts +(mime?: string | undefined) => ChatAttachmentKind +``` + +### `attachmentPartKey` + +`function` — Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it. + +```ts +(path: string) => string +``` + +### `attachmentPartsFromMessageParts` + +`function` — Every attachment part on one message's stored `parts`, in stored order. + +```ts +(parts: readonly Record[] | null | undefined) => ChatAttachmentPart[] +``` + +### `buildAttachmentPromptBlock` + +`function` — The agent-facing pointer block appended to the dispatched prompt — never persisted in `message.content`. + +```ts +(atts: readonly Pick[], header?: string) => string +``` + +### `BULK_DELETE_MAX_THREADS` + +`const` — Bounds a single bulk-delete request's write set; product surfaces cap thread lists at far fewer, so a larger batch is a malformed or hostile request. + +```ts +200 +``` + +### `BulkDeleteThreadsInput` + +`interface` — Define input for bulk deleting threads with access checks per workspace + +```ts +interface BulkDeleteThreadsInput +``` + +### `ChatAttachmentKind` + +`type` — The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (… + +```ts +type ChatAttachmentKind +``` + +### `ChatAttachmentPart` + +`interface` — Persisted attachment part: structurally an attachment-flavored `ChatFilePart` / `ChatImagePart` (`path` + `name` promoted to required) rather than a separate union member — see the section note above. + +```ts +interface ChatAttachmentPart +``` + +### `ChatDatabase` + +`type` — Any SQLite drizzle database — `any` erases the driver-specific run-result and schema generics so better-sqlite3, D1, and libsql handles all fit. + +```ts +type ChatDatabase +``` + +### `ChatFilePart` + +`interface` — Union of the sidecar's legacy (path-based) and AI-SDK (url-based) file shapes; response-side every field besides `type` is optional. + +```ts +interface ChatFilePart +``` + +### `ChatImagePart` + +`interface` — Define properties for an image part within a chat message including optional metadata fields + +```ts +interface ChatImagePart +``` + +### `ChatInteractionPart` + +`interface` — Persisted human-in-the-loop ask — byte-matches `interactionToPersistedPart` in `/web-react`'s chat-interactions contract. + +```ts +interface ChatInteractionPart +``` + +### `ChatMentionKind` + +`type` — The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value. + +```ts +type ChatMentionKind +``` + +### `ChatMentionPart` + +`interface` — A file the user `@`-mentioned on this turn: a workspace-relative path into the sandbox, never bytes. + +```ts +interface ChatMentionPart +``` + +### `ChatMessagePart` + +`type` — Represent parts of a chat message including text, reasoning, tools, files, images, subtasks, steps, interactions, notices, plans, and mentions + +```ts +type ChatMessagePart +``` + +### `ChatMessageRow` + +`type` — Resolve the selected structure of a chat message row from the messages table + +```ts +type ChatMessageRow +``` + +### `ChatNoticePart` + +`interface` — Persisted one-line transcript notice — byte-matches `noticePart` in `/web-react`'s chat-interactions contract. + +```ts +interface ChatNoticePart +``` + +### `ChatParentTable` + +`type` — A product table referenced by FK — only the `id` column is touched. + +```ts +type ChatParentTable +``` + +### `ChatPartTime` + +`interface` — Start/end wall-clock millis, as normalized by `/stream`'s `normalizeTime`. + +```ts +interface ChatPartTime +``` + +### `ChatPlanPart` + +`type` — Resolve a chat plan part by aliasing it to the persisted chat plan part type + +```ts +type ChatPlanPart +``` + +### `ChatReasoningPart` + +`interface` — Define a reasoning part of a chat with text content and optional metadata fields + +```ts +interface ChatReasoningPart +``` + +### `ChatStepFinishPart` + +`interface` — Define a chat step finish part indicating completion with optional reason, tokens, and cost + +```ts +interface ChatStepFinishPart +``` + +### `ChatStepStartPart` + +`interface` — OpenCode step-boundary marker — no renderable text; preserved so mappers never coerce it into a "[object Object]" text part. + +```ts +interface ChatStepStartPart +``` + +### `ChatStore` + +`interface` — Manage chat threads and messages with operations for listing, creating, updating, and deleting data + +```ts +interface ChatStore +``` + +### `ChatStoreInputError` + +`class` — Invalid caller input (missing/oversized ids, empty title). + +```ts +class ChatStoreInputError +``` + +### `ChatSubtaskPart` + +`interface` — Define a subtask part of a chat with prompt, description, agent, and optional identifier + +```ts +interface ChatSubtaskPart +``` + +### `ChatTables` + +`type` — The base (no-extras) table pair, pinned via an instantiation expression: `ReturnType` on the bare generic substitutes the extras params with their CONSTRAINT (`Record(db: ChatDatabase, tables: TTables) => ChatStore = {}, TMessageExtras extends Record[] | null | undefined; }, header?: string | undefi… +``` + +### `isChatAttachmentPart` + +`function` — True for any `image`/`file` part carrying a non-empty string `path`. + +```ts +(part: unknown) => part is ChatAttachmentPart +``` + +### `isChatInteractionPart` + +`function` — Resolve whether a ChatMessagePart is a ChatInteractionPart based on its type property + +```ts +(part: ChatMessagePart) => part is ChatInteractionPart +``` + +### `isChatMentionPart` + +`function` — Widened to `unknown` — unlike its siblings this guard also runs over raw untyped stored rows (a transcript renderer reads `message.parts` before the typed projection), which is exactly what {@link me… + +```ts +(part: unknown) => part is ChatMentionPart +``` + +### `isChatPlanPart` + +`function` — Resolve whether a chat message part is a persisted chat plan part + +```ts +(part: ChatMessagePart) => part is ChatPlanPersistedPart +``` + +### `isChatStepFinishPart` + +`function` — Determine if a chat message part represents the completion of a chat step + +```ts +(part: ChatMessagePart) => part is ChatStepFinishPart +``` + +### `isChatTextPart` + +`function` — Resolve whether a chat message part is a text part based on its type property + +```ts +(part: ChatMessagePart) => part is ChatTextPart +``` + +### `isChatToolPart` + +`function` — Resolve whether a ChatMessagePart is specifically a ChatToolPart based on its type property + +```ts +(part: ChatMessagePart) => part is ChatToolPart +``` + +### `ListMessagesOptions` + +`interface` — Define options to configure message listing with optional limit and offset parameters + +```ts +interface ListMessagesOptions +``` + +### `ListThreadsInput` + +`interface` — Define input parameters for listing threads within a workspace with pagination options + +```ts +interface ListThreadsInput +``` + +### `ListThreadsResult` + +`interface` — Represent a paginated collection of chat threads with total count and pagination details + +```ts +interface ListThreadsResult +``` + +### `mentionInputToPart` + +`function` — A validated wire mention (`parseFileMentions` in `/chat-routes`) as the part the turn route persists. + +```ts +(input: FileMention) => ChatMentionPart +``` + +### `mentionPartsFromMessageParts` + +`function` — Every mention part on one message, in stored order. + +```ts +(parts: readonly Record[] | readonly ChatMessagePart[] | null | undefined) => ChatMentionPart[] +``` + +### `NewChatMessageRow` + +`type` — Resolve the type for inserting a new chat message row into the messages table + +```ts +type NewChatMessageRow +``` + +### `NewChatThreadRow` + +`type` — Resolve the type for inserting a new chat thread row into the threads table + +```ts +type NewChatThreadRow +``` + +### `StorableHarnessPartKind` + +`type` — Every canonical harness wire-part kind must be storable — compile-time guarantee that a new agent-interface part kind cannot silently fall out of the persisted vocabulary. + +```ts +type StorableHarnessPartKind +``` + +### `threadTitleFromMessage` + +`function` — Thread titles come from the first message — keep the list scannable by storing only its first non-empty line, capped at 80 chars, never the whole multi-page prompt. + +```ts +(message: string) => string +``` + +### `toChatMessageParts` + +`function` — The typed projection at the `/stream` → `/chat-store` boundary. + +```ts +(parts: Record[]) => ChatMessagePart[] +``` + +### `WorkspaceAccessCheck` + +`type` — Product-injected access check. + +```ts +type WorkspaceAccessCheck +``` + + +## `./composer` + +Source: `src/composer/index.ts` + +### `AgentComposer` + +`function` — The canonical agent chat input: one rounded surface holding an auto-growing textarea, the embedded control strip (profile · harness · model · effort) at the bottom-left, and the send button at the bo… + +```ts +({ value, onChange, onSubmit, placeholder, disabled, busy, onCancel, harness, profile, model, reasoning, context, contr… +``` + +### `AgentComposerProps` + +`interface` + +```ts +interface AgentComposerProps +``` + +### `AgentProfileCapability` + +`interface` — A selectable tool group offered by the create/edit form. + +```ts +interface AgentProfileCapability +``` + +### `AgentProfileDraft` + +`interface` — The editable shape the create/edit form emits. + +```ts +interface AgentProfileDraft +``` + +### `AgentProfileOption` + +`interface` — An agent profile: a named bundle of toolset + persona layered over the same model and session. + +```ts +interface AgentProfileOption +``` + +### `AgentProfilePicker` + +`function` — Agent / mode switcher styled to match the chat control strip's pills (harness, model, effort). + +```ts +({ value, onChange, profiles, capabilities, onCreate, onUpdate, onDelete, disabled, className, side, }: AgentProfilePic… +``` + +### `AgentProfilePickerProps` + +`interface` + +```ts +interface AgentProfilePickerProps +``` + +### `AgentSessionControls` + +`function` — Compact control strip for an agent chat composer: harness, model, and thinking-effort pickers in one row. + +```ts +({ harness, profile, model, reasoning, filterModelsToHarness, trailing, className, context, layout, menuPlacement, }: A… +``` + +### `AgentSessionControlsProps` + +`interface` + +```ts +interface AgentSessionControlsProps +``` + +### `AgentSessionHarnessControl` + +`interface` + +```ts +interface AgentSessionHarnessControl +``` + +### `AgentSessionModelControl` + +`interface` + +```ts +interface AgentSessionModelControl +``` + +### `AgentSessionProfileControl` + +`interface` — Agent-profile (mode / toolset / persona) selection. + +```ts +interface AgentSessionProfileControl +``` + +### `AgentSessionReasoningControl` + +`interface` + +```ts +interface AgentSessionReasoningControl +``` + +### `DEFAULT_REASONING_LEVEL_OPTIONS` + +`const` + +```ts +readonly ReasoningLevelOption[] +``` + +### `HarnessType` + +`type` — The execution runner for an agent — WHICH runtime materializes and runs an `AgentProfile`. + +```ts +type HarnessType +``` + +### `isModelCompatibleWithHarness` + +`function` — Whether `harness` can run `modelId`. + +```ts +(harness: HarnessType, modelId: string) => boolean +``` + +### `ModelInfo` + +`interface` — Wire-format model entry as returned by `/v1/models` on the Tangle Router (and most OpenAI-compatible gateways). + +```ts +interface ModelInfo +``` + +### `ReasoningLevel` + +`type` — A reasoning selection: `auto` is a UI-only sentinel ("let the harness/model default decide", sends no explicit override); every other value is the canonical `ReasoningEffort` from `@tangle-network/ag… + +```ts +type ReasoningLevel +``` + +### `ReasoningLevelOption` + +`interface` + +```ts +interface ReasoningLevelOption +``` + +### `ReasoningLevelPicker` + +`function` + +```ts +({ value, onChange, disabled, className, triggerClassName, options, available, side, avoidCollisions, }: ReasoningLevel… +``` + +### `snapHarnessToModel` + +`function` — Keep the harness when it can run `modelId`; otherwise return the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to the router-backed `opencode` f… + +```ts +(harness: HarnessType, modelId: string) => HarnessType +``` + +### `snapModelToHarness` + +`function` — Keeps `modelId` when the harness can run it; otherwise returns the harness's best compatible model from the loaded catalog (preferred patterns in order, highest version within a pattern). + +```ts +(harness: HarnessType, modelId: string, models: readonly ModelInfo[]) => string +``` + + +## `./config` + +Source: `src/config/index.ts` · depends on `knowledge`, `runtime` + +### `AgentAppConfig` + +`interface` — The declarative domain surface of a Tangle agent product. + +```ts +interface AgentAppConfig +``` + +### `agentAppConfigJsonSchema` + +`const` — Machine-readable JSON Schema (draft 2020-12) for {@link AgentAppConfig}. + +```ts +{ readonly $schema: "https://json-schema.org/draft/2020-12/schema"; readonly $id: "https://tangle.tools/schemas/agent-a… +``` + +### `AgentIdentityConfig` + +`interface` — Who the agent is, as data. + +```ts +interface AgentIdentityConfig +``` + +### `AgentIntegrationsConfig` + +`interface` — Which integrations the product enables, as data. + +```ts +interface AgentIntegrationsConfig +``` + +### `AgentKnowledgeConfig` + +`interface` — The knowledge surface, as data. + +```ts +interface AgentKnowledgeConfig +``` + +### `AgentTaxonomyConfig` + +`interface` — The proposal taxonomy, as data. + +```ts +interface AgentTaxonomyConfig +``` + +### `AgentUiConfig` + +`interface` — UI capability flags, as data. + +```ts +interface AgentUiConfig +``` + +### `defineAgentApp` + +`function` — Identity helper: returns its argument unchanged, but anchors inference so a coding agent authoring a config gets full autocomplete + type-checking from a single import. + +```ts +(config: T) => T +``` + +### `KnowledgeLoopConfig` + +`interface` — The knowledge-acquisition loop config — the goal the researcher pursues and the gate it must clear before the loop is considered satisfied. + +```ts +interface KnowledgeLoopConfig +``` + +### `KnowledgeRequirementSpec` + +`interface` — Define the criteria and conditions required to satisfy a specific knowledge requirement + +```ts +interface KnowledgeRequirementSpec +``` + +### `KnowledgeSourceSpec` + +`interface` — A knowledge source the acquisition loop / researcher may draw on. + +```ts +interface KnowledgeSourceSpec +``` + +### `SatisfiedByRule` + +`type` — A declarative rule for satisfying a requirement from workspace state. + +```ts +type SatisfiedByRule +``` + +### `TangleModelConfig` + +`interface` — Resolve the model config a Tangle agent's sandbox/runtime runs on. + +```ts +interface TangleModelConfig +``` + + +## `./crypto` + +Source: `src/crypto/index.ts` · depends on `billing` + +### `createFieldCrypto` + +`function` — Build a {@link import ('../billing').KeyCrypto}-compatible pair bound to a key (or a key-resolver, for env-backed keys resolved per call). + +```ts +(key: string | (() => string)) => { encrypt(s: string): Promise; decrypt(s: string): Promise; } +``` + +### `decodeHexKey` + +`function` — Validate + decode a 64-char hex key to 32 bytes. + +```ts +(keyHex: string) => Uint8Array +``` + +### `decryptAesGcm` + +`function` — Decrypt a base64(iv ‖ ciphertext ‖ tag) string under `keyHex`. + +```ts +(encrypted: string, keyHex: string) => Promise +``` + +### `decryptBytes` + +`function` — Decrypt binary data (IV ‖ ciphertext ‖ tag) under a derived `CryptoKey`. + +```ts +(data: ArrayBuffer, key: CryptoKey) => Promise +``` + +### `decryptWithKey` + +`function` — Decrypt a base64(iv ‖ ct ‖ tag) string under a derived `CryptoKey`. + +```ts +(encoded: string, key: CryptoKey) => Promise +``` + +### `deriveKey` + +`function` — Derive an AES-256-GCM `CryptoKey` from a secret string via PBKDF2. + +```ts +(secret: string, opts: DeriveKeyOptions) => Promise +``` + +### `DeriveKeyOptions` + +`interface` — --- Passphrase-derived key path (PBKDF2 → AES-256-GCM CryptoKey) --- The `encryptAesGcm`/`decryptAesGcm` path takes a raw 64-char-hex key. + +```ts +interface DeriveKeyOptions +``` + +### `encryptAesGcm` + +`function` — Encrypt `plaintext` with AES-256-GCM under `keyHex`. + +```ts +(plaintext: string, keyHex: string) => Promise +``` + +### `encryptBytes` + +`function` — Encrypt binary data under a derived `CryptoKey`. + +```ts +(data: ArrayBuffer, key: CryptoKey) => Promise +``` + +### `encryptWithKey` + +`function` — Encrypt `plaintext` under a derived `CryptoKey`. + +```ts +(plaintext: string, key: CryptoKey) => Promise +``` + + +## `./design-canvas` + +Source: `src/design-canvas/index.ts` · depends on `tools`, `web` + +### `AddElementOperation` + +`interface` — Define an operation to add a scene element to a page with optional index and parent group + +```ts +interface AddElementOperation +``` + +### `AddPageOperation` + +`interface` — Define an operation to add a new page with an optional position and caller-minted page ID + +```ts +interface AddPageOperation +``` + +### `applyBindingsToDocument` + +`function` — Applies slot bindings to a document in place (mutates a deep copy produced by the caller). + +```ts +(document: SceneDocument, bindings: Record) => SceneDocument +``` + +### `ApplyDataOperation` + +`interface` — Fill slots with data — text slots take strings, image/video slots take src URLs. + +```ts +interface ApplyDataOperation +``` + +### `applySceneOperation` + +`function` — Apply a single operation to a document and return the new document. + +```ts +(document: SceneDocument, operation: SceneOperation) => SceneDocument +``` + +### `applySceneOperations` + +`function` — Full form: returns the new document AND per-op results. + +```ts +{ (document: SceneDocument, operations: SceneOperation[], options: ApplySceneOptions): { document: SceneDocument; resul… +``` + +### `ApplySceneOptions` + +`interface` — Resolve element ID conflicts by providing fresh unique identifiers during scene application + +```ts +interface ApplySceneOptions +``` + +### `assertColor` + +`function` — Validate that a string is a hex, rgb(a), or 'transparent' color and throw an error if not + +```ts +(value: string, label: string) => void +``` + +### `assertFinite` + +`function` — Assert that a value is a finite number and throw an error with a label if not + +```ts +(value: number, label: string) => void +``` + +### `assertPositiveFinite` + +`function` — Assert that a value is a positive finite number and throw an error with a label if not + +```ts +(value: number, label: string) => void +``` + +### `assertSceneMediaSrc` + +`function` — Media boundary rule shared with sequences: remote http(s) or a rooted /api/ path — never sandbox-local files or data:/blob: blobs. + +```ts +(value: string, label: string) => void +``` + +### `BindSlotOperation` + +`interface` — Define an operation to bind or unbind a unique slot to an element on a specific page + +```ts +interface BindSlotOperation +``` + +### `bleedAwareExportBounds` + +`function` — Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins. + +```ts +(page: ScenePage, includeBleed: boolean) => ExportCropRect +``` + +### `bleedAwareExportRect` + +`function` — Export rectangle in page coordinates that includes bleed margins when present. + +```ts +(page: Pick) => Bounds +``` + +### `Bounds` + +`interface` — Define rectangular boundaries with position and size properties + +```ts +interface Bounds +``` + +### `boundsIntersect` + +`function` — Determine if two rectangular bounds overlap or intersect each other + +```ts +(a: Bounds, b: Bounds) => boolean +``` + +### `buildDesignCanvasMcpServerEntry` + +`function` — Build the `AgentProfileMcpServer`-shaped entry for the design-canvas channel. + +```ts +(opts: ScopedMcpServerEntryOptions) => AppToolMcpServer +``` + +### `BuildDesignCanvasMcpServerEntryOptions` + +`type` — Build scoped MCP server entry options for the design canvas environment + +```ts +type BuildDesignCanvasMcpServerEntryOptions +``` + +### `CANVAS_ELEMENT_KINDS` + +`const` — Provide a readonly array of string identifiers representing canvas element kinds + +```ts +readonly string[] +``` + +### `CANVAS_MCP_TOOL_NAMES` + +`const` — Extract names of all tools from the CANVAS_MCP_TOOLS array + +```ts +string[] +``` + +### `CANVAS_MCP_TOOLS` + +`const` — Provide a collection of MCP tool definitions for manipulating and querying the design canvas environment + +```ts +McpToolDefinition[] +``` + +### `CHANNEL_PRESETS` + +`const` — Fixed output resolution presets for the channel/platform export dialog. + +```ts +readonly ChannelPreset[] +``` + +### `ChannelPreset` + +`interface` — Define a preset configuration for a channel including its id, label, width, and height + +```ts +interface ChannelPreset +``` + +### `ChannelPresetId` + +`type` — Resolve a valid channel preset identifier from the predefined channel presets array + +```ts +type ChannelPresetId +``` + +### `ChannelScaleResult` + +`interface` — Define the pixel ratio and horizontal offset for scaling a Konva stage to a channel preset size + +```ts +interface ChannelScaleResult +``` + +### `collectSlots` + +`function` — All slot names declared across the document — the template's fillable surface. + +```ts +(document: SceneDocument) => Map (request: Request) => Promise +``` + +### `CreateDesignCanvasMcpHandlerOptions` + +`interface` — Define options for creating a design canvas MCP handler including store, ID minting, and optional server info + +```ts +interface CreateDesignCanvasMcpHandlerOptions +``` + +### `createEmptyDocument` + +`function` — Create a new empty SceneDocument with a title and optional initial page settings + +```ts +(title: string, page?: NewPageOptions | undefined) => SceneDocument +``` + +### `createPage` + +`function` — Create a new ScenePage with specified options and a unique identifier + +```ts +(options: NewPageOptions, id: string) => ScenePage +``` + +### `DEFAULT_DESIGN_CANVAS_MCP_DESCRIPTION` + +`const` — Describe the live visual asset editor capabilities for the current design document using CSS pixel coordinates + +```ts +"Live visual asset editor for the current design document: read scene state, add/move/resize/delete elements, manage pa… +``` + +### `DeleteElementOperation` + +`interface` — Resolve deletion of a specific element from a page by its identifiers + +```ts +interface DeleteElementOperation +``` + +### `DeletePageOperation` + +`interface` — Represent a delete page operation with a specified page identifier + +```ts +interface DeletePageOperation +``` + +### `DesignCanvasMcpServerInfo` + +`interface` — Describe design canvas MCP server information including name and version + +```ts +interface DesignCanvasMcpServerInfo +``` + +### `DesignCanvasMcpToolEnv` + +`interface` — Define the environment for MCP tool with a scene store and ID minting function + +```ts +interface DesignCanvasMcpToolEnv +``` + +### `DuplicatePageOperation` + +`interface` — Define an operation to duplicate a page with a new caller-specified page ID + +```ts +interface DuplicatePageOperation +``` + +### `elementAabb` + +`function` — Axis-aligned bounding box in the parent's coordinate space, accounting for rotation about the element's top-left origin. + +```ts +(element: SceneElement) => Bounds +``` + +### `elementExtent` + +`function` — Unrotated local extent of an element (line/group derive from content). + +```ts +(element: SceneElement) => { width: number; height: number; } +``` + +### `EllipseElement` + +`interface` — Define properties for an ellipse element including dimensions, fill, and optional stroke details + +```ts +interface EllipseElement +``` + +### `estimateTextHeight` + +`function` — Estimate the height of multiline text based on font size and line height + +```ts +(element: Pick) => number +``` + +### `EXPORT_PRESETS` + +`const` — Provide predefined export configurations for various social media and image formats + +```ts +Record +``` + +### `ExportCropRect` + +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds + +```ts +interface ExportCropRect +``` + +### `ExportFormat` + +`type` — Define supported image export formats as PNG or JPEG + +```ts +type ExportFormat +``` + +### `ExportPreset` + +`interface` — Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag. + +```ts +interface ExportPreset +``` + +### `findCanvasMcpTool` + +`function` — Find the canvas MCP tool definition matching the given name or return undefined + +```ts +(name: string) => McpToolDefinition | undefined +``` + +### `findElement` + +`function` — Depth-first search across a page including group children. + +```ts +(page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; } | null +``` + +### `findPreset` + +`function` — Resolve a size preset by its identifier or return null if not found + +```ts +(id: string) => SizePreset | null +``` + +### `GroupElement` + +`interface` — Define a group element that contains multiple child scene elements + +```ts +interface GroupElement +``` + +### `GroupElementsOperation` + +`interface` — Group elements by grouping two or more sibling elements in their current z-order under a new group ID + +```ts +interface GroupElementsOperation +``` + +### `ImageElement` + +`interface` — Define properties for an image element including source, dimensions, and fit mode + +```ts +interface ImageElement +``` + +### `InstantiateOptions` + +`interface` — Define options for instantiating a document with title, optional bindings, and custom id minting + +```ts +interface InstantiateOptions +``` + +### `instantiateTemplate` + +`function` — Produces a new `SceneDocument` from a template: 1. + +```ts +(document: SceneDocument, options: InstantiateOptions) => SceneDocument +``` + +### `LineElement` + +`interface` — Define a line element with points, stroke, stroke width, and optional dash pattern + +```ts +interface LineElement +``` + +### `listTemplateSlots` + +`function` — Wraps `collectSlots` with kind-aware fill typing so callers know WHAT to put in each slot without inspecting the element tree themselves. + +```ts +(document: SceneDocument) => TemplateSlot[] +``` + +### `matchPreset` + +`function` — Match a (width, height) pair against the preset table. + +```ts +(width: number, height: number) => SizePreset | null +``` + +### `NewPageOptions` + +`interface` — Define options to configure a new page including name, dimensions, and background color + +```ts +interface NewPageOptions +``` + +### `NewSceneDecision` + +`interface` — Define the structure for decisions related to creating a new scene with instructions and optional details + +```ts +interface NewSceneDecision +``` + +### `PageBleed` + +`interface` — Per-side bleed extents in px, drawn OUTSIDE the page bounds. + +```ts +interface PageBleed +``` + +### `PageGuides` + +`interface` — Saved ruler guides, in page coordinates. + +```ts +interface PageGuides +``` + +### `RectElement` + +`interface` — Define a rectangular scene element with size, fill, optional stroke, and corner radius properties + +```ts +interface RectElement +``` + +### `ReorderElementOperation` + +`interface` — Resolve an operation to reorder an element within its current owner by specifying the target index + +```ts +interface ReorderElementOperation +``` + +### `ReorderPageOperation` + +`interface` — Represent an operation to reorder a page by moving it to a specified index + +```ts +interface ReorderPageOperation +``` + +### `requireChannelPreset` + +`function` — Throws when the id is unknown — callers should only pass ids sourced from `CHANNEL_PRESETS`. + +```ts +(id: string) => ChannelPreset +``` + +### `requireElement` + +`function` — Resolve and return the element, its owner array, and index from the page by element ID + +```ts +(page: ScenePage, elementId: string) => { element: SceneElement; owner: SceneElement[]; index: number; } +``` + +### `requirePage` + +`function` — Resolve and return a page by ID from a document or throw an error if not found + +```ts +(document: SceneDocument, pageId: string) => ScenePage +``` + +### `scaleForPreset` + +`function` — Pixel ratio for stage.toDataURL given a crop rect and an export preset. + +```ts +(preset: ExportPreset, cropRect: ExportCropRect) => number +``` + +### `scalePageForChannelPreset` + +`function` — Computes the Konva stage parameters to render `page` centered inside `channelPreset` without cropping (contain / letterbox). + +```ts +(page: Pick, channelPreset: ChannelPreset) => ChannelScaleResult +``` + +### `SCENE_ELEMENT_KINDS` + +`const` — Define all valid kinds of scene elements used in the application + +```ts +readonly ("text" | "image" | "rect" | "ellipse" | "line" | "video" | "group")[] +``` + +### `SCENE_OPERATION_TYPES` + +`const` — Define all valid operation types for scene manipulation in the application + +```ts +readonly ("add_element" | "set_attrs" | "reorder_element" | "delete_element" | "group_elements" | "ungroup_element" | "… +``` + +### `SCENE_SCHEMA_VERSION` + +`const` — Define the current version number of the scene schema + +```ts +1 +``` + +### `SceneApplyResult` + +`type` — Represent the result of applying changes to a scene as an element, page, or entire document + +```ts +type SceneApplyResult +``` + +### `SceneAttrsPatch` + +`type` — Per-kind attribute patch. + +```ts +type SceneAttrsPatch +``` + +### `SceneDecision` + +`interface` — Define the structure for decisions made within a scene including type, instructions, and metadata + +```ts +interface SceneDecision +``` + +### `SceneDocument` + +`interface` — Define the structure and properties of a scene document including version, title, pages, settings, and metadata + +```ts +interface SceneDocument +``` + +### `SceneDocumentRecord` + +`interface` — Represent a scene document with its current revision number for version tracking + +```ts +interface SceneDocumentRecord +``` + +### `SceneElement` + +`type` — Represent a graphical element in a scene including shapes, text, media, or groups + +```ts +type SceneElement +``` + +### `SceneElementBase` + +`interface` — Attributes every element carries. + +```ts +interface SceneElementBase +``` + +### `SceneElementKind` + +`type` — Extract the kind property from a SceneElement to identify its element type + +```ts +type SceneElementKind +``` + +### `SceneExportFormat` + +`type` — Define supported formats for exporting a scene including image and JSON options + +```ts +type SceneExportFormat +``` + +### `SceneExportRecord` + +`interface` — Describe a scene export with its status, format, metadata, and result information + +```ts +interface SceneExportRecord +``` + +### `SceneOperation` + +`type` — Represent operations that modify scenes by adding, updating, reordering, grouping, or deleting elements and pages + +```ts +type SceneOperation +``` + +### `SceneOperationType` + +`type` — Extract the type property from a SceneOperation to represent its operation type + +```ts +type SceneOperationType +``` + +### `ScenePage` + +`interface` — Define the structure and properties of a scene page including layout, background, and elements + +```ts +interface ScenePage +``` + +### `ScenePlan` + +`interface` — Define a plan summarizing a scene with its description and associated operations + +```ts +interface ScenePlan +``` + +### `SceneSettings` + +`interface` — Define settings for scene export including print conversion factor for unit calculations + +```ts +interface SceneSettings +``` + +### `SceneStore` + +`interface` — Manage scene documents, decisions, and exports with atomic save and revision control + +```ts +interface SceneStore +``` + +### `SceneStoreScope` + +`interface` — Per-request scope a product binds at store construction; decision and export rows attribute to the acting user — never trusted from tool args. + +```ts +interface SceneStoreScope +``` + +### `SetAttrsOperation` + +`interface` — Define an operation to update attributes of a specific element on a page + +```ts +interface SetAttrsOperation +``` + +### `SetDocumentTitleOperation` + +`interface` — Define an operation to set the document title to a specified string + +```ts +interface SetDocumentTitleOperation +``` + +### `SetPageGuidesOperation` + +`interface` — Resolve an operation to set guides on a specific page by its identifier + +```ts +interface SetPageGuidesOperation +``` + +### `SetPagePropsOperation` + +`interface` — Define an operation to set or update properties of a page including size, background, and bleed + +```ts +interface SetPagePropsOperation +``` + +### `SIZE_PRESETS` + +`const` — Provide predefined size presets for social, presentation, and print categories + +```ts +readonly SizePreset[] +``` + +### `SizePreset` + +`interface` — Define size presets with identifiers, labels, categories, and dimensions for various media types + +```ts +interface SizePreset +``` + +### `SlotFillKind` + +`type` — Define allowed string literals representing different slot fill kinds + +```ts +type SlotFillKind +``` + +### `storeApplyScenePlan` + +`function` — Resolve and apply a scene plan to the store with specified actor context and generate results + +```ts +(store: SceneStore, plan: ScenePlan, opts: { actorKind: "human_edit" | "agent_edit" | "agent_proposal" | "export" | "no… +``` + +### `TemplateSlot` + +`interface` — Define a slot template specifying its name, page, element, and fill characteristics + +```ts +interface TemplateSlot +``` + +### `TextElement` + +`interface` — Define properties for a text element including content, style, alignment, and layout parameters + +```ts +interface TextElement +``` + +### `UngroupElementOperation` + +`interface` — Resolve an operation to ungroup elements within a specified page and group context + +```ts +interface UngroupElementOperation +``` + +### `validateBindings` + +`function` — Preflight check: every key in `bindings` must name a slot in the document. + +```ts +(document: SceneDocument, bindings: Record) => string[] +``` + +### `validateSceneOperation` + +`function` — Validate a scene operation against the document to ensure it meets required constraints + +```ts +(document: SceneDocument, operation: SceneOperation) => void +``` + +### `validateSceneOperations` + +`function` — Validate each scene operation against the document and throw detailed errors for invalid operations + +```ts +(document: SceneDocument, operations: SceneOperation[]) => void +``` + +### `validateSlotValue` + +`function` — Validates that a slot binding value matches the slot element's kind. + +```ts +(slotName: string, elementKind: "text" | "image" | "rect" | "ellipse" | "line" | "video" | "group", value: string) => v… +``` + +### `VideoElement` + +`interface` — Video placed on a canvas renders and exports as its poster frame — motion belongs to the sequences surface; this keeps video assets placeable in static layouts (e.g. + +```ts +interface VideoElement +``` + + +## `./design-canvas-react` + +Source: `src/design-canvas-react/index.ts` · depends on `brand`, `design-canvas`, `theme` + +### `addElementCommand` + +`function` — Create a command to add an element to a scene with optional positioning and grouping + +```ts +(input: AddElementInput) => SceneCommand +``` + +### `AddElementInput` + +`interface` — Define input parameters for adding a scene element with optional index and parent group ID + +```ts +interface AddElementInput +``` + +### `addPageCommand` + +`function` — Create a command to add a page with optional settings and index in the scene + +```ts +(input: AddPageInput) => SceneCommand +``` + +### `AddPageInput` + +`interface` — Define input parameters for adding a new page with optional settings and position index + +```ts +interface AddPageInput +``` + +### `ApplySceneResult` + +`interface` — Resolve the result of applying a scene update including revision and optional normalized document + +```ts +interface ApplySceneResult +``` + +### `BakedNodeAttrs` + +`interface` — Define baked node attributes including position, size, and rotation with collapsed scale + +```ts +interface BakedNodeAttrs +``` + +### `bakeLineTransform` + +`function` — Lines store points as a flat [x0, y0, x1, y1, ...] array relative to the line element's (x, y). + +```ts +(node: TransformerNode & { points: number[]; }) => BakedNodeAttrs & { points: number[]; } +``` + +### `bakeRectTransform` + +`function` — Collapse Konva scaleX/scaleY into width/height so the model always stores true pixel dimensions. + +```ts +(node: TransformerNode) => BakedNodeAttrs +``` + +### `bakeTextTransform` + +`function` — Text nodes have a fixed wrap width; scaling that width is what the transformer controls. + +```ts +(node: TransformerNode & { fontSize: number; }) => BakedNodeAttrs & { fontSize: number; } +``` + +### `bindSlotCommand` + +`function` — Bind a slot to an element within a page and generate the corresponding scene command + +```ts +(input: BindSlotInput) => SceneCommand +``` + +### `BindSlotInput` + +`interface` — Define input parameters for binding a slot within a scene document element + +```ts +interface BindSlotInput +``` + +### `bleedAwareExportBounds` + +`function` — Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins. + +```ts +(page: ScenePage, includeBleed: boolean) => ExportCropRect +``` + +### `BTN` + +`const` — 28px square (h-7) — used by the main toolbar. + +```ts +"flex h-7 w-7 items-center justify-center rounded border border-[var(--border-default)] text-[var(--text-secondary)] tr… +``` + +### `BTN_ACTIVE` + +`const` + +```ts +string +``` + +### `BTN_SM` + +`const` — 24px square (h-6) — used by the zoom controls and pages strip. + +```ts +"flex h-6 w-6 items-center justify-center rounded border border-[var(--border-default)] text-[var(--text-secondary)] tr… +``` + +### `BTN_SM_ACTIVE` + +`const` + +```ts +string +``` + +### `buildInsertImageOp` + +`function` — Build an `add_element` op placing an image, fitted and centered on the page. + +```ts +(src: string, naturalSize: { width: number; height: number; }, page: InsertPageGeometry) => SceneOperation +``` + +### `buildRulerTicks` + +`function` — Generate all ticks visible in a ruler of `documentLength` document-px, given the current tick step. + +```ts +(input: { documentLength: number; step: TickStep; }) => RulerTick[] +``` + +### `CanvasEmptyState` + +`function` — The three-door empty state. + +```ts +({ onStartTemplate, onAddElement, onAskAgent, title, subtitle, className, }: CanvasEmptyStateProps) => Element +``` + +### `CanvasEmptyStateProps` + +`interface` + +```ts +interface CanvasEmptyStateProps +``` + +### `CanvasInsertPanel` + +`function` + +```ts +({ canWrite, page, onInsert, onUploadImage, loadGenerations, templates, accept, className, }: CanvasInsertPanelProps) =… +``` + +### `CanvasInsertPanelProps` + +`interface` + +```ts +interface CanvasInsertPanelProps +``` + +### `centeredPosition` + +`function` — Top-left position that centers a (width, height) box on the page. + +```ts +(width: number, height: number, pageWidth: number, pageHeight: number) => { x: number; y: number; } +``` + +### `collectGridTargets` + +`function` — Generate grid line targets within a neighborhood around the moving bounds. + +```ts +(bounds: Bounds, gridSize: number, page: ScenePage, thresholdDocPx: number) => { vertical: SnapTarget[]; horizontal: Sn… +``` + +### `createSceneCommandStack` + +`function` — Create a command stack for scene editing with reapply capabilities based on the given document and page ID + +```ts +(document: SceneDocument, activePageId: string) => SceneCommandStackWithReapply +``` + +### `createSnapEngine` + +`function` — Build a SnapEngine instance to manage snapping targets and behavior within an editor scene + +```ts +() => SnapEngine +``` + +### `createZoomPanMath` + +`function` — Create zoom and pan math utilities enforcing valid zoom range constraints + +```ts +(config: ZoomPanConfig) => ZoomPanMath +``` + +### `DEFAULT_INSERT_TEMPLATES` + +`const` — The built-in starter templates (heading, body text, rectangle, ellipse). + +```ts +readonly InsertTemplate[] +``` + +### `deleteElementCommand` + +`function` — Resolve a command to delete an element from a specified page in the document + +```ts +(input: DeleteElementInput) => SceneCommand +``` + +### `DeleteElementInput` + +`interface` — Define input parameters required to delete an element from a specific page in a document + +```ts +interface DeleteElementInput +``` + +### `deletePageCommand` + +`function` — Delete a page from a document ensuring it is not the last remaining page + +```ts +(input: DeletePageInput) => SceneCommand +``` + +### `DeletePageInput` + +`interface` — Define input parameters required to delete a page from a scene document + +```ts +interface DeletePageInput +``` + +### `DesignCanvas` + +`function` + +```ts +({ document: initialDocument, rev: initialRev, canWrite, mode, onApplyOperations, onSelectionChange, renderAgentPanel,… +``` + +### `DesignCanvasChromeLazy` + +`function` — Raw chrome only — use when supplying a custom renderWorkspace/renderThumbnail. + +```ts +LazyExoticComponent<({ document: initialDocument, rev: initialRev, canWrite, mode, onApplyOperations, onSelectionChange… +``` + +### `DesignCanvasEditor` + +`function` — Mount this component to get the full editor: toolbar, rulers, layers panel, pages strip, zoom controls, and the Konva canvas — all sharing one command stack so undo/redo and selection are coherent ac… + +```ts +(props: DesignCanvasProps) => Element +``` + +### `DesignCanvasFullProps` + +`interface` — Callers inject a workspace renderer so this chrome stays Konva-free. + +```ts +interface DesignCanvasFullProps +``` + +### `DesignCanvasLazy` + +`function` — Batteries-included editor: chrome + workspace on one shared stack. + +```ts +LazyExoticComponent<(props: DesignCanvasProps) => Element> +``` + +### `DesignCanvasMode` + +`type` — Editor capability mode. + +```ts +type DesignCanvasMode +``` + +### `DesignCanvasProps` + +`interface` — Define properties and callbacks for configuring and controlling the design canvas editor + +```ts +interface DesignCanvasProps +``` + +### `documentCropToStageCoords` + +`function` — Build the toDataURL crop rect translated to stage output coordinates. + +```ts +(cropRect: ExportCropRect, stageScale: number, stageX: number, stageY: number) => { x: number; y: number; width: number… +``` + +### `downloadDataUrl` + +`function` — Trigger a browser download for a data URL. + +```ts +(dataUrl: string, filename: string) => void +``` + +### `DUPLICATE_OFFSET` + +`const` — Document-px offset applied to duplicated elements so the copy is visually separated from the original (matching common design-tool convention). + +```ts +NudgeDelta +``` + +### `duplicatePageCommand` + +`function` — Create a command to duplicate a page and prepare its deletion operation in the scene + +```ts +(input: DuplicatePageInput) => SceneCommand +``` + +### `DuplicatePageInput` + +`interface` — Define input parameters required to duplicate a page within a scene document + +```ts +interface DuplicatePageInput +``` + +### `EditorSceneState` + +`interface` — Define the state of the editor scene including document, view settings, and selection details + +```ts +interface EditorSceneState +``` + +### `ElementNode` + +`function` — Memoized so a `stack.notify()` (fired ~120/s during a pan/marquee) that re-renders WorkspaceView does NOT re-render every element. + +```ts +MemoExoticComponent<(props: ElementNodeProps) => Element | null> +``` + +### `ElementNodeProps` + +`interface` + +```ts +interface ElementNodeProps +``` + +### `ExportControl` + +`function` + +```ts +({ defaults, onExport, className }: ExportControlProps) => Element +``` + +### `ExportControlProps` + +`interface` + +```ts +interface ExportControlProps +``` + +### `ExportCropRect` + +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds + +```ts +interface ExportCropRect +``` + +### `exportDocumentJson` + +`function` — Serialize a scene document to pretty-printed JSON with schemaVersion asserted. + +```ts +(document: SceneDocument) => string +``` + +### `exportPageDataUrl` + +`function` — Render a single page to a data URL. + +```ts +(stage: KonvaStageLike, page: ScenePage, opts: ExportPageDataUrlOptions) => Promise +``` + +### `ExportPageDataUrlOptions` + +`interface` — Define options to export a page as a data URL with format, pixel ratio, bleed, and preset settings + +```ts +interface ExportPageDataUrlOptions +``` + +### `ExportPreset` + +`interface` — Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag. + +```ts +interface ExportPreset +``` + +### `ExportTriggerOptions` + +`interface` — What the chrome's Export control collects and hands to the workspace's export callback. + +```ts +interface ExportTriggerOptions +``` + +### `ExportViewSnapshot` + +`interface` — Minimal snapshot of stage view state that export.ts saves before mutating zoom/pan/visibility and restores afterward. + +```ts +interface ExportViewSnapshot +``` + +### `fittedSize` + +`function` — Fit (naturalW, naturalH) under a max-dimension cap (further bounded by the page), preserving aspect ratio. + +```ts +(naturalW: number, naturalH: number, pageWidth: number, pageHeight: number) => { width: number; height: number; } +``` + +### `flattenLayerTree` + +`function` — Flatten `page.elements` into display order for the layers panel. + +```ts +(page: ScenePage) => LayerRow[] +``` + +### `formatRulerLabel` + +`function` — Format a document-px position as a compact label: integers stay whole, decimals are rounded to 1 place. + +```ts +(value: number) => string +``` + +### `GridLayer` + +`function` + +```ts +({ pageWidth, pageHeight, gridSize, zoom, panX, panY, color, opacity, }: GridLayerProps) => Element | null +``` + +### `GridLayerProps` + +`interface` + +```ts +interface GridLayerProps +``` + +### `groupElementsCommand` + +`function` — Create a command to group multiple elements into a single group within a scene + +```ts +(input: GroupElementsInput) => SceneCommand +``` + +### `GroupElementsInput` + +`interface` — Define input parameters for grouping elements within a scene document on a specific page + +```ts +interface GroupElementsInput +``` + +### `hitTestPoint` + +`function` — Top-most selectable element whose AABB contains the document-space point, or null when the point is over empty space. + +```ts +(page: ScenePage, x: number, y: number) => string | null +``` + +### `IconButton` + +`function` + +```ts +ForwardRefExoticComponent> +``` + +### `IconButtonProps` + +`interface` + +```ts +interface IconButtonProps +``` + +### `identifyTaintedSrc` + +`function` — Walk image nodes to find the src of any that may have caused a SecurityError when the stage called toDataURL. + +```ts +(imageSrcs: readonly { name: string; src: string; }[]) => string | null +``` + +### `InsertGeneration` + +`interface` — An already-generated image the panel can offer for one-click insertion. + +```ts +interface InsertGeneration +``` + +### `InsertPageGeometry` + +`interface` — Active page geometry an insert lands into — drives centering and fitting. + +```ts +interface InsertPageGeometry +``` + +### `InsertTemplate` + +`interface` — A template the insert panel can drop without the agent. + +```ts +interface InsertTemplate +``` + +### `isCrossOriginSrc` + +`function` — Heuristic: a src is potentially cross-origin when it is an absolute http(s) URL. + +```ts +(src: string) => boolean +``` + +### `isExportHiddenNodeName` + +`function` — Returns true for any Konva node that must be hidden during export. + +```ts +(name: string) => boolean +``` + +### `LayerRow` + +`interface` — Describe a layer row with its element, depth, grouping, ownership, and parent group details + +```ts +interface LayerRow +``` + +### `LAYERS_PANEL_ROW_LIMIT` + +`const` — The maximum number of rows the layers panel renders before truncating. + +```ts +500 +``` + +### `LayersPanel` + +`function` + +```ts +({ page, selectedElementIds, canWrite, onSetAttrs, onReorder, onSelect }: LayersPanelProps) => Element +``` + +### `LayersPanelProps` + +`interface` + +```ts +interface LayersPanelProps +``` + +### `marqueeSelect` + +`function` — Returns the ids of selectable elements on `page` whose AABB intersects (or is contained by) `rect`. + +```ts +(page: ScenePage, rect: Bounds, opts?: MarqueeSelectOptions) => string[] +``` + +### `MarqueeSelectOptions` + +`interface` — Define options to configure marquee selection behavior including containment requirements + +```ts +interface MarqueeSelectOptions +``` + +### `MAX_INSERT_DIMENSION` + +`const` — Largest dimension (document px) a freshly inserted element is fitted to, before the page-size cap applies. + +```ts +600 +``` + +### `mintElementId` + +`function` — Mint a DOM-safe element id. + +```ts +() => string +``` + +### `multiSetAttrsCommand` + +`function` — Build a scene command to set multiple attributes on elements across pages + +```ts +(entries: MultiSetAttrsEntry[]) => SceneCommand +``` + +### `MultiSetAttrsEntry` + +`interface` — Define an entry linking page and element IDs with current and prior scene attribute patches + +```ts +interface MultiSetAttrsEntry +``` + +### `nudgeDelta` + +`function` — Map an arrow key to a document-px delta. + +```ts +(key: "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown", shift: boolean) => NudgeDelta +``` + +### `NudgeDelta` + +`interface` — Represent horizontal and vertical displacement values for nudging elements + +```ts +interface NudgeDelta +``` + +### `PagesStrip` + +`function` + +```ts +({ pages, activePageId, canWrite, renderThumbnail, onSelectPage, onAddPage, onDuplicatePage, onDeletePage, onReorderPag… +``` + +### `PagesStripProps` + +`interface` + +```ts +interface PagesStripProps +``` + +### `reorderElementCommand` + +`function` — Resolve a command to reorder an element within a scene by moving it to a specified index + +```ts +(input: ReorderElementInput) => SceneCommand +``` + +### `ReorderElementInput` + +`interface` — Define input parameters to reorder an element within a page + +```ts +interface ReorderElementInput +``` + +### `reorderPageCommand` + +`function` — Create a command to reorder a page to a specified index within a scene + +```ts +(input: ReorderPageInput) => SceneCommand +``` + +### `ReorderPageInput` + +`interface` — Define input parameters to reorder a page by specifying its ID and target index + +```ts +interface ReorderPageInput +``` + +### `ResolvedExportParams` + +`interface` — Define parameters required to resolve export settings including crop, pixel ratio, type, and quality + +```ts +interface ResolvedExportParams +``` + +### `resolveExportParams` + +`function` — Resolve the full set of toDataURL params from a page, format, pixel ratio, bleed flag, and optional preset. + +```ts +(page: ScenePage, opts: { format: "png" | "jpeg"; pixelRatio?: number | undefined; includeBleed?: boolean | undefined;… +``` + +### `Rulers` + +`function` + +```ts +({ pageWidth, pageHeight, zoom, scrollLeft, scrollTop, showRulers, guides, onGuidesChange }: RulersProps) => Element |… +``` + +### `RulersProps` + +`interface` + +```ts +interface RulersProps +``` + +### `RulerTick` + +`interface` — Define a ruler tick with a position and optional label for measurement markings + +```ts +interface RulerTick +``` + +### `scaleForPreset` + +`function` — Pixel ratio for stage.toDataURL given a crop rect and an export preset. + +```ts +(preset: ExportPreset, cropRect: ExportCropRect) => number +``` + +### `SCENE_COMMAND_HISTORY_LIMIT` + +`const` — Oldest entries are dropped past this bound; redo stack is cleared on execute. + +```ts +200 +``` + +### `SceneCommand` + +`interface` — Define a command with execution, undo, and operation methods for scene editing and persistence + +```ts +interface SceneCommand +``` + +### `SceneCommandStack` + +`interface` — Manage and track scene commands with undo, redo, and state subscription capabilities + +```ts +interface SceneCommandStack +``` + +### `SceneCommandStackWithReapply` + +`interface` — The base {@link SceneCommandStack} plus the two command-specific recovery primitives the undo/redo persistence path needs. + +```ts +interface SceneCommandStackWithReapply +``` + +### `SelectionLayer` + +`function` + +```ts +({ stageRef, selectedIds, selectedElements, canWrite, onTransformEnd, pageId, render, }: SelectionLayerProps) => Element +``` + +### `SelectionLayerProps` + +`interface` + +```ts +interface SelectionLayerProps +``` + +### `selectTickStep` + +`function` — Select the major tick step that keeps major ticks ≥ minMajorSpacingPx apart at the given zoom. + +```ts +(input: { zoom: number; minMajorSpacingPx?: number | undefined; minMinorSpacingPx?: number | undefined; }) => TickStep +``` + +### `setAttrsCommand` + +`function` — Create a command to set attributes on a scene element with undo capability + +```ts +(input: SetAttrsInput) => SceneCommand +``` + +### `SetAttrsInput` + +`interface` — Define input parameters for setting element attributes within a specific page context + +```ts +interface SetAttrsInput +``` + +### `setDocumentTitleCommand` + +`function` — Resolve a command to rename a document title with undo and redo operations + +```ts +(input: SetDocumentTitleInput) => SceneCommand +``` + +### `SetDocumentTitleInput` + +`interface` — Define input parameters for setting the title of a scene document + +```ts +interface SetDocumentTitleInput +``` + +### `setPageGuidesCommand` + +`function` — Create a command to update page guides with undo support + +```ts +(input: SetPageGuidesInput) => SceneCommand +``` + +### `SetPageGuidesInput` + +`interface` — Define input parameters for setting guides on a specific page within a document + +```ts +interface SetPageGuidesInput +``` + +### `setPagePropsCommand` + +`function` — Build a command to update page properties based on the provided input + +```ts +(input: SetPagePropsInput) => SceneCommand +``` + +### `SetPagePropsInput` + +`interface` — Define input parameters for setting properties on a specific page within a scene document + +```ts +interface SetPagePropsInput +``` + +### `SnapEngine` + +`interface` — Resolve snapping targets and apply snapping logic to moving elements within the editor scene + +```ts +interface SnapEngine +``` + +### `SnapResult` + +`interface` — Define the result of a snap operation including coordinates and active snap lines + +```ts +interface SnapResult +``` + +### `SnapTarget` + +`interface` — Define a target position and kind for snapping elements on a page + +```ts +interface SnapTarget +``` + +### `SnapTargetKind` + +`type` — Define snap target categories for aligning elements within a layout system + +```ts +type SnapTargetKind +``` + +### `SnapTargets` + +`interface` — Define vertical and horizontal collections of snap targets for alignment purposes + +```ts +interface SnapTargets +``` + +### `TickStep` + +`interface` — Define spacing and visibility rules for major and minor ticks in a coordinate system + +```ts +interface TickStep +``` + +### `Toolbar` + +`function` + +```ts +({ page, selectedElements, canWrite, mode, canUndo, canRedo, gridEnabled, snapEnabled, showRulers, showBleed, onUndo, o… +``` + +### `ToolbarProps` + +`interface` + +```ts +interface ToolbarProps +``` + +### `TransformerNode` + +`interface` — Pure geometry helpers extracted from component drag/transform logic so every interactive math path is unit-testable without Konva or a DOM. + +```ts +interface TransformerNode +``` + +### `ungroupElementCommand` + +`function` — Resolve a command to ungroup a group element into its child elements within a scene + +```ts +(input: UngroupElementInput) => SceneCommand +``` + +### `UngroupElementInput` + +`interface` — Define input parameters required to ungroup elements within a specific page and group + +```ts +interface UngroupElementInput +``` + +### `Workspace` + +`function` — Self-contained Konva workspace that creates its own command stack. + +```ts +(props: DesignCanvasProps) => Element | null +``` + +### `WorkspaceView` + +`function` + +```ts +({ canWrite, onApplyOperations, onSelectionChange, className, stack, activePage, onFitRef, onExport, onExportRef, fitOn… +``` + +### `WorkspaceViewProps` + +`interface` + +```ts +interface WorkspaceViewProps +``` + +### `ZoomControls` + +`function` + +```ts +({ zoom, onZoom, onFit, fitLabel }: ZoomControlsProps) => Element +``` + +### `ZoomControlsProps` + +`interface` + +```ts +interface ZoomControlsProps +``` + +### `ZoomPanConfig` + +`interface` — Define configuration options for minimum and maximum zoom levels in a zoom-pan interface + +```ts +interface ZoomPanConfig +``` + +### `ZoomPanMath` + +`interface` — Define methods and properties to calculate zoom and pan transformations between document and screen coordinates + +```ts +interface ZoomPanMath +``` + + +## `./design-canvas-react/engine` + +Source: `src/design-canvas-react/engine.ts` · depends on `brand`, `design-canvas`, `theme` + +### `addElementCommand` + +`function` — Create a command to add an element to a scene with optional positioning and grouping + +```ts +(input: AddElementInput) => SceneCommand +``` + +### `AddElementInput` + +`interface` — Define input parameters for adding a scene element with optional index and parent group ID + +```ts +interface AddElementInput +``` + +### `addPageCommand` + +`function` — Create a command to add a page with optional settings and index in the scene + +```ts +(input: AddPageInput) => SceneCommand +``` + +### `AddPageInput` + +`interface` — Define input parameters for adding a new page with optional settings and position index + +```ts +interface AddPageInput +``` + +### `ApplySceneResult` + +`interface` — Resolve the result of applying a scene update including revision and optional normalized document + +```ts +interface ApplySceneResult +``` + +### `bindSlotCommand` + +`function` — Bind a slot to an element within a page and generate the corresponding scene command + +```ts +(input: BindSlotInput) => SceneCommand +``` + +### `BindSlotInput` + +`interface` — Define input parameters for binding a slot within a scene document element + +```ts +interface BindSlotInput +``` + +### `bleedAwareExportBounds` + +`function` — Crop rectangle in page coordinates for a given page, optionally expanded to include bleed margins. + +```ts +(page: ScenePage, includeBleed: boolean) => ExportCropRect +``` + +### `buildInsertImageOp` + +`function` — Build an `add_element` op placing an image, fitted and centered on the page. + +```ts +(src: string, naturalSize: { width: number; height: number; }, page: InsertPageGeometry) => SceneOperation +``` + +### `centeredPosition` + +`function` — Top-left position that centers a (width, height) box on the page. + +```ts +(width: number, height: number, pageWidth: number, pageHeight: number) => { x: number; y: number; } +``` + +### `collectGridTargets` + +`function` — Generate grid line targets within a neighborhood around the moving bounds. + +```ts +(bounds: Bounds, gridSize: number, page: ScenePage, thresholdDocPx: number) => { vertical: SnapTarget[]; horizontal: Sn… +``` + +### `createSceneCommandStack` + +`function` — Create a command stack for scene editing with reapply capabilities based on the given document and page ID + +```ts +(document: SceneDocument, activePageId: string) => SceneCommandStackWithReapply +``` + +### `createSnapEngine` + +`function` — Build a SnapEngine instance to manage snapping targets and behavior within an editor scene + +```ts +() => SnapEngine +``` + +### `createZoomPanMath` + +`function` — Create zoom and pan math utilities enforcing valid zoom range constraints + +```ts +(config: ZoomPanConfig) => ZoomPanMath +``` + +### `DEFAULT_INSERT_TEMPLATES` + +`const` — The built-in starter templates (heading, body text, rectangle, ellipse). + +```ts +readonly InsertTemplate[] +``` + +### `deleteElementCommand` + +`function` — Resolve a command to delete an element from a specified page in the document + +```ts +(input: DeleteElementInput) => SceneCommand +``` + +### `DeleteElementInput` + +`interface` — Define input parameters required to delete an element from a specific page in a document + +```ts +interface DeleteElementInput +``` + +### `deletePageCommand` + +`function` — Delete a page from a document ensuring it is not the last remaining page + +```ts +(input: DeletePageInput) => SceneCommand +``` + +### `DeletePageInput` + +`interface` — Define input parameters required to delete a page from a scene document + +```ts +interface DeletePageInput +``` + +### `DesignCanvasMode` + +`type` — Editor capability mode. + +```ts +type DesignCanvasMode +``` + +### `DesignCanvasProps` + +`interface` — Define properties and callbacks for configuring and controlling the design canvas editor + +```ts +interface DesignCanvasProps +``` + +### `documentCropToStageCoords` + +`function` — Build the toDataURL crop rect translated to stage output coordinates. + +```ts +(cropRect: ExportCropRect, stageScale: number, stageX: number, stageY: number) => { x: number; y: number; width: number… +``` + +### `DUPLICATE_OFFSET` + +`const` — Document-px offset applied to duplicated elements so the copy is visually separated from the original (matching common design-tool convention). + +```ts +NudgeDelta +``` + +### `duplicatePageCommand` + +`function` — Create a command to duplicate a page and prepare its deletion operation in the scene + +```ts +(input: DuplicatePageInput) => SceneCommand +``` + +### `DuplicatePageInput` + +`interface` — Define input parameters required to duplicate a page within a scene document + +```ts +interface DuplicatePageInput +``` + +### `EditorSceneState` + +`interface` — Define the state of the editor scene including document, view settings, and selection details + +```ts +interface EditorSceneState +``` + +### `ExportCropRect` + +`interface` — Define crop rectangle coordinates and dimensions for exporting content within page bounds + +```ts +interface ExportCropRect +``` + +### `ExportPreset` + +`interface` — Export quality preset — pins pixel density, optional output dimensions, bleed inclusion, and raster format so callers pass a preset id rather than a full parameter bag. + +```ts +interface ExportPreset +``` + +### `ExportTriggerOptions` + +`interface` — What the chrome's Export control collects and hands to the workspace's export callback. + +```ts +interface ExportTriggerOptions +``` + +### `ExportViewSnapshot` + +`interface` — Minimal snapshot of stage view state that export.ts saves before mutating zoom/pan/visibility and restores afterward. + +```ts +interface ExportViewSnapshot +``` + +### `fittedSize` + +`function` — Fit (naturalW, naturalH) under a max-dimension cap (further bounded by the page), preserving aspect ratio. + +```ts +(naturalW: number, naturalH: number, pageWidth: number, pageHeight: number) => { width: number; height: number; } +``` + +### `groupElementsCommand` + +`function` — Create a command to group multiple elements into a single group within a scene + +```ts +(input: GroupElementsInput) => SceneCommand +``` + +### `GroupElementsInput` + +`interface` — Define input parameters for grouping elements within a scene document on a specific page + +```ts +interface GroupElementsInput +``` + +### `hitTestPoint` + +`function` — Top-most selectable element whose AABB contains the document-space point, or null when the point is over empty space. + +```ts +(page: ScenePage, x: number, y: number) => string | null +``` + +### `identifyTaintedSrc` + +`function` — Walk image nodes to find the src of any that may have caused a SecurityError when the stage called toDataURL. + +```ts +(imageSrcs: readonly { name: string; src: string; }[]) => string | null +``` + +### `InsertPageGeometry` + +`interface` — Active page geometry an insert lands into — drives centering and fitting. + +```ts +interface InsertPageGeometry +``` + +### `InsertTemplate` + +`interface` — A template the insert panel can drop without the agent. + +```ts +interface InsertTemplate +``` + +### `isCrossOriginSrc` + +`function` — Heuristic: a src is potentially cross-origin when it is an absolute http(s) URL. + +```ts +(src: string) => boolean +``` + +### `isExportHiddenNodeName` + +`function` — Returns true for any Konva node that must be hidden during export. + +```ts +(name: string) => boolean +``` + +### `marqueeSelect` + +`function` — Returns the ids of selectable elements on `page` whose AABB intersects (or is contained by) `rect`. + +```ts +(page: ScenePage, rect: Bounds, opts?: MarqueeSelectOptions) => string[] +``` + +### `MarqueeSelectOptions` + +`interface` — Define options to configure marquee selection behavior including containment requirements + +```ts +interface MarqueeSelectOptions +``` + +### `MAX_INSERT_DIMENSION` + +`const` — Largest dimension (document px) a freshly inserted element is fitted to, before the page-size cap applies. + +```ts +600 +``` + +### `mintElementId` + +`function` — Mint a DOM-safe element id. + +```ts +() => string +``` + +### `multiSetAttrsCommand` + +`function` — Build a scene command to set multiple attributes on elements across pages + +```ts +(entries: MultiSetAttrsEntry[]) => SceneCommand +``` + +### `MultiSetAttrsEntry` + +`interface` — Define an entry linking page and element IDs with current and prior scene attribute patches + +```ts +interface MultiSetAttrsEntry +``` + +### `nudgeDelta` + +`function` — Map an arrow key to a document-px delta. + +```ts +(key: "ArrowLeft" | "ArrowRight" | "ArrowUp" | "ArrowDown", shift: boolean) => NudgeDelta +``` + +### `NudgeDelta` + +`interface` — Represent horizontal and vertical displacement values for nudging elements + +```ts +interface NudgeDelta +``` + +### `reorderElementCommand` + +`function` — Resolve a command to reorder an element within a scene by moving it to a specified index + +```ts +(input: ReorderElementInput) => SceneCommand +``` + +### `ReorderElementInput` + +`interface` — Define input parameters to reorder an element within a page + +```ts +interface ReorderElementInput +``` + +### `reorderPageCommand` + +`function` — Create a command to reorder a page to a specified index within a scene + +```ts +(input: ReorderPageInput) => SceneCommand +``` + +### `ReorderPageInput` + +`interface` — Define input parameters to reorder a page by specifying its ID and target index + +```ts +interface ReorderPageInput +``` + +### `ResolvedExportParams` + +`interface` — Define parameters required to resolve export settings including crop, pixel ratio, type, and quality + +```ts +interface ResolvedExportParams +``` + +### `resolveExportParams` + +`function` — Resolve the full set of toDataURL params from a page, format, pixel ratio, bleed flag, and optional preset. + +```ts +(page: ScenePage, opts: { format: "png" | "jpeg"; pixelRatio?: number | undefined; includeBleed?: boolean | undefined;… +``` + +### `scaleForPreset` + +`function` — Pixel ratio for stage.toDataURL given a crop rect and an export preset. + +```ts +(preset: ExportPreset, cropRect: ExportCropRect) => number +``` + +### `SCENE_COMMAND_HISTORY_LIMIT` + +`const` — Oldest entries are dropped past this bound; redo stack is cleared on execute. + +```ts +200 +``` + +### `SceneCommand` + +`interface` — Define a command with execution, undo, and operation methods for scene editing and persistence + +```ts +interface SceneCommand +``` + +### `SceneCommandStack` + +`interface` — Manage and track scene commands with undo, redo, and state subscription capabilities + +```ts +interface SceneCommandStack +``` + +### `SceneCommandStackWithReapply` + +`interface` — The base {@link SceneCommandStack} plus the two command-specific recovery primitives the undo/redo persistence path needs. + +```ts +interface SceneCommandStackWithReapply +``` + +### `setAttrsCommand` + +`function` — Create a command to set attributes on a scene element with undo capability + +```ts +(input: SetAttrsInput) => SceneCommand +``` + +### `SetAttrsInput` + +`interface` — Define input parameters for setting element attributes within a specific page context + +```ts +interface SetAttrsInput +``` + +### `setDocumentTitleCommand` + +`function` — Resolve a command to rename a document title with undo and redo operations + +```ts +(input: SetDocumentTitleInput) => SceneCommand +``` + +### `SetDocumentTitleInput` + +`interface` — Define input parameters for setting the title of a scene document + +```ts +interface SetDocumentTitleInput +``` + +### `setPageGuidesCommand` + +`function` — Create a command to update page guides with undo support + +```ts +(input: SetPageGuidesInput) => SceneCommand +``` + +### `SetPageGuidesInput` + +`interface` — Define input parameters for setting guides on a specific page within a document + +```ts +interface SetPageGuidesInput +``` + +### `setPagePropsCommand` + +`function` — Build a command to update page properties based on the provided input + +```ts +(input: SetPagePropsInput) => SceneCommand +``` + +### `SetPagePropsInput` + +`interface` — Define input parameters for setting properties on a specific page within a scene document + +```ts +interface SetPagePropsInput +``` + +### `SnapEngine` + +`interface` — Resolve snapping targets and apply snapping logic to moving elements within the editor scene + +```ts +interface SnapEngine +``` + +### `SnapResult` + +`interface` — Define the result of a snap operation including coordinates and active snap lines + +```ts +interface SnapResult +``` + +### `SnapTarget` + +`interface` — Define a target position and kind for snapping elements on a page + +```ts +interface SnapTarget +``` + +### `SnapTargetKind` + +`type` — Define snap target categories for aligning elements within a layout system + +```ts +type SnapTargetKind +``` + +### `SnapTargets` + +`interface` — Define vertical and horizontal collections of snap targets for alignment purposes + +```ts +interface SnapTargets +``` + +### `ungroupElementCommand` + +`function` — Resolve a command to ungroup a group element into its child elements within a scene + +```ts +(input: UngroupElementInput) => SceneCommand +``` + +### `UngroupElementInput` + +`interface` — Define input parameters required to ungroup elements within a specific page and group + +```ts +interface UngroupElementInput +``` + +### `ZoomPanConfig` + +`interface` — Define configuration options for minimum and maximum zoom levels in a zoom-pan interface + +```ts +interface ZoomPanConfig +``` + +### `ZoomPanMath` + +`interface` — Define methods and properties to calculate zoom and pan transformations between document and screen coordinates + +```ts +interface ZoomPanMath +``` + + +## `./design-canvas-react/lazy` + +Source: `src/design-canvas-react/lazy.tsx` · depends on `brand`, `design-canvas`, `theme` + +### `DesignCanvasChromeLazy` + +`function` — Raw chrome only — use when supplying a custom renderWorkspace/renderThumbnail. + +```ts +LazyExoticComponent<({ document: initialDocument, rev: initialRev, canWrite, mode, onApplyOperations, onSelectionChange… +``` + +### `DesignCanvasFullProps` + +`interface` — Callers inject a workspace renderer so this chrome stays Konva-free. + +```ts +interface DesignCanvasFullProps +``` + +### `DesignCanvasLazy` + +`function` — Batteries-included editor: chrome + workspace on one shared stack. + +```ts +LazyExoticComponent<(props: DesignCanvasProps) => Element> +``` + +### `DesignCanvasProps` + +`interface` — Define properties and callbacks for configuring and controlling the design canvas editor + +```ts +interface DesignCanvasProps +``` + + +## `./design-canvas/drizzle` + +Source: `src/design-canvas/drizzle.ts` · depends on `tools`, `web` + +### `createDesignCanvasTables` + +`function` — Build SQLite tables for design documents with workspace and user references + +```ts +(opts: CreateDesignCanvasTablesOptions) => { designDocuments: SQLiteTableWithColumns<{ name: "design_document"; schema:… +``` + +### `CreateDesignCanvasTablesOptions` + +`interface` — Define options for creating design canvas tables including workspace and user table configurations + +```ts +interface CreateDesignCanvasTablesOptions +``` + +### `createDrizzleSceneStore` + +`function` — Create a scene store configured with database tables and scoped to a specific document and workspace + +```ts +(options: CreateDrizzleSceneStoreOptions) => SceneStore +``` + +### `CreateDrizzleSceneStoreOptions` + +`interface` — Define options for creating a Drizzle scene store including database, tables, and scope + +```ts +interface CreateDrizzleSceneStoreOptions +``` + +### `DesignCanvasDatabase` + +`type` — Any SQLite drizzle database — `any` erases the driver-specific run-result and schema generics so better-sqlite3, D1, and libsql handles all fit. + +```ts +type DesignCanvasDatabase +``` + +### `DesignCanvasParentTable` + +`type` — A product table referenced by FK — only the `id` column is touched. + +```ts +type DesignCanvasParentTable +``` + +### `DesignCanvasTables` + +`type` — Resolve the structure and data of design canvas tables for rendering and manipulation + +```ts +type DesignCanvasTables +``` + +### `DesignDecisionRow` + +`type` — Resolve a design decision row from the design decisions table selection + +```ts +type DesignDecisionRow +``` + +### `DesignDocumentRow` + +`type` — Resolve the selected structure of a design document row from design canvas tables + +```ts +type DesignDocumentRow +``` + +### `DesignExportRow` + +`type` — Resolve the selected fields of designExports from DesignCanvasTables + +```ts +type DesignExportRow +``` + + +## `./durable-chat` + +Source: `src/durable-chat/index.ts` · depends on `interactions`, `plans` + +### `applyDurableInteractionAnswer` + +`function` — Resolve and record the outcome and answers of a durable interaction within the given store and scope + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: "declined" | "accepted", answers?: R… +``` + +### `applyDurableInteractionAsk` + +`function` — Resolve and upsert a durable interaction ask in the store with optional event and timing parameters + +```ts +(store: DurablePlanStore, scope: DurableChatScope, request: InteractionRequestWire, options?: { eventId?: string | unde… +``` + +### `applyDurableInteractionCancel` + +`function` — Resolve cancellation of a durable interaction with optional reason and event details + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… +``` + +### `createDurableChatEventProjection` + +`function` — Event projector usable with any `ChatTurnRouteProducer` through `withDurableChatProjection`. + +```ts +(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableChatEventP… +``` + +### `createDurableChatScope` + +`function` — Create a durable chat scope from a non-empty string value + +```ts +(value: string) => DurableChatScope +``` + +### `createDurableInteractionProjectionAdapter` + +`function` — Binds an authorized durable scope/store to interaction lifecycle events. + +```ts +(options: { store: DurablePlanStore; scope: DurableChatScope; now?: (() => string) | undefined; }) => DurableInteractio… +``` + +### `createDurableInteractionRoutePersistence` + +`function` — Ready-to-use bridge from `/interactions` to the durable state port. + +```ts +(options: CreateDurableInteractionRoutePersistenceOptions) => DurableInteractionRoutePersistence DurableInteractionSettlement +``` + +### `createDurablePlanRoutes` + +`function` — Build durable plan routes with authorization and effect handling based on provided options + +```ts +(options: DurablePlanRouteOptions) => DurablePlanRoutes +``` + +### `createInMemoryDurableChatStateStore` + +`function` — Create an in-memory durable chat state store for managing chat session data efficiently + +```ts +() => InMemoryDurableChatStateStore +``` + +### `DurableAnswerIntentJournal` + +`type` — Provide durable methods to manage the lifecycle of answer intents in a plan store + +```ts +type DurableAnswerIntentJournal +``` + +### `DurableAnswerIntentRecord` + +`interface` — Define the structure for recording durable answer intent details and their states + +```ts +interface DurableAnswerIntentRecord +``` + +### `DurableAnswerIntentState` + +`type` — Define possible states for a durable answer intent lifecycle + +```ts +type DurableAnswerIntentState +``` + +### `DurableChatConflictError` + +`class` — Represent conflict errors occurring in durable chat state management + +```ts +class DurableChatConflictError +``` + +### `DurableChatError` + +`class` — Typed, fail-loud errors for adapters and route seams. + +```ts +class DurableChatError +``` + +### `DurableChatErrorCode` + +`type` — Define error codes representing possible Durable Chat failure scenarios + +```ts +type DurableChatErrorCode +``` + +### `DurableChatEventProjection` + +`interface` — Resolve chat events and materialize their state into durable records + +```ts +interface DurableChatEventProjection +``` + +### `DurableChatGoneError` + +`class` — Represent durable chat errors indicating the chat plan is no longer available + +```ts +class DurableChatGoneError +``` + +### `DurableChatScope` + +`type` — An authorization-derived tenant/thread scope. + +```ts +type DurableChatScope +``` + +### `durableChatScopeKey` + +`function` — Resolve a valid durable chat scope key from the given scope input + +```ts +(scope: DurableChatScope) => string +``` + +### `DurableChatStateStore` + +`type` — Alias used by adapters that store all durable chat state in one port. + +```ts +type DurableChatStateStore +``` + +### `DurableChatUnavailableError` + +`class` — Represent unavailable durable chat authority errors with status code 503 + +```ts +class DurableChatUnavailableError +``` + +### `DurableFollowUpReceipt` + +`interface` — Define a durable receipt capturing stable identifiers and state for follow-up decisions + +```ts +interface DurableFollowUpReceipt +``` + +### `DurableInteractionAcknowledgement` + +`interface` — Represent durable acknowledgement of an interaction with optional authority, status, and timestamp fields + +```ts +interface DurableInteractionAcknowledgement +``` + +### `DurableInteractionGuarantee` + +`type` — Define interaction durability levels to specify reconciliation or best-effort guarantees + +```ts +type DurableInteractionGuarantee +``` + +### `durableInteractionIntentKey` + +`function` — Stable key helper exported for products implementing their own settlement loop. + +```ts +(scope: DurableChatScope, interactionId: string, attemptKey: string) => string +``` + +### `DurableInteractionProjection` + +`interface` — Define a durable chat interaction projection with idempotent event tracking and optional tombstone flag + +```ts +interface DurableInteractionProjection +``` + +### `DurableInteractionProjectionAdapter` + +`interface` — Define methods to manage durable interaction projections including upsert, cancel, and materialize operations + +```ts +interface DurableInteractionProjectionAdapter +``` + +### `DurableInteractionSettlement` + +`interface` — Manage durable interaction lifecycles by preparing, acknowledging, finalizing, aborting, and reconciling intents + +```ts +interface DurableInteractionSettlement +``` + +### `DurableInteractionSettlementFactoryOptions` + +`interface` — Define options for creating durable interaction settlement factories including store and optional reconcile authority + +```ts +interface DurableInteractionSettlementFactoryOptions +``` + +### `DurableInteractionSettlementOptions` + +`interface` — Define options for durable interaction settlement including attempt key, guarantee, and timestamp provider + +```ts +interface DurableInteractionSettlementOptions +``` + +### `DurablePlanAuthority` + +`interface` — Structural port to Sandbox (or another durable plan authority). + +```ts +interface DurablePlanAuthority +``` + +### `DurablePlanAuthorityCurrentResult` + +`interface` — Represent the current authoritative state and optional receipt of a durable plan authority + +```ts +interface DurablePlanAuthorityCurrentResult +``` + +### `DurablePlanAuthorityDecision` + +`type` — Resolve durable plan authority decisions including approval, rejection, or predefined durable decisions + +```ts +type DurablePlanAuthorityDecision +``` + +### `DurablePlanAuthorityResult` + +`interface` — Describe the outcome of an authority's durable plan decision including follow-up and metadata + +```ts +interface DurablePlanAuthorityResult +``` + +### `DurablePlanAuthorization` + +`type` — Resolve authorization status for durable plans using scopes, responses, or nullish values + +```ts +type DurablePlanAuthorization +``` + +### `DurablePlanCommandJournal` + +`type` — Pick essential methods to manage and record durable plan command operations + +```ts +type DurablePlanCommandJournal +``` + +### `DurablePlanCommandKey` + +`type` — Represent a unique identifier key for durable plan commands + +```ts +type DurablePlanCommandKey +``` + +### `DurablePlanCommandRecord` + +`interface` — Define the structure for recording durable plan commands with associated metadata and state information + +```ts +interface DurablePlanCommandRecord +``` + +### `DurablePlanCommandState` + +`type` — Define possible states for a durable plan command in its lifecycle + +```ts +type DurablePlanCommandState +``` + +### `DurablePlanDecision` + +`type` — Represent durable plan outcomes as either approved or rejected + +```ts +type DurablePlanDecision +``` + +### `DurablePlanEffectRecord` + +`interface` — Define the structure for recording the state and metadata of a durable plan effect + +```ts +interface DurablePlanEffectRecord +``` + +### `DurablePlanProjection` + +`type` — Projection retained by a durable store. + +```ts +type DurablePlanProjection +``` + +### `DurablePlanRouteAuthorizeArgs` + +`interface` — Define arguments for authorizing durable plan route requests with operation and optional plan ID + +```ts +interface DurablePlanRouteAuthorizeArgs +``` + +### `DurablePlanRouteOptions` + +`interface` — Define options for durable plan routing including store, authority, authorization, and idempotent side effect handling + +```ts +interface DurablePlanRouteOptions +``` + +### `DurablePlanRoutes` + +`interface` — Define routes handling durable plan requests with current and decide methods + +```ts +interface DurablePlanRoutes +``` + +### `DurablePlanStateStore` + +`type` — Represent durable storage for plan state management with persistence and reliability guarantees + +```ts +type DurablePlanStateStore +``` + +### `DurablePlanStore` + +`interface` — Manage durable storage and retrieval of plan projections, commands, and effects within a scoped context + +```ts +interface DurablePlanStore +``` + +### `InMemoryDurableChatStateStore` + +`class` — Reference adapter for tests and local development. + +```ts +class InMemoryDurableChatStateStore +``` + +### `InMemoryDurableChatStore` + +`const` — Short aliases retained for adapter authors who call this a durable chat store rather than a state store. + +```ts +typeof InMemoryDurableChatStateStore +``` + +### `normalizePlanDecision` + +`function` — Normalize input value to a standardized DurablePlanDecision or return null for invalid inputs + +```ts +(value: unknown) => DurablePlanDecision | null +``` + +### `planAuthorityIdempotencyKey` + +`function` — Generate a unique idempotency key for a plan authority based on scope, plan, revision, and decision + +```ts +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string +``` + +### `planCommandKey` + +`function` — Generate a unique key string for a plan command using plan ID, revision, and decision + +```ts +(planId: string, revision: number, decision: DurablePlanDecision) => string +``` + +### `planEffectKey` + +`function` — Generate a unique string key representing the effect of a plan decision within a given scope and revision + +```ts +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision) => string +``` + +### `PreparedDurableInteractionAnswer` + +`interface` — Define a structured response containing scope, settlement, and intent for durable interactions + +```ts +interface PreparedDurableInteractionAnswer +``` + +### `recordDurableInteractionAnswer` + +`function` — Record an accepted/declined answer in the projection. + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, outcome: "declined" | "accepted", answers?: R… +``` + +### `recordDurableInteractionCancel` + +`function` — Apply a cancel event. + +```ts +(store: DurablePlanStore, scope: DurableChatScope, interactionId: string, reason?: string | undefined, options?: { even… +``` + +### `stablePlanReceipt` + +`function` — Resolve a durable follow-up receipt ensuring idempotency for a given plan decision and revision + +```ts +(scope: DurableChatScope, planId: string, revision: number, decision: DurablePlanDecision, result: Pick CorrectnessChecker +``` + +### `createTokenRecallChecker` + +`function` — A deterministic `CorrectnessChecker` (agent-eval exports only `createLlmCorrectnessChecker`). + +```ts +(opts?: { minRecall?: number | undefined; minContentLength?: number | undefined; }) => (requirement: CompletionRequirem… +``` + +### `extractProducedState` + +`function` — Normalize a run's runtime event stream into `ProducedState`. + +```ts +(events: readonly RuntimeEventLike[]) => ProducedState +``` + +### `producedFromToolEvents` + +`function` — Bridge the app-tool side channel's produced events into the runtime-event shape agent-eval's `extractProducedState` reads. + +```ts +(events: readonly AppToolProducedEvent[]) => RuntimeEventLike[] +``` + +### `ProducedState` + +`interface` — Everything observable about what a run actually produced. + +```ts +interface ProducedState +``` + +### `RuntimeEventLike` + +`type` — The subset of runtime stream events `extractProducedState` consumes. + +```ts +type RuntimeEventLike +``` + +### `SatisfiedBy` + +`type` — What kind of produced state can satisfy a requirement structurally. + +```ts +type SatisfiedBy +``` + +### `TaskGold` + +`interface` + +```ts +interface TaskGold +``` + +### `verifyCompletion` + +`function` — Verify whether a run completed the task. + +```ts +(gold: TaskGold, state: ProducedState, checkCorrectness: CorrectnessChecker) => Promise +``` + +### `weightedComposite` + +`function` — Weighted composite over judge dimensions: `Σ(score_d · w_d) / Σ(w_d)` across the weighted dimensions. + +```ts +(input: WeightedCompositeInput) => WeightedCompositeResult +``` + + +## `./eval-campaign` + +Source: `src/eval-campaign/index.ts` + +### `aggregateJudgeVerdicts` + +`function` — Reduce per-judge verdicts to one aggregate. + +```ts +(verdicts: readonly JudgeVerdict[], dimensionKeys: readonly D[], weights?: Partial(cfg: EnsembleJudgeConfig) => JudgeCo… +``` + +### `CampaignResult` + +`interface` + +```ts +interface CampaignResult +``` + +### `defaultProductionGate` + +`function` + +```ts +(options: DefaultProductionGateOptions) => Gate +``` + +### `DispatchContext` + +`interface` — Context handed to every dispatch invocation. + +```ts +interface DispatchContext +``` + +### `EnsembleAggregate` + +`interface` — The aggregated ensemble result. + +```ts +interface EnsembleAggregate +``` + +### `EnsembleJudgeConfig` + +`interface` — Config for {@link buildEnsembleJudge}. + +```ts +interface EnsembleJudgeConfig +``` + +### `evolutionaryProposer` + +`function` + +```ts +(opts: EvolutionaryProposerOptions) => SurfaceProposer +``` + +### `Gate` + +`interface` — Composable promotion gate. + +```ts +interface Gate +``` + +### `gepaProposer` + +`function` + +```ts +(opts: GepaProposerOptions) => SurfaceProposer +``` + +### `JudgeConfig` + +`interface` — Pluggable dimensional scorer. + +```ts +interface JudgeConfig +``` + +### `JudgeDimension` + +`interface` + +```ts +interface JudgeDimension +``` + +### `JudgeScore` + +`interface` — The canonical judge verdict shape — one declaration, shared by campaign judges and the multishot judge runner (which re-exports this type). + +```ts +interface JudgeScore +``` + +### `JudgeVerdict` + +`interface` — One judge's verdict. + +```ts +interface JudgeVerdict +``` + +### `LabeledScenarioStore` + +`interface` + +```ts +interface LabeledScenarioStore +``` + +### `MutableSurface` + +`type` — The mutable surface a proposer changes. + +```ts +type MutableSurface +``` + +### `Mutator` + +`interface` — Stateless surface mutation — given findings + current surface, return N candidate surfaces. + +```ts +interface Mutator +``` + +### `paretoSignificanceGate` + +`function` — Wrap the bus + a policy as a `Gate`. + +```ts +(options: ParetoSignificanceGateOptions) => Gate(opts: RunCampaignOptions) => Promise(opts: SelfImproveOptions) => Promise(items: readonly TrustItem[], thresholds?: TrustThresholds) => TrustVerdict +``` + + +## `./harness` + +Source: `src/harness/index.ts` + +### `assertHarnessModelCompatible` + +`function` — Fail-loud server guard: throw when a harness is asked to run a model it can't. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `coerceHarness` + +`function` — Coerce an arbitrary value to a known harness, falling back (default `opencode`). + +```ts +(value: unknown, fallback?: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids"… +``` + +### `DEFAULT_HARNESS` + +`const` — Define the default harness to use for code execution and testing environments + +```ts +"opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes" | "forge"… +``` + +### `Harness` + +`type` — Resolve a valid harness identifier from the predefined KNOWN_HARNESSES array + +```ts +type Harness +``` + +### `isHarness` + +`function` — Determine if a value is a recognized harness string identifier + +```ts +(value: unknown) => value is "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids"… +``` + +### `isModelCompatibleWithHarness` + +`function` — Provider-less ids (sentinels like "default", or a session's own config) are compatible everywhere — every harness honors its own configuration. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `KNOWN_HARNESSES` + +`const` — The known coding-agent backends. + +```ts +readonly ["opencode", "claude-code", "nanoclaw", "kimi-code", "codex", "amp", "factory-droids", "pi", "hermes", "forge"… +``` + +### `modelProvider` + +`function` — Provider prefix of a canonical model id (`anthropic/claude-…` → `anthropic`), or null. + +```ts +(modelId: string) => string | null +``` + +### `ResolvedSessionHarness` + +`interface` — Represent resolved session state including harness, lock status, and swap attempt flag + +```ts +interface ResolvedSessionHarness +``` + +### `resolveSessionHarness` + +`function` — Resolve the harness for a turn, enforcing the session lock. + +```ts +(input?: ResolveSessionHarnessInput) => ResolvedSessionHarness +``` + +### `ResolveSessionHarnessInput` + +`interface` — Resolve input options to determine the appropriate session harness to use + +```ts +interface ResolveSessionHarnessInput +``` + +### `snapHarnessToModel` + +`function` — Keep the harness when it can run `modelId`; else the model's native harness (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `snapModelToHarness` + +`function` — Keep `modelId` when the harness can run it; else the harness's best compatible catalog id (preferred patterns in order, highest version). + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + + +## `./intakes` + +Source: `src/intakes/index.ts` + +### `AnswerRejectionReason` + +`type` — The reason an answer failed validation. + +```ts +type AnswerRejectionReason +``` + +### `AnswerValidationResult` + +`interface` — Describe validation outcome of an answer including success status and optional rejection reason + +```ts +interface AnswerValidationResult +``` + +### `buildContextGatherPrompt` + +`function` — Render the prompt section that mirrors a conversational-gather flow: - "### Context you already have" — the known facts, as `label: value`. + +```ts +(spec: ContextFactSpec, sufficiency: ContextSufficiency) => string +``` + +### `computeContextSufficiency` + +`function` — Combine a fact spec with resolved signals into the readiness verdict. + +```ts +(spec: ContextFactSpec, signals: ResolvedContextSignals) => ContextSufficiency +``` + +### `ContextFact` + +`interface` — One fact the product treats as known context once it has a value. + +```ts +interface ContextFact +``` + +### `ContextFactSpec` + +`interface` — The product's declaration of what context matters: the facts that make up scope, plus optional tool hints appended verbatim to the gather prompt (e.g. + +```ts +interface ContextFactSpec +``` + +### `ContextSufficiency` + +`interface` — The deterministic verdict over the resolved signals. + +```ts +interface ContextSufficiency +``` + +### `emptyPayload` + +`function` — An empty payload for a fresh intake against `graph`. + +```ts +(graph: IntakeGraph) => IntakePayload +``` + +### `getQuestion` + +`function` — Look up a question by id, or null if the graph has none. + +```ts +(graph: IntakeGraph, questionId: string) => IntakeQuestion | null +``` + +### `hasAnswer` + +`function` — True when an answer value is present (not null/undefined/empty). + +```ts +(value: IntakeAnswerValue | undefined) => boolean +``` + +### `IntakeAnswers` + +`type` — A flat map of answers keyed by question id. + +```ts +type IntakeAnswers +``` + +### `IntakeAnswerType` + +`type` — The kinds of answer a question accepts. + +```ts +type IntakeAnswerType +``` + +### `IntakeAnswerValue` + +`type` — Any value an answer can hold; the type is validated per-question. + +```ts +type IntakeAnswerValue +``` + +### `IntakeGraph` + +`interface` — The intake definition: an ordered, addressable set of questions. + +```ts +interface IntakeGraph +``` + +### `IntakeOption` + +`interface` — A selectable option for single/multi-select questions. + +```ts +interface IntakeOption +``` + +### `IntakePayload` + +`interface` — The persisted JSON for one intake (the `payload` column). + +```ts +interface IntakePayload +``` + +### `intakeProgress` + +`function` — Progress as answered-vs-total over the REACHABLE required questions under the current answers — what a progress bar renders. + +```ts +(graph: IntakeGraph, answers: IntakeAnswers) => { answered: number; total: number; } +``` + +### `IntakeQuestion` + +`interface` — One question in the graph. + +```ts +interface IntakeQuestion +``` + +### `isComplete` + +`function` — True when every REQUIRED question reachable under the current answers has a valid answer. + +```ts +(graph: IntakeGraph, answers: IntakeAnswers) => boolean +``` + +### `KnownFact` + +`interface` — A resolved fact that has a value — surfaced to the prompt as known context. + +```ts +interface KnownFact +``` + +### `markComplete` + +`function` — Stamp the payload complete at `at` (default now). + +```ts +(payload: IntakePayload, at?: Date) => IntakePayload +``` + +### `MissingFact` + +`interface` — A required fact with no value — surfaced to the prompt as a gap to close. + +```ts +interface MissingFact +``` + +### `nextQuestion` + +`function` — The single question to ask next given the answers so far, or null when the interview is done. + +```ts +(graph: IntakeGraph, answers: IntakeAnswers) => IntakeQuestion | null +``` + +### `payloadComplete` + +`function` — True when the payload's answers complete the graph AND the payload was collected against THIS graph. + +```ts +(graph: IntakeGraph, payload: IntakePayload) => boolean +``` + +### `payloadIsStale` + +`function` — True when the payload was collected against a DIFFERENT graph revision. + +```ts +(graph: IntakeGraph, payload: IntakePayload) => boolean +``` + +### `reachableQuestions` + +`function` — The questions reachable under the current answers, in traversal order. + +```ts +(graph: IntakeGraph, answers: IntakeAnswers) => IntakeQuestion[] +``` + +### `ResolvedContextSignals` + +`interface` — What a product's adapter resolves from its own substrate, ready to combine. + +```ts +interface ResolvedContextSignals +``` + +### `validateAnswer` + +`function` — Validate one answer against its question. + +```ts +(question: IntakeQuestion, value: IntakeAnswerValue | undefined) => AnswerValidationResult +``` + +### `withAnswer` + +`function` — A copy of `payload` with one answer set (does not mutate the input). + +```ts +(payload: IntakePayload, questionId: string, value: IntakeAnswerValue) => IntakePayload +``` + + +## `./intakes-react` + +Source: `src/intakes-react/index.ts` · depends on `intakes` + +### `IntakeInterview` + +`function` + +```ts +({ view: initialView, onAnswer, onComplete, onDone, onNotice, }: IntakeInterviewProps) => Element +``` + +### `IntakeInterviewProps` + +`interface` — Define properties and callbacks for managing the intake interview flow and user interactions + +```ts +interface IntakeInterviewProps +``` + +### `IntakeView` + +`interface` — The state the interview renders — the shape `./intakes/api` returns. + +```ts +interface IntakeView +``` + + +## `./intakes-react/lazy` + +Source: `src/intakes-react/lazy.tsx` · depends on `intakes` + +### `IntakeInterviewLazy` + +`function` — Load IntakeInterview component lazily to optimize initial application rendering + +```ts +LazyExoticComponent<({ view: initialView, onAnswer, onComplete, onDone, onNotice, }: IntakeInterviewProps) => Element> +``` + +### `IntakeInterviewProps` + +`interface` — Define properties and callbacks for managing the intake interview flow and user interactions + +```ts +interface IntakeInterviewProps +``` + + +## `./intakes/api` + +Source: `src/intakes/api.ts` + +### `createIntakeApi` + +`function` — Build the intake API bound to one store + graph. + +```ts +(opts: IntakeApiOptions) => { getCurrentIntake: () => Promise; saveAnswer: (input: { questionId?: string | un… +``` + +### `CurrentIntakeView` + +`interface` — What the client renders: the saved state, the next prompt, and progress. + +```ts +interface CurrentIntakeView +``` + +### `IntakeApiOptions` + +`interface` — Define configuration options for initializing the intake API with store and graph components + +```ts +interface IntakeApiOptions +``` + + +## `./intakes/drizzle` + +Source: `src/intakes/drizzle.ts` + +### `AnyIntakeTables` + +`type` — The union table shape, for code that handles either scope generically. + +```ts +type AnyIntakeTables +``` + +### `createIntakeTables` + +`function` — Build the intake tables wired to the product's tables. + +```ts +(opts: O) => IntakeTables +``` + +### `CreateIntakeTablesOptions` + +`interface` — Define options for creating intake tables including user and optional workspace references + +```ts +interface CreateIntakeTablesOptions +``` + +### `createProjectIntakeStore` + +`function` — Build the per-project store, scoped to one workspaceId. + +```ts +(opts: CreateProjectIntakeStoreOptions) => IntakeStore +``` + +### `CreateProjectIntakeStoreOptions` + +`interface` — Define options required to create a project intake store including database, table, graph, and workspace ID + +```ts +interface CreateProjectIntakeStoreOptions +``` + +### `createUserIntakeStore` + +`function` — Build the per-user onboarding store, scoped to one userId. + +```ts +(opts: CreateUserIntakeStoreOptions) => IntakeStore +``` + +### `CreateUserIntakeStoreOptions` + +`interface` — Define options required to create a user intake store for onboarding data collection + +```ts +interface CreateUserIntakeStoreOptions +``` + +### `IntakeDatabase` + +`type` — Any SQLite drizzle database — `any` erases driver-specific generics so better-sqlite3, D1, and libsql handles all fit. + +```ts +type IntakeDatabase +``` + +### `IntakeError` + +`class` — Thrown by store mutations on a refused write — callers map it to a 4xx. + +```ts +class IntakeError +``` + +### `IntakeErrorCode` + +`type` — Define error codes representing specific intake validation failures + +```ts +type IntakeErrorCode +``` + +### `IntakeParentTable` + +`type` — A product table referenced by FK — only the `id` column is touched. + +```ts +type IntakeParentTable +``` + +### `IntakeState` + +`interface` — A loaded intake: the payload plus whether it is complete against the graph. + +```ts +interface IntakeState +``` + +### `IntakeStore` + +`interface` — The three-method store surface, identical for both scopes. + +```ts +interface IntakeStore +``` + +### `IntakeTables` + +`type` — The tables returned for a given options shape: `projectIntake` is present in the type exactly when `workspaceTable` was provided. + +```ts +type IntakeTables +``` + +### `ProjectIntakeRow` + +`type` — Resolve the selected data structure for a project intake table row + +```ts +type ProjectIntakeRow +``` + +### `ProjectIntakeTable` + +`type` — Resolve the structure and data of the project intake table from the factory function + +```ts +type ProjectIntakeTable +``` + +### `UserIntakeRow` + +`type` — Infer and represent a selected row from the UserIntakeTable data structure + +```ts +type UserIntakeRow +``` + +### `UserIntakeTable` + +`type` — Resolve the structure and data of a user intake table based on the createUserIntakeTable function + +```ts +type UserIntakeTable +``` + + +## `./integrations` + +Source: `src/integrations/index.ts` + +### `HubExecClient` + +`class` — Typed client over the platform hub `/v1/hub/exec`. + +```ts +class HubExecClient +``` + +### `HubExecClientOptions` + +`interface` — Define configuration options for initializing a Hub execution client + +```ts +interface HubExecClientOptions +``` + +### `HubExecErrorCode` + +`type` — `{ success: false }` codes the hub returns on `/exec`. + +```ts +type HubExecErrorCode +``` + +### `HubExecResult` + +`type` — Outcome of a hub `/exec` call. + +```ts +type HubExecResult +``` + +### `HubInvokeDeps` + +`interface` — Define dependencies for invoking hub operations including API key resolution and optional configuration + +```ts +interface HubInvokeDeps +``` + +### `HubInvokeInput` + +`interface` — Define input parameters for invoking a hub tool with user ID, tool name, and optional arguments + +```ts +interface HubInvokeInput +``` + +### `HubInvokeOutcome` + +`interface` — Describe the outcome of a hub invocation including status and response body + +```ts +interface HubInvokeOutcome +``` + +### `invokeIntegrationHub` + +`function` — Resolve + execute one integration tool call through the hub: resolve the per-user bearer, map the MCP tool name to the hub action path, forward to `/v1/hub/exec`, and shape the route response (200 ok… + +```ts +(input: HubInvokeInput, deps: HubInvokeDeps) => Promise +``` + +### `ParsedIntegrationAction` + +`interface` — The provider/connector/action a hub action path addresses, plus the dotted `path` the hub `/exec` endpoint expects. + +```ts +interface ParsedIntegrationAction +``` + +### `resolveIntegrationAction` + +`function` — Resolve an MCP tool name (the opaque `int_…` catalog name the agent calls) into the dotted hub action path. + +```ts +(toolName: string) => ParsedIntegrationAction | undefined +``` + + +## `./interactions` + +Source: `src/interactions/index.ts` + +### `BeforeInteractionAnswerArgs` + +`interface` — Describe the arguments provided before processing an interaction answer including request, body, and connection details + +```ts +interface BeforeInteractionAnswerArgs +``` + +### `cancelStatusFor` + +`function` — Maps an `interaction.cancel` reason to the card's terminal status. + +```ts +(reason: string | undefined) => ChatInteractionStatus +``` + +### `canTransitionInteractionStatus` + +`function` — Statuses only move forward (pending → terminal); a replayed/stale `pending` must never resurrect a resolved card. + +```ts +(from: ChatInteractionStatus, to: ChatInteractionStatus) => boolean +``` + +### `ChatInteraction` + +`interface` — The client/persisted view of one ask. + +```ts +interface ChatInteraction +``` + +### `ChatInteractionField` + +`type` — Resolve a chat interaction field excluding select types or including chat select fields + +```ts +type ChatInteractionField +``` + +### `ChatInteractionStatus` + +`type` — Define possible statuses representing the state of a chat interaction + +```ts +type ChatInteractionStatus +``` + +### `ChatSelectField` + +`type` — Extract select-type interaction fields and optionally allow custom values + +```ts +type ChatSelectField +``` + +### `composerAnswerData` + +`function` — Shapes composer text into the respond payload for the routed field (select answers are string arrays on the wire; text answers are strings). + +```ts +(field: ChatInteractionField, text: string) => Record +``` + +### `composerAnswerDeliveries` + +`function` — One delivery per pending ask: the first free-text-capable field, else the first field. + +```ts +(pending: ChatInteraction[]) => ComposerAnswerDelivery[] +``` + +### `ComposerAnswerDelivery` + +`interface` — Define the structure for delivering answers linked to a specific chat interaction and field + +```ts +interface ComposerAnswerDelivery +``` + +### `createInteractionAnswerRoute` + +`function` — Create an interaction answer route that handles listing and resolving interaction requests + +```ts +(options: InteractionAnswerRouteOptions) => InteractionAnswerRoute +``` + +### `dedupeQuestionInteractionsByContent` + +`function` — Remove duplicate question interactions based on their content signature to ensure uniqueness + +```ts +(interactions: ChatInteraction[]) => ChatInteraction[] +``` + +### `DurableInteractionRouteArgs` + +`interface` — Define arguments for durable interaction routes including a stable caller-created attempt key + +```ts +interface DurableInteractionRouteArgs +``` + +### `DurableInteractionRoutePersistence` + +`interface` — Crash-recoverable persistence lifecycle for the answer route. + +```ts +interface DurableInteractionRoutePersistence +``` + +### `fieldAcceptsFreeText` + +`function` — Determine if a chat interaction field allows free text input + +```ts +(field: ChatInteractionField) => boolean +``` + +### `INTERACTION_CANCEL_EVENT` + +`const` — Sidecar → client: the ask was withdrawn; data = `{ id, reason? + +```ts +"interaction.cancel" +``` + +### `INTERACTION_EVENT` + +`const` — Sidecar → client: the agent raised an ask; data = `{ request }`. + +```ts +"interaction" +``` + +### `INTERACTION_RESOLVED_EVENT` + +`const` — An ask was answered; data = `{ id, status }`. + +```ts +"interaction.resolved" +``` + +### `InteractionAnswerBodyValidation` + +`type` — Validate interaction answer body and return success with data or failure with error message + +```ts +type InteractionAnswerBodyValidation +``` + +### `InteractionAnswerRoute` + +`interface` — Define routes to list outstanding interactions and resolve answers for live turns + +```ts +interface InteractionAnswerRoute +``` + +### `InteractionAnswerRouteOptions` + +`interface` — Define options to authenticate, authorize, and manage persistence for interaction answer routes + +```ts +interface InteractionAnswerRouteOptions +``` + +### `InteractionAnswers` + +`type` — Map interaction identifiers to their corresponding answer values + +```ts +type InteractionAnswers +``` + +### `InteractionAnswerValue` + +`type` — Accepted answer values. + +```ts +type InteractionAnswerValue +``` + +### `InteractionCancelData` + +`interface` — Describe data required to cancel an interaction including its identifier and optional reason + +```ts +interface InteractionCancelData +``` + +### `InteractionClientOutcome` + +`type` — Define possible outcomes for an interaction client as accepted or declined + +```ts +type InteractionClientOutcome +``` + +### `InteractionConnectionResolution` + +`type` — The product seam's verdict for one request. + +```ts +type InteractionConnectionResolution +``` + +### `InteractionData` + +`type` + +```ts +type InteractionData +``` + +### `interactionFromWireRequest` + +`function` — Reads a wire request into the client's pending `ChatInteraction`. + +```ts +(request: InteractionRequestWire) => ChatInteraction +``` + +### `InteractionOutcome` + +`type` + +```ts +type InteractionOutcome +``` + +### `interactionPartKey` + +`function` — Generate a unique key string for an interaction using the given identifier + +```ts +(id: string) => string +``` + +### `InteractionPersistedPart` + +`type` — Persisted-part shapes the codecs below produce — the SAME rows `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the source so a product pushing them into a `ChatMessagePart[]` t… + +```ts +type InteractionPersistedPart +``` + +### `InteractionRequest` + +`type` + +```ts +type InteractionRequest +``` + +### `InteractionRequestWire` + +`type` — `InteractionRequest` whose select fields may carry `allowCustom`. + +```ts +type InteractionRequestWire +``` + +### `InteractionRouteLogger` + +`type` — Provide logging methods for warnings and errors in interaction routes + +```ts +type InteractionRouteLogger +``` + +### `interactionToPersistedPart` + +`function` — Builds the persisted/streamed `interaction` part from a wire request. + +```ts +(request: InteractionRequestWire, status: ChatInteractionStatus, cancelReason?: string | undefined, answers?: Interacti… +``` + +### `isRenderableInteractionKind` + +`function` — Resolve if the given interaction kind is renderable within the application context + +```ts +(kind: string) => boolean +``` + +### `isSafeInteractionFieldKey` + +`function` — Answer/field keys the sidecar will accept: identifier-safe and never a prototype-pollution vector. + +```ts +(key: string) => boolean +``` + +### `isTerminalInteractionStatus` + +`function` — Resolve if the interaction status is a terminal state excluding pending + +```ts +(status: ChatInteractionStatus) => boolean +``` + +### `listSessionInteractions` + +`function` — Outstanding (unanswered) interactions for the session — the sidecar's registry is authoritative, so this is the reconnect/reload source of truth. + +```ts +(connection: SidecarInteractionsConnection) => Promise> +``` + +### `mapInteractionRespondFailure` + +`function` — Sidecar error → the client-actionable contract. + +```ts +(error: SidecarInteractionsError, logger?: InteractionRouteLogger) => Response +``` + +### `NoticeKind` + +`type` — Define specific string literals representing different kinds of notices + +```ts +type NoticeKind +``` + +### `noticePart` + +`function` — Builds the persisted/streamed `notice` part — a one-line transcript notice explaining an out-of-band event (warning, auto-declined interaction). + +```ts +(noticeKind: NoticeKind, id: string, text: string) => NoticePersistedPart +``` + +### `noticePartKey` + +`function` — Generate a unique key string for a notice using the given identifier + +```ts +(id: string) => string +``` + +### `NoticePersistedPart` + +`type` — Define a persisted notice part with type, id, kind, and text properties + +```ts +type NoticePersistedPart +``` + +### `parseInteractionAnswers` + +`function` — Strictly validates and copies persisted answer selections. + +```ts +(value: unknown) => ParseInteractionAnswersResult +``` + +### `ParseInteractionAnswersResult` + +`type` — Resolve the result of parsing interaction answers with success status and corresponding data or error message + +```ts +type ParseInteractionAnswersResult +``` + +### `parseInteractionCancel` + +`function` — Parse interaction cancel data and return success status with parsed value or error message + +```ts +(data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;… +``` + +### `parseInteractionRequest` + +`function` — Parses an `interaction` event's data (`{ request }`). + +```ts +(data: Record | undefined) => ParseInteractionResult +``` + +### `ParseInteractionResult` + +`type` — Resolve interaction parsing outcome as success with value or failure with error message + +```ts +type ParseInteractionResult +``` + +### `persistedPartToInteraction` + +`function` — Reads a persisted/streamed `interaction` part back into a `ChatInteraction`. + +```ts +(part: Record) => ChatInteraction | null +``` + +### `questionInteractionContentSignature` + +`function` — Content identity for duplicate safety nets. + +```ts +(interaction: ChatInteraction) => string | null +``` + +### `ResolveInteractionConnectionArgs` + +`interface` — Define arguments required to resolve interaction connections based on request and intent + +```ts +interface ResolveInteractionConnectionArgs +``` + +### `respondToSessionInteraction` + +`function` — Resolves one interaction. + +```ts +(connection: SidecarInteractionsConnection, response: { id: string; outcome: "declined" | "cancelled" | "accepted"; dat… +``` + +### `SidecarInteractionsConnection` + +`interface` — Where and how to reach one session's interaction registry. + +```ts +interface SidecarInteractionsConnection +``` + +### `SidecarInteractionsError` + +`interface` — Describe error details including code, message, and upstream HTTP status for sidecar interactions + +```ts +interface SidecarInteractionsError +``` + +### `SidecarInteractionsResult` + +`type` — Represent the outcome of sidecar interactions with success or error details + +```ts +type SidecarInteractionsResult +``` + +### `stampInteractionAnswers` + +`function` — Stamps accepted values onto matching persisted interaction parts without mutating the caller's transcript or answer maps. + +```ts +(parts: Record[], answersByInteractionId: Readonly>) => Record) => InteractionAnswerBodyValidation +``` + + +## `./knowledge` + +Source: `src/knowledge/index.ts` + +### `buildKnowledgeRequirements` + +`function` — Map specs -> the runtime's `KnowledgeRequirement[]`, folding in per-spec confidence from `signals` (default 0). + +```ts +(specs: KnowledgeRequirementSpec[], signals?: Record) => KnowledgeRequirement[] +``` + +### `deriveSignals` + +`function` — Score every spec from workspace state. + +```ts +(specs: KnowledgeRequirementSpec[], ctx: KnowledgeStateAccessor) => Promise> +``` + +### `KnowledgeRequirementSpec` + +`interface` — Define the criteria and conditions required to satisfy a specific knowledge requirement + +```ts +interface KnowledgeRequirementSpec +``` + +### `KnowledgeSignal` + +`interface` — Define a signal representing knowledge with confidence level and optional supporting evidence + +```ts +interface KnowledgeSignal +``` + +### `KnowledgeStateAccessor` + +`interface` — The single seam a backend implements. + +```ts +interface KnowledgeStateAccessor +``` + +### `SatisfiedByRule` + +`type` — A declarative rule for satisfying a requirement from workspace state. + +```ts +type SatisfiedByRule +``` + + +## `./knowledge-loop` + +Source: `src/knowledge-loop/index.ts` · depends on `config` + +### `createKnowledgeLoop` + +`function` — Build a runnable knowledge-acquisition loop from the product's `AgentKnowledgeConfig` and a small set of seams. + +```ts +(knowledge: AgentKnowledgeConfig, deps: CreateKnowledgeLoopDeps) => KnowledgeLoop +``` + +### `CreateKnowledgeLoopDeps` + +`interface` — Define dependencies required to create and run a knowledge processing loop + +```ts +interface CreateKnowledgeLoopDeps +``` + +### `createReviewerDecider` + +`function` — Wrap a candidate-producing policy in the default reviewer gate. + +```ts +(propose: (input: KnowledgeDeciderInput) => KnowledgeCandidate | Promise) => KnowledgeDecider +``` + +### `KnowledgeCandidate` + +`interface` — A research candidate the decider evaluates before the loop applies it. + +```ts +interface KnowledgeCandidate +``` + +### `KnowledgeDecider` + +`interface` — The pluggable acquisition policy. + +```ts +interface KnowledgeDecider +``` + +### `KnowledgeDeciderInput` + +`interface` — Define the input parameters required to decide knowledge proposals within an agent-knowledge loop + +```ts +interface KnowledgeDeciderInput +``` + +### `KnowledgeDecision` + +`interface` — Define a decision containing a candidate and the gate's verdict on that candidate + +```ts +interface KnowledgeDecision +``` + +### `KnowledgeGateVerdict` + +`interface` — The verdict a gate returns for one candidate. + +```ts +interface KnowledgeGateVerdict +``` + +### `KnowledgeLoop` + +`interface` — The handle `createKnowledgeLoop` returns. + +```ts +interface KnowledgeLoop +``` + +### `KnowledgeLoopDriver` + +`interface` — The agent-runtime turn driver seam. + +```ts +interface KnowledgeLoopDriver +``` + +### `reviewCandidate` + +`function` — The default gate — agent-knowledge's propose-don't-apply reviewer posture as a confidence threshold. + +```ts +(candidate: KnowledgeCandidate, minConfidence: number) => KnowledgeGateVerdict +``` + + +## `./missions` + +Source: `src/missions/index.ts` + +### `applyMissionEvent` + +`function` — Fold one event into one mission's state. + +```ts +(prev: MissionState | undefined, event: MissionStreamEvent) => MissionState +``` + +### `asMissionStreamEvent` + +`function` — Narrow an arbitrary channel payload to a MissionStreamEvent. + +```ts +(value: unknown) => MissionStreamEvent | null +``` + +### `budgetGateProposalId` + +`function` — Deterministic proposal id for a budget-overrun override. + +```ts +(missionId: string, stepId: string) => string +``` + +### `buildAgentMissionPlan` + +`function` — Materialize parsed steps into the engine's MissionStep[] shape. + +```ts +(steps: ParsedMissionStep[]) => MissionStep[] +``` + +### `CompleteMissionInput` + +`interface` — Define input parameters to complete a mission with status and optional summary + +```ts +interface CompleteMissionInput +``` + +### `createInMemoryMissionStore` + +`function` — In-memory {@link MissionStorePort} — the portable backend for tests and sandbox/eval shells. + +```ts +() => InMemoryMissionStore +``` + +### `createMissionEngine` + +`function` — Create a mission engine configured with options to manage mission execution and error handling + +```ts +(options: MissionEngineOptions) => MissionEngine +``` + +### `CreateMissionInput` + +`interface` — Define input parameters for creating a mission including optional deterministic id and unique plan steps + +```ts +interface CreateMissionInput +``` + +### `createMissionService` + +`function` — Create a mission service that manages mission records and audit events with customizable options + +```ts +(options: MissionServiceOptions) => MissionService +``` + +### `DEFAULT_MISSION_STEP_KINDS` + +`const` — Default step-kind vocabulary. + +```ts +readonly string[] +``` + +### `InMemoryMissionStore` + +`interface` — Define an in-memory mission store that tracks events and allows direct record writes + +```ts +interface InMemoryMissionStore +``` + +### `isMissionStopRequested` + +`function` — The cooperative kill switch: a stop request rides metadata so it survives any status and is honored by the engine before the next side effect. + +```ts +(mission: MissionRecord) => boolean +``` + +### `isMissionTerminal` + +`function` — Statuses a mission can never leave — the run is done. + +```ts +(status: MissionStatus) => boolean +``` + +### `mergeMissionState` + +`function` — Merge a loader SEED into the live state for one mission, advancing through the SAME monotonic clamps the event reducer uses. + +```ts +(live: MissionState | undefined, seed: MissionState) => MissionState +``` + +### `MISSION_CONTROL_CHANNEL_ID` + +`const` — Workspace-wide channel id missions broadcast on (alongside any per-thread channel the product keys). + +```ts +"missions" +``` + +### `MissionApprovalsPort` + +`interface` — Approval persistence seam — the product implements this over its own proposal table and resolution flow. + +```ts +interface MissionApprovalsPort +``` + +### `MissionAuditEvent` + +`interface` — One audit-trail row. + +```ts +interface MissionAuditEvent +``` + +### `MissionConcurrencyError` + +`class` — Thrown to make the owner's durable-step wrapper retry. + +```ts +class MissionConcurrencyError +``` + +### `MissionCostLedger` + +`interface` — Define the structure for tracking mission token usage, cost, duration, and LLM call counts + +```ts +interface MissionCostLedger +``` + +### `MissionEngine` + +`interface` — Resolve mission plan steps with concurrency control and durable state management + +```ts +interface MissionEngine +``` + +### `MissionEngineOptions` + +`interface` — Define configuration options for initializing and controlling the mission engine behavior + +```ts +interface MissionEngineOptions +``` + +### `MissionEventSink` + +`interface` — Handle mission stream events by processing emitted MissionStreamEvent objects + +```ts +interface MissionEventSink +``` + +### `MissionGateKind` + +`type` — Define mission gate categories as step, budget, or volume + +```ts +type MissionGateKind +``` + +### `MissionGateOptions` + +`interface` — Define configuration options for mission gating including approvals, step classification, and action limits + +```ts +interface MissionGateOptions +``` + +### `MissionGateProposal` + +`interface` — A gate proposal the engine asks the product to persist. + +```ts +interface MissionGateProposal +``` + +### `MissionOutcome` + +`type` — Discriminated outcome for guarded operations. + +```ts +type MissionOutcome +``` + +### `MissionPlanRunOptions` + +`interface` — Define options to control mission plan execution with optional pre-step veto logic + +```ts +interface MissionPlanRunOptions +``` + +### `MissionProposalResolution` + +`type` — Resolution states a gate proposal can be in. + +```ts +type MissionProposalResolution +``` + +### `MissionRecord` + +`interface` — The durable mission row, shape-normalized. + +```ts +interface MissionRecord +``` + +### `MissionService` + +`interface` — Define methods to create, retrieve, and update missions with controlled engine binding and metadata merging + +```ts +interface MissionService +``` + +### `MissionServiceOptions` + +`interface` — Define options for configuring mission service behavior including storage, time, and ID generation + +```ts +interface MissionServiceOptions +``` + +### `MissionState` + +`interface` — Live per-mission view the reducer folds events into. + +```ts +interface MissionState +``` + +### `MissionStatus` + +`type` — Durable mission state — the guarded status machine for a multi-step agent run. + +```ts +type MissionStatus +``` + +### `MissionStep` + +`interface` — Define the structure and state details of a mission step within a workflow system + +```ts +interface MissionStep +``` + +### `MissionStepState` + +`interface` — Live per-step view the reducer maintains. + +```ts +interface MissionStepState +``` + +### `MissionStepStatus` + +`type` — Define possible statuses for a mission step during its execution lifecycle + +```ts +type MissionStepStatus +``` + +### `MissionStorePort` + +`interface` — Persistence seam — the product implements this over its own tables. + +```ts +interface MissionStorePort +``` + +### `MissionStreamEvent` + +`type` — Discriminated union of every live mission event. + +```ts +type MissionStreamEvent +``` + +### `MissionStreamStatus` + +`type` — Define possible statuses representing the current state of a mission stream + +```ts +type MissionStreamStatus +``` + +### `MissionStreamStep` + +`interface` — One plan step as it appears on the wire — only what a live UI needs (`sublabel` updates travel separately via `step.updated` so the snapshot stays small). + +```ts +interface MissionStreamStep +``` + +### `MissionStreamStepStatus` + +`type` — Define possible status values for a mission stream step + +```ts +type MissionStreamStepStatus +``` + +### `MissionUpdateGuard` + +`interface` — Fields a guarded write compares against the values the caller read. + +```ts +interface MissionUpdateGuard +``` + +### `MissionUpdatePatch` + +`interface` — Fields a guarded write sets when the guard holds. + +```ts +interface MissionUpdatePatch +``` + +### `noopEventSink` + +`const` — A sink that drops every event — the engine default when no live channel is wired (and the unit-test default). + +```ts +MissionEventSink +``` + +### `ParsedMission` + +`interface` — Describe a mission with a title and an ordered list of parsed steps + +```ts +interface ParsedMission +``` + +### `ParsedMissionStep` + +`interface` — Define the structure representing a parsed mission step with id, kind, and intent fields + +```ts +interface ParsedMissionStep +``` + +### `parseMissionBlocks` + +`function` — Parse every well-formed `:::mission` block. + +```ts +(fullContent: string, options?: ParseMissionBlocksOptions) => ParsedMission[] +``` + +### `ParseMissionBlocksOptions` + +`interface` — Define options to specify allowed lowercase step kinds for parsing mission blocks + +```ts +interface ParseMissionBlocksOptions +``` + +### `parseSessionStreamEnvelope` + +`function` — Reconstruct the flat MissionStreamEvent from a broadcast envelope of shape `{ type, data: { ...missionFields } }` (transports may also stamp routing fields like workspaceId/threadId into `data`). + +```ts +(raw: unknown) => MissionStreamEvent | null +``` + +### `PlanOutcome` + +`type` — Outcome of running the whole plan from the cursor to the end. + +```ts +type PlanOutcome +``` + +### `reduceMissionEvents` + +`function` — Fold a whole event sequence into a Map. + +```ts +(events: MissionStreamEvent[], seed?: Map | undefined) => Map +``` + +### `RetryableStepError` + +`class` — Thrown by a {@link SandboxDispatch} for a TRANSIENT failure (platform blip, exec-time network fault) that should be re-attempted. + +```ts +class RetryableStepError +``` + +### `SandboxDispatch` + +`type` — A side-effecting unit of per-step work. + +```ts +type SandboxDispatch +``` + +### `SandboxDispatchDoneResult` + +`interface` — Define the result of a completed sandbox dispatch including artifact reference and optional cost details + +```ts +interface SandboxDispatchDoneResult +``` + +### `SandboxDispatchInProgressResult` + +`interface` — The dispatched step's detached session is still executing on the platform. + +```ts +interface SandboxDispatchInProgressResult +``` + +### `SandboxDispatchInput` + +`interface` — Define input parameters for dispatching a mission step in the sandbox environment + +```ts +interface SandboxDispatchInput +``` + +### `SandboxDispatchResult` + +`type` — Resolve the result of a sandbox dispatch as done or in progress + +```ts +type SandboxDispatchResult +``` + +### `SetStepStatusPatch` + +`interface` — Define a patch to update the status and optional metadata of a step in a process + +```ts +interface SetStepStatusPatch +``` + +### `stepAgentActivity` + +`function` — Re-validate an `agentActivity` lane that crossed a JSON boundary. + +```ts +(step: object) => StepAgentActivity[] +``` + +### `StepAgentActivity` + +`interface` — Canonical shape for the per-step agent-activity lane — the delegated runs (delegation MCP registry entries) a mission step spawned, journaled onto the step so a live UI can render "what the agent is… + +```ts +interface StepAgentActivity +``` + +### `StepGateClassification` + +`interface` — Product classification of one step. + +```ts +interface StepGateClassification +``` + +### `stepGateProposalId` + +`function` — Deterministic proposal id for a step-classification gate. + +```ts +(missionId: string, stepId: string) => string +``` + +### `StepOutcome` + +`type` — Outcome of running a single step. + +```ts +type StepOutcome +``` + +### `volumeGateProposalId` + +`function` — Deterministic proposal id for an external-action volume-cap override. + +```ts +(missionId: string, stepId: string) => string +``` + +### `WithAgentActivity` + +`type` — Step state extended with the activity lane a loader/seed route attaches. + +```ts +type WithAgentActivity +``` + + +## `./model-resolution` + +Source: `src/model-resolution/index.ts` + +### `catalogIdsForModel` + +`function` — Resolve unique catalog IDs associated with a given model including its canonical form if applicable + +```ts +(model: ModelInfo) => string[] +``` + +### `ChatModelSource` + +`type` — Define possible origins for the chat model configuration values + +```ts +type ChatModelSource +``` + +### `ChatModelValidationFailure` + +`interface` — Describe a failed chat model validation result with an error message + +```ts +interface ChatModelValidationFailure +``` + +### `ChatModelValidationResult` + +`type` — Resolve the outcome of validating a chat model as either success or failure + +```ts +type ChatModelValidationResult +``` + +### `ChatModelValidationSuccess` + +`interface` — Represent successful chat model validation with a true status and a validated string value + +```ts +interface ChatModelValidationSuccess +``` + +### `cleanModelId` + +`function` — Resolve and return a trimmed string model ID or undefined for invalid or empty input + +```ts +(value: unknown) => string | undefined +``` + +### `isWellFormedModelId` + +`function` — Validate if a model ID string conforms to length and character format requirements + +```ts +(modelId: string) => boolean +``` + +### `LoadModels` + +`type` — The catalog-fetch boundary: maps a router base URL to the raw model list. + +```ts +type LoadModels +``` + +### `ModelInfo` + +`interface` — The router /v1/models entry shape this module reads. + +```ts +interface ModelInfo +``` + +### `resolveChatModel` + +`function` — Resolve the chat-turn model by the one canonical precedence. + +```ts +(input: ResolveChatModelInput) => ResolvedChatModel +``` + +### `ResolveChatModelInput` + +`interface` — Resolve the effective chat model input by prioritizing request, workspace, environment, and default models + +```ts +interface ResolveChatModelInput +``` + +### `ResolvedChatModel` + +`interface` — Resolve a chat model with its identifier and source information + +```ts +interface ResolvedChatModel +``` + +### `validateChatModelId` + +`function` — Fail-closed model-id validation. + +```ts +(modelId: unknown, input: ValidateChatModelIdInput) => Promise +``` + +### `ValidateChatModelIdInput` + +`interface` — Define input parameters for validating chat model IDs with optional allowlist and catalog access details + +```ts +interface ValidateChatModelIdInput +``` + + +## `./object-store` + +Source: `src/object-store/index.ts` · depends on `crypto` + +### `assertSafeKeySegment` + +`function` — Assert a single object-key path SEGMENT (an operator id, customer id, or upload id) is safe to interpolate into a key, and return it. + +```ts +(s: string) => string +``` + +### `createProxiedArtifactRoute` + +`function` — Build a download handler that verifies a signed request and STREAMS the object back with a conservative, non-executable content type. + +```ts +({ store, secret, }: { store: ObjectStore; secret: string; }) => (request: Request) => Promise +``` + +### `createR2ObjectStore` + +`function` — Map the {@link ObjectStore} port onto an R2 bucket 1:1. + +```ts +({ bucket }: { bucket: R2LikeBucket; }) => ObjectStore +``` + +### `ObjectBody` + +`interface` — A retrieved object. + +```ts +interface ObjectBody +``` + +### `objectKey` + +`function` — Build the canonical object key: `operator/customer/upload-filename`. + +```ts +({ operatorId, customerId, uploadId, filename }: ObjectKeyParts) => string +``` + +### `ObjectKeyParts` + +`interface` — Inputs to {@link objectKey}. + +```ts +interface ObjectKeyParts +``` + +### `ObjectStore` + +`interface` — Portable object-store port. + +```ts +interface ObjectStore +``` + +### `PutObjectOptions` + +`interface` — Options for a single {@link ObjectStore.put}. + +```ts +interface PutObjectOptions +``` + +### `R2LikeBucket` + +`interface` — The minimal slice of Cloudflare's `R2Bucket` this module calls. + +```ts +interface R2LikeBucket +``` + +### `R2LikeObjectBody` + +`interface` — Body shape of a retrieved object (structural match of R2's `R2ObjectBody`). + +```ts +interface R2LikeObjectBody +``` + +### `R2LikeObjectHead` + +`interface` — Head/metadata shape of a stored object (structural match of R2's `R2Object`). + +```ts +interface R2LikeObjectHead +``` + +### `signObjectUrl` + +`function` — Mint a signed query string (`?key=…&exp=…&sig=…`) authorizing a download of `key` until `exp`. + +```ts +({ key, exp, secret }: SignObjectUrlArgs) => Promise +``` + +### `SignObjectUrlArgs` + +`interface` — Arguments to {@link signObjectUrl}. + +```ts +interface SignObjectUrlArgs +``` + +### `verifyObjectUrl` + +`function` — Verify a signed download request. + +```ts +(request: Request, { secret }: { secret: string; }) => Promise +``` + +### `VerifyObjectUrlResult` + +`type` — Result of {@link verifyObjectUrl}: the canonical key on success, nothing distinguishing on failure (so a rejection leaks no detail). + +```ts +type VerifyObjectUrlResult +``` + + +## `./plans` + +Source: `src/plans/index.ts` + +### `canTransitionPlanStatus` + +`function` — Plan status is monotonic: only a pending plan can settle. + +```ts +(from: ChatPlanStatus, to: ChatPlanStatus) => boolean +``` + +### `ChatPlan` + +`type` — Browser/persisted projection of the sandbox SDK's durable-plan union. + +```ts +type ChatPlan +``` + +### `ChatPlanPersistedPart` + +`type` — Canonical transcript part for one durable plan. + +```ts +type ChatPlanPersistedPart +``` + +### `ChatPlanStatus` + +`type` — Sandbox plan lifecycle. + +```ts +type ChatPlanStatus +``` + +### `parsePlanSubmittedEvent` + +`function` — Parses both direct sandbox events (`data.plan`) and session envelopes (`properties.plan`). + +```ts +(event: unknown) => ParsePlanSubmittedResult +``` + +### `ParsePlanSubmittedResult` + +`type` — Resolve the result of parsing a plan submission into success with value or failure with error + +```ts +type ParsePlanSubmittedResult +``` + +### `persistedPartToPlan` + +`function` — Resolve a persisted part object into a ChatPlan or return null if the type is not 'plan + +```ts +(part: Record) => ChatPlan | null +``` + +### `PLAN_SUBMITTED_EVENT` + +`const` — Durable-plan application-shell contract. + +```ts +"plan.submitted" +``` + +### `planFollowUpTurnId` + +`function` — Generate a unique follow-up turn ID based on the plan ID and its outcome + +```ts +(planId: string, outcome: "approved" | "rejected") => string +``` + +### `planPartKey` + +`function` — Generate a unique key string for a given plan identifier + +```ts +(planId: string) => string +``` + +### `planRevisionKey` + +`function` — Generate a unique key string for a plan based on its ID and revision number + +```ts +(planId: string, revision: number) => string +``` + +### `planToPersistedPart` + +`function` — Resolve a ChatPlan into its persisted part representation for storage or transmission + +```ts +(plan: ChatPlan) => ChatPlanPersistedPart +``` + + +## `./platform` + +Source: `src/platform/index.ts` · depends on `billing`, `runtime`, `web` + +### `AdminGuardOptions` + +`interface` — Define options to resolve user session and control access based on allowed admin emails + +```ts +interface AdminGuardOptions +``` + +### `assertBillableBalance` + +`function` — Gate a billable turn: passes when enforcement is disabled (dev default), the tier allows overage, or remaining balance is positive. + +```ts +(state: BillableBalanceState, opts?: AssertBillableBalanceOptions) => void +``` + +### `AssertBillableBalanceOptions` + +`interface` — Define options to assert and customize billable balance enforcement behavior + +```ts +interface AssertBillableBalanceOptions +``` + +### `AuthGuard` + +`interface` — Resolve user authentication and session requirements for page and API requests + +```ts +interface AuthGuard +``` + +### `AuthGuardOptions` + +`interface` — Define options for configuring authentication guard behavior and session retrieval + +```ts +interface AuthGuardOptions +``` + +### `BetterAuthSessionCookieMinterOptions` + +`interface` — Define options to customize warning behavior for shadowed cookie names in authentication sessions + +```ts +interface BetterAuthSessionCookieMinterOptions +``` + +### `BetterAuthSessionCookieSource` + +`interface` — Structural slice of a `betterAuth()` instance — only what cookie minting reads. + +```ts +interface BetterAuthSessionCookieSource +``` + +### `BillableBalanceState` + +`interface` — Describe the billable balance state including overage permission and remaining USD balance + +```ts +interface BillableBalanceState +``` + +### `createAdminGuard` + +`function` — Non-admins (and empty allowlists) get 404, keeping the route invisible — better than a "forbidden" footprint that advertises its existence. + +```ts +(opts: AdminGuardOptions) => (request: Request) => Promise +``` + +### `createAuthGuard` + +`function` — Create an authentication guard that enforces session presence and handles unauthorized access responses + +```ts +(opts: AuthGuardOptions) => AuthGuard +``` + +### `createBetterAuthSessionCookieMinter` + +`function` — Canonical `setSessionCookie` wiring for better-auth apps: mint the session Set-Cookie exactly as better-auth's own login flows do — name + attributes from `auth.$context.authCookies.sessionToken` (be… + +```ts +(auth: BetterAuthSessionCookieSource, options?: BetterAuthSessionCookieMinterOptions) => (args: TangleSsoSessionCookieA… +``` + +### `createHubProxyRoutes` + +`function` — Resolve hub proxy routes with authentication and error handling based on the given context + +```ts +(ctx: HubProxyContext) => HubProxyRoutes +``` + +### `createPlatformBillingHttp` + +`function` — Create a PlatformBillingHttp instance configured with given options and default behaviors + +```ts +(opts: PlatformBillingHttpOptions) => PlatformBillingHttp +``` + +### `createSignedSsoState` + +`function` — Mint a `..` state value. + +```ts +(config: SsoStateConfig) => Promise +``` + +### `createTanglePlatformBillingClient` + +`function` — Concrete fetch-backed `PlatformBillingClient` for `createPlatformBalanceManager` (from `/billing`). + +```ts +(http: PlatformBillingHttp, identity: PlatformIdentityStore) => PlatformBillingClient +``` + +### `createTangleSsoHandlers` + +`function` — Create Tangle SSO handlers to manage authentication state, callbacks, and session cookies + +```ts +(opts: TangleSsoHandlerOptions) => TangleSsoHandlers +``` + +### `DEFAULT_SEAT_BILLING_ENABLED_ENV_VAR` + +`const` — Default name of the per-app feature flag gating seat billing. + +```ts +"SEAT_BILLING_ENABLED" +``` + +### `DEFAULT_TANGLE_TIER_POLICY` + +`const` — Define default concurrency and overage policies for each TanglePlanTier level + +```ts +Record +``` + +### `FREE_TIER_SPEND_CAP_USD` + +`const` — Lifetime free-tier cap: $2 (200¢) cumulative inference spend, expressed in dollars. + +```ts +2 +``` + +### `getProductEntitlement` + +`function` — Read a user's entitlement for one product. + +```ts +(http: Pick, userApiKey: string | null | undefined, productId: string, fl… +``` + +### `guardResolution` + +`function` — Adapt a guard that THROWS a Response (the quartet above — the router convention) to the `{ok: true, value} | {ok: false, response}` resolution shape the route factories take (`/chat-routes` `authoriz… + +```ts +(run: () => Promise) => Promise> +``` + +### `GuardResolution` + +`type` — Resolve a value or an HTTP response indicating failure in a guarded operation + +```ts +type GuardResolution +``` + +### `HubClientLike` + +`interface` — Structural subset of the platform hub wire client — extra methods are fine. + +```ts +interface HubClientLike +``` + +### `HubProxyContext` + +`interface` — Define methods to require user ID, get bearer token, and create a hub client bound to the bearer + +```ts +interface HubProxyContext +``` + +### `HubProxyRouteArgs` + +`interface` — Define arguments for configuring a proxy route with request and optional parameters + +```ts +interface HubProxyRouteArgs +``` + +### `HubProxyRoutes` + +`interface` — Define routes for hub proxy handling catalog, connections, healthchecks, and authorization actions + +```ts +interface HubProxyRoutes +``` + +### `isPlatformBillingHttpError` + +`function` — Structural guard (name + numeric status) — robust across module instances. + +```ts +(error: unknown) => error is PlatformBillingHttpError +``` + +### `isPlatformHubErrorLike` + +`function` — Structural detection of the platform hub wire error (name + numeric status). + +```ts +(error: unknown) => error is Error & { status: number; code?: string | undefined; } +``` + +### `isProductEntitled` + +`function` — Entitled = holds an active seat OR is still inside the free tier. + +```ts +(ent: ProductEntitlement) => boolean +``` + +### `isSeatBillingEnabled` + +`function` — Seat billing is OFF unless the flag is explicitly truthy ('true'/'1'/'on'/ 'enabled'). + +```ts +(opts?: SeatBillingFlagOptions) => boolean +``` + +### `isTangleBearerMissingError` + +`function` — Structural guard (name + userId shape) — robust when the error class is constructed in a different module instance than the one checking it. + +```ts +(error: unknown) => error is TangleBearerMissingError +``` + +### `normalizeTanglePlanTier` + +`function` — 'pro' | 'enterprise' pass through; anything else (null, unknown) → 'free'. + +```ts +(plan: string | null | undefined) => TanglePlanTier +``` + +### `parseAdminEmails` + +`function` — Comma/whitespace separated → trimmed, lowercased, empties dropped. + +```ts +(raw: string | null | undefined) => string[] +``` + +### `PlatformBalanceSnapshot` + +`interface` — Describe the platform balance and lifetime spending with an optional update timestamp + +```ts +interface PlatformBalanceSnapshot +``` + +### `PlatformBillingHttp` + +`interface` — Define methods to interact with platform billing endpoints using user or service authentication + +```ts +interface PlatformBillingHttp +``` + +### `PlatformBillingHttpError` + +`class` — Represent platform billing HTTP errors with status code and detailed message + +```ts +class PlatformBillingHttpError +``` + +### `PlatformBillingHttpOptions` + +`interface` — Define HTTP options for platform billing including base URL, service token, product slug, fetch implementation, and timeout + +```ts +interface PlatformBillingHttpOptions +``` + +### `PlatformIdentityStore` + +`interface` — Define a contract for resolving platform identities based on user identifiers + +```ts +interface PlatformIdentityStore +``` + +### `PlatformSubscriptionInfo` + +`interface` — Describe subscription tier and status information for a platform user + +```ts +interface PlatformSubscriptionInfo +``` + +### `PlatformUsageProductRow` + +`interface` — Describe a product's usage and spending metrics on the platform + +```ts +interface PlatformUsageProductRow +``` + +### `ProductEntitlement` + +`interface` — Per-product entitlement snapshot from the platform — the single read that tells a product whether to show its workspace or the seat paywall. + +```ts +interface ProductEntitlement +``` + +### `readTangleTierState` + +`function` — Read subscription + balance and project them onto the tier policy. + +```ts +(http: PlatformBillingHttp, userApiKey: string | null | undefined, policy?: Record) =… +``` + +### `ResolvedTangleHubBearer` + +`interface` — Represent a resolved bearer token with its associated TangleHub bearer source + +```ts +interface ResolvedTangleHubBearer +``` + +### `resolveUserTangleHubBearer` + +`function` — Resolve the Tangle bearer used by the integration hub proxy. + +```ts +(opts: ResolveUserTangleHubBearerOptions) => Promise +``` + +### `resolveUserTangleHubBearerForUser` + +`function` — Resolve the TangleHub bearer token for a specified user based on provided options + +```ts +(opts: ResolveUserTangleHubBearerForUserOptions) => Promise +``` + +### `ResolveUserTangleHubBearerForUserOptions` + +`interface` — Resolve options for retrieving a TangleHub bearer token for a specified user + +```ts +interface ResolveUserTangleHubBearerForUserOptions +``` + +### `ResolveUserTangleHubBearerOptions` + +`interface` — Resolve options required to obtain a user's TangleHub bearer token including environment and API key retrieval + +```ts +interface ResolveUserTangleHubBearerOptions +``` + +### `SeatBillingFlagOptions` + +`interface` — Define options to configure seat billing flag environment variables and override flag name + +```ts +interface SeatBillingFlagOptions +``` + +### `seatCheckoutUrl` + +`function` — Platform Stripe checkout URL for a product's $100/mo seat. + +```ts +(baseUrl: string, productId: string) => string +``` + +### `SeatStatus` + +`type` — Lifecycle of a per-product seat subscription, mirroring the Stripe states the platform persists. + +```ts +type SeatStatus +``` + +### `signSessionCookieValue` + +`function` — Sign a session token to better-call's signed-cookie contract — the value better-auth's `getSignedCookie` verifies: `.` where the signature is the raw HMAC-SHA256 of the token under… + +```ts +(token: string, secret: string) => Promise +``` + +### `SsoStateConfig` + +`interface` — Define configuration options for managing SSO state including secret, lifetime, and clock injection + +```ts +interface SsoStateConfig +``` + +### `TangleBearerMissingError` + +`class` — Represent missing Tangle platform link error for a specified user ID + +```ts +class TangleBearerMissingError +``` + +### `TangleHubBearerSource` + +`type` — Hub bearer provenance mirrors the execution-key source union. + +```ts +type TangleHubBearerSource +``` + +### `TanglePlanTier` + +`type` — Define available subscription tiers for the TanglePlan service + +```ts +type TanglePlanTier +``` + +### `TangleSsoAccountStore` + +`interface` — Account persistence seam. + +```ts +interface TangleSsoAccountStore +``` + +### `TangleSsoAuthClient` + +`interface` — Structural mirror of the platform auth wire client — any object with these two methods satisfies it without this module importing the concrete class. + +```ts +interface TangleSsoAuthClient +``` + +### `TangleSsoExchangeResult` + +`interface` — Describe the result of exchanging SSO credentials including API key, user info, and optional plan details + +```ts +interface TangleSsoExchangeResult +``` + +### `TangleSsoHandlerOptions` + +`interface` — Define configuration options for handling Tangle SSO authentication and session management + +```ts +interface TangleSsoHandlerOptions +``` + +### `TangleSsoHandlers` + +`interface` — Define handlers for SSO start and callback routes managing authentication flow and session cookies + +```ts +interface TangleSsoHandlers +``` + +### `TangleSsoSessionCookieArgs` + +`interface` — Successful-login context handed to the `setSessionCookie` seam. + +```ts +interface TangleSsoSessionCookieArgs +``` + +### `TangleSsoUserCreateError` + +`class` — Thrown by `upsertUserByEmail` when the app-local user row cannot be created; the callback handler maps it to `?error=tangle_user_create_failed`. + +```ts +class TangleSsoUserCreateError +``` + +### `TangleTierPolicy` + +`interface` — Define policy settings for concurrency and overage allowance in a tangle tier + +```ts +interface TangleTierPolicy +``` + +### `TangleTierState` + +`interface` — Describe the state of a Tangle plan tier including subscription, balance, spending, and concurrency details + +```ts +interface TangleTierState +``` + +### `verifySignedSsoState` + +`function` — Verify the MAC (constant-time) and the signed TTL. + +```ts +(state: string, config: SsoStateConfig) => Promise +``` + + +## `./preflight` + +Source: `src/preflight/index.ts` + +### `formatPreflightReport` + +`function` — Render a report as an aligned, operator-readable table + verdict line. + +```ts +(report: PreflightReport) => string +``` + +### `httpHeadProbe` + +`function` — Probe a plain reachability endpoint (e.g. + +```ts +(config: HttpHeadProbeConfig) => PreflightProbe +``` + +### `HttpHeadProbeConfig` + +`interface` — Define configuration options for performing an HTTP HEAD probe to check URL availability + +```ts +interface HttpHeadProbeConfig +``` + +### `PreflightProbe` + +`interface` — A liveness probe. + +```ts +interface PreflightProbe +``` + +### `PreflightProbeResult` + +`interface` — One probe's outcome. + +```ts +interface PreflightProbeResult +``` + +### `PreflightProbeVerdict` + +`interface` — Per-probe verdict enriched with the resolved criticality and measured latency. + +```ts +interface PreflightProbeVerdict +``` + +### `PreflightReport` + +`interface` — Aggregate of every probe verdict plus the overall pass/fail decision. + +```ts +interface PreflightReport +``` + +### `routerChatProbe` + +`function` — Probe an OpenAI-compatible LLM router with one cheap `POST /chat/completions` (`max_tokens: 1`). + +```ts +(config: RouterChatProbeConfig) => PreflightProbe +``` + +### `RouterChatProbeConfig` + +`interface` — Define configuration options for probing an LLM router with authentication and model details + +```ts +interface RouterChatProbeConfig +``` + +### `runPreflight` + +`function` — Run every probe (concurrently), time each, and fold into a report. + +```ts +(probes: PreflightProbe[]) => Promise +``` + +### `sandboxAuthProbe` + +`function` — Probe the sandbox API with a cheap authed `GET /v1/sandboxes?limit=1`. + +```ts +(config: SandboxAuthProbeConfig) => PreflightProbe +``` + +### `SandboxAuthProbeConfig` + +`interface` — Define configuration options for probing sandbox authentication endpoints + +```ts +interface SandboxAuthProbeConfig +``` + + +## `./preset-cloudflare` + +Source: `src/preset-cloudflare/index.ts` · depends on `billing`, `crypto`, `knowledge`, `tools`, `web` + +### `createD1KnowledgeStateAccessor` + +`function` — The {@link KnowledgeStateAccessor} over the preset D1 schema — the seam that lets the declarative `satisfiedBy` rules resolve with ZERO consumer code: - `config(path)` reads the supplied workspace co… + +```ts +(opts: PresetKnowledgeAccessorOptions) => KnowledgeStateAccessor +``` + +### `createPresetDrizzleSchema` + +`function` — Build the typed Drizzle schema for the preset, given the consumer's `drizzle-orm/sqlite-core` module. + +```ts +(d: DrizzleSqliteCoreLike) => { proposals: unknown; knowledge: unknown; deadlines: unknown; workspaceKeys: unknown; } +``` + +### `createPresetFieldCrypto` + +`function` — Build the {@link KeyCrypto} the billing key store uses — AES-256-GCM field crypto bound to the product's 64-char-hex `ENCRYPTION_KEY` (or a resolver). + +```ts +(key: string | (() => string)) => KeyCrypto +``` + +### `createPresetToolHandlers` + +`function` — The default {@link AppToolHandlers} for the house stack: - `submit_proposal` → insert a `proposals` row (`status='pending'`), deduped on (workspace, title) so a retried turn doesn't double-queue. + +```ts +(opts: PresetToolHandlerOptions) => AppToolHandlers +``` + +### `createPresetWorkspaceKeyManager` + +`function` — Stand up the per-workspace budget-capped {@link WorkspaceKeyManager} on the house stack: the preset `workspace_keys` D1 store + AES-GCM field crypto + the consumer's tcloud provisioner. + +```ts +(opts: PresetBillingOptions) => WorkspaceKeyManager +``` + +### `createPresetWorkspaceKeyStore` + +`function` — The {@link WorkspaceKeyStore} over the preset `workspace_keys` table — the persistence seam the per-workspace key manager needs. + +```ts +(db: D1Like) => WorkspaceKeyStore +``` + +### `D1Like` + +`interface` — The D1 surface the preset needs. + +```ts +interface D1Like +``` + +### `D1PreparedLike` + +`interface` — A prepared, bound D1 statement. + +```ts +interface D1PreparedLike +``` + +### `DrizzleColumnLike` + +`interface` — A chainable column builder — every modifier returns the builder so calls like `.notNull().default('pending')` typecheck. + +```ts +interface DrizzleColumnLike +``` + +### `DrizzleSqliteCoreLike` + +`interface` — The shape of a `drizzle-orm/sqlite-core` module — the few builders the preset schema uses. + +```ts +interface DrizzleSqliteCoreLike +``` + +### `PRESET_MIGRATION_SQL` + +`const` — Plain DDL for the preset schema — run by a consumer to create the tables with ZERO drizzle (`for (const sql of PRESET_MIGRATION_SQL) await db.prepare(sql).run()`, or paste into a `.sql` migration). + +```ts +readonly string[] +``` + +### `PRESET_TABLES` + +`const` — The preset table + column names — the contract the DDL, Drizzle schema, handlers, and accessor share. + +```ts +{ readonly proposals: { readonly name: "proposals"; readonly columns: { readonly id: "id"; readonly workspaceId: "works… +``` + +### `PresetBillingOptions` + +`interface` — Define preset billing options including database, provisioner, encryption key, budget, and optional settings + +```ts +interface PresetBillingOptions +``` + +### `PresetKnowledgeAccessorOptions` + +`interface` — Define options for accessing preset knowledge scoped to a specific workspace and configuration + +```ts +interface PresetKnowledgeAccessorOptions +``` + +### `PresetToolHandlerOptions` + +`interface` — Define configuration options for handling preset tools including database, vault, and optional utilities + +```ts +interface PresetToolHandlerOptions +``` + +### `VaultKv` + +`type` — The KV-backed vault. + +```ts +type VaultKv +``` + + +## `./profile` + +Source: `src/profile/index.ts` · depends on `skills` + +### `assertSkillDeliveryDisjoint` + +`function` — Throw when the same skill id is delivered both `inline` and `mounted` — the agent would see it twice (once in the prompt body, once as a mounted file it's told to go read), doubling prompt bytes and… + +```ts +(inlineIds: Iterable, mountedIds: Iterable) => void +``` + +### `assertSystemPromptWithinBudget` + +`function` — Enforce {@link ComposeProfileBudget} on a composed system prompt: over budget throws (or warns with `warnOnly`) with the actual size and the top-3 largest sections. + +```ts +(systemPrompt: string, budget?: ComposeProfileBudget) => void +``` + +### `composeAgentProfile` + +`function` — Compose a deployable `AgentProfile` from a canonical base plus the four file-mount channels and the overlay overrides. + +```ts +(base: AgentProfile, channels?: ProfileChannels, overlay?: ProfileOverlay, budget?: ComposeProfileBudget) => AgentProfi… +``` + +### `ComposedSkills` + +`interface` — The output of {@link composeSkills}: the refs to attach to `resources.skills` (empty for `inline`) and the prompt section to fold into the system prompt (already carries its own leading `\n\n`, or `'… + +```ts +interface ComposedSkills +``` + +### `ComposeProfileBudget` + +`interface` — Budget config for the composed system prompt. + +```ts +interface ComposeProfileBudget +``` + +### `composeShellResources` + +`function` — Compose every mount channel into one `resources.files`-ready array. + +```ts +(input: ComposeShellResourcesInput) => AgentProfileFileMount[] +``` + +### `ComposeShellResourcesInput` + +`interface` — Inputs to {@link composeShellResources}. + +```ts +interface ComposeShellResourcesInput +``` + +### `composeSkills` + +`function` — Build the {@link ComposedSkills} for one delivery mode. + +```ts +(input: ComposeSkillsInput) => ComposedSkills +``` + +### `CorpusEntry` + +`interface` — One markdown document discovered from the corpus. + +```ts +interface CorpusEntry +``` + +### `CorpusLoadResult` + +`interface` — Outcome of {@link loadMarkdownCorpus}: the entries plus which path produced them, so a caller can fail loud when both are empty rather than silently mounting nothing. + +```ts +interface CorpusLoadResult +``` + +### `corpusSkills` + +`function` — Project corpus entries onto SDK file mounts at a relative path under `/`. + +```ts +(corpus: CorpusEntry[], anchor: string) => AgentProfileFileMount[] +``` + +### `DEFAULT_MAX_SYSTEM_PROMPT_BYTES` + +`const` — Byte budget on the FINAL composed `prompt.systemPrompt`. + +```ts +40000 +``` + +### `EvolvableSectionInput` + +`interface` — Inputs to {@link makeEvolvableSection}. + +```ts +interface EvolvableSectionInput +``` + +### `GlobModules` + +`type` — A Vite eager `?raw` glob result: glob key -> raw file body. + +```ts +type GlobModules +``` + +### `largestPromptSections` + +`function` — Largest markdown-heading-delimited sections of a prompt, by UTF-8 bytes. + +```ts +(prompt: string, top?: number) => { title: string; bytes: number; }[] +``` + +### `LoadCorpusOptions` + +`interface` — Options for {@link loadMarkdownCorpus}. + +```ts +interface LoadCorpusOptions +``` + +### `loadMarkdownCorpus` + +`function` — Load a markdown corpus, preferring a Vite glob-result map and falling back to a Node fs walk. + +```ts +(options: LoadCorpusOptions, importMetaUrl?: string | undefined) => CorpusLoadResult +``` + +### `makeEvolvableSection` + +`function` — Build the one evolvable (`evolvable: true`) domain section whose body comes from the product's loader, falling back to the required baseline when the loaded body is empty after stripping comments. + +```ts +(input: EvolvableSectionInput) => AgentProfileSection +``` + +### `mergeComposedSkills` + +`function` — Combine multiple {@link ComposedSkills} batches (e.g. + +```ts +(batches: ComposedSkills[]) => ComposedSkills +``` + +### `parseCorpusSkills` + +`function` — Map a loaded corpus (see {@link loadMarkdownCorpus}) onto `SkillEntry`s, using each entry's `id` as the fallback when its `SKILL.md` carries no frontmatter `id` of its own. + +```ts +(corpus: CorpusEntry[]) => SkillEntry[] +``` + +### `ParsedSkill` + +`interface` — The result of {@link parseSkillFrontmatter}: the parsed fields, the body with the frontmatter block stripped, and the original untouched text. + +```ts +interface ParsedSkill +``` + +### `parseSkillFrontmatter` + +`function` — THE one `SKILL.md` frontmatter parser — hand-rolled, no YAML dependency. + +```ts +(raw: string) => ParsedSkill +``` + +### `profile` + +`namespace` + +```ts +namespace profile +``` + +### `ProfileChannels` + +`interface` — The file-mount channels layered onto `resources.files`. + +```ts +interface ProfileChannels +``` + +### `ProfileOverlay` + +`interface` — Overlay overrides applied on top of the channel mounts. + +```ts +interface ProfileOverlay +``` + +### `registrySkills` + +`function` — Project the registry's free-tier (or `tier`-matched) entries onto SDK file mounts at the harness skill-discovery path. + +```ts +(registry: SkillEntry[], tier?: string) => AgentProfileFileMount[] +``` + +### `renderInlineSkills` + +`function` — Render every (tier-filtered) skill's full body inline into the prompt — the `inline` delivery mode. + +```ts +(input: RenderInlineSkillsInput) => string +``` + +### `renderSkillIndex` + +`function` — Render a one-line-per-skill INDEX (name, description, and the path to read the full body) — the `mounted` delivery mode's prompt section, paired with {@link skillRefs} putting the actual files on `re… + +```ts +(input: RenderSkillIndexInput) => string +``` + +### `SkillDeliveryMode` + +`type` — How a skill reaches the agent: `inline` renders its full body into the system prompt; `mounted` puts it on the typed `resources.skills` channel and renders only an index line. + +```ts +type SkillDeliveryMode +``` + +### `SkillEntry` + +`interface` — A hand-authored, tier-gated installable skill. + +```ts +interface SkillEntry +``` + +### `skillEntryFromMarkdown` + +`function` — Build a {@link SkillEntry} from a raw `SKILL.md` body. + +```ts +(raw: string, fallbackId?: string | undefined) => SkillEntry +``` + +### `SkillFrontmatter` + +`interface` — Fields a `SKILL.md` frontmatter block may declare. + +```ts +interface SkillFrontmatter +``` + +### `skillMountPath` + +`function` — Harness skill-discovery path the Claude Code backend reads natively. + +```ts +(id: string) => string +``` + +### `skillRefs` + +`function` — Project skills onto the typed `resources.skills` channel (`AgentProfileResourceRef[]`), tier-filtered (same `s.tier === tier` semantics as {@link registrySkills}) when `opts.tier` is given, sorted by… + +```ts +(skills: SkillEntry[], opts?: { tier?: string | undefined; }) => AgentProfileResourceRef[] +``` + +### `stripComments` + +`function` — True body of an addendum file with HTML comments stripped — an all-comment placeholder counts as empty, so the loader falls back to the baseline. + +```ts +(raw: string) => string +``` + +### `UserSkill` + +`interface` — A per-user / per-workspace skill: an id and an inline `SKILL.md` body. + +```ts +interface UserSkill +``` + +### `userSkillMounts` + +`function` — Project per-user skills onto SDK file mounts at the harness skill-discovery path. + +```ts +(userSkills: UserSkill[]) => AgentProfileFileMount[] +``` + + +## `./prompt` + +Source: `src/prompt/index.ts` + +### `AssembleResult` + +`type` — Typed outcome of {@link assembleSystemPrompt}. + +```ts +type AssembleResult +``` + +### `assembleSystemPrompt` + +`function` — Assemble a system prompt from a base block, an operating directive, and an ordered list of pre-rendered context sections. + +```ts +(input: AssembleSystemPromptInput) => AssembleResult +``` + +### `AssembleSystemPromptInput` + +`interface` — Inputs to {@link assembleSystemPrompt}. + +```ts +interface AssembleSystemPromptInput +``` + + +## `./redact` + +Source: `src/redact/index.ts` + +### `buildRedactedDocument` + +`function` — Split `text` into text + redacted segments, encrypting each redacted span's original. + +```ts +(text: string, options: BuildRedactedDocumentOptions) => Promise +``` + +### `BuildRedactedDocumentOptions` + +`interface` — Define options to encrypt text and specify patterns for redacting sensitive document content + +```ts +interface BuildRedactedDocumentOptions +``` + +### `DEFAULT_REDACTION_PATTERNS` + +`const` — The default deterministic patterns. + +```ts +readonly RedactionPattern[] +``` + +### `detectSpans` + +`function` — Find non-overlapping PII spans in `text`. + +```ts +(text: string, patterns?: readonly RedactionPattern[]) => RedactionSpan[] +``` + +### `maskSpans` + +`function` — Replace only the PII substrings in `text`, preserving everything around them (the `mask-spans` string mode). + +```ts +(text: string, patterns?: readonly RedactionPattern[]) => string +``` + +### `RedactedDocSegment` + +`type` — A redacted document segment: literal text, or a masked span with the original kept ENCRYPTED for an authorized reveal. + +```ts +type RedactedDocSegment +``` + +### `RedactedDocument` + +`interface` — Define a document composed of multiple redacted content segments + +```ts +interface RedactedDocument +``` + +### `redactForIngestion` + +`function` — One-way PII scrub for telemetry/ingestion. + +```ts +(value: unknown, options?: RedactForIngestionOptions) => unknown +``` + +### `RedactForIngestionOptions` + +`interface` — Define options to customize sensitive data redaction patterns and key names for ingestion + +```ts +interface RedactForIngestionOptions +``` + +### `RedactionPattern` + +`interface` — A named PII pattern. + +```ts +interface RedactionPattern +``` + +### `RedactionSpan` + +`interface` — A detected PII span in a source string. + +```ts +interface RedactionSpan +``` + +### `RevealResult` + +`interface` — Describe the outcome of a reveal operation including success status, value, and failure reason + +```ts +interface RevealResult +``` + +### `revealSpan` + +`function` — Reveal one redacted span's original, gated + audited. + +```ts +(doc: RedactedDocument, spanId: string, options: RevealSpanOptions) => Promise +``` + +### `RevealSpanOptions` + +`interface` — Define options to decrypt, authorize, and audit the reveal of a span segment + +```ts +interface RevealSpanOptions +``` + + +## `./run` + +Source: `src/run/index.ts` · depends on `harness` + +### `ExecutionMode` + +`type` — Define execution mode as either router or sandbox + +```ts +type ExecutionMode +``` + +### `executionModeForProfile` + +`function` — Execution mode for a profile — `harness` omitted/null => router. + +```ts +(profile: ShellProfile) => ExecutionMode +``` + +### `isKnownSandboxHarness` + +`function` — True when `harness` names a sandbox backend the SDK knows about. + +```ts +(harness: ProfileHarness) => harness is "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "fact… +``` + +### `ProfileHarness` + +`type` — Resolve a ProfileHarness as a Harness, RouterHarness, null, or undefined value + +```ts +type ProfileHarness +``` + +### `resolveExecutionMode` + +`function` — Infer the execution mode from a profile's harness. + +```ts +(harness: ProfileHarness) => ExecutionMode +``` + +### `ROUTER_HARNESS` + +`const` — The router pseudo-harness — the absence of a sandbox backend. + +```ts +"router" +``` + +### `RouterHarness` + +`type` — Provide a type alias for the ROUTER_HARNESS constant to enable consistent router harness usage + +```ts +type RouterHarness +``` + +### `runAgent` + +`function` — Route a turn to the branch the harness selects and stream its events through. + +```ts +(harness: ProfileHarness, branches: RunAgentBranches) => AsyncGenerator +``` + +### `RunAgentBranches` + +`interface` — The two branch runners. + +```ts +interface RunAgentBranches +``` + +### `ShellProfile` + +`interface` — The superset the dispatch reads: the SDK `AgentProfile` plus the harness discriminator. + +```ts +interface ShellProfile +``` + + +## `./runtime` + +Source: `src/runtime/index.ts` · depends on `tools` + +### `AgentRuntime` + +`interface` — Resolve and stream tool execution loops with final results and intermediate events for agent runtime + +```ts +interface AgentRuntime +``` + +### `AgentRuntimeModelConfig` + +`interface` — OpenAI-compatible model endpoint (Tangle Router / tcloud / any compat provider). + +```ts +interface AgentRuntimeModelConfig +``` + +### `AgentTurnOptions` + +`interface` — Define options for configuring a single agent turn including context, prior messages, prompts, and event handlers + +```ts +interface AgentTurnOptions +``` + +### `AnySurfaceKind` + +`type` — The variance-erased form a registry accepts (`build` is contravariant in `TCtx`, so every concrete definition is assignable to this). + +```ts +type AnySurfaceKind +``` + +### `AppToolLoopOptions` + +`interface` + +```ts +interface AppToolLoopOptions +``` + +### `buildCatalog` + +`function` — Pure catalogue pipeline. + +```ts +(raw: RouterModel[], opts?: { preferredDefault?: string | undefined; } | undefined) => ModelCatalog +``` + +### `CatalogModel` + +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags + +```ts +interface CatalogModel +``` + +### `CertifiedDelivery` + +`interface` — Resolve and manage certified profiles with refresh and composition capabilities + +```ts +interface CertifiedDelivery +``` + +### `CertifiedDeliveryConfig` + +`interface` — Define configuration options for delivering certified artifacts to a specified tenant target + +```ts +interface CertifiedDeliveryConfig +``` + +### `createAgentRuntime` + +`function` — Create an in-process agent runtime for one agent. + +```ts +(opts: CreateAgentRuntimeOptions) => AgentRuntime +``` + +### `CreateAgentRuntimeOptions` + +`interface` — Define options for creating an agent runtime including model config and optional profile transformation + +```ts +interface CreateAgentRuntimeOptions +``` + +### `createCertifiedDelivery` + +`function` — Build a certified-delivery transform for one agent target. + +```ts +(config: CertifiedDeliveryConfig) => CertifiedDelivery +``` + +### `createOpenAICompatStreamTurn` + +`function` — Build a `streamTurn` that calls an OpenAI-compatible `/chat/completions` endpoint (Tangle Router / tcloud / any compat provider) with `stream: true` and yields `LoopEvent`s via {@link toLoopEvents}. + +```ts +(opts: OpenAICompatStreamTurnOptions) => (messages: ToolLoopMessage[]) => AsyncIterable +``` + +### `createSurfaceRegistry` + +`function` — Assemble the product's surface registry from its registered kinds. + +```ts +(kinds: readonly AnySurfaceKind[]) => SurfaceRegistry +``` + +### `createTangleRouterModelConfig` + +`function` — Build an OpenAI-compatible Tangle Router model config from an already resolved execution key. + +```ts +(opts: CreateTangleRouterModelConfigOptions) => TangleModelConfig +``` + +### `CreateTangleRouterModelConfigOptions` + +`interface` — Define configuration options for creating a Tangle router model including API key and model details + +```ts +interface CreateTangleRouterModelConfigOptions +``` + +### `DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR` + +`const` — Define the default environment variable name for Tangle billing enforcement + +```ts +"TANGLE_BILLING_ENFORCEMENT" +``` + +### `DEFAULT_TANGLE_ROUTER_BASE_URL` + +`const` — Provide the default base URL for the Tangle router API endpoint + +```ts +"https://router.tangle.tools/v1" +``` + +### `defineSurfaceKind` + +`function` — Declare one surface kind. + +```ts +(opts: { kind: string; build: (ctx: TCtx) => SurfaceOverlay | Promise; }) => SurfaceKindDefinitio… +``` + +### `fetchModelCatalog` + +`function` — Fetch the router model list and build the catalogue, with an in-isolate cache (TTL 5 min). + +```ts +(cfg: { baseUrl: string; apiKey: string; preferredDefault?: string | undefined; }) => Promise +``` + +### `isTangleBillingEnforcementDisabled` + +`function` — Shared policy for agent products that bill through the Tangle Platform. + +```ts +(opts?: TangleBillingEnforcementOptions) => boolean +``` + +### `isTangleExecutionKeyError` + +`function` — Identify whether an error is a TangleExecutionKeyError based on its properties and type + +```ts +(error: unknown) => error is TangleExecutionKeyError +``` + +### `LoopAssistantToolCall` + +`interface` — One OpenAI-shaped tool-call entry carried on an assistant message. + +```ts +interface LoopAssistantToolCall +``` + +### `LoopEvent` + +`type` — Events the app's OpenAI-compat stream adapter ({@link toLoopEvents }) yields. + +```ts +type LoopEvent +``` + +### `LoopMessage` + +`type` — A message in the running conversation the loop sends to `streamTurn`. + +```ts +type LoopMessage +``` + +### `LoopToolCall` + +`interface` — Bounded turn-level tool-dispatch loop. + +```ts +interface LoopToolCall +``` + +### `mergeSurfaceOverlay` + +`function` — Merge one surface overlay into a base profile, returning a new object (the base is never mutated; untouched nested records are shared by reference). + +```ts +(base: TBase, overlay: SurfaceOverlay) => TBase & SurfaceMergeBase +``` + +### `ModelCatalog` + +`interface` — Define a catalog containing models with a default ID and fetch timestamp + +```ts +interface ModelCatalog +``` + +### `normalizeModelId` + +`function` — Strip provider prefix, :free suffix, and trailing date stamps. + +```ts +(id: string) => string +``` + +### `OpenAICompatStreamTurnOptions` + +`interface` — Define options for configuring an OpenAI-compatible streaming chat turn including API details and tools + +```ts +interface OpenAICompatStreamTurnOptions +``` + +### `OpenAIStreamChunk` + +`interface` — Minimal OpenAI Chat Completions streaming chunk (structural — no `openai` dep). + +```ts +interface OpenAIStreamChunk +``` + +### `ResolvedAgentProfile` + +`interface` — The agent's resolved profile surfaces for one turn — the things a delivered / certified `AgentProfile` can change. + +```ts +interface ResolvedAgentProfile +``` + +### `ResolvedTangleExecutionKey` + +`interface` — Define a resolved key combining an API key with its Tangle execution source + +```ts +interface ResolvedTangleExecutionKey +``` + +### `ResolveModelOptions` + +`interface` — Resolve options for model configuration including environment variables and default router base URL + +```ts +interface ResolveModelOptions +``` + +### `resolveTangleDevOrUserKey` + +`function` — Shared dev-aware Tangle key resolution. + +```ts +(opts: ResolveTangleDevOrUserKeyOptions) => Promise +``` + +### `ResolveTangleDevOrUserKeyOptions` + +`interface` — Resolve options for retrieving a Tangle developer or user API key based on environment and context + +```ts +interface ResolveTangleDevOrUserKeyOptions +``` + +### `resolveTangleExecutionEnvironment` + +`function` — Resolve the current Tangle execution environment based on provided or process environment variables + +```ts +(env?: Record) => TangleExecutionEnvironment +``` + +### `resolveTangleModelConfig` + +`function` — Resolve the model config from env. + +```ts +(opts?: ResolveModelOptions) => TangleModelConfig +``` + +### `resolveUserTangleExecutionKey` + +`function` — Resolve the user-facing Tangle API key for model execution. + +```ts +(opts: ResolveUserTangleExecutionKeyOptions) => Promise +``` + +### `resolveUserTangleExecutionKeyForUser` + +`function` — Resolve the Tangle execution key for a specified user using provided environment and API key options + +```ts +(opts: ResolveUserTangleExecutionKeyForUserOptions) => Promise +``` + +### `ResolveUserTangleExecutionKeyForUserOptions` + +`interface` — Resolve options for retrieving a user's Tangle execution key with environment and API key access parameters + +```ts +interface ResolveUserTangleExecutionKeyForUserOptions +``` + +### `ResolveUserTangleExecutionKeyOptions` + +`interface` — Resolve options for retrieving user API keys within a specific Tangle execution environment + +```ts +interface ResolveUserTangleExecutionKeyOptions +``` + +### `RouterModel` + +`interface` — Model catalogue — computed live from the Tangle Router, never hand-curated. + +```ts +interface RouterModel +``` + +### `runAppToolLoop` + +`function` — Run the bounded tool loop and return the final text + every executed tool outcome. + +```ts +(opts: RunToolLoopOptions) => Promise +``` + +### `streamAppToolLoop` + +`function` — Streaming bounded tool loop: yields each raw turn event (the caller maps + telemetries + re-emits it) and each executed `tool_result`; emits one `capped` if it stops for any non-completed reason with… + +```ts +(opts: StreamToolLoopOptions) => AsyncGenerator, void, unknown> +``` + +### `StreamAppToolLoopOptions` + +`interface` + +```ts +interface StreamAppToolLoopOptions +``` + +### `StreamLoopYield` + +`type` + +```ts +type StreamLoopYield +``` + +### `SurfaceKindDefinition` + +`interface` — One registered surface kind. + +```ts +interface SurfaceKindDefinition +``` + +### `SurfaceMcpServer` + +`type` — The only MCP entry shape an overlay may carry: the server-built bridge entry from ../tools/mcp (transport, url, headers, and capability token all assembled server-side). + +```ts +type SurfaceMcpServer +``` + +### `SurfaceMergeBase` + +`interface` — Base-profile slice the merge reads/writes. + +```ts +interface SurfaceMergeBase +``` + +### `SurfaceOverlay` + +`interface` — What one surface contributes to the agent profile for a single turn. + +```ts +interface SurfaceOverlay +``` + +### `SurfacePermissionValue` + +`type` — Sandbox permission posture values, ranked deny > ask > allow for merging. + +```ts +type SurfacePermissionValue +``` + +### `SurfaceRegistry` + +`interface` — Resolve and build the overlay for a given surface kind within a turn context + +```ts +interface SurfaceRegistry +``` + +### `TangleBillingEnforcementOptions` + +`interface` — Define options for configuring billing enforcement environment variables and overrides + +```ts +interface TangleBillingEnforcementOptions +``` + +### `TangleExecutionEnvironment` + +`type` — Define the environment context for executing Tangle operations + +```ts +type TangleExecutionEnvironment +``` + +### `TangleExecutionKeyError` + +`class` — Represent execution key errors with specific codes and HTTP status information + +```ts +class TangleExecutionKeyError +``` + +### `TangleExecutionKeyErrorCode` + +`type` — Define error codes for Tangle execution key issues related to API key and account connection + +```ts +type TangleExecutionKeyErrorCode +``` + +### `tangleExecutionKeyHttpError` + +`function` — Resolve and format TangleExecutionKey HTTP errors into a standardized error object or return null + +```ts +(error: unknown) => TangleExecutionKeyHttpError | null +``` + +### `TangleExecutionKeyHttpError` + +`interface` — Represent HTTP error response containing status, error message, and specific error code + +```ts +interface TangleExecutionKeyHttpError +``` + +### `TangleExecutionKeySource` + +`type` — Resolve the source of the Tangle execution key as either local environment or user input + +```ts +type TangleExecutionKeySource +``` + +### `TangleModelConfig` + +`interface` — Resolve the model config a Tangle agent's sandbox/runtime runs on. + +```ts +interface TangleModelConfig +``` + +### `toLoopEvents` + +`function` — Map an OpenAI-compat streaming chunk iterator to `LoopEvent`s: each content delta → a `text` event; tool-call deltas are accumulated by index across chunks and emitted as one complete `tool_call` eve… + +```ts +(chunks: AsyncIterable) => AsyncIterable +``` + +### `ToolLoopEvent` + +`type` + +```ts +type ToolLoopEvent +``` + +### `ToolLoopResult` + +`interface` + +```ts +interface ToolLoopResult +``` + +### `ToolLoopStopReason` + +`type` — Why the loop stopped. + +```ts +type ToolLoopStopReason +``` + +### `trimOrNull` + +`function` — Resolve a string by trimming whitespace or returning null if empty or undefined + +```ts +(value: string | null | undefined) => string | null +``` + + +## `./sandbox` + +Source: `src/sandbox/index.ts` · depends on `crypto`, `harness`, `runtime`, `tools` + +### `AppToolDescriptor` + +`interface` — Describe an application tool with its name, unique key, and description + +```ts +interface AppToolDescriptor +``` + +### `assertEnvWithinLimits` + +`function` — Throw when any single env value exceeds {@link ENV_VALUE_MAX_BYTES} or the whole env block exceeds {@link ENV_TOTAL_MAX_BYTES}, naming the offending variable. + +```ts +(env: Record) => void +``` + +### `assertProvisionPayloadWithinCap` + +`function` — Throw when the serialized provision payload exceeds {@link PROVISION_PAYLOAD_MAX_BYTES}. + +```ts +(payload: ProvisionPayloadSections) => void +``` + +### `attachReasoningEffort` + +`function` — Attach a specified reasoning effort level to an agent profile for a given harness + +```ts +(profile: AgentProfile, harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-dro… +``` + +### `AuthenticatedSandboxUser` + +`interface` — Represent an authenticated user within a sandbox environment with a unique identifier + +```ts +interface AuthenticatedSandboxUser +``` + +### `bearerSubprotocolToken` + +`function` — Resolve and decode a bearer token from a comma-separated subprotocol string or return null + +```ts +(value: string | null) => string | null +``` + +### `bearerToken` + +`function` — Extract the token from a bearer authorization string or return null if invalid or missing + +```ts +(value: string | null) => string | null +``` + +### `buildAppToolMcpServers` + +`function` — Build a mapping of MCP server profiles keyed by tool identifiers from provided options + +```ts +(options: BuildAppToolMcpServersOptions) => Record +``` + +### `BuildAppToolMcpServersOptions` + +`interface` — Define options for building MCP server configurations in the app tool environment + +```ts +interface BuildAppToolMcpServersOptions +``` + +### `buildSandboxRuntimeProxyHeaders` + +`function` — Build proxy headers for sandbox runtime including authorization and forwarded headers + +```ts +(source: Headers, sandboxApiKey: string, forwardHeaders?: string[]) => Headers +``` + +### `buildSandboxToolFileMounts` + +`function` — Build file mounts for sandbox tools based on provided options and tool configurations + +```ts +(options: BuildSandboxToolFileMountsOptions) => AgentProfileFileMount[] +``` + +### `BuildSandboxToolFileMountsOptions` + +`interface` — Define options for building sandbox tool file mounts including tool specifications and paths + +```ts +interface BuildSandboxToolFileMountsOptions +``` + +### `buildSandboxToolPathSetupScript` + +`function` — Build a shell script that sets up and exports the sandbox tool binary directory in user profiles + +```ts +(options: SandboxToolPathOptions) => string +``` + +### `classifySeveredStream` + +`function` — Resolve the severed stream event to a corresponding sandbox step transition or null + +```ts +(event: unknown) => SandboxStepTransition | null +``` + +### `createSandboxTerminalToken` + +`function` — Generate a sandbox terminal token for a given subject with specified options + +```ts +(subject: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise +``` + +### `createWorkspaceSandboxConnectionHandler` + +`function` — Create a handler to resolve workspace sandbox connections with user and access validation + +```ts +(opts: WorkspaceSandboxConnectionHandlerOptions) => ({ request, params… +``` + +### `createWorkspaceSandboxManager` + +`function` — Create a manager to handle workspace sandbox instances with client and options configuration + +```ts +(opts: WorkspaceSandboxManagerOptions ({ request, params }: WorkspaceSandboxRuntimeProxyArgs) => Promis… +``` + +### `createWorkspaceSandboxTerminalUpgradeHandler` + +`function` — Build a Worker-entry handler that proxies a sandbox terminal WebSocket upgrade to the sandbox API runtime proxy. + +```ts +(opts: WorkspaceSandboxTerminalUpgradeHandlerOptions) => (request: Request) => Promise +``` + +### `DEFAULT_SANDBOX_RESOURCES` + +`const` — Define default resource limits and settings for sandbox environments + +```ts +SandboxResourceConfig +``` + +### `deferredCorpusHash` + +`function` — Stable content hash of the deferred file corpus (path + inline content). + +```ts +(files: AgentProfileFileMount[]) => string +``` + +### `deleteSecret` + +`function` — Delete a secret by name from the given secret store and return the operation outcome + +```ts +(store: SecretStore, name: string) => Promise> +``` + +### `detectInteractiveQuestion` + +`function` — Resolve the interactive question text from a structured event or return null if none found + +```ts +(event: unknown) => string | null +``` + +### `driveSandboxTurn` + +`function` — Resolve a sandbox turn by processing a message with given configuration and options + +```ts +(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options: DriveSandboxTurnOptio… +``` + +### `DriveSandboxTurnOptions` + +`interface` — Define options to manage deterministic session resumption and turn idempotency in sandboxed drive turns + +```ts +interface DriveSandboxTurnOptions +``` + +### `encodeSandboxRuntimePath` + +`function` — Encode a runtime path by URI-encoding each valid segment and returning null for invalid segments + +```ts +(runtimePath: string) => string | null +``` + +### `ensureWorkspaceSandbox` + +`function` — Resolve or create a workspace sandbox instance with optional reuse and progress tracking + +```ts +(shell: SandboxRuntimeConfig, options: EnsureWorkspaceSandboxOptions) => Promise +``` + +### `EnsureWorkspaceSandboxOptions` + +`interface` — Define options for ensuring a workspace sandbox with provisioning and progress handling + +```ts +interface EnsureWorkspaceSandboxOptions +``` + +### `ENV_TOTAL_MAX_BYTES` + +`const` — Total env gate: the whole environment block shares the payload budget with the profile; past 200 KB the provision body cannot stay under the cap. + +```ts +200000 +``` + +### `ENV_VALUE_MAX_BYTES` + +`const` — Per-variable env gate: the kernel rejects any single `NAME=value` env entry over MAX_ARG_STRLEN (131072 bytes) with E2BIG, killing every exec inside the box. + +```ts +120000 +``` + +### `flattenHistory` + +`function` — Build a single string combining conversation history and the current user message + +```ts +(message: string, history?: { role: "user" | "assistant"; content: string; }[] | undefined) => string +``` + +### `getClient` + +`function` — Resolve a synchronous sandbox client from provided runtime configuration credentials + +```ts +(shell: SandboxRuntimeConfig) => SandboxClient +``` + +### `isSandboxTerminalWsUpgrade` + +`function` — True when `request` is a WebSocket upgrade for a sandbox terminal path. + +```ts +(request: Request) => boolean +``` + +### `isTerminalPromptEvent` + +`function` — Determine if an event is a terminal prompt event with type 'result' or 'done + +```ts +(event: unknown) => boolean +``` + +### `LivenessProbeConfig` + +`interface` — Define configuration for liveness probes including sidecar process pattern and optional timeouts + +```ts +interface LivenessProbeConfig +``` + +### `matchSandboxTerminalWsPath` + +`function` — Parse a same-origin terminal-WS pathname into its parts, or `null` when the path is not a sandbox terminal WebSocket. + +```ts +(pathname: string) => SandboxTerminalWsMatch | null +``` + +### `MemberSyncSeam` + +`interface` — Map workspace roles to corresponding sandbox permission levels + +```ts +interface MemberSyncSeam +``` + +### `mergeExtraMcp` + +`function` — Resolve conflicts and merge extra MCP profiles into the app tool MCP without overwriting existing keys + +```ts +(appToolMcp: Record, baseProfileMcp: Record, extra: Recor… +``` + +### `mergeHistoryIntoParts` + +`function` — History-aware equivalent of flattenHistory for multimodal prompt parts: the transcript is folded into the first text part (image/file parts carry no text to prepend to) rather than replacing the mess… + +```ts +(parts: PromptInputPart[], history?: { role: "user" | "assistant"; content: string; }[] | undefined) => PromptInputPart… +``` + +### `mintSandboxScopedToken` + +`function` — Mint a scoped token for an already-provisioned box (e.g. + +```ts +(box: SandboxInstance, options: { scope: ScopedTokenScope; sessionId?: string | undefined; ttlMinutes?: number | undefi… +``` + +### `mintTerminalProxyToken` + +`function` — Generate a signed token for TerminalProxyIdentity with an expiration based on TTL milliseconds + +```ts +(secret: string, identity: TerminalProxyIdentity, ttlMs?: number, now?: () => number) => Promise Promise Prom… +``` + +### `readSecret` + +`function` — Resolve a secret value from the store by its name and return the outcome asynchronously + +```ts +(store: SecretStore, name: string) => Promise> +``` + +### `resetClientCache` + +`function` — Reset the client cache to clear stored data and force fresh retrieval + +```ts +() => void +``` + +### `ResolvedModel` + +`interface` — Represent a fully configured model with optional API key and base URL for sandbox platform integration + +```ts +interface ResolvedModel +``` + +### `resolveModel` + +`function` — Resolve and return the appropriate model configuration based on provider settings and optional overrides + +```ts +(config: ProviderResolutionConfig | undefined, override?: { model?: string | undefined; modelApiKey?: string | undefine… +``` + +### `resolveSandboxClientCredentials` + +`function` — Resolve sandbox client credentials based on environment and provided options asynchronously + +```ts +(options?: ResolveSandboxClientCredentialsOptions) => Promise +``` + +### `ResolveSandboxClientCredentialsOptions` + +`interface` — Resolve options for obtaining sandbox client credentials from environment variables and classification + +```ts +interface ResolveSandboxClientCredentialsOptions +``` + +### `runSandboxPrompt` + +`function` — Resolve a sandbox prompt by streaming and aggregating message parts into a complete string + +```ts +(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… +``` + +### `runSandboxToolPathSetup` + +`function` — Resolve the sandbox environment PATH setup by executing the configuration script with given options + +```ts +(box: SandboxInstance, options: SandboxToolPathOptions) => Promise> +``` + +### `SandboxApiCredentials` + +`interface` — Define credentials required to access the sandbox API environment + +```ts +interface SandboxApiCredentials +``` + +### `SandboxBuildContext` + +`interface` — Define the context for building a sandbox including workspace, integrations, and optional user ID + +```ts +interface SandboxBuildContext +``` + +### `SandboxClientCredentials` + +`interface` — Define client credentials for accessing the sandbox environment with API key and base URL + +```ts +interface SandboxClientCredentials +``` + +### `SandboxCredentialEnvironment` + +`type` — Sandbox credential policy reuses the canonical execution-environment union (development/test/staging/production) so env classification stays in one place (see resolveTangleExecutionEnvironment in run… + +```ts +type SandboxCredentialEnvironment +``` + +### `SandboxExecChannel` + +`interface` — The `box.exec` surface these helpers use — structural, so a caller can pass the sandbox SDK's `SandboxInstance` directly or a narrower test double. + +```ts +interface SandboxExecChannel +``` + +### `SandboxExecOptions` + +`interface` — Define options to execute code within a sandbox environment with optional session control + +```ts +interface SandboxExecOptions +``` + +### `SandboxFileBytesOutcome` + +`type` — Represent the outcome of reading sandbox file bytes with success status and corresponding data or error + +```ts +type SandboxFileBytesOutcome +``` + +### `SandboxFileSizeOutcome` + +`type` — Resolve the outcome of a sandbox file size check with success status and value or error message + +```ts +type SandboxFileSizeOutcome +``` + +### `SandboxPermissionLevel` + +`type` — Define permission levels for sandbox access and control + +```ts +type SandboxPermissionLevel +``` + +### `SandboxResourceConfig` + +`interface` — Define configuration parameters for sandbox resource allocation and lifecycle management + +```ts +interface SandboxResourceConfig +``` + +### `SandboxRestoreSpec` + +`interface` — Define the specification for restoring a sandbox from a snapshot or another sandbox ID + +```ts +interface SandboxRestoreSpec +``` + +### `SandboxRuntimeAuthRefreshError` + +`class` — Represent an error thrown when sandbox runtime authentication refresh fails for a specific stage and name + +```ts +class SandboxRuntimeAuthRefreshError +``` + +### `SandboxRuntimeConfig` + +`interface` — Define runtime configuration methods for sandbox environments including credentials, metadata, and permissions + +```ts +interface SandboxRuntimeConfig +``` + +### `SandboxRuntimeConnection` + +`interface` — Define a connection configuration for sandbox runtime including URL and optional server-side auth token + +```ts +interface SandboxRuntimeConnection +``` + +### `SandboxScope` + +`interface` — Define a scope containing workspace and optional user identifiers for sandbox environments + +```ts +interface SandboxScope +``` + +### `SandboxStepTransition` + +`type` — Define transitions marking the start or finish of a sandbox step with associated details + +```ts +type SandboxStepTransition +``` + +### `SandboxTerminalTokenOptions` + +`interface` — Define options for generating a sandbox terminal token including secret and expiration settings + +```ts +interface SandboxTerminalTokenOptions +``` + +### `SandboxTerminalTokenResult` + +`interface` — Provide token and expiration details for a sandbox terminal session + +```ts +interface SandboxTerminalTokenResult +``` + +### `SandboxTerminalTokenSubject` + +`type` — Resolve the identity type used for sandbox terminal token subjects + +```ts +type SandboxTerminalTokenSubject +``` + +### `SandboxTerminalWsMatch` + +`interface` — Define the structure for matching a sandbox terminal WebSocket with workspace and path details + +```ts +interface SandboxTerminalWsMatch +``` + +### `sandboxToolBinDir` + +`function` — Resolve the binary directory path for a sandbox tool based on provided options + +```ts +(options: SandboxToolPathOptions) => string +``` + +### `sandboxToolPath` + +`function` — Resolve the file system path to a specified sandbox tool based on given options + +```ts +(options: SandboxToolPathOptions & { toolName: string; }) => string +``` + +### `SandboxToolPathOptions` + +`interface` — Define options for resolving sandbox tool paths including appName, baseDir, and binDir + +```ts +interface SandboxToolPathOptions +``` + +### `sandboxToolRootDir` + +`function` — Resolve the root directory path for a sandbox tool based on provided options + +```ts +(options: SandboxToolPathOptions) => string +``` + +### `SandboxToolSpec` + +`interface` — Define the specification for a sandbox tool including its name, content, and optional executability + +```ts +interface SandboxToolSpec +``` + +### `ScopedTokenResult` + +`interface` — Represent a token with its expiration date and associated scope + +```ts +interface ScopedTokenResult +``` + +### `SecretStore` + +`interface` — Define methods to create, update, retrieve, and delete secrets asynchronously + +```ts +interface SecretStore +``` + +### `secretStoreFromClient` + +`function` — Resolve a SecretStore interface using the provided SandboxRuntimeConfig shell + +```ts +(shell: SandboxRuntimeConfig) => SecretStore +``` + +### `shellQuote` + +`function` — Wraps a value in single quotes for `sh`, closing and reopening the quote around each embedded quote (`'` → `'"'"'`). + +```ts +(value: string) => string +``` + +### `splitDeferredProfileFiles` + +`function` — Split profile files into inline deferred files and a lean profile without them + +```ts +(profile: AgentProfile) => { leanProfile: AgentProfile; deferredFiles: AgentProfileFileMount[]; } +``` + +### `statSandboxFileSize` + +`function` — Stats a sandbox file's byte length via `wc -c`. + +```ts +(box: SandboxExecChannel, absolutePath: string, options?: SandboxExecOptions | undefined) => Promise Promise> +``` + +### `streamSandboxPrompt` + +`function` — Resolve and stream AI-generated responses from a sandboxed environment based on input messages and options + +```ts +(shell: SandboxRuntimeConfig, box: SandboxInstance, message: string | PromptInputPart[], options?: StreamSandboxPromptO… +``` + +### `StreamSandboxPromptOptions` + +`interface` — Define options for configuring and controlling a streaming sandbox prompt session + +```ts +interface StreamSandboxPromptOptions +``` + +### `syncSandboxMemberAdd` + +`function` — Resolve adding a user with a specific role to a sandbox and return the operation outcome + +```ts +(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> +``` + +### `syncSandboxMemberRemove` + +`function` — Remove a member from the sandbox while preserving their home directory and handle the outcome + +```ts +(box: SandboxInstance, userId: string) => Promise> +``` + +### `syncSandboxMemberRole` + +`function` — Synchronize a sandbox member's role by updating permissions based on the provided role mapping + +```ts +(box: SandboxInstance, seam: MemberSyncSeam, userId: string, role: string) => Promise> +``` + +### `TerminalProxyIdentity` + +`interface` — Define identity details for a terminal proxy including user, workspace, and sandbox identifiers + +```ts +interface TerminalProxyIdentity +``` + +### `terminalTokenFromRequest` + +`function` — Resolve the terminal token from request headers using Authorization or Sec-WebSocket-Protocol fields + +```ts +(headers: Headers) => string | null +``` + +### `verifySandboxTerminalToken` + +`function` — Verify the validity of a sandbox terminal token against the expected identity and options + +```ts +(token: string, expected: TerminalProxyIdentity, opts: SandboxTerminalTokenOptions) => Promise +``` + +### `verifyTerminalProxyToken` + +`function` — Verify the authenticity and validity of a terminal proxy token against expected identity and timestamp + +```ts +(secret: string, token: string, expected: TerminalProxyIdentity, now?: () => number) => Promise +``` + +### `WorkspaceSandboxConnectionArgs` + +`interface` — Define arguments required to establish a workspace sandbox connection + +```ts +interface WorkspaceSandboxConnectionArgs +``` + +### `WorkspaceSandboxConnectionHandlerOptions` + +`interface` — Define options to handle workspace sandbox connections with user authentication and access control + +```ts +interface WorkspaceSandboxConnectionHandlerOptions +``` + +### `WorkspaceSandboxEnsureContext` + +`interface` — Define the context containing workspace and user identifiers for sandbox environment operations + +```ts +interface WorkspaceSandboxEnsureContext +``` + +### `WorkspaceSandboxInstanceLike` + +`interface` — Define the shape of a workspace sandbox instance including its connection details and status + +```ts +interface WorkspaceSandboxInstanceLike +``` + +### `WorkspaceSandboxManager` + +`interface` — Manage workspace sandboxes by ensuring their creation and retrieval for specified users + +```ts +interface WorkspaceSandboxManager +``` + +### `WorkspaceSandboxManagerOptions` + +`interface` — Define configuration options for managing and interacting with workspace sandboxes + +```ts +interface WorkspaceSandboxManagerOptions +``` + +### `WorkspaceSandboxRuntimeProxyArgs` + +`interface` — Define arguments for proxying runtime requests within a workspace sandbox environment + +```ts +interface WorkspaceSandboxRuntimeProxyArgs +``` + +### `WorkspaceSandboxRuntimeProxyHandlerOptions` + +`interface` — Define options for handling workspace sandbox runtime proxy including user, access, credentials, and connection retrieval + +```ts +interface WorkspaceSandboxRuntimeProxyHandlerOptions +``` + +### `WorkspaceSandboxTerminalUpgradeHandlerOptions` + +`interface` — Define options to handle user authentication, workspace access, and sandbox API credential retrieval + +```ts +interface WorkspaceSandboxTerminalUpgradeHandlerOptions +``` + +### `WriteProfileFilesOptions` + +`interface` — Define options to control execution timeout, pacing, and retry behavior when writing profile files + +```ts +interface WriteProfileFilesOptions +``` + +### `writeProfileFilesToBox` + +`function` — Write profile files to a sandbox with pacing, retries, and optional execution timeout handling + +```ts +(box: SandboxInstance, files: AgentProfileFileMount[], options?: WriteProfileFilesOptions) => Promise> +``` + + +## `./sequences` + +Source: `src/sequences/index.ts` · depends on `tools`, `web` + +### `AddCaptionOperation` + +`interface` — Add a caption with optional language, timing, and track placement details + +```ts +interface AddCaptionOperation +``` + +### `applySequenceOperation` + +`function` — Apply a sequence operation to update the store and timeline asynchronously + +```ts +(store: SequenceStore, timeline: SequenceTimeline, op: SequenceOperation, ctx: SequenceOperationContext) => Promise<...> +``` + +### `applySequenceOperations` + +`function` — The batch path every dispatcher (the MCP tools, a product's editor persistence route) funnels through: fetch the timeline, validate the WHOLE batch against pre-state, then apply in order with a timel… + +```ts +(store: SequenceStore, operations: SequenceOperation[], ctx: SequenceOperationContext) => Promise +``` + +### `assertClipFitsSequence` + +`function` — Validate that a clip's start and duration fit within the sequence duration without overflow + +```ts +(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; label: string; }) => void +``` + +### `assertSequenceMediaUrl` + +`function` — Media references must be provider URLs or app-served paths. + +```ts +(url: string) => void +``` + +### `buildCaptionChunks` + +`function` — Split transcript segments into caption chunks. + +```ts +(segments: TranscriptSegment[], opts: BuildCaptionChunksOptions) => CaptionChunk[] +``` + +### `BuildCaptionChunksOptions` + +`interface` — Define options to configure caption chunk size, duration, and frame rate constraints + +```ts +interface BuildCaptionChunksOptions +``` + +### `buildContactSheetManifest` + +`function` — One sample frame per enabled video-track clip with resolved, completed media — the product side renders the actual sheet (needs ffmpeg/canvas). + +```ts +(timeline: SequenceTimeline) => ContactSheetManifest +``` + +### `buildEdl` + +`function` — CMX3600-style EDL: one event per enabled video/audio clip in record-start order. + +```ts +(timeline: SequenceTimeline) => string +``` + +### `buildOtio` + +`function` — OpenTimelineIO `Timeline.1` document. + +```ts +(timeline: SequenceTimeline) => OtioTimeline +``` + +### `buildSequencesMcpServerEntry` + +`function` — Build the `AgentProfileMcpServer`-shaped entry for the sequences channel. + +```ts +(opts: ScopedMcpServerEntryOptions) => AppToolMcpServer +``` + +### `BuildSequencesMcpServerEntryOptions` + +`type` — Extend ScopedMcpServerEntryOptions to configure MCP server entry options for sequence building + +```ts +type BuildSequencesMcpServerEntryOptions +``` + +### `buildSrt` + +`function` — Numbered SubRip cues from caption-track clips, in timeline order. + +```ts +(timeline: SequenceTimeline, opts?: CaptionExportOptions) => string +``` + +### `buildVtt` + +`function` — WebVTT with numbered cue identifiers; same filtering and frame math as `buildSrt`, dot millisecond separator per the VTT grammar. + +```ts +(timeline: SequenceTimeline, opts?: CaptionExportOptions) => string +``` + +### `CaptionChunk` + +`interface` — One caption clip's worth of text with its timeline bounds. + +```ts +interface CaptionChunk +``` + +### `captionCoverage` + +`function` — Per-language caption coverage over [0, durationFrames). + +```ts +(timeline: SequenceTimeline) => CaptionCoverageEntry[] +``` + +### `CaptionCoverageEntry` + +`interface` — Coverage for one caption language across the sequence. + +```ts +interface CaptionCoverageEntry +``` + +### `CaptionExportOptions` + +`interface` — Define options to export captions filtered by an optional BCP-47 language tag + +```ts +interface CaptionExportOptions +``` + +### `CaptionTargetResolution` + +`type` — Resolve caption target by specifying an existing track or creating a new one with language and name + +```ts +type CaptionTargetResolution +``` + +### `captionTrackNameForLanguage` + +`function` — Naming convention for auto-created per-language caption tracks. + +```ts +(language: string) => string +``` + +### `chooseCaptionPlacement` + +`function` — Place a caption near the playhead inside FREE space only — the caption track never double-books. + +```ts +(input: { playheadFrame: number; fps: number; sequenceDurationFrames: number; occupiedIntervals: TimelineInterval[]; })… +``` + +### `clampClipDuration` + +`function` — Clamp clip duration to fit within sequence bounds and minimum length constraints + +```ts +(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number +``` + +### `clampClipStart` + +`function` — Clamp the clip start frame within the valid range of the sequence duration and clip length + +```ts +(input: { startFrame: number; durationFrames: number; sequenceDurationFrames: number; }) => number +``` + +### `ContactSheetEntry` + +`interface` — Describe a single entry in a contact sheet with timing and media source details + +```ts +interface ContactSheetEntry +``` + +### `ContactSheetManifest` + +`interface` — Define the structure for a contact sheet manifest including metadata and entries + +```ts +interface ContactSheetManifest +``` + +### `createSequencesMcpHandler` + +`function` — Create a handler to process MCP sequence requests with optional playhead frame and server info + +```ts +(opts: CreateSequencesMcpHandlerOptions) => (request: Request) => Promise +``` + +### `CreateSequencesMcpHandlerOptions` + +`interface` — Define options for creating sequences MCP handler including store, playhead frame, and server info + +```ts +interface CreateSequencesMcpHandlerOptions +``` + +### `CreateTrackOperation` + +`interface` — Define an operation to create a new sequence track with a specified kind and name + +```ts +interface CreateTrackOperation +``` + +### `DEFAULT_SEQUENCES_MCP_DESCRIPTION` + +`const` — Describe live timeline editor features for current video sequence including clip and caption management + +```ts +"Live timeline editor for the current video sequence: read timeline state, place/move/trim/split clips, add captions, m… +``` + +### `DeleteClipOperation` + +`interface` — Represent a delete clip operation with a specified clip identifier + +```ts +interface DeleteClipOperation +``` + +### `ExtendSequenceOperation` + +`interface` — Define an operation to extend a sequence by a specified number of frames + +```ts +interface ExtendSequenceOperation +``` + +### `findSequenceMcpTool` + +`function` — Resolve the SequenceMcpToolDefinition matching the given name or return undefined + +```ts +(name: string) => SequenceMcpToolDefinition | undefined +``` + +### `formatSeconds` + +`function` — Format a number of seconds into a string with integer or two-decimal precision suffix s + +```ts +(seconds: number) => string +``` + +### `formatTimecode` + +`function` — `m:ss.ff` timecode for UI and agent-readable frame references. + +```ts +(frames: number, fps: number) => string +``` + +### `framesToSeconds` + +`function` — Convert a frame count to seconds based on the given frames per second rate + +```ts +(frames: number, fps: number) => number +``` + +### `LanguageFanoutOptions` + +`interface` — Define options to specify target languages and an optional source language for fan-out operations + +```ts +interface LanguageFanoutOptions +``` + +### `lastClipEndFrame` + +`function` — Last occupied frame across all clips — the floor for `extend_sequence`. + +```ts +(timeline: SequenceTimeline) => number +``` + +### `MAX_CAPTION_BATCH` + +`const` — Largest accepted `add_captions` batch — bounds one decision row / one validation pass to a size the store can absorb in a single request. + +```ts +500 +``` + +### `MIN_SEQUENCE_CLIP_FRAMES` + +`const` — Frame-accurate sequence timeline model — the product-agnostic spine of the sequences surface. + +```ts +1 +``` + +### `MoveClipOperation` + +`interface` — Resolve an operation to move a clip to a new start frame and optional track + +```ts +interface MoveClipOperation +``` + +### `NewSequenceClip` + +`interface` — Define properties for a new sequence clip including timing, labels, and optional metadata + +```ts +interface NewSequenceClip +``` + +### `NewSequenceDecision` + +`interface` — Define the structure for a new sequence decision with optional metadata and acceptance status + +```ts +interface NewSequenceDecision +``` + +### `NewSequenceTrack` + +`interface` — Define properties for a new sequence track including kind, name, and optional sort order + +```ts +interface NewSequenceTrack +``` + +### `normalizeLanguageTag` + +`function` — Normalize a BCP-47 tag to conventional casing: primary subtag lowercase, 4-letter script subtags Title Case, 2-letter region subtags UPPER, all other subtags lowercase. + +```ts +(tag: string) => string +``` + +### `OtioClip` + +`interface` — Define a clip object with metadata, source range, and media reference according to OTIO schema + +```ts +interface OtioClip +``` + +### `OtioExternalReference` + +`interface` — Define the structure for an external media reference with schema, URL, and optional time range + +```ts +interface OtioExternalReference +``` + +### `OtioGap` + +`interface` — Define the structure for a gap element with schema, name, and source time range properties + +```ts +interface OtioGap +``` + +### `OtioMissingReference` + +`interface` — Represent missing references in OTIO with a fixed schema identifier + +```ts +interface OtioMissingReference +``` + +### `OtioRationalTime` + +`interface` — Represent a rational time value with a specific rate and numeric value for OTIO schema + +```ts +interface OtioRationalTime +``` + +### `OtioStack` + +`interface` — Represent a stack container holding a named collection of OtioTrack children + +```ts +interface OtioStack +``` + +### `OtioTimeline` + +`interface` — Define the structure of a timeline with metadata, tracks, and global start time in OTIO format + +```ts +interface OtioTimeline +``` + +### `OtioTimeRange` + +`interface` — Define a time range with a start time and duration using OtioRationalTime values + +```ts +interface OtioTimeRange +``` + +### `OtioTrack` + +`interface` — Define a track containing video or audio clips with metadata and child elements + +```ts +interface OtioTrack +``` + +### `parseSequenceOperations` + +`function` — Shape-gate untrusted JSON (a product's `onApplyOperations` route body) into `SequenceOperation[]` BEFORE `validateSequenceOperations` sees it. + +```ts +(input: unknown) => SequenceOperation[] +``` + +### `PlaceClipOperation` + +`interface` — Define an operation to place a media clip with timing, track, and playback options + +```ts +interface PlaceClipOperation +``` + +### `planLanguageFanout` + +`function` — Plan which caption languages to generate: normalized, deduped (first occurrence wins), source excluded. + +```ts +(opts: LanguageFanoutOptions) => string[] +``` + +### `QueueExportOperation` + +`interface` — Define the structure for a queue export operation with format and optional metadata + +```ts +interface QueueExportOperation +``` + +### `resolveCaptionPlacement` + +`function` — Caption bounds. + +```ts +(timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext, targetTrackId: string | nul… +``` + +### `resolveCaptionTarget` + +`function` — Target caption track for an `add_caption`. + +```ts +(timeline: SequenceTimeline, operation: AddCaptionOperation) => CaptionTargetResolution +``` + +### `resolvePlaceClipTrack` + +`function` — Target track for a `place_clip`. + +```ts +(timeline: SequenceTimeline, operation: PlaceClipOperation) => SequenceTrack +``` + +### `secondsToFrames` + +`function` — Convert seconds to the nearest whole number of frames based on frames per second + +```ts +(seconds: number, fps: number) => number +``` + +### `SEQUENCE_EXPORT_FORMATS` + +`const` — Define supported export formats for sequence outputs including video, subtitle, and metadata types + +```ts +readonly ["mp4", "otio", "xml", "edl", "vtt", "srt", "contact_sheet"] +``` + +### `SEQUENCE_MCP_TOOLS` + +`const` — Resolve an array of immutable sequence MCP tool definitions for timeline and frame operations + +```ts +readonly SequenceMcpToolDefinition[] +``` + +### `SEQUENCE_MEDIA_KINDS` + +`const` — Define the allowed media kinds for sequences including video, image, and audio + +```ts +readonly ["video", "image", "audio"] +``` + +### `SEQUENCE_OPERATION_TYPES` + +`const` — List all valid sequence operation types used in editing workflows + +```ts +readonly ("place_clip" | "add_caption" | "move_clip" | "trim_clip" | "split_clip" | "set_clip_text" | "set_clip_disable… +``` + +### `SEQUENCE_TRACK_KINDS` + +`const` — Define immutable sequence track kinds for video, audio, caption, reference, and agent + +```ts +readonly ["video", "audio", "caption", "reference", "agent"] +``` + +### `SequenceApplyResult` + +`type` — The entity an operation changed, for the MCP layer to serialize back to the agent. + +```ts +type SequenceApplyResult +``` + +### `SequenceClip` + +`interface` — Define properties for a media sequence clip including timing, source, track, and caption details + +```ts +interface SequenceClip +``` + +### `SequenceClipMedia` + +`interface` — Resolved playable media behind a clip. + +```ts +interface SequenceClipMedia +``` + +### `SequenceClipPatch` + +`interface` — Define optional properties to update or patch a sequence clip's attributes in a timeline + +```ts +interface SequenceClipPatch +``` + +### `SequenceDecision` + +`interface` — One entry in the sequence's decision log — human edits, agent proposals, agent edits, exports, and notes all land here so the edit history is a single auditable lane. + +```ts +interface SequenceDecision +``` + +### `SequenceExportFormat` + +`type` — Define export formats available for sequence data including video, subtitle, and metadata types + +```ts +type SequenceExportFormat +``` + +### `SequenceExportRecord` + +`interface` — Describe a record representing the export details and status of a sequence + +```ts +interface SequenceExportRecord +``` + +### `SequenceExportStatus` + +`type` — Represent export status of a sequence as queued, processing, completed, failed, or cancelled + +```ts +type SequenceExportStatus +``` + +### `SequenceFrameSnapshot` + +`interface` — What is on screen/audible at a single frame — the answer shape for "what is happening at 0:34". + +```ts +interface SequenceFrameSnapshot +``` + +### `SequenceMcpToolDefinition` + +`interface` — Define a tool with metadata and a run method for processing input within a specific environment + +```ts +interface SequenceMcpToolDefinition +``` + +### `SequenceMcpToolEnv` + +`interface` — Everything one tool invocation needs. + +```ts +interface SequenceMcpToolEnv +``` + +### `SequenceMediaKind` + +`type` — Define media types allowed in a sequence including video, image, and audio + +```ts +type SequenceMediaKind +``` + +### `SequenceMeta` + +`interface` — Describe metadata and properties of a media sequence including dimensions, duration, and status + +```ts +interface SequenceMeta +``` + +### `SequenceOperation` + +`type` — Represent sequence editing actions for manipulating clips, tracks, captions, and exports + +```ts +type SequenceOperation +``` + +### `SequenceOperationContext` + +`interface` — Editor/agent context an operation is resolved against. + +```ts +interface SequenceOperationContext +``` + +### `SequenceOperationType` + +`type` — Extract the type of operation from a sequence operation object + +```ts +type SequenceOperationType +``` + +### `SequencePlan` + +`interface` — A batch of operations with the agent's stated intent — the decision-log unit for agent edits. + +```ts +interface SequencePlan +``` + +### `SEQUENCES_MCP_PROTOCOL_VERSIONS` + +`const` — Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server. + +```ts +readonly ["2025-06-18", "2025-03-26", "2024-11-05"] +``` + +### `SequencesMcpServerInfo` + +`interface` — Describe server information including name and version for Sequences MCP integration + +```ts +interface SequencesMcpServerInfo +``` + +### `SequenceStatus` + +`type` — Define sequence status as one of the specific lifecycle stages draft, active, exporting, or archived + +```ts +type SequenceStatus +``` + +### `SequenceStore` + +`interface` — Manage sequences by providing methods to get timelines, clips, and modify tracks and clips + +```ts +interface SequenceStore +``` + +### `SequenceStoreScope` + +`interface` — Per-request scope a product binds when constructing its store. + +```ts +interface SequenceStoreScope +``` + +### `SequenceTimeline` + +`interface` — The full timeline aggregate — what `get_timeline_state` returns and what every operation validates against. + +```ts +interface SequenceTimeline +``` + +### `SequenceTrack` + +`interface` — Define properties and state for a sequence track including id, kind, name, order, and flags + +```ts +interface SequenceTrack +``` + +### `SequenceTrackKind` + +`type` — Track kinds. + +```ts +type SequenceTrackKind +``` + +### `SetClipDisabledOperation` + +`interface` — Define an operation to enable or disable a clip by its identifier + +```ts +interface SetClipDisabledOperation +``` + +### `SetClipTextOperation` + +`interface` — Resolve an operation to set clipboard text with optional language and clip identifier + +```ts +interface SetClipTextOperation +``` + +### `snapshotFrame` + +`function` — Resolve everything active at one frame — the core of `get_frame_at_time`. + +```ts +(timeline: SequenceTimeline, frame: number) => SequenceFrameSnapshot +``` + +### `SplitClipOperation` + +`interface` — Split a clip at a specified frame inside the clip to create two separate segments + +```ts +interface SplitClipOperation +``` + +### `TimelineClipBounds` + +`interface` — Define the start frame and duration in frames for a timeline clip's bounds + +```ts +interface TimelineClipBounds +``` + +### `TimelineInterval` + +`interface` — Define a time range with inclusive start and end frame numbers + +```ts +interface TimelineInterval +``` + +### `trackIntervals` + +`function` — Occupied intervals on one track, for placement collision checks. + +```ts +(timeline: SequenceTimeline, trackId: string) => TimelineInterval[] +``` + +### `TranscriptSegment` + +`interface` — Server twin of `TranscriptionSegment` (../sequences-react/contracts) — structurally identical so react-side transcription output feeds `buildCaptionChunks` without mapping. + +```ts +interface TranscriptSegment +``` + +### `TrimClipOperation` + +`interface` — Define an operation to trim a clip by adjusting its start, duration, and optional source in/out points + +```ts +interface TrimClipOperation +``` + +### `validateAddCaption` + +`function` — Validate the parameters and context of an AddCaptionOperation within a sequence timeline + +```ts +(timeline: SequenceTimeline, operation: AddCaptionOperation, ctx: SequenceOperationContext) => void +``` + +### `validateCreateTrack` + +`function` — Validate that a CreateTrackOperation has a supported kind and a non-empty name + +```ts +(operation: CreateTrackOperation) => void +``` + +### `validateDeleteClip` + +`function` — Validate that the clip to delete exists and is mutable in the given timeline + +```ts +(timeline: SequenceTimeline, operation: DeleteClipOperation) => void +``` + +### `validateExtendSequence` + +`function` — Validate that the extend sequence operation has a positive duration and exceeds the last clip end frame + +```ts +(timeline: SequenceTimeline, operation: ExtendSequenceOperation) => void +``` + +### `validateMoveClip` + +`function` — Validate that a clip move operation is within bounds and targets a compatible unlocked track + +```ts +(timeline: SequenceTimeline, operation: MoveClipOperation) => void +``` + +### `validatePlaceClip` + +`function` — Validate the properties and constraints of a PlaceClipOperation within a SequenceTimeline + +```ts +(timeline: SequenceTimeline, operation: PlaceClipOperation) => void +``` + +### `validateQueueExport` + +`function` — Validate that the queue export operation uses a supported export format + +```ts +(operation: QueueExportOperation) => void +``` + +### `validateSequenceOperation` + +`function` — Validate a sequence operation against the timeline and context to ensure correctness + +```ts +(timeline: SequenceTimeline, operation: SequenceOperation, ctx: SequenceOperationContext) => void +``` + +### `validateSequenceOperations` + +`function` — Validate each operation in a sequence against the timeline and context, throwing detailed errors on failure + +```ts +(timeline: SequenceTimeline, operations: SequenceOperation[], ctx: SequenceOperationContext) => void +``` + +### `validateSetClipDisabled` + +`function` — Validate that the clip can be disabled within the given timeline and operation constraints + +```ts +(timeline: SequenceTimeline, operation: SetClipDisabledOperation) => void +``` + +### `validateSetClipText` + +`function` — Validate that a SetClipTextOperation targets a caption clip with non-empty text and valid language tag + +```ts +(timeline: SequenceTimeline, operation: SetClipTextOperation) => void +``` + +### `validateSplitClip` + +`function` — Validate that a split operation on a clip is within valid frame boundaries and conditions + +```ts +(timeline: SequenceTimeline, operation: SplitClipOperation) => void +``` + +### `validateTrimClip` + +`function` — Validate that a trim clip operation respects timeline bounds and source frame constraints + +```ts +(timeline: SequenceTimeline, operation: TrimClipOperation) => void +``` + + +## `./sequences-react` + +Source: `src/sequences-react/index.ts` · depends on `brand`, `sequences` + +### `addCaptionCommand` + +`function` — Resolve a command to add a caption to a specified caption track within a timeline + +```ts +(input: AddCaptionInput) => TimelineCommand +``` + +### `AddCaptionInput` + +`interface` — Define input parameters for adding a caption clip to a sequence timeline + +```ts +interface AddCaptionInput +``` + +### `applySnap` + +`function` — Nearest candidate wins; ties keep the first candidate in `points` order (sorted by frame from `collectSnapPoints`, so the lower frame). + +```ts +(frame: number, points: SnapPoint[], opts: ApplySnapOptions) => SnapResult +``` + +### `ApplySnapOptions` + +`interface` — Define options to configure snapping behavior including zoom, threshold, and exclusion criteria + +```ts +interface ApplySnapOptions +``` + +### `AudioBufferLike` + +`interface` — Structural slice of Web Audio's AudioBuffer so peak math runs on synthetic fixtures in tests and on real decoded buffers in the browser. + +```ts +interface AudioBufferLike +``` + +### `BrandMark` + +`function` + +```ts +({ size, className }: BrandMarkProps) => Element +``` + +### `BrandMarkProps` + +`interface` + +```ts +interface BrandMarkProps +``` + +### `captionFontPx` + +`function` — Caption type scales with the rendered frame, floored so captions stay legible on small previews. + +```ts +(canvasCssHeight: number) => number +``` + +### `chooseMoveSnap` + +`function` — A move drag snaps whichever clip edge lands closest to a snap point: the start edge directly, or the end edge re-expressed as a start. + +```ts +(input: { candidateStartFrame: number; durationFrames: number; startSnap: SnapResult; endSnap: SnapResult; }) => { star… +``` + +### `classifyMediaUrl` + +`function` — Extension-based kind classification; 'unknown' defers to a HEAD content-type probe at draw time. + +```ts +(url: string) => "image" | "unknown" | "video" +``` + +### `clipChipGeometry` + +`function` — Pixel geometry for a clip chip; width floors at 2px so 1-frame clips stay grabbable. + +```ts +(input: { startFrame: number; durationFrames: number; zoom: number; }) => { left: number; width: number; } +``` + +### `ClipIdResolver` + +`type` — Live local→server clip-id lookup (see module header). + +```ts +type ClipIdResolver +``` + +### `ClipMoveCommit` + +`interface` + +```ts +interface ClipMoveCommit +``` + +### `ClipTrimCommit` + +`interface` + +```ts +interface ClipTrimCommit +``` + +### `collectSnapPoints` + +`function` — Disabled clips still occupy timeline space visually, so their edges remain snap targets. + +```ts +(timeline: SequenceTimeline, playheadFrame: number) => TimelineSnapPoint[] +``` + +### `COMMAND_HISTORY_LIMIT` + +`const` — Oldest entries are dropped past this bound; redo is cleared on execute. + +```ts +200 +``` + +### `CommandStack` + +`interface` — Manage and track command execution with undo, redo, state subscription, and timeline reset capabilities + +```ts +interface CommandStack +``` + +### `compositeCommand` + +`function` + +```ts +(label: string, commands: TimelineCommand[]) => TimelineCommand +``` + +### `computeWaveform` + +`function` — One max-abs peak per bucket, taken across all channels. + +```ts +(buffer: AudioBufferLike, bucketCount: number) => WaveformData +``` + +### `containFitRect` + +`function` — Object-fit 'contain' placement: preserve aspect ratio, fit entirely inside `dest`, center the residual space. + +```ts +(source: { width: number; height: number; }, dest: FrameRect) => FrameRect +``` + +### `createCommandStack` + +`function` — Create a command stack managing undo and redo operations for a given timeline + +```ts +(initial: SequenceTimeline) => CommandStack +``` + +### `createImageFrameProvider` + +`function` — Stills behind the same `VideoFrameProvider` seam — `sourceSeconds` is validated for contract parity but does not affect the painted pixels. + +```ts +(opts?: { maxElements?: number | undefined; } | undefined) => VideoFrameProvider +``` + +### `createMediaElementPool` + +`function` — LRU pool of media elements keyed by URL. + +```ts +(opts: { maxElements: number; create(url: string): T; destroy(element: T, url: string): void; }) => MediaElementPool… +``` + +### `createPlaybackClock` + +`function` — Create a playback clock that manages frame timing and playback state based on configuration + +```ts +(config: PlaybackClockConfig) => PlaybackClock +``` + +### `createVideoElementFrameProvider` + +`function` — The baseline provider `TimelineEditorProps.frameProvider` defaults to. + +```ts +(opts?: { maxElements?: number | undefined; } | undefined) => VideoFrameProvider +``` + +### `createWhisperTranscriptionProvider` + +`function` — Create a Whisper-based transcription provider with optional model configuration + +```ts +(opts?: { model?: string | undefined; } | undefined) => TranscriptionProvider +``` + +### `createZoomMath` + +`function` — Create a ZoomMath object that validates config and calculates zoom ratio within bounds + +```ts +(config: ZoomMathConfig) => ZoomMath +``` + +### `DEFAULT_MAX_MEDIA_ELEMENTS` + +`const` — Define the default maximum number of media elements allowed in a collection + +```ts +4 +``` + +### `DEFAULT_TIMELINE_LABELS` + +`const` — Provide default labels and accessibility text for timeline editor UI elements + +```ts +Required +``` + +### `DEFAULT_WHISPER_MODEL` + +`const` — Provide the default Whisper model identifier for ONNX community large v3 turbo + +```ts +"onnx-community/whisper-large-v3-turbo" +``` + +### `deleteClipCommand` + +`function` — Snapshots the full clip at construction so undo restores it exactly. + +```ts +(input: DeleteClipInput) => TimelineCommand +``` + +### `DeleteClipInput` + +`interface` — Define input parameters required to delete a clip from a sequence timeline + +```ts +interface DeleteClipInput +``` + +### `drawWaveform` + +`function` — Paint mirrored peak bars centered on the rect's midline. + +```ts +(ctx: CanvasRenderingContext2D, data: WaveformData, rect: { x: number; y: number; width: number; height: number; }, col… +``` + +### `EditorTimelineState` + +`interface` — Local editor state — the timeline plus volatile view state the server never sees. + +```ts +interface EditorTimelineState +``` + +### `FrameRect` + +`interface` — Define a rectangular frame with position and size properties x, y, width, and height + +```ts +interface FrameRect +``` + +### `framesFromPixelDelta` + +`function` — Quantize a horizontal pointer delta to whole frames at the current zoom. + +```ts +(deltaX: number, zoom: number) => number +``` + +### `frameToPixel` + +`function` — Frame → viewport-relative pixel x. + +```ts +(frame: number, view: ViewportTransform) => number +``` + +### `letterboxRect` + +`function` — Contain-fit a media aspect inside a container, centered with letterbox or pillarbox bars. + +```ts +(input: { containerWidth: number; containerHeight: number; mediaWidth: number; mediaHeight: number; }) => LetterboxRect +``` + +### `LetterboxRect` + +`interface` + +```ts +interface LetterboxRect +``` + +### `loadWaveform` + +`function` — Fetch + decode `mediaUrl` and bucket it. + +```ts +(mediaUrl: string, bucketCount: number, ctx?: AudioContext | undefined) => Promise +``` + +### `mapWhisperOutput` + +`function` — Map whisper chunk output to contract segments. + +```ts +(output: WhisperOutput | WhisperOutput[], durationSeconds: number, mediaUrl: string) => TranscriptionSegment[] +``` + +### `MediaElementPool` + +`interface` — Manage a pool of media elements to acquire, check, count, and dispose resources efficiently + +```ts +interface MediaElementPool +``` + +### `mixdownToMono` + +`function` — Mean-mixdown to mono. + +```ts +(buffer: AudioBufferLike) => Float32Array +``` + +### `moveClipCommand` + +`function` — Drag-move. + +```ts +(input: MoveClipInput) => TimelineCommand +``` + +### `MoveClipInput` + +`interface` — Define input parameters to move a clip within a timeline including optional track and resolver + +```ts +interface MoveClipInput +``` + +### `MoveDragInput` + +`interface` + +```ts +interface MoveDragInput +``` + +### `moveDragStartFrame` + +`function` — New start frame for a move drag, clamped so the clip stays fully inside the sequence. + +```ts +(input: MoveDragInput) => number +``` + +### `needsSeek` + +`function` — Determine if seeking is required based on the difference between current and target times + +```ts +(currentTimeSeconds: number, targetSeconds: number) => boolean +``` + +### `pixelToFrame` + +`function` — Viewport-relative pixel x → integer frame. + +```ts +(pixel: number, view: ViewportTransform) => number +``` + +### `placeClipCommand` + +`function` — Resolve and validate clip placement parameters to create a timeline command + +```ts +(input: PlaceClipInput) => TimelineCommand +``` + +### `PlaceClipInput` + +`interface` — Define input parameters required to place a clip within a sequence timeline + +```ts +interface PlaceClipInput +``` + +### `PlaybackClock` + +`interface` — rAF-driven playback clock. + +```ts +interface PlaybackClock +``` + +### `PlaybackClockConfig` + +`interface` — Define configuration settings for playback clock including frames per second and total duration frames + +```ts +interface PlaybackClockConfig +``` + +### `PooledElementLease` + +`interface` — Manage a leased element from a pool and release it to enable LRU eviction + +```ts +interface PooledElementLease +``` + +### `PreviewCanvas` + +`function` + +```ts +({ timeline, clock, frameProvider, className }: PreviewCanvasProps) => Element +``` + +### `PreviewCanvasProps` + +`interface` + +```ts +interface PreviewCanvasProps +``` + +### `SEEK_TIMEOUT_MS` + +`const` — A seek that hasn't fired `seeked` after this long is a decode failure — the draw REJECTS rather than painting whatever frame happens to be up. + +```ts +5000 +``` + +### `SEEK_TOLERANCE_SECONDS` + +`const` — Half a frame at 30fps. + +```ts +number +``` + +### `selectTickStepSeconds` + +`function` — Smallest ruler step whose major ticks sit at least `minSpacingPx` apart at the current zoom; past the table it grows in whole minutes so labels never collide at extreme zoom-out. + +```ts +(input: { zoom: number; fps: number; minSpacingPx?: number | undefined; }) => number +``` + +### `SEQUENCE_MEDIA_DRAG_TYPE` + +`const` + +```ts +"application/x-sequence-media" +``` + +### `SequenceTimelineEditorLazy` + +`function` + +```ts +LazyExoticComponent<(props: TimelineEditorProps) => Element> +``` + +### `setClipTextCommand` + +`function` — Requires the clip to already carry text: `set_clip_text` has no "create" semantics in the union, and an inverse for a text-less clip would have to invent an empty string. + +```ts +(input: SetClipTextInput) => TimelineCommand +``` + +### `SetClipTextInput` + +`interface` — Define input parameters for setting text and optional language on a specific clip in a timeline + +```ts +interface SetClipTextInput +``` + +### `SnapIndicatorLine` + +`function` + +```ts +({ point, zoom }: SnapIndicatorLineProps) => Element | null +``` + +### `SnapIndicatorLineProps` + +`interface` + +```ts +interface SnapIndicatorLineProps +``` + +### `snapPixel` + +`function` — Snap a CSS-pixel value to the device pixel grid so 1px timeline rules render crisp on fractional-DPR displays. + +```ts +(value: number, devicePixelRatio: number) => number +``` + +### `SnapPoint` + +`interface` — Define a point in a timeline where snapping occurs based on frame and kind + +```ts +interface SnapPoint +``` + +### `SnapResult` + +`interface` — Describe the result of snapping a point to a frame including success status and snapped point details + +```ts +interface SnapResult +``` + +### `splitClipCommand` + +`function` — Source mapping is 1:1 frames (no rate ramps in the model), so the tail's source in-point is the head's in-point advanced by the head duration. + +```ts +(input: SplitClipInput) => TimelineCommand +``` + +### `SplitClipInput` + +`interface` — Define input parameters for splitting a clip at a specific frame within a timeline + +```ts +interface SplitClipInput +``` + +### `TimelineClipChip` + +`function` + +```ts +(props: TimelineClipChipProps) => Element +``` + +### `TimelineClipChipProps` + +`interface` + +```ts +interface TimelineClipChipProps +``` + +### `TimelineCommand` + +`interface` — One undoable edit. + +```ts +interface TimelineCommand +``` + +### `TimelineEditor` + +`function` + +```ts +(props: TimelineEditorProps) => Element +``` + +### `TimelineEditorLabels` + +`interface` — Overridable copy for the editor's product-facing labels. + +```ts +interface TimelineEditorLabels +``` + +### `TimelineEditorProps` + +`interface` — Define properties and callbacks for editing and applying operations on a sequence timeline + +```ts +interface TimelineEditorProps +``` + +### `TimelineEmptyState` + +`function` + +```ts +(props: TimelineEmptyStateProps) => Element +``` + +### `TimelineEmptyStateProps` + +`interface` + +```ts +interface TimelineEmptyStateProps +``` + +### `TimelineGhostLanes` + +`function` + +```ts +({ laneWidth, videoLabel, captionLabel }: TimelineGhostLanesProps) => Element +``` + +### `TimelineGhostLanesProps` + +`interface` + +```ts +interface TimelineGhostLanesProps +``` + +### `TimelinePlayhead` + +`function` + +```ts +({ frame, zoom }: TimelinePlayheadProps) => Element +``` + +### `TimelinePlayheadProps` + +`interface` — Playhead overlay for the track area: a full-height line with a triangular cap. + +```ts +interface TimelinePlayheadProps +``` + +### `TimelineRuler` + +`function` + +```ts +({ fps, durationFrames, zoom, onScrub }: TimelineRulerProps) => Element +``` + +### `TimelineRulerProps` + +`interface` + +```ts +interface TimelineRulerProps +``` + +### `TimelineSmallScreenGate` + +`function` + +```ts +({ labels }: TimelineSmallScreenGateProps) => Element +``` + +### `TimelineSmallScreenGateProps` + +`interface` + +```ts +interface TimelineSmallScreenGateProps +``` + +### `TimelineSnapPoint` + +`interface` — Snap point with its owning clip when it came from one, so a drag can exclude the dragged clip's own edges. + +```ts +interface TimelineSnapPoint +``` + +### `TimelineTrackRow` + +`function` + +```ts +(props: TimelineTrackRowProps) => Element +``` + +### `TimelineTrackRowProps` + +`interface` + +```ts +interface TimelineTrackRowProps +``` + +### `toggleClipDisabledCommand` + +`function` — The target value is captured at construction (not flipped at execute time) so redo after a rebase applies the same durable op the stack already emitted. + +```ts +(input: ToggleClipDisabledInput) => TimelineCommand +``` + +### `ToggleClipDisabledInput` + +`interface` — Define input parameters to toggle the disabled state of a clip within a timeline + +```ts +interface ToggleClipDisabledInput +``` + +### `TranscriptionProvider` + +`interface` — Whisper-in-a-worker contract. + +```ts +interface TranscriptionProvider +``` + +### `TranscriptionSegment` + +`interface` — Represent a segment of transcription with text and start and end times in seconds + +```ts +interface TranscriptionSegment +``` + +### `trimClipCommand` + +`function` — Trim is strict where move is forgiving: the caller (a trim handle) already knows both edges, so out-of-bounds input is a bug, not a gesture. + +```ts +(input: TrimClipInput) => TimelineCommand +``` + +### `TrimClipInput` + +`interface` — Define input parameters for trimming a clip within a sequence timeline + +```ts +interface TrimClipInput +``` + +### `trimEndDrag` + +`function` — Tail trim: start is invariant; duration is bounded below by the minimum clip length and above by both the sequence end and the remaining source material past the in-point. + +```ts +(input: TrimEndDragInput) => { durationFrames: number; } +``` + +### `TrimEndDragInput` + +`interface` + +```ts +interface TrimEndDragInput +``` + +### `trimStartDrag` + +`function` — Head trim: the clip END is invariant; start slides between two hard walls — it cannot reveal media before source frame 0 (sourceInFrame >= 0) and cannot pass within MIN_SEQUENCE_CLIP_FRAMES of the en… + +```ts +(input: TrimStartDragInput) => TrimStartDragResult +``` + +### `TrimStartDragInput` + +`interface` + +```ts +interface TrimStartDragInput +``` + +### `TrimStartDragResult` + +`interface` + +```ts +interface TrimStartDragResult +``` + +### `VideoFrameProvider` + +`interface` — Supplies decoded frames for preview rendering. + +```ts +interface VideoFrameProvider +``` + +### `ViewportTransform` + +`interface` — Horizontal viewport: zoom in pixels per frame, scrollLeft in pixels. + +```ts +interface ViewportTransform +``` + +### `WaveformData` + +`interface` — min/max sample peaks per pixel bucket for waveform rendering. + +```ts +interface WaveformData +``` + +### `WhisperOutput` + +`interface` — Define the structure for transcribed text output with optional segmented chunks + +```ts +interface WhisperOutput +``` + +### `ZoomControl` + +`function` + +```ts +({ zoomMath, zoom, onZoomChange, fitZoom }: ZoomControlProps) => Element +``` + +### `ZoomControlProps` + +`interface` + +```ts +interface ZoomControlProps +``` + +### `ZoomMath` + +`interface` — Exponential zoom mapping so the slider feels linear across a 10x+ range. + +```ts +interface ZoomMath +``` + +### `ZoomMathConfig` + +`interface` — Define configuration settings for minimum and maximum zoom levels + +```ts +interface ZoomMathConfig +``` + + +## `./sequences/drizzle` + +Source: `src/sequences/drizzle.ts` · depends on `tools`, `web` + +### `createDrizzleSequenceStore` + +`function` — Create a sequence store scoped to a specific sequence and workspace with database access and media resolution + +```ts +(options: CreateDrizzleSequenceStoreOptions) => SequenceStore +``` + +### `CreateDrizzleSequenceStoreOptions` + +`interface` — Define options for creating a Drizzle sequence store including database, tables, scope, and media resolver + +```ts +interface CreateDrizzleSequenceStoreOptions +``` + +### `createSequenceTables` + +`function` — Build SQLite sequence tables with defined columns and relationships based on provided options + +```ts +(opts: CreateSequenceTablesOptions) => { sequences: SQLiteTableWithColumns<{ name: "sequence"; schema: undefined; colum… +``` + +### `CreateSequenceTablesOptions` + +`interface` — Define options for creating sequence-related database tables including workspace and user tables + +```ts +interface CreateSequenceTablesOptions +``` + +### `SequenceClipRow` + +`type` — Resolve the selected fields of sequence clips from the sequence tables data structure + +```ts +type SequenceClipRow +``` + +### `SequenceDatabase` + +`type` — Any SQLite drizzle database — `any` erases the driver-specific run-result and schema generics so better-sqlite3, D1, and libsql handles all fit. + +```ts +type SequenceDatabase +``` + +### `SequenceDecisionRow` + +`type` — Resolve a sequence decision row from the sequenceDecisions table data + +```ts +type SequenceDecisionRow +``` + +### `SequenceExportRow` + +`type` — Resolve a row type representing exported sequence data from sequenceExports table + +```ts +type SequenceExportRow +``` + +### `SequenceMediaResolver` + +`type` — Resolves product-specific media (generation rows, asset rows) for a batch of clip rows. + +```ts +type SequenceMediaResolver +``` + +### `SequenceParentTable` + +`type` — A product table referenced by FK — only the `id` column is touched. + +```ts +type SequenceParentTable +``` + +### `SequenceRow` + +`type` — Resolve a sequence row by inferring the selected fields from the sequences table + +```ts +type SequenceRow +``` + +### `SequenceTables` + +`type` — Resolve sequence tables by invoking the createSequenceTables factory function + +```ts +type SequenceTables +``` + +### `SequenceTrackRow` + +`type` — Resolve the selected sequence track row from the sequenceTracks table + +```ts +type SequenceTrackRow +``` + + +## `./skills` + +Source: `src/skills/index.ts` + +### `assertSkillDeliveryDisjoint` + +`function` — Throw when the same skill id is delivered both `inline` and `mounted` — the agent would see it twice (once in the prompt body, once as a mounted file it's told to go read), doubling prompt bytes and… + +```ts +(inlineIds: Iterable, mountedIds: Iterable) => void +``` + +### `ComposedSkills` + +`interface` — The output of {@link composeSkills}: the refs to attach to `resources.skills` (empty for `inline`) and the prompt section to fold into the system prompt (already carries its own leading `\n\n`, or `'… + +```ts +interface ComposedSkills +``` + +### `composeShellResources` + +`function` — Compose every mount channel into one `resources.files`-ready array. + +```ts +(input: ComposeShellResourcesInput) => AgentProfileFileMount[] +``` + +### `ComposeShellResourcesInput` + +`interface` — Inputs to {@link composeShellResources}. + +```ts +interface ComposeShellResourcesInput +``` + +### `composeSkills` + +`function` — Build the {@link ComposedSkills} for one delivery mode. + +```ts +(input: ComposeSkillsInput) => ComposedSkills +``` + +### `ComposeSkillsInput` + +`interface` — Inputs to {@link composeSkills}. + +```ts +interface ComposeSkillsInput +``` + +### `CorpusEntry` + +`interface` — One markdown document discovered from the corpus. + +```ts +interface CorpusEntry +``` + +### `CorpusLoadResult` + +`interface` — Outcome of {@link loadMarkdownCorpus}: the entries plus which path produced them, so a caller can fail loud when both are empty rather than silently mounting nothing. + +```ts +interface CorpusLoadResult +``` + +### `corpusSkills` + +`function` — Project corpus entries onto SDK file mounts at a relative path under `/`. + +```ts +(corpus: CorpusEntry[], anchor: string) => AgentProfileFileMount[] +``` + +### `GlobModules` + +`type` — A Vite eager `?raw` glob result: glob key -> raw file body. + +```ts +type GlobModules +``` + +### `LoadCorpusOptions` + +`interface` — Options for {@link loadMarkdownCorpus}. + +```ts +interface LoadCorpusOptions +``` + +### `loadMarkdownCorpus` + +`function` — Load a markdown corpus, preferring a Vite glob-result map and falling back to a Node fs walk. + +```ts +(options: LoadCorpusOptions, importMetaUrl?: string | undefined) => CorpusLoadResult +``` + +### `mergeComposedSkills` + +`function` — Combine multiple {@link ComposedSkills} batches (e.g. + +```ts +(batches: ComposedSkills[]) => ComposedSkills +``` + +### `parseCorpusSkills` + +`function` — Map a loaded corpus (see {@link loadMarkdownCorpus}) onto `SkillEntry`s, using each entry's `id` as the fallback when its `SKILL.md` carries no frontmatter `id` of its own. + +```ts +(corpus: CorpusEntry[]) => SkillEntry[] +``` + +### `ParsedSkill` + +`interface` — The result of {@link parseSkillFrontmatter}: the parsed fields, the body with the frontmatter block stripped, and the original untouched text. + +```ts +interface ParsedSkill +``` + +### `parseSkillFrontmatter` + +`function` — THE one `SKILL.md` frontmatter parser — hand-rolled, no YAML dependency. + +```ts +(raw: string) => ParsedSkill +``` + +### `registrySkills` + +`function` — Project the registry's free-tier (or `tier`-matched) entries onto SDK file mounts at the harness skill-discovery path. + +```ts +(registry: SkillEntry[], tier?: string) => AgentProfileFileMount[] +``` + +### `renderInlineSkills` + +`function` — Render every (tier-filtered) skill's full body inline into the prompt — the `inline` delivery mode. + +```ts +(input: RenderInlineSkillsInput) => string +``` + +### `RenderInlineSkillsInput` + +`interface` — Inputs to {@link renderInlineSkills}. + +```ts +interface RenderInlineSkillsInput +``` + +### `renderSkillIndex` + +`function` — Render a one-line-per-skill INDEX (name, description, and the path to read the full body) — the `mounted` delivery mode's prompt section, paired with {@link skillRefs} putting the actual files on `re… + +```ts +(input: RenderSkillIndexInput) => string +``` + +### `RenderSkillIndexInput` + +`interface` — Inputs to {@link renderSkillIndex}. + +```ts +interface RenderSkillIndexInput +``` + +### `SkillDeliveryMode` + +`type` — How a skill reaches the agent: `inline` renders its full body into the system prompt; `mounted` puts it on the typed `resources.skills` channel and renders only an index line. + +```ts +type SkillDeliveryMode +``` + +### `SkillEntry` + +`interface` — A hand-authored, tier-gated installable skill. + +```ts +interface SkillEntry +``` + +### `skillEntryFromMarkdown` + +`function` — Build a {@link SkillEntry} from a raw `SKILL.md` body. + +```ts +(raw: string, fallbackId?: string | undefined) => SkillEntry +``` + +### `SkillFrontmatter` + +`interface` — Fields a `SKILL.md` frontmatter block may declare. + +```ts +interface SkillFrontmatter +``` + +### `skillMountPath` + +`function` — Harness skill-discovery path the Claude Code backend reads natively. + +```ts +(id: string) => string +``` + +### `skillRefs` + +`function` — Project skills onto the typed `resources.skills` channel (`AgentProfileResourceRef[]`), tier-filtered (same `s.tier === tier` semantics as {@link registrySkills}) when `opts.tier` is given, sorted by… + +```ts +(skills: SkillEntry[], opts?: { tier?: string | undefined; }) => AgentProfileResourceRef[] +``` + + +## `./skills-placement` + +Source: `src/skills-placement/index.ts` · depends on `harness`, `skills` + +### `ComposedSkills` + +`interface` — The output of {@link composeSkills}: the refs to attach to `resources.skills` (empty for `inline`) and the prompt section to fold into the system prompt (already carries its own leading `\n\n`, or `'… + +```ts +interface ComposedSkills +``` + +### `composeSkillsForHarness` + +`function` — Compose {@link ComposedSkills} for `harness`: `mounted` delivery when the platform names a cwd skill dir for it, `inline` delivery (the automatic fallback that keeps every skill available on every ha… + +```ts +(input: ComposeSkillsForHarnessInput) => ComposedSkills +``` + +### `ComposeSkillsForHarnessInput` + +`interface` — Inputs to {@link composeSkillsForHarness}. + +```ts +interface ComposeSkillsForHarnessInput +``` + +### `resolveSkillDir` + +`function` — Resolve the cwd-relative skill dir `resources.skills` refs materialize into on `harness` — via the platform's `skillDirForHarness`. + +```ts +(harness: "opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi" | "hermes"… +``` + +### `SkillEntry` + +`interface` — A hand-authored, tier-gated installable skill. + +```ts +interface SkillEntry +``` + +### `unsupportedSkillHarnesses` + +`function` — Filter `harnesses` down to those with no mounted skill dir (deduped, first-seen order preserved) — the set that must fall back to `inline` delivery, or that a caller should warn about before offering… + +```ts +(harnesses: Iterable<"opencode" | "claude-code" | "nanoclaw" | "kimi-code" | "codex" | "amp" | "factory-droids" | "pi"… +``` + + +## `./store` + +Source: `src/store/index.ts` + +### `createDatabaseProvider` + +`function` — Create a swappable database provider. + +```ts +(options?: DatabaseProviderOptions) => DatabaseProvider +``` + +### `createInMemoryKV` + +`function` — In-memory {@link KVStore} — the portable vault backend for sandbox/eval runs. + +```ts +(initial?: Record | undefined) => KVStore +``` + +### `DatabaseProvider` + +`interface` — Swappable database provider — the seam that decouples the agent's persistence from any one driver. + +```ts +interface DatabaseProvider +``` + +### `DatabaseProviderOptions` + +`interface` — Define options for configuring database provider behavior including error messaging + +```ts +interface DatabaseProviderOptions +``` + +### `KVGetWithMetadataResult` + +`interface` — Resolve a key-value pair retrieval including its associated metadata and value + +```ts +interface KVGetWithMetadataResult +``` + +### `KVListResult` + +`interface` — Describe the result of listing keys with completion status and optional pagination cursor + +```ts +interface KVListResult +``` + +### `KVPutOptions` + +`interface` — Define options for storing a key-value pair with expiration and metadata settings + +```ts +interface KVPutOptions +``` + +### `KVStore` + +`interface` — Define a key-value store interface for asynchronous data retrieval, storage, deletion, and listing + +```ts +interface KVStore +``` + + +## `./stream` + +Source: `src/stream/index.ts` · depends on `interactions`, `plans` + +### `asRecord` + +`function` — Resolve an unknown value to a JsonRecord if it is a non-array object or return undefined + +```ts +(value: unknown) => JsonRecord | undefined +``` + +### `asString` + +`function` — Resolve a non-empty string from a value or return undefined + +```ts +(value: unknown) => string | undefined +``` + +### `attachmentPartKey` + +`function` — Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it. + +```ts +(path: string) => string +``` + +### `BufferedTurnEvent` + +`interface` — Represent a buffered turn event with a sequence number and serialized event data + +```ts +interface BufferedTurnEvent +``` + +### `BufferedTurnOptions` + +`interface` — Define options for buffering and flushing turn events with optional live client delivery and event coalescing + +```ts +interface BufferedTurnOptions +``` + +### `BufferedTurnTap` + +`interface` — A push-driven buffer for a turn whose producer the caller does NOT own. + +```ts +interface BufferedTurnTap +``` + +### `buildUserTextParts` + +`function` — Build an array of text parts with optional turn ID for user input + +```ts +(text: string, turnId: string | undefined) => JsonRecord[] +``` + +### `coalesceChatStreamEvents` + +`function` — Coalesce consecutive `message.part.updated` deltas for the SAME part into one event. + +```ts +(events: unknown[]) => unknown[] +``` + +### `coalesceDeltas` + +`function` — Merge consecutive text/reasoning deltas of the same type into one event. + +```ts +(events: unknown[]) => unknown[] +``` + +### `collapseRedundantTextParts` + +`function` — Collapses text-part artifacts of unstable upstream segment identity: the same text arriving under two keys (id-less delta stream, then an id-bearing snapshot) folds into two segments, and interleaved… + +```ts +(parts: JsonRecord[]) => JsonRecord[] +``` + +### `createBufferedTurnTap` + +`function` — The buffering core. + +```ts +(opts: BufferedTurnOptions) => BufferedTurnTap +``` + +### `createD1TurnEventStore` + +`function` — Resolve a TurnEventStore that appends and reads turn events using a D1-like database interface + +```ts +(db: D1LikeForTurns) => TurnEventStore +``` + +### `createMemoryTurnEventStore` + +`function` — In-memory store for tests and keyless local dev. + +```ts +() => TurnEventStore +``` + +### `D1LikeForTurns` + +`interface` — Minimal structural D1 contract (Cloudflare `D1Database` satisfies it). + +```ts +interface D1LikeForTurns +``` + +### `encodeEvent` + +`function` — Encode a StreamEvent object into a Uint8Array using the provided TextEncoder + +```ts +(encoder: TextEncoder, event: StreamEvent) => Uint8Array +``` + +### `finalizeAssistantParts` + +`function` — Resolve and clean up assistant parts by terminalizing and collapsing redundant segments + +```ts +(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[] +``` + +### `finalizePendingInteractionParts` + +`function` — Settles still-pending interaction parts at persist time. + +```ts +(parts: JsonRecord[], outcome: "answered" | "expired") => JsonRecord[] +``` + +### `getPartKey` + +`function` — Resolve a unique key string for a part based on its type and identifying properties + +```ts +(part: JsonRecord) => string +``` + +### `JsonRecord` + +`type` — Represent a JSON-compatible object with string keys and values of any type + +```ts +type JsonRecord +``` + +### `mergePersistedPart` + +`function` — Merge incoming JSON with existing persisted data, applying delta for text types when provided + +```ts +(existing: JsonRecord | undefined, incoming: JsonRecord, delta?: string | undefined) => JsonRecord +``` + +### `messageHasTurnId` + +`function` — Resolve whether a message contains any part with the specified turn ID + +```ts +(message: PersistedChatMessageForTurn, turnId: string) => boolean +``` + +### `MISSING_TOOL_TERMINAL_ERROR` + +`const` — Resolve errors when a tool fails to report a terminal result before the assistant turn ends + +```ts +"Tool did not report a terminal result before the assistant turn completed." +``` + +### `MISSING_TOOL_TERMINAL_REASON` + +`const` — Provide the reason identifier for a missing tool in the terminal environment + +```ts +"missing-tool-terminal" +``` + +### `normalizeClientTurnId` + +`function` — Normalize and validate a client turn ID string ensuring it meets format and length requirements + +```ts +(value: unknown) => string | undefined +``` + +### `normalizePersistedPart` + +`function` — Normalize a persisted part object by standardizing its structure and fields + +```ts +(rawPart: JsonRecord) => JsonRecord | null +``` + +### `normalizeTime` + +`function` — Resolve time properties from various keys into a normalized record with numeric start and end fields + +```ts +(value: unknown) => JsonRecord | undefined +``` + +### `normalizeToolEvent` + +`function` — Normalize tool-related events into a standardized message.part.updated format + +```ts +(event: StreamEvent) => StreamEvent +``` + +### `PersistedChatMessageForTurn` + +`interface` — Define the structure of a chat message stored for a specific conversation turn + +```ts +interface PersistedChatMessageForTurn +``` + +### `pumpBufferedTurn` + +`function` — Drive a turn to completion regardless of the live client, when you OWN the producer as an `AsyncIterable`. + +```ts +(opts: PumpBufferedTurnOptions) => Promise +``` + +### `PumpBufferedTurnOptions` + +`interface` — Define options to pump data from an asynchronous iterable source with buffered turn control + +```ts +interface PumpBufferedTurnOptions +``` + +### `replayTurnEvents` + +`function` — Yield buffered events after `fromSeq`, then keep polling while the turn is still 'running' until it completes, errors, or times out. + +```ts +(opts: ReplayTurnEventsOptions) => AsyncGenerator +``` + +### `ReplayTurnEventsOptions` + +`interface` — Define options for replaying turn events with control over sequence, polling, and timeout + +```ts +interface ReplayTurnEventsOptions +``` + +### `resolveChatTurn` + +`function` — Resolve a chat turn by determining message reuse and constructing user message parts + +```ts +(input: { existingMessages: PersistedChatMessageForTurn[]; userContent: string; turnId?: string | undefined; }) => Reso… +``` + +### `ResolvedChatTurn` + +`interface` — Represent a chat turn with resolved user message insertion and prior message context + +```ts +interface ResolvedChatTurn +``` + +### `resolveToolId` + +`function` — Resolve a unique tool identifier from various possible properties or generate a fallback ID + +```ts +(part: JsonRecord) => string +``` + +### `resolveToolName` + +`function` — Resolve the tool name from a JSON record using tool, name, or a default value + +```ts +(part: JsonRecord) => string +``` + +### `StreamEvent` + +`interface` — Define an event object carrying a type and optional JSON data payload + +```ts +interface StreamEvent +``` + +### `terminalizeDanglingAssistantToolUpdates` + +`function` — Finalizes, then folds each synthetic tool settlement back into `partMap` and returns just those updates — the shape a streaming loop needs to emit closing `message.part.updated` frames for tools the… + +```ts +(partOrder: string[], partMap: Map, finalText: string) => JsonRecord[] +``` + +### `terminalizeDanglingToolPart` + +`function` — Closes a tool part left `running` when a stream ended abnormally: settles it as a terminal `error` and stamps `state.metadata.terminalized` so the synthetic settlement is distinguishable from a real… + +```ts +(part: JsonRecord) => JsonRecord +``` + +### `terminalizeDanglingToolParts` + +`function` — Resolve dangling tool parts into terminal forms within the given JSON records array + +```ts +(parts: JsonRecord[]) => JsonRecord[] +``` + +### `TURN_EVENTS_MIGRATION_SQL` + +`const` — Schema for the D1 store — append to the product's migrations. + +```ts +"\nCREATE TABLE IF NOT EXISTS turn_events (\n turnId TEXT NOT NULL,\n seq INTEGER NOT NULL,\n event TEXT NOT NULL,\n PR… +``` + +### `TURN_STATUS_SCOPE_MIGRATION_SQL` + +`const` — For deployments whose `turn_status` table predates `scopeId`/`listRunning` — run once to add the column (the CREATE above already includes it for new deployments). + +```ts +"ALTER TABLE turn_status ADD COLUMN scopeId TEXT;" +``` + +### `TurnEventStore` + +`interface` — Manage and query turn events and their lifecycle statuses within a scoped event store + +```ts +interface TurnEventStore +``` + +### `TurnStatus` + +`type` — Resumable chat turns — the router-path answer to "streams resume on disconnect" (issue #27). + +```ts +type TurnStatus +``` + + +## `./studio` + +Source: `src/studio/index.ts` + +### `buildGenerationRequestBody` + +`function` — Build the request body object for a generation operation from provided fields + +```ts +(fields: GenerationRequestFields) => Record +``` + +### `buildPublishPackage` + +`function` — Build a PublishPackage object from caption, description, mentions, cadence, and destinations inputs + +```ts +({ caption, postDescription, mentions, cadence, destinations, }: { caption: string; postDescription: string; mentions:… +``` + +### `CADENCES` + +`const` — Provide an array of predefined cadence options for scheduling or approval processes + +```ts +string[] +``` + +### `DESTINATIONS` + +`const` — List available social media platforms with their publishing fields and provider identifiers + +```ts +PublishDestination[] +``` + +### `failedOptimisticGeneration` + +`function` — Mark a generation as failed with updated status and error information + +```ts +(generation: Generation) => Generation +``` + +### `Generation` + +`interface` — Define the structure for a generation entity including its metadata and creation details + +```ts +interface Generation +``` + +### `GENERATION_TYPES` + +`const` — Provide an array of supported generation types for media and content processing + +```ts +readonly GenerationType[] +``` + +### `generationError` + +`function` — Resolve and return the first user-safe error message from generation metadata or null if none exist + +```ts +(generation: Generation) => string | null +``` + +### `generationMergeKey` + +`function` — Resolve a unique merge key from a generation using batch slot or client request ID + +```ts +(generation: Generation) => string | null +``` + +### `GenerationRequestFields` + +`interface` — Define fields required to configure and request various types of media generation + +```ts +interface GenerationRequestFields +``` + +### `generationStatus` + +`function` — Resolve the current status of a generation based on its metadata and result fields + +```ts +(generation: Generation) => GenerationStatus +``` + +### `GenerationStatus` + +`type` — Define possible states representing the progress of a generation process + +```ts +type GenerationStatus +``` + +### `GenerationType` + +`type` — Define generation categories for media including image, video, speech, avatar, and transcription + +```ts +type GenerationType +``` + +### `generationVaultPath` + +`function` — Resolve the vault path string from a Generation object or return null if unavailable + +```ts +(generation: Generation) => string | null +``` + +### `isDestinationConnected` + +`function` — Determine if a destination has any active connections in the given list of studio integration connections + +```ts +(destination: PublishDestination, connections: StudioIntegrationConnection[]) => boolean +``` + +### `isGenerationType` + +`function` — Resolve whether a string value matches a valid GenerationType + +```ts +(value: string) => value is GenerationType +``` + +### `isLocalGeneration` + +`function` — Determine if a generation ID indicates a local generation + +```ts +(generation: Generation) => boolean +``` + +### `isPublishPackage` + +`function` — Determine if a value conforms to the PublishPackage structure with optional metadata fields + +```ts +(value: unknown) => value is { caption?: string | undefined; description?: string | undefined; mentions?: string[] | un… +``` + +### `latestBatchOf` + +`function` — Resolve and return the latest batch of generations grouped and sorted by client request ID and output index + +```ts +(generations: Generation[]) => Generation[] +``` + +### `MAX_IMAGE_COUNT` + +`const` — Define the maximum number of images allowed for upload or display + +```ts +4 +``` + +### `MediaModelCatalogResponse` + +`interface` — Represent media model catalog with default values, model options, and optional error message + +```ts +interface MediaModelCatalogResponse +``` + +### `MediaModelOption` + +`interface` — Describe media model option properties including id, name, type, status, and optional provider and reason + +```ts +interface MediaModelOption +``` + +### `MediaModelStatus` + +`type` — Define possible status values for a media model's availability and accessibility + +```ts +type MediaModelStatus +``` + +### `mergeLiveGeneration` + +`function` — Merge a new generation into the current list by replacing or prepending it based on matching keys + +```ts +(current: Generation[], generation: Generation) => Generation[] +``` + +### `mergeLoaderAndLive` + +`function` — Merge two Generation arrays prioritizing live entries and matching by merge keys or IDs + +```ts +(loader: Generation[], live: Generation[]) => Generation[] +``` + +### `MIN_IMAGE_COUNT` + +`const` — Define the minimum number of images required for processing or validation + +```ts +1 +``` + +### `modelMessage` + +`function` — Resolve the appropriate status message for a media model based on loading state and availability + +```ts +(model: MediaModelOption | undefined, loading: boolean, count: number) => string | null +``` + +### `normalizeImageCount` + +`function` — Normalize a value to a finite integer within the allowed image count range + +```ts +(value: unknown) => number +``` + +### `optimisticGeneration` + +`function` — Generate content optimistically based on input parameters and optional model and output details + +```ts +({ type, prompt, model, clientRequestId, outputIndex, outputCount, }: { type: GenerationType; prompt: string; model?: s… +``` + +### `outputPathFor` + +`function` — Resolve the output directory path based on the specified generation type + +```ts +(type: GenerationType) => string +``` + +### `preferredModelId` + +`function` — Resolve the preferred model ID for a given generation type from the media model catalog + +```ts +(type: GenerationType, catalog: MediaModelCatalogResponse | null) => string | undefined +``` + +### `PublishDestination` + +`interface` — Define a destination for publishing content with identifiers, label, provider IDs, and fields + +```ts +interface PublishDestination +``` + +### `PublishPackage` + +`interface` — Define the structure for configuring package publishing details and evaluation criteria + +```ts +interface PublishPackage +``` + +### `relativeTime` + +`function` — Resolve a human-readable relative time string from a given date or return an empty string if null + +```ts +(date: Date | null) => string +``` + +### `selectedModelsWithDefaults` + +`function` — Resolve selected models by applying defaults for missing or unavailable entries in the catalog + +```ts +(current: Partial>, catalog: MediaModelCatalogResponse) => Partial string +``` + + +## `./studio-react` + +Source: `src/studio-react/index.tsx` · depends on `studio` + +### `AvatarComposer` + +`function` + +```ts +({ audioUrl, imageUrl, avatarId, onAudioUrlChange, onImageUrlChange, onAvatarIdChange, }: { audioUrl: string; imageUrl:… +``` + +### `ComposerDisclosure` + +`function` + +```ts +({ summary, children }: { summary: ReactNode; children: ReactNode; }) => Element +``` + +### `ComposerHero` + +`function` + +```ts +({ workspaceId, integrationsHref, canManageIntegrations, align, surfaceClassName, onGenerated, }: { workspaceId?: strin… +``` + +### `Field` + +`function` + +```ts +({ label, htmlFor, className, children, }: { label: string; htmlFor?: string | undefined; className?: string | undefine… +``` + +### `filterGenerations` + +`function` — The visible set for the active type tab (all generations when unfiltered). + +```ts +(generations: Generation[], typeFilter: string | null) => Generation[] +``` + +### `GenerationCard` + +`function` + +```ts +({ generation, onSelect, }: { generation: Generation; onSelect: (generation: Generation) => void; }) => Element +``` + +### `GenerationDetail` + +`function` + +```ts +({ generation, vaultHref, onNavigate, }: { generation: Generation; vaultHref?: ((filePath?: string | null | undefined)… +``` + +### `GenerationDetailModal` + +`function` — Centered detail view for a single generation. + +```ts +({ generation, vaultHref, onClose, }: { generation: Generation | null; vaultHref?: ((filePath?: string | null | undefin… +``` + +### `GenerationGrid` + +`function` — Chrome-less asset grid — the `GenerationCard` grid plus its empty state, with no surrounding tabs/stats/sheet chrome. + +```ts +({ generations, typeFilter, onSelect, }: { generations: Generation[]; typeFilter: string | null; onSelect: (generation:… +``` + +### `GenerationStatusBadge` + +`function` + +```ts +({ generation, inline, }: { generation: Generation; inline?: boolean | undefined; }) => Element | null +``` + +### `ImageComposer` + +`function` + +```ts +({ size, quality, imageCount, onSizeChange, onQualityChange, onImageCountChange, }: { size: string; quality: string; im… +``` + +### `LibraryDrawer` + +`function` + +```ts +({ open, onOpenChange, generations, totalCost, typeFilter, onFilterChange, vaultHref, selected, onSelect, }: { open: bo… +``` + +### `LibraryPanel` + +`function` — Inline asset gallery — the same filter + stats + card grid as the library drawer's list view, but with no sheet chrome so it can sit on the page beside the composer. + +```ts +({ generations, totalCost, typeFilter, onFilterChange, onSelect, }: { generations: Generation[]; totalCost: number; typ… +``` + +### `NativeSelect` + +`function` + +```ts +(props: SelectHTMLAttributes) => Element +``` + +### `PublishPackageComposer` + +`function` + +```ts +({ caption, postDescription, mentions, cadence, selectedDestinations, connections, connectionError, connectionsLoading,… +``` + +### `ResultCanvas` + +`function` + +```ts +({ batch, onOpenLibrary, onSelect, }: { batch: Generation[]; onOpenLibrary: () => void; onSelect: (generation: Generati… +``` + +### `SpeechComposer` + +`function` + +```ts +({ voice, onVoiceChange, }: { voice: string; onVoiceChange: (value: string) => void; }) => Element +``` + +### `Stepper` + +`function` + +```ts +({ value, min, max, onChange, }: { value: number; min: number; max: number; onChange: (value: number) => void; }) => El… +``` + +### `StudioHeader` + +`function` + +```ts +({ count, onOpenLibrary, canGenerate, }: { count: number; onOpenLibrary: () => void; canGenerate: boolean; }) => Element +``` + +### `StudioRole` + +`type` + +```ts +type StudioRole +``` + +### `StudioSheet` + +`function` — Right-side overlay sheet built on Radix Dialog — gives focus-trap, scroll-lock, and Escape-to-close for free. + +```ts +({ open, onOpenChange, title, children, }: { open: boolean; onOpenChange: (open: boolean) => void; title: string; child… +``` + +### `StudioWorkspace` + +`function` — The full studio surface: header + composer + result canvas + library drawer, with the generation orchestrator (merge/poll/revalidate) wired in. + +```ts +({ generations, totalCost, workspaceId, role, generationsEndpoint, vaultHref, integrationsHref, }: StudioWorkspaceProps… +``` + +### `StudioWorkspaceProps` + +`interface` + +```ts +interface StudioWorkspaceProps +``` + +### `TranscriptionComposer` + +`function` + +```ts +({ audioUrl, language, onAudioUrlChange, onLanguageChange, }: { audioUrl: string; language: string; onAudioUrlChange: (… +``` + +### `TranscriptionOptions` + +`function` + +```ts +({ responseFormat, temperature, onResponseFormatChange, onTemperatureChange, }: { responseFormat: string; temperature:… +``` + +### `TYPE_CONFIG` + +`const` — Map type keys to their corresponding configuration objects including labels, icons, and colors + +```ts +Record +``` + +### `TypeConfig` + +`interface` — Define configuration options for a type including label, icon, and color properties + +```ts +interface TypeConfig +``` + +### `typeConfigFor` + +`function` — Resolve the configuration object for a given type or return the default image configuration + +```ts +(type: string) => TypeConfig +``` + +### `useStudioGenerations` + +`function` — The generation orchestrator behind a studio surface: it merges the loader's rows with in-flight live generations, computes the latest batch for the canvas, polls running generations until they settle… + +```ts +(loaderGenerations: Generation[], options?: { workspaceId?: string | undefined; generationsEndpoint?: string | undefine… +``` + +### `VideoComposer` + +`function` + +```ts +({ duration, resolution, aspectRatio, referenceImageUrl, onDurationChange, onResolutionChange, onAspectRatioChange, onR… +``` + + +## `./tangle` + +Source: `src/tangle/index.ts` + +### `BrokerToken` + +`interface` — A single-use hub bearer minted from a durable grant — mirrors `@tangle-network/agent-integrations`'s `BrokerToken`. + +```ts +interface BrokerToken +``` + +### `BrokerTokenMinter` + +`interface` — The one method the provider needs — `TangleAppsClient` satisfies it structurally, so `createBrokerTokenProvider({ client: tangleAppsClient, … })` type-checks without importing the concrete class. + +```ts +interface BrokerTokenMinter +``` + +### `BrokerTokenProvider` + +`interface` — Provide and refresh broker bearer tokens, allowing forced token invalidation + +```ts +interface BrokerTokenProvider +``` + +### `BrokerTokenProviderOptions` + +`interface` — Define options for configuring a broker token provider including client credentials and token management settings + +```ts +interface BrokerTokenProviderOptions +``` + +### `buildConsentUrl` + +`function` — Build the URL to send the user to for the one-time app-consent. + +```ts +(input: ConsentUrlInput) => string +``` + +### `ConsentUrlInput` + +`interface` — Define input parameters required to generate a consent URL for OAuth authorization + +```ts +interface ConsentUrlInput +``` + +### `createBrokerTokenProvider` + +`function` — Cache + auto-refresh a broker token for one grant. + +```ts +(opts: BrokerTokenProviderOptions) => BrokerTokenProvider +``` + + +## `./teams` + +Source: `src/teams/index.ts` + +### `ASSIGNABLE_WORKSPACE_ROLES` + +`const` — Define the list of roles that can be assigned within a workspace + +```ts +readonly ["viewer", "editor", "admin"] +``` + +### `AssignableWorkspaceRole` + +`type` — Resolve the set of roles that can be assigned within a workspace + +```ts +type AssignableWorkspaceRole +``` + +### `canManageWorkspaceMemberRole` + +`function` — Whether `actorRole` may set/clear a member currently at `targetRole`. + +```ts +(actorRole: "viewer" | "editor" | "admin" | "owner", targetRole: "viewer" | "editor" | "admin" | "owner") => boolean +``` + +### `generateInvitationToken` + +`function` — A cryptographically-random, URL-safe invitation token. + +```ts +() => string +``` + +### `generateInviteToken` + +`function` — Cryptographically-random, URL-safe (base64url) invite token. + +```ts +() => string +``` + +### `getInvitationExpiresAt` + +`function` — Calculate the expiration date of an invitation based on the given or current date + +```ts +(now?: Date) => Date +``` + +### `hasOrganizationRole` + +`function` — True when `actual` is at least `minimum` on the organization ladder. + +```ts +(actual: "admin" | "owner" | "member" | "billing", minimum: "admin" | "owner" | "member" | "billing") => boolean +``` + +### `hasWorkspaceRole` + +`function` — True when `actual` is at least `minimum` on the workspace ladder. + +```ts +(actual: "viewer" | "editor" | "admin" | "owner", minimum: "viewer" | "editor" | "admin" | "owner") => boolean +``` + +### `INVITATION_EXPIRY_DAYS` + +`const` — Define the number of days before an invitation expires + +```ts +7 +``` + +### `InvitationEmailBrand` + +`interface` — Define the structure for an invitation email brand including the RFC-5322 From header + +```ts +interface InvitationEmailBrand +``` + +### `InvitationEmailStatus` + +`type` — Define possible statuses for the sending state of an invitation email + +```ts +type InvitationEmailStatus +``` + +### `InvitationPermission` + +`type` — The role an invitation grants — the assignable workspace ladder (never owner). + +```ts +type InvitationPermission +``` + +### `InvitationStatus` + +`type` — Define possible states for an invitation's lifecycle including pending, accepted, expired, and revoked + +```ts +type InvitationStatus +``` + +### `InviteRejectionReason` + +`type` — Define possible reasons for rejecting an invite including acceptance, expiration, or email mismatch + +```ts +type InviteRejectionReason +``` + +### `InviteTokenState` + +`interface` — A pending invite row, narrowed to the fields invite acceptance reasons over. + +```ts +interface InviteTokenState +``` + +### `inviteUrlForToken` + +`function` — Generate an invite URL by combining the origin with an encoded token + +```ts +(origin: string, token: string) => string +``` + +### `InviteValidationResult` + +`interface` — Represent the outcome of validating an invite with success status and optional rejection reason + +```ts +interface InviteValidationResult +``` + +### `isAssignableWorkspaceRole` + +`function` — Determine if a value is a valid assignable workspace role among viewer, editor, or admin + +```ts +(value: unknown) => value is "viewer" | "editor" | "admin" +``` + +### `isInviteTokenShape` + +`function` — True when `value` has the shape of an invite token (not whether it exists). + +```ts +(value: unknown) => value is string +``` + +### `normalizeInvitationEmail` + +`function` — Normalize an invitation email by trimming whitespace and converting to lowercase + +```ts +(email: string) => string +``` + +### `ORGANIZATION_ROLE_RANK` + +`const` — Map organization roles to their hierarchical rank for permission and access control purposes + +```ts +Record<"admin" | "owner" | "member" | "billing", number> +``` + +### `ORGANIZATION_ROLES` + +`const` — Define the set of fixed roles available within an organization + +```ts +readonly ["owner", "admin", "member", "billing"] +``` + +### `OrganizationRole` + +`type` — Resolve a role string from the predefined list of organization roles + +```ts +type OrganizationRole +``` + +### `organizationRoleGrantsWorkspaceOwner` + +`function` — Org owners and admins are workspace owners across the whole org. + +```ts +(role: string | null | undefined) => boolean +``` + +### `parseInvitationPermission` + +`function` — Resolve invitation permission from a string or return null if invalid + +```ts +(value: string | undefined) => "viewer" | "editor" | "admin" | null +``` + +### `RenderedInvitationEmail` + +`interface` — Define the structure of a fully rendered invitation email with sender, subject, and content fields + +```ts +interface RenderedInvitationEmail +``` + +### `renderInvitationEmail` + +`function` — Render the invitation email body — pure, deterministic, transport-free. + +```ts +(input: RenderInvitationEmailInput, brand: InvitationEmailBrand) => RenderedInvitationEmail +``` + +### `RenderInvitationEmailInput` + +`interface` — Define input data required to render an invitation email template + +```ts +interface RenderInvitationEmailInput +``` + +### `resolveWorkspaceRole` + +`function` — The effective workspace role a request runs at: org owner/admin → owner of every workspace; otherwise the explicit per-workspace role (or null = no access). + +```ts +(organizationRole: string | null | undefined, workspaceRole: "viewer" | "editor" | "admin" | "owner" | null | undefined… +``` + +### `SandboxWorkspaceRole` + +`type` — Define user roles available within a sandbox workspace environment + +```ts +type SandboxWorkspaceRole +``` + +### `validateInviteToken` + +`function` — Decide whether a loaded invite can be accepted by `acceptingEmail` at `now`. + +```ts +(invite: InviteTokenState, opts?: { acceptingEmail?: string | null | undefined; now?: Date | undefined; }) => InviteVal… +``` + +### `WORKSPACE_ROLE_RANK` + +`const` — Map workspace roles to their corresponding hierarchical rank values + +```ts +Record<"viewer" | "editor" | "admin" | "owner", number> +``` + +### `WORKSPACE_ROLES` + +`const` — Pure role algebra for the teams capability — the tenancy/membership model shared across the fleet. + +```ts +readonly ["viewer", "editor", "admin", "owner"] +``` + +### `WorkspaceCollaborationAccess` + +`type` — Define access levels for workspace collaboration as either read or write + +```ts +type WorkspaceCollaborationAccess +``` + +### `WorkspaceRole` + +`type` — Resolve the union type of all possible workspace role string literals from WORKSPACE_ROLES array + +```ts +type WorkspaceRole +``` + +### `workspaceRoleToCollaborationAccess` + +`function` — Map a workspace role to the corresponding collaboration access level + +```ts +(role: "viewer" | "editor" | "admin" | "owner") => WorkspaceCollaborationAccess +``` + +### `workspaceRoleToSandboxRole` + +`function` — Map a workspace role to its corresponding sandbox workspace role + +```ts +(role: "viewer" | "editor" | "admin" | "owner") => SandboxWorkspaceRole +``` + + +## `./teams-react` + +Source: `src/teams-react/index.ts` · depends on `teams` + +### `InvitationsPanel` + +`function` + +```ts +({ invitations, currentRole, onInvite, onResend, onRevoke, onCopy, onNotice, }: InvitationsPanelProps) => Element +``` + +### `InvitationsPanelProps` + +`interface` — Define properties and callbacks for managing workspace invitations and user roles + +```ts +interface InvitationsPanelProps +``` + +### `InvitationView` + +`interface` — One invitation row as `InvitationsPanel` renders it — the shape `invitations-api` returns. + +```ts +interface InvitationView +``` + +### `InviteAcceptDetails` + +`interface` — Describe details of an accepted invite including status, workspace, inviter, role, emails, and expiration + +```ts +interface InviteAcceptDetails +``` + +### `InviteAcceptPage` + +`function` + +```ts +({ details, onAccept, onNavigate, onResendVerification }: InviteAcceptPageProps) => Element +``` + +### `InviteAcceptPageProps` + +`interface` — Define properties and callbacks for handling invite acceptance and navigation actions on the invite page + +```ts +interface InviteAcceptPageProps +``` + +### `InviteAcceptStatus` + +`type` — Define possible statuses for the acceptance state of an invitation + +```ts +type InviteAcceptStatus +``` + +### `MembersPanel` + +`function` + +```ts +({ members, currentRole, onInvite, onChangeRole, onRemove, onNotice, showInviteForm, }: MembersPanelProps) => Element +``` + +### `MembersPanelProps` + +`interface` — Define properties and callbacks for managing members and their roles in a workspace panel + +```ts +interface MembersPanelProps +``` + +### `MemberView` + +`interface` — One member row as the panel renders it — the shape `members-api` returns. + +```ts +interface MemberView +``` + + +## `./teams-react/lazy` + +Source: `src/teams-react/lazy.tsx` · depends on `teams` + +### `InvitationsPanelLazy` + +`function` — Load InvitationsPanel component lazily to optimize initial rendering performance + +```ts +LazyExoticComponent<({ invitations, currentRole, onInvite, onResend, onRevoke, onCopy, onNotice, }: InvitationsPanelPro… +``` + +### `InvitationsPanelProps` + +`interface` — Define properties and callbacks for managing workspace invitations and user roles + +```ts +interface InvitationsPanelProps +``` + +### `InviteAcceptPageLazy` + +`function` — Load InviteAcceptPage component lazily for optimized code splitting and performance + +```ts +LazyExoticComponent<({ details, onAccept, onNavigate, onResendVerification }: InviteAcceptPageProps) => Element> +``` + +### `InviteAcceptPageProps` + +`interface` — Define properties and callbacks for handling invite acceptance and navigation actions on the invite page + +```ts +interface InviteAcceptPageProps +``` + +### `MembersPanelLazy` + +`function` — Load MembersPanel component lazily to optimize initial rendering performance + +```ts +LazyExoticComponent<({ members, currentRole, onInvite, onChangeRole, onRemove, onNotice, showInviteForm, }: MembersPane… +``` + +### `MembersPanelProps` + +`interface` — Define properties and callbacks for managing members and their roles in a workspace panel + +```ts +interface MembersPanelProps +``` + + +## `./teams/drizzle` + +Source: `src/teams/drizzle.ts` + +### `CreateAccessOptions` + +`interface` — Define options required to create access with database, tables, and workspace table references + +```ts +interface CreateAccessOptions +``` + +### `createEnsurePersonalOrganization` + +`function` — Ensure a user has a personal organization by creating or retrieving it as needed + +```ts +(opts: CreatePersonalOrganizationOptions) => (user: EnsurePersonalOrganizationUser) => Promise OrganizationAccessApi +``` + +### `CreateOrganizationAccessOptions` + +`interface` — Define options required to create access for an organization including database and tables + +```ts +interface CreateOrganizationAccessOptions +``` + +### `CreatePersonalOrganizationOptions` + +`interface` — Define options required to create a personal organization including database and tables references + +```ts +interface CreatePersonalOrganizationOptions +``` + +### `createTeamTables` + +`function` — Build SQLite tables for organizations and related team structures using provided options + +```ts +(opts: CreateTeamTablesOptions) => { organizations: SQLiteTableWithColumns<{ name: "organization"; schema: undefined; c… +``` + +### `CreateTeamTablesOptions` + +`interface` — Define options specifying user and workspace tables for creating team-related tables + +```ts +interface CreateTeamTablesOptions +``` + +### `createWorkspaceAccess` + +`function` — Create workspace access API to manage user roles and permissions within a workspace + +```ts +(opts: CreateAccessOptions) => WorkspaceAccessApi +``` + +### `createWorkspaceInvitationTable` + +`function` — Build a workspace invitation table with defined columns and foreign key constraints + +```ts +(opts: CreateWorkspaceInvitationTableOptions) => { workspaceInvitations: SQLiteTableWithColumns<{ name: "workspace_invi… +``` + +### `CreateWorkspaceInvitationTableOptions` + +`interface` — Define options for creating a workspace invitation table with user, workspace, and organization references + +```ts +interface CreateWorkspaceInvitationTableOptions +``` + +### `EnsurePersonalOrganizationUser` + +`interface` — Define the structure for a user within a personal organization context + +```ts +interface EnsurePersonalOrganizationUser +``` + +### `OrganizationAccess` + +`interface` — Define access details linking an organization, its member, and the member's role + +```ts +interface OrganizationAccess +``` + +### `OrganizationAccessApi` + +`interface` — Define methods to retrieve and enforce user access levels within an organization + +```ts +interface OrganizationAccessApi +``` + +### `OrganizationMemberRow` + +`type` — Resolve the structure of an organization member row from the team tables selection + +```ts +type OrganizationMemberRow +``` + +### `OrganizationRow` + +`type` — Resolve the structure of an organization row from the organizations table in TeamTables + +```ts +type OrganizationRow +``` + +### `PersonalOrganizationResult` + +`interface` — Describe a personal organization result including organization, member, and role details + +```ts +interface PersonalOrganizationResult +``` + +### `TeamDatabase` + +`type` — Any SQLite drizzle database — `any` erases driver-specific generics so better-sqlite3, D1, and libsql handles all fit. + +```ts +type TeamDatabase +``` + +### `TeamParentTable` + +`type` — A product table referenced by FK — only the `id` column is touched. + +```ts +type TeamParentTable +``` + +### `TeamTables` + +`type` — Resolve team tables by deriving the return type of createTeamTables + +```ts +type TeamTables +``` + +### `UserWorkspaceSummary` + +`interface` — Describe a user's workspace details including organization and role information + +```ts +interface UserWorkspaceSummary +``` + +### `WorkspaceAccess` + +`interface` — Define access details including workspace data, organization info, member info, and role within workspace + +```ts +interface WorkspaceAccess +``` + +### `WorkspaceAccessApi` + +`interface` — Define methods to retrieve and enforce user access permissions within workspaces + +```ts +interface WorkspaceAccessApi +``` + +### `WorkspaceAccessTable` + +`interface` — The product's workspace table, narrowed to the columns the access joins read. + +```ts +interface WorkspaceAccessTable +``` + +### `WorkspaceInvitationRow` + +`type` — Resolve the structure of a workspace invitation row from the workspaceInvitations table + +```ts +type WorkspaceInvitationRow +``` + +### `WorkspaceInvitationTables` + +`type` — Resolve the structure of workspace invitation tables from the creation function + +```ts +type WorkspaceInvitationTables +``` + +### `WorkspaceMemberRow` + +`type` — Resolve a workspace member row with selected fields from the workspaceMembers table + +```ts +type WorkspaceMemberRow +``` + + +## `./teams/invitations-api` + +Source: `src/teams/invitations-api.ts` + +### `createInvitationsApi` + +`function` — Build the invitations API bound to one product's db/tables/access/seams. + +```ts +(opts: InvitationsApiOptions) => { createInvitation: (input: { workspaceId: string; email: string; permissions: string… +``` + +### `EnforceSeatSeam` + +`interface` — Optional billing seat gate. + +```ts +interface EnforceSeatSeam +``` + +### `InvitationOutcome` + +`type` — Resolve the result of an invitation as success with a value or failure with status and error details + +```ts +type InvitationOutcome +``` + +### `InvitationPreview` + +`interface` — Describe the structure of an invitation preview with workspace, email, permissions, status, and expiration details + +```ts +interface InvitationPreview +``` + +### `InvitationsApiOptions` + +`interface` — Define configuration options required to manage workspace invitations and related data sources + +```ts +interface InvitationsApiOptions +``` + +### `InvitationUserTable` + +`interface` — The product's user table, narrowed to the columns the queries read. + +```ts +interface InvitationUserTable +``` + +### `InvitationWorkspaceTable` + +`interface` — The product's workspace table, narrowed to the columns the queries read. + +```ts +interface InvitationWorkspaceTable +``` + +### `MemberSyncSeam` + +`interface` — Optional membership-change propagation to an external system (e.g. + +```ts +interface MemberSyncSeam +``` + +### `SeatLimitError` + +`class` — Thrown by an `enforceSeat` seam to deny an invite; serialized to a 402. + +```ts +class SeatLimitError +``` + +### `SendInvitationEmailInput` + +`interface` — The app's mail transport. + +```ts +interface SendInvitationEmailInput +``` + +### `SendInvitationEmailResult` + +`type` — Represent the outcome of sending an invitation email with success status and optional error message + +```ts +type SendInvitationEmailResult +``` + +### `SendInvitationEmailSeam` + +`interface` — Resolve sending an invitation email and return the result asynchronously + +```ts +interface SendInvitationEmailSeam +``` + +### `WorkspaceInvitationView` + +`interface` — Represent a workspace invitation with details about inviter, permissions, status, and timestamps + +```ts +interface WorkspaceInvitationView +``` + + +## `./teams/members-api` + +Source: `src/teams/members-api.ts` + +### `createMembersApi` + +`function` — Build the members API bound to one product's db/tables/access. + +```ts +(opts: MembersApiOptions) => { listMembers: (input: { workspaceId: string; actor: MembersApiActor; }) => Promise SendInvitationEmailSeam +``` + +### `ResendInvitationSenderOptions` + +`interface` — Define options for sending a resend invitation including sender address and optional API key + +```ts +interface ResendInvitationSenderOptions +``` + + +## `./theme` + +Source: `src/theme/index.ts` + +### `AgentAppTheme` + +`interface` — Typed mirror of tokens.css for runtime/JS theming. + +```ts +interface AgentAppTheme +``` + +### `CanvasRenderPalette` + +`interface` — Colors the Konva design-canvas paints directly. + +```ts +interface CanvasRenderPalette +``` + +### `darkTheme` + +`const` — Define a dark color scheme for the Agent app interface with specific background and foreground hues + +```ts +AgentAppTheme +``` + +### `lightTheme` + +`const` — Define a light color theme with specific background, foreground, and accent color values + +```ts +AgentAppTheme +``` + +### `themeColor` + +`function` — Wrap a channel triple in `hsl()`; pass through values already in a color form. + +```ts +(value: string) => string +``` + +### `themeToCssVars` + +`function` — Map a theme to the full CSS-variable set (shadcn triples + canvas/sequences aliases + canvas surface). + +```ts +(theme: AgentAppTheme) => Record +``` + + +## `./theme-contract` + +Source: `src/theme-contract/index.ts` + +### `checkThemeContract` + +`function` — Check that every theme token a consumer's source references is actually defined in the CSS that consumer ships. + +```ts +(opts: ThemeContractOptions) => ThemeContractResult +``` + +### `ThemeContractMiss` + +`interface` — Describe a missing theme contract variable and where it was referenced + +```ts +interface ThemeContractMiss +``` + +### `ThemeContractOptions` + +`interface` — Define options for scanning source directories and CSS token files in a theme contract + +```ts +interface ThemeContractOptions +``` + +### `ThemeContractResult` + +`interface` — Describe the result of validating a theme contract including success status and missing items + +```ts +interface ThemeContractResult +``` + + +## `./theme-contract/cli` + +Source: `src/theme-contract/cli.ts` + +_No public exports._ + +## `./theme/tailwind-preset` + +Source: `src/theme/tailwind-preset.ts` + +### `default` + +`const` — Define a preset configuration for dark mode and extended theme colors with foreground variants + +```ts +{ darkMode: [string, string]; theme: { extend: { colors: { background: string; foreground: string; border: string; inpu… +``` + + +## `./tools` + +Source: `src/tools/index.ts` · depends on `crypto`, `eval` + +### `AddCitationArgs` + +`interface` — Define arguments required to add a citation including path, quote, and optional label + +```ts +interface AddCitationArgs +``` + +### `AddCitationResult` + +`interface` — Represent the result of adding a citation including its identifier and location path + +```ts +interface AddCitationResult +``` + +### `APP_TOOL_NAMES` + +`const` — The four canonical app-tool names. + +```ts +readonly ["submit_proposal", "schedule_followup", "render_ui", "add_citation"] +``` + +### `AppToolContext` + +`interface` — Server-set, trusted per-turn context. + +```ts +interface AppToolContext +``` + +### `AppToolDefinition` + +`interface` — A product-defined app tool — the open registration seam. + +```ts +interface AppToolDefinition +``` + +### `AppToolHandlers` + +`interface` — The domain seam. + +```ts +interface AppToolHandlers +``` + +### `AppToolMcpServer` + +`interface` — The portable MCP server entry the sandbox SDK accepts (transport + url + headers). + +```ts +interface AppToolMcpServer +``` + +### `AppToolName` + +`type` — Resolve a valid application tool name from the predefined list of tool names + +```ts +type AppToolName +``` + +### `AppToolOutcome` + +`type` — Outcome of one tool dispatch — structurally identical to the agent-runtime tool-loop's `ToolCallOutcome`, so a dispatched outcome folds straight into the loop's `role: 'tool'` result message. + +```ts +type AppToolOutcome +``` + +### `AppToolProducedEvent` + +`type` — Produced-state events the runtime executor emits at the real side-effect site, so a consumer's eval/completion oracle credits a persisted proposal or artifact. + +```ts +type AppToolProducedEvent +``` + +### `AppToolRuntimeExecutor` + +`type` — Executes an app-tool call the model emits on the agent-runtime chat path. + +```ts +type AppToolRuntimeExecutor +``` + +### `AppToolTaxonomy` + +`interface` — The product's proposal taxonomy — the only domain-specific vocabulary the generic layer needs (to validate `submit_proposal.type` and label the regulated subset). + +```ts +interface AppToolTaxonomy +``` + +### `AuthenticateOptions` + +`interface` — Define options to verify bearer tokens and customize authentication header names + +```ts +interface AuthenticateOptions +``` + +### `authenticateToolRequest` + +`function` — Recover + verify the trusted context for a tool request. + +```ts +(request: Request, opts: AuthenticateOptions) => Promise +``` + +### `buildAppToolMcpServer` + +`function` — Build one app-tool MCP server entry — a thin wrapper over {@link buildHttpMcpServer} that resolves the tool's route path. + +```ts +(opts: BuildMcpServerOptions) => AppToolMcpServer +``` + +### `buildAppToolOpenAITools` + +`function` — Build the four app tools in OpenAI function-tool shape. + +```ts +(taxonomy: AppToolTaxonomy, opts?: BuildAppToolsOptions | undefined) => OpenAIFunctionTool[] +``` + +### `BuildAppToolsOptions` + +`interface` — Optional overrides for {@link buildAppToolOpenAITools }. + +```ts +interface BuildAppToolsOptions +``` + +### `buildHttpMcpServer` + +`function` — Build ONE HTTP MCP server entry — the generic agent→app bridge. + +```ts +(opts: BuildHttpMcpServerOptions) => AppToolMcpServer +``` + +### `BuildHttpMcpServerOptions` + +`interface` — Define configuration options for building an HTTP MCP server including path, baseUrl, token, context, and description + +```ts +interface BuildHttpMcpServerOptions +``` + +### `BuildMcpServerOptions` + +`interface` — Define configuration options required to build an MCP server including tool, baseUrl, token, and context + +```ts +interface BuildMcpServerOptions +``` + +### `buildScopedMcpServerEntry` + +`function` — Build the `AgentProfileMcpServer`-shaped entry for a scoped, per-resource MCP channel. + +```ts +(opts: ScopedMcpServerEntryOptions & { label: string; defaultDescription: string; }) => AppToolMcpServer +``` + +### `CapabilityTokenOptions` + +`interface` — Define options for creating and verifying capability tokens including secret and prefix + +```ts +interface CapabilityTokenOptions +``` + +### `createAppToolRuntimeExecutor` + +`function` — Build the runtime executor for one turn. + +```ts +(opts: RuntimeExecutorOptions) => AppToolRuntimeExecutor +``` + +### `createCapabilityToken` + +`function` — Mint a capability token for `userId`, or `undefined` when no secret is configured (fail-closed — the caller omits the MCP server rather than fake it). + +```ts +(userId: string, opts: CapabilityTokenOptions) => Promise +``` + +### `createExpiringCapabilityToken` + +`function` — Mint an EXPIRING capability token: `.` where the payload carries `{ sub, exp, n }` (subject, epoch-ms expiry, random nonce) and the signature is HMAC-SHA256 over the… + +```ts +(subject: string, opts: ExpiringCapabilityTokenOptions) => Promise +``` + +### `createMcpToolHandler` + +`function` — Build a request handler for a tools-only MCP server. + +```ts +>(opts: CreateMcpToolHandlerOptions) => (request: Request) => Promise +``` + +### `CreateMcpToolHandlerOptions` + +`interface` — Define options for creating a handler that manages MCP tools with environment support + +```ts +interface CreateMcpToolHandlerOptions +``` + +### `customToolToOpenAI` + +`function` — The OpenAI function-tool def for a custom tool — appended to the built-ins by `buildAppToolOpenAITools`. + +```ts +(def: AppToolDefinition>) => OpenAIFunctionTool +``` + +### `DEFAULT_APP_TOOL_PATHS` + +`const` — Default route path each app tool is served at. + +```ts +Record<"submit_proposal" | "schedule_followup" | "render_ui" | "add_citation", string> +``` + +### `DEFAULT_HEADER_NAMES` + +`const` — Provide default HTTP header names for user, workspace, and thread identification + +```ts +ToolHeaderNames +``` + +### `defineAppTool` + +`function` — Validate + brand a product tool definition. + +```ts +>(def: AppToolDefinition) => AppToolDefinition +``` + +### `dispatchAppTool` + +`function` — The ONE place an app-tool call is validated, dispatched to the product's handler, and turned into an {@link AppToolOutcome} + produced events. + +```ts +(toolName: string, rawArgs: Record, ctx: AppToolContext, opts: DispatchOptions) => Promise>[] | undefined) => AppToolDefinition Promise +``` + +### `HandleToolRequestOptions` + +`interface` — Define options for handling tool requests including tool identification and token verification + +```ts +interface HandleToolRequestOptions +``` + +### `isAppToolName` + +`function` — Determine if a string matches a valid application tool name + +```ts +(name: string) => name is "submit_proposal" | "schedule_followup" | "render_ui" | "add_citation" +``` + +### `MCP_PROTOCOL_VERSIONS` + +`const` — Generic streamable-HTTP JSON-RPC 2.0 envelope for a tools-only MCP server. + +```ts +readonly ["2025-06-18", "2025-03-26", "2024-11-05"] +``` + +### `McpProtocolVersion` + +`type` — Resolve a valid protocol version from the predefined MCP_PROTOCOL_VERSIONS array + +```ts +type McpProtocolVersion +``` + +### `McpServerInfo` + +`interface` — Describe the structure of server information including name and version + +```ts +interface McpServerInfo +``` + +### `McpToolDefinition` + +`interface` — One tool entry in the registry the handler owns. + +```ts +interface McpToolDefinition +``` + +### `OpenAIFunctionTool` + +`interface` — A minimal OpenAI Chat Completions function-tool shape — structurally compatible with `@tangle-network/agent-runtime`'s `OpenAIChatTool` without importing it (keeps this package runtime-free). + +```ts +interface OpenAIFunctionTool +``` + +### `outcomeStatus` + +`function` — HTTP status for a failed outcome — the handler's `ToolInputError.status` when present, else 400 for a validation reject. + +```ts +(outcome: { ok: false; code: string; message: string; status?: number | undefined; }) => number +``` + +### `readToolArgs` + +`function` — Read a tool's argument object from the request body, tolerant of MCP host aliases (`args` / `arguments`) or a bare body. + +```ts +(request: Request) => Promise +``` + +### `RenderUiArgs` + +`interface` — Define arguments required to render a UI including title and schema + +```ts +interface RenderUiArgs +``` + +### `RenderUiResult` + +`interface` — Describe the result of rendering UI including the artifact path and exact persisted content + +```ts +interface RenderUiResult +``` + +### `ResolvedToolCapabilities` + +`interface` — Describe resolved capabilities including proposal types and product tool groups to expose + +```ts +interface ResolvedToolCapabilities +``` + +### `resolveToolCapabilities` + +`function` — Resolve an enabled capability-id set against a taxonomy into the concrete tool surface. + +```ts +(opts: ResolveToolCapabilitiesOptions) => ResolvedToolCapabilities +``` + +### `ResolveToolCapabilitiesOptions` + +`interface` — Resolve options for determining tool capabilities based on taxonomy, capabilities, and enabled IDs + +```ts +interface ResolveToolCapabilitiesOptions +``` + +### `restrictTaxonomy` + +`function` — Restrict a taxonomy to a subset of proposal types, intersecting the regulated subset too — the regulated label survives restriction, so a narrowed agent can never launder a regulated type into an unr… + +```ts +(taxonomy: AppToolTaxonomy, allowed: readonly string[]) => AppToolTaxonomy +``` + +### `RuntimeExecutorOptions` + +`interface` — Define options for executing runtime tasks with a trusted per-turn context + +```ts +interface RuntimeExecutorOptions +``` + +### `ScheduleFollowupArgs` + +`interface` — Define arguments required to schedule a follow-up with optional priority + +```ts +interface ScheduleFollowupArgs +``` + +### `ScheduleFollowupResult` + +`interface` — Define the result structure for scheduling a follow-up with unique identification and due date + +```ts +interface ScheduleFollowupResult +``` + +### `ScopedMcpServerEntryOptions` + +`interface` — Options for a per-document/scoped MCP channel entry (design-canvas, sequences, …). + +```ts +interface ScopedMcpServerEntryOptions +``` + +### `SubmitProposalArgs` + +`interface` — Define the arguments required to submit a proposal including type, title, description, and approval status + +```ts +interface SubmitProposalArgs +``` + +### `SubmitProposalResult` + +`interface` — Describe the result of submitting a proposal including deduplication and execution status + +```ts +interface SubmitProposalResult +``` + +### `ToolAuthResult` + +`type` — Represent the result of tool authentication with success context or failure response + +```ts +type ToolAuthResult +``` + +### `ToolCapability` + +`interface` — One toggleable tool group in a product's capability registry. + +```ts +interface ToolCapability +``` + +### `ToolHeaderNames` + +`interface` — Header names carrying the server-set per-turn context + the capability token. + +```ts +interface ToolHeaderNames +``` + +### `ToolInputError` + +`class` — A correctable bad-input error a tool handler throws; the HTTP layer maps it to a 4xx with the code, the runtime layer to a failed tool_result. + +```ts +class ToolInputError +``` + +### `verifyCapabilityToken` + +`function` — Verify a capability token against `userId`. + +```ts +(userId: string, token: string, opts: CapabilityTokenOptions) => Promise +``` + +### `verifyExpiringCapabilityToken` + +`function` — Verify an expiring token against `subject`: prefix, payload integrity, subject match, and expiry all checked; returns false (never throws) on any failure including a malformed payload. + +```ts +(subject: string, token: string, opts: CapabilityTokenOptions & { now?: (() => number) | undefined; }) => Promise StepSpanContext +``` + +### `composeMissionFlowTrace` + +`function` — Compose a mission-wide FlowTrace: one 'pipeline' span per step, the step's delegated runs ('tool' spans, from `activity[stepId]`) beneath it. + +```ts +(input: { steps: MissionFlowStep[]; activity?: Record | undefined; startedAt?: number | un… +``` + +### `createMissionTraceContext` + +`function` — Mint a mission's trace context. + +```ts +(missionId?: string | undefined) => MissionTraceContext +``` + +### `delegationActivityToFlowSpans` + +`function` — One 'tool' FlowSpan per delegation, positioned relative to `turnStartMs` (the epoch-ms origin of the trace — usually the step or mission start). + +```ts +(activity: StepAgentActivity[], turnStartMs: number, opts?: { nowMs?: number | undefined; } | undefined) => FlowSpan[] +``` + +### `DistributionSummary` + +`interface` — Summarize key statistics of a numerical distribution including count, min, percentiles, and max + +```ts +interface DistributionSummary +``` + +### `FlowSpan` + +`interface` — The shared FlowSpan / FlowTrace data shapes — the LEAF both the trace barrel (`./index`, which builds + renders them) and the delegation converters (`./mission-flow`, which emit them) import, so neit… + +```ts +interface FlowSpan +``` + +### `FlowTrace` + +`interface` — Describe the structure of a flow trace including spans, timing, tokens, cost, and tool calls + +```ts +interface FlowTrace +``` + +### `LoopTraceEventLike` + +`interface` — Structural mirror of agent-runtime's `LoopTraceEvent` — same fields, no import, so journals parsed from JSON feed straight in. + +```ts +interface LoopTraceEventLike +``` + +### `loopTraceEventsToFlowSpans` + +`function` — Reconstruct one delegation's loop → round → iteration tree from its journaled LoopTraceEvents, as FlowSpans relative to `loop.started` (or the first event). + +```ts +(events: LoopTraceEventLike[]) => FlowSpan[] +``` + +### `MissionFlowStep` + +`interface` — Define a step in a mission flow with id, intent, optional status, start time, and duration + +```ts +interface MissionFlowStep +``` + +### `MissionTraceContext` + +`interface` — Mission trace context — mint + thread the trace ids that join a mission's step attempts and its delegated agent runs into ONE trace tree. + +```ts +interface MissionTraceContext +``` + +### `renderHistogram` + +`function` — ASCII histogram for multi-run samples (eval latencies, costs, scores). + +```ts +(values: number[], opts?: { buckets?: number | undefined; width?: number | undefined; unit?: string | undefined; format… +``` + +### `renderWaterfall` + +`function` — ASCII waterfall cascade — the default artifact for explaining a flow. + +```ts +(trace: FlowTrace, opts?: { width?: number | undefined; } | undefined) => string +``` + +### `stepActivityFlowTrace` + +`function` — A single step's activity lane as its own FlowTrace — what a per-step drill-in renders. + +```ts +(activity: StepAgentActivity[], opts?: { startedAt?: number | undefined; nowMs?: number | undefined; } | undefined) =>… +``` + +### `StepSpanContext` + +`interface` — Define context information for a step span including trace, span, and parent span identifiers + +```ts +interface StepSpanContext +``` + +### `summarize` + +`function` — Summarize numeric values into a distribution summary including count, min, median, 90th percentile, and max + +```ts +(values: number[]) => DistributionSummary +``` + +### `TimedEvent` + +`interface` — Represent a timed event with a timestamp and associated event data + +```ts +interface TimedEvent +``` + +### `timedEventsFromLines` + +`function` — Parse stored turn-event lines (JSON strings with `_t`) into TimedEvents. + +```ts +(lines: string[]) => TimedEvent[] +``` + +### `traceEnv` + +`function` — The env pair a delegation subprocess inherits — agent-runtime's `readTraceContextFromEnv` reads exactly these names. + +```ts +(ctx: MissionTraceContext | StepSpanContext) => { TRACE_ID: string; PARENT_SPAN_ID: string; } +``` + + +## `./turn-stream` + +Source: `src/turn-stream/index.ts` · depends on `chat-routes`, `stream` + +### `acquireDurableTurnLock` + +`function` — Acquire a durable turn lock in the specified namespace with given input parameters + +```ts +(namespace: TurnStreamNamespaceLike, input: AcquireDurableTurnLockInput) => Promise +``` + +### `AcquireDurableTurnLockInput` + +`interface` — Define input parameters required to acquire a durable turn lock in a workspace thread context + +```ts +interface AcquireDurableTurnLockInput +``` + +### `activeTurnLock` + +`function` — `stored` is what the DO read from storage; expired locks are dead. + +```ts +(stored: DurableTurnLock | undefined, now: number) => DurableTurnLock | null +``` + +### `ACTIVITY_TTL_MS` + +`const` — A responding marker older than this is treated as stale, so a dropped `end` broadcast can't leave a permanently-stuck "responding" dot. + +```ts +number +``` + +### `appendSegmentEvent` + +`function` — Append a per-turn event to its execution's segment, assigning a monotonic `seq`. + +```ts +(store: SegmentStore, executionId: string, incoming: TurnStreamEvent, maxEvents?: number) => TurnStreamEvent +``` + +### `broadcastThreadCreated` + +`function` — Per-workspace marker that a new thread was created, so an already-open history list prepends it without a reload. + +```ts +(namespace: TurnStreamNamespaceLike, workspaceId: string, thread: { threadId: string; title: string; }) => Promise +``` + +### `broadcastTurnStreamEvent` + +`function` — Fan a turn event out to the per-thread channel. + +```ts +(namespace: TurnStreamNamespaceLike, input: { workspaceId: string; threadId: string; executionId: string; event: { type… +``` + +### `broadcastWorkspaceActivity` + +`function` — Coarse per-workspace marker that a thread's turn started / ended — drives a sidebar "agent responding" indicator subscribed once per workspace. + +```ts +(namespace: TurnStreamNamespaceLike, workspaceId: string, threadId: string, phase: "start" | "end") => Promise +``` + +### `createDurableObjectTurnEventStore` + +`function` — A {@link TurnEventStore} backed by {@link TurnStreamDO } storage — the production implementation of `createChatTurnRoutes`' `turnStore` seam for apps that don't run D1 for turn events (or want replay… + +```ts +(namespace: TurnStreamNamespaceLike) => TurnEventStore +``` + +### `createDurableTurnLock` + +`function` — The vertical's `turnLock` seam on the shared DO: dual-scope single-flight acquire (with one reconcile-then-retry pass when the product supplies a stale-lock reconciler) and cooperative release on set… + +```ts +(options: CreateDurableTurnLockOptions) => { acquire(args: TurnLockSeamArgs): Promise<...… +``` + +### `CreateDurableTurnLockOptions` + +`interface` — Define options for creating a durable turn lock with customizable scope and identification methods + +```ts +interface CreateDurableTurnLockOptions +``` + +### `createMemoryTurnStreamHarness` + +`function` — Build the harness. + +```ts +(createInstance?: (state: TurnStreamDOState) => TurnStreamDO, _options?: TurnStreamDOOptions) => MemoryTurnStreamHarness +``` + +### `createSegmentStore` + +`function` — Create a SegmentStore with initialized segments and no active execution ID + +```ts +() => SegmentStore +``` + +### `createTurnLock` + +`function` — Create a durable turn lock object with timing and scope based on input parameters + +```ts +(input: TurnLockAcquireInput, now: number, ttlMs?: number) => DurableTurnLock +``` + +### `createTurnStreamUpgradeHandler` + +`function` — The worker-entry WebSocket forwarder. + +```ts +(options: CreateTurnStreamUpgradeHandlerOptions) => (request: Request) => Promise +``` + +### `CreateTurnStreamUpgradeHandlerOptions` + +`interface` — Define options for creating a TURN stream upgrade handler including namespace, path, and authorization logic + +```ts +interface CreateTurnStreamUpgradeHandlerOptions +``` + +### `DurableTurnLock` + +`interface` — The stored single-flight lock. + +```ts +interface DurableTurnLock +``` + +### `interruptedReleaseApplies` + +`function` — The interrupted/stale release fence. + +```ts +(active: DurableTurnLock, input: { threadId: string; interruptedAt: number; turnId?: string | undefined; }) => boolean +``` + +### `isTerminalRunEvent` + +`function` — Terminal run markers: they close a turn segment and auto-release the channel's chat-turn lock for the segment's execution. + +```ts +(type: string) => boolean +``` + +### `MAX_RECENT_CREATED` + +`const` — Recent `thread.created` markers kept for late-connecting sidebars. + +```ts +50 +``` + +### `MAX_SEGMENT_EVENTS` + +`const` — Per-turn replay window. + +```ts +2000 +``` + +### `MemoryTurnStreamChannel` + +`interface` — Define an in-memory channel for streaming turn-based data with viewer socket connection support + +```ts +interface MemoryTurnStreamChannel +``` + +### `MemoryTurnStreamHarness` + +`interface` — Provide an interface to manage channels and namespaces for memory-based turn stream testing + +```ts +interface MemoryTurnStreamHarness +``` + +### `MemoryTurnStreamSocket` + +`interface` — A test-side viewer socket: records frames sent by the DO and lets the test drive the `sync` handshake. + +```ts +interface MemoryTurnStreamSocket +``` + +### `pruneStaleThreads` + +`function` — Remove responding entries (threadId → startedAt) older than `ttlMs`, so a dropped `end` broadcast can't leave a permanently-stuck dot. + +```ts +(active: Map, now: number, ttlMs: number) => string[] +``` + +### `reconcileStaleDurableTurnLock` + +`function` — `/chat-routes`' `reconcileStaleTurnLock` policy wired to the DO: the product supplies the probes (which box, what its session says), the policy decides, and a release lands as a FENCED interrupted re… + +```ts +(options: ReconcileStaleDurableTurnLockOptions) => Promise<{ released: boolean; diagnostics: Record; }> +``` + +### `ReconcileStaleDurableTurnLockOptions` + +`interface` — Define options to reconcile stale durable turn locks with context, namespace, workspace, and active lock details + +```ts +interface ReconcileStaleDurableTurnLockOptions +``` + +### `releaseDurableTurnLock` + +`function` — Release a durable turn lock and indicate if the release was successful or deferred + +```ts +(namespace: TurnStreamNamespaceLike, input: TurnLockReleaseInput) => Promise<{ released: boolean; deferred?: boolean |… +``` + +### `releaseInterruptedDurableTurnLock` + +`function` — Fenced out-of-band release — the DO refuses a successor lock (started after `interruptedAt`) and a turnId mismatch. + +```ts +(namespace: TurnStreamNamespaceLike, input: ReleaseInterruptedDurableTurnLockInput) => Promise +``` + +### `ReleaseInterruptedDurableTurnLockInput` + +`interface` — Define input parameters to release an interrupted durable turn lock in a workspace or thread + +```ts +interface ReleaseInterruptedDurableTurnLockInput +``` + +### `replayActiveSegment` + +`function` — Events of the active, non-terminal turn with `seq > afterSeq` — what a (re)connecting client replays before going live. + +```ts +(store: SegmentStore, afterSeq: number) => TurnStreamEvent[] +``` + +### `scopeIndexChannelKey` + +`function` — Generate a unique channel key string based on the provided scope identifier + +```ts +(scopeId: string) => string +``` + +### `SegmentStore` + +`interface` — Define a store managing segments and tracking the active execution identifier + +```ts +interface SegmentStore +``` + +### `threadChannelKey` + +`function` — Generate a unique string key combining workspace and thread identifiers + +```ts +(workspaceId: string, threadId: string) => string +``` + +### `TURN_LOCK_TTL_MS` + +`const` — Default lifetime of an unreleased lock. + +```ts +number +``` + +### `TURN_STREAM_PATHS` + +`const` — Provide constant paths for managing chat turn streams and locks + +```ts +{ readonly broadcast: "/broadcast"; readonly lockAcquire: "/chat-turn-lock/acquire"; readonly lockRelease: "/chat-turn-… +``` + +### `TURN_STREAM_STORAGE_KEYS` + +`const` — Storage keys inside a DO instance. + +```ts +{ readonly lock: "chatTurnLock"; readonly activeThreads: "activeThreads"; readonly turnStatus: "turnStatus"; readonly t… +``` + +### `turnEventStorageKey` + +`function` — Zero-padded seq so DO storage `list({ prefix })` returns rows in replay order without a sort. + +```ts +(seq: number) => string +``` + +### `TurnLockAcquireInput` + +`interface` — Define input parameters required to acquire a turn-based lock in a workspace thread + +```ts +interface TurnLockAcquireInput +``` + +### `TurnLockAcquireResult` + +`type` — Resolve the result of attempting to acquire a turn lock indicating success or active lock status + +```ts +type TurnLockAcquireResult +``` + +### `turnLockChannelKey` + +`function` — The channel a lock lives on: workspace-scope locks serialize every thread in the workspace (one shared sandbox), thread-scope locks serialize one thread (router lane). + +```ts +(workspaceId: string, threadId: string, scope: TurnLockScope) => string +``` + +### `TurnLockInterruptedReleaseInput` + +`interface` — Fenced out-of-band release (stop button, stale-lock reconciliation). + +```ts +interface TurnLockInterruptedReleaseInput +``` + +### `turnLockMatchesRelease` + +`function` — A cooperative release must present the lock's own identity — both the execution and the lockId minted at acquire — so a retry of a PREVIOUS turn can never release the current one. + +```ts +(active: DurableTurnLock, input: { executionId: string; lockId?: string | undefined; }) => boolean +``` + +### `TurnLockReleaseInput` + +`interface` — Define input parameters required to release a turn lock in a specific workspace thread + +```ts +interface TurnLockReleaseInput +``` + +### `TurnLockScope` + +`type` — Define the scope level for acquiring a turn lock within thread or workspace contexts + +```ts +type TurnLockScope +``` + +### `TurnLockSeamArgs` + +`interface` — The subset of `ChatTurnProduceArgs` the lock adapter reads — structural, so this module needs no import from `/chat-routes/turn-routes` (which would drag the `agent-runtime` peer into every `/turn-st… + +```ts +interface TurnLockSeamArgs +``` + +### `TurnLockSeamResult` + +`type` — Verdict shape of the vertical's `turnLock.acquire`. + +```ts +type TurnLockSeamResult +``` + +### `TurnSegment` + +`interface` — Represent a segment of a turn containing events, sequence limit, and terminal status + +```ts +interface TurnSegment +``` + +### `turnStorageChannelKey` + +`function` — Generate a storage channel key string for a given turn identifier + +```ts +(turnId: string) => string +``` + +### `TurnStreamDO` + +`class` — Manage per-turn segments and track active threads with durable event storage + +```ts +class TurnStreamDO +``` + +### `TurnStreamDOOptions` + +`interface` — Define options to override default TTL and event limits for TURN stream DO operations + +```ts +interface TurnStreamDOOptions +``` + +### `TurnStreamDOState` + +`interface` — The `DurableObjectState` surface the DO uses. + +```ts +interface TurnStreamDOState +``` + +### `TurnStreamEvent` + +`interface` — One event on a turn-stream channel. + +```ts +interface TurnStreamEvent +``` + +### `TurnStreamNamespaceLike` + +`interface` — The surface of `DurableObjectNamespace` the adapters use. + +```ts +interface TurnStreamNamespaceLike +``` + +### `TurnStreamSocket` + +`interface` — The socket surface the DO touches. + +```ts +interface TurnStreamSocket +``` + +### `TurnStreamStorage` + +`interface` — The storage surface the DO touches (Cloudflare `DurableObjectStorage` satisfies it structurally). + +```ts +interface TurnStreamStorage +``` + +### `TurnStreamStubLike` + +`interface` — Resolve a stub interface for handling fetch requests with optional initialization parameters + +```ts +interface TurnStreamStubLike +``` + +### `TurnStreamUpgradeAuthorization` + +`type` — Represent success or failure of a TURN stream upgrade authorization with optional response data + +```ts +type TurnStreamUpgradeAuthorization +``` + +### `workspaceChannelKey` + +`function` — Generate a unique channel key based on the given workspace identifier + +```ts +(workspaceId: string) => string +``` + + +## `./vault` + +Source: `src/vault/index.ts` + +### `ConfirmDialog` + +`function` + +```ts +({ open, title, description, confirmLabel, cancelLabel, destructive, confirmDisabled, onConfirm, onCancel, children, }:… +``` + +### `ConfirmDialogProps` + +`interface` + +```ts +interface ConfirmDialogProps +``` + +### `VaultArtifactRenderProps` + +`interface` — Props the pane passes to the product's artifact renderer (e.g. + +```ts +interface VaultArtifactRenderProps +``` + +### `VaultDataPort` + +`interface` — The data seam the product owns. + +```ts +interface VaultDataPort +``` + +### `VaultDockRenderProps` + +`interface` — Props the pane passes to the product's optional dock renderer (e.g. + +```ts +interface VaultDockRenderProps +``` + +### `VaultDockToggle` + +`interface` — Configures the dock toggle VaultPane renders above the artifact pane. + +```ts +interface VaultDockToggle +``` + +### `VaultEditorMode` + +`type` — The two editor surfaces the pane switches between for editable text files. + +```ts +type VaultEditorMode +``` + +### `VaultFile` + +`interface` — A loaded vault file: its text content plus optional preview hints. + +```ts +interface VaultFile +``` + +### `VaultMarkdownCodec` + +`interface` — Optional rich/source codec. + +```ts +interface VaultMarkdownCodec +``` + +### `VaultOperation` + +`type` — The Vault operation that failed at the product-owned data-port seam. + +```ts +type VaultOperation +``` + +### `VaultOperationFailure` + +`interface` — Structured failure reported to an optional host observer. + +```ts +interface VaultOperationFailure +``` + +### `VaultOperationPhase` + +`type` — Whether the operation itself failed or a mutation succeeded but its follow-up tree refresh did not. + +```ts +type VaultOperationPhase +``` + +### `VaultPane` + +`function` + +```ts +(props: VaultPaneProps) => Element +``` + +### `VaultPaneProps` + +`interface` — Define the properties and render methods for the vault pane UI components + +```ts +interface VaultPaneProps +``` + +### `VaultRichParts` + +`type` — The parsed form of a file's rich content. + +```ts +type VaultRichParts +``` + +### `VaultTreeNode` + +`interface` — One node in the vault tree. + +```ts +interface VaultTreeNode +``` + +### `VaultTreeRenderProps` + +`interface` — Props the pane passes to the product's tree renderer (e.g. + +```ts +interface VaultTreeRenderProps +``` + + +## `./vault/lazy` + +Source: `src/vault/lazy.tsx` + +### `VaultPaneLazy` + +`function` — Resolve VaultPane component lazily to optimize loading and improve performance + +```ts +LazyExoticComponent<(props: VaultPaneProps) => Element> +``` + +### `VaultPaneProps` + +`interface` — Define the properties and render methods for the vault pane UI components + +```ts +interface VaultPaneProps +``` + + +## `./web` + +Source: `src/web/index.ts` + +### `addSecurityHeaders` + +`function` — Set standard security headers on a response (HSTS, nosniff, frame-options, referrer-policy, XSS) + optional product disclaimer/retention. + +```ts +(response: Response, opts?: SecurityHeaderOptions) => Response +``` + +### `assertMediaUrl` + +`function` — Canonical media-reference boundary shared by every surface that persists a media url (sequences clips, design-canvas image/video src). + +```ts +(url: string, what?: string) => void +``` + +### `checkRateLimit` + +`function` — KV-backed sliding-window rate limit. + +```ts +(kv: KvLike, key: string, limit: number, windowSeconds: number) => Promise +``` + +### `clearCookieHeader` + +`function` — Set-Cookie header value that deletes the cookie (empty value, Max-Age=0). + +```ts +(opts: Omit) => string +``` + +### `CookieOptions` + +`interface` — Define options for configuring cookie attributes and behavior + +```ts +interface CookieOptions +``` + +### `extractRequestContext` + +`function` — Extract request context for audit trails. + +```ts +(request: Request) => RequestContext +``` + +### `JsonObject` + +`type` — Web-boundary utilities every agent app's routes hand-roll: JSON body parsing + narrowing, request-context extraction (real client IP behind Cloudflare), a KV-backed sliding-window rate limiter, and s… + +```ts +type JsonObject +``` + +### `KvLike` + +`interface` — Minimal KV contract (Cloudflare `KVNamespace` satisfies it structurally). + +```ts +interface KvLike +``` + +### `parseJsonObjectBody` + +`function` — Parse + object-narrow a Request body. + +```ts +(request: Request) => Promise<[JsonObject, null] | [null, Response]> +``` + +### `RateLimitResult` + +`interface` — Describe the outcome of a rate limit check including allowance, remaining count, and reset time + +```ts +interface RateLimitResult +``` + +### `readCookieValue` + +`function` — Read + decode one cookie from a Cookie request header; null when absent. + +```ts +(cookieHeader: string | null, name: string) => string | null +``` + +### `RequestContext` + +`interface` — Define the context of a request including IP address, user agent, timestamp, and request ID + +```ts +interface RequestContext +``` + +### `requireString` + +`function` — Narrow one required string field, 400 if missing/empty. + +```ts +(body: JsonObject, field: string) => string | Response +``` + +### `SecurityHeaderOptions` + +`interface` — Define options for configuring security-related HTTP headers including disclaimers and retention labels + +```ts +interface SecurityHeaderOptions +``` + +### `serializeCookie` + +`function` — Serialize a Set-Cookie header value: `name=encodeURIComponent(value)` plus attributes in Path / HttpOnly / SameSite / Max-Age / Secure order. + +```ts +(value: string, opts: CookieOptions) => string +``` + + +## `./web-react` + +Source: `src/web-react/index.tsx` · depends on `brand`, `chat-routes`, `chat-store`, `harness`, `interactions`, `missions`, `plans`, `runtime`, `trace` + +### `activityTone` + +`function` — Map a delegation status (free-form string on the wire) to a render tone. + +```ts +(status: string) => ActivityTone +``` + +### `ActivityTone` + +`type` + +```ts +type ActivityTone +``` + +### `AgentActivityPage` + +`interface` + +```ts +interface AgentActivityPage +``` + +### `AgentActivityPanel` + +`function` — The standalone cross-context delegation surface: every agent run the product journaled, mission-spawned or not, with status, cost, drill-in, and a mission link slot for promoted delegations. + +```ts +({ fetchActivity, renderMissionRef, title, emptyLabel }: AgentActivityPanelProps) => Element +``` + +### `AgentActivityPanelProps` + +`interface` + +```ts +interface AgentActivityPanelProps +``` + +### `AgentActivityRecord` + +`interface` — A delegation record on the cross-context surface; `missionRef` links a promoted delegation back to the mission/step that spawned it. + +```ts +interface AgentActivityRecord +``` + +### `AgentSessionControls` + +`function` + +```ts +(props: AgentSessionControlsProps) => Element +``` + +### `AgentSessionControlsProps` + +`interface` + +```ts +interface AgentSessionControlsProps +``` + +### `ATTACHMENT_ACCEPT` + +`const` — Accept list for the composer file picker + type validation, same grammar as the native `` attribute. + +```ts +"image/*,.pdf,.txt,.md,.csv,.json,.yaml,.yml,.html" +``` + +### `AttachmentFileResult` + +`type` — Typed outcome of fetching one attachment's raw bytes. + +```ts +type AttachmentFileResult +``` + +### `attachmentInputToPart` + +`function` — Drop absent/empty optional fields rather than persisting `undefined`/`''` — keeps stored parts minimal. + +```ts +(input: ChatAttachmentInput) => ChatAttachmentPart +``` + +### `attachmentKindForMime` + +`function` — `image` for any `image/*` mime, `file` for everything else (including an absent/empty mime) — the same split the composer and the persisted-part discriminant both key on. + +```ts +(mime?: string | undefined) => ChatAttachmentKind +``` + +### `attachmentPartKey` + +`function` — Stream/transcript part key for a promoted (path-bearing) attachment, keyed on its storage path — re-emitting the same path folds into the same segment instead of duplicating it. + +```ts +(path: string) => string +``` + +### `attachmentPartsFromMessageParts` + +`function` — Every attachment part on one message's stored `parts`, in stored order. + +```ts +(parts: readonly Record[] | null | undefined) => ChatAttachmentPart[] +``` + +### `base64WireLen` + +`function` — Size a base64-encoded string occupies on the wire given the raw (pre-encoding) byte length: base64 packs 3 raw bytes into 4 output characters, rounded up to the next multiple of 4. + +```ts +(byteLen: number) => number +``` + +### `buildAnswerData` + +`function` — All required fields answered → the respond payload; else null (not submittable yet). + +```ts +(fields: ChatInteractionField[], values: FieldValues) => Record | null +``` + +### `buildMentionPromptBlock` + +`function` — The agent-facing pointer block appended to the dispatched prompt — never persisted in message `content`. + +```ts +(mentions: readonly Pick[]) => string +``` + +### `cancelChatInteraction` + +`function` — Applies an `interaction.cancel` event: only a pending ask moves, to `expired` (reason:"timeout") or `cancelled`. + +```ts +(list: ChatInteraction[], cancel: InteractionCancelData) => ChatInteraction[] +``` + +### `cancelStatusFor` + +`function` — Maps an `interaction.cancel` reason to the card's terminal status. + +```ts +(reason: string | undefined) => ChatInteractionStatus +``` + +### `canTransitionInteractionStatus` + +`function` — Statuses only move forward (pending → terminal); a replayed/stale `pending` must never resurrect a resolved card. + +```ts +(from: ChatInteractionStatus, to: ChatInteractionStatus) => boolean +``` + +### `CatalogModel` + +`interface` — Define the structure and capabilities of a catalog item with optional pricing and feature flags + +```ts +interface CatalogModel +``` + +### `ChatAttachmentInput` + +`interface` — `POST` turn-body entry describing a file already uploaded to the product's store (vault/object-store) — distinct from an inline {@link * ChatTurnFilePartInput} (which carries bytes) and from a {@link… + +```ts +interface ChatAttachmentInput +``` + +### `ChatAttachmentKind` + +`type` — The image/file split an attachment is rendered and persisted under — the same discriminant as {@link ChatMentionKind}, but a distinct name because an attachment carries content the product uploaded (… + +```ts +type ChatAttachmentKind +``` + +### `ChatAttachmentPart` + +`interface` — Persisted attachment part: structurally an attachment-flavored `ChatFilePart` / `ChatImagePart` (`path` + `name` promoted to required) rather than a separate union member — see the section note above. + +```ts +interface ChatAttachmentPart +``` + +### `ChatComposer` + +`function` + +```ts +({ onSend, onSendParts, onCancel, isStreaming, disabled, placeholder, value, onValueChange, initialValue, seed, onSeedA… +``` + +### `ChatComposerProps` + +`interface` + +```ts +interface ChatComposerProps +``` + +### `ChatEmptyDoor` + +`interface` — One starting "door" in the chat first-run state — a concrete, labeled action (start from a template, do it by hand, ask the agent), not a placeholder. + +```ts +interface ChatEmptyDoor +``` + +### `ChatEmptyState` + +`function` — Branded chat first-run state: the Tangle mark, a delegation-framed prompt, and up to three concrete doors. + +```ts +({ productName, headline, subline, doors, }: ChatEmptyStateProps) => Element +``` + +### `ChatEmptyStateProps` + +`interface` — Define properties for rendering the chat empty state with customizable text and starting doors + +```ts +interface ChatEmptyStateProps +``` + +### `ChatInteraction` + +`interface` — The client/persisted view of one ask. + +```ts +interface ChatInteraction +``` + +### `ChatInteractionField` + +`type` — Resolve a chat interaction field excluding select types or including chat select fields + +```ts +type ChatInteractionField +``` + +### `ChatInteractionRestoreMode` + +`type` — Define modes for restoring chat interactions with legacy or durable strategies + +```ts +type ChatInteractionRestoreMode +``` + +### `ChatInteractionStatus` + +`type` — Define possible statuses representing the state of a chat interaction + +```ts +type ChatInteractionStatus +``` + +### `ChatMentionKind` + +`type` — The image/file split a mention is rendered and persisted under — the composer pill's icon, the dispatched part's `type`, and `ChatMentionPart.mentionKind` are all this one value. + +```ts +type ChatMentionKind +``` + +### `ChatMentionPart` + +`interface` — A file the user `@`-mentioned on this turn: a workspace-relative path into the sandbox, never bytes. + +```ts +interface ChatMentionPart +``` + +### `ChatMessageMetrics` + +`interface` — Describe metrics related to a chat message including model, token counts, and duration + +```ts +interface ChatMessageMetrics +``` + +### `ChatMessages` + +`function` — The message thread: one centered column; user messages are right-aligned bubbles with a User label; agent messages carry an Agent meta line with model id, tokens/sec, and cost, plus a collapsible thi… + +```ts +({ messages, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, approval, onToolCallCl… +``` + +### `ChatMessageSegment` + +`type` — One ordered piece of an assistant turn: a run of answer text, or a tool call, in the sequence the agent emitted them. + +```ts +type ChatMessageSegment +``` + +### `ChatMessagesProps` + +`interface` — Define properties for rendering chat messages with optional models, markdown, extras, and durable cards + +```ts +interface ChatMessagesProps +``` + +### `ChatSelectField` + +`type` — Extract select-type interaction fields and optionally allow custom values + +```ts +type ChatSelectField +``` + +### `ChatStreamCallbacks` + +`interface` — Define callbacks to handle events and data during a chat streaming session + +```ts +interface ChatStreamCallbacks +``` + +### `ChatStreamToolCall` + +`interface` — Define the structure for a chat tool call including optional ID, name, and arguments object + +```ts +interface ChatStreamToolCall +``` + +### `ChatStreamToolResult` + +`interface` — Describe the result of a chat stream tool including its outcome and optional metadata fields + +```ts +interface ChatStreamToolResult +``` + +### `ChatToolCallInfo` + +`interface` — Describe the structure and state of a tool call within a chat interaction + +```ts +interface ChatToolCallInfo +``` + +### `ChatTurnFilePartInput` + +`interface` — A non-text prompt part the upload route hands back and the client echoes on send. + +```ts +interface ChatTurnFilePartInput +``` + +### `ChatTurnPartInput` + +`type` — Resolve input as either a text part or a file part of a chat turn + +```ts +type ChatTurnPartInput +``` + +### `chatTurnRequestInit` + +`function` — `fetch` init for the turn route — the one place the client wire shape is serialized, so composer glue and products never drift from the server's parser. + +```ts +(payload: ChatTurnRequestPayload) => RequestInit +``` + +### `ChatTurnRequestPayload` + +`interface` — POST body for the turn route. + +```ts +interface ChatTurnRequestPayload +``` + +### `ChatUiMessage` + +`interface` — Describe the structure and properties of a chat message with roles, content, and optional metadata + +```ts +interface ChatUiMessage +``` + +### `composerAnswerData` + +`function` — Shapes composer text into the respond payload for the routed field (select answers are string arrays on the wire; text answers are strings). + +```ts +(field: ChatInteractionField, text: string) => Record +``` + +### `composerAnswerDeliveries` + +`function` — One delivery per pending ask: the first free-text-capable field, else the first field. + +```ts +(pending: ChatInteraction[]) => ComposerAnswerDelivery[] +``` + +### `ComposerAnswerDelivery` + +`interface` — Define the structure for delivering answers linked to a specific chat interaction and field + +```ts +interface ComposerAnswerDelivery +``` + +### `ComposerFile` + +`interface` + +```ts +interface ComposerFile +``` + +### `ComposerFilePart` + +`interface` — Prompt-part descriptor an uploaded file carries (the upload route's `UploadedChatFile.part`), echoed back in the turn body on send. + +```ts +interface ComposerFilePart +``` + +### `ComposerMentionProp` + +`interface` — Mirrors sandbox-ui#184's `AgentComposerProps['mention']` shape — plug the hook's `mention` return value straight into that prop. + +```ts +interface ComposerMentionProp +``` + +### `consumeChatStream` + +`function` — Drain one NDJSON body into the callbacks. + +```ts +(body: ReadableStream>, cb: ChatStreamCallbacks) => Promise +``` + +### `ConsumeChatStreamResult` + +`interface` — Represent the result of consuming a chat stream including turn ID and content reception status + +```ts +interface ConsumeChatStreamResult +``` + +### `createDurableInteractionAnswerSubmitter` + +`function` — Answer submitter for a durable interaction route. + +```ts +(options: DurableInteractionAnswerSubmitterOptions) => SubmitInteractionAnswer +``` + +### `createDurablePlanDecisionClient` + +`function` — Browser client for the shared durable-plan route. + +```ts +(options: DurablePlanDecisionClientOptions) => DurablePlanDecisionClient +``` + +### `createInteractionAnswerSubmitter` + +`function` — Builds the `SubmitInteractionAnswer` the cards consume: POSTs `{ ...routingFields, id, outcome, data? + +```ts +(options: InteractionAnswerSubmitterOptions) => SubmitInteractionAnswer +``` + +### `createMemoryInteractionAttemptStore` + +`function` — Create an in-memory store to manage interaction attempts keyed by ID and signature + +```ts +() => InteractionAttemptStore +``` + +### `createSessionInteractionAttemptStore` + +`function` — Create a session-based store to manage interaction attempts using provided storage and optional namespace + +```ts +(storage: Pick, namespace?: string) => InteractionAttemptStore +``` + +### `dedupeQuestionInteractionsByContent` + +`function` — Remove duplicate question interactions based on their content signature to ensure uniqueness + +```ts +(interactions: ChatInteraction[]) => ChatInteraction[] +``` + +### `DEFAULT_EFFORT_LEVELS` + +`const` + +```ts +readonly EffortLevel[] +``` + +### `DEFAULT_MENTION_EMPTY_TEXT` + +`const` — Popover empty-state copy for a `ready` index whose query matched nothing. + +```ts +"No matching files" +``` + +### `DEFAULT_MENTION_LIMIT` + +`const` — Max popover results per query — enough to show a useful spread of matches without pushing the fuzzy-filtered list past what a popover can usefully render in one screen. + +```ts +20 +``` + +### `DISPATCH_MAX_MEDIA_PARTS` + +`const` — Product-side cap on media parts per dispatch (current turn + carried history), well under {@link DISPATCH_MAX_PARTS}. + +```ts +24 +``` + +### `DISPATCH_MAX_PARTS` + +`const` — Sidecar's hard cap on the `parts` array of one prompt request — a dispatch must never assemble more parts than this or the whole turn 400s. + +```ts +64 +``` + +### `DISPATCH_REQUEST_MAX_BYTES` + +`const` — Hard cap on the whole `/prompt` request body as it crosses the sandbox proxy — smaller in practice than a raw-file write cap because a dispatch carries several inline parts plus the flattened history… + +```ts +number +``` + +### `DISPATCH_STRUCTURAL_RESERVE_BYTES` + +`const` — Bytes reserved off the top of {@link DISPATCH_REQUEST_MAX_BYTES} for the JSON structure around the parts array (keys, delimiters, per-part `type`/`filename`/`mediaType` fields) that {@link base64Wire… + +```ts +number +``` + +### `dispatchChatStreamLine` + +`function` — Parse one NDJSON line into the callbacks. + +```ts +(line: string, cb: ChatStreamCallbacks) => { turnId?: string | undefined; receivedContent: boolean; } +``` + +### `DurableChatCard` + +`type` + +```ts +type DurableChatCard +``` + +### `DurableChatCards` + +`function` — Ready-to-embed canonical question/plan card lane for persisted assistant parts. + +```ts +({ parts, canWrite, submitInteraction, decidePlan, decidingPlan, planError, onInteractionResolved, onLateAnswer, onReRe… +``` + +### `durableChatCardsFromParts` + +`function` — Converts persisted/live parts to canonical cards. + +```ts +(parts: Record[]) => DurableChatCard[] +``` + +### `DurableChatCardsProps` + +`interface` + +```ts +interface DurableChatCardsProps +``` + +### `DurableInteractionAnswerSubmitterOptions` + +`interface` — Define options for submitting durable interaction answers with attempt tracking and optional key creation + +```ts +interface DurableInteractionAnswerSubmitterOptions +``` + +### `DurablePlanCard` + +`function` + +```ts +({ plan, canWrite, decide, deciding, error, renderMarkdown, className, }: DurablePlanCardProps) => Element +``` + +### `DurablePlanCardProps` + +`interface` + +```ts +interface DurablePlanCardProps +``` + +### `DurablePlanClientError` + +`class` — Represent errors from DurablePlanClient operations including status, code, and current plan details + +```ts +class DurablePlanClientError +``` + +### `DurablePlanCurrentInput` + +`interface` — Define input parameters for retrieving the current durable plan including optional revision number + +```ts +interface DurablePlanCurrentInput +``` + +### `DurablePlanDecision` + +`type` — Represent durable plan decisions as either approved or rejected + +```ts +type DurablePlanDecision +``` + +### `DurablePlanDecisionClient` + +`interface` — Define methods to obtain and decide durable plan decisions asynchronously + +```ts +interface DurablePlanDecisionClient +``` + +### `DurablePlanDecisionClientOptions` + +`interface` — Define configuration options for creating a durable plan decision client + +```ts +interface DurablePlanDecisionClientOptions +``` + +### `DurablePlanDecisionInput` + +`interface` — Define input parameters for making a durable plan decision including optional feedback + +```ts +interface DurablePlanDecisionInput +``` + +### `DurablePlanDecisionResult` + +`interface` — Describe the result of a durable plan decision including plan details and pending statuses + +```ts +interface DurablePlanDecisionResult +``` + +### `DurablePlanFollowUpReceipt` + +`interface` — Stable authority receipt for the follow-up turn dispatched by a plan decision. + +```ts +interface DurablePlanFollowUpReceipt +``` + +### `EffortLevel` + +`interface` — One reasoning-budget level: the engine `id` is unchanged (the value the product sends to the loop); only the user-facing `label` is renamed to the plainer "how hard should it think" vocabulary from d… + +```ts +interface EffortLevel +``` + +### `EffortPicker` + +`function` — Thinking-budget selector pill, styled to match {@link ModelPicker}. + +```ts +({ value, onChange, levels, label }: EffortPickerProps) => Element +``` + +### `EffortPickerProps` + +`interface` + +```ts +interface EffortPickerProps +``` + +### `fieldAcceptsFreeText` + +`function` — Determine if a chat interaction field allows free text input + +```ts +(field: ChatInteractionField) => boolean +``` + +### `fieldAnswer` + +`function` — The submitted value for one field, or null when it has no answer yet. + +```ts +(field: ChatInteractionField, values: FieldValues) => string | number | boolean | string[] | null +``` + +### `FieldValues` + +`type` — Define a record mapping field names to objects with optional selected, text, and custom string arrays or values + +```ts +type FieldValues +``` + +### `fieldValuesFromAnswers` + +`function` — Converts acknowledged, persisted answers back into the local field state consumed by the shared cards. + +```ts +(fields: ChatInteractionField[], answers: InteractionAnswers | undefined) => FieldValues +``` + +### `FileIndexReadyResponse` + +`interface` — Describe a ready file index response with workspace-relative entries and truncation status + +```ts +interface FileIndexReadyResponse +``` + +### `FileIndexResponse` + +`type` — Resolve a response indicating the file index is either ready or warming up + +```ts +type FileIndexResponse +``` + +### `FileIndexWarmingResponse` + +`interface` — Cold-box answer: no provisioning happened, no files were scanned. + +```ts +interface FileIndexWarmingResponse +``` + +### `FileMention` + +`interface` — A file mention resolved from the composer's `@`-picker: the workspace-relative path plus enough metadata to build a prompt part and pointer text. + +```ts +interface FileMention +``` + +### `fileMentionsToParts` + +`function` — Maps resolved file mentions to path-only `ChatTurnFilePartInput`s — `image` vs `file` by extension, and always a `path`, never a `url` (the url/path XOR invariant: a mention is a sandbox path referen… + +```ts +(mentions: readonly FileMention[], opts?: FileMentionsToPartsOptions) => ChatTurnFilePartInput[] +``` + +### `FlowWaterfall` + +`function` — Compact proportional waterfall over a FlowTrace — span name, bar, duration per row; total + cost in the footer. + +```ts +({ trace }: FlowWaterfallProps) => Element | null +``` + +### `FlowWaterfallProps` + +`interface` + +```ts +interface FlowWaterfallProps +``` + +### `formatActivityCost` + +`function` — "$0.4000" under a cent shows 4 decimals; null when unknown/zero. + +```ts +(costUsd?: number | undefined) => string | null +``` + +### `formatActivityDuration` + +`function` — "8s" / "2m 05s" / "1h 12m"; null when unknown. + +```ts +(durationMs?: number | undefined) => string | null +``` + +### `formatModelCost` + +`function` — "$0.0042" from token counts × catalogue per-token pricing; null when unknown. + +```ts +(msg: ChatMessageMetrics, models: CatalogModel[]) => string | null +``` + +### `formatTokensPerSecond` + +`function` — "38 tok/s" from completion tokens over first-token→end duration; null when unknown. + +```ts +(msg: ChatMessageMetrics) => string | null +``` + +### `hasSecretField` + +`function` — Secrets must never leave the sidecar answer channel for the visible chat transcript, so a secret-bearing ask cannot be late-answered. + +```ts +(fields: ChatInteractionField[]) => boolean +``` + +### `hydrateChatInteractions` + +`function` — Applies transcript/state-store projections after reload. + +```ts +(list: ChatInteraction[], persisted: ChatInteraction[]) => ChatInteraction[] +``` + +### `INDEX_REFRESH_AFTER_MS` + +`const` — How long a `ready` index is served before a background refetch — long enough that a full session's worth of popover opens don't repeatedly hit the index endpoint, short enough that a stale listing do… + +```ts +number +``` + +### `INTERACTION_CANCEL_EVENT` + +`const` — Sidecar → client: the ask was withdrawn; data = `{ id, reason? + +```ts +"interaction.cancel" +``` + +### `INTERACTION_EVENT` + +`const` — Sidecar → client: the agent raised an ask; data = `{ request }`. + +```ts +"interaction" +``` + +### `INTERACTION_RESOLVED_EVENT` + +`const` — An ask was answered; data = `{ id, status }`. + +```ts +"interaction.resolved" +``` + +### `INTERACTION_SUBMIT_TIMEOUT_MESSAGE` + +`const` — Provide the timeout message displayed when the agent cannot be reached during interaction submission + +```ts +"Could not reach the agent. Try again." +``` + +### `INTERACTION_SUBMIT_TIMEOUT_MS` + +`const` — Define the timeout duration in milliseconds for submitting an interaction + +```ts +30000 +``` + +### `InteractionActionButton` + +`function` + +```ts +({ variant, onClick, disabled, children, }: { variant?: "primary" | "outline" | undefined; onClick: () => void; disable… +``` + +### `InteractionAnswers` + +`type` — Map interaction identifiers to their corresponding answer values + +```ts +type InteractionAnswers +``` + +### `InteractionAnswerSubmission` + +`interface` — One card submission: which ask, resolved how, with what answers. + +```ts +interface InteractionAnswerSubmission +``` + +### `InteractionAnswerSubmitterOptions` + +`interface` — Define options for submitting interaction answers including URL, body, timeout, and fetch implementation + +```ts +interface InteractionAnswerSubmitterOptions +``` + +### `InteractionAnswerValue` + +`type` — Accepted answer values. + +```ts +type InteractionAnswerValue +``` + +### `InteractionAttemptStore` + +`interface` — Manage storage and retrieval of interaction attempt keys by interaction and submission identifiers + +```ts +interface InteractionAttemptStore +``` + +### `InteractionBadge` + +`function` + +```ts +({ variant, children }: { variant: InteractionBadgeVariant; children: string; }) => Element +``` + +### `InteractionBadgeVariant` + +`type` + +```ts +type InteractionBadgeVariant +``` + +### `InteractionCancelData` + +`interface` — Describe data required to cancel an interaction including its identifier and optional reason + +```ts +interface InteractionCancelData +``` + +### `InteractionData` + +`type` + +```ts +type InteractionData +``` + +### `interactionFromWireRequest` + +`function` — Reads a wire request into the client's pending `ChatInteraction`. + +```ts +(request: InteractionRequestWire) => ChatInteraction +``` + +### `InteractionOutcome` + +`type` + +```ts +type InteractionOutcome +``` + +### `interactionPartKey` + +`function` — Generate a unique key string for an interaction using the given identifier + +```ts +(id: string) => string +``` + +### `InteractionPersistedPart` + +`type` — Persisted-part shapes the codecs below produce — the SAME rows `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the source so a product pushing them into a `ChatMessagePart[]` t… + +```ts +type InteractionPersistedPart +``` + +### `InteractionPlanCard` + +`function` + +```ts +({ interaction, canWrite, submitAnswer, onResolved, onReRequest, reRequestLabel, renderMarkdown, className, }: Interact… +``` + +### `InteractionPlanCardProps` + +`interface` + +```ts +interface InteractionPlanCardProps +``` + +### `InteractionQuestionCard` + +`function` + +```ts +({ interaction, canWrite, submitAnswer, onResolved, onLateAnswer, className, }: InteractionQuestionCardProps) => Element +``` + +### `InteractionQuestionCardProps` + +`interface` + +```ts +interface InteractionQuestionCardProps +``` + +### `InteractionRequest` + +`type` + +```ts +type InteractionRequest +``` + +### `InteractionRequestWire` + +`type` — `InteractionRequest` whose select fields may carry `allowCustom`. + +```ts +type InteractionRequestWire +``` + +### `interactionStatusLabels` + +`function` — Status-badge labels for an interaction card. + +```ts +(labels: { pending: string; answered: string; declined: string; }) => Record +``` + +### `interactionSubmissionSignature` + +`function` — Generate a stable string signature from an interaction answer submission + +```ts +(submission: InteractionAnswerSubmission) => string +``` + +### `InteractionSubmitResult` + +`type` — Resolve the result of an interaction submission indicating success or failure with details + +```ts +type InteractionSubmitResult +``` + +### `interactionTerminalNotes` + +`function` — Terminal-state notes for an interaction card. + +```ts +(noun: string, extra?: Partial> | undefined) => Partial part is ChatAttachmentPart +``` + +### `isLateAnswerableStatus` + +`function` — Determine if a status is late answerable by checking if it is expired or cancelled + +```ts +(status: ChatInteractionStatus) => boolean +``` + +### `isRenderableInteractionKind` + +`function` — Resolve if the given interaction kind is renderable within the application context + +```ts +(kind: string) => boolean +``` + +### `isSafeInteractionFieldKey` + +`function` — Answer/field keys the sidecar will accept: identifier-safe and never a prototype-pollution vector. + +```ts +(key: string) => boolean +``` + +### `isTerminalInteractionStatus` + +`function` — Resolve if the interaction status is a terminal state excluding pending + +```ts +(status: ChatInteractionStatus) => boolean +``` + +### `lateAnswerMessage` + +`function` — Renders the late answer as a self-contained chat message: the original question, its context, and the user's answer(s). + +```ts +(interaction: ChatInteraction, data: Record) => string +``` + +### `loadAttachmentFile` + +`function` — Fetches (and caches) the raw bytes behind one attachment url. + +```ts +(url: string, fetchFile?: (url: string) => Promise) => Promise +``` + +### `mediaTypeForMentionPath` + +`function` — The `image/*` mime for a mention path by extension, or `undefined` for anything not in the known image set (dispatched as `type: 'file'`). + +```ts +(path: string) => string | undefined +``` + +### `mentionInputToPart` + +`function` — A validated wire mention (`parseFileMentions` in `/chat-routes`) as the part the turn route persists. + +```ts +(input: FileMention) => ChatMentionPart +``` + +### `MentionItem` + +`interface` — Mirrors sandbox-ui#184's `MentionItem` — the atomic pill's payload. + +```ts +interface MentionItem +``` + +### `mentionKindForPath` + +`function` — `image` when the path's extension is in the known image set (the same table {@link mediaTypeForMentionPath} reads), `file` otherwise. + +```ts +(path: string) => ChatMentionKind +``` + +### `mentionPartsFromMessageParts` + +`function` — Every mention part on one message, in stored order. + +```ts +(parts: readonly Record[] | readonly ChatMessagePart[] | null | undefined) => ChatMentionPart[] +``` + +### `MentionTextSegment` + +`interface` — One run of a segmented message: literal prose, or a matched mention with the part that produced it. + +```ts +interface MentionTextSegment +``` + +### `mergeActivityPages` + +`function` — Fold a fetched page into the held rows: dedupe by `taskId` with the incoming row winning (a refresh re-fetches the head page, so newer snapshots of in-flight runs replace stale ones), newest `started… + +```ts +(existing: AgentActivityRecord[], incoming: AgentActivityRecord[]) => AgentActivityRecord[] +``` + +### `MessageAttachments` + +`function` — Renders a message's attachment parts as a row of image thumbnails and file chips. + +```ts +({ parts, resolveFileUrl, justify, fetchFile }: MessageAttachmentsProps) => ReactNode +``` + +### `MessageAttachmentsProps` + +`interface` + +```ts +interface MessageAttachmentsProps +``` + +### `MissionActivityLane` + +`function` — Collapsed sub-rows under a mission step — one row per delegated run — expanding to the step's waterfall. + +```ts +({ activity, startedAt, nowMs }: MissionActivityLaneProps) => Element | null +``` + +### `MissionActivityLaneProps` + +`interface` + +```ts +interface MissionActivityLaneProps +``` + +### `ModelPicker` + +`function` — Searchable model picker pill + popover: a featured/recommended section first, then per-provider groups in catalogue order (the server already sorts providers by tier). + +```ts +({ value, onChange, models, loading, renderProviderBadge, recommendedLabel, priorityGroup }: ModelPickerProps) => Eleme… +``` + +### `ModelPickerProps` + +`interface` + +```ts +interface ModelPickerProps +``` + +### `nextRevealCount` + +`function` — Pure reveal step: how many characters should be visible after `dtMs`. + +```ts +(shown: number, targetLength: number, dtMs: number, opts?: SmoothRevealOptions) => number +``` + +### `NoticeKind` + +`type` — Define specific string literals representing different kinds of notices + +```ts +type NoticeKind +``` + +### `noticePart` + +`function` — Builds the persisted/streamed `notice` part — a one-line transcript notice explaining an out-of-band event (warning, auto-declined interaction). + +```ts +(noticeKind: NoticeKind, id: string, text: string) => NoticePersistedPart +``` + +### `noticePartKey` + +`function` — Generate a unique key string for a notice using the given identifier + +```ts +(id: string) => string +``` + +### `NoticePersistedPart` + +`type` — Define a persisted notice part with type, id, kind, and text properties + +```ts +type NoticePersistedPart +``` + +### `parseInteractionAnswers` + +`function` — Strictly validates and copies persisted answer selections. + +```ts +(value: unknown) => ParseInteractionAnswersResult +``` + +### `ParseInteractionAnswersResult` + +`type` — Resolve the result of parsing interaction answers with success status and corresponding data or error message + +```ts +type ParseInteractionAnswersResult +``` + +### `parseInteractionCancel` + +`function` — Parse interaction cancel data and return success status with parsed value or error message + +```ts +(data: Record | undefined) => { succeeded: true; value: InteractionCancelData; } | { succeeded: false;… +``` + +### `parseInteractionRequest` + +`function` — Parses an `interaction` event's data (`{ request }`). + +```ts +(data: Record | undefined) => ParseInteractionResult +``` + +### `ParseInteractionResult` + +`type` — Resolve interaction parsing outcome as success with value or failure with error message + +```ts +type ParseInteractionResult +``` + +### `pendingApprovalOf` + +`function` — Extract `{proposalId, status}` from a tool outcome when it is a proposal awaiting human approval; null otherwise. + +```ts +(call: ChatToolCallInfo) => { proposalId: string; } | null +``` + +### `persistedPartToInteraction` + +`function` — Reads a persisted/streamed `interaction` part back into a `ChatInteraction`. + +```ts +(part: Record) => ChatInteraction | null +``` + +### `ProducerErrorEvent` + +`interface` — Represent an error event emitted by a producer containing message, code, and optional details + +```ts +interface ProducerErrorEvent +``` + +### `ProducerNoticeEvent` + +`interface` — Define the structure for a producer notice event with type, id, kind, and text fields + +```ts +interface ProducerNoticeEvent +``` + +### `ProducerPassthroughEvent` + +`interface` — Define an event carrying passthrough data with flexible properties for producer communication + +```ts +interface ProducerPassthroughEvent +``` + +### `ProducerPassthroughEventType` + +`type` — Stable raw lifecycle/interaction/plan/route events forwarded unchanged. + +```ts +type ProducerPassthroughEventType +``` + +### `ProducerReasoningEvent` + +`interface` — Define an event representing reasoning output with a fixed type and associated text + +```ts +interface ProducerReasoningEvent +``` + +### `ProducerTextEvent` + +`interface` — Represent a text event produced by a source with a fixed type and associated text content + +```ts +interface ProducerTextEvent +``` + +### `ProducerToolCallEvent` + +`interface` — Represent an event triggered by a producer tool call with its identifier, name, and arguments + +```ts +interface ProducerToolCallEvent +``` + +### `ProducerToolResultEvent` + +`interface` — Describe the structure of an event representing the result of a producer tool call + +```ts +interface ProducerToolResultEvent +``` + +### `ProducerUsageEvent` + +`interface` — Describe usage event with prompt and completion token counts for a producer + +```ts +interface ProducerUsageEvent +``` + +### `ProducerWireEvent` + +`type` — Represent events emitted by a producer during its operation for processing and handling + +```ts +type ProducerWireEvent +``` + +### `ProposalApprovalHandlers` + +`interface` — Handle approval and rejection actions for proposals with asynchronous support + +```ts +interface ProposalApprovalHandlers +``` + +### `ProviderLogo` + +`function` — Real brand mark when we have one; tinted monogram otherwise. + +```ts +({ provider, size }: ProviderLogoProps) => ReactNode +``` + +### `ProviderLogoProps` + +`interface` + +```ts +interface ProviderLogoProps +``` + +### `questionInteractionContentSignature` + +`function` — Content identity for duplicate safety nets. + +```ts +(interaction: ChatInteraction) => string | null +``` + +### `QuestionOptionList` + +`function` — The radio/checkbox option rows for a select field. + +```ts +({ groupName, idPrefix, options, multi, selectedValues, disabled, onToggle, }: QuestionOptionListProps) => Element +``` + +### `QuestionOptionListProps` + +`interface` + +```ts +interface QuestionOptionListProps +``` + +### `rankFileMentions` + +`function` — Ranks `files` against `query` (case-insensitive), capped to `limit`: name-prefix matches first, then name-substring, then path-substring. + +```ts +(files: readonly FileMention[], query: string, limit: number) => FileMention[] +``` + +### `resolveChatInteraction` + +`function` — Marks one ask resolved locally (the card's `onResolved`). + +```ts +(list: ChatInteraction[], id: string, status: "answered" | "declined" | "cancelled" | "expired", answers?: InteractionA… +``` + +### `responseErrorMessage` + +`function` — Extracts the most specific error message a route returned. + +```ts +(res: Response) => Promise<{ code?: string | undefined; message: string; }> +``` + +### `restoreChatInteractions` + +`function` — Reload restore from the answer route's GET list. + +```ts +(list: ChatInteraction[], outstanding: InteractionRequestWire[], options?: RestoreChatInteractionsOptions) => ChatInter… +``` + +### `RestoreChatInteractionsOptions` + +`interface` — Define options to control how chat interactions are restored during the restore process + +```ts +interface RestoreChatInteractionsOptions +``` + +### `RunDrillIn` + +`function` — Readonly side panel showing a retained tool run's transcript — the "drill into what the sandbox actually did" view. + +```ts +({ run, onClose }: RunDrillInProps) => Element +``` + +### `RunDrillInProps` + +`interface` — Define properties required to run a drill and handle its closure event + +```ts +interface RunDrillInProps +``` + +### `SandboxTerminalConnection` + +`interface` — Define the connection details and status for a sandbox terminal session + +```ts +interface SandboxTerminalConnection +``` + +### `SandboxTerminalConnectionResponse` + +`interface` — Define the response structure for a sandbox terminal connection including URLs, token, status, and errors + +```ts +interface SandboxTerminalConnectionResponse +``` + +### `SeatPaywall` + +`function` — Centered card paywall. + +```ts +({ product, onCheckout, priceUsd, includedUsageUsd, tagline, ctaLabel, benefits, footnote, }: SeatPaywallProps) => Reac… +``` + +### `SeatPaywallProps` + +`interface` + +```ts +interface SeatPaywallProps +``` + +### `segmentMentionContent` + +`function` — Split a message's text into plain-text and mention segments by matching `@` runs against that message's own mention parts. + +```ts +(content: string, parts: readonly ChatMentionPart[]) => { segments: MentionTextSegment[]; matched: Set… +``` + +### `SmoothRevealOptions` + +`interface` — Define configuration options for controlling smooth text reveal animation rates + +```ts +interface SmoothRevealOptions +``` + +### `stampInteractionAnswers` + +`function` — Stamps accepted values onto matching persisted interaction parts without mutating the caller's transcript or answer maps. + +```ts +(parts: Record[], answersByInteractionId: Readonly>) => Record Promise +``` + +### `SubmitInteractionAnswer` + +`type` — The cards' only side-effect seam: POST one resolution, report the normalized outcome. + +```ts +type SubmitInteractionAnswer +``` + +### `tabTerminalConnectionId` + +`function` — Stable-per-tab, unique-per-client terminal connection id. + +```ts +(storageKey?: string) => string +``` + +### `terminalizePendingChatInteractions` + +`function` — Settles every still-pending ask when the turn ends: `answered` for a turn that completed cleanly, `expired` for one that failed. + +```ts +(list: ChatInteraction[], status: "answered" | "expired") => ChatInteraction[] +``` + +### `ToolDetailRenderers` + +`type` — Per-tool custom detail renderers for the expanded card body — keyed by tool name. + +```ts +type ToolDetailRenderers +``` + +### `ToolRunRecord` + +`interface` — A retained tool run keyed by the parent message's toolCallId. + +```ts +interface ToolRunRecord +``` + +### `ToolRunStep` + +`interface` — One step of a retained tool run (e.g. + +```ts +interface ToolRunStep +``` + +### `triggerAttachmentDownload` + +`function` — Drives an anchor-click download from an already-resolved blob. + +```ts +(name: string, blob: Blob) => { ok: true; } | { ok: false; message: string; } +``` + +### `upsertChatInteraction` + +`function` — Insert or update one interaction. + +```ts +(list: ChatInteraction[], interaction: ChatInteraction) => ChatInteraction[] +``` + +### `useChatInteractions` + +`function` — Manage chat interactions state with upsert, cancel, resolve, and restore capabilities + +```ts +(options?: RestoreChatInteractionsOptions) => UseChatInteractionsResult +``` + +### `UseChatInteractionsOptions` + +`type` — Resolve options for restoring chat interactions from previous sessions + +```ts +type UseChatInteractionsOptions +``` + +### `UseChatInteractionsResult` + +`interface` — Resolve and manage chat interactions with methods to update, cancel, mark resolved, and restore state + +```ts +interface UseChatInteractionsResult +``` + +### `useComposerAttachments` + +`function` — Owns the composer's attachment lifecycle: validate selected/dropped/pasted files against the shared limits, upload each accepted file to the product's store (one request per file), and track every fi… + +```ts +(options: UseComposerAttachmentsOptions) => UseComposerAttachmentsResult +``` + +### `UseComposerAttachmentsOptions` + +`interface` — Define options for configuring file upload behavior and handling in a composer component + +```ts +interface UseComposerAttachmentsOptions +``` + +### `UseComposerAttachmentsResult` + +`interface` — Provide staged file chips, ready attachments, and methods to add, retry, or drop composer files + +```ts +interface UseComposerAttachmentsResult +``` + +### `useDurablePlanFlow` + +`function` — Shared plan decision controller. + +```ts +(options: UseDurablePlanFlowOptions) => UseDurablePlanFlowResult +``` + +### `UseDurablePlanFlowOptions` + +`interface` — Define options to configure durable plan flow with plan, client, and optional callbacks + +```ts +interface UseDurablePlanFlowOptions +``` + +### `UseDurablePlanFlowResult` + +`interface` — Define the result and actions for managing a durable plan flow including decisions, restoration, and error handling + +```ts +interface UseDurablePlanFlowResult +``` + +### `useFileMentions` + +`function` — Resolve and manage file mention data with configurable fetching and state handling + +```ts +(options: UseFileMentionsOptions) => UseFileMentionsResult +``` + +### `UseFileMentionsOptions` + +`interface` — Define options for configuring file mention fetching, caching, and display behavior + +```ts +interface UseFileMentionsOptions +``` + +### `UseFileMentionsResult` + +`interface` — Provide properties and methods to manage and refresh file mentions in a composer interface + +```ts +interface UseFileMentionsResult +``` + +### `usePending` + +`function` — Guard an async action against double-submit. + +```ts +() => { pending: boolean; run: (action: () => void | Promise) => void; } +``` + +### `usePopover` + +`function` — Keyboard + pointer model for a trigger-and-popover pair, dependency-free. + +```ts +(open: boolean, setOpen: (open: boolean) => void) => { containerRef: RefObject; triggerRef: RefO… +``` + +### `useSandboxTerminalConnection` + +`function` — Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling + +```ts +(opts: UseSandboxTerminalConnectionOptions) => UseSandboxTerminalConnectionResult +``` + +### `UseSandboxTerminalConnectionOptions` + +`interface` — Define options for configuring a sandbox terminal connection including workspace ID and connection parameters + +```ts +interface UseSandboxTerminalConnectionOptions +``` + +### `UseSandboxTerminalConnectionResult` + +`interface` — Resolve sandbox terminal connection status and provide a method to initiate the connection + +```ts +interface UseSandboxTerminalConnectionResult +``` + +### `useSmoothText` + +`function` — Animate `target` text into view. + +```ts +(target: string, enabled: boolean, opts?: SmoothRevealOptions | undefined) => string +``` + +### `useThinkingSeconds` + +`function` — Whole seconds elapsed while `active`, ticking once a second. + +```ts +(active: boolean) => number +``` + +### `waterfallLayout` + +`function` — Project a FlowTrace into proportional bar geometry for {@link FlowWaterfall}. + +```ts +(trace: FlowTrace) => WaterfallRow[] +``` + +### `WaterfallRow` + +`interface` + +```ts +interface WaterfallRow +``` + + +## `./web-react/terminal` + +Source: `src/web-react/terminal.ts` · depends on `brand`, `chat-routes`, `chat-store`, `harness`, `interactions`, `missions`, `plans`, `runtime`, `trace` + +### `SandboxTerminalConnection` + +`interface` — Define the connection details and status for a sandbox terminal session + +```ts +interface SandboxTerminalConnection +``` + +### `SandboxTerminalConnectionResponse` + +`interface` — Define the response structure for a sandbox terminal connection including URLs, token, status, and errors + +```ts +interface SandboxTerminalConnectionResponse +``` + +### `tabTerminalConnectionId` + +`function` — Stable-per-tab, unique-per-client terminal connection id. + +```ts +(storageKey?: string) => string +``` + +### `TerminalStatusDisplay` + +`interface` + +```ts +interface TerminalStatusDisplay +``` + +### `TerminalStatusTone` + +`type` + +```ts +type TerminalStatusTone +``` + +### `useSandboxTerminalConnection` + +`function` — Manage and maintain a sandbox terminal connection with automatic polling and token refresh handling + +```ts +(opts: UseSandboxTerminalConnectionOptions) => UseSandboxTerminalConnectionResult +``` + +### `UseSandboxTerminalConnectionOptions` + +`interface` — Define options for configuring a sandbox terminal connection including workspace ID and connection parameters + +```ts +interface UseSandboxTerminalConnectionOptions +``` + +### `UseSandboxTerminalConnectionResult` + +`interface` — Resolve sandbox terminal connection status and provide a method to initiate the connection + +```ts +interface UseSandboxTerminalConnectionResult +``` + +### `WorkspaceTerminalPanel` + +`function` + +```ts +({ connection, connectionId, title, subtitle, isActive, onRetry, statusDisplay, headerExtra, className, }: WorkspaceTer… +``` + +### `WorkspaceTerminalPanelProps` + +`interface` + +```ts +interface WorkspaceTerminalPanelProps +``` diff --git a/docs/llms.txt b/docs/llms.txt new file mode 100644 index 0000000..4259d75 --- /dev/null +++ b/docs/llms.txt @@ -0,0 +1,81 @@ +# agent-app + +> Application-shell framework for Tangle agent products: a bounded tool loop, the structured agent→app tool side channel, integration-hub client, per-workspace billing, and crypto — composed over the Tangle agent substrate through typed seams. + +_Generated by agent-docs from tsup.config `entry`; 73 entries. Regenerate with `agent-docs`; full inlined surface in [llms-full.txt](llms-full.txt)._ + +## Modules + +- [`.`](api/index.md): 766 exports — AddCitationArgs, AddCitationResult, addSecurityHeaders, AgentAppConfig, agentAppConfigJsonSchema, AgentAppTheme, AgentIdentityConfig, AgentIntegrationsConfig, … +- [`./app-auth`](api/app-auth.md): 11 exports — AppAuth, AppAuthConfig, AppAuthEmailClient, AppAuthEmailConfig, AppAuthInstance, AppAuthSchema, AppAuthSession, AppAuthSocialConfig, … +- [`./assets`](api/assets.md): 43 exports — ApprovalEvent, ApprovalEventSchema, AssetContentMap, AssetFormat, AssetSpec, AssetStatus, AssetVariant, BrandTokens, … +- [`./assistant`](api/assistant.md): 55 exports — adaptTranscript, AssistantChat, AssistantClient, AssistantClientConfig, AssistantClientInputError, AssistantClientProvider, AssistantDeliveryMode, AssistantDock, … +- [`./billing`](api/billing.md): 19 exports — createPlatformBalanceManager, createTcloudKeyProvisioner, createWorkspaceKeyManager, KeyCrypto, KeyProvisioner, PlanLimit, PlatformBalanceInfo, PlatformBalanceManager, … +- [`./brand`](api/brand.md): 5 exports — BrandHeader, BrandHeaderProps, Logo, LogoProps, TangleKnot +- [`./brand-extraction`](api/brand-extraction.md): 19 exports — BrandColor, BrandExtractionResult, BrandFont, BrandImage, BrandKit, BrandLogoCandidate, decideBrandKit, DecidedBrandKit, … +- [`./catalog`](api/catalog.md): 6 exports — buildCatalog, CatalogModel, fetchModelCatalog, ModelCatalog, normalizeModelId, RouterModel +- [`./chat-routes`](api/chat-routes.md): 131 exports — ALLOWED_ATTACHMENT_SNIFFED_MIMES, assertPromptPartsWithinCap, ATTACHMENT_ACCEPT, ATTACHMENT_MAX_COUNT, AttachmentPathArgs, AttachmentPathCheck, AttachmentReadResult, attachmentSizeErrorMessage, … +- [`./chat-store`](api/chat-store.md): 59 exports — AppendMessageInput, attachmentInputToPart, attachmentKindForMime, attachmentPartKey, attachmentPartsFromMessageParts, buildAttachmentPromptBlock, BULK_DELETE_MAX_THREADS, BulkDeleteThreadsInput, … +- [`./composer`](api/composer.md): 22 exports — AgentComposer, AgentComposerProps, AgentProfileCapability, AgentProfileDraft, AgentProfileOption, AgentProfilePicker, AgentProfilePickerProps, AgentSessionControls, … +- [`./config`](api/config.md): 13 exports — AgentAppConfig, agentAppConfigJsonSchema, AgentIdentityConfig, AgentIntegrationsConfig, AgentKnowledgeConfig, AgentTaxonomyConfig, AgentUiConfig, defineAgentApp, … +- [`./crypto`](api/crypto.md): 10 exports — createFieldCrypto, decodeHexKey, decryptAesGcm, decryptBytes, decryptWithKey, deriveKey, DeriveKeyOptions, encryptAesGcm, … +- [`./design-canvas`](api/design-canvas.md): 103 exports — AddElementOperation, AddPageOperation, applyBindingsToDocument, ApplyDataOperation, applySceneOperation, applySceneOperations, ApplySceneOptions, assertColor, … +- [`./design-canvas-react`](api/design-canvas-react.md): 129 exports — addElementCommand, AddElementInput, addPageCommand, AddPageInput, ApplySceneResult, BakedNodeAttrs, bakeLineTransform, bakeRectTransform, … +- [`./design-canvas-react/engine`](api/design-canvas-react-engine.md): 75 exports — addElementCommand, AddElementInput, addPageCommand, AddPageInput, ApplySceneResult, bindSlotCommand, BindSlotInput, bleedAwareExportBounds, … +- [`./design-canvas-react/lazy`](api/design-canvas-react-lazy.md): 4 exports — DesignCanvasChromeLazy, DesignCanvasFullProps, DesignCanvasLazy, DesignCanvasProps +- [`./design-canvas/drizzle`](api/design-canvas-drizzle.md): 10 exports — createDesignCanvasTables, CreateDesignCanvasTablesOptions, createDrizzleSceneStore, CreateDrizzleSceneStoreOptions, DesignCanvasDatabase, DesignCanvasParentTable, DesignCanvasTables, DesignDecisionRow, … +- [`./durable-chat`](api/durable-chat.md): 60 exports — applyDurableInteractionAnswer, applyDurableInteractionAsk, applyDurableInteractionCancel, createDurableChatEventProjection, createDurableChatScope, createDurableInteractionProjectionAdapter, createDurableInteractionRoutePersistence, CreateDurableInteractionRoutePersistenceOptions, … +- [`./eval`](api/eval.md): 13 exports — CompletionRequirement, CompletionVerdict, CorrectnessChecker, createLlmCorrectnessChecker, createTokenRecallChecker, extractProducedState, producedFromToolEvents, ProducedState, … +- [`./eval-campaign`](api/eval-campaign.md): 30 exports — aggregateJudgeVerdicts, buildEnsembleJudge, CampaignResult, defaultProductionGate, DispatchContext, EnsembleAggregate, EnsembleJudgeConfig, evolutionaryProposer, … +- [`./harness`](api/harness.md): 13 exports — assertHarnessModelCompatible, coerceHarness, DEFAULT_HARNESS, Harness, isHarness, isModelCompatibleWithHarness, KNOWN_HARNESSES, modelProvider, … +- [`./intakes`](api/intakes.md): 29 exports — AnswerRejectionReason, AnswerValidationResult, buildContextGatherPrompt, computeContextSufficiency, ContextFact, ContextFactSpec, ContextSufficiency, emptyPayload, … +- [`./intakes-react`](api/intakes-react.md): 3 exports — IntakeInterview, IntakeInterviewProps, IntakeView +- [`./intakes-react/lazy`](api/intakes-react-lazy.md): 2 exports — IntakeInterviewLazy, IntakeInterviewProps +- [`./intakes/api`](api/intakes-api.md): 3 exports — createIntakeApi, CurrentIntakeView, IntakeApiOptions +- [`./intakes/drizzle`](api/intakes-drizzle.md): 18 exports — AnyIntakeTables, createIntakeTables, CreateIntakeTablesOptions, createProjectIntakeStore, CreateProjectIntakeStoreOptions, createUserIntakeStore, CreateUserIntakeStoreOptions, IntakeDatabase, … +- [`./integrations`](api/integrations.md): 10 exports — HubExecClient, HubExecClientOptions, HubExecErrorCode, HubExecResult, HubInvokeDeps, HubInvokeInput, HubInvokeOutcome, invokeIntegrationHub, … +- [`./interactions`](api/interactions.md): 58 exports — BeforeInteractionAnswerArgs, cancelStatusFor, canTransitionInteractionStatus, ChatInteraction, ChatInteractionField, ChatInteractionStatus, ChatSelectField, composerAnswerData, … +- [`./knowledge`](api/knowledge.md): 6 exports — buildKnowledgeRequirements, deriveSignals, KnowledgeRequirementSpec, KnowledgeSignal, KnowledgeStateAccessor, SatisfiedByRule +- [`./knowledge-loop`](api/knowledge-loop.md): 11 exports — createKnowledgeLoop, CreateKnowledgeLoopDeps, createReviewerDecider, KnowledgeCandidate, KnowledgeDecider, KnowledgeDeciderInput, KnowledgeDecision, KnowledgeGateVerdict, … +- [`./missions`](api/missions.md): 65 exports — applyMissionEvent, asMissionStreamEvent, budgetGateProposalId, buildAgentMissionPlan, CompleteMissionInput, createInMemoryMissionStore, createMissionEngine, CreateMissionInput, … +- [`./model-resolution`](api/model-resolution.md): 14 exports — catalogIdsForModel, ChatModelSource, ChatModelValidationFailure, ChatModelValidationResult, ChatModelValidationSuccess, cleanModelId, isWellFormedModelId, LoadModels, … +- [`./object-store`](api/object-store.md): 15 exports — assertSafeKeySegment, createProxiedArtifactRoute, createR2ObjectStore, ObjectBody, objectKey, ObjectKeyParts, ObjectStore, PutObjectOptions, … +- [`./plans`](api/plans.md): 12 exports — canTransitionPlanStatus, ChatPlan, ChatPlanPersistedPart, ChatPlanStatus, parsePlanSubmittedEvent, ParsePlanSubmittedResult, persistedPartToPlan, PLAN_SUBMITTED_EVENT, … +- [`./platform`](api/platform.md): 65 exports — AdminGuardOptions, assertBillableBalance, AssertBillableBalanceOptions, AuthGuard, AuthGuardOptions, BetterAuthSessionCookieMinterOptions, BetterAuthSessionCookieSource, BillableBalanceState, … +- [`./preflight`](api/preflight.md): 12 exports — formatPreflightReport, httpHeadProbe, HttpHeadProbeConfig, PreflightProbe, PreflightProbeResult, PreflightProbeVerdict, PreflightReport, routerChatProbe, … +- [`./preset-cloudflare`](api/preset-cloudflare.md): 16 exports — createD1KnowledgeStateAccessor, createPresetDrizzleSchema, createPresetFieldCrypto, createPresetToolHandlers, createPresetWorkspaceKeyManager, createPresetWorkspaceKeyStore, D1Like, D1PreparedLike, … +- [`./profile`](api/profile.md): 37 exports — assertSkillDeliveryDisjoint, assertSystemPromptWithinBudget, composeAgentProfile, ComposedSkills, ComposeProfileBudget, composeShellResources, ComposeShellResourcesInput, composeSkills, … +- [`./prompt`](api/prompt.md): 3 exports — AssembleResult, assembleSystemPrompt, AssembleSystemPromptInput +- [`./redact`](api/redact.md): 14 exports — buildRedactedDocument, BuildRedactedDocumentOptions, DEFAULT_REDACTION_PATTERNS, detectSpans, maskSpans, RedactedDocSegment, RedactedDocument, redactForIngestion, … +- [`./run`](api/run.md): 10 exports — ExecutionMode, executionModeForProfile, isKnownSandboxHarness, ProfileHarness, resolveExecutionMode, ROUTER_HARNESS, RouterHarness, runAgent, … +- [`./runtime`](api/runtime.md): 66 exports — AgentRuntime, AgentRuntimeModelConfig, AgentTurnOptions, AnySurfaceKind, AppToolLoopOptions, buildCatalog, CatalogModel, CertifiedDelivery, … +- [`./sandbox`](api/sandbox.md): 114 exports — AppToolDescriptor, assertEnvWithinLimits, assertProvisionPayloadWithinCap, attachReasoningEffort, AuthenticatedSandboxUser, bearerSubprotocolToken, bearerToken, buildAppToolMcpServers, … +- [`./sequences`](api/sequences.md): 113 exports — AddCaptionOperation, applySequenceOperation, applySequenceOperations, assertClipFitsSequence, assertSequenceMediaUrl, buildCaptionChunks, BuildCaptionChunksOptions, buildContactSheetManifest, … +- [`./sequences-react`](api/sequences-react.md): 108 exports — addCaptionCommand, AddCaptionInput, applySnap, ApplySnapOptions, AudioBufferLike, BrandMark, BrandMarkProps, captionFontPx, … +- [`./sequences/drizzle`](api/sequences-drizzle.md): 13 exports — createDrizzleSequenceStore, CreateDrizzleSequenceStoreOptions, createSequenceTables, CreateSequenceTablesOptions, SequenceClipRow, SequenceDatabase, SequenceDecisionRow, SequenceExportRow, … +- [`./skills`](api/skills.md): 27 exports — assertSkillDeliveryDisjoint, ComposedSkills, composeShellResources, ComposeShellResourcesInput, composeSkills, ComposeSkillsInput, CorpusEntry, CorpusLoadResult, … +- [`./skills-placement`](api/skills-placement.md): 6 exports — ComposedSkills, composeSkillsForHarness, ComposeSkillsForHarnessInput, resolveSkillDir, SkillEntry, unsupportedSkillHarnesses +- [`./store`](api/store.md): 8 exports — createDatabaseProvider, createInMemoryKV, DatabaseProvider, DatabaseProviderOptions, KVGetWithMetadataResult, KVListResult, KVPutOptions, KVStore +- [`./stream`](api/stream.md): 44 exports — asRecord, asString, attachmentPartKey, BufferedTurnEvent, BufferedTurnOptions, BufferedTurnTap, buildUserTextParts, coalesceChatStreamEvents, … +- [`./studio`](api/studio.md): 37 exports — buildGenerationRequestBody, buildPublishPackage, CADENCES, DESTINATIONS, failedOptimisticGeneration, Generation, GENERATION_TYPES, generationError, … +- [`./studio-react`](api/studio-react.md): 30 exports — AvatarComposer, ComposerDisclosure, ComposerHero, Field, filterGenerations, GenerationCard, GenerationDetail, GenerationDetailModal, … +- [`./tangle`](api/tangle.md): 7 exports — BrokerToken, BrokerTokenMinter, BrokerTokenProvider, BrokerTokenProviderOptions, buildConsentUrl, ConsentUrlInput, createBrokerTokenProvider +- [`./teams`](api/teams.md): 37 exports — ASSIGNABLE_WORKSPACE_ROLES, AssignableWorkspaceRole, canManageWorkspaceMemberRole, generateInvitationToken, generateInviteToken, getInvitationExpiresAt, hasOrganizationRole, hasWorkspaceRole, … +- [`./teams-react`](api/teams-react.md): 10 exports — InvitationsPanel, InvitationsPanelProps, InvitationView, InviteAcceptDetails, InviteAcceptPage, InviteAcceptPageProps, InviteAcceptStatus, MembersPanel, … +- [`./teams-react/lazy`](api/teams-react-lazy.md): 6 exports — InvitationsPanelLazy, InvitationsPanelProps, InviteAcceptPageLazy, InviteAcceptPageProps, MembersPanelLazy, MembersPanelProps +- [`./teams/drizzle`](api/teams-drizzle.md): 26 exports — CreateAccessOptions, createEnsurePersonalOrganization, createOrganizationAccess, CreateOrganizationAccessOptions, CreatePersonalOrganizationOptions, createTeamTables, CreateTeamTablesOptions, createWorkspaceAccess, … +- [`./teams/invitations-api`](api/teams-invitations-api.md): 13 exports — createInvitationsApi, EnforceSeatSeam, InvitationOutcome, InvitationPreview, InvitationsApiOptions, InvitationUserTable, InvitationWorkspaceTable, MemberSyncSeam, … +- [`./teams/members-api`](api/teams-members-api.md): 9 exports — createMembersApi, EnforceSeatSeam, MemberListEntry, MembersApiActor, MembersApiOptions, MemberSyncSeam, SeatLimitError, UserLookupTable, … +- [`./teams/resend`](api/teams-resend.md): 2 exports — createResendInvitationSender, ResendInvitationSenderOptions +- [`./theme`](api/theme.md): 6 exports — AgentAppTheme, CanvasRenderPalette, darkTheme, lightTheme, themeColor, themeToCssVars +- [`./theme-contract`](api/theme-contract.md): 4 exports — checkThemeContract, ThemeContractMiss, ThemeContractOptions, ThemeContractResult +- [`./theme-contract/cli`](api/theme-contract-cli.md): 0 exports +- [`./theme/tailwind-preset`](api/theme-tailwind-preset.md): 1 export — default +- [`./tools`](api/tools.md): 63 exports — AddCitationArgs, AddCitationResult, APP_TOOL_NAMES, AppToolContext, AppToolDefinition, AppToolHandlers, AppToolMcpServer, AppToolName, … +- [`./trace`](api/trace.md): 20 exports — buildFlowTrace, childSpanContext, composeMissionFlowTrace, createMissionTraceContext, delegationActivityToFlowSpans, DistributionSummary, FlowSpan, FlowTrace, … +- [`./turn-stream`](api/turn-stream.md): 59 exports — acquireDurableTurnLock, AcquireDurableTurnLockInput, activeTurnLock, ACTIVITY_TTL_MS, appendSegmentEvent, broadcastThreadCreated, broadcastTurnStreamEvent, broadcastWorkspaceActivity, … +- [`./vault`](api/vault.md): 17 exports — ConfirmDialog, ConfirmDialogProps, VaultArtifactRenderProps, VaultDataPort, VaultDockRenderProps, VaultDockToggle, VaultEditorMode, VaultFile, … +- [`./vault/lazy`](api/vault-lazy.md): 2 exports — VaultPaneLazy, VaultPaneProps +- [`./web`](api/web.md): 15 exports — addSecurityHeaders, assertMediaUrl, checkRateLimit, clearCookieHeader, CookieOptions, extractRequestContext, JsonObject, KvLike, … +- [`./web-react`](api/web-react.md): 230 exports — activityTone, ActivityTone, AgentActivityPage, AgentActivityPanel, AgentActivityPanelProps, AgentActivityRecord, AgentSessionControls, AgentSessionControlsProps, … +- [`./web-react/terminal`](api/web-react-terminal.md): 10 exports — SandboxTerminalConnection, SandboxTerminalConnectionResponse, tabTerminalConnectionId, TerminalStatusDisplay, TerminalStatusTone, useSandboxTerminalConnection, UseSandboxTerminalConnectionOptions, UseSandboxTerminalConnectionResult, … diff --git a/package.json b/package.json index 5072661..39e82e6 100644 --- a/package.json +++ b/package.json @@ -407,12 +407,13 @@ "test": "vitest run", "test:watch": "vitest", "typecheck": "tsc --noEmit", - "docs:gen": "node scripts/gen-codemap.mjs", + "docs:gen": "agent-docs", "knip": "knip" }, "devDependencies": { "@cloudflare/workers-types": "^4.20250620.0", "@radix-ui/react-dialog": "^1.1.15", + "@tangle-network/agent-docs": "0.2.0", "@tangle-network/agent-eval": "^0.100.0", "@tangle-network/agent-integrations": "^0.44.0", "@tangle-network/agent-interface": "^0.15.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2282cb..a6068bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,6 +18,9 @@ importers: '@radix-ui/react-dialog': specifier: ^1.1.15 version: 1.1.17(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + '@tangle-network/agent-docs': + specifier: 0.2.0 + version: 0.2.0(typescript@5.9.3) '@tangle-network/agent-eval': specifier: ^0.100.0 version: 0.100.0(typescript@5.9.3) @@ -1303,6 +1306,13 @@ packages: '@tangle-network/agent-core@0.4.13': resolution: {integrity: sha512-L6nwzESwVODXd8HMjwkTQlNEsPQeDX1wBKF9DH8bRK38MfWl3TuFJwtRCDM8VsXVa5V9Np2wNc8XeOuBOKbVQQ==} + '@tangle-network/agent-docs@0.2.0': + resolution: {integrity: sha512-FXKRZsBlX9I83v2+lH/03QXeopg2dwYYx8Ky2A7vX+j9yaa7WQYiC2SuJnJwNlsAYcIb4Hk+5V+xtDwPNV1G/Q==} + engines: {node: '>=20'} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + '@tangle-network/agent-eval@0.100.0': resolution: {integrity: sha512-yBupVJJAqHozhe1BL5xBuDObjvNsoY+XmJo7qfpw/w7rehAXbKliBb4k3XS1G55+GaYPjFA+xwPzlEDQISpMRw==} engines: {node: '>=20'} @@ -4199,6 +4209,10 @@ snapshots: '@tangle-network/agent-interface': 0.27.0 zod: 4.4.3 + '@tangle-network/agent-docs@0.2.0(typescript@5.9.3)': + dependencies: + typescript: 5.9.3 + '@tangle-network/agent-eval@0.100.0(typescript@5.9.3)': dependencies: '@asteasolutions/zod-to-openapi': 8.5.0(zod@4.4.3) diff --git a/scripts/gen-codemap.mjs b/scripts/gen-codemap.mjs deleted file mode 100644 index 73ecf77..0000000 --- a/scripts/gen-codemap.mjs +++ /dev/null @@ -1,282 +0,0 @@ -#!/usr/bin/env node -/** - * gen-codemap — deterministic code-map + API reference for @tangle-network/agent-app. - * - * The published surface is the `entry` map in `tsup.config.ts` (subpath → - * `src//index.ts`). The hand-maintained tables in README.md / AGENTS.md drift; - * this regenerates the reference from source so CI can gate on it. - * - * It loads each entry through the TypeScript compiler API and enumerates the - * PUBLIC exports with `checker.getExportsOfModule` — which follows the - * `export * from './x'` re-export chains correctly — so it never has to run the - * `pnpm build` d.ts step (that OOMs). For each export it records the kind, a - * one-line signature, and the first sentence of the leading doc comment. It also - * computes, per subpath, which OTHER agent-app subpaths it imports (the - * intra-package dependency edge). - * - * node scripts/gen-codemap.mjs # write docs/CODEMAP.md + docs/api/*.md - * node scripts/gen-codemap.mjs --check # fail (exit 1) if the committed docs are stale - */ -import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs' -import { dirname, join, relative, resolve } from 'node:path' -import { fileURLToPath, pathToFileURL } from 'node:url' - -import ts from 'typescript' - -const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..') -const SRC = join(ROOT, 'src') -const HEADER = '' - -/** Parse the `entry` map out of tsup.config.ts (handles object and array forms). */ -function loadEntries() { - const configPath = join(ROOT, 'tsup.config.ts') - const sf = ts.createSourceFile(configPath, readFileSync(configPath, 'utf8'), ts.ScriptTarget.Latest, true) - let init - const visit = (node) => { - if ( - ts.isPropertyAssignment(node) && - (ts.isIdentifier(node.name) || ts.isStringLiteral(node.name)) && - node.name.text === 'entry' - ) { - init = node.initializer - } - ts.forEachChild(node, visit) - } - visit(sf) - if (!init) throw new Error('tsup.config.ts: could not find an `entry` property') - - const files = [] - if (ts.isObjectLiteralExpression(init)) { - for (const prop of init.properties) { - if (ts.isPropertyAssignment(prop) && ts.isStringLiteral(prop.initializer)) files.push(prop.initializer.text) - } - } else if (ts.isArrayLiteralExpression(init)) { - for (const el of init.elements) if (ts.isStringLiteral(el)) files.push(el.text) - } else { - throw new Error('tsup.config.ts: `entry` is neither an object nor an array literal') - } - - return files.map((file) => { - // `src/chat-routes/index.ts` → key `chat-routes/index`; drop a trailing /index. - const key = file.replace(/^src\//, '').replace(/\.[tj]sx?$/, '') - const id = key === 'index' ? '.' : key.replace(/\/index$/, '') - const exportPath = id === '.' ? '.' : `./${id}` - const apiName = (id === '.' ? 'index' : id).replace(/\//g, '-') - const topDir = file.replace(/^src\//, '').split('/')[0] - return { id, exportPath, file, apiName, topDir, absFile: join(ROOT, file), srcDir: dirname(join(ROOT, file)) } - }) -} - -/** Build one TS program over every entry file, reusing the repo's tsconfig options. */ -function createProgram(entries) { - const cfg = ts.readConfigFile(join(ROOT, 'tsconfig.json'), ts.sys.readFile) - const parsed = ts.parseJsonConfigFileContent(cfg.config ?? {}, ts.sys, ROOT) - const options = { ...parsed.options, noEmit: true, skipLibCheck: true } - return ts.createProgram(entries.map((e) => e.absFile), options) -} - -const truncate = (s, n) => (s.length > n ? `${s.slice(0, n - 1).trimEnd()}…` : s) - -/** First sentence of a doc-comment block, whitespace-collapsed. */ -function firstSentence(text) { - const flat = text.replace(/\s+/g, ' ').trim() - if (!flat) return '' - const m = flat.match(/^(.*?[.!?])(\s|$)/) - return truncate(m ? m[1] : flat, 200) -} - -/** Kind + one-line signature + doc summary for one exported symbol. */ -function describe(checker, exported) { - let sym = exported - if (sym.flags & ts.SymbolFlags.Alias) { - try { - sym = checker.getAliasedSymbol(sym) - } catch { - sym = exported - } - } - const name = exported.getName() - const decl = sym.valueDeclaration ?? sym.declarations?.[0] - const f = sym.flags - let kind - let signature - if (f & ts.SymbolFlags.Class) { - kind = 'class' - signature = `class ${name}` - } else if (f & ts.SymbolFlags.Interface) { - kind = 'interface' - signature = `interface ${name}` - } else if (f & ts.SymbolFlags.TypeAlias) { - kind = 'type' - signature = `type ${name}` - } else if (f & ts.SymbolFlags.Enum || f & ts.SymbolFlags.EnumMember) { - kind = 'enum' - signature = `enum ${name}` - } else if (f & (ts.SymbolFlags.Module | ts.SymbolFlags.ValueModule | ts.SymbolFlags.NamespaceModule)) { - kind = 'namespace' - signature = `namespace ${name}` - } else if (decl) { - const type = checker.getTypeOfSymbolAtLocation(sym, decl) - const callable = type.getCallSignatures().length > 0 - kind = f & ts.SymbolFlags.Function || callable ? 'function' : 'const' - signature = truncate(checker.typeToString(type).replace(/\s+/g, ' '), 120) - } else { - kind = 'value' - signature = name - } - - let doc = ts.displayPartsToString(exported.getDocumentationComment(checker)).trim() - if (!doc && sym !== exported) doc = ts.displayPartsToString(sym.getDocumentationComment(checker)).trim() - return { name, kind, signature, doc: firstSentence(doc) } -} - -/** Public exports of one entry module, sorted by name, skipping synthetic __names. */ -function exportsOf(program, checker, entry) { - const sf = program.getSourceFile(entry.absFile) - if (!sf) return { error: `no source file for ${entry.file}` } - const moduleSym = checker.getSymbolAtLocation(sf) - if (!moduleSym) return { error: `no module symbol for ${entry.file} (empty or non-module?)` } - const exports = checker - .getExportsOfModule(moduleSym) - .filter((s) => !s.getName().startsWith('__')) - .map((s) => describe(checker, s)) - .sort((a, b) => a.name.localeCompare(b.name)) - return { exports } -} - -const walk = (dir) => - readdirSync(dir, { withFileTypes: true }).flatMap((e) => { - const p = join(dir, e.name) - if (e.isDirectory()) return walk(p) - return /\.(ts|tsx)$/.test(e.name) ? [p] : [] - }) - -/** Sibling agent-app subpaths this entry imports (via relative import/export specifiers). */ -function siblingDeps(entry, topDirs) { - const deps = new Set() - for (const file of walk(entry.srcDir)) { - const text = readFileSync(file, 'utf8') - for (const m of text.matchAll(/(?:from|import)\s*\(?\s*['"](\.[^'"]*)['"]/g)) { - const abs = resolve(dirname(file), m[1]) - if (!abs.startsWith(SRC + '/')) continue - const seg = relative(SRC, abs).split('/')[0] - if (seg && seg !== entry.topDir && topDirs.has(seg)) deps.add(seg) - } - } - return [...deps].sort() -} - -function build() { - const entries = loadEntries().sort((a, b) => a.exportPath.localeCompare(b.exportPath)) - const topDirs = new Set(entries.map((e) => e.topDir)) - const program = createProgram(entries) - const checker = program.getTypeChecker() - - const rows = entries.map((entry) => { - const { exports = [], error } = exportsOf(program, checker, entry) - return { entry, exports, error, deps: siblingDeps(entry, topDirs) } - }) - - const files = new Map() - files.set('docs/CODEMAP.md', renderCodemap(rows)) - for (const row of rows) files.set(`docs/api/${row.entry.apiName}.md`, renderApiPage(row)) - return { files, rows } -} - -function renderCodemap(rows) { - const lines = [HEADER, '', '# agent-app code map', ''] - lines.push( - `_${rows.length} published subpaths — source of truth: \`tsup.config.ts\` \`entry\`. Regenerate with \`pnpm docs:gen\`._`, - '', - '| Subpath | Exports | Depends on (siblings) |', - '|---|---|---|', - ) - for (const { entry, exports, error, deps } of rows) { - const link = `[\`${entry.exportPath}\`](api/${entry.apiName}.md)` - const count = error ? '—' : String(exports.length) - const dep = deps.length ? deps.map((d) => `\`${d}\``).join(', ') : '—' - lines.push(`| ${link} | ${count} | ${dep} |`) - } - lines.push('', '---', '') - for (const { entry, exports, error, deps } of rows) { - lines.push(`## \`${entry.exportPath}\``, '') - lines.push(`Source: \`${entry.file}\` · ${error ? 'introspection failed' : `${exports.length} exports`}`, '') - if (deps.length) lines.push(`Depends on: ${deps.map((d) => `\`${d}\``).join(', ')}`, '') - if (error) { - lines.push(`> Could not introspect: ${error}`, '') - } else if (exports.length) { - lines.push(exports.map((e) => `\`${e.name}\``).join(', '), '') - lines.push(`[Full API →](api/${entry.apiName}.md)`, '') - } else { - lines.push('_No public exports._', '') - } - } - return `${lines.join('\n').trimEnd()}\n` -} - -function renderApiPage({ entry, exports, error }) { - const lines = [HEADER, '', `# \`${entry.exportPath}\``, ''] - lines.push(`Source: \`${entry.file}\``, '') - if (error) { - lines.push(`> Could not introspect this subpath: ${error}`, '') - return `${lines.join('\n').trimEnd()}\n` - } - lines.push(`${exports.length} export${exports.length === 1 ? '' : 's'}.`, '') - for (const e of exports) { - lines.push(`### \`${e.name}\``, '') - lines.push(`\`${e.kind}\`${e.doc ? ` — ${e.doc}` : ''}`, '') - lines.push('```ts', e.signature, '```', '') - } - return `${lines.join('\n').trimEnd()}\n` -} - -function writeAll() { - const { files } = build() - const apiDir = join(ROOT, 'docs', 'api') - if (existsSync(apiDir)) rmSync(apiDir, { recursive: true, force: true }) - mkdirSync(apiDir, { recursive: true }) - for (const [rel, content] of files) { - const abs = join(ROOT, rel) - mkdirSync(dirname(abs), { recursive: true }) - writeFileSync(abs, content) - } - return files -} - -/** Compare freshly-generated output against what is committed on disk. */ -function check() { - const { files } = build() - const stale = [] - const missing = [] - for (const [rel, content] of files) { - const abs = join(ROOT, rel) - if (!existsSync(abs)) missing.push(rel) - else if (readFileSync(abs, 'utf8') !== content) stale.push(rel) - } - const apiDir = join(ROOT, 'docs', 'api') - const orphan = existsSync(apiDir) - ? readdirSync(apiDir) - .filter((f) => f.endsWith('.md')) - .map((f) => `docs/api/${f}`) - .filter((rel) => !files.has(rel)) - : [] - return { ok: stale.length + missing.length + orphan.length === 0, stale, missing, orphan } -} - -const isMain = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href -if (isMain) { - if (process.argv.includes('--check')) { - const { ok, stale, missing, orphan } = check() - if (ok) { - console.log('codemap: docs are fresh') - process.exit(0) - } - console.error('codemap: docs are STALE — run `pnpm docs:gen` and commit the result.') - for (const f of missing) console.error(` missing: ${f}`) - for (const f of stale) console.error(` changed: ${f}`) - for (const f of orphan) console.error(` orphaned: ${f}`) - process.exit(1) - } - const files = writeAll() - console.log(`codemap: wrote ${files.size} files (docs/CODEMAP.md + ${files.size - 1} API pages)`) -} diff --git a/src/index.ts b/src/index.ts index 6a4932a..d4a1db3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,11 +46,12 @@ export * from './theme-contract/index' // its browser-safe wire contract is re-exported via `/web-react`. // `/web-react` and `/sequences-react` are intentionally NOT re-exported here: // they need the optional react peer and would drag JSX into every root-entry -// consumer. `/sequences/drizzle` likewise stays subpath-only — it imports the -// optional drizzle-orm peer at module top. +// consumer. export * from './trace/index' -export * from './sequences/index' -// `/design-canvas/drizzle` and `/design-canvas-react` are intentionally NOT -// re-exported here: drizzle imports the optional peer at module top; react and -// konva are optional peers pulled in only by the design-canvas-react subpath. -export * from './design-canvas/index' +// `/sequences` and `/design-canvas` are app-specific FEATURE surfaces (timeline +// editing, a design canvas), not shell mechanism every product wants — so they +// are NOT re-exported from the root. Import them explicitly when a product opts +// in: `@tangle-network/agent-app/sequences`, `@tangle-network/agent-app/design-canvas`. +// This keeps the root entry to shared mechanism instead of every product's +// features. (Their `/drizzle` + `-react` variants were already subpath-only for +// the optional drizzle / react / konva peers.) diff --git a/tests/codemap-fresh.test.ts b/tests/codemap-fresh.test.ts index fd4964b..eed5f96 100644 --- a/tests/codemap-fresh.test.ts +++ b/tests/codemap-fresh.test.ts @@ -1,12 +1,11 @@ /** - * The code-map staleness gate. `docs/CODEMAP.md` + `docs/api/*.md` are generated - * from `tsup.config.ts` `entry` and the TypeScript export graph by - * `scripts/gen-codemap.mjs`. This runs the generator's `--check` mode, which - * regenerates in memory and exits non-zero the moment the committed docs drift - * from the current source — a new subpath, a renamed export, a changed signature, - * or a removed page. Fix by running `pnpm docs:gen` and committing the result. - * Mirrors the intent of `tests/theme/tokens-contract.test.ts`: the generator IS - * the single source of truth; this test just enforces adoption. + * The code-map staleness gate. `docs/CODEMAP.md` + `docs/api/*.md` + `docs/llms.txt` + * + `docs/codemap.json` are generated from the TypeScript export graph by + * `@tangle-network/agent-docs` (this repo dogfoods its own doc tool). This runs + * `agent-docs --check`, which regenerates in memory and exits non-zero the moment + * the committed docs drift from the current source — a new subpath, a renamed + * export, a changed signature, a removed page. Fix by running `pnpm docs:gen` + * (= `agent-docs`) and committing the result. */ import { spawnSync } from 'node:child_process' @@ -16,14 +15,14 @@ import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..') -const script = join(repoRoot, 'scripts', 'gen-codemap.mjs') +const cli = join(repoRoot, 'node_modules', '@tangle-network', 'agent-docs', 'dist', 'cli.js') describe('codemap freshness', () => { // Spawns the generator over the whole source tree; the walk scales with the // number of documented exports, so give it well over vitest's 5s default. - it('committed docs/CODEMAP.md + docs/api/*.md match the current source', () => { - const res = spawnSync(process.execPath, [script, '--check'], { encoding: 'utf8' }) + it('committed docs match the current source (agent-docs --check)', () => { + const res = spawnSync(process.execPath, [cli, '--repo', repoRoot, '--check'], { cwd: repoRoot, encoding: 'utf8' }) const detail = `${res.stdout ?? ''}${res.stderr ?? ''}`.trim() - expect(res.status, `codemap --check failed — run \`pnpm docs:gen\` and commit:\n${detail}`).toBe(0) + expect(res.status, `agent-docs --check failed — run \`pnpm docs:gen\` and commit:\n${detail}`).toBe(0) }, 60_000) })