apps 0.0.1-beta.7 → 0.0.1-beta.8
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.0.1-beta.7","digest":"d34d26e76c118dfdc1ffc7ae75aac1e1217f6087913ab6f9bed70316de201509","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<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 /** Invocation-owned HTTP requests with trace propagation and host cancellation. */\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.","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}","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","apps.Schema","Schema"],"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":["apps.Schema","Schema"],"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":["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","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.Schema","apps/operations/approval.ApprovalDecision","Schema"],"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.Schema","apps.SecretsMethod","Schema"],"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.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.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.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","apps.Schema","Schema"],"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","apps.Schema","Schema"],"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","apps.Schema","Schema"],"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":["apps.Schema","Schema"],"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.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.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.","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.OAuth2Config","kind":"type","summary":"OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain\nhost-owned. Declared endpoints may name an RFC 7009 `revocationUrl`; discovery reads the\nserver's `revocation_endpoint` metadata instead.","signatures":[],"definition":"OAuth2Config = Schema.Union([\n Schema.Struct({\n ...oauthOptions,\n discover: HttpUrl,\n authorizationUrl: Schema.optionalKey(Schema.Never),\n tokenUrl: Schema.optionalKey(Schema.Never),\n revocationUrl: Schema.optionalKey(Schema.Never),\n scopes: Schema.optionalKey(Schema.Array(Schema.String)),\n }),\n Schema.Struct({\n ...oauthOptions,\n authorizationUrl: HttpUrl,\n tokenUrl: HttpUrl,\n revocationUrl: Schema.optionalKey(HttpUrl),\n scopes: Schema.Array(Schema.String),\n /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */\n issuer: Schema.optionalKey(HttpUrl),\n discover: Schema.optionalKey(Schema.Never),\n }),\n Schema.Struct({\n grant: Schema.Literal(\"client_credentials\"),\n discover: HttpUrl,\n authorizationUrl: Schema.optionalKey(Schema.Never),\n tokenUrl: Schema.optionalKey(Schema.Never),\n revocationUrl: Schema.optionalKey(Schema.Never),\n scopes: Schema.optionalKey(Schema.Array(Schema.String)),\n tokenEndpointAuthMethod: OAuthSecretClientAuth,\n resource: Schema.optionalKey(Schema.NullOr(HttpUrl)),\n }),\n Schema.Struct({\n grant: Schema.Literal(\"client_credentials\"),\n tokenUrl: HttpUrl,\n revocationUrl: Schema.optionalKey(HttpUrl),\n scopes: Schema.Array(Schema.String),\n tokenEndpointAuthMethod: OAuthSecretClientAuth,\n resource: Schema.optionalKey(Schema.NullOr(HttpUrl)),\n authorizationUrl: Schema.optionalKey(Schema.Never),\n discover: Schema.optionalKey(Schema.Never),\n }),\n])","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.Schema","Schema"],"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<Infer<Response>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Infer","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","apps.Schema","Schema"],"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.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 /** 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.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.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":["apps.Schema","Schema"],"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":["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<Infer<Shape>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Fields","apps.Infer","apps.ObjectSchema"],"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.Schema","apps.SkillFile","apps/skills.SkillFile","Schema"],"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.Schema","apps/skills.SkillFile","Schema"],"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.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.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.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":["apps.Schema","Schema"],"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.Schema","apps.WorkflowDuration","Schema"],"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.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<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.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":"","signatures":[],"definition":"export interface GraphqlCatalogOptions extends GraphqlToolsOptions, CatalogCacheOptions {}","tags":[],"docs":"integrations.md","source":"apps/src/implementation/graphql-catalog.ts","related":["apps/graphql.GraphqlToolsOptions"],"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":["apps.Schema","Schema"],"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":"Metadata policy for HTTP/SSE sources. A missing cache keeps discovery invocation-local.","signatures":[],"definition":"export interface McpCatalogOptions extends McpToolsOptions, CatalogCacheOptions {}","tags":[],"docs":"integrations.md","source":"apps/src/implementation/mcp-catalog.ts","related":["apps/mcp.McpToolsOptions"],"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. Protocol/transport failures use the Effect error channel.","signatures":[],"definition":"McpToolResult = Schema.Struct({\n content: Schema.Array(JsonObject),\n structuredContent: Schema.optional(JsonObject),\n isError: Schema.optional(Schema.Boolean),\n _meta: Schema.optional(JsonObject),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.JsonObject","apps.Schema","Schema"],"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":["apps.Schema","Schema"],"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.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":["apps.Schema","Schema"],"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":["apps.Schema","Schema"],"examples":[]},{"symbol":"apps/openapi.isOpenapiTextMedia","kind":"function","summary":"Media returned as text rather than a base64 file. NDJSON remains an unparsed text result.","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.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","apps.Schema","Schema"],"examples":[]},{"symbol":"apps/openapi.openapiMediaKind","kind":"function","summary":"Classify request media for JSON-safe tool arguments; Swagger owns wire serialization.","signatures":["(type: string): \"form\" | \"binary\" | \"json\" | \"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\"]),\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.Schema","apps/openapi.OpenapiErrorResponse","apps/openapi.OpenapiParameter","Schema"],"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 in: Schema.Literals([\"path\", \"query\", \"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","apps.Schema","Schema"],"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.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 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.Schema","apps/openapi.CredentialBinding","apps/openapi.OpenapiOperation","Schema"],"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","apps.Schema","Schema"],"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 name: string; readonly description: 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 name: string; readonly description: 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 name: string; readonly description: 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.Schema","apps.SkillFile","apps/skills.SkillFile","Schema"],"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.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.Schema","apps.SkillFile","Schema"],"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.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 name: string; readonly description: 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 * 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 return new ManyAccounts({ provider: this });\n }\n}","tags":[],"docs":"accounts.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods"],"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":["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"],"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.7\",\n \"react\": \"^19.2.0\",\n \"react-dom\": \"^19.2.0\"\n }\n}\n"}]}]}
|
|
1
|
+
{"version":"0.0.1-beta.8","digest":"4d3cb6fd2b5429c2048f464bf83fb81dc0693ee0cd7614e232059157d49a5ba6","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<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 /** Invocation-owned HTTP requests with trace propagation and host cancellation. */\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.","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}","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","apps.Schema","Schema"],"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":["apps.Schema","Schema"],"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":["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","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.Schema","apps/operations/approval.ApprovalDecision","Schema"],"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.Schema","apps.SecretsMethod","Schema"],"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.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.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.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","apps.Schema","Schema"],"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","apps.Schema","Schema"],"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","apps.Schema","Schema"],"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":["apps.Schema","Schema"],"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.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.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.","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.OAuth2Config","kind":"type","summary":"OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain\nhost-owned. Declared endpoints may name an RFC 7009 `revocationUrl`; discovery reads the\nserver's `revocation_endpoint` metadata instead.","signatures":[],"definition":"OAuth2Config = Schema.Union([\n Schema.Struct({\n ...oauthOptions,\n discover: HttpUrl,\n authorizationUrl: Schema.optionalKey(Schema.Never),\n tokenUrl: Schema.optionalKey(Schema.Never),\n revocationUrl: Schema.optionalKey(Schema.Never),\n scopes: Schema.optionalKey(Schema.Array(Schema.String)),\n }),\n Schema.Struct({\n ...oauthOptions,\n authorizationUrl: HttpUrl,\n tokenUrl: HttpUrl,\n revocationUrl: Schema.optionalKey(HttpUrl),\n scopes: Schema.Array(Schema.String),\n /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */\n issuer: Schema.optionalKey(HttpUrl),\n discover: Schema.optionalKey(Schema.Never),\n }),\n Schema.Struct({\n grant: Schema.Literal(\"client_credentials\"),\n discover: HttpUrl,\n authorizationUrl: Schema.optionalKey(Schema.Never),\n tokenUrl: Schema.optionalKey(Schema.Never),\n revocationUrl: Schema.optionalKey(Schema.Never),\n scopes: Schema.optionalKey(Schema.Array(Schema.String)),\n tokenEndpointAuthMethod: OAuthSecretClientAuth,\n resource: Schema.optionalKey(Schema.NullOr(HttpUrl)),\n }),\n Schema.Struct({\n grant: Schema.Literal(\"client_credentials\"),\n tokenUrl: HttpUrl,\n revocationUrl: Schema.optionalKey(HttpUrl),\n scopes: Schema.Array(Schema.String),\n tokenEndpointAuthMethod: OAuthSecretClientAuth,\n resource: Schema.optionalKey(Schema.NullOr(HttpUrl)),\n authorizationUrl: Schema.optionalKey(Schema.Never),\n discover: Schema.optionalKey(Schema.Never),\n }),\n])","tags":[],"docs":"tools.md","source":"apps/src/contracts/provider.ts","related":["apps.Schema","Schema"],"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<Infer<Response>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Infer","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","apps.Schema","Schema"],"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.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 /** 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.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.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":["apps.Schema","Schema"],"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":["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<Infer<Shape>>\n>;","tags":[],"docs":"tools.md","source":"apps/src/index.ts","related":["apps.Fields","apps.Infer","apps.ObjectSchema"],"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.Schema","apps.SkillFile","apps/skills.SkillFile","Schema"],"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.Schema","apps/skills.SkillFile","Schema"],"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.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.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.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":["apps.Schema","Schema"],"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.Schema","apps.WorkflowDuration","Schema"],"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.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<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.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":"","signatures":[],"definition":"export interface GraphqlCatalogOptions extends GraphqlToolsOptions, CatalogCacheOptions {}","tags":[],"docs":"integrations.md","source":"apps/src/implementation/graphql-catalog.ts","related":["apps/graphql.GraphqlToolsOptions"],"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":["apps.Schema","Schema"],"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":"Metadata policy for HTTP/SSE sources. A missing cache keeps discovery invocation-local.","signatures":[],"definition":"export interface McpCatalogOptions extends McpToolsOptions, CatalogCacheOptions {}","tags":[],"docs":"integrations.md","source":"apps/src/implementation/mcp-catalog.ts","related":["apps/mcp.McpToolsOptions"],"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. Protocol/transport failures use the Effect error channel.","signatures":[],"definition":"McpToolResult = Schema.Struct({\n content: Schema.Array(JsonObject),\n structuredContent: Schema.optional(JsonObject),\n isError: Schema.optional(Schema.Boolean),\n _meta: Schema.optional(JsonObject),\n})","tags":[],"docs":"integrations.md","source":"apps/src/contracts/mcp.ts","related":["apps.JsonObject","apps.Schema","Schema"],"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":["apps.Schema","Schema"],"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.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":["apps.Schema","Schema"],"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":["apps.Schema","Schema"],"examples":[]},{"symbol":"apps/openapi.isOpenapiTextMedia","kind":"function","summary":"Media returned as text rather than a base64 file. NDJSON remains an unparsed text result.","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.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","apps.Schema","Schema"],"examples":[]},{"symbol":"apps/openapi.openapiMediaKind","kind":"function","summary":"Classify request media for JSON-safe tool arguments; Swagger owns wire serialization.","signatures":["(type: string): \"form\" | \"binary\" | \"json\" | \"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\"]),\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.Schema","apps/openapi.OpenapiErrorResponse","apps/openapi.OpenapiParameter","Schema"],"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 in: Schema.Literals([\"path\", \"query\", \"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","apps.Schema","Schema"],"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.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 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.Schema","apps/openapi.CredentialBinding","apps/openapi.OpenapiOperation","Schema"],"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","apps.Schema","Schema"],"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 name: string; readonly description: 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 name: string; readonly description: 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 name: string; readonly description: 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.Schema","apps.SkillFile","apps/skills.SkillFile","Schema"],"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.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.Schema","apps.SkillFile","Schema"],"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.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 name: string; readonly description: 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 * 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 return new ManyAccounts({ provider: this });\n }\n}","tags":[],"docs":"accounts.md","source":"apps/src/contracts/provider.ts","related":["apps.AuthMethods"],"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":["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"],"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.8\",\n \"react\": \"^19.2.0\",\n \"react-dom\": \"^19.2.0\"\n }\n}\n"}]}]}
|