@cotal-ai/connector-core 0.24.0 → 0.26.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.
@@ -1 +1 @@
1
- {"version":3,"file":"docs-bundle.generated.js","sourceRoot":"","sources":["../src/docs-bundle.generated.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,SAAS,EAAE,QAAQ;IACnB,eAAe,EAAE,mEAAmE;IACpF,OAAO,EAAE;QACP;YACE,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,eAAe;YACxB,MAAM,EAAE,0BAA0B;YAClC,SAAS,EAAE,+FAA+F;YAC1G,MAAM,EAAE,o6IAAo6I;SAC76I;QACD;YACE,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,YAAY;YACrB,MAAM,EAAE,0BAA0B;YAClC,SAAS,EAAE,gHAAgH;YAC3H,MAAM,EAAE,imVAAimV;SAC1mV;QACD;YACE,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,wMAAwM;YACnN,MAAM,EAAE,y+hBAAy+hB;SACl/hB;QACD;YACE,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,kBAAkB;YAC3B,MAAM,EAAE,mEAAmE;YAC3E,SAAS,EAAE,wMAAwM;YACnN,MAAM,EAAE,0yqBAA0yqB;SACnzqB;QACD;YACE,MAAM,EAAE,0BAA0B;YAClC,OAAO,EAAE,0BAA0B;YACnC,MAAM,EAAE,mCAAmC;YAC3C,SAAS,EAAE,sIAAsI;YACjJ,MAAM,EAAE,u+JAAu+J;SACh/J;QACD;YACE,MAAM,EAAE,mBAAmB;YAC3B,OAAO,EAAE,iBAAiB;YAC1B,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,oDAAoD;YAC/D,MAAM,EAAE,w9mBAAw9mB;SACj+mB;QACD;YACE,MAAM,EAAE,aAAa;YACrB,O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ACtE,MAAM,EAAE,g0KAAg0K;SACz0K;QACD;YACE,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,qBAAqB;YAC9B,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,kGAAkG;YAC7G,MAAM,EAAE,oyPAAoyP;SAC7yP;QACD;YACE,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,uBAAuB;YAChC,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,kGAAkG;YAC7G,MAAM,EAAE,mlNAAmlN;SAC5lN;QACD;YACE,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,qBAAqB;YAC7B,SAAS,EAAE,uHAAuH;YAClI,MAAM,EAAE,63WAA63W;SACt4W;QACD;YACE,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,eAAe;YACxB,MAAM,EAAE,uBAAuB;YAC/B,SAAS,EAAE,kHAAkH;YAC7H,MAAM,EAAE,0/UAA0/U;SACngV;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,0BAA0B;QACnC,MAAM,EAAE,kg6YAAkg6Y;KAC3g6Y;IACD,MAAM,EAAE;QACN,OAAO,EAAE,mCAAmC;QAC5C,MAAM,EAAE,k4yEAAk4yE;KAC34yE;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,oCAAoC;QAC7C,MAAM,EAAE,siUAAsiU;KAC/iU;CACF,CAAC"}
package/dist/launch.d.ts CHANGED
@@ -1,40 +1,75 @@
1
1
  /**
2
- * The spawned-agent env allow-list (P3) the single chokepoint for what a child process sees.
3
- *
4
- * Connectors build the child's env as `{ ...launchEnv(...), <COTAL_* identity>, <connector vars> }`
5
- * and the runtimes pass ONLY that (never `...process.env`). So the operator's *unrelated* env
6
- * (AWS creds, GH tokens, other service keys sitting in their shell) stops bleeding into every
7
- * spawned child. What a child sees is auditable from the spec, not "whatever the manager
8
- * inherited."
9
- *
10
- * Scope this is HONEST about (P6): it closes ENV-VAR bleed. It does NOT close (i) model-key
11
- * exfil for key-based providers the agent holds the key in its own process to do inference, so
12
- * a compromised agent exfils from its OWN env, spawn-gating the key only breaks the child's LLM
13
- * function (the real fix is per-agent model auth, a separate roadmap item); nor (ii) filesystem
14
- * secret access HOME / XDG / platform config dirs are forwarded, so a child can still read
15
- * ~/.aws / ~/.ssh / ~/.config off disk (needs a workspace sandbox, a separate control).
2
+ * The spawned-agent env (P3) - the single chokepoint for what a child process sees.
3
+ *
4
+ * DEFAULT: a spawned agent INHERITS the operator's environment. A coding harness the operator
5
+ * installed and configured should behave under `cotal spawn` the way it behaves when they run it
6
+ * themselves, and Cotal has no business holding an opinion about which inference providers exist or
7
+ * which variables a harness reads. The list of vendor key names that used to live here was the tell:
8
+ * every new provider needed a change in Cotal before it would work through a managed spawn.
9
+ *
10
+ * EXCEPT Cotal's own `COTAL_*` namespace, which is RESET. That is not an opinion about the
11
+ * operator's environment; it is Cotal refusing to let one agent's identity become another's. A
12
+ * connector re-supplies the `COTAL_*` a child should have, but many of those assignments are
13
+ * CONDITIONAL - {@link aclEnv} omits an empty ACL so the connector can defer to the persona file,
14
+ * {@link materialEnv} returns `{}` when a launch carries nothing to hand over, `if (opts.role)`,
15
+ * `if (opts.lifecycleUid)` - so an inherited value is never overwritten and survives into a child
16
+ * that was never granted it.
17
+ *
18
+ * The prefix is stripped WHOLESALE rather than by a named deny-list, because the danger is
19
+ * ASYMMETRY rather than any single omission: `COTAL_EVENTS` and `COTAL_WORKSPACE_ROOT` are set by
20
+ * opencode/claude/codex and NOT by hermes/pi, `COTAL_CHANNEL` only by claude, `COTAL_VARIANT` only
21
+ * by opencode/codex, the `COTAL_CODEX_*` family only by codex. A hand-maintained deny-list names
22
+ * what its author remembers. The repo has a worked example: six suite files reached main each
23
+ * blanking exactly `COTAL_SPACE`, `COTAL_SERVERS` and `COTAL_CREDS` by hand before spreading
24
+ * `...process.env` into a `cotal attach` child, which let the lifecycle uid, the control token, both
25
+ * identity quads and {@link LAUNCH_MATERIAL_ENV} through to a process that reads connection
26
+ * material. {@link OPERATOR_ENV_KEEP} is the inverse and is safe for the same reason a deny-list is
27
+ * not: every name on it is one no connector assigns per spawn, so a new connector cannot invalidate
28
+ * it by forgetting something.
29
+ *
30
+ * OPT-IN CONTAINMENT: an operator who wants the child confined sets `spawn.env` in the cotal config
31
+ * file; the caller resolves it and passes it as `envAllow`. The child then gets the OS allow-list
32
+ * plus exactly the names declared there, and nothing else.
33
+ *
34
+ * Scope this is HONEST about (P6). NEITHER mode closes filesystem secret access: HOME / XDG /
35
+ * platform config dirs are forwarded either way, so a child with a shell reads ~/.aws, ~/.ssh,
36
+ * ~/.config and ~/.cotal straight off disk. An allow-list stops env-ONLY secrets - an
37
+ * `aws-vault exec` or `op run` shell, CI-injected values - and nothing that has a file behind it.
38
+ * Nor does either mode close model-key exfil: a key-based agent holds its provider key in its own
39
+ * process in order to do inference. What DOES narrow under inherit is that Cotal's own connection
40
+ * material is no longer in the environment at all: {@link materialEnv} moved the credential, the
41
+ * broker address and the control token behind a 0600 file, so what a child now inherits from the
42
+ * `COTAL_*` namespace is a path this function removes, not a secret.
16
43
  */
17
44
  import { type McpServerSpec } from "@cotal-ai/core";
18
- /** Model-provider API keys a key-based connector may forward to its child. claude needs none
19
- * (macOS Keychain / OAuth token, not an env key) strong isolation for free; opencode/hermes
20
- * need the key for the provider behind the agent's model forward just these, by NAME, only if
21
- * present. This is the single chokepoint for model-key forwarding the seam for spawner-
22
- * conditional gating (per-agent model auth) later. Never `...process.env`. */
23
- export declare const MODEL_PROVIDER_KEYS: readonly ["OPENCODE_API_KEY", "ANTHROPIC_API_KEY", "OPENAI_API_KEY", "OPENROUTER_API_KEY", "NOUS_API_KEY", "NEBIUS_API_KEY"];
24
- /** Build the base env a spawned agent runs with: the OS allow-list plus any named keys the
25
- * connector declares the agent needs `providerKeys` (the model-provider key) and `mcpKeys`
26
- * (the `${VAR}` secrets a shared MCP server references, see {@link mcpServerEnvKeys}). Every entry
27
- * is copied from the manager's env BY NAME and only when present — never required, never spread
28
- * wholesale, so the operator's unrelated secrets don't bleed into the child (P3).
29
- *
30
- * Matching is CASE-INSENSITIVE and each value is copied under the OS's OWN key casing: Windows
31
- * spells these `Path`/`ComSpec`/`windir`, so a canonical-only copy would either miss them (a plain
32
- * read of `process.env.SystemRoot` differs from `process.env.systemroot`) or, worse, emit BOTH
33
- * `Path` and `PATH` a case-duplicate Windows process creation chokes on. Keying off the source
34
- * env's actual casing (one entry per lowercased name) forwards each var exactly once. */
45
+ /** The `COTAL_*` an operator sets MACHINE-WIDE, which a child legitimately needs. The qualifying
46
+ * property is not "harmless" but "no connector assigns it per spawn": a name no launch path writes
47
+ * cannot carry one agent's grant into another, which is why this list stays correct as connectors
48
+ * are added and a deny-list would not. `COTAL_HOME` is the load-bearing entry - it redirects the
49
+ * mesh registry, and a child that shells out to `cotal` must resolve the one its parent did.
50
+ * `COTAL_CODEX_BIN` and its siblings are operator binary overrides, and sit here precisely BECAUSE
51
+ * the neighbouring per-launch `COTAL_CODEX_HOME`/`_CONFIG`/`_TUI`/`_PROMPT` do not. */
52
+ export declare const OPERATOR_ENV_KEEP: readonly ["COTAL_HOME", "COTAL_FEEDBACK_KEY", "COTAL_FEEDBACK_EMAIL", "COTAL_FEEDBACK_URL", "COTAL_DEFAULT_AGENT", "COTAL_DEFAULT_PERSONA", "COTAL_SKIP_CONNECTOR_SEED", "COTAL_SKIP_ASSIST", "COTAL_DETACH_KEY", "COTAL_COMPLETE_DEBUG", "COTAL_DEBUG", "COTAL_SERVE_HEADLESS", "COTAL_EVENTS_DEFAULT", "COTAL_MEMBERSHIP_INTERVAL_MS", "COTAL_DELIVERY_BROKER_GONE_MS", "COTAL_IDP_TIMEOUT_MS", "COTAL_CODEX_BIN", "COTAL_OPENCODE_BIN", "COTAL_ORCA_BIN"];
53
+ /** Build the base env a spawned agent runs with.
54
+ *
55
+ * DEFAULT (`envAllow` absent): the operator's environment minus {@link SESSION_ENV_PREFIX}, keeping
56
+ * {@link OPERATOR_ENV_KEEP}. The connector layers this child's own `COTAL_*` on top, so every
57
+ * per-session name it ends up with was granted to IT.
58
+ *
59
+ * OPT-IN (`envAllow` present, from the config file's `spawn.env`): the OS allow-list plus exactly
60
+ * the declared names and `mcpKeys` (the `${VAR}` secrets a shared MCP server references, see
61
+ * {@link mcpServerEnvKeys}). Each is copied BY NAME and only when present. An EMPTY array is a real
62
+ * policy - the OS allow-list alone - and not "unset", which is why the mode is chosen on
63
+ * `!== undefined` rather than on length.
64
+ *
65
+ * Allow-list matching is CASE-INSENSITIVE and each value is copied under the OS's OWN key casing:
66
+ * Windows spells these `Path`/`ComSpec`/`windir`, so a canonical-only copy would either miss them
67
+ * (a plain read of `process.env.SystemRoot` differs from `process.env.systemroot`) or, worse, emit
68
+ * BOTH `Path` and `PATH` - a case-duplicate Windows process creation chokes on. Keying off the
69
+ * source env's actual casing (one entry per lowercased name) forwards each var exactly once. */
35
70
  export declare function launchEnv(opts?: {
36
- providerKeys?: readonly string[];
37
71
  mcpKeys?: readonly string[];
72
+ envAllow?: readonly string[];
38
73
  }): Record<string, string>;
39
74
  /** The agent's resolved access policy as `COTAL_*` env, when present. Forwarded by each connector
40
75
  * so the spawned session's runtime read/post set matches the creds the manager minted from the
@@ -60,11 +95,29 @@ export declare function aclEnv(opts: {
60
95
  * would corrupt the config object or garble a rendered flag. Core never sees this; each connector
61
96
  * calls it for the surface IT renders. */
62
97
  export declare function connectorLaunchOptions(connector: string, launchOptions: Record<string, unknown> | undefined): [string, unknown][];
63
- /** USER-MODE launch identity as `COTAL_*` env, when present — the one place the LaunchOpts.userAuth
64
- * env mapping lives, so every connector forwards the identical contract configFromEnv parses.
65
- * Refuses a creds+userAuth combination here (one launch, one identity plane — U10). */
66
- export declare function userAuthEnv(opts: {
98
+ /**
99
+ * The launch's CONNECTION MATERIAL as a private file, and one env entry naming it.
100
+ *
101
+ * This replaces `userAuthEnv` and the per-connector `COTAL_CREDS` / `COTAL_SERVERS` /
102
+ * `COTAL_CONTROL_TOKEN` assignments it used to sit beside. Those put the broker address, the
103
+ * credential and a control-plane bearer into the seat's process environment, which every descendant
104
+ * of the seat inherits: the build it runs, the linter, the third-party CLI, the test suite that
105
+ * reads its broker from the environment. Nothing in that chain asked for any of it, and there is no
106
+ * moment where a human sees a credential being handed over, so there is no natural moment to object.
107
+ *
108
+ * Now they ride a 0600 file (see `writeLaunchMaterial`) and only its PATH is exported. The identity
109
+ * that is not secret - space, name, role, id, lifecycle uid, the ACLs, the control SOCKET path -
110
+ * stays in the environment where the launcher's contract has always put it, because a descendant
111
+ * learning the seat's name is not the failure.
112
+ *
113
+ * Refuses a creds+userAuth combination here (one launch, one identity plane - U10), which is where
114
+ * `userAuthEnv` refused it.
115
+ */
116
+ export declare function materialEnv(opts: {
67
117
  creds?: string;
118
+ servers?: string;
119
+ token?: string;
120
+ controlToken?: string;
68
121
  userAuth?: {
69
122
  owner: string;
70
123
  actor: string;
@@ -1 +1 @@
1
- {"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../src/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAiD,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AA0DnG;;;;+EAI+E;AAC/E,eAAO,MAAM,mBAAmB,8HAOtB,CAAC;AAEX;;;;;;;;;;0FAU0F;AAC1F,wBAAgB,SAAS,CACvB,IAAI,GAAE;IAAE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAO,GAC3E,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED;;;;;mFAKmF;AACnF,wBAAgB,MAAM,CAAC,IAAI,EAAE;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE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,CAAC;IACtB,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC7F,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAczB;AAED;;;;;;;;;;;;;;;;qFAgBqF;AACrF,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;6CAY6C;AAC7C,wBAAgB,sBAAsB,CACpC,EAAE,EAAE;IAAE,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,GAC7E,MAAM,CASR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,GAC9E,MAAM,CAwCR;AAED;;;;kEAIkE;AAClE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,EAAE,CAcjF"}
package/dist/launch.js CHANGED
@@ -1,20 +1,47 @@
1
1
  /**
2
- * The spawned-agent env allow-list (P3) the single chokepoint for what a child process sees.
2
+ * The spawned-agent env (P3) - the single chokepoint for what a child process sees.
3
3
  *
4
- * Connectors build the child's env as `{ ...launchEnv(...), <COTAL_* identity>, <connector vars> }`
5
- * and the runtimes pass ONLY that (never `...process.env`). So the operator's *unrelated* env
6
- * (AWS creds, GH tokens, other service keys sitting in their shell) stops bleeding into every
7
- * spawned child. What a child sees is auditable from the spec, not "whatever the manager
8
- * inherited."
4
+ * DEFAULT: a spawned agent INHERITS the operator's environment. A coding harness the operator
5
+ * installed and configured should behave under `cotal spawn` the way it behaves when they run it
6
+ * themselves, and Cotal has no business holding an opinion about which inference providers exist or
7
+ * which variables a harness reads. The list of vendor key names that used to live here was the tell:
8
+ * every new provider needed a change in Cotal before it would work through a managed spawn.
9
9
  *
10
- * Scope this is HONEST about (P6): it closes ENV-VAR bleed. It does NOT close (i) model-key
11
- * exfil for key-based providers the agent holds the key in its own process to do inference, so
12
- * a compromised agent exfils from its OWN env, spawn-gating the key only breaks the child's LLM
13
- * function (the real fix is per-agent model auth, a separate roadmap item); nor (ii) filesystem
14
- * secret access HOME / XDG / platform config dirs are forwarded, so a child can still read
15
- * ~/.aws / ~/.ssh / ~/.config off disk (needs a workspace sandbox, a separate control).
10
+ * EXCEPT Cotal's own `COTAL_*` namespace, which is RESET. That is not an opinion about the
11
+ * operator's environment; it is Cotal refusing to let one agent's identity become another's. A
12
+ * connector re-supplies the `COTAL_*` a child should have, but many of those assignments are
13
+ * CONDITIONAL - {@link aclEnv} omits an empty ACL so the connector can defer to the persona file,
14
+ * {@link materialEnv} returns `{}` when a launch carries nothing to hand over, `if (opts.role)`,
15
+ * `if (opts.lifecycleUid)` - so an inherited value is never overwritten and survives into a child
16
+ * that was never granted it.
17
+ *
18
+ * The prefix is stripped WHOLESALE rather than by a named deny-list, because the danger is
19
+ * ASYMMETRY rather than any single omission: `COTAL_EVENTS` and `COTAL_WORKSPACE_ROOT` are set by
20
+ * opencode/claude/codex and NOT by hermes/pi, `COTAL_CHANNEL` only by claude, `COTAL_VARIANT` only
21
+ * by opencode/codex, the `COTAL_CODEX_*` family only by codex. A hand-maintained deny-list names
22
+ * what its author remembers. The repo has a worked example: six suite files reached main each
23
+ * blanking exactly `COTAL_SPACE`, `COTAL_SERVERS` and `COTAL_CREDS` by hand before spreading
24
+ * `...process.env` into a `cotal attach` child, which let the lifecycle uid, the control token, both
25
+ * identity quads and {@link LAUNCH_MATERIAL_ENV} through to a process that reads connection
26
+ * material. {@link OPERATOR_ENV_KEEP} is the inverse and is safe for the same reason a deny-list is
27
+ * not: every name on it is one no connector assigns per spawn, so a new connector cannot invalidate
28
+ * it by forgetting something.
29
+ *
30
+ * OPT-IN CONTAINMENT: an operator who wants the child confined sets `spawn.env` in the cotal config
31
+ * file; the caller resolves it and passes it as `envAllow`. The child then gets the OS allow-list
32
+ * plus exactly the names declared there, and nothing else.
33
+ *
34
+ * Scope this is HONEST about (P6). NEITHER mode closes filesystem secret access: HOME / XDG /
35
+ * platform config dirs are forwarded either way, so a child with a shell reads ~/.aws, ~/.ssh,
36
+ * ~/.config and ~/.cotal straight off disk. An allow-list stops env-ONLY secrets - an
37
+ * `aws-vault exec` or `op run` shell, CI-injected values - and nothing that has a file behind it.
38
+ * Nor does either mode close model-key exfil: a key-based agent holds its provider key in its own
39
+ * process in order to do inference. What DOES narrow under inherit is that Cotal's own connection
40
+ * material is no longer in the environment at all: {@link materialEnv} moved the credential, the
41
+ * broker address and the control token behind a 0600 file, so what a child now inherits from the
42
+ * `COTAL_*` namespace is a path this function removes, not a secret.
16
43
  */
17
- import { eventChannel, parsePrincipalKey, principalKey } from "@cotal-ai/core";
44
+ import { eventChannel, LAUNCH_MATERIAL_ENV, parsePrincipalKey, principalKey, writeLaunchMaterial, } from "@cotal-ai/core";
18
45
  /** OS env a coding-agent TUI genuinely needs to run — find its binary (PATH), render (TERM /
19
46
  * COLORTERM), resolve home/config/data roots (HOME / XDG_*_HOME on Unix,
20
47
  * USERPROFILE / APPDATA / LOCALAPPDATA on Windows), locale (LANG / LC_*), timezone (TZ), temp
@@ -70,49 +97,89 @@ const OS_ENV_ALLOW = [
70
97
  "CommonProgramFiles",
71
98
  "PUBLIC",
72
99
  ];
73
- /** Model-provider API keys a key-based connector may forward to its child. claude needs none
74
- * (macOS Keychain / OAuth token, not an env key) → strong isolation for free; opencode/hermes
75
- * need the key for the provider behind the agent's model forward just these, by NAME, only if
76
- * present. This is the single chokepoint for model-key forwarding — the seam for spawner-
77
- * conditional gating (per-agent model auth) later. Never `...process.env`. */
78
- export const MODEL_PROVIDER_KEYS = [
79
- "OPENCODE_API_KEY",
80
- "ANTHROPIC_API_KEY",
81
- "OPENAI_API_KEY",
82
- "OPENROUTER_API_KEY",
83
- "NOUS_API_KEY",
84
- "NEBIUS_API_KEY",
100
+ /** Cotal's own per-session namespace. Everything under this prefix is reset before a child starts,
101
+ * except {@link OPERATOR_ENV_KEEP}. Compared case-INSENSITIVELY: Windows env lookup is
102
+ * case-insensitive, so a stray `Cotal_Creds` must not slip past a case-sensitive test. */
103
+ const SESSION_ENV_PREFIX = "COTAL_";
104
+ /** The `COTAL_*` an operator sets MACHINE-WIDE, which a child legitimately needs. The qualifying
105
+ * property is not "harmless" but "no connector assigns it per spawn": a name no launch path writes
106
+ * cannot carry one agent's grant into another, which is why this list stays correct as connectors
107
+ * are added and a deny-list would not. `COTAL_HOME` is the load-bearing entry - it redirects the
108
+ * mesh registry, and a child that shells out to `cotal` must resolve the one its parent did.
109
+ * `COTAL_CODEX_BIN` and its siblings are operator binary overrides, and sit here precisely BECAUSE
110
+ * the neighbouring per-launch `COTAL_CODEX_HOME`/`_CONFIG`/`_TUI`/`_PROMPT` do not. */
111
+ export const OPERATOR_ENV_KEEP = [
112
+ "COTAL_HOME",
113
+ "COTAL_FEEDBACK_KEY",
114
+ "COTAL_FEEDBACK_EMAIL",
115
+ "COTAL_FEEDBACK_URL",
116
+ "COTAL_DEFAULT_AGENT",
117
+ "COTAL_DEFAULT_PERSONA",
118
+ "COTAL_SKIP_CONNECTOR_SEED",
119
+ "COTAL_SKIP_ASSIST",
120
+ "COTAL_DETACH_KEY",
121
+ "COTAL_COMPLETE_DEBUG",
122
+ "COTAL_DEBUG",
123
+ "COTAL_SERVE_HEADLESS",
124
+ "COTAL_EVENTS_DEFAULT",
125
+ "COTAL_MEMBERSHIP_INTERVAL_MS",
126
+ "COTAL_DELIVERY_BROKER_GONE_MS",
127
+ "COTAL_IDP_TIMEOUT_MS",
128
+ "COTAL_CODEX_BIN",
129
+ "COTAL_OPENCODE_BIN",
130
+ "COTAL_ORCA_BIN",
85
131
  ];
86
- /** Build the base env a spawned agent runs with: the OS allow-list plus any named keys the
87
- * connector declares the agent needs — `providerKeys` (the model-provider key) and `mcpKeys`
88
- * (the `${VAR}` secrets a shared MCP server references, see {@link mcpServerEnvKeys}). Every entry
89
- * is copied from the manager's env BY NAME and only when present — never required, never spread
90
- * wholesale, so the operator's unrelated secrets don't bleed into the child (P3).
132
+ /** Build the base env a spawned agent runs with.
91
133
  *
92
- * Matching is CASE-INSENSITIVE and each value is copied under the OS's OWN key casing: Windows
93
- * spells these `Path`/`ComSpec`/`windir`, so a canonical-only copy would either miss them (a plain
94
- * read of `process.env.SystemRoot` differs from `process.env.systemroot`) or, worse, emit BOTH
95
- * `Path` and `PATH` — a case-duplicate Windows process creation chokes on. Keying off the source
96
- * env's actual casing (one entry per lowercased name) forwards each var exactly once. */
134
+ * DEFAULT (`envAllow` absent): the operator's environment minus {@link SESSION_ENV_PREFIX}, keeping
135
+ * {@link OPERATOR_ENV_KEEP}. The connector layers this child's own `COTAL_*` on top, so every
136
+ * per-session name it ends up with was granted to IT.
137
+ *
138
+ * OPT-IN (`envAllow` present, from the config file's `spawn.env`): the OS allow-list plus exactly
139
+ * the declared names and `mcpKeys` (the `${VAR}` secrets a shared MCP server references, see
140
+ * {@link mcpServerEnvKeys}). Each is copied BY NAME and only when present. An EMPTY array is a real
141
+ * policy - the OS allow-list alone - and not "unset", which is why the mode is chosen on
142
+ * `!== undefined` rather than on length.
143
+ *
144
+ * Allow-list matching is CASE-INSENSITIVE and each value is copied under the OS's OWN key casing:
145
+ * Windows spells these `Path`/`ComSpec`/`windir`, so a canonical-only copy would either miss them
146
+ * (a plain read of `process.env.SystemRoot` differs from `process.env.systemroot`) or, worse, emit
147
+ * BOTH `Path` and `PATH` - a case-duplicate Windows process creation chokes on. Keying off the
148
+ * source env's actual casing (one entry per lowercased name) forwards each var exactly once. */
97
149
  export function launchEnv(opts = {}) {
150
+ if (opts.envAllow !== undefined) {
151
+ const env = {};
152
+ // lowercased name -> the OS's actual key casing; one entry per var (the OS env has no case-dup),
153
+ // so every allow-list name resolves to a single source key and the result carries no case-dup.
154
+ const sourceKey = new Map();
155
+ for (const k of Object.keys(process.env))
156
+ sourceKey.set(k.toLowerCase(), k);
157
+ const copy = (name) => {
158
+ const src = sourceKey.get(name.toLowerCase());
159
+ if (src === undefined)
160
+ return;
161
+ const v = process.env[src];
162
+ if (v !== undefined)
163
+ env[src] = v;
164
+ };
165
+ for (const k of OS_ENV_ALLOW)
166
+ copy(k);
167
+ for (const k of [...opts.envAllow, ...(opts.mcpKeys ?? [])])
168
+ copy(k);
169
+ return env;
170
+ }
171
+ // Inherit. `mcpKeys` needs no handling in this mode: a `${VAR}` a shared MCP server references is
172
+ // already in the operator's environment, which is what the child is being given.
173
+ const keep = new Set(OPERATOR_ENV_KEEP);
98
174
  const env = {};
99
- // lowercased name -> the OS's actual key casing; one entry per var (the OS env has no case-dup),
100
- // so every allow-list name resolves to a single source key and the result carries no case-dup.
101
- const sourceKey = new Map();
102
- for (const k of Object.keys(process.env))
103
- sourceKey.set(k.toLowerCase(), k);
104
- const copy = (name) => {
105
- const src = sourceKey.get(name.toLowerCase());
106
- if (src === undefined)
107
- return;
108
- const v = process.env[src];
109
- if (v !== undefined)
110
- env[src] = v;
111
- };
112
- for (const k of OS_ENV_ALLOW)
113
- copy(k);
114
- for (const k of [...(opts.providerKeys ?? []), ...(opts.mcpKeys ?? [])])
115
- copy(k);
175
+ for (const [k, v] of Object.entries(process.env)) {
176
+ if (v === undefined)
177
+ continue;
178
+ const canon = k.toUpperCase();
179
+ if (canon.startsWith(SESSION_ENV_PREFIX) && !keep.has(canon))
180
+ continue;
181
+ env[k] = v;
182
+ }
116
183
  return env;
117
184
  }
118
185
  /** The agent's resolved access policy as `COTAL_*` env, when present. Forwarded by each connector
@@ -167,20 +234,44 @@ export function connectorLaunchOptions(connector, launchOptions) {
167
234
  throw new Error(`${connector} connector: launch option key ${JSON.stringify(k)} is not a valid flag name`);
168
235
  return Object.entries(launchOptions);
169
236
  }
170
- /** USER-MODE launch identity as `COTAL_*` env, when present — the one place the LaunchOpts.userAuth
171
- * env mapping lives, so every connector forwards the identical contract configFromEnv parses.
172
- * Refuses a creds+userAuth combination here (one launch, one identity plane — U10). */
173
- export function userAuthEnv(opts) {
174
- if (!opts.userAuth)
175
- return {};
176
- if (opts.creds)
237
+ /**
238
+ * The launch's CONNECTION MATERIAL as a private file, and one env entry naming it.
239
+ *
240
+ * This replaces `userAuthEnv` and the per-connector `COTAL_CREDS` / `COTAL_SERVERS` /
241
+ * `COTAL_CONTROL_TOKEN` assignments it used to sit beside. Those put the broker address, the
242
+ * credential and a control-plane bearer into the seat's process environment, which every descendant
243
+ * of the seat inherits: the build it runs, the linter, the third-party CLI, the test suite that
244
+ * reads its broker from the environment. Nothing in that chain asked for any of it, and there is no
245
+ * moment where a human sees a credential being handed over, so there is no natural moment to object.
246
+ *
247
+ * Now they ride a 0600 file (see `writeLaunchMaterial`) and only its PATH is exported. The identity
248
+ * that is not secret - space, name, role, id, lifecycle uid, the ACLs, the control SOCKET path -
249
+ * stays in the environment where the launcher's contract has always put it, because a descendant
250
+ * learning the seat's name is not the failure.
251
+ *
252
+ * Refuses a creds+userAuth combination here (one launch, one identity plane - U10), which is where
253
+ * `userAuthEnv` refused it.
254
+ */
255
+ export function materialEnv(opts) {
256
+ if (opts.userAuth && opts.creds)
177
257
  throw new Error("launch: creds (static auth) and userAuth (user-mode auth) are mutually exclusive — one launch carries one identity plane");
178
- return {
179
- COTAL_OWNER: opts.userAuth.owner,
180
- COTAL_ACTOR: opts.userAuth.actor,
181
- COTAL_SENTINEL_CREDS: opts.userAuth.sentinelCredsPath,
182
- COTAL_BEARER_CMD: JSON.stringify(opts.userAuth.bearerCmd),
183
- };
258
+ const material = {};
259
+ if (opts.creds)
260
+ material.creds = opts.creds;
261
+ if (opts.servers)
262
+ material.servers = opts.servers;
263
+ if (opts.token)
264
+ material.token = opts.token;
265
+ if (opts.controlToken)
266
+ material.controlToken = opts.controlToken;
267
+ if (opts.userAuth)
268
+ material.userAuth = opts.userAuth;
269
+ // Nothing to hand over (an open mesh launched with no control endpoint) → no file and no env
270
+ // entry, rather than a file that says nothing. writeLaunchMaterial refuses the empty case too;
271
+ // this is the caller-side half of the same rule.
272
+ if (Object.keys(material).length === 0)
273
+ return {};
274
+ return { [LAUNCH_MATERIAL_ENV]: writeLaunchMaterial(material) };
184
275
  }
185
276
  /** The per-agent EVENT channel and its classifier, RE-EXPORTED FROM CORE.
186
277
  *
@@ -1 +1 @@
1
- {"version":3,"file":"launch.js","sourceRoot":"","sources":["../src/launch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAsB,MAAM,gBAAgB,CAAC;AAEnG;;;;;;;;kGAQkG;AAClG,MAAM,YAAY,GAAG;IACnB,MAAM;IACN,MAAM;IACN,aAAa;IACb,WAAW;IACX,UAAU;IACV,MAAM;IACN,SAAS;IACT,OAAO;IACP,SAAS;IACT,SAAS;IACT,MAAM;IACN,WAAW;IACX,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;IACV,aAAa;IACb,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,KAAK;IACL,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,cAAc;IACd,iBAAiB;IACjB,8FAA8F;IAC9F,gGAAgG;IAChG,kGAAkG;IAClG,kGAAkG;IAClG,0DAA0D;IAC1D,YAAY;IACZ,QAAQ;IACR,aAAa;IACb,wBAAwB;IACxB,sBAAsB;IACtB,iBAAiB;IACjB,aAAa;IACb,cAAc;IACd,mBAA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ACF,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG;YAAE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACf,IAAI,IAAI,CAAC,OAAO;YAAE,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../src/relay.ts"],"names":[],"mappings":"AAuDA,6FAA6F;AAC7F,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAuElD"}
1
+ {"version":3,"file":"relay.d.ts","sourceRoot":"","sources":["../src/relay.ts"],"names":[],"mappings":"AAoFA,6FAA6F;AAC7F,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAuFlD"}
package/dist/relay.js CHANGED
@@ -8,9 +8,39 @@
8
8
  * entry points are one-liners over {@link runHookRelay}.
9
9
  */
10
10
  import { connect } from "node:net";
11
- import { hasIdentity } from "./config.js";
11
+ import { controlFromEnv, hasIdentity } from "./config.js";
12
12
  import { HANDOFF_RECEIPT } from "./control.js";
13
13
  const TIMEOUT_MS = 2000;
14
+ /**
15
+ * One bounded warning per hook process, on stderr, with no values in it.
16
+ *
17
+ * FAIL OPEN IS NOT THE SAME AS FAIL SILENT, and this relay was doing both. A hook that throws is a
18
+ * hook that blocked a human's session, so the catch below stays. But a material file that is
19
+ * missing, permissive, malformed, or contradicted by a direct carrier used to produce a hook that
20
+ * did nothing and said nothing: the seat runs, presence never advances, no queued peer message is
21
+ * ever injected, and there is no line anywhere to read. That is the same failure this connector's
22
+ * Python counterpart shipped, one connector over, and it is why the repair is a WARNING rather than
23
+ * a stricter refusal.
24
+ *
25
+ * Bounded means once per process, and the runtime starts one hook process per lifecycle event, so a
26
+ * genuinely broken session keeps saying so. That is the intended trade: the alternative is a single
27
+ * line early in a session that scrolls away, for a fault that persists until someone fixes the
28
+ * launch. Nothing is interpolated into the message. The variable NAMES are the diagnosis and the
29
+ * operator can read their own environment; a value in a hook's stderr is a disclosure in whatever
30
+ * captures that stream.
31
+ */
32
+ let warned = false;
33
+ function warnOnce(message) {
34
+ if (warned)
35
+ return;
36
+ warned = true;
37
+ try {
38
+ process.stderr.write(`[cotal-connector] ${message}\n`);
39
+ }
40
+ catch {
41
+ /* a hook that cannot even warn still must not block the session */
42
+ }
43
+ }
14
44
  function readStdin() {
15
45
  return new Promise((resolve) => {
16
46
  if (process.stdin.isTTY)
@@ -56,13 +86,28 @@ function done(out, confirm) {
56
86
  export async function runHookRelay() {
57
87
  if (!hasIdentity())
58
88
  return done(""); // plain session, not a managed one — no-op
59
- // Path + token come from the launch env (shared with the in-agent server, which we inherited from);
60
- // never recomputed from public identity. Absent not an authenticated control session: no-op (fail
61
- // open, so a hook never blocks the user's session).
62
- const path = process.env.COTAL_CONTROL_SOCKET;
63
- const token = process.env.COTAL_CONTROL_TOKEN;
64
- if (!path || !token)
89
+ // The socket path comes from the launch env; the token comes from the launch-material file that
90
+ // env points at (the same file the in-agent server reads), never recomputed from public identity.
91
+ // A malformed or missing material file THROWS from controlFromEnv, and a hook that throws is a
92
+ // hook that blocked the session, so it is caught here and treated as "no control session": fail
93
+ // open is this relay's whole contract.
94
+ let control;
95
+ try {
96
+ control = controlFromEnv();
97
+ }
98
+ catch {
99
+ warnOnce("this session's control endpoint could not be resolved: the launch material is missing, " +
100
+ "unreadable, readable beyond its owner, malformed, or contradicted by direct COTAL_ variables. " +
101
+ "Lifecycle relays are disabled for this session, so presence will not advance and queued peer " +
102
+ "messages will not be injected. Check COTAL_LAUNCH_MATERIAL and COTAL_CONTROL_SOCKET.");
103
+ return done("");
104
+ }
105
+ // No control endpoint AT ALL is not a fault and is not warned about: a hand-driven session that
106
+ // sets COTAL_NAME and never had a control socket is a legitimate launch, and warning here would
107
+ // fire on every hook of a working session and teach the operator to ignore the channel.
108
+ if (!control)
65
109
  return done("");
110
+ const { path, token } = control;
66
111
  const raw = (await readStdin()).trim() || "{}";
67
112
  let event = {};
68
113
  try {
package/dist/relay.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"relay.js","sourceRoot":"","sources":["../src/relay.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,SAAS,SAAS;IAChB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK;YAAE,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC1C,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,OAAO,CAAC,KAAK,CA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