@diagonal-hq/cli 0.42.5 → 0.42.6
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/dist/{cli-check-data-VZ52XV3R.mjs → cli-check-data-V6YHHRMU.mjs} +2 -2
- package/dist/cli-chunk-YSDTJ57P.mjs +87 -0
- package/dist/{cli-sdk-files.generated-CETMBWOK.mjs → cli-sdk-files.generated-KZHKLP6A.mjs} +3 -3
- package/dist/{cli-workflows-XIIQQSDG.mjs → cli-workflows-ZDUTSUQP.mjs} +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/script-sdk.json +1 -1
- package/dist/workflow/generated/capabilities.d.ts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/input.d.ts +20 -0
- package/package.json +4 -4
- package/dist/cli-chunk-3SNILJKW.mjs +0 -87
package/dist/script-sdk.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"files":{"/sdk/console.ts":"// The sandbox provides console, and the ES2023 lib does not declare it. These declarations merge\n// with the DOM and Node declarations when the SDK is used outside the sandbox.\ndeclare global {\n interface Console {\n log(...values: unknown[]): void;\n info(...values: unknown[]): void;\n warn(...values: unknown[]): void;\n error(...values: unknown[]): void;\n }\n\n var console: Console;\n}\n\nexport {};\n","/sdk/data.ts":"import {\n data as generatedData,\n type DataCountInput,\n type DataCreateInput,\n type DataCreateManyInput,\n type DataDeleteInput,\n type DataDeleteManyInput,\n type DataDeleteManyOutput,\n type DataFindInput,\n type DataFindOrCreateInput,\n type DataRestoreInput,\n type DataSearchInput,\n type DataSearchOutput,\n type DataUpdateInput,\n type DataUpdateOrCreateInput\n} from './generated/capabilities';\nimport type { WorkspaceResources } from './index';\nimport { invoke } from './transport';\n\ntype Entry = WorkspaceResources[keyof WorkspaceResources];\nexport type ResourceKey = [keyof WorkspaceResources] extends [never]\n ? string\n : Entry extends { id: infer I }\n ? I\n : never;\n/** The id of each entry of `E` that has every capability in `C`. */\ntype IdWithCapabilities<E, C extends string> = E extends {\n id: infer I;\n capabilities: infer Declared;\n}\n ? [C] extends [Declared]\n ? I\n : never\n : never;\n/**\n * The ids of the resources that have every capability in `C`. Any string while the workspace\n * declares no resources.\n */\nexport type ResourceKeyWith<C extends string> = [keyof WorkspaceResources] extends [never]\n ? string\n : IdWithCapabilities<Entry, C>;\ntype EntryFor<R> = Extract<Entry, { id: R }>;\nexport type InputOf<R> = [EntryFor<R>] extends [never]\n ? Record<string, unknown>\n : EntryFor<R> extends { input: infer I }\n ? I\n : never;\nexport type RecordOf<R> = [EntryFor<R>] extends [never]\n ? { id: string } & Record<string, unknown>\n : EntryFor<R> extends { record: infer T }\n ? T\n : never;\n\n/** The declared keys of `T`. `keyof` on a type with an index signature returns only `string | number`. */\ntype DeclaredKey<T> = keyof {\n [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];\n};\n\n/**\n * `DataSearchOutput` with `data` narrowed to the resource's record shape and `cursor` narrowed to\n * the cursor text. `pagination` stays as generated.\n */\ntype SearchOutput<R> = Pick<\n DataSearchOutput,\n Exclude<DeclaredKey<DataSearchOutput>, 'data' | 'cursor'>\n> & {\n data?: Array<RecordOf<R>>;\n /** With `paging: 'cursor'`, the `after` value for the next page. Null when no records are left. */\n cursor?: string | null;\n [key: string]: unknown;\n};\n\ntype EachInput<R> = Omit<DataSearchInput, 'resource' | 'page' | 'pageSize' | 'paging' | 'after'> & {\n resource: R;\n /** Stop after this many records. Leave it out to visit every match. */\n maxRecords?: number;\n};\n\n/** The page size of `data.each`. It is the largest page that `data.search` accepts. */\nconst EACH_PAGE_SIZE = 100;\n\n/**\n * Visit every record that the search matches, one record at a time. Use it in place of a loop\n * over `data.search` pages: it calls `data.search` with cursor paging and pages of 100 records. The\n * query is copied when `each` is called, so a change to the input object during the walk does\n * not change the pages.\n *\n * Each page continues after the last record of the page before it. A record that the loop body\n * updates so that it no longer matches, or deletes, does not move a later page. A body that\n * changes the value of a `sort` field can move a visited record after the cursor, and the walk\n * then visits it again. Sort on a field that the body does not change, or leave `sort` empty.\n */\nfunction each<R extends ResourceKey>(\n input: EachInput<R>\n): AsyncGenerator<RecordOf<R>, void, undefined> {\n const { maxRecords, ...search } = input;\n\n if (maxRecords !== undefined && (!Number.isInteger(maxRecords) || maxRecords < 1)) {\n throw new RangeError(`maxRecords must be a positive integer. Received ${maxRecords}.`);\n }\n\n const query: Omit<EachInput<R>, 'maxRecords'> = JSON.parse(JSON.stringify(search));\n\n return walk(query, maxRecords ?? Number.POSITIVE_INFINITY);\n}\n\nasync function* walk<R extends ResourceKey>(\n query: Omit<EachInput<R>, 'maxRecords'>,\n maxRecords: number\n): AsyncGenerator<RecordOf<R>, void, undefined> {\n let remaining = maxRecords;\n let after: string | null = null;\n\n while (remaining > 0) {\n const page: SearchOutput<R> = await invoke<SearchOutput<R>>('data.search', {\n ...query,\n paging: 'cursor',\n pageSize: Math.min(EACH_PAGE_SIZE, remaining),\n ...(after === null ? {} : { after })\n });\n\n for (const record of page.data ?? []) {\n yield record;\n remaining--;\n\n if (remaining === 0) {\n return;\n }\n }\n\n if (typeof page.cursor !== 'string') {\n return;\n }\n\n after = page.cursor;\n }\n}\n\n// Each call names its return type. Declaration emit otherwise writes the inferred type, and with\n// no workspace resources that resolves RecordOf<R> to the open record, so a workspace that\n// augments WorkspaceResources would still get untyped records from the published package.\nexport const data = {\n ...generatedData,\n create: <R extends ResourceKey>(\n input: Omit<DataCreateInput, 'resource' | 'data'> & { resource: R; data: InputOf<R> }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.create', input),\n find: <R extends ResourceKey>(\n input: Omit<DataFindInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.find', input),\n update: <R extends ResourceKey>(\n input: Omit<DataUpdateInput, 'resource' | 'data'> & { resource: R; data: InputOf<R> }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.update', input),\n /**\n * One page of the records that the search matches: 50 records by default, and at most 100 with\n * `pageSize`. To read every match, use `data.each`, which requests the pages for you.\n */\n search: <R extends ResourceKey>(\n input: Omit<DataSearchInput, 'resource'> & { resource: R }\n ): Promise<SearchOutput<R>> => invoke<SearchOutput<R>>('data.search', input),\n each,\n delete: <R extends ResourceKey>(\n input: Omit<DataDeleteInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.delete', input),\n restore: <R extends ResourceKey>(\n input: Omit<DataRestoreInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.restore', input),\n count: <R extends ResourceKey>(\n input: Omit<DataCountInput, 'resource'> & { resource: R }\n ): Promise<number> => invoke<number>('data.count', input),\n findOrCreate: <R extends ResourceKey>(\n input: Omit<DataFindOrCreateInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.find-or-create', input),\n updateOrCreate: <R extends ResourceKey>(\n input: Omit<DataUpdateOrCreateInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.update-or-create', input),\n /** Create all of `records` in one call. The call has no limit on the number of records. */\n createMany: <R extends ResourceKey>(\n input: Omit<DataCreateManyInput, 'resource' | 'records'> & {\n resource: R;\n records: Array<InputOf<R>>;\n }\n ): Promise<Array<RecordOf<R>>> => invoke<Array<RecordOf<R>>>('data.create-many', input),\n deleteMany: <R extends ResourceKey>(\n input: Omit<DataDeleteManyInput, 'resource'> & { resource: R }\n ): Promise<DataDeleteManyOutput> => invoke<DataDeleteManyOutput>('data.delete-many', input)\n};\n","/sdk/errors.ts":"/**\n * The failure that a graph step records when its task throws, which the step's error edge reads.\n * A task failure has `type`, `message`, and `status_code`. An unexpected exception also has\n * `original_type`, a validation failure has `errors`, and a refused input has `invalid_input`.\n * A declared error is keyed by its type, and a failed child workflow gives its own failure.\n */\nexport type HostFailure = {\n type?: string;\n message?: string;\n original_type?: string;\n status_code?: number;\n errors?: Record<string, string[]>;\n invalid_input?: unknown;\n [key: string]: unknown;\n};\n\nexport class HostError extends Error {\n /**\n * @param failureId The host's ID for the failure of the call. When the error ends the run, the\n * host records that failure, so a run records the failure of the call that it rethrows.\n * @param failure The failure that a graph step records for the same error, or null for a\n * refusal that only a script call can receive, such as an unknown capability.\n * @param options `cause` is the error of a `transaction()` body that a `transaction_rollback`\n * error replaces.\n */\n constructor(\n message: string,\n readonly code: string,\n readonly status: number,\n readonly details: unknown,\n readonly failureId: number | null = null,\n readonly failure: HostFailure | null = null,\n options: ErrorOptions = {}\n ) {\n super(message, options);\n this.name = 'HostError';\n }\n}\n\nexport class WorkflowFailure extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly details: unknown = null\n ) {\n super(message);\n this.name = 'WorkflowFailure';\n }\n}\n\nexport function fail(message: string, options: { status?: number; details?: unknown } = {}): never {\n throw new WorkflowFailure(message, options.status ?? 400, options.details ?? null);\n}\n\nexport function validationError(\n errors: Record<string, string[]>,\n options: { message?: string } = {}\n): never {\n throw new WorkflowFailure(options.message ?? 'The given data was invalid.', 422, { errors });\n}\n","/sdk/generated/capabilities.ts":"// AUTO-GENERATED by `php artisan workflows:script-sdk:build`. Do not edit by hand.\nimport type { ResourceKeyWith } from '../data';\nimport type { ContentDocument } from '../input';\nimport type { DeepReadonly, Liquid, StaticLiquid } from '../liquid';\nimport { invoke } from '../transport';\n\nexport const SDK_VERSION = 82;\n\nexport interface WorkspaceSystemFields {\n \"ai_custom_system_prompt\": string | null;\n \"brand_kit\": { \"colors\"?: { \"light\"?: { \"--background\"?: string; \"--foreground\"?: string; \"--card\"?: string; \"--card-foreground\"?: string; \"--popover\"?: string; \"--popover-foreground\"?: string; \"--primary\"?: string; \"--primary-foreground\"?: string; \"--secondary\"?: string; \"--secondary-foreground\"?: string; \"--muted\"?: string; \"--muted-foreground\"?: string; \"--accent\"?: string; \"--accent-foreground\"?: string; \"--destructive\"?: string; \"--destructive-foreground\"?: string; \"--success\"?: string; \"--success-foreground\"?: string; \"--warning\"?: string; \"--warning-foreground\"?: string; \"--informative\"?: string; \"--informative-foreground\"?: string; \"--border\"?: string; \"--input\"?: string; \"--ring\"?: string; \"--chart-1\"?: string; \"--chart-2\"?: string; \"--chart-3\"?: string; \"--chart-4\"?: string; \"--chart-5\"?: string; \"--sidebar\"?: string; \"--sidebar-foreground\"?: string; \"--sidebar-primary\"?: string; \"--sidebar-primary-foreground\"?: string; \"--sidebar-accent\"?: string; \"--sidebar-accent-foreground\"?: string; \"--sidebar-border\"?: string; \"--sidebar-ring\"?: string } | null; \"dark\"?: { \"--background\"?: string; \"--foreground\"?: string; \"--card\"?: string; \"--card-foreground\"?: string; \"--popover\"?: string; \"--popover-foreground\"?: string; \"--primary\"?: string; \"--primary-foreground\"?: string; \"--secondary\"?: string; \"--secondary-foreground\"?: string; \"--muted\"?: string; \"--muted-foreground\"?: string; \"--accent\"?: string; \"--accent-foreground\"?: string; \"--destructive\"?: string; \"--destructive-foreground\"?: string; \"--success\"?: string; \"--success-foreground\"?: string; \"--warning\"?: string; \"--warning-foreground\"?: string; \"--informative\"?: string; \"--informative-foreground\"?: string; \"--border\"?: string; \"--input\"?: string; \"--ring\"?: string; \"--chart-1\"?: string; \"--chart-2\"?: string; \"--chart-3\"?: string; \"--chart-4\"?: string; \"--chart-5\"?: string; \"--sidebar\"?: string; \"--sidebar-foreground\"?: string; \"--sidebar-primary\"?: string; \"--sidebar-primary-foreground\"?: string; \"--sidebar-accent\"?: string; \"--sidebar-accent-foreground\"?: string; \"--sidebar-border\"?: string; \"--sidebar-ring\"?: string } | null } | null; \"typography\"?: { \"--font-sans\"?: string | null; \"--font-serif\"?: string | null; \"--font-mono\"?: string | null; \"--radius\"?: \"0rem\" | \"0.125rem\" | \"0.25rem\" | \"0.375rem\" | \"0.5rem\" | \"0.75rem\" } | null; \"shadows\"?: { \"light\"?: { \"--shadow-2xs\"?: \"none\" | \"0px 1px 1px 0px hsl(0 0% 0% \\/ 0.04)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-xs\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.05)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 2px 4px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-sm\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 1px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 3px 0px hsl(0 0% 0% \\/ 0.25), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-md\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-lg\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 10px 15px -3px hsl(0 0% 0% \\/ 0.25), 0px 4px 6px -4px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 20px 25px -5px hsl(0 0% 0% \\/ 0.25), 0px 8px 10px -6px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-2xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.45)\" | \"0px 25px 50px -12px hsl(0 0% 0% \\/ 0.5)\" } | null; \"dark\"?: { \"--shadow-2xs\"?: \"none\" | \"0px 1px 1px 0px hsl(0 0% 0% \\/ 0.04)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-xs\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.05)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 2px 4px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-sm\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 1px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 3px 0px hsl(0 0% 0% \\/ 0.25), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-md\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-lg\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 10px 15px -3px hsl(0 0% 0% \\/ 0.25), 0px 4px 6px -4px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 20px 25px -5px hsl(0 0% 0% \\/ 0.25), 0px 8px 10px -6px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-2xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.45)\" | \"0px 25px 50px -12px hsl(0 0% 0% \\/ 0.5)\" } | null } | null; \"logos\"?: { \"horizontal\"?: { \"dark\"?: string; \"light\"?: string } | null; \"icon\"?: { \"dark\"?: string; \"light\"?: string } | null; \"wordmark\"?: { \"dark\"?: string; \"light\"?: string } | null } | null; \"favicon\"?: { \"dark\"?: string; \"light\"?: string } | null; \"seo\"?: { \"title\"?: string | null; \"description\"?: string | null; \"og_image\"?: string } | null; \"design_profile\"?: string | null } | null;\n \"custom_401_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_403_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_404_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_422_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_500_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"default_currency\": \"aed\" | \"ars\" | \"aud\" | \"brl\" | \"cad\" | \"chf\" | \"clp\" | \"cny\" | \"cop\" | \"czk\" | \"dkk\" | \"eur\" | \"gbp\" | \"hkd\" | \"idr\" | \"ils\" | \"inr\" | \"jpy\" | \"krw\" | \"mxn\" | \"myr\" | \"nok\" | \"nzd\" | \"pen\" | \"php\" | \"pln\" | \"sar\" | \"sek\" | \"sgd\" | \"thb\" | \"twd\" | \"usd\" | \"zar\" | null;\n \"default_timezone\": string | null;\n \"fathom_site_id\": string | null;\n \"head_html\": string | null;\n \"name\": string | null;\n \"sidebar_icon\": string | null;\n \"sidebar_icon_color\": string | null;\n \"slug\": string | null;\n \"website\": string | null;\n}\n\nexport interface AiDecideInput {\n state: unknown;\n questions: Array<{ key?: string; type?: \"choice\" | \"noul\" | \"score\"; instructions?: unknown; criteria?: Array<{ name?: string; description?: string; [key: string]: unknown; }>; [key: string]: unknown; }>;\n}\nexport type AiDecideOutput = Record<string, unknown>;\n\nexport interface AiRunPromptInput {\n prompt: unknown;\n attachments?: Array<string> | null;\n modelPreset?: \"auto\" | \"fast\" | \"balanced\" | \"smart\" | null;\n outputSchema?: unknown;\n strict?: boolean | null;\n}\nexport type AiRunPromptOutput = string;\n\nexport interface AuthImpersonateInput {\n resource: ResourceKeyWith<\"authenticatable\">;\n record: string;\n}\nexport type AuthImpersonateOutput = { success?: boolean; redirect_url?: unknown; error?: unknown; [key: string]: unknown; };\n\nexport interface AuthLoginInput {\n resource: ResourceKeyWith<\"authenticatable\">;\n record: string;\n}\nexport type AuthLoginOutput = boolean;\n\nexport interface CalendarGenerateLinkInput {\n type: \"apple\" | \"google\" | \"outlook\";\n resource: ResourceKeyWith<\"eventable\">;\n record: string;\n}\nexport type CalendarGenerateLinkOutput = unknown;\n\nexport interface CalendarSearchEventsInput {\n resource: ResourceKeyWith<\"eventable\">;\n from: string;\n to: string;\n filters?: unknown;\n relations?: Array<string>;\n}\nexport type CalendarSearchEventsOutput = { data?: Array<Record<string, unknown>>; [key: string]: unknown; };\n\nexport interface CallbackGetInput {\n key: string;\n default?: unknown;\n}\nexport type CallbackGetOutput = unknown;\n\nexport interface CallbackRemoveInput {\n key: string;\n}\nexport type CallbackRemoveOutput = string;\n\nexport interface CallbackSetInput {\n key?: string;\n value?: unknown;\n}\nexport type CallbackSetOutput = unknown;\n\nexport interface ChartDistributionInput {\n resource: string;\n categoryField: string;\n valueField?: string | null;\n filters?: unknown;\n /**\n * Maximum number of categories to show.\n * From 1 to 50.\n * @minimum 1\n * @maximum 50\n */\n limit?: number | null;\n}\nexport type ChartDistributionOutput = Array<{ category?: string; count?: number; total?: number; [key: string]: unknown; }>;\n\nexport interface ChartKpiInput {\n resource: string;\n metrics?: Array<{ name?: string; operation?: \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\" | \"distinct\"; field?: string; [key: string]: unknown; }>;\n filters?: unknown;\n}\nexport type ChartKpiOutput = Record<string, unknown>;\n\nexport interface ChartLeaderboardInput {\n resource: string;\n entityField: string;\n operation: \"count\" | \"sum\" | \"avg\";\n valueField?: string | null;\n metricName: string;\n filters?: unknown;\n /**\n * Number of top entries to return.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n limit: number;\n}\nexport type ChartLeaderboardOutput = Array<{ entity?: string; value?: number; count?: number; [key: string]: unknown; }>;\n\nexport interface ChartTimeSeriesInput {\n resource: string;\n dateField: string;\n granularity: \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\";\n metrics?: Array<{ name?: string; operation?: \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\"; field?: string; [key: string]: unknown; }>;\n filters?: unknown;\n /**\n * Maximum number of time periods to return.\n * From 1 to 1000.\n * @minimum 1\n * @maximum 1000\n */\n limit?: number | null;\n}\nexport type ChartTimeSeriesOutput = Array<Record<string, unknown>>;\n\nexport interface DataAggregateMetricsInput {\n resource: string;\n groupBy?: Array<string>;\n dateGranularity?: \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\" | null;\n metrics?: Array<{ name?: string; operation?: \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\" | \"distinct\"; field?: string; [key: string]: unknown; }>;\n filters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n /**\n * Maximum number of groups to return.\n * From 1 to 1000.\n * @minimum 1\n * @maximum 1000\n */\n limit?: number | null;\n}\nexport type DataAggregateMetricsOutput = Array<Record<string, unknown>>;\n\nexport interface DataCountInput {\n resource: string;\n search?: string | null;\n filters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n relations?: Array<string>;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n /**\n * The page number.\n * At least 1.\n * @minimum 1\n */\n page?: number | null;\n /**\n * The number of records per page.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n pageSize?: number | null;\n}\nexport type DataCountOutput = number;\n\nexport interface DataCreateInput {\n resource: string;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataCreateOutput = Record<string, unknown>;\n\nexport interface DataCreateManyInput {\n resource: string;\n records: Array<Record<string, unknown>>;\n}\nexport type DataCreateManyOutput = Array<Record<string, unknown>>;\n\nexport interface DataDeleteInput {\n resource: string;\n record: string;\n confirmSideEffects?: boolean | null;\n operation?: Record<string, unknown> | null;\n}\nexport type DataDeleteOutput = Record<string, unknown>;\n\nexport interface DataDeleteManyInput {\n resource: string;\n filters: unknown;\n}\nexport type DataDeleteManyOutput = { deleted_count?: number; deleted_ids?: Array<string>; [key: string]: unknown; };\n\nexport interface DataFindInput {\n resource: string;\n mode?: \"filters\" | \"record\" | null;\n record?: string | null;\n filters?: unknown;\n requiredFilters?: unknown;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n relations?: Array<string>;\n}\nexport type DataFindOutput = Record<string, unknown>;\n\nexport interface DataFindOrCreateInput {\n resource: string;\n attributes: Record<string, unknown>;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataFindOrCreateOutput = Record<string, unknown>;\n\nexport interface DataRelationAttachInput {\n resource: string;\n record: string;\n relation: string;\n related: string;\n}\nexport type DataRelationAttachOutput = Record<string, unknown>;\n\nexport interface DataRelationAttachManyInput {\n resource: string;\n record: string;\n relation: string;\n relatedIds?: Array<string> | null;\n}\nexport type DataRelationAttachManyOutput = Record<string, unknown>;\n\nexport interface DataRelationDetachInput {\n resource: string;\n record: string;\n relation: string;\n related: string;\n}\nexport type DataRelationDetachOutput = Record<string, unknown>;\n\nexport interface DataRelationDetachManyInput {\n resource: string;\n record: string;\n relation: string;\n relatedIds?: Array<string>;\n}\nexport type DataRelationDetachManyOutput = Record<string, unknown>;\n\nexport interface DataRelationSyncInput {\n resource: string;\n record: string;\n relation: string;\n relatedIds?: Array<string>;\n}\nexport type DataRelationSyncOutput = Record<string, unknown>;\n\nexport interface DataRestoreInput {\n resource: string;\n record: string;\n}\nexport type DataRestoreOutput = Record<string, unknown>;\n\nexport interface DataSearchInput {\n resource: string;\n search?: string | null;\n filters?: unknown;\n requiredFilters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n relations?: Array<string>;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n /**\n * The page number.\n * At least 1.\n * @minimum 1\n */\n page?: number | null;\n /**\n * The number of records per page.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n pageSize?: number | null;\n paging?: \"cursor\" | \"page\" | null;\n after?: string | null;\n}\nexport type DataSearchOutput = { data?: Array<Record<string, unknown>>; pagination?: { total?: unknown; per_page?: unknown; current_page?: unknown; last_page?: unknown; [key: string]: unknown; }; [key: string]: unknown; };\n\nexport interface DataSemanticSearchInput {\n resource: string;\n query: string;\n filters?: unknown;\n /**\n * The maximum number of records to return.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n topK?: number | null;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n}\nexport type DataSemanticSearchOutput = { data?: Array<Record<string, unknown>>; scores?: Record<string, unknown>; [key: string]: unknown; };\n\nexport interface DataSumInput {\n resource: string;\n search?: string | null;\n filters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n relations?: Array<string>;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n /**\n * The page number.\n * At least 1.\n * @minimum 1\n */\n page?: number | null;\n /**\n * The number of records per page.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n pageSize?: number | null;\n field: string;\n}\nexport type DataSumOutput = number;\n\nexport interface DataUpdateInput {\n resource: string;\n mode?: \"filters\" | \"record\" | null;\n record?: string | null;\n filters?: unknown;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataUpdateOutput = Record<string, unknown>;\n\nexport interface DataUpdateOrCreateInput {\n resource: string;\n attributes: Record<string, unknown>;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataUpdateOrCreateOutput = Record<string, unknown>;\n\nexport interface DataValidateInput {\n resource: string;\n data: Record<string, unknown>;\n}\nexport type DataValidateOutput = unknown;\n\nexport interface DateAddInput {\n date: string;\n value: number;\n unit: \"days\" | \"months\" | \"weeks\" | \"years\";\n}\nexport type DateAddOutput = string;\n\nexport interface DateDiffInput {\n start: string;\n end: string;\n unit: \"days\" | \"months\" | \"weeks\" | \"years\";\n}\nexport type DateDiffOutput = number;\n\nexport interface DateEndOfInput {\n date: string;\n unit: \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type DateEndOfOutput = string;\n\nexport interface DateFormatInput {\n date: string;\n format: string;\n}\nexport type DateFormatOutput = string;\n\nexport interface DateStartOfInput {\n date: string;\n unit: \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type DateStartOfOutput = string;\n\nexport interface DateSubtractInput {\n date: string;\n value: number;\n unit: \"days\" | \"months\" | \"weeks\" | \"years\";\n}\nexport type DateSubtractOutput = string;\n\nexport interface FileChangeVisibilityInput {\n file: string;\n visibility: \"private\" | \"public\";\n}\nexport type FileChangeVisibilityOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface FileCreateFromUrlInput {\n url: string;\n}\nexport type FileCreateFromUrlOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface FileCreateMediaLibraryItemInput {\n file: string;\n folderId?: string | null;\n displayName?: string | null;\n}\nexport type FileCreateMediaLibraryItemOutput = { id?: string; workspace_id?: string; file_id?: string; folder_id?: unknown; display_name?: string; file?: { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; }; created_at?: unknown; updated_at?: unknown; [key: string]: unknown; };\n\nexport interface FileCreateQrCodeInput {\n value: string;\n size?: number | null;\n errorCorrection?: \"L\" | \"M\" | \"Q\" | \"H\" | null;\n}\nexport type FileCreateQrCodeOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface GuardValidateInput {\n value?: unknown;\n guard?: Array<string> | Record<string, unknown> | null;\n haltOnFailure?: boolean;\n}\nexport type GuardValidateOutput = boolean;\n\nexport interface HttpRequestInput {\n url: string;\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\" | \"OPTIONS\" | \"HEAD\";\n headers?: Array<{ key?: string; value?: string; [key: string]: unknown; }> | null;\n body?: Record<string, unknown> | null;\n query?: Array<{ key?: string; value?: string; [key: string]: unknown; }> | null;\n}\nexport type HttpRequestOutput = { status?: unknown; headers?: Record<string, unknown>; response?: string; [key: string]: unknown; };\n\nexport interface LifecycleOutputInput {\n record?: unknown;\n}\nexport type LifecycleOutputOutput = Record<string, unknown>;\n\nexport interface MailSearchInput {\n emails?: Array<string> | null;\n resource?: string | null;\n record?: string | null;\n includeCurrentAddresses?: boolean | null;\n emailField?: string | null;\n subjectContains?: string | null;\n fromAddress?: string | null;\n statuses?: Array<\"bounced\" | \"deferred\" | \"delivered\" | \"dropped\" | \"failed\" | \"sending\" | \"sent\" | \"spam_reported\" | \"suppressed\"> | null;\n dateFrom?: string | null;\n dateBefore?: string | null;\n /**\n * Maximum number of emails to return, newest first. Total still counts every match.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n limit?: number | null;\n}\nexport type MailSearchOutput = { total?: number; messages?: Array<{ id?: string; subject?: unknown; status?: \"bounced\" | \"deferred\" | \"delivered\" | \"dropped\" | \"failed\" | \"sending\" | \"sent\" | \"spam_reported\" | \"suppressed\"; recorded_at?: unknown; recipients?: Array<{ address?: string; status?: \"bounced\" | \"deferred\" | \"delivered\" | \"dropped\" | \"failed\" | \"sending\" | \"sent\" | \"spam_reported\" | \"suppressed\"; bounce_type?: \"hard\" | \"soft\"; reason?: unknown; last_event_at?: unknown; [key: string]: unknown; }>; [key: string]: unknown; }>; [key: string]: unknown; };\n\nexport interface MailSendInput {\n to: Array<string>;\n cc?: Array<string> | null;\n bcc?: Array<string> | null;\n replyTo?: Array<string> | null;\n subject: Liquid;\n emailLayout?: string | null;\n /**\n * A value composed from other values fails the compile: the layout can render it as Liquid.\n * @liquidSlots $references\n */\n layoutData?: { content?: Liquid; [key: string]: unknown; };\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type MailSendOutput = { success?: boolean; status_message?: string; recipients?: { to?: Array<string>; cc?: Array<string>; bcc?: Array<string>; reply_to?: Array<string>; [key: string]: unknown; }; subject?: string; content?: string; attachments?: Array<{ id?: string; name?: string; mime?: string; [key: string]: unknown; }>; [key: string]: unknown; };\n\nexport interface MailSendNotificationInput {\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n to: Array<string>;\n cc?: Array<string> | null;\n bcc?: Array<string> | null;\n replyTo?: Array<string> | null;\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type MailSendNotificationOutput = { success?: boolean; status_message?: string; recipients?: { to?: Array<string>; cc?: Array<string>; bcc?: Array<string>; reply_to?: Array<string>; [key: string]: unknown; }; subject?: string; content?: string; attachments?: Array<{ id?: string; name?: string; mime?: string; [key: string]: unknown; }>; [key: string]: unknown; };\n\nexport interface MarkdownFromContentInput {\n value?: unknown;\n}\nexport type MarkdownFromContentOutput = string;\n\nexport interface MarkdownToContentInput {\n value: string;\n}\nexport type MarkdownToContentOutput = ContentDocument;\n\nexport interface MediaLibraryCreateFolderInput {\n name: string;\n parentId?: string | null;\n}\nexport type MediaLibraryCreateFolderOutput = string;\n\nexport interface MediaLibraryDeleteItemInput {\n itemId: string;\n}\nexport type MediaLibraryDeleteItemOutput = string;\n\nexport interface MediaLibraryMoveItemsInput {\n itemIds: Array<string>;\n folderId?: string | null;\n}\nexport type MediaLibraryMoveItemsOutput = Array<string>;\n\nexport interface MediaLibraryUpdateItemInput {\n mediaLibraryItemId: string;\n displayName?: string | null;\n folderId?: string | null;\n}\nexport type MediaLibraryUpdateItemOutput = { id?: string; workspace_id?: string; file_id?: string; folder_id?: unknown; display_name?: string; file?: { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; }; created_at?: unknown; updated_at?: unknown; [key: string]: unknown; };\n\nexport interface MoneyFormatInput {\n value?: { amount: number; currency: string; [key: string]: unknown; } | null;\n}\nexport type MoneyFormatOutput = string;\n\nexport interface NotificationSendInput {\n resource: ResourceKeyWith<\"notifiable\">;\n relations?: Array<string>;\n record: string;\n subject: Liquid;\n emailLayout?: string | null;\n /**\n * A value composed from other values fails the compile: the layout can render it as Liquid.\n * @liquidSlots $references\n */\n layoutData?: { content?: Liquid; [key: string]: unknown; };\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type NotificationSendOutput = boolean;\n\nexport interface NotificationSendBulkNotificationsInput {\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n resource: string;\n filters?: unknown;\n recipient: unknown;\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n idempotencyKey?: string | null;\n}\nexport type NotificationSendBulkNotificationsOutput = { processed_count: number; queued_count: number; failed_count: number; duplicate_count: number; failures?: Array<{ record_id: string; errors?: Record<string, unknown>; [key: string]: unknown; }>; failures_truncated: boolean; [key: string]: unknown; };\n\nexport interface NotificationSendNotificationInput {\n deliveryChannel?: \"email\" | \"sms\" | \"email_and_sms\";\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n idempotencyKey?: string | null;\n recipient: unknown;\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type NotificationSendNotificationOutput = boolean;\n\nexport interface NotificationSetConsentInput {\n resource: ResourceKeyWith<\"notifiable\">;\n record: string;\n sms?: boolean | null;\n email?: boolean | null;\n}\nexport type NotificationSetConsentOutput = { email?: boolean; sms?: boolean; changed_at?: string; [key: string]: unknown; };\n\nexport interface NumberFormatInput {\n value?: number | null;\n decimals?: number;\n}\nexport type NumberFormatOutput = string;\n\nexport interface PackageInstallInputInput {\n package_id: string;\n key: string;\n}\nexport type PackageInstallInputOutput = unknown;\n\nexport interface PageUrlInput {\n page: { id: string; params?: Record<string, unknown>; [key: string]: unknown; };\n}\nexport type PageUrlOutput = unknown;\n\nexport interface PayablesVoidInput {\n reason?: string | null;\n effectiveDate?: string | null;\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n}\nexport type PayablesVoidOutput = { status?: string; [key: string]: unknown; };\n\nexport interface PayablesWriteOffInput {\n lineAllocations?: unknown[] | null;\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n adjustmentResource: ResourceKeyWith<\"payable_adjustment\">;\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n effectiveAt?: string | null;\n description?: string | null;\n}\nexport type PayablesWriteOffOutput = Record<string, unknown>;\n\nexport interface PaymentCreateManualInput {\n resource: ResourceKeyWith<\"payment\">;\n payableRecord: string;\n amount: { amount: number; currency: string; [key: string]: unknown; };\n paidAt?: string | null;\n payerRecord?: string | null;\n notes?: string | null;\n}\nexport type PaymentCreateManualOutput = Record<string, unknown>;\n\nexport interface PaymentsChargeInput {\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n description?: string | null;\n payerRecord?: string | null;\n paymentMethodId?: string | null;\n}\nexport type PaymentsChargeOutput = Record<string, unknown>;\n\nexport interface PaymentsCheckoutInput {\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n successUrl: string;\n cancelUrl?: string | null;\n description?: string | null;\n}\nexport type PaymentsCheckoutOutput = { checkout_url?: string; session_id?: string; [key: string]: unknown; };\n\nexport interface PaymentsConfirmInput {\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n confirmationTokenId?: string | null;\n paymentMethodId?: string | null;\n paymentAttemptId?: string | null;\n expectedTotal: { amount: number; currency: string; [key: string]: unknown; };\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n savePaymentMethod?: boolean | null;\n setPaymentMethodAsDefault?: boolean | null;\n}\nexport type PaymentsConfirmOutput = { payment_intent_id: string; payment_record_id: string; status: string; client_secret?: unknown; [key: string]: unknown; };\n\nexport interface PaymentsRefundInput {\n resource: ResourceKeyWith<\"payment\">;\n record: string;\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n invoiceBalance?: \"credit\" | \"reopen\" | null;\n reason?: string | null;\n}\nexport type PaymentsRefundOutput = Record<string, unknown>;\n\nexport interface PaymentsVoidInput {\n resource: ResourceKeyWith<\"payment\">;\n record: string;\n reason: string;\n}\nexport type PaymentsVoidOutput = Record<string, unknown>;\n\nexport interface PhoneFormatInput {\n phone?: string | null;\n format?: \"e164\" | \"international\" | \"national\" | \"rfc3966\" | null;\n}\nexport type PhoneFormatOutput = string;\n\nexport interface SchedulingBookSlotInput {\n bookingResource: string;\n start: string;\n search: { bookingResource: string; groups: Array<{ mode?: \"all\" | \"any\"; strategy?: \"first_available\" | \"least_booked\" | \"round_robin\"; records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }>; [key: string]: unknown; }>; from: string; to: string; durationMinutes: number; stepMinutes?: number | null; noticeMinutes?: number | null; maxAdvanceDays?: number | null; quantity?: number | null; maxSlots?: number | null; timezone?: string | null; seed?: string | null; } | Record<string, unknown>;\n relations: Array<string>;\n data?: Record<string, unknown> | null;\n}\nexport type SchedulingBookSlotOutput = Record<string, unknown>;\n\nexport interface SchedulingFindSlotsInput {\n bookingResource: string;\n groups: Array<{ mode?: \"all\" | \"any\"; strategy?: \"first_available\" | \"least_booked\" | \"round_robin\"; records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }>; [key: string]: unknown; }>;\n from: string;\n to: string;\n durationMinutes: number;\n stepMinutes?: number | null;\n noticeMinutes?: number | null;\n maxAdvanceDays?: number | null;\n quantity?: number | null;\n maxSlots?: number | null;\n timezone?: string | null;\n seed?: string | null;\n}\nexport type SchedulingFindSlotsOutput = Record<string, unknown>;\n\nexport interface SchemaToJsonSchemaInput {\n schema: unknown;\n}\nexport type SchemaToJsonSchemaOutput = Record<string, unknown>;\n\nexport interface SecurityRandomPasswordInput {\n passwordLength?: number | null;\n}\nexport type SecurityRandomPasswordOutput = string;\n\nexport interface SmsSendNotificationInput {\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n recipient: unknown;\n}\nexport type SmsSendNotificationOutput = Record<string, unknown>;\n\nexport interface SubscriptionsActivateInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsActivateOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsCancelInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n atPeriodEnd?: boolean | null;\n}\nexport type SubscriptionsCancelOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsChangeItemsInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n items: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: \"catalog\" | \"custom\"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }>;\n effective?: \"now\" | \"next_renewal\" | \"period\" | null;\n periodStart?: string | null;\n prorationBehavior?: \"prorate\" | \"none\" | null;\n revisionScope?: \"this_renewal\" | \"this_and_following\" | null;\n confirmedQuote?: string | null;\n reason?: string | null;\n}\nexport type SubscriptionsChangeItemsOutput = { changed?: boolean; invoice?: unknown; preview?: { mode?: string; effective?: string; proration_behavior?: string; changed?: boolean; currency?: string; timezone?: string; effective_date?: string; period_start?: unknown; period_end?: unknown; days_in_period?: unknown; days_remaining?: unknown; items?: Array<{ price_record_id?: string; quantity?: number; pricing?: string; catalog_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; current_unit_price?: unknown; effective_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; charges?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; credits?: Array<{ description?: string; quantity?: number; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; amount?: { amount: number; currency: string; [key: string]: unknown; }; gross_amount?: { amount: number; currency: string; [key: string]: unknown; }; source_invoice_record_id?: string; source_line_record_id?: string; covered_start?: string; covered_end?: string; [key: string]: unknown; }>; applied_to_invoices?: Array<{ invoice_record_id?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; renewal?: unknown; revision?: unknown; schedule?: unknown; replaces_upcoming_items?: boolean; quote?: string; charge_total?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_total?: { amount: number; currency: string; [key: string]: unknown; }; amount_due?: { amount: number; currency: string; [key: string]: unknown; }; net_credit?: { amount: number; currency: string; [key: string]: unknown; }; applied_to_invoices_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_to_balance?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_before?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_after?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; };\n\nexport interface SubscriptionsCreateInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n accountingEntity?: string | null;\n payerRecord: string;\n priceRecordIds?: Array<string> | null;\n items?: Array<{ price_record_id?: string; quantity?: number; [key: string]: unknown; }> | null;\n discounts?: Array<{ calculation_type?: \"fixed_amount\" | \"percentage\"; duration?: \"every_invoice\" | \"first_invoice\" | \"specific_period\"; percent?: number; fixed_amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: string; description?: string; [key: string]: unknown; }> | null;\n confirmedQuote?: string | null;\n requireConfirmedQuote?: boolean | null;\n collectionMethod?: \"charge_automatically\" | \"send_invoice\" | null;\n gracePeriodDays?: number | null;\n billingCycleMode?: \"anniversary\" | \"calendar_aligned\" | null;\n billingAnchorMonth?: number | null;\n billingAnchorDay?: number | null;\n activationPolicy?: \"after_first_payment\" | \"immediate\" | null;\n initialTermAnchor?: \"first_payment_at\" | \"subscription_created_at\" | null;\n initialPaymentWindowDays?: number | null;\n startedAt?: string | null;\n trialDays?: number | null;\n trialEndsAt?: string | null;\n trialPaymentMethodPolicy?: \"optional\" | \"required\" | null;\n lapseBillingBehavior?: \"continue_billing\" | \"suspend_renewals\" | \"cancel\" | null;\n generateInvoice?: boolean | null;\n}\nexport type SubscriptionsCreateOutput = { record?: Record<string, unknown>; invoice?: unknown; invoices?: Array<Record<string, unknown>>; [key: string]: unknown; };\n\nexport interface SubscriptionsGenerateInvoiceInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsGenerateInvoiceOutput = { record?: unknown; created?: boolean; period_start?: string; period_end?: string; renewal_outcome?: \"canceled\" | \"not_due\" | \"processed\" | \"suspended\"; [key: string]: unknown; };\n\nexport interface SubscriptionsPauseInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsPauseOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsPreviewInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n priceRecordIds?: Array<string> | null;\n items?: Array<{ price_record_id?: string; quantity?: number; [key: string]: unknown; }> | null;\n discounts?: Array<{ calculation_type?: \"fixed_amount\" | \"percentage\"; duration?: \"every_invoice\" | \"first_invoice\" | \"specific_period\"; percent?: number; fixed_amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: string; description?: string; [key: string]: unknown; }> | null;\n collectionMethod?: \"charge_automatically\" | \"send_invoice\" | null;\n gracePeriodDays?: number | null;\n billingCycleMode?: \"anniversary\" | \"calendar_aligned\" | null;\n billingAnchorMonth?: number | null;\n billingAnchorDay?: number | null;\n activationPolicy?: \"after_first_payment\" | \"immediate\" | null;\n initialTermAnchor?: \"first_payment_at\" | \"subscription_created_at\" | null;\n initialPaymentWindowDays?: number | null;\n startedAt?: string | null;\n trialDays?: number | null;\n trialEndsAt?: string | null;\n trialPaymentMethodPolicy?: \"optional\" | \"required\" | null;\n lapseBillingBehavior?: \"continue_billing\" | \"suspend_renewals\" | \"cancel\" | null;\n}\nexport type SubscriptionsPreviewOutput = { currency?: string; billing_cycle_mode?: string; interval?: string; timezone?: string; discounts?: unknown; initial?: { lines?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; total?: { amount: number; currency: string; [key: string]: unknown; }; covered_start?: string; covered_end?: string; reference_start?: string; reference_end?: string; days_charged?: number; days_in_period?: number; is_prorated?: boolean; [key: string]: unknown; }; additional_invoices?: Array<{ lines?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; total?: { amount: number; currency: string; [key: string]: unknown; }; covered_start?: string; covered_end?: string; reference_start?: string; reference_end?: string; days_charged?: number; days_in_period?: number; is_prorated?: boolean; [key: string]: unknown; }>; renewal?: { next_renewal_date?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }; trial_ends_at?: unknown; first_paid_invoice?: unknown; quote?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsPreviewChangeInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n items: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: \"catalog\" | \"custom\"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }>;\n effective?: \"now\" | \"next_renewal\" | \"period\" | null;\n periodStart?: string | null;\n prorationBehavior?: \"prorate\" | \"none\" | null;\n revisionScope?: \"this_renewal\" | \"this_and_following\" | null;\n}\nexport type SubscriptionsPreviewChangeOutput = { mode?: string; effective?: string; proration_behavior?: string; changed?: boolean; currency?: string; timezone?: string; effective_date?: string; period_start?: unknown; period_end?: unknown; days_in_period?: unknown; days_remaining?: unknown; items?: Array<{ price_record_id?: string; quantity?: number; pricing?: string; catalog_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; current_unit_price?: unknown; effective_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; charges?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; credits?: Array<{ description?: string; quantity?: number; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; amount?: { amount: number; currency: string; [key: string]: unknown; }; gross_amount?: { amount: number; currency: string; [key: string]: unknown; }; source_invoice_record_id?: string; source_line_record_id?: string; covered_start?: string; covered_end?: string; [key: string]: unknown; }>; applied_to_invoices?: Array<{ invoice_record_id?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; renewal?: unknown; revision?: unknown; schedule?: unknown; replaces_upcoming_items?: boolean; quote?: string; charge_total?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_total?: { amount: number; currency: string; [key: string]: unknown; }; amount_due?: { amount: number; currency: string; [key: string]: unknown; }; net_credit?: { amount: number; currency: string; [key: string]: unknown; }; applied_to_invoices_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_to_balance?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_before?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_after?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; };\n\nexport interface SubscriptionsResumeInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsResumeOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsSetUpcomingItemsInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n desiredPriceRecordIds?: Array<string> | null;\n items?: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: \"catalog\" | \"custom\"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }> | null;\n}\nexport type SubscriptionsSetUpcomingItemsOutput = { period_start?: string; items_added?: number; items_ended?: number; selection_locked?: boolean; [key: string]: unknown; };\n\nexport interface TextGenerateInput {\n length: number;\n includeNumbers?: boolean | null;\n includeSpecial?: boolean | null;\n}\nexport type TextGenerateOutput = string;\n\nexport interface TextHashInput {\n value: string;\n}\nexport type TextHashOutput = string;\n\nexport type TextRandomUuidInput = Record<string, never>;\nexport type TextRandomUuidOutput = string;\n\nexport interface TextToContentInput {\n value: string;\n}\nexport type TextToContentOutput = ContentDocument;\n\nexport interface TimeAddInput {\n date: string;\n value: number;\n unit: \"days\" | \"hours\" | \"minutes\" | \"months\" | \"seconds\" | \"weeks\" | \"years\";\n}\nexport type TimeAddOutput = string;\n\nexport interface TimeDiffInput {\n start: string;\n end: string;\n unit: \"days\" | \"hours\" | \"minutes\" | \"months\" | \"seconds\" | \"weeks\" | \"years\";\n}\nexport type TimeDiffOutput = number;\n\nexport interface TimeEndOfInput {\n date: string;\n unit: \"day\" | \"hour\" | \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type TimeEndOfOutput = string;\n\nexport interface TimeFormatInput {\n date: string;\n format: string;\n timezone?: string | null;\n}\nexport type TimeFormatOutput = string;\n\nexport interface TimeStartOfInput {\n date: string;\n unit: \"day\" | \"hour\" | \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type TimeStartOfOutput = string;\n\nexport interface TimeSubtractInput {\n date: string;\n value: number;\n unit: \"days\" | \"hours\" | \"minutes\" | \"months\" | \"seconds\" | \"weeks\" | \"years\";\n}\nexport type TimeSubtractOutput = string;\n\nexport interface TimezoneFormatInput {\n timezone: string;\n format: \"abbreviation\" | \"city\" | \"full\" | \"offset\";\n}\nexport type TimezoneFormatOutput = string;\n\nexport interface TimezoneInterpretInput {\n value: string;\n timezone: string;\n boundary: \"exact\" | \"start_of_day\" | \"end_of_day\";\n}\nexport type TimezoneInterpretOutput = string;\n\nexport interface TiptapParseInput {\n content?: unknown;\n html?: boolean;\n oneLine?: boolean;\n placeholder?: string;\n}\nexport type TiptapParseOutput = unknown;\n\nexport type TransactionBeginInput = Record<string, never>;\nexport type TransactionBeginOutput = null;\n\nexport type TransactionCommitInput = Record<string, never>;\nexport type TransactionCommitOutput = null;\n\nexport interface TransactionRollbackInput {\n error?: { name?: string; message?: string; code?: string; status?: number; errors?: Record<string, unknown>; failure_id?: number; };\n}\nexport type TransactionRollbackOutput = null | { message: string; code: string; status: number; details: Record<string, unknown>; failure: Record<string, unknown>; failure_id: number; };\n\nexport interface UserAuthorizeInput {\n permission: string;\n user?: Record<string, unknown>;\n}\nexport type UserAuthorizeOutput = boolean;\n\nexport interface WebAgentInput {\n url: string;\n prompt: unknown;\n schema: unknown;\n strict: boolean;\n}\nexport type WebAgentOutput = { url?: string; data?: unknown; [key: string]: unknown; };\n\nexport interface WebBatchScrapeInput {\n urls: Array<string>;\n}\nexport type WebBatchScrapeOutput = Array<{ url?: string; markdown?: unknown; html?: unknown; metadata?: { title?: unknown; description?: unknown; language?: unknown; status_code?: unknown; source_url?: unknown; content_type?: unknown; raw?: unknown; [key: string]: unknown; }; images?: unknown; branding?: unknown; [key: string]: unknown; }>;\n\nexport interface WebCrawlInput {\n url: string;\n limit?: number | null;\n maxDepth?: number | null;\n formats?: unknown[] | null;\n includePaths?: Array<string> | null;\n excludePaths?: Array<string> | null;\n allowSubdomains?: boolean | null;\n}\nexport type WebCrawlOutput = { url?: string; job_id?: string; status?: string; total?: unknown; pages?: unknown; [key: string]: unknown; };\n\nexport interface WebExtractInput {\n urls: Array<string>;\n prompt: unknown;\n schema: unknown;\n strict: boolean;\n}\nexport type WebExtractOutput = { urls?: Array<string>; data?: unknown; [key: string]: unknown; };\n\nexport interface WebGoogleSearchInput {\n query: unknown;\n limit?: number | null;\n}\nexport type WebGoogleSearchOutput = { query?: string; results?: unknown; [key: string]: unknown; };\n\nexport interface WebMapInput {\n url: string;\n search?: unknown;\n limit?: number | null;\n}\nexport type WebMapOutput = { url?: string; links?: unknown; [key: string]: unknown; };\n\nexport interface WebPdfInput {\n url: string;\n format?: \"a3\" | \"a4\" | \"a5\" | \"legal\" | \"letter\" | \"tabloid\" | null;\n landscape?: boolean | null;\n printBackground?: boolean | null;\n scale?: number | null;\n waitMs?: number | null;\n}\nexport type WebPdfOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface WebScrapeInput {\n url: string;\n mode?: \"content\" | \"json\" | null;\n formats?: unknown[] | null;\n onlyMainContent?: boolean | null;\n prompt?: unknown;\n schema?: unknown;\n strict?: boolean | null;\n maxAgeMs?: number | null;\n}\nexport type WebScrapeOutput = { url?: string; markdown?: unknown; html?: unknown; metadata?: { title?: unknown; description?: unknown; language?: unknown; status_code?: unknown; source_url?: unknown; content_type?: unknown; raw?: unknown; [key: string]: unknown; }; images?: unknown; branding?: unknown; [key: string]: unknown; };\n\nexport interface WebScreenshotInput {\n url: string;\n fullPage?: boolean | null;\n width?: number | null;\n height?: number | null;\n waitMs?: number | null;\n imageType?: \"jpeg\" | \"png\" | \"webp\" | null;\n}\nexport type WebScreenshotOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface WebSearchRankedInput {\n query: unknown;\n limit?: number | null;\n}\nexport type WebSearchRankedOutput = { query?: string; results?: unknown; [key: string]: unknown; };\n\nexport interface WorkflowRunInput {\n workflow: string | { id: string; params?: Record<string, unknown>; [key: string]: unknown; };\n input?: Record<string, unknown> | null;\n runAsResource?: ResourceKeyWith<\"authenticatable\"> | null;\n runAsRecord?: string | null;\n executionMode?: \"async\" | \"sync\" | null;\n}\nexport type WorkflowRunOutput = unknown;\n\nexport interface WorkflowUrlInput {\n workflow: { id: string; params?: Record<string, unknown>; [key: string]: unknown; };\n}\nexport type WorkflowUrlOutput = unknown;\n\nexport interface WorkspaceLoginUrlInput {\n resource: string;\n}\nexport type WorkspaceLoginUrlOutput = string;\n\nexport interface WorkspaceSetValueInput {\n key: string;\n value?: unknown;\n}\nexport type WorkspaceSetValueOutput = unknown;\n\nexport interface WorkspaceSetValuesInput {\n values?: Record<string, unknown>;\n}\nexport type WorkspaceSetValuesOutput = Record<string, unknown>;\n\nexport interface WorkspaceValueInput {\n key: string;\n defaultValue?: unknown;\n}\nexport type WorkspaceValueOutput = unknown;\n\nexport type WorkspaceValuesInput = Record<string, never>;\nexport type WorkspaceValuesOutput = Record<string, unknown>;\n\nexport const ai = {\n /** Ask a decisions model typed questions about some content and get labelled answers with their probabilities */\n decide: (input: AiDecideInput): Promise<AiDecideOutput> => invoke('ai.decide', input),\n /** Hand a prompt to the AI assistant, which can look up data and take action in your workspace */\n runPrompt: (input: AiRunPromptInput): Promise<AiRunPromptOutput> => invoke('ai.run_prompt', input),\n};\n\nexport const auth = {\n /** Impersonate an authenticatable user, switching the current session to act as that user */\n impersonate: (input: AuthImpersonateInput): Promise<AuthImpersonateOutput> => invoke('auth.impersonate', input),\n /** Login an authenticatable record */\n login: (input: AuthLoginInput): Promise<AuthLoginOutput> => invoke('auth.login', input),\n};\n\nexport const calendar = {\n /** Generate a shareable calendar link (Google, Apple, Outlook) for an eventable record */\n generateLink: (input: CalendarGenerateLinkInput): Promise<CalendarGenerateLinkOutput> => invoke('calendar.generate_link', input),\n /** Find eventable records occurring in a date window no wider than 3 months, expanding recurring events into one row per occurrence and per calendar the record appears on. Returns every match, so narrow the window or filters on a busy resource */\n searchEvents: (input: CalendarSearchEventsInput): Promise<CalendarSearchEventsOutput> => invoke('calendar.search_events', input),\n};\n\nexport const callback = {\n /** Get a callback value */\n get: (input: CallbackGetInput): Promise<CallbackGetOutput> => invoke('callback.get', input),\n /** Remove a callback value */\n remove: (input: CallbackRemoveInput): Promise<CallbackRemoveOutput> => invoke('callback.remove', input),\n /** Set a callback value */\n set: (input: CallbackSetInput): Promise<CallbackSetOutput> => invoke('callback.set', input),\n};\n\nexport const chart = {\n /** Group data by category for pie or donut charts */\n distribution: (input: ChartDistributionInput): Promise<ChartDistributionOutput> => invoke('chart.distribution', input),\n /** Calculate a single metric value (total revenue, order count, etc.) */\n kpi: (input: ChartKpiInput): Promise<ChartKpiOutput> => invoke('chart.kpi', input),\n /** Rank entities by a metric (top customers, best sellers, etc.) */\n leaderboard: (input: ChartLeaderboardInput): Promise<ChartLeaderboardOutput> => invoke('chart.leaderboard', input),\n /** Aggregate data over time for line or area charts */\n timeSeries: (input: ChartTimeSeriesInput): Promise<ChartTimeSeriesOutput> => invoke('chart.time_series', input),\n};\n\nexport const data = {\n /** Compute grouped metrics (count, sum, avg, etc.) over records */\n aggregateMetrics: (input: DataAggregateMetricsInput): Promise<DataAggregateMetricsOutput> => invoke('data.aggregate_metrics', input),\n /** Count the number of records matching the filters */\n count: (input: DataCountInput): Promise<DataCountOutput> => invoke('data.count', input),\n /** Create a new record */\n create: (input: DataCreateInput): Promise<DataCreateOutput> => invoke('data.create', input),\n /** Create many records at once */\n createMany: (input: DataCreateManyInput): Promise<DataCreateManyOutput> => invoke('data.create-many', input),\n /** Delete a record */\n delete: (input: DataDeleteInput): Promise<DataDeleteOutput> => invoke('data.delete', input),\n /** Delete all records matching filter conditions */\n deleteMany: (input: DataDeleteManyInput): Promise<DataDeleteManyOutput> => invoke('data.delete-many', input),\n /** Find a single record by ID or by filters */\n find: (input: DataFindInput): Promise<DataFindOutput> => invoke('data.find', input),\n /** Find a record by attributes, or create a new one when no match exists */\n findOrCreate: (input: DataFindOrCreateInput): Promise<DataFindOrCreateOutput> => invoke('data.find-or-create', input),\n relation: {\n /** Attach a related record to a relation. Plural relations (BelongsToMany, HasMany) keep their existing records. */\n attach: (input: DataRelationAttachInput): Promise<DataRelationAttachOutput> => invoke('data.relation.attach', input),\n /** Attach related records to a plural relation (BelongsToMany, HasMany) */\n attachMany: (input: DataRelationAttachManyInput): Promise<DataRelationAttachManyOutput> => invoke('data.relation.attach-many', input),\n /** Detach a related record. */\n detach: (input: DataRelationDetachInput): Promise<DataRelationDetachOutput> => invoke('data.relation.detach', input),\n /** Detach related records from a plural relation (BelongsToMany, HasMany) */\n detachMany: (input: DataRelationDetachManyInput): Promise<DataRelationDetachManyOutput> => invoke('data.relation.detach-many', input),\n /** Sync related records for a relation (replaces all existing) */\n sync: (input: DataRelationSyncInput): Promise<DataRelationSyncOutput> => invoke('data.relation.sync', input),\n },\n /** Restore an archived record */\n restore: (input: DataRestoreInput): Promise<DataRestoreOutput> => invoke('data.restore', input),\n /** Search for records */\n search: (input: DataSearchInput): Promise<DataSearchOutput> => invoke('data.search', input),\n /** Search for records by semantic similarity */\n semanticSearch: (input: DataSemanticSearchInput): Promise<DataSemanticSearchOutput> => invoke('data.semantic_search', input),\n /** Sum a numeric field across records matching the filters */\n sum: (input: DataSumInput): Promise<DataSumOutput> => invoke('data.sum', input),\n /** Update an existing record found by ID or by filters */\n update: (input: DataUpdateInput): Promise<DataUpdateOutput> => invoke('data.update', input),\n /** Find a record by attributes and update it, or create a new one */\n updateOrCreate: (input: DataUpdateOrCreateInput): Promise<DataUpdateOrCreateOutput> => invoke('data.update-or-create', input),\n /** Validate a record */\n validate: (input: DataValidateInput): Promise<DataValidateOutput> => invoke('data.validate', input),\n};\n\nexport const date = {\n /** Add N days/weeks/months/years to a date */\n add: (input: DateAddInput): Promise<DateAddOutput> => invoke('date.add', input),\n /** Difference between two dates in a specified unit */\n diff: (input: DateDiffInput): Promise<DateDiffOutput> => invoke('date.diff', input),\n /** Snap a date to the end of a period (week, month, quarter, year) */\n endOf: (input: DateEndOfInput): Promise<DateEndOfOutput> => invoke('date.end_of', input),\n /** Format a date string using ICU date format syntax (e.g., \"yyyy-MM-dd\", \"MMM d, yyyy\"). */\n format: (input: DateFormatInput): Promise<DateFormatOutput> => invoke('date.format', input),\n /** Snap a date to the start of a period (week, month, quarter, year) */\n startOf: (input: DateStartOfInput): Promise<DateStartOfOutput> => invoke('date.start_of', input),\n /** Subtract N days/weeks/months/years from a date */\n subtract: (input: DateSubtractInput): Promise<DateSubtractOutput> => invoke('date.subtract', input),\n};\n\nexport const file = {\n /** Change a file's visibility by moving it between private and public storage */\n changeVisibility: (input: FileChangeVisibilityInput): Promise<FileChangeVisibilityOutput> => invoke('file.change_visibility', input),\n /** Download a file from a public http(s) URL and save it privately in the workspace */\n createFromUrl: (input: FileCreateFromUrlInput): Promise<FileCreateFromUrlOutput> => invoke('file.create_from_url', input),\n /** Create a public library master from an accessible workspace file, preserving external sources. Accepts images, video, audio and PDF by the type detected from bytes. Store other files in a record file field. Returns the library File ID */\n createMediaLibraryItem: (input: FileCreateMediaLibraryItemInput): Promise<FileCreateMediaLibraryItemOutput> => invoke('file.create_media_library_item', input),\n /** Generate a QR code PNG image that encodes a value and save it privately in the workspace */\n createQrCode: (input: FileCreateQrCodeInput): Promise<FileCreateQrCodeOutput> => invoke('file.create_qr_code', input),\n};\n\nexport const guard = {\n /** Perform a validation check */\n validate: (input: GuardValidateInput): Promise<GuardValidateOutput> => invoke('guard.validate', input),\n};\n\nexport const http = {\n /** Send an HTTP request */\n request: (input: HttpRequestInput): Promise<HttpRequestOutput> => invoke('http.request', input),\n};\n\nexport const lifecycle = {\n /** Return modified record fields from a record lifecycle workflow */\n output: (input: LifecycleOutputInput): Promise<LifecycleOutputOutput> => invoke('lifecycle.output', input),\n};\n\nexport const mail = {\n /** Find tracked emails by recipient, linked record, subject, sender, status, or date, newest first, with the delivery status of each recipient, including hard and soft bounces. Searches without a record, or that include the record's current addresses, require a Run As identity with the Manage Notifications permission */\n search: (input: MailSearchInput): Promise<MailSearchOutput> => invoke('mail.search', input),\n /** Send an email */\n send: <const I extends DeepReadonly<MailSendInput>>(input: StaticLiquid<I, MailSendInput>): Promise<MailSendOutput> => invoke('mail.send', input),\n /** Send an email using a notification type and template */\n sendNotification: (input: MailSendNotificationInput): Promise<MailSendNotificationOutput> => invoke('mail.send-notification', input),\n};\n\nexport const markdown = {\n /** Convert rich Content into a markdown string */\n fromContent: (input: MarkdownFromContentInput): Promise<MarkdownFromContentOutput> => invoke('markdown.from_content', input),\n /** Convert a markdown string into rich Content. Nodes a destination Content field disallows may be rejected by that field. */\n toContent: (input: MarkdownToContentInput): Promise<MarkdownToContentOutput> => invoke('markdown.to_content', input),\n};\n\nexport const mediaLibrary = {\n /** Create a media library folder */\n createFolder: (input: MediaLibraryCreateFolderInput): Promise<MediaLibraryCreateFolderOutput> => invoke('media_library.create_folder', input),\n /** Detach a file from the media library */\n deleteItem: (input: MediaLibraryDeleteItemInput): Promise<MediaLibraryDeleteItemOutput> => invoke('media_library.delete_item', input),\n /** Move media library items into a target folder */\n moveItems: (input: MediaLibraryMoveItemsInput): Promise<MediaLibraryMoveItemsOutput> => invoke('media_library.move_items', input),\n /** Rename a media library item and/or move it into a folder */\n updateItem: (input: MediaLibraryUpdateItemInput): Promise<MediaLibraryUpdateItemOutput> => invoke('media_library.update_item', input),\n};\n\nexport const money = {\n /** Format a money value as a currency string */\n format: (input: MoneyFormatInput): Promise<MoneyFormatOutput> => invoke('money.format', input),\n};\n\nexport const notification = {\n /** Send a notification email to a notifiable record */\n send: <const I extends DeepReadonly<NotificationSendInput>>(input: StaticLiquid<I, NotificationSendInput>): Promise<NotificationSendOutput> => invoke('notification.send', input),\n /** Find records with filters and send each record’s notification to the type’s configured recipient resource */\n sendBulkNotifications: (input: NotificationSendBulkNotificationsInput): Promise<NotificationSendBulkNotificationsOutput> => invoke('notification.send-bulk-notifications', input),\n /** Send a notification template to a full record of the type’s recipient resource */\n sendNotification: (input: NotificationSendNotificationInput): Promise<NotificationSendNotificationOutput> => invoke('notification.send-notification', input),\n /** Record whether a notifiable record agreed to receive email or SMS */\n setConsent: (input: NotificationSetConsentInput): Promise<NotificationSetConsentOutput> => invoke('notification.set-consent', input),\n};\n\nexport const number = {\n /** Format a number with configurable decimal places */\n format: (input: NumberFormatInput): Promise<NumberFormatOutput> => invoke('number.format', input),\n};\n\nconst package_ = {\n /** Read an input value collected when this package was installed */\n installInput: (input: PackageInstallInputInput): Promise<PackageInstallInputOutput> => invoke('package.install-input', input),\n};\nexport { package_ as package };\n\nexport const page = {\n /** Get the URL for a page with route parameters */\n url: (input: PageUrlInput): Promise<PageUrlOutput> => invoke('page.url', input),\n};\n\nexport const payables = {\n /** Void an unpaid draft or open invoice. Rejects collected payments and payments in progress. Does not refund payments or cancel subscriptions. */\n void: (input: PayablesVoidInput): Promise<PayablesVoidOutput> => invoke('payables.void', input),\n /** Write off all or part of an open invoice while preserving its original total. */\n writeOff: (input: PayablesWriteOffInput): Promise<PayablesWriteOffOutput> => invoke('payables.write-off', input),\n};\n\nexport const payment = {\n /** Record a manual payment against a payable record */\n createManual: (input: PaymentCreateManualInput): Promise<PaymentCreateManualOutput> => invoke('payment.create_manual', input),\n};\n\nexport const payments = {\n /** Charge a payable record using the payer default Stripe payment method */\n charge: (input: PaymentsChargeInput): Promise<PaymentsChargeOutput> => invoke('payments.charge', input),\n /** Create a Stripe Checkout session to collect payment against a payable record */\n checkout: (input: PaymentsCheckoutInput): Promise<PaymentsCheckoutOutput> => invoke('payments.checkout', input),\n /** Confirm new or saved payment details collected by PaymentForm. Return this output to the form for authentication. Run after committing checkout choices; Stripe charges cannot be rolled back. */\n confirm: (input: PaymentsConfirmInput): Promise<PaymentsConfirmOutput> => invoke('payments.confirm', input),\n /** Process a full or partial refund against a payment record */\n refund: (input: PaymentsRefundInput): Promise<PaymentsRefundOutput> => invoke('payments.refund', input),\n /** Void a mistaken manual payment without recording a refund. */\n void: (input: PaymentsVoidInput): Promise<PaymentsVoidOutput> => invoke('payments.void', input),\n};\n\nexport const phone = {\n /** Format a phone number into a human-readable string */\n format: (input: PhoneFormatInput): Promise<PhoneFormatOutput> => invoke('phone.format', input),\n};\n\nexport const scheduling = {\n /** Book a slot that Find Slots returned, as the run identity. Check the slot and return the booking with the caller's view. Return only the booking id if the caller cannot read the booking. Search accepts the Find Slots input with camelCase or snake_case keys. A pool tries its next free member when admission refuses the pick; a slot that is gone fails with the $capacity error */\n bookSlot: (input: SchedulingBookSlotInput): Promise<SchedulingBookSlotOutput> => invoke('scheduling.book_slot', input),\n /** Find the times a booking can start across groups of Schedulable records, inside their open hours and outside the time bookings take, without changing records. A Request workflow that runs as another identity searches with the view of the person who called it */\n findSlots: (input: SchedulingFindSlotsInput): Promise<SchedulingFindSlotsOutput> => invoke('scheduling.find_slots', input),\n};\n\nexport const schema = {\n /** Convert a schema definition into its JSON Schema document — the shape used to constrain AI and extraction output */\n toJsonSchema: (input: SchemaToJsonSchemaInput): Promise<SchemaToJsonSchemaOutput> => invoke('schema.to_json_schema', input),\n};\n\nexport const security = {\n /** Generate a secure random password */\n randomPassword: (input: SecurityRandomPasswordInput): Promise<SecurityRandomPasswordOutput> => invoke('security.random_password', input),\n};\n\nexport const sms = {\n /** Send a notification template by SMS to a full record of the type’s recipient resource */\n sendNotification: (input: SmsSendNotificationInput): Promise<SmsSendNotificationOutput> => invoke('sms.send-notification', input),\n};\n\nexport const subscriptions = {\n /** Start a draft subscription using its snapshotted activation and trial policies */\n activate: (input: SubscriptionsActivateInput): Promise<SubscriptionsActivateOutput> => invoke('subscriptions.activate', input),\n /** Cancel a subscription immediately, or at the end of the current billing period */\n cancel: (input: SubscriptionsCancelInput): Promise<SubscriptionsCancelOutput> => invoke('subscriptions.cancel', input),\n /** Change subscription items now with optional proration, schedule the selection for the next renewal or a later billing period, or revise an eligible unpaid current or upcoming renewal invoice. An incomplete subscription can change now without a revision scope; this revises its first invoice in place. Renewal revisions use full-period prices without proration. Net prorated credits first reduce open current-period invoices of the subscription, then go to the payer balance. */\n changeItems: (input: SubscriptionsChangeItemsInput): Promise<SubscriptionsChangeItemsOutput> => invoke('subscriptions.change_items', input),\n /** Create and activate a subscription for a payer in one step: the record, an item per price, and optionally the first invoice */\n create: (input: SubscriptionsCreateInput): Promise<SubscriptionsCreateOutput> => invoke('subscriptions.create', input),\n /** Generate the payable invoice for the saved subscription schedule; partial calendar periods prorate recurring lines and full periods use the original prices */\n generateInvoice: (input: SubscriptionsGenerateInvoiceInput): Promise<SubscriptionsGenerateInvoiceOutput> => invoke('subscriptions.generate_invoice', input),\n /** Pause a billing subscription so no further invoices generate until it is resumed */\n pause: (input: SubscriptionsPauseInput): Promise<SubscriptionsPauseOutput> => invoke('subscriptions.pause', input),\n /** Preview initial subscription charges, covered dates, and renewal amounts without creating records or collecting payment */\n preview: (input: SubscriptionsPreviewInput): Promise<SubscriptionsPreviewOutput> => invoke('subscriptions.preview', input),\n /** Preview a complete subscription item selection effective now, at the next renewal, or at a later billing period, without changing records */\n previewChange: (input: SubscriptionsPreviewChangeInput): Promise<SubscriptionsPreviewChangeOutput> => invoke('subscriptions.preview_change', input),\n /** Resume a paused subscription; its status re-derives from the latest invoice */\n resume: (input: SubscriptionsResumeInput): Promise<SubscriptionsResumeOutput> => invoke('subscriptions.resume', input),\n /** Safely replace the complete price selection that takes effect in the next billing period */\n setUpcomingItems: (input: SubscriptionsSetUpcomingItemsInput): Promise<SubscriptionsSetUpcomingItemsOutput> => invoke('subscriptions.set_upcoming_items', input),\n};\n\nexport const text = {\n /** Generate a random string with configurable character sets */\n generate: (input: TextGenerateInput): Promise<TextGenerateOutput> => invoke('text.generate', input),\n /** Hash a text value */\n hash: (input: TextHashInput): Promise<TextHashOutput> => invoke('text.hash', input),\n /** Generate a random UUID v7 */\n randomUuid: (input: TextRandomUuidInput = {}): Promise<TextRandomUuidOutput> => invoke('text.random_uuid', input),\n /** Convert a plain text string into rich Content */\n toContent: (input: TextToContentInput): Promise<TextToContentOutput> => invoke('text.to_content', input),\n};\n\nexport const time = {\n /** Add N seconds/minutes/hours/days/weeks/months/years to a datetime */\n add: (input: TimeAddInput): Promise<TimeAddOutput> => invoke('time.add', input),\n /** Difference between two datetimes in a specified unit */\n diff: (input: TimeDiffInput): Promise<TimeDiffOutput> => invoke('time.diff', input),\n /** Snap a datetime to the end of a period (hour, day, week, month, quarter, year) */\n endOf: (input: TimeEndOfInput): Promise<TimeEndOfOutput> => invoke('time.end_of', input),\n /** Format a datetime string using ICU date format syntax (e.g., \"yyyy-MM-dd HH:mm:ss\", \"MMM d, yyyy h:mm a\"). */\n format: (input: TimeFormatInput): Promise<TimeFormatOutput> => invoke('time.format', input),\n /** Snap a datetime to the start of a period (hour, day, week, month, quarter, year) */\n startOf: (input: TimeStartOfInput): Promise<TimeStartOfOutput> => invoke('time.start_of', input),\n /** Subtract N seconds/minutes/hours/days/weeks/months/years from a datetime */\n subtract: (input: TimeSubtractInput): Promise<TimeSubtractOutput> => invoke('time.subtract', input),\n};\n\nexport const timezone = {\n /** Format a timezone identifier into a human-readable string. Supports formats: full (region/city with offset), offset (UTC offset), abbreviation (timezone abbreviation), and city (city name only). */\n format: (input: TimezoneFormatInput): Promise<TimezoneFormatOutput> => invoke('timezone.format', input),\n /** Interpret a local date or datetime in a timezone and return the canonical UTC datetime string. */\n interpret: (input: TimezoneInterpretInput): Promise<TimezoneInterpretOutput> => invoke('timezone.interpret', input),\n};\n\nexport const tiptap = {\n /** Parse Tiptap content to HTML or text */\n parse: (input: TiptapParseInput): Promise<TiptapParseOutput> => invoke('tiptap.parse', input),\n};\n\nexport const transaction = {\n /** Transaction control for transaction(). */\n begin: (input: TransactionBeginInput = {}): Promise<TransactionBeginOutput> => invoke('transaction.begin', input),\n /** Transaction control for transaction(). */\n commit: (input: TransactionCommitInput = {}): Promise<TransactionCommitOutput> => invoke('transaction.commit', input),\n /** Transaction control for transaction(). */\n rollback: (input: TransactionRollbackInput): Promise<TransactionRollbackOutput> => invoke('transaction.rollback', input),\n};\n\nexport const user = {\n /** Check user permissions for authorization */\n authorize: (input: UserAuthorizeInput): Promise<UserAuthorizeOutput> => invoke('user.authorize', input),\n};\n\nexport const web = {\n /** Extract structured data from a web page, guided by a natural-language prompt and a required shape */\n agent: (input: WebAgentInput): Promise<WebAgentOutput> => invoke('web.agent', input),\n /** Scrape multiple web pages in one batch and poll until every page is finished */\n batchScrape: (input: WebBatchScrapeInput): Promise<WebBatchScrapeOutput> => invoke('web.batch_scrape', input),\n /** Crawl a site and return multi-page content (polls to completion) */\n crawl: (input: WebCrawlInput): Promise<WebCrawlOutput> => invoke('web.crawl', input),\n /** Extract structured data from one or more web pages, guided by a required shape and a supporting prompt */\n extract: (input: WebExtractInput): Promise<WebExtractOutput> => invoke('web.extract', input),\n /** Search Google and return the organic results */\n googleSearch: (input: WebGoogleSearchInput): Promise<WebGoogleSearchOutput> => invoke('web.google_search', input),\n /** Map a site and return all of its discoverable URLs */\n map: (input: WebMapInput): Promise<WebMapOutput> => invoke('web.map', input),\n /** Render a web page to a PDF document */\n pdf: (input: WebPdfInput): Promise<WebPdfOutput> => invoke('web.pdf', input),\n /** Scrape a web page in content mode (markdown/HTML plus metadata) or JSON mode (structured data extracted against a schema) */\n scrape: (input: WebScrapeInput): Promise<WebScrapeOutput> => invoke('web.scrape', input),\n /** Render a web page to a screenshot (PNG, JPEG, or WebP) */\n screenshot: (input: WebScreenshotInput): Promise<WebScreenshotOutput> => invoke('web.screenshot', input),\n /** Search the web for a query and return ranked results */\n searchRanked: (input: WebSearchRankedInput): Promise<WebSearchRankedOutput> => invoke('web.search_ranked', input),\n};\n\nexport const workflow = {\n /** Runs a workflow using its published version */\n run: (input: WorkflowRunInput): Promise<WorkflowRunOutput> => invoke('workflow.run', input),\n /** Get the URL for a workflow with route parameters */\n url: (input: WorkflowUrlInput): Promise<WorkflowUrlOutput> => invoke('workflow.url', input),\n};\n\nexport const workspace = {\n /** Get the login URL for an authenticatable resource */\n loginUrl: (input: WorkspaceLoginUrlInput): Promise<WorkspaceLoginUrlOutput> => invoke('workspace.login_url', input),\n /** Set the value of a field in a workspace */\n setValue: (input: WorkspaceSetValueInput): Promise<WorkspaceSetValueOutput> => invoke('workspace.set_value', input),\n /** Set multiple workspace field values at once from a key => value map */\n setValues: (input: WorkspaceSetValuesInput): Promise<WorkspaceSetValuesOutput> => invoke('workspace.set_values', input),\n /** Get the value of a field in a workspace */\n value: (input: WorkspaceValueInput): Promise<WorkspaceValueOutput> => invoke('workspace.value', input),\n /** Get all workspace field values as a dictionary */\n values: (input: WorkspaceValuesInput = {}): Promise<WorkspaceValuesOutput> => invoke('workspace.values', input),\n};\n\n","/sdk/generated/profiles/test.ts":"// AUTO-GENERATED by `php artisan workflows:script-sdk:build`. Do not edit by hand.\nimport { data as rootData } from '../../data';\nimport { workspace as rootWorkspace } from '../../workspace-values';\nimport { ai as rootAi, calendar as rootCalendar, callback as rootCallback, chart as rootChart, date as rootDate, file as rootFile, guard as rootGuard, http as rootHttp, lifecycle as rootLifecycle, mail as rootMail, markdown as rootMarkdown, mediaLibrary as rootMediaLibrary, money as rootMoney, notification as rootNotification, number as rootNumber, package as rootPackage, page as rootPage, payables as rootPayables, payment as rootPayment, payments as rootPayments, phone as rootPhone, scheduling as rootScheduling, schema as rootSchema, security as rootSecurity, sms as rootSms, subscriptions as rootSubscriptions, text as rootText, time as rootTime, timezone as rootTimezone, tiptap as rootTiptap, user as rootUser, web as rootWeb, workflow as rootWorkflow } from '../capabilities';\n\nexport const ai: {\n decide: typeof rootAi.decide;\n runPrompt: typeof rootAi.runPrompt;\n} = {\n decide: rootAi.decide,\n runPrompt: rootAi.runPrompt,\n};\n\nexport const calendar: {\n generateLink: typeof rootCalendar.generateLink;\n searchEvents: typeof rootCalendar.searchEvents;\n} = {\n generateLink: rootCalendar.generateLink,\n searchEvents: rootCalendar.searchEvents,\n};\n\nexport const callback: {\n get: typeof rootCallback.get;\n remove: typeof rootCallback.remove;\n set: typeof rootCallback.set;\n} = {\n get: rootCallback.get,\n remove: rootCallback.remove,\n set: rootCallback.set,\n};\n\nexport const chart: {\n distribution: typeof rootChart.distribution;\n kpi: typeof rootChart.kpi;\n leaderboard: typeof rootChart.leaderboard;\n timeSeries: typeof rootChart.timeSeries;\n} = {\n distribution: rootChart.distribution,\n kpi: rootChart.kpi,\n leaderboard: rootChart.leaderboard,\n timeSeries: rootChart.timeSeries,\n};\n\nexport const data: {\n aggregateMetrics: typeof rootData.aggregateMetrics;\n count: typeof rootData.count;\n create: typeof rootData.create;\n createMany: typeof rootData.createMany;\n delete: typeof rootData.delete;\n deleteMany: typeof rootData.deleteMany;\n find: typeof rootData.find;\n findOrCreate: typeof rootData.findOrCreate;\n relation: {\n attach: typeof rootData.relation.attach;\n attachMany: typeof rootData.relation.attachMany;\n detach: typeof rootData.relation.detach;\n detachMany: typeof rootData.relation.detachMany;\n sync: typeof rootData.relation.sync;\n };\n restore: typeof rootData.restore;\n search: typeof rootData.search;\n semanticSearch: typeof rootData.semanticSearch;\n sum: typeof rootData.sum;\n update: typeof rootData.update;\n updateOrCreate: typeof rootData.updateOrCreate;\n validate: typeof rootData.validate;\n} = {\n aggregateMetrics: rootData.aggregateMetrics,\n count: rootData.count,\n create: rootData.create,\n createMany: rootData.createMany,\n delete: rootData.delete,\n deleteMany: rootData.deleteMany,\n find: rootData.find,\n findOrCreate: rootData.findOrCreate,\n relation: {\n attach: rootData.relation.attach,\n attachMany: rootData.relation.attachMany,\n detach: rootData.relation.detach,\n detachMany: rootData.relation.detachMany,\n sync: rootData.relation.sync,\n },\n restore: rootData.restore,\n search: rootData.search,\n semanticSearch: rootData.semanticSearch,\n sum: rootData.sum,\n update: rootData.update,\n updateOrCreate: rootData.updateOrCreate,\n validate: rootData.validate,\n};\n\nexport const date: {\n add: typeof rootDate.add;\n diff: typeof rootDate.diff;\n endOf: typeof rootDate.endOf;\n format: typeof rootDate.format;\n startOf: typeof rootDate.startOf;\n subtract: typeof rootDate.subtract;\n} = {\n add: rootDate.add,\n diff: rootDate.diff,\n endOf: rootDate.endOf,\n format: rootDate.format,\n startOf: rootDate.startOf,\n subtract: rootDate.subtract,\n};\n\nexport const file: {\n changeVisibility: typeof rootFile.changeVisibility;\n createFromUrl: typeof rootFile.createFromUrl;\n createMediaLibraryItem: typeof rootFile.createMediaLibraryItem;\n createQrCode: typeof rootFile.createQrCode;\n} = {\n changeVisibility: rootFile.changeVisibility,\n createFromUrl: rootFile.createFromUrl,\n createMediaLibraryItem: rootFile.createMediaLibraryItem,\n createQrCode: rootFile.createQrCode,\n};\n\nexport const guard: {\n validate: typeof rootGuard.validate;\n} = {\n validate: rootGuard.validate,\n};\n\nexport const http: {\n request: typeof rootHttp.request;\n} = {\n request: rootHttp.request,\n};\n\nexport const lifecycle: {\n output: typeof rootLifecycle.output;\n} = {\n output: rootLifecycle.output,\n};\n\nexport const mail: {\n search: typeof rootMail.search;\n send: typeof rootMail.send;\n sendNotification: typeof rootMail.sendNotification;\n} = {\n search: rootMail.search,\n send: rootMail.send,\n sendNotification: rootMail.sendNotification,\n};\n\nexport const markdown: {\n fromContent: typeof rootMarkdown.fromContent;\n toContent: typeof rootMarkdown.toContent;\n} = {\n fromContent: rootMarkdown.fromContent,\n toContent: rootMarkdown.toContent,\n};\n\nexport const mediaLibrary: {\n createFolder: typeof rootMediaLibrary.createFolder;\n deleteItem: typeof rootMediaLibrary.deleteItem;\n moveItems: typeof rootMediaLibrary.moveItems;\n updateItem: typeof rootMediaLibrary.updateItem;\n} = {\n createFolder: rootMediaLibrary.createFolder,\n deleteItem: rootMediaLibrary.deleteItem,\n moveItems: rootMediaLibrary.moveItems,\n updateItem: rootMediaLibrary.updateItem,\n};\n\nexport const money: {\n format: typeof rootMoney.format;\n} = {\n format: rootMoney.format,\n};\n\nexport const notification: {\n send: typeof rootNotification.send;\n sendBulkNotifications: typeof rootNotification.sendBulkNotifications;\n sendNotification: typeof rootNotification.sendNotification;\n setConsent: typeof rootNotification.setConsent;\n} = {\n send: rootNotification.send,\n sendBulkNotifications: rootNotification.sendBulkNotifications,\n sendNotification: rootNotification.sendNotification,\n setConsent: rootNotification.setConsent,\n};\n\nexport const number: {\n format: typeof rootNumber.format;\n} = {\n format: rootNumber.format,\n};\n\nconst package_: {\n installInput: typeof rootPackage.installInput;\n} = {\n installInput: rootPackage.installInput,\n};\nexport { package_ as package };\n\nexport const page: {\n url: typeof rootPage.url;\n} = {\n url: rootPage.url,\n};\n\nexport const payables: {\n void: typeof rootPayables.void;\n writeOff: typeof rootPayables.writeOff;\n} = {\n void: rootPayables.void,\n writeOff: rootPayables.writeOff,\n};\n\nexport const payment: {\n createManual: typeof rootPayment.createManual;\n} = {\n createManual: rootPayment.createManual,\n};\n\nexport const payments: {\n charge: typeof rootPayments.charge;\n checkout: typeof rootPayments.checkout;\n confirm: typeof rootPayments.confirm;\n refund: typeof rootPayments.refund;\n void: typeof rootPayments.void;\n} = {\n charge: rootPayments.charge,\n checkout: rootPayments.checkout,\n confirm: rootPayments.confirm,\n refund: rootPayments.refund,\n void: rootPayments.void,\n};\n\nexport const phone: {\n format: typeof rootPhone.format;\n} = {\n format: rootPhone.format,\n};\n\nexport const scheduling: {\n bookSlot: typeof rootScheduling.bookSlot;\n findSlots: typeof rootScheduling.findSlots;\n} = {\n bookSlot: rootScheduling.bookSlot,\n findSlots: rootScheduling.findSlots,\n};\n\nexport const schema: {\n toJsonSchema: typeof rootSchema.toJsonSchema;\n} = {\n toJsonSchema: rootSchema.toJsonSchema,\n};\n\nexport const security: {\n randomPassword: typeof rootSecurity.randomPassword;\n} = {\n randomPassword: rootSecurity.randomPassword,\n};\n\nexport const sms: {\n sendNotification: typeof rootSms.sendNotification;\n} = {\n sendNotification: rootSms.sendNotification,\n};\n\nexport const subscriptions: {\n activate: typeof rootSubscriptions.activate;\n cancel: typeof rootSubscriptions.cancel;\n changeItems: typeof rootSubscriptions.changeItems;\n create: typeof rootSubscriptions.create;\n generateInvoice: typeof rootSubscriptions.generateInvoice;\n pause: typeof rootSubscriptions.pause;\n preview: typeof rootSubscriptions.preview;\n previewChange: typeof rootSubscriptions.previewChange;\n resume: typeof rootSubscriptions.resume;\n setUpcomingItems: typeof rootSubscriptions.setUpcomingItems;\n} = {\n activate: rootSubscriptions.activate,\n cancel: rootSubscriptions.cancel,\n changeItems: rootSubscriptions.changeItems,\n create: rootSubscriptions.create,\n generateInvoice: rootSubscriptions.generateInvoice,\n pause: rootSubscriptions.pause,\n preview: rootSubscriptions.preview,\n previewChange: rootSubscriptions.previewChange,\n resume: rootSubscriptions.resume,\n setUpcomingItems: rootSubscriptions.setUpcomingItems,\n};\n\nexport const text: {\n generate: typeof rootText.generate;\n hash: typeof rootText.hash;\n randomUuid: typeof rootText.randomUuid;\n toContent: typeof rootText.toContent;\n} = {\n generate: rootText.generate,\n hash: rootText.hash,\n randomUuid: rootText.randomUuid,\n toContent: rootText.toContent,\n};\n\nexport const time: {\n add: typeof rootTime.add;\n diff: typeof rootTime.diff;\n endOf: typeof rootTime.endOf;\n format: typeof rootTime.format;\n startOf: typeof rootTime.startOf;\n subtract: typeof rootTime.subtract;\n} = {\n add: rootTime.add,\n diff: rootTime.diff,\n endOf: rootTime.endOf,\n format: rootTime.format,\n startOf: rootTime.startOf,\n subtract: rootTime.subtract,\n};\n\nexport const timezone: {\n format: typeof rootTimezone.format;\n interpret: typeof rootTimezone.interpret;\n} = {\n format: rootTimezone.format,\n interpret: rootTimezone.interpret,\n};\n\nexport const tiptap: {\n parse: typeof rootTiptap.parse;\n} = {\n parse: rootTiptap.parse,\n};\n\nexport const user: {\n authorize: typeof rootUser.authorize;\n} = {\n authorize: rootUser.authorize,\n};\n\nexport const web: {\n agent: typeof rootWeb.agent;\n batchScrape: typeof rootWeb.batchScrape;\n crawl: typeof rootWeb.crawl;\n extract: typeof rootWeb.extract;\n googleSearch: typeof rootWeb.googleSearch;\n map: typeof rootWeb.map;\n pdf: typeof rootWeb.pdf;\n scrape: typeof rootWeb.scrape;\n screenshot: typeof rootWeb.screenshot;\n searchRanked: typeof rootWeb.searchRanked;\n} = {\n agent: rootWeb.agent,\n batchScrape: rootWeb.batchScrape,\n crawl: rootWeb.crawl,\n extract: rootWeb.extract,\n googleSearch: rootWeb.googleSearch,\n map: rootWeb.map,\n pdf: rootWeb.pdf,\n scrape: rootWeb.scrape,\n screenshot: rootWeb.screenshot,\n searchRanked: rootWeb.searchRanked,\n};\n\nexport const workflow: {\n run: typeof rootWorkflow.run;\n url: typeof rootWorkflow.url;\n} = {\n run: rootWorkflow.run,\n url: rootWorkflow.url,\n};\n\nexport const workspace: {\n loginUrl: typeof rootWorkspace.loginUrl;\n setValue: typeof rootWorkspace.setValue;\n setValues: typeof rootWorkspace.setValues;\n value: typeof rootWorkspace.value;\n values: typeof rootWorkspace.values;\n} = {\n loginUrl: rootWorkspace.loginUrl,\n setValue: rootWorkspace.setValue,\n setValues: rootWorkspace.setValues,\n value: rootWorkspace.value,\n values: rootWorkspace.values,\n};\n","/sdk/index.ts":"import './console';\n\nexport { HostError, WorkflowFailure, fail, validationError } from './errors';\nexport type { HostFailure } from './errors';\nexport { invoke, setTransport, type HostTransport } from './transport';\nexport { transaction } from './transaction';\nexport type { Liquid, declaredInput } from './liquid';\nexport { data } from './data';\nexport { mail, notification, sms } from './notifications';\nexport { workspace } from './workspace-values';\nexport {\n InputField,\n InputSchema,\n v,\n type ContentDocument,\n type ContentNode,\n type ContentOptions,\n type FileVisibility,\n type Infer,\n type InferInput,\n type InputFieldKind,\n type InputFieldSpec,\n type InputShape,\n type Money,\n type RecordScope\n} from './input';\nexport {\n defineWorkflow,\n parseWorkflowInput,\n redirect,\n respond,\n validateWorkflowInput,\n type Identity,\n type InputErrors,\n type InputValidator,\n type RequestContext,\n type ScriptExecution,\n type WorkflowContext,\n type WorkflowDefinition,\n type WorkflowExecution\n} from './workflow';\nexport * from './generated/capabilities';\n\n/** The embedding host selects its execution context through its supplied declarations. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ScriptHostContext {}\n\n/**\n * Declaration-merged by the generated workspace module with one entry per resource.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceResources {}\n\n/**\n * Declaration-merged by the workspace's field definitions with each key's value type.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceFieldCatalog {}\n\n/**\n * Declaration-merged by the generated workspace module with one entry per notification type:\n * its id, the unions of its template ids (all, email-enabled, and SMS-enabled), and the shape\n * of its variables.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceNotificationTypes {}\n","/sdk/input.ts":"import type { InputOf, ResourceKey } from './data';\n\n/**\n * A declared input field, as data. The compiler reads a workflow's input schema from its source\n * and saves each field as a workflow input variable, so the platform validates a run's input\n * against these rules before the script starts. The same data travels with the workflow at run\n * time, where the SDK uses it to coerce string values to the declared types.\n */\nexport interface InputFieldSpec {\n readonly kind: InputFieldKind;\n readonly optional: boolean;\n readonly nullable: boolean;\n /** Validation rules in the platform's rule syntax, such as `min:1` or `regex:/^[a-z]+$/`. */\n readonly rules: readonly string[];\n readonly label?: string;\n readonly description?: string;\n /** `select`: the allowed values. */\n readonly options?: readonly (string | number)[];\n /** `list`: the item field. */\n readonly items?: InputFieldSpec;\n /** `object`: the nested fields. */\n readonly fields?: Readonly<Record<string, InputFieldSpec>>;\n /** `record` and `recordReference`: the resource whose definitions or records the value must match. */\n readonly resource?: string;\n /** `recordReference`: the records the ID can name. The platform default is `active`. */\n readonly scope?: RecordScope;\n /** `file`: the accepted MIME types. */\n readonly accept?: readonly string[];\n /** `file`: the visibility of the file. */\n readonly visibility?: FileVisibility;\n /** `content`: the formatting the document may use. */\n readonly content?: ContentOptions;\n}\n\n/**\n * A money value as the platform stores it. It is a type alias, not an interface, so that it is\n * assignable to the open money objects of capability inputs such as `money.format`.\n */\nexport type Money = {\n amount: number;\n currency: string;\n};\n\nexport type InputFieldKind =\n | 'text'\n | 'email'\n | 'url'\n | 'uuid'\n | 'phone'\n | 'date'\n | 'datetime'\n | 'time'\n | 'timezone'\n | 'color'\n | 'number'\n | 'integer'\n | 'money'\n | 'boolean'\n | 'select'\n | 'list'\n | 'object'\n | 'record'\n | 'recordReference'\n | 'roleReference'\n | 'file'\n | 'content';\n\n/** The records a record ID can name: `active`, `archived` (deleted), or `activeOrArchived` (all). */\nexport type RecordScope = 'active' | 'archived' | 'activeOrArchived';\n\nexport type FileVisibility = 'public' | 'private';\n\nexport interface ContentOptions {\n /** `false` allows one paragraph only. The default is `true`. */\n readonly multiLine?: boolean;\n /** The marks the text may use. Each mark is allowed unless it is `false`. */\n readonly extensions?: Readonly<\n Partial<Record<'bold' | 'italic' | 'strike' | 'underline' | 'link', boolean>>\n >;\n /** The block nodes the document may use. Each node is allowed unless it is `false`. */\n readonly allowedNodes?: Readonly<\n Partial<Record<'heading' | 'blockquote' | 'bulletList' | 'orderedList' | 'media', boolean>>\n >;\n}\n\n/** A rich text node in the platform's content format. */\nexport interface ContentNode {\n type: string;\n attrs?: Record<string, unknown>;\n content?: ContentNode[];\n marks?: { type: string; attrs?: Record<string, unknown> }[];\n text?: string;\n}\n\n/** A rich text document in the platform's content format. */\nexport interface ContentDocument extends ContentNode {\n type: 'doc';\n}\n\n/**\n * One field of a workflow's input schema. `T` is the value type the handler receives; `O` is\n * whether the key may be absent. Every modifier returns a new field, so a field can be shared.\n */\nexport class InputField<T, O extends boolean = false> {\n /** Phantom members that carry the static types; they hold no value at run time. */\n declare readonly $value: T;\n declare readonly $optional: O;\n\n constructor(readonly $spec: InputFieldSpec) {}\n\n /** The key may be absent. */\n optional(): InputField<T | undefined, true> {\n return new InputField({ ...this.$spec, optional: true });\n }\n\n /** The value may be `null`. */\n nullable(): InputField<T | null, O> {\n return new InputField({ ...this.$spec, nullable: true });\n }\n\n /** At least `value`: a number's value, a text's length, or a list's item count. */\n min(value: number): InputField<T, O> {\n return this.rule(`min:${value}`);\n }\n\n /** At most `value`: a number's value, a text's length, or a list's item count. */\n max(value: number): InputField<T, O> {\n return this.rule(`max:${value}`);\n }\n\n /** Between `min` and `max`, inclusive, measured as for `min` and `max`. */\n between(min: number, max: number): InputField<T, O> {\n return this.rule(`between:${min},${max}`);\n }\n\n /** Exactly `value`, measured as for `min` and `max`. */\n size(value: number): InputField<T, O> {\n return this.rule(`size:${value}`);\n }\n\n /** The text matches the pattern. */\n regex(pattern: RegExp): InputField<T, O> {\n return this.rule(`regex:/${pattern.source}/${pattern.flags}`);\n }\n\n /** Any other platform validation rule, such as `starts_with:INV-` or `after:today`. */\n rule(rule: string): InputField<T, O> {\n return new InputField({ ...this.$spec, rules: [...this.$spec.rules, rule] });\n }\n\n label(label: string): InputField<T, O> {\n return new InputField({ ...this.$spec, label });\n }\n\n description(description: string): InputField<T, O> {\n return new InputField({ ...this.$spec, description });\n }\n}\n\nexport type InputShape = Record<string, InputField<unknown, boolean>>;\n\ntype Simplify<T> = { [K in keyof T]: T[K] } & {};\n\n/** The value an input schema describes: optional fields become optional keys. */\nexport type InferInput<S extends InputShape> = Simplify<\n { [K in keyof S as S[K]['$optional'] extends true ? never : K]: S[K]['$value'] } & {\n [K in keyof S as S[K]['$optional'] extends true ? K : never]?: S[K]['$value'];\n }\n>;\n\n/** The value a field or schema describes: `Infer<typeof Input>`. */\nexport type Infer<F extends InputField<unknown, boolean>> = F['$value'];\n\n/** A workflow's input schema: the fields of an object. */\nexport class InputSchema<S extends InputShape> extends InputField<InferInput<S>> {\n constructor(readonly shape: S) {\n super(objectSpec(shape));\n }\n}\n\nfunction objectSpec(shape: InputShape): InputFieldSpec {\n return {\n kind: 'object',\n optional: false,\n nullable: false,\n rules: [],\n fields: Object.fromEntries(Object.entries(shape).map(([key, field]) => [key, field.$spec]))\n };\n}\n\nconst field = <T>(kind: InputFieldKind, extra: Partial<InputFieldSpec> = {}): InputField<T> =>\n new InputField<T>({ kind, optional: false, nullable: false, rules: [], ...extra });\n\n/** Builders for a workflow's input schema. */\nexport const v = {\n text: () => field<string>('text'),\n email: () => field<string>('email'),\n url: () => field<string>('url'),\n uuid: () => field<string>('uuid'),\n phone: () => field<string>('phone'),\n /** A calendar date, `YYYY-MM-DD`. */\n date: () => field<string>('date'),\n /** A date and time, ISO 8601. */\n datetime: () => field<string>('datetime'),\n /** A time of day, `HH:MM`. */\n time: () => field<string>('time'),\n timezone: () => field<string>('timezone'),\n color: () => field<string>('color'),\n number: () => field<number>('number'),\n integer: () => field<number>('integer'),\n /** An amount of money: `amount` in the currency's minor units, such as cents, and the lowercase ISO 4217 `currency`. */\n money: () => field<Money>('money'),\n boolean: () => field<boolean>('boolean'),\n /** One of `options`. */\n select: <const V extends readonly (string | number)[]>(options: V) =>\n field<V[number]>('select', { options }),\n /** A list whose items each satisfy `items`. */\n list: <T>(items: InputField<T, boolean>) =>\n field<Exclude<T, undefined>[]>('list', { items: items.$spec }),\n /** An object with the given fields. */\n object: <S extends InputShape>(shape: S) => new InputSchema(shape),\n /**\n * The field values of a record of `resource`, checked against that resource's field\n * definitions: types, required fields, and each field's own rules.\n */\n record: <R extends ResourceKey>(resource: R) => field<InputOf<R>>('record', { resource }),\n /** The ID of an existing record of `resource`, in `scope`. */\n recordReference: <R extends ResourceKey>(resource: R, options: { scope?: RecordScope } = {}) =>\n field<string>('recordReference', { resource, ...options }),\n /** The ID of an existing role. */\n roleReference: () => field<string>('roleReference'),\n /**\n * A file: the ID of an existing file, or the temporary path of an upload. A data call that\n * writes the value to a file field of a record finalizes the upload.\n */\n file: (options: { accept?: readonly string[]; visibility?: FileVisibility } = {}) =>\n field<string>('file', options),\n /** A rich text document with the formatting that `options` allows. */\n content: (options: ContentOptions = {}) =>\n field<ContentDocument>('content', Object.keys(options).length === 0 ? {} : { content: options })\n};\n\nconst NUMERIC = /^-?(\\d+\\.?\\d*|\\.\\d+)(e[-+]?\\d+)?$/i;\n\nfunction coerceNumber(value: unknown): unknown {\n return typeof value === 'string' && NUMERIC.test(value.trim()) ? Number(value) : value;\n}\n\n/**\n * Converts the string forms a request carries (`\"5\"`, `\"true\"`) to the declared types. It runs\n * after the platform validated the input against the same schema, so a value it cannot convert\n * is left as it is.\n */\nexport function coerceInput(spec: InputFieldSpec, value: unknown): unknown {\n if (value === null || value === undefined) {\n return value;\n }\n\n switch (spec.kind) {\n case 'number':\n case 'integer':\n return coerceNumber(value);\n case 'money':\n return typeof value === 'object' && !Array.isArray(value) && 'amount' in value\n ? { ...value, amount: coerceNumber(value.amount) }\n : value;\n case 'boolean':\n if (value === 'true' || value === '1' || value === 1) {\n return true;\n }\n\n return value === 'false' || value === '0' || value === 0 ? false : value;\n case 'select':\n return typeof value === 'string' &&\n !spec.options?.includes(value) &&\n spec.options?.includes(Number(value))\n ? Number(value)\n : value;\n case 'list':\n return Array.isArray(value) && spec.items\n ? value.map((item) => coerceInput(spec.items!, item))\n : value;\n case 'object': {\n if (typeof value !== 'object' || Array.isArray(value) || !spec.fields) {\n return value;\n }\n\n const result: Record<string, unknown> = { ...(value as Record<string, unknown>) };\n\n for (const [key, fieldSpec] of Object.entries(spec.fields)) {\n if (key in result) {\n result[key] = coerceInput(fieldSpec, result[key]);\n }\n }\n\n return result;\n }\n default:\n return value;\n }\n}\n","/sdk/liquid.ts":"declare const liquidBrand: unique symbol;\n\n/**\n * The key under which a checked capability parameter carries its declared input type, so that a\n * tool such as the editor outline can read the fields that the capability declares.\n */\nexport declare const declaredInput: unique symbol;\n\n/**\n * Text that the task renders as a Liquid template, such as the body of an email. Write it as fixed\n * text, and pass each value as a reference: a value written into the text would be evaluated as\n * Liquid, so `{{ workspace.name }}` in submitted data would render.\n */\nexport type Liquid = string & { readonly [liquidBrand]?: true };\n\n/** The text that the type check shows for a Liquid field whose value is not fixed text. */\ntype FixedTextHint =\n 'Write fixed text here. Put each value in a reference and write {{ ref.<key> }}.';\n\ntype IsLiquid<T> = [T] extends [string]\n ? typeof liquidBrand extends keyof T\n ? true\n : false\n : false;\n\n/**\n * A string literal, or a union of string literals. A template literal type such as `Hi ${string}`\n * is not fixed: Record gives it an index signature. StaticFields passes a value without null and\n * undefined, so an optional value is fixed only when its string is. `never` is the value `undefined`\n * alone, which is fixed.\n */\ntype IsFixed<T> = [T] extends [never] ? true : false extends FixedMember<T> ? false : true;\n\n/**\n * Whether each member of `T` is fixed, member by member: a Record of the whole union would require\n * the key of each literal member, so one literal would hide a template literal beside it.\n */\ntype FixedMember<T> = T extends string\n ? string extends T\n ? false\n : {} extends Record<T, 1>\n ? false\n : true\n : true;\n\n/** The input of a capability call, deeply readonly, so a `const` type parameter can infer it. */\nexport type DeepReadonly<T> = T extends (...args: never[]) => unknown\n ? T\n : T extends readonly (infer E)[]\n ? readonly DeepReadonly<E>[]\n : T extends object\n ? { readonly [K in keyof T]: DeepReadonly<T[K]> }\n : T;\n\n/**\n * The input `I` of a capability call whose declared input is `D`, with each value of a Liquid field\n * that is not fixed text replaced by the hint, so the call fails the type check at that value.\n */\nexport type StaticLiquid<I, D> = StaticFields<I, D> & { readonly [declaredInput]?: D };\n\ntype StaticFields<I, D> = {\n [K in keyof I]: K extends keyof NonNullable<D>\n ? IsLiquid<NonNullable<NonNullable<D>[K]>> extends true\n ? IsFixed<NonNullable<I[K]>> extends true\n ? I[K]\n : FixedTextHint\n : I[K] extends readonly unknown[]\n ? I[K]\n : NonNullable<I[K]> extends object\n ? StaticFields<I[K], NonNullable<D>[K]>\n : I[K]\n : I[K];\n};\n","/sdk/notifications.ts":"import type { ResourceKey } from './data';\nimport {\n mail as generatedMail,\n notification as generatedNotification,\n sms as generatedSms,\n type MailSendNotificationInput,\n type MailSendNotificationOutput,\n type NotificationSendBulkNotificationsInput,\n type NotificationSendBulkNotificationsOutput,\n type NotificationSendNotificationInput,\n type NotificationSendNotificationOutput,\n type NotificationSetConsentInput,\n type NotificationSetConsentOutput,\n type SmsSendNotificationInput,\n type SmsSendNotificationOutput\n} from './generated/capabilities';\nimport type { WorkspaceNotificationTypes } from './index';\nimport { invoke } from './transport';\n\ntype Entry = WorkspaceNotificationTypes[keyof WorkspaceNotificationTypes];\ntype Declared = [keyof WorkspaceNotificationTypes] extends [never] ? false : true;\nexport type NotificationTypeKey = Declared extends true\n ? Entry extends { id: infer I }\n ? I\n : never\n : string;\n// A type can declare more than one id, such as its uid and its slug, so an entry matches when `T`\n// is one of its ids.\ntype MatchingEntry<E, T> = E extends { id: infer I } ? (T extends I ? E : never) : never;\ntype EntryFor<T> = MatchingEntry<Entry, T>;\n/**\n * The template ids of one notification type under `Channel`: every template, or only the\n * templates with email or SMS on. Any string while the workspace declares no types.\n */\nexport type NotificationTemplateKey<\n T,\n Channel extends 'template' | 'emailTemplate' | 'smsTemplate' = 'template'\n> = Declared extends true ? (EntryFor<T> extends Record<Channel, infer K> ? K : never) : string;\n/** The variables one notification type declares; any dictionary while the workspace declares no types. */\nexport type NotificationVariables<T> = Declared extends true\n ? EntryFor<T> extends { variables: infer V }\n ? V\n : never\n : Record<string, unknown>;\n\ntype NotificationInput<\n I,\n T,\n Channel extends 'template' | 'emailTemplate' | 'smsTemplate' = 'template'\n> = Omit<I, 'notificationType' | 'notificationTemplate' | 'variables'> & {\n notificationType: T;\n notificationTemplate?: NotificationTemplateKey<T, Channel>;\n} & ({} extends NotificationVariables<T>\n ? { variables?: NotificationVariables<T> }\n : { variables: NotificationVariables<T> });\n\nexport const mail = {\n ...generatedMail,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<MailSendNotificationInput, T, 'emailTemplate'>\n ) => invoke<MailSendNotificationOutput>('mail.send-notification', input)\n};\n\nexport const notification = {\n ...generatedNotification,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<NotificationSendNotificationInput, T>\n ) => invoke<NotificationSendNotificationOutput>('notification.send-notification', input),\n sendBulkNotifications: <T extends NotificationTypeKey, R extends ResourceKey>(\n input: Omit<NotificationInput<NotificationSendBulkNotificationsInput, T>, 'resource'> & {\n resource: R;\n }\n ) =>\n invoke<NotificationSendBulkNotificationsOutput>('notification.send-bulk-notifications', input),\n setConsent: <R extends NotificationSetConsentInput['resource']>(\n input: Omit<NotificationSetConsentInput, 'resource'> & { resource: R }\n ) => invoke<NotificationSetConsentOutput>('notification.set-consent', input)\n};\n\nexport const sms = {\n ...generatedSms,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<SmsSendNotificationInput, T, 'smsTemplate'>\n ) => invoke<SmsSendNotificationOutput>('sms.send-notification', input)\n};\n","/sdk/profiles/shared.ts":"// The root exports that call no host capability. Each profile entry point re-exports them.\nexport { HostError, WorkflowFailure, fail, validationError } from '../errors';\nexport {\n InputField,\n InputSchema,\n v,\n type ContentDocument,\n type ContentNode,\n type ContentOptions,\n type FileVisibility,\n type Infer,\n type InferInput,\n type InputFieldKind,\n type InputFieldSpec,\n type InputShape,\n type Money,\n type RecordScope\n} from '../input';\nexport {\n defineWorkflow,\n parseWorkflowInput,\n redirect,\n respond,\n validateWorkflowInput,\n type Identity,\n type InputErrors,\n type InputValidator,\n type RequestContext,\n type ScriptExecution,\n type WorkflowContext,\n type WorkflowDefinition,\n type WorkflowExecution\n} from '../workflow';\nexport type {\n ScriptHostContext,\n WorkspaceFieldCatalog,\n WorkspaceNotificationTypes,\n WorkspaceResources\n} from '../index';\n","/sdk/profiles/test.ts":"// The `@diagonal-hq/workflows/test` entry point of E2E setup and assert scripts. It exports every\n// capability wrapper except the test profile's deny list (sign-in changes), the `transaction()`\n// helper, and the root exports that call no host capability. The script host refuses each\n// denied capability.\nimport '../console';\nimport { data as rootData } from '../data';\nimport { data as testData } from '../generated/profiles/test';\n\nexport * from './shared';\nexport * from '../generated/profiles/test';\nexport { transaction } from '../transaction';\n\nexport const data: typeof testData & { each: typeof rootData.each } = {\n ...testData,\n each: rootData.each\n};\n","/sdk/runtime/quickjs.ts":"// The sandbox entry. scripts/build-workflow-code-runtime.mjs bundles this file and the SDK into\n// the QuickJS runtime. It must not import http-transport.ts or testing/, which need DOM types.\n//\n// The runner evaluates the bundle as the ES module `@diagonal/workflow` before the script, so a\n// script that imports the SDK gets this module and its transport, also at its top level.\n\nimport { HostError, type HostFailure } from '../errors';\n// oxlint-disable-next-line import/no-namespace -- `require('@diagonal/workflow')` of a CommonJS script returns the whole SDK module.\nimport * as sdk from '../index';\nimport { SerialTransactionTransport } from '../serial-transaction-transport';\nimport type { WorkflowContext, WorkflowDefinition } from '../workflow';\n\nexport * from '../index';\n\ntype HostBridge = (name: string, argsJson: string) => Promise<string>;\n\ntype HostReply = {\n ok: boolean;\n value: unknown;\n error: {\n message: string;\n code: string;\n status: number;\n details: unknown;\n failure?: HostFailure | null;\n failure_id?: number;\n } | null;\n};\n\nconst guest = globalThis as unknown as Record<string, unknown>;\n\n// Scripts reach the host only through the SDK, so the bridge leaves the global scope here.\nconst host = guest.__host as HostBridge;\nconst handlerStarted = guest.__handlerStarted as () => void;\ndelete guest.__host;\ndelete guest.__handlerStarted;\n\nclass QuickJsTransport implements sdk.HostTransport {\n async call(name: string, input: Record<string, unknown>): Promise<unknown> {\n const reply = JSON.parse(await host(name, JSON.stringify([input]))) as HostReply;\n\n if (!reply.ok) {\n const error = reply.error ?? {\n message: 'The call failed.',\n code: 'internal_error',\n status: 500,\n details: null\n };\n throw new HostError(\n error.message,\n error.code,\n error.status,\n error.details,\n error.failure_id ?? null,\n error.failure ?? null\n );\n }\n\n return reply.value;\n }\n}\n\nsdk.setTransport(new SerialTransactionTransport(new QuickJsTransport()));\n\ntype WorkspaceValues = {\n resources: Record<string, string>;\n notificationTypes: Record<string, string>;\n notificationTemplates: Record<string, Record<string, string>>;\n};\n\n/**\n * The exports of a script that an earlier compiler wrote as CommonJS, with a `require` that serves\n * the SDK and the workspace values.\n */\nguest.__commonJsExports = (code: string, workspaceJson: string): Record<string, unknown> => {\n const workspace = JSON.parse(workspaceJson) as WorkspaceValues;\n const module = { exports: {} as Record<string, unknown> };\n const require = (specifier: string): unknown => {\n if (specifier === '@diagonal/workflow') {\n return sdk;\n }\n\n if (specifier === '@diagonal/workflow/workspace') {\n return workspace;\n }\n\n throw new Error(`Cannot import ${specifier}.`);\n };\n\n // The compiled module is CommonJS text produced by the Diagonal compiler. It runs inside\n // QuickJS, which is the sandbox boundary.\n // oxlint-disable-next-line typescript/no-implied-eval\n new Function('exports', 'require', 'module', code)(module.exports, require, module);\n\n return module.exports;\n};\n\nguest.__runWorkflow = async (\n exports: Record<string, unknown>,\n inputJson: string,\n contextJson: string\n): Promise<unknown> => {\n const input = JSON.parse(inputJson) as unknown;\n const context = JSON.parse(contextJson) as WorkflowContext;\n const workflow = exports.default as WorkflowDefinition<unknown, unknown> | undefined;\n\n if (workflow?.$diagonal !== 'workflow') {\n throw new Error('The script has no default workflow export.');\n }\n\n const validateInput = exports.validateInput;\n const parsed = sdk.parseWorkflowInput(workflow, input);\n\n if (validateInput !== undefined && typeof validateInput !== 'function') {\n throw new TypeError('The validateInput export must be a function.');\n }\n\n if (workflow.validate !== undefined && validateInput !== undefined) {\n throw new TypeError(\n 'The workflow has a validate option and a validateInput export. Keep only the validate option.'\n );\n }\n\n const validator = workflow.validate ?? (validateInput as sdk.InputValidator<unknown> | undefined);\n\n if (validator !== undefined) {\n await sdk.validateWorkflowInput(validator, parsed, context);\n }\n\n handlerStarted();\n return workflow.run(parsed, context);\n};\n","/sdk/serial-transaction-transport.ts":"import { HostError } from './errors';\nimport type { HostTransport } from './transport';\n\nconst PromiseConstructor = Promise;\nconst objectKeys = Object.keys;\nconst isArray = Array.isArray;\n\nexport class SerialTransactionTransport implements HostTransport {\n private pending = 0;\n private settled: Promise<void> | null = null;\n private transactionOpen = false;\n private closing = false;\n\n constructor(private readonly transport: HostTransport) {}\n\n async call(name: string, input: Record<string, unknown>): Promise<unknown> {\n const begins = name === 'transaction.begin';\n const rollsBack = name === 'transaction.rollback';\n const ends = rollsBack || name === 'transaction.commit';\n\n if (begins || ends) {\n const keys =\n input !== null && typeof input === 'object' && !isArray(input) ? objectKeys(input) : null;\n // A rollback can also name the error of the transaction body. The input is not read here:\n // the transport serializes it only after the call is reserved below.\n const describesError = rollsBack && keys !== null && keys.length === 1 && keys[0] === 'error';\n\n if (keys === null || (keys.length > 0 && !describesError)) {\n throw new HostError(\n 'Transaction controls accept an empty object. A rollback also accepts the error of the body.',\n 'invalid_arguments',\n 422,\n null\n );\n }\n\n if (!describesError) {\n input = {};\n }\n }\n\n if (this.closing || ((this.transactionOpen || begins) && this.pending > 0 && !rollsBack)) {\n throw new HostError(\n 'Await each capability call before starting another call while a transaction is active.',\n 'transaction_concurrent',\n 409,\n null\n );\n }\n\n const opens = begins && !this.transactionOpen;\n const closes = ends && this.transactionOpen;\n\n if (opens) {\n this.transactionOpen = true;\n }\n\n if (closes) {\n this.closing = true;\n }\n\n const previous = this.settled;\n let complete: (() => void) | undefined;\n let closed = closes;\n\n try {\n // Promise.all can reject while an accepted call still waits on PHP. Rollback must follow\n // that call, and no new call may enter while cleanup waits.\n if (rollsBack && closes && previous !== null) {\n await previous;\n }\n\n this.pending++;\n this.settled = new PromiseConstructor<void>((resolve) => {\n complete = resolve;\n });\n\n return await this.transport.call(name, input);\n } catch (error) {\n if (\n closes &&\n error instanceof HostError &&\n (error.code === 'invalid_arguments' ||\n error.code === 'resolver_not_allowed' ||\n error.code === 'capability_denied' ||\n error.code === 'payload_too_large' ||\n error.code === 'validation' ||\n error.code === 'transaction_concurrent')\n ) {\n closed = false;\n }\n\n if (opens) {\n this.transactionOpen = false;\n }\n\n throw error;\n } finally {\n if (complete !== undefined) {\n this.pending--;\n complete();\n\n if (this.pending === 0) {\n this.settled = null;\n }\n }\n\n if (closes) {\n this.transactionOpen = !closed;\n this.closing = false;\n }\n }\n }\n}\n","/sdk/transaction.ts":"import { HostError, type HostFailure } from './errors';\nimport type { TransactionRollbackInput } from './generated/capabilities';\nimport { invoke } from './transport';\n\ntype ThrownError = NonNullable<TransactionRollbackInput['error']>;\n\n/**\n * Runs `fn` in one database transaction. When a concurrent write aborts the transaction, the host\n * rolls it back and answers with `transaction_transient`, and `fn` runs again. The host limits the\n * attempts and waits between them, so `fn` can run more than once.\n */\nexport async function transaction<T>(fn: () => Promise<T>): Promise<T> {\n for (;;) {\n await invoke('transaction.begin', {});\n\n let result: T;\n\n try {\n result = await fn();\n } catch (error) {\n const rolledBack = await rollBack({ error: thrownError(error) });\n\n if (rolledBack.retry) {\n continue;\n }\n\n throw rollbackError(rolledBack.reply, error) ?? error;\n }\n\n // The host closes the transaction when a commit fails, so a rollback here would only hide the commit error.\n try {\n await invoke('transaction.commit', {});\n } catch (error) {\n if (isTransient(error)) {\n continue;\n }\n\n if (error instanceof HostError && error.code === 'transaction_concurrent') {\n await rollBack({});\n }\n\n throw error;\n }\n\n return result;\n }\n}\n\n/**\n * Rolls back the open transaction and says whether the host asks for another attempt. When the\n * input names the error of the body, the reply describes the error that `transaction()` throws in\n * its place.\n */\nasync function rollBack(\n input: TransactionRollbackInput\n): Promise<{ retry: true } | { retry: false; reply: unknown }> {\n try {\n return { retry: false, reply: await invoke<unknown>('transaction.rollback', input) };\n } catch (error) {\n if (isTransient(error)) {\n return { retry: true };\n }\n\n throw error;\n }\n}\n\nfunction isTransient(error: unknown): boolean {\n return error instanceof HostError && error.code === 'transaction_transient';\n}\n\n/**\n * The fields of a `done` error that the host needs to describe the failure of `error`. The host\n * keeps the failure of a host error that has a failure ID, so only that ID is sent. Of the\n * details, only the field errors are sent, because only they change the recorded failure.\n */\nfunction thrownError(error: unknown): ThrownError {\n if (typeof error !== 'object' || error === null) {\n // JSON.stringify throws for a BigInt, and the rollback must still be sent.\n const value = typeof error === 'bigint' ? String(error) : JSON.stringify(error);\n\n return { name: 'Error', message: `The workflow threw a non-error value: ${value}` };\n }\n\n const name: unknown = Reflect.get(error, 'name');\n const failureId: unknown = Reflect.get(error, 'failureId');\n\n if (name === 'HostError' && typeof failureId === 'number' && Number.isInteger(failureId)) {\n return { name, failure_id: failureId };\n }\n\n const message: unknown = Reflect.get(error, 'message');\n const code: unknown = Reflect.get(error, 'code');\n const status: unknown = Reflect.get(error, 'status');\n const details: unknown = Reflect.get(error, 'details');\n const errors: unknown =\n typeof details === 'object' && details !== null ? Reflect.get(details, 'errors') : undefined;\n\n const thrown: ThrownError = {\n name: typeof name === 'string' ? name : 'Error',\n message: String(message ?? 'The workflow threw an error.')\n };\n\n if (typeof code === 'string') {\n thrown.code = code;\n }\n\n if (typeof status === 'number' && Number.isInteger(status)) {\n thrown.status = status;\n }\n\n if (typeof errors === 'object' && errors !== null && !Array.isArray(errors)) {\n thrown.errors = { ...errors };\n }\n\n return thrown;\n}\n\n/**\n * The `transaction_rollback` error that the host described for the rollback, with the error of\n * the body as its cause. Its failure is the rollback payload that the error edge of a graph\n * Transaction step reads. A reply that describes no error, such as the null of a mock rollback,\n * gives null, and `transaction()` rethrows the error of the body.\n */\nfunction rollbackError(reply: unknown, cause: unknown): HostError | null {\n if (typeof reply !== 'object' || reply === null) {\n return null;\n }\n\n const message: unknown = Reflect.get(reply, 'message');\n const code: unknown = Reflect.get(reply, 'code');\n const status: unknown = Reflect.get(reply, 'status');\n const failureId: unknown = Reflect.get(reply, 'failure_id');\n const failure: unknown = Reflect.get(reply, 'failure');\n\n if (\n typeof message !== 'string' ||\n code !== 'transaction_rollback' ||\n typeof status !== 'number' ||\n typeof failureId !== 'number' ||\n !isFailure(failure)\n ) {\n return null;\n }\n\n return new HostError(message, code, status, Reflect.get(reply, 'details'), failureId, failure, {\n cause\n });\n}\n\nfunction isFailure(value: unknown): value is HostFailure {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n","/sdk/transport.ts":"export interface HostTransport {\n call(name: string, input: Record<string, unknown>): Promise<unknown>;\n}\n\nlet active: HostTransport | null = null;\n\nexport function setTransport(transport: HostTransport | null): void {\n active = transport;\n}\n\nexport function invoke<T>(name: string, input: object): Promise<T> {\n if (active === null) {\n return Promise.reject(\n new Error(\n 'No Diagonal host transport is set. In tests, call setTransport(new MockTransport(...)).'\n )\n );\n }\n\n return active.call(name, input as Record<string, unknown>) as Promise<T>;\n}\n","/sdk/workflow-config.ts":"/**\n * The options of `defineWorkflow(config, handler)` other than `input`, `output`, and `validate`.\n * The build reads them as static data, checks them, and removes them from the compiled script, so\n * the compiler sees only `input`, `output`, and `validate`. `@diagonal-hq/cli` replaces this\n * declaration with its `WorkflowConfig`, so the editor checks each option.\n */\nexport type WorkflowConfig = Record<never, never>;\n","/sdk/workflow.ts":"import type { ResourceKeyWith } from './data';\nimport { validationError } from './errors';\nimport type { ScriptHostContext } from './index';\nimport {\n coerceInput,\n type Infer,\n type InputField,\n InputSchema,\n type InferInput,\n type InputFieldSpec,\n type InputShape\n} from './input';\nimport type { WorkflowConfig } from './workflow-config';\n\nexport interface Identity {\n id: string;\n /** The identity's resource has the Authenticatable capability. */\n resourceId: ResourceKeyWith<'authenticatable'>;\n email: string | null;\n name: string | null;\n permissions: string[];\n}\n\nexport interface RequestContext {\n method: string;\n url: string;\n params: Record<string, string>;\n query: Record<string, unknown>;\n /** The request input: the payload with the query string values added. */\n body: Record<string, unknown>;\n /** The payload as the caller sent it, without the query string. */\n payload: Record<string, unknown>;\n /** Header names are lowercase. A header with more than one value joins them with `, `. */\n headers: Record<string, string>;\n /**\n * The raw value of each field that the request contract of the trigger declares, under its\n * declared key, as a graph `request.input` reference reads it. A field that the request does\n * not carry is absent. A header has its first value only.\n */\n declared: {\n params: Record<string, unknown>;\n query: Record<string, unknown>;\n headers: Record<string, unknown>;\n body: Record<string, unknown>;\n };\n}\n\nexport interface ScriptExecution {\n id: string;\n kind: 'workflow' | 'embedded';\n owner: { type: string; id: string };\n}\n\nexport interface WorkflowExecution extends ScriptExecution {\n kind: 'workflow';\n workflowId: string;\n}\n\nexport interface WorkflowContext {\n user: Identity | null;\n callingUser: Identity | null;\n trigger: Record<string, unknown>;\n request: RequestContext | null;\n workspace: { id: string; timezone: string };\n execution: ScriptHostContext extends { embedded: true } ? ScriptExecution : WorkflowExecution;\n now: string;\n}\n\nexport interface WorkflowDefinition<I, O> {\n readonly $diagonal: 'workflow';\n /** The declared input schema, when the workflow has one. */\n readonly input?: InputFieldSpec;\n /**\n * The `validate` option of the config, which runs before the handler with the same input. A\n * method, like `run`, so a definition stays assignable to a narrower input type.\n */\n validate?(input: I, ctx: WorkflowContext): ReturnType<InputValidator<I>>;\n /** Runs the handler with input that {@link parseWorkflowInput} already converted. */\n run(input: I, ctx: WorkflowContext): Promise<O>;\n}\n\n/**\n * Converts a run's raw input to the declared types. A runner calls it once and passes the result\n * to both `validateInput` and `run`, so the validator and the handler receive the same input.\n */\nexport function parseWorkflowInput<I>(workflow: WorkflowDefinition<I, unknown>, input: unknown): I {\n return (workflow.input === undefined ? input : coerceInput(workflow.input, input)) as I;\n}\n\n/**\n * The errors an input validator reports, keyed by input field. A key outside the input's own fields\n * (a nested path such as `tags.0`) is allowed; an empty or absent message means the field is valid.\n */\nexport type InputErrors<I> = Partial<Record<keyof I & string, string | string[]>> &\n Record<string, string | string[] | undefined>;\n\n/**\n * The `validate` option of a workflow config, or the `validateInput` export a script may define\n * beside its workflow. It runs before the handler with the same input and context; when it\n * reports any error, the run ends with a 422 and those errors, and the handler does not run.\n */\nexport type InputValidator<I> = (\n input: I,\n ctx: WorkflowContext\n) => InputErrors<I> | void | Promise<InputErrors<I> | void>;\n\n/** Runs a script's input validator and ends the run with a validation error when it reports one. */\nexport async function validateWorkflowInput<I>(\n validator: InputValidator<I>,\n input: I,\n ctx: WorkflowContext\n): Promise<void> {\n const reported = await validator(input, ctx);\n\n if (reported === undefined || reported === null) {\n return;\n }\n\n if (typeof reported !== 'object' || Array.isArray(reported)) {\n throw new TypeError(\n 'validateInput must return an object of errors keyed by field, or nothing.'\n );\n }\n\n const errors: Record<string, string[]> = {};\n\n for (const [field, messages] of Object.entries(reported)) {\n const list = (Array.isArray(messages) ? messages : [messages]).filter(\n (message): message is string => typeof message === 'string' && message !== ''\n );\n\n if (list.length > 0) {\n errors[field] = list;\n }\n }\n\n if (Object.keys(errors).length > 0) {\n validationError(errors);\n }\n}\n\ntype Handler<I, O> = (input: I, ctx: WorkflowContext) => Promise<O> | O;\n\n/** A declared output: any `v` field, usually `v.object({ ... })`. */\ntype OutputField = InputField<unknown, boolean>;\n\n/** The handler input of a config: the type of its `input` schema, or `I` without one. */\ntype ConfigInput<C, I> = C extends InputSchema<infer S> ? InferInput<S> : I;\n\n/**\n * A value of a declared output type that a handler may return. A const context makes a returned\n * array a readonly tuple, so arrays and objects may be readonly at every level.\n */\ntype Returnable<T> = T extends readonly (infer E)[]\n ? readonly Returnable<E>[]\n : T extends object\n ? { readonly [K in keyof T]: Returnable<T[K]> }\n : T;\n\n/** The handler result of a config: the type of its `output` schema, or `O` without one. */\ntype ConfigOutput<F, O> = F extends OutputField ? Infer<F> : O;\n\n// `O` comes only from the declared output, so the return value cannot widen it. `const` makes the\n// return a const context: a returned literal, such as a `v.select` option, keeps its literal type\n// while `O` is still unfixed.\n/**\n * Declares a workflow. A file-based workflow passes its config first, as `definePage` does. The\n * build reads the config as static data. With an `input` schema in the config, or a schema first,\n * the platform validates every run's input against it before the script starts, and the handler's\n * `input` type comes from the schema. A `validate` function in the config runs after that check\n * and before the handler, with the same input type. With an `output` schema in the config of a\n * file-based workflow, the handler must return a value of that type: the platform documents it as\n * the response of a Request workflow and verifies each return value against it.\n */\nexport function defineWorkflow<\n const O,\n C extends InputSchema<InputShape> | undefined = undefined,\n I = Record<string, unknown>\n>(\n config: WorkflowConfig & {\n readonly input?: C;\n readonly output: InputField<O, boolean>;\n readonly validate?: InputValidator<ConfigInput<C, I>>;\n },\n handler: Handler<ConfigInput<C, I>, Returnable<NoInfer<O>>>\n): WorkflowDefinition<ConfigInput<C, I>, O>;\nexport function defineWorkflow<S extends InputShape, O = unknown>(\n input: InputSchema<S>,\n handler: Handler<InferInput<S>, O>\n): WorkflowDefinition<InferInput<S>, O>;\nexport function defineWorkflow<I = Record<string, unknown>, O = unknown>(\n handler: Handler<I, O>\n): WorkflowDefinition<I, O>;\n// The general config signature is the last one, so a compile error in a config or its handler\n// reports this signature instead of an unrelated one.\nexport function defineWorkflow<\n I = Record<string, unknown>,\n O = unknown,\n C extends InputSchema<InputShape> | undefined = undefined,\n F extends OutputField | undefined = undefined\n>(\n config: WorkflowConfig & {\n readonly input?: C;\n readonly output?: F;\n readonly validate?: InputValidator<ConfigInput<C, I>>;\n },\n handler: Handler<ConfigInput<C, I>, ConfigOutput<F, O>>\n): WorkflowDefinition<ConfigInput<C, I>, ConfigOutput<F, O>>;\nexport function defineWorkflow<I, O>(\n first:\n | InputSchema<InputShape>\n | {\n readonly input?: InputSchema<InputShape>;\n readonly output?: OutputField;\n readonly validate?: InputValidator<I>;\n }\n | Handler<I, O>,\n maybeHandler?: Handler<I, O>\n): WorkflowDefinition<I, O> {\n if (typeof first === 'function') {\n return { $diagonal: 'workflow', run: async (input, ctx) => first(input, ctx) };\n }\n\n const schema = first instanceof InputSchema ? first : first.input;\n const validate = first instanceof InputSchema ? undefined : first.validate;\n const handler = maybeHandler;\n\n if (handler === undefined) {\n throw new TypeError(\n schema === first\n ? 'defineWorkflow(input, handler) needs a handler after the input schema.'\n : 'defineWorkflow(config, handler) needs a handler after the config.'\n );\n }\n\n if (validate !== undefined && typeof validate !== 'function') {\n throw new TypeError(\n 'The validate option of defineWorkflow(config, handler) must be a function.'\n );\n }\n\n return {\n $diagonal: 'workflow',\n ...(schema === undefined ? {} : { input: schema.$spec }),\n ...(validate === undefined ? {} : { validate }),\n run: async (input, ctx) => handler(input, ctx)\n };\n}\n\nexport type ResponseOutput = {\n $response_status: number;\n $response_body: unknown;\n $response_content_type: string;\n};\nexport type RedirectType = 'internal' | 'external' | 'back';\nexport type RedirectOutput = {\n redirect_url: string;\n redirect_type: RedirectType;\n permanent: boolean;\n success?: string;\n};\n\nexport function respond(\n body: unknown,\n options: { status?: number; contentType?: string } = {}\n): ResponseOutput {\n return {\n $response_status: options.status ?? 200,\n $response_body: body,\n $response_content_type: options.contentType ?? 'application/json'\n };\n}\n\n/**\n * Builds the output of a graph `http.redirect` step, with the same `redirect_type` and\n * `permanent` keys. Without a `type`, a path such as `/done` redirects as `internal`. Any other\n * URL, including a protocol-relative `//host`, redirects as `external`, because an Inertia\n * request cannot follow a plain redirect to another origin. A `back` redirect is never permanent.\n */\nexport function redirect(\n url: string,\n options: { success?: string; type?: RedirectType; permanent?: boolean } = {}\n): RedirectOutput {\n const type = options.type ?? (/^\\/(?![/\\\\])/.test(url) ? 'internal' : 'external');\n const output: RedirectOutput = {\n redirect_url: url,\n redirect_type: type,\n permanent: type !== 'back' && options.permanent === true\n };\n\n if (options.success !== undefined) {\n output.success = options.success;\n }\n\n return output;\n}\n","/sdk/workspace-values.ts":"import {\n workspace as generatedWorkspace,\n type WorkspaceSystemFields,\n type WorkspaceValuesInput\n} from './generated/capabilities';\nimport type { WorkspaceFieldCatalog } from './index';\nimport { invoke } from './transport';\n\ntype Fields = Omit<WorkspaceSystemFields, keyof WorkspaceFieldCatalog> & WorkspaceFieldCatalog;\ntype Property<T, K extends string> = T extends null | undefined\n ? never\n : T extends readonly (infer Item)[]\n ? K extends `${number}`\n ? K extends keyof T\n ? T[K]\n : Item\n : unknown\n : T extends object\n ? K extends keyof T\n ? T[K]\n : unknown\n : unknown;\ntype PathValue<T, P extends string> = P extends `${infer Head}.${infer Tail}`\n ? PathValue<Property<T, Head>, Tail>\n : Property<T, P>;\nexport type WorkspaceValue<K extends string> = K extends keyof Fields\n ? Fields[K]\n : K extends `${infer Key}.${infer Path}`\n ? Key extends keyof Fields\n ? PathValue<Fields[Key], Path>\n : unknown\n : unknown;\ntype DefaultValue<D> = Exclude<D, undefined> | (undefined extends D ? null : never);\ntype ReadValue<K extends string, D> =\n | Exclude<WorkspaceValue<K>, null | undefined>\n | DefaultValue<D>;\ntype WriteValue<K extends string> = K extends keyof Fields ? Fields[K] | null : unknown;\ntype WrittenValues<V> = { [K in keyof V]: K extends string ? WriteValue<K> : unknown };\nexport type WorkspaceValues = { [K in keyof Fields]: Fields[K] | null } & Record<string, unknown>;\n\nfunction value<K extends string, D>(input: { key: K; defaultValue: D }): Promise<ReadValue<K, D>>;\nfunction value<K extends string, D = never>(input: {\n key: K;\n defaultValue?: D;\n}): Promise<ReadValue<K, D | undefined>>;\nfunction value(input: { key: string; defaultValue?: unknown }): Promise<unknown> {\n return invoke('workspace.value', input);\n}\n\nexport const workspace = {\n ...generatedWorkspace,\n value,\n setValue: <K extends string>(input: { key: K; value?: WriteValue<NoInfer<K>> }) =>\n invoke<WriteValue<K>>('workspace.set_value', input),\n values: (input: WorkspaceValuesInput = {}) => invoke<WorkspaceValues>('workspace.values', input),\n setValues: <V extends Record<string, unknown> = Record<never, never>>(input: {\n values?: V & WrittenValues<NoInfer<V>>;\n }) => invoke<WrittenValues<V>>('workspace.set_values', input)\n};\n","/sdk/workspace.ts":"// The editor's slot for `@diagonal/workflow/workspace`: it replaces this file with the workspace's\n// declarations. Local runs import the file `diagonal-workflow pull-types` writes instead.\nexport const resources: Record<string, string> = {};\nexport const notificationTypes: Record<string, string> = {};\nexport const notificationTemplates: Record<string, Record<string, string>> = {};\n"},"surface":{"root":{"HostError":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"code":{"callable":false},"status":{"callable":false},"details":{"callable":false},"failureId":{"callable":false},"failure":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"WorkflowFailure":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"status":{"callable":false},"details":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"fail":{"value":true,"callable":true,"tasks":[]},"validationError":{"value":true,"callable":true,"tasks":[]},"HostFailure":{"value":false},"invoke":{"value":true,"callable":true,"tasks":[],"invoke":true},"setTransport":{"value":true,"callable":true,"tasks":[]},"HostTransport":{"value":false},"transaction":{"value":true,"callable":true,"tasks":["transaction.begin","transaction.commit","transaction.rollback"]},"Liquid":{"value":false},"declaredInput":{"value":true,"callable":false},"data":{"value":true,"callable":false,"members":{"create":{"callable":true,"tasks":["data.create"]},"find":{"callable":true,"tasks":["data.find"]},"update":{"callable":true,"tasks":["data.update"]},"search":{"callable":true,"tasks":["data.search"]},"each":{"callable":true,"tasks":["data.search"]},"delete":{"callable":true,"tasks":["data.delete"]},"restore":{"callable":true,"tasks":["data.restore"]},"count":{"callable":true,"tasks":["data.count"]},"findOrCreate":{"callable":true,"tasks":["data.find-or-create"]},"updateOrCreate":{"callable":true,"tasks":["data.update-or-create"]},"createMany":{"callable":true,"tasks":["data.create-many"]},"deleteMany":{"callable":true,"tasks":["data.delete-many"]},"aggregateMetrics":{"callable":true,"tasks":["data.aggregate_metrics"]},"relation":{"callable":false,"members":{"attach":{"callable":true,"tasks":["data.relation.attach"]},"attachMany":{"callable":true,"tasks":["data.relation.attach-many"]},"detach":{"callable":true,"tasks":["data.relation.detach"]},"detachMany":{"callable":true,"tasks":["data.relation.detach-many"]},"sync":{"callable":true,"tasks":["data.relation.sync"]}}},"semanticSearch":{"callable":true,"tasks":["data.semantic_search"]},"sum":{"callable":true,"tasks":["data.sum"]},"validate":{"callable":true,"tasks":["data.validate"]}}},"mail":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["mail.send-notification"]},"search":{"callable":true,"tasks":["mail.search"]},"send":{"callable":true,"tasks":["mail.send"]}}},"notification":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["notification.send-notification"]},"sendBulkNotifications":{"callable":true,"tasks":["notification.send-bulk-notifications"]},"setConsent":{"callable":true,"tasks":["notification.set-consent"]},"send":{"callable":true,"tasks":["notification.send"]}}},"sms":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["sms.send-notification"]}}},"workspace":{"value":true,"callable":false,"members":{"value":{"callable":true,"tasks":["workspace.value"]},"setValue":{"callable":true,"tasks":["workspace.set_value"]},"values":{"callable":true,"tasks":["workspace.values"]},"setValues":{"callable":true,"tasks":["workspace.set_values"]},"loginUrl":{"callable":true,"tasks":["workspace.login_url"]}}},"InputField":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"$value":{"callable":false},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]}}}}},"InputSchema":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"shape":{"callable":false},"$value":{"callable":false,"members":{}},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]}}}}},"v":{"value":true,"callable":false,"members":{"text":{"callable":true,"tasks":[]},"email":{"callable":true,"tasks":[]},"url":{"callable":true,"tasks":[]},"uuid":{"callable":true,"tasks":[]},"phone":{"callable":true,"tasks":[]},"date":{"callable":true,"tasks":[]},"datetime":{"callable":true,"tasks":[]},"time":{"callable":true,"tasks":[]},"timezone":{"callable":true,"tasks":[]},"color":{"callable":true,"tasks":[]},"number":{"callable":true,"tasks":[]},"integer":{"callable":true,"tasks":[]},"money":{"callable":true,"tasks":[]},"boolean":{"callable":true,"tasks":[]},"select":{"callable":true,"tasks":[]},"list":{"callable":true,"tasks":[]},"object":{"callable":true,"tasks":[]},"record":{"callable":true,"tasks":[]},"recordReference":{"callable":true,"tasks":[]},"roleReference":{"callable":true,"tasks":[]},"file":{"callable":true,"tasks":[]},"content":{"callable":true,"tasks":[]}}},"ContentDocument":{"value":false},"ContentNode":{"value":false},"ContentOptions":{"value":false},"FileVisibility":{"value":false},"Infer":{"value":false},"InferInput":{"value":false},"InputFieldKind":{"value":false},"InputFieldSpec":{"value":false},"InputShape":{"value":false},"Money":{"value":false},"RecordScope":{"value":false},"defineWorkflow":{"value":true,"callable":true,"tasks":[]},"parseWorkflowInput":{"value":true,"callable":true,"tasks":[]},"redirect":{"value":true,"callable":true,"tasks":[]},"respond":{"value":true,"callable":true,"tasks":[]},"validateWorkflowInput":{"value":true,"callable":true,"tasks":[]},"Identity":{"value":false},"InputErrors":{"value":false},"InputValidator":{"value":false},"RequestContext":{"value":false},"ScriptExecution":{"value":false},"WorkflowContext":{"value":false},"WorkflowDefinition":{"value":false},"WorkflowExecution":{"value":false},"ScriptHostContext":{"value":false},"WorkspaceResources":{"value":false},"WorkspaceFieldCatalog":{"value":false},"WorkspaceNotificationTypes":{"value":false},"SDK_VERSION":{"value":true,"callable":false},"WorkspaceSystemFields":{"value":false},"AiDecideInput":{"value":false},"AiDecideOutput":{"value":false},"AiRunPromptInput":{"value":false},"AiRunPromptOutput":{"value":false},"AuthImpersonateInput":{"value":false},"AuthImpersonateOutput":{"value":false},"AuthLoginInput":{"value":false},"AuthLoginOutput":{"value":false},"CalendarGenerateLinkInput":{"value":false},"CalendarGenerateLinkOutput":{"value":false},"CalendarSearchEventsInput":{"value":false},"CalendarSearchEventsOutput":{"value":false},"CallbackGetInput":{"value":false},"CallbackGetOutput":{"value":false},"CallbackRemoveInput":{"value":false},"CallbackRemoveOutput":{"value":false},"CallbackSetInput":{"value":false},"CallbackSetOutput":{"value":false},"ChartDistributionInput":{"value":false},"ChartDistributionOutput":{"value":false},"ChartKpiInput":{"value":false},"ChartKpiOutput":{"value":false},"ChartLeaderboardInput":{"value":false},"ChartLeaderboardOutput":{"value":false},"ChartTimeSeriesInput":{"value":false},"ChartTimeSeriesOutput":{"value":false},"DataAggregateMetricsInput":{"value":false},"DataAggregateMetricsOutput":{"value":false},"DataCountInput":{"value":false},"DataCountOutput":{"value":false},"DataCreateInput":{"value":false},"DataCreateOutput":{"value":false},"DataCreateManyInput":{"value":false},"DataCreateManyOutput":{"value":false},"DataDeleteInput":{"value":false},"DataDeleteOutput":{"value":false},"DataDeleteManyInput":{"value":false},"DataDeleteManyOutput":{"value":false},"DataFindInput":{"value":false},"DataFindOutput":{"value":false},"DataFindOrCreateInput":{"value":false},"DataFindOrCreateOutput":{"value":false},"DataRelationAttachInput":{"value":false},"DataRelationAttachOutput":{"value":false},"DataRelationAttachManyInput":{"value":false},"DataRelationAttachManyOutput":{"value":false},"DataRelationDetachInput":{"value":false},"DataRelationDetachOutput":{"value":false},"DataRelationDetachManyInput":{"value":false},"DataRelationDetachManyOutput":{"value":false},"DataRelationSyncInput":{"value":false},"DataRelationSyncOutput":{"value":false},"DataRestoreInput":{"value":false},"DataRestoreOutput":{"value":false},"DataSearchInput":{"value":false},"DataSearchOutput":{"value":false},"DataSemanticSearchInput":{"value":false},"DataSemanticSearchOutput":{"value":false},"DataSumInput":{"value":false},"DataSumOutput":{"value":false},"DataUpdateInput":{"value":false},"DataUpdateOutput":{"value":false},"DataUpdateOrCreateInput":{"value":false},"DataUpdateOrCreateOutput":{"value":false},"DataValidateInput":{"value":false},"DataValidateOutput":{"value":false},"DateAddInput":{"value":false},"DateAddOutput":{"value":false},"DateDiffInput":{"value":false},"DateDiffOutput":{"value":false},"DateEndOfInput":{"value":false},"DateEndOfOutput":{"value":false},"DateFormatInput":{"value":false},"DateFormatOutput":{"value":false},"DateStartOfInput":{"value":false},"DateStartOfOutput":{"value":false},"DateSubtractInput":{"value":false},"DateSubtractOutput":{"value":false},"FileChangeVisibilityInput":{"value":false},"FileChangeVisibilityOutput":{"value":false},"FileCreateFromUrlInput":{"value":false},"FileCreateFromUrlOutput":{"value":false},"FileCreateMediaLibraryItemInput":{"value":false},"FileCreateMediaLibraryItemOutput":{"value":false},"FileCreateQrCodeInput":{"value":false},"FileCreateQrCodeOutput":{"value":false},"GuardValidateInput":{"value":false},"GuardValidateOutput":{"value":false},"HttpRequestInput":{"value":false},"HttpRequestOutput":{"value":false},"LifecycleOutputInput":{"value":false},"LifecycleOutputOutput":{"value":false},"MailSearchInput":{"value":false},"MailSearchOutput":{"value":false},"MailSendInput":{"value":false},"MailSendOutput":{"value":false},"MailSendNotificationInput":{"value":false},"MailSendNotificationOutput":{"value":false},"MarkdownFromContentInput":{"value":false},"MarkdownFromContentOutput":{"value":false},"MarkdownToContentInput":{"value":false},"MarkdownToContentOutput":{"value":false},"MediaLibraryCreateFolderInput":{"value":false},"MediaLibraryCreateFolderOutput":{"value":false},"MediaLibraryDeleteItemInput":{"value":false},"MediaLibraryDeleteItemOutput":{"value":false},"MediaLibraryMoveItemsInput":{"value":false},"MediaLibraryMoveItemsOutput":{"value":false},"MediaLibraryUpdateItemInput":{"value":false},"MediaLibraryUpdateItemOutput":{"value":false},"MoneyFormatInput":{"value":false},"MoneyFormatOutput":{"value":false},"NotificationSendInput":{"value":false},"NotificationSendOutput":{"value":false},"NotificationSendBulkNotificationsInput":{"value":false},"NotificationSendBulkNotificationsOutput":{"value":false},"NotificationSendNotificationInput":{"value":false},"NotificationSendNotificationOutput":{"value":false},"NotificationSetConsentInput":{"value":false},"NotificationSetConsentOutput":{"value":false},"NumberFormatInput":{"value":false},"NumberFormatOutput":{"value":false},"PackageInstallInputInput":{"value":false},"PackageInstallInputOutput":{"value":false},"PageUrlInput":{"value":false},"PageUrlOutput":{"value":false},"PayablesVoidInput":{"value":false},"PayablesVoidOutput":{"value":false},"PayablesWriteOffInput":{"value":false},"PayablesWriteOffOutput":{"value":false},"PaymentCreateManualInput":{"value":false},"PaymentCreateManualOutput":{"value":false},"PaymentsChargeInput":{"value":false},"PaymentsChargeOutput":{"value":false},"PaymentsCheckoutInput":{"value":false},"PaymentsCheckoutOutput":{"value":false},"PaymentsConfirmInput":{"value":false},"PaymentsConfirmOutput":{"value":false},"PaymentsRefundInput":{"value":false},"PaymentsRefundOutput":{"value":false},"PaymentsVoidInput":{"value":false},"PaymentsVoidOutput":{"value":false},"PhoneFormatInput":{"value":false},"PhoneFormatOutput":{"value":false},"SchedulingBookSlotInput":{"value":false},"SchedulingBookSlotOutput":{"value":false},"SchedulingFindSlotsInput":{"value":false},"SchedulingFindSlotsOutput":{"value":false},"SchemaToJsonSchemaInput":{"value":false},"SchemaToJsonSchemaOutput":{"value":false},"SecurityRandomPasswordInput":{"value":false},"SecurityRandomPasswordOutput":{"value":false},"SmsSendNotificationInput":{"value":false},"SmsSendNotificationOutput":{"value":false},"SubscriptionsActivateInput":{"value":false},"SubscriptionsActivateOutput":{"value":false},"SubscriptionsCancelInput":{"value":false},"SubscriptionsCancelOutput":{"value":false},"SubscriptionsChangeItemsInput":{"value":false},"SubscriptionsChangeItemsOutput":{"value":false},"SubscriptionsCreateInput":{"value":false},"SubscriptionsCreateOutput":{"value":false},"SubscriptionsGenerateInvoiceInput":{"value":false},"SubscriptionsGenerateInvoiceOutput":{"value":false},"SubscriptionsPauseInput":{"value":false},"SubscriptionsPauseOutput":{"value":false},"SubscriptionsPreviewInput":{"value":false},"SubscriptionsPreviewOutput":{"value":false},"SubscriptionsPreviewChangeInput":{"value":false},"SubscriptionsPreviewChangeOutput":{"value":false},"SubscriptionsResumeInput":{"value":false},"SubscriptionsResumeOutput":{"value":false},"SubscriptionsSetUpcomingItemsInput":{"value":false},"SubscriptionsSetUpcomingItemsOutput":{"value":false},"TextGenerateInput":{"value":false},"TextGenerateOutput":{"value":false},"TextHashInput":{"value":false},"TextHashOutput":{"value":false},"TextRandomUuidInput":{"value":false},"TextRandomUuidOutput":{"value":false},"TextToContentInput":{"value":false},"TextToContentOutput":{"value":false},"TimeAddInput":{"value":false},"TimeAddOutput":{"value":false},"TimeDiffInput":{"value":false},"TimeDiffOutput":{"value":false},"TimeEndOfInput":{"value":false},"TimeEndOfOutput":{"value":false},"TimeFormatInput":{"value":false},"TimeFormatOutput":{"value":false},"TimeStartOfInput":{"value":false},"TimeStartOfOutput":{"value":false},"TimeSubtractInput":{"value":false},"TimeSubtractOutput":{"value":false},"TimezoneFormatInput":{"value":false},"TimezoneFormatOutput":{"value":false},"TimezoneInterpretInput":{"value":false},"TimezoneInterpretOutput":{"value":false},"TiptapParseInput":{"value":false},"TiptapParseOutput":{"value":false},"TransactionBeginInput":{"value":false},"TransactionBeginOutput":{"value":false},"TransactionCommitInput":{"value":false},"TransactionCommitOutput":{"value":false},"TransactionRollbackInput":{"value":false},"TransactionRollbackOutput":{"value":false},"UserAuthorizeInput":{"value":false},"UserAuthorizeOutput":{"value":false},"WebAgentInput":{"value":false},"WebAgentOutput":{"value":false},"WebBatchScrapeInput":{"value":false},"WebBatchScrapeOutput":{"value":false},"WebCrawlInput":{"value":false},"WebCrawlOutput":{"value":false},"WebExtractInput":{"value":false},"WebExtractOutput":{"value":false},"WebGoogleSearchInput":{"value":false},"WebGoogleSearchOutput":{"value":false},"WebMapInput":{"value":false},"WebMapOutput":{"value":false},"WebPdfInput":{"value":false},"WebPdfOutput":{"value":false},"WebScrapeInput":{"value":false},"WebScrapeOutput":{"value":false},"WebScreenshotInput":{"value":false},"WebScreenshotOutput":{"value":false},"WebSearchRankedInput":{"value":false},"WebSearchRankedOutput":{"value":false},"WorkflowRunInput":{"value":false},"WorkflowRunOutput":{"value":false},"WorkflowUrlInput":{"value":false},"WorkflowUrlOutput":{"value":false},"WorkspaceLoginUrlInput":{"value":false},"WorkspaceLoginUrlOutput":{"value":false},"WorkspaceSetValueInput":{"value":false},"WorkspaceSetValueOutput":{"value":false},"WorkspaceSetValuesInput":{"value":false},"WorkspaceSetValuesOutput":{"value":false},"WorkspaceValueInput":{"value":false},"WorkspaceValueOutput":{"value":false},"WorkspaceValuesInput":{"value":false},"WorkspaceValuesOutput":{"value":false},"ai":{"value":true,"callable":false,"members":{"decide":{"callable":true,"tasks":["ai.decide"]},"runPrompt":{"callable":true,"tasks":["ai.run_prompt"]}}},"auth":{"value":true,"callable":false,"members":{"impersonate":{"callable":true,"tasks":["auth.impersonate"]},"login":{"callable":true,"tasks":["auth.login"]}}},"calendar":{"value":true,"callable":false,"members":{"generateLink":{"callable":true,"tasks":["calendar.generate_link"]},"searchEvents":{"callable":true,"tasks":["calendar.search_events"]}}},"callback":{"value":true,"callable":false,"members":{"get":{"callable":true,"tasks":["callback.get"]},"remove":{"callable":true,"tasks":["callback.remove"]},"set":{"callable":true,"tasks":["callback.set"]}}},"chart":{"value":true,"callable":false,"members":{"distribution":{"callable":true,"tasks":["chart.distribution"]},"kpi":{"callable":true,"tasks":["chart.kpi"]},"leaderboard":{"callable":true,"tasks":["chart.leaderboard"]},"timeSeries":{"callable":true,"tasks":["chart.time_series"]}}},"date":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["date.add"]},"diff":{"callable":true,"tasks":["date.diff"]},"endOf":{"callable":true,"tasks":["date.end_of"]},"format":{"callable":true,"tasks":["date.format"]},"startOf":{"callable":true,"tasks":["date.start_of"]},"subtract":{"callable":true,"tasks":["date.subtract"]}}},"file":{"value":true,"callable":false,"members":{"changeVisibility":{"callable":true,"tasks":["file.change_visibility"]},"createFromUrl":{"callable":true,"tasks":["file.create_from_url"]},"createMediaLibraryItem":{"callable":true,"tasks":["file.create_media_library_item"]},"createQrCode":{"callable":true,"tasks":["file.create_qr_code"]}}},"guard":{"value":true,"callable":false,"members":{"validate":{"callable":true,"tasks":["guard.validate"]}}},"http":{"value":true,"callable":false,"members":{"request":{"callable":true,"tasks":["http.request"]}}},"lifecycle":{"value":true,"callable":false,"members":{"output":{"callable":true,"tasks":["lifecycle.output"]}}},"markdown":{"value":true,"callable":false,"members":{"fromContent":{"callable":true,"tasks":["markdown.from_content"]},"toContent":{"callable":true,"tasks":["markdown.to_content"]}}},"mediaLibrary":{"value":true,"callable":false,"members":{"createFolder":{"callable":true,"tasks":["media_library.create_folder"]},"deleteItem":{"callable":true,"tasks":["media_library.delete_item"]},"moveItems":{"callable":true,"tasks":["media_library.move_items"]},"updateItem":{"callable":true,"tasks":["media_library.update_item"]}}},"money":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["money.format"]}}},"number":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["number.format"]}}},"package":{"value":true,"callable":false,"members":{"installInput":{"callable":true,"tasks":["package.install-input"]}}},"page":{"value":true,"callable":false,"members":{"url":{"callable":true,"tasks":["page.url"]}}},"payables":{"value":true,"callable":false,"members":{"void":{"callable":true,"tasks":["payables.void"]},"writeOff":{"callable":true,"tasks":["payables.write-off"]}}},"payment":{"value":true,"callable":false,"members":{"createManual":{"callable":true,"tasks":["payment.create_manual"]}}},"payments":{"value":true,"callable":false,"members":{"charge":{"callable":true,"tasks":["payments.charge"]},"checkout":{"callable":true,"tasks":["payments.checkout"]},"confirm":{"callable":true,"tasks":["payments.confirm"]},"refund":{"callable":true,"tasks":["payments.refund"]},"void":{"callable":true,"tasks":["payments.void"]}}},"phone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["phone.format"]}}},"scheduling":{"value":true,"callable":false,"members":{"bookSlot":{"callable":true,"tasks":["scheduling.book_slot"]},"findSlots":{"callable":true,"tasks":["scheduling.find_slots"]}}},"schema":{"value":true,"callable":false,"members":{"toJsonSchema":{"callable":true,"tasks":["schema.to_json_schema"]}}},"security":{"value":true,"callable":false,"members":{"randomPassword":{"callable":true,"tasks":["security.random_password"]}}},"subscriptions":{"value":true,"callable":false,"members":{"activate":{"callable":true,"tasks":["subscriptions.activate"]},"cancel":{"callable":true,"tasks":["subscriptions.cancel"]},"changeItems":{"callable":true,"tasks":["subscriptions.change_items"]},"create":{"callable":true,"tasks":["subscriptions.create"]},"generateInvoice":{"callable":true,"tasks":["subscriptions.generate_invoice"]},"pause":{"callable":true,"tasks":["subscriptions.pause"]},"preview":{"callable":true,"tasks":["subscriptions.preview"]},"previewChange":{"callable":true,"tasks":["subscriptions.preview_change"]},"resume":{"callable":true,"tasks":["subscriptions.resume"]},"setUpcomingItems":{"callable":true,"tasks":["subscriptions.set_upcoming_items"]}}},"text":{"value":true,"callable":false,"members":{"generate":{"callable":true,"tasks":["text.generate"]},"hash":{"callable":true,"tasks":["text.hash"]},"randomUuid":{"callable":true,"tasks":["text.random_uuid"]},"toContent":{"callable":true,"tasks":["text.to_content"]}}},"time":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["time.add"]},"diff":{"callable":true,"tasks":["time.diff"]},"endOf":{"callable":true,"tasks":["time.end_of"]},"format":{"callable":true,"tasks":["time.format"]},"startOf":{"callable":true,"tasks":["time.start_of"]},"subtract":{"callable":true,"tasks":["time.subtract"]}}},"timezone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["timezone.format"]},"interpret":{"callable":true,"tasks":["timezone.interpret"]}}},"tiptap":{"value":true,"callable":false,"members":{"parse":{"callable":true,"tasks":["tiptap.parse"]}}},"user":{"value":true,"callable":false,"members":{"authorize":{"callable":true,"tasks":["user.authorize"]}}},"web":{"value":true,"callable":false,"members":{"agent":{"callable":true,"tasks":["web.agent"]},"batchScrape":{"callable":true,"tasks":["web.batch_scrape"]},"crawl":{"callable":true,"tasks":["web.crawl"]},"extract":{"callable":true,"tasks":["web.extract"]},"googleSearch":{"callable":true,"tasks":["web.google_search"]},"map":{"callable":true,"tasks":["web.map"]},"pdf":{"callable":true,"tasks":["web.pdf"]},"scrape":{"callable":true,"tasks":["web.scrape"]},"screenshot":{"callable":true,"tasks":["web.screenshot"]},"searchRanked":{"callable":true,"tasks":["web.search_ranked"]}}},"workflow":{"value":true,"callable":false,"members":{"run":{"callable":true,"tasks":["workflow.run"]},"url":{"callable":true,"tasks":["workflow.url"]}}}},"profiles":{"test":{"transaction":{"value":true,"callable":true,"tasks":["transaction.begin","transaction.commit","transaction.rollback"]},"data":{"value":true,"callable":false,"members":{"aggregateMetrics":{"callable":true,"tasks":["data.aggregate_metrics"]},"count":{"callable":true,"tasks":["data.count"]},"create":{"callable":true,"tasks":["data.create"]},"createMany":{"callable":true,"tasks":["data.create-many"]},"delete":{"callable":true,"tasks":["data.delete"]},"deleteMany":{"callable":true,"tasks":["data.delete-many"]},"find":{"callable":true,"tasks":["data.find"]},"findOrCreate":{"callable":true,"tasks":["data.find-or-create"]},"relation":{"callable":false,"members":{"attach":{"callable":true,"tasks":[]},"attachMany":{"callable":true,"tasks":[]},"detach":{"callable":true,"tasks":[]},"detachMany":{"callable":true,"tasks":[]},"sync":{"callable":true,"tasks":[]}}},"restore":{"callable":true,"tasks":["data.restore"]},"search":{"callable":true,"tasks":["data.search"]},"semanticSearch":{"callable":true,"tasks":["data.semantic_search"]},"sum":{"callable":true,"tasks":["data.sum"]},"update":{"callable":true,"tasks":["data.update"]},"updateOrCreate":{"callable":true,"tasks":["data.update-or-create"]},"validate":{"callable":true,"tasks":["data.validate"]},"each":{"callable":true,"tasks":[]}}},"HostError":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"code":{"callable":false},"status":{"callable":false},"details":{"callable":false},"failureId":{"callable":false},"failure":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"WorkflowFailure":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"status":{"callable":false},"details":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"fail":{"value":true,"callable":true,"tasks":[]},"validationError":{"value":true,"callable":true,"tasks":[]},"InputField":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"$value":{"callable":false},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]}}}}},"InputSchema":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"shape":{"callable":false},"$value":{"callable":false,"members":{}},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]}}}}},"v":{"value":true,"callable":false,"members":{"text":{"callable":true,"tasks":[]},"email":{"callable":true,"tasks":[]},"url":{"callable":true,"tasks":[]},"uuid":{"callable":true,"tasks":[]},"phone":{"callable":true,"tasks":[]},"date":{"callable":true,"tasks":[]},"datetime":{"callable":true,"tasks":[]},"time":{"callable":true,"tasks":[]},"timezone":{"callable":true,"tasks":[]},"color":{"callable":true,"tasks":[]},"number":{"callable":true,"tasks":[]},"integer":{"callable":true,"tasks":[]},"money":{"callable":true,"tasks":[]},"boolean":{"callable":true,"tasks":[]},"select":{"callable":true,"tasks":[]},"list":{"callable":true,"tasks":[]},"object":{"callable":true,"tasks":[]},"record":{"callable":true,"tasks":[]},"recordReference":{"callable":true,"tasks":[]},"roleReference":{"callable":true,"tasks":[]},"file":{"callable":true,"tasks":[]},"content":{"callable":true,"tasks":[]}}},"ContentDocument":{"value":false},"ContentNode":{"value":false},"ContentOptions":{"value":false},"FileVisibility":{"value":false},"Infer":{"value":false},"InferInput":{"value":false},"InputFieldKind":{"value":false},"InputFieldSpec":{"value":false},"InputShape":{"value":false},"Money":{"value":false},"RecordScope":{"value":false},"defineWorkflow":{"value":true,"callable":true,"tasks":[]},"parseWorkflowInput":{"value":true,"callable":true,"tasks":[]},"redirect":{"value":true,"callable":true,"tasks":[]},"respond":{"value":true,"callable":true,"tasks":[]},"validateWorkflowInput":{"value":true,"callable":true,"tasks":[]},"Identity":{"value":false},"InputErrors":{"value":false},"InputValidator":{"value":false},"RequestContext":{"value":false},"ScriptExecution":{"value":false},"WorkflowContext":{"value":false},"WorkflowDefinition":{"value":false},"WorkflowExecution":{"value":false},"ScriptHostContext":{"value":false},"WorkspaceFieldCatalog":{"value":false},"WorkspaceNotificationTypes":{"value":false},"WorkspaceResources":{"value":false},"ai":{"value":true,"callable":false,"members":{"decide":{"callable":true,"tasks":["ai.decide"]},"runPrompt":{"callable":true,"tasks":["ai.run_prompt"]}}},"calendar":{"value":true,"callable":false,"members":{"generateLink":{"callable":true,"tasks":["calendar.generate_link"]},"searchEvents":{"callable":true,"tasks":["calendar.search_events"]}}},"callback":{"value":true,"callable":false,"members":{"get":{"callable":true,"tasks":["callback.get"]},"remove":{"callable":true,"tasks":["callback.remove"]},"set":{"callable":true,"tasks":["callback.set"]}}},"chart":{"value":true,"callable":false,"members":{"distribution":{"callable":true,"tasks":["chart.distribution"]},"kpi":{"callable":true,"tasks":["chart.kpi"]},"leaderboard":{"callable":true,"tasks":["chart.leaderboard"]},"timeSeries":{"callable":true,"tasks":["chart.time_series"]}}},"date":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["date.add"]},"diff":{"callable":true,"tasks":["date.diff"]},"endOf":{"callable":true,"tasks":["date.end_of"]},"format":{"callable":true,"tasks":["date.format"]},"startOf":{"callable":true,"tasks":["date.start_of"]},"subtract":{"callable":true,"tasks":["date.subtract"]}}},"file":{"value":true,"callable":false,"members":{"changeVisibility":{"callable":true,"tasks":["file.change_visibility"]},"createFromUrl":{"callable":true,"tasks":["file.create_from_url"]},"createMediaLibraryItem":{"callable":true,"tasks":["file.create_media_library_item"]},"createQrCode":{"callable":true,"tasks":["file.create_qr_code"]}}},"guard":{"value":true,"callable":false,"members":{"validate":{"callable":true,"tasks":["guard.validate"]}}},"http":{"value":true,"callable":false,"members":{"request":{"callable":true,"tasks":["http.request"]}}},"lifecycle":{"value":true,"callable":false,"members":{"output":{"callable":true,"tasks":["lifecycle.output"]}}},"mail":{"value":true,"callable":false,"members":{"search":{"callable":true,"tasks":["mail.search"]},"send":{"callable":true,"tasks":["mail.send"]},"sendNotification":{"callable":true,"tasks":["mail.send-notification"]}}},"markdown":{"value":true,"callable":false,"members":{"fromContent":{"callable":true,"tasks":["markdown.from_content"]},"toContent":{"callable":true,"tasks":["markdown.to_content"]}}},"mediaLibrary":{"value":true,"callable":false,"members":{"createFolder":{"callable":true,"tasks":["media_library.create_folder"]},"deleteItem":{"callable":true,"tasks":["media_library.delete_item"]},"moveItems":{"callable":true,"tasks":["media_library.move_items"]},"updateItem":{"callable":true,"tasks":["media_library.update_item"]}}},"money":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["money.format"]}}},"notification":{"value":true,"callable":false,"members":{"send":{"callable":true,"tasks":["notification.send"]},"sendBulkNotifications":{"callable":true,"tasks":["notification.send-bulk-notifications"]},"sendNotification":{"callable":true,"tasks":["notification.send-notification"]},"setConsent":{"callable":true,"tasks":["notification.set-consent"]}}},"number":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["number.format"]}}},"package":{"value":true,"callable":false,"members":{"installInput":{"callable":true,"tasks":["package.install-input"]}}},"page":{"value":true,"callable":false,"members":{"url":{"callable":true,"tasks":["page.url"]}}},"payables":{"value":true,"callable":false,"members":{"void":{"callable":true,"tasks":["payables.void"]},"writeOff":{"callable":true,"tasks":["payables.write-off"]}}},"payment":{"value":true,"callable":false,"members":{"createManual":{"callable":true,"tasks":["payment.create_manual"]}}},"payments":{"value":true,"callable":false,"members":{"charge":{"callable":true,"tasks":["payments.charge"]},"checkout":{"callable":true,"tasks":["payments.checkout"]},"confirm":{"callable":true,"tasks":["payments.confirm"]},"refund":{"callable":true,"tasks":["payments.refund"]},"void":{"callable":true,"tasks":["payments.void"]}}},"phone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["phone.format"]}}},"scheduling":{"value":true,"callable":false,"members":{"bookSlot":{"callable":true,"tasks":["scheduling.book_slot"]},"findSlots":{"callable":true,"tasks":["scheduling.find_slots"]}}},"schema":{"value":true,"callable":false,"members":{"toJsonSchema":{"callable":true,"tasks":["schema.to_json_schema"]}}},"security":{"value":true,"callable":false,"members":{"randomPassword":{"callable":true,"tasks":["security.random_password"]}}},"sms":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["sms.send-notification"]}}},"subscriptions":{"value":true,"callable":false,"members":{"activate":{"callable":true,"tasks":["subscriptions.activate"]},"cancel":{"callable":true,"tasks":["subscriptions.cancel"]},"changeItems":{"callable":true,"tasks":["subscriptions.change_items"]},"create":{"callable":true,"tasks":["subscriptions.create"]},"generateInvoice":{"callable":true,"tasks":["subscriptions.generate_invoice"]},"pause":{"callable":true,"tasks":["subscriptions.pause"]},"preview":{"callable":true,"tasks":["subscriptions.preview"]},"previewChange":{"callable":true,"tasks":["subscriptions.preview_change"]},"resume":{"callable":true,"tasks":["subscriptions.resume"]},"setUpcomingItems":{"callable":true,"tasks":["subscriptions.set_upcoming_items"]}}},"text":{"value":true,"callable":false,"members":{"generate":{"callable":true,"tasks":["text.generate"]},"hash":{"callable":true,"tasks":["text.hash"]},"randomUuid":{"callable":true,"tasks":["text.random_uuid"]},"toContent":{"callable":true,"tasks":["text.to_content"]}}},"time":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["time.add"]},"diff":{"callable":true,"tasks":["time.diff"]},"endOf":{"callable":true,"tasks":["time.end_of"]},"format":{"callable":true,"tasks":["time.format"]},"startOf":{"callable":true,"tasks":["time.start_of"]},"subtract":{"callable":true,"tasks":["time.subtract"]}}},"timezone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["timezone.format"]},"interpret":{"callable":true,"tasks":["timezone.interpret"]}}},"tiptap":{"value":true,"callable":false,"members":{"parse":{"callable":true,"tasks":["tiptap.parse"]}}},"user":{"value":true,"callable":false,"members":{"authorize":{"callable":true,"tasks":["user.authorize"]}}},"web":{"value":true,"callable":false,"members":{"agent":{"callable":true,"tasks":["web.agent"]},"batchScrape":{"callable":true,"tasks":["web.batch_scrape"]},"crawl":{"callable":true,"tasks":["web.crawl"]},"extract":{"callable":true,"tasks":["web.extract"]},"googleSearch":{"callable":true,"tasks":["web.google_search"]},"map":{"callable":true,"tasks":["web.map"]},"pdf":{"callable":true,"tasks":["web.pdf"]},"scrape":{"callable":true,"tasks":["web.scrape"]},"screenshot":{"callable":true,"tasks":["web.screenshot"]},"searchRanked":{"callable":true,"tasks":["web.search_ranked"]}}},"workflow":{"value":true,"callable":false,"members":{"run":{"callable":true,"tasks":["workflow.run"]},"url":{"callable":true,"tasks":["workflow.url"]}}},"workspace":{"value":true,"callable":false,"members":{"loginUrl":{"callable":true,"tasks":["workspace.login_url"]},"setValue":{"callable":true,"tasks":["workspace.set_value"]},"setValues":{"callable":true,"tasks":["workspace.set_values"]},"value":{"callable":true,"tasks":["workspace.value"]},"values":{"callable":true,"tasks":["workspace.values"]}}}}},"ranges":{"data.search":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"data.count":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"data.aggregateMetrics":{"limit":{"minimum":1,"maximum":1000}},"data.semanticSearch":{"topK":{"minimum":1,"maximum":100}},"data.sum":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"mail.search":{"limit":{"minimum":1,"maximum":100}},"chart.distribution":{"limit":{"minimum":1,"maximum":50}},"chart.leaderboard":{"limit":{"minimum":1,"maximum":100}},"chart.timeSeries":{"limit":{"minimum":1,"maximum":1000}}},"rangesByType":{"ChartDistributionInput":{"limit":{"minimum":1,"maximum":50}},"ChartLeaderboardInput":{"limit":{"minimum":1,"maximum":100}},"ChartTimeSeriesInput":{"limit":{"minimum":1,"maximum":1000}},"DataAggregateMetricsInput":{"limit":{"minimum":1,"maximum":1000}},"DataCountInput":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"DataSearchInput":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"DataSemanticSearchInput":{"topK":{"minimum":1,"maximum":100}},"DataSumInput":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"MailSearchInput":{"limit":{"minimum":1,"maximum":100}}},"liquidSlots":{"mail.send":{"layoutData":["$references","content"]},"notification.send":{"layoutData":["$references","content"]}},"liquidSlotsByType":{"MailSendInput":{"layoutData":["$references","content"]},"NotificationSendInput":{"layoutData":["$references","content"]}},"augmentable":["WorkspaceFieldCatalog","WorkspaceNotificationTypes","WorkspaceResources"]},"profiles":{"workflow":{"label":"A workflow script","imports":["@diagonal/workflow","@diagonal/workflow/workspace"],"specifier":null,"entry":null,"defaultExports":["defineWorkflow"]},"test":{"label":"A test script","imports":["@diagonal/workflow","@diagonal-hq/workflows/test","@diagonal/workflow/workspace"],"specifier":"@diagonal-hq/workflows/test","entry":"/sdk/profiles/test.ts","defaultExports":["defineWorkflow"]}}}
|
|
1
|
+
{"files":{"/sdk/console.ts":"// The sandbox provides console, and the ES2023 lib does not declare it. These declarations merge\n// with the DOM and Node declarations when the SDK is used outside the sandbox.\ndeclare global {\n interface Console {\n log(...values: unknown[]): void;\n info(...values: unknown[]): void;\n warn(...values: unknown[]): void;\n error(...values: unknown[]): void;\n }\n\n var console: Console;\n}\n\nexport {};\n","/sdk/data.ts":"import {\n data as generatedData,\n type DataCountInput,\n type DataCreateInput,\n type DataCreateManyInput,\n type DataDeleteInput,\n type DataDeleteManyInput,\n type DataDeleteManyOutput,\n type DataFindInput,\n type DataFindOrCreateInput,\n type DataRestoreInput,\n type DataSearchInput,\n type DataSearchOutput,\n type DataUpdateInput,\n type DataUpdateOrCreateInput\n} from './generated/capabilities';\nimport type { WorkspaceResources } from './index';\nimport { invoke } from './transport';\n\ntype Entry = WorkspaceResources[keyof WorkspaceResources];\nexport type ResourceKey = [keyof WorkspaceResources] extends [never]\n ? string\n : Entry extends { id: infer I }\n ? I\n : never;\n/** The id of each entry of `E` that has every capability in `C`. */\ntype IdWithCapabilities<E, C extends string> = E extends {\n id: infer I;\n capabilities: infer Declared;\n}\n ? [C] extends [Declared]\n ? I\n : never\n : never;\n/**\n * The ids of the resources that have every capability in `C`. Any string while the workspace\n * declares no resources.\n */\nexport type ResourceKeyWith<C extends string> = [keyof WorkspaceResources] extends [never]\n ? string\n : IdWithCapabilities<Entry, C>;\ntype EntryFor<R> = Extract<Entry, { id: R }>;\nexport type InputOf<R> = [EntryFor<R>] extends [never]\n ? Record<string, unknown>\n : EntryFor<R> extends { input: infer I }\n ? I\n : never;\nexport type RecordOf<R> = [EntryFor<R>] extends [never]\n ? { id: string } & Record<string, unknown>\n : EntryFor<R> extends { record: infer T }\n ? T\n : never;\n\n/** The declared keys of `T`. `keyof` on a type with an index signature returns only `string | number`. */\ntype DeclaredKey<T> = keyof {\n [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];\n};\n\n/**\n * `DataSearchOutput` with `data` narrowed to the resource's record shape and `cursor` narrowed to\n * the cursor text. `pagination` stays as generated.\n */\ntype SearchOutput<R> = Pick<\n DataSearchOutput,\n Exclude<DeclaredKey<DataSearchOutput>, 'data' | 'cursor'>\n> & {\n data?: Array<RecordOf<R>>;\n /** With `paging: 'cursor'`, the `after` value for the next page. Null when no records are left. */\n cursor?: string | null;\n [key: string]: unknown;\n};\n\ntype EachInput<R> = Omit<DataSearchInput, 'resource' | 'page' | 'pageSize' | 'paging' | 'after'> & {\n resource: R;\n /** Stop after this many records. Leave it out to visit every match. */\n maxRecords?: number;\n};\n\n/** The page size of `data.each`. It is the largest page that `data.search` accepts. */\nconst EACH_PAGE_SIZE = 100;\n\n/**\n * Visit every record that the search matches, one record at a time. Use it in place of a loop\n * over `data.search` pages: it calls `data.search` with cursor paging and pages of 100 records. The\n * query is copied when `each` is called, so a change to the input object during the walk does\n * not change the pages.\n *\n * Each page continues after the last record of the page before it. A record that the loop body\n * updates so that it no longer matches, or deletes, does not move a later page. A body that\n * changes the value of a `sort` field can move a visited record after the cursor, and the walk\n * then visits it again. Sort on a field that the body does not change, or leave `sort` empty.\n */\nfunction each<R extends ResourceKey>(\n input: EachInput<R>\n): AsyncGenerator<RecordOf<R>, void, undefined> {\n const { maxRecords, ...search } = input;\n\n if (maxRecords !== undefined && (!Number.isInteger(maxRecords) || maxRecords < 1)) {\n throw new RangeError(`maxRecords must be a positive integer. Received ${maxRecords}.`);\n }\n\n const query: Omit<EachInput<R>, 'maxRecords'> = JSON.parse(JSON.stringify(search));\n\n return walk(query, maxRecords ?? Number.POSITIVE_INFINITY);\n}\n\nasync function* walk<R extends ResourceKey>(\n query: Omit<EachInput<R>, 'maxRecords'>,\n maxRecords: number\n): AsyncGenerator<RecordOf<R>, void, undefined> {\n let remaining = maxRecords;\n let after: string | null = null;\n\n while (remaining > 0) {\n const page: SearchOutput<R> = await invoke<SearchOutput<R>>('data.search', {\n ...query,\n paging: 'cursor',\n pageSize: Math.min(EACH_PAGE_SIZE, remaining),\n ...(after === null ? {} : { after })\n });\n\n for (const record of page.data ?? []) {\n yield record;\n remaining--;\n\n if (remaining === 0) {\n return;\n }\n }\n\n if (typeof page.cursor !== 'string') {\n return;\n }\n\n after = page.cursor;\n }\n}\n\n// Each call names its return type. Declaration emit otherwise writes the inferred type, and with\n// no workspace resources that resolves RecordOf<R> to the open record, so a workspace that\n// augments WorkspaceResources would still get untyped records from the published package.\nexport const data = {\n ...generatedData,\n create: <R extends ResourceKey>(\n input: Omit<DataCreateInput, 'resource' | 'data'> & { resource: R; data: InputOf<R> }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.create', input),\n find: <R extends ResourceKey>(\n input: Omit<DataFindInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.find', input),\n update: <R extends ResourceKey>(\n input: Omit<DataUpdateInput, 'resource' | 'data'> & { resource: R; data: InputOf<R> }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.update', input),\n /**\n * One page of the records that the search matches: 50 records by default, and at most 100 with\n * `pageSize`. To read every match, use `data.each`, which requests the pages for you.\n */\n search: <R extends ResourceKey>(\n input: Omit<DataSearchInput, 'resource'> & { resource: R }\n ): Promise<SearchOutput<R>> => invoke<SearchOutput<R>>('data.search', input),\n each,\n delete: <R extends ResourceKey>(\n input: Omit<DataDeleteInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.delete', input),\n restore: <R extends ResourceKey>(\n input: Omit<DataRestoreInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.restore', input),\n count: <R extends ResourceKey>(\n input: Omit<DataCountInput, 'resource'> & { resource: R }\n ): Promise<number> => invoke<number>('data.count', input),\n findOrCreate: <R extends ResourceKey>(\n input: Omit<DataFindOrCreateInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.find-or-create', input),\n updateOrCreate: <R extends ResourceKey>(\n input: Omit<DataUpdateOrCreateInput, 'resource'> & { resource: R }\n ): Promise<RecordOf<R>> => invoke<RecordOf<R>>('data.update-or-create', input),\n /** Create all of `records` in one call. The call has no limit on the number of records. */\n createMany: <R extends ResourceKey>(\n input: Omit<DataCreateManyInput, 'resource' | 'records'> & {\n resource: R;\n records: Array<InputOf<R>>;\n }\n ): Promise<Array<RecordOf<R>>> => invoke<Array<RecordOf<R>>>('data.create-many', input),\n deleteMany: <R extends ResourceKey>(\n input: Omit<DataDeleteManyInput, 'resource'> & { resource: R }\n ): Promise<DataDeleteManyOutput> => invoke<DataDeleteManyOutput>('data.delete-many', input)\n};\n","/sdk/errors.ts":"/**\n * The failure that a graph step records when its task throws, which the step's error edge reads.\n * A task failure has `type`, `message`, and `status_code`. An unexpected exception also has\n * `original_type`, a validation failure has `errors`, and a refused input has `invalid_input`.\n * A declared error is keyed by its type, and a failed child workflow gives its own failure.\n */\nexport type HostFailure = {\n type?: string;\n message?: string;\n original_type?: string;\n status_code?: number;\n errors?: Record<string, string[]>;\n invalid_input?: unknown;\n [key: string]: unknown;\n};\n\nexport class HostError extends Error {\n /**\n * @param failureId The host's ID for the failure of the call. When the error ends the run, the\n * host records that failure, so a run records the failure of the call that it rethrows.\n * @param failure The failure that a graph step records for the same error, or null for a\n * refusal that only a script call can receive, such as an unknown capability.\n * @param options `cause` is the error of a `transaction()` body that a `transaction_rollback`\n * error replaces.\n */\n constructor(\n message: string,\n readonly code: string,\n readonly status: number,\n readonly details: unknown,\n readonly failureId: number | null = null,\n readonly failure: HostFailure | null = null,\n options: ErrorOptions = {}\n ) {\n super(message, options);\n this.name = 'HostError';\n }\n}\n\nexport class WorkflowFailure extends Error {\n constructor(\n message: string,\n readonly status: number,\n readonly details: unknown = null\n ) {\n super(message);\n this.name = 'WorkflowFailure';\n }\n}\n\nexport function fail(message: string, options: { status?: number; details?: unknown } = {}): never {\n throw new WorkflowFailure(message, options.status ?? 400, options.details ?? null);\n}\n\nexport function validationError(\n errors: Record<string, string[]>,\n options: { message?: string } = {}\n): never {\n throw new WorkflowFailure(options.message ?? 'The given data was invalid.', 422, { errors });\n}\n","/sdk/generated/capabilities.ts":"// AUTO-GENERATED by `php artisan workflows:script-sdk:build`. Do not edit by hand.\nimport type { ResourceKeyWith } from '../data';\nimport type { ContentDocument } from '../input';\nimport type { DeepReadonly, Liquid, StaticLiquid } from '../liquid';\nimport { invoke } from '../transport';\n\nexport const SDK_VERSION = 83;\n\nexport interface WorkspaceSystemFields {\n \"ai_custom_system_prompt\": string | null;\n \"brand_kit\": { \"colors\"?: { \"light\"?: { \"--background\"?: string; \"--foreground\"?: string; \"--card\"?: string; \"--card-foreground\"?: string; \"--popover\"?: string; \"--popover-foreground\"?: string; \"--primary\"?: string; \"--primary-foreground\"?: string; \"--secondary\"?: string; \"--secondary-foreground\"?: string; \"--muted\"?: string; \"--muted-foreground\"?: string; \"--accent\"?: string; \"--accent-foreground\"?: string; \"--destructive\"?: string; \"--destructive-foreground\"?: string; \"--success\"?: string; \"--success-foreground\"?: string; \"--warning\"?: string; \"--warning-foreground\"?: string; \"--informative\"?: string; \"--informative-foreground\"?: string; \"--border\"?: string; \"--input\"?: string; \"--ring\"?: string; \"--chart-1\"?: string; \"--chart-2\"?: string; \"--chart-3\"?: string; \"--chart-4\"?: string; \"--chart-5\"?: string; \"--sidebar\"?: string; \"--sidebar-foreground\"?: string; \"--sidebar-primary\"?: string; \"--sidebar-primary-foreground\"?: string; \"--sidebar-accent\"?: string; \"--sidebar-accent-foreground\"?: string; \"--sidebar-border\"?: string; \"--sidebar-ring\"?: string } | null; \"dark\"?: { \"--background\"?: string; \"--foreground\"?: string; \"--card\"?: string; \"--card-foreground\"?: string; \"--popover\"?: string; \"--popover-foreground\"?: string; \"--primary\"?: string; \"--primary-foreground\"?: string; \"--secondary\"?: string; \"--secondary-foreground\"?: string; \"--muted\"?: string; \"--muted-foreground\"?: string; \"--accent\"?: string; \"--accent-foreground\"?: string; \"--destructive\"?: string; \"--destructive-foreground\"?: string; \"--success\"?: string; \"--success-foreground\"?: string; \"--warning\"?: string; \"--warning-foreground\"?: string; \"--informative\"?: string; \"--informative-foreground\"?: string; \"--border\"?: string; \"--input\"?: string; \"--ring\"?: string; \"--chart-1\"?: string; \"--chart-2\"?: string; \"--chart-3\"?: string; \"--chart-4\"?: string; \"--chart-5\"?: string; \"--sidebar\"?: string; \"--sidebar-foreground\"?: string; \"--sidebar-primary\"?: string; \"--sidebar-primary-foreground\"?: string; \"--sidebar-accent\"?: string; \"--sidebar-accent-foreground\"?: string; \"--sidebar-border\"?: string; \"--sidebar-ring\"?: string } | null } | null; \"typography\"?: { \"--font-sans\"?: string | null; \"--font-serif\"?: string | null; \"--font-mono\"?: string | null; \"--radius\"?: \"0rem\" | \"0.125rem\" | \"0.25rem\" | \"0.375rem\" | \"0.5rem\" | \"0.75rem\" } | null; \"shadows\"?: { \"light\"?: { \"--shadow-2xs\"?: \"none\" | \"0px 1px 1px 0px hsl(0 0% 0% \\/ 0.04)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-xs\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.05)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 2px 4px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-sm\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 1px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 3px 0px hsl(0 0% 0% \\/ 0.25), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-md\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-lg\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 10px 15px -3px hsl(0 0% 0% \\/ 0.25), 0px 4px 6px -4px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 20px 25px -5px hsl(0 0% 0% \\/ 0.25), 0px 8px 10px -6px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-2xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.45)\" | \"0px 25px 50px -12px hsl(0 0% 0% \\/ 0.5)\" } | null; \"dark\"?: { \"--shadow-2xs\"?: \"none\" | \"0px 1px 1px 0px hsl(0 0% 0% \\/ 0.04)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-xs\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.05)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.09)\" | \"0px 2px 4px 0px hsl(0 0% 0% \\/ 0.18)\"; \"--shadow-sm\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 1px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 3px 0px hsl(0 0% 0% \\/ 0.25), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 1px 2px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-md\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 2px 4px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 4px 6px -1px hsl(0 0% 0% \\/ 0.25), 0px 2px 4px -2px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-lg\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 4px 6px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 10px 15px -3px hsl(0 0% 0% \\/ 0.25), 0px 4px 6px -4px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.06), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.06)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18), 0px 8px 10px -1px hsl(0 0% 0% \\/ 0.18)\" | \"0px 20px 25px -5px hsl(0 0% 0% \\/ 0.25), 0px 8px 10px -6px hsl(0 0% 0% \\/ 0.25)\"; \"--shadow-2xl\"?: \"none\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.18)\" | \"0px 1px 2px 0px hsl(0 0% 0% \\/ 0.45)\" | \"0px 25px 50px -12px hsl(0 0% 0% \\/ 0.5)\" } | null } | null; \"logos\"?: { \"horizontal\"?: { \"dark\"?: string; \"light\"?: string } | null; \"icon\"?: { \"dark\"?: string; \"light\"?: string } | null; \"wordmark\"?: { \"dark\"?: string; \"light\"?: string } | null } | null; \"favicon\"?: { \"dark\"?: string; \"light\"?: string } | null; \"seo\"?: { \"title\"?: string | null; \"description\"?: string | null; \"og_image\"?: string } | null; \"design_profile\"?: string | null } | null;\n \"custom_401_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_403_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_404_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_422_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"custom_500_error_page\": string | { id: string; params?: Record<string, unknown> } | null;\n \"default_currency\": \"aed\" | \"ars\" | \"aud\" | \"brl\" | \"cad\" | \"chf\" | \"clp\" | \"cny\" | \"cop\" | \"czk\" | \"dkk\" | \"eur\" | \"gbp\" | \"hkd\" | \"idr\" | \"ils\" | \"inr\" | \"jpy\" | \"krw\" | \"mxn\" | \"myr\" | \"nok\" | \"nzd\" | \"pen\" | \"php\" | \"pln\" | \"sar\" | \"sek\" | \"sgd\" | \"thb\" | \"twd\" | \"usd\" | \"zar\" | null;\n \"default_timezone\": string | null;\n \"fathom_site_id\": string | null;\n \"head_html\": string | null;\n \"name\": string | null;\n \"sidebar_icon\": string | null;\n \"sidebar_icon_color\": string | null;\n \"slug\": string | null;\n \"website\": string | null;\n}\n\nexport interface AiDecideInput {\n state: unknown;\n questions: Array<{ key?: string; type?: \"choice\" | \"noul\" | \"score\"; instructions?: unknown; criteria?: Array<{ name?: string; description?: string; [key: string]: unknown; }>; [key: string]: unknown; }>;\n}\nexport type AiDecideOutput = Record<string, unknown>;\n\nexport interface AiRunPromptInput {\n prompt: unknown;\n attachments?: Array<string> | null;\n modelPreset?: \"auto\" | \"fast\" | \"balanced\" | \"smart\" | null;\n outputSchema?: unknown;\n strict?: boolean | null;\n}\nexport type AiRunPromptOutput = string;\n\nexport interface AuthImpersonateInput {\n resource: ResourceKeyWith<\"authenticatable\">;\n record: string;\n}\nexport type AuthImpersonateOutput = { success?: boolean; redirect_url?: unknown; error?: unknown; [key: string]: unknown; };\n\nexport interface AuthLoginInput {\n resource: ResourceKeyWith<\"authenticatable\">;\n record: string;\n}\nexport type AuthLoginOutput = boolean;\n\nexport interface CalendarGenerateLinkInput {\n type: \"apple\" | \"google\" | \"outlook\";\n resource: ResourceKeyWith<\"eventable\">;\n record: string;\n}\nexport type CalendarGenerateLinkOutput = unknown;\n\nexport interface CalendarSearchEventsInput {\n resource: ResourceKeyWith<\"eventable\">;\n from: string;\n to: string;\n filters?: unknown;\n relations?: Array<string>;\n}\nexport type CalendarSearchEventsOutput = { data?: Array<Record<string, unknown>>; [key: string]: unknown; };\n\nexport interface CallbackGetInput {\n key: string;\n default?: unknown;\n}\nexport type CallbackGetOutput = unknown;\n\nexport interface CallbackRemoveInput {\n key: string;\n}\nexport type CallbackRemoveOutput = string;\n\nexport interface CallbackSetInput {\n key?: string;\n value?: unknown;\n}\nexport type CallbackSetOutput = unknown;\n\nexport interface ChartDistributionInput {\n resource: string;\n categoryField: string;\n valueField?: string | null;\n filters?: unknown;\n /**\n * Maximum number of categories to show.\n * From 1 to 50.\n * @minimum 1\n * @maximum 50\n */\n limit?: number | null;\n}\nexport type ChartDistributionOutput = Array<{ category?: string; count?: number; total?: number; [key: string]: unknown; }>;\n\nexport interface ChartKpiInput {\n resource: string;\n metrics?: Array<{ name?: string; operation?: \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\" | \"distinct\"; field?: string; [key: string]: unknown; }>;\n filters?: unknown;\n}\nexport type ChartKpiOutput = Record<string, unknown>;\n\nexport interface ChartLeaderboardInput {\n resource: string;\n entityField: string;\n operation: \"count\" | \"sum\" | \"avg\";\n valueField?: string | null;\n metricName: string;\n filters?: unknown;\n /**\n * Number of top entries to return.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n limit: number;\n}\nexport type ChartLeaderboardOutput = Array<{ entity?: string; value?: number; count?: number; [key: string]: unknown; }>;\n\nexport interface ChartTimeSeriesInput {\n resource: string;\n dateField: string;\n granularity: \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\";\n metrics?: Array<{ name?: string; operation?: \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\"; field?: string; [key: string]: unknown; }>;\n filters?: unknown;\n /**\n * Maximum number of time periods to return.\n * From 1 to 1000.\n * @minimum 1\n * @maximum 1000\n */\n limit?: number | null;\n}\nexport type ChartTimeSeriesOutput = Array<Record<string, unknown>>;\n\nexport interface DataAggregateMetricsInput {\n resource: string;\n groupBy?: Array<string>;\n dateGranularity?: \"hour\" | \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\" | null;\n metrics?: Array<{ name?: string; operation?: \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\" | \"distinct\"; field?: string; [key: string]: unknown; }>;\n filters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n /**\n * Maximum number of groups to return.\n * From 1 to 1000.\n * @minimum 1\n * @maximum 1000\n */\n limit?: number | null;\n}\nexport type DataAggregateMetricsOutput = Array<Record<string, unknown>>;\n\nexport interface DataCountInput {\n resource: string;\n search?: string | null;\n filters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n relations?: Array<string>;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n /**\n * The page number.\n * At least 1.\n * @minimum 1\n */\n page?: number | null;\n /**\n * The number of records per page.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n pageSize?: number | null;\n}\nexport type DataCountOutput = number;\n\nexport interface DataCreateInput {\n resource: string;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataCreateOutput = Record<string, unknown>;\n\nexport interface DataCreateManyInput {\n resource: string;\n records: Array<Record<string, unknown>>;\n}\nexport type DataCreateManyOutput = Array<Record<string, unknown>>;\n\nexport interface DataDeleteInput {\n resource: string;\n record: string;\n confirmSideEffects?: boolean | null;\n operation?: Record<string, unknown> | null;\n}\nexport type DataDeleteOutput = Record<string, unknown>;\n\nexport interface DataDeleteManyInput {\n resource: string;\n filters: unknown;\n}\nexport type DataDeleteManyOutput = { deleted_count?: number; deleted_ids?: Array<string>; [key: string]: unknown; };\n\nexport interface DataFindInput {\n resource: string;\n mode?: \"filters\" | \"record\" | null;\n record?: string | null;\n filters?: unknown;\n requiredFilters?: unknown;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n relations?: Array<string>;\n}\nexport type DataFindOutput = Record<string, unknown>;\n\nexport interface DataFindOrCreateInput {\n resource: string;\n attributes: Record<string, unknown>;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataFindOrCreateOutput = Record<string, unknown>;\n\nexport interface DataRelationAttachInput {\n resource: string;\n record: string;\n relation: string;\n related: string;\n}\nexport type DataRelationAttachOutput = Record<string, unknown>;\n\nexport interface DataRelationAttachManyInput {\n resource: string;\n record: string;\n relation: string;\n relatedIds?: Array<string> | null;\n}\nexport type DataRelationAttachManyOutput = Record<string, unknown>;\n\nexport interface DataRelationDetachInput {\n resource: string;\n record: string;\n relation: string;\n related: string;\n}\nexport type DataRelationDetachOutput = Record<string, unknown>;\n\nexport interface DataRelationDetachManyInput {\n resource: string;\n record: string;\n relation: string;\n relatedIds?: Array<string>;\n}\nexport type DataRelationDetachManyOutput = Record<string, unknown>;\n\nexport interface DataRelationSyncInput {\n resource: string;\n record: string;\n relation: string;\n relatedIds?: Array<string>;\n}\nexport type DataRelationSyncOutput = Record<string, unknown>;\n\nexport interface DataRestoreInput {\n resource: string;\n record: string;\n}\nexport type DataRestoreOutput = Record<string, unknown>;\n\nexport interface DataSearchInput {\n resource: string;\n search?: string | null;\n filters?: unknown;\n requiredFilters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n relations?: Array<string>;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n /**\n * The page number.\n * At least 1.\n * @minimum 1\n */\n page?: number | null;\n /**\n * The number of records per page.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n pageSize?: number | null;\n paging?: \"cursor\" | \"page\" | null;\n after?: string | null;\n}\nexport type DataSearchOutput = { data?: Array<Record<string, unknown>>; pagination?: { total?: unknown; per_page?: unknown; current_page?: unknown; last_page?: unknown; [key: string]: unknown; }; [key: string]: unknown; };\n\nexport interface DataSemanticSearchInput {\n resource: string;\n query: string;\n filters?: unknown;\n /**\n * The maximum number of records to return.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n topK?: number | null;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n}\nexport type DataSemanticSearchOutput = { data?: Array<Record<string, unknown>>; scores?: Record<string, unknown>; [key: string]: unknown; };\n\nexport interface DataSumInput {\n resource: string;\n search?: string | null;\n filters?: unknown;\n sort?: Array<{ field?: string; direction?: \"asc\" | \"desc\"; [key: string]: unknown; }>;\n relations?: Array<string>;\n recordScope?: \"active\" | \"archived\" | \"activeOrArchived\" | null;\n /**\n * The page number.\n * At least 1.\n * @minimum 1\n */\n page?: number | null;\n /**\n * The number of records per page.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n pageSize?: number | null;\n field: string;\n}\nexport type DataSumOutput = number;\n\nexport interface DataUpdateInput {\n resource: string;\n mode?: \"filters\" | \"record\" | null;\n record?: string | null;\n filters?: unknown;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataUpdateOutput = Record<string, unknown>;\n\nexport interface DataUpdateOrCreateInput {\n resource: string;\n attributes: Record<string, unknown>;\n data: Record<string, unknown>;\n operation?: Record<string, unknown> | null;\n}\nexport type DataUpdateOrCreateOutput = Record<string, unknown>;\n\nexport interface DataValidateInput {\n resource: string;\n data: Record<string, unknown>;\n}\nexport type DataValidateOutput = unknown;\n\nexport interface DateAddInput {\n date: string;\n value: number;\n unit: \"days\" | \"months\" | \"weeks\" | \"years\";\n}\nexport type DateAddOutput = string;\n\nexport interface DateDiffInput {\n start: string;\n end: string;\n unit: \"days\" | \"months\" | \"weeks\" | \"years\";\n}\nexport type DateDiffOutput = number;\n\nexport interface DateEndOfInput {\n date: string;\n unit: \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type DateEndOfOutput = string;\n\nexport interface DateFormatInput {\n date: string;\n format: string;\n}\nexport type DateFormatOutput = string;\n\nexport interface DateStartOfInput {\n date: string;\n unit: \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type DateStartOfOutput = string;\n\nexport interface DateSubtractInput {\n date: string;\n value: number;\n unit: \"days\" | \"months\" | \"weeks\" | \"years\";\n}\nexport type DateSubtractOutput = string;\n\nexport interface FileChangeVisibilityInput {\n file: string;\n visibility: \"private\" | \"public\";\n}\nexport type FileChangeVisibilityOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface FileCreateFromUrlInput {\n url: string;\n}\nexport type FileCreateFromUrlOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface FileCreateMediaLibraryItemInput {\n file: string;\n folderId?: string | null;\n displayName?: string | null;\n}\nexport type FileCreateMediaLibraryItemOutput = { id?: string; workspace_id?: string; file_id?: string; folder_id?: unknown; display_name?: string; file?: { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; }; created_at?: unknown; updated_at?: unknown; [key: string]: unknown; };\n\nexport interface FileCreateQrCodeInput {\n value: string;\n size?: number | null;\n errorCorrection?: \"L\" | \"M\" | \"Q\" | \"H\" | null;\n}\nexport type FileCreateQrCodeOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface GuardValidateInput {\n value?: unknown;\n guard?: Array<string> | Record<string, unknown> | null;\n haltOnFailure?: boolean;\n}\nexport type GuardValidateOutput = boolean;\n\nexport interface HttpRequestInput {\n url: string;\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\" | \"OPTIONS\" | \"HEAD\";\n headers?: Array<{ key?: string; value?: string; [key: string]: unknown; }> | null;\n body?: Record<string, unknown> | null;\n query?: Array<{ key?: string; value?: string; [key: string]: unknown; }> | null;\n}\nexport type HttpRequestOutput = { status?: unknown; headers?: Record<string, unknown>; response?: string; [key: string]: unknown; };\n\nexport interface LifecycleOutputInput {\n record?: unknown;\n}\nexport type LifecycleOutputOutput = Record<string, unknown>;\n\nexport interface MailSearchInput {\n emails?: Array<string> | null;\n resource?: string | null;\n record?: string | null;\n includeCurrentAddresses?: boolean | null;\n emailField?: string | null;\n subjectContains?: string | null;\n fromAddress?: string | null;\n statuses?: Array<\"bounced\" | \"deferred\" | \"delivered\" | \"dropped\" | \"failed\" | \"sending\" | \"sent\" | \"spam_reported\" | \"suppressed\"> | null;\n dateFrom?: string | null;\n dateBefore?: string | null;\n /**\n * Maximum number of emails to return, newest first. Total still counts every match.\n * From 1 to 100.\n * @minimum 1\n * @maximum 100\n */\n limit?: number | null;\n}\nexport type MailSearchOutput = { total?: number; messages?: Array<{ id?: string; subject?: unknown; status?: \"bounced\" | \"deferred\" | \"delivered\" | \"dropped\" | \"failed\" | \"sending\" | \"sent\" | \"spam_reported\" | \"suppressed\"; recorded_at?: unknown; recipients?: Array<{ address?: string; status?: \"bounced\" | \"deferred\" | \"delivered\" | \"dropped\" | \"failed\" | \"sending\" | \"sent\" | \"spam_reported\" | \"suppressed\"; bounce_type?: \"hard\" | \"soft\"; reason?: unknown; last_event_at?: unknown; [key: string]: unknown; }>; [key: string]: unknown; }>; [key: string]: unknown; };\n\nexport interface MailSendInput {\n to: Array<string>;\n cc?: Array<string> | null;\n bcc?: Array<string> | null;\n replyTo?: Array<string> | null;\n subject: Liquid;\n emailLayout?: string | null;\n /**\n * A value composed from other values fails the compile: the layout can render it as Liquid.\n * @liquidSlots $references\n */\n layoutData?: { content?: Liquid; [key: string]: unknown; };\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type MailSendOutput = { success?: boolean; status_message?: string; recipients?: { to?: Array<string>; cc?: Array<string>; bcc?: Array<string>; reply_to?: Array<string>; [key: string]: unknown; }; subject?: string; content?: string; attachments?: Array<{ id?: string; name?: string; mime?: string; [key: string]: unknown; }>; [key: string]: unknown; };\n\nexport interface MailSendNotificationInput {\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n to: Array<string>;\n cc?: Array<string> | null;\n bcc?: Array<string> | null;\n replyTo?: Array<string> | null;\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type MailSendNotificationOutput = { success?: boolean; status_message?: string; recipients?: { to?: Array<string>; cc?: Array<string>; bcc?: Array<string>; reply_to?: Array<string>; [key: string]: unknown; }; subject?: string; content?: string; attachments?: Array<{ id?: string; name?: string; mime?: string; [key: string]: unknown; }>; [key: string]: unknown; };\n\nexport interface MarkdownFromContentInput {\n value?: unknown;\n}\nexport type MarkdownFromContentOutput = string;\n\nexport interface MarkdownToContentInput {\n value: string;\n}\nexport type MarkdownToContentOutput = ContentDocument;\n\nexport interface MediaLibraryCreateFolderInput {\n name: string;\n parentId?: string | null;\n}\nexport type MediaLibraryCreateFolderOutput = string;\n\nexport interface MediaLibraryDeleteItemInput {\n itemId: string;\n}\nexport type MediaLibraryDeleteItemOutput = string;\n\nexport interface MediaLibraryMoveItemsInput {\n itemIds: Array<string>;\n folderId?: string | null;\n}\nexport type MediaLibraryMoveItemsOutput = Array<string>;\n\nexport interface MediaLibraryUpdateItemInput {\n mediaLibraryItemId: string;\n displayName?: string | null;\n folderId?: string | null;\n}\nexport type MediaLibraryUpdateItemOutput = { id?: string; workspace_id?: string; file_id?: string; folder_id?: unknown; display_name?: string; file?: { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; }; created_at?: unknown; updated_at?: unknown; [key: string]: unknown; };\n\nexport interface MoneyFormatInput {\n value?: { amount: number; currency: string; [key: string]: unknown; } | null;\n}\nexport type MoneyFormatOutput = string;\n\nexport interface NotificationSendInput {\n resource: ResourceKeyWith<\"notifiable\">;\n relations?: Array<string>;\n record: string;\n subject: Liquid;\n emailLayout?: string | null;\n /**\n * A value composed from other values fails the compile: the layout can render it as Liquid.\n * @liquidSlots $references\n */\n layoutData?: { content?: Liquid; [key: string]: unknown; };\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type NotificationSendOutput = boolean;\n\nexport interface NotificationSendBulkNotificationsInput {\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n resource: string;\n filters?: unknown;\n recipient: unknown;\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n idempotencyKey?: string | null;\n}\nexport type NotificationSendBulkNotificationsOutput = { processed_count: number; queued_count: number; failed_count: number; duplicate_count: number; failures?: Array<{ record_id: string; errors?: Record<string, unknown>; [key: string]: unknown; }>; failures_truncated: boolean; [key: string]: unknown; };\n\nexport interface NotificationSendNotificationInput {\n deliveryChannel?: \"email\" | \"sms\" | \"email_and_sms\";\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n idempotencyKey?: string | null;\n recipient: unknown;\n records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }> | null;\n attachments?: Array<string> | null;\n calendarEvents?: Array<{ resource_id?: string; record_id?: string; [key: string]: unknown; }> | null;\n}\nexport type NotificationSendNotificationOutput = boolean;\n\nexport interface NotificationSetConsentInput {\n resource: ResourceKeyWith<\"notifiable\">;\n record: string;\n sms?: boolean | null;\n email?: boolean | null;\n}\nexport type NotificationSetConsentOutput = { email?: boolean; sms?: boolean; changed_at?: string; [key: string]: unknown; };\n\nexport interface NumberFormatInput {\n value?: number | null;\n decimals?: number;\n}\nexport type NumberFormatOutput = string;\n\nexport interface PackageInstallInputInput {\n package_id: string;\n key: string;\n}\nexport type PackageInstallInputOutput = unknown;\n\nexport interface PageUrlInput {\n page: { id: string; params?: Record<string, unknown>; [key: string]: unknown; };\n}\nexport type PageUrlOutput = unknown;\n\nexport interface PayablesVoidInput {\n reason?: string | null;\n effectiveDate?: string | null;\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n}\nexport type PayablesVoidOutput = { status?: string; [key: string]: unknown; };\n\nexport interface PayablesWriteOffInput {\n lineAllocations?: unknown[] | null;\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n adjustmentResource: ResourceKeyWith<\"payable_adjustment\">;\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n effectiveAt?: string | null;\n description?: string | null;\n}\nexport type PayablesWriteOffOutput = Record<string, unknown>;\n\nexport interface PaymentCreateManualInput {\n resource: ResourceKeyWith<\"payment\">;\n payableRecord: string;\n amount: { amount: number; currency: string; [key: string]: unknown; };\n paidAt?: string | null;\n payerRecord?: string | null;\n notes?: string | null;\n}\nexport type PaymentCreateManualOutput = Record<string, unknown>;\n\nexport interface PaymentsChargeInput {\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n description?: string | null;\n payerRecord?: string | null;\n paymentMethodId?: string | null;\n}\nexport type PaymentsChargeOutput = Record<string, unknown>;\n\nexport interface PaymentsCheckoutInput {\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n successUrl: string;\n cancelUrl?: string | null;\n description?: string | null;\n}\nexport type PaymentsCheckoutOutput = { checkout_url?: string; session_id?: string; [key: string]: unknown; };\n\nexport interface PaymentsConfirmInput {\n payableResource: ResourceKeyWith<\"payable\">;\n payableRecord: string;\n confirmationTokenId?: string | null;\n paymentMethodId?: string | null;\n paymentAttemptId?: string | null;\n expectedTotal: { amount: number; currency: string; [key: string]: unknown; };\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n savePaymentMethod?: boolean | null;\n setPaymentMethodAsDefault?: boolean | null;\n}\nexport type PaymentsConfirmOutput = { payment_intent_id: string; payment_record_id: string; status: string; client_secret?: unknown; [key: string]: unknown; };\n\nexport interface PaymentsRefundInput {\n resource: ResourceKeyWith<\"payment\">;\n record: string;\n amount?: { amount: number; currency: string; [key: string]: unknown; } | null;\n invoiceBalance?: \"credit\" | \"reopen\" | null;\n reason?: string | null;\n}\nexport type PaymentsRefundOutput = Record<string, unknown>;\n\nexport interface PaymentsVoidInput {\n resource: ResourceKeyWith<\"payment\">;\n record: string;\n reason: string;\n}\nexport type PaymentsVoidOutput = Record<string, unknown>;\n\nexport interface PhoneFormatInput {\n phone?: string | null;\n format?: \"e164\" | \"international\" | \"national\" | \"rfc3966\" | null;\n}\nexport type PhoneFormatOutput = string;\n\nexport interface SchedulingBookSlotInput {\n bookingResource: string;\n start: string;\n search: { bookingResource: string; groups: Array<{ mode?: \"all\" | \"any\"; strategy?: \"first_available\" | \"least_booked\" | \"round_robin\"; records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }>; [key: string]: unknown; }>; from: string; to: string; durationMinutes: number; stepMinutes?: number | null; noticeMinutes?: number | null; maxAdvanceDays?: number | null; quantity?: number | null; maxSlots?: number | null; timezone?: string | null; seed?: string | null; } | Record<string, unknown>;\n relations: Array<string>;\n data?: Record<string, unknown> | null;\n}\nexport type SchedulingBookSlotOutput = Record<string, unknown>;\n\nexport interface SchedulingFindSlotsInput {\n bookingResource: string;\n groups: Array<{ mode?: \"all\" | \"any\"; strategy?: \"first_available\" | \"least_booked\" | \"round_robin\"; records?: Array<{ resource_id?: string; id?: string; [key: string]: unknown; }>; [key: string]: unknown; }>;\n from: string;\n to: string;\n durationMinutes: number;\n stepMinutes?: number | null;\n noticeMinutes?: number | null;\n maxAdvanceDays?: number | null;\n quantity?: number | null;\n maxSlots?: number | null;\n timezone?: string | null;\n seed?: string | null;\n}\nexport type SchedulingFindSlotsOutput = Record<string, unknown>;\n\nexport interface SchemaToJsonSchemaInput {\n schema: unknown;\n}\nexport type SchemaToJsonSchemaOutput = Record<string, unknown>;\n\nexport interface SecurityRandomPasswordInput {\n passwordLength?: number | null;\n}\nexport type SecurityRandomPasswordOutput = string;\n\nexport interface SmsSendNotificationInput {\n notificationType: string;\n notificationTemplate?: string | null;\n variables?: Record<string, unknown>;\n recipient: unknown;\n}\nexport type SmsSendNotificationOutput = Record<string, unknown>;\n\nexport interface SubscriptionsActivateInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsActivateOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsCancelInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n atPeriodEnd?: boolean | null;\n}\nexport type SubscriptionsCancelOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsChangeItemsInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n items: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: \"catalog\" | \"custom\"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }>;\n effective?: \"now\" | \"next_renewal\" | \"period\" | null;\n periodStart?: string | null;\n prorationBehavior?: \"prorate\" | \"none\" | null;\n revisionScope?: \"this_renewal\" | \"this_and_following\" | null;\n confirmedQuote?: string | null;\n reason?: string | null;\n}\nexport type SubscriptionsChangeItemsOutput = { changed?: boolean; invoice?: unknown; preview?: { mode?: string; effective?: string; proration_behavior?: string; changed?: boolean; currency?: string; timezone?: string; effective_date?: string; period_start?: unknown; period_end?: unknown; days_in_period?: unknown; days_remaining?: unknown; items?: Array<{ price_record_id?: string; quantity?: number; pricing?: string; catalog_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; current_unit_price?: unknown; effective_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; charges?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; credits?: Array<{ description?: string; quantity?: number; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; amount?: { amount: number; currency: string; [key: string]: unknown; }; gross_amount?: { amount: number; currency: string; [key: string]: unknown; }; source_invoice_record_id?: string; source_line_record_id?: string; covered_start?: string; covered_end?: string; [key: string]: unknown; }>; applied_to_invoices?: Array<{ invoice_record_id?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; renewal?: unknown; revision?: unknown; schedule?: unknown; replaces_upcoming_items?: boolean; quote?: string; charge_total?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_total?: { amount: number; currency: string; [key: string]: unknown; }; amount_due?: { amount: number; currency: string; [key: string]: unknown; }; net_credit?: { amount: number; currency: string; [key: string]: unknown; }; applied_to_invoices_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_to_balance?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_before?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_after?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; };\n\nexport interface SubscriptionsCreateInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n accountingEntity?: string | null;\n payerRecord: string;\n priceRecordIds?: Array<string> | null;\n items?: Array<{ price_record_id?: string; quantity?: number; [key: string]: unknown; }> | null;\n discounts?: Array<{ calculation_type?: \"fixed_amount\" | \"percentage\"; duration?: \"every_invoice\" | \"first_invoice\" | \"specific_period\"; percent?: number; fixed_amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: string; description?: string; [key: string]: unknown; }> | null;\n confirmedQuote?: string | null;\n requireConfirmedQuote?: boolean | null;\n collectionMethod?: \"charge_automatically\" | \"send_invoice\" | null;\n gracePeriodDays?: number | null;\n billingCycleMode?: \"anniversary\" | \"calendar_aligned\" | null;\n billingAnchorMonth?: number | null;\n billingAnchorDay?: number | null;\n activationPolicy?: \"after_first_payment\" | \"immediate\" | null;\n initialTermAnchor?: \"first_payment_at\" | \"subscription_created_at\" | null;\n initialPaymentWindowDays?: number | null;\n startedAt?: string | null;\n trialDays?: number | null;\n trialEndsAt?: string | null;\n trialPaymentMethodPolicy?: \"optional\" | \"required\" | null;\n lapseBillingBehavior?: \"continue_billing\" | \"suspend_renewals\" | \"cancel\" | null;\n generateInvoice?: boolean | null;\n}\nexport type SubscriptionsCreateOutput = { record?: Record<string, unknown>; invoice?: unknown; invoices?: Array<Record<string, unknown>>; [key: string]: unknown; };\n\nexport interface SubscriptionsGenerateInvoiceInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsGenerateInvoiceOutput = { record?: unknown; created?: boolean; period_start?: string; period_end?: string; renewal_outcome?: \"canceled\" | \"not_due\" | \"processed\" | \"suspended\"; [key: string]: unknown; };\n\nexport interface SubscriptionsPauseInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsPauseOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsPreviewInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n priceRecordIds?: Array<string> | null;\n items?: Array<{ price_record_id?: string; quantity?: number; [key: string]: unknown; }> | null;\n discounts?: Array<{ calculation_type?: \"fixed_amount\" | \"percentage\"; duration?: \"every_invoice\" | \"first_invoice\" | \"specific_period\"; percent?: number; fixed_amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: string; description?: string; [key: string]: unknown; }> | null;\n collectionMethod?: \"charge_automatically\" | \"send_invoice\" | null;\n gracePeriodDays?: number | null;\n billingCycleMode?: \"anniversary\" | \"calendar_aligned\" | null;\n billingAnchorMonth?: number | null;\n billingAnchorDay?: number | null;\n activationPolicy?: \"after_first_payment\" | \"immediate\" | null;\n initialTermAnchor?: \"first_payment_at\" | \"subscription_created_at\" | null;\n initialPaymentWindowDays?: number | null;\n startedAt?: string | null;\n trialDays?: number | null;\n trialEndsAt?: string | null;\n trialPaymentMethodPolicy?: \"optional\" | \"required\" | null;\n lapseBillingBehavior?: \"continue_billing\" | \"suspend_renewals\" | \"cancel\" | null;\n}\nexport type SubscriptionsPreviewOutput = { currency?: string; billing_cycle_mode?: string; interval?: string; timezone?: string; discounts?: unknown; initial?: { lines?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; total?: { amount: number; currency: string; [key: string]: unknown; }; covered_start?: string; covered_end?: string; reference_start?: string; reference_end?: string; days_charged?: number; days_in_period?: number; is_prorated?: boolean; [key: string]: unknown; }; additional_invoices?: Array<{ lines?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; total?: { amount: number; currency: string; [key: string]: unknown; }; covered_start?: string; covered_end?: string; reference_start?: string; reference_end?: string; days_charged?: number; days_in_period?: number; is_prorated?: boolean; [key: string]: unknown; }>; renewal?: { next_renewal_date?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; subtotal?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }; trial_ends_at?: unknown; first_paid_invoice?: unknown; quote?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsPreviewChangeInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n items: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: \"catalog\" | \"custom\"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }>;\n effective?: \"now\" | \"next_renewal\" | \"period\" | null;\n periodStart?: string | null;\n prorationBehavior?: \"prorate\" | \"none\" | null;\n revisionScope?: \"this_renewal\" | \"this_and_following\" | null;\n}\nexport type SubscriptionsPreviewChangeOutput = { mode?: string; effective?: string; proration_behavior?: string; changed?: boolean; currency?: string; timezone?: string; effective_date?: string; period_start?: unknown; period_end?: unknown; days_in_period?: unknown; days_remaining?: unknown; items?: Array<{ price_record_id?: string; quantity?: number; pricing?: string; catalog_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; current_unit_price?: unknown; effective_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; charges?: Array<{ price_record_id?: string; description?: string; quantity?: number; is_one_time?: boolean; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; line_total?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; discounts?: Array<{ description?: string; duration?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; period_start?: unknown; [key: string]: unknown; }>; credits?: Array<{ description?: string; quantity?: number; full_unit_price?: { amount: number; currency: string; [key: string]: unknown; }; unit_price?: { amount: number; currency: string; [key: string]: unknown; }; amount?: { amount: number; currency: string; [key: string]: unknown; }; gross_amount?: { amount: number; currency: string; [key: string]: unknown; }; source_invoice_record_id?: string; source_line_record_id?: string; covered_start?: string; covered_end?: string; [key: string]: unknown; }>; applied_to_invoices?: Array<{ invoice_record_id?: string; amount?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; }>; renewal?: unknown; revision?: unknown; schedule?: unknown; replaces_upcoming_items?: boolean; quote?: string; charge_total?: { amount: number; currency: string; [key: string]: unknown; }; discount_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_total?: { amount: number; currency: string; [key: string]: unknown; }; amount_due?: { amount: number; currency: string; [key: string]: unknown; }; net_credit?: { amount: number; currency: string; [key: string]: unknown; }; applied_to_invoices_total?: { amount: number; currency: string; [key: string]: unknown; }; credit_to_balance?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_before?: { amount: number; currency: string; [key: string]: unknown; }; outstanding_after?: { amount: number; currency: string; [key: string]: unknown; }; [key: string]: unknown; };\n\nexport interface SubscriptionsResumeInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n}\nexport type SubscriptionsResumeOutput = { status?: string; [key: string]: unknown; };\n\nexport interface SubscriptionsSetUpcomingItemsInput {\n subscriptionResource: ResourceKeyWith<\"subscription\">;\n subscriptionRecord: string;\n desiredPriceRecordIds?: Array<string> | null;\n items?: Array<{ price_record_id?: string; quantity?: number; pricing?: { mode?: \"catalog\" | \"custom\"; unit_price?: { amount?: number; currency?: string; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; }> | null;\n}\nexport type SubscriptionsSetUpcomingItemsOutput = { period_start?: string; items_added?: number; items_ended?: number; selection_locked?: boolean; [key: string]: unknown; };\n\nexport interface TextGenerateInput {\n length: number;\n includeNumbers?: boolean | null;\n includeSpecial?: boolean | null;\n}\nexport type TextGenerateOutput = string;\n\nexport interface TextHashInput {\n value: string;\n}\nexport type TextHashOutput = string;\n\nexport type TextRandomUuidInput = Record<string, never>;\nexport type TextRandomUuidOutput = string;\n\nexport interface TextToContentInput {\n value: string;\n}\nexport type TextToContentOutput = ContentDocument;\n\nexport interface TimeAddInput {\n date: string;\n value: number;\n unit: \"days\" | \"hours\" | \"minutes\" | \"months\" | \"seconds\" | \"weeks\" | \"years\";\n}\nexport type TimeAddOutput = string;\n\nexport interface TimeDiffInput {\n start: string;\n end: string;\n unit: \"days\" | \"hours\" | \"minutes\" | \"months\" | \"seconds\" | \"weeks\" | \"years\";\n}\nexport type TimeDiffOutput = number;\n\nexport interface TimeEndOfInput {\n date: string;\n unit: \"day\" | \"hour\" | \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type TimeEndOfOutput = string;\n\nexport interface TimeFormatInput {\n date: string;\n format: string;\n timezone?: string | null;\n}\nexport type TimeFormatOutput = string;\n\nexport interface TimeStartOfInput {\n date: string;\n unit: \"day\" | \"hour\" | \"month\" | \"quarter\" | \"week\" | \"year\";\n}\nexport type TimeStartOfOutput = string;\n\nexport interface TimeSubtractInput {\n date: string;\n value: number;\n unit: \"days\" | \"hours\" | \"minutes\" | \"months\" | \"seconds\" | \"weeks\" | \"years\";\n}\nexport type TimeSubtractOutput = string;\n\nexport interface TimezoneFormatInput {\n timezone: string;\n format: \"abbreviation\" | \"city\" | \"full\" | \"offset\";\n}\nexport type TimezoneFormatOutput = string;\n\nexport interface TimezoneInterpretInput {\n value: string;\n timezone: string;\n boundary: \"exact\" | \"start_of_day\" | \"end_of_day\";\n}\nexport type TimezoneInterpretOutput = string;\n\nexport interface TiptapParseInput {\n content?: unknown;\n html?: boolean;\n oneLine?: boolean;\n placeholder?: string;\n}\nexport type TiptapParseOutput = unknown;\n\nexport type TransactionBeginInput = Record<string, never>;\nexport type TransactionBeginOutput = null;\n\nexport type TransactionCommitInput = Record<string, never>;\nexport type TransactionCommitOutput = null;\n\nexport interface TransactionRollbackInput {\n error?: { name?: string; message?: string; code?: string; status?: number; errors?: Record<string, unknown>; failure_id?: number; };\n}\nexport type TransactionRollbackOutput = null | { message: string; code: string; status: number; details: Record<string, unknown>; failure: Record<string, unknown>; failure_id: number; };\n\nexport interface UserAuthorizeInput {\n permission: string;\n user?: Record<string, unknown>;\n}\nexport type UserAuthorizeOutput = boolean;\n\nexport interface WebAgentInput {\n url: string;\n prompt: unknown;\n schema: unknown;\n strict: boolean;\n}\nexport type WebAgentOutput = { url?: string; data?: unknown; [key: string]: unknown; };\n\nexport interface WebBatchScrapeInput {\n urls: Array<string>;\n}\nexport type WebBatchScrapeOutput = Array<{ url?: string; markdown?: unknown; html?: unknown; metadata?: { title?: unknown; description?: unknown; language?: unknown; status_code?: unknown; source_url?: unknown; content_type?: unknown; raw?: unknown; [key: string]: unknown; }; images?: unknown; branding?: unknown; [key: string]: unknown; }>;\n\nexport interface WebCrawlInput {\n url: string;\n limit?: number | null;\n maxDepth?: number | null;\n formats?: unknown[] | null;\n includePaths?: Array<string> | null;\n excludePaths?: Array<string> | null;\n allowSubdomains?: boolean | null;\n}\nexport type WebCrawlOutput = { url?: string; job_id?: string; status?: string; total?: unknown; pages?: unknown; [key: string]: unknown; };\n\nexport interface WebExtractInput {\n urls: Array<string>;\n prompt: unknown;\n schema: unknown;\n strict: boolean;\n}\nexport type WebExtractOutput = { urls?: Array<string>; data?: unknown; [key: string]: unknown; };\n\nexport interface WebGoogleSearchInput {\n query: unknown;\n limit?: number | null;\n}\nexport type WebGoogleSearchOutput = { query?: string; results?: unknown; [key: string]: unknown; };\n\nexport interface WebMapInput {\n url: string;\n search?: unknown;\n limit?: number | null;\n}\nexport type WebMapOutput = { url?: string; links?: unknown; [key: string]: unknown; };\n\nexport interface WebPdfInput {\n url: string;\n format?: \"a3\" | \"a4\" | \"a5\" | \"legal\" | \"letter\" | \"tabloid\" | null;\n landscape?: boolean | null;\n printBackground?: boolean | null;\n scale?: number | null;\n waitMs?: number | null;\n}\nexport type WebPdfOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface WebScrapeInput {\n url: string;\n mode?: \"content\" | \"json\" | null;\n formats?: unknown[] | null;\n onlyMainContent?: boolean | null;\n prompt?: unknown;\n schema?: unknown;\n strict?: boolean | null;\n maxAgeMs?: number | null;\n}\nexport type WebScrapeOutput = { url?: string; markdown?: unknown; html?: unknown; metadata?: { title?: unknown; description?: unknown; language?: unknown; status_code?: unknown; source_url?: unknown; content_type?: unknown; raw?: unknown; [key: string]: unknown; }; images?: unknown; branding?: unknown; [key: string]: unknown; };\n\nexport interface WebScreenshotInput {\n url: string;\n fullPage?: boolean | null;\n width?: number | null;\n height?: number | null;\n waitMs?: number | null;\n imageType?: \"jpeg\" | \"png\" | \"webp\" | null;\n}\nexport type WebScreenshotOutput = { id?: string; url?: string; is_public?: boolean; mime_type?: string; original_filename?: string; bytes?: unknown; width?: unknown; height?: unknown; sizes?: Array<number>; keywords?: unknown; created_at?: unknown; [key: string]: unknown; };\n\nexport interface WebSearchRankedInput {\n query: unknown;\n limit?: number | null;\n}\nexport type WebSearchRankedOutput = { query?: string; results?: unknown; [key: string]: unknown; };\n\nexport interface WorkflowRunInput {\n workflow: string | { id: string; params?: Record<string, unknown>; [key: string]: unknown; };\n input?: Record<string, unknown> | null;\n runAsResource?: ResourceKeyWith<\"authenticatable\"> | null;\n runAsRecord?: string | null;\n executionMode?: \"async\" | \"sync\" | null;\n}\nexport type WorkflowRunOutput = unknown;\n\nexport interface WorkflowUrlInput {\n workflow: { id: string; params?: Record<string, unknown>; [key: string]: unknown; };\n}\nexport type WorkflowUrlOutput = unknown;\n\nexport interface WorkspaceLoginUrlInput {\n resource: string;\n}\nexport type WorkspaceLoginUrlOutput = string;\n\nexport interface WorkspaceSetValueInput {\n key: string;\n value?: unknown;\n}\nexport type WorkspaceSetValueOutput = unknown;\n\nexport interface WorkspaceSetValuesInput {\n values?: Record<string, unknown>;\n}\nexport type WorkspaceSetValuesOutput = Record<string, unknown>;\n\nexport interface WorkspaceValueInput {\n key: string;\n defaultValue?: unknown;\n}\nexport type WorkspaceValueOutput = unknown;\n\nexport type WorkspaceValuesInput = Record<string, never>;\nexport type WorkspaceValuesOutput = Record<string, unknown>;\n\nexport const ai = {\n /** Ask a decisions model typed questions about some content and get labelled answers with their probabilities */\n decide: (input: AiDecideInput): Promise<AiDecideOutput> => invoke('ai.decide', input),\n /** Hand a prompt to the AI assistant, which can look up data and take action in your workspace */\n runPrompt: (input: AiRunPromptInput): Promise<AiRunPromptOutput> => invoke('ai.run_prompt', input),\n};\n\nexport const auth = {\n /** Impersonate an authenticatable user, switching the current session to act as that user */\n impersonate: (input: AuthImpersonateInput): Promise<AuthImpersonateOutput> => invoke('auth.impersonate', input),\n /** Login an authenticatable record */\n login: (input: AuthLoginInput): Promise<AuthLoginOutput> => invoke('auth.login', input),\n};\n\nexport const calendar = {\n /** Generate a shareable calendar link (Google, Apple, Outlook) for an eventable record */\n generateLink: (input: CalendarGenerateLinkInput): Promise<CalendarGenerateLinkOutput> => invoke('calendar.generate_link', input),\n /** Find eventable records occurring in a date window no wider than 3 months, expanding recurring events into one row per occurrence and per calendar the record appears on. Returns every match, so narrow the window or filters on a busy resource */\n searchEvents: (input: CalendarSearchEventsInput): Promise<CalendarSearchEventsOutput> => invoke('calendar.search_events', input),\n};\n\nexport const callback = {\n /** Get a callback value */\n get: (input: CallbackGetInput): Promise<CallbackGetOutput> => invoke('callback.get', input),\n /** Remove a callback value */\n remove: (input: CallbackRemoveInput): Promise<CallbackRemoveOutput> => invoke('callback.remove', input),\n /** Set a callback value */\n set: (input: CallbackSetInput): Promise<CallbackSetOutput> => invoke('callback.set', input),\n};\n\nexport const chart = {\n /** Group data by category for pie or donut charts */\n distribution: (input: ChartDistributionInput): Promise<ChartDistributionOutput> => invoke('chart.distribution', input),\n /** Calculate a single metric value (total revenue, order count, etc.) */\n kpi: (input: ChartKpiInput): Promise<ChartKpiOutput> => invoke('chart.kpi', input),\n /** Rank entities by a metric (top customers, best sellers, etc.) */\n leaderboard: (input: ChartLeaderboardInput): Promise<ChartLeaderboardOutput> => invoke('chart.leaderboard', input),\n /** Aggregate data over time for line or area charts */\n timeSeries: (input: ChartTimeSeriesInput): Promise<ChartTimeSeriesOutput> => invoke('chart.time_series', input),\n};\n\nexport const data = {\n /** Compute grouped metrics (count, sum, avg, etc.) over records */\n aggregateMetrics: (input: DataAggregateMetricsInput): Promise<DataAggregateMetricsOutput> => invoke('data.aggregate_metrics', input),\n /** Count the number of records matching the filters */\n count: (input: DataCountInput): Promise<DataCountOutput> => invoke('data.count', input),\n /** Create a new record */\n create: (input: DataCreateInput): Promise<DataCreateOutput> => invoke('data.create', input),\n /** Create many records at once */\n createMany: (input: DataCreateManyInput): Promise<DataCreateManyOutput> => invoke('data.create-many', input),\n /** Delete a record */\n delete: (input: DataDeleteInput): Promise<DataDeleteOutput> => invoke('data.delete', input),\n /** Delete all records matching filter conditions */\n deleteMany: (input: DataDeleteManyInput): Promise<DataDeleteManyOutput> => invoke('data.delete-many', input),\n /** Find a single record by ID or by filters */\n find: (input: DataFindInput): Promise<DataFindOutput> => invoke('data.find', input),\n /** Find a record by attributes, or create a new one when no match exists */\n findOrCreate: (input: DataFindOrCreateInput): Promise<DataFindOrCreateOutput> => invoke('data.find-or-create', input),\n relation: {\n /** Attach a related record to a relation. Plural relations (BelongsToMany, HasMany) keep their existing records. */\n attach: (input: DataRelationAttachInput): Promise<DataRelationAttachOutput> => invoke('data.relation.attach', input),\n /** Attach related records to a plural relation (BelongsToMany, HasMany) */\n attachMany: (input: DataRelationAttachManyInput): Promise<DataRelationAttachManyOutput> => invoke('data.relation.attach-many', input),\n /** Detach a related record. */\n detach: (input: DataRelationDetachInput): Promise<DataRelationDetachOutput> => invoke('data.relation.detach', input),\n /** Detach related records from a plural relation (BelongsToMany, HasMany) */\n detachMany: (input: DataRelationDetachManyInput): Promise<DataRelationDetachManyOutput> => invoke('data.relation.detach-many', input),\n /** Sync related records for a relation (replaces all existing) */\n sync: (input: DataRelationSyncInput): Promise<DataRelationSyncOutput> => invoke('data.relation.sync', input),\n },\n /** Restore an archived record */\n restore: (input: DataRestoreInput): Promise<DataRestoreOutput> => invoke('data.restore', input),\n /** Search for records */\n search: (input: DataSearchInput): Promise<DataSearchOutput> => invoke('data.search', input),\n /** Search for records by semantic similarity */\n semanticSearch: (input: DataSemanticSearchInput): Promise<DataSemanticSearchOutput> => invoke('data.semantic_search', input),\n /** Sum a numeric field across records matching the filters */\n sum: (input: DataSumInput): Promise<DataSumOutput> => invoke('data.sum', input),\n /** Update an existing record found by ID or by filters */\n update: (input: DataUpdateInput): Promise<DataUpdateOutput> => invoke('data.update', input),\n /** Find a record by attributes and update it, or create a new one */\n updateOrCreate: (input: DataUpdateOrCreateInput): Promise<DataUpdateOrCreateOutput> => invoke('data.update-or-create', input),\n /** Validate a record */\n validate: (input: DataValidateInput): Promise<DataValidateOutput> => invoke('data.validate', input),\n};\n\nexport const date = {\n /** Add N days/weeks/months/years to a date */\n add: (input: DateAddInput): Promise<DateAddOutput> => invoke('date.add', input),\n /** Difference between two dates in a specified unit */\n diff: (input: DateDiffInput): Promise<DateDiffOutput> => invoke('date.diff', input),\n /** Snap a date to the end of a period (week, month, quarter, year) */\n endOf: (input: DateEndOfInput): Promise<DateEndOfOutput> => invoke('date.end_of', input),\n /** Format a date string using ICU date format syntax (e.g., \"yyyy-MM-dd\", \"MMM d, yyyy\"). */\n format: (input: DateFormatInput): Promise<DateFormatOutput> => invoke('date.format', input),\n /** Snap a date to the start of a period (week, month, quarter, year) */\n startOf: (input: DateStartOfInput): Promise<DateStartOfOutput> => invoke('date.start_of', input),\n /** Subtract N days/weeks/months/years from a date */\n subtract: (input: DateSubtractInput): Promise<DateSubtractOutput> => invoke('date.subtract', input),\n};\n\nexport const file = {\n /** Change a file's visibility by moving it between private and public storage */\n changeVisibility: (input: FileChangeVisibilityInput): Promise<FileChangeVisibilityOutput> => invoke('file.change_visibility', input),\n /** Download a file from a public http(s) URL and save it privately in the workspace */\n createFromUrl: (input: FileCreateFromUrlInput): Promise<FileCreateFromUrlOutput> => invoke('file.create_from_url', input),\n /** Create a public library master from an accessible workspace file, preserving external sources. Accepts images, video, audio and PDF by the type detected from bytes. Store other files in a record file field. Returns the library File ID */\n createMediaLibraryItem: (input: FileCreateMediaLibraryItemInput): Promise<FileCreateMediaLibraryItemOutput> => invoke('file.create_media_library_item', input),\n /** Generate a QR code PNG image that encodes a value and save it privately in the workspace */\n createQrCode: (input: FileCreateQrCodeInput): Promise<FileCreateQrCodeOutput> => invoke('file.create_qr_code', input),\n};\n\nexport const guard = {\n /** Perform a validation check */\n validate: (input: GuardValidateInput): Promise<GuardValidateOutput> => invoke('guard.validate', input),\n};\n\nexport const http = {\n /** Send an HTTP request */\n request: (input: HttpRequestInput): Promise<HttpRequestOutput> => invoke('http.request', input),\n};\n\nexport const lifecycle = {\n /** Return modified record fields from a record lifecycle workflow */\n output: (input: LifecycleOutputInput): Promise<LifecycleOutputOutput> => invoke('lifecycle.output', input),\n};\n\nexport const mail = {\n /** Find tracked emails by recipient, linked record, subject, sender, status, or date, newest first, with the delivery status of each recipient, including hard and soft bounces. Searches without a record, or that include the record's current addresses, require a Run As identity with the Manage Notifications permission */\n search: (input: MailSearchInput): Promise<MailSearchOutput> => invoke('mail.search', input),\n /** Send an email */\n send: <const I extends DeepReadonly<MailSendInput>>(input: StaticLiquid<I, MailSendInput>): Promise<MailSendOutput> => invoke('mail.send', input),\n /** Send an email using a notification type and template */\n sendNotification: (input: MailSendNotificationInput): Promise<MailSendNotificationOutput> => invoke('mail.send-notification', input),\n};\n\nexport const markdown = {\n /** Convert rich Content into a markdown string */\n fromContent: (input: MarkdownFromContentInput): Promise<MarkdownFromContentOutput> => invoke('markdown.from_content', input),\n /** Convert a markdown string into rich Content. Nodes a destination Content field disallows may be rejected by that field. */\n toContent: (input: MarkdownToContentInput): Promise<MarkdownToContentOutput> => invoke('markdown.to_content', input),\n};\n\nexport const mediaLibrary = {\n /** Create a media library folder */\n createFolder: (input: MediaLibraryCreateFolderInput): Promise<MediaLibraryCreateFolderOutput> => invoke('media_library.create_folder', input),\n /** Detach a file from the media library */\n deleteItem: (input: MediaLibraryDeleteItemInput): Promise<MediaLibraryDeleteItemOutput> => invoke('media_library.delete_item', input),\n /** Move media library items into a target folder */\n moveItems: (input: MediaLibraryMoveItemsInput): Promise<MediaLibraryMoveItemsOutput> => invoke('media_library.move_items', input),\n /** Rename a media library item and/or move it into a folder */\n updateItem: (input: MediaLibraryUpdateItemInput): Promise<MediaLibraryUpdateItemOutput> => invoke('media_library.update_item', input),\n};\n\nexport const money = {\n /** Format a money value as a currency string */\n format: (input: MoneyFormatInput): Promise<MoneyFormatOutput> => invoke('money.format', input),\n};\n\nexport const notification = {\n /** Send a notification email to a notifiable record */\n send: <const I extends DeepReadonly<NotificationSendInput>>(input: StaticLiquid<I, NotificationSendInput>): Promise<NotificationSendOutput> => invoke('notification.send', input),\n /** Find records with filters and send each record’s notification to the type’s configured recipient resource */\n sendBulkNotifications: (input: NotificationSendBulkNotificationsInput): Promise<NotificationSendBulkNotificationsOutput> => invoke('notification.send-bulk-notifications', input),\n /** Send a notification template to a full record of the type’s recipient resource */\n sendNotification: (input: NotificationSendNotificationInput): Promise<NotificationSendNotificationOutput> => invoke('notification.send-notification', input),\n /** Record whether a notifiable record agreed to receive email or SMS */\n setConsent: (input: NotificationSetConsentInput): Promise<NotificationSetConsentOutput> => invoke('notification.set-consent', input),\n};\n\nexport const number = {\n /** Format a number with configurable decimal places */\n format: (input: NumberFormatInput): Promise<NumberFormatOutput> => invoke('number.format', input),\n};\n\nconst package_ = {\n /** Read an input value collected when this package was installed */\n installInput: (input: PackageInstallInputInput): Promise<PackageInstallInputOutput> => invoke('package.install-input', input),\n};\nexport { package_ as package };\n\nexport const page = {\n /** Get the URL for a page with route parameters */\n url: (input: PageUrlInput): Promise<PageUrlOutput> => invoke('page.url', input),\n};\n\nexport const payables = {\n /** Void an unpaid draft or open invoice. Rejects collected payments and payments in progress. Does not refund payments or cancel subscriptions. */\n void: (input: PayablesVoidInput): Promise<PayablesVoidOutput> => invoke('payables.void', input),\n /** Write off all or part of an open invoice while preserving its original total. */\n writeOff: (input: PayablesWriteOffInput): Promise<PayablesWriteOffOutput> => invoke('payables.write-off', input),\n};\n\nexport const payment = {\n /** Record a manual payment against a payable record */\n createManual: (input: PaymentCreateManualInput): Promise<PaymentCreateManualOutput> => invoke('payment.create_manual', input),\n};\n\nexport const payments = {\n /** Charge a payable record using the payer default Stripe payment method */\n charge: (input: PaymentsChargeInput): Promise<PaymentsChargeOutput> => invoke('payments.charge', input),\n /** Create a Stripe Checkout session to collect payment against a payable record */\n checkout: (input: PaymentsCheckoutInput): Promise<PaymentsCheckoutOutput> => invoke('payments.checkout', input),\n /** Confirm new or saved payment details collected by PaymentForm. Return this output to the form for authentication. Run after committing checkout choices; Stripe charges cannot be rolled back. */\n confirm: (input: PaymentsConfirmInput): Promise<PaymentsConfirmOutput> => invoke('payments.confirm', input),\n /** Process a full or partial refund against a payment record */\n refund: (input: PaymentsRefundInput): Promise<PaymentsRefundOutput> => invoke('payments.refund', input),\n /** Void a mistaken manual payment without recording a refund. */\n void: (input: PaymentsVoidInput): Promise<PaymentsVoidOutput> => invoke('payments.void', input),\n};\n\nexport const phone = {\n /** Format a phone number into a human-readable string */\n format: (input: PhoneFormatInput): Promise<PhoneFormatOutput> => invoke('phone.format', input),\n};\n\nexport const scheduling = {\n /** Book a slot that Find Slots returned, as the run identity. Check the slot and return the booking with the caller's view. Return only the booking id if the caller cannot read the booking. Search accepts the Find Slots input with camelCase or snake_case keys. A pool tries its next free member when admission refuses the pick; a slot that is gone fails with the $capacity error */\n bookSlot: (input: SchedulingBookSlotInput): Promise<SchedulingBookSlotOutput> => invoke('scheduling.book_slot', input),\n /** Find the times a booking can start across groups of Schedulable records, inside their open hours and outside the time bookings take, without changing records. A Request workflow that runs as another identity searches with the view of the person who called it */\n findSlots: (input: SchedulingFindSlotsInput): Promise<SchedulingFindSlotsOutput> => invoke('scheduling.find_slots', input),\n};\n\nexport const schema = {\n /** Convert a schema definition into its JSON Schema document — the shape used to constrain AI and extraction output */\n toJsonSchema: (input: SchemaToJsonSchemaInput): Promise<SchemaToJsonSchemaOutput> => invoke('schema.to_json_schema', input),\n};\n\nexport const security = {\n /** Generate a secure random password */\n randomPassword: (input: SecurityRandomPasswordInput): Promise<SecurityRandomPasswordOutput> => invoke('security.random_password', input),\n};\n\nexport const sms = {\n /** Send a notification template by SMS to a full record of the type’s recipient resource */\n sendNotification: (input: SmsSendNotificationInput): Promise<SmsSendNotificationOutput> => invoke('sms.send-notification', input),\n};\n\nexport const subscriptions = {\n /** Start a draft subscription using its snapshotted activation and trial policies */\n activate: (input: SubscriptionsActivateInput): Promise<SubscriptionsActivateOutput> => invoke('subscriptions.activate', input),\n /** Cancel a subscription immediately, or at the end of the current billing period */\n cancel: (input: SubscriptionsCancelInput): Promise<SubscriptionsCancelOutput> => invoke('subscriptions.cancel', input),\n /** Change subscription items now with optional proration, schedule the selection for the next renewal or a later billing period, or revise an eligible unpaid current or upcoming renewal invoice. An incomplete subscription can change now without a revision scope; this revises its first invoice in place. Renewal revisions use full-period prices without proration. Net prorated credits first reduce open current-period invoices of the subscription, then go to the payer balance. */\n changeItems: (input: SubscriptionsChangeItemsInput): Promise<SubscriptionsChangeItemsOutput> => invoke('subscriptions.change_items', input),\n /** Create and activate a subscription for a payer in one step: the record, an item per price, and optionally the first invoice */\n create: (input: SubscriptionsCreateInput): Promise<SubscriptionsCreateOutput> => invoke('subscriptions.create', input),\n /** Generate the payable invoice for the saved subscription schedule; partial calendar periods prorate recurring lines and full periods use the original prices */\n generateInvoice: (input: SubscriptionsGenerateInvoiceInput): Promise<SubscriptionsGenerateInvoiceOutput> => invoke('subscriptions.generate_invoice', input),\n /** Pause a billing subscription so no further invoices generate until it is resumed */\n pause: (input: SubscriptionsPauseInput): Promise<SubscriptionsPauseOutput> => invoke('subscriptions.pause', input),\n /** Preview initial subscription charges, covered dates, and renewal amounts without creating records or collecting payment */\n preview: (input: SubscriptionsPreviewInput): Promise<SubscriptionsPreviewOutput> => invoke('subscriptions.preview', input),\n /** Preview a complete subscription item selection effective now, at the next renewal, or at a later billing period, without changing records */\n previewChange: (input: SubscriptionsPreviewChangeInput): Promise<SubscriptionsPreviewChangeOutput> => invoke('subscriptions.preview_change', input),\n /** Resume a paused subscription; its status re-derives from the latest invoice */\n resume: (input: SubscriptionsResumeInput): Promise<SubscriptionsResumeOutput> => invoke('subscriptions.resume', input),\n /** Safely replace the complete price selection that takes effect in the next billing period */\n setUpcomingItems: (input: SubscriptionsSetUpcomingItemsInput): Promise<SubscriptionsSetUpcomingItemsOutput> => invoke('subscriptions.set_upcoming_items', input),\n};\n\nexport const text = {\n /** Generate a random string with configurable character sets */\n generate: (input: TextGenerateInput): Promise<TextGenerateOutput> => invoke('text.generate', input),\n /** Hash a text value */\n hash: (input: TextHashInput): Promise<TextHashOutput> => invoke('text.hash', input),\n /** Generate a random UUID v7 */\n randomUuid: (input: TextRandomUuidInput = {}): Promise<TextRandomUuidOutput> => invoke('text.random_uuid', input),\n /** Convert a plain text string into rich Content */\n toContent: (input: TextToContentInput): Promise<TextToContentOutput> => invoke('text.to_content', input),\n};\n\nexport const time = {\n /** Add N seconds/minutes/hours/days/weeks/months/years to a datetime */\n add: (input: TimeAddInput): Promise<TimeAddOutput> => invoke('time.add', input),\n /** Difference between two datetimes in a specified unit */\n diff: (input: TimeDiffInput): Promise<TimeDiffOutput> => invoke('time.diff', input),\n /** Snap a datetime to the end of a period (hour, day, week, month, quarter, year) */\n endOf: (input: TimeEndOfInput): Promise<TimeEndOfOutput> => invoke('time.end_of', input),\n /** Format a datetime string using ICU date format syntax (e.g., \"yyyy-MM-dd HH:mm:ss\", \"MMM d, yyyy h:mm a\"). */\n format: (input: TimeFormatInput): Promise<TimeFormatOutput> => invoke('time.format', input),\n /** Snap a datetime to the start of a period (hour, day, week, month, quarter, year) */\n startOf: (input: TimeStartOfInput): Promise<TimeStartOfOutput> => invoke('time.start_of', input),\n /** Subtract N seconds/minutes/hours/days/weeks/months/years from a datetime */\n subtract: (input: TimeSubtractInput): Promise<TimeSubtractOutput> => invoke('time.subtract', input),\n};\n\nexport const timezone = {\n /** Format a timezone identifier into a human-readable string. Supports formats: full (region/city with offset), offset (UTC offset), abbreviation (timezone abbreviation), and city (city name only). */\n format: (input: TimezoneFormatInput): Promise<TimezoneFormatOutput> => invoke('timezone.format', input),\n /** Interpret a local date or datetime in a timezone and return the canonical UTC datetime string. */\n interpret: (input: TimezoneInterpretInput): Promise<TimezoneInterpretOutput> => invoke('timezone.interpret', input),\n};\n\nexport const tiptap = {\n /** Parse Tiptap content to HTML or text */\n parse: (input: TiptapParseInput): Promise<TiptapParseOutput> => invoke('tiptap.parse', input),\n};\n\nexport const transaction = {\n /** Transaction control for transaction(). */\n begin: (input: TransactionBeginInput = {}): Promise<TransactionBeginOutput> => invoke('transaction.begin', input),\n /** Transaction control for transaction(). */\n commit: (input: TransactionCommitInput = {}): Promise<TransactionCommitOutput> => invoke('transaction.commit', input),\n /** Transaction control for transaction(). */\n rollback: (input: TransactionRollbackInput): Promise<TransactionRollbackOutput> => invoke('transaction.rollback', input),\n};\n\nexport const user = {\n /** Check user permissions for authorization */\n authorize: (input: UserAuthorizeInput): Promise<UserAuthorizeOutput> => invoke('user.authorize', input),\n};\n\nexport const web = {\n /** Extract structured data from a web page, guided by a natural-language prompt and a required shape */\n agent: (input: WebAgentInput): Promise<WebAgentOutput> => invoke('web.agent', input),\n /** Scrape multiple web pages in one batch and poll until every page is finished */\n batchScrape: (input: WebBatchScrapeInput): Promise<WebBatchScrapeOutput> => invoke('web.batch_scrape', input),\n /** Crawl a site and return multi-page content (polls to completion) */\n crawl: (input: WebCrawlInput): Promise<WebCrawlOutput> => invoke('web.crawl', input),\n /** Extract structured data from one or more web pages, guided by a required shape and a supporting prompt */\n extract: (input: WebExtractInput): Promise<WebExtractOutput> => invoke('web.extract', input),\n /** Search Google and return the organic results */\n googleSearch: (input: WebGoogleSearchInput): Promise<WebGoogleSearchOutput> => invoke('web.google_search', input),\n /** Map a site and return all of its discoverable URLs */\n map: (input: WebMapInput): Promise<WebMapOutput> => invoke('web.map', input),\n /** Render a web page to a PDF document */\n pdf: (input: WebPdfInput): Promise<WebPdfOutput> => invoke('web.pdf', input),\n /** Scrape a web page in content mode (markdown/HTML plus metadata) or JSON mode (structured data extracted against a schema) */\n scrape: (input: WebScrapeInput): Promise<WebScrapeOutput> => invoke('web.scrape', input),\n /** Render a web page to a screenshot (PNG, JPEG, or WebP) */\n screenshot: (input: WebScreenshotInput): Promise<WebScreenshotOutput> => invoke('web.screenshot', input),\n /** Search the web for a query and return ranked results */\n searchRanked: (input: WebSearchRankedInput): Promise<WebSearchRankedOutput> => invoke('web.search_ranked', input),\n};\n\nexport const workflow = {\n /** Runs a workflow using its published version */\n run: (input: WorkflowRunInput): Promise<WorkflowRunOutput> => invoke('workflow.run', input),\n /** Get the URL for a workflow with route parameters */\n url: (input: WorkflowUrlInput): Promise<WorkflowUrlOutput> => invoke('workflow.url', input),\n};\n\nexport const workspace = {\n /** Get the login URL for an authenticatable resource */\n loginUrl: (input: WorkspaceLoginUrlInput): Promise<WorkspaceLoginUrlOutput> => invoke('workspace.login_url', input),\n /** Set the value of a field in a workspace */\n setValue: (input: WorkspaceSetValueInput): Promise<WorkspaceSetValueOutput> => invoke('workspace.set_value', input),\n /** Set multiple workspace field values at once from a key => value map */\n setValues: (input: WorkspaceSetValuesInput): Promise<WorkspaceSetValuesOutput> => invoke('workspace.set_values', input),\n /** Get the value of a field in a workspace */\n value: (input: WorkspaceValueInput): Promise<WorkspaceValueOutput> => invoke('workspace.value', input),\n /** Get all workspace field values as a dictionary */\n values: (input: WorkspaceValuesInput = {}): Promise<WorkspaceValuesOutput> => invoke('workspace.values', input),\n};\n\n","/sdk/generated/profiles/test.ts":"// AUTO-GENERATED by `php artisan workflows:script-sdk:build`. Do not edit by hand.\nimport { data as rootData } from '../../data';\nimport { workspace as rootWorkspace } from '../../workspace-values';\nimport { ai as rootAi, calendar as rootCalendar, callback as rootCallback, chart as rootChart, date as rootDate, file as rootFile, guard as rootGuard, http as rootHttp, lifecycle as rootLifecycle, mail as rootMail, markdown as rootMarkdown, mediaLibrary as rootMediaLibrary, money as rootMoney, notification as rootNotification, number as rootNumber, package as rootPackage, page as rootPage, payables as rootPayables, payment as rootPayment, payments as rootPayments, phone as rootPhone, scheduling as rootScheduling, schema as rootSchema, security as rootSecurity, sms as rootSms, subscriptions as rootSubscriptions, text as rootText, time as rootTime, timezone as rootTimezone, tiptap as rootTiptap, user as rootUser, web as rootWeb, workflow as rootWorkflow } from '../capabilities';\n\nexport const ai: {\n decide: typeof rootAi.decide;\n runPrompt: typeof rootAi.runPrompt;\n} = {\n decide: rootAi.decide,\n runPrompt: rootAi.runPrompt,\n};\n\nexport const calendar: {\n generateLink: typeof rootCalendar.generateLink;\n searchEvents: typeof rootCalendar.searchEvents;\n} = {\n generateLink: rootCalendar.generateLink,\n searchEvents: rootCalendar.searchEvents,\n};\n\nexport const callback: {\n get: typeof rootCallback.get;\n remove: typeof rootCallback.remove;\n set: typeof rootCallback.set;\n} = {\n get: rootCallback.get,\n remove: rootCallback.remove,\n set: rootCallback.set,\n};\n\nexport const chart: {\n distribution: typeof rootChart.distribution;\n kpi: typeof rootChart.kpi;\n leaderboard: typeof rootChart.leaderboard;\n timeSeries: typeof rootChart.timeSeries;\n} = {\n distribution: rootChart.distribution,\n kpi: rootChart.kpi,\n leaderboard: rootChart.leaderboard,\n timeSeries: rootChart.timeSeries,\n};\n\nexport const data: {\n aggregateMetrics: typeof rootData.aggregateMetrics;\n count: typeof rootData.count;\n create: typeof rootData.create;\n createMany: typeof rootData.createMany;\n delete: typeof rootData.delete;\n deleteMany: typeof rootData.deleteMany;\n find: typeof rootData.find;\n findOrCreate: typeof rootData.findOrCreate;\n relation: {\n attach: typeof rootData.relation.attach;\n attachMany: typeof rootData.relation.attachMany;\n detach: typeof rootData.relation.detach;\n detachMany: typeof rootData.relation.detachMany;\n sync: typeof rootData.relation.sync;\n };\n restore: typeof rootData.restore;\n search: typeof rootData.search;\n semanticSearch: typeof rootData.semanticSearch;\n sum: typeof rootData.sum;\n update: typeof rootData.update;\n updateOrCreate: typeof rootData.updateOrCreate;\n validate: typeof rootData.validate;\n} = {\n aggregateMetrics: rootData.aggregateMetrics,\n count: rootData.count,\n create: rootData.create,\n createMany: rootData.createMany,\n delete: rootData.delete,\n deleteMany: rootData.deleteMany,\n find: rootData.find,\n findOrCreate: rootData.findOrCreate,\n relation: {\n attach: rootData.relation.attach,\n attachMany: rootData.relation.attachMany,\n detach: rootData.relation.detach,\n detachMany: rootData.relation.detachMany,\n sync: rootData.relation.sync,\n },\n restore: rootData.restore,\n search: rootData.search,\n semanticSearch: rootData.semanticSearch,\n sum: rootData.sum,\n update: rootData.update,\n updateOrCreate: rootData.updateOrCreate,\n validate: rootData.validate,\n};\n\nexport const date: {\n add: typeof rootDate.add;\n diff: typeof rootDate.diff;\n endOf: typeof rootDate.endOf;\n format: typeof rootDate.format;\n startOf: typeof rootDate.startOf;\n subtract: typeof rootDate.subtract;\n} = {\n add: rootDate.add,\n diff: rootDate.diff,\n endOf: rootDate.endOf,\n format: rootDate.format,\n startOf: rootDate.startOf,\n subtract: rootDate.subtract,\n};\n\nexport const file: {\n changeVisibility: typeof rootFile.changeVisibility;\n createFromUrl: typeof rootFile.createFromUrl;\n createMediaLibraryItem: typeof rootFile.createMediaLibraryItem;\n createQrCode: typeof rootFile.createQrCode;\n} = {\n changeVisibility: rootFile.changeVisibility,\n createFromUrl: rootFile.createFromUrl,\n createMediaLibraryItem: rootFile.createMediaLibraryItem,\n createQrCode: rootFile.createQrCode,\n};\n\nexport const guard: {\n validate: typeof rootGuard.validate;\n} = {\n validate: rootGuard.validate,\n};\n\nexport const http: {\n request: typeof rootHttp.request;\n} = {\n request: rootHttp.request,\n};\n\nexport const lifecycle: {\n output: typeof rootLifecycle.output;\n} = {\n output: rootLifecycle.output,\n};\n\nexport const mail: {\n search: typeof rootMail.search;\n send: typeof rootMail.send;\n sendNotification: typeof rootMail.sendNotification;\n} = {\n search: rootMail.search,\n send: rootMail.send,\n sendNotification: rootMail.sendNotification,\n};\n\nexport const markdown: {\n fromContent: typeof rootMarkdown.fromContent;\n toContent: typeof rootMarkdown.toContent;\n} = {\n fromContent: rootMarkdown.fromContent,\n toContent: rootMarkdown.toContent,\n};\n\nexport const mediaLibrary: {\n createFolder: typeof rootMediaLibrary.createFolder;\n deleteItem: typeof rootMediaLibrary.deleteItem;\n moveItems: typeof rootMediaLibrary.moveItems;\n updateItem: typeof rootMediaLibrary.updateItem;\n} = {\n createFolder: rootMediaLibrary.createFolder,\n deleteItem: rootMediaLibrary.deleteItem,\n moveItems: rootMediaLibrary.moveItems,\n updateItem: rootMediaLibrary.updateItem,\n};\n\nexport const money: {\n format: typeof rootMoney.format;\n} = {\n format: rootMoney.format,\n};\n\nexport const notification: {\n send: typeof rootNotification.send;\n sendBulkNotifications: typeof rootNotification.sendBulkNotifications;\n sendNotification: typeof rootNotification.sendNotification;\n setConsent: typeof rootNotification.setConsent;\n} = {\n send: rootNotification.send,\n sendBulkNotifications: rootNotification.sendBulkNotifications,\n sendNotification: rootNotification.sendNotification,\n setConsent: rootNotification.setConsent,\n};\n\nexport const number: {\n format: typeof rootNumber.format;\n} = {\n format: rootNumber.format,\n};\n\nconst package_: {\n installInput: typeof rootPackage.installInput;\n} = {\n installInput: rootPackage.installInput,\n};\nexport { package_ as package };\n\nexport const page: {\n url: typeof rootPage.url;\n} = {\n url: rootPage.url,\n};\n\nexport const payables: {\n void: typeof rootPayables.void;\n writeOff: typeof rootPayables.writeOff;\n} = {\n void: rootPayables.void,\n writeOff: rootPayables.writeOff,\n};\n\nexport const payment: {\n createManual: typeof rootPayment.createManual;\n} = {\n createManual: rootPayment.createManual,\n};\n\nexport const payments: {\n charge: typeof rootPayments.charge;\n checkout: typeof rootPayments.checkout;\n confirm: typeof rootPayments.confirm;\n refund: typeof rootPayments.refund;\n void: typeof rootPayments.void;\n} = {\n charge: rootPayments.charge,\n checkout: rootPayments.checkout,\n confirm: rootPayments.confirm,\n refund: rootPayments.refund,\n void: rootPayments.void,\n};\n\nexport const phone: {\n format: typeof rootPhone.format;\n} = {\n format: rootPhone.format,\n};\n\nexport const scheduling: {\n bookSlot: typeof rootScheduling.bookSlot;\n findSlots: typeof rootScheduling.findSlots;\n} = {\n bookSlot: rootScheduling.bookSlot,\n findSlots: rootScheduling.findSlots,\n};\n\nexport const schema: {\n toJsonSchema: typeof rootSchema.toJsonSchema;\n} = {\n toJsonSchema: rootSchema.toJsonSchema,\n};\n\nexport const security: {\n randomPassword: typeof rootSecurity.randomPassword;\n} = {\n randomPassword: rootSecurity.randomPassword,\n};\n\nexport const sms: {\n sendNotification: typeof rootSms.sendNotification;\n} = {\n sendNotification: rootSms.sendNotification,\n};\n\nexport const subscriptions: {\n activate: typeof rootSubscriptions.activate;\n cancel: typeof rootSubscriptions.cancel;\n changeItems: typeof rootSubscriptions.changeItems;\n create: typeof rootSubscriptions.create;\n generateInvoice: typeof rootSubscriptions.generateInvoice;\n pause: typeof rootSubscriptions.pause;\n preview: typeof rootSubscriptions.preview;\n previewChange: typeof rootSubscriptions.previewChange;\n resume: typeof rootSubscriptions.resume;\n setUpcomingItems: typeof rootSubscriptions.setUpcomingItems;\n} = {\n activate: rootSubscriptions.activate,\n cancel: rootSubscriptions.cancel,\n changeItems: rootSubscriptions.changeItems,\n create: rootSubscriptions.create,\n generateInvoice: rootSubscriptions.generateInvoice,\n pause: rootSubscriptions.pause,\n preview: rootSubscriptions.preview,\n previewChange: rootSubscriptions.previewChange,\n resume: rootSubscriptions.resume,\n setUpcomingItems: rootSubscriptions.setUpcomingItems,\n};\n\nexport const text: {\n generate: typeof rootText.generate;\n hash: typeof rootText.hash;\n randomUuid: typeof rootText.randomUuid;\n toContent: typeof rootText.toContent;\n} = {\n generate: rootText.generate,\n hash: rootText.hash,\n randomUuid: rootText.randomUuid,\n toContent: rootText.toContent,\n};\n\nexport const time: {\n add: typeof rootTime.add;\n diff: typeof rootTime.diff;\n endOf: typeof rootTime.endOf;\n format: typeof rootTime.format;\n startOf: typeof rootTime.startOf;\n subtract: typeof rootTime.subtract;\n} = {\n add: rootTime.add,\n diff: rootTime.diff,\n endOf: rootTime.endOf,\n format: rootTime.format,\n startOf: rootTime.startOf,\n subtract: rootTime.subtract,\n};\n\nexport const timezone: {\n format: typeof rootTimezone.format;\n interpret: typeof rootTimezone.interpret;\n} = {\n format: rootTimezone.format,\n interpret: rootTimezone.interpret,\n};\n\nexport const tiptap: {\n parse: typeof rootTiptap.parse;\n} = {\n parse: rootTiptap.parse,\n};\n\nexport const user: {\n authorize: typeof rootUser.authorize;\n} = {\n authorize: rootUser.authorize,\n};\n\nexport const web: {\n agent: typeof rootWeb.agent;\n batchScrape: typeof rootWeb.batchScrape;\n crawl: typeof rootWeb.crawl;\n extract: typeof rootWeb.extract;\n googleSearch: typeof rootWeb.googleSearch;\n map: typeof rootWeb.map;\n pdf: typeof rootWeb.pdf;\n scrape: typeof rootWeb.scrape;\n screenshot: typeof rootWeb.screenshot;\n searchRanked: typeof rootWeb.searchRanked;\n} = {\n agent: rootWeb.agent,\n batchScrape: rootWeb.batchScrape,\n crawl: rootWeb.crawl,\n extract: rootWeb.extract,\n googleSearch: rootWeb.googleSearch,\n map: rootWeb.map,\n pdf: rootWeb.pdf,\n scrape: rootWeb.scrape,\n screenshot: rootWeb.screenshot,\n searchRanked: rootWeb.searchRanked,\n};\n\nexport const workflow: {\n run: typeof rootWorkflow.run;\n url: typeof rootWorkflow.url;\n} = {\n run: rootWorkflow.run,\n url: rootWorkflow.url,\n};\n\nexport const workspace: {\n loginUrl: typeof rootWorkspace.loginUrl;\n setValue: typeof rootWorkspace.setValue;\n setValues: typeof rootWorkspace.setValues;\n value: typeof rootWorkspace.value;\n values: typeof rootWorkspace.values;\n} = {\n loginUrl: rootWorkspace.loginUrl,\n setValue: rootWorkspace.setValue,\n setValues: rootWorkspace.setValues,\n value: rootWorkspace.value,\n values: rootWorkspace.values,\n};\n","/sdk/index.ts":"import './console';\n\nexport { HostError, WorkflowFailure, fail, validationError } from './errors';\nexport type { HostFailure } from './errors';\nexport { invoke, setTransport, type HostTransport } from './transport';\nexport { transaction } from './transaction';\nexport type { Liquid, declaredInput } from './liquid';\nexport { data } from './data';\nexport { mail, notification, sms } from './notifications';\nexport { workspace } from './workspace-values';\nexport {\n InputField,\n InputSchema,\n v,\n type ContentDocument,\n type ContentNode,\n type ContentOptions,\n type FileVisibility,\n type Infer,\n type InferInput,\n type InputFieldKind,\n type InputFieldSpec,\n type InputShape,\n type Money,\n type RecordScope,\n type RequestLocation,\n type RequestSource\n} from './input';\nexport {\n defineWorkflow,\n parseWorkflowInput,\n redirect,\n respond,\n validateWorkflowInput,\n type Identity,\n type InputErrors,\n type InputValidator,\n type RequestContext,\n type ScriptExecution,\n type WorkflowContext,\n type WorkflowDefinition,\n type WorkflowExecution\n} from './workflow';\nexport * from './generated/capabilities';\n\n/** The embedding host selects its execution context through its supplied declarations. */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ScriptHostContext {}\n\n/**\n * Declaration-merged by the generated workspace module with one entry per resource.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceResources {}\n\n/**\n * Declaration-merged by the workspace's field definitions with each key's value type.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceFieldCatalog {}\n\n/**\n * Declaration-merged by the generated workspace module with one entry per notification type:\n * its id, the unions of its template ids (all, email-enabled, and SMS-enabled), and the shape\n * of its variables.\n * @augmentable\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface WorkspaceNotificationTypes {}\n","/sdk/input.ts":"import type { InputOf, ResourceKey } from './data';\n\n/**\n * A declared input field, as data. The compiler reads a workflow's input schema from its source\n * and saves each field as a workflow input variable, so the platform validates a run's input\n * against these rules before the script starts. The same data travels with the workflow at run\n * time, where the SDK uses it to coerce string values to the declared types.\n */\nexport interface InputFieldSpec {\n readonly kind: InputFieldKind;\n readonly optional: boolean;\n readonly nullable: boolean;\n /** Validation rules in the platform's rule syntax, such as `min:1` or `regex:/^[a-z]+$/`. */\n readonly rules: readonly string[];\n readonly label?: string;\n readonly description?: string;\n /** `select`: the allowed values. */\n readonly options?: readonly (string | number)[];\n /** `list`: the item field. */\n readonly items?: InputFieldSpec;\n /** `object`: the nested fields. */\n readonly fields?: Readonly<Record<string, InputFieldSpec>>;\n /** `record` and `recordReference`: the resource whose definitions or records the value must match. */\n readonly resource?: string;\n /** `recordReference`: the records the ID can name. The platform default is `active`. */\n readonly scope?: RecordScope;\n /** `file`: the accepted MIME types. */\n readonly accept?: readonly string[];\n /** `file`: the visibility of the file. */\n readonly visibility?: FileVisibility;\n /** `content`: the formatting the document may use. */\n readonly content?: ContentOptions;\n /** A top-level field of a Request workflow: the part of the request that holds the value. */\n readonly from?: RequestSource;\n}\n\n/**\n * The part of the request that a field of a Request workflow reads. `body` is the default: the\n * request input under the field key, with the query string values added. `header` reads the header\n * `key`, or the field key, in any letter case. `path` reads the route parameter of the field key.\n */\nexport type RequestLocation = 'body' | 'header' | 'path';\n\nexport interface RequestSource {\n readonly location: RequestLocation;\n /** `header`: the header name, when it is not the field key. */\n readonly key?: string;\n}\n\n/**\n * A money value as the platform stores it. It is a type alias, not an interface, so that it is\n * assignable to the open money objects of capability inputs such as `money.format`.\n */\nexport type Money = {\n amount: number;\n currency: string;\n};\n\nexport type InputFieldKind =\n | 'text'\n | 'email'\n | 'url'\n | 'uuid'\n | 'phone'\n | 'date'\n | 'datetime'\n | 'time'\n | 'timezone'\n | 'color'\n | 'number'\n | 'integer'\n | 'money'\n | 'boolean'\n | 'select'\n | 'list'\n | 'object'\n | 'record'\n | 'recordReference'\n | 'roleReference'\n | 'file'\n | 'content';\n\n/** The records a record ID can name: `active`, `archived` (deleted), or `activeOrArchived` (all). */\nexport type RecordScope = 'active' | 'archived' | 'activeOrArchived';\n\nexport type FileVisibility = 'public' | 'private';\n\nexport interface ContentOptions {\n /** `false` allows one paragraph only. The default is `true`. */\n readonly multiLine?: boolean;\n /** The marks the text may use. Each mark is allowed unless it is `false`. */\n readonly extensions?: Readonly<\n Partial<Record<'bold' | 'italic' | 'strike' | 'underline' | 'link', boolean>>\n >;\n /** The block nodes the document may use. Each node is allowed unless it is `false`. */\n readonly allowedNodes?: Readonly<\n Partial<Record<'heading' | 'blockquote' | 'bulletList' | 'orderedList' | 'media', boolean>>\n >;\n}\n\n/** A rich text node in the platform's content format. */\nexport interface ContentNode {\n type: string;\n attrs?: Record<string, unknown>;\n content?: ContentNode[];\n marks?: { type: string; attrs?: Record<string, unknown> }[];\n text?: string;\n}\n\n/** A rich text document in the platform's content format. */\nexport interface ContentDocument extends ContentNode {\n type: 'doc';\n}\n\n/**\n * One field of a workflow's input schema. `T` is the value type the handler receives; `O` is\n * whether the key may be absent. Every modifier returns a new field, so a field can be shared.\n */\nexport class InputField<T, O extends boolean = false> {\n /** Phantom members that carry the static types; they hold no value at run time. */\n declare readonly $value: T;\n declare readonly $optional: O;\n\n constructor(readonly $spec: InputFieldSpec) {}\n\n /** The key may be absent. */\n optional(): InputField<T | undefined, true> {\n return new InputField({ ...this.$spec, optional: true });\n }\n\n /** The value may be `null`. */\n nullable(): InputField<T | null, O> {\n return new InputField({ ...this.$spec, nullable: true });\n }\n\n /** At least `value`: a number's value, a text's length, or a list's item count. */\n min(value: number): InputField<T, O> {\n return this.rule(`min:${value}`);\n }\n\n /** At most `value`: a number's value, a text's length, or a list's item count. */\n max(value: number): InputField<T, O> {\n return this.rule(`max:${value}`);\n }\n\n /** Between `min` and `max`, inclusive, measured as for `min` and `max`. */\n between(min: number, max: number): InputField<T, O> {\n return this.rule(`between:${min},${max}`);\n }\n\n /** Exactly `value`, measured as for `min` and `max`. */\n size(value: number): InputField<T, O> {\n return this.rule(`size:${value}`);\n }\n\n /** The text matches the pattern. */\n regex(pattern: RegExp): InputField<T, O> {\n return this.rule(`regex:/${pattern.source}/${pattern.flags}`);\n }\n\n /** Any other platform validation rule, such as `starts_with:INV-` or `after:today`. */\n rule(rule: string): InputField<T, O> {\n return new InputField({ ...this.$spec, rules: [...this.$spec.rules, rule] });\n }\n\n label(label: string): InputField<T, O> {\n return new InputField({ ...this.$spec, label });\n }\n\n description(description: string): InputField<T, O> {\n return new InputField({ ...this.$spec, description });\n }\n\n /**\n * The part of the request that holds the value, on a top-level field of a Request workflow:\n * `from('header', 'X-Signature')` or `from('path')`. A path field has the name of its route\n * parameter.\n */\n from(location: 'header', key?: string): InputField<T, O>;\n from(location: 'body' | 'path'): InputField<T, O>;\n from(location: RequestLocation, key?: string): InputField<T, O> {\n return new InputField({\n ...this.$spec,\n from: key === undefined ? { location } : { location, key }\n });\n }\n}\n\nexport type InputShape = Record<string, InputField<unknown, boolean>>;\n\ntype Simplify<T> = { [K in keyof T]: T[K] } & {};\n\n/** The value an input schema describes: optional fields become optional keys. */\nexport type InferInput<S extends InputShape> = Simplify<\n { [K in keyof S as S[K]['$optional'] extends true ? never : K]: S[K]['$value'] } & {\n [K in keyof S as S[K]['$optional'] extends true ? K : never]?: S[K]['$value'];\n }\n>;\n\n/** The value a field or schema describes: `Infer<typeof Input>`. */\nexport type Infer<F extends InputField<unknown, boolean>> = F['$value'];\n\n/** A workflow's input schema: the fields of an object. */\nexport class InputSchema<S extends InputShape> extends InputField<InferInput<S>> {\n constructor(readonly shape: S) {\n super(objectSpec(shape));\n }\n}\n\nfunction objectSpec(shape: InputShape): InputFieldSpec {\n return {\n kind: 'object',\n optional: false,\n nullable: false,\n rules: [],\n fields: Object.fromEntries(Object.entries(shape).map(([key, field]) => [key, field.$spec]))\n };\n}\n\nconst field = <T>(kind: InputFieldKind, extra: Partial<InputFieldSpec> = {}): InputField<T> =>\n new InputField<T>({ kind, optional: false, nullable: false, rules: [], ...extra });\n\n/** Builders for a workflow's input schema. */\nexport const v = {\n text: () => field<string>('text'),\n email: () => field<string>('email'),\n url: () => field<string>('url'),\n uuid: () => field<string>('uuid'),\n phone: () => field<string>('phone'),\n /** A calendar date, `YYYY-MM-DD`. */\n date: () => field<string>('date'),\n /** A date and time, ISO 8601. */\n datetime: () => field<string>('datetime'),\n /** A time of day, `HH:MM`. */\n time: () => field<string>('time'),\n timezone: () => field<string>('timezone'),\n color: () => field<string>('color'),\n number: () => field<number>('number'),\n integer: () => field<number>('integer'),\n /** An amount of money: `amount` in the currency's minor units, such as cents, and the lowercase ISO 4217 `currency`. */\n money: () => field<Money>('money'),\n boolean: () => field<boolean>('boolean'),\n /** One of `options`. */\n select: <const V extends readonly (string | number)[]>(options: V) =>\n field<V[number]>('select', { options }),\n /** A list whose items each satisfy `items`. */\n list: <T>(items: InputField<T, boolean>) =>\n field<Exclude<T, undefined>[]>('list', { items: items.$spec }),\n /** An object with the given fields. */\n object: <S extends InputShape>(shape: S) => new InputSchema(shape),\n /**\n * The field values of a record of `resource`, checked against that resource's field\n * definitions: types, required fields, and each field's own rules.\n */\n record: <R extends ResourceKey>(resource: R) => field<InputOf<R>>('record', { resource }),\n /** The ID of an existing record of `resource`, in `scope`. */\n recordReference: <R extends ResourceKey>(resource: R, options: { scope?: RecordScope } = {}) =>\n field<string>('recordReference', { resource, ...options }),\n /** The ID of an existing role. */\n roleReference: () => field<string>('roleReference'),\n /**\n * A file: the ID of an existing file, or the temporary path of an upload. A data call that\n * writes the value to a file field of a record finalizes the upload.\n */\n file: (options: { accept?: readonly string[]; visibility?: FileVisibility } = {}) =>\n field<string>('file', options),\n /** A rich text document with the formatting that `options` allows. */\n content: (options: ContentOptions = {}) =>\n field<ContentDocument>('content', Object.keys(options).length === 0 ? {} : { content: options })\n};\n\nconst NUMERIC = /^-?(\\d+\\.?\\d*|\\.\\d+)(e[-+]?\\d+)?$/i;\n\nfunction coerceNumber(value: unknown): unknown {\n return typeof value === 'string' && NUMERIC.test(value.trim()) ? Number(value) : value;\n}\n\n/**\n * Converts the string forms a request carries (`\"5\"`, `\"true\"`) to the declared types. It runs\n * after the platform validated the input against the same schema, so a value it cannot convert\n * is left as it is.\n */\nexport function coerceInput(spec: InputFieldSpec, value: unknown): unknown {\n if (value === null || value === undefined) {\n return value;\n }\n\n switch (spec.kind) {\n case 'number':\n case 'integer':\n return coerceNumber(value);\n case 'money':\n return typeof value === 'object' && !Array.isArray(value) && 'amount' in value\n ? { ...value, amount: coerceNumber(value.amount) }\n : value;\n case 'boolean':\n if (value === 'true' || value === '1' || value === 1) {\n return true;\n }\n\n return value === 'false' || value === '0' || value === 0 ? false : value;\n case 'select':\n return typeof value === 'string' &&\n !spec.options?.includes(value) &&\n spec.options?.includes(Number(value))\n ? Number(value)\n : value;\n case 'list':\n return Array.isArray(value) && spec.items\n ? value.map((item) => coerceInput(spec.items!, item))\n : value;\n case 'object': {\n if (typeof value !== 'object' || Array.isArray(value) || !spec.fields) {\n return value;\n }\n\n const result: Record<string, unknown> = { ...(value as Record<string, unknown>) };\n\n for (const [key, fieldSpec] of Object.entries(spec.fields)) {\n if (key in result) {\n result[key] = coerceInput(fieldSpec, result[key]);\n }\n }\n\n return result;\n }\n default:\n return value;\n }\n}\n","/sdk/liquid.ts":"declare const liquidBrand: unique symbol;\n\n/**\n * The key under which a checked capability parameter carries its declared input type, so that a\n * tool such as the editor outline can read the fields that the capability declares.\n */\nexport declare const declaredInput: unique symbol;\n\n/**\n * Text that the task renders as a Liquid template, such as the body of an email. Write it as fixed\n * text, and pass each value as a reference: a value written into the text would be evaluated as\n * Liquid, so `{{ workspace.name }}` in submitted data would render.\n */\nexport type Liquid = string & { readonly [liquidBrand]?: true };\n\n/** The text that the type check shows for a Liquid field whose value is not fixed text. */\ntype FixedTextHint =\n 'Write fixed text here. Put each value in a reference and write {{ ref.<key> }}.';\n\ntype IsLiquid<T> = [T] extends [string]\n ? typeof liquidBrand extends keyof T\n ? true\n : false\n : false;\n\n/**\n * A string literal, or a union of string literals. A template literal type such as `Hi ${string}`\n * is not fixed: Record gives it an index signature. StaticFields passes a value without null and\n * undefined, so an optional value is fixed only when its string is. `never` is the value `undefined`\n * alone, which is fixed.\n */\ntype IsFixed<T> = [T] extends [never] ? true : false extends FixedMember<T> ? false : true;\n\n/**\n * Whether each member of `T` is fixed, member by member: a Record of the whole union would require\n * the key of each literal member, so one literal would hide a template literal beside it.\n */\ntype FixedMember<T> = T extends string\n ? string extends T\n ? false\n : {} extends Record<T, 1>\n ? false\n : true\n : true;\n\n/** The input of a capability call, deeply readonly, so a `const` type parameter can infer it. */\nexport type DeepReadonly<T> = T extends (...args: never[]) => unknown\n ? T\n : T extends readonly (infer E)[]\n ? readonly DeepReadonly<E>[]\n : T extends object\n ? { readonly [K in keyof T]: DeepReadonly<T[K]> }\n : T;\n\n/**\n * The input `I` of a capability call whose declared input is `D`, with each value of a Liquid field\n * that is not fixed text replaced by the hint, so the call fails the type check at that value.\n */\nexport type StaticLiquid<I, D> = StaticFields<I, D> & { readonly [declaredInput]?: D };\n\ntype StaticFields<I, D> = {\n [K in keyof I]: K extends keyof NonNullable<D>\n ? IsLiquid<NonNullable<NonNullable<D>[K]>> extends true\n ? IsFixed<NonNullable<I[K]>> extends true\n ? I[K]\n : FixedTextHint\n : I[K] extends readonly unknown[]\n ? I[K]\n : NonNullable<I[K]> extends object\n ? StaticFields<I[K], NonNullable<D>[K]>\n : I[K]\n : I[K];\n};\n","/sdk/notifications.ts":"import type { ResourceKey } from './data';\nimport {\n mail as generatedMail,\n notification as generatedNotification,\n sms as generatedSms,\n type MailSendNotificationInput,\n type MailSendNotificationOutput,\n type NotificationSendBulkNotificationsInput,\n type NotificationSendBulkNotificationsOutput,\n type NotificationSendNotificationInput,\n type NotificationSendNotificationOutput,\n type NotificationSetConsentInput,\n type NotificationSetConsentOutput,\n type SmsSendNotificationInput,\n type SmsSendNotificationOutput\n} from './generated/capabilities';\nimport type { WorkspaceNotificationTypes } from './index';\nimport { invoke } from './transport';\n\ntype Entry = WorkspaceNotificationTypes[keyof WorkspaceNotificationTypes];\ntype Declared = [keyof WorkspaceNotificationTypes] extends [never] ? false : true;\nexport type NotificationTypeKey = Declared extends true\n ? Entry extends { id: infer I }\n ? I\n : never\n : string;\n// A type can declare more than one id, such as its uid and its slug, so an entry matches when `T`\n// is one of its ids.\ntype MatchingEntry<E, T> = E extends { id: infer I } ? (T extends I ? E : never) : never;\ntype EntryFor<T> = MatchingEntry<Entry, T>;\n/**\n * The template ids of one notification type under `Channel`: every template, or only the\n * templates with email or SMS on. Any string while the workspace declares no types.\n */\nexport type NotificationTemplateKey<\n T,\n Channel extends 'template' | 'emailTemplate' | 'smsTemplate' = 'template'\n> = Declared extends true ? (EntryFor<T> extends Record<Channel, infer K> ? K : never) : string;\n/** The variables one notification type declares; any dictionary while the workspace declares no types. */\nexport type NotificationVariables<T> = Declared extends true\n ? EntryFor<T> extends { variables: infer V }\n ? V\n : never\n : Record<string, unknown>;\n\ntype NotificationInput<\n I,\n T,\n Channel extends 'template' | 'emailTemplate' | 'smsTemplate' = 'template'\n> = Omit<I, 'notificationType' | 'notificationTemplate' | 'variables'> & {\n notificationType: T;\n notificationTemplate?: NotificationTemplateKey<T, Channel>;\n} & ({} extends NotificationVariables<T>\n ? { variables?: NotificationVariables<T> }\n : { variables: NotificationVariables<T> });\n\nexport const mail = {\n ...generatedMail,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<MailSendNotificationInput, T, 'emailTemplate'>\n ) => invoke<MailSendNotificationOutput>('mail.send-notification', input)\n};\n\nexport const notification = {\n ...generatedNotification,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<NotificationSendNotificationInput, T>\n ) => invoke<NotificationSendNotificationOutput>('notification.send-notification', input),\n sendBulkNotifications: <T extends NotificationTypeKey, R extends ResourceKey>(\n input: Omit<NotificationInput<NotificationSendBulkNotificationsInput, T>, 'resource'> & {\n resource: R;\n }\n ) =>\n invoke<NotificationSendBulkNotificationsOutput>('notification.send-bulk-notifications', input),\n setConsent: <R extends NotificationSetConsentInput['resource']>(\n input: Omit<NotificationSetConsentInput, 'resource'> & { resource: R }\n ) => invoke<NotificationSetConsentOutput>('notification.set-consent', input)\n};\n\nexport const sms = {\n ...generatedSms,\n sendNotification: <T extends NotificationTypeKey>(\n input: NotificationInput<SmsSendNotificationInput, T, 'smsTemplate'>\n ) => invoke<SmsSendNotificationOutput>('sms.send-notification', input)\n};\n","/sdk/profiles/shared.ts":"// The root exports that call no host capability. Each profile entry point re-exports them.\nexport { HostError, WorkflowFailure, fail, validationError } from '../errors';\nexport {\n InputField,\n InputSchema,\n v,\n type ContentDocument,\n type ContentNode,\n type ContentOptions,\n type FileVisibility,\n type Infer,\n type InferInput,\n type InputFieldKind,\n type InputFieldSpec,\n type InputShape,\n type Money,\n type RecordScope\n} from '../input';\nexport {\n defineWorkflow,\n parseWorkflowInput,\n redirect,\n respond,\n validateWorkflowInput,\n type Identity,\n type InputErrors,\n type InputValidator,\n type RequestContext,\n type ScriptExecution,\n type WorkflowContext,\n type WorkflowDefinition,\n type WorkflowExecution\n} from '../workflow';\nexport type {\n ScriptHostContext,\n WorkspaceFieldCatalog,\n WorkspaceNotificationTypes,\n WorkspaceResources\n} from '../index';\n","/sdk/profiles/test.ts":"// The `@diagonal-hq/workflows/test` entry point of E2E setup and assert scripts. It exports every\n// capability wrapper except the test profile's deny list (sign-in changes), the `transaction()`\n// helper, and the root exports that call no host capability. The script host refuses each\n// denied capability.\nimport '../console';\nimport { data as rootData } from '../data';\nimport { data as testData } from '../generated/profiles/test';\n\nexport * from './shared';\nexport * from '../generated/profiles/test';\nexport { transaction } from '../transaction';\n\nexport const data: typeof testData & { each: typeof rootData.each } = {\n ...testData,\n each: rootData.each\n};\n","/sdk/runtime/quickjs.ts":"// The sandbox entry. scripts/build-workflow-code-runtime.mjs bundles this file and the SDK into\n// the QuickJS runtime. It must not import http-transport.ts or testing/, which need DOM types.\n//\n// The runner evaluates the bundle as the ES module `@diagonal/workflow` before the script, so a\n// script that imports the SDK gets this module and its transport, also at its top level.\n\nimport { HostError, type HostFailure } from '../errors';\n// oxlint-disable-next-line import/no-namespace -- `require('@diagonal/workflow')` of a CommonJS script returns the whole SDK module.\nimport * as sdk from '../index';\nimport { SerialTransactionTransport } from '../serial-transaction-transport';\nimport type { WorkflowContext, WorkflowDefinition } from '../workflow';\n\nexport * from '../index';\n\ntype HostBridge = (name: string, argsJson: string) => Promise<string>;\n\ntype HostReply = {\n ok: boolean;\n value: unknown;\n error: {\n message: string;\n code: string;\n status: number;\n details: unknown;\n failure?: HostFailure | null;\n failure_id?: number;\n } | null;\n};\n\nconst guest = globalThis as unknown as Record<string, unknown>;\n\n// Scripts reach the host only through the SDK, so the bridge leaves the global scope here.\nconst host = guest.__host as HostBridge;\nconst handlerStarted = guest.__handlerStarted as () => void;\ndelete guest.__host;\ndelete guest.__handlerStarted;\n\nclass QuickJsTransport implements sdk.HostTransport {\n async call(name: string, input: Record<string, unknown>): Promise<unknown> {\n const reply = JSON.parse(await host(name, JSON.stringify([input]))) as HostReply;\n\n if (!reply.ok) {\n const error = reply.error ?? {\n message: 'The call failed.',\n code: 'internal_error',\n status: 500,\n details: null\n };\n throw new HostError(\n error.message,\n error.code,\n error.status,\n error.details,\n error.failure_id ?? null,\n error.failure ?? null\n );\n }\n\n return reply.value;\n }\n}\n\nsdk.setTransport(new SerialTransactionTransport(new QuickJsTransport()));\n\ntype WorkspaceValues = {\n resources: Record<string, string>;\n notificationTypes: Record<string, string>;\n notificationTemplates: Record<string, Record<string, string>>;\n};\n\n/**\n * The exports of a script that an earlier compiler wrote as CommonJS, with a `require` that serves\n * the SDK and the workspace values.\n */\nguest.__commonJsExports = (code: string, workspaceJson: string): Record<string, unknown> => {\n const workspace = JSON.parse(workspaceJson) as WorkspaceValues;\n const module = { exports: {} as Record<string, unknown> };\n const require = (specifier: string): unknown => {\n if (specifier === '@diagonal/workflow') {\n return sdk;\n }\n\n if (specifier === '@diagonal/workflow/workspace') {\n return workspace;\n }\n\n throw new Error(`Cannot import ${specifier}.`);\n };\n\n // The compiled module is CommonJS text produced by the Diagonal compiler. It runs inside\n // QuickJS, which is the sandbox boundary.\n // oxlint-disable-next-line typescript/no-implied-eval\n new Function('exports', 'require', 'module', code)(module.exports, require, module);\n\n return module.exports;\n};\n\nguest.__runWorkflow = async (\n exports: Record<string, unknown>,\n inputJson: string,\n contextJson: string\n): Promise<unknown> => {\n const input = JSON.parse(inputJson) as unknown;\n const context = JSON.parse(contextJson) as WorkflowContext;\n const workflow = exports.default as WorkflowDefinition<unknown, unknown> | undefined;\n\n if (workflow?.$diagonal !== 'workflow') {\n throw new Error('The script has no default workflow export.');\n }\n\n const validateInput = exports.validateInput;\n const parsed = sdk.parseWorkflowInput(workflow, input);\n\n if (validateInput !== undefined && typeof validateInput !== 'function') {\n throw new TypeError('The validateInput export must be a function.');\n }\n\n if (workflow.validate !== undefined && validateInput !== undefined) {\n throw new TypeError(\n 'The workflow has a validate option and a validateInput export. Keep only the validate option.'\n );\n }\n\n const validator = workflow.validate ?? (validateInput as sdk.InputValidator<unknown> | undefined);\n\n if (validator !== undefined) {\n await sdk.validateWorkflowInput(validator, parsed, context);\n }\n\n handlerStarted();\n return workflow.run(parsed, context);\n};\n","/sdk/serial-transaction-transport.ts":"import { HostError } from './errors';\nimport type { HostTransport } from './transport';\n\nconst PromiseConstructor = Promise;\nconst objectKeys = Object.keys;\nconst isArray = Array.isArray;\n\nexport class SerialTransactionTransport implements HostTransport {\n private pending = 0;\n private settled: Promise<void> | null = null;\n private transactionOpen = false;\n private closing = false;\n\n constructor(private readonly transport: HostTransport) {}\n\n async call(name: string, input: Record<string, unknown>): Promise<unknown> {\n const begins = name === 'transaction.begin';\n const rollsBack = name === 'transaction.rollback';\n const ends = rollsBack || name === 'transaction.commit';\n\n if (begins || ends) {\n const keys =\n input !== null && typeof input === 'object' && !isArray(input) ? objectKeys(input) : null;\n // A rollback can also name the error of the transaction body. The input is not read here:\n // the transport serializes it only after the call is reserved below.\n const describesError = rollsBack && keys !== null && keys.length === 1 && keys[0] === 'error';\n\n if (keys === null || (keys.length > 0 && !describesError)) {\n throw new HostError(\n 'Transaction controls accept an empty object. A rollback also accepts the error of the body.',\n 'invalid_arguments',\n 422,\n null\n );\n }\n\n if (!describesError) {\n input = {};\n }\n }\n\n if (this.closing || ((this.transactionOpen || begins) && this.pending > 0 && !rollsBack)) {\n throw new HostError(\n 'Await each capability call before starting another call while a transaction is active.',\n 'transaction_concurrent',\n 409,\n null\n );\n }\n\n const opens = begins && !this.transactionOpen;\n const closes = ends && this.transactionOpen;\n\n if (opens) {\n this.transactionOpen = true;\n }\n\n if (closes) {\n this.closing = true;\n }\n\n const previous = this.settled;\n let complete: (() => void) | undefined;\n let closed = closes;\n\n try {\n // Promise.all can reject while an accepted call still waits on PHP. Rollback must follow\n // that call, and no new call may enter while cleanup waits.\n if (rollsBack && closes && previous !== null) {\n await previous;\n }\n\n this.pending++;\n this.settled = new PromiseConstructor<void>((resolve) => {\n complete = resolve;\n });\n\n return await this.transport.call(name, input);\n } catch (error) {\n if (\n closes &&\n error instanceof HostError &&\n (error.code === 'invalid_arguments' ||\n error.code === 'resolver_not_allowed' ||\n error.code === 'capability_denied' ||\n error.code === 'payload_too_large' ||\n error.code === 'validation' ||\n error.code === 'transaction_concurrent')\n ) {\n closed = false;\n }\n\n if (opens) {\n this.transactionOpen = false;\n }\n\n throw error;\n } finally {\n if (complete !== undefined) {\n this.pending--;\n complete();\n\n if (this.pending === 0) {\n this.settled = null;\n }\n }\n\n if (closes) {\n this.transactionOpen = !closed;\n this.closing = false;\n }\n }\n }\n}\n","/sdk/transaction.ts":"import { HostError, type HostFailure } from './errors';\nimport type { TransactionRollbackInput } from './generated/capabilities';\nimport { invoke } from './transport';\n\ntype ThrownError = NonNullable<TransactionRollbackInput['error']>;\n\n/**\n * Runs `fn` in one database transaction. When a concurrent write aborts the transaction, the host\n * rolls it back and answers with `transaction_transient`, and `fn` runs again. The host limits the\n * attempts and waits between them, so `fn` can run more than once.\n */\nexport async function transaction<T>(fn: () => Promise<T>): Promise<T> {\n for (;;) {\n await invoke('transaction.begin', {});\n\n let result: T;\n\n try {\n result = await fn();\n } catch (error) {\n const rolledBack = await rollBack({ error: thrownError(error) });\n\n if (rolledBack.retry) {\n continue;\n }\n\n throw rollbackError(rolledBack.reply, error) ?? error;\n }\n\n // The host closes the transaction when a commit fails, so a rollback here would only hide the commit error.\n try {\n await invoke('transaction.commit', {});\n } catch (error) {\n if (isTransient(error)) {\n continue;\n }\n\n if (error instanceof HostError && error.code === 'transaction_concurrent') {\n await rollBack({});\n }\n\n throw error;\n }\n\n return result;\n }\n}\n\n/**\n * Rolls back the open transaction and says whether the host asks for another attempt. When the\n * input names the error of the body, the reply describes the error that `transaction()` throws in\n * its place.\n */\nasync function rollBack(\n input: TransactionRollbackInput\n): Promise<{ retry: true } | { retry: false; reply: unknown }> {\n try {\n return { retry: false, reply: await invoke<unknown>('transaction.rollback', input) };\n } catch (error) {\n if (isTransient(error)) {\n return { retry: true };\n }\n\n throw error;\n }\n}\n\nfunction isTransient(error: unknown): boolean {\n return error instanceof HostError && error.code === 'transaction_transient';\n}\n\n/**\n * The fields of a `done` error that the host needs to describe the failure of `error`. The host\n * keeps the failure of a host error that has a failure ID, so only that ID is sent. Of the\n * details, only the field errors are sent, because only they change the recorded failure.\n */\nfunction thrownError(error: unknown): ThrownError {\n if (typeof error !== 'object' || error === null) {\n // JSON.stringify throws for a BigInt, and the rollback must still be sent.\n const value = typeof error === 'bigint' ? String(error) : JSON.stringify(error);\n\n return { name: 'Error', message: `The workflow threw a non-error value: ${value}` };\n }\n\n const name: unknown = Reflect.get(error, 'name');\n const failureId: unknown = Reflect.get(error, 'failureId');\n\n if (name === 'HostError' && typeof failureId === 'number' && Number.isInteger(failureId)) {\n return { name, failure_id: failureId };\n }\n\n const message: unknown = Reflect.get(error, 'message');\n const code: unknown = Reflect.get(error, 'code');\n const status: unknown = Reflect.get(error, 'status');\n const details: unknown = Reflect.get(error, 'details');\n const errors: unknown =\n typeof details === 'object' && details !== null ? Reflect.get(details, 'errors') : undefined;\n\n const thrown: ThrownError = {\n name: typeof name === 'string' ? name : 'Error',\n message: String(message ?? 'The workflow threw an error.')\n };\n\n if (typeof code === 'string') {\n thrown.code = code;\n }\n\n if (typeof status === 'number' && Number.isInteger(status)) {\n thrown.status = status;\n }\n\n if (typeof errors === 'object' && errors !== null && !Array.isArray(errors)) {\n thrown.errors = { ...errors };\n }\n\n return thrown;\n}\n\n/**\n * The `transaction_rollback` error that the host described for the rollback, with the error of\n * the body as its cause. Its failure is the rollback payload that the error edge of a graph\n * Transaction step reads. A reply that describes no error, such as the null of a mock rollback,\n * gives null, and `transaction()` rethrows the error of the body.\n */\nfunction rollbackError(reply: unknown, cause: unknown): HostError | null {\n if (typeof reply !== 'object' || reply === null) {\n return null;\n }\n\n const message: unknown = Reflect.get(reply, 'message');\n const code: unknown = Reflect.get(reply, 'code');\n const status: unknown = Reflect.get(reply, 'status');\n const failureId: unknown = Reflect.get(reply, 'failure_id');\n const failure: unknown = Reflect.get(reply, 'failure');\n\n if (\n typeof message !== 'string' ||\n code !== 'transaction_rollback' ||\n typeof status !== 'number' ||\n typeof failureId !== 'number' ||\n !isFailure(failure)\n ) {\n return null;\n }\n\n return new HostError(message, code, status, Reflect.get(reply, 'details'), failureId, failure, {\n cause\n });\n}\n\nfunction isFailure(value: unknown): value is HostFailure {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n","/sdk/transport.ts":"export interface HostTransport {\n call(name: string, input: Record<string, unknown>): Promise<unknown>;\n}\n\nlet active: HostTransport | null = null;\n\nexport function setTransport(transport: HostTransport | null): void {\n active = transport;\n}\n\nexport function invoke<T>(name: string, input: object): Promise<T> {\n if (active === null) {\n return Promise.reject(\n new Error(\n 'No Diagonal host transport is set. In tests, call setTransport(new MockTransport(...)).'\n )\n );\n }\n\n return active.call(name, input as Record<string, unknown>) as Promise<T>;\n}\n","/sdk/workflow-config.ts":"/**\n * The options of `defineWorkflow(config, handler)` other than `input`, `output`, and `validate`.\n * The build reads them as static data, checks them, and removes them from the compiled script, so\n * the compiler sees only `input`, `output`, and `validate`. `@diagonal-hq/cli` replaces this\n * declaration with its `WorkflowConfig`, so the editor checks each option.\n */\nexport type WorkflowConfig = Record<never, never>;\n","/sdk/workflow.ts":"import type { ResourceKeyWith } from './data';\nimport { validationError } from './errors';\nimport type { ScriptHostContext } from './index';\nimport {\n coerceInput,\n type Infer,\n type InputField,\n InputSchema,\n type InferInput,\n type InputFieldSpec,\n type InputShape\n} from './input';\nimport type { WorkflowConfig } from './workflow-config';\n\nexport interface Identity {\n id: string;\n /** The identity's resource has the Authenticatable capability. */\n resourceId: ResourceKeyWith<'authenticatable'>;\n email: string | null;\n name: string | null;\n permissions: string[];\n}\n\nexport interface RequestContext {\n method: string;\n url: string;\n params: Record<string, string>;\n query: Record<string, unknown>;\n /** The request input: the payload with the query string values added. */\n body: Record<string, unknown>;\n /** The payload as the caller sent it, without the query string. */\n payload: Record<string, unknown>;\n /** Header names are lowercase. A header with more than one value joins them with `, `. */\n headers: Record<string, string>;\n /**\n * The raw value of each field that the request contract of the trigger declares, under its\n * declared key, as a graph `request.input` reference reads it. A field that the request does\n * not carry is absent. A header has its first value only.\n */\n declared: {\n params: Record<string, unknown>;\n query: Record<string, unknown>;\n headers: Record<string, unknown>;\n body: Record<string, unknown>;\n };\n}\n\nexport interface ScriptExecution {\n id: string;\n kind: 'workflow' | 'embedded';\n owner: { type: string; id: string };\n}\n\nexport interface WorkflowExecution extends ScriptExecution {\n kind: 'workflow';\n workflowId: string;\n}\n\nexport interface WorkflowContext {\n user: Identity | null;\n callingUser: Identity | null;\n trigger: Record<string, unknown>;\n request: RequestContext | null;\n workspace: { id: string; timezone: string };\n execution: ScriptHostContext extends { embedded: true } ? ScriptExecution : WorkflowExecution;\n now: string;\n}\n\nexport interface WorkflowDefinition<I, O> {\n readonly $diagonal: 'workflow';\n /** The declared input schema, when the workflow has one. */\n readonly input?: InputFieldSpec;\n /**\n * The `validate` option of the config, which runs before the handler with the same input. A\n * method, like `run`, so a definition stays assignable to a narrower input type.\n */\n validate?(input: I, ctx: WorkflowContext): ReturnType<InputValidator<I>>;\n /** Runs the handler with input that {@link parseWorkflowInput} already converted. */\n run(input: I, ctx: WorkflowContext): Promise<O>;\n}\n\n/**\n * Converts a run's raw input to the declared types. A runner calls it once and passes the result\n * to both `validateInput` and `run`, so the validator and the handler receive the same input.\n */\nexport function parseWorkflowInput<I>(workflow: WorkflowDefinition<I, unknown>, input: unknown): I {\n return (workflow.input === undefined ? input : coerceInput(workflow.input, input)) as I;\n}\n\n/**\n * The errors an input validator reports, keyed by input field. A key outside the input's own fields\n * (a nested path such as `tags.0`) is allowed; an empty or absent message means the field is valid.\n */\nexport type InputErrors<I> = Partial<Record<keyof I & string, string | string[]>> &\n Record<string, string | string[] | undefined>;\n\n/**\n * The `validate` option of a workflow config, or the `validateInput` export a script may define\n * beside its workflow. It runs before the handler with the same input and context; when it\n * reports any error, the run ends with a 422 and those errors, and the handler does not run.\n */\nexport type InputValidator<I> = (\n input: I,\n ctx: WorkflowContext\n) => InputErrors<I> | void | Promise<InputErrors<I> | void>;\n\n/** Runs a script's input validator and ends the run with a validation error when it reports one. */\nexport async function validateWorkflowInput<I>(\n validator: InputValidator<I>,\n input: I,\n ctx: WorkflowContext\n): Promise<void> {\n const reported = await validator(input, ctx);\n\n if (reported === undefined || reported === null) {\n return;\n }\n\n if (typeof reported !== 'object' || Array.isArray(reported)) {\n throw new TypeError(\n 'validateInput must return an object of errors keyed by field, or nothing.'\n );\n }\n\n const errors: Record<string, string[]> = {};\n\n for (const [field, messages] of Object.entries(reported)) {\n const list = (Array.isArray(messages) ? messages : [messages]).filter(\n (message): message is string => typeof message === 'string' && message !== ''\n );\n\n if (list.length > 0) {\n errors[field] = list;\n }\n }\n\n if (Object.keys(errors).length > 0) {\n validationError(errors);\n }\n}\n\ntype Handler<I, O> = (input: I, ctx: WorkflowContext) => Promise<O> | O;\n\n/** A declared output: any `v` field, usually `v.object({ ... })`. */\ntype OutputField = InputField<unknown, boolean>;\n\n/** The handler input of a config: the type of its `input` schema, or `I` without one. */\ntype ConfigInput<C, I> = C extends InputSchema<infer S> ? InferInput<S> : I;\n\n/**\n * A value of a declared output type that a handler may return. A const context makes a returned\n * array a readonly tuple, so arrays and objects may be readonly at every level.\n */\ntype Returnable<T> = T extends readonly (infer E)[]\n ? readonly Returnable<E>[]\n : T extends object\n ? { readonly [K in keyof T]: Returnable<T[K]> }\n : T;\n\n/** The handler result of a config: the type of its `output` schema, or `O` without one. */\ntype ConfigOutput<F, O> = F extends OutputField ? Infer<F> : O;\n\n// `O` comes only from the declared output, so the return value cannot widen it. `const` makes the\n// return a const context: a returned literal, such as a `v.select` option, keeps its literal type\n// while `O` is still unfixed.\n/**\n * Declares a workflow. A file-based workflow passes its config first, as `definePage` does. The\n * build reads the config as static data. With an `input` schema in the config, or a schema first,\n * the platform validates every run's input against it before the script starts, and the handler's\n * `input` type comes from the schema. A `validate` function in the config runs after that check\n * and before the handler, with the same input type. With an `output` schema in the config of a\n * file-based workflow, the handler must return a value of that type: the platform documents it as\n * the response of a Request workflow and verifies each return value against it.\n */\nexport function defineWorkflow<\n const O,\n C extends InputSchema<InputShape> | undefined = undefined,\n I = Record<string, unknown>\n>(\n config: WorkflowConfig & {\n readonly input?: C;\n readonly output: InputField<O, boolean>;\n readonly validate?: InputValidator<ConfigInput<C, I>>;\n },\n handler: Handler<ConfigInput<C, I>, Returnable<NoInfer<O>>>\n): WorkflowDefinition<ConfigInput<C, I>, O>;\nexport function defineWorkflow<S extends InputShape, O = unknown>(\n input: InputSchema<S>,\n handler: Handler<InferInput<S>, O>\n): WorkflowDefinition<InferInput<S>, O>;\nexport function defineWorkflow<I = Record<string, unknown>, O = unknown>(\n handler: Handler<I, O>\n): WorkflowDefinition<I, O>;\n// The general config signature is the last one, so a compile error in a config or its handler\n// reports this signature instead of an unrelated one.\nexport function defineWorkflow<\n I = Record<string, unknown>,\n O = unknown,\n C extends InputSchema<InputShape> | undefined = undefined,\n F extends OutputField | undefined = undefined\n>(\n config: WorkflowConfig & {\n readonly input?: C;\n readonly output?: F;\n readonly validate?: InputValidator<ConfigInput<C, I>>;\n },\n handler: Handler<ConfigInput<C, I>, ConfigOutput<F, O>>\n): WorkflowDefinition<ConfigInput<C, I>, ConfigOutput<F, O>>;\nexport function defineWorkflow<I, O>(\n first:\n | InputSchema<InputShape>\n | {\n readonly input?: InputSchema<InputShape>;\n readonly output?: OutputField;\n readonly validate?: InputValidator<I>;\n }\n | Handler<I, O>,\n maybeHandler?: Handler<I, O>\n): WorkflowDefinition<I, O> {\n if (typeof first === 'function') {\n return { $diagonal: 'workflow', run: async (input, ctx) => first(input, ctx) };\n }\n\n const schema = first instanceof InputSchema ? first : first.input;\n const validate = first instanceof InputSchema ? undefined : first.validate;\n const handler = maybeHandler;\n\n if (handler === undefined) {\n throw new TypeError(\n schema === first\n ? 'defineWorkflow(input, handler) needs a handler after the input schema.'\n : 'defineWorkflow(config, handler) needs a handler after the config.'\n );\n }\n\n if (validate !== undefined && typeof validate !== 'function') {\n throw new TypeError(\n 'The validate option of defineWorkflow(config, handler) must be a function.'\n );\n }\n\n return {\n $diagonal: 'workflow',\n ...(schema === undefined ? {} : { input: schema.$spec }),\n ...(validate === undefined ? {} : { validate }),\n run: async (input, ctx) => handler(input, ctx)\n };\n}\n\nexport type ResponseOutput = {\n $response_status: number;\n $response_body: unknown;\n $response_content_type: string;\n};\nexport type RedirectType = 'internal' | 'external' | 'back';\nexport type RedirectOutput = {\n redirect_url: string;\n redirect_type: RedirectType;\n permanent: boolean;\n success?: string;\n};\n\nexport function respond(\n body: unknown,\n options: { status?: number; contentType?: string } = {}\n): ResponseOutput {\n return {\n $response_status: options.status ?? 200,\n $response_body: body,\n $response_content_type: options.contentType ?? 'application/json'\n };\n}\n\n/**\n * Builds the output of a graph `http.redirect` step, with the same `redirect_type` and\n * `permanent` keys. Without a `type`, a path such as `/done` redirects as `internal`. Any other\n * URL, including a protocol-relative `//host`, redirects as `external`, because an Inertia\n * request cannot follow a plain redirect to another origin. A `back` redirect is never permanent.\n */\nexport function redirect(\n url: string,\n options: { success?: string; type?: RedirectType; permanent?: boolean } = {}\n): RedirectOutput {\n const type = options.type ?? (/^\\/(?![/\\\\])/.test(url) ? 'internal' : 'external');\n const output: RedirectOutput = {\n redirect_url: url,\n redirect_type: type,\n permanent: type !== 'back' && options.permanent === true\n };\n\n if (options.success !== undefined) {\n output.success = options.success;\n }\n\n return output;\n}\n","/sdk/workspace-values.ts":"import {\n workspace as generatedWorkspace,\n type WorkspaceSystemFields,\n type WorkspaceValuesInput\n} from './generated/capabilities';\nimport type { WorkspaceFieldCatalog } from './index';\nimport { invoke } from './transport';\n\ntype Fields = Omit<WorkspaceSystemFields, keyof WorkspaceFieldCatalog> & WorkspaceFieldCatalog;\ntype Property<T, K extends string> = T extends null | undefined\n ? never\n : T extends readonly (infer Item)[]\n ? K extends `${number}`\n ? K extends keyof T\n ? T[K]\n : Item\n : unknown\n : T extends object\n ? K extends keyof T\n ? T[K]\n : unknown\n : unknown;\ntype PathValue<T, P extends string> = P extends `${infer Head}.${infer Tail}`\n ? PathValue<Property<T, Head>, Tail>\n : Property<T, P>;\nexport type WorkspaceValue<K extends string> = K extends keyof Fields\n ? Fields[K]\n : K extends `${infer Key}.${infer Path}`\n ? Key extends keyof Fields\n ? PathValue<Fields[Key], Path>\n : unknown\n : unknown;\ntype DefaultValue<D> = Exclude<D, undefined> | (undefined extends D ? null : never);\ntype ReadValue<K extends string, D> =\n | Exclude<WorkspaceValue<K>, null | undefined>\n | DefaultValue<D>;\ntype WriteValue<K extends string> = K extends keyof Fields ? Fields[K] | null : unknown;\ntype WrittenValues<V> = { [K in keyof V]: K extends string ? WriteValue<K> : unknown };\nexport type WorkspaceValues = { [K in keyof Fields]: Fields[K] | null } & Record<string, unknown>;\n\nfunction value<K extends string, D>(input: { key: K; defaultValue: D }): Promise<ReadValue<K, D>>;\nfunction value<K extends string, D = never>(input: {\n key: K;\n defaultValue?: D;\n}): Promise<ReadValue<K, D | undefined>>;\nfunction value(input: { key: string; defaultValue?: unknown }): Promise<unknown> {\n return invoke('workspace.value', input);\n}\n\nexport const workspace = {\n ...generatedWorkspace,\n value,\n setValue: <K extends string>(input: { key: K; value?: WriteValue<NoInfer<K>> }) =>\n invoke<WriteValue<K>>('workspace.set_value', input),\n values: (input: WorkspaceValuesInput = {}) => invoke<WorkspaceValues>('workspace.values', input),\n setValues: <V extends Record<string, unknown> = Record<never, never>>(input: {\n values?: V & WrittenValues<NoInfer<V>>;\n }) => invoke<WrittenValues<V>>('workspace.set_values', input)\n};\n","/sdk/workspace.ts":"// The editor's slot for `@diagonal/workflow/workspace`: it replaces this file with the workspace's\n// declarations. Local runs import the file `diagonal-workflow pull-types` writes instead.\nexport const resources: Record<string, string> = {};\nexport const notificationTypes: Record<string, string> = {};\nexport const notificationTemplates: Record<string, Record<string, string>> = {};\n"},"surface":{"root":{"HostError":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"code":{"callable":false},"status":{"callable":false},"details":{"callable":false},"failureId":{"callable":false},"failure":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"WorkflowFailure":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"status":{"callable":false},"details":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"fail":{"value":true,"callable":true,"tasks":[]},"validationError":{"value":true,"callable":true,"tasks":[]},"HostFailure":{"value":false},"invoke":{"value":true,"callable":true,"tasks":[],"invoke":true},"setTransport":{"value":true,"callable":true,"tasks":[]},"HostTransport":{"value":false},"transaction":{"value":true,"callable":true,"tasks":["transaction.begin","transaction.commit","transaction.rollback"]},"Liquid":{"value":false},"declaredInput":{"value":true,"callable":false},"data":{"value":true,"callable":false,"members":{"create":{"callable":true,"tasks":["data.create"]},"find":{"callable":true,"tasks":["data.find"]},"update":{"callable":true,"tasks":["data.update"]},"search":{"callable":true,"tasks":["data.search"]},"each":{"callable":true,"tasks":["data.search"]},"delete":{"callable":true,"tasks":["data.delete"]},"restore":{"callable":true,"tasks":["data.restore"]},"count":{"callable":true,"tasks":["data.count"]},"findOrCreate":{"callable":true,"tasks":["data.find-or-create"]},"updateOrCreate":{"callable":true,"tasks":["data.update-or-create"]},"createMany":{"callable":true,"tasks":["data.create-many"]},"deleteMany":{"callable":true,"tasks":["data.delete-many"]},"aggregateMetrics":{"callable":true,"tasks":["data.aggregate_metrics"]},"relation":{"callable":false,"members":{"attach":{"callable":true,"tasks":["data.relation.attach"]},"attachMany":{"callable":true,"tasks":["data.relation.attach-many"]},"detach":{"callable":true,"tasks":["data.relation.detach"]},"detachMany":{"callable":true,"tasks":["data.relation.detach-many"]},"sync":{"callable":true,"tasks":["data.relation.sync"]}}},"semanticSearch":{"callable":true,"tasks":["data.semantic_search"]},"sum":{"callable":true,"tasks":["data.sum"]},"validate":{"callable":true,"tasks":["data.validate"]}}},"mail":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["mail.send-notification"]},"search":{"callable":true,"tasks":["mail.search"]},"send":{"callable":true,"tasks":["mail.send"]}}},"notification":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["notification.send-notification"]},"sendBulkNotifications":{"callable":true,"tasks":["notification.send-bulk-notifications"]},"setConsent":{"callable":true,"tasks":["notification.set-consent"]},"send":{"callable":true,"tasks":["notification.send"]}}},"sms":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["sms.send-notification"]}}},"workspace":{"value":true,"callable":false,"members":{"value":{"callable":true,"tasks":["workspace.value"]},"setValue":{"callable":true,"tasks":["workspace.set_value"]},"values":{"callable":true,"tasks":["workspace.values"]},"setValues":{"callable":true,"tasks":["workspace.set_values"]},"loginUrl":{"callable":true,"tasks":["workspace.login_url"]}}},"InputField":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"$value":{"callable":false},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false},"from":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]},"from":{"callable":true,"tasks":[]}}}}},"InputSchema":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"shape":{"callable":false},"$value":{"callable":false,"members":{}},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false},"from":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]},"from":{"callable":true,"tasks":[]}}}}},"v":{"value":true,"callable":false,"members":{"text":{"callable":true,"tasks":[]},"email":{"callable":true,"tasks":[]},"url":{"callable":true,"tasks":[]},"uuid":{"callable":true,"tasks":[]},"phone":{"callable":true,"tasks":[]},"date":{"callable":true,"tasks":[]},"datetime":{"callable":true,"tasks":[]},"time":{"callable":true,"tasks":[]},"timezone":{"callable":true,"tasks":[]},"color":{"callable":true,"tasks":[]},"number":{"callable":true,"tasks":[]},"integer":{"callable":true,"tasks":[]},"money":{"callable":true,"tasks":[]},"boolean":{"callable":true,"tasks":[]},"select":{"callable":true,"tasks":[]},"list":{"callable":true,"tasks":[]},"object":{"callable":true,"tasks":[]},"record":{"callable":true,"tasks":[]},"recordReference":{"callable":true,"tasks":[]},"roleReference":{"callable":true,"tasks":[]},"file":{"callable":true,"tasks":[]},"content":{"callable":true,"tasks":[]}}},"ContentDocument":{"value":false},"ContentNode":{"value":false},"ContentOptions":{"value":false},"FileVisibility":{"value":false},"Infer":{"value":false},"InferInput":{"value":false},"InputFieldKind":{"value":false},"InputFieldSpec":{"value":false},"InputShape":{"value":false},"Money":{"value":false},"RecordScope":{"value":false},"RequestLocation":{"value":false},"RequestSource":{"value":false},"defineWorkflow":{"value":true,"callable":true,"tasks":[]},"parseWorkflowInput":{"value":true,"callable":true,"tasks":[]},"redirect":{"value":true,"callable":true,"tasks":[]},"respond":{"value":true,"callable":true,"tasks":[]},"validateWorkflowInput":{"value":true,"callable":true,"tasks":[]},"Identity":{"value":false},"InputErrors":{"value":false},"InputValidator":{"value":false},"RequestContext":{"value":false},"ScriptExecution":{"value":false},"WorkflowContext":{"value":false},"WorkflowDefinition":{"value":false},"WorkflowExecution":{"value":false},"ScriptHostContext":{"value":false},"WorkspaceResources":{"value":false},"WorkspaceFieldCatalog":{"value":false},"WorkspaceNotificationTypes":{"value":false},"SDK_VERSION":{"value":true,"callable":false},"WorkspaceSystemFields":{"value":false},"AiDecideInput":{"value":false},"AiDecideOutput":{"value":false},"AiRunPromptInput":{"value":false},"AiRunPromptOutput":{"value":false},"AuthImpersonateInput":{"value":false},"AuthImpersonateOutput":{"value":false},"AuthLoginInput":{"value":false},"AuthLoginOutput":{"value":false},"CalendarGenerateLinkInput":{"value":false},"CalendarGenerateLinkOutput":{"value":false},"CalendarSearchEventsInput":{"value":false},"CalendarSearchEventsOutput":{"value":false},"CallbackGetInput":{"value":false},"CallbackGetOutput":{"value":false},"CallbackRemoveInput":{"value":false},"CallbackRemoveOutput":{"value":false},"CallbackSetInput":{"value":false},"CallbackSetOutput":{"value":false},"ChartDistributionInput":{"value":false},"ChartDistributionOutput":{"value":false},"ChartKpiInput":{"value":false},"ChartKpiOutput":{"value":false},"ChartLeaderboardInput":{"value":false},"ChartLeaderboardOutput":{"value":false},"ChartTimeSeriesInput":{"value":false},"ChartTimeSeriesOutput":{"value":false},"DataAggregateMetricsInput":{"value":false},"DataAggregateMetricsOutput":{"value":false},"DataCountInput":{"value":false},"DataCountOutput":{"value":false},"DataCreateInput":{"value":false},"DataCreateOutput":{"value":false},"DataCreateManyInput":{"value":false},"DataCreateManyOutput":{"value":false},"DataDeleteInput":{"value":false},"DataDeleteOutput":{"value":false},"DataDeleteManyInput":{"value":false},"DataDeleteManyOutput":{"value":false},"DataFindInput":{"value":false},"DataFindOutput":{"value":false},"DataFindOrCreateInput":{"value":false},"DataFindOrCreateOutput":{"value":false},"DataRelationAttachInput":{"value":false},"DataRelationAttachOutput":{"value":false},"DataRelationAttachManyInput":{"value":false},"DataRelationAttachManyOutput":{"value":false},"DataRelationDetachInput":{"value":false},"DataRelationDetachOutput":{"value":false},"DataRelationDetachManyInput":{"value":false},"DataRelationDetachManyOutput":{"value":false},"DataRelationSyncInput":{"value":false},"DataRelationSyncOutput":{"value":false},"DataRestoreInput":{"value":false},"DataRestoreOutput":{"value":false},"DataSearchInput":{"value":false},"DataSearchOutput":{"value":false},"DataSemanticSearchInput":{"value":false},"DataSemanticSearchOutput":{"value":false},"DataSumInput":{"value":false},"DataSumOutput":{"value":false},"DataUpdateInput":{"value":false},"DataUpdateOutput":{"value":false},"DataUpdateOrCreateInput":{"value":false},"DataUpdateOrCreateOutput":{"value":false},"DataValidateInput":{"value":false},"DataValidateOutput":{"value":false},"DateAddInput":{"value":false},"DateAddOutput":{"value":false},"DateDiffInput":{"value":false},"DateDiffOutput":{"value":false},"DateEndOfInput":{"value":false},"DateEndOfOutput":{"value":false},"DateFormatInput":{"value":false},"DateFormatOutput":{"value":false},"DateStartOfInput":{"value":false},"DateStartOfOutput":{"value":false},"DateSubtractInput":{"value":false},"DateSubtractOutput":{"value":false},"FileChangeVisibilityInput":{"value":false},"FileChangeVisibilityOutput":{"value":false},"FileCreateFromUrlInput":{"value":false},"FileCreateFromUrlOutput":{"value":false},"FileCreateMediaLibraryItemInput":{"value":false},"FileCreateMediaLibraryItemOutput":{"value":false},"FileCreateQrCodeInput":{"value":false},"FileCreateQrCodeOutput":{"value":false},"GuardValidateInput":{"value":false},"GuardValidateOutput":{"value":false},"HttpRequestInput":{"value":false},"HttpRequestOutput":{"value":false},"LifecycleOutputInput":{"value":false},"LifecycleOutputOutput":{"value":false},"MailSearchInput":{"value":false},"MailSearchOutput":{"value":false},"MailSendInput":{"value":false},"MailSendOutput":{"value":false},"MailSendNotificationInput":{"value":false},"MailSendNotificationOutput":{"value":false},"MarkdownFromContentInput":{"value":false},"MarkdownFromContentOutput":{"value":false},"MarkdownToContentInput":{"value":false},"MarkdownToContentOutput":{"value":false},"MediaLibraryCreateFolderInput":{"value":false},"MediaLibraryCreateFolderOutput":{"value":false},"MediaLibraryDeleteItemInput":{"value":false},"MediaLibraryDeleteItemOutput":{"value":false},"MediaLibraryMoveItemsInput":{"value":false},"MediaLibraryMoveItemsOutput":{"value":false},"MediaLibraryUpdateItemInput":{"value":false},"MediaLibraryUpdateItemOutput":{"value":false},"MoneyFormatInput":{"value":false},"MoneyFormatOutput":{"value":false},"NotificationSendInput":{"value":false},"NotificationSendOutput":{"value":false},"NotificationSendBulkNotificationsInput":{"value":false},"NotificationSendBulkNotificationsOutput":{"value":false},"NotificationSendNotificationInput":{"value":false},"NotificationSendNotificationOutput":{"value":false},"NotificationSetConsentInput":{"value":false},"NotificationSetConsentOutput":{"value":false},"NumberFormatInput":{"value":false},"NumberFormatOutput":{"value":false},"PackageInstallInputInput":{"value":false},"PackageInstallInputOutput":{"value":false},"PageUrlInput":{"value":false},"PageUrlOutput":{"value":false},"PayablesVoidInput":{"value":false},"PayablesVoidOutput":{"value":false},"PayablesWriteOffInput":{"value":false},"PayablesWriteOffOutput":{"value":false},"PaymentCreateManualInput":{"value":false},"PaymentCreateManualOutput":{"value":false},"PaymentsChargeInput":{"value":false},"PaymentsChargeOutput":{"value":false},"PaymentsCheckoutInput":{"value":false},"PaymentsCheckoutOutput":{"value":false},"PaymentsConfirmInput":{"value":false},"PaymentsConfirmOutput":{"value":false},"PaymentsRefundInput":{"value":false},"PaymentsRefundOutput":{"value":false},"PaymentsVoidInput":{"value":false},"PaymentsVoidOutput":{"value":false},"PhoneFormatInput":{"value":false},"PhoneFormatOutput":{"value":false},"SchedulingBookSlotInput":{"value":false},"SchedulingBookSlotOutput":{"value":false},"SchedulingFindSlotsInput":{"value":false},"SchedulingFindSlotsOutput":{"value":false},"SchemaToJsonSchemaInput":{"value":false},"SchemaToJsonSchemaOutput":{"value":false},"SecurityRandomPasswordInput":{"value":false},"SecurityRandomPasswordOutput":{"value":false},"SmsSendNotificationInput":{"value":false},"SmsSendNotificationOutput":{"value":false},"SubscriptionsActivateInput":{"value":false},"SubscriptionsActivateOutput":{"value":false},"SubscriptionsCancelInput":{"value":false},"SubscriptionsCancelOutput":{"value":false},"SubscriptionsChangeItemsInput":{"value":false},"SubscriptionsChangeItemsOutput":{"value":false},"SubscriptionsCreateInput":{"value":false},"SubscriptionsCreateOutput":{"value":false},"SubscriptionsGenerateInvoiceInput":{"value":false},"SubscriptionsGenerateInvoiceOutput":{"value":false},"SubscriptionsPauseInput":{"value":false},"SubscriptionsPauseOutput":{"value":false},"SubscriptionsPreviewInput":{"value":false},"SubscriptionsPreviewOutput":{"value":false},"SubscriptionsPreviewChangeInput":{"value":false},"SubscriptionsPreviewChangeOutput":{"value":false},"SubscriptionsResumeInput":{"value":false},"SubscriptionsResumeOutput":{"value":false},"SubscriptionsSetUpcomingItemsInput":{"value":false},"SubscriptionsSetUpcomingItemsOutput":{"value":false},"TextGenerateInput":{"value":false},"TextGenerateOutput":{"value":false},"TextHashInput":{"value":false},"TextHashOutput":{"value":false},"TextRandomUuidInput":{"value":false},"TextRandomUuidOutput":{"value":false},"TextToContentInput":{"value":false},"TextToContentOutput":{"value":false},"TimeAddInput":{"value":false},"TimeAddOutput":{"value":false},"TimeDiffInput":{"value":false},"TimeDiffOutput":{"value":false},"TimeEndOfInput":{"value":false},"TimeEndOfOutput":{"value":false},"TimeFormatInput":{"value":false},"TimeFormatOutput":{"value":false},"TimeStartOfInput":{"value":false},"TimeStartOfOutput":{"value":false},"TimeSubtractInput":{"value":false},"TimeSubtractOutput":{"value":false},"TimezoneFormatInput":{"value":false},"TimezoneFormatOutput":{"value":false},"TimezoneInterpretInput":{"value":false},"TimezoneInterpretOutput":{"value":false},"TiptapParseInput":{"value":false},"TiptapParseOutput":{"value":false},"TransactionBeginInput":{"value":false},"TransactionBeginOutput":{"value":false},"TransactionCommitInput":{"value":false},"TransactionCommitOutput":{"value":false},"TransactionRollbackInput":{"value":false},"TransactionRollbackOutput":{"value":false},"UserAuthorizeInput":{"value":false},"UserAuthorizeOutput":{"value":false},"WebAgentInput":{"value":false},"WebAgentOutput":{"value":false},"WebBatchScrapeInput":{"value":false},"WebBatchScrapeOutput":{"value":false},"WebCrawlInput":{"value":false},"WebCrawlOutput":{"value":false},"WebExtractInput":{"value":false},"WebExtractOutput":{"value":false},"WebGoogleSearchInput":{"value":false},"WebGoogleSearchOutput":{"value":false},"WebMapInput":{"value":false},"WebMapOutput":{"value":false},"WebPdfInput":{"value":false},"WebPdfOutput":{"value":false},"WebScrapeInput":{"value":false},"WebScrapeOutput":{"value":false},"WebScreenshotInput":{"value":false},"WebScreenshotOutput":{"value":false},"WebSearchRankedInput":{"value":false},"WebSearchRankedOutput":{"value":false},"WorkflowRunInput":{"value":false},"WorkflowRunOutput":{"value":false},"WorkflowUrlInput":{"value":false},"WorkflowUrlOutput":{"value":false},"WorkspaceLoginUrlInput":{"value":false},"WorkspaceLoginUrlOutput":{"value":false},"WorkspaceSetValueInput":{"value":false},"WorkspaceSetValueOutput":{"value":false},"WorkspaceSetValuesInput":{"value":false},"WorkspaceSetValuesOutput":{"value":false},"WorkspaceValueInput":{"value":false},"WorkspaceValueOutput":{"value":false},"WorkspaceValuesInput":{"value":false},"WorkspaceValuesOutput":{"value":false},"ai":{"value":true,"callable":false,"members":{"decide":{"callable":true,"tasks":["ai.decide"]},"runPrompt":{"callable":true,"tasks":["ai.run_prompt"]}}},"auth":{"value":true,"callable":false,"members":{"impersonate":{"callable":true,"tasks":["auth.impersonate"]},"login":{"callable":true,"tasks":["auth.login"]}}},"calendar":{"value":true,"callable":false,"members":{"generateLink":{"callable":true,"tasks":["calendar.generate_link"]},"searchEvents":{"callable":true,"tasks":["calendar.search_events"]}}},"callback":{"value":true,"callable":false,"members":{"get":{"callable":true,"tasks":["callback.get"]},"remove":{"callable":true,"tasks":["callback.remove"]},"set":{"callable":true,"tasks":["callback.set"]}}},"chart":{"value":true,"callable":false,"members":{"distribution":{"callable":true,"tasks":["chart.distribution"]},"kpi":{"callable":true,"tasks":["chart.kpi"]},"leaderboard":{"callable":true,"tasks":["chart.leaderboard"]},"timeSeries":{"callable":true,"tasks":["chart.time_series"]}}},"date":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["date.add"]},"diff":{"callable":true,"tasks":["date.diff"]},"endOf":{"callable":true,"tasks":["date.end_of"]},"format":{"callable":true,"tasks":["date.format"]},"startOf":{"callable":true,"tasks":["date.start_of"]},"subtract":{"callable":true,"tasks":["date.subtract"]}}},"file":{"value":true,"callable":false,"members":{"changeVisibility":{"callable":true,"tasks":["file.change_visibility"]},"createFromUrl":{"callable":true,"tasks":["file.create_from_url"]},"createMediaLibraryItem":{"callable":true,"tasks":["file.create_media_library_item"]},"createQrCode":{"callable":true,"tasks":["file.create_qr_code"]}}},"guard":{"value":true,"callable":false,"members":{"validate":{"callable":true,"tasks":["guard.validate"]}}},"http":{"value":true,"callable":false,"members":{"request":{"callable":true,"tasks":["http.request"]}}},"lifecycle":{"value":true,"callable":false,"members":{"output":{"callable":true,"tasks":["lifecycle.output"]}}},"markdown":{"value":true,"callable":false,"members":{"fromContent":{"callable":true,"tasks":["markdown.from_content"]},"toContent":{"callable":true,"tasks":["markdown.to_content"]}}},"mediaLibrary":{"value":true,"callable":false,"members":{"createFolder":{"callable":true,"tasks":["media_library.create_folder"]},"deleteItem":{"callable":true,"tasks":["media_library.delete_item"]},"moveItems":{"callable":true,"tasks":["media_library.move_items"]},"updateItem":{"callable":true,"tasks":["media_library.update_item"]}}},"money":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["money.format"]}}},"number":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["number.format"]}}},"package":{"value":true,"callable":false,"members":{"installInput":{"callable":true,"tasks":["package.install-input"]}}},"page":{"value":true,"callable":false,"members":{"url":{"callable":true,"tasks":["page.url"]}}},"payables":{"value":true,"callable":false,"members":{"void":{"callable":true,"tasks":["payables.void"]},"writeOff":{"callable":true,"tasks":["payables.write-off"]}}},"payment":{"value":true,"callable":false,"members":{"createManual":{"callable":true,"tasks":["payment.create_manual"]}}},"payments":{"value":true,"callable":false,"members":{"charge":{"callable":true,"tasks":["payments.charge"]},"checkout":{"callable":true,"tasks":["payments.checkout"]},"confirm":{"callable":true,"tasks":["payments.confirm"]},"refund":{"callable":true,"tasks":["payments.refund"]},"void":{"callable":true,"tasks":["payments.void"]}}},"phone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["phone.format"]}}},"scheduling":{"value":true,"callable":false,"members":{"bookSlot":{"callable":true,"tasks":["scheduling.book_slot"]},"findSlots":{"callable":true,"tasks":["scheduling.find_slots"]}}},"schema":{"value":true,"callable":false,"members":{"toJsonSchema":{"callable":true,"tasks":["schema.to_json_schema"]}}},"security":{"value":true,"callable":false,"members":{"randomPassword":{"callable":true,"tasks":["security.random_password"]}}},"subscriptions":{"value":true,"callable":false,"members":{"activate":{"callable":true,"tasks":["subscriptions.activate"]},"cancel":{"callable":true,"tasks":["subscriptions.cancel"]},"changeItems":{"callable":true,"tasks":["subscriptions.change_items"]},"create":{"callable":true,"tasks":["subscriptions.create"]},"generateInvoice":{"callable":true,"tasks":["subscriptions.generate_invoice"]},"pause":{"callable":true,"tasks":["subscriptions.pause"]},"preview":{"callable":true,"tasks":["subscriptions.preview"]},"previewChange":{"callable":true,"tasks":["subscriptions.preview_change"]},"resume":{"callable":true,"tasks":["subscriptions.resume"]},"setUpcomingItems":{"callable":true,"tasks":["subscriptions.set_upcoming_items"]}}},"text":{"value":true,"callable":false,"members":{"generate":{"callable":true,"tasks":["text.generate"]},"hash":{"callable":true,"tasks":["text.hash"]},"randomUuid":{"callable":true,"tasks":["text.random_uuid"]},"toContent":{"callable":true,"tasks":["text.to_content"]}}},"time":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["time.add"]},"diff":{"callable":true,"tasks":["time.diff"]},"endOf":{"callable":true,"tasks":["time.end_of"]},"format":{"callable":true,"tasks":["time.format"]},"startOf":{"callable":true,"tasks":["time.start_of"]},"subtract":{"callable":true,"tasks":["time.subtract"]}}},"timezone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["timezone.format"]},"interpret":{"callable":true,"tasks":["timezone.interpret"]}}},"tiptap":{"value":true,"callable":false,"members":{"parse":{"callable":true,"tasks":["tiptap.parse"]}}},"user":{"value":true,"callable":false,"members":{"authorize":{"callable":true,"tasks":["user.authorize"]}}},"web":{"value":true,"callable":false,"members":{"agent":{"callable":true,"tasks":["web.agent"]},"batchScrape":{"callable":true,"tasks":["web.batch_scrape"]},"crawl":{"callable":true,"tasks":["web.crawl"]},"extract":{"callable":true,"tasks":["web.extract"]},"googleSearch":{"callable":true,"tasks":["web.google_search"]},"map":{"callable":true,"tasks":["web.map"]},"pdf":{"callable":true,"tasks":["web.pdf"]},"scrape":{"callable":true,"tasks":["web.scrape"]},"screenshot":{"callable":true,"tasks":["web.screenshot"]},"searchRanked":{"callable":true,"tasks":["web.search_ranked"]}}},"workflow":{"value":true,"callable":false,"members":{"run":{"callable":true,"tasks":["workflow.run"]},"url":{"callable":true,"tasks":["workflow.url"]}}}},"profiles":{"test":{"transaction":{"value":true,"callable":true,"tasks":["transaction.begin","transaction.commit","transaction.rollback"]},"data":{"value":true,"callable":false,"members":{"aggregateMetrics":{"callable":true,"tasks":["data.aggregate_metrics"]},"count":{"callable":true,"tasks":["data.count"]},"create":{"callable":true,"tasks":["data.create"]},"createMany":{"callable":true,"tasks":["data.create-many"]},"delete":{"callable":true,"tasks":["data.delete"]},"deleteMany":{"callable":true,"tasks":["data.delete-many"]},"find":{"callable":true,"tasks":["data.find"]},"findOrCreate":{"callable":true,"tasks":["data.find-or-create"]},"relation":{"callable":false,"members":{"attach":{"callable":true,"tasks":[]},"attachMany":{"callable":true,"tasks":[]},"detach":{"callable":true,"tasks":[]},"detachMany":{"callable":true,"tasks":[]},"sync":{"callable":true,"tasks":[]}}},"restore":{"callable":true,"tasks":["data.restore"]},"search":{"callable":true,"tasks":["data.search"]},"semanticSearch":{"callable":true,"tasks":["data.semantic_search"]},"sum":{"callable":true,"tasks":["data.sum"]},"update":{"callable":true,"tasks":["data.update"]},"updateOrCreate":{"callable":true,"tasks":["data.update-or-create"]},"validate":{"callable":true,"tasks":["data.validate"]},"each":{"callable":true,"tasks":[]}}},"HostError":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"code":{"callable":false},"status":{"callable":false},"details":{"callable":false},"failureId":{"callable":false},"failure":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"WorkflowFailure":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"status":{"callable":false},"details":{"callable":false},"name":{"callable":false},"message":{"callable":false},"stack":{"callable":false},"cause":{"callable":false}}}}},"fail":{"value":true,"callable":true,"tasks":[]},"validationError":{"value":true,"callable":true,"tasks":[]},"InputField":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"$value":{"callable":false},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false},"from":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]},"from":{"callable":true,"tasks":[]}}}}},"InputSchema":{"value":true,"callable":false,"members":{"prototype":{"callable":false,"members":{"shape":{"callable":false},"$value":{"callable":false,"members":{}},"$optional":{"callable":false},"$spec":{"callable":false,"members":{"kind":{"callable":false},"optional":{"callable":false},"nullable":{"callable":false},"rules":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":true,"tasks":[]},"toLocaleString":{"callable":true,"tasks":[]},"concat":{"callable":true,"tasks":[]},"join":{"callable":true,"tasks":[]},"slice":{"callable":true,"tasks":[]},"indexOf":{"callable":true,"tasks":[]},"lastIndexOf":{"callable":true,"tasks":[]},"every":{"callable":true,"tasks":[]},"some":{"callable":true,"tasks":[]},"forEach":{"callable":true,"tasks":[]},"map":{"callable":true,"tasks":[]},"filter":{"callable":true,"tasks":[]},"reduce":{"callable":true,"tasks":[]},"reduceRight":{"callable":true,"tasks":[]},"find":{"callable":true,"tasks":[]},"findIndex":{"callable":true,"tasks":[]},"entries":{"callable":true,"tasks":[]},"keys":{"callable":true,"tasks":[]},"values":{"callable":true,"tasks":[]},"includes":{"callable":true,"tasks":[]},"flatMap":{"callable":true,"tasks":[]},"flat":{"callable":true,"tasks":[]},"at":{"callable":true,"tasks":[]},"findLast":{"callable":true,"tasks":[]},"findLastIndex":{"callable":true,"tasks":[]},"toReversed":{"callable":true,"tasks":[]},"toSorted":{"callable":true,"tasks":[]},"toSpliced":{"callable":true,"tasks":[]},"with":{"callable":true,"tasks":[]},"__@iterator@17":{"callable":true,"tasks":[]},"__@unscopables@394":{"callable":false,"members":{"length":{"callable":false},"toString":{"callable":false},"toLocaleString":{"callable":false},"concat":{"callable":false},"join":{"callable":false},"slice":{"callable":false},"indexOf":{"callable":false},"lastIndexOf":{"callable":false},"every":{"callable":false},"some":{"callable":false},"forEach":{"callable":false},"map":{"callable":false},"filter":{"callable":false},"reduce":{"callable":false},"reduceRight":{"callable":false},"find":{"callable":false},"findIndex":{"callable":false},"entries":{"callable":false},"keys":{"callable":false},"values":{"callable":false},"includes":{"callable":false},"flatMap":{"callable":false},"flat":{"callable":false},"at":{"callable":false},"findLast":{"callable":false},"findLastIndex":{"callable":false},"toReversed":{"callable":false},"toSorted":{"callable":false},"toSpliced":{"callable":false},"with":{"callable":false},"__@iterator@17":{"callable":false},"__@unscopables@394":{"callable":false}}}}},"label":{"callable":false},"description":{"callable":false},"options":{"callable":false},"items":{"callable":false},"fields":{"callable":false},"resource":{"callable":false},"scope":{"callable":false},"accept":{"callable":false},"visibility":{"callable":false},"content":{"callable":false},"from":{"callable":false}}},"optional":{"callable":true,"tasks":[]},"nullable":{"callable":true,"tasks":[]},"min":{"callable":true,"tasks":[]},"max":{"callable":true,"tasks":[]},"between":{"callable":true,"tasks":[]},"size":{"callable":true,"tasks":[]},"regex":{"callable":true,"tasks":[]},"rule":{"callable":true,"tasks":[]},"label":{"callable":true,"tasks":[]},"description":{"callable":true,"tasks":[]},"from":{"callable":true,"tasks":[]}}}}},"v":{"value":true,"callable":false,"members":{"text":{"callable":true,"tasks":[]},"email":{"callable":true,"tasks":[]},"url":{"callable":true,"tasks":[]},"uuid":{"callable":true,"tasks":[]},"phone":{"callable":true,"tasks":[]},"date":{"callable":true,"tasks":[]},"datetime":{"callable":true,"tasks":[]},"time":{"callable":true,"tasks":[]},"timezone":{"callable":true,"tasks":[]},"color":{"callable":true,"tasks":[]},"number":{"callable":true,"tasks":[]},"integer":{"callable":true,"tasks":[]},"money":{"callable":true,"tasks":[]},"boolean":{"callable":true,"tasks":[]},"select":{"callable":true,"tasks":[]},"list":{"callable":true,"tasks":[]},"object":{"callable":true,"tasks":[]},"record":{"callable":true,"tasks":[]},"recordReference":{"callable":true,"tasks":[]},"roleReference":{"callable":true,"tasks":[]},"file":{"callable":true,"tasks":[]},"content":{"callable":true,"tasks":[]}}},"ContentDocument":{"value":false},"ContentNode":{"value":false},"ContentOptions":{"value":false},"FileVisibility":{"value":false},"Infer":{"value":false},"InferInput":{"value":false},"InputFieldKind":{"value":false},"InputFieldSpec":{"value":false},"InputShape":{"value":false},"Money":{"value":false},"RecordScope":{"value":false},"defineWorkflow":{"value":true,"callable":true,"tasks":[]},"parseWorkflowInput":{"value":true,"callable":true,"tasks":[]},"redirect":{"value":true,"callable":true,"tasks":[]},"respond":{"value":true,"callable":true,"tasks":[]},"validateWorkflowInput":{"value":true,"callable":true,"tasks":[]},"Identity":{"value":false},"InputErrors":{"value":false},"InputValidator":{"value":false},"RequestContext":{"value":false},"ScriptExecution":{"value":false},"WorkflowContext":{"value":false},"WorkflowDefinition":{"value":false},"WorkflowExecution":{"value":false},"ScriptHostContext":{"value":false},"WorkspaceFieldCatalog":{"value":false},"WorkspaceNotificationTypes":{"value":false},"WorkspaceResources":{"value":false},"ai":{"value":true,"callable":false,"members":{"decide":{"callable":true,"tasks":["ai.decide"]},"runPrompt":{"callable":true,"tasks":["ai.run_prompt"]}}},"calendar":{"value":true,"callable":false,"members":{"generateLink":{"callable":true,"tasks":["calendar.generate_link"]},"searchEvents":{"callable":true,"tasks":["calendar.search_events"]}}},"callback":{"value":true,"callable":false,"members":{"get":{"callable":true,"tasks":["callback.get"]},"remove":{"callable":true,"tasks":["callback.remove"]},"set":{"callable":true,"tasks":["callback.set"]}}},"chart":{"value":true,"callable":false,"members":{"distribution":{"callable":true,"tasks":["chart.distribution"]},"kpi":{"callable":true,"tasks":["chart.kpi"]},"leaderboard":{"callable":true,"tasks":["chart.leaderboard"]},"timeSeries":{"callable":true,"tasks":["chart.time_series"]}}},"date":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["date.add"]},"diff":{"callable":true,"tasks":["date.diff"]},"endOf":{"callable":true,"tasks":["date.end_of"]},"format":{"callable":true,"tasks":["date.format"]},"startOf":{"callable":true,"tasks":["date.start_of"]},"subtract":{"callable":true,"tasks":["date.subtract"]}}},"file":{"value":true,"callable":false,"members":{"changeVisibility":{"callable":true,"tasks":["file.change_visibility"]},"createFromUrl":{"callable":true,"tasks":["file.create_from_url"]},"createMediaLibraryItem":{"callable":true,"tasks":["file.create_media_library_item"]},"createQrCode":{"callable":true,"tasks":["file.create_qr_code"]}}},"guard":{"value":true,"callable":false,"members":{"validate":{"callable":true,"tasks":["guard.validate"]}}},"http":{"value":true,"callable":false,"members":{"request":{"callable":true,"tasks":["http.request"]}}},"lifecycle":{"value":true,"callable":false,"members":{"output":{"callable":true,"tasks":["lifecycle.output"]}}},"mail":{"value":true,"callable":false,"members":{"search":{"callable":true,"tasks":["mail.search"]},"send":{"callable":true,"tasks":["mail.send"]},"sendNotification":{"callable":true,"tasks":["mail.send-notification"]}}},"markdown":{"value":true,"callable":false,"members":{"fromContent":{"callable":true,"tasks":["markdown.from_content"]},"toContent":{"callable":true,"tasks":["markdown.to_content"]}}},"mediaLibrary":{"value":true,"callable":false,"members":{"createFolder":{"callable":true,"tasks":["media_library.create_folder"]},"deleteItem":{"callable":true,"tasks":["media_library.delete_item"]},"moveItems":{"callable":true,"tasks":["media_library.move_items"]},"updateItem":{"callable":true,"tasks":["media_library.update_item"]}}},"money":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["money.format"]}}},"notification":{"value":true,"callable":false,"members":{"send":{"callable":true,"tasks":["notification.send"]},"sendBulkNotifications":{"callable":true,"tasks":["notification.send-bulk-notifications"]},"sendNotification":{"callable":true,"tasks":["notification.send-notification"]},"setConsent":{"callable":true,"tasks":["notification.set-consent"]}}},"number":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["number.format"]}}},"package":{"value":true,"callable":false,"members":{"installInput":{"callable":true,"tasks":["package.install-input"]}}},"page":{"value":true,"callable":false,"members":{"url":{"callable":true,"tasks":["page.url"]}}},"payables":{"value":true,"callable":false,"members":{"void":{"callable":true,"tasks":["payables.void"]},"writeOff":{"callable":true,"tasks":["payables.write-off"]}}},"payment":{"value":true,"callable":false,"members":{"createManual":{"callable":true,"tasks":["payment.create_manual"]}}},"payments":{"value":true,"callable":false,"members":{"charge":{"callable":true,"tasks":["payments.charge"]},"checkout":{"callable":true,"tasks":["payments.checkout"]},"confirm":{"callable":true,"tasks":["payments.confirm"]},"refund":{"callable":true,"tasks":["payments.refund"]},"void":{"callable":true,"tasks":["payments.void"]}}},"phone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["phone.format"]}}},"scheduling":{"value":true,"callable":false,"members":{"bookSlot":{"callable":true,"tasks":["scheduling.book_slot"]},"findSlots":{"callable":true,"tasks":["scheduling.find_slots"]}}},"schema":{"value":true,"callable":false,"members":{"toJsonSchema":{"callable":true,"tasks":["schema.to_json_schema"]}}},"security":{"value":true,"callable":false,"members":{"randomPassword":{"callable":true,"tasks":["security.random_password"]}}},"sms":{"value":true,"callable":false,"members":{"sendNotification":{"callable":true,"tasks":["sms.send-notification"]}}},"subscriptions":{"value":true,"callable":false,"members":{"activate":{"callable":true,"tasks":["subscriptions.activate"]},"cancel":{"callable":true,"tasks":["subscriptions.cancel"]},"changeItems":{"callable":true,"tasks":["subscriptions.change_items"]},"create":{"callable":true,"tasks":["subscriptions.create"]},"generateInvoice":{"callable":true,"tasks":["subscriptions.generate_invoice"]},"pause":{"callable":true,"tasks":["subscriptions.pause"]},"preview":{"callable":true,"tasks":["subscriptions.preview"]},"previewChange":{"callable":true,"tasks":["subscriptions.preview_change"]},"resume":{"callable":true,"tasks":["subscriptions.resume"]},"setUpcomingItems":{"callable":true,"tasks":["subscriptions.set_upcoming_items"]}}},"text":{"value":true,"callable":false,"members":{"generate":{"callable":true,"tasks":["text.generate"]},"hash":{"callable":true,"tasks":["text.hash"]},"randomUuid":{"callable":true,"tasks":["text.random_uuid"]},"toContent":{"callable":true,"tasks":["text.to_content"]}}},"time":{"value":true,"callable":false,"members":{"add":{"callable":true,"tasks":["time.add"]},"diff":{"callable":true,"tasks":["time.diff"]},"endOf":{"callable":true,"tasks":["time.end_of"]},"format":{"callable":true,"tasks":["time.format"]},"startOf":{"callable":true,"tasks":["time.start_of"]},"subtract":{"callable":true,"tasks":["time.subtract"]}}},"timezone":{"value":true,"callable":false,"members":{"format":{"callable":true,"tasks":["timezone.format"]},"interpret":{"callable":true,"tasks":["timezone.interpret"]}}},"tiptap":{"value":true,"callable":false,"members":{"parse":{"callable":true,"tasks":["tiptap.parse"]}}},"user":{"value":true,"callable":false,"members":{"authorize":{"callable":true,"tasks":["user.authorize"]}}},"web":{"value":true,"callable":false,"members":{"agent":{"callable":true,"tasks":["web.agent"]},"batchScrape":{"callable":true,"tasks":["web.batch_scrape"]},"crawl":{"callable":true,"tasks":["web.crawl"]},"extract":{"callable":true,"tasks":["web.extract"]},"googleSearch":{"callable":true,"tasks":["web.google_search"]},"map":{"callable":true,"tasks":["web.map"]},"pdf":{"callable":true,"tasks":["web.pdf"]},"scrape":{"callable":true,"tasks":["web.scrape"]},"screenshot":{"callable":true,"tasks":["web.screenshot"]},"searchRanked":{"callable":true,"tasks":["web.search_ranked"]}}},"workflow":{"value":true,"callable":false,"members":{"run":{"callable":true,"tasks":["workflow.run"]},"url":{"callable":true,"tasks":["workflow.url"]}}},"workspace":{"value":true,"callable":false,"members":{"loginUrl":{"callable":true,"tasks":["workspace.login_url"]},"setValue":{"callable":true,"tasks":["workspace.set_value"]},"setValues":{"callable":true,"tasks":["workspace.set_values"]},"value":{"callable":true,"tasks":["workspace.value"]},"values":{"callable":true,"tasks":["workspace.values"]}}}}},"ranges":{"data.search":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"data.count":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"data.aggregateMetrics":{"limit":{"minimum":1,"maximum":1000}},"data.semanticSearch":{"topK":{"minimum":1,"maximum":100}},"data.sum":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"mail.search":{"limit":{"minimum":1,"maximum":100}},"chart.distribution":{"limit":{"minimum":1,"maximum":50}},"chart.leaderboard":{"limit":{"minimum":1,"maximum":100}},"chart.timeSeries":{"limit":{"minimum":1,"maximum":1000}}},"rangesByType":{"ChartDistributionInput":{"limit":{"minimum":1,"maximum":50}},"ChartLeaderboardInput":{"limit":{"minimum":1,"maximum":100}},"ChartTimeSeriesInput":{"limit":{"minimum":1,"maximum":1000}},"DataAggregateMetricsInput":{"limit":{"minimum":1,"maximum":1000}},"DataCountInput":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"DataSearchInput":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"DataSemanticSearchInput":{"topK":{"minimum":1,"maximum":100}},"DataSumInput":{"page":{"minimum":1},"pageSize":{"minimum":1,"maximum":100}},"MailSearchInput":{"limit":{"minimum":1,"maximum":100}}},"liquidSlots":{"mail.send":{"layoutData":["$references","content"]},"notification.send":{"layoutData":["$references","content"]}},"liquidSlotsByType":{"MailSendInput":{"layoutData":["$references","content"]},"NotificationSendInput":{"layoutData":["$references","content"]}},"augmentable":["WorkspaceFieldCatalog","WorkspaceNotificationTypes","WorkspaceResources"]},"profiles":{"workflow":{"label":"A workflow script","imports":["@diagonal/workflow","@diagonal/workflow/workspace"],"specifier":null,"entry":null,"defaultExports":["defineWorkflow"]},"test":{"label":"A test script","imports":["@diagonal/workflow","@diagonal-hq/workflows/test","@diagonal/workflow/workspace"],"specifier":"@diagonal-hq/workflows/test","entry":"/sdk/profiles/test.ts","defaultExports":["defineWorkflow"]}}}
|