@zgeoff/atc 2.36.1 → 2.38.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 +2 -1
- package/package.json +1 -1
- package/src/agents/agent-adapter.ts +6 -1
- package/src/agents/build-agent-adapters.ts +32 -0
- package/src/agents/build-claude-config-seed.ts +7 -4
- package/src/agents/build-claude-mcp-config.ts +27 -0
- package/src/agents/claude-adapter.ts +157 -66
- package/src/agents/codex-adapter.ts +17 -11
- package/src/agents/gateway-adapter.ts +17 -1
- package/src/agents/grok-adapter.ts +15 -9
- package/src/build-migrated-config.ts +196 -0
- package/src/cli.ts +49 -17
- package/src/client/collect-agent-picks.ts +3 -10
- package/src/client/index.ts +1 -1
- package/src/client/resolve-agent-metadata.ts +4 -10
- package/src/client/spawn-picker.ts +1 -2
- package/src/daemon/build-auth-binding.ts +2 -1
- package/src/daemon/daemon-connection.ts +1 -1
- package/src/daemon/daemon.ts +12 -3
- package/src/daemon/sessions.ts +8 -2
- package/src/mcp/build-spawn-descriptions.ts +2 -2
- package/src/run-config-migrate.ts +85 -0
- package/src/shared/check-gateway-auth.ts +173 -0
- package/src/shared/collect-agents.ts +349 -0
- package/src/shared/collect-claude-auth.ts +125 -10
- package/src/shared/collect-gateways.ts +2 -168
- package/src/shared/collect-legacy-agents.ts +80 -0
- package/src/shared/config.ts +70 -60
- package/src/shared/format-mixed-agent-keys.ts +10 -0
- package/src/shared/is-subscription-override-variable.ts +14 -0
- package/src/shared/legacy-agent-keys.ts +15 -0
- package/src/shared/outranking-variables.ts +17 -0
- package/src/shared/pick-default-agent.ts +12 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isBrokerVariable } from './is-broker-variable';
|
|
2
|
+
import { OUTRANKING_VARIABLES } from './outranking-variables';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Whether a variable set in a Claude session's environment would override
|
|
6
|
+
* the subscription sign-in or route the CLI around impd's broker: an
|
|
7
|
+
* outranking credential, endpoint, or provider selector, the subscription
|
|
8
|
+
* token variable itself, or a proxy or CA variable.
|
|
9
|
+
*/
|
|
10
|
+
export function isSubscriptionOverrideVariable(key: string): boolean {
|
|
11
|
+
return OUTRANKING_VARIABLES.has(key) || key === OAUTH_VARIABLE || isBrokerVariable(key);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const OAUTH_VARIABLE = 'CLAUDE_CODE_OAUTH_TOKEN';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The config.json keys of the old agent shape, which `agents` replaces: the
|
|
3
|
+
* harness binaries and arguments, the Claude subscription auth, and the
|
|
4
|
+
* gateway map.
|
|
5
|
+
*/
|
|
6
|
+
export const LEGACY_AGENT_KEYS: readonly string[] = [
|
|
7
|
+
'claudeBin',
|
|
8
|
+
'claudeArgs',
|
|
9
|
+
'claudeAuth',
|
|
10
|
+
'grokBin',
|
|
11
|
+
'grokArgs',
|
|
12
|
+
'codexBin',
|
|
13
|
+
'codexArgs',
|
|
14
|
+
'gateways',
|
|
15
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The variables that keep Claude Code from sending the subscription token
|
|
3
|
+
* to the Anthropic API: a credential it takes ahead of that token, another
|
|
4
|
+
* endpoint, or a cloud provider it signs in to instead.
|
|
5
|
+
*/
|
|
6
|
+
export const OUTRANKING_VARIABLES: ReadonlySet<string> = new Set([
|
|
7
|
+
'ANTHROPIC_AUTH_TOKEN',
|
|
8
|
+
'ANTHROPIC_API_KEY',
|
|
9
|
+
'ANTHROPIC_BASE_URL',
|
|
10
|
+
'CLAUDE_CODE_USE_BEDROCK',
|
|
11
|
+
'CLAUDE_CODE_USE_VERTEX',
|
|
12
|
+
'CLAUDE_CODE_USE_FOUNDRY',
|
|
13
|
+
'CLAUDE_CODE_USE_MANTLE',
|
|
14
|
+
'CLAUDE_CODE_USE_ANTHROPIC_AWS',
|
|
15
|
+
'CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD',
|
|
16
|
+
'CLAUDE_CODE_USE_GATEWAY',
|
|
17
|
+
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentID } from './agent-id';
|
|
2
|
+
import type { AgentEntry } from './collect-agents';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The agent a spawn without one runs: `claude` when the registry holds an
|
|
6
|
+
* entry with that id, else the first entry. An empty registry still reports
|
|
7
|
+
* `claude`, so a spawn is refused for want of an adapter rather than for an
|
|
8
|
+
* unknown default.
|
|
9
|
+
*/
|
|
10
|
+
export function pickDefaultAgent(agents: readonly AgentEntry[]): AgentID {
|
|
11
|
+
return agents.find((entry) => entry.id === 'claude')?.id ?? agents[0]?.id ?? 'claude';
|
|
12
|
+
}
|