@objectstack/service-automation 3.0.7

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/engine.ts","../src/plugin.ts","../src/plugins/crud-nodes-plugin.ts","../src/plugins/logic-nodes-plugin.ts","../src/plugins/http-connector-plugin.ts"],"sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { FlowParsed, FlowNodeParsed } from '@objectstack/spec/automation';\nimport type { AutomationContext, AutomationResult, IAutomationService } from '@objectstack/spec/contracts';\nimport type { Logger } from '@objectstack/spec/contracts';\nimport { FlowSchema } from '@objectstack/spec/automation';\n\n// ─── Node Executor Interface (Plugin Extension Point) ───────────────\n\n/**\n * Each node type corresponds to a NodeExecutor.\n * Third-party plugins only need to implement this interface and register\n * it with the engine to extend automation capabilities.\n */\nexport interface NodeExecutor {\n /** Corresponds to FlowNodeAction enum value */\n readonly type: string;\n\n /**\n * Execute a node\n * @param node - Current node definition\n * @param variables - Flow variable context (read/write)\n * @param context - Trigger context\n * @returns Execution result (may include output data, branch conditions, etc.)\n */\n execute(\n node: FlowNodeParsed,\n variables: Map<string, unknown>,\n context: AutomationContext,\n ): Promise<NodeExecutionResult>;\n}\n\nexport interface NodeExecutionResult {\n success: boolean;\n output?: Record<string, unknown>;\n error?: string;\n /** Used by decision nodes — returns the selected branch label */\n branchLabel?: string;\n}\n\n// ─── Trigger Interface (Plugin Extension Point) ─────────────────────\n\n/**\n * Trigger interface. Schedule/Event/API triggers are registered via plugins.\n */\nexport interface FlowTrigger {\n readonly type: string;\n start(flowName: string, callback: (ctx: AutomationContext) => Promise<void>): void;\n stop(flowName: string): void;\n}\n\n// ─── Core Automation Engine ─────────────────────────────────────────\n\nexport class AutomationEngine implements IAutomationService {\n private flows = new Map<string, FlowParsed>();\n private nodeExecutors = new Map<string, NodeExecutor>();\n private triggers = new Map<string, FlowTrigger>();\n private logger: Logger;\n\n constructor(logger: Logger) {\n this.logger = logger;\n }\n\n // ── Plugin Extension API ──────────────────────────────\n\n /** Register a node executor (called by plugins) */\n registerNodeExecutor(executor: NodeExecutor): void {\n if (this.nodeExecutors.has(executor.type)) {\n this.logger.warn(`Node executor '${executor.type}' replaced`);\n }\n this.nodeExecutors.set(executor.type, executor);\n this.logger.info(`Node executor registered: ${executor.type}`);\n }\n\n /** Unregister a node executor (hot-unplug) */\n unregisterNodeExecutor(type: string): void {\n this.nodeExecutors.delete(type);\n this.logger.info(`Node executor unregistered: ${type}`);\n }\n\n /** Register a trigger (called by plugins) */\n registerTrigger(trigger: FlowTrigger): void {\n this.triggers.set(trigger.type, trigger);\n this.logger.info(`Trigger registered: ${trigger.type}`);\n }\n\n /** Unregister a trigger (hot-unplug) */\n unregisterTrigger(type: string): void {\n this.triggers.delete(type);\n this.logger.info(`Trigger unregistered: ${type}`);\n }\n\n /** Get all registered node types */\n getRegisteredNodeTypes(): string[] {\n return [...this.nodeExecutors.keys()];\n }\n\n /** Get all registered trigger types */\n getRegisteredTriggerTypes(): string[] {\n return [...this.triggers.keys()];\n }\n\n // ── IAutomationService Contract Implementation ────────\n\n registerFlow(name: string, definition: unknown): void {\n const parsed = FlowSchema.parse(definition);\n this.flows.set(name, parsed);\n this.logger.info(`Flow registered: ${name}`);\n }\n\n unregisterFlow(name: string): void {\n this.flows.delete(name);\n this.logger.info(`Flow unregistered: ${name}`);\n }\n\n async listFlows(): Promise<string[]> {\n return [...this.flows.keys()];\n }\n\n async execute(flowName: string, context?: AutomationContext): Promise<AutomationResult> {\n const startTime = Date.now();\n const flow = this.flows.get(flowName);\n\n if (!flow) {\n return { success: false, error: `Flow '${flowName}' not found` };\n }\n\n // Initialize variable context\n const variables = new Map<string, unknown>();\n if (flow.variables) {\n for (const v of flow.variables) {\n if (v.isInput && context?.params?.[v.name] !== undefined) {\n variables.set(v.name, context.params[v.name]);\n }\n }\n }\n // Inject trigger record\n if (context?.record) {\n variables.set('$record', context.record);\n }\n\n try {\n // Find the start node\n const startNode = flow.nodes.find(n => n.type === 'start');\n if (!startNode) {\n return { success: false, error: 'Flow has no start node' };\n }\n\n // DAG traversal execution\n await this.executeNode(startNode, flow, variables, context ?? {});\n\n // Collect output variables\n const output: Record<string, unknown> = {};\n if (flow.variables) {\n for (const v of flow.variables) {\n if (v.isOutput) {\n output[v.name] = variables.get(v.name);\n }\n }\n }\n\n return {\n success: true,\n output,\n durationMs: Date.now() - startTime,\n };\n } catch (err: unknown) {\n const errorMessage = err instanceof Error ? err.message : String(err);\n\n // Error handling strategy\n if (flow.errorHandling?.strategy === 'retry') {\n return this.retryExecution(flowName, context, startTime, flow.errorHandling);\n }\n return {\n success: false,\n error: errorMessage,\n durationMs: Date.now() - startTime,\n };\n }\n }\n\n // ── DAG Traversal Core ──────────────────────────────────\n\n private async executeNode(\n node: FlowNodeParsed,\n flow: FlowParsed,\n variables: Map<string, unknown>,\n context: AutomationContext,\n ): Promise<void> {\n if (node.type === 'end') return;\n\n // Find executor\n const executor = this.nodeExecutors.get(node.type);\n if (!executor) {\n // start node without executor is fine — just skip\n if (node.type !== 'start') {\n throw new Error(`No executor registered for node type '${node.type}'`);\n }\n } else {\n // Execute node\n const result = await executor.execute(node, variables, context);\n if (!result.success) {\n throw new Error(`Node '${node.id}' failed: ${result.error}`);\n }\n // Write back output variables\n if (result.output) {\n for (const [key, value] of Object.entries(result.output)) {\n variables.set(`${node.id}.${key}`, value);\n }\n }\n }\n\n // Find next nodes (filter by edge conditions)\n const outEdges = flow.edges.filter(e => e.source === node.id);\n for (const edge of outEdges) {\n if (edge.condition && !this.evaluateCondition(edge.condition, variables)) {\n continue;\n }\n const nextNode = flow.nodes.find(n => n.id === edge.target);\n if (nextNode) {\n await this.executeNode(nextNode, flow, variables, context);\n }\n }\n }\n\n private evaluateCondition(expression: string, variables: Map<string, unknown>): boolean {\n // MVP: Simple template replacement + expression evaluation.\n // Flow definitions are authored by trusted developers/admins.\n // TODO: Replace with safe expression evaluator (e.g., jexl) for production.\n let resolved = expression;\n for (const [key, value] of variables) {\n resolved = resolved.split(`{${key}}`).join(String(value));\n }\n try {\n return new Function(`return (${resolved})`)() as boolean;\n } catch {\n return false;\n }\n }\n\n private async retryExecution(\n flowName: string,\n context: AutomationContext | undefined,\n startTime: number,\n errorHandling: { maxRetries?: number; retryDelayMs?: number },\n ): Promise<AutomationResult> {\n const maxRetries = errorHandling.maxRetries ?? 3;\n const delay = errorHandling.retryDelayMs ?? 1000;\n\n for (let i = 0; i < maxRetries; i++) {\n await new Promise(r => setTimeout(r, delay));\n const result = await this.execute(flowName, context);\n if (result.success) return result;\n }\n return { success: false, error: 'Max retries exceeded', durationMs: Date.now() - startTime };\n }\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Plugin, PluginContext } from '@objectstack/core';\nimport { AutomationEngine } from './engine.js';\n\n/**\n * Configuration options for the AutomationServicePlugin.\n */\nexport interface AutomationServicePluginOptions {\n /** Enable debug logging for flow execution */\n debug?: boolean;\n}\n\n/**\n * AutomationServicePlugin — Core engine plugin\n *\n * Responsibilities:\n * 1. init phase: Create engine instance, register as 'automation' service\n * 2. start phase: Trigger 'automation:ready' hook for node plugin registration\n * 3. destroy phase: Clean up resources\n *\n * Does NOT implement any specific nodes — nodes are registered by other plugins\n * via the engine's extension API.\n *\n * @example\n * ```ts\n * import { LiteKernel } from '@objectstack/core';\n * import { AutomationServicePlugin } from '@objectstack/service-automation';\n *\n * const kernel = new LiteKernel();\n * kernel.use(new AutomationServicePlugin());\n * await kernel.bootstrap();\n *\n * const automation = kernel.getService('automation');\n * ```\n */\nexport class AutomationServicePlugin implements Plugin {\n name = 'com.objectstack.service-automation';\n version = '1.0.0';\n type = 'standard' as const;\n dependencies: string[] = [];\n\n private engine?: AutomationEngine;\n private readonly options: AutomationServicePluginOptions;\n\n constructor(options: AutomationServicePluginOptions = {}) {\n this.options = options;\n }\n\n async init(ctx: PluginContext): Promise<void> {\n this.engine = new AutomationEngine(ctx.logger);\n\n // Register as global service — other plugins access via ctx.getService('automation')\n ctx.registerService('automation', this.engine);\n\n if (this.options.debug) {\n ctx.hook('automation:beforeExecute', async (flowName: string) => {\n ctx.logger.debug(`[Automation] Before execute: ${flowName}`);\n });\n }\n\n ctx.logger.info('[Automation] Engine initialized');\n }\n\n async start(ctx: PluginContext): Promise<void> {\n if (!this.engine) return;\n\n // Trigger hook to notify engine is ready — other plugins can start registering nodes\n await ctx.trigger('automation:ready', this.engine);\n\n const nodeTypes = this.engine.getRegisteredNodeTypes();\n ctx.logger.info(\n `[Automation] Engine started with ${nodeTypes.length} node types: ${nodeTypes.join(', ') || '(none)'}`,\n );\n }\n\n async destroy(): Promise<void> {\n this.engine = undefined;\n }\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Plugin, PluginContext } from '@objectstack/core';\nimport type { AutomationEngine } from '../engine.js';\n\n/**\n * CRUD Node Plugin — Provides get_record / create_record / update_record / delete_record\n *\n * Dependencies: service-automation (engine)\n *\n * In a full runtime environment these nodes would delegate to ObjectQL (data layer).\n * This MVP implementation provides the extension point structure.\n */\nexport class CrudNodesPlugin implements Plugin {\n name = 'com.objectstack.automation.crud-nodes';\n version = '1.0.0';\n type = 'standard' as const;\n dependencies = ['com.objectstack.service-automation'];\n\n async init(ctx: PluginContext): Promise<void> {\n const engine = ctx.getService<AutomationEngine>('automation');\n\n // get_record node executor\n engine.registerNodeExecutor({\n type: 'get_record',\n async execute(node, _variables, _context) {\n const config = node.config as Record<string, unknown> | undefined;\n // In production, this would query via ObjectQL:\n // const ql = ctx.getService('objectql');\n // const records = await ql.find(config.object, config.filters);\n return {\n success: true,\n output: { records: [], object: config?.object },\n };\n },\n });\n\n // create_record node executor\n engine.registerNodeExecutor({\n type: 'create_record',\n async execute(node, _variables, _context) {\n const config = node.config as Record<string, unknown> | undefined;\n return {\n success: true,\n output: { id: 'new-record-id', object: config?.object },\n };\n },\n });\n\n // update_record node executor\n engine.registerNodeExecutor({\n type: 'update_record',\n async execute(_node, _variables, _context) {\n return { success: true };\n },\n });\n\n // delete_record node executor\n engine.registerNodeExecutor({\n type: 'delete_record',\n async execute(_node, _variables, _context) {\n return { success: true };\n },\n });\n\n ctx.logger.info('[CRUD Nodes] 4 node executors registered');\n }\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Plugin, PluginContext } from '@objectstack/core';\nimport type { AutomationEngine } from '../engine.js';\n\n/**\n * Logic Node Plugin — Provides decision / assignment / loop nodes\n *\n * Dependencies: service-automation (engine)\n */\nexport class LogicNodesPlugin implements Plugin {\n name = 'com.objectstack.automation.logic-nodes';\n version = '1.0.0';\n type = 'standard' as const;\n dependencies = ['com.objectstack.service-automation'];\n\n async init(ctx: PluginContext): Promise<void> {\n const engine = ctx.getService<AutomationEngine>('automation');\n\n // decision node — conditional branching\n engine.registerNodeExecutor({\n type: 'decision',\n async execute(node, variables, _context) {\n const config = node.config as Record<string, unknown> | undefined;\n const conditions = (config?.conditions ?? []) as Array<{ label: string; expression: string }>;\n\n for (const cond of conditions) {\n // MVP: Simple template replacement + expression evaluation.\n // Flow definitions are authored by trusted developers/admins.\n // TODO: Replace with safe expression evaluator (e.g., jexl) for production.\n let expr = cond.expression;\n for (const [k, v] of variables) {\n expr = expr.split(`{${k}}`).join(String(v));\n }\n try {\n if (new Function(`return (${expr})`)()) {\n return { success: true, branchLabel: cond.label };\n }\n } catch {\n // Continue to next condition\n }\n }\n return { success: true, branchLabel: 'default' };\n },\n });\n\n // assignment node — set variables\n engine.registerNodeExecutor({\n type: 'assignment',\n async execute(node, variables, _context) {\n const config = (node.config ?? {}) as Record<string, unknown>;\n for (const [key, value] of Object.entries(config)) {\n variables.set(key, value);\n }\n return { success: true };\n },\n });\n\n // loop node — iterate over a collection\n engine.registerNodeExecutor({\n type: 'loop',\n async execute(node, variables, _context) {\n const config = node.config as Record<string, unknown> | undefined;\n const collectionName = config?.collection as string | undefined;\n if (collectionName) {\n const collection = variables.get(collectionName);\n if (Array.isArray(collection)) {\n variables.set('$loopItems', collection);\n variables.set('$loopIndex', 0);\n }\n }\n return { success: true };\n },\n });\n\n ctx.logger.info('[Logic Nodes] 3 node executors registered');\n }\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Plugin, PluginContext } from '@objectstack/core';\nimport type { AutomationEngine } from '../engine.js';\n\n/**\n * HTTP + Connector Node Plugin — Provides http_request / connector_action nodes\n *\n * Dependencies: service-automation (engine)\n */\nexport class HttpConnectorPlugin implements Plugin {\n name = 'com.objectstack.automation.http-connector';\n version = '1.0.0';\n type = 'standard' as const;\n dependencies = ['com.objectstack.service-automation'];\n\n async init(ctx: PluginContext): Promise<void> {\n const engine = ctx.getService<AutomationEngine>('automation');\n\n // http_request node executor\n engine.registerNodeExecutor({\n type: 'http_request',\n async execute(node, _variables, _context) {\n const config = node.config as Record<string, unknown> | undefined;\n const url = config?.url as string | undefined;\n const method = (config?.method as string) ?? 'GET';\n const headers = config?.headers as Record<string, string> | undefined;\n const body = config?.body;\n\n if (!url) {\n return { success: false, error: 'http_request: url is required' };\n }\n\n const response = await fetch(url, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n const data = await response.json();\n\n return {\n success: response.ok,\n output: { response: data, status: response.status },\n error: response.ok ? undefined : `HTTP ${response.status}`,\n };\n },\n });\n\n // connector_action node — calls a registered connector\n engine.registerNodeExecutor({\n type: 'connector_action',\n async execute(node, _variables, _context) {\n const connectorConfig = node.connectorConfig;\n if (!connectorConfig) {\n return { success: false, error: 'connector_action: connectorConfig is required' };\n }\n\n ctx.logger.info(\n `Connector action: ${connectorConfig.connectorId}.${connectorConfig.actionId}`,\n );\n\n // In production, this would look up the connector from a registry\n // and execute the specified action with the mapped inputs\n return { success: true, output: { connectorResult: {} } };\n },\n });\n\n ctx.logger.info('[HTTP Connector] 2 node executors registered');\n }\n}\n"],"mappings":";AAKA,SAAS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AAO,gDAAgD;AAAA,QACpF;AAEA,YAAI,OAAO;AAAA,UACP,qBAAqB,gBAAgB,WAAW,IAAI,gBAAgB,QAAQ;AAAA,QAChF;AAIA,eAAO,EAAE,SAAS,MAAM,QAAQ,EAAE,iBAAiB,CAAC,EAAE,EAAE;AAAA,MAC5D;AAAA,IACJ,CAAC;AAED,QAAI,OAAO,KAAK,8CAA8C;AAAA,EAClE;AACJ;","names":[]}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@objectstack/service-automation",
3
+ "version": "3.0.7",
4
+ "license": "Apache-2.0",
5
+ "description": "Automation Service for ObjectStack — implements IAutomationService with plugin-based DAG flow execution engine",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.js"
14
+ }
15
+ },
16
+ "dependencies": {
17
+ "@objectstack/core": "3.0.7",
18
+ "@objectstack/spec": "3.0.7"
19
+ },
20
+ "devDependencies": {
21
+ "typescript": "^5.0.0",
22
+ "vitest": "^4.0.18",
23
+ "@types/node": "^25.2.3"
24
+ },
25
+ "scripts": {
26
+ "build": "tsup --config ../../../tsup.config.ts",
27
+ "test": "vitest run"
28
+ }
29
+ }