@cogitator-ai/worker 0.1.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Cogitator Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # @cogitator-ai/worker
2
+
3
+ Distributed job queue for Cogitator agent execution. Built on BullMQ for reliable, scalable background processing.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @cogitator-ai/worker ioredis
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Job Queue
14
+
15
+ Add jobs for background execution:
16
+
17
+ ```typescript
18
+ import { JobQueue } from '@cogitator-ai/worker';
19
+
20
+ const queue = new JobQueue({
21
+ redis: { url: 'redis://localhost:6379' },
22
+ });
23
+
24
+ // Add agent job
25
+ await queue.addAgentJob({
26
+ agentId: 'my-agent',
27
+ input: 'Process this task',
28
+ threadId: 'thread-123',
29
+ });
30
+
31
+ // Add workflow job
32
+ await queue.addWorkflowJob({
33
+ workflowId: 'data-pipeline',
34
+ input: { data: [...] },
35
+ });
36
+
37
+ // Add swarm job
38
+ await queue.addSwarmJob({
39
+ swarmId: 'research-team',
40
+ input: 'Research AI trends',
41
+ });
42
+ ```
43
+
44
+ ### Worker Pool
45
+
46
+ Process jobs with configurable concurrency:
47
+
48
+ ```typescript
49
+ import { WorkerPool } from '@cogitator-ai/worker';
50
+ import { Cogitator } from '@cogitator-ai/core';
51
+
52
+ const cogitator = new Cogitator();
53
+ const pool = new WorkerPool(cogitator, {
54
+ redis: { url: 'redis://localhost:6379' },
55
+ concurrency: 5,
56
+ });
57
+
58
+ await pool.start();
59
+ ```
60
+
61
+ ### Metrics
62
+
63
+ Prometheus-compatible metrics for HPA:
64
+
65
+ ```typescript
66
+ import { MetricsCollector, formatPrometheusMetrics } from '@cogitator-ai/worker';
67
+
68
+ const metrics = new MetricsCollector(queue);
69
+
70
+ // Expose metrics endpoint
71
+ app.get('/metrics', async (req, res) => {
72
+ const data = await metrics.collect();
73
+ res.send(formatPrometheusMetrics(data));
74
+ });
75
+ ```
76
+
77
+ ### Available Metrics
78
+
79
+ - `cogitator_queue_depth` - Total waiting + delayed jobs
80
+ - `cogitator_queue_waiting` - Jobs waiting
81
+ - `cogitator_queue_active` - Jobs processing
82
+ - `cogitator_queue_completed_total` - Completed jobs
83
+ - `cogitator_queue_failed_total` - Failed jobs
84
+ - `cogitator_workers_total` - Active workers
85
+
86
+ ## Environment Variables
87
+
88
+ - `REDIS_URL` - Redis connection URL
89
+ - `WORKER_CONCURRENCY` - Jobs per worker (default: 5)
90
+
91
+ ## Documentation
92
+
93
+ See the [Cogitator documentation](https://github.com/eL1fe/cogitator) for full API reference.
94
+
95
+ ## License
96
+
97
+ MIT
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @cogitator-ai/worker - Distributed job queue for agent execution
3
+ *
4
+ * Provides BullMQ-based job processing with:
5
+ * - Redis cluster support
6
+ * - Auto-retry with exponential backoff
7
+ * - Job priorities and delays
8
+ * - Prometheus metrics for HPA
9
+ */
10
+ export { JobQueue } from './queue';
11
+ export { WorkerPool, type WorkerPoolEvents } from './worker';
12
+ export { formatPrometheusMetrics, DurationHistogram, MetricsCollector, } from './metrics';
13
+ export { processAgentJob, processWorkflowJob, processSwarmJob, } from './processors/index';
14
+ export type { SerializedAgent, SerializedWorkflow, SerializedWorkflowNode, SerializedWorkflowEdge, SerializedSwarm, JobPayload, AgentJobPayload, WorkflowJobPayload, SwarmJobPayload, JobResult, AgentJobResult, WorkflowJobResult, SwarmJobResult, QueueConfig, WorkerConfig, QueueMetrics, } from './types';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,eAAe,EACf,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @cogitator-ai/worker - Distributed job queue for agent execution
3
+ *
4
+ * Provides BullMQ-based job processing with:
5
+ * - Redis cluster support
6
+ * - Auto-retry with exponential backoff
7
+ * - Job priorities and delays
8
+ * - Prometheus metrics for HPA
9
+ */
10
+ export { JobQueue } from './queue';
11
+ export { WorkerPool } from './worker';
12
+ export { formatPrometheusMetrics, DurationHistogram, MetricsCollector, } from './metrics';
13
+ export { processAgentJob, processWorkflowJob, processSwarmJob, } from './processors/index';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,UAAU,EAAyB,MAAM,UAAU,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Prometheus metrics for queue monitoring
3
+ *
4
+ * Provides metrics in Prometheus exposition format for:
5
+ * - Queue depth (key HPA metric)
6
+ * - Job counts by state
7
+ * - Worker count
8
+ * - Processing times
9
+ */
10
+ import type { QueueMetrics } from './types';
11
+ /**
12
+ * Format queue metrics as Prometheus exposition format
13
+ */
14
+ export declare function formatPrometheusMetrics(metrics: QueueMetrics, labels?: Record<string, string>): string;
15
+ /**
16
+ * Simple histogram tracker for job durations
17
+ */
18
+ export declare class DurationHistogram {
19
+ private buckets;
20
+ private sum;
21
+ private count;
22
+ private readonly name;
23
+ private readonly help;
24
+ constructor(name: string, help: string);
25
+ /**
26
+ * Record a duration observation
27
+ */
28
+ observe(durationSeconds: number): void;
29
+ /**
30
+ * Format as Prometheus exposition format
31
+ */
32
+ format(labels?: Record<string, string>): string;
33
+ /**
34
+ * Reset the histogram
35
+ */
36
+ reset(): void;
37
+ }
38
+ /**
39
+ * Metrics collector for worker pool
40
+ */
41
+ export declare class MetricsCollector {
42
+ readonly jobDuration: DurationHistogram;
43
+ private jobsByType;
44
+ constructor();
45
+ /**
46
+ * Record a completed job
47
+ */
48
+ recordJob(type: string, durationMs: number): void;
49
+ /**
50
+ * Format all metrics
51
+ */
52
+ format(queueMetrics: QueueMetrics, labels?: Record<string, string>): string;
53
+ }
54
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,YAAY,EACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC9B,MAAM,CAwCR;AAOD;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;gBAElB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAQtC;;OAEG;IACH,OAAO,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI;IAUtC;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM;IA8B/C;;OAEG;IACH,KAAK,IAAI,IAAI;CAOd;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,OAAO,CAAC,UAAU,CAA6B;;IAS/C;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAKjD;;OAEG;IACH,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM;CAoB5E"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Prometheus metrics for queue monitoring
3
+ *
4
+ * Provides metrics in Prometheus exposition format for:
5
+ * - Queue depth (key HPA metric)
6
+ * - Job counts by state
7
+ * - Worker count
8
+ * - Processing times
9
+ */
10
+ /**
11
+ * Format queue metrics as Prometheus exposition format
12
+ */
13
+ export function formatPrometheusMetrics(metrics, labels) {
14
+ const labelStr = labels
15
+ ? Object.entries(labels)
16
+ .map(([k, v]) => `${k}="${v}"`)
17
+ .join(',')
18
+ : '';
19
+ const labelSuffix = labelStr ? `{${labelStr}}` : '';
20
+ const lines = [
21
+ '# HELP cogitator_queue_depth Total number of jobs waiting to be processed',
22
+ '# TYPE cogitator_queue_depth gauge',
23
+ `cogitator_queue_depth${labelSuffix} ${metrics.depth}`,
24
+ '',
25
+ '# HELP cogitator_queue_waiting Number of jobs in waiting state',
26
+ '# TYPE cogitator_queue_waiting gauge',
27
+ `cogitator_queue_waiting${labelSuffix} ${metrics.waiting}`,
28
+ '',
29
+ '# HELP cogitator_queue_active Number of jobs currently being processed',
30
+ '# TYPE cogitator_queue_active gauge',
31
+ `cogitator_queue_active${labelSuffix} ${metrics.active}`,
32
+ '',
33
+ '# HELP cogitator_queue_completed_total Total number of completed jobs',
34
+ '# TYPE cogitator_queue_completed_total counter',
35
+ `cogitator_queue_completed_total${labelSuffix} ${metrics.completed}`,
36
+ '',
37
+ '# HELP cogitator_queue_failed_total Total number of failed jobs',
38
+ '# TYPE cogitator_queue_failed_total counter',
39
+ `cogitator_queue_failed_total${labelSuffix} ${metrics.failed}`,
40
+ '',
41
+ '# HELP cogitator_queue_delayed Number of delayed/scheduled jobs',
42
+ '# TYPE cogitator_queue_delayed gauge',
43
+ `cogitator_queue_delayed${labelSuffix} ${metrics.delayed}`,
44
+ '',
45
+ '# HELP cogitator_workers_total Number of active workers',
46
+ '# TYPE cogitator_workers_total gauge',
47
+ `cogitator_workers_total${labelSuffix} ${metrics.workerCount}`,
48
+ '',
49
+ ];
50
+ return lines.join('\n');
51
+ }
52
+ /**
53
+ * Job timing histogram buckets (in seconds)
54
+ */
55
+ const DURATION_BUCKETS = [0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 300];
56
+ /**
57
+ * Simple histogram tracker for job durations
58
+ */
59
+ export class DurationHistogram {
60
+ buckets = new Map();
61
+ sum = 0;
62
+ count = 0;
63
+ name;
64
+ help;
65
+ constructor(name, help) {
66
+ this.name = name;
67
+ this.help = help;
68
+ for (const bucket of DURATION_BUCKETS) {
69
+ this.buckets.set(bucket, 0);
70
+ }
71
+ }
72
+ /**
73
+ * Record a duration observation
74
+ */
75
+ observe(durationSeconds) {
76
+ this.sum += durationSeconds;
77
+ this.count++;
78
+ for (const bucket of DURATION_BUCKETS) {
79
+ if (durationSeconds <= bucket) {
80
+ this.buckets.set(bucket, (this.buckets.get(bucket) ?? 0) + 1);
81
+ }
82
+ }
83
+ }
84
+ /**
85
+ * Format as Prometheus exposition format
86
+ */
87
+ format(labels) {
88
+ const labelStr = labels
89
+ ? Object.entries(labels)
90
+ .map(([k, v]) => `${k}="${v}"`)
91
+ .join(',')
92
+ : '';
93
+ const lines = [
94
+ `# HELP ${this.name} ${this.help}`,
95
+ `# TYPE ${this.name} histogram`,
96
+ ];
97
+ let cumulative = 0;
98
+ for (const bucket of DURATION_BUCKETS) {
99
+ cumulative += this.buckets.get(bucket) ?? 0;
100
+ const bucketLabels = labelStr ? `${labelStr},le="${bucket}"` : `le="${bucket}"`;
101
+ lines.push(`${this.name}_bucket{${bucketLabels}} ${cumulative}`);
102
+ }
103
+ const infLabels = labelStr ? `${labelStr},le="+Inf"` : `le="+Inf"`;
104
+ lines.push(`${this.name}_bucket{${infLabels}} ${this.count}`);
105
+ const sumSuffix = labelStr ? `{${labelStr}}` : '';
106
+ lines.push(`${this.name}_sum${sumSuffix} ${this.sum}`);
107
+ lines.push(`${this.name}_count${sumSuffix} ${this.count}`);
108
+ lines.push('');
109
+ return lines.join('\n');
110
+ }
111
+ /**
112
+ * Reset the histogram
113
+ */
114
+ reset() {
115
+ this.sum = 0;
116
+ this.count = 0;
117
+ for (const bucket of DURATION_BUCKETS) {
118
+ this.buckets.set(bucket, 0);
119
+ }
120
+ }
121
+ }
122
+ /**
123
+ * Metrics collector for worker pool
124
+ */
125
+ export class MetricsCollector {
126
+ jobDuration;
127
+ jobsByType = new Map();
128
+ constructor() {
129
+ this.jobDuration = new DurationHistogram('cogitator_job_duration_seconds', 'Job processing duration in seconds');
130
+ }
131
+ /**
132
+ * Record a completed job
133
+ */
134
+ recordJob(type, durationMs) {
135
+ this.jobDuration.observe(durationMs / 1000);
136
+ this.jobsByType.set(type, (this.jobsByType.get(type) ?? 0) + 1);
137
+ }
138
+ /**
139
+ * Format all metrics
140
+ */
141
+ format(queueMetrics, labels) {
142
+ const parts = [
143
+ formatPrometheusMetrics(queueMetrics, labels),
144
+ this.jobDuration.format(labels),
145
+ ];
146
+ if (this.jobsByType.size > 0) {
147
+ parts.push('# HELP cogitator_jobs_by_type_total Jobs processed by type');
148
+ parts.push('# TYPE cogitator_jobs_by_type_total counter');
149
+ for (const [type, count] of this.jobsByType) {
150
+ const typeLabels = labels
151
+ ? `${Object.entries(labels).map(([k, v]) => `${k}="${v}"`).join(',')},type="${type}"`
152
+ : `type="${type}"`;
153
+ parts.push(`cogitator_jobs_by_type_total{${typeLabels}} ${count}`);
154
+ }
155
+ parts.push('');
156
+ }
157
+ return parts.join('\n');
158
+ }
159
+ }
160
+ //# sourceMappingURL=metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAqB,EACrB,MAA+B;IAE/B,MAAM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AK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,GAAG;oBACrF,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,gCAAgC,UAAU,KAAK,KAAK,EAAE,CAAC,CAAC;YACrE,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Agent job processor
3
+ *
4
+ * Recreates an Agent from serialized config and executes it.
5
+ */
6
+ import type { AgentJobPayload, AgentJobResult } from '../types';
7
+ /**
8
+ * Process an agent job
9
+ */
10
+ export declare function processAgentJob(payload: AgentJobPayload): Promise<AgentJobResult>;
11
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/processors/agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAmDhE;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAqCzB"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Agent job processor
3
+ *
4
+ * Recreates an Agent from serialized config and executes it.
5
+ */
6
+ import { Cogitator, Agent, tool } from '@cogitator-ai/core';
7
+ import { z } from 'zod';
8
+ /**
9
+ * Convert JSON Schema parameters to a permissive Zod schema
10
+ *
11
+ * Since we only have the JSON Schema and not the original Zod type,
12
+ * we create a schema that accepts any object matching the required structure.
13
+ */
14
+ function jsonSchemaToZod(params) {
15
+ const properties = params.properties;
16
+ const required = params.required ?? [];
17
+ if (Object.keys(properties).length === 0) {
18
+ return z.object({});
19
+ }
20
+ const shape = {};
21
+ for (const [key, _] of Object.entries(properties)) {
22
+ shape[key] = required.includes(key) ? z.unknown() : z.unknown().optional();
23
+ }
24
+ return z.object(shape).passthrough();
25
+ }
26
+ /**
27
+ * Recreate tools from schemas
28
+ *
29
+ * Note: This creates stub tools that log execution but can't actually run
30
+ * the original code. For full tool support, tools need to be registered
31
+ * separately on the worker or use a remote execution mechanism.
32
+ */
33
+ function recreateTools(schemas) {
34
+ return schemas.map((schema) => tool({
35
+ name: schema.name,
36
+ description: schema.description,
37
+ parameters: jsonSchemaToZod(schema.parameters),
38
+ execute: async (input) => {
39
+ console.warn(`[worker] Tool "${schema.name}" called with input:`, JSON.stringify(input));
40
+ return {
41
+ warning: 'Tool executed in worker with stub implementation',
42
+ input,
43
+ };
44
+ },
45
+ }));
46
+ }
47
+ /**
48
+ * Process an agent job
49
+ */
50
+ export async function processAgentJob(payload) {
51
+ const { agentConfig, input, threadId } = payload;
52
+ const cogitator = new Cogitator();
53
+ const tools = recreateTools(agentConfig.tools);
54
+ const agent = new Agent({
55
+ name: agentConfig.name,
56
+ model: `${agentConfig.provider}/${agentConfig.model}`,
57
+ instructions: agentConfig.instructions,
58
+ temperature: agentConfig.temperature,
59
+ maxTokens: agentConfig.maxTokens,
60
+ tools,
61
+ });
62
+ const result = await cogitator.run(agent, {
63
+ input,
64
+ threadId,
65
+ });
66
+ const toolCalls = result.toolCalls.map((tc) => ({
67
+ name: tc.name,
68
+ input: tc.arguments,
69
+ output: undefined,
70
+ }));
71
+ return {
72
+ type: 'agent',
73
+ output: result.output,
74
+ toolCalls,
75
+ tokenUsage: {
76
+ prompt: result.usage.inputTokens,
77
+ completion: result.usage.outputTokens,
78
+ total: result.usage.totalTokens,
79
+ },
80
+ };
81
+ }
82
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/processors/agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI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,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { processAgentJob } from './agent';
2
+ export { processWorkflowJob } from './workflow';
3
+ export { processSwarmJob } from './swarm';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/processors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { processAgentJob } from './agent';
2
+ export { processWorkflowJob } from './workflow';
3
+ export { processSwarmJob } from './swarm';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/processors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Swarm job processor
3
+ *
4
+ * Recreates a Swarm from serialized config and executes it.
5
+ */
6
+ import type { SwarmJobPayload, SwarmJobResult } from '../types';
7
+ /**
8
+ * Process a swarm job
9
+ */
10
+ export declare function processSwarmJob(payload: SwarmJobPayload): Promise<SwarmJobResult>;
11
+ //# sourceMappingURL=swarm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swarm.d.ts","sourceRoot":"","sources":["../../src/processors/swarm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,UAAU,CAAC;AAiFjF;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,cAAc,CAAC,CAqCzB"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Swarm job processor
3
+ *
4
+ * Recreates a Swarm from serialized config and executes it.
5
+ */
6
+ import { Cogitator, Agent, tool } from '@cogitator-ai/core';
7
+ import { Swarm } from '@cogitator-ai/swarms';
8
+ import { z } from 'zod';
9
+ /**
10
+ * Convert JSON Schema to permissive Zod schema
11
+ */
12
+ function jsonSchemaToZod(params) {
13
+ const properties = params.properties;
14
+ const required = params.required ?? [];
15
+ if (Object.keys(properties).length === 0) {
16
+ return z.object({});
17
+ }
18
+ const shape = {};
19
+ for (const [key, _] of Object.entries(properties)) {
20
+ shape[key] = required.includes(key) ? z.unknown() : z.unknown().optional();
21
+ }
22
+ return z.object(shape).passthrough();
23
+ }
24
+ /**
25
+ * Recreate tools from schemas
26
+ */
27
+ function recreateTools(schemas) {
28
+ return schemas.map((schema) => tool({
29
+ name: schema.name,
30
+ description: schema.description,
31
+ parameters: jsonSchemaToZod(schema.parameters),
32
+ execute: async (input) => {
33
+ console.warn(`[worker] Tool "${schema.name}" called with input:`, JSON.stringify(input));
34
+ return {
35
+ warning: 'Tool executed in worker with stub implementation',
36
+ input,
37
+ };
38
+ },
39
+ }));
40
+ }
41
+ /**
42
+ * Recreate an agent from serialized config
43
+ */
44
+ function recreateAgent(config) {
45
+ const tools = recreateTools(config.tools);
46
+ return new Agent({
47
+ name: config.name,
48
+ model: `${config.provider}/${config.model}`,
49
+ instructions: config.instructions,
50
+ temperature: config.temperature,
51
+ maxTokens: config.maxTokens,
52
+ tools,
53
+ });
54
+ }
55
+ /**
56
+ * Map topology to strategy type
57
+ */
58
+ function getStrategyType(topology) {
59
+ switch (topology) {
60
+ case 'sequential':
61
+ return 'pipeline';
62
+ case 'hierarchical':
63
+ return 'hierarchical';
64
+ case 'collaborative':
65
+ return 'round-robin';
66
+ case 'debate':
67
+ return 'debate';
68
+ case 'voting':
69
+ return 'consensus';
70
+ default:
71
+ return 'round-robin';
72
+ }
73
+ }
74
+ /**
75
+ * Process a swarm job
76
+ */
77
+ export async function processSwarmJob(payload) {
78
+ const { swarmConfig, input } = payload;
79
+ const cogitator = new Cogitator();
80
+ const agents = swarmConfig.agents.map(recreateAgent);
81
+ const strategyType = getStrategyType(swarmConfig.topology);
82
+ const config = {
83
+ name: `worker-swarm-${Date.now()}`,
84
+ agents,
85
+ strategy: strategyType,
86
+ };
87
+ const swarm = new Swarm(cogitator, config);
88
+ const result = await swarm.run({
89
+ input,
90
+ });
91
+ const agentOutputs = [];
92
+ if (result.agentResults) {
93
+ for (const [agentId, runResult] of result.agentResults) {
94
+ agentOutputs.push({
95
+ agent: agentId,
96
+ output: runResult.output,
97
+ });
98
+ }
99
+ }
100
+ return {
101
+ type: 'swarm',
102
+ output: String(result.output ?? ''),
103
+ rounds: 1,
104
+ agentOutputs,
105
+ };
106
+ }
107
+ //# sourceMappingURL=swarm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swarm.js","sourceRoot":"","sources":["../../src/processors/swarm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,SAAS,eAAe,CAAC,MAAgC;IACvD,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;IAEvC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;IAED,MAAM,KAAK,GAA8B,EAAE,CAAC;IAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAA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C;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;QACnC,MAAM,EAAE,CAAC;QACT,YAAY;KACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Workflow job processor
3
+ *
4
+ * Recreates a Workflow from serialized config and executes it.
5
+ */
6
+ import type { WorkflowJobPayload, WorkflowJobResult } from '../types';
7
+ /**
8
+ * Process a workflow job
9
+ *
10
+ * Note: Full workflow execution requires deserializing the workflow graph
11
+ * and recreating node instances. This is a placeholder implementation.
12
+ */
13
+ export declare function processWorkflowJob(payload: WorkflowJobPayload): Promise<WorkflowJobResult>;
14
+ //# sourceMappingURL=workflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/processors/workflow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CA6B5B"}