@cortexkit/pi-openai-auth 1.4.0 → 1.5.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/index.d.ts +33 -25
- package/dist/index.js +22 -22
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
|
2
2
|
import "@cortexkit/private-files";
|
|
3
3
|
import { ClaustrumClient, EnrollmentPollOutcome } from "@cortexkit/claustrum-client";
|
|
4
4
|
import { Api, AssistantMessageEventStream, Context, Model, SimpleStreamOptions } from "@earendil-works/pi-ai";
|
|
5
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
5
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/pi-slot/slot.d.ts
|
|
6
6
|
interface PiSlotInspection {
|
|
7
7
|
slot: 'original' | 'placeholder' | 'foreign' | 'empty';
|
|
8
8
|
stash: 'valid' | 'missing';
|
|
@@ -13,7 +13,7 @@ interface PiSlot {
|
|
|
13
13
|
exitVault(): Promise<'restored' | 'conflict' | 'nothing-to-do'>;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
16
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/schema.d.ts
|
|
17
17
|
type OAuthCredential = {
|
|
18
18
|
type: 'oauth';
|
|
19
19
|
access?: string;
|
|
@@ -202,7 +202,7 @@ interface PoolRow {
|
|
|
202
202
|
unbound?: true;
|
|
203
203
|
}
|
|
204
204
|
//#endregion
|
|
205
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
205
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/errors.d.ts
|
|
206
206
|
/** Every library operation that can fail, as named in the failure value. */
|
|
207
207
|
type PoolOperation = 'initialize' | 'add' | 'replace' | 'rotate' | 'disable' | 'enable' | 'remove' | 'reorder' | 'updateSettings' | 'recordIdentity' | 'updateProviderState' | 'refresh' | 'pull' | 'publishRoster';
|
|
208
208
|
/**
|
|
@@ -249,12 +249,12 @@ declare class PoolOperationError extends Error {
|
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
//#endregion
|
|
252
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
252
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/hooks.d.ts
|
|
253
253
|
interface PoolLogger {
|
|
254
254
|
warn(message: string, data?: unknown): void;
|
|
255
255
|
}
|
|
256
256
|
//#endregion
|
|
257
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
257
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/fs/refresh-file-lock.d.ts
|
|
258
258
|
interface LockLoss {
|
|
259
259
|
readonly reason: 'taken-over' | 'expired' | 'unreadable' | 'renewal-failed' | 'marker-lost';
|
|
260
260
|
readonly expectedOwnerId: string;
|
|
@@ -289,7 +289,7 @@ type RefreshFileLockOptions = {
|
|
|
289
289
|
/** Filesystem leases share wall time across all callers and processes. */
|
|
290
290
|
declare function acquireRefreshFileLock(options: RefreshFileLockOptions): Promise<RefreshFileLock | null>;
|
|
291
291
|
//#endregion
|
|
292
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
292
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/refresh-lock.d.ts
|
|
293
293
|
type LockStep = NonNullable<Parameters<typeof acquireRefreshFileLock>[0]['onStep']> extends ((step: infer S) => unknown) ? S : never;
|
|
294
294
|
/** Tuning shared by every lock the store takes; each field is overridable. */
|
|
295
295
|
interface PoolLockOptions {
|
|
@@ -321,7 +321,7 @@ interface LockEnvironment {
|
|
|
321
321
|
}, event: 'scheduled' | 'cancelled') => void;
|
|
322
322
|
}
|
|
323
323
|
//#endregion
|
|
324
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
324
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/mutate.d.ts
|
|
325
325
|
/** Named points on the write path, for crash and ownership injection. */
|
|
326
326
|
type WriteStep = 'before-config-write' | 'after-config-write' | 'before-state-write' | 'after-state-write';
|
|
327
327
|
/** Awaitable pause points on the pull and refresh paths. */
|
|
@@ -356,11 +356,11 @@ interface StoreContext {
|
|
|
356
356
|
/** What `initializePool` did. */
|
|
357
357
|
type InitializeOutcome = 'initialized' | 'already-ready';
|
|
358
358
|
//#endregion
|
|
359
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
359
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/runtime.d.ts
|
|
360
360
|
/** Where a pull was fired from; `load` fires at most once per process per row. */
|
|
361
361
|
type PullReason = 'load' | 'add' | 'replace' | 'admission';
|
|
362
362
|
//#endregion
|
|
363
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
363
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/attribution.d.ts
|
|
364
364
|
/**
|
|
365
365
|
* What a pull or refresh captured about its row (named by id alongside) when
|
|
366
366
|
* it was issued. A result applies only while the row with that id still has
|
|
@@ -383,7 +383,7 @@ interface Attribution {
|
|
|
383
383
|
identity?: string;
|
|
384
384
|
}
|
|
385
385
|
//#endregion
|
|
386
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
386
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/rows.d.ts
|
|
387
387
|
type FailureHook = (rowId: string, error: PoolOperationError) => void | Promise<void>;
|
|
388
388
|
interface RowOperationOptions {
|
|
389
389
|
/** Called once, awaited, on every non-success path, before locks release. */
|
|
@@ -599,7 +599,7 @@ interface RowTransitionResult {
|
|
|
599
599
|
providerState?: unknown;
|
|
600
600
|
}
|
|
601
601
|
//#endregion
|
|
602
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
602
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/provider-state.d.ts
|
|
603
603
|
/**
|
|
604
604
|
* Receives a private copy of the row's provider state (undefined when the row
|
|
605
605
|
* shows none) and the row as loaded under the locks, and returns the next
|
|
@@ -635,7 +635,7 @@ declare const DECLINE_TRANSITION: unique symbol;
|
|
|
635
635
|
*/
|
|
636
636
|
type RowTransitionMutator = (current: unknown | undefined, row: PoolRow) => unknown | typeof DECLINE_TRANSITION | Promise<unknown | typeof DECLINE_TRANSITION>;
|
|
637
637
|
//#endregion
|
|
638
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
638
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/publication.d.ts
|
|
639
639
|
interface PublishPlan {
|
|
640
640
|
operationId: string;
|
|
641
641
|
remove: Array<{
|
|
@@ -678,7 +678,7 @@ interface PublishResult {
|
|
|
678
678
|
receipt: PublicationReceipt;
|
|
679
679
|
}
|
|
680
680
|
//#endregion
|
|
681
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
681
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/pull.d.ts
|
|
682
682
|
/** What a pull is issued with: the credential and its attribution tuple. */
|
|
683
683
|
interface PullRequest {
|
|
684
684
|
id: string;
|
|
@@ -689,7 +689,7 @@ interface PullRequest {
|
|
|
689
689
|
}
|
|
690
690
|
type PullHook = (request: PullRequest) => Promise<unknown>;
|
|
691
691
|
//#endregion
|
|
692
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
692
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/refresh.d.ts
|
|
693
693
|
/** What the injected provider refresh function returns. */
|
|
694
694
|
interface ProviderRefreshResult {
|
|
695
695
|
access: string;
|
|
@@ -752,7 +752,7 @@ type RefreshOutcome = {
|
|
|
752
752
|
reason: string;
|
|
753
753
|
};
|
|
754
754
|
//#endregion
|
|
755
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
755
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/settings.d.ts
|
|
756
756
|
/** The plugin's settings: every top-level config key except the pool-owned ones. */
|
|
757
757
|
type PoolSettings = Record<string, unknown>;
|
|
758
758
|
type SettingsRead = {
|
|
@@ -796,7 +796,7 @@ type UpdateSettingsResult = {
|
|
|
796
796
|
outcome: 'updated' | 'unchanged';
|
|
797
797
|
};
|
|
798
798
|
//#endregion
|
|
799
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
799
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/store/pool.d.ts
|
|
800
800
|
interface OpenPoolStoreOptions {
|
|
801
801
|
/** The provider every row of this pool belongs to; keys the provider-wide lock. */
|
|
802
802
|
provider: string;
|
|
@@ -1210,7 +1210,7 @@ interface RefreshAllQuotaResult {
|
|
|
1210
1210
|
permanent?: boolean;
|
|
1211
1211
|
}
|
|
1212
1212
|
//#endregion
|
|
1213
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1213
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/watch.d.ts
|
|
1214
1214
|
/**
|
|
1215
1215
|
* How a host currently learns about changes, for logs and status displays.
|
|
1216
1216
|
* `watching`: a watch was accepted and is open, so polling is reduced to a
|
|
@@ -1264,7 +1264,7 @@ interface ScopedWatchSource {
|
|
|
1264
1264
|
}): ScopedWatchHandle;
|
|
1265
1265
|
}
|
|
1266
1266
|
//#endregion
|
|
1267
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1267
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/insula.d.ts
|
|
1268
1268
|
/**
|
|
1269
1269
|
* A held-open `usage.watch` stream. `closed` resolves when insula ends the
|
|
1270
1270
|
* stream (STREAM_END at shutdown, or a reply that ends it) or after `stop()`,
|
|
@@ -1288,7 +1288,7 @@ interface InsulaUsageTransport {
|
|
|
1288
1288
|
watchUsage?(onNotice: (body: Uint8Array) => void): InsulaUsageWatch;
|
|
1289
1289
|
}
|
|
1290
1290
|
//#endregion
|
|
1291
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1291
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/custody.d.ts
|
|
1292
1292
|
/**
|
|
1293
1293
|
* `watchScoped` is present from claustrum-client 0.12.0. Hosts detect it at
|
|
1294
1294
|
* run time and keep polling without it.
|
|
@@ -1393,7 +1393,7 @@ interface KeptReceiptState {
|
|
|
1393
1393
|
readonly since: number | null;
|
|
1394
1394
|
}
|
|
1395
1395
|
//#endregion
|
|
1396
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1396
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/quota/map.d.ts
|
|
1397
1397
|
interface QuotaReadingEntry {
|
|
1398
1398
|
scope: string;
|
|
1399
1399
|
label: string;
|
|
@@ -1466,7 +1466,7 @@ interface QuotaMap {
|
|
|
1466
1466
|
credits?: QuotaCredits;
|
|
1467
1467
|
}
|
|
1468
1468
|
//#endregion
|
|
1469
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1469
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/quota/merge.d.ts
|
|
1470
1470
|
interface ObservedReading {
|
|
1471
1471
|
/** Defaults to `all`. */
|
|
1472
1472
|
scope?: string;
|
|
@@ -1509,7 +1509,7 @@ interface QuotaObservation {
|
|
|
1509
1509
|
credits?: QuotaCredits;
|
|
1510
1510
|
}
|
|
1511
1511
|
//#endregion
|
|
1512
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1512
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/interlock.d.ts
|
|
1513
1513
|
/**
|
|
1514
1514
|
* The declined-account interlock: the user's "do not use this vault account",
|
|
1515
1515
|
* kept on the consumer side because the vault has no notion of it.
|
|
@@ -1528,7 +1528,7 @@ interface DeclinedAccount {
|
|
|
1528
1528
|
readonly accountIdentity?: string;
|
|
1529
1529
|
}
|
|
1530
1530
|
//#endregion
|
|
1531
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1531
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/roster.d.ts
|
|
1532
1532
|
/**
|
|
1533
1533
|
* One vault account as the pool sees it. It carries no bearer material: the
|
|
1534
1534
|
* access token is fetched from the vault for every send. Several vault
|
|
@@ -1576,6 +1576,12 @@ interface VaultRosterFile {
|
|
|
1576
1576
|
rows: VaultRosterRow[];
|
|
1577
1577
|
declined: DeclinedAccount[];
|
|
1578
1578
|
}
|
|
1579
|
+
interface ReorderVaultRosterResult {
|
|
1580
|
+
/** The route id order now on disk. */
|
|
1581
|
+
ids: string[];
|
|
1582
|
+
/** `unchanged` when the roster was already in this order; nothing was written. */
|
|
1583
|
+
outcome: 'reordered' | 'unchanged';
|
|
1584
|
+
}
|
|
1579
1585
|
/**
|
|
1580
1586
|
* The receipt fields a quota or profile observation must carry to say which
|
|
1581
1587
|
* send (credential and account) it came from. Pass the
|
|
@@ -1583,7 +1589,7 @@ interface VaultRosterFile {
|
|
|
1583
1589
|
*/
|
|
1584
1590
|
type QuotaReceipt = Pick<ClaustrumScopedAttempt, 'credentialId' | 'accountIdentity' | 'accountIdentitySource' | 'expectedAccountIdentity'>;
|
|
1585
1591
|
//#endregion
|
|
1586
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1592
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/consumer.d.ts
|
|
1587
1593
|
/**
|
|
1588
1594
|
* How a started consumer learns about changes, for logs and status displays.
|
|
1589
1595
|
* `insula` is present when the consumer was given an insula source. Never
|
|
@@ -1594,7 +1600,7 @@ interface ClaustrumWatchState {
|
|
|
1594
1600
|
readonly insula?: WatchMode;
|
|
1595
1601
|
}
|
|
1596
1602
|
//#endregion
|
|
1597
|
-
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.
|
|
1603
|
+
//#region ../../node_modules/.bun/@cortexkit+common-auth@0.25.0+edd79cef82a5b402/node_modules/@cortexkit/common-auth/dist/claustrum/enrollment.d.ts
|
|
1598
1604
|
interface ClaustrumEnrollmentClient {
|
|
1599
1605
|
enrollPropose(input: {
|
|
1600
1606
|
name: string;
|
|
@@ -1839,6 +1845,8 @@ declare class OpenAiVault {
|
|
|
1839
1845
|
ok: boolean;
|
|
1840
1846
|
error?: string;
|
|
1841
1847
|
}>>;
|
|
1848
|
+
/** Reorders this host's vault roster without touching its local accounts. */
|
|
1849
|
+
reorder(routeIds: readonly string[]): Promise<ReorderVaultRosterResult>;
|
|
1842
1850
|
/** Declines a vault account: it stays listed and never routes until accepted. */
|
|
1843
1851
|
decline(routeId: string): Promise<void>;
|
|
1844
1852
|
accept(routeId: string): Promise<void>;
|