eacn3 0.3.0 → 0.3.3
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/index.d.ts +1 -1
- package/dist/index.js +76 -8
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +197 -35
- package/dist/server.js.map +1 -1
- package/dist/src/a2a-server.d.ts +27 -0
- package/dist/src/a2a-server.js +146 -0
- package/dist/src/a2a-server.js.map +1 -0
- package/dist/src/models.d.ts +88 -4
- package/dist/src/models.js +23 -0
- package/dist/src/models.js.map +1 -1
- package/dist/src/network-client.d.ts +26 -2
- package/dist/src/network-client.js +16 -1
- package/dist/src/network-client.js.map +1 -1
- package/dist/src/state.d.ts +15 -1
- package/dist/src/state.js +50 -1
- package/dist/src/state.js.map +1 -1
- package/package.json +4 -2
- package/scripts/cli.cjs +199 -9
- package/scripts/postinstall.cjs +9 -3
- package/skills/eacn3-adjudicate-zh/SKILL.md +106 -0
- package/skills/eacn3-bid/SKILL.md +13 -3
- package/skills/eacn3-bid-zh/SKILL.md +108 -0
- package/skills/eacn3-bounty-zh/SKILL.md +98 -0
- package/skills/eacn3-browse-zh/SKILL.md +76 -0
- package/skills/eacn3-budget-zh/SKILL.md +95 -0
- package/skills/eacn3-clarify-zh/SKILL.md +56 -0
- package/skills/eacn3-collect-zh/SKILL.md +77 -0
- package/skills/eacn3-dashboard-zh/SKILL.md +103 -0
- package/skills/eacn3-delegate-zh/SKILL.md +136 -0
- package/skills/eacn3-execute-zh/SKILL.md +147 -0
- package/skills/eacn3-invite/SKILL.md +90 -0
- package/skills/eacn3-invite-zh/SKILL.md +90 -0
- package/skills/eacn3-join-zh/SKILL.md +54 -0
- package/skills/eacn3-leave-zh/SKILL.md +49 -0
- package/skills/eacn3-message/SKILL.md +67 -0
- package/skills/eacn3-message-zh/SKILL.md +67 -0
- package/skills/eacn3-register/SKILL.md +18 -2
- package/skills/eacn3-register-zh/SKILL.md +140 -0
- package/skills/eacn3-task/SKILL.md +4 -0
- package/skills/eacn3-task-zh/SKILL.md +143 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A2A HTTP server — receives direct messages from remote agents.
|
|
3
|
+
*
|
|
4
|
+
* Listens on a configurable port and accepts POST /agents/{agent_id}/events.
|
|
5
|
+
* Incoming messages are validated and pushed into the shared event buffer,
|
|
6
|
+
* identical to messages arriving via WebSocket.
|
|
7
|
+
*
|
|
8
|
+
* Lifecycle: started per-agent when a real url/port is provided at registration,
|
|
9
|
+
* stopped when the agent is unregistered.
|
|
10
|
+
*/
|
|
11
|
+
import { createServer } from "node:http";
|
|
12
|
+
import { getAgent, pushEvents } from "./state.js";
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Server state
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
let server = null;
|
|
17
|
+
let serverPort = 0;
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Request handling
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
function readBody(req) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const chunks = [];
|
|
24
|
+
req.on("data", (chunk) => chunks.push(chunk));
|
|
25
|
+
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf-8")));
|
|
26
|
+
req.on("error", reject);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function respond(res, status, body) {
|
|
30
|
+
res.writeHead(status, { "Content-Type": "application/json" });
|
|
31
|
+
res.end(JSON.stringify(body));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Route: POST /agents/{agent_id}/events
|
|
35
|
+
* Accepts a direct message and pushes it into the event queue.
|
|
36
|
+
*/
|
|
37
|
+
async function handleEventsPost(agentId, req, res) {
|
|
38
|
+
// Validate agent exists locally
|
|
39
|
+
if (!getAgent(agentId)) {
|
|
40
|
+
respond(res, 404, { error: `Agent ${agentId} not found on this server` });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// Parse body
|
|
44
|
+
let body;
|
|
45
|
+
try {
|
|
46
|
+
const raw = await readBody(req);
|
|
47
|
+
body = JSON.parse(raw);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
respond(res, 400, { error: "Invalid JSON body" });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Validate required fields
|
|
54
|
+
const from = body.from;
|
|
55
|
+
const content = body.content;
|
|
56
|
+
if (!from || content === undefined) {
|
|
57
|
+
respond(res, 400, { error: "Missing required fields: from, content" });
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// Push into event queue (same path as WebSocket messages)
|
|
61
|
+
const event = {
|
|
62
|
+
type: "direct_message",
|
|
63
|
+
task_id: "",
|
|
64
|
+
payload: { from, content, agent_id: agentId },
|
|
65
|
+
received_at: Date.now(),
|
|
66
|
+
};
|
|
67
|
+
pushEvents([event]);
|
|
68
|
+
respond(res, 200, { ok: true, agent_id: agentId });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Main request handler — route dispatch.
|
|
72
|
+
*/
|
|
73
|
+
async function handleRequest(req, res) {
|
|
74
|
+
const url = req.url ?? "";
|
|
75
|
+
const method = req.method ?? "";
|
|
76
|
+
// Route: POST /agents/{agent_id}/events
|
|
77
|
+
const match = url.match(/^\/agents\/([^/]+)\/events\/?$/);
|
|
78
|
+
if (match && method === "POST") {
|
|
79
|
+
await handleEventsPost(match[1], req, res);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// Health check
|
|
83
|
+
if (url === "/health" && method === "GET") {
|
|
84
|
+
respond(res, 200, { status: "ok" });
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
respond(res, 404, { error: "Not found" });
|
|
88
|
+
}
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Public API
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
/**
|
|
93
|
+
* Start the A2A HTTP server on the given port.
|
|
94
|
+
* Returns the actual port (useful if 0 was passed for auto-assign).
|
|
95
|
+
*/
|
|
96
|
+
export function startServer(port) {
|
|
97
|
+
return new Promise((resolve, reject) => {
|
|
98
|
+
if (server) {
|
|
99
|
+
resolve(serverPort);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
server = createServer((req, res) => {
|
|
103
|
+
handleRequest(req, res).catch(() => {
|
|
104
|
+
respond(res, 500, { error: "Internal server error" });
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
server.listen(port, () => {
|
|
108
|
+
const addr = server.address();
|
|
109
|
+
serverPort = typeof addr === "object" && addr ? addr.port : port;
|
|
110
|
+
resolve(serverPort);
|
|
111
|
+
});
|
|
112
|
+
server.on("error", (err) => {
|
|
113
|
+
server = null;
|
|
114
|
+
reject(err);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Stop the A2A HTTP server.
|
|
120
|
+
*/
|
|
121
|
+
export function stopServer() {
|
|
122
|
+
return new Promise((resolve) => {
|
|
123
|
+
if (!server) {
|
|
124
|
+
resolve();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
server.close(() => {
|
|
128
|
+
server = null;
|
|
129
|
+
serverPort = 0;
|
|
130
|
+
resolve();
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Get the port the server is listening on (0 if not started).
|
|
136
|
+
*/
|
|
137
|
+
export function getServerPort() {
|
|
138
|
+
return serverPort;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Check if the A2A server is running.
|
|
142
|
+
*/
|
|
143
|
+
export function isRunning() {
|
|
144
|
+
return server !== null;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=a2a-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a-server.js","sourceRoot":"","sources":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,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;YACjE,OAAO,CAAC,UAAU,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACzB,MAAM,GAAG,IAAI,CAAC;YACd,MAAM,CAAC,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YAChB,MAAM,GAAG,IAAI,CAAC;YACd,UAAU,GAAG,CAAC,CAAC;YACf,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,MAAM,KAAK,IAAI,CAAC;AACzB,CAAC"}
|
package/dist/src/models.d.ts
CHANGED
|
@@ -27,6 +27,22 @@ export interface AgentSkill {
|
|
|
27
27
|
/** Schema or hints describing the inputs the skill accepts; structure is skill-specific. */
|
|
28
28
|
parameters?: Record<string, unknown>;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Agent capability tier — determines which task levels the agent can bid on.
|
|
32
|
+
*
|
|
33
|
+
* - `"general"` — General-purpose agent, can bid on any task level.
|
|
34
|
+
* - `"expert"` — Domain expert, can bid on expert, expert_general, and tool tasks.
|
|
35
|
+
* - `"expert_general"` — Generalist within an expert domain, can bid on expert_general and tool tasks.
|
|
36
|
+
* - `"tool"` — Single-purpose tool wrapper, can ONLY bid on tool-level tasks.
|
|
37
|
+
*
|
|
38
|
+
* Tier hierarchy (higher can accept lower):
|
|
39
|
+
* general > expert > expert_general > tool
|
|
40
|
+
*/
|
|
41
|
+
export type AgentTier = "general" | "expert" | "expert_general" | "tool";
|
|
42
|
+
/**
|
|
43
|
+
* Ordered tier hierarchy for comparison. Lower index = higher tier.
|
|
44
|
+
*/
|
|
45
|
+
export declare const AGENT_TIER_HIERARCHY: AgentTier[];
|
|
30
46
|
/** Concurrency limits for an agent's task execution. */
|
|
31
47
|
export interface AgentCapabilities {
|
|
32
48
|
/** Maximum number of tasks this agent can execute simultaneously. */
|
|
@@ -42,6 +58,8 @@ export interface AgentCard {
|
|
|
42
58
|
name: string;
|
|
43
59
|
/** Role: "executor" does work, "planner" orchestrates/delegates via subtasks. */
|
|
44
60
|
agent_type: "executor" | "planner";
|
|
61
|
+
/** Capability tier: general > expert > expert_general > tool. Determines which task levels the agent can bid on. Defaults to "general". */
|
|
62
|
+
tier: AgentTier;
|
|
45
63
|
/** Capability tags used for task routing (e.g. "translation", "python-coding"). Only matching broadcasts are received. */
|
|
46
64
|
domains: string[];
|
|
47
65
|
/** List of discrete skills this agent advertises. */
|
|
@@ -85,10 +103,11 @@ export interface TaskContent {
|
|
|
85
103
|
}>;
|
|
86
104
|
}
|
|
87
105
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
106
|
+
* Permission toggle for executor to contact a human.
|
|
107
|
+
* Agents cannot contact humans by default. The task initiator sets this
|
|
108
|
+
* field at creation, authorizing the assigned executor to contact a
|
|
109
|
+
* designated human when needed.
|
|
110
|
+
* After timeout_s the executor should decide on its own.
|
|
92
111
|
*/
|
|
93
112
|
export interface HumanContact {
|
|
94
113
|
/** Whether the executor is permitted to contact a human for guidance. */
|
|
@@ -113,6 +132,19 @@ export type TaskStatus = "unclaimed" | "bidding" | "awaiting_retrieval" | "compl
|
|
|
113
132
|
* - `"adjudication"` — A meta-task to judge/evaluate results of another task.
|
|
114
133
|
*/
|
|
115
134
|
export type TaskType = "normal" | "adjudication";
|
|
135
|
+
/**
|
|
136
|
+
* Task complexity level — matches against AgentTier for bid admission.
|
|
137
|
+
*
|
|
138
|
+
* - `"general"` — Open to all agent tiers.
|
|
139
|
+
* - `"expert"` — Requires expert-tier or higher.
|
|
140
|
+
* - `"expert_general"` — Requires expert_general-tier or higher.
|
|
141
|
+
* - `"tool"` — Simple tool-level task, open to all tiers including tool-only agents.
|
|
142
|
+
*
|
|
143
|
+
* Tier filtering rule:
|
|
144
|
+
* An agent can bid if its tier index <= task level index in AGENT_TIER_HIERARCHY,
|
|
145
|
+
* EXCEPT tool-tier agents can ONLY bid on tool-level tasks.
|
|
146
|
+
*/
|
|
147
|
+
export type TaskLevel = "general" | "expert" | "expert_general" | "tool";
|
|
116
148
|
/** A unit of work on the EACN3 network. Created by eacn3_create_task or eacn3_create_subtask. */
|
|
117
149
|
export interface Task {
|
|
118
150
|
/** Unique task identifier (e.g. "t-abc123"). */
|
|
@@ -121,6 +153,8 @@ export interface Task {
|
|
|
121
153
|
status: TaskStatus;
|
|
122
154
|
/** Whether this is a regular task or an adjudication (judging) task. */
|
|
123
155
|
type: TaskType;
|
|
156
|
+
/** Complexity level — determines which agent tiers can bid. Defaults to "general". */
|
|
157
|
+
level: TaskLevel;
|
|
124
158
|
/** Agent ID of the task creator. Budget is frozen from this agent's balance. */
|
|
125
159
|
initiator_id: string;
|
|
126
160
|
/** Server that hosts the initiator; may be absent for cross-network tasks. */
|
|
@@ -151,6 +185,14 @@ export interface Task {
|
|
|
151
185
|
budget_locked: boolean;
|
|
152
186
|
/** Permission for executors to contact a human; absent means human contact is not allowed. */
|
|
153
187
|
human_contact?: HumanContact;
|
|
188
|
+
/**
|
|
189
|
+
* Agent IDs that bypass bid admission filtering (confidence×reputation threshold).
|
|
190
|
+
* These agents are directly approved when they bid — the publisher's explicit choice.
|
|
191
|
+
* Domain matching still applies for broadcast routing, but invited agents can bid
|
|
192
|
+
* even if they don't match domains (they just won't receive the broadcast automatically).
|
|
193
|
+
* Optional; defaults to [] for tasks created without invitations or legacy tasks from the network.
|
|
194
|
+
*/
|
|
195
|
+
invited_agent_ids?: string[];
|
|
154
196
|
/** ISO 8601 timestamp of task creation; set by the server. */
|
|
155
197
|
created_at?: string;
|
|
156
198
|
}
|
|
@@ -358,6 +400,26 @@ export interface LocalTaskInfo {
|
|
|
358
400
|
/** ISO 8601 timestamp when the task was created. */
|
|
359
401
|
created_at: string;
|
|
360
402
|
}
|
|
403
|
+
/** A single direct message between two agents. */
|
|
404
|
+
export interface DirectMessage {
|
|
405
|
+
/** Sender agent ID. */
|
|
406
|
+
from: string;
|
|
407
|
+
/** Receiver agent ID. */
|
|
408
|
+
to: string;
|
|
409
|
+
/** Message content (text). */
|
|
410
|
+
content: string;
|
|
411
|
+
/** Unix timestamp in milliseconds. */
|
|
412
|
+
timestamp: number;
|
|
413
|
+
/** Direction relative to the local agent: "in" = received, "out" = sent. */
|
|
414
|
+
direction: "in" | "out";
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Session key: `${local_agent_id}:${peer_agent_id}`.
|
|
418
|
+
* Each session stores the conversation between a local agent and a remote peer.
|
|
419
|
+
*/
|
|
420
|
+
export type SessionKey = string;
|
|
421
|
+
/** Maximum messages per session to prevent unbounded growth. */
|
|
422
|
+
export declare const MAX_MESSAGES_PER_SESSION = 100;
|
|
361
423
|
/** Plugin-local state. Holds all in-memory data for the current session; reset on disconnect. */
|
|
362
424
|
export interface EacnState {
|
|
363
425
|
/** Server identity; null before eacn3_connect is called. */
|
|
@@ -372,9 +434,31 @@ export interface EacnState {
|
|
|
372
434
|
reputation_cache: Record<string, number>;
|
|
373
435
|
/** Buffered WebSocket events not yet consumed. Drained by eacn3_get_events(). */
|
|
374
436
|
pending_events: PushEvent[];
|
|
437
|
+
/** Active message sessions keyed by "local_agent_id:peer_agent_id". */
|
|
438
|
+
active_sessions: Record<SessionKey, DirectMessage[]>;
|
|
375
439
|
}
|
|
376
440
|
/**
|
|
377
441
|
* Default network endpoint. Override with EACN3_NETWORK_URL env var.
|
|
378
442
|
*/
|
|
379
443
|
export declare const EACN3_DEFAULT_NETWORK_ENDPOINT: string;
|
|
380
444
|
export declare function createDefaultState(networkEndpoint?: string): EacnState;
|
|
445
|
+
/**
|
|
446
|
+
* Check whether an agent tier is eligible to bid on a task level.
|
|
447
|
+
*
|
|
448
|
+
* Rule: tool-tier agents can ONLY bid on tool-level tasks.
|
|
449
|
+
* All other tiers (general, expert, expert_general) can bid on ANY task level.
|
|
450
|
+
* The tier is a self-declaration of specialization breadth, not a hard gate —
|
|
451
|
+
* an expert should still be able to take general tasks.
|
|
452
|
+
*/
|
|
453
|
+
export declare function isTierEligible(agentTier: AgentTier, taskLevel: TaskLevel): boolean;
|
|
454
|
+
/** Response from eacn3_invite_agent. Confirms the agent was added to the invite list. */
|
|
455
|
+
export interface InviteAgentResponse {
|
|
456
|
+
/** Whether the invitation was recorded. */
|
|
457
|
+
ok: boolean;
|
|
458
|
+
/** The task the agent was invited to. */
|
|
459
|
+
task_id: string;
|
|
460
|
+
/** The agent that was invited. */
|
|
461
|
+
agent_id: string;
|
|
462
|
+
/** Status message. */
|
|
463
|
+
message: string;
|
|
464
|
+
}
|
package/dist/src/models.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* EACN3 data models — TypeScript interfaces matching network-api.md structures.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Ordered tier hierarchy for comparison. Lower index = higher tier.
|
|
6
|
+
*/
|
|
7
|
+
export const AGENT_TIER_HIERARCHY = ["general", "expert", "expert_general", "tool"];
|
|
8
|
+
/** Maximum messages per session to prevent unbounded growth. */
|
|
9
|
+
export const MAX_MESSAGES_PER_SESSION = 100;
|
|
4
10
|
/**
|
|
5
11
|
* Default network endpoint. Override with EACN3_NETWORK_URL env var.
|
|
6
12
|
*/
|
|
@@ -13,6 +19,23 @@ export function createDefaultState(networkEndpoint) {
|
|
|
13
19
|
local_tasks: {},
|
|
14
20
|
reputation_cache: {},
|
|
15
21
|
pending_events: [],
|
|
22
|
+
active_sessions: {},
|
|
16
23
|
};
|
|
17
24
|
}
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
// Tier / Level Helpers
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
/**
|
|
29
|
+
* Check whether an agent tier is eligible to bid on a task level.
|
|
30
|
+
*
|
|
31
|
+
* Rule: tool-tier agents can ONLY bid on tool-level tasks.
|
|
32
|
+
* All other tiers (general, expert, expert_general) can bid on ANY task level.
|
|
33
|
+
* The tier is a self-declaration of specialization breadth, not a hard gate —
|
|
34
|
+
* an expert should still be able to take general tasks.
|
|
35
|
+
*/
|
|
36
|
+
export function isTierEligible(agentTier, taskLevel) {
|
|
37
|
+
if (agentTier === "tool")
|
|
38
|
+
return taskLevel === "tool";
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
18
41
|
//# sourceMappingURL=models.js.map
|
package/dist/src/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AAmDH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAucjG,gEAAgE;AAChE,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAoB5C;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,2BAA2B,CAAC;AAE/D,MAAM,UAAU,kBAAkB,CAAC,eAAwB;IACzD,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,gBAAgB,EAAE,eAAe,IAAI,8BAA8B;QACnE,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,EAAE;QAClB,eAAe,EAAE,EAAE;KACpB,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,SAAoB,EAAE,SAAoB;IACvE,IAAI,SAAS,KAAK,MAAM;QAAE,OAAO,SAAS,KAAK,MAAM,CAAC;IACtD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each method maps 1:1 to a network-api.md endpoint.
|
|
5
5
|
* server_id is injected from local state — callers don't need to pass it.
|
|
6
6
|
*/
|
|
7
|
-
import { type ServerCard, type AgentCard, type Task, type ReputationScore, type RegisterServerResponse, type RegisterAgentResponse, type BidResponse, type DiscoverResponse, type TaskResultsResponse, type BalanceResponse, type DepositResponse, type ClusterStatus, type HealthResponse } from "./models.js";
|
|
7
|
+
import { type ServerCard, type AgentCard, type Task, type ReputationScore, type RegisterServerResponse, type RegisterAgentResponse, type BidResponse, type DiscoverResponse, type TaskResultsResponse, type BalanceResponse, type DepositResponse, type ClusterStatus, type HealthResponse, type InviteAgentResponse, type TaskLevel } from "./models.js";
|
|
8
8
|
/**
|
|
9
9
|
* Probe a network endpoint for health. Uses a short timeout so it can be
|
|
10
10
|
* used for fast fail-over. If `endpoint` is omitted, probes the current
|
|
@@ -68,6 +68,8 @@ export declare function createTask(task: {
|
|
|
68
68
|
contact_id?: string;
|
|
69
69
|
timeout_s?: number;
|
|
70
70
|
};
|
|
71
|
+
level?: TaskLevel;
|
|
72
|
+
invited_agent_ids?: string[];
|
|
71
73
|
}): Promise<Task>;
|
|
72
74
|
export declare function getOpenTasks(opts?: {
|
|
73
75
|
domains?: string;
|
|
@@ -105,8 +107,30 @@ export declare function rejectTask(taskId: string, agentId: string, reason?: str
|
|
|
105
107
|
}>;
|
|
106
108
|
export declare function createSubtask(parentTaskId: string, initiatorId: string, content: {
|
|
107
109
|
description: string;
|
|
108
|
-
}, domains: string[], budget: number, deadline?: string): Promise<Task>;
|
|
110
|
+
}, domains: string[], budget: number, deadline?: string, level?: string): Promise<Task>;
|
|
109
111
|
export declare function reportEvent(agentId: string, eventType: string): Promise<ReputationScore>;
|
|
110
112
|
export declare function getReputation(agentId: string): Promise<ReputationScore>;
|
|
111
113
|
export declare function getBalance(agentId: string): Promise<BalanceResponse>;
|
|
112
114
|
export declare function deposit(agentId: string, amount: number): Promise<DepositResponse>;
|
|
115
|
+
export declare function inviteAgent(taskId: string, initiatorId: string, agentId: string): Promise<InviteAgentResponse>;
|
|
116
|
+
export interface RelayMessagePayload {
|
|
117
|
+
to: {
|
|
118
|
+
network_id: string;
|
|
119
|
+
server_id: string;
|
|
120
|
+
agent_id: string;
|
|
121
|
+
};
|
|
122
|
+
from: {
|
|
123
|
+
network_id: string;
|
|
124
|
+
server_id: string;
|
|
125
|
+
agent_id: string;
|
|
126
|
+
};
|
|
127
|
+
content: unknown;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Send a direct message via Network relay.
|
|
131
|
+
* The Network node routes by three-layer addressing and delivers via WebSocket.
|
|
132
|
+
*/
|
|
133
|
+
export declare function relayMessage(msg: RelayMessagePayload): Promise<{
|
|
134
|
+
ok: boolean;
|
|
135
|
+
delivered: number;
|
|
136
|
+
}>;
|
|
@@ -264,7 +264,7 @@ export async function rejectTask(taskId, agentId, reason) {
|
|
|
264
264
|
body.reason = reason;
|
|
265
265
|
return request("POST", `/api/tasks/${taskId}/reject`, body);
|
|
266
266
|
}
|
|
267
|
-
export async function createSubtask(parentTaskId, initiatorId, content, domains, budget, deadline) {
|
|
267
|
+
export async function createSubtask(parentTaskId, initiatorId, content, domains, budget, deadline, level) {
|
|
268
268
|
const body = {
|
|
269
269
|
initiator_id: initiatorId,
|
|
270
270
|
content,
|
|
@@ -273,6 +273,8 @@ export async function createSubtask(parentTaskId, initiatorId, content, domains,
|
|
|
273
273
|
};
|
|
274
274
|
if (deadline)
|
|
275
275
|
body.deadline = deadline;
|
|
276
|
+
if (level)
|
|
277
|
+
body.level = level;
|
|
276
278
|
return request("POST", `/api/tasks/${parentTaskId}/subtask`, body);
|
|
277
279
|
}
|
|
278
280
|
// ---------------------------------------------------------------------------
|
|
@@ -297,4 +299,17 @@ export async function getBalance(agentId) {
|
|
|
297
299
|
export async function deposit(agentId, amount) {
|
|
298
300
|
return request("POST", `/api/economy/deposit`, { agent_id: agentId, amount });
|
|
299
301
|
}
|
|
302
|
+
// ---------------------------------------------------------------------------
|
|
303
|
+
// Tasks — Invite (1)
|
|
304
|
+
// ---------------------------------------------------------------------------
|
|
305
|
+
export async function inviteAgent(taskId, initiatorId, agentId) {
|
|
306
|
+
return request("POST", `/api/tasks/${taskId}/invite`, { initiator_id: initiatorId, agent_id: agentId });
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Send a direct message via Network relay.
|
|
310
|
+
* The Network node routes by three-layer addressing and delivers via WebSocket.
|
|
311
|
+
*/
|
|
312
|
+
export async function relayMessage(msg) {
|
|
313
|
+
return request("POST", "/api/messages", msg);
|
|
314
|
+
}
|
|
300
315
|
//# sourceMappingURL=network-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-client.js","sourceRoot":"","sources":["../../src/network-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"network-client.js","sourceRoot":"","sources":["../../src/network-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnD,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,SAAS,OAAO;IACd,OAAO,QAAQ,EAAE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ads/writes ~/.eacn3/state.json.
|
|
3
3
|
*/
|
|
4
|
-
import { type EacnState, type AgentCard, type LocalTaskInfo, type PushEvent } from "./models.js";
|
|
4
|
+
import { type EacnState, type AgentCard, type LocalTaskInfo, type PushEvent, type DirectMessage } from "./models.js";
|
|
5
5
|
/**
|
|
6
6
|
* Load state from disk. Creates default if not exists.
|
|
7
7
|
*/
|
|
@@ -31,3 +31,17 @@ export declare function drainEvents(): PushEvent[];
|
|
|
31
31
|
export declare function updateReputationCache(agentId: string, score: number): void;
|
|
32
32
|
export declare function isConnected(): boolean;
|
|
33
33
|
export declare function getServerId(): string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Add a message to a session. Creates the session if it doesn't exist.
|
|
36
|
+
* Trims to MAX_MESSAGES_PER_SESSION, dropping oldest messages.
|
|
37
|
+
*/
|
|
38
|
+
export declare function addMessage(localAgentId: string, msg: DirectMessage): void;
|
|
39
|
+
/**
|
|
40
|
+
* Get all messages in a session between a local agent and a peer.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getMessages(localAgentId: string, peerAgentId: string): DirectMessage[];
|
|
43
|
+
/**
|
|
44
|
+
* List all active session keys for a local agent.
|
|
45
|
+
* Returns peer agent IDs.
|
|
46
|
+
*/
|
|
47
|
+
export declare function listSessions(localAgentId: string): string[];
|
package/dist/src/state.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
|
-
import { createDefaultState } from "./models.js";
|
|
7
|
+
import { MAX_MESSAGES_PER_SESSION, createDefaultState } from "./models.js";
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
9
9
|
// Paths
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
@@ -110,4 +110,53 @@ export function isConnected() {
|
|
|
110
110
|
export function getServerId() {
|
|
111
111
|
return getState().server_card?.server_id ?? null;
|
|
112
112
|
}
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// Message sessions
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
function sessionKey(localAgentId, peerAgentId) {
|
|
117
|
+
return `${localAgentId}:${peerAgentId}`;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Add a message to a session. Creates the session if it doesn't exist.
|
|
121
|
+
* Trims to MAX_MESSAGES_PER_SESSION, dropping oldest messages.
|
|
122
|
+
*/
|
|
123
|
+
export function addMessage(localAgentId, msg) {
|
|
124
|
+
const s = getState();
|
|
125
|
+
// Ensure active_sessions exists (backward compat with old state files)
|
|
126
|
+
if (!s.active_sessions)
|
|
127
|
+
s.active_sessions = {};
|
|
128
|
+
const peerId = msg.direction === "in" ? msg.from : msg.to;
|
|
129
|
+
const key = sessionKey(localAgentId, peerId);
|
|
130
|
+
if (!s.active_sessions[key]) {
|
|
131
|
+
s.active_sessions[key] = [];
|
|
132
|
+
}
|
|
133
|
+
s.active_sessions[key].push(msg);
|
|
134
|
+
// Trim oldest if over limit
|
|
135
|
+
if (s.active_sessions[key].length > MAX_MESSAGES_PER_SESSION) {
|
|
136
|
+
s.active_sessions[key] = s.active_sessions[key].slice(-MAX_MESSAGES_PER_SESSION);
|
|
137
|
+
}
|
|
138
|
+
save();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get all messages in a session between a local agent and a peer.
|
|
142
|
+
*/
|
|
143
|
+
export function getMessages(localAgentId, peerAgentId) {
|
|
144
|
+
const s = getState();
|
|
145
|
+
if (!s.active_sessions)
|
|
146
|
+
return [];
|
|
147
|
+
return s.active_sessions[sessionKey(localAgentId, peerAgentId)] ?? [];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* List all active session keys for a local agent.
|
|
151
|
+
* Returns peer agent IDs.
|
|
152
|
+
*/
|
|
153
|
+
export function listSessions(localAgentId) {
|
|
154
|
+
const s = getState();
|
|
155
|
+
if (!s.active_sessions)
|
|
156
|
+
return [];
|
|
157
|
+
const prefix = `${localAgentId}:`;
|
|
158
|
+
return Object.keys(s.active_sessions)
|
|
159
|
+
.filter((k) => k.startsWith(prefix))
|
|
160
|
+
.map((k) => k.slice(prefix.length));
|
|
161
|
+
}
|
|
113
162
|
//# sourceMappingURL=state.js.map
|
package/dist/src/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAA2G,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEpL,8EAA8E;AAC9E,QAAQ;AACR,8EAA8E;AAE9E,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC3E,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAEjD,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E;AAE9E,IAAI,KAAK,GAAqB,IAAI,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,IAAI;IAClB,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,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AAE,CAAC;AACT,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,YAAoB,EAAE,WAAmB;IACnE,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;IACrB,IAAI,CAAC,CAAC,CAAC,eAAe;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;AACxE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,YAAoB;IAC/C,MAAM,CAAC,GAAG,QAAQ,EAAE,CAAC;IACrB,IAAI,CAAC,CAAC,CAAC,eAAe;QAAE,OAAO,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG,GAAG,YAAY,GAAG,CAAC;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eacn3",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "EACN3 network plugin — your digital network card for agent collaboration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
"type": "module",
|
|
21
21
|
"main": "dist/index.js",
|
|
22
22
|
"openclaw": {
|
|
23
|
-
"extensions": [
|
|
23
|
+
"extensions": [
|
|
24
|
+
"./dist/index.js"
|
|
25
|
+
]
|
|
24
26
|
},
|
|
25
27
|
"bin": {
|
|
26
28
|
"eacn3": "scripts/cli.cjs"
|