@claudexor/cli 3.23.2 → 3.25.1
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/account-management.d.ts +17 -0
- package/dist/account-management.d.ts.map +1 -0
- package/dist/account-management.js +35 -0
- package/dist/account-management.js.map +1 -0
- package/dist/account-observations.d.ts +7 -3
- package/dist/account-observations.d.ts.map +1 -1
- package/dist/account-observations.js +16 -4
- package/dist/account-observations.js.map +1 -1
- package/dist/account-reset-command.d.ts +3 -0
- package/dist/account-reset-command.d.ts.map +1 -0
- package/dist/account-reset-command.js +32 -0
- package/dist/account-reset-command.js.map +1 -0
- package/dist/account-reset-services.d.ts +341 -0
- package/dist/account-reset-services.d.ts.map +1 -0
- package/dist/account-reset-services.js +183 -0
- package/dist/account-reset-services.js.map +1 -0
- package/dist/account-resource-query.d.ts +18 -0
- package/dist/account-resource-query.d.ts.map +1 -0
- package/dist/account-resource-query.js +62 -0
- package/dist/account-resource-query.js.map +1 -0
- package/dist/accounts-services.d.ts +1 -0
- package/dist/accounts-services.d.ts.map +1 -1
- package/dist/accounts-services.js +4 -2
- package/dist/accounts-services.js.map +1 -1
- package/dist/claude-account-resources.d.ts +5 -0
- package/dist/claude-account-resources.d.ts.map +1 -0
- package/dist/claude-account-resources.js +134 -0
- package/dist/claude-account-resources.js.map +1 -0
- package/dist/claude-oauth-codec.d.ts +4 -0
- package/dist/claude-oauth-codec.d.ts.map +1 -0
- package/dist/claude-oauth-codec.js +71 -0
- package/dist/claude-oauth-codec.js.map +1 -0
- package/dist/claude-oauth-credential.d.ts +6 -0
- package/dist/claude-oauth-credential.d.ts.map +1 -1
- package/dist/claude-oauth-credential.js +18 -0
- package/dist/claude-oauth-credential.js.map +1 -1
- package/dist/claude-oauth-fetch.d.ts +1 -1
- package/dist/claude-oauth-fetch.d.ts.map +1 -1
- package/dist/claude-oauth-fetch.js +3 -2
- package/dist/claude-oauth-fetch.js.map +1 -1
- package/dist/claude-oauth-usage.d.ts +5 -4
- package/dist/claude-oauth-usage.d.ts.map +1 -1
- package/dist/claude-oauth-usage.js +47 -75
- package/dist/claude-oauth-usage.js.map +1 -1
- package/dist/claude-resource-source.d.ts +18 -0
- package/dist/claude-resource-source.d.ts.map +1 -0
- package/dist/claude-resource-source.js +108 -0
- package/dist/claude-resource-source.js.map +1 -0
- package/dist/claude-resource-transport.d.ts +12 -0
- package/dist/claude-resource-transport.d.ts.map +1 -0
- package/dist/claude-resource-transport.js +47 -0
- package/dist/claude-resource-transport.js.map +1 -0
- package/dist/claudexord.d.ts.map +1 -1
- package/dist/claudexord.js +10 -4
- package/dist/claudexord.js.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/codex-quota-source.d.ts +7 -2
- package/dist/codex-quota-source.d.ts.map +1 -1
- package/dist/codex-quota-source.js +72 -12
- package/dist/codex-quota-source.js.map +1 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +7 -0
- package/dist/command-flags.js.map +1 -1
- package/dist/control-services.d.ts +264 -118
- package/dist/control-services.d.ts.map +1 -1
- package/dist/harness-command-specs.d.ts.map +1 -1
- package/dist/harness-command-specs.js +11 -4
- package/dist/harness-command-specs.js.map +1 -1
- package/dist/harness-command.d.ts.map +1 -1
- package/dist/harness-command.js +5 -0
- package/dist/harness-command.js.map +1 -1
- package/dist/harness-install-proof.d.ts +9 -0
- package/dist/harness-install-proof.d.ts.map +1 -1
- package/dist/harness-install-proof.js +60 -8
- package/dist/harness-install-proof.js.map +1 -1
- package/dist/harness-install-recipes.d.ts +24 -1
- package/dist/harness-install-recipes.d.ts.map +1 -1
- package/dist/harness-install-recipes.js +54 -2
- package/dist/harness-install-recipes.js.map +1 -1
- package/dist/harness-install-runtime.d.ts +29 -0
- package/dist/harness-install-runtime.d.ts.map +1 -0
- package/dist/harness-install-runtime.js +51 -0
- package/dist/harness-install-runtime.js.map +1 -0
- package/dist/harness-installer.d.ts +19 -65
- package/dist/harness-installer.d.ts.map +1 -1
- package/dist/harness-installer.js +46 -48
- package/dist/harness-installer.js.map +1 -1
- package/dist/harness-maintenance-service.d.ts +473 -0
- package/dist/harness-maintenance-service.d.ts.map +1 -0
- package/dist/harness-maintenance-service.js +429 -0
- package/dist/harness-maintenance-service.js.map +1 -0
- package/dist/harness-maintenance.d.ts +62 -0
- package/dist/harness-maintenance.d.ts.map +1 -0
- package/dist/harness-maintenance.js +353 -0
- package/dist/harness-maintenance.js.map +1 -0
- package/dist/mcp-runner.d.ts.map +1 -1
- package/dist/mcp-runner.js +5 -0
- package/dist/mcp-runner.js.map +1 -1
- package/dist/model-services.d.ts +9 -1
- package/dist/model-services.d.ts.map +1 -1
- package/dist/model-services.js +39 -10
- package/dist/model-services.js.map +1 -1
- package/dist/ops-command-specs.d.ts.map +1 -1
- package/dist/ops-command-specs.js +11 -2
- package/dist/ops-command-specs.js.map +1 -1
- package/dist/quota-command.d.ts.map +1 -1
- package/dist/quota-command.js +38 -2
- package/dist/quota-command.js.map +1 -1
- package/dist/quota-refreshers.d.ts +3 -1
- package/dist/quota-refreshers.d.ts.map +1 -1
- package/dist/quota-refreshers.js +6 -2
- package/dist/quota-refreshers.js.map +1 -1
- package/dist/quota-services.d.ts +234 -2
- package/dist/quota-services.d.ts.map +1 -1
- package/dist/quota-services.js +49 -4
- package/dist/quota-services.js.map +1 -1
- package/package.json +25 -25
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AccountTarget, CredentialProfile } from "@claudexor/schema";
|
|
2
|
+
/** Management resolves custody, never inference admission. Disabled portable
|
|
3
|
+
* profiles and ordinary default-named registry rows remain exact targets. */
|
|
4
|
+
export declare function accountManagementTarget(target: AccountTarget, profiles?: readonly CredentialProfile[]): {
|
|
5
|
+
profile: {
|
|
6
|
+
profile_id: string;
|
|
7
|
+
harness_id: string;
|
|
8
|
+
display_name: string;
|
|
9
|
+
credential_kind: "api_key" | "config_dir_login" | "oauth_token";
|
|
10
|
+
isolation_locator: string | null;
|
|
11
|
+
secret_ref: string | null;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
created_at: string | null;
|
|
14
|
+
};
|
|
15
|
+
locator: string;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=account-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-management.d.ts","sourceRoot":"","sources":["../src/account-management.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI1E;6EAC6E;AAC7E,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,QAAQ,GAAE,SAAS,iBAAiB,EACd;;;;;;;;;;;;EAgCvB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { loadConfig } from "@claudexor/config";
|
|
2
|
+
import { credentialProfilePolicyState, credentialProfilePolicyProblem } from "@claudexor/core";
|
|
3
|
+
import { canonicalCodexProfileHome } from "@claudexor/harness-codex";
|
|
4
|
+
import { canonicalProfileConfigDir } from "@claudexor/harness-claude";
|
|
5
|
+
import { noProjectRepoRoot } from "@claudexor/util";
|
|
6
|
+
import { buildRegistry } from "./registry.js";
|
|
7
|
+
/** Management resolves custody, never inference admission. Disabled portable
|
|
8
|
+
* profiles and ordinary default-named registry rows remain exact targets. */
|
|
9
|
+
export function accountManagementTarget(target, profiles = loadConfig(noProjectRepoRoot()).global
|
|
10
|
+
.credential_profiles) {
|
|
11
|
+
const profile = profiles.find((p) => p.harness_id === target.harness && p.profile_id === target.profile_id);
|
|
12
|
+
if (!profile)
|
|
13
|
+
throw Object.assign(new Error("Account target is not registered"), {
|
|
14
|
+
status: 404,
|
|
15
|
+
code: "credential_profile_not_found",
|
|
16
|
+
});
|
|
17
|
+
const adapter = buildRegistry({ includeFakes: false }).get(target.harness);
|
|
18
|
+
const state = credentialProfilePolicyState({ adapter, registry: profiles });
|
|
19
|
+
if (state.ambiguous)
|
|
20
|
+
throw credentialProfilePolicyProblem(state, "credential_profile_ambiguous");
|
|
21
|
+
if (state.policy.identity_scope !== "profile" && !profile.enabled)
|
|
22
|
+
throw Object.assign(new Error("Disabled shared native identity cannot be independently addressed"), { status: 409, code: "account_identity_shared" });
|
|
23
|
+
if (profile.credential_kind !== "config_dir_login" ||
|
|
24
|
+
!profile.isolation_locator ||
|
|
25
|
+
!["codex", "claude"].includes(target.harness))
|
|
26
|
+
throw Object.assign(new Error("This account has no native resource management source"), {
|
|
27
|
+
status: 503,
|
|
28
|
+
code: "account_resources_unsupported",
|
|
29
|
+
});
|
|
30
|
+
const locator = target.harness === "codex"
|
|
31
|
+
? canonicalCodexProfileHome(profile.isolation_locator)
|
|
32
|
+
: canonicalProfileConfigDir(profile.isolation_locator);
|
|
33
|
+
return { profile, locator };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=account-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-management.js","sourceRoot":"","sources":["../src/account-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;6EAC6E;AAC7E,MAAM,UAAU,uBAAuB,CACrC,MAAqB,EACrB,QAAQ,GAAiC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC,MAAM;KAC5E,mBAAmB;IAEtB,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAC3B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,OAAO,I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AAC,CAAC;IAC3D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -9,11 +9,15 @@ interface Observation<T> {
|
|
|
9
9
|
* Refresh discard it. Run admission does not read this display cache. */
|
|
10
10
|
declare class AccountObservations {
|
|
11
11
|
private entries;
|
|
12
|
-
generation
|
|
12
|
+
private generation;
|
|
13
|
+
private harnessGenerations;
|
|
13
14
|
constructor();
|
|
14
15
|
invalidate(): void;
|
|
16
|
+
generationFor(harnessId: string): string;
|
|
17
|
+
/** One harness's observations only (e.g. after its CLI was replaced). */
|
|
18
|
+
invalidateHarness(harnessId: string): void;
|
|
15
19
|
invalidateCatalogs(): void;
|
|
16
|
-
observeProfile(profile: CredentialProfile, receipt: CredentialAccountProbeReceipt, generation:
|
|
20
|
+
observeProfile(profile: CredentialProfile, receipt: CredentialAccountProbeReceipt, generation: string): void;
|
|
17
21
|
read<T>(kind: string, profile: CredentialProfile, acquire: () => Promise<T>, fresh?: boolean): Promise<Observation<T>>;
|
|
18
22
|
}
|
|
19
23
|
export declare const accountObservations: AccountObservations;
|
|
@@ -25,7 +29,7 @@ export declare function profileAccountIdentity(profile: CredentialProfile): {
|
|
|
25
29
|
/** One acquisition shared by profile hydration and account-catalog display. */
|
|
26
30
|
export declare function displayAccountObservation(profile: CredentialProfile, adapter?: HarnessAdapter, fresh?: boolean): Promise<CredentialAccountProbeReceipt>;
|
|
27
31
|
/** Existing necessary probes feed the same display owner; observing a run
|
|
28
|
-
* never starts an extra probe.
|
|
32
|
+
* never starts an extra probe. Credential or harness changes reject late receipts. */
|
|
29
33
|
export declare function retainAccountProbeObservations(adapter: HarnessAdapter): HarnessAdapter;
|
|
30
34
|
export {};
|
|
31
35
|
//# sourceMappingURL=account-observations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-observations.d.ts","sourceRoot":"","sources":["../src/account-observations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BA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ED,eAAO,MAAM,mBAAmB,qBAA4B,CAAC;AAE7D,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB;;;SAKhE;AAED,+EAA+E;AAC/E,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,cAAc,EACxB,KAAK,UAAQ,GACZ,OAAO,CAAC,6BAA6B,CAAC,CAuCxC;AAED;sFACsF;AACtF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAkCtF"}
|
|
@@ -10,12 +10,24 @@ import { registerStatusProjection, STATUS_PROJECTION_TTL_MS } from "./status-pro
|
|
|
10
10
|
class AccountObservations {
|
|
11
11
|
entries = new Map();
|
|
12
12
|
generation = 0;
|
|
13
|
+
harnessGenerations = new Map();
|
|
13
14
|
constructor() {
|
|
14
15
|
registerStatusProjection(this);
|
|
15
16
|
}
|
|
16
17
|
invalidate() {
|
|
17
18
|
this.entries.clear();
|
|
18
19
|
this.generation += 1;
|
|
20
|
+
this.harnessGenerations.clear();
|
|
21
|
+
}
|
|
22
|
+
generationFor(harnessId) {
|
|
23
|
+
return `${this.generation}:${this.harnessGenerations.get(harnessId) ?? 0}`;
|
|
24
|
+
}
|
|
25
|
+
/** One harness's observations only (e.g. after its CLI was replaced). */
|
|
26
|
+
invalidateHarness(harnessId) {
|
|
27
|
+
this.harnessGenerations.set(harnessId, (this.harnessGenerations.get(harnessId) ?? 0) + 1);
|
|
28
|
+
for (const key of this.entries.keys())
|
|
29
|
+
if (key.split("\0")[2] === harnessId)
|
|
30
|
+
this.entries.delete(key);
|
|
19
31
|
}
|
|
20
32
|
invalidateCatalogs() {
|
|
21
33
|
for (const key of this.entries.keys())
|
|
@@ -23,7 +35,7 @@ class AccountObservations {
|
|
|
23
35
|
this.entries.delete(key);
|
|
24
36
|
}
|
|
25
37
|
observeProfile(profile, receipt, generation) {
|
|
26
|
-
if (generation !== this.
|
|
38
|
+
if (generation !== this.generationFor(profile.harness_id))
|
|
27
39
|
return;
|
|
28
40
|
const key = [globalConfigPath(), "profile", profile.harness_id, profile.profile_id].join("\0");
|
|
29
41
|
// The display acquisition already receives this same adapter response.
|
|
@@ -104,7 +116,7 @@ export async function displayAccountObservation(profile, adapter, fresh = false)
|
|
|
104
116
|
};
|
|
105
117
|
}
|
|
106
118
|
/** Existing necessary probes feed the same display owner; observing a run
|
|
107
|
-
* never starts an extra probe.
|
|
119
|
+
* never starts an extra probe. Credential or harness changes reject late receipts. */
|
|
108
120
|
export function retainAccountProbeObservations(adapter) {
|
|
109
121
|
const profileProbe = adapter.probeCredentialProfile?.bind(adapter);
|
|
110
122
|
const accountProbe = adapter.probeCredentialAccount?.bind(adapter);
|
|
@@ -113,7 +125,7 @@ export function retainAccountProbeObservations(adapter) {
|
|
|
113
125
|
...(profileProbe
|
|
114
126
|
? {
|
|
115
127
|
probeCredentialProfile: async (...args) => {
|
|
116
|
-
const generation = accountObservations.
|
|
128
|
+
const generation = accountObservations.generationFor(args[0].harness_id);
|
|
117
129
|
const status = await profileProbe(...args);
|
|
118
130
|
accountObservations.observeProfile(args[0], { status, identity: profileAccountIdentity(args[0]) }, generation);
|
|
119
131
|
return status;
|
|
@@ -123,7 +135,7 @@ export function retainAccountProbeObservations(adapter) {
|
|
|
123
135
|
...(accountProbe
|
|
124
136
|
? {
|
|
125
137
|
probeCredentialAccount: async (...args) => {
|
|
126
|
-
const generation = accountObservations.
|
|
138
|
+
const generation = accountObservations.generationFor(args[0].harness_id);
|
|
127
139
|
const receipt = await accountProbe(...args);
|
|
128
140
|
accountObservations.observeProfile(args[0], receipt, generation);
|
|
129
141
|
return receipt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-observations.js","sourceRoot":"","sources":["../src/account-observations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB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":"","sources":["../src/account-reset-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAKrD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA4B1F"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { flagStr } from "./args.js";
|
|
2
|
+
import { print, printJson } from "./cli-io.js";
|
|
3
|
+
import { renderCliFailure } from "./cli-error.js";
|
|
4
|
+
import { accountResourceQuery, parseAccountTarget } from "./account-resource-query.js";
|
|
5
|
+
export async function accountResetCommand(args, json) {
|
|
6
|
+
try {
|
|
7
|
+
const operation = flagStr(args, "operation");
|
|
8
|
+
if (operation &&
|
|
9
|
+
(args._[1] ||
|
|
10
|
+
flagStr(args, "offer") ||
|
|
11
|
+
flagStr(args, "grant") ||
|
|
12
|
+
flagStr(args, "idempotency-key")))
|
|
13
|
+
throw new Error("--operation cannot be combined with a reset request");
|
|
14
|
+
const value = operation
|
|
15
|
+
? await accountResourceQuery("reset", { operation_id: operation })
|
|
16
|
+
: await accountResourceQuery("reset", {
|
|
17
|
+
target: parseAccountTarget(args._[1] ?? ""),
|
|
18
|
+
offer_id: flagStr(args, "offer") ?? "",
|
|
19
|
+
grant_id: flagStr(args, "grant"),
|
|
20
|
+
idempotency_key: flagStr(args, "idempotency-key") ?? "",
|
|
21
|
+
});
|
|
22
|
+
if (json)
|
|
23
|
+
printJson(value);
|
|
24
|
+
else
|
|
25
|
+
print(`${value.id}: ${value.outcome}; resource readback: ${value.readback.state}${value.detail ? ` (${value.detail})` : ""}`);
|
|
26
|
+
return ["unknown", "already_used", "unavailable"].includes(value.outcome) ? 1 : 0;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
return renderCliFailure(json, error, { messagePrefix: "claudexor account-reset:" });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=account-reset-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-reset-command.js","sourceRoot":"","sources":["../src/account-reset-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEvF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAgB,EAAE,IAAa;IACvE,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC7C,IACE,SAAS;YACT,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;gBACtB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;gBACtB,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;YAEnC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,MAAM,KAAK,GAAG,SAAS;YACrB,CAAC,CAAC,MAAM,oBAAoB,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;YAClE,CAAC,CAAC,MAAM,oBAAoB,CAAC,OAAO,EAAE;gBAClC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC3C,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;gBACtC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;gBAChC,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,EAAE;aACxD,CAAC,CAAC;QACP,IAAI,IAAI;YAAE,SAAS,CAAC,KAAK,CAAC,CAAC;;YAEzB,KAAK,CACH,GAAG,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,OAAO,wBAAwB,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACvH,CAAC;QACJ,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,0BAA0B,EAAE,CAAC,CAAC;IACtF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { type AccountResetBinding, type CommandStore, type QuotaRegistry } from "@claudexor/daemon";
|
|
2
|
+
import type { ControlAccountResetRequest, ControlAccountResetResponse } from "@claudexor/schema";
|
|
3
|
+
export declare function accountResetServices(commands: {
|
|
4
|
+
current(): CommandStore;
|
|
5
|
+
}, quota: {
|
|
6
|
+
current(): QuotaRegistry;
|
|
7
|
+
}): {
|
|
8
|
+
createAccountReset: (input: {
|
|
9
|
+
request: ControlAccountResetRequest;
|
|
10
|
+
idempotencyKey: string;
|
|
11
|
+
clientId: string;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
id: string;
|
|
14
|
+
request: {
|
|
15
|
+
target: {
|
|
16
|
+
harness: string;
|
|
17
|
+
profile_id: string;
|
|
18
|
+
};
|
|
19
|
+
offer_id: string;
|
|
20
|
+
grant_id?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
state: "completed" | "running";
|
|
23
|
+
created_at: string;
|
|
24
|
+
completed_at: string | null;
|
|
25
|
+
outcome: "already_redeemed" | "already_used" | "cooldown" | "no_credit" | "not_eligible" | "nothing_to_reset" | "pending" | "reset" | "unavailable" | "unknown";
|
|
26
|
+
detail: string | null;
|
|
27
|
+
readback: {
|
|
28
|
+
state: "failed" | "fresh" | "pending";
|
|
29
|
+
attempted_at: string | null;
|
|
30
|
+
detail: string | null;
|
|
31
|
+
};
|
|
32
|
+
resources: {
|
|
33
|
+
snapshots: {
|
|
34
|
+
subject: {
|
|
35
|
+
harness: string;
|
|
36
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
37
|
+
plan_label: string | null;
|
|
38
|
+
subject_id: string | null;
|
|
39
|
+
};
|
|
40
|
+
constraints: {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
applies_to_models?: string[] | null | undefined;
|
|
44
|
+
applies_to_model_prefixes?: string[] | undefined;
|
|
45
|
+
applies_to_unspecified_model?: boolean | undefined;
|
|
46
|
+
used_ratio: number | null;
|
|
47
|
+
window_seconds: number | null;
|
|
48
|
+
resets_at: string | null;
|
|
49
|
+
cooldown_until: string | null;
|
|
50
|
+
}[];
|
|
51
|
+
source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
|
|
52
|
+
observed_at: string;
|
|
53
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
54
|
+
snapshot_id?: string | undefined;
|
|
55
|
+
availability?: {
|
|
56
|
+
state: "available" | "cooldown" | "exhausted";
|
|
57
|
+
blocking_constraints: string[];
|
|
58
|
+
resets_at: string | null;
|
|
59
|
+
model_scoped_exhaustions: {
|
|
60
|
+
constraint_id: string;
|
|
61
|
+
applies_to_models: string[];
|
|
62
|
+
applies_to_model_prefixes?: string[] | undefined;
|
|
63
|
+
resets_at: string | null;
|
|
64
|
+
}[];
|
|
65
|
+
} | undefined;
|
|
66
|
+
}[];
|
|
67
|
+
absences: {
|
|
68
|
+
subject: {
|
|
69
|
+
harness: string;
|
|
70
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
71
|
+
plan_label: string | null;
|
|
72
|
+
subject_id: string | null;
|
|
73
|
+
};
|
|
74
|
+
reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "poll_paced" | "probe_skipped_rate_limited" | "rate_limited" | "refresh_failed" | "transport_unavailable";
|
|
75
|
+
detail: string | null;
|
|
76
|
+
observed_at: string;
|
|
77
|
+
retry_after_ms?: number | undefined;
|
|
78
|
+
}[];
|
|
79
|
+
refreshed_at: string | null;
|
|
80
|
+
refresh_skipped?: {
|
|
81
|
+
vendor: string;
|
|
82
|
+
subject?: {
|
|
83
|
+
harness: string;
|
|
84
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
85
|
+
plan_label: string | null;
|
|
86
|
+
subject_id: string | null;
|
|
87
|
+
} | undefined;
|
|
88
|
+
not_before: string;
|
|
89
|
+
}[] | undefined;
|
|
90
|
+
resources: {
|
|
91
|
+
target: {
|
|
92
|
+
harness: string;
|
|
93
|
+
profile_id: string;
|
|
94
|
+
};
|
|
95
|
+
balances: {
|
|
96
|
+
value: {
|
|
97
|
+
id: string;
|
|
98
|
+
label: string;
|
|
99
|
+
amount: string | null;
|
|
100
|
+
unit: string;
|
|
101
|
+
currency: string | null;
|
|
102
|
+
decimal_places: number | null;
|
|
103
|
+
has_balance: boolean | null;
|
|
104
|
+
unlimited: boolean | null;
|
|
105
|
+
}[] | null;
|
|
106
|
+
source: string | null;
|
|
107
|
+
observed_at: string | null;
|
|
108
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
109
|
+
last_attempt_at: string | null;
|
|
110
|
+
last_error: string | null;
|
|
111
|
+
};
|
|
112
|
+
spending: {
|
|
113
|
+
value: {
|
|
114
|
+
id: string;
|
|
115
|
+
label: string;
|
|
116
|
+
enabled: boolean | null;
|
|
117
|
+
used: string | null;
|
|
118
|
+
limit: string | null;
|
|
119
|
+
unit: string;
|
|
120
|
+
currency: string | null;
|
|
121
|
+
decimal_places: number | null;
|
|
122
|
+
resets_at: string | null;
|
|
123
|
+
reason: string | null;
|
|
124
|
+
}[] | null;
|
|
125
|
+
source: string | null;
|
|
126
|
+
observed_at: string | null;
|
|
127
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
128
|
+
last_attempt_at: string | null;
|
|
129
|
+
last_error: string | null;
|
|
130
|
+
};
|
|
131
|
+
resets: {
|
|
132
|
+
value: {
|
|
133
|
+
id: string;
|
|
134
|
+
kind: "granted_reset" | "session_refill";
|
|
135
|
+
label: string;
|
|
136
|
+
description: string | null;
|
|
137
|
+
available_count: number | null;
|
|
138
|
+
eligible: boolean | null;
|
|
139
|
+
usable_now: boolean | null;
|
|
140
|
+
reason: string | null;
|
|
141
|
+
resets_at: string | null;
|
|
142
|
+
weekly_limit_applies: boolean;
|
|
143
|
+
grants: {
|
|
144
|
+
id: string;
|
|
145
|
+
label: string;
|
|
146
|
+
description: string | null;
|
|
147
|
+
available_count: number | null;
|
|
148
|
+
total_count: number | null;
|
|
149
|
+
usable_now: boolean | null;
|
|
150
|
+
starts_at: string | null;
|
|
151
|
+
expires_at: string | null;
|
|
152
|
+
clears: string[];
|
|
153
|
+
}[] | null;
|
|
154
|
+
}[] | null;
|
|
155
|
+
source: string | null;
|
|
156
|
+
observed_at: string | null;
|
|
157
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
158
|
+
last_attempt_at: string | null;
|
|
159
|
+
last_error: string | null;
|
|
160
|
+
};
|
|
161
|
+
diagnostics: {
|
|
162
|
+
value: {
|
|
163
|
+
code: string;
|
|
164
|
+
detail: string | null;
|
|
165
|
+
}[] | null;
|
|
166
|
+
source: string | null;
|
|
167
|
+
observed_at: string | null;
|
|
168
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
169
|
+
last_attempt_at: string | null;
|
|
170
|
+
last_error: string | null;
|
|
171
|
+
};
|
|
172
|
+
}[];
|
|
173
|
+
} | null;
|
|
174
|
+
}>;
|
|
175
|
+
accountReset: (id: string) => Promise<{
|
|
176
|
+
id: string;
|
|
177
|
+
request: {
|
|
178
|
+
target: {
|
|
179
|
+
harness: string;
|
|
180
|
+
profile_id: string;
|
|
181
|
+
};
|
|
182
|
+
offer_id: string;
|
|
183
|
+
grant_id?: string | undefined;
|
|
184
|
+
};
|
|
185
|
+
state: "completed" | "running";
|
|
186
|
+
created_at: string;
|
|
187
|
+
completed_at: string | null;
|
|
188
|
+
outcome: "already_redeemed" | "already_used" | "cooldown" | "no_credit" | "not_eligible" | "nothing_to_reset" | "pending" | "reset" | "unavailable" | "unknown";
|
|
189
|
+
detail: string | null;
|
|
190
|
+
readback: {
|
|
191
|
+
state: "failed" | "fresh" | "pending";
|
|
192
|
+
attempted_at: string | null;
|
|
193
|
+
detail: string | null;
|
|
194
|
+
};
|
|
195
|
+
resources: {
|
|
196
|
+
snapshots: {
|
|
197
|
+
subject: {
|
|
198
|
+
harness: string;
|
|
199
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
200
|
+
plan_label: string | null;
|
|
201
|
+
subject_id: string | null;
|
|
202
|
+
};
|
|
203
|
+
constraints: {
|
|
204
|
+
id: string;
|
|
205
|
+
label: string;
|
|
206
|
+
applies_to_models?: string[] | null | undefined;
|
|
207
|
+
applies_to_model_prefixes?: string[] | undefined;
|
|
208
|
+
applies_to_unspecified_model?: boolean | undefined;
|
|
209
|
+
used_ratio: number | null;
|
|
210
|
+
window_seconds: number | null;
|
|
211
|
+
resets_at: string | null;
|
|
212
|
+
cooldown_until: string | null;
|
|
213
|
+
}[];
|
|
214
|
+
source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_rate_limit_event" | "claude_statusline" | "codex_app_server" | "codex_app_server_event" | "codex_rollout" | "cursor_rate_limit";
|
|
215
|
+
observed_at: string;
|
|
216
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
217
|
+
snapshot_id?: string | undefined;
|
|
218
|
+
availability?: {
|
|
219
|
+
state: "available" | "cooldown" | "exhausted";
|
|
220
|
+
blocking_constraints: string[];
|
|
221
|
+
resets_at: string | null;
|
|
222
|
+
model_scoped_exhaustions: {
|
|
223
|
+
constraint_id: string;
|
|
224
|
+
applies_to_models: string[];
|
|
225
|
+
applies_to_model_prefixes?: string[] | undefined;
|
|
226
|
+
resets_at: string | null;
|
|
227
|
+
}[];
|
|
228
|
+
} | undefined;
|
|
229
|
+
}[];
|
|
230
|
+
absences: {
|
|
231
|
+
subject: {
|
|
232
|
+
harness: string;
|
|
233
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
234
|
+
plan_label: string | null;
|
|
235
|
+
subject_id: string | null;
|
|
236
|
+
};
|
|
237
|
+
reason: "auth_revoked" | "credential_profile_ambiguous" | "no_source" | "not_logged_in" | "platform_unsupported" | "poll_paced" | "probe_skipped_rate_limited" | "rate_limited" | "refresh_failed" | "transport_unavailable";
|
|
238
|
+
detail: string | null;
|
|
239
|
+
observed_at: string;
|
|
240
|
+
retry_after_ms?: number | undefined;
|
|
241
|
+
}[];
|
|
242
|
+
refreshed_at: string | null;
|
|
243
|
+
refresh_skipped?: {
|
|
244
|
+
vendor: string;
|
|
245
|
+
subject?: {
|
|
246
|
+
harness: string;
|
|
247
|
+
credential_route: "local" | "managed_api_key" | "vendor_native";
|
|
248
|
+
plan_label: string | null;
|
|
249
|
+
subject_id: string | null;
|
|
250
|
+
} | undefined;
|
|
251
|
+
not_before: string;
|
|
252
|
+
}[] | undefined;
|
|
253
|
+
resources: {
|
|
254
|
+
target: {
|
|
255
|
+
harness: string;
|
|
256
|
+
profile_id: string;
|
|
257
|
+
};
|
|
258
|
+
balances: {
|
|
259
|
+
value: {
|
|
260
|
+
id: string;
|
|
261
|
+
label: string;
|
|
262
|
+
amount: string | null;
|
|
263
|
+
unit: string;
|
|
264
|
+
currency: string | null;
|
|
265
|
+
decimal_places: number | null;
|
|
266
|
+
has_balance: boolean | null;
|
|
267
|
+
unlimited: boolean | null;
|
|
268
|
+
}[] | null;
|
|
269
|
+
source: string | null;
|
|
270
|
+
observed_at: string | null;
|
|
271
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
272
|
+
last_attempt_at: string | null;
|
|
273
|
+
last_error: string | null;
|
|
274
|
+
};
|
|
275
|
+
spending: {
|
|
276
|
+
value: {
|
|
277
|
+
id: string;
|
|
278
|
+
label: string;
|
|
279
|
+
enabled: boolean | null;
|
|
280
|
+
used: string | null;
|
|
281
|
+
limit: string | null;
|
|
282
|
+
unit: string;
|
|
283
|
+
currency: string | null;
|
|
284
|
+
decimal_places: number | null;
|
|
285
|
+
resets_at: string | null;
|
|
286
|
+
reason: string | null;
|
|
287
|
+
}[] | null;
|
|
288
|
+
source: string | null;
|
|
289
|
+
observed_at: string | null;
|
|
290
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
291
|
+
last_attempt_at: string | null;
|
|
292
|
+
last_error: string | null;
|
|
293
|
+
};
|
|
294
|
+
resets: {
|
|
295
|
+
value: {
|
|
296
|
+
id: string;
|
|
297
|
+
kind: "granted_reset" | "session_refill";
|
|
298
|
+
label: string;
|
|
299
|
+
description: string | null;
|
|
300
|
+
available_count: number | null;
|
|
301
|
+
eligible: boolean | null;
|
|
302
|
+
usable_now: boolean | null;
|
|
303
|
+
reason: string | null;
|
|
304
|
+
resets_at: string | null;
|
|
305
|
+
weekly_limit_applies: boolean;
|
|
306
|
+
grants: {
|
|
307
|
+
id: string;
|
|
308
|
+
label: string;
|
|
309
|
+
description: string | null;
|
|
310
|
+
available_count: number | null;
|
|
311
|
+
total_count: number | null;
|
|
312
|
+
usable_now: boolean | null;
|
|
313
|
+
starts_at: string | null;
|
|
314
|
+
expires_at: string | null;
|
|
315
|
+
clears: string[];
|
|
316
|
+
}[] | null;
|
|
317
|
+
}[] | null;
|
|
318
|
+
source: string | null;
|
|
319
|
+
observed_at: string | null;
|
|
320
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
321
|
+
last_attempt_at: string | null;
|
|
322
|
+
last_error: string | null;
|
|
323
|
+
};
|
|
324
|
+
diagnostics: {
|
|
325
|
+
value: {
|
|
326
|
+
code: string;
|
|
327
|
+
detail: string | null;
|
|
328
|
+
}[] | null;
|
|
329
|
+
source: string | null;
|
|
330
|
+
observed_at: string | null;
|
|
331
|
+
freshness: "fresh" | "stale" | "unknown";
|
|
332
|
+
last_attempt_at: string | null;
|
|
333
|
+
last_error: string | null;
|
|
334
|
+
};
|
|
335
|
+
}[];
|
|
336
|
+
} | null;
|
|
337
|
+
}>;
|
|
338
|
+
};
|
|
339
|
+
export declare function consumeNativeReset(binding: AccountResetBinding): Promise<Pick<ControlAccountResetResponse, "outcome" | "detail">>;
|
|
340
|
+
export declare function nativeResetOutcome(harness: string, value: unknown): Pick<ControlAccountResetResponse, "outcome" | "detail">;
|
|
341
|
+
//# sourceMappingURL=account-reset-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-reset-services.d.ts","sourceRoot":"","sources":["../src/account-reset-services.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAEV,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,mBAAmB,CAAC;AAuD3B,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE;IAAE,OAAO,IAAI,YAAY,CAAA;CAAE,EACrC,KAAK,EAAE;IAAE,OAAO,IAAI,aAAa,CAAA;CAAE;IAgEjC,kBAAkB,UAAU;QAC1B,OAAO,EAAE,0BAA0B,CAAC;QACpC,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,EAAE,MAAM,CAAC;KAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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