@modelprofile.com/authswitch 6.4.0 → 7.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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/authority-contract.d.ts +302 -6
- package/dist_ts/authority-contract.js +1 -1
- package/dist_ts/authority-runtime-contract.d.ts +15 -0
- package/dist_ts/authorityrehearsal.child.d.ts +1 -0
- package/dist_ts/authorityrehearsal.child.js +395 -0
- package/dist_ts/classes.accountlist.js +4 -3
- package/dist_ts/classes.authoritybackup.d.ts +134 -0
- package/dist_ts/classes.authoritybackup.js +769 -0
- package/dist_ts/classes.authoritybroker.d.ts +29 -6
- package/dist_ts/classes.authoritybroker.js +413 -122
- package/dist_ts/classes.authoritycli.d.ts +24 -0
- package/dist_ts/classes.authoritycli.js +675 -0
- package/dist_ts/classes.authorityclient.d.ts +34 -9
- package/dist_ts/classes.authorityclient.js +136 -38
- package/dist_ts/classes.authoritydaemon.d.ts +47 -0
- package/dist_ts/classes.authoritydaemon.js +705 -16
- package/dist_ts/classes.authoritydatabase.d.ts +182 -8
- package/dist_ts/classes.authoritydatabase.js +1188 -41
- package/dist_ts/classes.authoritymodels.d.ts +247 -1
- package/dist_ts/classes.authoritymodels.js +870 -6
- package/dist_ts/classes.authoritypreuse.d.ts +47 -0
- package/dist_ts/classes.authoritypreuse.js +278 -0
- package/dist_ts/classes.authorityregistry.d.ts +24 -0
- package/dist_ts/classes.authorityregistry.js +88 -0
- package/dist_ts/classes.authorityrehearsal.d.ts +127 -0
- package/dist_ts/classes.authorityrehearsal.js +632 -0
- package/dist_ts/classes.authorityusage.d.ts +160 -0
- package/dist_ts/classes.authorityusage.js +429 -0
- package/dist_ts/classes.claudeauthority.d.ts +66 -0
- package/dist_ts/classes.claudeauthority.js +532 -0
- package/dist_ts/classes.claudecodeharness.js +3 -2
- package/dist_ts/classes.claudecodelocks.d.ts +13 -0
- package/dist_ts/classes.claudecodelocks.js +75 -3
- package/dist_ts/classes.claudenative.d.ts +137 -0
- package/dist_ts/classes.claudenative.js +731 -0
- package/dist_ts/classes.claudestatus.d.ts +9 -0
- package/dist_ts/classes.claudestatus.js +26 -9
- package/dist_ts/classes.claudetokenrefresh.d.ts +15 -1
- package/dist_ts/classes.claudetokenrefresh.js +74 -21
- package/dist_ts/classes.codexharness.js +4 -2
- package/dist_ts/classes.codexmanaged.d.ts +91 -0
- package/dist_ts/classes.codexmanaged.js +404 -0
- package/dist_ts/classes.codexpreuse.d.ts +8 -0
- package/dist_ts/classes.codexpreuse.js +24 -6
- package/dist_ts/classes.fileharness.d.ts +2 -0
- package/dist_ts/classes.fileharness.js +6 -4
- package/dist_ts/classes.limits.js +12 -7
- package/dist_ts/classes.opencodeharness.js +2 -2
- package/dist_ts/claudehttp.d.ts +10 -0
- package/dist_ts/claudehttp.js +29 -3
- package/dist_ts/index.d.ts +2 -0
- package/dist_ts/index.js +8 -1
- package/dist_ts/interfaces.harness.d.ts +6 -0
- package/dist_ts/interfaces.list.d.ts +9 -3
- package/dist_ts/plugins.d.ts +7 -3
- package/dist_ts/plugins.js +9 -4
- package/dist_ts/ts_migration/0001_authority_meta.d.ts +3 -0
- package/dist_ts/ts_migration/0001_authority_meta.js +32 -0
- package/dist_ts/ts_migration/index.d.ts +3 -0
- package/dist_ts/ts_migration/index.js +6 -0
- package/package.json +12 -2
- package/readme.md +205 -13
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/authority-contract.ts +264 -9
- package/ts/authority-runtime-contract.ts +21 -1
- package/ts/authorityrehearsal.child.ts +330 -0
- package/ts/classes.accountlist.ts +3 -2
- package/ts/classes.authoritybackup.ts +780 -0
- package/ts/classes.authoritybroker.ts +410 -120
- package/ts/classes.authoritycli.ts +719 -0
- package/ts/classes.authorityclient.ts +164 -38
- package/ts/classes.authoritydaemon.ts +614 -17
- package/ts/classes.authoritydatabase.ts +1229 -44
- package/ts/classes.authoritymodels.ts +579 -4
- package/ts/classes.authoritypreuse.ts +297 -0
- package/ts/classes.authorityregistry.ts +118 -0
- package/ts/classes.authorityrehearsal.ts +625 -0
- package/ts/classes.authorityusage.ts +527 -0
- package/ts/classes.claudeauthority.ts +541 -0
- package/ts/classes.claudecodeharness.ts +2 -1
- package/ts/classes.claudecodelocks.ts +70 -1
- package/ts/classes.claudenative.ts +816 -0
- package/ts/classes.claudestatus.ts +38 -9
- package/ts/classes.claudetokenrefresh.ts +82 -19
- package/ts/classes.codexharness.ts +3 -1
- package/ts/classes.codexmanaged.ts +402 -0
- package/ts/classes.codexpreuse.ts +33 -5
- package/ts/classes.fileharness.ts +7 -3
- package/ts/classes.limits.ts +11 -6
- package/ts/classes.opencodeharness.ts +1 -1
- package/ts/claudehttp.ts +31 -2
- package/ts/index.ts +7 -0
- package/ts/interfaces.harness.ts +6 -0
- package/ts/interfaces.list.ts +9 -3
- package/ts/plugins.ts +9 -3
- package/ts/ts_migration/0001_authority_meta.ts +33 -0
- package/ts/ts_migration/index.ts +7 -0
package/ts/authority-contract.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ITypedRequest } from '@api.global/typedrequest-interfaces';
|
|
2
|
+
import type { IAuthSwitchUsageSnapshot } from './classes.authorityusage.js';
|
|
3
|
+
export type { IAuthSwitchUsageSnapshot } from './classes.authorityusage.js';
|
|
2
4
|
|
|
3
5
|
/** Credential-free account management contract. Safe to import in browser code. */
|
|
4
|
-
export type
|
|
6
|
+
export type TAuthSwitchLoginPurpose = 'openai_managed' | 'claude_host_native' | 'claude_container_setup' | 'opencode_native';
|
|
7
|
+
export type TAuthSwitchLoginHealth = 'ready' | 'refreshing' | 'retry_wait' | 'needs_reauth' | 'unverified' | 'pending_handoff' | 'handoff_quarantined' | 'removed';
|
|
5
8
|
|
|
6
9
|
export interface IAuthSwitchAccount {
|
|
7
10
|
id: string;
|
|
@@ -9,14 +12,26 @@ export interface IAuthSwitchAccount {
|
|
|
9
12
|
label: string;
|
|
10
13
|
email: string | null;
|
|
11
14
|
plan: string | null;
|
|
12
|
-
|
|
15
|
+
removed: boolean;
|
|
16
|
+
revision: number;
|
|
17
|
+
statusObservedAt: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** One independently owned login. Native ownership does not imply observed health. */
|
|
21
|
+
export interface IAuthSwitchLogin {
|
|
22
|
+
id: string;
|
|
23
|
+
accountId: string;
|
|
24
|
+
providerId: string;
|
|
25
|
+
purpose: TAuthSwitchLoginPurpose;
|
|
13
26
|
owner: 'daemon' | 'claude_native' | 'legacy_native' | 'none';
|
|
27
|
+
health: TAuthSwitchLoginHealth;
|
|
28
|
+
problem: 'none' | 'provider_unavailable' | 'exchange_uncertain' | 'provider_rejected' | 'native_owner';
|
|
14
29
|
grantGeneration: number;
|
|
15
30
|
revision: number;
|
|
16
31
|
accessExpiresAt: string | null;
|
|
17
32
|
retryAt: string | null;
|
|
18
|
-
problem: 'none' | 'provider_unavailable' | 'exchange_uncertain' | 'provider_rejected' | 'native_owner';
|
|
19
33
|
statusObservedAt: string;
|
|
34
|
+
capabilities: { canReauthenticate: boolean; canBind: boolean; canPreuse: boolean };
|
|
20
35
|
}
|
|
21
36
|
|
|
22
37
|
export interface IAuthSwitchBinding {
|
|
@@ -29,16 +44,152 @@ export interface IAuthSwitchBinding {
|
|
|
29
44
|
}
|
|
30
45
|
|
|
31
46
|
export interface IAuthSwitchSnapshot {
|
|
32
|
-
schemaVersion:
|
|
47
|
+
schemaVersion: 2;
|
|
33
48
|
epoch: string;
|
|
34
49
|
revision: number;
|
|
35
50
|
generatedAt: string;
|
|
36
51
|
accounts: IAuthSwitchAccount[];
|
|
52
|
+
logins: IAuthSwitchLogin[];
|
|
37
53
|
bindings: IAuthSwitchBinding[];
|
|
38
54
|
nextAccountCursor: string | null;
|
|
55
|
+
nextLoginCursor: string | null;
|
|
39
56
|
nextBindingCursor: string | null;
|
|
40
57
|
}
|
|
41
58
|
|
|
59
|
+
/** Persisted account evidence. No provider request is made while collecting diagnostics. */
|
|
60
|
+
export interface IAuthSwitchDoctorAccountEvidence {
|
|
61
|
+
id: string;
|
|
62
|
+
providerId: string;
|
|
63
|
+
removed: boolean;
|
|
64
|
+
statusObservedAt: string;
|
|
65
|
+
evidence: 'stored';
|
|
66
|
+
liveCheck: 'not_checked';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Persisted login evidence. Stored readiness is not a live provider-health claim. */
|
|
70
|
+
export interface IAuthSwitchDoctorLoginEvidence {
|
|
71
|
+
id: string;
|
|
72
|
+
accountId: string;
|
|
73
|
+
providerId: string;
|
|
74
|
+
purpose: TAuthSwitchLoginPurpose;
|
|
75
|
+
owner: 'daemon' | 'claude_native' | 'legacy_native' | 'none';
|
|
76
|
+
state: 'ready' | 'exchange_may_have_been_sent' | 'retry_wait' | 'needs_reauth' | 'native'
|
|
77
|
+
| 'legacy_native_pending' | 'handoff_pending' | 'handoff_quarantined' | 'removed';
|
|
78
|
+
problem: 'none' | 'provider_unavailable' | 'exchange_uncertain' | 'provider_rejected' | 'native_owner';
|
|
79
|
+
grantGeneration: number;
|
|
80
|
+
authorizationGeneration: number;
|
|
81
|
+
accessExpiresAt: string | null;
|
|
82
|
+
retryAt: string | null;
|
|
83
|
+
statusObservedAt: string;
|
|
84
|
+
evidence: 'stored';
|
|
85
|
+
liveCheck: 'not_checked';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface IAuthSwitchDoctorManagedCodex {
|
|
89
|
+
homeId: string;
|
|
90
|
+
accountId: string;
|
|
91
|
+
loginId: string;
|
|
92
|
+
scopeId: string;
|
|
93
|
+
health: 'healthy' | 'degraded' | 'unknown';
|
|
94
|
+
durable: {
|
|
95
|
+
state: 'idle' | 'launch_prepared' | 'registered';
|
|
96
|
+
runId: string | null;
|
|
97
|
+
pid: number | null;
|
|
98
|
+
startedAt: string | null;
|
|
99
|
+
};
|
|
100
|
+
daemon: {
|
|
101
|
+
state: 'untracked' | 'starting' | 'ready' | 'stopping' | 'degraded';
|
|
102
|
+
assignment: 'untracked' | 'matches' | 'mismatch';
|
|
103
|
+
};
|
|
104
|
+
process: {
|
|
105
|
+
state: 'not_expected' | 'absent' | 'observed' | 'unknown';
|
|
106
|
+
identity: 'not_applicable' | 'unregistered' | 'matches' | 'mismatch' | 'unknown';
|
|
107
|
+
pid: number | null;
|
|
108
|
+
startedAt: string | null;
|
|
109
|
+
observedAt: string;
|
|
110
|
+
problem: 'none' | 'inspection_failed' | 'multiple_claimants';
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface IAuthSwitchDoctorClaudeHome {
|
|
115
|
+
id: string;
|
|
116
|
+
activeAccountId: string;
|
|
117
|
+
activeLoginId: string;
|
|
118
|
+
pendingOperationId: string | null;
|
|
119
|
+
status: 'ready' | 'quarantined';
|
|
120
|
+
revision: number;
|
|
121
|
+
createdAt: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface IAuthSwitchDoctorClaudeHandoff {
|
|
125
|
+
id: string;
|
|
126
|
+
homeId: string;
|
|
127
|
+
outgoingAccountId: string;
|
|
128
|
+
outgoingLoginId: string;
|
|
129
|
+
incomingAccountId: string;
|
|
130
|
+
incomingLoginId: string;
|
|
131
|
+
phase: 'reserved' | 'prepared' | 'committed' | 'aborted' | 'quarantined';
|
|
132
|
+
problem: 'none' | 'native_uncertain' | 'foreign_or_torn' | 'unsupported_effective_auth' | 'database_uncertain';
|
|
133
|
+
runningEffectiveAuth: 'no_scoped_sessions' | 'unsupported_effective_auth' | null;
|
|
134
|
+
startedAt: string;
|
|
135
|
+
updatedAt: string;
|
|
136
|
+
revision: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface IAuthSwitchDoctorNativeHandoff {
|
|
140
|
+
id: string;
|
|
141
|
+
accountId: string;
|
|
142
|
+
loginId: string;
|
|
143
|
+
nativeHomeId: string;
|
|
144
|
+
direction: 'to_native' | 'to_daemon';
|
|
145
|
+
phase: 'prepared' | 'source_stopped' | 'target_written' | 'verified' | 'committed' | 'needs_reauth' | 'aborted';
|
|
146
|
+
operationId: string;
|
|
147
|
+
revision: number;
|
|
148
|
+
statusObservedAt: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface IAuthSwitchDoctorMigration {
|
|
152
|
+
id: string;
|
|
153
|
+
sourceKind: 'authswitch_stash' | 'authswitch_backup' | 'agl_flex' | 'codex_native' | 'opencode_native' | 'claude_native';
|
|
154
|
+
status: 'pending_native_owner' | 'prepared' | 'verified' | 'complete' | 'quarantined';
|
|
155
|
+
accountId: string | null;
|
|
156
|
+
loginId: string | null;
|
|
157
|
+
revision: number;
|
|
158
|
+
statusObservedAt: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** One independently observed diagnostic page. Separate pages are not one atomic global snapshot. */
|
|
162
|
+
export interface IAuthSwitchDoctorPage {
|
|
163
|
+
observedAt: string;
|
|
164
|
+
daemon: {
|
|
165
|
+
state: 'ready' | 'closing';
|
|
166
|
+
claudeNativeAuthority: 'configured' | 'not_configured';
|
|
167
|
+
observedAt: string;
|
|
168
|
+
};
|
|
169
|
+
database: {
|
|
170
|
+
state: 'available';
|
|
171
|
+
observedAt: string;
|
|
172
|
+
schemaVersion: 2;
|
|
173
|
+
admission: 'open' | 'closed_restored';
|
|
174
|
+
epoch: string;
|
|
175
|
+
revision: number;
|
|
176
|
+
};
|
|
177
|
+
accounts: IAuthSwitchDoctorAccountEvidence[];
|
|
178
|
+
logins: IAuthSwitchDoctorLoginEvidence[];
|
|
179
|
+
managedCodex: IAuthSwitchDoctorManagedCodex[];
|
|
180
|
+
claudeHomes: IAuthSwitchDoctorClaudeHome[];
|
|
181
|
+
claudeHandoffs: IAuthSwitchDoctorClaudeHandoff[];
|
|
182
|
+
nativeHandoffs: IAuthSwitchDoctorNativeHandoff[];
|
|
183
|
+
migrations: IAuthSwitchDoctorMigration[];
|
|
184
|
+
nextAccountCursor: string | null;
|
|
185
|
+
nextLoginCursor: string | null;
|
|
186
|
+
nextCodexHomeCursor: string | null;
|
|
187
|
+
nextClaudeHomeCursor: string | null;
|
|
188
|
+
nextClaudeHandoffCursor: string | null;
|
|
189
|
+
nextNativeHandoffCursor: string | null;
|
|
190
|
+
nextMigrationCursor: string | null;
|
|
191
|
+
}
|
|
192
|
+
|
|
42
193
|
export interface IAuthSwitchAccountEvent {
|
|
43
194
|
epoch: string;
|
|
44
195
|
revision: number;
|
|
@@ -52,18 +203,97 @@ export type TAuthSwitchLoginPrompt =
|
|
|
52
203
|
|
|
53
204
|
export interface IAuthSwitchOperation {
|
|
54
205
|
id: string;
|
|
55
|
-
|
|
206
|
+
kind: 'add_openai' | 'reauth_openai';
|
|
207
|
+
purpose: 'openai_managed';
|
|
208
|
+
targetAccountId: string | null;
|
|
209
|
+
targetLoginId: string | null;
|
|
210
|
+
state: 'starting' | 'pending' | 'committing' | 'complete' | 'failed' | 'cancelled' | 'interrupted' | 'outcome_unknown';
|
|
56
211
|
prompt: TAuthSwitchLoginPrompt | null;
|
|
57
|
-
|
|
212
|
+
result: { accountId: string; loginId: string; accountRevision: number; loginGeneration: number } | null;
|
|
58
213
|
error: string | null;
|
|
214
|
+
createdAt: string;
|
|
215
|
+
updatedAt: string;
|
|
216
|
+
finishedAt: string | null;
|
|
217
|
+
revision: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Credential-free receipt for one exact, never-replayed quota-consuming request. */
|
|
221
|
+
export interface IAuthSwitchPreuseOperation {
|
|
222
|
+
id: string;
|
|
223
|
+
accountId: string;
|
|
224
|
+
loginId: string;
|
|
225
|
+
purpose: 'openai_managed';
|
|
226
|
+
requestedModel: string | null;
|
|
227
|
+
model: string | null;
|
|
228
|
+
state: 'preparing' | 'request_may_have_started' | 'complete' | 'not_sent' | 'outcome_unknown';
|
|
229
|
+
result: { inputTokens: number | null; outputTokens: number | null; totalTokens: number | null } | null;
|
|
230
|
+
problem: 'none' | 'target_unavailable' | 'access_unavailable' | 'catalog_unavailable'
|
|
231
|
+
| 'account_busy' | 'cancelled' | 'authority_closing' | 'interrupted'
|
|
232
|
+
| 'request_uncertain' | 'restored_history_uncertain';
|
|
233
|
+
createdAt: string;
|
|
234
|
+
updatedAt: string;
|
|
235
|
+
finishedAt: string | null;
|
|
236
|
+
revision: number;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/** Credential-free native file ownership result. It makes no claim about a running session's active request. */
|
|
240
|
+
export interface IAuthSwitchClaudeNativeHandoff {
|
|
241
|
+
id: string;
|
|
242
|
+
homeId: string;
|
|
243
|
+
outgoingAccountId: string;
|
|
244
|
+
incomingAccountId: string;
|
|
245
|
+
phase: 'reserved' | 'prepared' | 'committed' | 'aborted' | 'quarantined';
|
|
246
|
+
problem: 'none' | 'native_uncertain' | 'foreign_or_torn' | 'unsupported_effective_auth' | 'database_uncertain';
|
|
247
|
+
runningEffectiveAuth: 'no_scoped_sessions' | 'unsupported_effective_auth' | null;
|
|
248
|
+
updatedAt: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface IReq_AuthSwitchSwitchClaudeNative extends ITypedRequest {
|
|
252
|
+
method: 'authswitch.authority.claude.switch';
|
|
253
|
+
request: { accountId: string; loginId: string; purpose: 'claude_host_native' };
|
|
254
|
+
response: { handoff: IAuthSwitchClaudeNativeHandoff };
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface IReq_AuthSwitchClaudeNativeHandoff extends ITypedRequest {
|
|
258
|
+
method: 'authswitch.authority.claude.handoff';
|
|
259
|
+
request: { operationId: string };
|
|
260
|
+
response: { handoff: IAuthSwitchClaudeNativeHandoff };
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export interface IReq_AuthSwitchClaudeNativeHandoffs extends ITypedRequest {
|
|
264
|
+
method: 'authswitch.authority.claude.handoffs';
|
|
265
|
+
request: { after?: string; limit?: number };
|
|
266
|
+
response: { handoffs: IAuthSwitchClaudeNativeHandoff[]; nextCursor: string | null };
|
|
59
267
|
}
|
|
60
268
|
|
|
61
269
|
export interface IReq_AuthSwitchSnapshot extends ITypedRequest {
|
|
62
270
|
method: 'authswitch.authority.snapshot';
|
|
63
|
-
request: { accountAfter?: string; bindingAfter?: string; limit?: number };
|
|
271
|
+
request: { accountAfter?: string; loginAfter?: string; bindingAfter?: string; limit?: number };
|
|
64
272
|
response: { snapshot: IAuthSwitchSnapshot };
|
|
65
273
|
}
|
|
66
274
|
|
|
275
|
+
export interface IReq_AuthSwitchDoctor extends ITypedRequest {
|
|
276
|
+
method: 'authswitch.authority.doctor';
|
|
277
|
+
request: {
|
|
278
|
+
accountAfter?: string;
|
|
279
|
+
loginAfter?: string;
|
|
280
|
+
codexHomeAfter?: string;
|
|
281
|
+
claudeHomeAfter?: string;
|
|
282
|
+
claudeHandoffAfter?: string;
|
|
283
|
+
nativeHandoffAfter?: string;
|
|
284
|
+
migrationAfter?: string;
|
|
285
|
+
limit?: number;
|
|
286
|
+
};
|
|
287
|
+
response: { page: IAuthSwitchDoctorPage };
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** Management-only usage read. The DTO contains no access or refresh credential. */
|
|
291
|
+
export interface IReq_AuthSwitchUsage extends ITypedRequest {
|
|
292
|
+
method: 'authswitch.authority.usage';
|
|
293
|
+
request: { accountId: string; loginId: string; force?: boolean };
|
|
294
|
+
response: { usage: IAuthSwitchUsageSnapshot };
|
|
295
|
+
}
|
|
296
|
+
|
|
67
297
|
export interface IReq_AuthSwitchEvents extends ITypedRequest {
|
|
68
298
|
method: 'authswitch.authority.events';
|
|
69
299
|
request: { epoch: string; afterRevision: number; waitMs: number };
|
|
@@ -72,16 +302,22 @@ export interface IReq_AuthSwitchEvents extends ITypedRequest {
|
|
|
72
302
|
|
|
73
303
|
export interface IReq_AuthSwitchBeginAdd extends ITypedRequest {
|
|
74
304
|
method: 'authswitch.authority.add';
|
|
75
|
-
request: { providerId: 'openai'; flow: 'device' };
|
|
305
|
+
request: { operationId: string; providerId: 'openai'; flow: 'device' };
|
|
76
306
|
response: { operation: IAuthSwitchOperation };
|
|
77
307
|
}
|
|
78
308
|
|
|
79
309
|
export interface IReq_AuthSwitchBeginReauth extends ITypedRequest {
|
|
80
310
|
method: 'authswitch.authority.reauth';
|
|
81
|
-
request: { accountId: string; flow: 'device' };
|
|
311
|
+
request: { operationId: string; accountId: string; loginId: string; purpose: 'openai_managed'; flow: 'device' };
|
|
82
312
|
response: { operation: IAuthSwitchOperation };
|
|
83
313
|
}
|
|
84
314
|
|
|
315
|
+
export interface IReq_AuthSwitchListOperations extends ITypedRequest {
|
|
316
|
+
method: 'authswitch.authority.operations';
|
|
317
|
+
request: { after?: string; limit?: number };
|
|
318
|
+
response: { operations: IAuthSwitchOperation[]; nextCursor: string | null };
|
|
319
|
+
}
|
|
320
|
+
|
|
85
321
|
export interface IReq_AuthSwitchGetOperation extends ITypedRequest {
|
|
86
322
|
method: 'authswitch.authority.operation';
|
|
87
323
|
request: { operationId: string };
|
|
@@ -94,6 +330,25 @@ export interface IReq_AuthSwitchCancelOperation extends ITypedRequest {
|
|
|
94
330
|
response: { operation: IAuthSwitchOperation };
|
|
95
331
|
}
|
|
96
332
|
|
|
333
|
+
export interface IReq_AuthSwitchStartPreuse extends ITypedRequest {
|
|
334
|
+
method: 'authswitch.authority.preuse.start';
|
|
335
|
+
request: { operationId: string; accountId: string; loginId: string; purpose: 'openai_managed';
|
|
336
|
+
prompt: string; model?: string };
|
|
337
|
+
response: { operation: IAuthSwitchPreuseOperation };
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface IReq_AuthSwitchGetPreuse extends ITypedRequest {
|
|
341
|
+
method: 'authswitch.authority.preuse.operation';
|
|
342
|
+
request: { operationId: string };
|
|
343
|
+
response: { operation: IAuthSwitchPreuseOperation };
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface IReq_AuthSwitchCancelPreuse extends ITypedRequest {
|
|
347
|
+
method: 'authswitch.authority.preuse.cancel';
|
|
348
|
+
request: { operationId: string };
|
|
349
|
+
response: { operation: IAuthSwitchPreuseOperation };
|
|
350
|
+
}
|
|
351
|
+
|
|
97
352
|
export interface IReq_AuthSwitchRenameAccount extends ITypedRequest {
|
|
98
353
|
method: 'authswitch.authority.rename';
|
|
99
354
|
request: { accountId: string; expectedRevision: number; label: string };
|
|
@@ -6,6 +6,8 @@ export interface IReq_AuthSwitchBindAccount extends ITypedRequest {
|
|
|
6
6
|
method: 'authswitch.authority.bind';
|
|
7
7
|
request: {
|
|
8
8
|
accountId: string;
|
|
9
|
+
loginId: string;
|
|
10
|
+
purpose: 'openai_managed';
|
|
9
11
|
runtime: IAuthSwitchBinding['runtime'];
|
|
10
12
|
scopeId: string;
|
|
11
13
|
incarnationId: string;
|
|
@@ -16,7 +18,13 @@ export interface IReq_AuthSwitchBindAccount extends ITypedRequest {
|
|
|
16
18
|
/** Backend-only access operation. Refresh grants never cross this interface. */
|
|
17
19
|
export interface IReq_AuthSwitchResolveAccess extends ITypedRequest {
|
|
18
20
|
method: 'authswitch.authority.resolveAccess';
|
|
19
|
-
request: {
|
|
21
|
+
request: {
|
|
22
|
+
bindingId: string;
|
|
23
|
+
capability: string;
|
|
24
|
+
minValidityMs: number;
|
|
25
|
+
/** The provider rejected this exact access-token generation. */
|
|
26
|
+
rejectedGrantGeneration?: number;
|
|
27
|
+
};
|
|
20
28
|
response: {
|
|
21
29
|
accessToken: string;
|
|
22
30
|
accountId: string;
|
|
@@ -25,3 +33,15 @@ export interface IReq_AuthSwitchResolveAccess extends ITypedRequest {
|
|
|
25
33
|
grantGeneration: number;
|
|
26
34
|
};
|
|
27
35
|
}
|
|
36
|
+
|
|
37
|
+
/** Backend-only release for one exact external runtime capability. */
|
|
38
|
+
export interface IReq_AuthSwitchReleaseBinding extends ITypedRequest {
|
|
39
|
+
method: 'authswitch.authority.release';
|
|
40
|
+
request: {
|
|
41
|
+
bindingId: string;
|
|
42
|
+
capability: string;
|
|
43
|
+
};
|
|
44
|
+
response: {
|
|
45
|
+
state: 'released' | 'inactive';
|
|
46
|
+
};
|
|
47
|
+
}
|