@praesidia/neurogent 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/dist/chunk-JBDXA3BS.js +214 -0
- package/dist/chunk-VPHKQCPP.js +49 -0
- package/dist/chunk-ZC65T52L.js +255 -0
- package/dist/chunk-ZTZVL6N5.js +108 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +519 -0
- package/dist/index-BW9fPh3v.d.ts +372 -0
- package/dist/index.d.ts +175 -0
- package/dist/index.js +385 -0
- package/dist/security/index.d.ts +2 -0
- package/dist/security/index.js +8 -0
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.js +889 -0
- package/examples/dev-trio-openai.yaml +42 -0
- package/examples/dev-trio.yaml +42 -0
- package/examples/full-team.yaml +170 -0
- package/examples/marketing-team.yaml +190 -0
- package/examples/solo-researcher.yaml +27 -0
- package/package.json +65 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents the fundamental A2A message types.
|
|
5
|
+
*/
|
|
6
|
+
interface A2AMessage {
|
|
7
|
+
jsonrpc: '2.0';
|
|
8
|
+
method: string;
|
|
9
|
+
params: Record<string, any>;
|
|
10
|
+
id?: string | number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Common roles for standard conversational tasks.
|
|
14
|
+
*/
|
|
15
|
+
type Role = 'user' | 'assistant' | 'system' | 'tool';
|
|
16
|
+
/**
|
|
17
|
+
* Message payload within the A2A specification.
|
|
18
|
+
*/
|
|
19
|
+
interface ConversationMessage {
|
|
20
|
+
role: Role;
|
|
21
|
+
content: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
tool_call_id?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A2A Standard Task states.
|
|
27
|
+
*/
|
|
28
|
+
type TaskState = 'PENDING' | 'WORKING' | 'COMPLETED' | 'FAILED' | 'CANCELLED' | 'ESCALATION_REQUIRED';
|
|
29
|
+
interface TaskStatus {
|
|
30
|
+
taskId: string;
|
|
31
|
+
state: TaskState;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
result?: any;
|
|
35
|
+
error?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Generic hook result used by ingress/egress guards.
|
|
39
|
+
*/
|
|
40
|
+
interface HookResult {
|
|
41
|
+
allowed: boolean;
|
|
42
|
+
reason?: string;
|
|
43
|
+
modifiedPayload?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Pluggable security/policy hook interface.
|
|
47
|
+
* Implement this to add ingress filtering, egress redaction,
|
|
48
|
+
* or tool-level authorization without coupling to any specific provider.
|
|
49
|
+
*/
|
|
50
|
+
interface AgentHook {
|
|
51
|
+
getPolicyHash(): string;
|
|
52
|
+
checkIngress(payload: string): Promise<HookResult>;
|
|
53
|
+
checkEgress(chunk: string): Promise<HookResult>;
|
|
54
|
+
checkTool(toolName: string): Promise<HookResult>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A2A AgentCard representation.
|
|
58
|
+
* Exposed at /.well-known/agent.json
|
|
59
|
+
*/
|
|
60
|
+
interface AgentCard {
|
|
61
|
+
name: string;
|
|
62
|
+
version: string;
|
|
63
|
+
description: string;
|
|
64
|
+
author: string;
|
|
65
|
+
license: string;
|
|
66
|
+
capabilities: string[];
|
|
67
|
+
tools?: Array<{
|
|
68
|
+
name: string;
|
|
69
|
+
description: string;
|
|
70
|
+
type?: string;
|
|
71
|
+
mcp_server?: string;
|
|
72
|
+
}>;
|
|
73
|
+
endpoints: {
|
|
74
|
+
message: string;
|
|
75
|
+
tasks: string;
|
|
76
|
+
};
|
|
77
|
+
sub_agents?: Array<{
|
|
78
|
+
name: string;
|
|
79
|
+
description: string;
|
|
80
|
+
endpoint: string;
|
|
81
|
+
}>;
|
|
82
|
+
'x-praesidia-policy-hash'?: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare const neuroAgentSchema: z.ZodObject<{
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
version: z.ZodString;
|
|
88
|
+
description: z.ZodString;
|
|
89
|
+
author: z.ZodString;
|
|
90
|
+
license: z.ZodString;
|
|
91
|
+
capabilities: z.ZodArray<z.ZodString, "many">;
|
|
92
|
+
model: z.ZodObject<{
|
|
93
|
+
provider: z.ZodString;
|
|
94
|
+
name: z.ZodString;
|
|
95
|
+
temperature: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
96
|
+
max_tokens: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
name: string;
|
|
99
|
+
provider: string;
|
|
100
|
+
temperature: number;
|
|
101
|
+
max_tokens: number;
|
|
102
|
+
}, {
|
|
103
|
+
name: string;
|
|
104
|
+
provider: string;
|
|
105
|
+
temperature?: number | undefined;
|
|
106
|
+
max_tokens?: number | undefined;
|
|
107
|
+
}>;
|
|
108
|
+
memory: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
109
|
+
type: z.ZodEnum<["conversation-buffer", "redis", "none"]>;
|
|
110
|
+
max_messages: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
type: "conversation-buffer" | "redis" | "none";
|
|
113
|
+
max_messages: number;
|
|
114
|
+
}, {
|
|
115
|
+
type: "conversation-buffer" | "redis" | "none";
|
|
116
|
+
max_messages?: number | undefined;
|
|
117
|
+
}>>>;
|
|
118
|
+
tools: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
119
|
+
name: z.ZodString;
|
|
120
|
+
description: z.ZodString;
|
|
121
|
+
type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["inline", "mcp"]>>>;
|
|
122
|
+
mcp_server: z.ZodOptional<z.ZodString>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
name: string;
|
|
125
|
+
description: string;
|
|
126
|
+
type: "inline" | "mcp";
|
|
127
|
+
mcp_server?: string | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
name: string;
|
|
130
|
+
description: string;
|
|
131
|
+
type?: "inline" | "mcp" | undefined;
|
|
132
|
+
mcp_server?: string | undefined;
|
|
133
|
+
}>, "many">>>;
|
|
134
|
+
praesidia: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
policy: z.ZodOptional<z.ZodString>;
|
|
136
|
+
enforce_on: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
enforce_on: string[];
|
|
139
|
+
policy?: string | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
policy?: string | undefined;
|
|
142
|
+
enforce_on?: string[] | undefined;
|
|
143
|
+
}>>;
|
|
144
|
+
sub_agents: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
description: z.ZodString;
|
|
147
|
+
endpoint: z.ZodString;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
endpoint: string;
|
|
152
|
+
}, {
|
|
153
|
+
name: string;
|
|
154
|
+
description: string;
|
|
155
|
+
endpoint: string;
|
|
156
|
+
}>, "many">>>;
|
|
157
|
+
auth: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
158
|
+
type: z.ZodEnum<["bearer", "none", "oauth2"]>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
type: "none" | "bearer" | "oauth2";
|
|
161
|
+
}, {
|
|
162
|
+
type: "none" | "bearer" | "oauth2";
|
|
163
|
+
}>>>;
|
|
164
|
+
endpoint: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
165
|
+
}, "strip", z.ZodTypeAny, {
|
|
166
|
+
name: string;
|
|
167
|
+
version: string;
|
|
168
|
+
description: string;
|
|
169
|
+
author: string;
|
|
170
|
+
license: string;
|
|
171
|
+
capabilities: string[];
|
|
172
|
+
model: {
|
|
173
|
+
name: string;
|
|
174
|
+
provider: string;
|
|
175
|
+
temperature: number;
|
|
176
|
+
max_tokens: number;
|
|
177
|
+
};
|
|
178
|
+
memory: {
|
|
179
|
+
type: "conversation-buffer" | "redis" | "none";
|
|
180
|
+
max_messages: number;
|
|
181
|
+
};
|
|
182
|
+
tools: {
|
|
183
|
+
name: string;
|
|
184
|
+
description: string;
|
|
185
|
+
type: "inline" | "mcp";
|
|
186
|
+
mcp_server?: string | undefined;
|
|
187
|
+
}[];
|
|
188
|
+
endpoint: string;
|
|
189
|
+
sub_agents: {
|
|
190
|
+
name: string;
|
|
191
|
+
description: string;
|
|
192
|
+
endpoint: string;
|
|
193
|
+
}[];
|
|
194
|
+
auth: {
|
|
195
|
+
type: "none" | "bearer" | "oauth2";
|
|
196
|
+
};
|
|
197
|
+
praesidia?: {
|
|
198
|
+
enforce_on: string[];
|
|
199
|
+
policy?: string | undefined;
|
|
200
|
+
} | undefined;
|
|
201
|
+
}, {
|
|
202
|
+
name: string;
|
|
203
|
+
version: string;
|
|
204
|
+
description: string;
|
|
205
|
+
author: string;
|
|
206
|
+
license: string;
|
|
207
|
+
capabilities: string[];
|
|
208
|
+
model: {
|
|
209
|
+
name: string;
|
|
210
|
+
provider: string;
|
|
211
|
+
temperature?: number | undefined;
|
|
212
|
+
max_tokens?: number | undefined;
|
|
213
|
+
};
|
|
214
|
+
memory?: {
|
|
215
|
+
type: "conversation-buffer" | "redis" | "none";
|
|
216
|
+
max_messages?: number | undefined;
|
|
217
|
+
} | undefined;
|
|
218
|
+
tools?: {
|
|
219
|
+
name: string;
|
|
220
|
+
description: string;
|
|
221
|
+
type?: "inline" | "mcp" | undefined;
|
|
222
|
+
mcp_server?: string | undefined;
|
|
223
|
+
}[] | undefined;
|
|
224
|
+
praesidia?: {
|
|
225
|
+
policy?: string | undefined;
|
|
226
|
+
enforce_on?: string[] | undefined;
|
|
227
|
+
} | undefined;
|
|
228
|
+
endpoint?: string | undefined;
|
|
229
|
+
sub_agents?: {
|
|
230
|
+
name: string;
|
|
231
|
+
description: string;
|
|
232
|
+
endpoint: string;
|
|
233
|
+
}[] | undefined;
|
|
234
|
+
auth?: {
|
|
235
|
+
type: "none" | "bearer" | "oauth2";
|
|
236
|
+
} | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
type NeuroAgentConfig = z.infer<typeof neuroAgentSchema>;
|
|
239
|
+
/**
|
|
240
|
+
* Parses raw YAML string into a validated NeuroAgentConfig
|
|
241
|
+
*/
|
|
242
|
+
declare function parseAgentConfig(yamlContent: string): NeuroAgentConfig;
|
|
243
|
+
/**
|
|
244
|
+
* Compiles a NeuroAgentConfig into a standard A2A AgentCard
|
|
245
|
+
*/
|
|
246
|
+
declare function compileToAgentCard(config: NeuroAgentConfig, praesidiaHash?: string): AgentCard;
|
|
247
|
+
|
|
248
|
+
declare const praesidiaPolicySchema: z.ZodObject<{
|
|
249
|
+
schema_version: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
250
|
+
enforcement: z.ZodDefault<z.ZodEnum<["strict", "permissive"]>>;
|
|
251
|
+
rules: z.ZodObject<{
|
|
252
|
+
ingress: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
253
|
+
rule: z.ZodString;
|
|
254
|
+
action: z.ZodEnum<["reject", "allow", "log"]>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
action: "reject" | "allow" | "log";
|
|
257
|
+
rule: string;
|
|
258
|
+
}, {
|
|
259
|
+
action: "reject" | "allow" | "log";
|
|
260
|
+
rule: string;
|
|
261
|
+
}>, "many">>>;
|
|
262
|
+
egress: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
263
|
+
rule: z.ZodString;
|
|
264
|
+
types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
265
|
+
action: z.ZodEnum<["modify", "reject", "allow"]>;
|
|
266
|
+
}, "strip", z.ZodTypeAny, {
|
|
267
|
+
action: "reject" | "allow" | "modify";
|
|
268
|
+
rule: string;
|
|
269
|
+
types?: string[] | undefined;
|
|
270
|
+
}, {
|
|
271
|
+
action: "reject" | "allow" | "modify";
|
|
272
|
+
rule: string;
|
|
273
|
+
types?: string[] | undefined;
|
|
274
|
+
}>, "many">>>;
|
|
275
|
+
tools: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
276
|
+
match: z.ZodString;
|
|
277
|
+
action: z.ZodEnum<["allow", "reject"]>;
|
|
278
|
+
require_human_approval: z.ZodOptional<z.ZodBoolean>;
|
|
279
|
+
}, "strip", z.ZodTypeAny, {
|
|
280
|
+
action: "reject" | "allow";
|
|
281
|
+
match: string;
|
|
282
|
+
require_human_approval?: boolean | undefined;
|
|
283
|
+
}, {
|
|
284
|
+
action: "reject" | "allow";
|
|
285
|
+
match: string;
|
|
286
|
+
require_human_approval?: boolean | undefined;
|
|
287
|
+
}>, "many">>>;
|
|
288
|
+
}, "strip", z.ZodTypeAny, {
|
|
289
|
+
tools: {
|
|
290
|
+
action: "reject" | "allow";
|
|
291
|
+
match: string;
|
|
292
|
+
require_human_approval?: boolean | undefined;
|
|
293
|
+
}[];
|
|
294
|
+
ingress: {
|
|
295
|
+
action: "reject" | "allow" | "log";
|
|
296
|
+
rule: string;
|
|
297
|
+
}[];
|
|
298
|
+
egress: {
|
|
299
|
+
action: "reject" | "allow" | "modify";
|
|
300
|
+
rule: string;
|
|
301
|
+
types?: string[] | undefined;
|
|
302
|
+
}[];
|
|
303
|
+
}, {
|
|
304
|
+
tools?: {
|
|
305
|
+
action: "reject" | "allow";
|
|
306
|
+
match: string;
|
|
307
|
+
require_human_approval?: boolean | undefined;
|
|
308
|
+
}[] | undefined;
|
|
309
|
+
ingress?: {
|
|
310
|
+
action: "reject" | "allow" | "log";
|
|
311
|
+
rule: string;
|
|
312
|
+
}[] | undefined;
|
|
313
|
+
egress?: {
|
|
314
|
+
action: "reject" | "allow" | "modify";
|
|
315
|
+
rule: string;
|
|
316
|
+
types?: string[] | undefined;
|
|
317
|
+
}[] | undefined;
|
|
318
|
+
}>;
|
|
319
|
+
}, "strip", z.ZodTypeAny, {
|
|
320
|
+
schema_version: string | number;
|
|
321
|
+
enforcement: "strict" | "permissive";
|
|
322
|
+
rules: {
|
|
323
|
+
tools: {
|
|
324
|
+
action: "reject" | "allow";
|
|
325
|
+
match: string;
|
|
326
|
+
require_human_approval?: boolean | undefined;
|
|
327
|
+
}[];
|
|
328
|
+
ingress: {
|
|
329
|
+
action: "reject" | "allow" | "log";
|
|
330
|
+
rule: string;
|
|
331
|
+
}[];
|
|
332
|
+
egress: {
|
|
333
|
+
action: "reject" | "allow" | "modify";
|
|
334
|
+
rule: string;
|
|
335
|
+
types?: string[] | undefined;
|
|
336
|
+
}[];
|
|
337
|
+
};
|
|
338
|
+
}, {
|
|
339
|
+
schema_version: string | number;
|
|
340
|
+
rules: {
|
|
341
|
+
tools?: {
|
|
342
|
+
action: "reject" | "allow";
|
|
343
|
+
match: string;
|
|
344
|
+
require_human_approval?: boolean | undefined;
|
|
345
|
+
}[] | undefined;
|
|
346
|
+
ingress?: {
|
|
347
|
+
action: "reject" | "allow" | "log";
|
|
348
|
+
rule: string;
|
|
349
|
+
}[] | undefined;
|
|
350
|
+
egress?: {
|
|
351
|
+
action: "reject" | "allow" | "modify";
|
|
352
|
+
rule: string;
|
|
353
|
+
types?: string[] | undefined;
|
|
354
|
+
}[] | undefined;
|
|
355
|
+
};
|
|
356
|
+
enforcement?: "strict" | "permissive" | undefined;
|
|
357
|
+
}>;
|
|
358
|
+
type PraesidiaPolicy = z.infer<typeof praesidiaPolicySchema>;
|
|
359
|
+
declare function parsePolicy(yamlContent: string): PraesidiaPolicy;
|
|
360
|
+
|
|
361
|
+
declare class PraesidiaHooks implements AgentHook {
|
|
362
|
+
private policy;
|
|
363
|
+
private isPermissive;
|
|
364
|
+
constructor(policy?: PraesidiaPolicy);
|
|
365
|
+
static withPolicy(filePath: string): PraesidiaHooks;
|
|
366
|
+
getPolicyHash(): string;
|
|
367
|
+
checkIngress(payload: string): Promise<HookResult>;
|
|
368
|
+
checkEgress(chunk: string): Promise<HookResult>;
|
|
369
|
+
checkTool(toolName: string): Promise<HookResult>;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export { type AgentHook as A, type ConversationMessage as C, type HookResult as H, type NeuroAgentConfig as N, PraesidiaHooks as P, type Role as R, type TaskState as T, type A2AMessage as a, type AgentCard as b, type PraesidiaPolicy as c, type TaskStatus as d, compileToAgentCard as e, parsePolicy as f, neuroAgentSchema as n, parseAgentConfig as p };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Hono } from 'hono';
|
|
2
|
+
import { serve } from '@hono/node-server';
|
|
3
|
+
import { C as ConversationMessage, A as AgentHook } from './index-BW9fPh3v.js';
|
|
4
|
+
export { a as A2AMessage, b as AgentCard, H as HookResult, N as NeuroAgentConfig, P as PraesidiaHooks, c as PraesidiaPolicy, R as Role, T as TaskState, d as TaskStatus, e as compileToAgentCard, n as neuroAgentSchema, p as parseAgentConfig, f as parsePolicy } from './index-BW9fPh3v.js';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
|
|
7
|
+
interface ToolConfig<T extends z.ZodTypeAny> {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
schema: T;
|
|
11
|
+
execute: (input: z.infer<T>) => Promise<any>;
|
|
12
|
+
}
|
|
13
|
+
declare class Tool<T extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
schema: T;
|
|
17
|
+
private executor;
|
|
18
|
+
constructor(config: ToolConfig<T>);
|
|
19
|
+
run(input: any): Promise<any>;
|
|
20
|
+
getSchemaDefinition(): any;
|
|
21
|
+
}
|
|
22
|
+
type ToolDef = Tool;
|
|
23
|
+
|
|
24
|
+
interface MemoryStore {
|
|
25
|
+
store(message: ConversationMessage): Promise<void>;
|
|
26
|
+
query(limit?: number): Promise<ConversationMessage[]>;
|
|
27
|
+
clear(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
declare class ConversationBufferMemory implements MemoryStore {
|
|
30
|
+
private messages;
|
|
31
|
+
private maxMessages;
|
|
32
|
+
constructor(maxMessages?: number);
|
|
33
|
+
store(message: ConversationMessage): Promise<void>;
|
|
34
|
+
query(limit?: number): Promise<ConversationMessage[]>;
|
|
35
|
+
clear(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
declare class LocalSemanticMemory implements MemoryStore {
|
|
38
|
+
private memoryId;
|
|
39
|
+
constructor(memoryId: string);
|
|
40
|
+
store(message: ConversationMessage): Promise<void>;
|
|
41
|
+
query(limit?: number): Promise<ConversationMessage[]>;
|
|
42
|
+
clear(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface AgentContext {
|
|
46
|
+
llm: {
|
|
47
|
+
execute: (msg: ConversationMessage, config: {
|
|
48
|
+
tools?: Tool[];
|
|
49
|
+
}) => AsyncIterable<string>;
|
|
50
|
+
};
|
|
51
|
+
tools: Tool[];
|
|
52
|
+
stream: {
|
|
53
|
+
write: (chunk: string) => Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
delegate: (subAgentName: string, task: string) => Promise<string>;
|
|
56
|
+
memory: MemoryStore;
|
|
57
|
+
}
|
|
58
|
+
interface AgentBuilderConfig {
|
|
59
|
+
config: string;
|
|
60
|
+
tools?: Tool[];
|
|
61
|
+
systemPrompt?: string | ((context: {
|
|
62
|
+
metadata?: Record<string, string>;
|
|
63
|
+
}) => string);
|
|
64
|
+
hooks?: AgentHook[];
|
|
65
|
+
onMessage?: (msg: ConversationMessage, ctx: AgentContext) => Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
declare class NeuroAgent {
|
|
68
|
+
private agentConfig;
|
|
69
|
+
private tools;
|
|
70
|
+
private hooks;
|
|
71
|
+
private onMessageHandler?;
|
|
72
|
+
private systemPromptSource;
|
|
73
|
+
private memoryStore;
|
|
74
|
+
private tasks;
|
|
75
|
+
private app;
|
|
76
|
+
private agentCard;
|
|
77
|
+
constructor(cfg: AgentBuilderConfig);
|
|
78
|
+
private setupRoutes;
|
|
79
|
+
private resolveSystemPrompt;
|
|
80
|
+
private resolveTools;
|
|
81
|
+
private buildContext;
|
|
82
|
+
private defaultStreamHandler;
|
|
83
|
+
private delegate;
|
|
84
|
+
start(port?: number): ReturnType<typeof serve>;
|
|
85
|
+
getApp(): Hono;
|
|
86
|
+
}
|
|
87
|
+
declare function createAgent(config: AgentBuilderConfig): NeuroAgent;
|
|
88
|
+
|
|
89
|
+
declare class MCPClient {
|
|
90
|
+
private client;
|
|
91
|
+
private transport;
|
|
92
|
+
private isConnected;
|
|
93
|
+
constructor(serverCommand: string, serverArgs: string[]);
|
|
94
|
+
connect(): Promise<void>;
|
|
95
|
+
fetchTools(): Promise<Tool<z.ZodTypeAny>[]>;
|
|
96
|
+
close(): Promise<void>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
type AgentId = string;
|
|
100
|
+
interface AgentModel {
|
|
101
|
+
provider: 'openai' | 'anthropic' | 'ollama';
|
|
102
|
+
name: string;
|
|
103
|
+
maxTokens?: number;
|
|
104
|
+
temperature?: number;
|
|
105
|
+
baseUrl?: string;
|
|
106
|
+
}
|
|
107
|
+
interface AgentDef {
|
|
108
|
+
id: AgentId;
|
|
109
|
+
name: string;
|
|
110
|
+
role: string;
|
|
111
|
+
emoji: string;
|
|
112
|
+
inkColor: string;
|
|
113
|
+
expertise: string[];
|
|
114
|
+
systemPrompt: string;
|
|
115
|
+
model?: AgentModel;
|
|
116
|
+
zeroClawUrl?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* ZeroClaw Runtime — Hono HTTP server that exposes a Neurogent agent
|
|
121
|
+
* as a persistent, A2A-compatible service.
|
|
122
|
+
*
|
|
123
|
+
* Each agent gets its own server on a dedicated port:
|
|
124
|
+
* GET /health — liveness probe
|
|
125
|
+
* GET /.well-known/agent.json — A2A AgentCard
|
|
126
|
+
* POST /webhook — receive task/message
|
|
127
|
+
* GET /a2a/tasks/:taskId — task status
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
interface ZeroClawInstance {
|
|
131
|
+
agent: AgentDef;
|
|
132
|
+
port: number;
|
|
133
|
+
url: string;
|
|
134
|
+
startedAt: string;
|
|
135
|
+
}
|
|
136
|
+
declare function createAgentServer(agent: AgentDef, port: number, globalModel?: AgentModel): {
|
|
137
|
+
start: () => Promise<ZeroClawInstance>;
|
|
138
|
+
stop: () => void;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* ZeroClaw Client — talks to running ZeroClaw agent servers.
|
|
143
|
+
* Used by the shell executor to route messages to persistent agents.
|
|
144
|
+
*/
|
|
145
|
+
interface ZeroClawRegistration {
|
|
146
|
+
agents: Array<{
|
|
147
|
+
id: string;
|
|
148
|
+
name: string;
|
|
149
|
+
url: string;
|
|
150
|
+
port: number;
|
|
151
|
+
pid?: number;
|
|
152
|
+
startedAt: string;
|
|
153
|
+
}>;
|
|
154
|
+
startedAt: string;
|
|
155
|
+
}
|
|
156
|
+
declare function loadRuntime(): ZeroClawRegistration | null;
|
|
157
|
+
declare function saveRuntime(reg: ZeroClawRegistration): void;
|
|
158
|
+
declare function clearRuntime(): void;
|
|
159
|
+
declare function getAgentUrl(agentId: string): string | null;
|
|
160
|
+
/**
|
|
161
|
+
* Health-checks a ZeroClaw instance.
|
|
162
|
+
*/
|
|
163
|
+
declare function pingAgent(url: string): Promise<{
|
|
164
|
+
alive: boolean;
|
|
165
|
+
agent?: string;
|
|
166
|
+
uptime?: number;
|
|
167
|
+
error?: string;
|
|
168
|
+
}>;
|
|
169
|
+
/**
|
|
170
|
+
* Send a message to a ZeroClaw agent and stream the response back.
|
|
171
|
+
* Falls back to non-streaming if the server doesn't support it.
|
|
172
|
+
*/
|
|
173
|
+
declare function sendMessage(url: string, message: string): AsyncGenerator<string>;
|
|
174
|
+
|
|
175
|
+
export { type AgentBuilderConfig, type AgentContext, AgentHook, ConversationBufferMemory, ConversationMessage, LocalSemanticMemory, MCPClient, type MemoryStore, NeuroAgent, Tool, type ToolConfig, type ToolDef, type ZeroClawInstance, type ZeroClawRegistration, clearRuntime, createAgent, createAgentServer, getAgentUrl, loadRuntime, pingAgent, saveRuntime, sendMessage };
|