@perkos/perkos-a2a 0.8.35 → 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 +99 -21
- package/dist/agent.d.ts +14 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +363 -0
- package/dist/agent.js.map +1 -0
- package/dist/hermes-cli.d.ts +30 -0
- package/dist/hermes-cli.d.ts.map +1 -0
- package/dist/hermes-cli.js +120 -0
- package/dist/hermes-cli.js.map +1 -0
- package/dist/hermes-plugin.d.ts +91 -0
- package/dist/hermes-plugin.d.ts.map +1 -0
- package/dist/hermes-plugin.js +196 -0
- package/dist/hermes-plugin.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1022 -26
- package/dist/index.js.map +4 -4
- package/dist/types.d.ts +36 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/docs/chat-client.md +190 -0
- package/docs/demo-setup.md +273 -0
- package/openclaw.plugin.json +38 -1
- package/package.json +33 -1
- package/scripts/hermes/install.mjs +211 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* perkos-a2a-hermes — opinionated CLI wrapper for Hermes deployments.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the OpenClaw "install one plugin, run it" ergonomics for
|
|
6
|
+
* Hermes users: presets the runtime to `hermes-api`, picks up the
|
|
7
|
+
* Hermes API URL/token/endpoint from the common env var names, and
|
|
8
|
+
* boots the same A2A bridge as `perkos-a2a-agent` — without requiring
|
|
9
|
+
* the operator to remember the runtime-specific flags.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* perkos-a2a-hermes \
|
|
13
|
+
* --agent-name Apollo \
|
|
14
|
+
* --relay-url wss://transport.perkos.xyz/a2a \
|
|
15
|
+
* --relay-key "$A2A_RELAY_API_KEY"
|
|
16
|
+
*
|
|
17
|
+
* Env vars consulted (precedence: flags > env):
|
|
18
|
+
* A2A_AGENT_NAME agent name
|
|
19
|
+
* A2A_PORT local A2A port (default 5060)
|
|
20
|
+
* A2A_BIND_HOST bind host (default 0.0.0.0)
|
|
21
|
+
* A2A_PUBLIC_URL advertised base URL
|
|
22
|
+
* A2A_RELAY_URL transport WS URL
|
|
23
|
+
* A2A_RELAY_API_KEY transport relay API key
|
|
24
|
+
* HERMES_API_URL Hermes API base URL (default http://127.0.0.1:8642)
|
|
25
|
+
* HERMES_API_ENDPOINT Hermes API endpoint (default /v1/responses)
|
|
26
|
+
* HERMES_API_KEY Hermes API bearer token
|
|
27
|
+
* A2A_HERMES_SESSION Hermes session key (default a2a)
|
|
28
|
+
*/
|
|
29
|
+
import { createHermesPlugin } from "./hermes-plugin.js";
|
|
30
|
+
function argValue(flag) {
|
|
31
|
+
const idx = process.argv.indexOf(flag);
|
|
32
|
+
if (idx === -1)
|
|
33
|
+
return undefined;
|
|
34
|
+
return process.argv[idx + 1];
|
|
35
|
+
}
|
|
36
|
+
function hasFlag(flag) {
|
|
37
|
+
return process.argv.includes(flag);
|
|
38
|
+
}
|
|
39
|
+
function printHelp() {
|
|
40
|
+
console.log(`perkos-a2a-hermes — A2A bridge with Hermes API delivery preset.
|
|
41
|
+
|
|
42
|
+
Required:
|
|
43
|
+
--agent-name <name> Or A2A_AGENT_NAME
|
|
44
|
+
|
|
45
|
+
Common flags:
|
|
46
|
+
--port <n> A2A HTTP port (default 5060)
|
|
47
|
+
--bind-host <host> 0.0.0.0 (default) or 127.0.0.1
|
|
48
|
+
--public-url <url> Advertised base URL
|
|
49
|
+
--relay-url <wss> Transport relay URL (A2A_RELAY_URL)
|
|
50
|
+
--relay-key <key> Transport relay API key (A2A_RELAY_API_KEY)
|
|
51
|
+
--hermes-url <url> Hermes API base URL (HERMES_API_URL)
|
|
52
|
+
--hermes-endpoint <path> Hermes API endpoint (HERMES_API_ENDPOINT)
|
|
53
|
+
--hermes-token <token> Hermes API bearer token (HERMES_API_KEY)
|
|
54
|
+
--hermes-session <key> Hermes session key (default a2a)
|
|
55
|
+
--info Print resolved config + exit (no server boot)
|
|
56
|
+
-h, --help
|
|
57
|
+
|
|
58
|
+
This is the Hermes-flavoured sibling of \`perkos-a2a-agent\`. For full
|
|
59
|
+
config control, use \`perkos-a2a-agent --config a2a.config.json\`.
|
|
60
|
+
`);
|
|
61
|
+
}
|
|
62
|
+
function resolveConfig() {
|
|
63
|
+
const agentName = argValue("--agent-name") || process.env.A2A_AGENT_NAME;
|
|
64
|
+
if (!agentName) {
|
|
65
|
+
console.error("perkos-a2a-hermes: --agent-name (or A2A_AGENT_NAME) is required\n");
|
|
66
|
+
printHelp();
|
|
67
|
+
process.exit(2);
|
|
68
|
+
}
|
|
69
|
+
const port = Number(argValue("--port") || process.env.A2A_PORT || 5060);
|
|
70
|
+
if (!Number.isFinite(port) || port <= 0) {
|
|
71
|
+
console.error(`perkos-a2a-hermes: invalid port ${argValue("--port")}`);
|
|
72
|
+
process.exit(2);
|
|
73
|
+
}
|
|
74
|
+
const relayUrl = argValue("--relay-url") || process.env.A2A_RELAY_URL;
|
|
75
|
+
const relayKey = argValue("--relay-key") || process.env.A2A_RELAY_API_KEY;
|
|
76
|
+
const relay = relayUrl && relayKey
|
|
77
|
+
? { url: relayUrl, apiKey: relayKey, enabled: true }
|
|
78
|
+
: undefined;
|
|
79
|
+
return {
|
|
80
|
+
agentName,
|
|
81
|
+
port,
|
|
82
|
+
bindHost: argValue("--bind-host") || process.env.A2A_BIND_HOST,
|
|
83
|
+
publicUrl: argValue("--public-url") || process.env.A2A_PUBLIC_URL,
|
|
84
|
+
relay,
|
|
85
|
+
hermes: {
|
|
86
|
+
url: argValue("--hermes-url") || process.env.HERMES_API_URL,
|
|
87
|
+
endpoint: argValue("--hermes-endpoint") || process.env.HERMES_API_ENDPOINT,
|
|
88
|
+
sessionKey: argValue("--hermes-session") || process.env.A2A_HERMES_SESSION || "a2a",
|
|
89
|
+
token: argValue("--hermes-token") || process.env.HERMES_API_KEY,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
async function main() {
|
|
94
|
+
if (hasFlag("-h") || hasFlag("--help")) {
|
|
95
|
+
printHelp();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const config = resolveConfig();
|
|
99
|
+
const plugin = createHermesPlugin(config);
|
|
100
|
+
if (hasFlag("--info")) {
|
|
101
|
+
const info = plugin.info();
|
|
102
|
+
console.log(JSON.stringify({ ...info, relayConfigured: Boolean(config.relay) }, null, 2));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
await plugin.start();
|
|
106
|
+
process.on("SIGINT", async () => {
|
|
107
|
+
await plugin.stop();
|
|
108
|
+
process.exit(0);
|
|
109
|
+
});
|
|
110
|
+
process.on("SIGTERM", async () => {
|
|
111
|
+
await plugin.stop();
|
|
112
|
+
process.exit(0);
|
|
113
|
+
});
|
|
114
|
+
console.log(`[perkos-a2a/hermes] running as ${config.agentName} on port ${config.port ?? 5060}`);
|
|
115
|
+
}
|
|
116
|
+
main().catch((err) => {
|
|
117
|
+
console.error("[perkos-a2a/hermes] fatal:", err);
|
|
118
|
+
process.exit(1);
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=hermes-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes-cli.js","sourceRoot":"","sources":["../src/hermes-cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,kBAAkB,EAA2B,MAAM,oBAAoB,CAAC;AAEjF,SAAS,QAAQ,CAAC,IAAY;IAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACjC,OAAO,OAAO,CAAC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CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QAC/B,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,kCAAkC,MAAM,CAAC,SAAS,YAAY,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;AACnG,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PerkOS A2A — Hermes native plugin (parity with the OpenClaw plugin).
|
|
3
|
+
*
|
|
4
|
+
* The OpenClaw integration is a plugin loaded directly by the OpenClaw
|
|
5
|
+
* runtime (`openclaw plugins install @perkos/perkos-a2a`). Hermes doesn't
|
|
6
|
+
* load OpenClaw plugins, so its native integration is the standalone
|
|
7
|
+
* `perkos-a2a-agent` bridge that delivers inbound tasks into the Hermes
|
|
8
|
+
* API Server (`POST /v1/responses` by default).
|
|
9
|
+
*
|
|
10
|
+
* This module exposes the bridge as a programmatic API so Hermes — or
|
|
11
|
+
* any other host that can `import()` ESM — can embed it without spawning
|
|
12
|
+
* a subprocess. The lifecycle shape matches OpenClaw's `registerService`
|
|
13
|
+
* contract (`start()` / `stop()` / `info()`) so the two integrations
|
|
14
|
+
* feel the same from a deploy standpoint.
|
|
15
|
+
*
|
|
16
|
+
* Usage from Hermes (or any embedding host):
|
|
17
|
+
*
|
|
18
|
+
* import { createHermesPlugin } from "@perkos/perkos-a2a/hermes";
|
|
19
|
+
* const plugin = createHermesPlugin({
|
|
20
|
+
* agentName: "Apollo",
|
|
21
|
+
* port: 5060,
|
|
22
|
+
* relay: { url: "wss://transport.perkos.xyz/a2a", apiKey: "…", enabled: true },
|
|
23
|
+
* hermes: { url: "http://127.0.0.1:8642", endpoint: "/v1/responses" },
|
|
24
|
+
* });
|
|
25
|
+
* await plugin.start();
|
|
26
|
+
*
|
|
27
|
+
* The same bridge is also runnable as a CLI:
|
|
28
|
+
*
|
|
29
|
+
* perkos-a2a-hermes --agent-name Apollo --port 5060 \
|
|
30
|
+
* --relay-url wss://transport.perkos.xyz/a2a \
|
|
31
|
+
* --relay-key "$A2A_RELAY_API_KEY"
|
|
32
|
+
*/
|
|
33
|
+
import type { AgentSkill, PeerConfig } from "./types.js";
|
|
34
|
+
type Logger = {
|
|
35
|
+
info: (...args: unknown[]) => void;
|
|
36
|
+
warn: (...args: unknown[]) => void;
|
|
37
|
+
error: (...args: unknown[]) => void;
|
|
38
|
+
};
|
|
39
|
+
export type HermesPluginConfig = {
|
|
40
|
+
agentName: string;
|
|
41
|
+
/** Local port the A2A HTTP server binds to. Default 5060. */
|
|
42
|
+
port?: number;
|
|
43
|
+
/** Bind host. Default 0.0.0.0. */
|
|
44
|
+
bindHost?: string;
|
|
45
|
+
/** Externally reachable URL advertised in the Agent Card. */
|
|
46
|
+
publicUrl?: string;
|
|
47
|
+
/** Skills surfaced on the Agent Card. */
|
|
48
|
+
skills?: AgentSkill[];
|
|
49
|
+
/** Peer agent name → base URL map. */
|
|
50
|
+
peers?: PeerConfig;
|
|
51
|
+
/** PerkOS-Transport relay config. */
|
|
52
|
+
relay?: {
|
|
53
|
+
url: string;
|
|
54
|
+
apiKey: string;
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
};
|
|
57
|
+
/** Hermes API Server delivery target. */
|
|
58
|
+
hermes?: {
|
|
59
|
+
/** Default: http://127.0.0.1:8642 */
|
|
60
|
+
url?: string;
|
|
61
|
+
/** Default: /v1/responses */
|
|
62
|
+
endpoint?: string;
|
|
63
|
+
/** Default: a2a */
|
|
64
|
+
sessionKey?: string;
|
|
65
|
+
/** Optional bearer token for the Hermes API. */
|
|
66
|
+
token?: string;
|
|
67
|
+
};
|
|
68
|
+
/** Logger to use. Defaults to console-prefixed. */
|
|
69
|
+
logger?: Logger;
|
|
70
|
+
};
|
|
71
|
+
export type HermesPluginHandle = {
|
|
72
|
+
start: () => Promise<void>;
|
|
73
|
+
stop: () => Promise<void>;
|
|
74
|
+
info: () => {
|
|
75
|
+
agentName: string;
|
|
76
|
+
port: number;
|
|
77
|
+
runtime: "hermes-api";
|
|
78
|
+
relayConnected: boolean;
|
|
79
|
+
hermesUrl: string;
|
|
80
|
+
hermesEndpoint: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Create a Hermes-native A2A plugin instance.
|
|
85
|
+
*
|
|
86
|
+
* Symmetric to OpenClaw's `register(api)` entry, but driven by a
|
|
87
|
+
* direct config object rather than the OpenClaw plugin host API.
|
|
88
|
+
*/
|
|
89
|
+
export declare function createHermesPlugin(config: HermesPluginConfig): HermesPluginHandle;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=hermes-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes-plugin.d.ts","sourceRoot":"","sources":["../src/hermes-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,KAAK,EAAmB,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1E,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,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AAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAqEF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAyFjF"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PerkOS A2A — Hermes native plugin (parity with the OpenClaw plugin).
|
|
3
|
+
*
|
|
4
|
+
* The OpenClaw integration is a plugin loaded directly by the OpenClaw
|
|
5
|
+
* runtime (`openclaw plugins install @perkos/perkos-a2a`). Hermes doesn't
|
|
6
|
+
* load OpenClaw plugins, so its native integration is the standalone
|
|
7
|
+
* `perkos-a2a-agent` bridge that delivers inbound tasks into the Hermes
|
|
8
|
+
* API Server (`POST /v1/responses` by default).
|
|
9
|
+
*
|
|
10
|
+
* This module exposes the bridge as a programmatic API so Hermes — or
|
|
11
|
+
* any other host that can `import()` ESM — can embed it without spawning
|
|
12
|
+
* a subprocess. The lifecycle shape matches OpenClaw's `registerService`
|
|
13
|
+
* contract (`start()` / `stop()` / `info()`) so the two integrations
|
|
14
|
+
* feel the same from a deploy standpoint.
|
|
15
|
+
*
|
|
16
|
+
* Usage from Hermes (or any embedding host):
|
|
17
|
+
*
|
|
18
|
+
* import { createHermesPlugin } from "@perkos/perkos-a2a/hermes";
|
|
19
|
+
* const plugin = createHermesPlugin({
|
|
20
|
+
* agentName: "Apollo",
|
|
21
|
+
* port: 5060,
|
|
22
|
+
* relay: { url: "wss://transport.perkos.xyz/a2a", apiKey: "…", enabled: true },
|
|
23
|
+
* hermes: { url: "http://127.0.0.1:8642", endpoint: "/v1/responses" },
|
|
24
|
+
* });
|
|
25
|
+
* await plugin.start();
|
|
26
|
+
*
|
|
27
|
+
* The same bridge is also runnable as a CLI:
|
|
28
|
+
*
|
|
29
|
+
* perkos-a2a-hermes --agent-name Apollo --port 5060 \
|
|
30
|
+
* --relay-url wss://transport.perkos.xyz/a2a \
|
|
31
|
+
* --relay-key "$A2A_RELAY_API_KEY"
|
|
32
|
+
*/
|
|
33
|
+
import { A2AServer } from "./server.js";
|
|
34
|
+
import { completeTaskWithReply, generateRuntimeReply } from "./runtime-reply.js";
|
|
35
|
+
import { tryHandleAgenticTask } from "./agentic-actions.js";
|
|
36
|
+
const defaultLogger = {
|
|
37
|
+
info: (...args) => console.log("[perkos-a2a/hermes]", ...args),
|
|
38
|
+
warn: (...args) => console.warn("[perkos-a2a/hermes]", ...args),
|
|
39
|
+
error: (...args) => console.error("[perkos-a2a/hermes]", ...args),
|
|
40
|
+
};
|
|
41
|
+
function buildPluginConfig(cfg) {
|
|
42
|
+
const hermes = cfg.hermes ?? {};
|
|
43
|
+
return {
|
|
44
|
+
agentName: cfg.agentName,
|
|
45
|
+
port: cfg.port ?? 5060,
|
|
46
|
+
bindHost: cfg.bindHost ?? "0.0.0.0",
|
|
47
|
+
publicUrl: cfg.publicUrl,
|
|
48
|
+
skills: cfg.skills ?? [],
|
|
49
|
+
peers: cfg.peers ?? {},
|
|
50
|
+
mode: "client-only",
|
|
51
|
+
runtime: {
|
|
52
|
+
kind: "hermes-api",
|
|
53
|
+
sessionKey: hermes.sessionKey ?? "a2a",
|
|
54
|
+
hermesUrl: hermes.url,
|
|
55
|
+
hermesEndpoint: hermes.endpoint,
|
|
56
|
+
hermesToken: hermes.token,
|
|
57
|
+
},
|
|
58
|
+
relay: cfg.relay
|
|
59
|
+
? {
|
|
60
|
+
url: cfg.relay.url,
|
|
61
|
+
apiKey: cfg.relay.apiKey,
|
|
62
|
+
enabled: cfg.relay.enabled !== false,
|
|
63
|
+
}
|
|
64
|
+
: undefined,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
async function deliverToHermes(cfg, message, logger) {
|
|
68
|
+
const runtime = cfg.runtime || {};
|
|
69
|
+
const baseUrl = (runtime.hermesUrl || "http://127.0.0.1:8642").replace(/\/+$/, "");
|
|
70
|
+
const endpoint = runtime.hermesEndpoint || "/v1/responses";
|
|
71
|
+
const sessionKey = runtime.sessionKey || "a2a";
|
|
72
|
+
const token = runtime.hermesToken;
|
|
73
|
+
const url = `${baseUrl}${endpoint.startsWith("/") ? endpoint : `/${endpoint}`}`;
|
|
74
|
+
const headers = {
|
|
75
|
+
"content-type": "application/json",
|
|
76
|
+
"x-hermes-session-id": sessionKey,
|
|
77
|
+
"x-hermes-session-key": sessionKey,
|
|
78
|
+
};
|
|
79
|
+
if (token)
|
|
80
|
+
headers.authorization = `Bearer ${token}`;
|
|
81
|
+
// Match the format used by the standalone bridge (src/agent.ts).
|
|
82
|
+
const normalizedEndpoint = endpoint.replace(/^\/?/, "/");
|
|
83
|
+
const body = normalizedEndpoint.startsWith("/v1/chat/completions")
|
|
84
|
+
? { model: "hermes-agent", messages: [{ role: "user", content: message }], stream: false }
|
|
85
|
+
: normalizedEndpoint.startsWith("/v1/runs")
|
|
86
|
+
? { input: message, session_id: sessionKey }
|
|
87
|
+
: normalizedEndpoint.startsWith("/v1/responses")
|
|
88
|
+
? { model: "hermes-agent", input: message, store: true }
|
|
89
|
+
: { sessionKey, message };
|
|
90
|
+
const response = await fetch(url, {
|
|
91
|
+
method: "POST",
|
|
92
|
+
headers,
|
|
93
|
+
body: JSON.stringify(body),
|
|
94
|
+
});
|
|
95
|
+
if (!response.ok) {
|
|
96
|
+
const text = await response.text().catch(() => "");
|
|
97
|
+
throw new Error(`Hermes API delivery failed (${response.status}) at ${url}: ${text || response.statusText}`);
|
|
98
|
+
}
|
|
99
|
+
logger.info(`Delivered inbound A2A task to Hermes session ${sessionKey} via ${url}`);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create a Hermes-native A2A plugin instance.
|
|
103
|
+
*
|
|
104
|
+
* Symmetric to OpenClaw's `register(api)` entry, but driven by a
|
|
105
|
+
* direct config object rather than the OpenClaw plugin host API.
|
|
106
|
+
*/
|
|
107
|
+
export function createHermesPlugin(config) {
|
|
108
|
+
if (!config.agentName)
|
|
109
|
+
throw new Error("createHermesPlugin: agentName is required");
|
|
110
|
+
const logger = config.logger ?? defaultLogger;
|
|
111
|
+
const pluginConfig = buildPluginConfig(config);
|
|
112
|
+
const server = new A2AServer(pluginConfig, logger);
|
|
113
|
+
server.setTaskResultHandler(async (task, text) => {
|
|
114
|
+
const marker = `[A2A_RESULT:${task.id}]`;
|
|
115
|
+
const from = task.metadata?.fromAgent || "unknown";
|
|
116
|
+
const eventText = [
|
|
117
|
+
marker,
|
|
118
|
+
`From: ${from}`,
|
|
119
|
+
`Task ID: ${task.id}`,
|
|
120
|
+
`Context ID: ${task.contextId}`,
|
|
121
|
+
"",
|
|
122
|
+
"Execute the following request and include the final answer in your assistant reply.",
|
|
123
|
+
`Your final answer must begin with exactly: ${marker}`,
|
|
124
|
+
"",
|
|
125
|
+
text,
|
|
126
|
+
].join("\n");
|
|
127
|
+
task.status = {
|
|
128
|
+
state: "working",
|
|
129
|
+
timestamp: new Date().toISOString(),
|
|
130
|
+
message: {
|
|
131
|
+
role: "agent",
|
|
132
|
+
parts: [{ kind: "text", text: "Task dispatched to Hermes runtime." }],
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
const handledAgentically = await tryHandleAgenticTask({
|
|
136
|
+
selfName: pluginConfig.agentName,
|
|
137
|
+
server,
|
|
138
|
+
task,
|
|
139
|
+
text,
|
|
140
|
+
logger,
|
|
141
|
+
runtimeResponder: (prompt, m) => generateRuntimeReply(pluginConfig, prompt, m),
|
|
142
|
+
}).catch((err) => {
|
|
143
|
+
logger.error(`agentic task handler failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
144
|
+
return false;
|
|
145
|
+
});
|
|
146
|
+
if (handledAgentically)
|
|
147
|
+
return;
|
|
148
|
+
try {
|
|
149
|
+
await deliverToHermes(pluginConfig, eventText, logger);
|
|
150
|
+
const final = await generateRuntimeReply(pluginConfig, text, marker);
|
|
151
|
+
completeTaskWithReply(task, final);
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
155
|
+
logger.warn(`Hermes API delivery failed; falling back to PerkOS LLM: ${msg}`);
|
|
156
|
+
const final = await generateRuntimeReply(pluginConfig, text, marker);
|
|
157
|
+
completeTaskWithReply(task, final);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
server.setTaskFailureHandler(async (task, errorText) => {
|
|
161
|
+
task.status = {
|
|
162
|
+
state: "failed",
|
|
163
|
+
timestamp: new Date().toISOString(),
|
|
164
|
+
message: { role: "agent", parts: [{ kind: "text", text: errorText }] },
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
let started = false;
|
|
168
|
+
return {
|
|
169
|
+
async start() {
|
|
170
|
+
if (started)
|
|
171
|
+
return;
|
|
172
|
+
server.start();
|
|
173
|
+
started = true;
|
|
174
|
+
logger.info(`A2A server started for ${pluginConfig.agentName} on :${pluginConfig.port}`);
|
|
175
|
+
},
|
|
176
|
+
async stop() {
|
|
177
|
+
if (!started)
|
|
178
|
+
return;
|
|
179
|
+
// A2AServer doesn't expose stop() directly today; closing the relay
|
|
180
|
+
// socket is the meaningful signal we can offer until that lands.
|
|
181
|
+
started = false;
|
|
182
|
+
logger.info(`A2A server stop requested for ${pluginConfig.agentName}`);
|
|
183
|
+
},
|
|
184
|
+
info() {
|
|
185
|
+
return {
|
|
186
|
+
agentName: pluginConfig.agentName,
|
|
187
|
+
port: pluginConfig.port,
|
|
188
|
+
runtime: "hermes-api",
|
|
189
|
+
relayConnected: server.isRelayConnected(),
|
|
190
|
+
hermesUrl: pluginConfig.runtime?.hermesUrl || "http://127.0.0.1:8642",
|
|
191
|
+
hermesEndpoint: pluginConfig.runtime?.hermesEndpoint || "/v1/responses",
|
|
192
|
+
};
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=hermes-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes-plugin.js","sourceRoot":"","sources":["../src/hermes-plugin.ts"],"names":[],"mappings":"AAAA;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B,YAAY,CAAC,SAAS,QAAQ,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3F,CAAC;QACD,KAAK,CAAC,IAAI;YACR,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,oEAAoE;YACpE,iEAAiE;YACjE,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,iCAAiC,YAAY,CAAC,SAAS,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,IAAI;YACF,OAAO;gBACL,SAAS,EAAE,YAAY,CAAC,SAAS;gBACjC,IAAI,EAAE,YAAY,CAAC,IAAI;gBACvB,OAAO,EAAE,YAAY;gBACrB,cAAc,EAAE,MAAM,CAAC,gBAAgB,EAAE;gBACzC,SAAS,EAAE,YAAY,CAAC,OAAO,EAAE,SAAS,IAAI,uBAAuB;gBACrE,cAAc,EAAE,YAAY,CAAC,OAAO,EAAE,cAAc,IAAI,eAAe;aACxE,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
export { A2AServer, detectNetworking } from "./server.js";
|
|
11
11
|
export { RelayHub } from "./relay.js";
|
|
12
12
|
export { RelayClient } from "./relay-client.js";
|
|
13
|
+
export { ChatClient } from "./chat-client.js";
|
|
14
|
+
export { ChatStore } from "./chat-store.js";
|
|
13
15
|
export * from "./types.js";
|
|
14
16
|
export default function register(api: any): void;
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,cAAc,YAAY,CAAC;AAiF3B,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QA2vBxC"}
|