@modelprofile.com/authswitch 7.0.0 → 8.1.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 +1 -3
- package/dist_ts/authority-contract.js +1 -1
- package/dist_ts/authority-import-contract.d.ts +207 -0
- package/dist_ts/authority-import-contract.js +18 -0
- package/dist_ts/classes.authoritybroker.js +1 -5
- package/dist_ts/classes.authoritycli.d.ts +4 -0
- package/dist_ts/classes.authoritycli.js +149 -12
- package/dist_ts/classes.authorityclient.d.ts +7 -0
- package/dist_ts/classes.authorityclient.js +13 -1
- package/dist_ts/classes.authoritydaemon.d.ts +4 -0
- package/dist_ts/classes.authoritydaemon.js +75 -9
- package/dist_ts/classes.authoritydatabase.d.ts +10 -26
- package/dist_ts/classes.authoritydatabase.js +68 -133
- package/dist_ts/classes.authorityimport.d.ts +161 -0
- package/dist_ts/classes.authorityimport.js +638 -0
- package/dist_ts/classes.authoritymodels.d.ts +39 -43
- package/dist_ts/classes.authoritymodels.js +209 -243
- package/dist_ts/classes.authoritypreuse.js +1 -2
- package/dist_ts/classes.authorityregistry.d.ts +2 -17
- package/dist_ts/classes.authorityregistry.js +18 -74
- package/dist_ts/classes.authoritysecrets.d.ts +1 -1
- package/dist_ts/classes.authoritysecrets.js +2 -2
- package/dist_ts/classes.authorityusage.d.ts +3 -3
- package/dist_ts/classes.claudeauthority.js +3 -7
- package/dist_ts/classes.claudenative.d.ts +1 -8
- package/dist_ts/classes.claudenative.js +2 -25
- package/dist_ts/classes.codexmanaged.d.ts +1 -1
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +6 -3
- package/dist_ts/plugins.d.ts +7 -7
- package/dist_ts/plugins.js +8 -8
- package/dist_ts/ts_migration/0001_authority_meta.d.ts +13 -3
- package/dist_ts/ts_migration/0001_authority_meta.js +29 -17
- package/dist_ts/ts_migration/0002_remove_backup_records.d.ts +17 -0
- package/dist_ts/ts_migration/0002_remove_backup_records.js +48 -0
- package/dist_ts/ts_migration/index.d.ts +6 -3
- package/dist_ts/ts_migration/index.js +10 -4
- package/dist_ts/ts_migration/legacysources/authswitchstores.d.ts +2 -0
- package/dist_ts/ts_migration/legacysources/authswitchstores.js +244 -0
- package/dist_ts/ts_migration/legacysources/index.d.ts +18 -0
- package/dist_ts/ts_migration/legacysources/index.js +24 -0
- package/dist_ts/ts_migration/legacysources/material.d.ts +37 -0
- package/dist_ts/ts_migration/legacysources/material.js +120 -0
- package/dist_ts/ts_migration/legacysources/nativestores.d.ts +2 -0
- package/dist_ts/ts_migration/legacysources/nativestores.js +207 -0
- package/dist_ts/ts_migration/legacysources/shared.d.ts +124 -0
- package/dist_ts/ts_migration/legacysources/shared.js +142 -0
- package/package.json +6 -5
- package/readme.md +68 -26
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/authority-contract.ts +1 -3
- package/ts/authority-import-contract.ts +216 -0
- package/ts/classes.authoritybroker.ts +0 -4
- package/ts/classes.authoritycli.ts +165 -11
- package/ts/classes.authorityclient.ts +22 -0
- package/ts/classes.authoritydaemon.ts +75 -8
- package/ts/classes.authoritydatabase.ts +70 -145
- package/ts/classes.authorityimport.ts +718 -0
- package/ts/classes.authoritymodels.ts +253 -269
- package/ts/classes.authoritypreuse.ts +0 -1
- package/ts/classes.authorityregistry.ts +20 -91
- package/ts/classes.authoritysecrets.ts +1 -1
- package/ts/classes.authorityusage.ts +3 -3
- package/ts/classes.claudeauthority.ts +2 -6
- package/ts/classes.claudenative.ts +1 -32
- package/ts/classes.codexmanaged.ts +1 -1
- package/ts/index.ts +5 -2
- package/ts/plugins.ts +7 -7
- package/ts/ts_migration/0001_authority_meta.ts +29 -17
- package/ts/ts_migration/0002_remove_backup_records.ts +49 -0
- package/ts/ts_migration/index.ts +10 -5
- package/ts/ts_migration/legacysources/authswitchstores.ts +211 -0
- package/ts/ts_migration/legacysources/index.ts +35 -0
- package/ts/ts_migration/legacysources/material.ts +134 -0
- package/ts/ts_migration/legacysources/nativestores.ts +204 -0
- package/ts/ts_migration/legacysources/shared.ts +220 -0
- package/dist_ts/authorityrehearsal.child.d.ts +0 -1
- package/dist_ts/authorityrehearsal.child.js +0 -395
- package/dist_ts/classes.authoritybackup.d.ts +0 -134
- package/dist_ts/classes.authoritybackup.js +0 -769
- package/dist_ts/classes.authorityrehearsal.d.ts +0 -127
- package/dist_ts/classes.authorityrehearsal.js +0 -632
- package/ts/authorityrehearsal.child.ts +0 -330
- package/ts/classes.authoritybackup.ts +0 -780
- package/ts/classes.authorityrehearsal.ts +0 -625
|
@@ -3,8 +3,6 @@ import type { TAuthSwitchLoginPrompt } from './authority-contract.js';
|
|
|
3
3
|
import type { IAuthSwitchStoredUsage } from './classes.authorityusage.js';
|
|
4
4
|
export interface IStoredAuthorityMeta {
|
|
5
5
|
id: 'authswitch-authority';
|
|
6
|
-
schemaVersion: 2;
|
|
7
|
-
admission: 'open' | 'closed_restored';
|
|
8
6
|
epoch: string;
|
|
9
7
|
revision: number;
|
|
10
8
|
updateId: string;
|
|
@@ -47,6 +45,18 @@ export interface IStoredAuthorityGrant {
|
|
|
47
45
|
statusObservedAt: string;
|
|
48
46
|
updateId: string;
|
|
49
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether a change of grant owner hands the refresher from one live owner to another.
|
|
50
|
+
*
|
|
51
|
+
* `daemon`, `legacy_native` and `claude_native` each refresh the grant they own, so moving between any two
|
|
52
|
+
* of them is a transfer and needs a verified handoff: doing it in one write would leave two owners believing
|
|
53
|
+
* they may send the same rotating refresh token. `none` is not an owner but the absence of one -- a grant
|
|
54
|
+
* that needs re-authentication has no refresher, and a device login gives it one -- so every transition to
|
|
55
|
+
* or from `none` is an ordinary lifecycle step, not a transfer.
|
|
56
|
+
*/
|
|
57
|
+
export declare const transfersGrantRefresher: (previous: IStoredAuthorityGrant["owner"], next: IStoredAuthorityGrant["owner"]) => boolean;
|
|
58
|
+
/** The refusal that names the direction of a transfer, so a caller learns which handoff it needs. */
|
|
59
|
+
export declare const grantRefresherTransferRefusal: (previous: IStoredAuthorityGrant["owner"], next: IStoredAuthorityGrant["owner"]) => string;
|
|
50
60
|
/** Credential-free provider usage cached for one exact account/login pair. */
|
|
51
61
|
export interface IStoredAuthorityUsage extends IAuthSwitchStoredUsage {
|
|
52
62
|
id: string;
|
|
@@ -142,7 +152,6 @@ export interface IStoredAuthorityHandoff {
|
|
|
142
152
|
operationId: string;
|
|
143
153
|
sourceDigest: string;
|
|
144
154
|
verifiedSourceDigest: string | null;
|
|
145
|
-
backupDigest: string | null;
|
|
146
155
|
revision: number;
|
|
147
156
|
statusObservedAt: string;
|
|
148
157
|
updateId: string;
|
|
@@ -157,7 +166,6 @@ export interface IStoredAuthorityMigrationLedger {
|
|
|
157
166
|
status: 'pending_native_owner' | 'prepared' | 'verified' | 'complete' | 'quarantined';
|
|
158
167
|
accountId: string | null;
|
|
159
168
|
grantId: string | null;
|
|
160
|
-
backupDigest: string | null;
|
|
161
169
|
revision: number;
|
|
162
170
|
statusObservedAt: string;
|
|
163
171
|
updateId: string;
|
|
@@ -193,7 +201,7 @@ export interface IStoredAuthorityDeviceOperation {
|
|
|
193
201
|
revision: number;
|
|
194
202
|
updateId: string;
|
|
195
203
|
}
|
|
196
|
-
export type TStoredAuthorityPreuseProblem = 'none' | 'target_unavailable' | 'access_unavailable' | 'catalog_unavailable' | 'account_busy' | 'cancelled' | 'authority_closing' | 'interrupted' | 'request_uncertain'
|
|
204
|
+
export type TStoredAuthorityPreuseProblem = 'none' | 'target_unavailable' | 'access_unavailable' | 'catalog_unavailable' | 'account_busy' | 'cancelled' | 'authority_closing' | 'interrupted' | 'request_uncertain';
|
|
197
205
|
/** One quota-consuming request. The prompt and generated prose never enter persistence. */
|
|
198
206
|
export interface IStoredAuthorityPreuseOperation {
|
|
199
207
|
id: string;
|
|
@@ -260,25 +268,15 @@ export declare const assertStoredAuthorityMigrationLedger: (value: unknown) => a
|
|
|
260
268
|
export declare const assertStoredAuthorityEvent: (value: unknown) => asserts value is IStoredAuthorityEvent;
|
|
261
269
|
export declare const assertStoredAuthorityOperation: (value: unknown) => asserts value is IStoredAuthorityOperation;
|
|
262
270
|
export declare const assertStoredAuthorityOperationDocument: (value: unknown) => asserts value is IStoredAuthorityOperationDocument;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
* evidence and is handled separately: a snapshot captured in `preparing` may have sent after capture.
|
|
266
|
-
*/
|
|
267
|
-
export declare const restoreStoredAuthorityOperation: (operation: IStoredAuthorityOperation, options: {
|
|
268
|
-
restoredAt: string;
|
|
269
|
-
updateId: string;
|
|
270
|
-
}) => IStoredAuthorityOperation;
|
|
271
|
-
export declare class AuthSwitchAuthorityMetaModel extends plugins.smartdata.SmartDataDbDoc<AuthSwitchAuthorityMetaModel, IStoredAuthorityMeta> {
|
|
272
|
-
static exact: plugins.smartdata.TExact<AuthSwitchAuthorityMetaModel>;
|
|
271
|
+
export declare class AuthSwitchAuthorityMetaModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityMetaModel, IStoredAuthorityMeta> {
|
|
272
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityMetaModel>;
|
|
273
273
|
id: 'authswitch-authority';
|
|
274
|
-
schemaVersion: 2;
|
|
275
|
-
admission: IStoredAuthorityMeta['admission'];
|
|
276
274
|
epoch: string;
|
|
277
275
|
revision: number;
|
|
278
276
|
updateId: string;
|
|
279
277
|
}
|
|
280
|
-
export declare class AuthSwitchAuthorityAccountModel extends plugins.
|
|
281
|
-
static exact: plugins.
|
|
278
|
+
export declare class AuthSwitchAuthorityAccountModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityAccountModel, IStoredAuthorityAccount> {
|
|
279
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityAccountModel>;
|
|
282
280
|
id: string;
|
|
283
281
|
providerId: string;
|
|
284
282
|
issuer: string;
|
|
@@ -293,8 +291,8 @@ export declare class AuthSwitchAuthorityAccountModel extends plugins.smartdata.S
|
|
|
293
291
|
statusObservedAt: string;
|
|
294
292
|
updateId: string;
|
|
295
293
|
}
|
|
296
|
-
export declare class AuthSwitchAuthorityGrantModel extends plugins.
|
|
297
|
-
static exact: plugins.
|
|
294
|
+
export declare class AuthSwitchAuthorityGrantModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityGrantModel, IStoredAuthorityGrant> {
|
|
295
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityGrantModel>;
|
|
298
296
|
id: string;
|
|
299
297
|
accountId: string;
|
|
300
298
|
providerId: string;
|
|
@@ -314,8 +312,8 @@ export declare class AuthSwitchAuthorityGrantModel extends plugins.smartdata.Sma
|
|
|
314
312
|
statusObservedAt: string;
|
|
315
313
|
updateId: string;
|
|
316
314
|
}
|
|
317
|
-
export declare class AuthSwitchAuthorityUsageModel extends plugins.
|
|
318
|
-
static exact: plugins.
|
|
315
|
+
export declare class AuthSwitchAuthorityUsageModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityUsageModel, IStoredAuthorityUsage> {
|
|
316
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityUsageModel>;
|
|
319
317
|
id: string;
|
|
320
318
|
accountId: string;
|
|
321
319
|
loginId: string;
|
|
@@ -330,8 +328,8 @@ export declare class AuthSwitchAuthorityUsageModel extends plugins.smartdata.Sma
|
|
|
330
328
|
failures: number;
|
|
331
329
|
problem: IAuthSwitchStoredUsage['problem'];
|
|
332
330
|
}
|
|
333
|
-
export declare class AuthSwitchAuthorityBindingModel extends plugins.
|
|
334
|
-
static exact: plugins.
|
|
331
|
+
export declare class AuthSwitchAuthorityBindingModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityBindingModel, IStoredAuthorityBinding> {
|
|
332
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityBindingModel>;
|
|
335
333
|
id: string;
|
|
336
334
|
accountId: string;
|
|
337
335
|
grantId: string;
|
|
@@ -343,16 +341,16 @@ export declare class AuthSwitchAuthorityBindingModel extends plugins.smartdata.S
|
|
|
343
341
|
capabilityHash: string;
|
|
344
342
|
updateId: string;
|
|
345
343
|
}
|
|
346
|
-
export declare class AuthSwitchAuthorityEnrollmentModel extends plugins.
|
|
347
|
-
static exact: plugins.
|
|
344
|
+
export declare class AuthSwitchAuthorityEnrollmentModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityEnrollmentModel, IStoredAuthorityEnrollment> {
|
|
345
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityEnrollmentModel>;
|
|
348
346
|
id: string;
|
|
349
347
|
accountId: string;
|
|
350
348
|
ciphertext: string;
|
|
351
349
|
revision: number;
|
|
352
350
|
updateId: string;
|
|
353
351
|
}
|
|
354
|
-
export declare class AuthSwitchAuthorityCodexHomeModel extends plugins.
|
|
355
|
-
static exact: plugins.
|
|
352
|
+
export declare class AuthSwitchAuthorityCodexHomeModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityCodexHomeModel, IStoredAuthorityCodexHome> {
|
|
353
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityCodexHomeModel>;
|
|
356
354
|
id: string;
|
|
357
355
|
accountId: string;
|
|
358
356
|
grantId: string;
|
|
@@ -361,8 +359,8 @@ export declare class AuthSwitchAuthorityCodexHomeModel extends plugins.smartdata
|
|
|
361
359
|
createdAt: string;
|
|
362
360
|
updateId: string;
|
|
363
361
|
}
|
|
364
|
-
export declare class AuthSwitchAuthorityClaudeHomeModel extends plugins.
|
|
365
|
-
static exact: plugins.
|
|
362
|
+
export declare class AuthSwitchAuthorityClaudeHomeModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityClaudeHomeModel, IStoredAuthorityClaudeHome> {
|
|
363
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityClaudeHomeModel>;
|
|
366
364
|
id: string;
|
|
367
365
|
activeAccountId: string;
|
|
368
366
|
activeGrantId: string;
|
|
@@ -372,8 +370,8 @@ export declare class AuthSwitchAuthorityClaudeHomeModel extends plugins.smartdat
|
|
|
372
370
|
createdAt: string;
|
|
373
371
|
updateId: string;
|
|
374
372
|
}
|
|
375
|
-
export declare class AuthSwitchAuthorityClaudeHandoffModel extends plugins.
|
|
376
|
-
static exact: plugins.
|
|
373
|
+
export declare class AuthSwitchAuthorityClaudeHandoffModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityClaudeHandoffModel, IStoredAuthorityClaudeHandoff> {
|
|
374
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityClaudeHandoffModel>;
|
|
377
375
|
id: string;
|
|
378
376
|
homeId: string;
|
|
379
377
|
outgoingAccountId: string;
|
|
@@ -395,8 +393,8 @@ export declare class AuthSwitchAuthorityClaudeHandoffModel extends plugins.smart
|
|
|
395
393
|
revision: number;
|
|
396
394
|
updateId: string;
|
|
397
395
|
}
|
|
398
|
-
export declare class AuthSwitchAuthorityHandoffModel extends plugins.
|
|
399
|
-
static exact: plugins.
|
|
396
|
+
export declare class AuthSwitchAuthorityHandoffModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityHandoffModel, IStoredAuthorityHandoff> {
|
|
397
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityHandoffModel>;
|
|
400
398
|
id: string;
|
|
401
399
|
accountId: string;
|
|
402
400
|
grantId: string;
|
|
@@ -406,13 +404,12 @@ export declare class AuthSwitchAuthorityHandoffModel extends plugins.smartdata.S
|
|
|
406
404
|
operationId: string;
|
|
407
405
|
sourceDigest: string;
|
|
408
406
|
verifiedSourceDigest: string | null;
|
|
409
|
-
backupDigest: string | null;
|
|
410
407
|
revision: number;
|
|
411
408
|
statusObservedAt: string;
|
|
412
409
|
updateId: string;
|
|
413
410
|
}
|
|
414
|
-
export declare class AuthSwitchAuthorityMigrationLedgerModel extends plugins.
|
|
415
|
-
static exact: plugins.
|
|
411
|
+
export declare class AuthSwitchAuthorityMigrationLedgerModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityMigrationLedgerModel, IStoredAuthorityMigrationLedger> {
|
|
412
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityMigrationLedgerModel>;
|
|
416
413
|
id: string;
|
|
417
414
|
version: number;
|
|
418
415
|
sourceKind: IStoredAuthorityMigrationLedger['sourceKind'];
|
|
@@ -421,21 +418,20 @@ export declare class AuthSwitchAuthorityMigrationLedgerModel extends plugins.sma
|
|
|
421
418
|
status: IStoredAuthorityMigrationLedger['status'];
|
|
422
419
|
accountId: string | null;
|
|
423
420
|
grantId: string | null;
|
|
424
|
-
backupDigest: string | null;
|
|
425
421
|
revision: number;
|
|
426
422
|
statusObservedAt: string;
|
|
427
423
|
updateId: string;
|
|
428
424
|
}
|
|
429
|
-
export declare class AuthSwitchAuthorityEventModel extends plugins.
|
|
430
|
-
static exact: plugins.
|
|
425
|
+
export declare class AuthSwitchAuthorityEventModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityEventModel, IStoredAuthorityEvent> {
|
|
426
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityEventModel>;
|
|
431
427
|
id: string;
|
|
432
428
|
epoch: string;
|
|
433
429
|
revision: number;
|
|
434
430
|
kind: IStoredAuthorityEvent['kind'];
|
|
435
431
|
accountId: string;
|
|
436
432
|
}
|
|
437
|
-
export declare class AuthSwitchAuthorityOperationModel extends plugins.
|
|
438
|
-
static exact: plugins.
|
|
433
|
+
export declare class AuthSwitchAuthorityOperationModel extends plugins.nosqldb.SmartDataDbDoc<AuthSwitchAuthorityOperationModel, IStoredAuthorityOperationDocument> {
|
|
434
|
+
static exact: plugins.nosqldb.TExact<AuthSwitchAuthorityOperationModel>;
|
|
439
435
|
id: string;
|
|
440
436
|
kind: IStoredAuthorityOperationDocument['kind'];
|
|
441
437
|
purpose: IStoredAuthorityOperation['purpose'];
|