@claudexor/cli 3.5.0 → 3.6.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.
Files changed (77) hide show
  1. package/dist/accounts-projection.d.ts +18 -12
  2. package/dist/accounts-projection.d.ts.map +1 -1
  3. package/dist/accounts-projection.js +63 -58
  4. package/dist/accounts-projection.js.map +1 -1
  5. package/dist/accounts-services.d.ts +134 -128
  6. package/dist/accounts-services.d.ts.map +1 -1
  7. package/dist/accounts-services.js +15 -7
  8. package/dist/accounts-services.js.map +1 -1
  9. package/dist/accounts-unified-migration.d.ts +110 -0
  10. package/dist/accounts-unified-migration.d.ts.map +1 -0
  11. package/dist/accounts-unified-migration.js +422 -0
  12. package/dist/accounts-unified-migration.js.map +1 -0
  13. package/dist/auth-login-harnesses.d.ts +7 -5
  14. package/dist/auth-login-harnesses.d.ts.map +1 -1
  15. package/dist/auth-login-harnesses.js +10 -9
  16. package/dist/auth-login-harnesses.js.map +1 -1
  17. package/dist/claude-oauth-usage.d.ts.map +1 -1
  18. package/dist/claude-oauth-usage.js +9 -3
  19. package/dist/claude-oauth-usage.js.map +1 -1
  20. package/dist/claude-statusline.d.ts.map +1 -1
  21. package/dist/claude-statusline.js +14 -1
  22. package/dist/claude-statusline.js.map +1 -1
  23. package/dist/claudexord.d.ts.map +1 -1
  24. package/dist/claudexord.js +25 -37
  25. package/dist/claudexord.js.map +1 -1
  26. package/dist/codex-quota-source.d.ts.map +1 -1
  27. package/dist/codex-quota-source.js +8 -3
  28. package/dist/codex-quota-source.js.map +1 -1
  29. package/dist/control-services.d.ts +179 -175
  30. package/dist/control-services.d.ts.map +1 -1
  31. package/dist/control-services.js +38 -117
  32. package/dist/control-services.js.map +1 -1
  33. package/dist/credential-commands.d.ts.map +1 -1
  34. package/dist/credential-commands.js +46 -26
  35. package/dist/credential-commands.js.map +1 -1
  36. package/dist/credential-profile-mutations.d.ts +63 -0
  37. package/dist/credential-profile-mutations.d.ts.map +1 -0
  38. package/dist/credential-profile-mutations.js +187 -0
  39. package/dist/credential-profile-mutations.js.map +1 -0
  40. package/dist/credential-status-invalidation.d.ts +11 -0
  41. package/dist/credential-status-invalidation.d.ts.map +1 -0
  42. package/dist/credential-status-invalidation.js +36 -0
  43. package/dist/credential-status-invalidation.js.map +1 -0
  44. package/dist/daemon-admission-runtime.d.ts +5 -0
  45. package/dist/daemon-admission-runtime.d.ts.map +1 -1
  46. package/dist/daemon-admission-runtime.js +1 -0
  47. package/dist/daemon-admission-runtime.js.map +1 -1
  48. package/dist/mcp-run-projections.d.ts +1 -1
  49. package/dist/native-login.d.ts.map +1 -1
  50. package/dist/native-login.js +11 -4
  51. package/dist/native-login.js.map +1 -1
  52. package/dist/profile-registration.d.ts +13 -1
  53. package/dist/profile-registration.d.ts.map +1 -1
  54. package/dist/profile-registration.js +76 -2
  55. package/dist/profile-registration.js.map +1 -1
  56. package/dist/quota-services.d.ts +2 -2
  57. package/dist/quota-subject-universe.d.ts.map +1 -1
  58. package/dist/quota-subject-universe.js +6 -0
  59. package/dist/quota-subject-universe.js.map +1 -1
  60. package/dist/run-orchestrator.d.ts +28 -0
  61. package/dist/run-orchestrator.d.ts.map +1 -0
  62. package/dist/run-orchestrator.js +43 -0
  63. package/dist/run-orchestrator.js.map +1 -0
  64. package/dist/settings-service.d.ts +1 -1
  65. package/dist/settings-service.js +3 -3
  66. package/dist/settings-service.js.map +1 -1
  67. package/dist/setup-job-support.d.ts +17 -0
  68. package/dist/setup-job-support.d.ts.map +1 -1
  69. package/dist/setup-job-support.js +30 -1
  70. package/dist/setup-job-support.js.map +1 -1
  71. package/dist/setup-jobs.js +2 -2
  72. package/dist/setup-jobs.js.map +1 -1
  73. package/dist/thread-continuity-context.d.ts +24 -0
  74. package/dist/thread-continuity-context.d.ts.map +1 -1
  75. package/dist/thread-continuity-context.js +17 -0
  76. package/dist/thread-continuity-context.js.map +1 -1
  77. package/package.json +24 -24
@@ -1,6 +1,6 @@
1
1
  import { type OperatorDecisionRecord, JournalManager, InteractionRegistry, ProjectPartitions, ProjectStore, ResourceStore, QuotaRegistry } from "@claudexor/daemon";
2
2
  import { listTrustService, updateTrustService } from "./trust-services.js";
3
- import { type ResourceAttachmentRef, type CredentialProfile, type ControlRunStartRequest } from "@claudexor/schema";
3
+ import { type ResourceAttachmentRef, type ControlRunStartRequest } from "@claudexor/schema";
4
4
  import { AuthReadinessService } from "@claudexor/gateway";
5
5
  import { type HarnessListInput } from "./accounts-services.js";
6
6
  import { createSetupJobManager } from "./setup-jobs.js";
@@ -18,6 +18,178 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
18
18
  finishedAt?: string;
19
19
  params?: unknown;
20
20
  }>>): {
21
+ credentialProfiles: (input?: {
22
+ snapshot?: boolean;
23
+ }) => Promise<{
24
+ profiles: {
25
+ profile: import("@claudexor/schema").CredentialProfile;
26
+ status: import("@claudexor/schema").CredentialProfileStatus;
27
+ identity: import("@claudexor/schema").AccountIdentity | null;
28
+ }[];
29
+ harnessAccounts: never[];
30
+ accountPools: {
31
+ harness_id: string;
32
+ next_up: {
33
+ kind: "profile";
34
+ profileId: string;
35
+ } | {
36
+ kind: "api_key_route";
37
+ } | {
38
+ kind: "none";
39
+ reason: string;
40
+ };
41
+ }[];
42
+ } | {
43
+ profiles: {
44
+ profile: import("@claudexor/schema").CredentialProfile;
45
+ status: import("@claudexor/schema").CredentialProfileStatus;
46
+ identity: import("@claudexor/schema").AccountIdentity | null;
47
+ }[];
48
+ harnessAccounts: never[];
49
+ accountPools: {
50
+ harness_id: string;
51
+ next_up: {
52
+ kind: "profile";
53
+ profileId: string;
54
+ } | {
55
+ kind: "api_key_route";
56
+ } | {
57
+ kind: "none";
58
+ reason: string;
59
+ };
60
+ }[];
61
+ harnesses: {
62
+ id: string;
63
+ available: boolean;
64
+ status: "ok" | "degraded" | "unavailable";
65
+ manifest: import("@claudexor/schema").HarnessManifest | null;
66
+ enabledIntents: import("@claudexor/schema").Intent[];
67
+ routableIntents: import("@claudexor/schema").Intent[];
68
+ disabledIntents: import("@claudexor/schema").Intent[];
69
+ checks: import("@claudexor/schema").ConformanceCheck[];
70
+ reasons: string[];
71
+ authSources: import("@claudexor/schema").AuthSourceReadiness[];
72
+ configuredModel: string | null;
73
+ configuredModelCheck: {
74
+ status: "ok" | "rejected";
75
+ message?: string | null;
76
+ } | null;
77
+ delegation: {
78
+ available: boolean;
79
+ reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
80
+ remediation: string | null;
81
+ requiresFullAccess: boolean;
82
+ };
83
+ readiness: {
84
+ id: string;
85
+ kind: "auth" | "binary" | "model" | "probe" | "smoke";
86
+ title: string;
87
+ status: "fail" | "pass" | "skip";
88
+ detail: string | null;
89
+ }[];
90
+ }[];
91
+ git: {
92
+ status: "available" | "developer_tools_stub" | "failed" | "missing";
93
+ version: string | null;
94
+ detail: string | null;
95
+ remediation: string | null;
96
+ };
97
+ quota: {
98
+ snapshots: {
99
+ subject: {
100
+ harness: string;
101
+ credential_route: "local" | "managed_api_key" | "vendor_native";
102
+ plan_label: string | null;
103
+ subject_id: string | null;
104
+ };
105
+ constraints: {
106
+ id: string;
107
+ label: string;
108
+ applies_to_models?: string[] | null | undefined;
109
+ applies_to_unspecified_model?: boolean | undefined;
110
+ used_ratio: number | null;
111
+ window_seconds: number | null;
112
+ resets_at: string | null;
113
+ cooldown_until: string | null;
114
+ }[];
115
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
116
+ observed_at: string;
117
+ freshness: "fresh" | "stale" | "unknown";
118
+ availability?: {
119
+ state: "available" | "cooldown" | "exhausted";
120
+ blocking_constraints: string[];
121
+ resets_at: string | null;
122
+ model_scoped_exhaustions: {
123
+ constraint_id: string;
124
+ applies_to_models: string[];
125
+ resets_at: string | null;
126
+ }[];
127
+ } | undefined;
128
+ }[];
129
+ absences: {
130
+ subject: {
131
+ harness: string;
132
+ credential_route: "local" | "managed_api_key" | "vendor_native";
133
+ plan_label: string | null;
134
+ subject_id: string | null;
135
+ };
136
+ reason: "auth_revoked" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
137
+ detail: string | null;
138
+ observed_at: string;
139
+ }[];
140
+ refreshed_at: string | null;
141
+ };
142
+ quotaEventCursor: string;
143
+ }>;
144
+ accountPools: () => Promise<{
145
+ accountPools: {
146
+ harness_id: string;
147
+ next_up: {
148
+ kind: "profile";
149
+ profileId: string;
150
+ } | {
151
+ kind: "api_key_route";
152
+ } | {
153
+ kind: "none";
154
+ reason: string;
155
+ };
156
+ }[];
157
+ }>;
158
+ updateCredentialProfile: (input: unknown) => Promise<{
159
+ profile: {
160
+ profile_id: string;
161
+ harness_id: string;
162
+ display_name: string;
163
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
164
+ isolation_locator: string | null;
165
+ secret_ref: string | null;
166
+ enabled: boolean;
167
+ created_at: string | null;
168
+ };
169
+ status: {
170
+ profile_id: string;
171
+ harness_id: string;
172
+ availability: "available" | "unavailable" | "unknown";
173
+ verification: "failed" | "not_run" | "passed";
174
+ verification_source: "local_store" | "vendor";
175
+ detail?: string | undefined;
176
+ last_verified_at: string | null;
177
+ };
178
+ }>;
179
+ deleteCredentialProfile: (input: unknown) => Promise<{
180
+ profile: {
181
+ profile_id: string;
182
+ harness_id: string;
183
+ display_name: string;
184
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
185
+ isolation_locator: string | null;
186
+ secret_ref: string | null;
187
+ enabled: boolean;
188
+ created_at: string | null;
189
+ };
190
+ removed: boolean;
191
+ credentialCleanup: "config_dir_removed" | "none" | "secret_deleted";
192
+ }>;
21
193
  quota: () => Promise<{
22
194
  snapshots: {
23
195
  subject: {
@@ -36,7 +208,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
36
208
  resets_at: string | null;
37
209
  cooldown_until: string | null;
38
210
  }[];
39
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
211
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
40
212
  observed_at: string;
41
213
  freshness: "fresh" | "stale" | "unknown";
42
214
  availability?: {
@@ -81,7 +253,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
81
253
  resets_at: string | null;
82
254
  cooldown_until: string | null;
83
255
  }[];
84
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
256
+ source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout" | "cursor_rate_limit";
85
257
  observed_at: string;
86
258
  freshness: "fresh" | "stale" | "unknown";
87
259
  availability?: {
@@ -2890,180 +3062,12 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
2890
3062
  fallbackModel: string | null;
2891
3063
  web: "auto" | "cached" | "live" | "off";
2892
3064
  authPreference: "api_key" | "auto" | "subscription";
2893
- profileLimitAction: "ask" | "fail" | "rotate";
3065
+ profileLimitAction: "ask" | "auto" | "fail" | "rotate";
2894
3066
  };
2895
3067
  };
2896
3068
  }>;
2897
- credentialProfiles: (input?: {
2898
- snapshot?: boolean;
2899
- }) => Promise<{
2900
- profiles: {
2901
- profile: CredentialProfile;
2902
- status: import("@claudexor/schema").CredentialProfileStatus;
2903
- identity: import("@claudexor/schema").AccountIdentity | null;
2904
- }[];
2905
- harnessAccounts: {
2906
- harness_id: string;
2907
- native_credentials_enabled: boolean;
2908
- native_login_detected: boolean;
2909
- identity: {
2910
- email?: string | undefined;
2911
- plan?: string | undefined;
2912
- } | null;
2913
- next_up: {
2914
- kind: "profile";
2915
- profileId: string;
2916
- } | {
2917
- kind: "native";
2918
- route?: "api_key" | "local_session" | undefined;
2919
- } | {
2920
- kind: "none";
2921
- reason: string;
2922
- };
2923
- }[];
2924
- } | {
2925
- profiles: {
2926
- profile: CredentialProfile;
2927
- status: import("@claudexor/schema").CredentialProfileStatus;
2928
- identity: import("@claudexor/schema").AccountIdentity | null;
2929
- }[];
2930
- harnessAccounts: {
2931
- harness_id: string;
2932
- native_credentials_enabled: boolean;
2933
- native_login_detected: boolean;
2934
- identity: {
2935
- email?: string | undefined;
2936
- plan?: string | undefined;
2937
- } | null;
2938
- next_up: {
2939
- kind: "profile";
2940
- profileId: string;
2941
- } | {
2942
- kind: "native";
2943
- route?: "api_key" | "local_session" | undefined;
2944
- } | {
2945
- kind: "none";
2946
- reason: string;
2947
- };
2948
- }[];
2949
- harnesses: {
2950
- id: string;
2951
- available: boolean;
2952
- status: "ok" | "degraded" | "unavailable";
2953
- manifest: import("@claudexor/schema").HarnessManifest | null;
2954
- enabledIntents: import("@claudexor/schema").Intent[];
2955
- routableIntents: import("@claudexor/schema").Intent[];
2956
- disabledIntents: import("@claudexor/schema").Intent[];
2957
- checks: import("@claudexor/schema").ConformanceCheck[];
2958
- reasons: string[];
2959
- authSources: import("@claudexor/schema").AuthSourceReadiness[];
2960
- configuredModel: string | null;
2961
- configuredModelCheck: {
2962
- status: "ok" | "rejected";
2963
- message?: string | null;
2964
- } | null;
2965
- delegation: {
2966
- available: boolean;
2967
- reason: "manifest_unsupported" | "ready" | "runtime_unavailable";
2968
- remediation: string | null;
2969
- requiresFullAccess: boolean;
2970
- };
2971
- readiness: {
2972
- id: string;
2973
- kind: "auth" | "binary" | "model" | "probe" | "smoke";
2974
- title: string;
2975
- status: "fail" | "pass" | "skip";
2976
- detail: string | null;
2977
- }[];
2978
- }[];
2979
- git: {
2980
- status: "available" | "developer_tools_stub" | "failed" | "missing";
2981
- version: string | null;
2982
- detail: string | null;
2983
- remediation: string | null;
2984
- };
2985
- quota: {
2986
- snapshots: {
2987
- subject: {
2988
- harness: string;
2989
- credential_route: "local" | "managed_api_key" | "vendor_native";
2990
- plan_label: string | null;
2991
- subject_id: string | null;
2992
- };
2993
- constraints: {
2994
- id: string;
2995
- label: string;
2996
- applies_to_models?: string[] | null | undefined;
2997
- applies_to_unspecified_model?: boolean | undefined;
2998
- used_ratio: number | null;
2999
- window_seconds: number | null;
3000
- resets_at: string | null;
3001
- cooldown_until: string | null;
3002
- }[];
3003
- source: "agy_command_usage" | "claude_api_retry" | "claude_oauth_usage" | "claude_statusline" | "codex_app_server" | "codex_rollout";
3004
- observed_at: string;
3005
- freshness: "fresh" | "stale" | "unknown";
3006
- availability?: {
3007
- state: "available" | "cooldown" | "exhausted";
3008
- blocking_constraints: string[];
3009
- resets_at: string | null;
3010
- model_scoped_exhaustions: {
3011
- constraint_id: string;
3012
- applies_to_models: string[];
3013
- resets_at: string | null;
3014
- }[];
3015
- } | undefined;
3016
- }[];
3017
- absences: {
3018
- subject: {
3019
- harness: string;
3020
- credential_route: "local" | "managed_api_key" | "vendor_native";
3021
- plan_label: string | null;
3022
- subject_id: string | null;
3023
- };
3024
- reason: "auth_revoked" | "no_source" | "not_logged_in" | "platform_unsupported" | "refresh_failed" | "transport_unavailable";
3025
- detail: string | null;
3026
- observed_at: string;
3027
- }[];
3028
- refreshed_at: string | null;
3029
- };
3030
- quotaEventCursor: string;
3031
- }>;
3032
- updateCredentialProfile: (input: unknown) => Promise<{
3033
- profile: {
3034
- profile_id: string;
3035
- harness_id: string;
3036
- display_name: string;
3037
- credential_kind: "api_key" | "config_dir_login" | "oauth_token";
3038
- isolation_locator: string | null;
3039
- secret_ref: string | null;
3040
- enabled: boolean;
3041
- created_at: string | null;
3042
- };
3043
- status: {
3044
- profile_id: string;
3045
- harness_id: string;
3046
- availability: "available" | "unavailable" | "unknown";
3047
- verification: "failed" | "not_run" | "passed";
3048
- verification_source: "local_store" | "vendor";
3049
- detail?: string | undefined;
3050
- last_verified_at: string | null;
3051
- };
3052
- }>;
3053
- deleteCredentialProfile: (input: unknown) => Promise<{
3054
- profile: {
3055
- profile_id: string;
3056
- harness_id: string;
3057
- display_name: string;
3058
- credential_kind: "api_key" | "config_dir_login" | "oauth_token";
3059
- isolation_locator: string | null;
3060
- secret_ref: string | null;
3061
- enabled: boolean;
3062
- created_at: string | null;
3063
- };
3064
- removed: boolean;
3065
- credentialCleanup: "config_dir_removed" | "none" | "secret_deleted";
3066
- cleanupWarning?: string | undefined;
3069
+ rollbackAccountsMigration: (input: unknown) => Promise<{
3070
+ rolledBack: import("./accounts-unified-migration.js").AccountsRollbackReceipt[];
3067
3071
  }>;
3068
3072
  createCredentialProfile: (input: unknown) => Promise<{
3069
3073
  profile: {
@@ -3132,7 +3136,7 @@ resources: () => ResourceStore, quotaRegistry: () => QuotaRegistry, daemonJobs:
3132
3136
  fallbackModel: string | null;
3133
3137
  web: "auto" | "cached" | "live" | "off";
3134
3138
  authPreference: "api_key" | "auto" | "subscription";
3135
- profileLimitAction: "ask" | "fail" | "rotate";
3139
+ profileLimitAction: "ask" | "auto" | "fail" | "rotate";
3136
3140
  };
3137
3141
  };
3138
3142
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"control-services.d.ts","sourceRoot":"","sources":["../src/control-services.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,sBAAsB,EAC3B,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAS3E,OAAO,EACL,KAAK,qBAAqB,EAE1B,KAAK,iBAAiB,EAEtB,KAAK,sBAAsB,EAG5B,MAAM,mBAAmB,CAAC;AAgB3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,s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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BACV,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BACJ,MAAM,gBAAgB,MAAM;;;;;;;;0CAEjB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;2CACL,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCACR,MAAM;;;;;;;;;6CAEF,MAAM,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAmC5B,OAAO;;;qCAaT,OAAO;;;;;;;;;;;;;;;;;;;;;4BAgBhB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAgBZ,OAAO;;;;;;yBAuBL,MAAM;;;;EAMpC"}
@@ -1,29 +1,29 @@
1
1
  /** Bind typed control operations to daemon stores and engine entrypoints. */
2
- import { existsSync, mkdirSync, realpathSync, rmSync } from "node:fs";
3
- import { join, sep } from "node:path";
4
- import { loadConfig, updateGlobalConfig } from "@claudexor/config";
2
+ import { mkdirSync, realpathSync } from "node:fs";
3
+ import { loadConfig } from "@claudexor/config";
5
4
  import { listTrustService, updateTrustService } from "./trust-services.js";
6
5
  import { SecretStore, isManagedSecretName } from "@claudexor/secrets";
7
- import { probeGitCapability, purgeProfileLanes, purgeThreadLanes, purgeThreadWorktree, } from "@claudexor/workspace";
8
- import { claudexorOwnedRoot, noProjectRepoRoot } from "@claudexor/util";
9
- import { ControlCredentialProfileCreateRequest, ControlSettingsUpdateRequest, RunScope, TERMINAL_LIFECYCLES, } from "@claudexor/schema";
6
+ import { probeGitCapability, purgeThreadLanes, purgeThreadWorktree } from "@claudexor/workspace";
7
+ import { noProjectRepoRoot } from "@claudexor/util";
8
+ import { ControlAccountsMigrationRollbackRequest, ControlCredentialProfileCreateRequest, ControlSettingsUpdateRequest, RunScope, TERMINAL_LIFECYCLES, } from "@claudexor/schema";
9
+ import { rollbackAccountsUnifiedMigration } from "./accounts-unified-migration.js";
10
+ import { credentialProfileMutations } from "./credential-profile-mutations.js";
10
11
  import { quotaControlServices } from "./quota-services.js";
11
- import { registerConfigDirProfile, removeProfileFromRegistry } from "./profile-registration.js";
12
- import { StatusProjectionCache, globalConfigVersion, invalidateStatusProjections, } from "./status-projection-cache.js";
12
+ import { registerConfigDirProfile } from "./profile-registration.js";
13
+ import { StatusProjectionCache, globalConfigVersion } from "./status-projection-cache.js";
13
14
  import { vendorVerifiedProfileStatus } from "@claudexor/orchestrator";
14
15
  import { profileDoctorStatus } from "./accounts-projection.js";
15
16
  import { createRetentionRunner } from "./retention-service.js";
16
- import { canonicalIsolationLocator, invalidateDoctorCache, normalizeThroughExistingAncestor, } from "@claudexor/core";
17
17
  import { buildGateway, harnessModels } from "./registry.js";
18
18
  import { createCredentialProfilesService, projectHarnessStatuses, } from "./accounts-services.js";
19
19
  import { buildAgentCapabilityCatalog } from "./capabilities.js";
20
20
  import { commitSettingsUpdate, settingsSnapshot } from "./settings-service.js";
21
+ import { bustCredentialStatusCaches, } from "./credential-status-invalidation.js";
21
22
  import { activeProfileLoginJob } from "./setup-job-support.js";
22
- import { canonicalProfileLoginDir, isConfigDirLoginHarness } from "./config-dir-login-harnesses.js";
23
23
  import { createRunRequirementsPreflight } from "./request-preflight.js";
24
24
  import { threadRunStartRequiresGit } from "./thread-execution-workspace.js";
25
25
  import { applyThreadDiff } from "./thread-delivery.js";
26
- import { assertCredentialProfileCompatibility, assertCredentialProfileRegistered, } from "./profile-compatibility.js";
26
+ import { assertCredentialProfileCompatibility } from "./profile-compatibility.js";
27
27
  import { remoteFilesystemServices } from "./remote-filesystem.js";
28
28
  import { projectRunApplicability } from "./run-applicability.js";
29
29
  import { threadTurnServices } from "./thread-turn-services.js";
@@ -63,11 +63,7 @@ resources, quotaRegistry, daemonJobs) {
63
63
  const harnessesPollCache = new StatusProjectionCache({
64
64
  versionOf: globalConfigVersion,
65
65
  });
66
- const bustStatusCaches = () => {
67
- invalidateDoctorCache();
68
- invalidateStatusProjections();
69
- quotaRegistry().noteCredentialChange();
70
- };
66
+ const bustStatusCaches = (subject) => bustCredentialStatusCaches(quotaRegistry, subject);
71
67
  const journalPartition = (partition) => partition === "global" ? journalManager : threads.journal(partition);
72
68
  const setupJobs = () => {
73
69
  try {
@@ -259,105 +255,30 @@ resources, quotaRegistry, daemonJobs) {
259
255
  ...quotaControlServices(quotaRegistry),
260
256
  // INV-135: durable registry + live doctor projection, one probe per
261
257
  // profile; adapters without profile support report honest unknown.
262
- credentialProfiles: createCredentialProfilesService(quotaRegistry),
263
- // PATCH /credential-profiles/:harness/:id the Enabled toggle of the
264
- // accounts symmetry (INV-135). Flips the profile's durable `enabled` in the
265
- // registry (one locked write) and returns the refreshed doctor projection.
266
- updateCredentialProfile: async (input) => {
267
- const p = (input ?? {});
268
- const harnessId = typeof p["harnessId"] === "string" ? p["harnessId"] : "";
269
- const profileId = typeof p["profileId"] === "string" ? p["profileId"] : "";
270
- const enabled = typeof p["enabled"] === "boolean" ? p["enabled"] : undefined;
271
- if (!harnessId || !profileId || enabled === undefined) {
272
- throw Object.assign(new Error("harnessId, profileId and enabled are required"), {
273
- status: 400,
274
- });
275
- }
276
- assertCredentialProfileRegistered(loadConfig(NO_PROJECT_ROOT).global.credential_profiles, harnessId, profileId);
277
- let updated;
278
- updateGlobalConfig((config) => ({
279
- ...config,
280
- credential_profiles: config.credential_profiles.map((profile) => {
281
- if (profile.harness_id !== harnessId || profile.profile_id !== profileId)
282
- return profile;
283
- updated = { ...profile, enabled };
284
- return updated;
285
- }),
286
- }));
287
- if (!updated) {
288
- throw Object.assign(new Error("profile update did not persist"), { status: 500 });
289
- }
290
- bustStatusCaches();
291
- return {
292
- profile: updated,
293
- // Same vendor overlay the listing applies: a single-profile response
294
- // must not re-declare a revoked credential `passed` (INV-135 honesty).
295
- status: vendorVerifiedProfileStatus(await profileDoctorStatus(updated), quotaRegistry().read()),
296
- };
297
- },
298
- // INV-135 deletion: registry first; scoped material cleanup is fenced and disclosed.
299
- deleteCredentialProfile: async (input) => {
300
- const p = (input ?? {});
301
- const harnessId = typeof p["harnessId"] === "string" ? p["harnessId"] : "";
302
- const profileId = typeof p["profileId"] === "string" ? p["profileId"] : "";
303
- if (!harnessId || !profileId) {
304
- throw Object.assign(new Error("harnessId and profileId are required"), { status: 400 });
305
- }
306
- const activeLogin = activeProfileLoginJob(setupJobs, harnessId, profileId);
307
- if (activeLogin) {
308
- throw Object.assign(new Error(`a login for this account is in progress (${activeLogin.jobId}); cancel it before removing the account`), { status: 409 });
309
- }
310
- assertCredentialProfileRegistered(loadConfig(NO_PROJECT_ROOT).global.credential_profiles, harnessId, profileId);
311
- threads.invalidateCredentialProfile(harnessId, profileId);
312
- // INV-034 lifecycle owner (b): the deleted account's durable per-lane
313
- // read-only homes must not survive to be resumed. Sweep them across every
314
- // project a live thread anchors to (plus the no-project partition).
315
- const laneRoots = new Set([NO_PROJECT_ROOT]);
316
- for (const thread of threads.listThreads()) {
317
- if (thread.repo?.root)
318
- laneRoots.add(thread.repo.root);
319
- }
320
- for (const root of laneRoots)
321
- purgeProfileLanes(root, harnessId, profileId);
322
- quotaRegistry().removeSubject(harnessId, profileId);
323
- const entry = removeProfileFromRegistry(harnessId, profileId);
324
- let credentialCleanup = "none";
325
- const cleanupWarnings = [];
326
- try {
327
- if (entry.credential_kind === "config_dir_login" && entry.isolation_locator) {
328
- // Each member resolves through its OWN canonicalizer (the ladder
329
- // this used to hand-write let cursor and agy fall through to the
330
- // generic one, so a member whose canonicalizer adds a rule — claude
331
- // already refuses the default native dir — would silently delete
332
- // against a different path than its login wrote to).
333
- const dir = isConfigDirLoginHarness(harnessId)
334
- ? canonicalProfileLoginDir(harnessId, entry.isolation_locator)
335
- : canonicalIsolationLocator(entry.isolation_locator, "credential profile dir");
336
- // Recursive deletion is fenced to a strict descendant of the profiles tree.
337
- const profilesRoot = normalizeThroughExistingAncestor(join(claudexorOwnedRoot(), "profiles"));
338
- if (!dir.startsWith(profilesRoot + sep)) {
339
- throw new Error(`refusing to delete "${dir}": not inside the profiles tree ${profilesRoot}`);
340
- }
341
- if (existsSync(dir)) {
342
- rmSync(dir, { recursive: true, force: true });
343
- credentialCleanup = "config_dir_removed";
344
- }
345
- }
346
- else if (entry.secret_ref) {
347
- secretStore.delete(entry.secret_ref);
348
- credentialCleanup = "secret_deleted";
349
- }
350
- }
351
- catch (err) {
352
- cleanupWarnings.push(`registry entry removed, but credential cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
353
- }
258
+ // The pool-authority read (GET /v2/account-pools) shares the same cached
259
+ // projection so the listing and the pool verdict cannot disagree.
260
+ ...createCredentialProfilesService(quotaRegistry),
261
+ // PATCH + DELETE /credential-profiles/:harness/:id the Enabled toggle
262
+ // (with the migrated row's native_credentials_enabled downgrade mirror)
263
+ // and the provable D-U4 removal, owned by credential-profile-mutations.ts.
264
+ ...credentialProfileMutations({
265
+ threads,
266
+ quotaRegistry,
267
+ secretStore,
268
+ bustStatusCaches,
269
+ activeLoginJob: (harnessId, profileId) => activeProfileLoginJob(setupJobs, harnessId, profileId),
270
+ }),
271
+ // POST /accounts-migration/rollback — the supported downgrade path's
272
+ // first step (unified account model): surgically reverses the startup
273
+ // migration (sessions/checkpoints/lane homes back to the engine-default
274
+ // keys, the auto-registered row out of the registry, its enabled state
275
+ // back onto the native_credentials_enabled mirror). Run BEFORE installing
276
+ // an engine whose canonicalizers refuse the native locator.
277
+ rollbackAccountsMigration: async (input) => {
278
+ const request = ControlAccountsMigrationRollbackRequest.parse(input ?? {});
279
+ const rolledBack = rollbackAccountsUnifiedMigration({ threads, quota: quotaRegistry() }, request.harnessId);
354
280
  bustStatusCaches();
355
- return {
356
- profile: entry,
357
- removed: true,
358
- credentialCleanup,
359
- ...(cleanupWarnings.length > 0 ? { cleanupWarning: cleanupWarnings.join("; ") } : {}),
360
- };
281
+ return { rolledBack };
361
282
  },
362
283
  // POST /credential-profiles: the SAME ONE registration owner the CLI's
363
284
  // `profiles add` uses (profile-registration.ts) — never a second write
@@ -370,7 +291,7 @@ resources, quotaRegistry, daemonJobs) {
370
291
  profileId: request.profileId,
371
292
  displayName: request.displayName,
372
293
  });
373
- bustStatusCaches();
294
+ bustStatusCaches({ harnessId: request.harnessId, profileId: request.profileId });
374
295
  return {
375
296
  profile,
376
297
  status: vendorVerifiedProfileStatus(await profileDoctorStatus(profile), quotaRegistry().read()),
@@ -405,7 +326,7 @@ resources, quotaRegistry, daemonJobs) {
405
326
  throw Object.assign(new Error(`secret name must be a managed name or managed:profile slot, got "${name}"`), { status: 400 });
406
327
  }
407
328
  const backend = secretStore.set(name, value);
408
- bustStatusCaches();
329
+ bustStatusCaches({ secretName: name });
409
330
  return {
410
331
  name,
411
332
  backend,
@@ -415,7 +336,7 @@ resources, quotaRegistry, daemonJobs) {
415
336
  },
416
337
  deleteSecret: async (name) => {
417
338
  secretStore.delete(name);
418
- bustStatusCaches();
339
+ bustStatusCaches({ secretName: name });
419
340
  return { name, deleted: true };
420
341
  },
421
342
  };