@cortexkit/opencode-openai-auth 1.0.5 → 1.2.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 (104) hide show
  1. package/dist/bin.js +9 -8
  2. package/dist/{pool-lifecycle-C_6YRmsh.d.ts → codex-request-CjXETpTA.d.ts} +190 -27
  3. package/dist/index-03em8hv1.js +69 -0
  4. package/dist/index-6n4pnfkg.js +2 -0
  5. package/dist/{index-pg305s90.js → index-bc89akak.js} +1 -1
  6. package/dist/{index-y4gxyxqd.js → index-ehjj89rx.js} +2 -2
  7. package/dist/index-f21addzm.js +90 -0
  8. package/dist/{index-fsky1rsh.js → index-ffg0sgg5.js} +2 -2
  9. package/dist/{index-nx2qh047.js → index-ftkhhr6d.js} +1 -1
  10. package/dist/{index-826s1yxa.js → index-htvcmtcx.js} +2 -2
  11. package/dist/{index-fsxbncpw.js → index-qp5hdpw8.js} +1 -1
  12. package/dist/index-qxbchh2d.js +8 -0
  13. package/dist/{index-116q849r.js → index-r2s51ac1.js} +2 -2
  14. package/dist/index-rwbrhkse.js +65 -0
  15. package/dist/{index-66asrje2.js → index-xwvze96g.js} +1 -1
  16. package/dist/index.d.ts +18 -8
  17. package/dist/index.js +1 -1
  18. package/dist/{protocol-DctqemRI.d.ts → model-CQcw10oW.d.ts} +67 -25
  19. package/dist/{port-file-ZPlxXB4G.d.ts → port-file-BDJnzgHH.d.ts} +1 -1
  20. package/dist/protocol-C-kagE6O.d.ts +29 -0
  21. package/dist/rpc/port-file.d.ts +1 -1
  22. package/dist/rpc/port-file.js +1 -1
  23. package/dist/rpc/protocol.d.ts +1 -1
  24. package/dist/rpc/protocol.js +1 -1
  25. package/dist/rpc/rpc-client.d.ts +3 -3
  26. package/dist/rpc/rpc-client.js +1 -1
  27. package/dist/rpc/rpc-dir.js +1 -1
  28. package/dist/{sidebar-state-z_M7Trnd.d.ts → sidebar-state-BfQ4mpZO.d.ts} +109 -10
  29. package/dist/sidebar-state.d.ts +2 -2
  30. package/dist/sidebar-state.js +1 -1
  31. package/dist/token-util-cf0nyh7n.js +1 -0
  32. package/dist/{token-bzhkgc29.js → token-z6qq7a1d.js} +1 -1
  33. package/dist/tui-preferences.js +1 -1
  34. package/dist/tui.d.ts +20 -2
  35. package/dist/v2/server.d.ts +180 -1
  36. package/dist/v2/server.js +3 -3
  37. package/package.json +3 -3
  38. package/src/tui-compiled/raw/shared/0332701351b3eeec-format.js +148 -26
  39. package/src/tui-compiled/raw/shared/0f77ebc3c914c9c6-custody.js +371 -0
  40. package/src/tui-compiled/raw/shared/134b008900698fe0-backoff.js +92 -0
  41. package/src/tui-compiled/raw/shared/169b2b4bf30909bc-consumer.js +430 -0
  42. package/src/tui-compiled/raw/shared/2577ec69f9973ae9-quota-normalize.js +154 -0
  43. package/src/tui-compiled/raw/shared/2dce6e9613993329-quota-manager.js +473 -0
  44. package/src/tui-compiled/raw/shared/30f5bc480f31f51c-roster.js +566 -0
  45. package/src/tui-compiled/raw/shared/43fc9e6b994519c7-refresh-lock.js +0 -1
  46. package/src/tui-compiled/raw/shared/4593a4d71edf69fd-tombstone.js +25 -0
  47. package/src/tui-compiled/raw/shared/4d05c2d7a531aece-oauth.js +500 -0
  48. package/src/tui-compiled/raw/shared/6371b24a0573d79e-any-signal.js +42 -0
  49. package/src/tui-compiled/raw/shared/7c140680fc81be92-interlock.js +29 -0
  50. package/src/tui-compiled/raw/shared/85512cc5263ba259-provider.js +87 -0
  51. package/src/tui-compiled/raw/shared/abd062d633e29fd2-pool-routing.js +192 -0
  52. package/src/tui-compiled/raw/shared/b9588ad4725c1d10-enrollment.js +806 -0
  53. package/src/tui-compiled/raw/shared/bfbdd0f9aae56b47-pool-quota.js +85 -0
  54. package/src/tui-compiled/raw/shared/c852a15cfe489d12-pool.js +0 -1
  55. package/src/tui-compiled/raw/shared/ca0fccaba1d87af4-errors.js +8 -0
  56. package/src/tui-compiled/raw/shared/d0f0b6be200311af-insula.js +152 -0
  57. package/src/tui-compiled/raw/shared/d5a8f1061ee2f114-index.js +1 -1
  58. package/src/tui-compiled/raw/shared/d9d2892a4c371301-host-slot.js +72 -0
  59. package/src/tui-compiled/raw/shared/dbc61cd405941828-accounts.js +1470 -0
  60. package/src/tui-compiled/raw/shared/e8cd4929507508d8-refresh-file-lock.js +26 -12
  61. package/src/tui-compiled/raw/shared/e8d3c8da776ef9cd-index.js +24 -0
  62. package/src/tui-compiled/raw/sidebar-state.js +103 -14
  63. package/src/tui-compiled/raw/tui/command-dialogs.tsx +3 -34
  64. package/src/tui-compiled/raw/tui/section-text.js +21 -0
  65. package/src/tui-compiled/raw/tui/v2-dialog.js +137 -0
  66. package/src/tui-compiled/raw/tui/v2.tsx +133 -0
  67. package/src/tui-compiled/raw/tui.tsx +228 -70
  68. package/src/tui-compiled/runtime/shared/0332701351b3eeec-format.js +148 -26
  69. package/src/tui-compiled/runtime/shared/0f77ebc3c914c9c6-custody.js +371 -0
  70. package/src/tui-compiled/runtime/shared/134b008900698fe0-backoff.js +92 -0
  71. package/src/tui-compiled/runtime/shared/169b2b4bf30909bc-consumer.js +430 -0
  72. package/src/tui-compiled/runtime/shared/2577ec69f9973ae9-quota-normalize.js +154 -0
  73. package/src/tui-compiled/runtime/shared/2dce6e9613993329-quota-manager.js +473 -0
  74. package/src/tui-compiled/runtime/shared/30f5bc480f31f51c-roster.js +566 -0
  75. package/src/tui-compiled/runtime/shared/43fc9e6b994519c7-refresh-lock.js +0 -1
  76. package/src/tui-compiled/runtime/shared/4593a4d71edf69fd-tombstone.js +25 -0
  77. package/src/tui-compiled/runtime/shared/4d05c2d7a531aece-oauth.js +500 -0
  78. package/src/tui-compiled/runtime/shared/6371b24a0573d79e-any-signal.js +42 -0
  79. package/src/tui-compiled/runtime/shared/7c140680fc81be92-interlock.js +29 -0
  80. package/src/tui-compiled/runtime/shared/85512cc5263ba259-provider.js +87 -0
  81. package/src/tui-compiled/runtime/shared/abd062d633e29fd2-pool-routing.js +192 -0
  82. package/src/tui-compiled/runtime/shared/b9588ad4725c1d10-enrollment.js +806 -0
  83. package/src/tui-compiled/runtime/shared/bfbdd0f9aae56b47-pool-quota.js +85 -0
  84. package/src/tui-compiled/runtime/shared/c852a15cfe489d12-pool.js +0 -1
  85. package/src/tui-compiled/runtime/shared/ca0fccaba1d87af4-errors.js +8 -0
  86. package/src/tui-compiled/runtime/shared/d0f0b6be200311af-insula.js +152 -0
  87. package/src/tui-compiled/runtime/shared/d5a8f1061ee2f114-index.js +1 -1
  88. package/src/tui-compiled/runtime/shared/d9d2892a4c371301-host-slot.js +72 -0
  89. package/src/tui-compiled/runtime/shared/dbc61cd405941828-accounts.js +1470 -0
  90. package/src/tui-compiled/runtime/shared/e8cd4929507508d8-refresh-file-lock.js +26 -12
  91. package/src/tui-compiled/runtime/shared/e8d3c8da776ef9cd-index.js +24 -0
  92. package/src/tui-compiled/runtime/sidebar-state.js +103 -14
  93. package/src/tui-compiled/runtime/tui/command-dialogs.js +3 -15
  94. package/src/tui-compiled/runtime/tui/section-text.js +21 -0
  95. package/src/tui-compiled/runtime/tui/v2-dialog.js +137 -0
  96. package/src/tui-compiled/runtime/tui/v2.js +95 -0
  97. package/src/tui-compiled/runtime/tui.js +351 -222
  98. package/dist/index-4fnghj9e.js +0 -65
  99. package/dist/index-a69gr76b.js +0 -2
  100. package/dist/index-h263aftt.js +0 -157
  101. package/dist/index-ssj7m2rd.js +0 -8
  102. package/dist/index-ydz3hbhc.js +0 -2
  103. package/dist/map-m6f5a_IA.d.ts +0 -56
  104. package/dist/token-util-4a2xxnpg.js +0 -1
@@ -1,7 +1,8 @@
1
- import { n as QuotaMap } from "./map-m6f5a_IA.js";
1
+ import { a as KnobValues, c as PluginExtraSection, i as CommandInvocation, l as PluginSection, o as MenuKnob, t as CommandApplyRequest } from "./model-CQcw10oW.js";
2
+ import { mt as QuotaMap } from "./sidebar-state-BfQ4mpZO.js";
2
3
  import { ClaustrumClient, EnrollmentPollOutcome } from "@cortexkit/claustrum-client";
3
4
  import "@cortexkit/private-files";
4
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/schema.d.ts
5
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/schema.d.ts
5
6
  type OAuthCredential = {
6
7
  type: 'oauth';
7
8
  access?: string;
@@ -190,7 +191,7 @@ interface PoolRow {
190
191
  unbound?: true;
191
192
  }
192
193
  //#endregion
193
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/errors.d.ts
194
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/errors.d.ts
194
195
  /** Every library operation that can fail, as named in the failure value. */
195
196
  type PoolOperation = 'initialize' | 'add' | 'replace' | 'rotate' | 'disable' | 'enable' | 'remove' | 'reorder' | 'updateSettings' | 'recordIdentity' | 'updateProviderState' | 'refresh' | 'pull' | 'publishRoster';
196
197
  /**
@@ -237,12 +238,12 @@ declare class PoolOperationError extends Error {
237
238
  });
238
239
  }
239
240
  //#endregion
240
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/hooks.d.ts
241
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/hooks.d.ts
241
242
  interface PoolLogger {
242
243
  warn(message: string, data?: unknown): void;
243
244
  }
244
245
  //#endregion
245
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/fs/refresh-file-lock.d.ts
246
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/fs/refresh-file-lock.d.ts
246
247
  interface LockLoss {
247
248
  readonly reason: 'taken-over' | 'expired' | 'unreadable' | 'renewal-failed' | 'marker-lost';
248
249
  readonly expectedOwnerId: string;
@@ -257,7 +258,7 @@ interface RefreshFileLock {
257
258
  whenLost(): Promise<LockLoss>;
258
259
  hasLost(): boolean;
259
260
  }
260
- declare function acquireRefreshFileLock(options: {
261
+ type RefreshFileLockOptions = {
261
262
  name: string;
262
263
  ttlMs: number;
263
264
  /**
@@ -266,7 +267,6 @@ declare function acquireRefreshFileLock(options: {
266
267
  * be one host's path.
267
268
  */
268
269
  path: string;
269
- now?: () => number;
270
270
  renew?: boolean;
271
271
  renewIntervalMs?: number;
272
272
  /** Notifies a live-owner refusal without awaiting; observer failures are ignored. */
@@ -274,9 +274,11 @@ declare function acquireRefreshFileLock(options: {
274
274
  /** Synchronous, never awaited; throws and returned promise/thenable rejections are isolated. */
275
275
  onRenewalTimer?: (event: 'scheduled' | 'cancelled') => void;
276
276
  onStep?: (step: 'stale-marker-stat' | 'stale-marker-claimed' | 'stale-lock-observed' | 'lock-read-ready' | 'lock-missing' | 'stale-lock-confirmed' | 'stale-lock-removed' | 'stale-lock-recreated' | 'eviction-marker-acquired' | 'renewal-owner-confirmed' | 'renewal-marker-unavailable' | 'renewal-write-fenced' | 'renewal-write-ready' | 'renewal-write-finished' | 'relinquish-read' | 'renewal-finished' | 'release-owner-confirmed') => void | Promise<void>;
277
- }): Promise<RefreshFileLock | null>;
277
+ };
278
+ /** Filesystem leases share wall time across all callers and processes. */
279
+ declare function acquireRefreshFileLock(options: RefreshFileLockOptions): Promise<RefreshFileLock | null>;
278
280
  //#endregion
279
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/refresh-lock.d.ts
281
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/refresh-lock.d.ts
280
282
  type LockStep = NonNullable<Parameters<typeof acquireRefreshFileLock>[0]['onStep']> extends ((step: infer S) => unknown) ? S : never;
281
283
  /** Tuning shared by every lock the store takes; each field is overridable. */
282
284
  interface PoolLockOptions {
@@ -297,7 +299,6 @@ type LockEvent = {
297
299
  path: string;
298
300
  };
299
301
  interface LockEnvironment {
300
- now: () => number;
301
302
  onLockEvent?: (event: LockEvent) => void;
302
303
  onLockStep?: (lock: {
303
304
  name: string;
@@ -309,7 +310,7 @@ interface LockEnvironment {
309
310
  }, event: 'scheduled' | 'cancelled') => void;
310
311
  }
311
312
  //#endregion
312
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/mutate.d.ts
313
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/mutate.d.ts
313
314
  /** Named points on the write path, for crash and ownership injection. */
314
315
  type WriteStep = 'before-config-write' | 'after-config-write' | 'before-state-write' | 'after-state-write';
315
316
  /** Awaitable pause points on the pull and refresh paths. */
@@ -344,11 +345,11 @@ interface StoreContext {
344
345
  /** What `initializePool` did. */
345
346
  type InitializeOutcome = 'initialized' | 'already-ready';
346
347
  //#endregion
347
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/runtime.d.ts
348
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/runtime.d.ts
348
349
  /** Where a pull was fired from; `load` fires at most once per process per row. */
349
350
  type PullReason = 'load' | 'add' | 'replace' | 'admission';
350
351
  //#endregion
351
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/attribution.d.ts
352
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/attribution.d.ts
352
353
  /**
353
354
  * What a pull or refresh captured about its row (named by id alongside) when
354
355
  * it was issued. A result applies only while the row with that id still has
@@ -371,7 +372,7 @@ interface Attribution {
371
372
  identity?: string;
372
373
  }
373
374
  //#endregion
374
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/rows.d.ts
375
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/rows.d.ts
375
376
  type FailureHook = (rowId: string, error: PoolOperationError) => void | Promise<void>;
376
377
  interface RowOperationOptions {
377
378
  /** Called once, awaited, on every non-success path, before locks release. */
@@ -587,7 +588,7 @@ interface RowTransitionResult {
587
588
  providerState?: unknown;
588
589
  }
589
590
  //#endregion
590
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/provider-state.d.ts
591
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/provider-state.d.ts
591
592
  /**
592
593
  * Receives a private copy of the row's provider state (undefined when the row
593
594
  * shows none) and the row as loaded under the locks, and returns the next
@@ -623,7 +624,7 @@ declare const DECLINE_TRANSITION: unique symbol;
623
624
  */
624
625
  type RowTransitionMutator = (current: unknown | undefined, row: PoolRow) => unknown | typeof DECLINE_TRANSITION | Promise<unknown | typeof DECLINE_TRANSITION>;
625
626
  //#endregion
626
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/publication.d.ts
627
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/publication.d.ts
627
628
  interface PublishPlan {
628
629
  operationId: string;
629
630
  remove: Array<{
@@ -666,7 +667,7 @@ interface PublishResult {
666
667
  receipt: PublicationReceipt;
667
668
  }
668
669
  //#endregion
669
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/pull.d.ts
670
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/pull.d.ts
670
671
  /** What a pull is issued with: the credential and its attribution tuple. */
671
672
  interface PullRequest {
672
673
  id: string;
@@ -677,7 +678,7 @@ interface PullRequest {
677
678
  }
678
679
  type PullHook = (request: PullRequest) => Promise<unknown>;
679
680
  //#endregion
680
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/refresh.d.ts
681
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/refresh.d.ts
681
682
  /** What the injected provider refresh function returns. */
682
683
  interface ProviderRefreshResult {
683
684
  access: string;
@@ -740,7 +741,7 @@ type RefreshOutcome = {
740
741
  reason: string;
741
742
  };
742
743
  //#endregion
743
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/settings.d.ts
744
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/settings.d.ts
744
745
  /** The plugin's settings: every top-level config key except the pool-owned ones. */
745
746
  type PoolSettings = Record<string, unknown>;
746
747
  type SettingsRead = {
@@ -784,7 +785,7 @@ type UpdateSettingsResult = {
784
785
  outcome: 'updated' | 'unchanged';
785
786
  };
786
787
  //#endregion
787
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/store/pool.d.ts
788
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/store/pool.d.ts
788
789
  interface OpenPoolStoreOptions {
789
790
  /** The provider every row of this pool belongs to; keys the provider-wide lock. */
790
791
  provider: string;
@@ -817,7 +818,7 @@ interface OpenPoolStoreOptions {
817
818
  requireCredentialStamps?: boolean;
818
819
  /** Require an exact secret fingerprint for every roster-publication removal. */
819
820
  requireRemovedFingerprint?: boolean;
820
- /** Injected clock for leases, refresh stamps and `addedAt`. */
821
+ /** Logical clock for refresh stamps and `addedAt`; filesystem leases always use wall time. */
821
822
  now?: () => number;
822
823
  /**
823
824
  * Ordered store-lock list held across every read-modify-write. Defaults to
@@ -970,6 +971,44 @@ interface PoolStore {
970
971
  pullsSettled(): Promise<void>;
971
972
  }
972
973
  //#endregion
974
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/commands/seam.d.ts
975
+ /** Where a dropped field is reported. Names only, never values. */
976
+ interface SeamLogger {
977
+ warn(message: string, data?: unknown): void;
978
+ }
979
+ //#endregion
980
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/commands/builtins.d.ts
981
+ /**
982
+ * What a plugin's login hands back. `ready` adds the account now. `pending`
983
+ * means the user must finish somewhere else (a browser, a device code):
984
+ * `message` tells them how, and the account is added when `completion`
985
+ * settles, with the result sent to the invocation that started it.
986
+ */
987
+ type LoginOutcome = {
988
+ status: 'ready';
989
+ account: AddInput;
990
+ } | {
991
+ status: 'pending';
992
+ message: string;
993
+ /** Resolves with the account to add, or undefined when the user gave up. */
994
+ completion: Promise<AddInput | undefined>;
995
+ } | {
996
+ status: 'cancelled';
997
+ message?: string;
998
+ };
999
+ interface AccountsSectionOptions {
1000
+ /** What to show as an account's identity; defaults to its recorded identity. */
1001
+ describeIdentity?(row: PoolRow): string | undefined;
1002
+ /** The plugin's login; without it the section offers no add action. */
1003
+ login?: {
1004
+ label?: string;
1005
+ knobs?: MenuKnob[];
1006
+ run(values: KnobValues, invocation: CommandInvocation): Promise<LoginOutcome>;
1007
+ };
1008
+ /** Passed to `store.remove`: a reason refuses removing that id. */
1009
+ protect?: RemoveOptions['protect'];
1010
+ }
1011
+ //#endregion
973
1012
  //#region ../core/dist/paths.d.ts
974
1013
  /**
975
1014
  * The config file and the runtime-state file a store operation reads and writes.
@@ -1058,14 +1097,14 @@ interface BeginAccountLoginResult {
1058
1097
  */
1059
1098
  declare function beginAccountLogin(opts: BeginAccountLoginOptions): Promise<BeginAccountLoginResult>;
1060
1099
  //#endregion
1061
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/claustrum/insula.d.ts
1100
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/claustrum/insula.d.ts
1062
1101
  /** Optional transport for custom scoped clients; getUsage must not retry refusals. */
1063
1102
  interface InsulaUsageTransport {
1064
1103
  connectionFile: string;
1065
1104
  getUsage(): Promise<unknown>;
1066
1105
  }
1067
1106
  //#endregion
1068
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/claustrum/custody.d.ts
1107
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/claustrum/custody.d.ts
1069
1108
  type ClaustrumScopedClient = Pick<ClaustrumClient, 'listScoped' | 'getScoped' | 'reportAuthFailureScoped' | 'close'> & {
1070
1109
  insula?: InsulaUsageTransport;
1071
1110
  };
@@ -1085,6 +1124,30 @@ interface SkippedVaultRecord {
1085
1124
  readonly credentialId?: string;
1086
1125
  readonly reason: SkippedVaultReason;
1087
1126
  }
1127
+ /**
1128
+ * One grant this consumer's enrollment holds, as the vault's list reply names
1129
+ * it: for example `{ selectorKind: 'category', selector: 'openai-native',
1130
+ * operation: 'read' }`. `selectorKind` is `exact` (the selector is a credential
1131
+ * id) or `category` (a bare category name); both open strings.
1132
+ */
1133
+ interface VaultGrantTuple {
1134
+ readonly selectorKind: string;
1135
+ readonly selector: string;
1136
+ readonly operation: string;
1137
+ }
1138
+ /**
1139
+ * What this consumer is granted, independent of what those grants currently
1140
+ * reach. It is what tells two empty listings apart: no rows with `grants === 0`
1141
+ * means no grant at all (the fix is `ck auth grant`), while no rows with
1142
+ * `grants > 0` means a grant that reaches no credential, usually logins that
1143
+ * lack the category (`ck auth reclassify --from-registry`); `tuples` names the
1144
+ * selector that matched nothing. Never written to the roster file.
1145
+ */
1146
+ interface VaultGrantReach {
1147
+ /** How many grants the consumer holds, deposit grants excluded. */
1148
+ readonly grants: number;
1149
+ readonly tuples: readonly VaultGrantTuple[];
1150
+ }
1088
1151
  /**
1089
1152
  * Where a receipt's `accountIdentity` came from: the vault asserted it in the
1090
1153
  * served reply, the plugin's `parseIdentity` read it from the served token, or
@@ -1131,7 +1194,7 @@ interface ClaustrumScopedAttempt {
1131
1194
  readonly expiresAtMs: number | null;
1132
1195
  }
1133
1196
  //#endregion
1134
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/claustrum/interlock.d.ts
1197
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/claustrum/interlock.d.ts
1135
1198
  /**
1136
1199
  * The declined-account interlock: the user's "do not use this vault account",
1137
1200
  * kept on the consumer side because the vault has no notion of it.
@@ -1150,7 +1213,7 @@ interface DeclinedAccount {
1150
1213
  readonly accountIdentity?: string;
1151
1214
  }
1152
1215
  //#endregion
1153
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/claustrum/roster.d.ts
1216
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/claustrum/roster.d.ts
1154
1217
  /**
1155
1218
  * One vault account as the pool sees it. It carries no bearer material: the
1156
1219
  * access token is fetched from the vault for every send. Several vault
@@ -1205,7 +1268,7 @@ interface VaultRosterFile {
1205
1268
  */
1206
1269
  type QuotaReceipt = Pick<ClaustrumScopedAttempt, 'credentialId' | 'accountIdentity' | 'accountIdentitySource' | 'expectedAccountIdentity'>;
1207
1270
  //#endregion
1208
- //#region ../../node_modules/.bun/@cortexkit+common-auth@0.17.1+0d2d5e37d881ac14/node_modules/@cortexkit/common-auth/dist/claustrum/enrollment.d.ts
1271
+ //#region ../../node_modules/.bun/@cortexkit+common-auth@0.19.0+eac60b769bf9196b/node_modules/@cortexkit/common-auth/dist/claustrum/enrollment.d.ts
1209
1272
  interface ClaustrumEnrollmentClient {
1210
1273
  enrollPropose(input: {
1211
1274
  name: string;
@@ -1265,6 +1328,8 @@ interface VaultPaths extends ClaustrumEnrollmentPaths {
1265
1328
  /** One vault account as routing sees it. */
1266
1329
  interface VaultRoute {
1267
1330
  id: string;
1331
+ /** The vault credential name, distinct from its stable routing id. */
1332
+ credentialId?: string;
1268
1333
  kind: 'oauth' | 'api-key';
1269
1334
  /** The ChatGPT account it signs in as, when the vault knows it. */
1270
1335
  identity?: string;
@@ -1349,6 +1414,12 @@ declare class OpenAiVault {
1349
1414
  */
1350
1415
  refresh(): Promise<VaultRosterFile | undefined>;
1351
1416
  snapshot(): VaultRosterFile | undefined;
1417
+ /**
1418
+ * What the vault says this host is granted, from the latest list, without
1419
+ * any I/O. Undefined is unknown (a vault that does not report grants, or
1420
+ * nothing listed yet), never zero grants.
1421
+ */
1422
+ grantReach(): VaultGrantReach | undefined;
1352
1423
  /** Whether the vault serves this host any account (whatever its state). */
1353
1424
  serves(): boolean;
1354
1425
  /**
@@ -1455,6 +1526,9 @@ declare class OpenAiVault {
1455
1526
  close(): void;
1456
1527
  }
1457
1528
  //#endregion
1529
+ //#region ../core/dist/vault-account-menu.d.ts
1530
+ type MenuVault = Pick<OpenAiVault, 'authority' | 'refresh' | 'status' | 'identities' | 'routes' | 'pollQuota' | 'snapshot'>;
1531
+ //#endregion
1458
1532
  //#region ../core/dist/commands.d.ts
1459
1533
  /**
1460
1534
  * The prompt-cache manager, as the Cache section uses it.
@@ -1496,6 +1570,15 @@ interface ResetTargetIdentity {
1496
1570
  chatgptAccountId?: string;
1497
1571
  onAuthFailure?: (status: number) => Promise<void>;
1498
1572
  }
1573
+ interface AccountRules {
1574
+ /**
1575
+ * The legacy locks a write of row `id` holds besides the store's own: the
1576
+ * locks an older openai-auth process holds while it refreshes that row.
1577
+ * Taken by remove, enable, disable and replace (and by the replace a
1578
+ * re-login becomes).
1579
+ */
1580
+ rowLocks?(id: string): readonly PoolLockSpec[];
1581
+ }
1499
1582
  /** One live process, on an older version, that keeps the accounts from moving to the account pool. */
1500
1583
  interface MigrationBlocker {
1501
1584
  /** `'unknown'` when the directory of process heartbeats could not be read. */
@@ -1508,6 +1591,53 @@ type MenuMigrationState = {
1508
1591
  migrated: false;
1509
1592
  blockers: readonly MigrationBlocker[];
1510
1593
  };
1594
+ /** A started OAuth login, as `beginAccountLogin` returns it. */
1595
+ interface MenuLoginFlow {
1596
+ url: string;
1597
+ instructions: string;
1598
+ completion: Promise<IngestAccount>;
1599
+ }
1600
+ interface MenuLoginDeps {
1601
+ /** Starts a browser login, or a device-code login when `headless`. */
1602
+ begin(options: {
1603
+ label?: string;
1604
+ headless: boolean;
1605
+ }): Promise<MenuLoginFlow>;
1606
+ /** The main account's ChatGPT identity; a login of that account is refused. */
1607
+ mainIdentity?(): Promise<string | undefined>;
1608
+ }
1609
+ interface OpenAiMenuOptions {
1610
+ store: PoolStore;
1611
+ vault?: MenuVault;
1612
+ /** Display the normal actions, but refuse all applies before running one. */
1613
+ readOnly?: boolean;
1614
+ /** A host capability fence, checked before the shared engine runs an action. */
1615
+ allowAction?: (request: CommandApplyRequest) => boolean;
1616
+ /** Keep unsupported host sections in their normal positions without actions. */
1617
+ unavailableSections?: readonly ('cache' | 'diagnostics' | 'reset')[];
1618
+ /**
1619
+ * The legacy locks the menu's writes that name no single row take (the
1620
+ * roster order, settings, a new account).
1621
+ */
1622
+ extraLocks?: readonly PoolLockSpec[];
1623
+ /** The legacy locks a write of one row takes; see `AccountRules`. */
1624
+ rowLocks?: AccountRules['rowLocks'];
1625
+ /** Whether the install is migrated; absent means it always is (Pi). */
1626
+ migration?(): Promise<MenuMigrationState>;
1627
+ login?: MenuLoginDeps;
1628
+ /** Passed to every removal: refuses row `main` and a pending transfer's row. */
1629
+ protect?: RemoveOptions['protect'];
1630
+ describeIdentity?: AccountsSectionOptions['describeIdentity'];
1631
+ /** The plugin's "check quota now"; without it the store pulls each row. */
1632
+ quotaCheck?(ids: readonly string[], invocation: CommandInvocation): Promise<void>;
1633
+ cache?: PluginSection;
1634
+ diagnostics?: PluginSection;
1635
+ extras?: readonly PluginExtraSection[];
1636
+ /** Runs after every successful apply (the host re-reads its rows). */
1637
+ afterApply?(): unknown;
1638
+ logger?: SeamLogger;
1639
+ now?: () => number;
1640
+ }
1511
1641
  //#endregion
1512
1642
  //#region src/core/version-fence.d.ts
1513
1643
  /** One live process that keeps the fence shut. */
@@ -1566,6 +1696,8 @@ interface LegacyLockOptions {
1566
1696
  interface PoolMigrationDeps {
1567
1697
  paths: AccountPaths;
1568
1698
  slot: HostSlotAdapter;
1699
+ /** Stop waiting for transfer locks; a transfer already holding them finishes. */
1700
+ signal?: AbortSignal;
1569
1701
  now?: () => number;
1570
1702
  sleep?: (ms: number) => Promise<void>;
1571
1703
  /** Id for a new row whose login carries no usable wire identity. */
@@ -1741,4 +1873,35 @@ interface PoolLifecycleDeps {
1741
1873
  paused?: () => boolean | Promise<boolean>;
1742
1874
  }
1743
1875
  //#endregion
1744
- export { ResetTargetIdentity as a, BeginAccountLoginOptions as c, TokenResponse as d, beginAccountLogin as f, PoolStore as g, AccountPaths as h, MenuMigrationState as i, BeginAccountLoginResult as l, parseJwtClaims as m, HostSlotAdapter as n, OpenAiVault as o, extractAccountIdFromClaims as p, CacheKeepManager as r, OpenAiVaultOptions as s, PoolLifecycleDeps as t, IdTokenClaims as u };
1876
+ //#region src/util/canonical-input.d.ts
1877
+ interface CanonicalInput {
1878
+ texts: string[];
1879
+ snapshots: unknown[];
1880
+ retainable: boolean;
1881
+ }
1882
+ //#endregion
1883
+ //#region src/codex-request.d.ts
1884
+ declare const RESPONSES_LITE_MODELS: ReadonlySet<string>;
1885
+ declare const CODEX_VERSION = "0.159.0";
1886
+ declare const CODEX_USER_AGENT = "codex_exec/0.159.0 (Debian 12.0.0; aarch64) unknown (codex_exec; 0.159.0)";
1887
+ interface CodexSessionMetadata {
1888
+ threadID: string;
1889
+ turnID: string;
1890
+ windowID: string;
1891
+ turnStartedAt?: number;
1892
+ input?: unknown[];
1893
+ canonicalInput?: CanonicalInput;
1894
+ /** Keep the opening effort fixed while later changes travel as input items. */
1895
+ pinnedEffort?: string;
1896
+ effortUpdates?: Array<{
1897
+ anchor: number;
1898
+ fingerprint: string;
1899
+ effort: string;
1900
+ }>;
1901
+ }
1902
+ interface CodexRequestRuntime {
1903
+ now: () => number;
1904
+ uuid: () => string;
1905
+ }
1906
+ //#endregion
1907
+ export { PoolStore as S, TokenResponse as _, RESPONSES_LITE_MODELS as a, parseJwtClaims as b, CacheKeepManager as c, ResetTargetIdentity as d, OpenAiVault as f, IdTokenClaims as g, BeginAccountLoginResult as h, CodexSessionMetadata as i, MenuMigrationState as l, BeginAccountLoginOptions as m, CODEX_VERSION as n, PoolLifecycleDeps as o, OpenAiVaultOptions as p, CodexRequestRuntime as r, HostSlotAdapter as s, CODEX_USER_AGENT as t, OpenAiMenuOptions as u, beginAccountLogin as v, AccountPaths as x, extractAccountIdFromClaims as y };