@powerhousedao/pieces-framework 6.2.3-dev.84 → 6.2.3-dev.85

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.
@@ -57,6 +57,7 @@ export declare function undeclaredPortEdges<E extends PortedEdge>(edges: readonl
57
57
  //#region src/workflow/core.d.ts
58
58
  export declare const CORE_PIECE_NAME = "@powerhousedao/piece-core";
59
59
  export declare const BRANCH_PORTS: readonly string[];
60
+ export declare const STOP_PORTS: readonly string[];
60
61
  export declare function knownPorts(block: {
61
62
  pieceName: string;
62
63
  kind: "action" | "trigger";
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","names":[],"sources":["../src/workflow/strategy.ts","../src/workflow/schedule.ts","../src/workflow/ports.ts","../src/workflow/core.ts","../src/workflow/document-reference.ts","../src/workflow/manual-inputs.ts"],"mappings":";YAGY;YAEA;EACN,UAAU;;EACV;;qBAUO;qBAGA,6BAA6B;WAC/B;EAET,YAAY,mBAAmB;;wBAOjB,qBAAqB,oBAAoB;wBAczC,gBAAgB,oBAAoB;;;qBCzCvC;qBAEA;WACX;WACA;WACA;;YAGU,4BAA4B;qBAE3B;YAED,uBAAuB;YAEvB;EACN;EAAc;EAAc;;EAE5B;EACA;EACA,MAAM;EACN;EACA;;qBAGO,4BAA4B;EACvC,YAAY;;wBAiCE,cAAc;wBAqCd,oBAAoB,kBAAkB;wBAmBtC,oBAAoB;;;qBClHvB;qBACA;qBAGA;qBAGA;wBAGG,UAAU;iBAIT;EACf;EACA;EACA;;wBAKc,oBAAoB,UAAU,YAC5C,gBAAgB,KAChB,UAAU,qDACT;;;qBCxBU;qBAGA;wBAIG,WAAW;EACzB;EACA;EACA;;;;iBCXe;EACf;EACA;EACA;EAEA,UAAU;;qBAIC;iBAEI;GACd,mBAAmB;;UAGZ;EACR;EACA;EACA;EACA,UAAU;;wBAgCI,kBAAkB,QAAQ,aAAa;wBASvC,oBACd,iBACC,SAAS;wBA0BI,kBACd,iBACC;EAAW,QAAQ;EAAY,OAAO;;wBAQzB,oBACd,iBACC,SAAS,oBAAoB;wBAoChB,mBAAmB;wBAmBnB,eAAe,iBAAiB;wBAchC,oBAAoB;wBAMpB,mBACd,gBACA,SAAS,WAAW,sBAAsB;;;qBCjL/B;YAUD,0BAA0B;iBAErB;EAEf;EACA;EACA,MAAM;EACN;EACA;EAEA;EAEA,UAAU;;iBAGK;EACf;EACA;;iBAGe;EACf;EACA;;qBAGW,2BAA2B;WAC7B,QAAQ;EACjB,YAAY,QAAQ;;wBA6BN,mBAAmB,iBAAiB;wBA8BpC,kBAAkB,kBAAkB;KA8B/C;EAAY;;EAAqB;;wBAGtB,kBAAkB,OAAO,aAAa,eAAe;wBAgDrD,cAAc,OAAO;wBA0BrB,oBACd,iBAAiB,eACjB,mBACC;wBAsCa,oBAAoB,OAAO"}
1
+ {"version":3,"file":"workflow.d.ts","names":[],"sources":["../src/workflow/strategy.ts","../src/workflow/schedule.ts","../src/workflow/ports.ts","../src/workflow/core.ts","../src/workflow/document-reference.ts","../src/workflow/manual-inputs.ts"],"mappings":";YAGY;YAEA;EACN,UAAU;;EACV;;qBAUO;qBAGA,6BAA6B;WAC/B;EAET,YAAY,mBAAmB;;wBAOjB,qBAAqB,oBAAoB;wBAczC,gBAAgB,oBAAoB;;;qBCzCvC;qBAEA;WACX;WACA;WACA;;YAGU,4BAA4B;qBAE3B;YAED,uBAAuB;YAEvB;EACN;EAAc;EAAc;;EAE5B;EACA;EACA,MAAM;EACN;EACA;;qBAGO,4BAA4B;EACvC,YAAY;;wBAiCE,cAAc;wBAqCd,oBAAoB,kBAAkB;wBAmBtC,oBAAoB;;;qBClHvB;qBACA;qBAGA;qBAGA;wBAGG,UAAU;iBAIT;EACf;EACA;EACA;;wBAKc,oBAAoB,UAAU,YAC5C,gBAAgB,KAChB,UAAU,qDACT;;;qBCxBU;qBAGA;qBAGA;wBAIG,WAAW;EACzB;EACA;EACA;;;;iBCde;EACf;EACA;EACA;EAEA,UAAU;;qBAIC;iBAEI;GACd,mBAAmB;;UAGZ;EACR;EACA;EACA;EACA,UAAU;;wBAgCI,kBAAkB,QAAQ,aAAa;wBASvC,oBACd,iBACC,SAAS;wBA0BI,kBACd,iBACC;EAAW,QAAQ;EAAY,OAAO;;wBAQzB,oBACd,iBACC,SAAS,oBAAoB;wBAoChB,mBAAmB;wBAmBnB,eAAe,iBAAiB;wBAchC,oBAAoB;wBAMpB,mBACd,gBACA,SAAS,WAAW,sBAAsB;;;qBCjL/B;YAUD,0BAA0B;iBAErB;EAEf;EACA;EACA,MAAM;EACN;EACA;EAEA;EAEA,UAAU;;iBAGK;EACf;EACA;;iBAGe;EACf;EACA;;qBAGW,2BAA2B;WAC7B,QAAQ;EACjB,YAAY,QAAQ;;wBA6BN,mBAAmB,iBAAiB;wBA8BpC,kBAAkB,kBAAkB;KA8B/C;EAAY;;EAAqB;;wBAGtB,kBAAkB,OAAO,aAAa,eAAe;wBAgDrD,cAAc,OAAO;wBA0BrB,oBACd,iBAAiB,eACjB,mBACC;wBAsCa,oBAAoB,OAAO"}
package/dist/workflow.js CHANGED
@@ -121,9 +121,13 @@ const BRANCH_PORTS = [
121
121
  "false",
122
122
  ERROR_PORT
123
123
  ];
124
+ const STOP_PORTS = [ERROR_PORT];
124
125
  function knownPorts(block) {
125
126
  if (block.kind === "trigger") return TRIGGER_PORTS;
126
- return block.pieceName === "@powerhousedao/piece-core" && block.name === "branch" ? BRANCH_PORTS : PIECE_ACTION_PORTS;
127
+ if (block.pieceName !== "@powerhousedao/piece-core") return PIECE_ACTION_PORTS;
128
+ if (block.name === "branch") return BRANCH_PORTS;
129
+ if (block.name === "stop") return STOP_PORTS;
130
+ return PIECE_ACTION_PORTS;
127
131
  }
128
132
 
129
133
  //#endregion
@@ -380,5 +384,5 @@ function manualInputTypeName(input) {
380
384
  }
381
385
 
382
386
  //#endregion
383
- export { APP_WEBHOOK_UNSUPPORTED, BRANCH_PORTS, CORE_PIECE_NAME, DEFAULT_TIMEZONE, DOCUMENT_REF_KEY, ERROR_PORT, MANUAL_INPUT_TYPES, ManualPayloadError, NEXT_PORT, PIECE_ACTION_PORTS, SCHEDULE_MODES, SCHEDULE_UNIT_MS, ScheduleConfigError, TRIGGER_PORTS, TriggerStrategyError, checkTriggerStrategy, coerceManualPayload, coerceManualValue, containsDocumentRef, documentReference, documentRefsIn, expandDocumentRefs, flowPorts, isDocumentRefMarker, isDocumentReference, isReactorDocument, knownPorts, manualDefault, manualInputTypeName, parseCronText, parseManualInputs, parseManualOptions, parseScheduleConfig, referenceDocuments, scheduleConfigIssue, triggerDelivery, undeclaredPortEdges };
387
+ export { APP_WEBHOOK_UNSUPPORTED, BRANCH_PORTS, CORE_PIECE_NAME, DEFAULT_TIMEZONE, DOCUMENT_REF_KEY, ERROR_PORT, MANUAL_INPUT_TYPES, ManualPayloadError, NEXT_PORT, PIECE_ACTION_PORTS, SCHEDULE_MODES, SCHEDULE_UNIT_MS, STOP_PORTS, ScheduleConfigError, TRIGGER_PORTS, TriggerStrategyError, checkTriggerStrategy, coerceManualPayload, coerceManualValue, containsDocumentRef, documentReference, documentRefsIn, expandDocumentRefs, flowPorts, isDocumentRefMarker, isDocumentReference, isReactorDocument, knownPorts, manualDefault, manualInputTypeName, parseCronText, parseManualInputs, parseManualOptions, parseScheduleConfig, referenceDocuments, scheduleConfigIssue, triggerDelivery, undeclaredPortEdges };
384
388
  //# sourceMappingURL=workflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.js","names":["isRecord"],"sources":["../src/workflow/strategy.ts","../src/workflow/schedule.ts","../src/workflow/ports.ts","../src/workflow/core.ts","../src/workflow/document-reference.ts","../src/workflow/manual-inputs.ts"],"sourcesContent":["// How a trigger is fed, decided from its resolved descriptor's strategy. The\n// runtime arms by it and the editor draws by it; nothing stores it.\n\nexport type TriggerDelivery = \"poll\" | \"webhook\" | \"manual\";\n\nexport type TriggerStrategyCheck =\n | { delivery: TriggerDelivery }\n | { issue: string };\n\nconst DELIVERIES: Record<string, TriggerDelivery> = {\n POLLING: \"poll\",\n WEBHOOK: \"webhook\",\n MANUAL: \"manual\",\n};\n\n// Activepieces routes APP_WEBHOOK events through one app-level endpoint and a\n// listener table; this runtime has neither, so it refuses them.\nexport const APP_WEBHOOK_UNSUPPORTED =\n \"TriggerStrategy.APP_WEBHOOK (app-level webhooks) is not supported\";\n\nexport class TriggerStrategyError extends Error {\n readonly strategy: unknown;\n\n constructor(strategy: unknown, issue: string) {\n super(issue);\n this.name = \"TriggerStrategyError\";\n this.strategy = strategy;\n }\n}\n\nexport function checkTriggerStrategy(strategy: unknown): TriggerStrategyCheck {\n if (typeof strategy === \"string\" && Object.hasOwn(DELIVERIES, strategy)) {\n return { delivery: DELIVERIES[strategy] };\n }\n if (strategy === \"APP_WEBHOOK\") return { issue: APP_WEBHOOK_UNSUPPORTED };\n return {\n issue:\n strategy === undefined || strategy === null || strategy === \"\"\n ? \"The trigger declares no strategy\"\n : `Unknown trigger strategy ${JSON.stringify(strategy)}`,\n };\n}\n\n// Throws TriggerStrategyError for an unsupported or unknown strategy.\nexport function triggerDelivery(strategy: unknown): TriggerDelivery {\n const check = checkTriggerStrategy(strategy);\n if (\"issue\" in check) throw new TriggerStrategyError(strategy, check.issue);\n return check.delivery;\n}\n","// The core piece's schedule trigger config, read the same way by the editor\n// and the runtime. The runtime also runs the cron through croner before arming it.\n\nexport const DEFAULT_TIMEZONE = \"UTC\";\n\nexport const SCHEDULE_UNIT_MS = {\n minutes: 60_000,\n hours: 3_600_000,\n days: 86_400_000,\n} as const;\n\nexport type ScheduleUnit = keyof typeof SCHEDULE_UNIT_MS;\n\nexport const SCHEDULE_MODES = [\"cron\", \"interval\"] as const;\n\nexport type ScheduleMode = (typeof SCHEDULE_MODES)[number];\n\nexport type ScheduleConfig =\n | { mode: \"cron\"; cron: string; timezone: string }\n | {\n mode: \"interval\";\n every: number;\n unit: ScheduleUnit;\n everyMs: number;\n timezone: string;\n };\n\nexport class ScheduleConfigError extends Error {\n constructor(message: string) {\n super(`Schedule: ${message}`);\n this.name = \"ScheduleConfigError\";\n }\n}\n\n// One cron field: digits, names, ranges, steps and lists; croner checks values.\nconst CRON_FIELD =\n /^[\\d*?A-Za-z]+(?:[-/][\\dA-Za-z]+)*(?:,[\\d*?A-Za-z]+(?:[-/][\\dA-Za-z]+)*)*$/;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\n// Intl is the authority on IANA names, in the browser and in Node alike.\nfunction parseTimezone(value: unknown): string {\n if (value === undefined || value === null || value === \"\") {\n return DEFAULT_TIMEZONE;\n }\n if (typeof value !== \"string\") {\n throw new ScheduleConfigError('\"timezone\" must be an IANA name');\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: value });\n } catch {\n throw new ScheduleConfigError(\n `unknown timezone \"${value}\" (use an IANA name such as Europe/Lisbon)`,\n );\n }\n return value;\n}\n\n// Exactly five fields: minute hour day month weekday.\nexport function parseCronText(cron: unknown): string {\n if (typeof cron !== \"string\" || cron.trim() === \"\") {\n throw new ScheduleConfigError('\"cron\" is required in cron mode');\n }\n const pattern = cron.trim().replace(/\\s+/g, \" \");\n const fields = pattern.split(\" \");\n if (fields.length !== 5) {\n throw new ScheduleConfigError(\n `cron \"${pattern}\" must have exactly five fields (minute hour day month weekday)`,\n );\n }\n const bad = fields.find((field) => !CRON_FIELD.test(field));\n if (bad !== undefined) {\n throw new ScheduleConfigError(\n `cron \"${pattern}\" has an invalid field \"${bad}\"`,\n );\n }\n return pattern;\n}\n\nfunction parseInterval(record: Record<string, unknown>) {\n const { every, unit } = record;\n if (typeof every !== \"number\" || !Number.isInteger(every) || every < 1) {\n throw new ScheduleConfigError(\n '\"every\" must be a whole number of at least 1 in interval mode',\n );\n }\n if (typeof unit !== \"string\" || !Object.hasOwn(SCHEDULE_UNIT_MS, unit)) {\n throw new ScheduleConfigError(\n `\"unit\" must be one of ${Object.keys(SCHEDULE_UNIT_MS).join(\", \")}`,\n );\n }\n const key = unit as ScheduleUnit;\n return { every, unit: key, everyMs: every * SCHEDULE_UNIT_MS[key] };\n}\n\n// { mode, cron | every + unit, timezone? }; `mode` is required.\nexport function parseScheduleConfig(config: unknown): ScheduleConfig {\n if (!isRecord(config)) {\n throw new ScheduleConfigError(\"the config must be an object\");\n }\n const timezone = parseTimezone(config.timezone);\n if (config.mode === \"cron\") {\n return { mode: \"cron\", cron: parseCronText(config.cron), timezone };\n }\n if (config.mode === \"interval\") {\n return { mode: \"interval\", ...parseInterval(config), timezone };\n }\n throw new ScheduleConfigError(\n config.mode === undefined\n ? '\"mode\" is required (\"cron\" or \"interval\")'\n : `\"mode\" must be \"cron\" or \"interval\", not ${JSON.stringify(config.mode)}`,\n );\n}\n\n// The problem with a config, or undefined when it parses.\nexport function scheduleConfigIssue(config: unknown): string | undefined {\n try {\n parseScheduleConfig(config);\n return undefined;\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n}\n","// Output ports a block declares. Descriptors carry them; the editor draws\n// only these, and the runtime warns about an edge on any other.\n\nexport const NEXT_PORT = \"next\";\nexport const ERROR_PORT = \"error\";\n\n// Every piece action: it succeeds onto \"next\" or fails onto \"error\".\nexport const PIECE_ACTION_PORTS: readonly string[] = [NEXT_PORT, ERROR_PORT];\n\n// A trigger starts the run on \"next\".\nexport const TRIGGER_PORTS: readonly string[] = [NEXT_PORT];\n\n// The ports that carry the flow on; \"error\" is a failure route.\nexport function flowPorts(ports: readonly string[]): string[] {\n return ports.filter((port) => port !== ERROR_PORT);\n}\n\nexport interface PortedEdge {\n id: string;\n from: string;\n port: string;\n}\n\n// Edges leaving on a port their source does not declare. A source whose\n// ports are not known (undefined) is not judged.\nexport function undeclaredPortEdges<E extends PortedEdge>(\n edges: readonly E[],\n portsOf: (sourceId: string) => readonly string[] | undefined,\n): E[] {\n return edges.filter((edge) => {\n const ports = portsOf(edge.from);\n return ports !== undefined && !ports.includes(edge.port);\n });\n}\n","// The built-in piece every reactor serves: branch, assert and the triggers\n// that belong to no service. Its version is the runtime's own.\nimport { ERROR_PORT, PIECE_ACTION_PORTS, TRIGGER_PORTS } from \"./ports.js\";\n\nexport const CORE_PIECE_NAME = \"@powerhousedao/piece-core\";\n\n// The core branch action leaves on \"true\" or \"false\".\nexport const BRANCH_PORTS: readonly string[] = [\"true\", \"false\", ERROR_PORT];\n\n// A block's ports as known before its descriptor loads: fixed per kind, and\n// the core branch's own.\nexport function knownPorts(block: {\n pieceName: string;\n kind: \"action\" | \"trigger\";\n name: string;\n}): readonly string[] {\n if (block.kind === \"trigger\") return TRIGGER_PORTS;\n return block.pieceName === CORE_PIECE_NAME && block.name === \"branch\"\n ? BRANCH_PORTS\n : PIECE_ACTION_PORTS;\n}\n","// A pointer to a reactor document, and the marker the run journal stores in\n// place of a document a step returned. No dependencies: the editor bundles it.\n\nexport interface DocumentReference {\n documentId: string;\n documentType: string;\n branch: string;\n // Operation count per scope when the reference was taken.\n revision: Record<string, number>;\n}\n\n// The journal's stand-in for a document: { \"$documentRef\": DocumentReference }.\nexport const DOCUMENT_REF_KEY = \"$documentRef\";\n\nexport interface DocumentRefMarker {\n [DOCUMENT_REF_KEY]: DocumentReference;\n}\n\ninterface HeaderLike {\n id: string;\n documentType: string;\n branch: string;\n revision: Record<string, number>;\n}\n\n// Keys of a PHDocument; anything else beside them is the step's own.\nconst DOCUMENT_KEYS = new Set([\n \"header\",\n \"state\",\n \"initialState\",\n \"operations\",\n \"clipboard\",\n]);\n\n// Past this depth a value is left as it is.\nconst MAX_DEPTH = 64;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value) as unknown;\n return proto === Object.prototype || proto === null;\n}\n\nfunction isRevision(value: unknown): value is Record<string, number> {\n return (\n isPlainObject(value) &&\n Object.values(value).every(\n (entry) => typeof entry === \"number\" && Number.isFinite(entry),\n )\n );\n}\n\nexport function documentReference(header: HeaderLike): DocumentReference {\n return {\n documentId: header.id,\n documentType: header.documentType,\n branch: header.branch,\n revision: { ...header.revision },\n };\n}\n\nexport function isDocumentReference(\n value: unknown,\n): value is DocumentReference {\n return (\n isPlainObject(value) &&\n typeof value.documentId === \"string\" &&\n typeof value.documentType === \"string\" &&\n typeof value.branch === \"string\" &&\n isRevision(value.revision)\n );\n}\n\n// A reactor document header: ids, branch, per-scope revisions and timestamps.\nfunction isDocumentHeader(value: unknown): value is HeaderLike {\n return (\n isPlainObject(value) &&\n typeof value.id === \"string\" &&\n value.id !== \"\" &&\n typeof value.documentType === \"string\" &&\n value.documentType !== \"\" &&\n typeof value.branch === \"string\" &&\n isRevision(value.revision) &&\n typeof value.createdAtUtcIso === \"string\" &&\n typeof value.lastModifiedAtUtcIso === \"string\"\n );\n}\n\n// Shaped like a reactor document: { header, state } with a full header.\nexport function isReactorDocument(\n value: unknown,\n): value is { header: HeaderLike; state: Record<string, unknown> } {\n return (\n isPlainObject(value) &&\n isDocumentHeader(value.header) &&\n isPlainObject(value.state)\n );\n}\n\nexport function isDocumentRefMarker(\n value: unknown,\n): value is DocumentRefMarker & Record<string, unknown> {\n return isPlainObject(value) && isDocumentReference(value[DOCUMENT_REF_KEY]);\n}\n\nfunction walk(\n value: unknown,\n visit: (node: Record<string, unknown>) => Record<string, unknown> | undefined,\n depth: number,\n seen: WeakSet<object>,\n): unknown {\n if (depth > MAX_DEPTH || typeof value !== \"object\" || value === null) {\n return value;\n }\n if (seen.has(value)) return value;\n if (Array.isArray(value)) {\n seen.add(value);\n const mapped = value.map((item) => walk(item, visit, depth + 1, seen));\n seen.delete(value);\n return mapped;\n }\n if (!isPlainObject(value)) return value;\n seen.add(value);\n const replaced = visit(value);\n const source = replaced ?? value;\n const result = Object.fromEntries(\n Object.entries(source).map(([key, entry]) => [\n key,\n replaced && !(key in value) ? entry : walk(entry, visit, depth + 1, seen),\n ]),\n );\n seen.delete(value);\n return result;\n}\n\n// Every document in the value, at any depth, swapped for its marker. Keys a\n// step set beside a document's (e.g. extractedFrom) stay next to the marker.\nexport function referenceDocuments(value: unknown): unknown {\n return walk(\n value,\n (node) => {\n if (!isReactorDocument(node)) return undefined;\n const rest = Object.entries(node).filter(\n ([key]) => !DOCUMENT_KEYS.has(key),\n );\n return {\n [DOCUMENT_REF_KEY]: documentReference(node.header),\n ...Object.fromEntries(rest),\n };\n },\n 0,\n new WeakSet(),\n );\n}\n\n// The references in a value's markers, in walk order.\nexport function documentRefsIn(value: unknown): DocumentReference[] {\n const found: DocumentReference[] = [];\n walk(\n value,\n (node) => {\n if (isDocumentRefMarker(node)) found.push(node[DOCUMENT_REF_KEY]);\n return undefined;\n },\n 0,\n new WeakSet(),\n );\n return found;\n}\n\nexport function containsDocumentRef(value: unknown): boolean {\n return documentRefsIn(value).length > 0;\n}\n\n// Each marker replaced by what `expand` gives for its reference, with the\n// marker's other keys kept beside it.\nexport function expandDocumentRefs(\n value: unknown,\n expand: (reference: DocumentReference) => Record<string, unknown>,\n): unknown {\n return walk(\n value,\n (node) => {\n if (!isDocumentRefMarker(node)) return undefined;\n const { [DOCUMENT_REF_KEY]: reference, ...rest } = node;\n return { ...rest, ...expand(reference) };\n },\n 0,\n new WeakSet(),\n );\n}\n","// The core manual trigger's `inputs` (Activepieces' web form fields, more\n// types), read the same way by the editor's run form and the runtime.\n\nexport const MANUAL_INPUT_TYPES = [\n \"text\",\n \"text_area\",\n \"number\",\n \"toggle\",\n \"date\",\n \"dropdown\",\n \"json\",\n] as const;\n\nexport type ManualInputType = (typeof MANUAL_INPUT_TYPES)[number];\n\nexport interface ManualInput {\n // The payload key.\n name: string;\n displayName: string;\n type: ManualInputType;\n required: boolean;\n description?: string;\n // As authored, text; coerced to the field's type when used.\n defaultValue?: string;\n // Dropdown only: the allowed values and the labels the run form shows.\n options?: ManualOption[];\n}\n\nexport interface ManualOption {\n label: string;\n value: string;\n}\n\nexport interface ManualPayloadFieldError {\n field: string;\n message: string;\n}\n\nexport class ManualPayloadError extends Error {\n readonly fields: ManualPayloadFieldError[];\n constructor(fields: ManualPayloadFieldError[]) {\n super(\n `Manual trigger payload: ${fields\n .map((entry) =>\n entry.field ? `\"${entry.field}\" ${entry.message}` : entry.message,\n )\n .join(\"; \")}`,\n );\n this.name = \"ManualPayloadError\";\n this.fields = fields;\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nconst text = (value: unknown) =>\n typeof value === \"string\" && value.trim() !== \"\" ? value.trim() : undefined;\n\nfunction defaultText(value: unknown): string | undefined {\n if (value === undefined || value === null || value === \"\") return undefined;\n if (typeof value === \"string\") return value;\n if (typeof value === \"object\") return JSON.stringify(value);\n return String(value as number | boolean);\n}\n\n// One option per line as `Label = value` (split on the first \" = \") or a bare\n// value that is its own label; blanks dropped, a repeated value keeps the first.\nexport function parseManualOptions(value: unknown): ManualOption[] {\n const entries = Array.isArray(value)\n ? value.map(optionEntry)\n : typeof value === \"string\"\n ? value.split(/\\r?\\n/).map(optionLine)\n : [];\n const byValue = new Map<string, ManualOption>();\n for (const entry of entries) {\n if (entry && !byValue.has(entry.value)) byValue.set(entry.value, entry);\n }\n return [...byValue.values()];\n}\n\nfunction optionLine(line: string): ManualOption | undefined {\n const at = line.indexOf(\" = \");\n const value = (at < 0 ? line : line.slice(at + 3)).trim();\n if (value === \"\") return undefined;\n const label = at < 0 ? value : line.slice(0, at).trim();\n return { label: label === \"\" ? value : label, value };\n}\n\nfunction optionEntry(entry: unknown): ManualOption | undefined {\n if (!isRecord(entry)) return optionLine(String(entry));\n const value = defaultText(entry.value)?.trim();\n if (!value) return undefined;\n return { label: text(entry.label) ?? value, value };\n}\n\n// The trigger config's `inputs`; rows without a name or known type are dropped,\n// and a later row replaces an earlier one of the same name.\nexport function parseManualInputs(config: unknown): ManualInput[] {\n const rows = isRecord(config) ? config.inputs : undefined;\n if (!Array.isArray(rows)) return [];\n const byName = new Map<string, ManualInput>();\n for (const row of rows) {\n if (!isRecord(row)) continue;\n const name = text(row.name);\n const type = row.type as ManualInputType;\n if (!name || !MANUAL_INPUT_TYPES.includes(type)) continue;\n const description = text(row.description);\n const defaultValue = defaultText(row.defaultValue);\n byName.delete(name);\n byName.set(name, {\n name,\n displayName: text(row.displayName) ?? name,\n type,\n required: row.required === true,\n ...(description ? { description } : {}),\n ...(defaultValue !== undefined ? { defaultValue } : {}),\n ...(type === \"dropdown\"\n ? { options: parseManualOptions(row.options) }\n : {}),\n });\n }\n return [...byName.values()];\n}\n\n// Calendar date or date-time, ISO 8601.\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}(?:[T ][\\d:.]+(?:Z|[+-]\\d{2}:?\\d{2})?)?$/;\n\ntype Coerced = { value: unknown } | { error: string };\n\n// One value as the field's type, or why it isn't one.\nexport function coerceManualValue(input: ManualInput, raw: unknown): Coerced {\n switch (input.type) {\n case \"text\":\n case \"text_area\":\n if (typeof raw === \"string\") return { value: raw };\n if (typeof raw === \"number\" || typeof raw === \"boolean\") {\n return { value: String(raw) };\n }\n return { error: \"must be text\" };\n case \"number\": {\n if (typeof raw === \"number\" && Number.isFinite(raw))\n return { value: raw };\n const parsed =\n typeof raw === \"string\" && raw.trim() !== \"\" ? Number(raw) : NaN;\n return Number.isFinite(parsed)\n ? { value: parsed }\n : { error: \"must be a number\" };\n }\n case \"toggle\":\n if (typeof raw === \"boolean\") return { value: raw };\n if (typeof raw === \"string\" && /^(true|false)$/i.test(raw.trim())) {\n return { value: raw.trim().toLowerCase() === \"true\" };\n }\n return { error: \"must be true or false\" };\n case \"date\": {\n const value = typeof raw === \"string\" ? raw.trim() : \"\";\n const time = ISO_DATE.test(value) ? Date.parse(value) : NaN;\n return Number.isNaN(time)\n ? { error: \"must be an ISO 8601 date\" }\n : { value: new Date(time).toISOString() };\n }\n case \"dropdown\": {\n const value =\n typeof raw === \"string\" || typeof raw === \"number\" ? String(raw) : \"\";\n const values = (input.options ?? []).map((option) => option.value);\n if (values.length === 0 ? value !== \"\" : values.includes(value)) {\n return { value };\n }\n return values.length > 0\n ? { error: `must be one of ${values.map((v) => `\"${v}\"`).join(\", \")}` }\n : { error: \"must be text\" };\n }\n case \"json\":\n return { value: raw };\n }\n}\n\n// An authored default as the field's type; JSON text is parsed when it parses.\nexport function manualDefault(input: ManualInput): unknown {\n if (input.defaultValue === undefined) return undefined;\n if (input.type === \"json\") {\n try {\n return JSON.parse(input.defaultValue) as unknown;\n } catch {\n return input.defaultValue;\n }\n }\n if (input.type === \"dropdown\") {\n // A value, or failing that an option's label.\n const options = input.options ?? [];\n const match =\n options.find((option) => option.value === input.defaultValue) ??\n options.find((option) => option.label === input.defaultValue);\n if (match) return match.value;\n }\n const coerced = coerceManualValue(input, input.defaultValue);\n return \"value\" in coerced ? coerced.value : undefined;\n}\n\nconst isMissing = (value: unknown) =>\n value === undefined || value === null || value === \"\";\n\n// The payload with each declared field coerced and defaults filled in; keys no\n// field declares pass through. Throws ManualPayloadError.\nexport function coerceManualPayload(\n inputs: readonly ManualInput[],\n payload: unknown,\n): Record<string, unknown> {\n if (payload !== undefined && payload !== null && !isRecord(payload)) {\n throw new ManualPayloadError([\n { field: \"\", message: \"must be a JSON object\" },\n ]);\n }\n const next: Record<string, unknown> = { ...payload };\n const errors: ManualPayloadFieldError[] = [];\n for (const input of inputs) {\n let raw = next[input.name];\n if (isMissing(raw)) raw = manualDefault(input);\n if (isMissing(raw)) {\n delete next[input.name];\n if (input.required) {\n errors.push({ field: input.name, message: \"is required\" });\n }\n continue;\n }\n const coerced = coerceManualValue(input, raw);\n if (\"error\" in coerced) {\n errors.push({ field: input.name, message: coerced.error });\n } else next[input.name] = coerced.value;\n }\n if (errors.length > 0) throw new ManualPayloadError(errors);\n return next;\n}\n\nconst TYPE_NAMES: Record<ManualInputType, string> = {\n text: \"String\",\n text_area: \"String\",\n number: \"Float\",\n toggle: \"Boolean\",\n date: \"DateTime\",\n dropdown: \"String\",\n json: \"JSON\",\n};\n\n// The GraphQL-style type the expression picker shows for a field.\nexport function manualInputTypeName(input: ManualInput): string {\n const base = TYPE_NAMES[input.type];\n return input.required ? `${base}!` : base;\n}\n"],"mappings":";AASA,MAAM,aAA8C;CAClD,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAIA,MAAa,0BACX;AAEF,IAAa,uBAAb,cAA0C,MAAM;CAC9C,AAAS;CAET,YAAY,UAAmB,OAAe;EAC5C,MAAM,KAAK;EACX,KAAK,OAAO;EACZ,KAAK,WAAW;CAClB;AACF;AAEA,SAAgB,qBAAqB,UAAyC;CAC5E,IAAI,OAAO,aAAa,YAAY,OAAO,OAAO,YAAY,QAAQ,GACpE,OAAO,EAAE,UAAU,WAAW,UAAU;CAE1C,IAAI,aAAa,eAAe,OAAO,EAAE,OAAO,wBAAwB;CACxE,OAAO,EACL,OACE,aAAa,UAAa,aAAa,QAAQ,aAAa,KACxD,qCACA,4BAA4B,KAAK,UAAU,QAAQ,IAC3D;AACF;AAGA,SAAgB,gBAAgB,UAAoC;CAClE,MAAM,QAAQ,qBAAqB,QAAQ;CAC3C,IAAI,WAAW,OAAO,MAAM,IAAI,qBAAqB,UAAU,MAAM,KAAK;CAC1E,OAAO,MAAM;AACf;;;;AC7CA,MAAa,mBAAmB;AAEhC,MAAa,mBAAmB;CAC9B,SAAS;CACT,OAAO;CACP,MAAM;AACR;AAIA,MAAa,iBAAiB,CAAC,QAAQ,UAAU;AAcjD,IAAa,sBAAb,cAAyC,MAAM;CAC7C,YAAY,SAAiB;EAC3B,MAAM,aAAa,SAAS;EAC5B,KAAK,OAAO;CACd;AACF;AAGA,MAAM,aACJ;AAEF,SAASA,WAAS,OAAkD;CAClE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAGA,SAAS,cAAc,OAAwB;CAC7C,IAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IACrD;CAEF,IAAI,OAAO,UAAU,UACnB,MAAM,IAAI,oBAAoB,mCAAiC;CAEjE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ClD,MAAM;CACN,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,UAAU;CACV,MAAM;AACR;AAGA,SAAgB,oBAAoB,OAA4B;CAC9D,MAAM,OAAO,WAAW,MAAM;CAC9B,OAAO,MAAM,WAAW,GAAG,KAAK,KAAK;AACvC"}
1
+ {"version":3,"file":"workflow.js","names":["isRecord"],"sources":["../src/workflow/strategy.ts","../src/workflow/schedule.ts","../src/workflow/ports.ts","../src/workflow/core.ts","../src/workflow/document-reference.ts","../src/workflow/manual-inputs.ts"],"sourcesContent":["// How a trigger is fed, decided from its resolved descriptor's strategy. The\n// runtime arms by it and the editor draws by it; nothing stores it.\n\nexport type TriggerDelivery = \"poll\" | \"webhook\" | \"manual\";\n\nexport type TriggerStrategyCheck =\n | { delivery: TriggerDelivery }\n | { issue: string };\n\nconst DELIVERIES: Record<string, TriggerDelivery> = {\n POLLING: \"poll\",\n WEBHOOK: \"webhook\",\n MANUAL: \"manual\",\n};\n\n// Activepieces routes APP_WEBHOOK events through one app-level endpoint and a\n// listener table; this runtime has neither, so it refuses them.\nexport const APP_WEBHOOK_UNSUPPORTED =\n \"TriggerStrategy.APP_WEBHOOK (app-level webhooks) is not supported\";\n\nexport class TriggerStrategyError extends Error {\n readonly strategy: unknown;\n\n constructor(strategy: unknown, issue: string) {\n super(issue);\n this.name = \"TriggerStrategyError\";\n this.strategy = strategy;\n }\n}\n\nexport function checkTriggerStrategy(strategy: unknown): TriggerStrategyCheck {\n if (typeof strategy === \"string\" && Object.hasOwn(DELIVERIES, strategy)) {\n return { delivery: DELIVERIES[strategy] };\n }\n if (strategy === \"APP_WEBHOOK\") return { issue: APP_WEBHOOK_UNSUPPORTED };\n return {\n issue:\n strategy === undefined || strategy === null || strategy === \"\"\n ? \"The trigger declares no strategy\"\n : `Unknown trigger strategy ${JSON.stringify(strategy)}`,\n };\n}\n\n// Throws TriggerStrategyError for an unsupported or unknown strategy.\nexport function triggerDelivery(strategy: unknown): TriggerDelivery {\n const check = checkTriggerStrategy(strategy);\n if (\"issue\" in check) throw new TriggerStrategyError(strategy, check.issue);\n return check.delivery;\n}\n","// The core piece's schedule trigger config, read the same way by the editor\n// and the runtime. The runtime also runs the cron through croner before arming it.\n\nexport const DEFAULT_TIMEZONE = \"UTC\";\n\nexport const SCHEDULE_UNIT_MS = {\n minutes: 60_000,\n hours: 3_600_000,\n days: 86_400_000,\n} as const;\n\nexport type ScheduleUnit = keyof typeof SCHEDULE_UNIT_MS;\n\nexport const SCHEDULE_MODES = [\"cron\", \"interval\"] as const;\n\nexport type ScheduleMode = (typeof SCHEDULE_MODES)[number];\n\nexport type ScheduleConfig =\n | { mode: \"cron\"; cron: string; timezone: string }\n | {\n mode: \"interval\";\n every: number;\n unit: ScheduleUnit;\n everyMs: number;\n timezone: string;\n };\n\nexport class ScheduleConfigError extends Error {\n constructor(message: string) {\n super(`Schedule: ${message}`);\n this.name = \"ScheduleConfigError\";\n }\n}\n\n// One cron field: digits, names, ranges, steps and lists; croner checks values.\nconst CRON_FIELD =\n /^[\\d*?A-Za-z]+(?:[-/][\\dA-Za-z]+)*(?:,[\\d*?A-Za-z]+(?:[-/][\\dA-Za-z]+)*)*$/;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\n// Intl is the authority on IANA names, in the browser and in Node alike.\nfunction parseTimezone(value: unknown): string {\n if (value === undefined || value === null || value === \"\") {\n return DEFAULT_TIMEZONE;\n }\n if (typeof value !== \"string\") {\n throw new ScheduleConfigError('\"timezone\" must be an IANA name');\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: value });\n } catch {\n throw new ScheduleConfigError(\n `unknown timezone \"${value}\" (use an IANA name such as Europe/Lisbon)`,\n );\n }\n return value;\n}\n\n// Exactly five fields: minute hour day month weekday.\nexport function parseCronText(cron: unknown): string {\n if (typeof cron !== \"string\" || cron.trim() === \"\") {\n throw new ScheduleConfigError('\"cron\" is required in cron mode');\n }\n const pattern = cron.trim().replace(/\\s+/g, \" \");\n const fields = pattern.split(\" \");\n if (fields.length !== 5) {\n throw new ScheduleConfigError(\n `cron \"${pattern}\" must have exactly five fields (minute hour day month weekday)`,\n );\n }\n const bad = fields.find((field) => !CRON_FIELD.test(field));\n if (bad !== undefined) {\n throw new ScheduleConfigError(\n `cron \"${pattern}\" has an invalid field \"${bad}\"`,\n );\n }\n return pattern;\n}\n\nfunction parseInterval(record: Record<string, unknown>) {\n const { every, unit } = record;\n if (typeof every !== \"number\" || !Number.isInteger(every) || every < 1) {\n throw new ScheduleConfigError(\n '\"every\" must be a whole number of at least 1 in interval mode',\n );\n }\n if (typeof unit !== \"string\" || !Object.hasOwn(SCHEDULE_UNIT_MS, unit)) {\n throw new ScheduleConfigError(\n `\"unit\" must be one of ${Object.keys(SCHEDULE_UNIT_MS).join(\", \")}`,\n );\n }\n const key = unit as ScheduleUnit;\n return { every, unit: key, everyMs: every * SCHEDULE_UNIT_MS[key] };\n}\n\n// { mode, cron | every + unit, timezone? }; `mode` is required.\nexport function parseScheduleConfig(config: unknown): ScheduleConfig {\n if (!isRecord(config)) {\n throw new ScheduleConfigError(\"the config must be an object\");\n }\n const timezone = parseTimezone(config.timezone);\n if (config.mode === \"cron\") {\n return { mode: \"cron\", cron: parseCronText(config.cron), timezone };\n }\n if (config.mode === \"interval\") {\n return { mode: \"interval\", ...parseInterval(config), timezone };\n }\n throw new ScheduleConfigError(\n config.mode === undefined\n ? '\"mode\" is required (\"cron\" or \"interval\")'\n : `\"mode\" must be \"cron\" or \"interval\", not ${JSON.stringify(config.mode)}`,\n );\n}\n\n// The problem with a config, or undefined when it parses.\nexport function scheduleConfigIssue(config: unknown): string | undefined {\n try {\n parseScheduleConfig(config);\n return undefined;\n } catch (error) {\n return error instanceof Error ? error.message : String(error);\n }\n}\n","// Output ports a block declares. Descriptors carry them; the editor draws\n// only these, and the runtime warns about an edge on any other.\n\nexport const NEXT_PORT = \"next\";\nexport const ERROR_PORT = \"error\";\n\n// Every piece action: it succeeds onto \"next\" or fails onto \"error\".\nexport const PIECE_ACTION_PORTS: readonly string[] = [NEXT_PORT, ERROR_PORT];\n\n// A trigger starts the run on \"next\".\nexport const TRIGGER_PORTS: readonly string[] = [NEXT_PORT];\n\n// The ports that carry the flow on; \"error\" is a failure route.\nexport function flowPorts(ports: readonly string[]): string[] {\n return ports.filter((port) => port !== ERROR_PORT);\n}\n\nexport interface PortedEdge {\n id: string;\n from: string;\n port: string;\n}\n\n// Edges leaving on a port their source does not declare. A source whose\n// ports are not known (undefined) is not judged.\nexport function undeclaredPortEdges<E extends PortedEdge>(\n edges: readonly E[],\n portsOf: (sourceId: string) => readonly string[] | undefined,\n): E[] {\n return edges.filter((edge) => {\n const ports = portsOf(edge.from);\n return ports !== undefined && !ports.includes(edge.port);\n });\n}\n","// The built-in piece every reactor serves: branch, assert and the triggers\n// that belong to no service. Its version is the runtime's own.\nimport { ERROR_PORT, PIECE_ACTION_PORTS, TRIGGER_PORTS } from \"./ports.js\";\n\nexport const CORE_PIECE_NAME = \"@powerhousedao/piece-core\";\n\n// The core branch action leaves on \"true\" or \"false\".\nexport const BRANCH_PORTS: readonly string[] = [\"true\", \"false\", ERROR_PORT];\n\n// The core stop action ends the run, so it continues on no port.\nexport const STOP_PORTS: readonly string[] = [ERROR_PORT];\n\n// A block's ports as known before its descriptor loads: fixed per kind, and\n// the core branch's and stop's own.\nexport function knownPorts(block: {\n pieceName: string;\n kind: \"action\" | \"trigger\";\n name: string;\n}): readonly string[] {\n if (block.kind === \"trigger\") return TRIGGER_PORTS;\n if (block.pieceName !== CORE_PIECE_NAME) return PIECE_ACTION_PORTS;\n if (block.name === \"branch\") return BRANCH_PORTS;\n if (block.name === \"stop\") return STOP_PORTS;\n return PIECE_ACTION_PORTS;\n}\n","// A pointer to a reactor document, and the marker the run journal stores in\n// place of a document a step returned. No dependencies: the editor bundles it.\n\nexport interface DocumentReference {\n documentId: string;\n documentType: string;\n branch: string;\n // Operation count per scope when the reference was taken.\n revision: Record<string, number>;\n}\n\n// The journal's stand-in for a document: { \"$documentRef\": DocumentReference }.\nexport const DOCUMENT_REF_KEY = \"$documentRef\";\n\nexport interface DocumentRefMarker {\n [DOCUMENT_REF_KEY]: DocumentReference;\n}\n\ninterface HeaderLike {\n id: string;\n documentType: string;\n branch: string;\n revision: Record<string, number>;\n}\n\n// Keys of a PHDocument; anything else beside them is the step's own.\nconst DOCUMENT_KEYS = new Set([\n \"header\",\n \"state\",\n \"initialState\",\n \"operations\",\n \"clipboard\",\n]);\n\n// Past this depth a value is left as it is.\nconst MAX_DEPTH = 64;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value) as unknown;\n return proto === Object.prototype || proto === null;\n}\n\nfunction isRevision(value: unknown): value is Record<string, number> {\n return (\n isPlainObject(value) &&\n Object.values(value).every(\n (entry) => typeof entry === \"number\" && Number.isFinite(entry),\n )\n );\n}\n\nexport function documentReference(header: HeaderLike): DocumentReference {\n return {\n documentId: header.id,\n documentType: header.documentType,\n branch: header.branch,\n revision: { ...header.revision },\n };\n}\n\nexport function isDocumentReference(\n value: unknown,\n): value is DocumentReference {\n return (\n isPlainObject(value) &&\n typeof value.documentId === \"string\" &&\n typeof value.documentType === \"string\" &&\n typeof value.branch === \"string\" &&\n isRevision(value.revision)\n );\n}\n\n// A reactor document header: ids, branch, per-scope revisions and timestamps.\nfunction isDocumentHeader(value: unknown): value is HeaderLike {\n return (\n isPlainObject(value) &&\n typeof value.id === \"string\" &&\n value.id !== \"\" &&\n typeof value.documentType === \"string\" &&\n value.documentType !== \"\" &&\n typeof value.branch === \"string\" &&\n isRevision(value.revision) &&\n typeof value.createdAtUtcIso === \"string\" &&\n typeof value.lastModifiedAtUtcIso === \"string\"\n );\n}\n\n// Shaped like a reactor document: { header, state } with a full header.\nexport function isReactorDocument(\n value: unknown,\n): value is { header: HeaderLike; state: Record<string, unknown> } {\n return (\n isPlainObject(value) &&\n isDocumentHeader(value.header) &&\n isPlainObject(value.state)\n );\n}\n\nexport function isDocumentRefMarker(\n value: unknown,\n): value is DocumentRefMarker & Record<string, unknown> {\n return isPlainObject(value) && isDocumentReference(value[DOCUMENT_REF_KEY]);\n}\n\nfunction walk(\n value: unknown,\n visit: (node: Record<string, unknown>) => Record<string, unknown> | undefined,\n depth: number,\n seen: WeakSet<object>,\n): unknown {\n if (depth > MAX_DEPTH || typeof value !== \"object\" || value === null) {\n return value;\n }\n if (seen.has(value)) return value;\n if (Array.isArray(value)) {\n seen.add(value);\n const mapped = value.map((item) => walk(item, visit, depth + 1, seen));\n seen.delete(value);\n return mapped;\n }\n if (!isPlainObject(value)) return value;\n seen.add(value);\n const replaced = visit(value);\n const source = replaced ?? value;\n const result = Object.fromEntries(\n Object.entries(source).map(([key, entry]) => [\n key,\n replaced && !(key in value) ? entry : walk(entry, visit, depth + 1, seen),\n ]),\n );\n seen.delete(value);\n return result;\n}\n\n// Every document in the value, at any depth, swapped for its marker. Keys a\n// step set beside a document's (e.g. extractedFrom) stay next to the marker.\nexport function referenceDocuments(value: unknown): unknown {\n return walk(\n value,\n (node) => {\n if (!isReactorDocument(node)) return undefined;\n const rest = Object.entries(node).filter(\n ([key]) => !DOCUMENT_KEYS.has(key),\n );\n return {\n [DOCUMENT_REF_KEY]: documentReference(node.header),\n ...Object.fromEntries(rest),\n };\n },\n 0,\n new WeakSet(),\n );\n}\n\n// The references in a value's markers, in walk order.\nexport function documentRefsIn(value: unknown): DocumentReference[] {\n const found: DocumentReference[] = [];\n walk(\n value,\n (node) => {\n if (isDocumentRefMarker(node)) found.push(node[DOCUMENT_REF_KEY]);\n return undefined;\n },\n 0,\n new WeakSet(),\n );\n return found;\n}\n\nexport function containsDocumentRef(value: unknown): boolean {\n return documentRefsIn(value).length > 0;\n}\n\n// Each marker replaced by what `expand` gives for its reference, with the\n// marker's other keys kept beside it.\nexport function expandDocumentRefs(\n value: unknown,\n expand: (reference: DocumentReference) => Record<string, unknown>,\n): unknown {\n return walk(\n value,\n (node) => {\n if (!isDocumentRefMarker(node)) return undefined;\n const { [DOCUMENT_REF_KEY]: reference, ...rest } = node;\n return { ...rest, ...expand(reference) };\n },\n 0,\n new WeakSet(),\n );\n}\n","// The core manual trigger's `inputs` (Activepieces' web form fields, more\n// types), read the same way by the editor's run form and the runtime.\n\nexport const MANUAL_INPUT_TYPES = [\n \"text\",\n \"text_area\",\n \"number\",\n \"toggle\",\n \"date\",\n \"dropdown\",\n \"json\",\n] as const;\n\nexport type ManualInputType = (typeof MANUAL_INPUT_TYPES)[number];\n\nexport interface ManualInput {\n // The payload key.\n name: string;\n displayName: string;\n type: ManualInputType;\n required: boolean;\n description?: string;\n // As authored, text; coerced to the field's type when used.\n defaultValue?: string;\n // Dropdown only: the allowed values and the labels the run form shows.\n options?: ManualOption[];\n}\n\nexport interface ManualOption {\n label: string;\n value: string;\n}\n\nexport interface ManualPayloadFieldError {\n field: string;\n message: string;\n}\n\nexport class ManualPayloadError extends Error {\n readonly fields: ManualPayloadFieldError[];\n constructor(fields: ManualPayloadFieldError[]) {\n super(\n `Manual trigger payload: ${fields\n .map((entry) =>\n entry.field ? `\"${entry.field}\" ${entry.message}` : entry.message,\n )\n .join(\"; \")}`,\n );\n this.name = \"ManualPayloadError\";\n this.fields = fields;\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nconst text = (value: unknown) =>\n typeof value === \"string\" && value.trim() !== \"\" ? value.trim() : undefined;\n\nfunction defaultText(value: unknown): string | undefined {\n if (value === undefined || value === null || value === \"\") return undefined;\n if (typeof value === \"string\") return value;\n if (typeof value === \"object\") return JSON.stringify(value);\n return String(value as number | boolean);\n}\n\n// One option per line as `Label = value` (split on the first \" = \") or a bare\n// value that is its own label; blanks dropped, a repeated value keeps the first.\nexport function parseManualOptions(value: unknown): ManualOption[] {\n const entries = Array.isArray(value)\n ? value.map(optionEntry)\n : typeof value === \"string\"\n ? value.split(/\\r?\\n/).map(optionLine)\n : [];\n const byValue = new Map<string, ManualOption>();\n for (const entry of entries) {\n if (entry && !byValue.has(entry.value)) byValue.set(entry.value, entry);\n }\n return [...byValue.values()];\n}\n\nfunction optionLine(line: string): ManualOption | undefined {\n const at = line.indexOf(\" = \");\n const value = (at < 0 ? line : line.slice(at + 3)).trim();\n if (value === \"\") return undefined;\n const label = at < 0 ? value : line.slice(0, at).trim();\n return { label: label === \"\" ? value : label, value };\n}\n\nfunction optionEntry(entry: unknown): ManualOption | undefined {\n if (!isRecord(entry)) return optionLine(String(entry));\n const value = defaultText(entry.value)?.trim();\n if (!value) return undefined;\n return { label: text(entry.label) ?? value, value };\n}\n\n// The trigger config's `inputs`; rows without a name or known type are dropped,\n// and a later row replaces an earlier one of the same name.\nexport function parseManualInputs(config: unknown): ManualInput[] {\n const rows = isRecord(config) ? config.inputs : undefined;\n if (!Array.isArray(rows)) return [];\n const byName = new Map<string, ManualInput>();\n for (const row of rows) {\n if (!isRecord(row)) continue;\n const name = text(row.name);\n const type = row.type as ManualInputType;\n if (!name || !MANUAL_INPUT_TYPES.includes(type)) continue;\n const description = text(row.description);\n const defaultValue = defaultText(row.defaultValue);\n byName.delete(name);\n byName.set(name, {\n name,\n displayName: text(row.displayName) ?? name,\n type,\n required: row.required === true,\n ...(description ? { description } : {}),\n ...(defaultValue !== undefined ? { defaultValue } : {}),\n ...(type === \"dropdown\"\n ? { options: parseManualOptions(row.options) }\n : {}),\n });\n }\n return [...byName.values()];\n}\n\n// Calendar date or date-time, ISO 8601.\nconst ISO_DATE = /^\\d{4}-\\d{2}-\\d{2}(?:[T ][\\d:.]+(?:Z|[+-]\\d{2}:?\\d{2})?)?$/;\n\ntype Coerced = { value: unknown } | { error: string };\n\n// One value as the field's type, or why it isn't one.\nexport function coerceManualValue(input: ManualInput, raw: unknown): Coerced {\n switch (input.type) {\n case \"text\":\n case \"text_area\":\n if (typeof raw === \"string\") return { value: raw };\n if (typeof raw === \"number\" || typeof raw === \"boolean\") {\n return { value: String(raw) };\n }\n return { error: \"must be text\" };\n case \"number\": {\n if (typeof raw === \"number\" && Number.isFinite(raw))\n return { value: raw };\n const parsed =\n typeof raw === \"string\" && raw.trim() !== \"\" ? Number(raw) : NaN;\n return Number.isFinite(parsed)\n ? { value: parsed }\n : { error: \"must be a number\" };\n }\n case \"toggle\":\n if (typeof raw === \"boolean\") return { value: raw };\n if (typeof raw === \"string\" && /^(true|false)$/i.test(raw.trim())) {\n return { value: raw.trim().toLowerCase() === \"true\" };\n }\n return { error: \"must be true or false\" };\n case \"date\": {\n const value = typeof raw === \"string\" ? raw.trim() : \"\";\n const time = ISO_DATE.test(value) ? Date.parse(value) : NaN;\n return Number.isNaN(time)\n ? { error: \"must be an ISO 8601 date\" }\n : { value: new Date(time).toISOString() };\n }\n case \"dropdown\": {\n const value =\n typeof raw === \"string\" || typeof raw === \"number\" ? String(raw) : \"\";\n const values = (input.options ?? []).map((option) => option.value);\n if (values.length === 0 ? value !== \"\" : values.includes(value)) {\n return { value };\n }\n return values.length > 0\n ? { error: `must be one of ${values.map((v) => `\"${v}\"`).join(\", \")}` }\n : { error: \"must be text\" };\n }\n case \"json\":\n return { value: raw };\n }\n}\n\n// An authored default as the field's type; JSON text is parsed when it parses.\nexport function manualDefault(input: ManualInput): unknown {\n if (input.defaultValue === undefined) return undefined;\n if (input.type === \"json\") {\n try {\n return JSON.parse(input.defaultValue) as unknown;\n } catch {\n return input.defaultValue;\n }\n }\n if (input.type === \"dropdown\") {\n // A value, or failing that an option's label.\n const options = input.options ?? [];\n const match =\n options.find((option) => option.value === input.defaultValue) ??\n options.find((option) => option.label === input.defaultValue);\n if (match) return match.value;\n }\n const coerced = coerceManualValue(input, input.defaultValue);\n return \"value\" in coerced ? coerced.value : undefined;\n}\n\nconst isMissing = (value: unknown) =>\n value === undefined || value === null || value === \"\";\n\n// The payload with each declared field coerced and defaults filled in; keys no\n// field declares pass through. Throws ManualPayloadError.\nexport function coerceManualPayload(\n inputs: readonly ManualInput[],\n payload: unknown,\n): Record<string, unknown> {\n if (payload !== undefined && payload !== null && !isRecord(payload)) {\n throw new ManualPayloadError([\n { field: \"\", message: \"must be a JSON object\" },\n ]);\n }\n const next: Record<string, unknown> = { ...payload };\n const errors: ManualPayloadFieldError[] = [];\n for (const input of inputs) {\n let raw = next[input.name];\n if (isMissing(raw)) raw = manualDefault(input);\n if (isMissing(raw)) {\n delete next[input.name];\n if (input.required) {\n errors.push({ field: input.name, message: \"is required\" });\n }\n continue;\n }\n const coerced = coerceManualValue(input, raw);\n if (\"error\" in coerced) {\n errors.push({ field: input.name, message: coerced.error });\n } else next[input.name] = coerced.value;\n }\n if (errors.length > 0) throw new ManualPayloadError(errors);\n return next;\n}\n\nconst TYPE_NAMES: Record<ManualInputType, string> = {\n text: \"String\",\n text_area: \"String\",\n number: \"Float\",\n toggle: \"Boolean\",\n date: \"DateTime\",\n dropdown: \"String\",\n json: \"JSON\",\n};\n\n// The GraphQL-style type the expression picker shows for a field.\nexport function manualInputTypeName(input: ManualInput): string {\n const base = TYPE_NAMES[input.type];\n return input.required ? `${base}!` : base;\n}\n"],"mappings":";AASA,MAAM,aAA8C;CAClD,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAIA,MAAa,0BACX;AAEF,IAAa,uBAAb,cAA0C,MAAM;CAC9C,AAAS;CAET,YAAY,UAAmB,OAAe;EAC5C,MAAM,KAAK;EACX,KAAK,OAAO;EACZ,KAAK,WAAW;CAClB;AACF;AAEA,SAAgB,qBAAqB,UAAyC;CAC5E,IAAI,OAAO,aAAa,YAAY,OAAO,OAAO,YAAY,QAAQ,GACpE,OAAO,EAAE,UAAU,WAAW,UAAU;CAE1C,IAAI,aAAa,eAAe,OAAO,EAAE,OAAO,wBAAwB;CACxE,OAAO,EACL,OACE,aAAa,UAAa,aAAa,QAAQ,aAAa,KACxD,qCACA,4BAA4B,KAAK,UAAU,QAAQ,IAC3D;AACF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,UAAU;AAIrD,SAAgB,oBACd,QACA,SACyB;CACzB,IAAI,YAAY,UAAa,YAAY,QAAQ,CAAC,SAAS,OAAO,GAChE,MAAM,IAAI,mBAAmB,CAC3B;EAAE,OAAO;EAAI,SAAS;CAAwB,CAChD,CAAC;CAEH,MAAM,OAAgC,EAAE,GAAG,QAAQ;CACnD,MAAM,SAAoC,CAAC;CAC3C,KAAK,MAAM,SAAS,QAAQ;EAC1B,IAAI,MAAM,KAAK,MAAM;EACrB,IAAI,UAAU,GAAG,GAAG,MAAM,cAAc,KAAK;EAC7C,IAAI,UAAU,GAAG,GAAG;GAClB,OAAO,KAAK,MAAM;GAClB,IAAI,MAAM,UACR,OAAO,KAAK;IAAE,OAAO,MAAM;IAAM,SAAS;GAAc,CAAC;GAE3D;EACF;EACA,MAAM,UAAU,kBAAkB,OAAO,GAAG;EAC5C,IAAI,WAAW,SACb,OAAO,KAAK;GAAE,OAAO,MAAM;GAAM,SAAS,QAAQ;EAAM,CAAC;OACpD,KAAK,MAAM,QAAQ,QAAQ;CACpC;CACA,IAAI,OAAO,SAAS,GAAG,MAAM,IAAI,mBAAmB,MAAM;CAC1D,OAAO;AACT;AAEA,MAAM,aAA8C;CAClD,MAAM;CACN,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,UAAU;CACV,MAAM;AACR;AAGA,SAAgB,oBAAoB,OAA4B;CAC9D,MAAM,OAAO,WAAW,MAAM;CAC9B,OAAO,MAAM,WAAW,GAAG,KAAK,KAAK;AACvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/pieces-framework",
3
- "version": "6.2.3-dev.84",
3
+ "version": "6.2.3-dev.85",
4
4
  "description": "Powerhouse's published copy of the Activepieces piece framework, widened with the reactor context.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -66,8 +66,8 @@
66
66
  "zod": "^4.5.4"
67
67
  },
68
68
  "devDependencies": {
69
- "@powerhousedao/reactor": "6.2.3-dev.84",
70
- "@powerhousedao/shared": "6.2.3-dev.84",
69
+ "@powerhousedao/reactor": "6.2.3-dev.85",
70
+ "@powerhousedao/shared": "6.2.3-dev.85",
71
71
  "@types/node": "25.2.3",
72
72
  "deepmerge-ts": "7.1.0",
73
73
  "prettier": "3.8.1",
@@ -77,8 +77,8 @@
77
77
  "vitest": "5.0.3"
78
78
  },
79
79
  "peerDependencies": {
80
- "@powerhousedao/reactor": "6.2.3-dev.84",
81
- "@powerhousedao/shared": "6.2.3-dev.84"
80
+ "@powerhousedao/reactor": "6.2.3-dev.85",
81
+ "@powerhousedao/shared": "6.2.3-dev.85"
82
82
  },
83
83
  "peerDependenciesMeta": {
84
84
  "@powerhousedao/reactor": {