@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/dist_ts/plugins.js
CHANGED
|
@@ -5,9 +5,10 @@ import * as path from 'node:path';
|
|
|
5
5
|
import * as childProcess from 'node:child_process';
|
|
6
6
|
import * as crypto from 'node:crypto';
|
|
7
7
|
import * as net from 'node:net';
|
|
8
|
+
import * as stream from 'node:stream';
|
|
8
9
|
import { createRequire } from 'node:module';
|
|
9
10
|
import { fileURLToPath } from 'node:url';
|
|
10
|
-
export { childProcess, crypto, fileURLToPath, fs, net, os, path };
|
|
11
|
+
export { childProcess, crypto, fileURLToPath, fs, net, os, path, stream };
|
|
11
12
|
const nativeRequire = createRequire(import.meta.url);
|
|
12
13
|
/** SQLite is needed only when accessing a Codex state database, not when hosting account APIs. */
|
|
13
14
|
export const loadSqlite = () => nativeRequire('node:sqlite');
|
|
@@ -16,18 +17,22 @@ export const loadSqlite = () => nativeRequire('node:sqlite');
|
|
|
16
17
|
* process that never changes a Claude Code login (such as a host embedding the account service) does not need.
|
|
17
18
|
*/
|
|
18
19
|
export const loadProperLockfile = () => import('proper-lockfile');
|
|
20
|
+
// @lossless.org modules
|
|
21
|
+
import * as smartbucket from '@lossless.org/client/objectstorage';
|
|
19
22
|
// @push.rocks modules
|
|
20
23
|
import * as smartconsole from '@push.rocks/smartconsole';
|
|
24
|
+
import * as smartcrypto from '@push.rocks/smartcrypto';
|
|
21
25
|
import * as smartdata from '@push.rocks/smartdata';
|
|
22
26
|
import * as smartdb from '@push.rocks/smartdb';
|
|
23
27
|
import * as smartsecret from '@push.rocks/smartsecret';
|
|
24
28
|
import * as smartdaemon from '@push.rocks/smartdaemon';
|
|
25
29
|
import * as typedrequest from '@api.global/typedrequest';
|
|
26
|
-
export { smartconsole, smartdata, smartdb, smartsecret, smartdaemon, typedrequest };
|
|
30
|
+
export { smartbucket, smartconsole, smartcrypto, smartdata, smartdb, smartsecret, smartdaemon, typedrequest };
|
|
27
31
|
// @modelprofile.com modules
|
|
28
32
|
import * as flexModels from '@modelprofile.com/flexharness-models';
|
|
29
33
|
import * as flexOpenAi from '@modelprofile.com/flexharness-providers/openai';
|
|
30
34
|
import * as flexAuth from '@modelprofile.com/flexharness-providers/auth';
|
|
31
35
|
import * as flexAccounts from '@modelprofile.com/flexharness-providers/accounts';
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
import * as crossharness from '@modelprofile.com/mcp-crossharness';
|
|
37
|
+
export { flexModels, flexOpenAi, flexAuth, flexAccounts, crossharness };
|
|
38
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3BsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0JBQXNCO0FBQ3RCLE9BQU8sS0FBSyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQzlCLE9BQU8sS0FBSyxFQUFFLE1BQU0sU0FBUyxDQUFDO0FBQzlCLE9BQU8sS0FBS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FBTyxLQUFLLE9BQU8sTUFBTSxxQkFBcUIsQ0FBQztBQUMvQyxPQUFPLEtBQUssV0FBVyxNQUFNLHlCQUF5QixDQUFDO0FBQ3ZELE9BQU8sS0FBSyxXQUFXLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxLQUFLLFlBQVksTUFBTSwwQkFBMEIsQ0FBQztBQUN6RCxPQUFPLEVBQUUsV0FBVyxFQUFFLFlBQVksRUFBRSxXQUFXLEVBQUUsU0FBUyxFQUFFLE9BQU8sRUFBRSxXQUFXLEVBQUUsV0FBVyxFQUFFLFlBQVksRUFBRSxDQUFDO0FBRTlHLDRCQUE0QjtBQUM1QixPQUFPLEtBQUssVUFBVSxNQUFNLHNDQUFzQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxVQUFVLE1BQU0sZ0RBQWdELENBQUM7QUFDN0UsT0FBTyxLQUFLLFFBQVEsTUFBTSw4Q0FBOEMsQ0FBQztBQUN6RSxPQUFPLEtBQUssWUFBWSxNQUFNLGtEQUFrRCxDQUFDO0FBQ2pGLE9BQU8sS0FBSyxZQUFZLE1BQU0sb0NBQW9DLENBQUM7QUFDbkUsT0FBTyxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUUsUUFBUSxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsQ0FBQyJ9
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { assertStoredAuthorityMeta } from '../classes.authoritymodels.js';
|
|
2
|
+
const reserved = new Set(['_id', '_smartdataRevision', '_createdAt', '_updatedAt']);
|
|
3
|
+
const keys = ['id', 'epoch', 'revision', 'updateId'];
|
|
4
|
+
const uuid = (value) => typeof value === 'string' && /^[a-f0-9-]{36}$/.test(value);
|
|
5
|
+
/** One-time published 6.4/6.5 metadata upgrade, under the exclusive LocalSmartDb root owner. */
|
|
6
|
+
export const migrateAuthorityMetaV1 = async (db) => {
|
|
7
|
+
const collection = db.mongoDb.collection('authswitch_authority_meta');
|
|
8
|
+
const stored = await collection.findOne({ id: 'authswitch-authority' });
|
|
9
|
+
if (!stored)
|
|
10
|
+
throw new Error('Existing authswitch authority database has no metadata.');
|
|
11
|
+
const body = Object.fromEntries(Object.entries(stored).filter(([key]) => !reserved.has(key)));
|
|
12
|
+
if (body.schemaVersion === 2) {
|
|
13
|
+
assertStoredAuthorityMeta(body);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (Object.keys(body).length !== keys.length || !keys.every(key => Object.hasOwn(body, key))
|
|
17
|
+
|| body.id !== 'authswitch-authority' || !uuid(body.epoch) || !uuid(body.updateId)
|
|
18
|
+
|| !Number.isSafeInteger(body.revision) || Number(body.revision) < 0) {
|
|
19
|
+
throw new Error('Existing authswitch authority metadata has an unknown schema.');
|
|
20
|
+
}
|
|
21
|
+
const result = await collection.updateOne({ _id: stored._id, id: 'authswitch-authority',
|
|
22
|
+
schemaVersion: { $exists: false }, admission: { $exists: false } }, { $set: { schemaVersion: 2, admission: 'open' } });
|
|
23
|
+
if (result.matchedCount !== 1 || result.modifiedCount !== 1) {
|
|
24
|
+
throw new Error('Authswitch authority metadata migration did not commit exactly once.');
|
|
25
|
+
}
|
|
26
|
+
const migrated = await collection.findOne({ _id: stored._id });
|
|
27
|
+
if (!migrated)
|
|
28
|
+
throw new Error('Authswitch authority metadata disappeared during migration.');
|
|
29
|
+
assertStoredAuthorityMeta(Object.fromEntries(Object.entries(migrated)
|
|
30
|
+
.filter(([key]) => !reserved.has(key))));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDAwMV9hdXRob3JpdHlfbWV0YS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL3RzX21pZ3JhdGlvbi8wMDAxX2F1dGhvcml0eV9tZXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSx5QkFBeUIsRUFBRS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0FBQyxZQUFZLEtBQUssQ0FBQyxJQUFJLE1BQU0sQ0FBQyxhQUFhLEtBQUssQ0FBQyxFQUFFLENBQUM7UUFDNUQsTUFBTSxJQUFJLEtBQUssQ0FBQyxzRUFBc0UsQ0FBQyxDQUFDO0lBQzFGLENBQUM7SUFDRCxNQUFNLFFBQVEsR0FBRyxNQUFNLFVBQVUsQ0FBQyxPQUFPLENBQUMsRUFBRSxHQUFHLEVBQUUsTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDLENBQUM7SUFDL0QsSUFBSSxDQUFDLFFBQVE7UUFBRSxNQUFNLElBQUksS0FBSyxDQUFDLDZEQUE2RCxDQUFDLENBQUM7SUFDOUYseUJBQXlCLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQztTQUNsRSxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDN0MsQ0FBQyxDQUFDIn0=
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { migrateAuthorityMetaV1 } from './0001_authority_meta.js';
|
|
2
|
+
/** The persisted metadata schema version records completion. Order is fixed for later migrations. */
|
|
3
|
+
export const runAuthorityMigrations = async (db) => {
|
|
4
|
+
await migrateAuthorityMetaV1(db);
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy90c19taWdyYXRpb24vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFFbEUscUdBQXFHO0FBQ3JHLE1BQU0sQ0FBQyxNQUFNLHNCQUFzQixHQUFHLEtBQUssRUFBRSxFQUFlLEVBQWlCLEVBQUU7SUFDN0UsTUFBTSxzQkFBc0IsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUNuQyxDQUFDLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modelprofile.com/authswitch",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Manage Codex, OpenCode and Claude Code accounts with guided switching and live usage status",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"./authority-client": {
|
|
22
22
|
"types": "./dist_ts/classes.authorityclient.d.ts",
|
|
23
23
|
"import": "./dist_ts/classes.authorityclient.js"
|
|
24
|
+
},
|
|
25
|
+
"./authority-daemon": {
|
|
26
|
+
"types": "./dist_ts/classes.authoritydaemon.d.ts",
|
|
27
|
+
"import": "./dist_ts/classes.authoritydaemon.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"type": "module",
|
|
@@ -45,14 +49,20 @@
|
|
|
45
49
|
"@git.zone/tsrun": "^2.0.6",
|
|
46
50
|
"@git.zone/tstest": "^6.1.1",
|
|
47
51
|
"@types/node": "26.5.1",
|
|
48
|
-
"
|
|
52
|
+
"@types/ws": "8.18.1",
|
|
53
|
+
"esbuild": "^0.28.2",
|
|
54
|
+
"ws": "8.21.2"
|
|
49
55
|
},
|
|
50
56
|
"dependencies": {
|
|
51
57
|
"@api.global/typedrequest": "8.1.0",
|
|
52
58
|
"@api.global/typedrequest-interfaces": "7.1.0",
|
|
59
|
+
"@aws-sdk/client-s3": "3.1131.0",
|
|
60
|
+
"@lossless.org/client": "1.2.0",
|
|
53
61
|
"@modelprofile.com/flexharness-models": "^8.0.0",
|
|
54
62
|
"@modelprofile.com/flexharness-providers": "^8.0.0",
|
|
63
|
+
"@modelprofile.com/mcp-crossharness": "5.4.0",
|
|
55
64
|
"@push.rocks/smartconsole": "^1.3.0",
|
|
65
|
+
"@push.rocks/smartcrypto": "2.2.0",
|
|
56
66
|
"@push.rocks/smartdaemon": "2.7.0",
|
|
57
67
|
"@push.rocks/smartdata": "11.14.2",
|
|
58
68
|
"@push.rocks/smartdb": "7.0.1",
|
package/readme.md
CHANGED
|
@@ -28,26 +28,190 @@ Node.js 24 or newer is required.
|
|
|
28
28
|
|
|
29
29
|
The package also exports a typed client for a per-user authswitch authority daemon. Its
|
|
30
30
|
SmartData registry stores account identity separately from sealed refresh grants, runtime
|
|
31
|
-
bindings, Codex enrollment records, and native-handoff and migration journals. A daemon
|
|
31
|
+
bindings, durable device-operation receipts, Codex enrollment records, and native-handoff and migration journals. A daemon
|
|
32
32
|
owns OpenAI device login, targeted reauthentication, and proactive refresh for grants
|
|
33
|
-
added through this API. Management snapshots
|
|
33
|
+
added through this API. Management snapshots expose separate account and login rows,
|
|
34
|
+
including each login's purpose, owner, health, problem and available actions; neither
|
|
35
|
+
snapshots nor events contain credentials.
|
|
34
36
|
|
|
35
37
|
```ts
|
|
38
|
+
import { randomUUID } from 'node:crypto';
|
|
36
39
|
import { AuthSwitchClient } from '@modelprofile.com/authswitch/authority-client';
|
|
37
40
|
import { resolveAuthSwitchAuthorityPaths } from '@modelprofile.com/authswitch';
|
|
38
41
|
|
|
39
42
|
const paths = resolveAuthSwitchAuthorityPaths();
|
|
40
43
|
const client = new AuthSwitchClient(paths.authoritySocketPath, paths.runtimeSocketPath);
|
|
41
44
|
const snapshot = await client.snapshotAll();
|
|
42
|
-
const
|
|
45
|
+
const operationId = randomUUID();
|
|
46
|
+
const operation = await client.beginAddOpenAi(operationId);
|
|
47
|
+
// Keep operation.id to discover its final result after navigation or reconnect.
|
|
48
|
+
const receipt = await client.getOperation(operation.id);
|
|
43
49
|
```
|
|
44
50
|
|
|
45
51
|
Browser code can import the credential-free DTOs from
|
|
46
52
|
`@modelprofile.com/authswitch/authority-contract`. A backend binds an account to a
|
|
47
|
-
runtime incarnation
|
|
53
|
+
runtime incarnation by exact account ID, login ID and purpose, and keeps the returned
|
|
54
|
+
capability private. Targeted reauthentication likewise requires the exact login; an
|
|
55
|
+
account's presentation default never selects a grant for either action. Completed and
|
|
56
|
+
interrupted operations remain discoverable through `getOperation()` and paged
|
|
57
|
+
`listOperations()`. A completed receipt and its account/grant change commit together, so
|
|
58
|
+
the receipt resolves a lost response or an event that arrives first. Add and reauthentication
|
|
59
|
+
callers supply one UUID for the logical start and reuse it after a lost response. Replaying that
|
|
60
|
+
UUID returns the same matching receipt without starting another provider login; using it for a
|
|
61
|
+
different target is rejected. Cancelling a durable `starting` receipt prevents a late provider
|
|
62
|
+
handle from promoting or overwriting it. Aborting a client request only detaches that request and
|
|
63
|
+
does not cancel the daemon-owned login. The runtime-only socket
|
|
48
64
|
resolves that binding to a current access token; its directory can be mounted into a
|
|
49
|
-
container without exposing the management socket.
|
|
50
|
-
|
|
65
|
+
container without exposing the management socket. A provider that rejects a specific
|
|
66
|
+
access-token generation can request a newer one through `rejectedGrantGeneration`; the
|
|
67
|
+
authority coalesces concurrent rejection callbacks and never replays an uncertain refresh.
|
|
68
|
+
After an external Flex or OpenCode runtime has fenced new work and drained its pending access
|
|
69
|
+
resolutions and provider requests, it can release its exact binding capability through the
|
|
70
|
+
runtime socket. Every bind receives a fresh random capability, so a stale release cannot fence
|
|
71
|
+
or delete a successor even if the caller reused an incarnation label. Release waits for admitted
|
|
72
|
+
server-side resolution handlers, but handler completion does not prove response delivery and
|
|
73
|
+
cannot retract an access token already received or in use; the runtime owner therefore owns that
|
|
74
|
+
drain. Generic release cannot revoke a managed Codex binding, whose daemon-owned stop still closes
|
|
75
|
+
the runtime and clears its durable run before internal revocation. Binding release never transfers
|
|
76
|
+
or changes ownership of the account grant. External-binding recovery after an owner crash remains
|
|
77
|
+
a prerequisite for the full account-mutation cutover.
|
|
78
|
+
|
|
79
|
+
`AuthSwitchClient.subscribe(onSnapshot, onEvent, signal, { onStatus })` reports `current`
|
|
80
|
+
after a fresh snapshot or verified heartbeat, `unavailable` on disconnect or resync, and
|
|
81
|
+
`closed` on abort. Keep cached account actions disabled while status is not `current`.
|
|
82
|
+
Every change-event batch supplies a fresh snapshot before `onEvent`, so a consumer does
|
|
83
|
+
not need to reconstruct account state from events. `lastVerifiedAt` records the last
|
|
84
|
+
successful daemon response, including an empty heartbeat.
|
|
85
|
+
|
|
86
|
+
`AuthSwitchClient.doctorPage()` reads credential-free diagnostic evidence without unsealing
|
|
87
|
+
a grant, refreshing a token or contacting a provider. Each bounded page separately stamps
|
|
88
|
+
the database observation, daemon state and managed-Codex process observation. Stored account
|
|
89
|
+
and login rows explicitly report `liveCheck: not_checked`; a ready daemon therefore does not
|
|
90
|
+
claim that a stored grant or provider is healthy. Native homes and journals omit paths,
|
|
91
|
+
digests and sealed values, while managed Codex reports durable, in-memory and observed-process
|
|
92
|
+
state independently with fixed problem categories. Continue each independent cursor to inspect
|
|
93
|
+
the complete inventory. Pages are later observations rather than one atomic global snapshot,
|
|
94
|
+
and the authority metadata revision is not a change clock for every native-home record. If the
|
|
95
|
+
management socket is unavailable, an offline caller must leave database and admission state
|
|
96
|
+
unknown instead of starting the database to inspect it.
|
|
97
|
+
|
|
98
|
+
The authority CLI uses that daemon surface without constructing the legacy native harness adapters:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
authswitch account list [--json]
|
|
102
|
+
authswitch account add openai [--json]
|
|
103
|
+
authswitch account reauth <account-id> <login-id> [--json]
|
|
104
|
+
authswitch account operation get <operation-id> [--json]
|
|
105
|
+
authswitch account operation cancel <operation-id> [--json]
|
|
106
|
+
authswitch account operation resume <operation-id> [--json]
|
|
107
|
+
authswitch account preuse <account-id> <login-id> [--prompt <text>] [--model <id>] [--json]
|
|
108
|
+
authswitch account preuse --all [--prompt <text>] [--model <id>] [--json]
|
|
109
|
+
authswitch account preuse operation get <operation-id> [--json]
|
|
110
|
+
authswitch account preuse operation cancel <operation-id> [--json]
|
|
111
|
+
authswitch account preuse operation resume <operation-id> [--json]
|
|
112
|
+
authswitch authority doctor [--json]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`account list --json` prints the complete, consistent credential-free authority snapshot.
|
|
116
|
+
Its human form labels login health as stored state and does not imply a live provider check.
|
|
117
|
+
`account add openai` starts one standalone OpenAI device login. `account reauth` starts one
|
|
118
|
+
device login for the exact account and managed login IDs; it never chooses a presentation
|
|
119
|
+
default. Both commands print the durable operation ID, verification URL, user code and changed
|
|
120
|
+
receipts until completion. `account operation resume` polls only the supplied durable ID, while
|
|
121
|
+
`get` performs one read and `cancel` performs one explicit cancellation. Ctrl-C or the local
|
|
122
|
+
15-minute deadline detaches the CLI and leaves the daemon-owned operation running. If a start
|
|
123
|
+
response is lost, the fixed diagnostic reports the caller-generated operation ID and exact resume
|
|
124
|
+
command; the CLI does not replay the start request.
|
|
125
|
+
|
|
126
|
+
`account preuse` sends one quota-consuming prompt through the exact managed OpenAI account and
|
|
127
|
+
login IDs. The default prompt is `Write 2000 words about strawberries.`; `--prompt` replaces it
|
|
128
|
+
and `--model` requests one exact model. `--all` freezes one consistent authority snapshot, walks
|
|
129
|
+
its canonical daemon-owned OpenAI managed logins in snapshot order, and starts one fresh durable
|
|
130
|
+
operation per login whose stored `canPreuse` capability is true. It does not infer readiness from
|
|
131
|
+
plan, usage, token expiry or binding capability. A login whose snapshot capability is false is
|
|
132
|
+
reported as skipped with the snapshot revision, login revision, stored health, problem and
|
|
133
|
+
observation time; no request or operation ID is created for that skip.
|
|
134
|
+
|
|
135
|
+
Preuse operations run sequentially and are never retried automatically. Every terminal receipt
|
|
136
|
+
advances an `--all` run, including `not_sent` and `outcome_unknown`, while any attempted operation
|
|
137
|
+
that does not complete makes the final exit status nonzero. Snapshot-ineligible skips alone do not
|
|
138
|
+
make an otherwise successful batch fail. Running `--all` again is a new quota-consuming run with
|
|
139
|
+
new operation IDs. Use `account preuse operation resume` to continue observing an existing receipt.
|
|
140
|
+
Only the explicit `cancel` command asks the daemon to cancel one.
|
|
141
|
+
|
|
142
|
+
For `account add`, `account reauth` and `account operation resume`, `--json` writes JSON Lines:
|
|
143
|
+
each line is one complete operation receipt, and unchanged revisions are omitted. `account
|
|
144
|
+
operation get --json` and `account operation cancel --json` each write one JSON object followed by
|
|
145
|
+
a newline. Human output includes the resume command on every unfinished receipt. These device
|
|
146
|
+
commands do not switch the active native login.
|
|
147
|
+
|
|
148
|
+
For one preuse start or resume, `--json` likewise writes each complete changed receipt as one raw
|
|
149
|
+
JSON Line; preuse get and cancel write one raw JSON object. A preuse `--all --json` stream tags each
|
|
150
|
+
line as `operation` or `skipped`. Operation lines contain the complete durable receipt. Skip lines
|
|
151
|
+
contain the exact account and login IDs plus the stored snapshot evidence described above. A lost
|
|
152
|
+
start response, transport or output failure, Ctrl-C, or the local 15-minute observation deadline
|
|
153
|
+
stops the batch before another login starts and reports the current operation ID and resume command.
|
|
154
|
+
It detaches without replaying or implicitly cancelling the daemon operation.
|
|
155
|
+
|
|
156
|
+
`authority doctor --json` incrementally writes one JSON document. Its `pages` array contains
|
|
157
|
+
every independently stamped bounded page; `observationSpan` is written only after all cursors
|
|
158
|
+
complete, and `globallyAtomic` is false. A failure during paging returns nonzero and leaves the
|
|
159
|
+
document incomplete rather than presenting partial evidence as a successful observation span.
|
|
160
|
+
The doctor command imposes no inventory cap. Account listing and doctor do not contact a provider,
|
|
161
|
+
unseal a grant, mutate authority state, start the service, open the database offline or fall back
|
|
162
|
+
to a legacy credential store.
|
|
163
|
+
If the daemon is unavailable before the first response, it fails with a fixed diagnostic on
|
|
164
|
+
stderr and leaves stdout empty. The older native-store commands documented below still coexist until the coordinated
|
|
165
|
+
major-version migration and removal; these authority routes never use them.
|
|
166
|
+
|
|
167
|
+
`AuthSwitchClient.getUsage(accountId, loginId)` reads OpenAI managed limits or a Claude
|
|
168
|
+
host login's profile and usage through the management socket. The tagged, credential-free
|
|
169
|
+
reading preserves Claude's labelled five-hour, weekly and model windows, plan provenance,
|
|
170
|
+
extra usage facts and explicit partial availability. Missing values never become zero.
|
|
171
|
+
The daemon caches one result in SmartData for a bounded current and stale period; a new
|
|
172
|
+
reading emits one account event without changing the account row revision. Concurrent
|
|
173
|
+
reads and rejected-token refresh share the existing provider and authority owners; usage
|
|
174
|
+
adds no polling timer. Native Claude reads hold the qualified vendor-home lease through
|
|
175
|
+
both status requests and publication, and revalidate the exact credential and config
|
|
176
|
+
source even when serving a cached result. Native grants are never refreshed by the daemon.
|
|
177
|
+
Pending, quarantined, setup-token-without-profile-scope and other unsupported contexts
|
|
178
|
+
return explicit unavailable status without a provider request. Production native home
|
|
179
|
+
adoption still requires the separate verified migration and backup cutover.
|
|
180
|
+
|
|
181
|
+
`AuthSwitchClient.startPreuse()` accepts one client-generated operation UUID and one exact
|
|
182
|
+
OpenAI account/login/purpose. The daemon resolves an access-only grant, optionally reads the
|
|
183
|
+
model catalog, then commits `request_may_have_started` immediately before FlexHarness sends one
|
|
184
|
+
inference with retries disabled. Reusing the UUID with the same request returns its durable receipt; changing
|
|
185
|
+
the target, prompt or requested model is rejected. A crash, cancellation or shutdown after the
|
|
186
|
+
marker remains `outcome_unknown` and is never replayed. Before-marker refusals are `not_sent`.
|
|
187
|
+
Only the request hash, selected model, timing and safe token counts are stored; the prompt,
|
|
188
|
+
generated prose and credentials are absent from persistence and management responses. Account
|
|
189
|
+
removal and targeted reauthentication refuse while that account has an active preuse request.
|
|
190
|
+
Historical restore marks every unresolved preuse receipt `outcome_unknown`, including snapshots
|
|
191
|
+
captured before the marker, because the original authority may have sent after snapshot capture.
|
|
192
|
+
|
|
193
|
+
A trusted in-process daemon host can call `AuthSwitchAuthorityDaemon.startManagedCodex()`
|
|
194
|
+
for a bound account and workspace. It owns a private Codex 0.155.1 app-server, passes only
|
|
195
|
+
the authority's current access token through Codex's external-token login, answers its
|
|
196
|
+
unauthorized callback through the authority, and revokes the binding on stop. The returned
|
|
197
|
+
runtime exposes an interactive `codex --remote unix://…` launch descriptor and native
|
|
198
|
+
`thread/start`, `thread/resume` and `turn/start` methods for noninteractive consumers.
|
|
199
|
+
Callers supply a private, durable `codexHomeDirectory` for Codex's own configuration and
|
|
200
|
+
conversation state. SmartData binds that home immutably to one account and scope, and the
|
|
201
|
+
daemon records its active process/socket identity before launching it. Admission refuses
|
|
202
|
+
an existing nonempty native home or a surviving app-server owner; a fresh empty home is
|
|
203
|
+
created on first use. Account removal and reauthentication refuse while an in-memory or
|
|
204
|
+
durably recorded managed Codex process for that account may still be running, including
|
|
205
|
+
after daemon restart. A recorded run is cleared only when its exact process is proven
|
|
206
|
+
gone; an uncertain launch remains blocked. Callers must explicitly stop owned processes
|
|
207
|
+
after their work finishes. Once reauthentication starts, it holds new admissions until the
|
|
208
|
+
device operation settles. Only the private socket directory is removed on close. Codex's
|
|
209
|
+
credential store remains ephemeral and does not read or write `auth.json` in that home.
|
|
210
|
+
Managed-Codex process ownership observation is qualified on Linux and reads exact argument
|
|
211
|
+
boundaries from `/proc`; on other hosts doctor reports the process observation as unknown,
|
|
212
|
+
and authority actions that require survivor proof refuse instead of guessing.
|
|
213
|
+
Codex 0.155.1 does not persist an unused thread created by `thread/start`; resume applies
|
|
214
|
+
after Codex has committed a rollout. The existing CLI has not yet been moved to this path.
|
|
51
215
|
|
|
52
216
|
This SDK is additive at this stage. The commands documented below still use the existing
|
|
53
217
|
credential stores. The authority daemon does not import those stores automatically,
|
|
@@ -58,6 +222,32 @@ remain vendor-owned; a container setup-token grant is a separate grant under the
|
|
|
58
222
|
account. The one-time migration and deletion of authswitch's old stores are separate
|
|
59
223
|
cutover steps.
|
|
60
224
|
|
|
225
|
+
The backend-only Claude native handoff journals an exact two-file write and transfers
|
|
226
|
+
ownership between two account grants in one SmartData transaction. An inactive Claude
|
|
227
|
+
grant is refreshed by the daemon only after a durable pre-send marker; pending, native,
|
|
228
|
+
and quarantined grants cannot enter that exchange. A native home and incoming grant
|
|
229
|
+
require source-mapped migration receipts with backup metadata. The ledger field does
|
|
230
|
+
not itself verify a SmartBucket backup, so the default daemon does not configure a
|
|
231
|
+
Claude native home or run this path against real credentials. One-time migration and
|
|
232
|
+
backup verification must precede production activation. Handoff receipts are queryable
|
|
233
|
+
after a lost response. `runningEffectiveAuth: unsupported_effective_auth` means the
|
|
234
|
+
native store changed, while an already-running Claude process's effective login cannot
|
|
235
|
+
be proven externally; qualified live native-store switching still works.
|
|
236
|
+
|
|
237
|
+
The authority database uses one versioned collection registry for startup preparation,
|
|
238
|
+
ordered backup capture and exact restore readback. Startup rejects unknown collections,
|
|
239
|
+
unknown metadata schemas and an incomplete restored database. Published 6.4/6.5 metadata
|
|
240
|
+
is upgraded in place while account IDs, sealed grants, enrollments and uncertain states
|
|
241
|
+
remain intact. A restored database keeps a durable closed-admission marker across restart;
|
|
242
|
+
the daemon refuses provider and runtime work until a separate ownership-reconciliation
|
|
243
|
+
step can prove it safe to open. Backup capture pins its paged records in one SmartData
|
|
244
|
+
transaction and stages each retry anew before any SmartBucket publication. The closed
|
|
245
|
+
restore rehearsal runs in a separate package-owned child, keeps its temporary source and
|
|
246
|
+
record stream encrypted, restores metadata closed before any other record, then stops and
|
|
247
|
+
reopens the same disposable database for exact stored readback. A receipt is issued only
|
|
248
|
+
after the child has closed and its temporary root has been removed. This rehearsal does
|
|
249
|
+
not perform a production restore or authorize a new authority instance to take ownership.
|
|
250
|
+
|
|
61
251
|
## Usage
|
|
62
252
|
|
|
63
253
|
Run `authswitch`, `authswitch -i`, or `authswitch --interactive` for an interactive guide. Use the arrow keys and
|
|
@@ -950,7 +1140,7 @@ arguments to these commands exit with 2.
|
|
|
950
1140
|
|
|
951
1141
|
`limits --json` emits `IAccountLimits` and `active --json` emits `IActiveAccounts`:
|
|
952
1142
|
the same rows as the tables, plus the machine-readable fields the tables condense —
|
|
953
|
-
`accountId`, `slotId`, `accountType` (`{ plan, source }` with the adapter's plan
|
|
1143
|
+
`accountId`, `providerAccountId`, `slotId`, `accountType` (`{ plan, source }` with the adapter's plan
|
|
954
1144
|
name, such as `max` or `pro`, sanitised but not display-formatted, and `source` `live`
|
|
955
1145
|
or `stored`; null when no type is known or the row names no account; both documents
|
|
956
1146
|
carry it), the limits rows' `billing` (the account's reported `hasActiveSubscription`,
|
|
@@ -961,18 +1151,20 @@ it gave none) and `headline` (true for the window the provider picks for a
|
|
|
961
1151
|
single-value summary), the ISO `savedAt` beside the human `savedAgo`, the per-row
|
|
962
1152
|
`unavailableReason` that the footnotes summarise, and `drift`, which carries the
|
|
963
1153
|
expected and current account ids, their labels, whether the current one is saved,
|
|
964
|
-
the ISO `switchedAt` of the switch that was undone, and the same sentence as `reason`.
|
|
1154
|
+
the ISO `switchedAt` of the switch that was undone, and the same sentence as `reason`. `accountId` remains the opaque
|
|
1155
|
+
authswitch identifier used for harness operations; `providerAccountId` is the exact provider-native identifier, or null
|
|
1156
|
+
when the credential reports none. Both documents carry `schemaVersion: 2`, the
|
|
965
1157
|
shared `generatedAt` snapshot every countdown is relative to, and `complete`, which
|
|
966
1158
|
is false when any account or harness could not be read.
|
|
967
1159
|
|
|
968
1160
|
The exported `IAccountList` contract contains:
|
|
969
1161
|
|
|
970
|
-
- `schemaVersion:
|
|
1162
|
+
- `schemaVersion: 3`, `generatedAt` (ISO UTC), and `complete`.
|
|
971
1163
|
- `harnesses[]`: `id`, `label`, `loginHint`, `saveUnavailableReason`, `accounts`,
|
|
972
1164
|
`credentialDrift` (slots whose file no longer holds the account the last switch
|
|
973
1165
|
wrote), and harness-level `problems` (distinguishing failed discovery from an
|
|
974
1166
|
empty list).
|
|
975
|
-
- Each account's opaque `id`, `label`, `isActive`, verified `isStashed`, `savedAt`,
|
|
1167
|
+
- Each account's opaque `id`, exact provider-native `providerAccountId` (or null), `label`, `isActive`, verified `isStashed`, `savedAt`,
|
|
976
1168
|
`details`, and `status` containing all labelled `facts`, `problems`, and optional
|
|
977
1169
|
typed `summary` fields. Missing fields remain omitted, not replaced by zero;
|
|
978
1170
|
`summary.usageWindows[]` carries `severity` and `headline` only when the provider
|
|
@@ -984,9 +1176,9 @@ harness internals. A partial result still produces valid JSON and exits with 1;
|
|
|
984
1176
|
successful and empty results exit with 0. `complete` describes lookup success,
|
|
985
1177
|
not whether the provider exposes every possible metric.
|
|
986
1178
|
|
|
987
|
-
Version
|
|
988
|
-
optional account `slotId` fields. Consumers
|
|
989
|
-
accept schema version
|
|
1179
|
+
Version 3 adds `providerAccountId` without changing the opaque `id` used by mutation commands. Version 2 allowed
|
|
1180
|
+
`usageWindows[].resetAt` to be null and added optional account `slotId` fields. Consumers must
|
|
1181
|
+
accept schema version 3, preserve the two identifiers' distinct meanings and handle null provider IDs and reset timestamps. Scripts should qualify
|
|
990
1182
|
mutation commands with `codex`, `opencode` or `claude`, since all three now register
|
|
991
1183
|
by default. Saved Codex credentials retain their existing format.
|
|
992
1184
|
|