@claudexor/cli 3.5.0 → 3.8.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/accounts-projection.d.ts +22 -14
- package/dist/accounts-projection.d.ts.map +1 -1
- package/dist/accounts-projection.js +112 -60
- package/dist/accounts-projection.js.map +1 -1
- package/dist/accounts-services.d.ts +140 -128
- package/dist/accounts-services.d.ts.map +1 -1
- package/dist/accounts-services.js +22 -9
- package/dist/accounts-services.js.map +1 -1
- package/dist/accounts-unified-migration.d.ts +110 -0
- package/dist/accounts-unified-migration.d.ts.map +1 -0
- package/dist/accounts-unified-migration.js +422 -0
- package/dist/accounts-unified-migration.js.map +1 -0
- package/dist/agy-quota-source.d.ts +1 -0
- package/dist/agy-quota-source.d.ts.map +1 -1
- package/dist/agy-quota-source.js +61 -108
- package/dist/agy-quota-source.js.map +1 -1
- package/dist/auth-login-harnesses.d.ts +7 -5
- package/dist/auth-login-harnesses.d.ts.map +1 -1
- package/dist/auth-login-harnesses.js +10 -9
- package/dist/auth-login-harnesses.js.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +6 -1
- package/dist/capabilities.js.map +1 -1
- package/dist/claude-oauth-usage.d.ts.map +1 -1
- package/dist/claude-oauth-usage.js +9 -3
- package/dist/claude-oauth-usage.js.map +1 -1
- package/dist/claude-statusline.d.ts.map +1 -1
- package/dist/claude-statusline.js +14 -1
- package/dist/claude-statusline.js.map +1 -1
- package/dist/claudexord-entry.d.ts +7 -2
- package/dist/claudexord-entry.d.ts.map +1 -1
- package/dist/claudexord-entry.js +33 -11
- package/dist/claudexord-entry.js.map +1 -1
- package/dist/claudexord.d.ts.map +1 -1
- package/dist/claudexord.js +25 -37
- package/dist/claudexord.js.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/codex-quota-source.d.ts.map +1 -1
- package/dist/codex-quota-source.js +8 -3
- package/dist/codex-quota-source.js.map +1 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +1 -0
- package/dist/command-flags.js.map +1 -1
- package/dist/control-services.d.ts +206 -188
- package/dist/control-services.d.ts.map +1 -1
- package/dist/control-services.js +54 -122
- package/dist/control-services.js.map +1 -1
- package/dist/credential-commands.d.ts +16 -0
- package/dist/credential-commands.d.ts.map +1 -1
- package/dist/credential-commands.js +93 -39
- package/dist/credential-commands.js.map +1 -1
- package/dist/credential-profile-mutations.d.ts +70 -0
- package/dist/credential-profile-mutations.d.ts.map +1 -0
- package/dist/credential-profile-mutations.js +219 -0
- package/dist/credential-profile-mutations.js.map +1 -0
- package/dist/credential-status-invalidation.d.ts +11 -0
- package/dist/credential-status-invalidation.d.ts.map +1 -0
- package/dist/credential-status-invalidation.js +36 -0
- package/dist/credential-status-invalidation.js.map +1 -0
- package/dist/daemon-admission-runtime.d.ts +5 -0
- package/dist/daemon-admission-runtime.d.ts.map +1 -1
- package/dist/daemon-admission-runtime.js +1 -0
- package/dist/daemon-admission-runtime.js.map +1 -1
- package/dist/delegation-belt-descriptor.d.ts +2 -1
- package/dist/delegation-belt-descriptor.d.ts.map +1 -1
- package/dist/delegation-belt-descriptor.js +2 -1
- package/dist/delegation-belt-descriptor.js.map +1 -1
- package/dist/harness-command-specs.d.ts.map +1 -1
- package/dist/harness-command-specs.js +4 -4
- package/dist/harness-command-specs.js.map +1 -1
- package/dist/harness-command.d.ts +5 -3
- package/dist/harness-command.d.ts.map +1 -1
- package/dist/harness-command.js +5 -3
- package/dist/harness-command.js.map +1 -1
- package/dist/harness-install-lease.d.ts +11 -0
- package/dist/harness-install-lease.d.ts.map +1 -0
- package/dist/harness-install-lease.js +98 -0
- package/dist/harness-install-lease.js.map +1 -0
- package/dist/harness-install-proof.d.ts +36 -0
- package/dist/harness-install-proof.d.ts.map +1 -0
- package/dist/harness-install-proof.js +148 -0
- package/dist/harness-install-proof.js.map +1 -0
- package/dist/harness-install-recipes.d.ts +80 -0
- package/dist/harness-install-recipes.d.ts.map +1 -0
- package/dist/harness-install-recipes.js +130 -0
- package/dist/harness-install-recipes.js.map +1 -0
- package/dist/harness-installer.d.ts +45 -46
- package/dist/harness-installer.d.ts.map +1 -1
- package/dist/harness-installer.js +248 -156
- package/dist/harness-installer.js.map +1 -1
- package/dist/mcp-run-projections.d.ts +1 -1
- package/dist/native-login.d.ts +7 -0
- package/dist/native-login.d.ts.map +1 -1
- package/dist/native-login.js +40 -17
- package/dist/native-login.js.map +1 -1
- package/dist/profile-registration.d.ts +15 -1
- package/dist/profile-registration.d.ts.map +1 -1
- package/dist/profile-registration.js +124 -7
- package/dist/profile-registration.js.map +1 -1
- package/dist/quota-services.d.ts +4 -4
- package/dist/quota-subject-universe.d.ts.map +1 -1
- package/dist/quota-subject-universe.js +6 -0
- package/dist/quota-subject-universe.js.map +1 -1
- package/dist/remote-command.d.ts +0 -2
- package/dist/remote-command.d.ts.map +1 -1
- package/dist/remote-command.js +3 -74
- package/dist/remote-command.js.map +1 -1
- package/dist/run-orchestrator.d.ts +28 -0
- package/dist/run-orchestrator.d.ts.map +1 -0
- package/dist/run-orchestrator.js +43 -0
- package/dist/run-orchestrator.js.map +1 -0
- package/dist/settings-service.d.ts +1 -1
- package/dist/settings-service.js +3 -3
- package/dist/settings-service.js.map +1 -1
- package/dist/setup-attach-command.d.ts +30 -0
- package/dist/setup-attach-command.d.ts.map +1 -0
- package/dist/setup-attach-command.js +118 -0
- package/dist/setup-attach-command.js.map +1 -0
- package/dist/setup-job-store.d.ts +2 -2
- package/dist/setup-job-support.d.ts +36 -9
- package/dist/setup-job-support.d.ts.map +1 -1
- package/dist/setup-job-support.js +81 -10
- package/dist/setup-job-support.js.map +1 -1
- package/dist/setup-jobs.d.ts +4 -4
- package/dist/setup-jobs.d.ts.map +1 -1
- package/dist/setup-jobs.js +50 -47
- package/dist/setup-jobs.js.map +1 -1
- package/dist/setup-login-capability.d.ts +37 -0
- package/dist/setup-login-capability.d.ts.map +1 -0
- package/dist/setup-login-capability.js +96 -0
- package/dist/setup-login-capability.js.map +1 -0
- package/dist/setup-login-io.d.ts +4 -1
- package/dist/setup-login-io.d.ts.map +1 -1
- package/dist/setup-login-io.js +22 -3
- package/dist/setup-login-io.js.map +1 -1
- package/dist/setup-login-pty.d.ts +64 -22
- package/dist/setup-login-pty.d.ts.map +1 -1
- package/dist/setup-login-pty.js +289 -48
- package/dist/setup-login-pty.js.map +1 -1
- package/dist/setup-login-runner-support.d.ts +12 -0
- package/dist/setup-login-runner-support.d.ts.map +1 -0
- package/dist/setup-login-runner-support.js +65 -0
- package/dist/setup-login-runner-support.js.map +1 -0
- package/dist/setup-login-runner.d.ts +2 -0
- package/dist/setup-login-runner.d.ts.map +1 -1
- package/dist/setup-login-runner.js +119 -116
- package/dist/setup-login-runner.js.map +1 -1
- package/dist/setup-runner-outcome.d.ts +10 -0
- package/dist/setup-runner-outcome.d.ts.map +1 -0
- package/dist/setup-runner-outcome.js +49 -0
- package/dist/setup-runner-outcome.js.map +1 -0
- package/dist/thread-continuity-context.d.ts +24 -0
- package/dist/thread-continuity-context.d.ts.map +1 -1
- package/dist/thread-continuity-context.js +17 -0
- package/dist/thread-continuity-context.js.map +1 -1
- package/package.json +24 -24
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Per-harness
|
|
3
|
-
*
|
|
4
|
-
* run
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* Per-harness POOL AUTHORITY projection of the unified account model
|
|
3
|
+
* (INV-135): every account is a named registry row; `accountPools` carries
|
|
4
|
+
* the routing facts (who an UNPINNED run routes to next), computed ONCE on
|
|
5
|
+
* the server by the same pool owner run admission uses so no surface
|
|
6
|
+
* re-derives it. The legacy `harnessAccounts` carrier stays on the wire as
|
|
7
|
+
* `[]` for strict old clients; its native "CLI login" pseudo-row is gone —
|
|
8
|
+
* detected default-store logins are auto-registered as ordinary rows at
|
|
9
|
+
* daemon start.
|
|
10
10
|
*/
|
|
11
|
-
import type { AccountIdentity,
|
|
11
|
+
import type { AccountIdentity, ControlHarnessAccountPool, CredentialProfile, CredentialProfileStatus, QuotaSnapshot } from "@claudexor/schema";
|
|
12
12
|
import type { HarnessStatus } from "@claudexor/gateway";
|
|
13
|
+
import { credentialProfilePolicyState } from "@claudexor/core";
|
|
13
14
|
/**
|
|
14
15
|
* Non-secret {email, plan} of a config_dir_login PROFILE, read daemon-side from
|
|
15
16
|
* the profile's OWN isolation-locator store (INV-067) — never the ordinary
|
|
@@ -22,24 +23,31 @@ export declare function profileAccountIdentity(profile: CredentialProfile): Acco
|
|
|
22
23
|
* live probe the accounts response and the profile mutation receipts share.
|
|
23
24
|
* Adapters without profile support report an honest unknown.
|
|
24
25
|
*/
|
|
25
|
-
export declare function profileDoctorStatus(profile: CredentialProfile): Promise<CredentialProfileStatus>;
|
|
26
|
+
export declare function profileDoctorStatus(profile: CredentialProfile, platform?: NodeJS.Platform): Promise<CredentialProfileStatus>;
|
|
27
|
+
export declare function disabledProfileSharesOsUserCredential(state: ReturnType<typeof credentialProfilePolicyState>): boolean;
|
|
26
28
|
/**
|
|
27
29
|
* Accounts projection for one named profile. A rich adapter owns readiness and
|
|
28
30
|
* identity in ONE call; adapters without it keep the existing doctor + owned-
|
|
29
31
|
* store identity path. A malformed rich receipt loses identity and fails
|
|
30
32
|
* closed through the shared readiness wrapper.
|
|
31
33
|
*/
|
|
32
|
-
export declare function profileAccountProjection(profile: CredentialProfile): Promise<{
|
|
34
|
+
export declare function profileAccountProjection(profile: CredentialProfile, registry?: readonly CredentialProfile[], platform?: NodeJS.Platform): Promise<{
|
|
33
35
|
profile: CredentialProfile;
|
|
34
36
|
status: CredentialProfileStatus;
|
|
35
37
|
identity: AccountIdentity | null;
|
|
36
38
|
}>;
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The per-harness pool routing verdict (`GET /v2/account-pools` and the
|
|
41
|
+
* additive `accountPools` key of the credential-profiles response). Routing
|
|
42
|
+
* facts ONLY — account facts live on the profile rows. The API-key ROUTE
|
|
43
|
+
* appears exclusively here (`api_key_route`) so legacy strict `next_up`
|
|
44
|
+
* decoders never see an unknown kind.
|
|
45
|
+
*/
|
|
46
|
+
export declare function accountPoolsProjection(repoRoot: string, quotaSnapshots?: readonly QuotaSnapshot[], snapshot?: {
|
|
38
47
|
statuses?: readonly HarnessStatus[];
|
|
39
48
|
profiles?: readonly {
|
|
40
49
|
profile: CredentialProfile;
|
|
41
50
|
status: CredentialProfileStatus;
|
|
42
51
|
}[];
|
|
43
|
-
|
|
44
|
-
}): Promise<ControlHarnessAccounts[]>;
|
|
52
|
+
}): Promise<ControlHarnessAccountPool[]>;
|
|
45
53
|
//# sourceMappingURL=accounts-projection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-projection.d.ts","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"accounts-projection.d.ts","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACvB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAY3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAK/D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,eAAe,GAAG,IAAI,CAKzF;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CAAC,uBAAuB,CAAC,CAOlC;AAiBD,wBAAgB,qCAAqC,CACnD,KAAK,EAAE,UAAU,CAAC,OAAO,4BAA4B,CAAC,GACrD,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,GAAE,SAAS,iBAAiB,EAAc,EAClD,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAC3C,OAAO,CAAC;IACT,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,uBAAuB,CAAC;IAChC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;CAClC,CAAC,CA2CD;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,SAAS,aAAa,EAAO,EAC7C,QAAQ,CAAC,EAAE;IACT,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,SAAS;QAAE,OAAO,EAAE,iBAAiB,CAAC;QAAC,MAAM,EAAE,uBAAuB,CAAA;KAAE,EAAE,CAAC;CACvF,GACA,OAAO,CAAC,yBAAyB,EAAE,CAAC,CA6FtC"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import { AccountIdentity as AccountIdentitySchema } from "@claudexor/schema";
|
|
1
|
+
import { AccountIdentity as AccountIdentitySchema, estimateEffectiveAuthRoute, } from "@claudexor/schema";
|
|
2
2
|
import { loadConfig } from "@claudexor/config";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { effectiveAuthPreference, probeCredentialProfileStatus, profileStatusAdmits, selectFromAccountPool, } from "@claudexor/orchestrator";
|
|
4
|
+
import { credentialProfilePolicyState } from "@claudexor/core";
|
|
5
|
+
import { codexAccountIdentity } from "@claudexor/harness-codex";
|
|
6
|
+
import { claudeAccountIdentity } from "@claudexor/harness-claude";
|
|
6
7
|
import { buildGateway, buildRegistry } from "./registry.js";
|
|
7
|
-
/**
|
|
8
|
-
* Non-secret {email, plan} of a harness's NATIVE/CLI login, read daemon-side
|
|
9
|
-
* from the Claudexor-owned native store (never the ordinary vendor home).
|
|
10
|
-
* Cursor's CLI-reported identity arrives through the Accounts-only doctor
|
|
11
|
-
* receipt instead; this helper remains the static-store owner for codex/claude.
|
|
12
|
-
*/
|
|
13
|
-
function nativeAccountIdentity(harnessId) {
|
|
14
|
-
if (harnessId === "codex")
|
|
15
|
-
return codexAccountIdentity(defaultNativeCodexHome());
|
|
16
|
-
if (harnessId === "claude")
|
|
17
|
-
return claudeAccountIdentity(defaultNativeClaudeConfigDir());
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
8
|
/**
|
|
21
9
|
* Non-secret {email, plan} of a config_dir_login PROFILE, read daemon-side from
|
|
22
10
|
* the profile's OWN isolation-locator store (INV-067) — never the ordinary
|
|
@@ -37,18 +25,51 @@ export function profileAccountIdentity(profile) {
|
|
|
37
25
|
* live probe the accounts response and the profile mutation receipts share.
|
|
38
26
|
* Adapters without profile support report an honest unknown.
|
|
39
27
|
*/
|
|
40
|
-
export async function profileDoctorStatus(profile) {
|
|
28
|
+
export async function profileDoctorStatus(profile, platform = process.platform) {
|
|
41
29
|
const adapter = buildRegistry().get(profile.harness_id);
|
|
30
|
+
const policy = credentialProfilePolicyState({ adapter, registry: [profile], platform });
|
|
31
|
+
if (!profile.enabled && disabledProfileSharesOsUserCredential(policy)) {
|
|
32
|
+
return inactiveProfileStatus(profile, "This profile is disabled and was not probed.");
|
|
33
|
+
}
|
|
42
34
|
return probeCredentialProfileStatus(profile, adapter?.probeCredentialProfile?.bind(adapter));
|
|
43
35
|
}
|
|
36
|
+
function inactiveProfileStatus(profile, detail) {
|
|
37
|
+
return {
|
|
38
|
+
profile_id: profile.profile_id,
|
|
39
|
+
harness_id: profile.harness_id,
|
|
40
|
+
availability: "unavailable",
|
|
41
|
+
verification: "not_run",
|
|
42
|
+
verification_source: "local_store",
|
|
43
|
+
detail,
|
|
44
|
+
last_verified_at: null,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function disabledProfileSharesOsUserCredential(state) {
|
|
48
|
+
return state.policy.identity_scope === "os_user";
|
|
49
|
+
}
|
|
44
50
|
/**
|
|
45
51
|
* Accounts projection for one named profile. A rich adapter owns readiness and
|
|
46
52
|
* identity in ONE call; adapters without it keep the existing doctor + owned-
|
|
47
53
|
* store identity path. A malformed rich receipt loses identity and fails
|
|
48
54
|
* closed through the shared readiness wrapper.
|
|
49
55
|
*/
|
|
50
|
-
export async function profileAccountProjection(profile) {
|
|
56
|
+
export async function profileAccountProjection(profile, registry = [profile], platform = process.platform) {
|
|
51
57
|
const adapter = buildRegistry().get(profile.harness_id);
|
|
58
|
+
const cardinality = credentialProfilePolicyState({ adapter, registry, platform });
|
|
59
|
+
if (!profile.enabled && disabledProfileSharesOsUserCredential(cardinality)) {
|
|
60
|
+
return {
|
|
61
|
+
profile,
|
|
62
|
+
status: inactiveProfileStatus(profile, "This profile is disabled and was not probed."),
|
|
63
|
+
identity: profileAccountIdentity(profile),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (profile.enabled && cardinality.ambiguous) {
|
|
67
|
+
return {
|
|
68
|
+
profile,
|
|
69
|
+
status: inactiveProfileStatus(profile, `${profile.harness_id} has ${cardinality.enabledProfileCount} enabled bindings on ${cardinality.platform}; disable extra profiles before this OS-user-scoped credential can be selected or probed.`),
|
|
70
|
+
identity: profileAccountIdentity(profile),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
52
73
|
if (!adapter?.probeCredentialAccount) {
|
|
53
74
|
return {
|
|
54
75
|
profile,
|
|
@@ -68,34 +89,26 @@ export async function profileAccountProjection(profile) {
|
|
|
68
89
|
});
|
|
69
90
|
return { profile, status, identity };
|
|
70
91
|
}
|
|
71
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The per-harness pool routing verdict (`GET /v2/account-pools` and the
|
|
94
|
+
* additive `accountPools` key of the credential-profiles response). Routing
|
|
95
|
+
* facts ONLY — account facts live on the profile rows. The API-key ROUTE
|
|
96
|
+
* appears exclusively here (`api_key_route`) so legacy strict `next_up`
|
|
97
|
+
* decoders never see an unknown kind.
|
|
98
|
+
*/
|
|
99
|
+
export async function accountPoolsProjection(repoRoot, quotaSnapshots = [], snapshot) {
|
|
72
100
|
const cfg = loadConfig(repoRoot).global;
|
|
73
101
|
const harnessIds = [...buildRegistry({ includeFakes: false }).keys()].sort();
|
|
74
|
-
const nativeDetected = new Map();
|
|
75
102
|
let statuses = snapshot?.statuses ?? [];
|
|
76
|
-
const accountIdentities = new Map(snapshot?.accountIdentities ?? []);
|
|
77
103
|
if (!snapshot?.statuses) {
|
|
78
104
|
try {
|
|
79
|
-
|
|
80
|
-
statuses = receipts.map((receipt) => receipt.status);
|
|
81
|
-
for (const receipt of receipts) {
|
|
82
|
-
accountIdentities.set(receipt.status.id, receipt.identity);
|
|
83
|
-
}
|
|
105
|
+
statuses = await buildGateway({ includeFakes: false }).statusAll({ cwd: repoRoot }, harnessIds);
|
|
84
106
|
}
|
|
85
107
|
catch {
|
|
86
108
|
statuses = [];
|
|
87
109
|
}
|
|
88
110
|
}
|
|
89
|
-
const
|
|
90
|
-
for (const s of statuses) {
|
|
91
|
-
const native = s.authSources.find((source) => source.source === "native_session");
|
|
92
|
-
const detected = native?.availability === "available";
|
|
93
|
-
nativeDetected.set(s.id, detected);
|
|
94
|
-
const harness = cfg.harnesses[s.id];
|
|
95
|
-
const route = defaultCredentialRoute(s, effectiveAuthPreference(harness?.auth_preference, cfg.routing.auth_preference));
|
|
96
|
-
if (route)
|
|
97
|
-
defaultRoutes.set(s.id, route);
|
|
98
|
-
}
|
|
111
|
+
const statusById = new Map(statuses.map((status) => [status.id, status]));
|
|
99
112
|
const readyProfiles = new Map();
|
|
100
113
|
for (const entry of snapshot?.profiles ?? []) {
|
|
101
114
|
if (!entry.profile.enabled || !profileStatusAdmits(entry.profile, entry.status))
|
|
@@ -106,31 +119,70 @@ export async function harnessAccountsProjection(repoRoot, quotaSnapshots = [], s
|
|
|
106
119
|
}
|
|
107
120
|
return harnessIds.map((harnessId) => {
|
|
108
121
|
const h = cfg.harnesses[harnessId];
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
if (h?.enabled === false) {
|
|
123
|
+
return {
|
|
124
|
+
harness_id: harnessId,
|
|
125
|
+
next_up: {
|
|
126
|
+
kind: "none",
|
|
127
|
+
reason: `harness is disabled in settings (harnesses.${harnessId}.enabled=false)`,
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const cardinality = credentialProfilePolicyState({
|
|
132
|
+
adapter: buildRegistry({ includeFakes: false }).get(harnessId),
|
|
133
|
+
registry: cfg.credential_profiles,
|
|
134
|
+
});
|
|
135
|
+
if (cardinality.ambiguous) {
|
|
136
|
+
return {
|
|
137
|
+
harness_id: harnessId,
|
|
138
|
+
next_up: {
|
|
139
|
+
kind: "none",
|
|
140
|
+
reason: `${harnessId} has an ambiguous enabled profile set; disable extra profiles before routing`,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
// next_up must never advertise a row the runtime would not select: a
|
|
145
|
+
// NON-EMPTY rotation_eligible list restricts the runtime's candidates
|
|
146
|
+
// (staticRotationCandidates), so the projection applies the same filter.
|
|
147
|
+
const rotationEligible = h?.profile_policy?.rotation_eligible ?? [];
|
|
148
|
+
const ready = readyProfiles.get(harnessId) ?? new Set();
|
|
149
|
+
const eligibleReady = rotationEligible.length > 0
|
|
150
|
+
? new Set([...ready].filter((id) => rotationEligible.includes(id)))
|
|
151
|
+
: ready;
|
|
152
|
+
const selection = selectFromAccountPool({
|
|
153
|
+
registry: cfg.credential_profiles,
|
|
154
|
+
harnessId,
|
|
155
|
+
snapshots: quotaSnapshots,
|
|
156
|
+
readyProfileIds: eligibleReady,
|
|
157
|
+
headroomThreshold: h?.profile_policy?.headroom_threshold ?? 0.9,
|
|
158
|
+
model: h?.default_model ?? null,
|
|
159
|
+
});
|
|
160
|
+
if (selection.outcome === "selected") {
|
|
161
|
+
return {
|
|
162
|
+
harness_id: harnessId,
|
|
163
|
+
next_up: { kind: "profile", profileId: selection.candidate.profile.profile_id },
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// Pool exhaustion is the typed `credential_pool_exhausted` terminal at
|
|
167
|
+
// run time (owner Q3=A): the paid API-key ROUTE serves it ONLY under the
|
|
168
|
+
// EXPLICIT api_key preference — never silently under auto — so next_up
|
|
169
|
+
// advertises the paid route exactly when the runtime would take it.
|
|
170
|
+
const preference = effectiveAuthPreference(h?.auth_preference, cfg.routing.auth_preference);
|
|
171
|
+
const status = statusById.get(harnessId);
|
|
172
|
+
const keyRouteReady = preference === "api_key" &&
|
|
173
|
+
status !== undefined &&
|
|
174
|
+
estimateEffectiveAuthRoute("api_key", status.authSources) === "api_key";
|
|
175
|
+
if (keyRouteReady) {
|
|
176
|
+
return { harness_id: harnessId, next_up: { kind: "api_key_route" } };
|
|
177
|
+
}
|
|
112
178
|
return {
|
|
113
179
|
harness_id: harnessId,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
registry: cfg.credential_profiles,
|
|
121
|
-
harnessId,
|
|
122
|
-
policy: h?.profile_policy ?? {
|
|
123
|
-
limit_action: "fail",
|
|
124
|
-
rotation_eligible: [],
|
|
125
|
-
headroom_threshold: 0.9,
|
|
126
|
-
},
|
|
127
|
-
snapshots: quotaSnapshots,
|
|
128
|
-
defaultEnabled,
|
|
129
|
-
defaultReady: defaultRoute !== null,
|
|
130
|
-
defaultRoute,
|
|
131
|
-
readyProfileIds: readyProfiles.get(harnessId) ?? new Set(),
|
|
132
|
-
model: h?.default_model ?? null,
|
|
133
|
-
}),
|
|
180
|
+
next_up: {
|
|
181
|
+
kind: "none",
|
|
182
|
+
reason: selection.outcome === "exhausted"
|
|
183
|
+
? `every enabled account is over its quota window${selection.resets_at ? ` (earliest reset ${selection.resets_at})` : ""}; unpinned runs wait for the reset (the paid API-key route requires the explicit api_key preference)`
|
|
184
|
+
: "no enabled account is signed in for this harness; connect an account or pin one per-run (--profile)",
|
|
185
|
+
},
|
|
134
186
|
};
|
|
135
187
|
});
|
|
136
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-projection.js","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"accounts-projection.js","sourceRoot":"","sources":["../src/accounts-projection.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,eAAe,IAAI,qBAAqB,EACxC,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EACL,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAA0B;IAC/D,IAAI,CAAC,OAAO,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,OAAO,CAAC,UAAU,KAAK,OAAO;QAAE,OAAO,oBAAoB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3F,IAAI,OAAO,CAAC,UAAU,KAAK,QAAQ;QAAE,OAAO,qBAAqB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7F,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAA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AE,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,CAAC;QACvE,CAAC;QACD,OAAO;YACL,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,MAAM,EACJ,SAAS,CAAC,OAAO,KAAK,WAAW;oBAC/B,CAAC,CAAC,iDAAiD,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,sGAAsG;oBAC9N,CAAC,CAAC,qGAAqG;aAC5G;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -28,6 +28,9 @@ export declare function projectHarnessStatuses(statuses: readonly HarnessStatus[
|
|
|
28
28
|
remediation: string | null;
|
|
29
29
|
requiresFullAccess: boolean;
|
|
30
30
|
};
|
|
31
|
+
setupLogin: {
|
|
32
|
+
mode: "external_terminal" | "in_app";
|
|
33
|
+
} | null;
|
|
31
34
|
readiness: {
|
|
32
35
|
id: string;
|
|
33
36
|
kind: "auth" | "binary" | "model" | "probe" | "smoke";
|
|
@@ -38,140 +41,149 @@ export declare function projectHarnessStatuses(statuses: readonly HarnessStatus[
|
|
|
38
41
|
}[]>;
|
|
39
42
|
/** One server-owned Accounts response builder. The opt-in form refreshes quota
|
|
40
43
|
* first and then derives next_up from that exact returned response; no client
|
|
41
|
-
* can accidentally pair a newer quota card with an older routing identity.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
native_credentials_enabled: boolean;
|
|
53
|
-
native_login_detected: boolean;
|
|
54
|
-
identity: {
|
|
55
|
-
email?: string | undefined;
|
|
56
|
-
plan?: string | undefined;
|
|
57
|
-
} | null;
|
|
58
|
-
next_up: {
|
|
59
|
-
kind: "profile";
|
|
60
|
-
profileId: string;
|
|
61
|
-
} | {
|
|
62
|
-
kind: "native";
|
|
63
|
-
route?: "api_key" | "local_session" | undefined;
|
|
64
|
-
} | {
|
|
65
|
-
kind: "none";
|
|
66
|
-
reason: string;
|
|
67
|
-
};
|
|
68
|
-
}[];
|
|
69
|
-
} | {
|
|
70
|
-
profiles: {
|
|
71
|
-
profile: CredentialProfile;
|
|
72
|
-
status: CredentialProfileStatus;
|
|
73
|
-
identity: import("@claudexor/schema").AccountIdentity | null;
|
|
74
|
-
}[];
|
|
75
|
-
harnessAccounts: {
|
|
76
|
-
harness_id: string;
|
|
77
|
-
native_credentials_enabled: boolean;
|
|
78
|
-
native_login_detected: boolean;
|
|
79
|
-
identity: {
|
|
80
|
-
email?: string | undefined;
|
|
81
|
-
plan?: string | undefined;
|
|
82
|
-
} | null;
|
|
83
|
-
next_up: {
|
|
84
|
-
kind: "profile";
|
|
85
|
-
profileId: string;
|
|
86
|
-
} | {
|
|
87
|
-
kind: "native";
|
|
88
|
-
route?: "api_key" | "local_session" | undefined;
|
|
89
|
-
} | {
|
|
90
|
-
kind: "none";
|
|
91
|
-
reason: string;
|
|
92
|
-
};
|
|
93
|
-
}[];
|
|
94
|
-
harnesses: {
|
|
95
|
-
id: string;
|
|
96
|
-
available: boolean;
|
|
97
|
-
status: "ok" | "degraded" | "unavailable";
|
|
98
|
-
manifest: import("@claudexor/schema").HarnessManifest | null;
|
|
99
|
-
enabledIntents: import("@claudexor/schema").Intent[];
|
|
100
|
-
routableIntents: import("@claudexor/schema").Intent[];
|
|
101
|
-
disabledIntents: import("@claudexor/schema").Intent[];
|
|
102
|
-
checks: import("@claudexor/schema").ConformanceCheck[];
|
|
103
|
-
reasons: string[];
|
|
104
|
-
authSources: import("@claudexor/schema").AuthSourceReadiness[];
|
|
105
|
-
configuredModel: string | null;
|
|
106
|
-
configuredModelCheck: {
|
|
107
|
-
status: "ok" | "rejected";
|
|
108
|
-
message?: string | null;
|
|
109
|
-
} | null;
|
|
110
|
-
delegation: {
|
|
111
|
-
available: boolean;
|
|
112
|
-
reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
|
|
113
|
-
remediation: string | null;
|
|
114
|
-
requiresFullAccess: boolean;
|
|
115
|
-
};
|
|
116
|
-
readiness: {
|
|
117
|
-
id: string;
|
|
118
|
-
kind: "auth" | "binary" | "model" | "probe" | "smoke";
|
|
119
|
-
title: string;
|
|
120
|
-
status: "fail" | "pass" | "skip";
|
|
121
|
-
detail: string | null;
|
|
44
|
+
* can accidentally pair a newer quota card with an older routing identity.
|
|
45
|
+
* Returns the listing service plus the pool-authority read
|
|
46
|
+
* (`GET /v2/account-pools`) so both share one cached projection. */
|
|
47
|
+
export declare function createCredentialProfilesService(quotaRegistry: () => QuotaRegistry): {
|
|
48
|
+
credentialProfiles: (input?: {
|
|
49
|
+
snapshot?: boolean;
|
|
50
|
+
}) => Promise<{
|
|
51
|
+
profiles: {
|
|
52
|
+
profile: CredentialProfile;
|
|
53
|
+
status: CredentialProfileStatus;
|
|
54
|
+
identity: import("@claudexor/schema").AccountIdentity | null;
|
|
122
55
|
}[];
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
135
|
-
plan_label: string | null;
|
|
136
|
-
subject_id: string | null;
|
|
56
|
+
harnessAccounts: never[];
|
|
57
|
+
accountPools: {
|
|
58
|
+
harness_id: string;
|
|
59
|
+
next_up: {
|
|
60
|
+
kind: "profile";
|
|
61
|
+
profileId: string;
|
|
62
|
+
} | {
|
|
63
|
+
kind: "api_key_route";
|
|
64
|
+
} | {
|
|
65
|
+
kind: "none";
|
|
66
|
+
reason: string;
|
|
137
67
|
};
|
|
138
|
-
|
|
68
|
+
}[];
|
|
69
|
+
} | {
|
|
70
|
+
profiles: {
|
|
71
|
+
profile: CredentialProfile;
|
|
72
|
+
status: CredentialProfileStatus;
|
|
73
|
+
identity: import("@claudexor/schema").AccountIdentity | null;
|
|
74
|
+
}[];
|
|
75
|
+
harnessAccounts: never[];
|
|
76
|
+
accountPools: {
|
|
77
|
+
harness_id: string;
|
|
78
|
+
next_up: {
|
|
79
|
+
kind: "profile";
|
|
80
|
+
profileId: string;
|
|
81
|
+
} | {
|
|
82
|
+
kind: "api_key_route";
|
|
83
|
+
} | {
|
|
84
|
+
kind: "none";
|
|
85
|
+
reason: string;
|
|
86
|
+
};
|
|
87
|
+
}[];
|
|
88
|
+
harnesses: {
|
|
89
|
+
id: string;
|
|
90
|
+
available: boolean;
|
|
91
|
+
status: "ok" | "degraded" | "unavailable";
|
|
92
|
+
manifest: import("@claudexor/schema").HarnessManifest | null;
|
|
93
|
+
enabledIntents: import("@claudexor/schema").Intent[];
|
|
94
|
+
routableIntents: import("@claudexor/schema").Intent[];
|
|
95
|
+
disabledIntents: import("@claudexor/schema").Intent[];
|
|
96
|
+
checks: import("@claudexor/schema").ConformanceCheck[];
|
|
97
|
+
reasons: string[];
|
|
98
|
+
authSources: import("@claudexor/schema").AuthSourceReadiness[];
|
|
99
|
+
configuredModel: string | null;
|
|
100
|
+
configuredModelCheck: {
|
|
101
|
+
status: "ok" | "rejected";
|
|
102
|
+
message?: string | null;
|
|
103
|
+
} | null;
|
|
104
|
+
delegation: {
|
|
105
|
+
available: boolean;
|
|
106
|
+
reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
|
|
107
|
+
remediation: string | null;
|
|
108
|
+
requiresFullAccess: boolean;
|
|
109
|
+
};
|
|
110
|
+
setupLogin: {
|
|
111
|
+
mode: "external_terminal" | "in_app";
|
|
112
|
+
} | null;
|
|
113
|
+
readiness: {
|
|
139
114
|
id: string;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
window_seconds: number | null;
|
|
145
|
-
resets_at: string | null;
|
|
146
|
-
cooldown_until: string | null;
|
|
115
|
+
kind: "auth" | "binary" | "model" | "probe" | "smoke";
|
|
116
|
+
title: string;
|
|
117
|
+
status: "fail" | "pass" | "skip";
|
|
118
|
+
detail: string | null;
|
|
147
119
|
}[];
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
120
|
+
}[];
|
|
121
|
+
git: {
|
|
122
|
+
status: "available" | "developer_tools_stub" | "failed" | "missing";
|
|
123
|
+
version: string | null;
|
|
124
|
+
detail: string | null;
|
|
125
|
+
remediation: string | null;
|
|
126
|
+
};
|
|
127
|
+
quota: {
|
|
128
|
+
snapshots: {
|
|
129
|
+
subject: {
|
|
130
|
+
harness: string;
|
|
131
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
132
|
+
plan_label: string | null;
|
|
133
|
+
subject_id: string | null;
|
|
134
|
+
};
|
|
135
|
+
constraints: {
|
|
136
|
+
id: string;
|
|
137
|
+
label: string;
|
|
138
|
+
applies_to_models?: string[] | null | undefined;
|
|
139
|
+
applies_to_unspecified_model?: boolean | undefined;
|
|
140
|
+
used_ratio: number | null;
|
|
141
|
+
window_seconds: number | null;
|
|
158
142
|
resets_at: string | null;
|
|
143
|
+
cooldown_until: string | null;
|
|
159
144
|
}[];
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
145
|
+
source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
|
|
146
|
+
observed_at: string;
|
|
147
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
148
|
+
availability?: {
|
|
149
|
+
state: "available" | "cooldown" | "exhausted";
|
|
150
|
+
blocking_constraints: string[];
|
|
151
|
+
resets_at: string | null;
|
|
152
|
+
model_scoped_exhaustions: {
|
|
153
|
+
constraint_id: string;
|
|
154
|
+
applies_to_models: string[];
|
|
155
|
+
resets_at: string | null;
|
|
156
|
+
}[];
|
|
157
|
+
} | undefined;
|
|
158
|
+
}[];
|
|
159
|
+
absences: {
|
|
160
|
+
subject: {
|
|
161
|
+
harness: string;
|
|
162
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
163
|
+
plan_label: string | null;
|
|
164
|
+
subject_id: string | null;
|
|
165
|
+
};
|
|
166
|
+
reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
|
|
167
|
+
detail: string | null;
|
|
168
|
+
observed_at: string;
|
|
169
|
+
}[];
|
|
170
|
+
refreshed_at: string | null;
|
|
171
|
+
};
|
|
172
|
+
quotaEventCursor: string;
|
|
173
|
+
}>;
|
|
174
|
+
accountPools: () => Promise<{
|
|
175
|
+
accountPools: {
|
|
176
|
+
harness_id: string;
|
|
177
|
+
next_up: {
|
|
178
|
+
kind: "profile";
|
|
179
|
+
profileId: string;
|
|
180
|
+
} | {
|
|
181
|
+
kind: "api_key_route";
|
|
182
|
+
} | {
|
|
183
|
+
kind: "none";
|
|
184
|
+
reason: string;
|
|
168
185
|
};
|
|
169
|
-
reason: "auth_revoked" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
|
|
170
|
-
detail: string | null;
|
|
171
|
-
observed_at: string;
|
|
172
186
|
}[];
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
quotaEventCursor: string;
|
|
176
|
-
}>;
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
177
189
|
//# sourceMappingURL=accounts-services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts-services.d.ts","sourceRoot":"","sources":["../src/accounts-services.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI5E,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EAGxB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"accounts-services.d.ts","sourceRoot":"","sources":["../src/accounts-services.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAI5E,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EAGxB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAEF,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE;;;;;;;;;;;;;gBAMpD,IAAI,GAAG,UAAU;kBAAY,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;KA0BpE;AAED;;;;oEAIoE;AACpE,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,MAAM,aAAa;iCA4BtC;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA7DvC,IAAI,GAAG,UAAU;0BAAY,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkGpE"}
|