@powerhousedao/pieces-framework 6.2.3-dev.44 → 6.2.3-dev.45

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.
@@ -63,5 +63,34 @@ export declare function knownPorts(block: {
63
63
  name: string;
64
64
  }): readonly string[];
65
65
  //#endregion
66
+ //#region src/workflow/document-reference.d.ts
67
+ export interface DocumentReference {
68
+ documentId: string;
69
+ documentType: string;
70
+ branch: string;
71
+ revision: Record<string, number>;
72
+ }
73
+ export declare const DOCUMENT_REF_KEY = "$documentRef";
74
+ export interface DocumentRefMarker {
75
+ [DOCUMENT_REF_KEY]: DocumentReference;
76
+ }
77
+ interface HeaderLike {
78
+ id: string;
79
+ documentType: string;
80
+ branch: string;
81
+ revision: Record<string, number>;
82
+ }
83
+ export declare function documentReference(header: HeaderLike): DocumentReference;
84
+ export declare function isDocumentReference(value: unknown): value is DocumentReference;
85
+ export declare function isReactorDocument(value: unknown): value is {
86
+ header: HeaderLike;
87
+ state: Record<string, unknown>;
88
+ };
89
+ export declare function isDocumentRefMarker(value: unknown): value is DocumentRefMarker & Record<string, unknown>;
90
+ export declare function referenceDocuments(value: unknown): unknown;
91
+ export declare function documentRefsIn(value: unknown): DocumentReference[];
92
+ export declare function containsDocumentRef(value: unknown): boolean;
93
+ export declare function expandDocumentRefs(value: unknown, expand: (reference: DocumentReference) => Record<string, unknown>): unknown;
94
+ //#endregion
66
95
  export {};
67
96
  //# sourceMappingURL=workflow.d.ts.map
@@ -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"],"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"}
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"],"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"}
package/dist/workflow.js CHANGED
@@ -127,5 +127,91 @@ function knownPorts(block) {
127
127
  }
128
128
 
129
129
  //#endregion
130
- export { APP_WEBHOOK_UNSUPPORTED, BRANCH_PORTS, CORE_PIECE_NAME, DEFAULT_TIMEZONE, ERROR_PORT, NEXT_PORT, PIECE_ACTION_PORTS, SCHEDULE_MODES, SCHEDULE_UNIT_MS, ScheduleConfigError, TRIGGER_PORTS, TriggerStrategyError, checkTriggerStrategy, flowPorts, knownPorts, parseCronText, parseScheduleConfig, scheduleConfigIssue, triggerDelivery, undeclaredPortEdges };
130
+ //#region src/workflow/document-reference.ts
131
+ const DOCUMENT_REF_KEY = "$documentRef";
132
+ const DOCUMENT_KEYS = /* @__PURE__ */ new Set([
133
+ "header",
134
+ "state",
135
+ "initialState",
136
+ "operations",
137
+ "clipboard"
138
+ ]);
139
+ const MAX_DEPTH = 64;
140
+ function isPlainObject(value) {
141
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
142
+ const proto = Object.getPrototypeOf(value);
143
+ return proto === Object.prototype || proto === null;
144
+ }
145
+ function isRevision(value) {
146
+ return isPlainObject(value) && Object.values(value).every((entry) => typeof entry === "number" && Number.isFinite(entry));
147
+ }
148
+ function documentReference(header) {
149
+ return {
150
+ documentId: header.id,
151
+ documentType: header.documentType,
152
+ branch: header.branch,
153
+ revision: { ...header.revision }
154
+ };
155
+ }
156
+ function isDocumentReference(value) {
157
+ return isPlainObject(value) && typeof value.documentId === "string" && typeof value.documentType === "string" && typeof value.branch === "string" && isRevision(value.revision);
158
+ }
159
+ function isDocumentHeader(value) {
160
+ return isPlainObject(value) && typeof value.id === "string" && value.id !== "" && typeof value.documentType === "string" && value.documentType !== "" && typeof value.branch === "string" && isRevision(value.revision) && typeof value.createdAtUtcIso === "string" && typeof value.lastModifiedAtUtcIso === "string";
161
+ }
162
+ function isReactorDocument(value) {
163
+ return isPlainObject(value) && isDocumentHeader(value.header) && isPlainObject(value.state);
164
+ }
165
+ function isDocumentRefMarker(value) {
166
+ return isPlainObject(value) && isDocumentReference(value["$documentRef"]);
167
+ }
168
+ function walk(value, visit, depth, seen) {
169
+ if (depth > MAX_DEPTH || typeof value !== "object" || value === null) return value;
170
+ if (seen.has(value)) return value;
171
+ if (Array.isArray(value)) {
172
+ seen.add(value);
173
+ const mapped = value.map((item) => walk(item, visit, depth + 1, seen));
174
+ seen.delete(value);
175
+ return mapped;
176
+ }
177
+ if (!isPlainObject(value)) return value;
178
+ seen.add(value);
179
+ const replaced = visit(value);
180
+ const result = Object.fromEntries(Object.entries(replaced ?? value).map(([key, entry]) => [key, replaced && !(key in value) ? entry : walk(entry, visit, depth + 1, seen)]));
181
+ seen.delete(value);
182
+ return result;
183
+ }
184
+ function referenceDocuments(value) {
185
+ return walk(value, (node) => {
186
+ if (!isReactorDocument(node)) return void 0;
187
+ const rest = Object.entries(node).filter(([key]) => !DOCUMENT_KEYS.has(key));
188
+ return {
189
+ [DOCUMENT_REF_KEY]: documentReference(node.header),
190
+ ...Object.fromEntries(rest)
191
+ };
192
+ }, 0, /* @__PURE__ */ new WeakSet());
193
+ }
194
+ function documentRefsIn(value) {
195
+ const found = [];
196
+ walk(value, (node) => {
197
+ if (isDocumentRefMarker(node)) found.push(node[DOCUMENT_REF_KEY]);
198
+ }, 0, /* @__PURE__ */ new WeakSet());
199
+ return found;
200
+ }
201
+ function containsDocumentRef(value) {
202
+ return documentRefsIn(value).length > 0;
203
+ }
204
+ function expandDocumentRefs(value, expand) {
205
+ return walk(value, (node) => {
206
+ if (!isDocumentRefMarker(node)) return void 0;
207
+ const { [DOCUMENT_REF_KEY]: reference, ...rest } = node;
208
+ return {
209
+ ...rest,
210
+ ...expand(reference)
211
+ };
212
+ }, 0, /* @__PURE__ */ new WeakSet());
213
+ }
214
+
215
+ //#endregion
216
+ export { APP_WEBHOOK_UNSUPPORTED, BRANCH_PORTS, CORE_PIECE_NAME, DEFAULT_TIMEZONE, DOCUMENT_REF_KEY, ERROR_PORT, NEXT_PORT, PIECE_ACTION_PORTS, SCHEDULE_MODES, SCHEDULE_UNIT_MS, ScheduleConfigError, TRIGGER_PORTS, TriggerStrategyError, checkTriggerStrategy, containsDocumentRef, documentReference, documentRefsIn, expandDocumentRefs, flowPorts, isDocumentRefMarker, isDocumentReference, isReactorDocument, knownPorts, parseCronText, parseScheduleConfig, referenceDocuments, scheduleConfigIssue, triggerDelivery, undeclaredPortEdges };
131
217
  //# sourceMappingURL=workflow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.js","names":[],"sources":["../src/workflow/strategy.ts","../src/workflow/schedule.ts","../src/workflow/ports.ts","../src/workflow/core.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"],"mappings":";AASA,MAAM,aAA8C;CAClD,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAIA,MAAa,0BACX;AAEF,IAAa,u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BAAoB,MAAM;EAC1B;CACF,SAAS,OAAO;EACd,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CAC9D;AACF;;;;ACzHA,MAAa,YAAY;AACzB,MAAa,aAAa;AAG1B,MAAa,qBAAwC,CAAC,WAAW,UAAU;AAG3E,MAAa,gBAAmC,CAAC,SAAS;AAG1D,SAAgB,UAAU,OAAoC;CAC5D,OAAO,MAAM,QAAQ,SAAS,SAAS,UAAU;AACnD;AAUA,SAAgB,oBACd,OACA,SACK;CACL,OAAO,MAAM,QAAQ,SAAS;EAC5B,MAAM,QAAQ,QAAQ,KAAK,IAAI;EAC/B,OAAO,UAAU,UAAa,CAAC,MAAM,SAAS,KAAK,IAAI;CACzD,CAAC;AACH;;;;AC7BA,MAAa,kBAAkB;AAG/B,MAAa,eAAkC;CAAC;CAAQ;CAAS;AAAU;AAI3E,SAAgB,WAAW,OAIL;CACpB,IAAI,MAAM,SAAS,WAAW,OAAO;CACrC,OAAO,MAAM,6CAAiC,MAAM,SAAS,WACzD,eACA;AACN"}
1
+ {"version":3,"file":"workflow.js","names":[],"sources":["../src/workflow/strategy.ts","../src/workflow/schedule.ts","../src/workflow/ports.ts","../src/workflow/core.ts","../src/workflow/document-reference.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"],"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;AAI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;EACR,IAAI,CAAC,oBAAoB,IAAI,GAAG,OAAO;EACvC,MAAM,GAAG,mBAAmB,WAAW,GAAG,SAAS;EACnD,OAAO;GAAE,GAAG;GAAM,GAAG,OAAO,SAAS;EAAE;CACzC,GACA,mBACA,IAAI,QAAQ,CACd;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/pieces-framework",
3
- "version": "6.2.3-dev.44",
3
+ "version": "6.2.3-dev.45",
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,6 +66,8 @@
66
66
  "zod": "4.3.6"
67
67
  },
68
68
  "devDependencies": {
69
+ "@powerhousedao/reactor": "6.2.3-dev.45",
70
+ "@powerhousedao/shared": "6.2.3-dev.45",
69
71
  "@types/node": "25.2.3",
70
72
  "deepmerge-ts": "7.1.0",
71
73
  "prettier": "3.8.1",
@@ -74,6 +76,18 @@
74
76
  "tsx": "4.23.13",
75
77
  "vitest": "4.1.1"
76
78
  },
79
+ "peerDependencies": {
80
+ "@powerhousedao/reactor": "6.2.3-dev.45",
81
+ "@powerhousedao/shared": "6.2.3-dev.45"
82
+ },
83
+ "peerDependenciesMeta": {
84
+ "@powerhousedao/reactor": {
85
+ "optional": true
86
+ },
87
+ "@powerhousedao/shared": {
88
+ "optional": true
89
+ }
90
+ },
77
91
  "scripts": {
78
92
  "tsc": "tsc",
79
93
  "lint": "cd ../.. && oxlint packages/pieces-framework",