@claudexor/cli 3.24.0 → 4.0.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/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-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/claude-statusline.d.ts +2 -4
- package/dist/claude-statusline.d.ts.map +1 -1
- package/dist/claude-statusline.js +6 -5
- 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 +10 -3
- package/dist/claudexord-entry.js.map +1 -1
- package/dist/claudexord.d.ts +0 -1
- package/dist/claudexord.d.ts.map +1 -1
- package/dist/claudexord.js +308 -239
- package/dist/claudexord.js.map +1 -1
- package/dist/cli-error.js +3 -3
- package/dist/cli-error.js.map +1 -1
- package/dist/cli.js +7 -49
- 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 +74 -14
- package/dist/codex-quota-source.js.map +1 -1
- package/dist/command-flags.d.ts.map +1 -1
- package/dist/command-flags.js +6 -0
- package/dist/command-flags.js.map +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/command-registry.js.map +1 -1
- package/dist/continue-from-run.d.ts +7 -8
- package/dist/continue-from-run.d.ts.map +1 -1
- package/dist/continue-from-run.js +3 -4
- package/dist/continue-from-run.js.map +1 -1
- package/dist/control-api-address.d.ts +6 -0
- package/dist/control-api-address.d.ts.map +1 -0
- package/dist/control-api-address.js +53 -0
- package/dist/control-api-address.js.map +1 -0
- package/dist/control-services.d.ts +400 -230
- package/dist/control-services.d.ts.map +1 -1
- package/dist/control-services.js +11 -32
- package/dist/control-services.js.map +1 -1
- package/dist/daemon-admission-runtime.d.ts +0 -60
- package/dist/daemon-admission-runtime.d.ts.map +1 -1
- package/dist/daemon-admission-runtime.js +3 -168
- package/dist/daemon-admission-runtime.js.map +1 -1
- package/dist/daemon-agent-runner.d.ts +6 -3
- package/dist/daemon-agent-runner.d.ts.map +1 -1
- package/dist/daemon-agent-runner.js +2 -1
- package/dist/daemon-agent-runner.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +10 -3
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +16 -7
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/daemon-owner.d.ts +7 -0
- package/dist/daemon-owner.d.ts.map +1 -0
- package/dist/daemon-owner.js +39 -0
- package/dist/daemon-owner.js.map +1 -0
- package/dist/daemon-run.d.ts +8 -1
- package/dist/daemon-run.d.ts.map +1 -1
- package/dist/daemon-run.js +31 -3
- package/dist/daemon-run.js.map +1 -1
- package/dist/daemon-runtime-shutdown.d.ts +1 -1
- package/dist/daemon-runtime-shutdown.d.ts.map +1 -1
- package/dist/daemon-runtime-shutdown.js +2 -2
- package/dist/daemon-runtime-shutdown.js.map +1 -1
- package/dist/daemon-startup.d.ts +5 -42
- package/dist/daemon-startup.d.ts.map +1 -1
- package/dist/daemon-startup.js +7 -85
- package/dist/daemon-startup.js.map +1 -1
- package/dist/daemon-status-report.d.ts +4 -0
- package/dist/daemon-status-report.d.ts.map +1 -0
- package/dist/daemon-status-report.js +39 -0
- package/dist/daemon-status-report.js.map +1 -0
- package/dist/engine-skew.d.ts +1 -0
- package/dist/engine-skew.d.ts.map +1 -1
- package/dist/engine-skew.js +6 -2
- package/dist/engine-skew.js.map +1 -1
- package/dist/harness-maintenance-service.d.ts +9 -222
- package/dist/harness-maintenance-service.d.ts.map +1 -1
- package/dist/harness-maintenance-service.js +7 -37
- package/dist/harness-maintenance-service.js.map +1 -1
- package/dist/live.d.ts +2 -5
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +2 -44
- package/dist/live.js.map +1 -1
- package/dist/mcp-catalog-query.d.ts +2 -1
- package/dist/mcp-catalog-query.d.ts.map +1 -1
- package/dist/mcp-catalog-query.js +6 -5
- package/dist/mcp-catalog-query.js.map +1 -1
- package/dist/mcp-daemon-unavailable.d.ts.map +1 -1
- package/dist/mcp-daemon-unavailable.js +4 -3
- package/dist/mcp-daemon-unavailable.js.map +1 -1
- package/dist/mcp-journal-recovery.d.ts.map +1 -1
- package/dist/mcp-journal-recovery.js +4 -4
- package/dist/mcp-journal-recovery.js.map +1 -1
- package/dist/mcp-runner.d.ts +1 -1
- package/dist/mcp-runner.d.ts.map +1 -1
- package/dist/mcp-runner.js +11 -4
- package/dist/mcp-runner.js.map +1 -1
- package/dist/mcp-thread-query.d.ts +1 -1
- package/dist/mcp-thread-query.d.ts.map +1 -1
- package/dist/mcp-thread-query.js +2 -2
- package/dist/mcp-thread-query.js.map +1 -1
- package/dist/model-operation-control.d.ts +375 -0
- package/dist/model-operation-control.d.ts.map +1 -0
- package/dist/model-operation-control.js +16 -0
- package/dist/model-operation-control.js.map +1 -0
- package/dist/model-services.d.ts +302 -91
- package/dist/model-services.d.ts.map +1 -1
- package/dist/model-services.js +5 -7
- 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/ops-commands.d.ts +1 -8
- package/dist/ops-commands.d.ts.map +1 -1
- package/dist/ops-commands.js +13 -16
- package/dist/ops-commands.js.map +1 -1
- package/dist/orphan-reaper.d.ts +18 -0
- package/dist/orphan-reaper.d.ts.map +1 -1
- package/dist/orphan-reaper.js +50 -0
- package/dist/orphan-reaper.js.map +1 -1
- package/dist/plugin-cli.d.ts +3 -0
- package/dist/plugin-cli.d.ts.map +1 -0
- package/dist/plugin-cli.js +57 -0
- package/dist/plugin-cli.js.map +1 -0
- package/dist/plugin-mcp.d.ts +3 -0
- package/dist/plugin-mcp.d.ts.map +1 -0
- package/dist/plugin-mcp.js +116 -0
- package/dist/plugin-mcp.js.map +1 -0
- package/dist/plugin-runtime.d.ts +24 -0
- package/dist/plugin-runtime.d.ts.map +1 -0
- package/dist/plugin-runtime.js +113 -0
- package/dist/plugin-runtime.js.map +1 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +92 -184
- package/dist/plugins.js.map +1 -1
- package/dist/project-command.d.ts +4 -1
- package/dist/project-command.d.ts.map +1 -1
- package/dist/project-command.js +14 -5
- package/dist/project-command.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 +236 -2
- package/dist/quota-services.d.ts.map +1 -1
- package/dist/quota-services.js +84 -4
- package/dist/quota-services.js.map +1 -1
- package/dist/recovery-control-services.d.ts +99 -0
- package/dist/recovery-control-services.d.ts.map +1 -0
- package/dist/recovery-control-services.js +32 -0
- package/dist/recovery-control-services.js.map +1 -0
- package/dist/remote-filesystem.d.ts +3 -3
- package/dist/remote-filesystem.d.ts.map +1 -1
- package/dist/remote-filesystem.js.map +1 -1
- package/dist/request-preflight.d.ts +2 -2
- package/dist/request-preflight.d.ts.map +1 -1
- package/dist/request-preflight.js.map +1 -1
- package/dist/retention-service.d.ts +3 -3
- package/dist/retention-service.d.ts.map +1 -1
- package/dist/settings-command.d.ts.map +1 -1
- package/dist/settings-command.js +7 -2
- package/dist/settings-command.js.map +1 -1
- package/dist/settings-service.d.ts +66 -6
- package/dist/settings-service.d.ts.map +1 -1
- package/dist/settings-service.js +1 -1
- package/dist/settings-service.js.map +1 -1
- package/dist/setup-client-pty.js +1 -1
- package/dist/setup-client-pty.js.map +1 -1
- package/dist/setup-credential-window.d.ts +4 -4
- package/dist/setup-credential-window.d.ts.map +1 -1
- package/dist/setup-credential-window.js +1 -1
- package/dist/setup-credential-window.js.map +1 -1
- package/dist/setup-device-code-disclosure.js +1 -1
- package/dist/setup-device-code-disclosure.js.map +1 -1
- package/dist/setup-job-persistence.d.ts +30 -0
- package/dist/setup-job-persistence.d.ts.map +1 -0
- package/dist/setup-job-persistence.js +3 -0
- package/dist/setup-job-persistence.js.map +1 -0
- package/dist/{setup-job-store.d.ts → setup-job-projection.d.ts} +9 -17
- package/dist/setup-job-projection.d.ts.map +1 -0
- package/dist/{setup-job-store.js → setup-job-projection.js} +29 -68
- package/dist/setup-job-projection.js.map +1 -0
- package/dist/setup-job-support.js +1 -1
- package/dist/setup-job-support.js.map +1 -1
- package/dist/setup-jobs.d.ts +3 -4
- package/dist/setup-jobs.d.ts.map +1 -1
- package/dist/setup-jobs.js +3 -3
- package/dist/setup-jobs.js.map +1 -1
- package/dist/setup-lifecycle-binding.js +1 -1
- package/dist/setup-lifecycle-binding.js.map +1 -1
- package/dist/setup-login-completion.js +1 -1
- package/dist/setup-login-completion.js.map +1 -1
- package/dist/sql-daemon-queries.d.ts +24 -0
- package/dist/sql-daemon-queries.d.ts.map +1 -0
- package/dist/sql-daemon-queries.js +41 -0
- package/dist/sql-daemon-queries.js.map +1 -0
- package/dist/sql-daemon-runtime.d.ts +1415 -0
- package/dist/sql-daemon-runtime.d.ts.map +1 -0
- package/dist/sql-daemon-runtime.js +94 -0
- package/dist/sql-daemon-runtime.js.map +1 -0
- package/dist/sql-daemon-storage.d.ts +40 -0
- package/dist/sql-daemon-storage.d.ts.map +1 -0
- package/dist/sql-daemon-storage.js +203 -0
- package/dist/sql-daemon-storage.js.map +1 -0
- package/dist/sql-import-publication.d.ts +19 -0
- package/dist/sql-import-publication.d.ts.map +1 -0
- package/dist/sql-import-publication.js +54 -0
- package/dist/sql-import-publication.js.map +1 -0
- package/dist/sql-setup-lifecycle.d.ts +15 -0
- package/dist/sql-setup-lifecycle.d.ts.map +1 -0
- package/dist/sql-setup-lifecycle.js +28 -0
- package/dist/sql-setup-lifecycle.js.map +1 -0
- package/dist/sql-setup-store.d.ts +7 -0
- package/dist/sql-setup-store.d.ts.map +1 -0
- package/dist/sql-setup-store.js +102 -0
- package/dist/sql-setup-store.js.map +1 -0
- package/dist/sql-startup-storage.d.ts +15 -0
- package/dist/sql-startup-storage.d.ts.map +1 -0
- package/dist/sql-startup-storage.js +75 -0
- package/dist/sql-startup-storage.js.map +1 -0
- package/dist/thread-delivery.d.ts +2 -2
- package/dist/thread-purge.d.ts +8 -2
- package/dist/thread-purge.d.ts.map +1 -1
- package/dist/thread-purge.js +37 -8
- package/dist/thread-purge.js.map +1 -1
- package/dist/thread-turn-services.d.ts +2 -2
- package/dist/thread-turn-services.d.ts.map +1 -1
- package/dist/thread-turn-services.js.map +1 -1
- package/package.json +25 -26
- package/dist/setup-job-store.d.ts.map +0 -1
- package/dist/setup-job-store.js.map +0 -1
|
@@ -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,IAAI,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,UAAU,CAC7E,CAAC;IACF,IAAI,CAAC,OAAO;QACV,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,EAAE;YACjE,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,8BAA8B;SACrC,CAAC,CAAC;IACL,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,MAA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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;AAC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M,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 CommandStorePort, type QuotaRegistry } from "@claudexor/daemon";
|
|
2
|
+
import type { ControlAccountResetRequest, ControlAccountResetResponse } from "@claudexor/schema";
|
|
3
|
+
export declare function accountResetServices(commands: {
|
|
4
|
+
current(): CommandStorePort;
|
|
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,gBAAgB,EACrB,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,gBAAgB,CAAA;CAAE,EACzC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACD,YAAY,OAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC;AAED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,SAAS,GAAG,QAAQ,CAAC,CAAC,CAoDlE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,GACb,IAAI,CAAC,2BAA2B,EAAE,SAAS,GAAG,QAAQ,CAAC,CA6BzD"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { randomUUID } from "node:crypto";
|
|
4
|
+
import { AccountResets, } from "@claudexor/daemon";
|
|
5
|
+
import { sha256 } from "@claudexor/util";
|
|
6
|
+
import { readClaudeOauthCredential, readClaudeOauthOrganization, } from "./claude-oauth-credential.js";
|
|
7
|
+
import { accountManagementTarget } from "./account-management.js";
|
|
8
|
+
import { requestCodexAccount } from "./codex-quota-source.js";
|
|
9
|
+
import { claudeResourceRequest } from "./claude-resource-transport.js";
|
|
10
|
+
import { accountResourcesResponse } from "./quota-services.js";
|
|
11
|
+
async function nativeIdentity(target) {
|
|
12
|
+
const { locator } = accountManagementTarget(target);
|
|
13
|
+
if (target.harness === "claude") {
|
|
14
|
+
const organization = await readClaudeOauthOrganization(locator);
|
|
15
|
+
if (!organization)
|
|
16
|
+
throw Object.assign(new Error("Native organization binding is unavailable"), {
|
|
17
|
+
status: 409,
|
|
18
|
+
code: "account_binding_unavailable",
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
locator,
|
|
22
|
+
fingerprint: sha256(JSON.stringify(organization)),
|
|
23
|
+
organization: organization.organizationUuid,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
let data;
|
|
27
|
+
try {
|
|
28
|
+
data = JSON.parse(await readFile(join(locator, "auth.json"), "utf8"));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
throw Object.assign(new Error("Native account binding is unavailable"), {
|
|
32
|
+
status: 409,
|
|
33
|
+
code: "account_binding_unavailable",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const account = data.tokens?.account_id;
|
|
37
|
+
if (typeof account !== "string" || !account)
|
|
38
|
+
throw Object.assign(new Error("Native account identity is unavailable"), {
|
|
39
|
+
status: 409,
|
|
40
|
+
code: "account_binding_unavailable",
|
|
41
|
+
});
|
|
42
|
+
// Subject claim is stable across token refresh, unlike the token bytes.
|
|
43
|
+
let principal = null;
|
|
44
|
+
try {
|
|
45
|
+
const token = data.tokens?.id_token;
|
|
46
|
+
if (typeof token === "string") {
|
|
47
|
+
const claims = JSON.parse(Buffer.from(token.split(".")[1] ?? "", "base64url").toString());
|
|
48
|
+
principal = typeof claims.sub === "string" ? claims.sub : null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
/* account id is still provider-owned binding */
|
|
53
|
+
}
|
|
54
|
+
return { locator, fingerprint: sha256(JSON.stringify([account, principal])), organization: null };
|
|
55
|
+
}
|
|
56
|
+
export function accountResetServices(commands, quota) {
|
|
57
|
+
const operations = new AccountResets({
|
|
58
|
+
commands: () => commands.current(),
|
|
59
|
+
resolve: async (request) => {
|
|
60
|
+
const identity = await nativeIdentity(request.target);
|
|
61
|
+
const programs = {
|
|
62
|
+
codex_granted: { harness: "codex", program: "rate_limit_reset_credit" },
|
|
63
|
+
claude_granted: { harness: "claude", program: "cedar_ember" },
|
|
64
|
+
claude_session_refill: { harness: "claude", program: "juniper_tide" },
|
|
65
|
+
};
|
|
66
|
+
const program = programs[request.offer_id];
|
|
67
|
+
if (!program || program.harness !== request.target.harness)
|
|
68
|
+
throw Object.assign(new Error("Unknown reset offer for this account"), {
|
|
69
|
+
status: 400,
|
|
70
|
+
code: "account_reset_offer_invalid",
|
|
71
|
+
});
|
|
72
|
+
const offer = quota
|
|
73
|
+
.current()
|
|
74
|
+
.readResources()
|
|
75
|
+
.find((row) => row.target.harness === request.target.harness &&
|
|
76
|
+
row.target.profile_id === request.target.profile_id)
|
|
77
|
+
?.resets.value?.find((offer) => offer.id === request.offer_id);
|
|
78
|
+
const grant = request.grant_id ?? offer?.grants?.find((grant) => grant.usable_now === true)?.id ?? null;
|
|
79
|
+
if (program.program === "cedar_ember" && !grant)
|
|
80
|
+
throw Object.assign(new Error("A native grant id is required; refresh this account or provide its grant id"), { status: 400, code: "account_reset_grant_required" });
|
|
81
|
+
if (program.program === "juniper_tide" && request.grant_id)
|
|
82
|
+
throw Object.assign(new Error("Session refill does not accept a grant id"), {
|
|
83
|
+
status: 400,
|
|
84
|
+
code: "account_reset_grant_invalid",
|
|
85
|
+
});
|
|
86
|
+
return {
|
|
87
|
+
harness: program.harness,
|
|
88
|
+
locator: identity.locator,
|
|
89
|
+
fingerprint: identity.fingerprint,
|
|
90
|
+
program: program.program,
|
|
91
|
+
grant_id: grant,
|
|
92
|
+
native_request_id: randomUUID(),
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
verify: async (binding, target) => {
|
|
96
|
+
const identity = await nativeIdentity(target);
|
|
97
|
+
if (identity.locator !== binding.locator || identity.fingerprint !== binding.fingerprint)
|
|
98
|
+
throw Object.assign(new Error("The reset operation's native account binding changed"), {
|
|
99
|
+
status: 409,
|
|
100
|
+
code: "account_binding_changed",
|
|
101
|
+
});
|
|
102
|
+
},
|
|
103
|
+
consume: consumeNativeReset,
|
|
104
|
+
read: () => accountResourcesResponse(quota.current()),
|
|
105
|
+
invalidate: (target) => quota.current().invalidateAccountResources(target),
|
|
106
|
+
refresh: async (target, mayHaveChanged) => {
|
|
107
|
+
const result = await quota.current().refreshResources(target, true, mayHaveChanged);
|
|
108
|
+
return accountResourcesResponse(quota.current(), result, result.resources);
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
createAccountReset: (input) => operations.create(input),
|
|
113
|
+
accountReset: async (id) => operations.get(id),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export async function consumeNativeReset(binding) {
|
|
117
|
+
let value;
|
|
118
|
+
if (binding.harness === "codex")
|
|
119
|
+
value = await requestCodexAccount(binding.locator, undefined, undefined, undefined, undefined, "account/rateLimitResetCredit/consume", {
|
|
120
|
+
idempotencyKey: binding.native_request_id,
|
|
121
|
+
...(binding.grant_id ? { creditId: binding.grant_id } : {}),
|
|
122
|
+
});
|
|
123
|
+
else {
|
|
124
|
+
const credential = await readClaudeOauthCredential(binding.locator);
|
|
125
|
+
const organization = await readClaudeOauthOrganization(binding.locator);
|
|
126
|
+
if (!credential || !organization)
|
|
127
|
+
return { outcome: "unavailable", detail: "native_credential_unavailable" };
|
|
128
|
+
try {
|
|
129
|
+
value = await claudeResourceRequest(`/api/organizations/${encodeURIComponent(organization.organizationUuid)}/reset_rate_limits`, credential.accessToken, {
|
|
130
|
+
body: binding.program === "cedar_ember"
|
|
131
|
+
? {
|
|
132
|
+
program: binding.program,
|
|
133
|
+
grant_id: binding.grant_id,
|
|
134
|
+
request_id: binding.native_request_id,
|
|
135
|
+
}
|
|
136
|
+
: { program: binding.program },
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
const status = error?.status;
|
|
141
|
+
if (typeof status === "number" &&
|
|
142
|
+
Number.isInteger(status) &&
|
|
143
|
+
status >= 100 &&
|
|
144
|
+
status <= 599) {
|
|
145
|
+
return {
|
|
146
|
+
outcome: "unknown",
|
|
147
|
+
detail: `Provider returned HTTP ${status}; reset outcome is unconfirmed`,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return nativeResetOutcome(binding.harness, value);
|
|
154
|
+
}
|
|
155
|
+
export function nativeResetOutcome(harness, value) {
|
|
156
|
+
const row = value && typeof value === "object" ? value : {};
|
|
157
|
+
const mapping = harness === "codex"
|
|
158
|
+
? {
|
|
159
|
+
reset: "reset",
|
|
160
|
+
alreadyRedeemed: "already_redeemed",
|
|
161
|
+
nothingToReset: "nothing_to_reset",
|
|
162
|
+
noCredit: "no_credit",
|
|
163
|
+
}
|
|
164
|
+
: {
|
|
165
|
+
reset: "reset",
|
|
166
|
+
already_used: "already_used",
|
|
167
|
+
not_limited: "nothing_to_reset",
|
|
168
|
+
ineligible: "not_eligible",
|
|
169
|
+
cooldown: "cooldown",
|
|
170
|
+
unavailable: "unavailable",
|
|
171
|
+
};
|
|
172
|
+
const native = row[harness === "codex" ? "outcome" : "result"];
|
|
173
|
+
const outcome = typeof native === "string" ? (mapping[native] ?? "unknown") : "unknown";
|
|
174
|
+
return {
|
|
175
|
+
outcome,
|
|
176
|
+
detail: outcome === "unknown"
|
|
177
|
+
? "provider_outcome_unconfirmed"
|
|
178
|
+
: outcome === "already_used"
|
|
179
|
+
? "grant_used_ownership_unconfirmed"
|
|
180
|
+
: null,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=account-reset-services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-reset-services.js","sourceRoot":"","sources":["../src/account-reset-services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,aAAa,GAId,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA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