@cotal-ai/connector-hermes 0.9.1 → 0.10.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,SAAS,EAAoC,MAAM,gBAAgB,CAAC;AAW3G;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,SAuC7B,CAAC"}
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,SAAS,EAAoC,MAAM,gBAAgB,CAAC;AAW3G;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,EAAE,SA2C7B,CAAC"}
package/dist/extension.js CHANGED
@@ -33,6 +33,8 @@ export const hermesConnector = {
33
33
  // ignores opts it doesn't render, so without this guard `resume` would be dropped without a word.
34
34
  if (opts.resume)
35
35
  throw new Error("the Hermes connector does not support resuming an existing session (resume)");
36
+ if (opts.variant)
37
+ throw new Error("the Hermes connector does not support model variants (variant)");
36
38
  // OS allow-list + the named model-provider key (Hermes is model-agnostic; any one unlocks a
37
39
  // provider), forwarded BY NAME — never `...process.env` — so the operator's unrelated secrets
38
40
  // don't reach the gateway child (P3).
@@ -59,8 +61,10 @@ export const hermesConnector = {
59
61
  // gateway model — resolving here is the one place that honors the file's model for Hermes.
60
62
  const fileModel = opts.configPath ? loadAgentFile(opts.configPath).model : undefined;
61
63
  const model = opts.model ?? fileModel ?? process.env.HERMES_MODEL;
62
- if (model)
64
+ if (model) {
63
65
  env.HERMES_MODEL = model;
66
+ env.COTAL_MODEL = model;
67
+ }
64
68
  return { command: TSX, args: [LAUNCH_ENTRY], env };
65
69
  },
66
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1C,IAAI,IAAI,CAAC,EAAE;YAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,IAAI,CAAC,KAAK;YAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,IAAI,IAAI,CAAC,OAAO;YAAE,GAAG,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC;QACnD,wFAAwF;QACxF,mFAAmF;QACnF,IAAI,IAAI,CAAC,UAAU;YAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC;QAC5D,gGAAgG;QAChG,8FAA8F;QAC9F,2FAA2F;QAC3F,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACrF,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QAClE,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC;YACzB,GAAG,CAAC,WAAW,GAAG,KAAK,CAAC;QAC1B,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrD,CAAC;CACF,CAAC;AAEF,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-hermes",
3
3
  "description": "Cotal connector for the Hermes (Nous Research) agent.",
4
- "version": "0.9.1",
4
+ "version": "0.10.1",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -23,14 +23,14 @@
23
23
  "dependencies": {
24
24
  "tsx": "^4.22.4",
25
25
  "zod": "^4.4.3",
26
- "@cotal-ai/connector-core": "0.9.1"
26
+ "@cotal-ai/connector-core": "0.10.1"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@cotal-ai/core": ">=0.1.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "esbuild": "^0.28.0",
33
- "@cotal-ai/core": "0.9.1"
33
+ "@cotal-ai/core": "0.10.1"
34
34
  },
35
35
  "files": [
36
36
  "bin",
@@ -16601,6 +16601,7 @@ var Algorithms;
16601
16601
 
16602
16602
  // ../../packages/core/dist/provision.js
16603
16603
  var import_nkeys2 = __toESM(require_mod(), 1);
16604
+ var FIVE_MINUTES = 5 * 60;
16604
16605
  var BASE_LIMITS = {
16605
16606
  subs: -1,
16606
16607
  conn: -1,
@@ -17020,7 +17021,7 @@ function loadAgentFile(path) {
17020
17021
  if (!channelInAllow(effAllow, ch))
17021
17022
  throw new Error(`agent file ${path}: ${field} channel "${ch}" is not within your read ACL / allowSubscribe [${effAllow.join(", ")}]`);
17022
17023
  }
17023
- const known = /* @__PURE__ */ new Set(["name", "role", "kind", "description", "tags", "subscribe", "allowSubscribe", "allowPublish", "quiet", "muted", "model", "capabilities", "owner"]);
17024
+ const known = /* @__PURE__ */ new Set(["name", "role", "kind", "description", "tags", "subscribe", "allowSubscribe", "allowPublish", "quiet", "muted", "model", "variant", "capabilities", "owner"]);
17024
17025
  const meta3 = {};
17025
17026
  for (const [k, v] of Object.entries(fm))
17026
17027
  if (!known.has(k) && typeof v === "string")
@@ -17037,6 +17038,7 @@ function loadAgentFile(path) {
17037
17038
  quiet,
17038
17039
  muted,
17039
17040
  model: str("model"),
17041
+ variant: str("variant"),
17040
17042
  capabilities: list("capabilities"),
17041
17043
  owner: str("owner"),
17042
17044
  meta: Object.keys(meta3).length ? meta3 : void 0,
@@ -19353,6 +19355,7 @@ function configFromEnv(env = process.env) {
19353
19355
  meta: def?.meta,
19354
19356
  capabilities: splitList(env.COTAL_CAPABILITIES).length ? splitList(env.COTAL_CAPABILITIES) : def?.capabilities,
19355
19357
  model: env.COTAL_MODEL?.trim() || def?.model || void 0,
19358
+ variant: env.COTAL_VARIANT?.trim() || def?.variant || void 0,
19356
19359
  servers: env.COTAL_SERVERS?.trim() || link?.servers || DEFAULT_SERVER,
19357
19360
  subscribe: resolvedSubscribe,
19358
19361
  allowSubscribe: resolvedAllowSub,
@@ -19373,10 +19376,13 @@ function configFromEnv(env = process.env) {
19373
19376
 
19374
19377
  // ../connector-core/dist/agent.js
19375
19378
  var import_node_events2 = require("node:events");
19379
+ var SPAWN_TIMEOUT_MS = 4e4;
19376
19380
  function buildMeta(config2) {
19377
19381
  const meta3 = { ...config2.meta ?? {} };
19378
19382
  if (config2.model)
19379
19383
  meta3.model = config2.model;
19384
+ if (config2.variant)
19385
+ meta3.variant = config2.variant;
19380
19386
  if (config2.connector)
19381
19387
  meta3.connector = config2.connector;
19382
19388
  return Object.keys(meta3).length ? meta3 : void 0;
@@ -19734,11 +19740,14 @@ var MeshAgent = class extends import_node_events2.EventEmitter {
19734
19740
  }
19735
19741
  // ---- supervision ---------------------------------------------------------
19736
19742
  /** Ask the manager to spawn a new teammate into this space (its `start` op).
19743
+ * #159 B1: the manager replies to `start` only on a REAL outcome — presence join, process exit,
19744
+ * or its ~30s readiness backstop — so the request must outlive that window ({@link SPAWN_TIMEOUT_MS}),
19745
+ * not the 5s op default.
19737
19746
  * How it lands — a detached PTY, a tmux window, a cmux tab — is the manager's
19738
19747
  * runtime; from here it just joins the mesh as a lateral peer. `opts.agent` picks
19739
- * the harness (default the manager's `cotal`/Claude), `opts.model` overrides the
19740
- * persona file's `model:`, and `opts.cwd` roots the new peer at a different folder/repo
19741
- * than the manager's workspace — the same knobs the operator's `cotal start` carries, so
19748
+ * the harness (default the manager's `COTAL_DEFAULT_AGENT`, else `cotal`/Claude), `opts.model` /
19749
+ * `opts.variant` override the persona file's model selectors, and `opts.cwd` roots the new peer at a different folder/repo
19750
+ * than the manager's workspace — the same knobs the operator's `cotal spawn --detach` carries, so
19742
19751
  * the agent and operator spawn doors share one control-op contract. (Session `resume` is
19743
19752
  * intentionally NOT forwarded here: forking a host-local `~/.claude` transcript is an
19744
19753
  * operator-local intent, kept off the peer-facing spawn door — see #159.) */
@@ -19746,8 +19755,8 @@ var MeshAgent = class extends import_node_events2.EventEmitter {
19746
19755
  this.assertConnected();
19747
19756
  return this.ep.requestControl(CONTROL_PRIVILEGED, {
19748
19757
  op: "start",
19749
- args: { name, role, agent: opts?.agent, model: opts?.model, cwd: opts?.cwd }
19750
- });
19758
+ args: { name, role, agent: opts?.agent, model: opts?.model, variant: opts?.variant, cwd: opts?.cwd }
19759
+ }, SPAWN_TIMEOUT_MS);
19751
19760
  }
19752
19761
  /** Ask the manager to tear a teammate down (its `stop` op). Graceful by default —
19753
19762
  * the session is told to exit cleanly (so it leaves the mesh) before the
@@ -34819,18 +34828,19 @@ ${info}${caught}`);
34819
34828
  schema: {
34820
34829
  name: external_exports.string().describe("Which persona to spawn \u2014 the persona FILENAME in .cotal/agents (e.g. `review-critic`), without the .md. The new peer joins under the persona's own `name:` (auto-numbered, e.g. socrates-2, if that's taken). Fails if no such persona file exists \u2014 spawn an existing persona, don't invent a name."),
34821
34830
  role: external_exports.string().optional().describe("Optional role for the new peer (e.g. worker, reviewer); overrides the persona file's role."),
34822
- agent: external_exports.string().optional().describe("Optional harness the new peer runs on \u2014 the agent/connector type (claude, opencode, hermes), NOT the persona to spawn (that's `name`). Defaults to the manager's default (Claude)."),
34831
+ agent: external_exports.string().optional().describe("Optional harness the new peer runs on \u2014 the agent/connector type (claude, opencode, hermes), NOT the persona to spawn (that's `name`). Defaults to the manager's COTAL_DEFAULT_AGENT, else Claude."),
34823
34832
  model: external_exports.string().optional().describe("Optional model override (e.g. opus, sonnet) \u2014 wins over the persona file's model:."),
34833
+ variant: external_exports.string().optional().describe("Optional model variant override (connector-defined; for OpenCode, a model variant such as high/max/low)."),
34824
34834
  cwd: external_exports.string().optional().describe("Optional working directory to root the new peer at (e.g. a different repo). A relative path resolves against the manager's workspace; omitted \u2192 it shares the manager's workspace.")
34825
34835
  // NOTE: session `resume` is deliberately NOT exposed here. Forking a host-local `~/.claude`
34826
34836
  // transcript is an operator-local intent; letting a spawn-capable mesh PEER name a host
34827
34837
  // session id would expand `spawn` into host-transcript disclosure with no broker-enforced
34828
- // boundary. Resume lives only on the operator CLI (`cotal spawn --resume` / `cotal start
34829
- // --resume`); a peer-facing, capability-gated resume is deferred (see #159).
34838
+ // boundary. Resume lives only on the operator CLI (`cotal spawn --resume`, foreground or
34839
+ // --detach); a peer-facing, capability-gated resume is deferred (see #159).
34830
34840
  },
34831
- async run(agent, _config, { name, role, agent: agentType, model, cwd }) {
34841
+ async run(agent, _config, { name, role, agent: agentType, model, variant, cwd }) {
34832
34842
  try {
34833
- const reply = await agent.spawn(name, role, { agent: agentType, model, cwd });
34843
+ const reply = await agent.spawn(name, role, { agent: agentType, model, variant, cwd });
34834
34844
  if (!reply.ok)
34835
34845
  return err(`Couldn't spawn ${name}: ${reply.error ?? "manager refused"}`);
34836
34846
  const d = reply.data;