@hearsay-tools/squawk 0.18.0-dev.6739 → 0.18.0-dev.6743
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/agent-config/account-identity.js +12 -11
- package/dist/agent-config/account-identity.js.map +1 -1
- package/dist/core/agent-profiles.d.ts +42 -9
- package/dist/core/agent-profiles.js +33 -26
- package/dist/core/agent-profiles.js.map +1 -1
- package/dist/core/agent-runner.d.ts +5 -0
- package/dist/core/agent-runner.js +11 -0
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/claude-cli-runner.d.ts +1 -0
- package/dist/core/codex-app-server-runner.d.ts +1 -0
- package/dist/core/cursor-print-runner.d.ts +1 -0
- package/dist/core/cursor-runner.d.ts +1 -0
- package/dist/core/omp-runner.d.ts +1 -0
- package/dist/core/opencode-server-runner.d.ts +1 -0
- package/dist/core/pi-runner.d.ts +1 -0
- package/dist/core/runner-facts.d.ts +9 -0
- package/dist/core/runner-facts.js +6 -0
- package/dist/core/runner-facts.js.map +1 -1
- package/dist/delegation/execution-identity.js +25 -30
- package/dist/delegation/execution-identity.js.map +1 -1
- package/dist/home/legacy-account-paths.js +2 -1
- package/dist/home/legacy-account-paths.js.map +1 -1
- package/dist/home/migration-accounts.d.ts +1 -1
- package/dist/home/migration-accounts.js +3 -2
- package/dist/home/migration-accounts.js.map +1 -1
- package/dist/paths.d.ts +3 -0
- package/dist/paths.js +4 -0
- package/dist/paths.js.map +1 -1
- package/dist/planner.js +4 -3
- package/dist/planner.js.map +1 -1
- package/dist/runs/auto-name.d.ts +1 -1
- package/dist/runs/auto-name.js +3 -2
- package/dist/runs/auto-name.js.map +1 -1
- package/dist/runs/store.js +2 -2
- package/dist/runs/store.js.map +1 -1
- package/dist/server/server.d.ts +58 -58
- package/dist/server/server.js +6 -10
- package/dist/server/server.js.map +1 -1
- package/dist/server-install/steps.js +24 -17
- package/dist/server-install/steps.js.map +1 -1
- package/dist/workflows/types.js +2 -3
- package/dist/workflows/types.js.map +1 -1
- package/dist/workspace/agent-accounts.js +2 -2
- package/dist/workspace/agent-accounts.js.map +1 -1
- package/dist/workspace/agent-profiles.d.ts +1 -1
- package/dist/workspace/agent-profiles.js +5 -5
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/package.json +4 -4
|
@@ -116,17 +116,18 @@ function decodeJwtClaims(token) {
|
|
|
116
116
|
* guessing from the default login would attribute one account's identity to another.
|
|
117
117
|
*/
|
|
118
118
|
export async function readAccountIdentity(provider, configDir) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return { available: false, reason: UNREADABLE_IDENTITY[provider], fields: [] };
|
|
119
|
+
const source = IDENTITY_SOURCE[provider];
|
|
120
|
+
if ('read' in source)
|
|
121
|
+
return source.read(configDir);
|
|
122
|
+
return { available: false, reason: source.unreadable, fields: [] };
|
|
124
123
|
}
|
|
125
|
-
/**
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
/** How each agent's login identity is read from an account folder, or why "Show details" has nothing. */
|
|
125
|
+
const IDENTITY_SOURCE = {
|
|
126
|
+
claude: { read: readClaudeIdentity },
|
|
127
|
+
codex: { read: readCodexIdentity },
|
|
128
|
+
opencode: { unreadable: `OpenCode keeps its login outside its config folder, so ${productName('cezar')} cannot read it.` },
|
|
129
|
+
pi: { unreadable: `${productName('cezar')} does not read which login a pi account is signed in as.` },
|
|
130
|
+
omp: { unreadable: `${productName('cezar')} does not read which login an omp account is signed in as.` },
|
|
131
|
+
cursor: { unreadable: `${productName('cezar')} does not read which login a Cursor account is signed in as.` },
|
|
131
132
|
};
|
|
132
133
|
//# sourceMappingURL=account-identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-identity.js","sourceRoot":"","sources":["../../src/agent-config/account-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CA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,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACrE,CAAC;AAED,yGAAyG;AACzG,MAAM,eAAe,GAA2G;IAC9H,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACpC,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IAClC,QAAQ,EAAE,EAAE,UAAU,EAAE,0DAA0D,WAAW,CAAC,OAAO,CAAC,kBAAkB,EAAE;IAC1H,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,0DAA0D,EAAE;IACrG,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,4DAA4D,EAAE;IACxG,MAAM,EAAE,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,8DAA8D,EAAE;CAC9G,CAAC"}
|
|
@@ -4,18 +4,51 @@ import type { ProviderId } from './provider-auth.ts';
|
|
|
4
4
|
* relocation. Workspace code resolves saved accounts; runners, auth and terminal handoff consume
|
|
5
5
|
* this mapping.
|
|
6
6
|
*/
|
|
7
|
+
/** How one provider lays out an account, declared once per provider id. */
|
|
8
|
+
export interface AccountLayout {
|
|
9
|
+
/**
|
|
10
|
+
* How a named account reaches the CLI: the variable Squawk sets, and what it takes. `folder`: the
|
|
11
|
+
* account folder. `profile-name`: a profile name parsed from the folder, which the CLI resolves
|
|
12
|
+
* under its own root. null: the provider carries no named accounts.
|
|
13
|
+
*/
|
|
14
|
+
readonly select: {
|
|
15
|
+
readonly envVar: string;
|
|
16
|
+
readonly by: 'folder' | 'profile-name';
|
|
17
|
+
} | null;
|
|
18
|
+
/** Where the agent keeps its config inside a named account folder; null: the folder itself. */
|
|
19
|
+
readonly configSubdir: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Whether a worker binding of the default account pins its discovered home. false: the default
|
|
22
|
+
* spawns bare and follows the host env, as it did before pi and omp carried accounts
|
|
23
|
+
* (hearsay-tools/cezarion#1283). A machine where the agent never ran has no home to pin.
|
|
24
|
+
*/
|
|
25
|
+
readonly defaultBindsHome: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Where the login state file sits for the discovered home. `beside-home`: next to it (Claude's
|
|
28
|
+
* `.claude.json`, see `claudeStateFilePath`), so a worker binds the home the child env resolves
|
|
29
|
+
* and records that layout. `in-home`: inside the account folder.
|
|
30
|
+
*/
|
|
31
|
+
readonly stateFile: 'in-home' | 'beside-home';
|
|
32
|
+
}
|
|
7
33
|
/**
|
|
8
|
-
* Account relocation
|
|
9
|
-
*
|
|
10
|
-
* named overrides apply last. Refuse a named omp folder outside the current profile root.
|
|
34
|
+
* Account relocation per provider. Host values define the default; named overrides apply last.
|
|
35
|
+
* Refuse a named profile-name folder outside the current profile root.
|
|
11
36
|
*/
|
|
12
|
-
export declare const
|
|
37
|
+
export declare const ACCOUNT_LAYOUT: Readonly<Record<ProviderId, AccountLayout>>;
|
|
38
|
+
/** The variable that selects a named account per provider; null means named accounts are unsupported. */
|
|
39
|
+
export declare const PROFILE_ENV_VAR: Readonly<Record<ProviderId, string | null>>;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a provider selects a named account by profile name rather than by folder. Takes a stored
|
|
42
|
+
* value, which may name no provider this version knows; such a value answers false.
|
|
43
|
+
*/
|
|
44
|
+
export declare function selectsByProfileName(provider: unknown): boolean;
|
|
13
45
|
/** Providers that can carry more than one account — what the UI offers "Add account" for. */
|
|
14
46
|
export declare const PROFILE_CAPABLE_PROVIDERS: readonly ProviderId[];
|
|
15
47
|
export declare function supportsProfiles(provider: ProviderId): boolean;
|
|
16
48
|
/**
|
|
17
|
-
* Build a provider-specific account override, or an empty object for the discovered default.
|
|
18
|
-
* takes a profile name parsed from its folder. Never emit another
|
|
49
|
+
* Build a provider-specific account override, or an empty object for the discovered default. A
|
|
50
|
+
* `profile-name` provider takes a profile name parsed from its folder. Never emit another
|
|
51
|
+
* provider’s variable.
|
|
19
52
|
*/
|
|
20
53
|
export declare function profileEnv(provider: ProviderId, configDir: string | null | undefined): Record<string, string>;
|
|
21
54
|
/**
|
|
@@ -33,9 +66,9 @@ export declare function ompProfileName(dir: string): string | null;
|
|
|
33
66
|
/** Whether omp accepts `name` as a profile of its own; `default` is omp's "no profile". */
|
|
34
67
|
export declare function isOmpProfileName(name: string): boolean;
|
|
35
68
|
/**
|
|
36
|
-
* Where the agent keeps its config inside an account folder: the folder
|
|
37
|
-
*
|
|
38
|
-
*
|
|
69
|
+
* Where the agent keeps its config inside an account folder: `configSubdir` of the folder, or the
|
|
70
|
+
* folder itself. The discovered omp default is ALREADY an agent dir (`agentHomePaths().omp`), so
|
|
71
|
+
* callers apply this to named accounts only.
|
|
39
72
|
*/
|
|
40
73
|
export declare function profileAgentDir(provider: ProviderId, dir: string): string;
|
|
41
74
|
/**
|
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* this mapping.
|
|
3
|
+
* Account relocation per provider. Host values define the default; named overrides apply last.
|
|
4
|
+
* Refuse a named profile-name folder outside the current profile root.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export const PROFILE_ENV_VAR = {
|
|
13
|
-
claude: 'CLAUDE_CONFIG_DIR',
|
|
14
|
-
codex: 'CODEX_HOME',
|
|
15
|
-
opencode: null,
|
|
16
|
-
pi: 'PI_CODING_AGENT_DIR',
|
|
6
|
+
export const ACCOUNT_LAYOUT = {
|
|
7
|
+
claude: { select: { envVar: 'CLAUDE_CONFIG_DIR', by: 'folder' }, configSubdir: null, defaultBindsHome: true, stateFile: 'beside-home' },
|
|
8
|
+
codex: { select: { envVar: 'CODEX_HOME', by: 'folder' }, configSubdir: null, defaultBindsHome: true, stateFile: 'in-home' },
|
|
9
|
+
opencode: { select: null, configSubdir: null, defaultBindsHome: false, stateFile: 'in-home' },
|
|
10
|
+
pi: { select: { envVar: 'PI_CODING_AGENT_DIR', by: 'folder' }, configSubdir: null, defaultBindsHome: false, stateFile: 'in-home' },
|
|
17
11
|
// CURSOR_CONFIG_DIR relocates configuration, not a verified whole account home.
|
|
18
|
-
cursor: null,
|
|
19
|
-
omp
|
|
12
|
+
cursor: { select: null, configSubdir: null, defaultBindsHome: false, stateFile: 'in-home' },
|
|
13
|
+
// A named omp account is a profile folder that keeps its config in `agent/`.
|
|
14
|
+
omp: { select: { envVar: 'OMP_PROFILE', by: 'profile-name' }, configSubdir: 'agent', defaultBindsHome: false, stateFile: 'in-home' },
|
|
20
15
|
};
|
|
16
|
+
/** The variable that selects a named account per provider; null means named accounts are unsupported. */
|
|
17
|
+
export const PROFILE_ENV_VAR = Object.fromEntries(Object.entries(ACCOUNT_LAYOUT).map(([provider, layout]) => [provider, layout.select?.envVar ?? null]));
|
|
18
|
+
/**
|
|
19
|
+
* Whether a provider selects a named account by profile name rather than by folder. Takes a stored
|
|
20
|
+
* value, which may name no provider this version knows; such a value answers false.
|
|
21
|
+
*/
|
|
22
|
+
export function selectsByProfileName(provider) {
|
|
23
|
+
return typeof provider === 'string' && Object.hasOwn(ACCOUNT_LAYOUT, provider)
|
|
24
|
+
&& ACCOUNT_LAYOUT[provider].select?.by === 'profile-name';
|
|
25
|
+
}
|
|
21
26
|
/** Providers that can carry more than one account — what the UI offers "Add account" for. */
|
|
22
27
|
export const PROFILE_CAPABLE_PROVIDERS = Object.keys(PROFILE_ENV_VAR).filter((provider) => PROFILE_ENV_VAR[provider] !== null);
|
|
23
28
|
export function supportsProfiles(provider) {
|
|
24
29
|
return PROFILE_ENV_VAR[provider] !== null;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
|
-
* Build a provider-specific account override, or an empty object for the discovered default.
|
|
28
|
-
* takes a profile name parsed from its folder. Never emit another
|
|
32
|
+
* Build a provider-specific account override, or an empty object for the discovered default. A
|
|
33
|
+
* `profile-name` provider takes a profile name parsed from its folder. Never emit another
|
|
34
|
+
* provider’s variable.
|
|
29
35
|
*/
|
|
30
36
|
export function profileEnv(provider, configDir) {
|
|
31
|
-
const
|
|
37
|
+
const select = ACCOUNT_LAYOUT[provider].select;
|
|
32
38
|
const dir = configDir?.trim();
|
|
33
|
-
if (
|
|
39
|
+
if (select === null || !dir)
|
|
34
40
|
return {};
|
|
35
|
-
if (
|
|
41
|
+
if (select.by === 'profile-name') {
|
|
36
42
|
const profile = ompProfileName(dir);
|
|
37
|
-
return profile === null ? {} : { [
|
|
43
|
+
return profile === null ? {} : { [select.envVar]: profile };
|
|
38
44
|
}
|
|
39
|
-
return { [
|
|
45
|
+
return { [select.envVar]: dir };
|
|
40
46
|
}
|
|
41
47
|
/** omp's own profile-name rule (omp 18.8.0, `packages/utils/src/dirs.ts`). */
|
|
42
48
|
const OMP_PROFILE_NAME_RE = /^[a-z0-9][a-z0-9._-]{0,63}$/;
|
|
@@ -66,12 +72,13 @@ export function isOmpProfileName(name) {
|
|
|
66
72
|
&& !OMP_RESERVED_NAME_RE.test(name);
|
|
67
73
|
}
|
|
68
74
|
/**
|
|
69
|
-
* Where the agent keeps its config inside an account folder: the folder
|
|
70
|
-
*
|
|
71
|
-
*
|
|
75
|
+
* Where the agent keeps its config inside an account folder: `configSubdir` of the folder, or the
|
|
76
|
+
* folder itself. The discovered omp default is ALREADY an agent dir (`agentHomePaths().omp`), so
|
|
77
|
+
* callers apply this to named accounts only.
|
|
72
78
|
*/
|
|
73
79
|
export function profileAgentDir(provider, dir) {
|
|
74
|
-
|
|
80
|
+
const subdir = ACCOUNT_LAYOUT[provider].configSubdir;
|
|
81
|
+
return subdir === null ? dir : join(dir, subdir);
|
|
75
82
|
}
|
|
76
83
|
/**
|
|
77
84
|
* Does `entries` look like a config dir this provider actually wrote?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-profiles.js","sourceRoot":"","sources":["../../src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AC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAoB,EAAE,OAA0B;IAClF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,6EAA6E;AAC7E,MAAM,mBAAmB,GAA0C;IACjE,8FAA8F;IAC9F,yCAAyC;IACzC,MAAM,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,CAAC;IACjE,KAAK,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;IACnC,8FAA8F;IAC9F,qDAAqD;IACrD,QAAQ,EAAE,EAAE;IACZ,EAAE,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,UAAU,CAAC;IAC7D,MAAM,EAAE,EAAE;IACV,4FAA4F;IAC5F,2FAA2F;IAC3F,GAAG,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC;CACrD,CAAC"}
|
|
@@ -17,6 +17,11 @@ export type RunnerId = (typeof RUNNER_IDS)[number];
|
|
|
17
17
|
export type AgentBackend = RunnerId | 'claude-cli';
|
|
18
18
|
/** Narrow an arbitrary string (a config value, a check name) to a runner id. */
|
|
19
19
|
export declare function isRunnerId(value: string): value is RunnerId;
|
|
20
|
+
/**
|
|
21
|
+
* The runner a backend value names. A legacy id maps to its runner; undefined and an unknown value
|
|
22
|
+
* map to `claude`, as `createRunner` does.
|
|
23
|
+
*/
|
|
24
|
+
export declare function runnerIdOf(backend: string | undefined): RunnerId;
|
|
20
25
|
export interface AgentRunSpec {
|
|
21
26
|
/** Internal deadline overrides; never persisted or sent to the native wire. */
|
|
22
27
|
timings?: Partial<RunnerTimings> | undefined;
|
|
@@ -11,6 +11,17 @@ export const RUNNER_IDS = ['claude', 'codex', 'opencode', 'pi', 'cursor', 'omp']
|
|
|
11
11
|
export function isRunnerId(value) {
|
|
12
12
|
return RUNNER_IDS.includes(value);
|
|
13
13
|
}
|
|
14
|
+
/** Legacy ids that old records carry, each with the runner it now names. */
|
|
15
|
+
const LEGACY_RUNNER_IDS = new Map([['claude-cli', 'claude']]);
|
|
16
|
+
/**
|
|
17
|
+
* The runner a backend value names. A legacy id maps to its runner; undefined and an unknown value
|
|
18
|
+
* map to `claude`, as `createRunner` does.
|
|
19
|
+
*/
|
|
20
|
+
export function runnerIdOf(backend) {
|
|
21
|
+
if (backend === undefined)
|
|
22
|
+
return 'claude';
|
|
23
|
+
return isRunnerId(backend) ? backend : LEGACY_RUNNER_IDS.get(backend) ?? 'claude';
|
|
24
|
+
}
|
|
14
25
|
/**
|
|
15
26
|
* Every `AgentRunSpec` field, as a runtime list. Typed as a full `Record` over
|
|
16
27
|
* `keyof AgentRunSpec`, so the interface gaining or losing a field is a compile
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-runner.js","sourceRoot":"","sources":["../../src/core/agent-runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAQ1F,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAQ,UAAgC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC;AAyDD;;;;GAIG;AACH,MAAM,wBAAwB,GAA+C;IAC3E,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,I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,KAAK,GAAG,IAAI,QAAQ,KAAK,GAAG,CAAC;AAClE,CAAC;AAUD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,UAAU,IAAI,IAAI,CAAC;IAChE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;QACtB,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC;AACtB,CAAC;AAyKD,MAAM,CAAC,MAAM,uBAAuB,GAAkB;IACpD,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,EAAE,gBAAgB;CACtI,CAAC;AACF,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAAC,MAA0C;IACxE,OAAO,MAAM,CAAC,aAAa,IAAI,uBAAuB,CAAC;AACzD,CAAC"}
|
|
@@ -43,6 +43,7 @@ export declare class ClaudeCliRunner implements AgentRunner {
|
|
|
43
43
|
readonly nativeTimerTool: 'ScheduleWakeup';
|
|
44
44
|
readonly costReport: 'cumulative';
|
|
45
45
|
readonly sessionIdSource: 'launch';
|
|
46
|
+
readonly claudeModelAliases: true;
|
|
46
47
|
};
|
|
47
48
|
readonly inputDelivery: InputDelivery;
|
|
48
49
|
private readonly bin;
|
|
@@ -46,6 +46,7 @@ export declare class CodexAppServerRunner implements AgentRunner {
|
|
|
46
46
|
readonly nativeTimerTool: null;
|
|
47
47
|
readonly costReport: 'per-turn';
|
|
48
48
|
readonly sessionIdSource: 'native';
|
|
49
|
+
readonly claudeModelAliases: false;
|
|
49
50
|
};
|
|
50
51
|
readonly inputDelivery: InputDelivery;
|
|
51
52
|
private readonly bin;
|
|
@@ -33,6 +33,7 @@ export declare class CursorPrintRunner implements AgentRunner {
|
|
|
33
33
|
readonly nativeTimerTool: null;
|
|
34
34
|
readonly costReport: 'per-turn';
|
|
35
35
|
readonly sessionIdSource: 'native';
|
|
36
|
+
readonly claudeModelAliases: false;
|
|
36
37
|
};
|
|
37
38
|
readonly inputDelivery: InputDelivery;
|
|
38
39
|
private lastSession?;
|
|
@@ -35,6 +35,7 @@ export declare class CursorRunner implements AgentRunner {
|
|
|
35
35
|
readonly nativeTimerTool: null;
|
|
36
36
|
readonly costReport: 'per-turn';
|
|
37
37
|
readonly sessionIdSource: 'native';
|
|
38
|
+
readonly claudeModelAliases: false;
|
|
38
39
|
};
|
|
39
40
|
readonly systemPromptOnResume: "in-thread";
|
|
40
41
|
readonly inputDelivery: InputDelivery;
|
|
@@ -73,6 +73,7 @@ export declare class OmpRunner implements AgentRunner {
|
|
|
73
73
|
readonly nativeTimerTool: null;
|
|
74
74
|
readonly costReport: 'per-turn';
|
|
75
75
|
readonly sessionIdSource: 'native';
|
|
76
|
+
readonly claudeModelAliases: false;
|
|
76
77
|
};
|
|
77
78
|
readonly inputDelivery: InputDelivery;
|
|
78
79
|
private readonly bin;
|
|
@@ -62,6 +62,7 @@ export declare class OpencodeServerRunner implements AgentRunner {
|
|
|
62
62
|
readonly nativeTimerTool: null;
|
|
63
63
|
readonly costReport: 'per-turn';
|
|
64
64
|
readonly sessionIdSource: 'native';
|
|
65
|
+
readonly claudeModelAliases: false;
|
|
65
66
|
};
|
|
66
67
|
readonly inputDelivery: InputDelivery;
|
|
67
68
|
private readonly bin;
|
package/dist/core/pi-runner.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export declare class PiRunner implements AgentRunner {
|
|
|
45
45
|
readonly nativeTimerTool: null;
|
|
46
46
|
readonly costReport: 'per-turn';
|
|
47
47
|
readonly sessionIdSource: 'launch';
|
|
48
|
+
readonly claudeModelAliases: false;
|
|
48
49
|
};
|
|
49
50
|
readonly inputDelivery: InputDelivery;
|
|
50
51
|
private readonly bin;
|
|
@@ -38,6 +38,9 @@ export interface RunnerFacts {
|
|
|
38
38
|
* runner never knew. The `sessionId` row of each runner's `specSupport` names the wire.
|
|
39
39
|
*/
|
|
40
40
|
readonly sessionIdSource: 'launch' | 'native';
|
|
41
|
+
/** The CLI takes Claude's model aliases (`sonnet`, `haiku`). The `plannerModel` and `namerModel`
|
|
42
|
+
* presets are such aliases, so only such a runner gets them; another runs on its own default. */
|
|
43
|
+
readonly claudeModelAliases: boolean;
|
|
41
44
|
}
|
|
42
45
|
export declare const RUNNER_FACTS: {
|
|
43
46
|
readonly claude: {
|
|
@@ -54,6 +57,7 @@ export declare const RUNNER_FACTS: {
|
|
|
54
57
|
readonly nativeTimerTool: 'ScheduleWakeup';
|
|
55
58
|
readonly costReport: 'cumulative';
|
|
56
59
|
readonly sessionIdSource: 'launch';
|
|
60
|
+
readonly claudeModelAliases: true;
|
|
57
61
|
};
|
|
58
62
|
readonly codex: {
|
|
59
63
|
readonly inputDelivery: {
|
|
@@ -69,6 +73,7 @@ export declare const RUNNER_FACTS: {
|
|
|
69
73
|
readonly nativeTimerTool: null;
|
|
70
74
|
readonly costReport: 'per-turn';
|
|
71
75
|
readonly sessionIdSource: 'native';
|
|
76
|
+
readonly claudeModelAliases: false;
|
|
72
77
|
};
|
|
73
78
|
readonly opencode: {
|
|
74
79
|
readonly inputDelivery: {
|
|
@@ -84,6 +89,7 @@ export declare const RUNNER_FACTS: {
|
|
|
84
89
|
readonly nativeTimerTool: null;
|
|
85
90
|
readonly costReport: 'per-turn';
|
|
86
91
|
readonly sessionIdSource: 'native';
|
|
92
|
+
readonly claudeModelAliases: false;
|
|
87
93
|
};
|
|
88
94
|
readonly pi: {
|
|
89
95
|
readonly inputDelivery: {
|
|
@@ -99,6 +105,7 @@ export declare const RUNNER_FACTS: {
|
|
|
99
105
|
readonly nativeTimerTool: null;
|
|
100
106
|
readonly costReport: 'per-turn';
|
|
101
107
|
readonly sessionIdSource: 'launch';
|
|
108
|
+
readonly claudeModelAliases: false;
|
|
102
109
|
};
|
|
103
110
|
readonly cursor: {
|
|
104
111
|
readonly inputDelivery: {
|
|
@@ -114,6 +121,7 @@ export declare const RUNNER_FACTS: {
|
|
|
114
121
|
readonly nativeTimerTool: null;
|
|
115
122
|
readonly costReport: 'per-turn';
|
|
116
123
|
readonly sessionIdSource: 'native';
|
|
124
|
+
readonly claudeModelAliases: false;
|
|
117
125
|
};
|
|
118
126
|
readonly omp: {
|
|
119
127
|
readonly inputDelivery: {
|
|
@@ -129,6 +137,7 @@ export declare const RUNNER_FACTS: {
|
|
|
129
137
|
readonly nativeTimerTool: null;
|
|
130
138
|
readonly costReport: 'per-turn';
|
|
131
139
|
readonly sessionIdSource: 'native';
|
|
140
|
+
readonly claudeModelAliases: false;
|
|
132
141
|
};
|
|
133
142
|
};
|
|
134
143
|
/** The runners whose declared facts match, in `RUNNER_IDS` order. */
|
|
@@ -7,6 +7,7 @@ export const RUNNER_FACTS = {
|
|
|
7
7
|
},
|
|
8
8
|
systemPromptOnResume: 'resent',
|
|
9
9
|
nativeAsk: 'none', nativeSubagents: 'reported', nativeTimerTool: 'ScheduleWakeup', costReport: 'cumulative', sessionIdSource: 'launch',
|
|
10
|
+
claudeModelAliases: true,
|
|
10
11
|
},
|
|
11
12
|
codex: {
|
|
12
13
|
inputDelivery: {
|
|
@@ -17,6 +18,7 @@ export const RUNNER_FACTS = {
|
|
|
17
18
|
},
|
|
18
19
|
systemPromptOnResume: 'in-thread',
|
|
19
20
|
nativeAsk: 'answerable', nativeSubagents: 'reported', nativeTimerTool: null, costReport: 'per-turn', sessionIdSource: 'native',
|
|
21
|
+
claudeModelAliases: false,
|
|
20
22
|
},
|
|
21
23
|
opencode: {
|
|
22
24
|
inputDelivery: {
|
|
@@ -25,6 +27,7 @@ export const RUNNER_FACTS = {
|
|
|
25
27
|
},
|
|
26
28
|
systemPromptOnResume: 'in-thread',
|
|
27
29
|
nativeAsk: 'answerable', nativeSubagents: 'turn-held', nativeTimerTool: null, costReport: 'per-turn', sessionIdSource: 'native',
|
|
30
|
+
claudeModelAliases: false,
|
|
28
31
|
},
|
|
29
32
|
pi: {
|
|
30
33
|
inputDelivery: {
|
|
@@ -33,6 +36,7 @@ export const RUNNER_FACTS = {
|
|
|
33
36
|
},
|
|
34
37
|
systemPromptOnResume: 'resent',
|
|
35
38
|
nativeAsk: 'none', nativeSubagents: 'unreported', nativeTimerTool: null, costReport: 'per-turn', sessionIdSource: 'launch',
|
|
39
|
+
claudeModelAliases: false,
|
|
36
40
|
},
|
|
37
41
|
// Every Cursor session runs on print (hearsay-tools/cezarion#1267).
|
|
38
42
|
cursor: {
|
|
@@ -42,6 +46,7 @@ export const RUNNER_FACTS = {
|
|
|
42
46
|
},
|
|
43
47
|
systemPromptOnResume: 'in-thread',
|
|
44
48
|
nativeAsk: 'auto-skipped', nativeSubagents: 'unreported', nativeTimerTool: null, costReport: 'per-turn', sessionIdSource: 'native',
|
|
49
|
+
claudeModelAliases: false,
|
|
45
50
|
},
|
|
46
51
|
omp: {
|
|
47
52
|
inputDelivery: {
|
|
@@ -50,6 +55,7 @@ export const RUNNER_FACTS = {
|
|
|
50
55
|
},
|
|
51
56
|
systemPromptOnResume: 'resent',
|
|
52
57
|
nativeAsk: 'none', nativeSubagents: 'turn-held', nativeTimerTool: null, costReport: 'per-turn', sessionIdSource: 'native',
|
|
58
|
+
claudeModelAliases: false,
|
|
53
59
|
},
|
|
54
60
|
};
|
|
55
61
|
/** The runners whose declared facts match, in `RUNNER_IDS` order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner-facts.js","sourceRoot":"","sources":["../../src/core/runner-facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"runner-facts.js","sourceRoot":"","sources":["../../src/core/runner-facts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgE,MAAM,mBAAmB,CAAC;AA8C7G,MAAM,CAAC,MAAM,YAAY,GA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E,yHAAyH;SAC/H;QACD,oBAAoB,EAAE,QAAQ;QAC9B,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ;QAC1H,kBAAkB,EAAE,KAAK;KAC1B;IACD,oEAAoE;IACpE,MAAM,EAAE;QACN,aAAa,EAAE;YACb,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa;YAChH,GAAG,EAAE,iCAAiC;SACvC;QACD,oBAAoB,EAAE,WAAW;QACjC,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ;QAClI,kBAAkB,EAAE,KAAK;KAC1B;IACD,GAAG,EAAE;QACH,aAAa,EAAE;YACb,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY;YACxG,GAAG,EAAE,yHAAyH;SAC/H;QACD,oBAAoB,EAAE,QAAQ;QAC9B,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ;QACzH,kBAAkB,EAAE,KAAK;KAC1B;CACyD,CAAC;AAE7D,qEAAqE;AACrE,MAAM,UAAU,YAAY,CAAC,OAAwC;IACnE,OAAO,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -3,21 +3,13 @@ import { workerInputRecipeSchema } from '../contract/index.js';
|
|
|
3
3
|
import { basename, dirname, isAbsolute, join } from 'node:path';
|
|
4
4
|
import { realpathSync, statSync } from 'node:fs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { profileEnv, supportsProfiles } from '../core/agent-profiles.js';
|
|
6
|
+
import { ACCOUNT_LAYOUT, profileEnv, selectsByProfileName, supportsProfiles } from '../core/agent-profiles.js';
|
|
7
7
|
import { RUNNER_IDS } from '../core/agent-runner.js';
|
|
8
8
|
import { namedAccountUnavailable } from '../workspace/agent-profiles.js';
|
|
9
|
-
import { agentHomePaths, claudeStateFilePath } from '../paths.js';
|
|
9
|
+
import { AGENT_HOME_SLOT, agentHomePaths, claudeStateFilePath } from '../paths.js';
|
|
10
10
|
import { workflowDefSchema, QUICK_TASK_WORKFLOW, stepKind } from '../workflows/types.js';
|
|
11
11
|
import { AGENT_MODELS_LOCKED_ERROR, agentModelsLocked } from '../core/agent-model-policy.js';
|
|
12
12
|
import { buildChildEnv } from '../core/agent-env.js';
|
|
13
|
-
/**
|
|
14
|
-
* Providers whose DEFAULT account binds no home: it spawns bare and follows the host env, as it did
|
|
15
|
-
* before pi and omp carried accounts (hearsay-tools/cezarion#1283). Pinning a home requires the
|
|
16
|
-
* folder to exist at launch, and a machine where the agent has never run has none, so pinning would
|
|
17
|
-
* turn a working zero-config worker into "identity is unavailable". Evidence accepted before #1283
|
|
18
|
-
* has this same shape. Named accounts always pin their folder.
|
|
19
|
-
*/
|
|
20
|
-
const HOMELESS_DEFAULT_PROVIDERS = new Set(['pi', 'omp']);
|
|
21
13
|
const absolutePathSchema = z.string().min(1).max(4096).refine(isAbsolute).refine(path => !/[\u0000-\u001f\u007f]/.test(path));
|
|
22
14
|
/** Internal durable evidence, never a public environment override or credential snapshot. */
|
|
23
15
|
export const workerAccountBindingSchema = z.object({
|
|
@@ -31,8 +23,9 @@ export const workerAccountBindingSchema = z.object({
|
|
|
31
23
|
]).optional(),
|
|
32
24
|
}).strict().refine(binding => binding.homePath !== undefined
|
|
33
25
|
? supportsProfiles(binding.provider)
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
// A default that binds no home spawns bare; evidence accepted before hearsay-tools/cezarion#1283 has this shape.
|
|
27
|
+
: binding.profileId === 'default' && !ACCOUNT_LAYOUT[binding.provider].defaultBindsHome)
|
|
28
|
+
.refine(binding => ACCOUNT_LAYOUT[binding.provider].stateFile === 'beside-home'
|
|
36
29
|
? binding.claudeLayout !== undefined && (binding.claudeLayout.kind !== 'native' || binding.profileId === 'default')
|
|
37
30
|
: binding.claudeLayout === undefined);
|
|
38
31
|
// Required private evidence; absent properties and explicit empty grants differ.
|
|
@@ -81,23 +74,25 @@ export const workerExecutionIdentitySchema = z.union([
|
|
|
81
74
|
export class WorkerIdentityError extends Error {
|
|
82
75
|
}
|
|
83
76
|
export function captureWorkerAccount(profile, env = process.env) {
|
|
84
|
-
|
|
77
|
+
const layout = ACCOUNT_LAYOUT[profile.provider];
|
|
78
|
+
if (!supportsProfiles(profile.provider) || (profile.isDefault && !layout.defaultBindsHome)) {
|
|
85
79
|
return { provider: profile.provider, profileId: 'default' };
|
|
86
80
|
}
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
// A home whose state file sits beside it binds the home the child env resolves, and records that
|
|
82
|
+
// layout. Bind an existing symlink to its actual home. A native first-run home may not exist yet.
|
|
83
|
+
const childHome = agentHomePaths(env)[AGENT_HOME_SLOT[profile.provider]];
|
|
84
|
+
let homePath = layout.stateFile === 'beside-home' ? childHome : profile.path;
|
|
90
85
|
try {
|
|
91
|
-
// A named
|
|
92
|
-
//
|
|
93
|
-
homePath =
|
|
86
|
+
// A named profile-name account is selected by its profile entry's NAME, and the entry may be a
|
|
87
|
+
// symlink the CLI follows itself: resolving it would leave a path that names no profile. Pin the parent.
|
|
88
|
+
homePath = isProfileNameBinding(profile.provider, profile.id)
|
|
94
89
|
? join(realpathSync(dirname(homePath)), basename(homePath))
|
|
95
90
|
: realpathSync(homePath);
|
|
96
91
|
}
|
|
97
92
|
catch { /* The owned consumer still requires it to exist. */ }
|
|
98
|
-
const claudeLayout =
|
|
93
|
+
const claudeLayout = layout.stateFile !== 'beside-home' ? undefined
|
|
99
94
|
: env.CLAUDE_CONFIG_DIR?.trim() ? { kind: 'relocated' }
|
|
100
|
-
: { kind: 'native', statePath: claudeStateFilePath(
|
|
95
|
+
: { kind: 'native', statePath: claudeStateFilePath(childHome, env) };
|
|
101
96
|
const parsed = workerAccountBindingSchema.safeParse({ provider: profile.provider, profileId: profile.id, homePath,
|
|
102
97
|
...(claudeLayout === undefined ? {} : { claudeLayout }) });
|
|
103
98
|
return parsed.success ? parsed.data : undefined;
|
|
@@ -105,8 +100,8 @@ export function captureWorkerAccount(profile, env = process.env) {
|
|
|
105
100
|
export function boundWorkerAccountEnv(binding, env = process.env) {
|
|
106
101
|
if (binding.homePath === undefined)
|
|
107
102
|
return {};
|
|
108
|
-
const
|
|
109
|
-
const pinned =
|
|
103
|
+
const namedProfile = isProfileNameBinding(binding.provider, binding.profileId);
|
|
104
|
+
const pinned = namedProfile ? dirname(binding.homePath) : binding.homePath;
|
|
110
105
|
try {
|
|
111
106
|
if (!statSync(binding.homePath).isDirectory() || realpathSync(pinned) !== pinned)
|
|
112
107
|
throw new Error();
|
|
@@ -114,16 +109,16 @@ export function boundWorkerAccountEnv(binding, env = process.env) {
|
|
|
114
109
|
catch {
|
|
115
110
|
throw new WorkerIdentityError('Accepted worker account identity is unavailable');
|
|
116
111
|
}
|
|
117
|
-
if (binding.provider
|
|
112
|
+
if (selectsByProfileName(binding.provider)) {
|
|
118
113
|
// The discovered omp account is spawned bare, so it keeps whatever profile the host selects.
|
|
119
|
-
if (!
|
|
114
|
+
if (!namedProfile)
|
|
120
115
|
return {};
|
|
121
|
-
const selected = profileEnv(
|
|
116
|
+
const selected = profileEnv(binding.provider, binding.homePath);
|
|
122
117
|
if (Object.keys(selected).length === 0)
|
|
123
118
|
throw new WorkerIdentityError('Accepted omp account names no omp profile');
|
|
124
119
|
// omp resolves the name under the root it computes from the CHILD's HOME and PI_CONFIG_DIR,
|
|
125
120
|
// which may have changed since acceptance; a moved root would select another profile.
|
|
126
|
-
const unavailable = namedAccountUnavailable(
|
|
121
|
+
const unavailable = namedAccountUnavailable(binding.provider, binding.homePath, env);
|
|
127
122
|
if (unavailable !== null)
|
|
128
123
|
throw new WorkerIdentityError(unavailable);
|
|
129
124
|
return selected;
|
|
@@ -142,9 +137,9 @@ export function boundWorkerAccountEnv(binding, env = process.env) {
|
|
|
142
137
|
}
|
|
143
138
|
return profileEnv(binding.provider, binding.homePath);
|
|
144
139
|
}
|
|
145
|
-
/** A named
|
|
146
|
-
function
|
|
147
|
-
return provider
|
|
140
|
+
/** A named account of a profile-name provider (omp): a profile, selected by name rather than by folder. */
|
|
141
|
+
function isProfileNameBinding(provider, profileId) {
|
|
142
|
+
return selectsByProfileName(provider) && profileId !== 'default';
|
|
148
143
|
}
|
|
149
144
|
/** Canonical schema order makes equivalent persisted object ordering immaterial. */
|
|
150
145
|
export function workerContextHash(context) {
|