apps 0.0.1-beta.32 → 0.0.1-beta.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/framework-reference.json +1 -1
- package/js/{chunk-W7F23NQ2.js → chunk-5OM6HBNU.js} +11 -9
- package/js/{chunk-N72RKJ5E.js → chunk-DSUKW6KJ.js} +1 -92
- package/js/{chunk-5DLG2FVN.js → chunk-DXGWKNTQ.js} +91 -0
- package/js/chunk-EPUWF4ZG.js +49 -0
- package/js/{chunk-4OKYLVU4.js → chunk-IU6OK5G2.js} +1 -1
- package/js/{chunk-GG566OOE.js → chunk-MYH3QZ4L.js} +6 -6
- package/js/{chunk-NPGRURDG.js → chunk-O3OAFU7Q.js} +20 -3
- package/js/{chunk-RULZPNGP.js → chunk-O4QOPXQT.js} +8 -47
- package/js/{chunk-WG5DFZFT.js → chunk-PUBNIORL.js} +2 -2
- package/js/{chunk-AYM2FUI5.js → chunk-Q7Q5JTRW.js} +1 -1
- package/js/{chunk-3FJYVAE4.js → chunk-QKVZGWGZ.js} +5 -5
- package/js/{chunk-5XJR4XGW.js → chunk-QUEPZ67T.js} +6 -5
- package/js/{chunk-FULRJSWU.js → chunk-QZD2RZ4S.js} +6 -5
- package/js/{chunk-BGALSHLT.js → chunk-UKMIHP2G.js} +9 -6
- package/js/client.js +1 -1
- package/js/contracts.js +9 -9
- package/js/effect.js +10 -9
- package/js/graphql.js +14 -14
- package/js/host.js +10 -9
- package/js/index.js +8 -8
- package/js/mcp/effect.js +12 -11
- package/js/mcp/stdio.js +12 -11
- package/js/mcp.js +15 -14
- package/js/openapi.js +11 -9
- package/js/skills.js +110 -42
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/cache.d.ts +14 -0
- package/types/apps/src/contracts/skills.d.ts +16 -4
- package/types/apps/src/implementation/catalog-cache.d.ts +14 -17
- package/types/apps/src/implementation/schema.d.ts +5 -0
- package/types/apps/src/implementation/skills.d.ts +13 -19
- package/types/apps/src/skills.d.ts +4 -3
package/framework-reference.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.0.1-beta.32","digest":"f87875cbeca789a6b7a99cf7d5129d01eec49ea53fdf8c2be4ec5bdf40189964","entries":[{"symbol":"AppCache","kind":"type","summary":"Cache keys describe every input that affects the value; the host adds app/build isolation.","signatures":[],"definition":"export interface AppCache {\n readonly get: <A>(options: CacheGetOptions<A>) => Promise<A>;\n /** Await a fresh load, coalescing concurrent refreshes and retaining the previous value on failure. */\n readonly revalidate: <A>(options: CacheGetOptions<A>) => Promise<A>;\n readonly read: <A>(key: JsonValue, schema: Schema<A, boolean>) => Promise<A | undefined>;\n readonly readMany: <A>(\n keys: readonly JsonValue[],\n schema: Schema<A, boolean>,\n ) => Promise<readonly (A | undefined)[]>;\n readonly write: (\n entries: readonly { readonly key: JsonValue; readonly value: JsonValue }[],\n retention: Duration.Input,\n ) => Promise<void>;\n readonly invalidate: (key: JsonValue) => Promise<void>;\n /**\n * Scope entries to a bound account and its credential generation. Token renewal keeps the\n * entries; reconnecting or replacing the account's credentials starts an empty scope.\n */\n readonly forAccount: (account: { readonly id: string }) => AppCache;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["apps.AppCache","apps.CacheGetOptions","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"AppCache.forAccount","kind":"method","summary":"Scope entries to a bound account and its credential generation. Token renewal keeps the\nentries; reconnecting or replacing the account's credentials starts an empty scope.","signatures":["(account: { readonly id: string; }): AppCache"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.AppCache"],"examples":["live-inbox"]},{"symbol":"AppCache.get","kind":"method","summary":"","signatures":["<A>(options: CacheGetOptions<A>): Promise<A>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.CacheGetOptions"],"examples":["live-inbox"]},{"symbol":"AppCache.invalidate","kind":"method","summary":"","signatures":["(key: JsonValue): Promise<void>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"AppCache.read","kind":"method","summary":"","signatures":["<A>(key: JsonValue, schema: Schema<A, boolean>): Promise<A | undefined>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"AppCache.readMany","kind":"method","summary":"","signatures":["<A>(keys: readonly JsonValue[], schema: Schema<A, boolean>): Promise<readonly (A | undefined)[]>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"AppCache.revalidate","kind":"method","summary":"Await a fresh load, coalescing concurrent refreshes and retaining the previous value on failure.","signatures":["<A>(options: CacheGetOptions<A>): Promise<A>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.CacheGetOptions"],"examples":["live-inbox"]},{"symbol":"AppCache.write","kind":"method","summary":"","signatures":["(entries: readonly { readonly key: JsonValue; readonly value: JsonValue; }[], retention: Duration.Input): Promise<void>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"AppClient.dispose","kind":"method","summary":"Close this client when its page or embedding owner is removed.","signatures":["(): Promise<void>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":[],"examples":["live-inbox"]},{"symbol":"AppClient.mutate","kind":"method","summary":"Execute a write once in this client's queue. Success acknowledges the write; queries reconcile afterward.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>): Promise<Output>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["apps.Schema","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppClient.mutation","kind":"method","summary":"Create a callable mutation with optional withOptimisticUpdate projections over mounted queries.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, output: Schema<NoInfer<Output>, boolean>): AppMutation<Input, Output>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["AppMutation","apps.Schema","apps/client.AppMutation","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppClient.query","kind":"method","summary":"Query this app once, with a runtime-validated response. Does not populate the mounted query cache.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>): Promise<NoInfer<Output>>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["apps.Schema","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppClient.queryAtom","kind":"method","summary":"Share a live query across mounts and reconcile optimistic changes against fresh server reads.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>): Atom.Atom<AsyncResult.AsyncResult<Output, unknown>>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["apps.Schema","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppContext","kind":"type","summary":"Current credentials for one invocation. Never retained in source or build output.","signatures":[],"definition":"export interface BoundContext<Slots extends AccountSlots> {\n /** Explicit app/build-scoped caching. Account-specific loaders opt into forAccount. */\n readonly cache: import(\"./cache.ts\").AppCache;\n /** Text files retained in this deployment. Paths are package-relative, never host filesystem paths. */\n readonly files: readonly SkillFile[];\n /** Read-only run management, bound to this configured app. */\n readonly workflows: WorkflowReads;\n /** Ask for user input during this tool call. Unavailable during discovery and after the invocation closes. */\n readonly elicit: Elicit;\n /**\n * Invocation-owned HTTP requests with trace propagation and host cancellation. It lasts until the\n * invocation and every app cache refresh it started in the background have ended, so a catalog\n * loader given this fetch can refresh after the reply.\n */\n readonly fetch: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;\n /** Host cancellation for this invocation. Pass it to fetch and other interruptible APIs. */\n readonly signal: AbortSignal;\n readonly accounts: {\n readonly [Slot in keyof Slots]: AccountsFor<Slots[Slot]>;\n };\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["AppCache","apps.AccountSlots","apps.AppCache","apps.Elicit","apps.SkillFile","apps.WorkflowReads","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"AppContext.elicit","kind":"method","summary":"Ask for user input during this tool call. Unavailable during discovery and after the invocation closes.","signatures":["(request: FormElicitation): Promise<ElicitationResponse>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["AppContext","apps.ElicitationResponse","apps.FormElicitation"],"examples":["live-inbox"]},{"symbol":"AppContext.fetch","kind":"method","summary":"Invocation-owned HTTP requests with trace propagation and host cancellation. It lasts until the\ninvocation and every app cache refresh it started in the background have ended, so a catalog\nloader given this fetch can refresh after the reply.","signatures":["(input: string | URL | Request, init?: RequestInit): Promise<Response>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["AppContext"],"examples":["live-inbox"]},{"symbol":"AppMutation","kind":"type","summary":"A callable mutation. Success means the write was acknowledged; its overlay stays until fresh reads finish.","signatures":[],"definition":"export interface AppMutation<Input, Output> {\n (input: Input): Promise<Output>;\n /** Return a new mutation handle with this projection. Failures remove only this invocation's changes. */\n withOptimisticUpdate(update: OptimisticUpdate<Input>): AppMutation<Input, Output>;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.AppMutation","apps/client.OptimisticUpdate"],"examples":["live-inbox"]},{"symbol":"AppMutation.withOptimisticUpdate","kind":"method","summary":"Return a new mutation handle with this projection. Failures remove only this invocation's changes.","signatures":["(update: OptimisticUpdate<Input>): AppMutation<Input, Output>"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["AppMutation","apps/client.AppMutation","apps/client.OptimisticUpdate"],"examples":["live-inbox"]},{"symbol":"apps.AccountCheckContext","kind":"type","summary":"The account a provider's check verifies, with invocation-owned HTTP and cancellation.","signatures":[],"definition":"export interface AccountCheckContext<Auth extends AuthMethods> {\n readonly account: AccountOfMethods<Auth>;\n readonly fetch: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;\n readonly signal: AbortSignal;\n /**\n * When the host stops waiting for the check, in milliseconds since the epoch. A check still\n * running then fails without its own message, so a check that gives up must do so before it.\n * Executor always sets it; a host that does not limit the check leaves it out.\n */\n readonly deadline?: number;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods"],"examples":["live-inbox"]},{"symbol":"apps.AccountCheckResult","kind":"type","summary":"A passing account check. Failures are thrown, so there is no failing variant.","signatures":[],"definition":"AccountCheckResult = Schema.Struct({ accountInfo: Schema.optionalKey(AccountInfo) })","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AccountInfo"],"examples":["live-inbox"]},{"symbol":"apps.AccountInfo","kind":"type","summary":"Upstream identity that a passing account check may report for display. Only these fields are\nretained; the host never stores raw provider responses.","signatures":[],"definition":"AccountInfo = Schema.Struct({\n externalId: Schema.optionalKey(displayText),\n displayName: Schema.optionalKey(displayText),\n username: Schema.optionalKey(displayText),\n email: Schema.optionalKey(displayText),\n avatarUrl: Schema.optionalKey(HttpUrl),\n profileUrl: Schema.optionalKey(HttpUrl),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.AccountOf","kind":"type","summary":"One selected account, discriminated by its author-chosen method name.","signatures":[],"definition":"export type AccountOf<P> = P extends Provider<infer Auth> ? AccountOfMethods<Auth> : never;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.Provider","Provider"],"examples":["live-inbox"]},{"symbol":"apps.accountRouter","kind":"function","summary":"Discover each selected account's router and combine matching names.\nCalls take { accountId, input }; each branch retains its account's input schema,\ncredentials, approval and output validation. Empty selections expose no operations.\nDiscovery is sequential and cancellation follows the caller's signal.","signatures":["<Account extends { readonly id: string; }>(accounts: readonly Account[], discover: (account: Account) => Promise<RouterDeclaration>, options: { readonly signal: AbortSignal; }): Promise<RouterDeclaration>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/account-router.ts","related":["apps.RouterDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.AccountSlots","kind":"type","summary":"Named requirements for one account or a collection from a provider.","signatures":[],"definition":"export type AccountSlots = Readonly<\n Record<string, Provider<AuthMethods> | ManyAccounts<AuthMethods>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["apps.AuthMethods","apps.ManyAccounts","apps.Provider","Provider"],"examples":["live-inbox"]},{"symbol":"apps.App","kind":"type","summary":"Public app handle; the native app is retained for host use without an async round trip.","signatures":[],"definition":"export interface App<\n Requirements extends AppRequirements,\n Def extends AppDefinition<Requirements>,\n> {\n readonly [InternalApp]: NativeApp<Requirements[\"accounts\"], EffectDefinition<Def>>;\n readonly accounts: Requirements[\"accounts\"];\n readonly evaluate: (context: AppContext<Requirements>) => Promise<Def>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/app.ts","related":["AppContext","apps.AppContext","apps.AppDefinition","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.AppCache","kind":"type","summary":"Cache keys describe every input that affects the value; the host adds app/build isolation.","signatures":[],"definition":"export interface AppCache {\n readonly get: <A>(options: CacheGetOptions<A>) => Promise<A>;\n /** Await a fresh load, coalescing concurrent refreshes and retaining the previous value on failure. */\n readonly revalidate: <A>(options: CacheGetOptions<A>) => Promise<A>;\n readonly read: <A>(key: JsonValue, schema: Schema<A, boolean>) => Promise<A | undefined>;\n readonly readMany: <A>(\n keys: readonly JsonValue[],\n schema: Schema<A, boolean>,\n ) => Promise<readonly (A | undefined)[]>;\n readonly write: (\n entries: readonly { readonly key: JsonValue; readonly value: JsonValue }[],\n retention: Duration.Input,\n ) => Promise<void>;\n readonly invalidate: (key: JsonValue) => Promise<void>;\n /**\n * Scope entries to a bound account and its credential generation. Token renewal keeps the\n * entries; reconnecting or replacing the account's credentials starts an empty scope.\n */\n readonly forAccount: (account: { readonly id: string }) => AppCache;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.CacheGetOptions","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.AppContext","kind":"type","summary":"Context available during dynamic app evaluation; storage opens only for handlers.","signatures":[],"definition":"export type AppContext<Requirements extends AppRequirements = AppRequirements> = BoundContext<\n Requirements[\"accounts\"]\n>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["AppContext","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.AppDefinition","kind":"type","summary":"Author definition projected from native capabilities. Excluding callable objects keeps\nfactories from being inferred as definitions and preserves contextual handler inference.","signatures":[],"definition":"export type AppDefinition<Requirements extends AppRequirements> = {\n readonly [Key in keyof NativeDefinition<WebhookContext<Requirements>>]: Key extends \"workflows\"\n ? Readonly<Record<string, WorkflowDeclaration<WorkflowContext<Requirements>>>>\n : Key extends \"schedules\"\n ? Readonly<Record<string, ScheduleDeclaration<MutationContext<Requirements>>>>\n : Key extends \"tools\"\n ? RouterDeclaration<QueryContext<Requirements>, MutationContext<Requirements>>\n : Key extends \"webhooks\"\n ? PromiseCatalog<NonNullable<NativeDefinition<WebhookContext<Requirements>>[Key]>>\n : NativeDefinition<WebhookContext<Requirements>>[Key];\n} & {\n readonly name?: never;\n readonly queries?: never;\n readonly mutations?: never;\n readonly call?: never;\n};","tags":[],"docs":"tools.md","source":"apps/src/implementation/app.ts","related":["apps.AppRequirements","apps.MutationContext","apps.QueryContext","apps.RouterDeclaration","apps.ScheduleDeclaration","apps.WebhookContext","apps.WorkflowContext","apps.WorkflowDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.AppRequirements","kind":"type","summary":"Requirements are pure values; selected accounts and database sessions belong to invocations.","signatures":[],"definition":"export interface AppRequirements {\n readonly accounts: AccountSlots;\n readonly database?: DatabaseDefinition;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["apps.AccountSlots","apps.DatabaseDefinition"],"examples":["live-inbox"]},{"symbol":"apps.Approval","kind":"type","summary":"Synchronous or async policy, projected from the framework's native contract.","signatures":[],"definition":"export type Approval<Input = unknown> = (\n ...args: Parameters<NativeApproval<Input>>\n) =>\n | Effect.Success<ReturnType<NativeApproval<Input>>>\n | Promise<Effect.Success<ReturnType<NativeApproval<Input>>>>;","tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps.ApprovalContext","kind":"type","summary":"Context for one tool's policy. toolInput is the same decoded value passed to run.","signatures":[],"definition":"export interface ApprovalContext<Input = unknown> {\n readonly toolName: string;\n readonly toolInput: Input;\n readonly signal: AbortSignal;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps/operations/approval.ApprovalContext"],"examples":["live-inbox"]},{"symbol":"apps.ApprovalDecision","kind":"type","summary":"Approve this call, deny it, or stop for a human decision.\nParsed result of one tool approval policy.","signatures":[],"definition":"ApprovalDecision = Schema.Literals([\"approved\", \"denied\", \"user-approval\"])","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps/operations/approval.ApprovalDecision"],"examples":["live-inbox"]},{"symbol":"apps.array","kind":"function","summary":"An array whose elements use the given schema.","signatures":["<T>(item: Schema<T, boolean>): Schema<readonly T[]>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.AuthMethod","kind":"type","summary":"Supported declarations; these acquire credentials rather than normalize them.","signatures":[],"definition":"export type AuthMethod =\n | SecretsMethod<Schema.Decoder<unknown>>\n | OAuth2Method<Schema.Decoder<unknown>>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.OAuth2Method","apps.SecretsMethod"],"examples":["live-inbox"]},{"symbol":"apps.AuthMethodData","kind":"type","summary":"Infer the data for one method from its native Effect decoder.","signatures":[],"definition":"export type AuthMethodData<Method> =\n Method extends SecretsMethod<infer Fields>\n ? Fields[\"Type\"]\n : Method extends OAuth2Method<infer Response>\n ? Response[\"Type\"]\n : never;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.Fields","apps.OAuth2Method","apps.SecretsMethod"],"examples":["live-inbox"]},{"symbol":"apps.AuthMethods","kind":"type","summary":"Auth method names are chosen by the provider author.","signatures":[],"definition":"export type AuthMethods = Readonly<Record<string, AuthMethod>>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethod"],"examples":["live-inbox"]},{"symbol":"apps.boolean","kind":"function","summary":"A boolean. No coercion.","signatures":["(): Schema<boolean>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.CacheError","kind":"class","summary":"Expected cache failures never include keys, values or upstream exception text.","signatures":[],"definition":"export class CacheError extends Schema.TaggedError<CacheError>()(\"CacheError\", {\n reason: Schema.Literals([\"unavailable\", \"storage\", \"invalid\", \"capacity\", \"timeout\"]),\n}) {}","tags":[],"docs":"tools.md","source":"app-cache/src/contracts/cache.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.CacheGetOptions","kind":"type","summary":"Load options shared by normal reads and explicit refreshes.","signatures":[],"definition":"export interface CacheGetOptions<A> {\n readonly key: JsonValue;\n readonly schema: Schema<A, boolean>;\n readonly freshFor: Duration.Input;\n readonly staleFor?: Duration.Input;\n readonly load: (context: CacheLoadContext) => Promise<A>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["apps.CacheLoadContext","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.CacheLoadContext","kind":"type","summary":"A cache loader owns its own cancellation and HTTP capability, including during SWR.","signatures":[],"definition":"export interface CacheLoadContext {\n readonly cache: AppCache;\n readonly signal: AbortSignal;\n readonly fetch: typeof globalThis.fetch;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.AppCache"],"examples":["live-inbox"]},{"symbol":"apps.cron","kind":"function","summary":"Calendar alternative for wall-clock schedules. UTC is the explicit default when timezone is omitted.","signatures":["<Input, Output, Context>(calendar: { readonly expression: string; readonly timezone?: string; }, operation: Operation<Input, Output, \"mutation\", Context>, input: NoInfer<Input>): ScheduleDeclaration<Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schedules.ts","related":["apps.Operation","apps.ScheduleDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.Database","kind":"type","summary":"Mutation methods stay inside one native SQLite transaction.","signatures":[],"definition":"export type Database<T extends Tables> = {\n readonly [K in keyof T]: WriteTable<RowOf<T[K]>, InputValue<T[K][\"fields\"]>, IndexOf<T[K]>>;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.DatabaseDefinition","kind":"type","summary":"Pure database declaration shared by requirements and derived handler contexts.","signatures":[],"definition":"export interface DatabaseDefinition<T extends Tables = Tables> {\n readonly schema: DatabaseSchema;\n readonly tables: T;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.DatabaseReader","kind":"type","summary":"Queries receive only read methods.","signatures":[],"definition":"export type DatabaseReader<T extends Tables> = {\n readonly [K in keyof T]: ReadTable<RowOf<T[K]>, IndexOf<T[K]>>;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.decodeJson","kind":"function","summary":"Decode a fetch response with safe status/body errors. Unexpected reader failures propagate unchanged.","signatures":["<T>(response: JsonResponse, schema: Schema<T, boolean>): Promise<T>"],"tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.JsonResponse","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.defineApp","kind":"function","summary":"Assemble app behavior. Package names belong in package.json; hosts name installed copies.","signatures":["<const Requirements extends AppRequirements, Def extends AppDefinition<Requirements>>(requirements: Requirements, definition: (Def & AppDefinition<Requirements>) | ((context: AppContext<Requirements>) => Promise<Def & AppDefinition<Requirements>>)): App<Requirements, Def>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/app.ts","related":["AppContext","apps.App","apps.AppContext","apps.AppDefinition","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.defineDatabase","kind":"function","summary":"Declare storage independently of handlers; the host binds each invocation's database.","signatures":["<const T extends Tables>(tables: T): DatabaseDefinition<T>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/storage.ts","related":["apps.DatabaseDefinition"],"examples":["live-inbox"]},{"symbol":"apps.defineProvider","kind":"function","summary":"Retain the provider and literal method names without registering or authenticating it.","signatures":["<const Auth extends AuthMethods>({ health, ...options }: ProviderOptions<Auth>): Provider<Auth>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/provider.ts","related":["apps.AuthMethods","apps.Provider","apps.ProviderOptions","Provider"],"examples":["live-inbox"]},{"symbol":"apps.dynamicRouter","kind":"function","summary":"Declare a router whose tools are discovered when read. `list` returns tools with names relative\nto this router; mark queries with `readOnly: true`. `resolve` receives one of those names.","signatures":["(source: { readonly meta?: () => RouterOptions | Promise<RouterOptions>; readonly list: () => readonly HostedTool[] | Promise<readonly HostedTool[]>; readonly resolve: (name: string) => OperationDeclaration<\"query\" | \"mutation\", unknown> | undefined | Promise<OperationDeclaration<\"query\" | \"mutation\", unknown> | undefined>; }): RouterDeclaration"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.RouterDeclaration","apps.RouterOptions"],"examples":["live-inbox"]},{"symbol":"apps.dynamicSkills","kind":"function","summary":"Declare skills that load only when skills are read, such as `list: () => githubSkills({...})`.","signatures":["(source: { readonly list: () => readonly AppSkillSource[] | Promise<readonly AppSkillSource[]>; }): DynamicSkills"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/dynamic-skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Elicit","kind":"type","summary":"App authors await standard MCP form responses without depending on Effect or a particular host.","signatures":[],"definition":"export type Elicit = (request: FormElicitation) => Promise<ElicitationResponse>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":["apps.ElicitationResponse","apps.FormElicitation"],"examples":["live-inbox"]},{"symbol":"apps.ElicitationFailed","kind":"class","summary":"A tool interaction could not be delivered or its request/response was invalid. No private payload is retained.","signatures":[],"definition":"export class ElicitationFailed extends Schema.TaggedError<ElicitationFailed>()(\n \"ElicitationFailed\",\n {\n reason: Schema.Literals([\n \"unavailable\",\n \"transaction\",\n \"invalid-request\",\n \"invalid-response\",\n \"transport\",\n \"expired\",\n \"forbidden\",\n ]),\n },\n) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ElicitationResponse","kind":"type","summary":"MCP accept/decline/cancel response, without imposing a client or transport on app code.","signatures":[],"definition":"ElicitationResponse = Schema.Union([\n Schema.Struct({ ...McpSchema.ElicitAcceptResult.fields, _meta: Schema.optional(JsonObject) }),\n Schema.Struct({ ...McpSchema.ElicitDeclineResult.fields, _meta: Schema.optional(JsonObject) }),\n])","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":["apps.JsonObject"],"examples":["live-inbox"]},{"symbol":"apps.FetchOptionUnsupported","kind":"class","summary":"`ctx.fetch` was given a standard RequestInit value the app runtime does not implement.","signatures":[],"definition":"export class FetchOptionUnsupported extends Schema.TaggedError<FetchOptionUnsupported>()(\n \"FetchOptionUnsupported\",\n {\n option: RestrictedFetchOption,\n value: Schema.String,\n supported: Schema.Array(Schema.String),\n },\n) {\n override get message();\n\n /** What to do instead, when the standard value has an equivalent the runtime supports. */\n private get advice();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/network.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Fields","kind":"type","summary":"Named author fields.","signatures":[],"definition":"export type Fields = Readonly<Record<string, Schema<unknown, boolean>>>;","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.FormElicitation","kind":"type","summary":"Plain-data form request derived from the pinned MCP protocol schema.","signatures":[],"definition":"FormElicitation = Schema.Struct({\n ...McpSchema.ElicitRequestFormParams.fields,\n mode: Schema.Literal(\"form\"),\n requestedSchema: Schema.toEncoded(McpSchema.ElicitRequestFormParams.fields.requestedSchema),\n _meta: Schema.optional(JsonObject),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":["apps.JsonObject"],"examples":["live-inbox"]},{"symbol":"apps.id","kind":"function","summary":"A row reference records the target table; existence is not a foreign-key constraint.","signatures":["(table: string): Schema<string>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.Infer","kind":"type","summary":"Infer the parsed author value.","signatures":[],"definition":"export type Infer<S> = S extends Schema<infer T, boolean> ? T : never;","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.interval","kind":"function","summary":"Run an existing mutation at a fixed interval. Installation enablement belongs to the host.","signatures":["<Input, Output, Context>(duration: Interval, operation: Operation<Input, Output, \"mutation\", Context>, input: NoInfer<Input>): ScheduleDeclaration<Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schedules.ts","related":["apps.Operation","apps.ScheduleDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.json","kind":"function","summary":"Any JSON value. Values still cross the native JSON decoder.","signatures":["(): Schema<EffectSchema.Json>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.JsonObject","kind":"type","summary":"A JSON object, distinct from an authored value schema.","signatures":[],"definition":"JsonObject = Schema.Record(Schema.String, JsonValue)","tags":[],"docs":"tools.md","source":"apps/src/contracts/schema.ts","related":["apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"apps.JsonResponse","kind":"type","summary":"Native fetch-compatible response accepted at the author boundary.","signatures":[],"definition":"export type JsonResponse = PromiseMethods<NativeResponse>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.jsonSchema","kind":"function","summary":"Import JSON metadata now; unsupported schemas and invalid values fail when parsed.","signatures":["(input: unknown): Schema<EffectSchema.Json>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.JsonValue","kind":"type","summary":"JSON values carried by remote protocols such as MCP.","signatures":[],"definition":"JsonValue = Schema.Json","tags":[],"docs":"tools.md","source":"apps/src/contracts/schema.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.literal","kind":"function","summary":"One exact JSON scalar value.","signatures":["<const T extends string | number | boolean | null>(value: T): Schema<T>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ManyAccounts","kind":"class","summary":"A collection requirement; selecting accounts does not copy or transfer them.","signatures":[],"definition":"export class ManyAccounts<Auth extends AuthMethods> extends Data.TaggedClass(\"many\")<{\n readonly provider: Provider<Auth>;\n}> {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods","apps.Provider","Provider"],"examples":["live-inbox"]},{"symbol":"apps.mutation","kind":"function","summary":"Explicit write operation. Database writes roll back on failure; external effects cannot be undone.","signatures":["<Input, Output, Context extends AppContext = MutationContext>(options: OperationOptions<Input, Output>, run: (context: Context, input: Input) => Promise<Output>): Operation<Input, Output, \"mutation\", Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["AppContext","apps.AppContext","apps.MutationContext","apps.Operation","apps.OperationOptions"],"examples":["live-inbox"]},{"symbol":"apps.MutationContext","kind":"type","summary":"Interactive mutation context; declared storage belongs to the invocation transaction.","signatures":[],"definition":"export type MutationContext<Requirements extends AppRequirements = AppRequirements> = Omit<\n AppContext<Requirements>,\n \"workflows\"\n> & { readonly workflows: WorkflowControls } & StorageContext<Requirements, true>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["AppContext","apps.AppContext","apps.AppRequirements","apps.WorkflowControls","WorkflowControls"],"examples":["live-inbox"]},{"symbol":"apps.NetworkRefused","kind":"class","summary":"Executor's app network refused a request before it reached the service.","signatures":[],"definition":"export class NetworkRefused extends Schema.TaggedError<NetworkRefused>()(\"NetworkRefused\", {\n /** The refused destination, with its port when the URL names one. */\n host: Schema.String,\n refusal: NetworkRefusal,\n}) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/network.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.NonRetryableError","kind":"class","summary":"Explicitly stop retrying an authored step. Its message is reported like any step error.","signatures":[],"definition":"export class NonRetryableError extends Error {\n override readonly name = \"NonRetryableError\";\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.NotImplemented","kind":"class","summary":"Explicit failure for authored capabilities that are still only sketches.","signatures":[],"definition":"export class NotImplemented extends Schema.TaggedError<NotImplemented>()(\"NotImplemented\", {\n operation: Schema.String,\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.number","kind":"function","summary":"A finite JSON number. No coercion.","signatures":["(): Schema<number>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.oauth2","kind":"function","summary":"Declare OAuth discovery/endpoints and an optional app-visible response projection.\n`authorizationParams` adds service-defined sign-in parameters; a declared `authorizationUrl`\nkeeps its own query. Neither can set host-owned parameters, and each parameter appears once.","signatures":["(options: OAuth2Config): OAuth2Method<typeof OAuth2AccessToken>","<Response extends Schema<unknown, boolean>>(options: OAuth2Config & { readonly response: Response; }): OAuth2Method<Response>"],"tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.OAuth2Config","apps.OAuth2Method","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.OAuth2AccessToken","kind":"value","summary":"Default OAuth fields visible to app code. Host-only grants and clients stay private.","signatures":[],"definition":"const OAuth2AccessToken: Schema<{ readonly access_token: string; }, false>","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.OAuth2Config","kind":"type","summary":"OAuth options as authors write them. `authorizationParams` naming a host-owned protocol\nparameter such as `state` or `scope` is a type error as well as a declaration failure.","signatures":[],"definition":"export type OAuth2Config = WithoutReservedParams<NativeOAuth2Config>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.OAuth2Method","kind":"type","summary":"An OAuth declaration inferred from its author-facing response schema.","signatures":[],"definition":"export type OAuth2Method<Response extends Schema<unknown, boolean>> = NativeOAuth2Method<\n EffectSchema.Decoder<AccountFields<Response>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.object","kind":"function","summary":"Parse declared fields and omit undeclared fields.","signatures":["<const F extends Fields>(fields: F): ObjectSchema<F>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Fields","apps.ObjectSchema"],"examples":["live-inbox"]},{"symbol":"apps.ObjectSchema","kind":"type","summary":"An author object schema with retained field declarations.","signatures":[],"definition":"export interface ObjectSchema<F extends Fields> extends Schema<ObjectValue<F>> {\n readonly fields: F;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Fields","apps.ObjectValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ObjectValue","kind":"type","summary":"Optional fields may be absent; defaulted fields are present after decoding.","signatures":[],"definition":"export type ObjectValue<F extends Fields> = {\n readonly [Key in keyof F as F[Key][\"optionalValue\"] extends true ? never : Key]: Infer<F[Key]>;\n} & {\n readonly [Key in keyof F as F[Key][\"optionalValue\"] extends true ? Key : never]?: Infer<F[Key]>;\n};","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Fields","apps.Infer"],"examples":["live-inbox"]},{"symbol":"apps.Operation","kind":"type","summary":"Typed operation handles drive browser reference inference without bundling handlers.","signatures":[],"definition":"export interface Operation<\n Input,\n Output,\n Kind extends \"query\" | \"mutation\",\n Context = AppContext,\n> extends OperationDeclaration<Kind, Context> {\n readonly [NativeOperation]: AppOperation<Input, Output> & { readonly kind: Kind };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["AppContext","apps.AppContext"],"examples":["live-inbox"]},{"symbol":"apps.OperationContext","kind":"type","summary":"Host-bound operation capabilities; the author declaration refines accounts and storage.","signatures":[],"definition":"export type OperationContext = BoundContext<AccountSlots> & {\n readonly db?: DatabaseReader<Tables> | Database<Tables>;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/operations.ts","related":["apps.AccountSlots","apps.Database","apps.DatabaseReader"],"examples":["live-inbox"]},{"symbol":"apps.OperationDescription","kind":"type","summary":"Serializable live tool metadata; executable callbacks never cross this boundary. `name` is the\ntool's full dotted path. `router` is the path of the router that owns it, omitted at the root.\n`readOnly` marks a query; a tool without it is a mutation.\nParsed live tool description.","signatures":[],"definition":"HostedTool = Schema.Struct({\n schedules: Schema.optionalKey(Schema.Array(OperationSchedule)),\n name: Schema.NonEmptyString,\n router: Schema.optionalKey(Schema.NonEmptyString),\n tags: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n description: Schema.String,\n inputSchema: JsonObject,\n readOnly: Schema.optionalKey(Schema.Boolean),\n title: Schema.optionalKey(Schema.String),\n outputSchema: Schema.optionalKey(JsonObject),\n annotations: Schema.optionalKey(ToolAnnotations),\n _meta: Schema.optionalKey(JsonObject),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/protocols/4.ts","related":["apps.JsonObject"],"examples":["live-inbox"]},{"symbol":"apps.OperationOptions","kind":"type","summary":"Options shared by database and external operations. Output defaults to a JSON-safe host check.","signatures":[],"definition":"export interface OperationOptions<Input, Output> {\n readonly description?: string;\n readonly title?: string;\n readonly input: Schema<Input, boolean>;\n readonly output?: Schema<Output, boolean>;\n readonly approval?: Approval<Input>;\n readonly annotations?: ToolAnnotations;\n readonly _meta?: JsonObject;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["apps.Approval","apps.JsonObject","apps.Schema","apps/operations/approval.Approval","Schema"],"examples":["live-inbox"]},{"symbol":"apps.plain","kind":"function","summary":"A field that is not secret, such as a subdomain or region. App code reads its real value and\nthe connect form shows it.","signatures":["<S extends Schema<unknown, boolean>>(schema: S): Exposed<S, \"plain\">"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.Provider","kind":"class","summary":"A provider declaration. The host derives its identity from the declaration, never its check.","signatures":[],"definition":"export class Provider<Auth extends AuthMethods> extends Data.Class<{\n readonly name: string;\n readonly auth: Auth;\n /**\n * The hosts this provider's credentials may be sent to. When present, secret fields reach app\n * code as handles that the outbound network replaces only on requests to these hosts.\n */\n readonly hosts?: readonly string[];\n /**\n * Stored without its method types so a specific provider still fills a general slot. The host\n * binds the account against this provider's methods before running it.\n */\n readonly health?: AccountCheck<AuthMethods>;\n}> {\n /** Declare zero or more accounts from this provider without performing I/O. */\n many(): ManyAccounts<Auth>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods","apps.ManyAccounts","Provider"],"examples":["live-inbox"]},{"symbol":"apps.ProviderError","kind":"class","summary":"A recognized service failure. App authors can throw this ordinary Error from\nasync code. Supply only a known reason and the account used for that request.\nNever include response bodies, messages, URLs or credentials. A bare 403 is\n`rejected`; `forbidden` requires explicit evidence of insufficient permission.\n\nThe framework adds the phase the failure happened in, and `upstream`: the error code and\ndescription the service stated in its documented error format, such as a Bearer challenge's\n`error` and `error_description`. Account secrets in that text are replaced.","signatures":[],"definition":"export class ProviderError extends Schema.TaggedError<ProviderError>()(\"ProviderError\", {\n reason: Schema.Literals([\"unauthorized\", \"forbidden\", \"rate_limited\", \"unavailable\", \"rejected\"]),\n status: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 100, maximum: 599 }))),\n accountId: Schema.optional(AccountId),\n phase: Schema.optional(FailurePhase),\n upstream: Schema.optional(UpstreamError),\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider-error.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ProviderOptions","kind":"type","summary":"Author options: the account check is an ordinary async function.","signatures":[],"definition":"export interface ProviderOptions<Auth extends AuthMethods> {\n readonly name: string;\n readonly auth: Auth;\n /**\n * Hosts the credentials may be sent to: `api.example.com`, `api.example.com:8443`, or\n * `*.example.com` for one level of subdomain. Secret fields then reach app code as handles\n * that the outbound network replaces only on requests to these hosts. An account records the\n * hosts it was connected for; changing them does not change the provider, but an existing\n * account sends only to hosts it was connected for until it is connected again.\n */\n readonly hosts?: readonly string[];\n /** Verify a connected account with a safe read, optionally reporting its upstream identity. */\n readonly health?: PromiseMethod<AccountCheck<Auth>[\"run\"]>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/provider.ts","related":["apps.AuthMethods"],"examples":["live-inbox"]},{"symbol":"apps.query","kind":"function","summary":"Read operation. External reads are allowed; only database writes are mechanically prohibited.","signatures":["<Input, Output, Context extends AppContext = AppContext<AppRequirements>>(options: OperationOptions<Input, Output>, run: (context: Context, input: Input) => Promise<Output>): Operation<Input, Output, \"query\", Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["AppContext","apps.AppContext","apps.AppRequirements","apps.Operation","apps.OperationOptions"],"examples":["live-inbox"]},{"symbol":"apps.QueryContext","kind":"type","summary":"Interactive query context; declared storage exposes only read methods.","signatures":[],"definition":"export type QueryContext<Requirements extends AppRequirements = AppRequirements> =\n AppContext<Requirements> & StorageContext<Requirements, false>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["AppContext","apps.AppContext","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.raw","kind":"function","summary":"A secret field that app code reads as its real value, for request signing and similar uses.\nThe connect form warns that the app can read it. Prefer an unmarked field, which app code\nreceives as a handle that only reaches the provider's declared hosts.","signatures":["<S extends Schema<unknown, boolean>>(schema: S): Exposed<S, \"raw\">"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.record","kind":"function","summary":"Named values with a common schema.","signatures":["<T>(value: Schema<T, boolean>): Schema<Readonly<Record<string, T>>>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ReservedAuthorizationParam","kind":"type","summary":"A protocol parameter only the host sets on the authorization request.","signatures":[],"definition":"export type ReservedAuthorizationParam = (typeof reservedAuthorizationParams)[number];","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ResponseDecodeError","kind":"class","summary":"Invalid JSON or a schema mismatch. Never includes the response body.","signatures":[],"definition":"export class ResponseDecodeError extends Schema.TaggedError<ResponseDecodeError>()(\n \"ResponseDecodeError\",\n {},\n) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/http.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ResponseStatusError","kind":"class","summary":"A non-2xx response. Carries the status only, never the body.","signatures":[],"definition":"export class ResponseStatusError extends Schema.TaggedError<ResponseStatusError>()(\n \"ResponseStatusError\",\n { status: Schema.Number },\n) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/http.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.router","kind":"function","summary":"Group operations and routers under path keys, like tRPC's nested routers, with metadata an\nagent can read. Passing an existing router instead of children overrides its metadata:\n`router(mcpRouter(options), { description: \"...\" })`.","signatures":["<Query = unknown, Mutation = unknown>(children: Readonly<Record<string, RouterChild<Query, Mutation>>>, options?: RouterOptions): RouterDeclaration<Query, Mutation>","<Query, Mutation>(source: RouterDeclaration<Query, Mutation>, options: RouterOptions): RouterDeclaration<Query, Mutation>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.RouterChild","apps.RouterDeclaration","apps.RouterOptions"],"examples":["live-inbox"]},{"symbol":"apps.RouterChild","kind":"type","summary":"An operation or nested router under one key. Each child is typed only by its own kind's context.","signatures":[],"definition":"export interface RouterChild<Query, Mutation> {\n readonly [QueryHandlerContext]?: (context: Query) => void;\n readonly [MutationHandlerContext]?: (context: Mutation) => void;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.RouterDeclaration","kind":"type","summary":"A router declaration. The phantom contexts let `defineApp` type inline handlers; protocol\nrouters accept any context because their operations only use the framework's own capabilities.\nThe native router is held under a private key in implementation/router.ts.","signatures":[],"definition":"export interface RouterDeclaration<Query = unknown, Mutation = unknown> {\n readonly [QueryHandlerContext]?: (context: Query) => void;\n readonly [MutationHandlerContext]?: (context: Mutation) => void;\n readonly [NativeRouterKey]: unknown;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.RouterIcon","kind":"type","summary":"An image a client may show beside a router, such as an MCP server's own icon. Models never read it.","signatures":[],"definition":"RouterIcon = Schema.Struct({\n src: Schema.NonEmptyString,\n mimeType: Schema.optionalKey(Schema.String),\n sizes: Schema.optionalKey(Schema.Array(Schema.String)),\n theme: Schema.optionalKey(Schema.Literals([\"light\", \"dark\"])),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/router.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.RouterOptions","kind":"type","summary":"Author metadata for a router. Instructions become a skill named after the router's path.","signatures":[],"definition":"export interface RouterOptions {\n readonly title?: string;\n readonly description?: string;\n readonly instructions?: string;\n readonly icons?: readonly RouterIcon[];\n readonly tags?: Readonly<Record<string, string>>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.RouterIcon"],"examples":["live-inbox"]},{"symbol":"apps.ScheduleDeclaration","kind":"type","summary":"The app adapter resolves this operation handle to its declared mutation name.","signatures":[],"definition":"export interface ScheduleDeclaration<Context = never> {\n readonly operation: OperationDeclaration<\"mutation\", Context>;\n readonly timing: ScheduleTiming;\n readonly input: JsonValue;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schedules.ts","related":["apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"apps.Schema","kind":"type","summary":"An author-facing value schema. Effect is never required in author code.","signatures":[],"definition":"export interface Schema<T, Optional extends boolean = false> {\n readonly [StorageField]?: Field;\n readonly [Decoder]: EffectSchema.Decoder<T>;\n readonly optionalValue: Optional;\n /** Parse an unknown value; invalid input throws a safe ValidationError. */\n parse(input: unknown): T;\n /** Accept an absent field without changing the original schema. */\n optional(): Schema<T | undefined, true>;\n /** Validate the default now and use it for undefined input. */\n default(value: T): Schema<T> & { readonly hasDefault: true; readonly inputOptional: Optional };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.ValidationError","Schema"],"examples":["live-inbox"]},{"symbol":"apps.secrets","kind":"function","summary":"Declare a secrets method without requiring an Effect schema from the author.","signatures":["<const F extends Fields>(options: { readonly label: string; readonly fields: ObjectSchema<F>; }): SecretsMethod<ObjectSchema<F>>"],"tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Fields","apps.ObjectSchema","apps.SecretsMethod"],"examples":["live-inbox"]},{"symbol":"apps.SecretsMethod","kind":"type","summary":"A secrets declaration inferred from an author schema.","signatures":[],"definition":"export type SecretsMethod<Shape extends ObjectSchema<Fields>> = NativeSecretsMethod<\n EffectSchema.Decoder<AccountFields<Shape>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Fields","apps.ObjectSchema"],"examples":["live-inbox"]},{"symbol":"apps.SecretString","kind":"type","summary":"A secret account value. In a provider that declares hosts it is a handle, which the host's\noutbound network replaces with the real value only on requests to those hosts. Pass it to\nclients and headers as an ordinary string; do not decode or transform it.","signatures":[],"definition":"export type SecretString = string & { readonly [Secret]: true };","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Skill","kind":"type","summary":"Files use paths relative to this skill directory; reading one never executes its contents.","signatures":[],"definition":"AppSkillSource = Schema.Struct({\n ...AppSkillMetadata.fields,\n files: Schema.Array(SkillFile).check(\n Schema.makeFilter(\n (files) =>\n files.some((file) => file.path === \"SKILL.md\") &&\n new Set(files.map((file) => file.path)).size === files.length,\n ),\n ),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps.SkillFile","kind":"type","summary":"UTF-8 text resource. Reading a resource never executes it.","signatures":[],"definition":"SkillFile = Schema.Struct({ path: SkillFilePath, content: Schema.String })","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps.string","kind":"function","summary":"A string, optionally with a minimum length. No coercion.","signatures":["(options?: { readonly minLength?: number; }): Schema<string>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.table","kind":"function","summary":"Declare scalar columns using the same schemas as operation inputs. The host adds `id`,\n`createdAt` and `updatedAt` to every row, so tables cannot declare those names.","signatures":["<const F extends Fields & { readonly [K in ReservedFieldName]?: never; }>(fields: F): Table<F>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/storage.ts","related":["apps.Fields","apps.Table","Table"],"examples":["live-inbox"]},{"symbol":"apps.Table","kind":"type","summary":"Typed table declaration; indexes refer only to authored or host metadata fields.","signatures":[],"definition":"export interface Table<F extends Fields, Index extends string = never> {\n readonly fields: F;\n readonly indexes: ReadonlyArray<{ readonly name: string; readonly fields: readonly string[] }>;\n readonly index: <Name extends string>(\n name: Name,\n fields: readonly [\n (keyof F & string) | keyof typeof RowMetadata.Type,\n ...((keyof F & string) | keyof typeof RowMetadata.Type)[],\n ],\n ) => Table<F, Index | Name>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":["apps.Fields","Table"],"examples":["live-inbox"]},{"symbol":"apps.toolAnnotations","kind":"function","summary":"The advisory hints an operation carries, such as an MCP server's `destructiveHint`. App code\nreads them to choose an approval; the framework never infers one from them.","signatures":["(operation: OperationDeclaration<\"query\" | \"mutation\", never>): ToolAnnotations | undefined"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.userId","kind":"function","summary":"A host user identifier, stored as a string without imposing a product auth model.","signatures":["(): Schema<string>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ValidationError","kind":"class","summary":"Invalid input. Never includes supplied values, credentials or response bodies.","signatures":[],"definition":"export class ValidationError extends Schema.TaggedError<ValidationError>()(\"ValidationError\", {}) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/schema.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Webhook","kind":"type","summary":"Author lifecycle methods use async functions and share native decoded context/state types.","signatures":[],"definition":"export type Webhook<\n Context extends WebhookContext,\n Config extends Schema<unknown, boolean>,\n State extends Schema<unknown, boolean>,\n> = AuthorWebhook<\n NativeWebhook<Context, EffectSchema.Decoder<Infer<Config>>, EffectSchema.Decoder<Infer<State>>>,\n Config,\n State\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Infer","apps.Schema","apps.WebhookContext","Schema"],"examples":["live-inbox"]},{"symbol":"apps.WebhookContext","kind":"type","summary":"Background webhook context has account and storage access without interactive input.","signatures":[],"definition":"export type WebhookContext<Requirements extends AppRequirements = AppRequirements> = Omit<\n MutationContext<Requirements>,\n \"elicit\"\n>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["apps.AppRequirements","apps.MutationContext"],"examples":["live-inbox"]},{"symbol":"apps.withApproval","kind":"function","summary":"Attach the same approval function to a generated or shared operation.","signatures":["<Input, Output, Kind extends \"query\" | \"mutation\", Context>(operation: Operation<Input, Output, Kind, Context>, approval: Approval<Input>): Operation<Input, Output, Kind, Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["apps.Approval","apps.Operation","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps.withApprovals","kind":"function","summary":"Choose an approval for each operation a router contains, including tools a dynamic router\nresolves later. `policy` receives the operation and its name relative to this router; returning\nundefined keeps the operation's own approval. Read hints with `toolAnnotations(operation)`.\nApply it to each account's router before `accountRouter` combines them, so every account keeps\nits own tools' hints.","signatures":["<Query, Mutation>(source: RouterDeclaration<Query, Mutation>, policy: (operation: OperationDeclaration<\"query\" | \"mutation\", never>, name: string) => Approval | undefined): RouterDeclaration<Query, Mutation>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.Approval","apps.RouterDeclaration","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps.workflow","kind":"function","summary":"Declare durable orchestration without starting a run or performing I/O.","signatures":["<Input, Output, Context extends WorkflowContext = WorkflowContext<AppRequirements>>(options: { readonly input: Schema<Input, boolean>; readonly output?: Schema<Output, boolean>; readonly description?: string; }, run: (context: Context, input: Input) => Promise<Output>): Workflow<Input, Output, Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/workflows.ts","related":["apps.AppRequirements","apps.Schema","apps.Workflow","apps.WorkflowContext","Schema"],"examples":["live-inbox"]},{"symbol":"apps.Workflow","kind":"type","summary":"A workflow declaration retains input/output inference and required context compatibility.","signatures":[],"definition":"export interface Workflow<Input, Output, Context extends WorkflowContext = WorkflowContext> {\n readonly [HandlerContext]?: (context: Context) => void;\n readonly [NativeWorkflow]: AppWorkflow<Input, Output>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/workflows.ts","related":["apps.WorkflowContext"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowContext","kind":"type","summary":"The orchestration body gets no account, database or interactive capabilities.","signatures":[],"definition":"export interface WorkflowContext<Requirements extends AppRequirements = AppRequirements> {\n readonly runId: WorkflowRunId;\n readonly step: WorkflowStep<Requirements>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.AppRequirements","apps.WorkflowStep","WorkflowStep"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowControls","kind":"type","summary":"Mutating handlers may start and terminate runs in their own configured app.","signatures":[],"definition":"export interface WorkflowControls extends WorkflowReads {\n readonly start: (input: {\n readonly workflow: string;\n readonly input: JsonValue;\n readonly key?: string;\n }) => Promise<WorkflowRun>;\n readonly terminate: (input: { readonly run: string }) => Promise<WorkflowRun>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.JsonValue","apps.WorkflowReads","WorkflowControls"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowDeclaration","kind":"type","summary":"Composition view erases input only after retaining its runtime decoder.","signatures":[],"definition":"export interface WorkflowDeclaration<Context extends WorkflowContext> {\n readonly [HandlerContext]?: (context: Context) => void;\n readonly [NativeWorkflow]: Omit<AppWorkflow<never>, \"input\"> & {\n readonly input: EffectSchema.Decoder<unknown>;\n };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/workflows.ts","related":["apps.WorkflowContext"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowDuration","kind":"type","summary":"Numbers are milliseconds; strings use a quantity and full unit, such as \"5 minutes\".","signatures":[],"definition":"WorkflowDuration = Schema.Union([\n Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.NonEmptyString,\n]).check(Schema.makeFilter((value) => workflowDurationMillis(value) !== undefined))","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.WorkflowFailure","kind":"class","summary":"Failures cross host boundaries as reason codes plus the app's own bounded error detail.","signatures":[],"definition":"export class WorkflowFailure extends Schema.TaggedError<WorkflowFailure>()(\"WorkflowFailure\", {\n ...WorkflowFailureDetail,\n reason: Schema.Literals([\n \"unavailable\",\n \"not_found\",\n \"input\",\n \"output\",\n \"operation\",\n \"approval\",\n \"credentials\",\n \"terminated\",\n \"execution\",\n \"conflict\",\n \"engine\",\n ]),\n retryable: Schema.Boolean,\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.WorkflowReads","kind":"type","summary":"Query and factory contexts may inspect only their own app's runs.","signatures":[],"definition":"export interface WorkflowReads {\n readonly get: (input: { readonly run: string }) => Promise<WorkflowRun>;\n readonly list: (input?: {\n readonly workflow?: string;\n readonly limit?: number;\n readonly cursor?: string;\n }) => Promise<WorkflowRunPage>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.WorkflowStep","kind":"type","summary":"Explicit durable boundaries; database access passes through registered app operations.","signatures":[],"definition":"export interface WorkflowStep<Requirements extends AppRequirements = AppRequirements> {\n do<Output>(\n name: string,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n do<Output>(\n name: string,\n options: WorkflowStepOptions,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n runQuery<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"query\", QueryContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n runMutation<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"mutation\", MutationContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n readonly sleep: (name: string, duration: WorkflowDuration) => Promise<void>;\n readonly sleepUntil: (name: string, timestamp: number | Date) => Promise<void>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.AppRequirements","apps.MutationContext","apps.Operation","apps.QueryContext","apps.WorkflowDuration","apps.WorkflowStepContext","apps.WorkflowStepOptions","WorkflowStep"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowStepContext","kind":"type","summary":"External steps get fresh credentials and cancellation, without storage or live elicitation.","signatures":[],"definition":"export type WorkflowStepContext<Requirements extends AppRequirements = AppRequirements> = Omit<\n AppContext<Requirements>,\n \"elicit\" | \"workflows\"\n> & {\n readonly runId: WorkflowRunId;\n readonly stepId: string;\n readonly idempotencyKey: string;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["AppContext","apps.AppContext","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowStepOptions","kind":"type","summary":"Author retry and timeout options are passed to the durable engine.","signatures":[],"definition":"WorkflowStepOptions = Schema.Struct({\n retries: Schema.optionalKey(\n Schema.Struct({\n limit: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n delay: WorkflowDuration,\n backoff: Schema.optionalKey(Schema.Literals([\"constant\", \"linear\", \"exponential\"])),\n }),\n ),\n timeout: Schema.optionalKey(WorkflowDuration),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.WorkflowDuration"],"examples":["live-inbox"]},{"symbol":"apps/client.AppMutation","kind":"type","summary":"A callable mutation. Success means the write was acknowledged; its overlay stays until fresh reads finish.","signatures":[],"definition":"export interface AppMutation<Input, Output> {\n (input: Input): Promise<Output>;\n /** Return a new mutation handle with this projection. Failures remove only this invocation's changes. */\n withOptimisticUpdate(update: OptimisticUpdate<Input>): AppMutation<Input, Output>;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["AppMutation","apps/client.OptimisticUpdate"],"examples":["live-inbox"]},{"symbol":"apps/client.AppQueryFailed","kind":"class","summary":"Safe client failure; arbitrary transport errors and response data are never exposed.","signatures":[],"definition":"export class AppQueryFailed extends Schema.TaggedError<AppQueryFailed>()(\"AppQueryFailed\", {}) {}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/client.createAppClient","kind":"function","summary":"A scoped page client. Host-injected context carries only the deployment, never credentials.","signatures":["(): { dispose: () => Promise<void>; query: <Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Promise<NoInfer<Output>>; mutate: <Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Promise<Output>; mutation: <Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, output: Schema<NoInfer<Output>, boolean>) => AppMutation<Input, Output>; queryAtom: <Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Atom.Atom<AsyncResult.AsyncResult<Output, unknown>>; }"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["AppMutation","apps.Schema","apps/client.AppMutation","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"apps/client.liveQueryAtom","kind":"function","summary":"Subscribe for the atom's mounted lifetime and parse every result using a shared output schema.\nThe host supplies routing, authentication and reconnection behavior through transport.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, options: { readonly output: Schema<NoInfer<Output>, boolean>; readonly transport: QueryTransport; }): Atom.Atom<AsyncResult<NoInfer<Output>, NoSuchElementError | AppQueryFailed>>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/live.ts","related":["apps.Schema","apps/client.AppQueryFailed","apps/client.OperationReference","apps/client.QueryTransport","Schema"],"examples":["live-inbox"]},{"symbol":"apps/client.mutationReference","kind":"function","summary":"Make a mutation reference using a type-only server import.","signatures":["<Mutation>(name: Mutation extends Operation<infer _Input, infer _Output, \"mutation\", infer _Context> ? string : never): OperationReference<InputOf<Mutation>, OutputOf<Mutation>, \"mutation\">"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/live.ts","related":["apps.Operation","apps/client.OperationReference"],"examples":["live-inbox"]},{"symbol":"apps/client.OperationReference","kind":"type","summary":"Serializable named reference; the phantom field is never populated at runtime.","signatures":[],"definition":"export interface OperationReference<Input, Output, Kind extends \"query\" | \"mutation\"> {\n readonly name: string;\n readonly kind: Kind;\n readonly _types?: { readonly input: Input; readonly output: Output };\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/client.OptimisticLocalStore","kind":"type","summary":"Read or replace mounted queries during a synchronous optimistic update. Never mutate returned values.","signatures":[],"definition":"export interface OptimisticLocalStore {\n /** Read the projected result, or undefined if this query is not loaded in this client. */\n getQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n ): Output | undefined;\n /** Read all mounted argument variants of an operation, including loading queries. */\n getAllQueries<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n ): readonly { readonly input: Input; readonly value: Output | undefined }[];\n /** Replace a mounted query's projected result. The query's output schema validates the new value. */\n setQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n value: NoInfer<Output>,\n ): void;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"apps/client.OptimisticUpdate","kind":"type","summary":"Pure synchronous projection. Replayed over current data; create temporary IDs before invoking the mutation.","signatures":[],"definition":"export type OptimisticUpdate<Input> = (store: OptimisticLocalStore, input: Input) => undefined;","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OptimisticLocalStore","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"apps/client.QueryDescriptor","kind":"type","summary":"Host-bound subscription request. Authentication and configured app identity belong to the host.","signatures":[],"definition":"export interface QueryDescriptor {\n readonly name: string;\n readonly input: JsonValue;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":["apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"apps/client.queryReference","kind":"function","summary":"Make a query reference using a type-only server import. No handler is passed or bundled.","signatures":["<Query>(name: Query extends Operation<infer _Input, infer _Output, \"query\", infer _Context> ? string : never): OperationReference<InputOf<Query>, OutputOf<Query>, \"query\">"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/live.ts","related":["apps.Operation","apps/client.OperationReference"],"examples":["live-inbox"]},{"symbol":"apps/client.QueryTransport","kind":"type","summary":"Host transport must close its subscription when async iteration ends. Results are parsed by the client.","signatures":[],"definition":"export interface QueryTransport {\n readonly subscribe: (descriptor: QueryDescriptor) => Promise<AsyncIterable<unknown>>;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":["apps/client.QueryDescriptor"],"examples":["live-inbox"]},{"symbol":"apps/graphql.GraphqlCatalogOptions","kind":"type","summary":"An endpoint, the account whose schema it is, and the metadata policy.","signatures":[],"definition":"export type GraphqlCatalogOptions = Omit<GraphqlToolsOptions, \"accountId\" | \"headers\"> &\n CatalogCacheOptions &\n CatalogAccount;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/graphql-catalog.ts","related":["apps/graphql.GraphqlToolsOptions"],"examples":[]},{"symbol":"apps/graphql.GraphqlError","kind":"class","summary":"Safe failures omit upstream bodies. Execution means a valid GraphQL error response, not malformed data.","signatures":[],"definition":"export class GraphqlError extends Schema.TaggedError<GraphqlError>()(\"GraphqlError\", {\n phase: Schema.Literals([\"discover\", \"call\"]),\n reason: Schema.Literals([\n \"request\",\n \"unauthorized\",\n \"invalid_response\",\n \"invalid_input\",\n \"timeout\",\n \"execution\",\n ]),\n status: Schema.optional(Schema.Number),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/graphql.ts","related":[],"examples":[]},{"symbol":"apps/graphql.graphqlRouter","kind":"function","summary":"Lazy tools with optional persistent metadata caching for the selected account.","signatures":["(options: GraphqlCatalogOptions, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/graphql.ts","related":["apps.RouterDeclaration","apps/graphql.GraphqlCatalogOptions","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/graphql.GraphqlToolsOptions","kind":"type","summary":"Endpoint and credential snapshot for one app evaluation.","signatures":[],"definition":"GraphqlToolsOptions = Schema.Struct({\n url: HttpUrl,\n accountId: Schema.optional(AccountId),\n headers: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n signal: Schema.optional(Schema.instanceOf(AbortSignal)),\n timeoutMs: Schema.optional(\n Schema.Int.check(\n Schema.isBetween({ minimum: 1, maximum: defaultGraphqlClientLimits.maxTimeoutMs }),\n ),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/graphql.ts","related":[],"examples":[]},{"symbol":"apps/graphql.OperationKinds","kind":"type","summary":"Explicit corrections for upstream read-only hints or unusual HTTP semantics.","signatures":[],"definition":"export type OperationKinds = Readonly<Record<string, \"query\" | \"mutation\">>;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/protocol-operations.ts","related":["apps/mcp.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/mcp.McpCatalogOptions","kind":"type","summary":"A server, the account whose catalog it is, and the metadata policy for HTTP/SSE sources. A\nmissing cache keeps discovery invocation-local.","signatures":[],"definition":"export type McpCatalogOptions = Omit<McpToolsOptions, \"accountId\" | \"headers\"> &\n CatalogCacheOptions &\n CatalogAccount;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/mcp-catalog.ts","related":["apps/mcp.McpToolsOptions"],"examples":[]},{"symbol":"apps/mcp.McpCredentialsUnverified","kind":"class","summary":"`mcpHealth` could not show that the server needs the account's credentials, although it accepted\nthem. `anonymous` is what the same check without credentials met: `answered` when it succeeded,\nso a refused key would pass too, or the failure, other than a refusal, that left it undecided.\nOnly app code raises it; the host reports its fixed message, so no host protocol carries it.","signatures":[],"definition":"export class McpCredentialsUnverified extends Schema.TaggedError<McpCredentialsUnverified>()(\n \"McpCredentialsUnverified\",\n { anonymous: Schema.Union([Schema.Literal(\"answered\"), McpError, ProviderError]) },\n) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.ProviderError","apps/mcp.McpError","apps/mcp/stdio.McpError"],"examples":[]},{"symbol":"apps/mcp.McpError","kind":"class","summary":"Safe protocol/transport failure; no raw upstream payloads or credentials. `status` is the HTTP\nstatus a `request` failure was redirected or refused with. Without one, a `request` failure in\nthe `transport` phase never reached the server; in another phase it may be a JSON-RPC error the\nserver answered with. `upstream` is that JSON-RPC error, bounded and with account secrets\nreplaced. A response that is not MCP is `invalid_response`.","signatures":[],"definition":"export class McpError extends Schema.TaggedError<McpError>()(\"McpError\", {\n phase: Schema.Literals([\"connect\", \"discover\", \"call\", \"schema\", \"transport\"]),\n reason: Schema.Literals([\n \"request\",\n \"unauthorized\",\n \"invalid_response\",\n \"timeout\",\n \"invalid_input\",\n ]),\n status: Schema.optional(Schema.Number),\n upstream: Schema.optional(UpstreamError),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps/mcp/stdio.McpError"],"examples":[]},{"symbol":"apps/mcp.mcpHealth","kind":"function","summary":"A provider `health` check for an MCP server. Pass the check context `health` receives, then the\nserver's `url` and the `headers` that send the account's credentials:\n`health: (check) => mcpHealth(check, { url, headers: headers(check.account) })`.\n\nIt connects with those headers, initializes, and reads the first page of tools, then does the\nsame without any headers. No tool runs. The check passes only when the server accepts the account\nand refuses the attempt without credentials. A refused account throws `ProviderError`, as HTTP\nhelpers do. An unreachable or unusable server throws `McpError`, and a request Executor's network\nrefuses throws `NetworkRefused`. A server that also answers without credentials, or whose answer\nto that attempt is not a refusal, throws `McpCredentialsUnverified`. Each of these errors means\nthe check could not verify the account, and the account form explains why. Send credentials only\nin `headers`; the attempt without them uses the same `url`. The check context's `signal` cancels\nboth attempts, and they share one budget that ends early enough before its `deadline` to report a\nserver that did not answer in time. `timeoutMs` can only shorten that budget.","signatures":["<Auth extends AuthMethods>(check: AccountCheckContext<Auth>, options: McpHealthOptions): Promise<void>"],"tags":[],"docs":"integrations.md","source":"apps/src/mcp.ts","related":["apps.AccountCheckContext","apps.AuthMethods","apps/mcp.McpHealthOptions"],"examples":[]},{"symbol":"apps/mcp.McpHealthOptions","kind":"type","summary":"The server a provider check verifies, and the headers that send the checked account's\ncredentials. The account, signal and deadline come from the check context instead. Both attempts\nshare one budget that ends `mcpHealthReserveMs` before the deadline. `timeoutMs` bounds the whole\ncheck too; it can shorten the budget, never extend it.","signatures":[],"definition":"export type McpHealthOptions = Pick<typeof McpHealthInput.Type, \"url\" | \"headers\" | \"timeoutMs\">;","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":[],"examples":[]},{"symbol":"apps/mcp.mcpRouter","kind":"function","summary":"A router over a server's tools for the selected account. Its title, description and\ninstructions come from the server. Kinds override uncertain upstream read-only hints.","signatures":["(options: McpCatalogOptions, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/mcp.ts","related":["apps.RouterDeclaration","apps/graphql.OperationKinds","apps/mcp.McpCatalogOptions","apps/mcp.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/mcp.McpToolContext","kind":"type","summary":"Direct callers can omit interaction capabilities. A server that asks for input then fails explicitly.","signatures":[],"definition":"export interface McpToolContext {\n readonly elicit?: Elicit;\n}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.Elicit","apps/mcp/stdio.McpToolContext"],"examples":[]},{"symbol":"apps/mcp.McpToolResult","kind":"type","summary":"Native MCP result semantics, and the value every MCP tool call returns. A tool's output\nschema is built from this declaration. Protocol/transport failures use the Effect error channel.","signatures":[],"definition":"McpToolResult = Schema.Struct({\n content: Schema.Array(JsonObject),\n structuredContent: Schema.optionalKey(JsonObject),\n isError: Schema.optionalKey(Schema.Boolean),\n _meta: Schema.optionalKey(JsonObject),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.JsonObject"],"examples":[]},{"symbol":"apps/mcp.McpToolsOptions","kind":"type","summary":"Server and headers for this selected account. Headers are a credential snapshot.","signatures":[],"definition":"McpToolsOptions = Schema.Struct({\n url: HttpUrl,\n accountId: Schema.optional(AccountId),\n headers: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n signal: Schema.optional(Schema.instanceOf(AbortSignal)),\n timeoutMs: Schema.optional(\n Schema.Number.check(\n Schema.isInt(),\n Schema.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs }),\n ),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":[],"examples":[]},{"symbol":"apps/mcp.OperationKinds","kind":"type","summary":"Explicit corrections for upstream read-only hints or unusual HTTP semantics.","signatures":[],"definition":"export type OperationKinds = Readonly<Record<string, \"query\" | \"mutation\">>;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/protocol-operations.ts","related":["apps/graphql.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/mcp/stdio.McpError","kind":"class","summary":"Safe protocol/transport failure; no raw upstream payloads or credentials. `status` is the HTTP\nstatus a `request` failure was redirected or refused with. Without one, a `request` failure in\nthe `transport` phase never reached the server; in another phase it may be a JSON-RPC error the\nserver answered with. `upstream` is that JSON-RPC error, bounded and with account secrets\nreplaced. A response that is not MCP is `invalid_response`.","signatures":[],"definition":"export class McpError extends Schema.TaggedError<McpError>()(\"McpError\", {\n phase: Schema.Literals([\"connect\", \"discover\", \"call\", \"schema\", \"transport\"]),\n reason: Schema.Literals([\n \"request\",\n \"unauthorized\",\n \"invalid_response\",\n \"timeout\",\n \"invalid_input\",\n ]),\n status: Schema.optional(Schema.Number),\n upstream: Schema.optional(UpstreamError),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps/mcp.McpError"],"examples":[]},{"symbol":"apps/mcp/stdio.McpToolContext","kind":"type","summary":"Direct callers can omit interaction capabilities. A server that asks for input then fails explicitly.","signatures":[],"definition":"export interface McpToolContext {\n readonly elicit?: Elicit;\n}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.Elicit","apps/mcp.McpToolContext"],"examples":[]},{"symbol":"apps/mcp/stdio.ProcessConfig","kind":"type","summary":"Public process configuration. Credentials arrive through the selected account.","signatures":[],"definition":"ProcessConfig = Schema.Struct({\n command: Schema.NonEmptyString,\n args: Schema.Array(Schema.String),\n cwd: Schema.optional(Schema.String),\n env: Schema.Record(Schema.String, Schema.String),\n timeoutMs: Schema.Int.check(\n Schema.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs }),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":[],"examples":[]},{"symbol":"apps/mcp/stdio.stdioRouter","kind":"function","summary":"Discover an account's tools as a router; each discovery and call owns and closes its subprocess.","signatures":["(config: ProcessConfig, signal?: AbortSignal, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/mcp-stdio.ts","related":["apps.RouterDeclaration","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/mcp/stdio.ProcessConfig","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/openapi.CredentialBinding","kind":"type","summary":"Map a selected account field to one Swagger credential value.","signatures":[],"definition":"CredentialBinding = Schema.Struct({\n scheme: Schema.String,\n field: Schema.String,\n part: Schema.Literals([\"value\", \"username\", \"password\"]),\n prefix: Schema.String,\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.isOpenapiTextMedia","kind":"function","summary":"Media returned as text rather than a base64 file. JSON sequences remain unparsed text.","signatures":["(type: string): boolean"],"tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.liveOpenapiRouter","kind":"function","summary":"No I/O during app construction. All accounts share credential-free compilation.","signatures":["(options: OpenapiSourceOptions): RouterDeclaration"],"tags":[],"docs":"integrations.md","source":"apps/src/implementation/openapi-source.ts","related":["apps.RouterDeclaration","apps/openapi.OpenapiSourceOptions"],"examples":[]},{"symbol":"apps/openapi.openapiBinaryResultSchema","kind":"value","summary":"JSON-safe binary result, independent of the host's file storage.","signatures":[],"definition":"const openapiBinaryResultSchema: { readonly [x: string]: Schema.Json; }","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiCompileError","kind":"class","summary":"A safe generation failure. `reason` explains the cause; `skipped` lists the declared operations\nit left out and why, and `origins` the origins operations resolve to when none of them matches\nthe allowed origin. Reading one left-out tool fails with this error for that operation alone.","signatures":[],"definition":"export class OpenapiCompileError extends Schema.TaggedError<OpenapiCompileError>()(\n \"OpenapiCompileError\",\n {\n code: OpenapiCompileErrorCode,\n reason: Schema.String,\n skipped: Schema.optionalKey(Schema.Array(OpenapiSkippedOperation)),\n origins: Schema.optionalKey(Schema.Array(Schema.String)),\n },\n) {\n override get message();\n}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi-compile.ts","related":["apps/openapi.OpenapiSkippedOperation"],"examples":[]},{"symbol":"apps/openapi.OpenapiCompileErrorCode","kind":"value","summary":"Which part of an OpenAPI document could not be compiled into tools.","signatures":[],"definition":"const OpenapiCompileErrorCode: Schema.Literals<readonly [\"server_protocol\", \"server_url\", \"external_reference\", \"circular_reference\", \"schema_keyword\", \"schema_reference\", \"missing_component\", \"openapi_version\", \"auth_helper\", \"auth_missing\", \"operation_path\", \"operation_method\", \"duplicate_operation\", \"server_missing\", \"multiple_hosts\", \"parameter_encoding\", \"parameter_style\", \"request_body\", \"combined_oauth\", \"auth_method\", \"event_stream\", \"input_schema\", \"no_operations\", \"no_supported_operations\", \"invalid_document\", \"source_generation\", \"authoring_reference\"]>","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi-compile.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiError","kind":"class","summary":"Safe failures omit request headers, credentials and upstream body text: the failure message is\nalso recorded in traces. A `request` failure with a status names the response that no declared\nerror matched, or the success response whose body could not be read, by its media type and\ndeclared length.","signatures":[],"definition":"export class OpenapiError extends Schema.TaggedError<OpenapiError>()(\"OpenapiError\", {\n reason: Schema.Literals([\"invalid_definition\", \"invalid_input\", \"request\"]),\n status: Schema.optional(Schema.Number),\n /** Absent only when the definition itself could not be read. */\n operation: Schema.optional(OpenapiFailedOperation),\n contentType: Schema.optional(OpenapiMediaType),\n /** The response's `content-length`, when it declared one. */\n bytes: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiErrorResponse","kind":"type","summary":"Tagged error shapes retain an explicit source for their public message.\nA retained declaration used to validate an HTTP failure before exposing its code.","signatures":[],"definition":"OpenapiErrorResponse = Schema.Struct({\n code: ApiErrorResponse.fields.code,\n status: ApiErrorResponse.fields.status,\n message: Schema.Union([\n Schema.Struct({ source: Schema.Literal(\"body\") }),\n Schema.Struct({ source: Schema.Literal(\"schema\"), value: ApiErrorResponse.fields.message }),\n ]),\n schema: JsonObject,\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject"],"examples":[]},{"symbol":"apps/openapi.openapiMediaKind","kind":"function","summary":"Classify request media for JSON-safe tool arguments; Swagger owns wire serialization.","signatures":["(type: string): \"form\" | \"json\" | \"binary\" | \"multipart\" | \"text\""],"tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiOperation","kind":"type","summary":"Credential-free operation data emitted by the OpenAPI importer.","signatures":[],"definition":"OpenapiOperation = Schema.Struct({\n /** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */\n name: Schema.NonEmptyString,\n /** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */\n operationId: Schema.optionalKey(Schema.String),\n description: Schema.String,\n method: Schema.Literals([\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"HEAD\", \"OPTIONS\", \"QUERY\"]),\n path: Schema.String,\n baseUrl: HttpUrl,\n openapi: Schema.String,\n securitySchemes: Schema.Record(Schema.String, JsonObject),\n /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */\n request: Schema.Struct({\n parameters: Schema.Array(OpenapiParameter),\n requestBody: Schema.optionalKey(OpenapiRequestBody),\n security: Schema.Array(Schema.Record(Schema.String, Schema.Array(Schema.String))),\n responses: Schema.Record(Schema.String, JsonObject),\n }),\n /** Streams remain in the metadata but cannot run through a single-result tool call. */\n streaming: Schema.optionalKey(Schema.Literal(true)),\n /** The operation's OpenAPI tags, shown to agents as labels within its router. */\n tags: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n input: JsonObject,\n outputSchema: Schema.optionalKey(JsonObject),\n errorResponses: Schema.optionalKey(Schema.Array(OpenapiErrorResponse)),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject","apps.Operation","apps/openapi.OpenapiErrorResponse","apps/openapi.OpenapiParameter"],"examples":[]},{"symbol":"apps/openapi.OpenapiParameter","kind":"type","summary":"Resolved OpenAPI parameter shared by import validation and request construction.","signatures":[],"definition":"OpenapiParameter = Schema.Struct({\n name: Schema.String,\n /** OpenAPI 3.2's `querystring` is the whole query string, serialized from one `content` value. */\n in: Schema.Literals([\"path\", \"query\", \"querystring\", \"header\", \"cookie\"]),\n required: Schema.optionalKey(Schema.Boolean),\n schema: Schema.optionalKey(JsonObject),\n style: Schema.optionalKey(Schema.String),\n explode: Schema.optionalKey(Schema.Boolean),\n allowReserved: Schema.optionalKey(Schema.Boolean),\n allowEmptyValue: Schema.optionalKey(Schema.Boolean),\n content: Schema.optionalKey(JsonObject),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject"],"examples":[]},{"symbol":"apps/openapi.OpenapiRequestBody","kind":"value","summary":"Preserve media schemas and Encoding Objects for Swagger request construction.","signatures":[],"definition":"const OpenapiRequestBody: Schema.Struct<{ readonly required: Schema.optionalKey<Schema.Boolean>; readonly content: Schema.$Record<Schema.String, Schema.Struct<{ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>; readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>; }>>; }>","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.openapiRouter","kind":"function","summary":"Discover a document's operations as a router for the selected account. Kinds override uncertain\nupstream read-only hints. Mount it under a key, or override its metadata with `router(...)`.","signatures":["(options: OpenapiToolsOptions, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/openapi.ts","related":["apps.RouterDeclaration","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/openapi.OpenapiToolsOptions","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/openapi.OpenapiSkippedOperation","kind":"type","summary":"A declared operation the importer left out, and why.","signatures":[],"definition":"OpenapiSkippedOperation = Schema.Struct({\n /** The tool name the operation would have; reading that tool reports why it is missing. */\n name: Schema.String,\n /** The HTTP method, such as `GET`. */\n method: Schema.String,\n /** The path as the definition declares it. */\n path: Schema.String,\n code: OpenapiCompileErrorCode,\n reason: Schema.String,\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi-compile.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiSourceOptions","kind":"type","summary":"Static credential placement and destination are reviewed when the app is authored/imported.","signatures":[],"definition":"export interface OpenapiSourceOptions extends Omit<\n OpenapiToolsOptions,\n \"operations\" | \"definitions\"\n> {\n readonly cache: AppCache;\n readonly source: { readonly url: string } | { readonly document: JsonObject };\n readonly allowedOrigin: string;\n readonly securitySchemes: Readonly<Record<string, JsonObject>>;\n readonly baseUrl?: string;\n /**\n * A path inserted between the server and every operation's path, for a definition that omits a\n * leading segment, such as `/projects/{project}`. Each `{name}` becomes a required string path\n * parameter of every tool, unless the operation already declares it without placing it.\n */\n readonly pathPrefix?: string;\n readonly freshFor?: Duration.Input;\n readonly staleFor?: Duration.Input;\n /**\n * Query or mutation overrides keyed by the document's operationId. An operation without an\n * operationId is keyed by its generated name without the kind, such as `users.getUsers`.\n */\n readonly kinds?: OperationKinds;\n readonly fallbackSecurity?: OpenapiOperation[\"request\"][\"security\"];\n readonly patches?: readonly {\n readonly op: \"add\" | \"remove\" | \"replace\";\n readonly path: string;\n readonly value?: JsonValue;\n }[];\n}","tags":[],"docs":"integrations.md","source":"apps/src/implementation/openapi-source.ts","related":["AppCache","apps.AppCache","apps.JsonObject","apps.JsonValue","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/openapi.OpenapiOperation","apps/openapi.OpenapiToolsOptions","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/openapi.OpenapiToolsOptions","kind":"type","summary":"Parsed options for one account's evaluation.\nJSON imports are decoded at the helper boundary, without assertions in app source.","signatures":[],"definition":"OpenapiToolsOptions = Schema.Struct({\n operations: Schema.Array(OpenapiOperation),\n /**\n * Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations\n * generated before shared definitions carry their own `$defs` and omit this.\n */\n definitions: Schema.optional(Schema.Record(Schema.String, JsonObject)),\n methods: Schema.Record(Schema.String, Schema.Array(CredentialBinding)),\n oauth: Schema.Array(Schema.String),\n account: Schema.optional(OpenapiAccount),\n parameterDefaults: Schema.optional(OpenapiParameterDefaults),\n signal: Schema.optional(Schema.instanceOf(AbortSignal)),\n fetch: Schema.optional(\n Schema.declare((value): value is typeof globalThis.fetch => typeof value === \"function\"),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject","apps/openapi.CredentialBinding","apps/openapi.OpenapiOperation"],"examples":[]},{"symbol":"apps/openapi.OperationKinds","kind":"type","summary":"Explicit corrections for upstream read-only hints or unusual HTTP semantics.","signatures":[],"definition":"export type OperationKinds = Readonly<Record<string, \"query\" | \"mutation\">>;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/protocol-operations.ts","related":["apps/graphql.OperationKinds","apps/mcp.OperationKinds"],"examples":[]},{"symbol":"apps/operations/approval.always","kind":"function","summary":"Require human approval for every call to the tool.","signatures":["<Input = unknown>(): Approval<Input>"],"tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps.Approval","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.Approval","kind":"type","summary":"Synchronous or async policy, projected from the framework's native contract.","signatures":[],"definition":"export type Approval<Input = unknown> = (\n ...args: Parameters<NativeApproval<Input>>\n) =>\n | Effect.Success<ReturnType<NativeApproval<Input>>>\n | Promise<Effect.Success<ReturnType<NativeApproval<Input>>>>;","tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps.Approval"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.ApprovalContext","kind":"type","summary":"Context for one tool's policy. toolInput is the same decoded value passed to run.","signatures":[],"definition":"export interface ApprovalContext<Input = unknown> {\n readonly toolName: string;\n readonly toolInput: Input;\n readonly signal: AbortSignal;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps.ApprovalContext"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.ApprovalDecision","kind":"type","summary":"Approve this call, deny it, or stop for a human decision.\nParsed result of one tool approval policy.","signatures":[],"definition":"ApprovalDecision = Schema.Literals([\"approved\", \"denied\", \"user-approval\"])","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps.ApprovalDecision"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.never","kind":"function","summary":"Never require human approval for this tool. Product access checks still apply.","signatures":["<Input = unknown>(): Approval<Input>"],"tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps.Approval","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps/react.useAppQuery","kind":"function","summary":"Subscribe for the component lifetime. Each mount owns and disposes its registry, including StrictMode remounts.","signatures":["<A, E>(atom: Atom.Atom<AsyncResult.AsyncResult<A, E>>): { data: A | undefined; pending: boolean; error: string | undefined; }"],"tags":[],"docs":"ui.md","source":"apps/src/react.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.fileSkill","kind":"function","summary":"Parse a bundled standard skill directory into an app capability.","signatures":["(files: readonly SkillFile[]): Promise<{ readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.folderSkills","kind":"function","summary":"Read skill directories from ctx.files. Omitted path selects skills/; missing folders return [].","signatures":["(options: FolderSkillsOptions): Promise<readonly { readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }[]>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.FolderSkillsOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.FolderSkillsOptions","kind":"type","summary":"A folder in the deployed package; omitted path selects skills/. No host filesystem access.","signatures":[],"definition":"export interface FolderSkillsOptions {\n readonly files: readonly SkillFile[];\n readonly path?: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.githubSkills","kind":"function","summary":"Fetch a public GitHub skill collection from one resolved commit. Pass `cache: ctx.cache` to reuse\nthe catalog; without it, mutable refs resolve again on each call.","signatures":["(options: GitHubSkillsOptions): Promise<readonly { readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }[]>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.GitHubSkillsOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.GitHubSkillsOptions","kind":"type","summary":"A public GitHub repository and an optional immutable commit, tag or branch. With a cache, a\nbranch or tag is resolved again when the catalog refreshes, and each commit's file list is kept.","signatures":[],"definition":"export interface GitHubSkillsOptions extends SkillTransport, SkillCacheOptions {\n readonly repo: string;\n readonly path?: string;\n readonly ref?: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps/skills.SkillCacheOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.Skill","kind":"type","summary":"Files use paths relative to this skill directory; reading one never executes its contents.","signatures":[],"definition":"AppSkillSource = Schema.Struct({\n ...AppSkillMetadata.fields,\n files: Schema.Array(SkillFile).check(\n Schema.makeFilter(\n (files) =>\n files.some((file) => file.path === \"SKILL.md\") &&\n new Set(files.map((file) => file.path)).size === files.length,\n ),\n ),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillCacheOptions","kind":"type","summary":"Catalog reuse shared by remote skill loaders, with the same policy as MCP tool catalogs. Pass\n`ctx.cache` to keep the loaded catalog; without it every read fetches the source again.","signatures":[],"definition":"export interface SkillCacheOptions {\n readonly cache?: import(\"./cache.ts\").AppCache;\n /** Reuse the catalog for this duration. Defaults to five minutes. */\n readonly freshFor?: import(\"effect\").Duration.Input;\n /** Serve the retained catalog while refreshing. Defaults to one day. */\n readonly staleFor?: import(\"effect\").Duration.Input;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["AppCache","apps.AppCache"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillDefinitionInvalid","kind":"type","summary":"Invalid selected skill files fail the load. Errors identify the file without disclosing its contents.","signatures":[],"definition":"SkillDefinitionInvalid = ApiError.define({\n tag: \"SkillDefinitionInvalid\",\n status: 400,\n fields: {\n file: SkillFilePath,\n reason: Schema.Literals([\n \"files\",\n \"directory\",\n \"missing-document\",\n \"frontmatter\",\n \"metadata\",\n \"name-mismatch\",\n ]),\n },\n message: ({ file, reason }) => skillDefinitionFailures[reason](file),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillFile","kind":"type","summary":"UTF-8 text resource. Reading a resource never executes it.","signatures":[],"definition":"SkillFile = Schema.Struct({ path: SkillFilePath, content: Schema.String })","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillLoadFailed","kind":"class","summary":"A skill loader failure shown to people. `message` is the explanation they read; write it for\nthem and never include URLs, tokens or response bodies. `reason` selects the title and whether\na retry can help. Custom loaders throw this error to get the same presentation as built-ins.","signatures":[],"definition":"export class SkillLoadFailed extends Schema.TaggedError<SkillLoadFailed>()(\"SkillLoadFailed\", {\n reason: Schema.Literals([\n \"source\",\n \"request\",\n \"rate_limited\",\n \"document\",\n \"limit\",\n \"changed\",\n \"encoding\",\n ]),\n // Error instances read an omitted message as \"\", so an empty message means none was given.\n message: Schema.optional(Schema.String.check(Schema.isMaxLength(500))),\n status: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 100, maximum: 599 }))),\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.skillReader","kind":"function","summary":"Read files for a custom remote skill loader, such as one for GitLab. Reads share one byte\nbudget and reject with the same safe SkillLoadFailed errors as githubSkills, naming `service`.","signatures":["(options: SkillReaderOptions): { text: (url: string) => Promise<string>; json: (url: string) => Promise<unknown>; }"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.SkillReaderOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillReaderOptions","kind":"type","summary":"A custom loader's transport and the service name shown when a request fails.","signatures":[],"definition":"export interface SkillReaderOptions extends SkillTransport {\n readonly service: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillServiceName","kind":"value","summary":"Short display name for a skill source, such as \"GitLab\" or an index host name.","signatures":[],"definition":"const SkillServiceName: Schema.String","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.wellKnownSkills","kind":"function","summary":"Fetch a published skill index and its text files. Pass `cache: ctx.cache` to reuse the catalog.","signatures":["(options: WellKnownSkillsOptions): Promise<readonly { readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }[]>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.WellKnownSkillsOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.WellKnownSkillsOptions","kind":"type","summary":"A published directory index, including its listed skill documents and text references.","signatures":[],"definition":"export interface WellKnownSkillsOptions extends SkillTransport, SkillCacheOptions {\n readonly url: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps/skills.SkillCacheOptions"],"examples":["live-inbox"]},{"symbol":"DatabaseTable","kind":"type","summary":"Writes are valid only inside their owning mutation.","signatures":[],"definition":"export interface WriteTable<Row, Insert, Index extends string = string> extends ReadTable<\n Row,\n Index\n> {\n /** Insert authored fields and return the complete row with generated id, createdAt and updatedAt. */\n readonly insert: (value: Insert) => Promise<Row>;\n /** Patch authored fields and return the complete row, or null if the ID does not exist. */\n readonly update: (id: string, patch: Partial<Insert>) => Promise<Row | null>;\n /** Delete the row and return whether it existed. */\n readonly delete: (id: string) => Promise<boolean>;\n}","tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":[],"examples":["live-inbox"]},{"symbol":"DatabaseTable.delete","kind":"method","summary":"Delete the row and return whether it existed.","signatures":["(id: string): Promise<boolean>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.get","kind":"method","summary":"Read a complete row by ID, or null when it does not exist.","signatures":["(id: string): Promise<Row | null>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.insert","kind":"method","summary":"Insert authored fields and return the complete row with generated id, createdAt and updatedAt.","signatures":["(value: Insert): Promise<Row>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.update","kind":"method","summary":"Patch authored fields and return the complete row, or null if the ID does not exist.","signatures":["(id: string, patch: Partial<Insert>): Promise<Row | null>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.withIndex","kind":"method","summary":"Select a declared index or by_creation, with optional prefix and range constraints.","signatures":["(index: \"by_creation\" | Index, range?: ((query: IndexRange<Row>) => IndexRange<Row>) | undefined): Query<Row>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexQuery","kind":"type","summary":"Bounded indexed reads; collect/count reject work beyond the invocation budget.","signatures":[],"definition":"export interface Query<Row> {\n /** Choose ascending or descending index order without changing this query. */\n readonly order: (direction: \"asc\" | \"desc\") => Query<Row>;\n /** Read all matching rows within the invocation budget; exceeding it fails. */\n readonly collect: () => Promise<readonly Row[]>;\n /** Count matching rows within the scan budget; exceeding it fails. */\n readonly count: () => Promise<number>;\n /** Read the first matching row, or null when no row matches. */\n readonly first: () => Promise<Row | null>;\n /** Read at most count matching rows within the invocation budget. */\n readonly take: (count: number) => Promise<readonly Row[]>;\n /** Read one cursor page. Return its rows, continuation cursor and completion flag. */\n readonly paginate: (options: {\n readonly numItems: number;\n readonly cursor: string | null;\n }) => Promise<{\n readonly page: readonly Row[];\n readonly continueCursor: string | null;\n readonly isDone: boolean;\n }>;\n}","tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":[],"examples":["live-inbox"]},{"symbol":"IndexQuery.collect","kind":"method","summary":"Read all matching rows within the invocation budget; exceeding it fails.","signatures":["(): Promise<readonly Row[]>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.count","kind":"method","summary":"Count matching rows within the scan budget; exceeding it fails.","signatures":["(): Promise<number>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.first","kind":"method","summary":"Read the first matching row, or null when no row matches.","signatures":["(): Promise<Row | null>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.order","kind":"method","summary":"Choose ascending or descending index order without changing this query.","signatures":["(direction: \"asc\" | \"desc\"): Query<Row>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.paginate","kind":"method","summary":"Read one cursor page. Return its rows, continuation cursor and completion flag.","signatures":["(options: { readonly numItems: number; readonly cursor: string | null; }): Promise<{ readonly page: readonly Row[]; readonly continueCursor: string | null; readonly isDone: boolean; }>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.take","kind":"method","summary":"Read at most count matching rows within the invocation budget.","signatures":["(count: number): Promise<readonly Row[]>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexRange","kind":"type","summary":"Index predicates are accumulated immutably, then checked against the declaration by the engine.","signatures":[],"definition":"export interface IndexRange<Fields> {\n /** Constrain an index prefix field to one value. Null matches a cleared optional field. */\n readonly eq: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key] | null,\n ) => IndexRange<Fields>;\n /** Require a value greater than the bound on the next index field. */\n readonly gt: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n /** Require a value greater than or equal to the bound on the next index field. */\n readonly gte: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n /** Require a value less than the bound on the next index field. */\n readonly lt: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n /** Require a value less than or equal to the bound on the next index field. */\n readonly lte: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n}","tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields"],"examples":["live-inbox"]},{"symbol":"IndexRange.eq","kind":"method","summary":"Constrain an index prefix field to one value. Null matches a cleared optional field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key] | null): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.gt","kind":"method","summary":"Require a value greater than the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.gte","kind":"method","summary":"Require a value greater than or equal to the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.lt","kind":"method","summary":"Require a value less than the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.lte","kind":"method","summary":"Require a value less than or equal to the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore","kind":"type","summary":"Read or replace mounted queries during a synchronous optimistic update. Never mutate returned values.","signatures":[],"definition":"export interface OptimisticLocalStore {\n /** Read the projected result, or undefined if this query is not loaded in this client. */\n getQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n ): Output | undefined;\n /** Read all mounted argument variants of an operation, including loading queries. */\n getAllQueries<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n ): readonly { readonly input: Input; readonly value: Output | undefined }[];\n /** Replace a mounted query's projected result. The query's output schema validates the new value. */\n setQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n value: NoInfer<Output>,\n ): void;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","apps/client.OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore.getAllQueries","kind":"method","summary":"Read all mounted argument variants of an operation, including loading queries.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">): readonly { readonly input: Input; readonly value: Output | undefined; }[]"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore.getQuery","kind":"method","summary":"Read the projected result, or undefined if this query is not loaded in this client.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>): Output | undefined"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore.setQuery","kind":"method","summary":"Replace a mounted query's projected result. The query's output schema validates the new value.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, value: NoInfer<Output>): void"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"Provider","kind":"type","summary":"A provider declaration. The host derives its identity from the declaration, never its check.","signatures":[],"definition":"export class Provider<Auth extends AuthMethods> extends Data.Class<{\n readonly name: string;\n readonly auth: Auth;\n /**\n * The hosts this provider's credentials may be sent to. When present, secret fields reach app\n * code as handles that the outbound network replaces only on requests to these hosts.\n */\n readonly hosts?: readonly string[];\n /**\n * Stored without its method types so a specific provider still fills a general slot. The host\n * binds the account against this provider's methods before running it.\n */\n readonly health?: AccountCheck<AuthMethods>;\n}> {\n /** Declare zero or more accounts from this provider without performing I/O. */\n many(): ManyAccounts<Auth>;\n}","tags":[],"docs":"accounts.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods","apps.ManyAccounts","apps.Provider"],"examples":[]},{"symbol":"Provider.many","kind":"method","summary":"Declare zero or more accounts from this provider without performing I/O.","signatures":["(): ManyAccounts<Auth>"],"tags":[],"docs":"accounts.md","source":"apps/src/contracts/provider.ts","related":["apps.ManyAccounts","Provider"],"examples":[]},{"symbol":"Provider.pipe","kind":"method","summary":"","signatures":["<A>(this: A): A","<A, B = never>(this: A, ab: (_: A) => B): B","<A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C","<A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D","<A, B = never, C = never, D = never, E = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E): E","<A, B = never, C = never, D = never, E = never, F = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F): F","<A, B = never, C = never, D = never, E = never, F = never, G = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G): G","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H): H","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I): I","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J): J","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K): K","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L): L","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M): M","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N): N","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O): O","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P): P","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q): Q","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R): R","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S): S","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never, T = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S, st: (_: S) => T): T","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never, T = never, U = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S, st: (_: S) => T, tu: (_: T) => U): U","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never, T = never, U = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S, st: (_: S) => T, tu: (_: T) => U): U"],"tags":[],"docs":"accounts.md","source":"../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Pipeable.d.ts","related":["Provider"],"examples":[]},{"symbol":"Schema","kind":"type","summary":"An author-facing value schema. Effect is never required in author code.","signatures":[],"definition":"export interface Schema<T, Optional extends boolean = false> {\n readonly [StorageField]?: Field;\n readonly [Decoder]: EffectSchema.Decoder<T>;\n readonly optionalValue: Optional;\n /** Parse an unknown value; invalid input throws a safe ValidationError. */\n parse(input: unknown): T;\n /** Accept an absent field without changing the original schema. */\n optional(): Schema<T | undefined, true>;\n /** Validate the default now and use it for undefined input. */\n default(value: T): Schema<T> & { readonly hasDefault: true; readonly inputOptional: Optional };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","apps.ValidationError"],"examples":["live-inbox"]},{"symbol":"Schema.default","kind":"method","summary":"Validate the default now and use it for undefined input.","signatures":["(value: T): Schema<T> & { readonly hasDefault: true; readonly inputOptional: Optional; }"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"Schema.optional","kind":"method","summary":"Accept an absent field without changing the original schema.","signatures":["(): Schema<T | undefined, true>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"Schema.parse","kind":"method","summary":"Parse an unknown value; invalid input throws a safe ValidationError.","signatures":["(input: unknown): T"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["Schema"],"examples":["live-inbox"]},{"symbol":"Table","kind":"type","summary":"Typed table declaration; indexes refer only to authored or host metadata fields.","signatures":[],"definition":"export interface Table<F extends Fields, Index extends string = never> {\n readonly fields: F;\n readonly indexes: ReadonlyArray<{ readonly name: string; readonly fields: readonly string[] }>;\n readonly index: <Name extends string>(\n name: Name,\n fields: readonly [\n (keyof F & string) | keyof typeof RowMetadata.Type,\n ...((keyof F & string) | keyof typeof RowMetadata.Type)[],\n ],\n ) => Table<F, Index | Name>;\n}","tags":[],"docs":"storage.md","source":"apps/src/contracts/storage.ts","related":["apps.Fields","apps.Table"],"examples":["live-inbox"]},{"symbol":"Table.index","kind":"method","summary":"","signatures":["<Name extends string>(name: Name, fields: readonly [(keyof F & string) | keyof typeof RowMetadata.Type, ...((keyof F & string) | keyof typeof RowMetadata.Type)[]]): Table<F, Index | Name>"],"tags":[],"docs":"storage.md","source":"apps/src/contracts/storage.ts","related":["apps.Table","Table"],"examples":["live-inbox"]},{"symbol":"WorkflowControls","kind":"type","summary":"Mutating handlers may start and terminate runs in their own configured app.","signatures":[],"definition":"export interface WorkflowControls extends WorkflowReads {\n readonly start: (input: {\n readonly workflow: string;\n readonly input: JsonValue;\n readonly key?: string;\n }) => Promise<WorkflowRun>;\n readonly terminate: (input: { readonly run: string }) => Promise<WorkflowRun>;\n}","tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.JsonValue","apps.WorkflowControls","apps.WorkflowReads"],"examples":[]},{"symbol":"WorkflowControls.get","kind":"method","summary":"","signatures":["(input: { readonly run: string; }): Promise<WorkflowRun>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowControls"],"examples":[]},{"symbol":"WorkflowControls.list","kind":"method","summary":"","signatures":["(input?: { readonly workflow?: string; readonly limit?: number; readonly cursor?: string; }): Promise<WorkflowRunPage>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowControls"],"examples":[]},{"symbol":"WorkflowControls.start","kind":"method","summary":"","signatures":["(input: { readonly workflow: string; readonly input: JsonValue; readonly key?: string; }): Promise<WorkflowRun>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.JsonValue","WorkflowControls"],"examples":[]},{"symbol":"WorkflowControls.terminate","kind":"method","summary":"","signatures":["(input: { readonly run: string; }): Promise<WorkflowRun>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowControls"],"examples":[]},{"symbol":"WorkflowStep","kind":"type","summary":"Explicit durable boundaries; database access passes through registered app operations.","signatures":[],"definition":"export interface WorkflowStep<Requirements extends AppRequirements = AppRequirements> {\n do<Output>(\n name: string,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n do<Output>(\n name: string,\n options: WorkflowStepOptions,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n runQuery<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"query\", QueryContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n runMutation<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"mutation\", MutationContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n readonly sleep: (name: string, duration: WorkflowDuration) => Promise<void>;\n readonly sleepUntil: (name: string, timestamp: number | Date) => Promise<void>;\n}","tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.AppRequirements","apps.MutationContext","apps.Operation","apps.QueryContext","apps.WorkflowDuration","apps.WorkflowStep","apps.WorkflowStepContext","apps.WorkflowStepOptions"],"examples":[]},{"symbol":"WorkflowStep.do","kind":"method","summary":"","signatures":["<Output>(name: string, run: (context: WorkflowStepContext<Requirements>) => Promise<Output>): Promise<Output>","<Output>(name: string, options: WorkflowStepOptions, run: (context: WorkflowStepContext<Requirements>) => Promise<Output>): Promise<Output>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.WorkflowStepContext","apps.WorkflowStepOptions","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.runMutation","kind":"method","summary":"","signatures":["<Input, Output>(name: string, operation: Operation<Input, Output, \"mutation\", MutationContext<Requirements>>, input: NoInfer<Input>, options?: WorkflowStepOptions): Promise<Output>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.MutationContext","apps.Operation","apps.WorkflowStepOptions","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.runQuery","kind":"method","summary":"","signatures":["<Input, Output>(name: string, operation: Operation<Input, Output, \"query\", QueryContext<Requirements>>, input: NoInfer<Input>, options?: WorkflowStepOptions): Promise<Output>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.Operation","apps.QueryContext","apps.WorkflowStepOptions","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.sleep","kind":"method","summary":"","signatures":["(name: string, duration: WorkflowDuration): Promise<void>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.WorkflowDuration","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.sleepUntil","kind":"method","summary":"","signatures":["(name: string, timestamp: number | Date): Promise<void>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowStep"],"examples":[]}],"examples":[{"id":"live-inbox","title":"React UI with live app storage","files":[{"path":"index.ts","content":"import {\n query,\n mutation,\n type QueryContext,\n type MutationContext,\n array,\n defineApp,\n defineDatabase,\n object,\n string,\n table,\n router,\n} from \"apps\";\nimport { Message } from \"./schema.ts\";\n\nconst database = defineDatabase({\n messages: table({ subject: string() }).index(\"by_subject\", [\"subject\"]),\n});\n\nconst requirements = { accounts: {}, database };\n\nexport const listMessages = query(\n { input: object({}), output: array(Message) },\n async ({ db }: QueryContext<typeof requirements>) =>\n await db.messages.withIndex(\"by_creation\").order(\"desc\").take(100),\n);\nexport const receiveMessage = mutation(\n { input: object({ subject: string(), clientId: string().optional() }), output: Message },\n async ({ db }: MutationContext<typeof requirements>, message) =>\n await db.messages.insert({ subject: message.subject }),\n);\nexport default defineApp(requirements, {\n tools: router({\n listMessages,\n receiveMessage,\n }),\n});\n"},{"path":"schema.ts","content":"/** Shared data shape; safe to import from browser and server code. */\nimport { object, string } from \"apps\";\nexport const Message = object({ id: string(), subject: string() });\n"},{"path":"ui/main.tsx","content":"import { StrictMode, useState } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { array } from \"apps\";\nimport { createAppClient, mutationReference, queryReference } from \"apps/client\";\nimport { useAppQuery } from \"apps/react\";\nimport type { listMessages, receiveMessage } from \"../index.ts\";\nimport { Message } from \"../schema.ts\";\nimport \"./style.css\";\n\nconst client = createAppClient();\nconst listRef = queryReference<typeof listMessages>(\"listMessages\");\nconst inbox = client.queryAtom(listRef, {}, array(Message));\nconst receive = client\n .mutation(mutationReference<typeof receiveMessage>(\"receiveMessage\"), Message)\n .withOptimisticUpdate((store, input) => {\n const rows = store.getQuery(listRef, {});\n if (rows !== undefined && input.clientId !== undefined) {\n store.setQuery(\n listRef,\n {},\n [{ id: input.clientId, subject: input.subject }, ...rows].slice(0, 100),\n );\n }\n });\n\nfunction Inbox() {\n const { data, pending, error } = useAppQuery(inbox);\n const [subject, setSubject] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [failure, setFailure] = useState<string>();\n return (\n <main className=\"max-w-225 min-h-dvh py-0 px-[32px] m-auto flex flex-col max-[540px]:py-0 max-[540px]:px-[20px]\">\n <header className=\"h-20 flex items-center justify-between [border-bottom:1px_solid_#e8e8e2] max-[540px]:h-16.5\">\n <div className=\"identity flex items-center gap-2.5 font-semibold text-[15px]\">\n <span\n className=\"mark w-7.25 h-7.25 [border:1px_solid_#deded7] bg-white grid [place-items:center] rounded-[8px]\"\n aria-hidden=\"true\"\n >\n ↗\n </span>\n <span>Inbox</span>\n </div>\n <span className=\"status text-[#55645b] text-[12px] flex items-center gap-1.5 before:[content:''] before:w-1.5 before:h-1.5 before:bg-[#659674] before:rounded-[50%]\">\n {pending ? \"Connecting…\" : error ? \"Disconnected\" : \"Live\"}\n </span>\n </header>\n <section className=\"intro [padding:64px_0_36px] [&_p]:text-[14px] [&_p]:text-[#85857d] [&_p]:m-0 max-[540px]:pt-10\">\n <span className=\"eyebrow text-[10px] tracking-[0.12em] font-semibold text-[#888880]\">\n YOUR SPACE\n </span>\n <h1 className=\"text-[clamp(26px,_5vw,_36px)] tracking-[-0.04em] font-medium [margin:14px_0_10px]\">\n A little room for ideas.\n </h1>\n <p>Leave a thought. It’s here when you return.</p>\n </section>\n <form\n className=\"bg-white [border:1px_solid_#e2e2db] rounded-[12px] p-[20px] max-[540px]:p-[16px]\"\n onSubmit={async (event) => {\n event.preventDefault();\n if (!subject.trim() || saving) return;\n setSaving(true);\n setFailure(undefined);\n try {\n await receive({ subject: subject.trim(), clientId: crypto.randomUUID() });\n setSubject(\"\");\n } catch {\n setFailure(\"Could not save your message. Try again.\");\n } finally {\n setSaving(false);\n }\n }}\n >\n <label className=\"block text-[12px] [font-weight:550] mb-3\" htmlFor=\"subject\">\n New message\n </label>\n <div className=\"compose flex gap-3 max-[540px]:flex-col\">\n <input\n className=\"min-w-0 flex-1 [border:1px_solid_#e3e3dd] rounded-[7px] py-[11px] px-[12px] bg-[#fafaf8] text-[14px] focus-visible:[outline:2px_solid_#adbdad] focus-visible:outline-offset-[2px]\"\n id=\"subject\"\n value={subject}\n onChange={(e) => setSubject(e.target.value)}\n placeholder=\"What’s on your mind?\"\n autoComplete=\"off\"\n required\n />\n <button\n className=\"border-0 rounded-[7px] bg-[#303d34] text-white py-0 px-[17px] text-[12px] [font-weight:550] cursor-pointer max-[540px]:min-h-10.5 disabled:opacity-50 disabled:cursor-default\"\n disabled={saving || !subject.trim()}\n >\n {saving ? \"Saving…\" : \"Add message\"}\n </button>\n </div>\n {failure && (\n <p className=\" text-[#a74636] text-[13px]\" role=\"alert\">\n {failure}\n </p>\n )}\n </form>\n <section className=\"messages flex-1 pt-9.5\" aria-labelledby=\"messages-title\">\n <div className=\"section-heading flex items-center justify-between pb-3.75 [border-bottom:1px_solid_#e6e6df] [&_h2]:text-[13px] [&_h2]:[font-weight:550] [&_h2]:m-0 [&_span]:text-[11px] [&_span]:text-[#8c8c83]\">\n <h2 id=\"messages-title\">Messages</h2>\n <span>{data?.length ?? 0}</span>\n </div>\n {error && (\n <p className=\" text-[#a74636] text-[13px]\" role=\"alert\">\n {error}\n </p>\n )}\n {pending ? (\n <p className=\"empty py-[64px] px-0 text-center text-[#97978e] [&_>_span]:text-[30px] [&_>_span]:text-[#bdc4b8] [&_h3]:text-[#77776f] [&_h3]:text-[14px] [&_h3]:font-medium [&_h3]:[margin:18px_0_7px] [&_p]:text-[12px] [&_p]:m-0 \">\n Loading your inbox…\n </p>\n ) : data?.length === 0 ? (\n <div className=\"empty py-[64px] px-0 text-center text-[#97978e] [&_>_span]:text-[30px] [&_>_span]:text-[#bdc4b8] [&_h3]:text-[#77776f] [&_h3]:text-[14px] [&_h3]:font-medium [&_h3]:[margin:18px_0_7px] [&_p]:text-[12px] [&_p]:m-0\">\n <span aria-hidden=\"true\">✳</span>\n <h3>A clean slate.</h3>\n <p>Your first message goes here.</p>\n </div>\n ) : (\n <ul className=\"p-0 m-0 [list-style:none]\">\n {data?.map((message) => (\n <li\n className=\"[border-bottom:1px_solid_#e8e8e2] flex gap-3.75 items-start py-[21px] px-[2px]\"\n key={message.id}\n >\n <span className=\"message-icon text-[#80917e]\" aria-hidden=\"true\">\n ↗\n </span>\n <p>{message.subject}</p>\n </li>\n ))}\n </ul>\n )}\n </section>\n <footer className=\"flex justify-between text-[#a1a197] text-[11px] py-[30px] px-0 mt-10\">\n Live inbox <span>Made with Executor</span>\n </footer>\n </main>\n );\n}\n\nconst root = document.getElementById(\"root\");\nif (root === null) throw new Error(\"Missing app root\");\ncreateRoot(root).render(\n <StrictMode>\n <Inbox />\n </StrictMode>,\n);\n"},{"path":"ui/index.html","content":"<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>Live inbox</title>\n <script type=\"module\" src=\"./main.tsx\"></script>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n</html>\n"},{"path":"ui/style.css","content":"/* Includes Preflight so copied controls do not retain browser default styles. */\n@import \"tailwindcss\";\n\n@layer base {\n :root {\n font-family:\n Inter,\n ui-sans-serif,\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n sans-serif;\n color: #232321;\n background: #fafaf8;\n font-synthesis: none;\n }\n * {\n box-sizing: border-box;\n }\n body {\n margin: 0;\n }\n button {\n font: inherit;\n }\n input {\n font: inherit;\n }\n}\n"},{"path":"package.json","content":"{\n \"name\": \"@executor-js/app-live-inbox\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"apps\": \"0.0.1-beta.32\",\n \"react\": \"^19.2.0\",\n \"react-dom\": \"^19.2.0\"\n }\n}\n"}]}]}
|
|
1
|
+
{"version":"0.0.1-beta.34","digest":"d6aa0ebd640caae675916b4a07abe25fe91643978a2555ac4021e6bb00602f8e","entries":[{"symbol":"AppCache","kind":"type","summary":"Cache keys describe every input that affects the value; the host adds app/build isolation.","signatures":[],"definition":"export interface AppCache {\n readonly get: <A>(options: CacheGetOptions<A>) => Promise<A>;\n /** Await a fresh load, coalescing concurrent refreshes and retaining the previous value on failure. */\n readonly revalidate: <A>(options: CacheGetOptions<A>) => Promise<A>;\n readonly read: <A>(key: JsonValue, schema: Schema<A, boolean>) => Promise<A | undefined>;\n readonly readMany: <A>(\n keys: readonly JsonValue[],\n schema: Schema<A, boolean>,\n ) => Promise<readonly (A | undefined)[]>;\n readonly write: (\n entries: readonly { readonly key: JsonValue; readonly value: JsonValue }[],\n retention: Duration.Input,\n ) => Promise<void>;\n readonly invalidate: (key: JsonValue) => Promise<void>;\n /**\n * Scope entries to a bound account and its credential generation. Token renewal keeps the\n * entries; reconnecting or replacing the account's credentials starts an empty scope.\n */\n readonly forAccount: (account: { readonly id: string }) => AppCache;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["apps.AppCache","apps.CacheGetOptions","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"AppCache.forAccount","kind":"method","summary":"Scope entries to a bound account and its credential generation. Token renewal keeps the\nentries; reconnecting or replacing the account's credentials starts an empty scope.","signatures":["(account: { readonly id: string; }): AppCache"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.AppCache"],"examples":["live-inbox"]},{"symbol":"AppCache.get","kind":"method","summary":"","signatures":["<A>(options: CacheGetOptions<A>): Promise<A>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.CacheGetOptions"],"examples":["live-inbox"]},{"symbol":"AppCache.invalidate","kind":"method","summary":"","signatures":["(key: JsonValue): Promise<void>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"AppCache.read","kind":"method","summary":"","signatures":["<A>(key: JsonValue, schema: Schema<A, boolean>): Promise<A | undefined>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"AppCache.readMany","kind":"method","summary":"","signatures":["<A>(keys: readonly JsonValue[], schema: Schema<A, boolean>): Promise<readonly (A | undefined)[]>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"AppCache.revalidate","kind":"method","summary":"Await a fresh load, coalescing concurrent refreshes and retaining the previous value on failure.","signatures":["<A>(options: CacheGetOptions<A>): Promise<A>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.CacheGetOptions"],"examples":["live-inbox"]},{"symbol":"AppCache.write","kind":"method","summary":"","signatures":["(entries: readonly { readonly key: JsonValue; readonly value: JsonValue; }[], retention: Duration.Input): Promise<void>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"AppClient.dispose","kind":"method","summary":"Close this client when its page or embedding owner is removed.","signatures":["(): Promise<void>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":[],"examples":["live-inbox"]},{"symbol":"AppClient.mutate","kind":"method","summary":"Execute a write once in this client's queue. Success acknowledges the write; queries reconcile afterward.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>): Promise<Output>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["apps.Schema","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppClient.mutation","kind":"method","summary":"Create a callable mutation with optional withOptimisticUpdate projections over mounted queries.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, output: Schema<NoInfer<Output>, boolean>): AppMutation<Input, Output>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["AppMutation","apps.Schema","apps/client.AppMutation","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppClient.query","kind":"method","summary":"Query this app once, with a runtime-validated response. Does not populate the mounted query cache.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>): Promise<NoInfer<Output>>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["apps.Schema","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppClient.queryAtom","kind":"method","summary":"Share a live query across mounts and reconcile optimistic changes against fresh server reads.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>): Atom.Atom<AsyncResult.AsyncResult<Output, unknown>>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["apps.Schema","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"AppContext","kind":"type","summary":"Current credentials for one invocation. Never retained in source or build output.","signatures":[],"definition":"export interface BoundContext<Slots extends AccountSlots> {\n /** Explicit app/build-scoped caching. Account-specific loaders opt into forAccount. */\n readonly cache: import(\"./cache.ts\").AppCache;\n /** Text files retained in this deployment. Paths are package-relative, never host filesystem paths. */\n readonly files: readonly SkillFile[];\n /** Read-only run management, bound to this configured app. */\n readonly workflows: WorkflowReads;\n /** Ask for user input during this tool call. Unavailable during discovery and after the invocation closes. */\n readonly elicit: Elicit;\n /**\n * Invocation-owned HTTP requests with trace propagation and host cancellation. It lasts until the\n * invocation and every app cache refresh it started in the background have ended, so a catalog\n * loader given this fetch can refresh after the reply.\n */\n readonly fetch: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;\n /** Host cancellation for this invocation. Pass it to fetch and other interruptible APIs. */\n readonly signal: AbortSignal;\n readonly accounts: {\n readonly [Slot in keyof Slots]: AccountsFor<Slots[Slot]>;\n };\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["AppCache","apps.AccountSlots","apps.AppCache","apps.Elicit","apps.SkillFile","apps.WorkflowReads","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"AppContext.elicit","kind":"method","summary":"Ask for user input during this tool call. Unavailable during discovery and after the invocation closes.","signatures":["(request: FormElicitation): Promise<ElicitationResponse>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["AppContext","apps.ElicitationResponse","apps.FormElicitation"],"examples":["live-inbox"]},{"symbol":"AppContext.fetch","kind":"method","summary":"Invocation-owned HTTP requests with trace propagation and host cancellation. It lasts until the\ninvocation and every app cache refresh it started in the background have ended, so a catalog\nloader given this fetch can refresh after the reply.","signatures":["(input: string | URL | Request, init?: RequestInit): Promise<Response>"],"tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["AppContext"],"examples":["live-inbox"]},{"symbol":"AppMutation","kind":"type","summary":"A callable mutation. Success means the write was acknowledged; its overlay stays until fresh reads finish.","signatures":[],"definition":"export interface AppMutation<Input, Output> {\n (input: Input): Promise<Output>;\n /** Return a new mutation handle with this projection. Failures remove only this invocation's changes. */\n withOptimisticUpdate(update: OptimisticUpdate<Input>): AppMutation<Input, Output>;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.AppMutation","apps/client.OptimisticUpdate"],"examples":["live-inbox"]},{"symbol":"AppMutation.withOptimisticUpdate","kind":"method","summary":"Return a new mutation handle with this projection. Failures remove only this invocation's changes.","signatures":["(update: OptimisticUpdate<Input>): AppMutation<Input, Output>"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["AppMutation","apps/client.AppMutation","apps/client.OptimisticUpdate"],"examples":["live-inbox"]},{"symbol":"apps.AccountCheckContext","kind":"type","summary":"The account a provider's check verifies, with invocation-owned HTTP and cancellation.","signatures":[],"definition":"export interface AccountCheckContext<Auth extends AuthMethods> {\n readonly account: AccountOfMethods<Auth>;\n readonly fetch: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;\n readonly signal: AbortSignal;\n /**\n * When the host stops waiting for the check, in milliseconds since the epoch. A check still\n * running then fails without its own message, so a check that gives up must do so before it.\n * Executor always sets it; a host that does not limit the check leaves it out.\n */\n readonly deadline?: number;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods"],"examples":["live-inbox"]},{"symbol":"apps.AccountCheckResult","kind":"type","summary":"A passing account check. Failures are thrown, so there is no failing variant.","signatures":[],"definition":"AccountCheckResult = Schema.Struct({ accountInfo: Schema.optionalKey(AccountInfo) })","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AccountInfo"],"examples":["live-inbox"]},{"symbol":"apps.AccountInfo","kind":"type","summary":"Upstream identity that a passing account check may report for display. Only these fields are\nretained; the host never stores raw provider responses.","signatures":[],"definition":"AccountInfo = Schema.Struct({\n externalId: Schema.optionalKey(displayText),\n displayName: Schema.optionalKey(displayText),\n username: Schema.optionalKey(displayText),\n email: Schema.optionalKey(displayText),\n avatarUrl: Schema.optionalKey(HttpUrl),\n profileUrl: Schema.optionalKey(HttpUrl),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.AccountOf","kind":"type","summary":"One selected account, discriminated by its author-chosen method name.","signatures":[],"definition":"export type AccountOf<P> = P extends Provider<infer Auth> ? AccountOfMethods<Auth> : never;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.Provider","Provider"],"examples":["live-inbox"]},{"symbol":"apps.accountRouter","kind":"function","summary":"Discover each selected account's router and combine matching names.\nCalls take { accountId, input }; each branch retains its account's input schema,\ncredentials, approval and output validation. Empty selections expose no operations.\nDiscovery is sequential and cancellation follows the caller's signal.","signatures":["<Account extends { readonly id: string; }>(accounts: readonly Account[], discover: (account: Account) => Promise<RouterDeclaration>, options: { readonly signal: AbortSignal; }): Promise<RouterDeclaration>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/account-router.ts","related":["apps.RouterDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.AccountSlots","kind":"type","summary":"Named requirements for one account or a collection from a provider.","signatures":[],"definition":"export type AccountSlots = Readonly<\n Record<string, Provider<AuthMethods> | ManyAccounts<AuthMethods>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":["apps.AuthMethods","apps.ManyAccounts","apps.Provider","Provider"],"examples":["live-inbox"]},{"symbol":"apps.App","kind":"type","summary":"Public app handle; the native app is retained for host use without an async round trip.","signatures":[],"definition":"export interface App<\n Requirements extends AppRequirements,\n Def extends AppDefinition<Requirements>,\n> {\n readonly [InternalApp]: NativeApp<Requirements[\"accounts\"], EffectDefinition<Def>>;\n readonly accounts: Requirements[\"accounts\"];\n readonly evaluate: (context: AppContext<Requirements>) => Promise<Def>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/app.ts","related":["AppContext","apps.AppContext","apps.AppDefinition","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.AppCache","kind":"type","summary":"Cache keys describe every input that affects the value; the host adds app/build isolation.","signatures":[],"definition":"export interface AppCache {\n readonly get: <A>(options: CacheGetOptions<A>) => Promise<A>;\n /** Await a fresh load, coalescing concurrent refreshes and retaining the previous value on failure. */\n readonly revalidate: <A>(options: CacheGetOptions<A>) => Promise<A>;\n readonly read: <A>(key: JsonValue, schema: Schema<A, boolean>) => Promise<A | undefined>;\n readonly readMany: <A>(\n keys: readonly JsonValue[],\n schema: Schema<A, boolean>,\n ) => Promise<readonly (A | undefined)[]>;\n readonly write: (\n entries: readonly { readonly key: JsonValue; readonly value: JsonValue }[],\n retention: Duration.Input,\n ) => Promise<void>;\n readonly invalidate: (key: JsonValue) => Promise<void>;\n /**\n * Scope entries to a bound account and its credential generation. Token renewal keeps the\n * entries; reconnecting or replacing the account's credentials starts an empty scope.\n */\n readonly forAccount: (account: { readonly id: string }) => AppCache;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.CacheGetOptions","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.AppContext","kind":"type","summary":"Context available during dynamic app evaluation; storage opens only for handlers.","signatures":[],"definition":"export type AppContext<Requirements extends AppRequirements = AppRequirements> = BoundContext<\n Requirements[\"accounts\"]\n>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["AppContext","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.AppDefinition","kind":"type","summary":"Author definition projected from native capabilities. Excluding callable objects keeps\nfactories from being inferred as definitions and preserves contextual handler inference.","signatures":[],"definition":"export type AppDefinition<Requirements extends AppRequirements> = {\n readonly [Key in keyof NativeDefinition<WebhookContext<Requirements>>]: Key extends \"workflows\"\n ? Readonly<Record<string, WorkflowDeclaration<WorkflowContext<Requirements>>>>\n : Key extends \"schedules\"\n ? Readonly<Record<string, ScheduleDeclaration<MutationContext<Requirements>>>>\n : Key extends \"tools\"\n ? RouterDeclaration<QueryContext<Requirements>, MutationContext<Requirements>>\n : Key extends \"webhooks\"\n ? PromiseCatalog<NonNullable<NativeDefinition<WebhookContext<Requirements>>[Key]>>\n : NativeDefinition<WebhookContext<Requirements>>[Key];\n} & {\n readonly name?: never;\n readonly queries?: never;\n readonly mutations?: never;\n readonly call?: never;\n};","tags":[],"docs":"tools.md","source":"apps/src/implementation/app.ts","related":["apps.AppRequirements","apps.MutationContext","apps.QueryContext","apps.RouterDeclaration","apps.ScheduleDeclaration","apps.WebhookContext","apps.WorkflowContext","apps.WorkflowDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.AppRequirements","kind":"type","summary":"Requirements are pure values; selected accounts and database sessions belong to invocations.","signatures":[],"definition":"export interface AppRequirements {\n readonly accounts: AccountSlots;\n readonly database?: DatabaseDefinition;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["apps.AccountSlots","apps.DatabaseDefinition"],"examples":["live-inbox"]},{"symbol":"apps.Approval","kind":"type","summary":"Synchronous or async policy, projected from the framework's native contract.","signatures":[],"definition":"export type Approval<Input = unknown> = (\n ...args: Parameters<NativeApproval<Input>>\n) =>\n | Effect.Success<ReturnType<NativeApproval<Input>>>\n | Promise<Effect.Success<ReturnType<NativeApproval<Input>>>>;","tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps.ApprovalContext","kind":"type","summary":"Context for one tool's policy. toolInput is the same decoded value passed to run.","signatures":[],"definition":"export interface ApprovalContext<Input = unknown> {\n readonly toolName: string;\n readonly toolInput: Input;\n readonly signal: AbortSignal;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps/operations/approval.ApprovalContext"],"examples":["live-inbox"]},{"symbol":"apps.ApprovalDecision","kind":"type","summary":"Approve this call, deny it, or stop for a human decision.\nParsed result of one tool approval policy.","signatures":[],"definition":"ApprovalDecision = Schema.Literals([\"approved\", \"denied\", \"user-approval\"])","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps/operations/approval.ApprovalDecision"],"examples":["live-inbox"]},{"symbol":"apps.array","kind":"function","summary":"An array whose elements use the given schema.","signatures":["<T>(item: Schema<T, boolean>): Schema<readonly T[]>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.AuthMethod","kind":"type","summary":"Supported declarations; these acquire credentials rather than normalize them.","signatures":[],"definition":"export type AuthMethod =\n | SecretsMethod<Schema.Decoder<unknown>>\n | OAuth2Method<Schema.Decoder<unknown>>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.OAuth2Method","apps.SecretsMethod"],"examples":["live-inbox"]},{"symbol":"apps.AuthMethodData","kind":"type","summary":"Infer the data for one method from its native Effect decoder.","signatures":[],"definition":"export type AuthMethodData<Method> =\n Method extends SecretsMethod<infer Fields>\n ? Fields[\"Type\"]\n : Method extends OAuth2Method<infer Response>\n ? Response[\"Type\"]\n : never;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.Fields","apps.OAuth2Method","apps.SecretsMethod"],"examples":["live-inbox"]},{"symbol":"apps.AuthMethods","kind":"type","summary":"Auth method names are chosen by the provider author.","signatures":[],"definition":"export type AuthMethods = Readonly<Record<string, AuthMethod>>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethod"],"examples":["live-inbox"]},{"symbol":"apps.boolean","kind":"function","summary":"A boolean. No coercion.","signatures":["(): Schema<boolean>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.CacheError","kind":"class","summary":"Expected cache failures never include keys, values or upstream exception text.","signatures":[],"definition":"export class CacheError extends Schema.TaggedError<CacheError>()(\"CacheError\", {\n reason: Schema.Literals([\"unavailable\", \"storage\", \"invalid\", \"capacity\", \"timeout\"]),\n}) {}","tags":[],"docs":"tools.md","source":"app-cache/src/contracts/cache.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.CacheGetOptions","kind":"type","summary":"Load options shared by normal reads and explicit refreshes.","signatures":[],"definition":"export interface CacheGetOptions<A> {\n readonly key: JsonValue;\n readonly schema: Schema<A, boolean>;\n readonly freshFor: Duration.Input;\n readonly staleFor?: Duration.Input;\n readonly load: (context: CacheLoadContext) => Promise<A>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["apps.CacheLoadContext","apps.JsonValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.CacheLoadContext","kind":"type","summary":"A cache loader owns its own cancellation and HTTP capability, including during SWR.","signatures":[],"definition":"export interface CacheLoadContext {\n readonly cache: AppCache;\n readonly signal: AbortSignal;\n readonly fetch: typeof globalThis.fetch;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/cache.ts","related":["AppCache","apps.AppCache"],"examples":["live-inbox"]},{"symbol":"apps.cron","kind":"function","summary":"Calendar alternative for wall-clock schedules. UTC is the explicit default when timezone is omitted.","signatures":["<Input, Output, Context>(calendar: { readonly expression: string; readonly timezone?: string; }, operation: Operation<Input, Output, \"mutation\", Context>, input: NoInfer<Input>): ScheduleDeclaration<Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schedules.ts","related":["apps.Operation","apps.ScheduleDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.Database","kind":"type","summary":"Mutation methods stay inside one native SQLite transaction.","signatures":[],"definition":"export type Database<T extends Tables> = {\n readonly [K in keyof T]: WriteTable<RowOf<T[K]>, InputValue<T[K][\"fields\"]>, IndexOf<T[K]>>;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.DatabaseDefinition","kind":"type","summary":"Pure database declaration shared by requirements and derived handler contexts.","signatures":[],"definition":"export interface DatabaseDefinition<T extends Tables = Tables> {\n readonly schema: DatabaseSchema;\n readonly tables: T;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.DatabaseReader","kind":"type","summary":"Queries receive only read methods.","signatures":[],"definition":"export type DatabaseReader<T extends Tables> = {\n readonly [K in keyof T]: ReadTable<RowOf<T[K]>, IndexOf<T[K]>>;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.decodeJson","kind":"function","summary":"Decode a fetch response with safe status/body errors. Unexpected reader failures propagate unchanged.","signatures":["<T>(response: JsonResponse, schema: Schema<T, boolean>): Promise<T>"],"tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.JsonResponse","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.defineApp","kind":"function","summary":"Assemble app behavior. Package names belong in package.json; hosts name installed copies.","signatures":["<const Requirements extends AppRequirements, Def extends AppDefinition<Requirements>>(requirements: Requirements, definition: (Def & AppDefinition<Requirements>) | ((context: AppContext<Requirements>) => Promise<Def & AppDefinition<Requirements>>)): App<Requirements, Def>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/app.ts","related":["AppContext","apps.App","apps.AppContext","apps.AppDefinition","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.defineDatabase","kind":"function","summary":"Declare storage independently of handlers; the host binds each invocation's database.","signatures":["<const T extends Tables>(tables: T): DatabaseDefinition<T>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/storage.ts","related":["apps.DatabaseDefinition"],"examples":["live-inbox"]},{"symbol":"apps.defineProvider","kind":"function","summary":"Retain the provider and literal method names without registering or authenticating it.","signatures":["<const Auth extends AuthMethods>({ health, ...options }: ProviderOptions<Auth>): Provider<Auth>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/provider.ts","related":["apps.AuthMethods","apps.Provider","apps.ProviderOptions","Provider"],"examples":["live-inbox"]},{"symbol":"apps.dynamicRouter","kind":"function","summary":"Declare a router whose tools are discovered when read. `list` returns tools with names relative\nto this router; mark queries with `readOnly: true`. `resolve` receives one of those names.","signatures":["(source: { readonly meta?: () => RouterOptions | Promise<RouterOptions>; readonly list: () => readonly HostedTool[] | Promise<readonly HostedTool[]>; readonly resolve: (name: string) => OperationDeclaration<\"query\" | \"mutation\", unknown> | undefined | Promise<OperationDeclaration<\"query\" | \"mutation\", unknown> | undefined>; }): RouterDeclaration"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.RouterDeclaration","apps.RouterOptions"],"examples":["live-inbox"]},{"symbol":"apps.dynamicSkills","kind":"function","summary":"Declare skills that load only when skills are read, such as `list: () => githubSkills({...})`.","signatures":["(source: { readonly list: () => readonly AppSkillSource[] | Promise<readonly AppSkillSource[]>; }): DynamicSkills"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/dynamic-skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Elicit","kind":"type","summary":"App authors await standard MCP form responses without depending on Effect or a particular host.","signatures":[],"definition":"export type Elicit = (request: FormElicitation) => Promise<ElicitationResponse>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":["apps.ElicitationResponse","apps.FormElicitation"],"examples":["live-inbox"]},{"symbol":"apps.ElicitationFailed","kind":"class","summary":"A tool interaction could not be delivered or its request/response was invalid. No private payload is retained.","signatures":[],"definition":"export class ElicitationFailed extends Schema.TaggedError<ElicitationFailed>()(\n \"ElicitationFailed\",\n {\n reason: Schema.Literals([\n \"unavailable\",\n \"transaction\",\n \"invalid-request\",\n \"invalid-response\",\n \"transport\",\n \"expired\",\n \"forbidden\",\n ]),\n },\n) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ElicitationResponse","kind":"type","summary":"MCP accept/decline/cancel response, without imposing a client or transport on app code.","signatures":[],"definition":"ElicitationResponse = Schema.Union([\n Schema.Struct({ ...McpSchema.ElicitAcceptResult.fields, _meta: Schema.optional(JsonObject) }),\n Schema.Struct({ ...McpSchema.ElicitDeclineResult.fields, _meta: Schema.optional(JsonObject) }),\n])","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":["apps.JsonObject"],"examples":["live-inbox"]},{"symbol":"apps.FetchOptionUnsupported","kind":"class","summary":"`ctx.fetch` was given a standard RequestInit value the app runtime does not implement.","signatures":[],"definition":"export class FetchOptionUnsupported extends Schema.TaggedError<FetchOptionUnsupported>()(\n \"FetchOptionUnsupported\",\n {\n option: RestrictedFetchOption,\n value: Schema.String,\n supported: Schema.Array(Schema.String),\n },\n) {\n override get message();\n\n /** What to do instead, when the standard value has an equivalent the runtime supports. */\n private get advice();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/network.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Fields","kind":"type","summary":"Named author fields.","signatures":[],"definition":"export type Fields = Readonly<Record<string, Schema<unknown, boolean>>>;","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.FormElicitation","kind":"type","summary":"Plain-data form request derived from the pinned MCP protocol schema.","signatures":[],"definition":"FormElicitation = Schema.Struct({\n ...McpSchema.ElicitRequestFormParams.fields,\n mode: Schema.Literal(\"form\"),\n requestedSchema: Schema.toEncoded(McpSchema.ElicitRequestFormParams.fields.requestedSchema),\n _meta: Schema.optional(JsonObject),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/elicitation.ts","related":["apps.JsonObject"],"examples":["live-inbox"]},{"symbol":"apps.id","kind":"function","summary":"A row reference records the target table; existence is not a foreign-key constraint.","signatures":["(table: string): Schema<string>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.Infer","kind":"type","summary":"Infer the parsed author value.","signatures":[],"definition":"export type Infer<S> = S extends Schema<infer T, boolean> ? T : never;","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.interval","kind":"function","summary":"Run an existing mutation at a fixed interval. Installation enablement belongs to the host.","signatures":["<Input, Output, Context>(duration: Interval, operation: Operation<Input, Output, \"mutation\", Context>, input: NoInfer<Input>): ScheduleDeclaration<Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schedules.ts","related":["apps.Operation","apps.ScheduleDeclaration"],"examples":["live-inbox"]},{"symbol":"apps.json","kind":"function","summary":"Any JSON value. Values still cross the native JSON decoder.","signatures":["(): Schema<EffectSchema.Json>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.JsonObject","kind":"type","summary":"A JSON object, distinct from an authored value schema.","signatures":[],"definition":"JsonObject = Schema.Record(Schema.String, JsonValue)","tags":[],"docs":"tools.md","source":"apps/src/contracts/schema.ts","related":["apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"apps.JsonResponse","kind":"type","summary":"Native fetch-compatible response accepted at the author boundary.","signatures":[],"definition":"export type JsonResponse = PromiseMethods<NativeResponse>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.jsonSchema","kind":"function","summary":"Import JSON metadata now; unsupported schemas and invalid values fail when parsed.","signatures":["(input: unknown): Schema<EffectSchema.Json>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.JsonValue","kind":"type","summary":"JSON values carried by remote protocols such as MCP.","signatures":[],"definition":"JsonValue = Schema.Json","tags":[],"docs":"tools.md","source":"apps/src/contracts/schema.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.literal","kind":"function","summary":"One exact JSON scalar value.","signatures":["<const T extends string | number | boolean | null>(value: T): Schema<T>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ManyAccounts","kind":"class","summary":"A collection requirement; selecting accounts does not copy or transfer them.","signatures":[],"definition":"export class ManyAccounts<Auth extends AuthMethods> extends Data.TaggedClass(\"many\")<{\n readonly provider: Provider<Auth>;\n}> {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods","apps.Provider","Provider"],"examples":["live-inbox"]},{"symbol":"apps.mutation","kind":"function","summary":"Explicit write operation. Database writes roll back on failure; external effects cannot be undone.","signatures":["<Input, Output, Context extends AppContext = MutationContext>(options: OperationOptions<Input, Output>, run: (context: Context, input: Input) => Promise<Output>): Operation<Input, Output, \"mutation\", Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["AppContext","apps.AppContext","apps.MutationContext","apps.Operation","apps.OperationOptions"],"examples":["live-inbox"]},{"symbol":"apps.MutationContext","kind":"type","summary":"Interactive mutation context; declared storage belongs to the invocation transaction.","signatures":[],"definition":"export type MutationContext<Requirements extends AppRequirements = AppRequirements> = Omit<\n AppContext<Requirements>,\n \"workflows\"\n> & { readonly workflows: WorkflowControls } & StorageContext<Requirements, true>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["AppContext","apps.AppContext","apps.AppRequirements","apps.WorkflowControls","WorkflowControls"],"examples":["live-inbox"]},{"symbol":"apps.NetworkRefused","kind":"class","summary":"Executor's app network refused a request before it reached the service.","signatures":[],"definition":"export class NetworkRefused extends Schema.TaggedError<NetworkRefused>()(\"NetworkRefused\", {\n /** The refused destination, with its port when the URL names one. */\n host: Schema.String,\n refusal: NetworkRefusal,\n}) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/network.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.NonRetryableError","kind":"class","summary":"Explicitly stop retrying an authored step. Its message is reported like any step error.","signatures":[],"definition":"export class NonRetryableError extends Error {\n override readonly name = \"NonRetryableError\";\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.NotImplemented","kind":"class","summary":"Explicit failure for authored capabilities that are still only sketches.","signatures":[],"definition":"export class NotImplemented extends Schema.TaggedError<NotImplemented>()(\"NotImplemented\", {\n operation: Schema.String,\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/app.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.number","kind":"function","summary":"A finite JSON number. No coercion.","signatures":["(): Schema<number>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.oauth2","kind":"function","summary":"Declare OAuth discovery/endpoints and an optional app-visible response projection.\n`authorizationParams` adds service-defined sign-in parameters; a declared `authorizationUrl`\nkeeps its own query. Neither can set host-owned parameters, and each parameter appears once.","signatures":["(options: OAuth2Config): OAuth2Method<typeof OAuth2AccessToken>","<Response extends Schema<unknown, boolean>>(options: OAuth2Config & { readonly response: Response; }): OAuth2Method<Response>"],"tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.OAuth2Config","apps.OAuth2Method","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.OAuth2AccessToken","kind":"value","summary":"Default OAuth fields visible to app code. Host-only grants and clients stay private.","signatures":[],"definition":"const OAuth2AccessToken: Schema<{ readonly access_token: string; }, false>","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.OAuth2Config","kind":"type","summary":"OAuth options as authors write them. `authorizationParams` naming a host-owned protocol\nparameter such as `state` or `scope` is a type error as well as a declaration failure.","signatures":[],"definition":"export type OAuth2Config = WithoutReservedParams<NativeOAuth2Config>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.OAuth2Method","kind":"type","summary":"An OAuth declaration inferred from its author-facing response schema.","signatures":[],"definition":"export type OAuth2Method<Response extends Schema<unknown, boolean>> = NativeOAuth2Method<\n EffectSchema.Decoder<AccountFields<Response>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.object","kind":"function","summary":"Parse declared fields and omit undeclared fields.","signatures":["<const F extends Fields>(fields: F): ObjectSchema<F>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Fields","apps.ObjectSchema"],"examples":["live-inbox"]},{"symbol":"apps.ObjectSchema","kind":"type","summary":"An author object schema with retained field declarations.","signatures":[],"definition":"export interface ObjectSchema<F extends Fields> extends Schema<ObjectValue<F>> {\n readonly fields: F;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Fields","apps.ObjectValue","apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ObjectValue","kind":"type","summary":"Optional fields may be absent; defaulted fields are present after decoding.","signatures":[],"definition":"export type ObjectValue<F extends Fields> = {\n readonly [Key in keyof F as F[Key][\"optionalValue\"] extends true ? never : Key]: Infer<F[Key]>;\n} & {\n readonly [Key in keyof F as F[Key][\"optionalValue\"] extends true ? Key : never]?: Infer<F[Key]>;\n};","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Fields","apps.Infer"],"examples":["live-inbox"]},{"symbol":"apps.Operation","kind":"type","summary":"Typed operation handles drive browser reference inference without bundling handlers.","signatures":[],"definition":"export interface Operation<\n Input,\n Output,\n Kind extends \"query\" | \"mutation\",\n Context = AppContext,\n> extends OperationDeclaration<Kind, Context> {\n readonly [NativeOperation]: AppOperation<Input, Output> & { readonly kind: Kind };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["AppContext","apps.AppContext"],"examples":["live-inbox"]},{"symbol":"apps.OperationContext","kind":"type","summary":"Host-bound operation capabilities; the author declaration refines accounts and storage.","signatures":[],"definition":"export type OperationContext = BoundContext<AccountSlots> & {\n readonly db?: DatabaseReader<Tables> | Database<Tables>;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/operations.ts","related":["apps.AccountSlots","apps.Database","apps.DatabaseReader"],"examples":["live-inbox"]},{"symbol":"apps.OperationDescription","kind":"type","summary":"Serializable live tool metadata; executable callbacks never cross this boundary. `name` is the\ntool's full dotted path. `router` is the path of the router that owns it, omitted at the root.\n`readOnly` marks a query; a tool without it is a mutation.\nParsed live tool description.","signatures":[],"definition":"HostedTool = Schema.Struct({\n schedules: Schema.optionalKey(Schema.Array(OperationSchedule)),\n name: Schema.NonEmptyString,\n router: Schema.optionalKey(Schema.NonEmptyString),\n tags: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n description: Schema.String,\n inputSchema: JsonObject,\n readOnly: Schema.optionalKey(Schema.Boolean),\n title: Schema.optionalKey(Schema.String),\n outputSchema: Schema.optionalKey(JsonObject),\n annotations: Schema.optionalKey(ToolAnnotations),\n _meta: Schema.optionalKey(JsonObject),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/protocols/4.ts","related":["apps.JsonObject"],"examples":["live-inbox"]},{"symbol":"apps.OperationOptions","kind":"type","summary":"Options shared by database and external operations. Output defaults to a JSON-safe host check.","signatures":[],"definition":"export interface OperationOptions<Input, Output> {\n readonly description?: string;\n readonly title?: string;\n readonly input: Schema<Input, boolean>;\n readonly output?: Schema<Output, boolean>;\n readonly approval?: Approval<Input>;\n readonly annotations?: ToolAnnotations;\n readonly _meta?: JsonObject;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["apps.Approval","apps.JsonObject","apps.Schema","apps/operations/approval.Approval","Schema"],"examples":["live-inbox"]},{"symbol":"apps.plain","kind":"function","summary":"A field that is not secret, such as a subdomain or region. App code reads its real value and\nthe connect form shows it.","signatures":["<S extends Schema<unknown, boolean>>(schema: S): Exposed<S, \"plain\">"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.Provider","kind":"class","summary":"A provider declaration. The host derives its identity from the declaration, never its check.","signatures":[],"definition":"export class Provider<Auth extends AuthMethods> extends Data.Class<{\n readonly name: string;\n readonly auth: Auth;\n /**\n * The hosts this provider's credentials may be sent to. When present, secret fields reach app\n * code as handles that the outbound network replaces only on requests to these hosts.\n */\n readonly hosts?: readonly string[];\n /**\n * Stored without its method types so a specific provider still fills a general slot. The host\n * binds the account against this provider's methods before running it.\n */\n readonly health?: AccountCheck<AuthMethods>;\n}> {\n /** Declare zero or more accounts from this provider without performing I/O. */\n many(): ManyAccounts<Auth>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods","apps.ManyAccounts","Provider"],"examples":["live-inbox"]},{"symbol":"apps.ProviderError","kind":"class","summary":"A recognized service failure. App authors can throw this ordinary Error from\nasync code. Supply only a known reason and the account used for that request.\nNever include response bodies, messages, URLs or credentials. A bare 403 is\n`rejected`; `forbidden` requires explicit evidence of insufficient permission.\n\nThe framework adds the phase the failure happened in, and `upstream`: the error code and\ndescription the service stated in its documented error format, such as a Bearer challenge's\n`error` and `error_description`. Account secrets in that text are replaced.","signatures":[],"definition":"export class ProviderError extends Schema.TaggedError<ProviderError>()(\"ProviderError\", {\n reason: Schema.Literals([\"unauthorized\", \"forbidden\", \"rate_limited\", \"unavailable\", \"rejected\"]),\n status: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 100, maximum: 599 }))),\n accountId: Schema.optional(AccountId),\n phase: Schema.optional(FailurePhase),\n upstream: Schema.optional(UpstreamError),\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider-error.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ProviderOptions","kind":"type","summary":"Author options: the account check is an ordinary async function.","signatures":[],"definition":"export interface ProviderOptions<Auth extends AuthMethods> {\n readonly name: string;\n readonly auth: Auth;\n /**\n * Hosts the credentials may be sent to: `api.example.com`, `api.example.com:8443`, or\n * `*.example.com` for one level of subdomain. Secret fields then reach app code as handles\n * that the outbound network replaces only on requests to these hosts. An account records the\n * hosts it was connected for; changing them does not change the provider, but an existing\n * account sends only to hosts it was connected for until it is connected again.\n */\n readonly hosts?: readonly string[];\n /** Verify a connected account with a safe read, optionally reporting its upstream identity. */\n readonly health?: PromiseMethod<AccountCheck<Auth>[\"run\"]>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/provider.ts","related":["apps.AuthMethods"],"examples":["live-inbox"]},{"symbol":"apps.query","kind":"function","summary":"Read operation. External reads are allowed; only database writes are mechanically prohibited.","signatures":["<Input, Output, Context extends AppContext = AppContext<AppRequirements>>(options: OperationOptions<Input, Output>, run: (context: Context, input: Input) => Promise<Output>): Operation<Input, Output, \"query\", Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["AppContext","apps.AppContext","apps.AppRequirements","apps.Operation","apps.OperationOptions"],"examples":["live-inbox"]},{"symbol":"apps.QueryContext","kind":"type","summary":"Interactive query context; declared storage exposes only read methods.","signatures":[],"definition":"export type QueryContext<Requirements extends AppRequirements = AppRequirements> =\n AppContext<Requirements> & StorageContext<Requirements, false>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["AppContext","apps.AppContext","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.raw","kind":"function","summary":"A secret field that app code reads as its real value, for request signing and similar uses.\nThe connect form warns that the app can read it. Prefer an unmarked field, which app code\nreceives as a handle that only reaches the provider's declared hosts.","signatures":["<S extends Schema<unknown, boolean>>(schema: S): Exposed<S, \"raw\">"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.record","kind":"function","summary":"Named values with a common schema.","signatures":["<T>(value: Schema<T, boolean>): Schema<Readonly<Record<string, T>>>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ReservedAuthorizationParam","kind":"type","summary":"A protocol parameter only the host sets on the authorization request.","signatures":[],"definition":"export type ReservedAuthorizationParam = (typeof reservedAuthorizationParams)[number];","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ResponseDecodeError","kind":"class","summary":"Invalid JSON or a schema mismatch. Never includes the response body.","signatures":[],"definition":"export class ResponseDecodeError extends Schema.TaggedError<ResponseDecodeError>()(\n \"ResponseDecodeError\",\n {},\n) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/http.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.ResponseStatusError","kind":"class","summary":"A non-2xx response. Carries the status only, never the body.","signatures":[],"definition":"export class ResponseStatusError extends Schema.TaggedError<ResponseStatusError>()(\n \"ResponseStatusError\",\n { status: Schema.Number },\n) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/http.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.router","kind":"function","summary":"Group operations and routers under path keys, like tRPC's nested routers, with metadata an\nagent can read. Passing an existing router instead of children overrides its metadata:\n`router(mcpRouter(options), { description: \"...\" })`.","signatures":["<Query = unknown, Mutation = unknown>(children: Readonly<Record<string, RouterChild<Query, Mutation>>>, options?: RouterOptions): RouterDeclaration<Query, Mutation>","<Query, Mutation>(source: RouterDeclaration<Query, Mutation>, options: RouterOptions): RouterDeclaration<Query, Mutation>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.RouterChild","apps.RouterDeclaration","apps.RouterOptions"],"examples":["live-inbox"]},{"symbol":"apps.RouterChild","kind":"type","summary":"An operation or nested router under one key. Each child is typed only by its own kind's context.","signatures":[],"definition":"export interface RouterChild<Query, Mutation> {\n readonly [QueryHandlerContext]?: (context: Query) => void;\n readonly [MutationHandlerContext]?: (context: Mutation) => void;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.RouterDeclaration","kind":"type","summary":"A router declaration. The phantom contexts let `defineApp` type inline handlers; protocol\nrouters accept any context because their operations only use the framework's own capabilities.\nThe native router is held under a private key in implementation/router.ts.","signatures":[],"definition":"export interface RouterDeclaration<Query = unknown, Mutation = unknown> {\n readonly [QueryHandlerContext]?: (context: Query) => void;\n readonly [MutationHandlerContext]?: (context: Mutation) => void;\n readonly [NativeRouterKey]: unknown;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.RouterIcon","kind":"type","summary":"An image a client may show beside a router, such as an MCP server's own icon. Models never read it.","signatures":[],"definition":"RouterIcon = Schema.Struct({\n src: Schema.NonEmptyString,\n mimeType: Schema.optionalKey(Schema.String),\n sizes: Schema.optionalKey(Schema.Array(Schema.String)),\n theme: Schema.optionalKey(Schema.Literals([\"light\", \"dark\"])),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/router.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.RouterOptions","kind":"type","summary":"Author metadata for a router. Instructions become a skill named after the router's path.","signatures":[],"definition":"export interface RouterOptions {\n readonly title?: string;\n readonly description?: string;\n readonly instructions?: string;\n readonly icons?: readonly RouterIcon[];\n readonly tags?: Readonly<Record<string, string>>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.RouterIcon"],"examples":["live-inbox"]},{"symbol":"apps.ScheduleDeclaration","kind":"type","summary":"The app adapter resolves this operation handle to its declared mutation name.","signatures":[],"definition":"export interface ScheduleDeclaration<Context = never> {\n readonly operation: OperationDeclaration<\"mutation\", Context>;\n readonly timing: ScheduleTiming;\n readonly input: JsonValue;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schedules.ts","related":["apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"apps.Schema","kind":"type","summary":"An author-facing value schema. Effect is never required in author code.","signatures":[],"definition":"export interface Schema<T, Optional extends boolean = false> {\n readonly [StorageField]?: Field;\n readonly [Decoder]: EffectSchema.Decoder<T>;\n readonly optionalValue: Optional;\n /** Parse an unknown value; invalid input throws a safe ValidationError. */\n parse(input: unknown): T;\n /** Accept an absent field without changing the original schema. */\n optional(): Schema<T | undefined, true>;\n /** Validate the default now and use it for undefined input. */\n default(value: T): Schema<T> & { readonly hasDefault: true; readonly inputOptional: Optional };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.ValidationError","Schema"],"examples":["live-inbox"]},{"symbol":"apps.secrets","kind":"function","summary":"Declare a secrets method without requiring an Effect schema from the author.","signatures":["<const F extends Fields>(options: { readonly label: string; readonly fields: ObjectSchema<F>; }): SecretsMethod<ObjectSchema<F>>"],"tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Fields","apps.ObjectSchema","apps.SecretsMethod"],"examples":["live-inbox"]},{"symbol":"apps.SecretsMethod","kind":"type","summary":"A secrets declaration inferred from an author schema.","signatures":[],"definition":"export type SecretsMethod<Shape extends ObjectSchema<Fields>> = NativeSecretsMethod<\n EffectSchema.Decoder<AccountFields<Shape>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Fields","apps.ObjectSchema"],"examples":["live-inbox"]},{"symbol":"apps.SecretString","kind":"type","summary":"A secret account value. In a provider that declares hosts it is a handle, which the host's\noutbound network replaces with the real value only on requests to those hosts. Pass it to\nclients and headers as an ordinary string; do not decode or transform it.","signatures":[],"definition":"export type SecretString = string & { readonly [Secret]: true };","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Skill","kind":"type","summary":"Files use paths relative to this skill directory; reading one never executes its contents.","signatures":[],"definition":"AppSkillSource = Schema.Struct({\n ...AppSkillMetadata.fields,\n files: Schema.Array(SkillFile).check(\n Schema.makeFilter(\n (files) =>\n files.some((file) => file.path === \"SKILL.md\") &&\n new Set(files.map((file) => file.path)).size === files.length,\n ),\n ),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps.SkillFile","kind":"type","summary":"UTF-8 text resource. Reading a resource never executes it.","signatures":[],"definition":"SkillFile = Schema.Struct({ path: SkillFilePath, content: Schema.String })","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps.string","kind":"function","summary":"A string, optionally with a minimum length. No coercion.","signatures":["(options?: { readonly minLength?: number; }): Schema<string>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.table","kind":"function","summary":"Declare scalar columns using the same schemas as operation inputs. The host adds `id`,\n`createdAt` and `updatedAt` to every row, so tables cannot declare those names.","signatures":["<const F extends Fields & { readonly [K in ReservedFieldName]?: never; }>(fields: F): Table<F>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/storage.ts","related":["apps.Fields","apps.Table","Table"],"examples":["live-inbox"]},{"symbol":"apps.Table","kind":"type","summary":"Typed table declaration; indexes refer only to authored or host metadata fields.","signatures":[],"definition":"export interface Table<F extends Fields, Index extends string = never> {\n readonly fields: F;\n readonly indexes: ReadonlyArray<{ readonly name: string; readonly fields: readonly string[] }>;\n readonly index: <Name extends string>(\n name: Name,\n fields: readonly [\n (keyof F & string) | keyof typeof RowMetadata.Type,\n ...((keyof F & string) | keyof typeof RowMetadata.Type)[],\n ],\n ) => Table<F, Index | Name>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/storage.ts","related":["apps.Fields","Table"],"examples":["live-inbox"]},{"symbol":"apps.toolAnnotations","kind":"function","summary":"The advisory hints an operation carries, such as an MCP server's `destructiveHint`. App code\nreads them to choose an approval; the framework never infers one from them.","signatures":["(operation: OperationDeclaration<\"query\" | \"mutation\", never>): ToolAnnotations | undefined"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.userId","kind":"function","summary":"A host user identifier, stored as a string without imposing a product auth model.","signatures":["(): Schema<string>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"apps.ValidationError","kind":"class","summary":"Invalid input. Never includes supplied values, credentials or response bodies.","signatures":[],"definition":"export class ValidationError extends Schema.TaggedError<ValidationError>()(\"ValidationError\", {}) {\n override get message();\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/schema.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.Webhook","kind":"type","summary":"Author lifecycle methods use async functions and share native decoded context/state types.","signatures":[],"definition":"export type Webhook<\n Context extends WebhookContext,\n Config extends Schema<unknown, boolean>,\n State extends Schema<unknown, boolean>,\n> = AuthorWebhook<\n NativeWebhook<Context, EffectSchema.Decoder<Infer<Config>>, EffectSchema.Decoder<Infer<State>>>,\n Config,\n State\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Infer","apps.Schema","apps.WebhookContext","Schema"],"examples":["live-inbox"]},{"symbol":"apps.WebhookContext","kind":"type","summary":"Background webhook context has account and storage access without interactive input.","signatures":[],"definition":"export type WebhookContext<Requirements extends AppRequirements = AppRequirements> = Omit<\n MutationContext<Requirements>,\n \"elicit\"\n>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/context.ts","related":["apps.AppRequirements","apps.MutationContext"],"examples":["live-inbox"]},{"symbol":"apps.withApproval","kind":"function","summary":"Attach the same approval function to a generated or shared operation.","signatures":["<Input, Output, Kind extends \"query\" | \"mutation\", Context>(operation: Operation<Input, Output, Kind, Context>, approval: Approval<Input>): Operation<Input, Output, Kind, Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/operations.ts","related":["apps.Approval","apps.Operation","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps.withApprovals","kind":"function","summary":"Choose an approval for each operation a router contains, including tools a dynamic router\nresolves later. `policy` receives the operation and its name relative to this router; returning\nundefined keeps the operation's own approval. Read hints with `toolAnnotations(operation)`.\nApply it to each account's router before `accountRouter` combines them, so every account keeps\nits own tools' hints.","signatures":["<Query, Mutation>(source: RouterDeclaration<Query, Mutation>, policy: (operation: OperationDeclaration<\"query\" | \"mutation\", never>, name: string) => Approval | undefined): RouterDeclaration<Query, Mutation>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/router.ts","related":["apps.Approval","apps.RouterDeclaration","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps.workflow","kind":"function","summary":"Declare durable orchestration without starting a run or performing I/O.","signatures":["<Input, Output, Context extends WorkflowContext = WorkflowContext<AppRequirements>>(options: { readonly input: Schema<Input, boolean>; readonly output?: Schema<Output, boolean>; readonly description?: string; }, run: (context: Context, input: Input) => Promise<Output>): Workflow<Input, Output, Context>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/workflows.ts","related":["apps.AppRequirements","apps.Schema","apps.Workflow","apps.WorkflowContext","Schema"],"examples":["live-inbox"]},{"symbol":"apps.Workflow","kind":"type","summary":"A workflow declaration retains input/output inference and required context compatibility.","signatures":[],"definition":"export interface Workflow<Input, Output, Context extends WorkflowContext = WorkflowContext> {\n readonly [HandlerContext]?: (context: Context) => void;\n readonly [NativeWorkflow]: AppWorkflow<Input, Output>;\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/workflows.ts","related":["apps.WorkflowContext"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowContext","kind":"type","summary":"The orchestration body gets no account, database or interactive capabilities.","signatures":[],"definition":"export interface WorkflowContext<Requirements extends AppRequirements = AppRequirements> {\n readonly runId: WorkflowRunId;\n readonly step: WorkflowStep<Requirements>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.AppRequirements","apps.WorkflowStep","WorkflowStep"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowControls","kind":"type","summary":"Mutating handlers may start and terminate runs in their own configured app.","signatures":[],"definition":"export interface WorkflowControls extends WorkflowReads {\n readonly start: (input: {\n readonly workflow: string;\n readonly input: JsonValue;\n readonly key?: string;\n }) => Promise<WorkflowRun>;\n readonly terminate: (input: { readonly run: string }) => Promise<WorkflowRun>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.JsonValue","apps.WorkflowReads","WorkflowControls"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowDeclaration","kind":"type","summary":"Composition view erases input only after retaining its runtime decoder.","signatures":[],"definition":"export interface WorkflowDeclaration<Context extends WorkflowContext> {\n readonly [HandlerContext]?: (context: Context) => void;\n readonly [NativeWorkflow]: Omit<AppWorkflow<never>, \"input\"> & {\n readonly input: EffectSchema.Decoder<unknown>;\n };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/workflows.ts","related":["apps.WorkflowContext"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowDuration","kind":"type","summary":"Numbers are milliseconds; strings use a quantity and full unit, such as \"5 minutes\".","signatures":[],"definition":"WorkflowDuration = Schema.Union([\n Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)),\n Schema.NonEmptyString,\n]).check(Schema.makeFilter((value) => workflowDurationMillis(value) !== undefined))","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.WorkflowFailure","kind":"class","summary":"Failures cross host boundaries as reason codes plus the app's own bounded error detail.","signatures":[],"definition":"export class WorkflowFailure extends Schema.TaggedError<WorkflowFailure>()(\"WorkflowFailure\", {\n ...WorkflowFailureDetail,\n reason: Schema.Literals([\n \"unavailable\",\n \"not_found\",\n \"input\",\n \"output\",\n \"operation\",\n \"approval\",\n \"credentials\",\n \"terminated\",\n \"execution\",\n \"conflict\",\n \"engine\",\n ]),\n retryable: Schema.Boolean,\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.WorkflowReads","kind":"type","summary":"Query and factory contexts may inspect only their own app's runs.","signatures":[],"definition":"export interface WorkflowReads {\n readonly get: (input: { readonly run: string }) => Promise<WorkflowRun>;\n readonly list: (input?: {\n readonly workflow?: string;\n readonly limit?: number;\n readonly cursor?: string;\n }) => Promise<WorkflowRunPage>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps.WorkflowStep","kind":"type","summary":"Explicit durable boundaries; database access passes through registered app operations.","signatures":[],"definition":"export interface WorkflowStep<Requirements extends AppRequirements = AppRequirements> {\n do<Output>(\n name: string,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n do<Output>(\n name: string,\n options: WorkflowStepOptions,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n runQuery<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"query\", QueryContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n runMutation<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"mutation\", MutationContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n readonly sleep: (name: string, duration: WorkflowDuration) => Promise<void>;\n readonly sleepUntil: (name: string, timestamp: number | Date) => Promise<void>;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.AppRequirements","apps.MutationContext","apps.Operation","apps.QueryContext","apps.WorkflowDuration","apps.WorkflowStepContext","apps.WorkflowStepOptions","WorkflowStep"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowStepContext","kind":"type","summary":"External steps get fresh credentials and cancellation, without storage or live elicitation.","signatures":[],"definition":"export type WorkflowStepContext<Requirements extends AppRequirements = AppRequirements> = Omit<\n AppContext<Requirements>,\n \"elicit\" | \"workflows\"\n> & {\n readonly runId: WorkflowRunId;\n readonly stepId: string;\n readonly idempotencyKey: string;\n};","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["AppContext","apps.AppContext","apps.AppRequirements"],"examples":["live-inbox"]},{"symbol":"apps.WorkflowStepOptions","kind":"type","summary":"Author retry and timeout options are passed to the durable engine.","signatures":[],"definition":"WorkflowStepOptions = Schema.Struct({\n retries: Schema.optionalKey(\n Schema.Struct({\n limit: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n delay: WorkflowDuration,\n backoff: Schema.optionalKey(Schema.Literals([\"constant\", \"linear\", \"exponential\"])),\n }),\n ),\n timeout: Schema.optionalKey(WorkflowDuration),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/workflows.ts","related":["apps.WorkflowDuration"],"examples":["live-inbox"]},{"symbol":"apps/client.AppMutation","kind":"type","summary":"A callable mutation. Success means the write was acknowledged; its overlay stays until fresh reads finish.","signatures":[],"definition":"export interface AppMutation<Input, Output> {\n (input: Input): Promise<Output>;\n /** Return a new mutation handle with this projection. Failures remove only this invocation's changes. */\n withOptimisticUpdate(update: OptimisticUpdate<Input>): AppMutation<Input, Output>;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["AppMutation","apps/client.OptimisticUpdate"],"examples":["live-inbox"]},{"symbol":"apps/client.AppQueryFailed","kind":"class","summary":"Safe client failure; arbitrary transport errors and response data are never exposed.","signatures":[],"definition":"export class AppQueryFailed extends Schema.TaggedError<AppQueryFailed>()(\"AppQueryFailed\", {}) {}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/client.createAppClient","kind":"function","summary":"A scoped page client. Host-injected context carries only the deployment, never credentials.","signatures":["(): { dispose: () => Promise<void>; query: <Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Promise<NoInfer<Output>>; mutate: <Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Promise<Output>; mutation: <Input, Output>(reference: OperationReference<Input, Output, \"mutation\">, output: Schema<NoInfer<Output>, boolean>) => AppMutation<Input, Output>; queryAtom: <Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Atom.Atom<AsyncResult.AsyncResult<Output, unknown>>; }"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/ui-client.ts","related":["AppMutation","apps.Schema","apps/client.AppMutation","apps/client.OperationReference","Schema"],"examples":["live-inbox"]},{"symbol":"apps/client.liveQueryAtom","kind":"function","summary":"Subscribe for the atom's mounted lifetime and parse every result using a shared output schema.\nThe host supplies routing, authentication and reconnection behavior through transport.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, options: { readonly output: Schema<NoInfer<Output>, boolean>; readonly transport: QueryTransport; }): Atom.Atom<AsyncResult<NoInfer<Output>, NoSuchElementError | AppQueryFailed>>"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/live.ts","related":["apps.Schema","apps/client.AppQueryFailed","apps/client.OperationReference","apps/client.QueryTransport","Schema"],"examples":["live-inbox"]},{"symbol":"apps/client.mutationReference","kind":"function","summary":"Make a mutation reference using a type-only server import.","signatures":["<Mutation>(name: Mutation extends Operation<infer _Input, infer _Output, \"mutation\", infer _Context> ? string : never): OperationReference<InputOf<Mutation>, OutputOf<Mutation>, \"mutation\">"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/live.ts","related":["apps.Operation","apps/client.OperationReference"],"examples":["live-inbox"]},{"symbol":"apps/client.OperationReference","kind":"type","summary":"Serializable named reference; the phantom field is never populated at runtime.","signatures":[],"definition":"export interface OperationReference<Input, Output, Kind extends \"query\" | \"mutation\"> {\n readonly name: string;\n readonly kind: Kind;\n readonly _types?: { readonly input: Input; readonly output: Output };\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/client.OptimisticLocalStore","kind":"type","summary":"Read or replace mounted queries during a synchronous optimistic update. Never mutate returned values.","signatures":[],"definition":"export interface OptimisticLocalStore {\n /** Read the projected result, or undefined if this query is not loaded in this client. */\n getQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n ): Output | undefined;\n /** Read all mounted argument variants of an operation, including loading queries. */\n getAllQueries<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n ): readonly { readonly input: Input; readonly value: Output | undefined }[];\n /** Replace a mounted query's projected result. The query's output schema validates the new value. */\n setQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n value: NoInfer<Output>,\n ): void;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"apps/client.OptimisticUpdate","kind":"type","summary":"Pure synchronous projection. Replayed over current data; create temporary IDs before invoking the mutation.","signatures":[],"definition":"export type OptimisticUpdate<Input> = (store: OptimisticLocalStore, input: Input) => undefined;","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OptimisticLocalStore","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"apps/client.QueryDescriptor","kind":"type","summary":"Host-bound subscription request. Authentication and configured app identity belong to the host.","signatures":[],"definition":"export interface QueryDescriptor {\n readonly name: string;\n readonly input: JsonValue;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":["apps.JsonValue"],"examples":["live-inbox"]},{"symbol":"apps/client.queryReference","kind":"function","summary":"Make a query reference using a type-only server import. No handler is passed or bundled.","signatures":["<Query>(name: Query extends Operation<infer _Input, infer _Output, \"query\", infer _Context> ? string : never): OperationReference<InputOf<Query>, OutputOf<Query>, \"query\">"],"tags":[],"docs":"ui.md","source":"apps/src/implementation/live.ts","related":["apps.Operation","apps/client.OperationReference"],"examples":["live-inbox"]},{"symbol":"apps/client.QueryTransport","kind":"type","summary":"Host transport must close its subscription when async iteration ends. Results are parsed by the client.","signatures":[],"definition":"export interface QueryTransport {\n readonly subscribe: (descriptor: QueryDescriptor) => Promise<AsyncIterable<unknown>>;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/live.ts","related":["apps/client.QueryDescriptor"],"examples":["live-inbox"]},{"symbol":"apps/graphql.GraphqlCatalogOptions","kind":"type","summary":"An endpoint, the account whose schema it is, and the metadata policy.","signatures":[],"definition":"export type GraphqlCatalogOptions = Omit<GraphqlToolsOptions, \"accountId\" | \"headers\"> &\n CatalogCacheOptions &\n CatalogAccount;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/graphql-catalog.ts","related":["apps/graphql.GraphqlToolsOptions"],"examples":[]},{"symbol":"apps/graphql.GraphqlError","kind":"class","summary":"Safe failures omit upstream bodies. Execution means a valid GraphQL error response, not malformed data.","signatures":[],"definition":"export class GraphqlError extends Schema.TaggedError<GraphqlError>()(\"GraphqlError\", {\n phase: Schema.Literals([\"discover\", \"call\"]),\n reason: Schema.Literals([\n \"request\",\n \"unauthorized\",\n \"invalid_response\",\n \"invalid_input\",\n \"timeout\",\n \"execution\",\n ]),\n status: Schema.optional(Schema.Number),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/graphql.ts","related":[],"examples":[]},{"symbol":"apps/graphql.graphqlRouter","kind":"function","summary":"Lazy tools with optional persistent metadata caching for the selected account.","signatures":["(options: GraphqlCatalogOptions, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/graphql.ts","related":["apps.RouterDeclaration","apps/graphql.GraphqlCatalogOptions","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/graphql.GraphqlToolsOptions","kind":"type","summary":"Endpoint and credential snapshot for one app evaluation.","signatures":[],"definition":"GraphqlToolsOptions = Schema.Struct({\n url: HttpUrl,\n accountId: Schema.optional(AccountId),\n headers: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n signal: Schema.optional(Schema.instanceOf(AbortSignal)),\n timeoutMs: Schema.optional(\n Schema.Int.check(\n Schema.isBetween({ minimum: 1, maximum: defaultGraphqlClientLimits.maxTimeoutMs }),\n ),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/graphql.ts","related":[],"examples":[]},{"symbol":"apps/graphql.OperationKinds","kind":"type","summary":"Explicit corrections for upstream read-only hints or unusual HTTP semantics.","signatures":[],"definition":"export type OperationKinds = Readonly<Record<string, \"query\" | \"mutation\">>;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/protocol-operations.ts","related":["apps/mcp.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/mcp.McpCatalogOptions","kind":"type","summary":"A server, the account whose catalog it is, and the metadata policy for HTTP/SSE sources. A\nmissing cache keeps discovery invocation-local.","signatures":[],"definition":"export type McpCatalogOptions = Omit<McpToolsOptions, \"accountId\" | \"headers\"> &\n CatalogCacheOptions &\n CatalogAccount;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/mcp-catalog.ts","related":["apps/mcp.McpToolsOptions"],"examples":[]},{"symbol":"apps/mcp.McpCredentialsUnverified","kind":"class","summary":"`mcpHealth` could not show that the server needs the account's credentials, although it accepted\nthem. `anonymous` is what the same check without credentials met: `answered` when it succeeded,\nso a refused key would pass too, or the failure, other than a refusal, that left it undecided.\nOnly app code raises it; the host reports its fixed message, so no host protocol carries it.","signatures":[],"definition":"export class McpCredentialsUnverified extends Schema.TaggedError<McpCredentialsUnverified>()(\n \"McpCredentialsUnverified\",\n { anonymous: Schema.Union([Schema.Literal(\"answered\"), McpError, ProviderError]) },\n) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.ProviderError","apps/mcp.McpError","apps/mcp/stdio.McpError"],"examples":[]},{"symbol":"apps/mcp.McpError","kind":"class","summary":"Safe protocol/transport failure; no raw upstream payloads or credentials. `status` is the HTTP\nstatus a `request` failure was redirected or refused with. Without one, a `request` failure in\nthe `transport` phase never reached the server; in another phase it may be a JSON-RPC error the\nserver answered with. `upstream` is that JSON-RPC error, bounded and with account secrets\nreplaced. A response that is not MCP is `invalid_response`.","signatures":[],"definition":"export class McpError extends Schema.TaggedError<McpError>()(\"McpError\", {\n phase: Schema.Literals([\"connect\", \"discover\", \"call\", \"schema\", \"transport\"]),\n reason: Schema.Literals([\n \"request\",\n \"unauthorized\",\n \"invalid_response\",\n \"timeout\",\n \"invalid_input\",\n ]),\n status: Schema.optional(Schema.Number),\n upstream: Schema.optional(UpstreamError),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps/mcp/stdio.McpError"],"examples":[]},{"symbol":"apps/mcp.mcpHealth","kind":"function","summary":"A provider `health` check for an MCP server. Pass the check context `health` receives, then the\nserver's `url` and the `headers` that send the account's credentials:\n`health: (check) => mcpHealth(check, { url, headers: headers(check.account) })`.\n\nIt connects with those headers, initializes, and reads the first page of tools, then does the\nsame without any headers. No tool runs. The check passes only when the server accepts the account\nand refuses the attempt without credentials. A refused account throws `ProviderError`, as HTTP\nhelpers do. An unreachable or unusable server throws `McpError`, and a request Executor's network\nrefuses throws `NetworkRefused`. A server that also answers without credentials, or whose answer\nto that attempt is not a refusal, throws `McpCredentialsUnverified`. Each of these errors means\nthe check could not verify the account, and the account form explains why. Send credentials only\nin `headers`; the attempt without them uses the same `url`. The check context's `signal` cancels\nboth attempts, and they share one budget that ends early enough before its `deadline` to report a\nserver that did not answer in time. `timeoutMs` can only shorten that budget.","signatures":["<Auth extends AuthMethods>(check: AccountCheckContext<Auth>, options: McpHealthOptions): Promise<void>"],"tags":[],"docs":"integrations.md","source":"apps/src/mcp.ts","related":["apps.AccountCheckContext","apps.AuthMethods","apps/mcp.McpHealthOptions"],"examples":[]},{"symbol":"apps/mcp.McpHealthOptions","kind":"type","summary":"The server a provider check verifies, and the headers that send the checked account's\ncredentials. The account, signal and deadline come from the check context instead. Both attempts\nshare one budget that ends `mcpHealthReserveMs` before the deadline. `timeoutMs` bounds the whole\ncheck too; it can shorten the budget, never extend it.","signatures":[],"definition":"export type McpHealthOptions = Pick<typeof McpHealthInput.Type, \"url\" | \"headers\" | \"timeoutMs\">;","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":[],"examples":[]},{"symbol":"apps/mcp.mcpRouter","kind":"function","summary":"A router over a server's tools for the selected account. Its title, description and\ninstructions come from the server. Kinds override uncertain upstream read-only hints.","signatures":["(options: McpCatalogOptions, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/mcp.ts","related":["apps.RouterDeclaration","apps/graphql.OperationKinds","apps/mcp.McpCatalogOptions","apps/mcp.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/mcp.McpToolContext","kind":"type","summary":"Direct callers can omit interaction capabilities. A server that asks for input then fails explicitly.","signatures":[],"definition":"export interface McpToolContext {\n readonly elicit?: Elicit;\n}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.Elicit","apps/mcp/stdio.McpToolContext"],"examples":[]},{"symbol":"apps/mcp.McpToolResult","kind":"type","summary":"Native MCP result semantics, and the value every MCP tool call returns. A tool's output\nschema is built from this declaration. Protocol/transport failures use the Effect error channel.","signatures":[],"definition":"McpToolResult = Schema.Struct({\n content: Schema.Array(JsonObject),\n structuredContent: Schema.optionalKey(JsonObject),\n isError: Schema.optionalKey(Schema.Boolean),\n _meta: Schema.optionalKey(JsonObject),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.JsonObject"],"examples":[]},{"symbol":"apps/mcp.McpToolsOptions","kind":"type","summary":"Server and headers for this selected account. Headers are a credential snapshot.","signatures":[],"definition":"McpToolsOptions = Schema.Struct({\n url: HttpUrl,\n accountId: Schema.optional(AccountId),\n headers: Schema.optional(Schema.Record(Schema.String, Schema.String)),\n signal: Schema.optional(Schema.instanceOf(AbortSignal)),\n timeoutMs: Schema.optional(\n Schema.Number.check(\n Schema.isInt(),\n Schema.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs }),\n ),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":[],"examples":[]},{"symbol":"apps/mcp.OperationKinds","kind":"type","summary":"Explicit corrections for upstream read-only hints or unusual HTTP semantics.","signatures":[],"definition":"export type OperationKinds = Readonly<Record<string, \"query\" | \"mutation\">>;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/protocol-operations.ts","related":["apps/graphql.OperationKinds","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/mcp/stdio.McpError","kind":"class","summary":"Safe protocol/transport failure; no raw upstream payloads or credentials. `status` is the HTTP\nstatus a `request` failure was redirected or refused with. Without one, a `request` failure in\nthe `transport` phase never reached the server; in another phase it may be a JSON-RPC error the\nserver answered with. `upstream` is that JSON-RPC error, bounded and with account secrets\nreplaced. A response that is not MCP is `invalid_response`.","signatures":[],"definition":"export class McpError extends Schema.TaggedError<McpError>()(\"McpError\", {\n phase: Schema.Literals([\"connect\", \"discover\", \"call\", \"schema\", \"transport\"]),\n reason: Schema.Literals([\n \"request\",\n \"unauthorized\",\n \"invalid_response\",\n \"timeout\",\n \"invalid_input\",\n ]),\n status: Schema.optional(Schema.Number),\n upstream: Schema.optional(UpstreamError),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps/mcp.McpError"],"examples":[]},{"symbol":"apps/mcp/stdio.McpToolContext","kind":"type","summary":"Direct callers can omit interaction capabilities. A server that asks for input then fails explicitly.","signatures":[],"definition":"export interface McpToolContext {\n readonly elicit?: Elicit;\n}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.Elicit","apps/mcp.McpToolContext"],"examples":[]},{"symbol":"apps/mcp/stdio.ProcessConfig","kind":"type","summary":"Public process configuration. Credentials arrive through the selected account.","signatures":[],"definition":"ProcessConfig = Schema.Struct({\n command: Schema.NonEmptyString,\n args: Schema.Array(Schema.String),\n cwd: Schema.optional(Schema.String),\n env: Schema.Record(Schema.String, Schema.String),\n timeoutMs: Schema.Int.check(\n Schema.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs }),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":[],"examples":[]},{"symbol":"apps/mcp/stdio.stdioRouter","kind":"function","summary":"Discover an account's tools as a router; each discovery and call owns and closes its subprocess.","signatures":["(config: ProcessConfig, signal?: AbortSignal, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/mcp-stdio.ts","related":["apps.RouterDeclaration","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/mcp/stdio.ProcessConfig","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/openapi.CredentialBinding","kind":"type","summary":"Map a selected account field to one Swagger credential value.","signatures":[],"definition":"CredentialBinding = Schema.Struct({\n scheme: Schema.String,\n field: Schema.String,\n part: Schema.Literals([\"value\", \"username\", \"password\"]),\n prefix: Schema.String,\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.isOpenapiTextMedia","kind":"function","summary":"Media returned as text rather than a base64 file. JSON sequences remain unparsed text.","signatures":["(type: string): boolean"],"tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.liveOpenapiRouter","kind":"function","summary":"No I/O during app construction. All accounts share credential-free compilation.","signatures":["(options: OpenapiSourceOptions): RouterDeclaration"],"tags":[],"docs":"integrations.md","source":"apps/src/implementation/openapi-source.ts","related":["apps.RouterDeclaration","apps/openapi.OpenapiSourceOptions"],"examples":[]},{"symbol":"apps/openapi.openapiBinaryResultSchema","kind":"value","summary":"JSON-safe binary result, independent of the host's file storage.","signatures":[],"definition":"const openapiBinaryResultSchema: { readonly [x: string]: Schema.Json; }","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiCompileError","kind":"class","summary":"A safe generation failure. `reason` explains the cause; `skipped` lists the declared operations\nit left out and why, and `origins` the origins operations resolve to when none of them matches\nthe allowed origin. Reading one left-out tool fails with this error for that operation alone.","signatures":[],"definition":"export class OpenapiCompileError extends Schema.TaggedError<OpenapiCompileError>()(\n \"OpenapiCompileError\",\n {\n code: OpenapiCompileErrorCode,\n reason: Schema.String,\n skipped: Schema.optionalKey(Schema.Array(OpenapiSkippedOperation)),\n origins: Schema.optionalKey(Schema.Array(Schema.String)),\n },\n) {\n override get message();\n}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi-compile.ts","related":["apps/openapi.OpenapiSkippedOperation"],"examples":[]},{"symbol":"apps/openapi.OpenapiCompileErrorCode","kind":"value","summary":"Which part of an OpenAPI document could not be compiled into tools.","signatures":[],"definition":"const OpenapiCompileErrorCode: Schema.Literals<readonly [\"server_protocol\", \"server_url\", \"external_reference\", \"circular_reference\", \"schema_keyword\", \"schema_reference\", \"missing_component\", \"openapi_version\", \"auth_helper\", \"auth_missing\", \"operation_path\", \"operation_method\", \"duplicate_operation\", \"server_missing\", \"multiple_hosts\", \"parameter_encoding\", \"parameter_style\", \"request_body\", \"combined_oauth\", \"auth_method\", \"event_stream\", \"input_schema\", \"no_operations\", \"no_supported_operations\", \"invalid_document\", \"source_generation\", \"authoring_reference\"]>","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi-compile.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiError","kind":"class","summary":"Safe failures omit request headers, credentials and upstream body text: the failure message is\nalso recorded in traces. A `request` failure with a status names the response that no declared\nerror matched, or the success response whose body could not be read, by its media type and\ndeclared length.","signatures":[],"definition":"export class OpenapiError extends Schema.TaggedError<OpenapiError>()(\"OpenapiError\", {\n reason: Schema.Literals([\"invalid_definition\", \"invalid_input\", \"request\"]),\n status: Schema.optional(Schema.Number),\n /** Absent only when the definition itself could not be read. */\n operation: Schema.optional(OpenapiFailedOperation),\n contentType: Schema.optional(OpenapiMediaType),\n /** The response's `content-length`, when it declared one. */\n bytes: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n}) {}","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiErrorResponse","kind":"type","summary":"Tagged error shapes retain an explicit source for their public message.\nA retained declaration used to validate an HTTP failure before exposing its code.","signatures":[],"definition":"OpenapiErrorResponse = Schema.Struct({\n code: ApiErrorResponse.fields.code,\n status: ApiErrorResponse.fields.status,\n message: Schema.Union([\n Schema.Struct({ source: Schema.Literal(\"body\") }),\n Schema.Struct({ source: Schema.Literal(\"schema\"), value: ApiErrorResponse.fields.message }),\n ]),\n schema: JsonObject,\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject"],"examples":[]},{"symbol":"apps/openapi.openapiMediaKind","kind":"function","summary":"Classify request media for JSON-safe tool arguments; Swagger owns wire serialization.","signatures":["(type: string): \"form\" | \"json\" | \"binary\" | \"multipart\" | \"text\""],"tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiOperation","kind":"type","summary":"Credential-free operation data emitted by the OpenAPI importer.","signatures":[],"definition":"OpenapiOperation = Schema.Struct({\n /** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */\n name: Schema.NonEmptyString,\n /** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */\n operationId: Schema.optionalKey(Schema.String),\n description: Schema.String,\n method: Schema.Literals([\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"HEAD\", \"OPTIONS\", \"QUERY\"]),\n path: Schema.String,\n baseUrl: HttpUrl,\n openapi: Schema.String,\n securitySchemes: Schema.Record(Schema.String, JsonObject),\n /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */\n request: Schema.Struct({\n parameters: Schema.Array(OpenapiParameter),\n requestBody: Schema.optionalKey(OpenapiRequestBody),\n security: Schema.Array(Schema.Record(Schema.String, Schema.Array(Schema.String))),\n responses: Schema.Record(Schema.String, JsonObject),\n }),\n /** Streams remain in the metadata but cannot run through a single-result tool call. */\n streaming: Schema.optionalKey(Schema.Literal(true)),\n /** The operation's OpenAPI tags, shown to agents as labels within its router. */\n tags: Schema.optionalKey(Schema.Array(Schema.NonEmptyString)),\n input: JsonObject,\n outputSchema: Schema.optionalKey(JsonObject),\n errorResponses: Schema.optionalKey(Schema.Array(OpenapiErrorResponse)),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject","apps.Operation","apps/openapi.OpenapiErrorResponse","apps/openapi.OpenapiParameter"],"examples":[]},{"symbol":"apps/openapi.OpenapiParameter","kind":"type","summary":"Resolved OpenAPI parameter shared by import validation and request construction.","signatures":[],"definition":"OpenapiParameter = Schema.Struct({\n name: Schema.String,\n /** OpenAPI 3.2's `querystring` is the whole query string, serialized from one `content` value. */\n in: Schema.Literals([\"path\", \"query\", \"querystring\", \"header\", \"cookie\"]),\n required: Schema.optionalKey(Schema.Boolean),\n schema: Schema.optionalKey(JsonObject),\n style: Schema.optionalKey(Schema.String),\n explode: Schema.optionalKey(Schema.Boolean),\n allowReserved: Schema.optionalKey(Schema.Boolean),\n allowEmptyValue: Schema.optionalKey(Schema.Boolean),\n content: Schema.optionalKey(JsonObject),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject"],"examples":[]},{"symbol":"apps/openapi.OpenapiRequestBody","kind":"value","summary":"Preserve media schemas and Encoding Objects for Swagger request construction.","signatures":[],"definition":"const OpenapiRequestBody: Schema.Struct<{ readonly required: Schema.optionalKey<Schema.Boolean>; readonly content: Schema.$Record<Schema.String, Schema.Struct<{ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>; readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>; }>>; }>","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":[],"examples":[]},{"symbol":"apps/openapi.openapiRouter","kind":"function","summary":"Discover a document's operations as a router for the selected account. Kinds override uncertain\nupstream read-only hints. Mount it under a key, or override its metadata with `router(...)`.","signatures":["(options: OpenapiToolsOptions, kinds?: OperationKinds): Promise<RouterDeclaration<unknown, unknown>>"],"tags":[],"docs":"integrations.md","source":"apps/src/openapi.ts","related":["apps.RouterDeclaration","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/openapi.OpenapiToolsOptions","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/openapi.OpenapiSkippedOperation","kind":"type","summary":"A declared operation the importer left out, and why.","signatures":[],"definition":"OpenapiSkippedOperation = Schema.Struct({\n /** The tool name the operation would have; reading that tool reports why it is missing. */\n name: Schema.String,\n /** The HTTP method, such as `GET`. */\n method: Schema.String,\n /** The path as the definition declares it. */\n path: Schema.String,\n code: OpenapiCompileErrorCode,\n reason: Schema.String,\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi-compile.ts","related":[],"examples":[]},{"symbol":"apps/openapi.OpenapiSourceOptions","kind":"type","summary":"Static credential placement and destination are reviewed when the app is authored/imported.","signatures":[],"definition":"export interface OpenapiSourceOptions extends Omit<\n OpenapiToolsOptions,\n \"operations\" | \"definitions\"\n> {\n readonly cache: AppCache;\n readonly source: { readonly url: string } | { readonly document: JsonObject };\n readonly allowedOrigin: string;\n readonly securitySchemes: Readonly<Record<string, JsonObject>>;\n readonly baseUrl?: string;\n /**\n * A path inserted between the server and every operation's path, for a definition that omits a\n * leading segment, such as `/projects/{project}`. Each `{name}` becomes a required string path\n * parameter of every tool, unless the operation already declares it without placing it.\n */\n readonly pathPrefix?: string;\n readonly freshFor?: Duration.Input;\n readonly staleFor?: Duration.Input;\n /**\n * Query or mutation overrides keyed by the document's operationId. An operation without an\n * operationId is keyed by its generated name without the kind, such as `users.getUsers`.\n */\n readonly kinds?: OperationKinds;\n readonly fallbackSecurity?: OpenapiOperation[\"request\"][\"security\"];\n readonly patches?: readonly {\n readonly op: \"add\" | \"remove\" | \"replace\";\n readonly path: string;\n readonly value?: JsonValue;\n }[];\n}","tags":[],"docs":"integrations.md","source":"apps/src/implementation/openapi-source.ts","related":["AppCache","apps.AppCache","apps.JsonObject","apps.JsonValue","apps/graphql.OperationKinds","apps/mcp.OperationKinds","apps/openapi.OpenapiOperation","apps/openapi.OpenapiToolsOptions","apps/openapi.OperationKinds"],"examples":[]},{"symbol":"apps/openapi.OpenapiToolsOptions","kind":"type","summary":"Parsed options for one account's evaluation.\nJSON imports are decoded at the helper boundary, without assertions in app source.","signatures":[],"definition":"OpenapiToolsOptions = Schema.Struct({\n operations: Schema.Array(OpenapiOperation),\n /**\n * Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations\n * generated before shared definitions carry their own `$defs` and omit this.\n */\n definitions: Schema.optional(Schema.Record(Schema.String, JsonObject)),\n methods: Schema.Record(Schema.String, Schema.Array(CredentialBinding)),\n oauth: Schema.Array(Schema.String),\n account: Schema.optional(OpenapiAccount),\n parameterDefaults: Schema.optional(OpenapiParameterDefaults),\n signal: Schema.optional(Schema.instanceOf(AbortSignal)),\n fetch: Schema.optional(\n Schema.declare((value): value is typeof globalThis.fetch => typeof value === \"function\"),\n ),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/openapi.ts","related":["apps.JsonObject","apps/openapi.CredentialBinding","apps/openapi.OpenapiOperation"],"examples":[]},{"symbol":"apps/openapi.OperationKinds","kind":"type","summary":"Explicit corrections for upstream read-only hints or unusual HTTP semantics.","signatures":[],"definition":"export type OperationKinds = Readonly<Record<string, \"query\" | \"mutation\">>;","tags":[],"docs":"integrations.md","source":"apps/src/implementation/protocol-operations.ts","related":["apps/graphql.OperationKinds","apps/mcp.OperationKinds"],"examples":[]},{"symbol":"apps/operations/approval.always","kind":"function","summary":"Require human approval for every call to the tool.","signatures":["<Input = unknown>(): Approval<Input>"],"tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps.Approval","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.Approval","kind":"type","summary":"Synchronous or async policy, projected from the framework's native contract.","signatures":[],"definition":"export type Approval<Input = unknown> = (\n ...args: Parameters<NativeApproval<Input>>\n) =>\n | Effect.Success<ReturnType<NativeApproval<Input>>>\n | Promise<Effect.Success<ReturnType<NativeApproval<Input>>>>;","tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps.Approval"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.ApprovalContext","kind":"type","summary":"Context for one tool's policy. toolInput is the same decoded value passed to run.","signatures":[],"definition":"export interface ApprovalContext<Input = unknown> {\n readonly toolName: string;\n readonly toolInput: Input;\n readonly signal: AbortSignal;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps.ApprovalContext"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.ApprovalDecision","kind":"type","summary":"Approve this call, deny it, or stop for a human decision.\nParsed result of one tool approval policy.","signatures":[],"definition":"ApprovalDecision = Schema.Literals([\"approved\", \"denied\", \"user-approval\"])","tags":[],"docs":"tools.md","source":"apps/src/contracts/approval.ts","related":["apps.ApprovalDecision"],"examples":["live-inbox"]},{"symbol":"apps/operations/approval.never","kind":"function","summary":"Never require human approval for this tool. Product access checks still apply.","signatures":["<Input = unknown>(): Approval<Input>"],"tags":[],"docs":"tools.md","source":"apps/src/approval.ts","related":["apps.Approval","apps/operations/approval.Approval"],"examples":["live-inbox"]},{"symbol":"apps/react.useAppQuery","kind":"function","summary":"Subscribe for the component lifetime. Each mount owns and disposes its registry, including StrictMode remounts.","signatures":["<A, E>(atom: Atom.Atom<AsyncResult.AsyncResult<A, E>>): { data: A | undefined; pending: boolean; error: string | undefined; }"],"tags":[],"docs":"ui.md","source":"apps/src/react.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.fileSkill","kind":"function","summary":"Parse a bundled standard skill directory into an app capability.","signatures":["(files: readonly SkillFile[]): Promise<{ readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.folderSkills","kind":"function","summary":"Read skill directories from ctx.files. Omitted path selects skills/; missing folders return [].","signatures":["(options: FolderSkillsOptions): Promise<readonly { readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }[]>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.FolderSkillsOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.FolderSkillsOptions","kind":"type","summary":"A folder in the deployed package; omitted path selects skills/. No host filesystem access.","signatures":[],"definition":"export interface FolderSkillsOptions {\n readonly files: readonly SkillFile[];\n readonly path?: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.githubSkills","kind":"function","summary":"Fetch a GitHub skill collection from one resolved commit. A private repository takes `account`\nand its `token`. Pass `cache: ctx.cache` to reuse the catalog; without it, mutable refs resolve\nagain on each call.","signatures":["(options: GitHubSkillsOptions): Promise<readonly { readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }[]>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.GitHubSkillsOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.GitHubSkillsAccount","kind":"type","summary":"Whose access reads the repository. A public repository needs neither field. A private one takes\na GitHub account and its token, sent on every request of this read. The token comes only with\nits account, so the catalog is cached in that account's scope and failures name the account.","signatures":[],"definition":"export type GitHubSkillsAccount = import(\"./cache.ts\").AccountCredential<{\n /**\n * The account's token or its handle, such as `account.fields.token`. Its provider declares\n * hosts `github.com` and `raw.githubusercontent.com`, so app code never holds the value.\n */\n readonly token: string;\n}>;","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.GitHubSkillsOptions","kind":"type","summary":"A GitHub repository and an optional immutable commit, tag or branch. With a cache, a branch or\ntag is resolved again when the catalog refreshes, and each commit's file list is kept.","signatures":[],"definition":"export type GitHubSkillsOptions = SkillTransport &\n SkillCacheOptions &\n GitHubSkillsAccount & {\n readonly repo: string;\n readonly path?: string;\n readonly ref?: string;\n };","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps/skills.GitHubSkillsAccount","apps/skills.SkillCacheOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.Skill","kind":"type","summary":"Files use paths relative to this skill directory; reading one never executes its contents.","signatures":[],"definition":"AppSkillSource = Schema.Struct({\n ...AppSkillMetadata.fields,\n files: Schema.Array(SkillFile).check(\n Schema.makeFilter(\n (files) =>\n files.some((file) => file.path === \"SKILL.md\") &&\n new Set(files.map((file) => file.path)).size === files.length,\n ),\n ),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile","apps/skills.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillCacheOptions","kind":"type","summary":"Catalog reuse shared by remote skill loaders, with the same policy as MCP tool catalogs. Pass\n`ctx.cache` to keep the loaded catalog; without it every read fetches the source again.","signatures":[],"definition":"export interface SkillCacheOptions {\n readonly cache?: import(\"./cache.ts\").AppCache;\n /** Reuse the catalog for this duration. Defaults to five minutes. */\n readonly freshFor?: import(\"effect\").Duration.Input;\n /** Serve the retained catalog while refreshing. Defaults to one day. */\n readonly staleFor?: import(\"effect\").Duration.Input;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["AppCache","apps.AppCache"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillDefinitionInvalid","kind":"type","summary":"Invalid selected skill files fail the load. Errors identify the file without disclosing its contents.","signatures":[],"definition":"SkillDefinitionInvalid = ApiError.define({\n tag: \"SkillDefinitionInvalid\",\n status: 400,\n fields: {\n file: SkillFilePath,\n reason: Schema.Literals([\n \"files\",\n \"directory\",\n \"missing-document\",\n \"frontmatter\",\n \"metadata\",\n \"name-mismatch\",\n ]),\n },\n message: ({ file, reason }) => skillDefinitionFailures[reason](file),\n})","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillFile","kind":"type","summary":"UTF-8 text resource. Reading a resource never executes it.","signatures":[],"definition":"SkillFile = Schema.Struct({ path: SkillFilePath, content: Schema.String })","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps.SkillFile"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillLoadFailed","kind":"class","summary":"A skill loader failure shown to people. `message` is the explanation they read; write it for\nthem and never include URLs, tokens or response bodies. `reason` selects the title and whether\na retry can help. Custom loaders throw this error to get the same presentation as built-ins.","signatures":[],"definition":"export class SkillLoadFailed extends Schema.TaggedError<SkillLoadFailed>()(\"SkillLoadFailed\", {\n reason: Schema.Literals([\n \"source\",\n \"request\",\n \"rate_limited\",\n \"document\",\n \"limit\",\n \"changed\",\n \"encoding\",\n ]),\n // Error instances read an omitted message as \"\", so an empty message means none was given.\n message: Schema.optional(Schema.String.check(Schema.isMaxLength(500))),\n status: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 100, maximum: 599 }))),\n}) {}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.skillReader","kind":"function","summary":"Read files for a custom remote skill loader, such as one for GitLab. Reads share one byte\nbudget and reject with the same safe SkillLoadFailed errors as githubSkills, naming `service`.","signatures":["(options: SkillReaderOptions): { text: (url: string) => Promise<string>; json: (url: string) => Promise<unknown>; }"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.SkillReaderOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillReaderOptions","kind":"type","summary":"A custom loader's transport and the service name shown when a request fails.","signatures":[],"definition":"export interface SkillReaderOptions extends SkillTransport {\n readonly service: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.SkillServiceName","kind":"value","summary":"Short display name for a skill source, such as \"GitLab\" or an index host name.","signatures":[],"definition":"const SkillServiceName: Schema.String","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":[],"examples":["live-inbox"]},{"symbol":"apps/skills.wellKnownSkills","kind":"function","summary":"Fetch a published skill index and its text files. Pass `cache: ctx.cache` to reuse the catalog.","signatures":["(options: WellKnownSkillsOptions): Promise<readonly { readonly description: string; readonly name: string; readonly files: readonly { readonly path: string; readonly content: string; }[]; readonly license?: string; readonly compatibility?: string; readonly metadata?: { readonly [x: string]: string; }; readonly \"allowed-tools\"?: string; }[]>"],"tags":[],"docs":"tools.md","source":"apps/src/skills.ts","related":["apps/skills.WellKnownSkillsOptions"],"examples":["live-inbox"]},{"symbol":"apps/skills.WellKnownSkillsOptions","kind":"type","summary":"A published directory index, including its listed skill documents and text references.","signatures":[],"definition":"export interface WellKnownSkillsOptions extends SkillTransport, SkillCacheOptions {\n readonly url: string;\n}","tags":[],"docs":"tools.md","source":"apps/src/contracts/skills.ts","related":["apps/skills.SkillCacheOptions"],"examples":["live-inbox"]},{"symbol":"DatabaseTable","kind":"type","summary":"Writes are valid only inside their owning mutation.","signatures":[],"definition":"export interface WriteTable<Row, Insert, Index extends string = string> extends ReadTable<\n Row,\n Index\n> {\n /** Insert authored fields and return the complete row with generated id, createdAt and updatedAt. */\n readonly insert: (value: Insert) => Promise<Row>;\n /** Patch authored fields and return the complete row, or null if the ID does not exist. */\n readonly update: (id: string, patch: Partial<Insert>) => Promise<Row | null>;\n /** Delete the row and return whether it existed. */\n readonly delete: (id: string) => Promise<boolean>;\n}","tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":[],"examples":["live-inbox"]},{"symbol":"DatabaseTable.delete","kind":"method","summary":"Delete the row and return whether it existed.","signatures":["(id: string): Promise<boolean>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.get","kind":"method","summary":"Read a complete row by ID, or null when it does not exist.","signatures":["(id: string): Promise<Row | null>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.insert","kind":"method","summary":"Insert authored fields and return the complete row with generated id, createdAt and updatedAt.","signatures":["(value: Insert): Promise<Row>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.update","kind":"method","summary":"Patch authored fields and return the complete row, or null if the ID does not exist.","signatures":["(id: string, patch: Partial<Insert>): Promise<Row | null>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable"],"examples":["live-inbox"]},{"symbol":"DatabaseTable.withIndex","kind":"method","summary":"Select a declared index or by_creation, with optional prefix and range constraints.","signatures":["(index: \"by_creation\" | Index, range?: ((query: IndexRange<Row>) => IndexRange<Row>) | undefined): Query<Row>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["DatabaseTable","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexQuery","kind":"type","summary":"Bounded indexed reads; collect/count reject work beyond the invocation budget.","signatures":[],"definition":"export interface Query<Row> {\n /** Choose ascending or descending index order without changing this query. */\n readonly order: (direction: \"asc\" | \"desc\") => Query<Row>;\n /** Read all matching rows within the invocation budget; exceeding it fails. */\n readonly collect: () => Promise<readonly Row[]>;\n /** Count matching rows within the scan budget; exceeding it fails. */\n readonly count: () => Promise<number>;\n /** Read the first matching row, or null when no row matches. */\n readonly first: () => Promise<Row | null>;\n /** Read at most count matching rows within the invocation budget. */\n readonly take: (count: number) => Promise<readonly Row[]>;\n /** Read one cursor page. Return its rows, continuation cursor and completion flag. */\n readonly paginate: (options: {\n readonly numItems: number;\n readonly cursor: string | null;\n }) => Promise<{\n readonly page: readonly Row[];\n readonly continueCursor: string | null;\n readonly isDone: boolean;\n }>;\n}","tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":[],"examples":["live-inbox"]},{"symbol":"IndexQuery.collect","kind":"method","summary":"Read all matching rows within the invocation budget; exceeding it fails.","signatures":["(): Promise<readonly Row[]>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.count","kind":"method","summary":"Count matching rows within the scan budget; exceeding it fails.","signatures":["(): Promise<number>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.first","kind":"method","summary":"Read the first matching row, or null when no row matches.","signatures":["(): Promise<Row | null>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.order","kind":"method","summary":"Choose ascending or descending index order without changing this query.","signatures":["(direction: \"asc\" | \"desc\"): Query<Row>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.paginate","kind":"method","summary":"Read one cursor page. Return its rows, continuation cursor and completion flag.","signatures":["(options: { readonly numItems: number; readonly cursor: string | null; }): Promise<{ readonly page: readonly Row[]; readonly continueCursor: string | null; readonly isDone: boolean; }>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexQuery.take","kind":"method","summary":"Read at most count matching rows within the invocation budget.","signatures":["(count: number): Promise<readonly Row[]>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["IndexQuery"],"examples":["live-inbox"]},{"symbol":"IndexRange","kind":"type","summary":"Index predicates are accumulated immutably, then checked against the declaration by the engine.","signatures":[],"definition":"export interface IndexRange<Fields> {\n /** Constrain an index prefix field to one value. Null matches a cleared optional field. */\n readonly eq: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key] | null,\n ) => IndexRange<Fields>;\n /** Require a value greater than the bound on the next index field. */\n readonly gt: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n /** Require a value greater than or equal to the bound on the next index field. */\n readonly gte: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n /** Require a value less than the bound on the next index field. */\n readonly lt: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n /** Require a value less than or equal to the bound on the next index field. */\n readonly lte: <Key extends keyof Fields & string>(\n field: Key,\n value: Fields[Key],\n ) => IndexRange<Fields>;\n}","tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields"],"examples":["live-inbox"]},{"symbol":"IndexRange.eq","kind":"method","summary":"Constrain an index prefix field to one value. Null matches a cleared optional field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key] | null): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.gt","kind":"method","summary":"Require a value greater than the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.gte","kind":"method","summary":"Require a value greater than or equal to the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.lt","kind":"method","summary":"Require a value less than the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"IndexRange.lte","kind":"method","summary":"Require a value less than or equal to the bound on the next index field.","signatures":["<Key extends keyof Fields & string>(field: Key, value: Fields[Key]): IndexRange<Fields>"],"tags":[],"docs":"storage.md","source":"app-data/src/implementation/promise.ts","related":["apps.Fields","IndexRange"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore","kind":"type","summary":"Read or replace mounted queries during a synchronous optimistic update. Never mutate returned values.","signatures":[],"definition":"export interface OptimisticLocalStore {\n /** Read the projected result, or undefined if this query is not loaded in this client. */\n getQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n ): Output | undefined;\n /** Read all mounted argument variants of an operation, including loading queries. */\n getAllQueries<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n ): readonly { readonly input: Input; readonly value: Output | undefined }[];\n /** Replace a mounted query's projected result. The query's output schema validates the new value. */\n setQuery<Input, Output>(\n reference: OperationReference<Input, Output, \"query\">,\n input: NoInfer<Input>,\n value: NoInfer<Output>,\n ): void;\n}","tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","apps/client.OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore.getAllQueries","kind":"method","summary":"Read all mounted argument variants of an operation, including loading queries.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">): readonly { readonly input: Input; readonly value: Output | undefined; }[]"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore.getQuery","kind":"method","summary":"Read the projected result, or undefined if this query is not loaded in this client.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>): Output | undefined"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"OptimisticLocalStore.setQuery","kind":"method","summary":"Replace a mounted query's projected result. The query's output schema validates the new value.","signatures":["<Input, Output>(reference: OperationReference<Input, Output, \"query\">, input: NoInfer<Input>, value: NoInfer<Output>): void"],"tags":[],"docs":"ui.md","source":"apps/src/contracts/optimistic.ts","related":["apps/client.OperationReference","OptimisticLocalStore"],"examples":["live-inbox"]},{"symbol":"Provider","kind":"type","summary":"A provider declaration. The host derives its identity from the declaration, never its check.","signatures":[],"definition":"export class Provider<Auth extends AuthMethods> extends Data.Class<{\n readonly name: string;\n readonly auth: Auth;\n /**\n * The hosts this provider's credentials may be sent to. When present, secret fields reach app\n * code as handles that the outbound network replaces only on requests to these hosts.\n */\n readonly hosts?: readonly string[];\n /**\n * Stored without its method types so a specific provider still fills a general slot. The host\n * binds the account against this provider's methods before running it.\n */\n readonly health?: AccountCheck<AuthMethods>;\n}> {\n /** Declare zero or more accounts from this provider without performing I/O. */\n many(): ManyAccounts<Auth>;\n}","tags":[],"docs":"accounts.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods","apps.ManyAccounts","apps.Provider"],"examples":[]},{"symbol":"Provider.many","kind":"method","summary":"Declare zero or more accounts from this provider without performing I/O.","signatures":["(): ManyAccounts<Auth>"],"tags":[],"docs":"accounts.md","source":"apps/src/contracts/provider.ts","related":["apps.ManyAccounts","Provider"],"examples":[]},{"symbol":"Provider.pipe","kind":"method","summary":"","signatures":["<A>(this: A): A","<A, B = never>(this: A, ab: (_: A) => B): B","<A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C","<A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D","<A, B = never, C = never, D = never, E = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E): E","<A, B = never, C = never, D = never, E = never, F = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F): F","<A, B = never, C = never, D = never, E = never, F = never, G = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G): G","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H): H","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I): I","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J): J","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K): K","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L): L","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M): M","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N): N","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O): O","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P): P","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q): Q","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R): R","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S): S","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never, T = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S, st: (_: S) => T): T","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never, T = never, U = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S, st: (_: S) => T, tu: (_: T) => U): U","<A, B = never, C = never, D = never, E = never, F = never, G = never, H = never, I = never, J = never, K = never, L = never, M = never, N = never, O = never, P = never, Q = never, R = never, S = never, T = never, U = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D, de: (_: D) => E, ef: (_: E) => F, fg: (_: F) => G, gh: (_: G) => H, hi: (_: H) => I, ij: (_: I) => J, jk: (_: J) => K, kl: (_: K) => L, lm: (_: L) => M, mn: (_: M) => N, no: (_: N) => O, op: (_: O) => P, pq: (_: P) => Q, qr: (_: Q) => R, rs: (_: R) => S, st: (_: S) => T, tu: (_: T) => U): U"],"tags":[],"docs":"accounts.md","source":"../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Pipeable.d.ts","related":["Provider"],"examples":[]},{"symbol":"Schema","kind":"type","summary":"An author-facing value schema. Effect is never required in author code.","signatures":[],"definition":"export interface Schema<T, Optional extends boolean = false> {\n readonly [StorageField]?: Field;\n readonly [Decoder]: EffectSchema.Decoder<T>;\n readonly optionalValue: Optional;\n /** Parse an unknown value; invalid input throws a safe ValidationError. */\n parse(input: unknown): T;\n /** Accept an absent field without changing the original schema. */\n optional(): Schema<T | undefined, true>;\n /** Validate the default now and use it for undefined input. */\n default(value: T): Schema<T> & { readonly hasDefault: true; readonly inputOptional: Optional };\n}","tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","apps.ValidationError"],"examples":["live-inbox"]},{"symbol":"Schema.default","kind":"method","summary":"Validate the default now and use it for undefined input.","signatures":["(value: T): Schema<T> & { readonly hasDefault: true; readonly inputOptional: Optional; }"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"Schema.optional","kind":"method","summary":"Accept an absent field without changing the original schema.","signatures":["(): Schema<T | undefined, true>"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["apps.Schema","Schema"],"examples":["live-inbox"]},{"symbol":"Schema.parse","kind":"method","summary":"Parse an unknown value; invalid input throws a safe ValidationError.","signatures":["(input: unknown): T"],"tags":[],"docs":"tools.md","source":"apps/src/implementation/schema.ts","related":["Schema"],"examples":["live-inbox"]},{"symbol":"Table","kind":"type","summary":"Typed table declaration; indexes refer only to authored or host metadata fields.","signatures":[],"definition":"export interface Table<F extends Fields, Index extends string = never> {\n readonly fields: F;\n readonly indexes: ReadonlyArray<{ readonly name: string; readonly fields: readonly string[] }>;\n readonly index: <Name extends string>(\n name: Name,\n fields: readonly [\n (keyof F & string) | keyof typeof RowMetadata.Type,\n ...((keyof F & string) | keyof typeof RowMetadata.Type)[],\n ],\n ) => Table<F, Index | Name>;\n}","tags":[],"docs":"storage.md","source":"apps/src/contracts/storage.ts","related":["apps.Fields","apps.Table"],"examples":["live-inbox"]},{"symbol":"Table.index","kind":"method","summary":"","signatures":["<Name extends string>(name: Name, fields: readonly [(keyof F & string) | keyof typeof RowMetadata.Type, ...((keyof F & string) | keyof typeof RowMetadata.Type)[]]): Table<F, Index | Name>"],"tags":[],"docs":"storage.md","source":"apps/src/contracts/storage.ts","related":["apps.Table","Table"],"examples":["live-inbox"]},{"symbol":"WorkflowControls","kind":"type","summary":"Mutating handlers may start and terminate runs in their own configured app.","signatures":[],"definition":"export interface WorkflowControls extends WorkflowReads {\n readonly start: (input: {\n readonly workflow: string;\n readonly input: JsonValue;\n readonly key?: string;\n }) => Promise<WorkflowRun>;\n readonly terminate: (input: { readonly run: string }) => Promise<WorkflowRun>;\n}","tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.JsonValue","apps.WorkflowControls","apps.WorkflowReads"],"examples":[]},{"symbol":"WorkflowControls.get","kind":"method","summary":"","signatures":["(input: { readonly run: string; }): Promise<WorkflowRun>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowControls"],"examples":[]},{"symbol":"WorkflowControls.list","kind":"method","summary":"","signatures":["(input?: { readonly workflow?: string; readonly limit?: number; readonly cursor?: string; }): Promise<WorkflowRunPage>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowControls"],"examples":[]},{"symbol":"WorkflowControls.start","kind":"method","summary":"","signatures":["(input: { readonly workflow: string; readonly input: JsonValue; readonly key?: string; }): Promise<WorkflowRun>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.JsonValue","WorkflowControls"],"examples":[]},{"symbol":"WorkflowControls.terminate","kind":"method","summary":"","signatures":["(input: { readonly run: string; }): Promise<WorkflowRun>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowControls"],"examples":[]},{"symbol":"WorkflowStep","kind":"type","summary":"Explicit durable boundaries; database access passes through registered app operations.","signatures":[],"definition":"export interface WorkflowStep<Requirements extends AppRequirements = AppRequirements> {\n do<Output>(\n name: string,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n do<Output>(\n name: string,\n options: WorkflowStepOptions,\n run: (context: WorkflowStepContext<Requirements>) => Promise<Output>,\n ): Promise<Output>;\n runQuery<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"query\", QueryContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n runMutation<Input, Output>(\n name: string,\n operation: Operation<Input, Output, \"mutation\", MutationContext<Requirements>>,\n input: NoInfer<Input>,\n options?: WorkflowStepOptions,\n ): Promise<Output>;\n readonly sleep: (name: string, duration: WorkflowDuration) => Promise<void>;\n readonly sleepUntil: (name: string, timestamp: number | Date) => Promise<void>;\n}","tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.AppRequirements","apps.MutationContext","apps.Operation","apps.QueryContext","apps.WorkflowDuration","apps.WorkflowStep","apps.WorkflowStepContext","apps.WorkflowStepOptions"],"examples":[]},{"symbol":"WorkflowStep.do","kind":"method","summary":"","signatures":["<Output>(name: string, run: (context: WorkflowStepContext<Requirements>) => Promise<Output>): Promise<Output>","<Output>(name: string, options: WorkflowStepOptions, run: (context: WorkflowStepContext<Requirements>) => Promise<Output>): Promise<Output>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.WorkflowStepContext","apps.WorkflowStepOptions","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.runMutation","kind":"method","summary":"","signatures":["<Input, Output>(name: string, operation: Operation<Input, Output, \"mutation\", MutationContext<Requirements>>, input: NoInfer<Input>, options?: WorkflowStepOptions): Promise<Output>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.MutationContext","apps.Operation","apps.WorkflowStepOptions","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.runQuery","kind":"method","summary":"","signatures":["<Input, Output>(name: string, operation: Operation<Input, Output, \"query\", QueryContext<Requirements>>, input: NoInfer<Input>, options?: WorkflowStepOptions): Promise<Output>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.Operation","apps.QueryContext","apps.WorkflowStepOptions","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.sleep","kind":"method","summary":"","signatures":["(name: string, duration: WorkflowDuration): Promise<void>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["apps.WorkflowDuration","WorkflowStep"],"examples":[]},{"symbol":"WorkflowStep.sleepUntil","kind":"method","summary":"","signatures":["(name: string, timestamp: number | Date): Promise<void>"],"tags":[],"docs":"workflows.md","source":"apps/src/contracts/workflows.ts","related":["WorkflowStep"],"examples":[]}],"examples":[{"id":"live-inbox","title":"React UI with live app storage","files":[{"path":"index.ts","content":"import {\n query,\n mutation,\n type QueryContext,\n type MutationContext,\n array,\n defineApp,\n defineDatabase,\n object,\n string,\n table,\n router,\n} from \"apps\";\nimport { Message } from \"./schema.ts\";\n\nconst database = defineDatabase({\n messages: table({ subject: string() }).index(\"by_subject\", [\"subject\"]),\n});\n\nconst requirements = { accounts: {}, database };\n\nexport const listMessages = query(\n { input: object({}), output: array(Message) },\n async ({ db }: QueryContext<typeof requirements>) =>\n await db.messages.withIndex(\"by_creation\").order(\"desc\").take(100),\n);\nexport const receiveMessage = mutation(\n { input: object({ subject: string(), clientId: string().optional() }), output: Message },\n async ({ db }: MutationContext<typeof requirements>, message) =>\n await db.messages.insert({ subject: message.subject }),\n);\nexport default defineApp(requirements, {\n tools: router({\n listMessages,\n receiveMessage,\n }),\n});\n"},{"path":"schema.ts","content":"/** Shared data shape; safe to import from browser and server code. */\nimport { object, string } from \"apps\";\nexport const Message = object({ id: string(), subject: string() });\n"},{"path":"ui/main.tsx","content":"import { StrictMode, useState } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport { array } from \"apps\";\nimport { createAppClient, mutationReference, queryReference } from \"apps/client\";\nimport { useAppQuery } from \"apps/react\";\nimport type { listMessages, receiveMessage } from \"../index.ts\";\nimport { Message } from \"../schema.ts\";\nimport \"./style.css\";\n\nconst client = createAppClient();\nconst listRef = queryReference<typeof listMessages>(\"listMessages\");\nconst inbox = client.queryAtom(listRef, {}, array(Message));\nconst receive = client\n .mutation(mutationReference<typeof receiveMessage>(\"receiveMessage\"), Message)\n .withOptimisticUpdate((store, input) => {\n const rows = store.getQuery(listRef, {});\n if (rows !== undefined && input.clientId !== undefined) {\n store.setQuery(\n listRef,\n {},\n [{ id: input.clientId, subject: input.subject }, ...rows].slice(0, 100),\n );\n }\n });\n\nfunction Inbox() {\n const { data, pending, error } = useAppQuery(inbox);\n const [subject, setSubject] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [failure, setFailure] = useState<string>();\n return (\n <main className=\"max-w-225 min-h-dvh py-0 px-[32px] m-auto flex flex-col max-[540px]:py-0 max-[540px]:px-[20px]\">\n <header className=\"h-20 flex items-center justify-between [border-bottom:1px_solid_#e8e8e2] max-[540px]:h-16.5\">\n <div className=\"identity flex items-center gap-2.5 font-semibold text-[15px]\">\n <span\n className=\"mark w-7.25 h-7.25 [border:1px_solid_#deded7] bg-white grid [place-items:center] rounded-[8px]\"\n aria-hidden=\"true\"\n >\n ↗\n </span>\n <span>Inbox</span>\n </div>\n <span className=\"status text-[#55645b] text-[12px] flex items-center gap-1.5 before:[content:''] before:w-1.5 before:h-1.5 before:bg-[#659674] before:rounded-[50%]\">\n {pending ? \"Connecting…\" : error ? \"Disconnected\" : \"Live\"}\n </span>\n </header>\n <section className=\"intro [padding:64px_0_36px] [&_p]:text-[14px] [&_p]:text-[#85857d] [&_p]:m-0 max-[540px]:pt-10\">\n <span className=\"eyebrow text-[10px] tracking-[0.12em] font-semibold text-[#888880]\">\n YOUR SPACE\n </span>\n <h1 className=\"text-[clamp(26px,_5vw,_36px)] tracking-[-0.04em] font-medium [margin:14px_0_10px]\">\n A little room for ideas.\n </h1>\n <p>Leave a thought. It’s here when you return.</p>\n </section>\n <form\n className=\"bg-white [border:1px_solid_#e2e2db] rounded-[12px] p-[20px] max-[540px]:p-[16px]\"\n onSubmit={async (event) => {\n event.preventDefault();\n if (!subject.trim() || saving) return;\n setSaving(true);\n setFailure(undefined);\n try {\n await receive({ subject: subject.trim(), clientId: crypto.randomUUID() });\n setSubject(\"\");\n } catch {\n setFailure(\"Could not save your message. Try again.\");\n } finally {\n setSaving(false);\n }\n }}\n >\n <label className=\"block text-[12px] [font-weight:550] mb-3\" htmlFor=\"subject\">\n New message\n </label>\n <div className=\"compose flex gap-3 max-[540px]:flex-col\">\n <input\n className=\"min-w-0 flex-1 [border:1px_solid_#e3e3dd] rounded-[7px] py-[11px] px-[12px] bg-[#fafaf8] text-[14px] focus-visible:[outline:2px_solid_#adbdad] focus-visible:outline-offset-[2px]\"\n id=\"subject\"\n value={subject}\n onChange={(e) => setSubject(e.target.value)}\n placeholder=\"What’s on your mind?\"\n autoComplete=\"off\"\n required\n />\n <button\n className=\"border-0 rounded-[7px] bg-[#303d34] text-white py-0 px-[17px] text-[12px] [font-weight:550] cursor-pointer max-[540px]:min-h-10.5 disabled:opacity-50 disabled:cursor-default\"\n disabled={saving || !subject.trim()}\n >\n {saving ? \"Saving…\" : \"Add message\"}\n </button>\n </div>\n {failure && (\n <p className=\" text-[#a74636] text-[13px]\" role=\"alert\">\n {failure}\n </p>\n )}\n </form>\n <section className=\"messages flex-1 pt-9.5\" aria-labelledby=\"messages-title\">\n <div className=\"section-heading flex items-center justify-between pb-3.75 [border-bottom:1px_solid_#e6e6df] [&_h2]:text-[13px] [&_h2]:[font-weight:550] [&_h2]:m-0 [&_span]:text-[11px] [&_span]:text-[#8c8c83]\">\n <h2 id=\"messages-title\">Messages</h2>\n <span>{data?.length ?? 0}</span>\n </div>\n {error && (\n <p className=\" text-[#a74636] text-[13px]\" role=\"alert\">\n {error}\n </p>\n )}\n {pending ? (\n <p className=\"empty py-[64px] px-0 text-center text-[#97978e] [&_>_span]:text-[30px] [&_>_span]:text-[#bdc4b8] [&_h3]:text-[#77776f] [&_h3]:text-[14px] [&_h3]:font-medium [&_h3]:[margin:18px_0_7px] [&_p]:text-[12px] [&_p]:m-0 \">\n Loading your inbox…\n </p>\n ) : data?.length === 0 ? (\n <div className=\"empty py-[64px] px-0 text-center text-[#97978e] [&_>_span]:text-[30px] [&_>_span]:text-[#bdc4b8] [&_h3]:text-[#77776f] [&_h3]:text-[14px] [&_h3]:font-medium [&_h3]:[margin:18px_0_7px] [&_p]:text-[12px] [&_p]:m-0\">\n <span aria-hidden=\"true\">✳</span>\n <h3>A clean slate.</h3>\n <p>Your first message goes here.</p>\n </div>\n ) : (\n <ul className=\"p-0 m-0 [list-style:none]\">\n {data?.map((message) => (\n <li\n className=\"[border-bottom:1px_solid_#e8e8e2] flex gap-3.75 items-start py-[21px] px-[2px]\"\n key={message.id}\n >\n <span className=\"message-icon text-[#80917e]\" aria-hidden=\"true\">\n ↗\n </span>\n <p>{message.subject}</p>\n </li>\n ))}\n </ul>\n )}\n </section>\n <footer className=\"flex justify-between text-[#a1a197] text-[11px] py-[30px] px-0 mt-10\">\n Live inbox <span>Made with Executor</span>\n </footer>\n </main>\n );\n}\n\nconst root = document.getElementById(\"root\");\nif (root === null) throw new Error(\"Missing app root\");\ncreateRoot(root).render(\n <StrictMode>\n <Inbox />\n </StrictMode>,\n);\n"},{"path":"ui/index.html","content":"<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>Live inbox</title>\n <script type=\"module\" src=\"./main.tsx\"></script>\n </head>\n <body>\n <div id=\"root\"></div>\n </body>\n</html>\n"},{"path":"ui/style.css","content":"/* Includes Preflight so copied controls do not retain browser default styles. */\n@import \"tailwindcss\";\n\n@layer base {\n :root {\n font-family:\n Inter,\n ui-sans-serif,\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n sans-serif;\n color: #232321;\n background: #fafaf8;\n font-synthesis: none;\n }\n * {\n box-sizing: border-box;\n }\n body {\n margin: 0;\n }\n button {\n font: inherit;\n }\n input {\n font: inherit;\n }\n}\n"},{"path":"package.json","content":"{\n \"name\": \"@executor-js/app-live-inbox\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"apps\": \"0.0.1-beta.34\",\n \"react\": \"^19.2.0\",\n \"react-dom\": \"^19.2.0\"\n }\n}\n"}]}]}
|