@cotal-ai/connector-hermes 0.167.0 → 0.169.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/sidecar.d.ts CHANGED
@@ -6,7 +6,7 @@ interface Sidecar {
6
6
  }
7
7
  /** Start the mesh agent, the control + bridge servers, and emit the tool descriptors file.
8
8
  * Reads `COTAL_CONTROL_SOCKET`, `COTAL_BRIDGE_SOCKET`, and `COTAL_TOOLS_FILE` from the env, and the
9
- * control token from the launch material (see controlFromEnv). */
9
+ * control key and version from the launch material (see controlFromEnv). */
10
10
  export declare function startSidecar(): Sidecar;
11
11
  export {};
12
12
  //# sourceMappingURL=sidecar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,SAAS,EAET,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAKlC,UAAU,OAAO;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAQD;;mEAEmE;AACnE,wBAAgB,YAAY,IAAI,OAAO,CAgDtC"}
1
+ {"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"AAgBA,OAAO,EAGL,SAAS,EAET,KAAK,WAAW,EACjB,MAAM,0BAA0B,CAAC;AAKlC,UAAU,OAAO;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAQD;;6EAE6E;AAC7E,wBAAgB,YAAY,IAAI,OAAO,CAwCtC"}
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.167.0",
4
+ "version": "0.169.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -24,8 +24,8 @@
24
24
  "@cotal-ai/core": ">=0.1.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@cotal-ai/core": "0.167.0",
28
- "@cotal-ai/connector-core": "0.167.0",
27
+ "@cotal-ai/core": "0.169.0",
28
+ "@cotal-ai/connector-core": "0.169.0",
29
29
  "@cotal-ai/smoke-kit": "0.0.0",
30
30
  "esbuild": "^0.28.0",
31
31
  "tsx": "^4.22.4",
@@ -26,6 +26,7 @@ from pathlib import Path
26
26
  from typing import Any
27
27
 
28
28
  from . import hooks, replies
29
+ from .control_exchange import CONTROL_PROTOCOL_VERSION, ControlConfigError, control_key, env_set
29
30
  from .tools import register_tools
30
31
 
31
32
 
@@ -90,10 +91,31 @@ def _resolve_node() -> str:
90
91
  )
91
92
 
92
93
 
94
+ def _standalone_control_key() -> None:
95
+ """The sidecar (listener) and the lifecycle hooks (this process) prove to each other that they
96
+ hold a shared control key, without sending it, and the bridge client presents a token derived
97
+ from it. A launch that carries neither the key nor its version gets both minted here, together,
98
+ so both sides (they share this env) agree on them. A launch that already carries a key is used
99
+ as it is, and half a pair, a version this plugin does not speak, two carriers, or the retired
100
+ ``COTAL_CONTROL_TOKEN`` are refused before any sidecar starts rather than filled in."""
101
+ carried = ("COTAL_CONTROL_KEY", "COTAL_CONTROL_VERSION", "COTAL_CONTROL_TOKEN", "COTAL_LAUNCH_MATERIAL")
102
+ if not any(env_set(k) for k in carried):
103
+ os.environ["COTAL_CONTROL_KEY"] = secrets.token_urlsafe(32)
104
+ os.environ["COTAL_CONTROL_VERSION"] = str(CONTROL_PROTOCOL_VERSION)
105
+ return
106
+ try:
107
+ key = control_key()
108
+ except ControlConfigError as exc:
109
+ raise RuntimeError(f"cannot start the standalone sidecar: {exc}") from exc
110
+ if not key:
111
+ raise RuntimeError("cannot start the standalone sidecar: COTAL_LAUNCH_MATERIAL carries no control key")
112
+
113
+
93
114
  def _bootstrap_standalone_sidecar() -> None:
94
115
  """Standalone mode: spawn the bundled Node sidecar and wait until it has published the bridge
95
116
  socket + tools file. Sets the three path env vars first so the sidecar and the rest of this
96
117
  registration agree on them."""
118
+ _standalone_control_key()
97
119
  run_dir = Path(tempfile.mkdtemp(prefix="cotal-hermes-"))
98
120
  # Identity may come entirely from COTAL_LINK (which carries the space), so neither of these is
99
121
  # guaranteed — they're only used for the readiness error below.
@@ -101,10 +123,6 @@ def _bootstrap_standalone_sidecar() -> None:
101
123
  space = os.environ.get("COTAL_SPACE") or "(from COTAL_LINK)"
102
124
  os.environ.setdefault("COTAL_BRIDGE_SOCKET", str(run_dir / "bridge.sock"))
103
125
  os.environ.setdefault("COTAL_CONTROL_SOCKET", str(run_dir / "control.sock"))
104
- # The sidecar (listener) and the lifecycle hooks (this process) authenticate the control plane
105
- # with a shared first-frame token. Managed mode gets it from the launcher; standalone mints one
106
- # here so both sides — they share this env — agree on it.
107
- os.environ.setdefault("COTAL_CONTROL_TOKEN", secrets.token_urlsafe(32))
108
126
  os.environ.setdefault("COTAL_TOOLS_FILE", str(run_dir / "cotal-tools.json"))
109
127
 
110
128
  sidecar = _resolve_sidecar_js()