@signetai/connector-hermes-agent 0.161.0 → 0.161.2
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.map +1 -1
- package/dist/index.js +31 -3
- package/hermes-plugin/__init__.py +15 -8
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAoDjG,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAClD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAA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CAAC,EAAE;IACtD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAuG9B;AAED,wBAAgB,eAAe,IAAI,oBAAoB,CAEtD;AAED,eAAe,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -23136,6 +23136,27 @@ function configuredAgentReadPolicy(warnings) {
|
|
|
23136
23136
|
warnings.push(`Ignoring unsupported SIGNET_AGENT_READ_POLICY '${raw}'. Expected one of: isolated, shared, group.`);
|
|
23137
23137
|
return "shared";
|
|
23138
23138
|
}
|
|
23139
|
+
async function resolveDaemonAgentId(daemonUrl) {
|
|
23140
|
+
try {
|
|
23141
|
+
const baseUrl = trimTrailingSlashes(daemonUrl);
|
|
23142
|
+
const token = sanitizedAuthTokenEnv();
|
|
23143
|
+
const headers = {};
|
|
23144
|
+
if (token) {
|
|
23145
|
+
headers.Authorization = `Bearer ${token}`;
|
|
23146
|
+
}
|
|
23147
|
+
const resp = await fetch(`${baseUrl}/api/status`, {
|
|
23148
|
+
headers,
|
|
23149
|
+
signal: AbortSignal.timeout(1000)
|
|
23150
|
+
});
|
|
23151
|
+
if (!resp.ok)
|
|
23152
|
+
return null;
|
|
23153
|
+
const body = await resp.json();
|
|
23154
|
+
const agentId = typeof body.agentId === "string" ? body.agentId.trim() : "";
|
|
23155
|
+
return agentId || null;
|
|
23156
|
+
} catch {
|
|
23157
|
+
return null;
|
|
23158
|
+
}
|
|
23159
|
+
}
|
|
23139
23160
|
async function ensureNamedAgentRegistered(daemonUrl, agentId, warnings) {
|
|
23140
23161
|
if (!agentId || agentId === "default" || agentId === "hermes-agent")
|
|
23141
23162
|
return;
|
|
@@ -23242,7 +23263,7 @@ class HermesAgentConnector extends BaseConnector {
|
|
|
23242
23263
|
};
|
|
23243
23264
|
}
|
|
23244
23265
|
const envPath = join4(hermesHome, ".env");
|
|
23245
|
-
let configuredSignetAgentId = "
|
|
23266
|
+
let configuredSignetAgentId = "default";
|
|
23246
23267
|
const configuredDaemonUrl = (process.env.SIGNET_DAEMON_URL?.trim() || "http://localhost:3850").replace(/[\r\n]+/g, "");
|
|
23247
23268
|
try {
|
|
23248
23269
|
let envContent = "";
|
|
@@ -23256,13 +23277,20 @@ class HermesAgentConnector extends BaseConnector {
|
|
|
23256
23277
|
if (process.env.SIGNET_TRUSTED_DAEMON_ORIGINS) {
|
|
23257
23278
|
signetVars.SIGNET_TRUSTED_DAEMON_ORIGINS = sanitizedEnv("SIGNET_TRUSTED_DAEMON_ORIGINS");
|
|
23258
23279
|
}
|
|
23259
|
-
|
|
23280
|
+
let signetAgentId = sanitizedEnv("SIGNET_AGENT_ID");
|
|
23281
|
+
if (signetAgentId === "hermes-agent") {
|
|
23282
|
+
warnings.push("SIGNET_AGENT_ID='hermes-agent' is the harness name, not an agent scope. Re-resolving from the daemon.");
|
|
23283
|
+
signetAgentId = "";
|
|
23284
|
+
}
|
|
23285
|
+
if (!signetAgentId) {
|
|
23286
|
+
signetAgentId = await resolveDaemonAgentId(configuredDaemonUrl) || "default";
|
|
23287
|
+
}
|
|
23260
23288
|
configuredSignetAgentId = signetAgentId;
|
|
23261
23289
|
signetVars.SIGNET_AGENT_ID = signetAgentId;
|
|
23262
23290
|
const explicitAgentWorkspace = process.env.SIGNET_AGENT_WORKSPACE?.trim();
|
|
23263
23291
|
if (explicitAgentWorkspace) {
|
|
23264
23292
|
signetVars.SIGNET_AGENT_WORKSPACE = expandHome(explicitAgentWorkspace).replace(/[\r\n]+/g, "");
|
|
23265
|
-
} else if (signetAgentId && signetAgentId !== "
|
|
23293
|
+
} else if (signetAgentId && signetAgentId !== "default") {
|
|
23266
23294
|
const agentWorkspace = join4(expandedBasePath, "agents", signetAgentId);
|
|
23267
23295
|
if (existsSync2(agentWorkspace)) {
|
|
23268
23296
|
signetVars.SIGNET_AGENT_WORKSPACE = agentWorkspace;
|
|
@@ -14,7 +14,7 @@ scoring.
|
|
|
14
14
|
Config:
|
|
15
15
|
- SIGNET_HOST / SIGNET_PORT env vars (default: localhost:3850)
|
|
16
16
|
- SIGNET_DAEMON_URL env var for full URL override
|
|
17
|
-
- SIGNET_AGENT_ID env var for agent scoping (
|
|
17
|
+
- SIGNET_AGENT_ID env var for agent scoping (unset: daemon's configured agent, usually "default")
|
|
18
18
|
- SIGNET_AGENT_WORKSPACE env var for the active named-agent workspace
|
|
19
19
|
"""
|
|
20
20
|
|
|
@@ -303,7 +303,7 @@ def _resolve_agent_workspace(agent_id: str, kwargs: Dict[str, Any]) -> str:
|
|
|
303
303
|
|
|
304
304
|
signet_path = _sanitize_env(os.environ.get("SIGNET_PATH", ""))
|
|
305
305
|
agents_root = Path(signet_path).expanduser() if signet_path else Path.home() / ".agents"
|
|
306
|
-
if agent_id and agent_id not in ("default",
|
|
306
|
+
if agent_id and agent_id not in ("default",):
|
|
307
307
|
candidate = agents_root / "agents" / agent_id
|
|
308
308
|
if candidate.exists():
|
|
309
309
|
return str(candidate)
|
|
@@ -379,8 +379,8 @@ class SignetMemoryProvider(MemoryProvider):
|
|
|
379
379
|
},
|
|
380
380
|
{
|
|
381
381
|
"key": "agent_id",
|
|
382
|
-
"description": "Agent scope identifier",
|
|
383
|
-
"default": "
|
|
382
|
+
"description": "Agent scope identifier. Leave empty to use the daemon's configured agent.",
|
|
383
|
+
"default": "",
|
|
384
384
|
"env_var": "SIGNET_AGENT_ID",
|
|
385
385
|
},
|
|
386
386
|
]
|
|
@@ -396,12 +396,19 @@ class SignetMemoryProvider(MemoryProvider):
|
|
|
396
396
|
return
|
|
397
397
|
|
|
398
398
|
agent_id = os.environ.get("SIGNET_AGENT_ID", "").strip()
|
|
399
|
-
if
|
|
399
|
+
if agent_id == "hermes-agent":
|
|
400
|
+
# The harness name is provenance, never an agent scope. A stale
|
|
401
|
+
# value from an older connector install is healed by letting the
|
|
402
|
+
# daemon resolve the workspace's configured agent instead.
|
|
400
403
|
logger.warning(
|
|
401
|
-
"SIGNET_AGENT_ID is
|
|
402
|
-
"
|
|
404
|
+
"SIGNET_AGENT_ID='hermes-agent' is the harness name, not an agent scope; "
|
|
405
|
+
"the daemon's configured agent will be used instead."
|
|
403
406
|
)
|
|
404
|
-
agent_id = "
|
|
407
|
+
agent_id = ""
|
|
408
|
+
if not agent_id:
|
|
409
|
+
# No explicit agent id: the daemon resolves its configured agent
|
|
410
|
+
# (its own SIGNET_AGENT_ID, or 'default' for the default workspace).
|
|
411
|
+
logger.debug("SIGNET_AGENT_ID is not set; the daemon's configured agent scope applies.")
|
|
405
412
|
|
|
406
413
|
# Skip for cron/flush contexts — no memory injection needed
|
|
407
414
|
agent_context = kwargs.get("agent_context", "")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signetai/connector-hermes-agent",
|
|
3
|
-
"version": "0.161.
|
|
3
|
+
"version": "0.161.2",
|
|
4
4
|
"description": "Signet connector for Hermes Agent — installs Signet as a pluggable memory provider",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"typecheck": "tsc --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@signetai/connector-base": "0.161.
|
|
29
|
-
"@signetai/core": "0.161.
|
|
28
|
+
"@signetai/connector-base": "0.161.2",
|
|
29
|
+
"@signetai/core": "0.161.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^22.0.0",
|