@powerhousedao/reactor-workflow 6.2.3-dev.11
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/LICENSE +661 -0
- package/README.md +130 -0
- package/dist/descriptor-DXbWuxhE.js +169 -0
- package/dist/descriptor-DXbWuxhE.js.map +1 -0
- package/dist/index.d.ts +19068 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3771 -0
- package/dist/index.js.map +1 -0
- package/dist/piece-registry-BWWihLyp.js +1419 -0
- package/dist/piece-registry-BWWihLyp.js.map +1 -0
- package/dist/piece-registry-CE0UFmDA.d.ts +600 -0
- package/dist/piece-registry-CE0UFmDA.d.ts.map +1 -0
- package/dist/redact-C7LWgAyD.js +797 -0
- package/dist/redact-C7LWgAyD.js.map +1 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +4 -0
- package/dist/worker-entry.d.ts +1 -0
- package/dist/worker-entry.js +605 -0
- package/dist/worker-entry.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-entry.js","names":[],"sources":["../src/pieces/activepieces/worker/host-call.ts","../src/pieces/activepieces/context/reactor.ts","../src/pieces/activepieces/context/check.ts","../src/pieces/activepieces/context/normalize.ts","../src/pieces/activepieces/context/props.ts","../src/pieces/activepieces/context/remote-store.ts","../src/pieces/activepieces/context/remote-output.ts","../src/pieces/activepieces/worker/logs.ts","../src/pieces/activepieces/worker/entry.ts"],"sourcesContent":["// The child's half of the call channel: how piece code reaches durable host\n// state mid-step, instead of handing everything back when the step returns.\n\n// Modelled on their engine RPC (createRpcClient): a method name, a payload, an\n// id, and failures returned as data rather than thrown across the boundary.\nimport type { HostCallResponse } from \"./protocol.js\";\n\n// A host call is a local IPC round trip. Ten seconds is already pathological;\n// the step's own timeout is the outer bound and kills the worker outright.\nconst DEFAULT_HOST_CALL_TIMEOUT_MS = 10_000;\n\ninterface Pending {\n method: string;\n resolve: (value: unknown) => void;\n reject: (error: Error) => void;\n timer: NodeJS.Timeout;\n}\n\nconst pending = new Map<number, Pending>();\nlet nextId = 1;\nlet listening = false;\n\nexport class HostCallError extends Error {\n constructor(method: string, detail: string) {\n super(`Host call \"${method}\" failed: ${detail}`);\n this.name = \"HostCallError\";\n }\n}\n\nexport class HostCallTimeoutError extends Error {\n constructor(method: string, timeoutMs: number) {\n super(`Host call \"${method}\" got no answer within ${timeoutMs}ms`);\n this.name = \"HostCallTimeoutError\";\n }\n}\n\nfunction isHostCallResponse(value: unknown): value is HostCallResponse {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as { type?: unknown }).type === \"host-result\"\n );\n}\n\n// Registered once, on the same channel the job messages arrive on. The job\n// dispatcher ignores `host-result` because it only knows its own request types.\nfunction ensureListening(): void {\n if (listening) return;\n listening = true;\n process.on(\"message\", (message: unknown) => {\n if (!isHostCallResponse(message)) return;\n const entry = pending.get(message.id);\n if (!entry) return;\n pending.delete(message.id);\n clearTimeout(entry.timer);\n if (message.error !== undefined) {\n entry.reject(new HostCallError(entry.method, message.error));\n return;\n }\n entry.resolve(message.value);\n });\n}\n\nexport function callHost<T = unknown>(\n method: string,\n payload: unknown,\n timeoutMs: number = DEFAULT_HOST_CALL_TIMEOUT_MS,\n): Promise<T> {\n if (!process.send) {\n return Promise.reject(\n new HostCallError(method, \"the worker has no channel to its host\"),\n );\n }\n ensureListening();\n const id = nextId++;\n return new Promise<T>((resolve, reject) => {\n const timer = setTimeout(() => {\n pending.delete(id);\n reject(new HostCallTimeoutError(method, timeoutMs));\n }, timeoutMs);\n pending.set(id, {\n method,\n resolve: resolve as (value: unknown) => void,\n reject,\n timer,\n });\n process.send?.({ id, type: \"host-call\", method, payload });\n });\n}\n\n// Test seam: a worker replaced between suites must not inherit pending calls.\nexport function resetHostCalls(): void {\n for (const entry of pending.values()) clearTimeout(entry.timer);\n pending.clear();\n}\n\n// The one-way half: a report with no answer to wait for. It cannot fail from\n// the piece's side, so a missing channel is dropped rather than raised.\nexport function notifyHost(method: string, payload: unknown): void {\n try {\n process.send?.({ type: \"host-notify\", method, payload });\n } catch {\n // `process.send` stays defined after the channel closes and throws. A tap\n // that threw here would be a tap that changed the step.\n }\n}\n","// `ctx.reactor` — the one way piece code reaches the reactor it runs inside.\n\n// Pieces are isolated from the host on purpose, so this is not a client: it is\n// the same call channel `ctx.store` uses (doc 08 §10), and every method is a\n// round trip the host answers. The host installs it only for a piece that came\n// from an installed reactor package; a bundle fetched from a registry gets the\n// throwing stub instead, and finds out by name that it has no reactor.\nimport { callHost } from \"../worker/host-call.js\";\nimport type {\n ReactorCreateInput,\n ReactorDocumentSummary,\n ReactorExecuteInput,\n ReactorFindInput,\n ReactorModelDetail,\n ReactorModelSummary,\n ReactorService,\n} from \"@powerhousedao/pieces-framework\";\nimport {\n REACTOR_CREATE,\n REACTOR_EXECUTE,\n REACTOR_FIND,\n REACTOR_GET,\n REACTOR_MODEL,\n REACTOR_MODELS,\n} from \"../worker/protocol.js\";\n\n// The service contract and its input/output shapes live in the framework, so a\n// piece and the host it calls are typed against one declaration.\nexport type {\n ReactorActionInput,\n ReactorCreateInput,\n ReactorDocumentSummary,\n ReactorExecuteInput,\n ReactorFindInput,\n ReactorModelActionSchema,\n ReactorModelDetail,\n ReactorModelSummary,\n ReactorService,\n} from \"@powerhousedao/pieces-framework\";\n\n// The worker's half: every method is one host call, named so a failure reads\n// as the operation the piece asked for.\nexport class RemoteReactorService implements ReactorService {\n models(): Promise<ReactorModelSummary[]> {\n return callHost<ReactorModelSummary[]>(REACTOR_MODELS, {});\n }\n\n model(documentType: string): Promise<ReactorModelDetail> {\n return callHost<ReactorModelDetail>(REACTOR_MODEL, { documentType });\n }\n\n get(input: {\n documentId: string;\n branch?: string;\n }): Promise<ReactorDocumentSummary> {\n return callHost<ReactorDocumentSummary>(REACTOR_GET, input);\n }\n\n find(input: ReactorFindInput): Promise<ReactorDocumentSummary[]> {\n return callHost<ReactorDocumentSummary[]>(REACTOR_FIND, input);\n }\n\n create(input: ReactorCreateInput): Promise<ReactorDocumentSummary> {\n return callHost<ReactorDocumentSummary>(REACTOR_CREATE, input);\n }\n\n execute(input: ReactorExecuteInput): Promise<ReactorDocumentSummary> {\n return callHost<ReactorDocumentSummary>(REACTOR_EXECUTE, input);\n }\n}\n","// Context handed to a piece's connection check. The framework has no\n// checkConnection hook: auth.validate({auth, server}) is the whole contract.\nimport { throwingStub, withTouchTracking } from \"./stubs.js\";\nimport type { AuthValidationServerContext } from \"@powerhousedao/pieces-framework\";\n\nexport interface CheckConnectionContextOptions {\n auth?: unknown;\n // apiUrl / publicUrl when the host serves them; mintOidcToken always throws,\n // since no reactor mints tokens for a piece's validate().\n server?: Omit<AuthValidationServerContext, \"mintOidcToken\">;\n onTouch?: (member: string) => void;\n}\n\nexport interface BuiltApCheckConnectionContext {\n auth: unknown;\n server: AuthValidationServerContext;\n}\n\nexport interface CheckConnectionContextHandle {\n context: BuiltApCheckConnectionContext;\n // Top-level members the check read; `UNDOCUMENTED:<name>` marks unknown reads.\n touched: ReadonlySet<string>;\n}\n\nexport function buildCheckConnectionContext(\n options: CheckConnectionContextOptions = {},\n): CheckConnectionContextHandle {\n const touched = new Set<string>();\n const base: Record<string, unknown> = {\n auth: options.auth,\n server: options.server\n ? {\n ...options.server,\n mintOidcToken: throwingStub(\"server.mintOidcToken\"),\n }\n : throwingStub(\"server\"),\n };\n const context = withTouchTracking(base, touched, options.onTouch);\n return {\n context: context as unknown as BuiltApCheckConnectionContext,\n touched,\n };\n}\n","// Run-time coercion of stored config values into the shapes pieces expect: the\n// engine's own property processors, with our file hydration in front of theirs.\nimport type { PieceProperty } from \"@powerhousedao/pieces-framework\";\nimport {\n arrayZipperProcessor,\n processors,\n type ProcessorFn,\n} from \"@powerhousedao/pieces-framework/host\";\nimport type { ApProperty } from \"../types.js\";\nimport {\n assertWithinLimit,\n DEFAULT_MAX_FILE_BYTES,\n maxFileBytes,\n} from \"./limits.js\";\n\n// Framework ApFile (filename, data, extension, base64) as a plain object so\n// it survives IPC and structured cloning.\nexport interface ApFileValue {\n filename: string;\n extension?: string;\n base64: string;\n data: Buffer;\n}\n\nexport interface FetchedFile {\n data: Buffer;\n filename?: string;\n contentType?: string;\n}\n\nexport interface NormalizeOptions {\n // Resolves a URL-valued FILE prop; defaults to fetch() with a size cap.\n fetchFile?: (url: string) => Promise<FetchedFile>;\n // Resolves a reference-valued FILE prop (attachment:// or apfile://). The\n // worker resolves these from files the host staged on disk, so the bytes\n // never cross IPC.\n resolveRef?: (ref: string) => Promise<FetchedFile>;\n}\n\n// Re-exported for compatibility; the ceiling itself lives in limits.ts so the\n// inbound and outbound paths cannot drift apart.\nexport const MAX_FILE_BYTES = DEFAULT_MAX_FILE_BYTES;\nconst FETCH_TIMEOUT_MS = 30_000;\n\n// A FILE prop whose value is a reference the host has to resolve.\nconst FILE_REF = /^(?:attachment|apfile):\\/\\//i;\n\nexport class FileFetchError extends Error {\n constructor(url: string, reason: string) {\n super(`Could not fetch FILE prop \"${url}\": ${reason}`);\n this.name = \"FileFetchError\";\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 DATA_URI = /^data:([^;,]*)((?:;[^;,]*)*),([\\s\\S]*)$/;\n\nfunction extensionOf(filename: string): string | undefined {\n const dot = filename.lastIndexOf(\".\");\n return dot > 0 && dot < filename.length - 1\n ? filename.slice(dot + 1)\n : undefined;\n}\n\nconst MIME_EXTENSIONS: Record<string, string> = {\n \"image/png\": \"png\",\n \"image/jpeg\": \"jpg\",\n \"image/gif\": \"gif\",\n \"image/webp\": \"webp\",\n \"image/svg+xml\": \"svg\",\n \"application/pdf\": \"pdf\",\n \"application/json\": \"json\",\n \"text/plain\": \"txt\",\n \"text/csv\": \"csv\",\n};\n\nfunction toFileValue(\n data: Buffer,\n filename: string | undefined,\n contentType: string | undefined,\n): ApFileValue {\n const mime = contentType?.split(\";\")[0].trim().toLowerCase();\n const mimeExtension = mime ? MIME_EXTENSIONS[mime] : undefined;\n const name =\n filename && filename !== \"\"\n ? filename\n : `file${mimeExtension ? `.${mimeExtension}` : \"\"}`;\n const extension = extensionOf(name) ?? mimeExtension;\n return {\n filename: name,\n ...(extension ? { extension } : {}),\n base64: data.toString(\"base64\"),\n data,\n };\n}\n\nfunction filenameFromDisposition(header: string | null): string | undefined {\n if (!header) return undefined;\n const utf8 = /filename\\*=(?:UTF-8'')?([^;]+)/i.exec(header);\n if (utf8) {\n try {\n return decodeURIComponent(utf8[1].trim().replace(/^\"|\"$/g, \"\"));\n } catch {\n // fall through to the plain form\n }\n }\n const plain = /filename=\"?([^\";]+)\"?/i.exec(header);\n return plain ? plain[1].trim() : undefined;\n}\n\nasync function defaultFetchFile(url: string): Promise<FetchedFile> {\n let response: Response;\n try {\n response = await fetch(url, {\n signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),\n });\n } catch (error) {\n throw new FileFetchError(\n url,\n error instanceof Error ? error.message : String(error),\n );\n }\n if (!response.ok) throw new FileFetchError(url, `HTTP ${response.status}`);\n const limit = maxFileBytes();\n const declared = Number(response.headers.get(\"content-length\"));\n if (Number.isFinite(declared) && declared > limit) {\n throw new FileFetchError(url, `${declared} bytes exceeds ${limit}`);\n }\n const data = Buffer.from(await response.arrayBuffer());\n if (data.byteLength > limit) {\n throw new FileFetchError(url, `${data.byteLength} bytes exceeds ${limit}`);\n }\n let filename = filenameFromDisposition(\n response.headers.get(\"content-disposition\"),\n );\n if (!filename) {\n const segment = new URL(url).pathname.split(\"/\").filter(Boolean).pop();\n if (segment) filename = decodeURIComponent(segment);\n }\n return {\n data,\n filename,\n contentType: response.headers.get(\"content-type\") ?? undefined,\n };\n}\n\nfunction isFileShaped(value: unknown): value is ApFileValue {\n return (\n isRecord(value) &&\n typeof value.filename === \"string\" &&\n (typeof value.base64 === \"string\" || Buffer.isBuffer(value.data))\n );\n}\n\n// URL or data URI → ApFile shape; already-shaped objects are completed\n// (data/base64 derived from each other); anything else passes through.\nexport async function toApFile(\n value: unknown,\n options: NormalizeOptions = {},\n): Promise<unknown> {\n if (isFileShaped(value)) {\n const data = Buffer.isBuffer(value.data)\n ? value.data\n : Buffer.from(value.base64, \"base64\");\n // The cap applies to every branch, not just the fetched one: an oversized\n // data URI or file-shaped object would otherwise slip past it.\n assertWithinLimit(data.byteLength);\n const extension = value.extension ?? extensionOf(value.filename);\n return {\n ...value,\n ...(extension ? { extension } : {}),\n base64:\n typeof value.base64 === \"string\"\n ? value.base64\n : data.toString(\"base64\"),\n data,\n };\n }\n if (typeof value !== \"string\") return value;\n const trimmed = value.trim();\n if (trimmed === \"\") return undefined;\n const dataUri = DATA_URI.exec(trimmed);\n if (dataUri) {\n const [, mime, params, payload] = dataUri;\n const isBase64 = /;base64/i.test(params);\n const data = isBase64\n ? Buffer.from(payload, \"base64\")\n : Buffer.from(decodeURIComponent(payload), \"utf8\");\n assertWithinLimit(data.byteLength);\n const nameParam = /;name=([^;]+)/i.exec(params)?.[1];\n return toFileValue(\n data,\n nameParam ? decodeURIComponent(nameParam) : undefined,\n mime || undefined,\n );\n }\n if (FILE_REF.test(trimmed)) {\n if (!options.resolveRef) {\n throw new FileFetchError(\n trimmed,\n \"no attachment resolver is available in this context\",\n );\n }\n const resolved = await options.resolveRef(trimmed);\n assertWithinLimit(resolved.data.byteLength);\n return toFileValue(resolved.data, resolved.filename, resolved.contentType);\n }\n if (/^https?:\\/\\//i.test(trimmed)) {\n const fetched = await (options.fetchFile ?? defaultFetchFile)(trimmed);\n return toFileValue(fetched.data, fetched.filename, fetched.contentType);\n }\n return value;\n}\n\n// ARRAY has no entry in the processor table: the engine zips an object of\n// parallel arrays into rows itself, then processes each row's own props.\nasync function normalizeArray(\n prop: ApProperty,\n value: unknown,\n options: NormalizeOptions,\n): Promise<unknown> {\n const fields = prop.properties;\n if (!fields) return value;\n const zipped: unknown = arrayZipperProcessor(prop as PieceProperty, value);\n if (!Array.isArray(zipped)) return value;\n return Promise.all(\n (zipped as unknown[]).map((item) =>\n isRecord(item) ? normalizePropsValue(fields, item, options) : item,\n ),\n );\n}\n\n// An ApFile is a class instance whose base64 is a prototype getter, and no\n// structured clone carries either; flatten it at the boundary (see ApFileValue).\nfunction plainFile(value: unknown): unknown {\n if (!isRecord(value) || typeof value.filename !== \"string\") return value;\n const { data } = value;\n if (!Buffer.isBuffer(data)) return value;\n const extension =\n typeof value.extension === \"string\"\n ? value.extension\n : extensionOf(value.filename);\n return {\n filename: value.filename,\n ...(extension ? { extension } : {}),\n base64:\n typeof value.base64 === \"string\" ? value.base64 : data.toString(\"base64\"),\n data,\n };\n}\n\nconst table = processors as Record<string, ProcessorFn | undefined>;\n\nexport async function normalizeValue(\n prop: ApProperty,\n value: unknown,\n options: NormalizeOptions = {},\n): Promise<unknown> {\n if (value === undefined || value === null) return value;\n if (prop.type === \"ARRAY\") return normalizeArray(prop, value, options);\n if (prop.type === \"FILE\") {\n // Our hydration owns the forms the engine's own processor cannot resolve:\n // attachment and apfile refs, the size cap, and a host-injected fetcher.\n const hydrated = await toApFile(value, options);\n if (typeof hydrated !== \"string\") return hydrated;\n return plainFile(await table.FILE?.(prop as PieceProperty, hydrated));\n }\n const processor = prop.type ? table[prop.type] : undefined;\n if (!processor) return value;\n return plainFile(await processor(prop as PieceProperty, value));\n}\n\n// Normalises every configured value with a matching prop schema; keys\n// without a schema (or props without a value) pass through untouched.\nexport async function normalizePropsValue(\n props: Record<string, ApProperty> | undefined,\n values: Record<string, unknown>,\n options: NormalizeOptions = {},\n): Promise<Record<string, unknown>> {\n if (!props || !isRecord(values)) return values;\n const out: Record<string, unknown> = { ...values };\n for (const [name, prop] of Object.entries(props)) {\n if (!(name in out) || !isRecord(prop)) continue;\n const normalized = await normalizeValue(prop, out[name], options);\n if (normalized === undefined) delete out[name];\n else out[name] = normalized;\n }\n return out;\n}\n","// Design-time channel (doc 06 §2.5): builds the PropertyContext handed to\n// DROPDOWN options() / DYNAMIC props() resolvers, and invokes them out-of-band.\nimport {\n getActions,\n getTriggers,\n type ApPiece,\n type ApProperty,\n} from \"../types.js\";\nimport { throwingStub, withTouchTracking } from \"./stubs.js\";\nimport type {\n ConnectionsManager,\n FlowsContext,\n PropertyContext,\n ReactorService,\n ServerContext,\n} from \"@powerhousedao/pieces-framework\";\n\n// The framework's FlowsContext.list, minus the SeekPage cursors the host does\n// not serve: a resolver only ever reads `data`.\nexport interface FlowsProvider {\n list(\n ...params: Parameters<FlowsContext[\"list\"]>\n ): Promise<{ data: unknown[] }>;\n}\n\n// The framework's ConnectionsManager with its return widened: the host serves\n// whatever a connection resolved to, not only the shapes upstream enumerates.\nexport interface ConnectionsProvider {\n get(...params: Parameters<ConnectionsManager[\"get\"]>): Promise<unknown>;\n}\n\nexport type BuiltApPropertyContext = Omit<\n PropertyContext,\n \"flows\" | \"connections\"\n> & {\n flows: FlowsProvider;\n connections: ConnectionsProvider;\n // ctx.reactor: the Powerhouse capability the framework has no member for.\n reactor: ReactorService;\n};\n\nexport interface PropertyContextOptions {\n searchValue?: string;\n // Injected capabilities; anything omitted throws with its member path.\n flows?: FlowsProvider;\n connections?: ConnectionsProvider;\n server?: ServerContext;\n projectId?: string;\n // ctx.reactor for a design-time resolver, on the same terms as at run time:\n // offered to a package piece, a throwing stub to every other.\n reactor?: ReactorService;\n onTouch?: (member: string) => void;\n}\n\nexport interface PropertyContextHandle {\n context: BuiltApPropertyContext;\n // Top-level members the resolver read; `UNDOCUMENTED:<name>` marks unknown reads.\n touched: ReadonlySet<string>;\n}\n\nexport function buildPropertyContext(\n options: PropertyContextOptions = {},\n): PropertyContextHandle {\n const touched = new Set<string>();\n const base: Record<string, unknown> = {\n searchValue: options.searchValue,\n reactor: options.reactor ?? throwingStub(\"reactor\"),\n server: options.server ?? throwingStub(\"server\"),\n project: {\n id: options.projectId ?? \"project\",\n externalId: () => Promise.resolve(options.projectId ?? \"project\"),\n },\n flows: options.flows ?? { list: throwingStub(\"flows.list\") },\n connections: options.connections ?? {\n get: throwingStub(\"connections.get\"),\n },\n };\n const context = withTouchTracking(base, touched, options.onTouch);\n return { context: context as unknown as BuiltApPropertyContext, touched };\n}\n\nexport class NotDynamicPropertyError extends Error {\n constructor(actionName: string, propName: string) {\n super(`Property \"${actionName}.${propName}\" has no dynamic resolver`);\n this.name = \"NotDynamicPropertyError\";\n }\n}\n\nfunction pickResolver(\n prop: ApProperty,\n): ((...args: unknown[]) => unknown) | undefined {\n if (typeof prop.options === \"function\") return prop.options;\n if (typeof prop.props === \"function\") return prop.props;\n return undefined;\n}\n\nexport interface ResolveDynamicPropertyParams {\n piece: ApPiece;\n // Action or trigger name, per kind (default \"action\").\n actionName: string;\n kind?: \"action\" | \"trigger\";\n propName: string;\n // Resolved values of the prop's refresher inputs (auth and sibling props).\n refresherValues?: Record<string, unknown>;\n context: BuiltApPropertyContext;\n}\n\n// Props map of an action or trigger; throws when the owner is unknown.\nexport function ownerProps(\n piece: ApPiece,\n actionName: string,\n kind: \"action\" | \"trigger\" = \"action\",\n): Record<string, ApProperty> {\n const owner =\n kind === \"trigger\"\n ? (getTriggers(piece)[actionName] as\n | { props?: Record<string, ApProperty> }\n | undefined)\n : (getActions(piece)[actionName] as\n | { props?: Record<string, ApProperty> }\n | undefined);\n if (!owner) throw new Error(`No ${kind} \"${actionName}\" on piece`);\n return owner.props ?? {};\n}\n\nexport function findProperty(\n piece: ApPiece,\n actionName: string,\n propName: string,\n kind: \"action\" | \"trigger\" = \"action\",\n): ApProperty {\n const prop = ownerProps(piece, actionName, kind)[propName] as\n | ApProperty\n | undefined;\n if (!prop)\n throw new Error(`No prop \"${propName}\" on ${kind} \"${actionName}\"`);\n return prop;\n}\n\n// Invokes a DROPDOWN options() or DYNAMIC props() resolver. The result is\n// returned untouched: pieces may soft-fail with a disabled DropdownState.\nexport async function resolveDynamicProperty(\n params: ResolveDynamicPropertyParams,\n): Promise<unknown> {\n const { piece, actionName, propName, kind = \"action\" } = params;\n const prop = findProperty(piece, actionName, propName, kind);\n const resolver = pickResolver(prop);\n if (!resolver) throw new NotDynamicPropertyError(actionName, propName);\n return await resolver(params.refresherValues ?? {}, params.context);\n}\n\nexport interface ParsedResolverId {\n packageName: string;\n actionName: string;\n propName: string;\n}\n\n// Inverse of the descriptor's id scheme: activepieces:<pkg>#<action>.<prop>.\nexport function parseDynamicResolverId(id: string): ParsedResolverId {\n const match = /^activepieces:(.+)#(.+)\\.([^.]+)$/.exec(id);\n if (!match) throw new Error(`Invalid dynamic resolver id: ${id}`);\n return { packageName: match[1], actionName: match[2], propName: match[3] };\n}\n\nexport async function resolveByResolverId(\n piece: ApPiece,\n resolverId: string,\n refresherValues: Record<string, unknown>,\n context: BuiltApPropertyContext,\n): Promise<unknown> {\n const { actionName, propName } = parseDynamicResolverId(resolverId);\n return resolveDynamicProperty({\n piece,\n actionName,\n propName,\n refresherValues,\n context,\n });\n}\n","// `ctx.store` served by the host, one call per operation, so a value a piece\n// writes is durable the moment it writes it rather than when the step ends.\n\n// This is the semantic Activepieces pieces are written against — theirs is an\n// HTTP call per get/put/delete — so a loop that checkpoints its cursor resumes.\nimport type { KeyValueStore } from \"./action.js\";\nimport type { StoreScopeName } from \"./store-scope.js\";\nimport { STORE_DELETE, STORE_GET, STORE_PUT } from \"../worker/protocol.js\";\nimport { callHost } from \"../worker/host-call.js\";\nimport { jsonSafe } from \"../worker/json-safe.js\";\n\n// The host writes JSON, so a value is flattened here rather than at the point\n// it lands. A piece that stores a Date reads back a string either way, whether\n// or not a durable store is configured — and whatever carries the message.\nexport class RemoteKeyValueStore implements KeyValueStore {\n async put(\n key: string,\n value: unknown,\n scope?: StoreScopeName,\n ): Promise<unknown> {\n const stored = jsonSafe(value);\n await callHost(STORE_PUT, { key, value: stored, scope });\n return stored;\n }\n\n get(key: string, scope?: StoreScopeName): Promise<unknown> {\n return callHost(STORE_GET, { key, scope });\n }\n\n async delete(key: string, scope?: StoreScopeName): Promise<void> {\n await callHost(STORE_DELETE, { key, scope });\n }\n}\n","// ctx.output.update: the piece reporting progress before it returns. A long\n// step is otherwise opaque until the moment it finishes.\nimport { notifyHost } from \"../worker/host-call.js\";\nimport { jsonSafe } from \"../worker/json-safe.js\";\nimport { OUTPUT_UPDATE } from \"../worker/protocol.js\";\n\nexport interface PartialOutput {\n update(output: unknown): Promise<void>;\n}\n\n// Resolves immediately: a tap the step waits on is a tap that can stall it,\n// which is the one thing plan/08 §7.8 rules out.\n\n// A notification carries no request id, and the worker is reused. A piece that\n// keeps `ctx` and updates from a timer would otherwise report progress against\n// whichever step is running by then, so the tap is closed when its step ends.\nexport class RemoteOutput implements PartialOutput {\n private open = true;\n\n update(output: unknown): Promise<void> {\n if (this.open) notifyHost(OUTPUT_UPDATE, jsonSafe(output));\n return Promise.resolve();\n }\n\n close(): void {\n this.open = false;\n }\n}\n","// Piece console output, forwarded to the host while the step runs. The child\n// is forked with its stdio discarded, so without this a piece's logs vanish.\nimport { format } from \"node:util\";\nimport { notifyHost } from \"./host-call.js\";\nimport { LOG_WRITE, type PieceLogEntry } from \"./protocol.js\";\n\n// A runaway piece can log in a loop; the channel is shared with the step's own\n// result, so both the size of an entry and the number of them are capped.\n\n// Without the count, a loop enqueues IPC messages faster than the host drains\n// them and the result waits behind the backlog until the step times out.\nconst MAX_MESSAGE_LENGTH = 8_192;\nconst MAX_ENTRIES_PER_REQUEST = 1_000;\n\nconst LEVELS = [\"log\", \"info\", \"warn\", \"error\", \"debug\"] as const;\n\ntype Level = (typeof LEVELS)[number];\n\n// Installs the patch for one request and returns its undo. Logs written after\n// the step returned belong to no step, which is why the scope is this narrow.\nexport function captureConsole(): () => void {\n const original = new Map<Level, (...args: unknown[]) => void>();\n let sent = 0;\n\n for (const level of LEVELS) {\n const previous = console[level] as (...args: unknown[]) => void;\n original.set(level, previous);\n console[level] = (...args: unknown[]) => {\n if (sent > MAX_ENTRIES_PER_REQUEST) return;\n sent += 1;\n // The last one says why the rest are missing, so a truncated log does\n // not read as a step that fell silent.\n const message =\n sent > MAX_ENTRIES_PER_REQUEST\n ? `[log truncated after ${MAX_ENTRIES_PER_REQUEST} entries]`\n : format(...args).slice(0, MAX_MESSAGE_LENGTH);\n notifyHost(LOG_WRITE, {\n level,\n message,\n at: Date.now(),\n } satisfies PieceLogEntry);\n };\n }\n\n return () => {\n for (const [level, previous] of original) {\n console[level] = previous as typeof console.log;\n }\n };\n}\n","// Worker child: loads piece bundles and executes actions in an isolated\n// process, so piece side-effects (TLS env poisoning, crashes) never reach the host.\nimport {\n buildActionContext,\n InMemoryConnectionsProvider,\n InMemoryKeyValueStore,\n UnsupportedContextMemberError,\n} from \"../context/action.js\";\nimport { RemoteKeyValueStore } from \"../context/remote-store.js\";\nimport { RemoteReactorService } from \"../context/reactor.js\";\nimport { RemoteOutput } from \"../context/remote-output.js\";\nimport { captureConsole } from \"./logs.js\";\nimport { jsonSafe } from \"./json-safe.js\";\nimport { formatPieceError } from \"@powerhousedao/pieces-framework/host\";\nimport { redactError, redactMessage } from \"./redact.js\";\nimport { readFile } from \"node:fs/promises\";\nimport { buildCheckConnectionContext } from \"../context/check.js\";\nimport { DataUriFilesService, StagedFilesService } from \"../context/files.js\";\nimport {\n normalizePropsValue,\n type NormalizeOptions,\n} from \"../context/normalize.js\";\nimport {\n buildPropertyContext,\n findProperty,\n resolveDynamicProperty,\n} from \"../context/props.js\";\nimport { buildTriggerContext, runTriggerHook } from \"../context/trigger.js\";\nimport { buildDescriptor, describeProperties } from \"../descriptor.js\";\nimport { loadPiece, loadPieceFromDir, type LoadedPiece } from \"../loader.js\";\nimport { getActions, getTriggers, type ApProperty } from \"../types.js\";\nimport { installEgressGuard, runWithEgressPolicy } from \"./egress.js\";\nimport type {\n StagedInput,\n PieceModuleRef,\n CheckConnectionMessage,\n CheckConnectionOutcome,\n DescribePieceMessage,\n ResolveOptionsMessage,\n RunMessage,\n SerializedPieceError,\n TriggerHookMessage,\n WorkerRequestMessage,\n WorkerResponse,\n} from \"./protocol.js\";\n\n// Before any piece module is loaded, so a piece cannot keep a pristine copy of\n// the socket layer from a request that carried no policy.\ninstallEgressGuard();\n\nconst loadedPieces = new Map<string, Promise<LoadedPiece>>();\n// One store per scope, alive for the worker's lifetime (in-memory phase:\n// state survives runs but not worker replacement).\nconst stores = new Map<string, InMemoryKeyValueStore>();\n\nfunction storeForScope(scope: string): InMemoryKeyValueStore {\n let store = stores.get(scope);\n if (!store) {\n store = new InMemoryKeyValueStore();\n stores.set(scope, store);\n }\n return store;\n}\n\n// The module this request names, and the cache key for it. A package piece\n// arrives as one file; a fetched bundle as the directory holding it.\nfunction pieceRefKey(ref: PieceModuleRef): string {\n const key = ref.entryPath ?? ref.bundleDir;\n if (!key) {\n throw new Error(\"Request names no piece module (entryPath or bundleDir)\");\n }\n return key;\n}\n\nfunction loadCached(ref: PieceModuleRef): Promise<LoadedPiece> {\n const key = pieceRefKey(ref);\n let loading = loadedPieces.get(key);\n if (!loading) {\n loading = ref.entryPath ? loadPiece(key) : loadPieceFromDir(key);\n loadedPieces.set(key, loading);\n }\n return loading;\n}\n\n// The secret values this request carried, if any. Redacting here rather than\n// on the host means the host process never holds them in an error object.\nfunction redactValuesOf(message: WorkerRequestMessage): string[] {\n const request = message.request as { redactValues?: string[] };\n return request.redactValues ?? [];\n}\n\nfunction serializeError(\n error: unknown,\n values: string[] = [],\n): SerializedPieceError {\n const properties: Record<string, unknown> = {};\n if (typeof error === \"object\" && error !== null) {\n for (const key of Object.keys(error)) {\n properties[key] = jsonSafe((error as Record<string, unknown>)[key]);\n }\n }\n // The framework's own formatter first: it lifts an HTTP status, the request\n // and response, and a message out of an HTML error page. Redaction stays last.\n const { __apErrorVersion, message, errorName, ...http } =\n formatPieceError(error);\n return {\n name:\n (typeof error === \"object\" && error !== null && error.constructor.name) ||\n errorName ||\n \"Error\",\n message: redactMessage(message, { values }),\n properties: redactError(\n { ...properties, ...(jsonSafe(http) as Record<string, unknown>) },\n { values },\n ) as Record<string, unknown>,\n unsupportedMember:\n error instanceof UnsupportedContextMemberError ? error.member : undefined,\n };\n}\n\n// Read-and-clear the piece-set TLS override so each run reports its own poisoning.\nfunction consumeTlsFlag(): boolean {\n const poisoned = process.env.NODE_TLS_REJECT_UNAUTHORIZED === \"0\";\n delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;\n return poisoned;\n}\n\nasync function handleResolveOptions(\n message: ResolveOptionsMessage,\n): Promise<WorkerResponse> {\n const { request } = message;\n const { piece } = await loadCached(request);\n const { context, touched } = buildPropertyContext({\n searchValue: request.searchValue,\n // Design-time default: an empty flows listing instead of a throwing stub.\n flows: { list: () => Promise.resolve({ data: [] }) },\n ...(request.reactorAccess ? { reactor: new RemoteReactorService() } : {}),\n });\n const refresherValues = {\n ...(request.auth !== undefined ? { auth: request.auth } : {}),\n ...request.refresherValues,\n };\n const prop = findProperty(\n piece,\n request.actionName,\n request.propName,\n request.kind,\n );\n const output = await resolveDynamicProperty({\n piece,\n actionName: request.actionName,\n kind: request.kind,\n propName: request.propName,\n refresherValues,\n context,\n });\n // DYNAMIC props() yields raw piece properties (with resolver functions);\n // the editor only ever sees descriptors, so translate before crossing IPC.\n const isDynamic =\n typeof prop.props === \"function\" && typeof prop.options !== \"function\";\n return {\n id: message.id,\n type: \"result\",\n output: isDynamic\n ? describeProperties(output as Record<string, ApProperty> | undefined)\n : jsonSafe(output),\n touched: [...touched],\n tlsPoisoned: consumeTlsFlag(),\n };\n}\n\n// Reads a FILE prop's attachment ref from the copy the host staged on disk.\n// The fork shares the filesystem with its parent, so this is what keeps a\n// 50 MB scan out of the IPC channel in both directions.\nfunction stagedInputResolver(\n inputs: StagedInput[] | undefined,\n): NormalizeOptions[\"resolveRef\"] {\n if (!inputs || inputs.length === 0) return undefined;\n const byRef = new Map(inputs.map((input) => [input.ref, input]));\n return async (ref: string) => {\n const staged = byRef.get(ref);\n if (!staged) {\n throw new Error(`No staged file for reference \"${ref}\"`);\n }\n return {\n data: await readFile(staged.path),\n filename: staged.fileName,\n contentType: staged.contentType,\n };\n };\n}\n\nasync function handleRun(message: RunMessage): Promise<WorkerResponse> {\n const { request } = message;\n const { piece } = await loadCached(request);\n const action = getActions(piece)[request.actionName] as\n | ReturnType<typeof getActions>[string]\n | undefined;\n if (!action) {\n throw new Error(\n `No action \"${request.actionName}\" in ${pieceRefKey(request)}`,\n );\n }\n const files = request.stagingDir\n ? new StagedFilesService(request.stagingDir)\n : new DataUriFilesService();\n // A durable store answers every get/put over the call channel, so a write\n // survives this worker; without one the value lives only in this heap.\n const durableStore = request.durableStore\n ? new RemoteKeyValueStore()\n : undefined;\n const liveOutput = request.liveOutput ? new RemoteOutput() : undefined;\n // Host-served reactor access, for a piece that ships inside a reactor package.\n const reactor = request.reactorAccess\n ? new RemoteReactorService()\n : undefined;\n const { context, touched } = buildActionContext({\n propsValue: await normalizePropsValue(action.props, request.propsValue, {\n resolveRef: stagedInputResolver(request.stagedInputs),\n }),\n auth: request.auth,\n store:\n durableStore ??\n (request.storeScope ? storeForScope(request.storeScope) : undefined),\n files,\n connections: request.connections\n ? new InMemoryConnectionsProvider(request.connections)\n : undefined,\n output: liveOutput,\n reactor,\n executionType: request.executionType,\n identity: request.identity,\n });\n const restoreConsole = request.captureLogs ? captureConsole() : undefined;\n let output: unknown;\n try {\n output = await action.run(context);\n } finally {\n restoreConsole?.();\n liveOutput?.close();\n }\n return {\n id: message.id,\n type: \"result\",\n output: jsonSafe(output),\n ...(files instanceof StagedFilesService && files.staged().length > 0\n ? { files: files.staged() }\n : {}),\n touched: [...touched],\n tlsPoisoned: consumeTlsFlag(),\n };\n}\n\nasync function handleTriggerHook(\n message: TriggerHookMessage,\n): Promise<WorkerResponse> {\n const { request } = message;\n const { piece } = await loadCached(request);\n const trigger = getTriggers(piece)[request.triggerName] as\n | ReturnType<typeof getTriggers>[string]\n | undefined;\n if (!trigger) {\n throw new Error(\n `No trigger \"${request.triggerName}\" in bundle ${request.bundleDir}`,\n );\n }\n // The durable store answers every get/put over the call channel, so a long\n // onEnable checkpoints: registration ids survive a crash mid-hook.\n const snapshot = request.durableStore\n ? undefined\n : new InMemoryKeyValueStore(request.storeState);\n const runsPiece = request.hook === \"run\" || request.hook === \"test\";\n const handle = buildTriggerContext({\n propsValue: await normalizePropsValue(trigger.props, request.propsValue),\n auth: request.auth,\n store: snapshot ?? new RemoteKeyValueStore(),\n hostPartitionedStore: request.durableStore,\n // Test hooks write under a separate prefix, never the live cursor.\n storePrefix: request.hook === \"test\" ? \"test\" : \"\",\n identity: request.identity,\n isRepublish: request.isRepublish,\n payload: request.payload,\n webhookUrl: request.webhookUrl,\n server: request.server,\n files: runsPiece ? new DataUriFilesService() : undefined,\n });\n const output = await runTriggerHook(trigger, request.hook, handle);\n return {\n id: message.id,\n type: \"result\",\n output: jsonSafe(output),\n touched: [...handle.touched],\n tlsPoisoned: consumeTlsFlag(),\n // Only the snapshot path has state to hand back; a durable store already\n // committed everything the hook wrote.\n ...(snapshot\n ? { storeState: jsonSafe(snapshot.snapshot()) as Record<string, unknown> }\n : {}),\n schedules: handle.schedules,\n listeners: handle.listeners,\n };\n}\n\nasync function handleCheckConnection(\n message: CheckConnectionMessage,\n): Promise<WorkerResponse> {\n const { request } = message;\n const { piece } = await loadCached(request);\n const app = piece as {\n checkConnection?: (context: unknown) => unknown;\n };\n if (typeof app.checkConnection !== \"function\") {\n const outcome: CheckConnectionOutcome = { declared: false };\n return {\n id: message.id,\n type: \"result\",\n output: outcome,\n touched: [],\n tlsPoisoned: consumeTlsFlag(),\n };\n }\n const { context, touched } = buildCheckConnectionContext({\n auth: request.auth,\n });\n const result = await app.checkConnection(context);\n const outcome: CheckConnectionOutcome = {\n declared: true,\n result: jsonSafe(result),\n };\n return {\n id: message.id,\n type: \"result\",\n output: outcome,\n touched: [...touched],\n tlsPoisoned: consumeTlsFlag(),\n };\n}\n\nasync function handleDescribe(\n message: DescribePieceMessage,\n): Promise<WorkerResponse> {\n const { request } = message;\n const { piece } = await loadCached(request);\n const descriptor = buildDescriptor(piece, {\n packageName: request.packageName,\n version: request.version,\n });\n return {\n id: message.id,\n type: \"result\",\n // A prop's defaultValue is piece-authored; jsonSafe keeps a non-cloneable\n // one from failing the IPC send.\n output: jsonSafe(descriptor),\n touched: [],\n tlsPoisoned: consumeTlsFlag(),\n };\n}\n\nfunction isWorkerMessage(value: unknown): value is WorkerRequestMessage {\n if (typeof value !== \"object\" || value === null) return false;\n const type = (value as { type?: unknown }).type;\n return (\n type === \"run\" ||\n type === \"resolve-options\" ||\n type === \"trigger-hook\" ||\n type === \"check-connection\" ||\n type === \"describe\"\n );\n}\n\nfunction dispatch(message: WorkerRequestMessage): Promise<WorkerResponse> {\n switch (message.type) {\n case \"run\":\n return handleRun(message);\n case \"resolve-options\":\n return handleResolveOptions(message);\n case \"trigger-hook\":\n return handleTriggerHook(message);\n case \"check-connection\":\n return handleCheckConnection(message);\n case \"describe\":\n return handleDescribe(message);\n }\n}\n\nprocess.on(\"message\", (message: unknown) => {\n if (!isWorkerMessage(message)) return;\n // Deferred so a synchronous throw — a malformed egress policy — becomes a\n // rejection the handler below reports, instead of killing the child.\n const handler = Promise.resolve().then(() =>\n runWithEgressPolicy(message.request.egress, () => dispatch(message)),\n );\n handler\n .catch(\n (error: unknown): WorkerResponse => ({\n id: message.id,\n type: \"error\",\n error: serializeError(error, redactValuesOf(message)),\n tlsPoisoned: consumeTlsFlag(),\n }),\n )\n .then((response) => process.send?.(response))\n .catch(() => process.exit(1));\n});\n"],"mappings":";;;;;;AASA,MAAM,+BAA+B;AASrC,MAAM,0BAAU,IAAI,KAAsB;AAC1C,IAAI,SAAS;AACb,IAAI,YAAY;AAEhB,IAAa,gBAAb,cAAmC,MAAM;CACvC,YAAY,QAAgB,QAAgB;AAC1C,QAAM,cAAc,OAAO,YAAY,SAAS;AAChD,OAAK,OAAO;;;AAIhB,IAAa,uBAAb,cAA0C,MAAM;CAC9C,YAAY,QAAgB,WAAmB;AAC7C,QAAM,cAAc,OAAO,yBAAyB,UAAU,IAAI;AAClE,OAAK,OAAO;;;AAIhB,SAAS,mBAAmB,OAA2C;AACrE,QACE,OAAO,UA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Q,MAAhB;EACE,KAAK,MACH,QAAO,UAAU,QAAQ;EAC3B,KAAK,kBACH,QAAO,qBAAqB,QAAQ;EACtC,KAAK,eACH,QAAO,kBAAkB,QAAQ;EACnC,KAAK,mBACH,QAAO,sBAAsB,QAAQ;EACvC,KAAK,WACH,QAAO,eAAe,QAAQ;;;AAIpC,QAAQ,GAAG,YAAY,YAAqB;AAC1C,KAAI,CAAC,gBAAgB,QAAQ,CAAE;AAGf,SAAQ,SAAS,CAAC,WAChC,oBAAoB,QAAQ,QAAQ,cAAc,SAAS,QAAQ,CAAC,CACrE,CAEE,OACE,WAAoC;EACnC,IAAI,QAAQ;EACZ,MAAM;EACN,OAAO,eAAe,OAAO,eAAe,QAAQ,CAAC;EACrD,aAAa,gBAAgB;EAC9B,EACF,CACA,MAAM,aAAa,QAAQ,OAAO,SAAS,CAAC,CAC5C,YAAY,QAAQ,KAAK,EAAE,CAAC;EAC/B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@powerhousedao/reactor-workflow",
|
|
3
|
+
"version": "6.2.3-dev.11",
|
|
4
|
+
"license": "AGPL-3.0-only",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
10
|
+
"directory": "packages/reactor-workflow"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"source": "./src/index.ts",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./testing": {
|
|
25
|
+
"source": "./src/testing.ts",
|
|
26
|
+
"types": "./dist/testing.d.ts",
|
|
27
|
+
"import": "./dist/testing.js"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"croner": "10.0.1",
|
|
33
|
+
"graphql": "^16",
|
|
34
|
+
"@powerhousedao/reactor": "6.2.3-dev.11",
|
|
35
|
+
"@powerhousedao/pieces-framework": "6.2.3-dev.11",
|
|
36
|
+
"@powerhousedao/workflow": "6.2.3-dev.11",
|
|
37
|
+
"@powerhousedao/shared": "6.2.3-dev.11",
|
|
38
|
+
"document-model": "6.2.3-dev.11"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@electric-sql/pglite": "0.3.15",
|
|
42
|
+
"@types/node": "25.2.3",
|
|
43
|
+
"kysely": "0.28.16",
|
|
44
|
+
"kysely-pglite-dialect": "1.2.0",
|
|
45
|
+
"tsdown": "0.21.1",
|
|
46
|
+
"vitest": "4.1.1"
|
|
47
|
+
},
|
|
48
|
+
"description": "The Powerhouse workflow engine: the reactor-side runtime that runs workflow documents, and the piece loader, worker pool and executor beneath it.",
|
|
49
|
+
"keywords": [
|
|
50
|
+
"powerhouse",
|
|
51
|
+
"workflow",
|
|
52
|
+
"automation",
|
|
53
|
+
"reactor",
|
|
54
|
+
"pieces",
|
|
55
|
+
"activepieces"
|
|
56
|
+
],
|
|
57
|
+
"scripts": {
|
|
58
|
+
"tsc": "tsc",
|
|
59
|
+
"lint": "eslint",
|
|
60
|
+
"test": "vitest --run",
|
|
61
|
+
"test:watch": "vitest",
|
|
62
|
+
"build": "tsdown"
|
|
63
|
+
}
|
|
64
|
+
}
|