cliq-a2a-runtime 0.9.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/README.md +91 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +260 -0
- package/dist/index.js.map +1 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# cliq-a2a-runtime
|
|
2
|
+
|
|
3
|
+
Lightweight SDK for building [Cliq](https://github.com/cliqhub/cliq) A2A phase agents. Zero external dependencies — uses only Node.js built-in HTTP.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install cliq-a2a-runtime
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { createCliqRuntime } from 'cliq-a2a-runtime';
|
|
15
|
+
|
|
16
|
+
const runtime = createCliqRuntime({
|
|
17
|
+
name: 'my-agent',
|
|
18
|
+
description: 'Custom phase agent',
|
|
19
|
+
|
|
20
|
+
async execute({ role, inputs, metadata, progress }) {
|
|
21
|
+
progress('Working...');
|
|
22
|
+
|
|
23
|
+
// Your logic here — call an LLM, run tools, process data
|
|
24
|
+
const output = await do_work(role, inputs);
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
channels: { 'phase_to_next': output },
|
|
28
|
+
summary: 'Done.',
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
runtime.start();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
### `createCliqRuntime(config)`
|
|
39
|
+
|
|
40
|
+
Returns a `CliqRuntime` object with `start()` and `stop()` methods.
|
|
41
|
+
|
|
42
|
+
**Config:**
|
|
43
|
+
|
|
44
|
+
| Field | Type | Required | Description |
|
|
45
|
+
|-------|------|----------|-------------|
|
|
46
|
+
| `name` | `string` | yes | Agent name (matches `team.yml` agent key) |
|
|
47
|
+
| `description` | `string` | no | Human-readable description |
|
|
48
|
+
| `port` | `number` | yes | Server port. Can be overridden at runtime with `--port <n>`. |
|
|
49
|
+
| `execute` | `ExecuteFunction` | yes | The function that handles phase execution |
|
|
50
|
+
|
|
51
|
+
### `execute(ctx)`
|
|
52
|
+
|
|
53
|
+
Called when the Cliq orchestrator dispatches a phase task.
|
|
54
|
+
|
|
55
|
+
**Context (`ctx`):**
|
|
56
|
+
|
|
57
|
+
| Field | Type | Description |
|
|
58
|
+
|-------|------|-------------|
|
|
59
|
+
| `role` | `string` | Role prompt content |
|
|
60
|
+
| `inputs` | `Record<string, string>` | Input channel contents from predecessors |
|
|
61
|
+
| `metadata` | `Record<string, unknown>` | Phase metadata (`req_spec`, `task_board`, `output_channels`) |
|
|
62
|
+
| `progress` | `(msg: string) => void` | Report progress updates |
|
|
63
|
+
|
|
64
|
+
**Returns:** `Promise<{ channels: Record<string, string>, summary: string }>`
|
|
65
|
+
|
|
66
|
+
### `runtime.start()`
|
|
67
|
+
|
|
68
|
+
Starts the HTTP server on `config.port`. Override at runtime with `--port`:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
node my-agent.js --port 9090
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Returns `Promise<{ port: number, url: string }>`.
|
|
75
|
+
|
|
76
|
+
### `runtime.stop()`
|
|
77
|
+
|
|
78
|
+
Gracefully shuts down the server.
|
|
79
|
+
|
|
80
|
+
## Protocol
|
|
81
|
+
|
|
82
|
+
The runtime automatically handles:
|
|
83
|
+
|
|
84
|
+
- **Agent card** at `GET /.well-known/agent.json` with the `cliq-phase-executor` skill
|
|
85
|
+
- **JSON-RPC** at `POST /` for `tasks/send`, `tasks/get`, `tasks/cancel`
|
|
86
|
+
|
|
87
|
+
See the [Custom Agents Guide](../../docs/custom-agents.md) for full documentation.
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cliq-a2a-runtime — lightweight SDK for building Cliq A2A phase agents.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { createCliqRuntime } from 'cliq-a2a-runtime';
|
|
6
|
+
*
|
|
7
|
+
* const runtime = createCliqRuntime({
|
|
8
|
+
* name: 'openai-analyst',
|
|
9
|
+
* description: 'Research phase agent powered by OpenAI',
|
|
10
|
+
* execute: async ({ role, inputs, metadata, progress }) => {
|
|
11
|
+
* // ... call your LLM, process data, etc.
|
|
12
|
+
* return { channels: { 'analysis_to_review': 'Review output...' }, summary: 'Done.' };
|
|
13
|
+
* },
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* runtime.start();
|
|
17
|
+
*/
|
|
18
|
+
export interface CliqRuntimeConfig {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
port: number;
|
|
22
|
+
execute: ExecuteFunction;
|
|
23
|
+
}
|
|
24
|
+
export interface ExecuteContext {
|
|
25
|
+
role: string;
|
|
26
|
+
inputs: Record<string, string>;
|
|
27
|
+
metadata: Record<string, unknown>;
|
|
28
|
+
progress: (message: string) => void;
|
|
29
|
+
}
|
|
30
|
+
export type ExecuteResult = {
|
|
31
|
+
channels: Record<string, string>;
|
|
32
|
+
summary: string;
|
|
33
|
+
};
|
|
34
|
+
export type ExecuteFunction = (ctx: ExecuteContext) => Promise<ExecuteResult>;
|
|
35
|
+
export interface CliqRuntime {
|
|
36
|
+
start: () => Promise<{
|
|
37
|
+
port: number;
|
|
38
|
+
url: string;
|
|
39
|
+
}>;
|
|
40
|
+
stop: () => Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
export declare function createCliqRuntime(config: CliqRuntimeConfig): CliqRuntime;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cliq-a2a-runtime — lightweight SDK for building Cliq A2A phase agents.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { createCliqRuntime } from 'cliq-a2a-runtime';
|
|
6
|
+
*
|
|
7
|
+
* const runtime = createCliqRuntime({
|
|
8
|
+
* name: 'openai-analyst',
|
|
9
|
+
* description: 'Research phase agent powered by OpenAI',
|
|
10
|
+
* execute: async ({ role, inputs, metadata, progress }) => {
|
|
11
|
+
* // ... call your LLM, process data, etc.
|
|
12
|
+
* return { channels: { 'analysis_to_review': 'Review output...' }, summary: 'Done.' };
|
|
13
|
+
* },
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* runtime.start();
|
|
17
|
+
*/
|
|
18
|
+
import http from 'node:http';
|
|
19
|
+
// ---- Agent card ----
|
|
20
|
+
function build_agent_card(name, description, port) {
|
|
21
|
+
return {
|
|
22
|
+
name,
|
|
23
|
+
description,
|
|
24
|
+
url: `http://localhost:${port}`,
|
|
25
|
+
version: '0.9.0',
|
|
26
|
+
capabilities: {
|
|
27
|
+
streaming: false,
|
|
28
|
+
pushNotifications: false,
|
|
29
|
+
},
|
|
30
|
+
skills: [
|
|
31
|
+
{
|
|
32
|
+
id: 'cliq-phase-executor',
|
|
33
|
+
name: 'Cliq Phase Executor',
|
|
34
|
+
description: 'Executes a Cliq pipeline phase via A2A protocol.',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
defaultInputModes: ['text'],
|
|
38
|
+
defaultOutputModes: ['text'],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// ---- Message parser ----
|
|
42
|
+
/** Extract role, inputs, and metadata from the structured Cliq message format. */
|
|
43
|
+
function parse_cliq_message(text) {
|
|
44
|
+
const sections = {};
|
|
45
|
+
let current_section = '';
|
|
46
|
+
const lines = text.split('\n');
|
|
47
|
+
for (const line of lines) {
|
|
48
|
+
const h1 = line.match(/^# (.+)/);
|
|
49
|
+
if (h1) {
|
|
50
|
+
current_section = h1[1].trim();
|
|
51
|
+
sections[current_section] = '';
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (current_section) {
|
|
55
|
+
sections[current_section] = (sections[current_section] + '\n' + line);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const role = (sections['Role'] ?? '').trim();
|
|
59
|
+
const req_spec = sections['Requirements']?.trim() || undefined;
|
|
60
|
+
const task_board = sections['Task Board']?.trim() || undefined;
|
|
61
|
+
// Parse input channels from "## channel_name" subsections
|
|
62
|
+
const inputs = {};
|
|
63
|
+
const channels_block = sections['Input Channels'] ?? '';
|
|
64
|
+
let current_channel = '';
|
|
65
|
+
for (const line of channels_block.split('\n')) {
|
|
66
|
+
const h2 = line.match(/^## (.+)/);
|
|
67
|
+
if (h2) {
|
|
68
|
+
current_channel = h2[1].trim();
|
|
69
|
+
inputs[current_channel] = '';
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (current_channel) {
|
|
73
|
+
inputs[current_channel] = (inputs[current_channel] + '\n' + line);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
for (const key of Object.keys(inputs)) {
|
|
77
|
+
inputs[key] = inputs[key].trim();
|
|
78
|
+
}
|
|
79
|
+
return { role, inputs, req_spec, task_board };
|
|
80
|
+
}
|
|
81
|
+
// ---- argv helpers ----
|
|
82
|
+
function parse_port_argv(config_port) {
|
|
83
|
+
const idx = process.argv.indexOf('--port');
|
|
84
|
+
if (idx !== -1 && process.argv[idx + 1]) {
|
|
85
|
+
const parsed = parseInt(process.argv[idx + 1], 10);
|
|
86
|
+
if (!isNaN(parsed) && parsed > 0)
|
|
87
|
+
return parsed;
|
|
88
|
+
}
|
|
89
|
+
return config_port;
|
|
90
|
+
}
|
|
91
|
+
// ---- createCliqRuntime ----
|
|
92
|
+
export function createCliqRuntime(config) {
|
|
93
|
+
const { name, description = '', port: config_port, execute } = config;
|
|
94
|
+
const tasks = new Map();
|
|
95
|
+
let server = null;
|
|
96
|
+
function handle_agent_card(res, port) {
|
|
97
|
+
const card = build_agent_card(name, description, port);
|
|
98
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
99
|
+
res.end(JSON.stringify(card));
|
|
100
|
+
}
|
|
101
|
+
async function handle_json_rpc(req, res) {
|
|
102
|
+
let body = '';
|
|
103
|
+
for await (const chunk of req)
|
|
104
|
+
body += chunk;
|
|
105
|
+
let rpc;
|
|
106
|
+
try {
|
|
107
|
+
rpc = JSON.parse(body);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
111
|
+
res.end(JSON.stringify({ jsonrpc: '2.0', error: { code: -32700, message: 'Parse error' } }));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
switch (rpc.method) {
|
|
115
|
+
case 'tasks/send':
|
|
116
|
+
await handle_tasks_send(rpc, res);
|
|
117
|
+
break;
|
|
118
|
+
case 'tasks/get':
|
|
119
|
+
handle_tasks_get(rpc, res);
|
|
120
|
+
break;
|
|
121
|
+
case 'tasks/cancel':
|
|
122
|
+
handle_tasks_cancel(rpc, res);
|
|
123
|
+
break;
|
|
124
|
+
default:
|
|
125
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
126
|
+
res.end(JSON.stringify({
|
|
127
|
+
jsonrpc: '2.0', id: rpc.id,
|
|
128
|
+
error: { code: -32601, message: `Method not found: ${rpc.method}` },
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function handle_tasks_send(rpc, res) {
|
|
133
|
+
const params = rpc.params ?? {};
|
|
134
|
+
const task_id = params.id ?? `task-${Date.now()}`;
|
|
135
|
+
const message = params.message;
|
|
136
|
+
const metadata = (params.metadata ?? {});
|
|
137
|
+
const text = message?.parts?.map(p => p.text).filter(Boolean).join('\n') ?? '';
|
|
138
|
+
const parsed = parse_cliq_message(text);
|
|
139
|
+
const output_channels = (metadata.output_channels ?? []);
|
|
140
|
+
const record = {
|
|
141
|
+
id: task_id,
|
|
142
|
+
status: 'working',
|
|
143
|
+
artifacts: [],
|
|
144
|
+
};
|
|
145
|
+
tasks.set(task_id, record);
|
|
146
|
+
try {
|
|
147
|
+
const result = await execute({
|
|
148
|
+
role: parsed.role,
|
|
149
|
+
inputs: parsed.inputs,
|
|
150
|
+
metadata: {
|
|
151
|
+
...metadata,
|
|
152
|
+
req_spec: parsed.req_spec,
|
|
153
|
+
task_board: parsed.task_board,
|
|
154
|
+
output_channels,
|
|
155
|
+
},
|
|
156
|
+
progress: (msg) => {
|
|
157
|
+
record.summary = msg;
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
record.status = 'completed';
|
|
161
|
+
record.summary = result.summary;
|
|
162
|
+
record.artifacts = Object.entries(result.channels).map(([ch_name, ch_text]) => ({
|
|
163
|
+
name: ch_name,
|
|
164
|
+
parts: [{ type: 'text', text: ch_text }],
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
record.status = 'failed';
|
|
169
|
+
record.summary = err instanceof Error ? err.message : String(err);
|
|
170
|
+
}
|
|
171
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
172
|
+
res.end(JSON.stringify({
|
|
173
|
+
jsonrpc: '2.0',
|
|
174
|
+
id: rpc.id,
|
|
175
|
+
result: {
|
|
176
|
+
id: record.id,
|
|
177
|
+
status: {
|
|
178
|
+
state: record.status,
|
|
179
|
+
message: record.summary ? { parts: [{ text: record.summary }] } : undefined,
|
|
180
|
+
},
|
|
181
|
+
artifacts: record.artifacts,
|
|
182
|
+
},
|
|
183
|
+
}));
|
|
184
|
+
}
|
|
185
|
+
function handle_tasks_get(rpc, res) {
|
|
186
|
+
const task_id = rpc.params?.id ?? '';
|
|
187
|
+
const record = tasks.get(task_id);
|
|
188
|
+
if (!record) {
|
|
189
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
190
|
+
res.end(JSON.stringify({
|
|
191
|
+
jsonrpc: '2.0', id: rpc.id,
|
|
192
|
+
error: { code: -32000, message: `Task not found: ${task_id}` },
|
|
193
|
+
}));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
197
|
+
res.end(JSON.stringify({
|
|
198
|
+
jsonrpc: '2.0',
|
|
199
|
+
id: rpc.id,
|
|
200
|
+
result: {
|
|
201
|
+
id: record.id,
|
|
202
|
+
status: {
|
|
203
|
+
state: record.status,
|
|
204
|
+
message: record.summary ? { parts: [{ text: record.summary }] } : undefined,
|
|
205
|
+
},
|
|
206
|
+
artifacts: record.artifacts,
|
|
207
|
+
},
|
|
208
|
+
}));
|
|
209
|
+
}
|
|
210
|
+
function handle_tasks_cancel(rpc, res) {
|
|
211
|
+
const task_id = rpc.params?.id ?? '';
|
|
212
|
+
const record = tasks.get(task_id);
|
|
213
|
+
if (record && (record.status === 'submitted' || record.status === 'working')) {
|
|
214
|
+
record.status = 'canceled';
|
|
215
|
+
}
|
|
216
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
217
|
+
res.end(JSON.stringify({ jsonrpc: '2.0', id: rpc.id, result: {} }));
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
start() {
|
|
221
|
+
const listen_port = parse_port_argv(config_port);
|
|
222
|
+
return new Promise((resolve, reject) => {
|
|
223
|
+
server = http.createServer((req, res) => {
|
|
224
|
+
if (req.method === 'GET' && req.url === '/.well-known/agent.json') {
|
|
225
|
+
const addr = server.address();
|
|
226
|
+
const actual_port = typeof addr === 'object' && addr ? addr.port : listen_port;
|
|
227
|
+
handle_agent_card(res, actual_port);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (req.method === 'POST') {
|
|
231
|
+
handle_json_rpc(req, res).catch(() => {
|
|
232
|
+
res.writeHead(500, { 'Content-Type': 'application/json' });
|
|
233
|
+
res.end(JSON.stringify({ jsonrpc: '2.0', error: { code: -32603, message: 'Internal error' } }));
|
|
234
|
+
});
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
res.writeHead(404);
|
|
238
|
+
res.end('Not found');
|
|
239
|
+
});
|
|
240
|
+
server.listen(listen_port, () => {
|
|
241
|
+
const addr = server.address();
|
|
242
|
+
const actual_port = typeof addr === 'object' && addr ? addr.port : listen_port;
|
|
243
|
+
const url = `http://localhost:${actual_port}`;
|
|
244
|
+
resolve({ port: actual_port, url });
|
|
245
|
+
});
|
|
246
|
+
server.on('error', reject);
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
stop() {
|
|
250
|
+
return new Promise((resolve) => {
|
|
251
|
+
if (!server) {
|
|
252
|
+
resolve();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
server.close(() => resolve());
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAiD7B,uBAAuB;AAEvB,SAAS,gBAAgB,CAAC,IAAY,EAAE,WAAmB,EAAE,IAAY;IACxE,OAAO;QACN,IAAI;QACJ,WAAW;QACX,GAAG,EAAE,oBAAoB,IAAI,EAAE;QAC/B,OAAO,EAAE,OAAO;QAChB,YAAY,EAAE;YACb,SAAS,EAAE,KAAK;YAChB,iBAAiB,EAAE,KAAK;SACxB;QACD,MAAM,EAAE;YACP;gBACC,EAAE,EAAE,qBAAqB;gBACzB,IAAI,EAAE,qBAAqB;gBAC3B,WAAW,EAAE,kDAAkD;aAC/D;SACD;QACD,iBAAiB,EAAE,CAAC,MAAM,CAAC;QAC3B,kBAAkB,EAAE,CAAC,MAAM,CAAC;KAC5B,CAAC;AACH,CAAC;AAGD,2BAA2B;AAE3B,kFAAkF;AAClF,SAAS,kBAAkB,CAAC,IAAY;IAE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IAAI,CAAC,MAAM,EAAE,CAAC;oBAAC,OAAO,EAAE,CAAC;oBAAC,OAAO;gBAAC,CAAC;gBACnC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cliq-a2a-runtime",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Lightweight SDK for building Cliq A2A phase agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"test": "vitest run"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"keywords": ["cliq", "a2a", "agent", "runtime", "pipeline"]
|
|
27
|
+
}
|