@diagonal-hq/cli 0.42.1 → 0.42.2
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-3LBUEOMY.mjs → cli-check-data-K7Y2SOSP.mjs} +2 -2
- package/dist/cli-chunk-3SNILJKW.mjs +87 -0
- package/dist/{cli-sdk-files.generated-PNUTKWYQ.mjs → cli-sdk-files.generated-CETMBWOK.mjs} +2 -2
- package/dist/{cli-workflows-VFKTQW7H.mjs → cli-workflows-XIIQQSDG.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/package.json +1 -1
- package/dist/cli-chunk-77DCVFIZ.mjs +0 -87
|
@@ -9,7 +9,7 @@ import type { ContentDocument } from '../input';
|
|
|
9
9
|
import type { DeepReadonly, Liquid, StaticLiquid } from '../liquid';
|
|
10
10
|
import { invoke } from '../transport';
|
|
11
11
|
|
|
12
|
-
export const SDK_VERSION =
|
|
12
|
+
export const SDK_VERSION = 82;
|
|
13
13
|
|
|
14
14
|
export interface WorkspaceSystemFields {
|
|
15
15
|
"ai_custom_system_prompt": string | null;
|
|
@@ -1422,7 +1422,7 @@ export const workspace = {
|
|
|
1422
1422
|
values: (input: WorkspaceValuesInput = {}): Promise<WorkspaceValuesOutput> => invoke('workspace.values', input),
|
|
1423
1423
|
};
|
|
1424
1424
|
|
|
1425
|
-
`, "/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;\ndelete guest.__host;\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 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" };
|
|
1425
|
+
`, "/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" };
|
|
1426
1426
|
var SDK_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": 1e3 } }, "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": 1e3 } } }, "rangesByType": { "ChartDistributionInput": { "limit": { "minimum": 1, "maximum": 50 } }, "ChartLeaderboardInput": { "limit": { "minimum": 1, "maximum": 100 } }, "ChartTimeSeriesInput": { "limit": { "minimum": 1, "maximum": 1e3 } }, "DataAggregateMetricsInput": { "limit": { "minimum": 1, "maximum": 1e3 } }, "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"] };
|
|
1427
1427
|
export {
|
|
1428
1428
|
SDK_FILES,
|
package/dist/cli.mjs
CHANGED
|
@@ -10914,7 +10914,7 @@ async function checkSources() {
|
|
|
10914
10914
|
if (existsSync4(DATA_FILE) && existsSync4(SDK_FILE)) {
|
|
10915
10915
|
return { dataFile: DATA_FILE, sdkFile: SDK_FILE };
|
|
10916
10916
|
}
|
|
10917
|
-
const { checkData, scriptSdk } = await import("./cli-check-data-
|
|
10917
|
+
const { checkData, scriptSdk } = await import("./cli-check-data-K7Y2SOSP.mjs");
|
|
10918
10918
|
return { data: checkData(), sdk: scriptSdk() };
|
|
10919
10919
|
}
|
|
10920
10920
|
function isScriptTestPath(path) {
|
|
@@ -10934,7 +10934,7 @@ function holdsSkills(root, plan) {
|
|
|
10934
10934
|
async function checkCheckout(root, options) {
|
|
10935
10935
|
const sources = await checkSources();
|
|
10936
10936
|
const plan = composePackages(root);
|
|
10937
|
-
const testRunner = async () => (await import("./cli-workflows-
|
|
10937
|
+
const testRunner = async () => (await import("./cli-workflows-XIIQQSDG.mjs")).runBuildTests;
|
|
10938
10938
|
const skillReader = async () => (await import("./cli-skill-file-XEFKCU5Y.mjs")).skillFrontMatter;
|
|
10939
10939
|
const finish = (checkoutRoot, buildPlan, answer, runTests2) => {
|
|
10940
10940
|
const run = hasScriptTests(answer) ? runTests2(checkoutRoot, answer.tests) : null;
|