sidekick-shared 0.28.2 → 0.28.3
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/CHANGELOG.md +19 -0
- package/README.md +29 -13
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +10 -1
- package/dist/codexQuota.js +17 -4
- package/dist/esm/browser.js +2 -0
- package/dist/esm/codexQuota.js +18 -5
- package/dist/esm/index.js +3 -3
- package/dist/esm/multiProviderQuotaService.js +1 -1
- package/dist/esm/quota.js +356 -24
- package/dist/esm/quotaHistory.js +33 -8
- package/dist/esm/quotaPoller.js +5 -2
- package/dist/esm/quotaResolver.js +31 -6
- package/dist/esm/quotaSnapshots.js +65 -10
- package/dist/esm/quotaThresholds.js +7 -2
- package/dist/esm/schemas/index.js +2 -2
- package/dist/esm/schemas/quota.js +30 -0
- package/dist/esm/schemas/quotaHistory.js +10 -2
- package/dist/esm/schemas/stateFile.js +9 -0
- package/dist/esm/stateFile.js +18 -3
- package/dist/esm/statusline/claudeStatuslinePayload.js +16 -4
- package/dist/esm/statusline/formatter.js +57 -18
- package/dist/esm/statusline/index.js +2 -2
- package/dist/esm/zaiQuotaApi.js +4 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +18 -5
- package/dist/multiProviderQuotaService.js +1 -1
- package/dist/quota.d.ts +131 -1
- package/dist/quota.js +366 -24
- package/dist/quotaHistory.d.ts +10 -0
- package/dist/quotaHistory.js +34 -8
- package/dist/quotaPoller.d.ts +11 -3
- package/dist/quotaPoller.js +5 -2
- package/dist/quotaResolver.js +30 -5
- package/dist/quotaSnapshots.js +64 -9
- package/dist/quotaThresholds.js +7 -2
- package/dist/schemas/index.d.ts +3 -3
- package/dist/schemas/index.js +5 -2
- package/dist/schemas/quota.d.ts +258 -0
- package/dist/schemas/quota.js +31 -1
- package/dist/schemas/quotaHistory.d.ts +2 -0
- package/dist/schemas/quotaHistory.js +10 -2
- package/dist/schemas/stateFile.d.ts +34 -0
- package/dist/schemas/stateFile.js +10 -1
- package/dist/stateFile.d.ts +18 -0
- package/dist/stateFile.js +17 -2
- package/dist/statusline/claudeStatuslinePayload.d.ts +4 -3
- package/dist/statusline/claudeStatuslinePayload.js +16 -4
- package/dist/statusline/formatter.d.ts +5 -0
- package/dist/statusline/formatter.js +56 -17
- package/dist/statusline/index.d.ts +4 -4
- package/dist/statusline/index.js +5 -1
- package/dist/zaiQuotaApi.js +3 -1
- package/package.json +1 -1
package/dist/quotaHistory.js
CHANGED
|
@@ -42,6 +42,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
42
42
|
})();
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
44
|
exports.getWorkspaceIdFromPath = getWorkspaceIdFromPath;
|
|
45
|
+
exports.quotaHistoryWindow = quotaHistoryWindow;
|
|
45
46
|
exports.appendQuotaHistorySample = appendQuotaHistorySample;
|
|
46
47
|
exports.readQuotaHistoryRange = readQuotaHistoryRange;
|
|
47
48
|
exports.readQuotaHistoryDailyBuckets = readQuotaHistoryDailyBuckets;
|
|
@@ -200,11 +201,26 @@ function pruneFileSync(filePath, retentionDays) {
|
|
|
200
201
|
}
|
|
201
202
|
return { kept: keptLines.length, pruned };
|
|
202
203
|
}
|
|
204
|
+
function historyWindowToQuota(window) {
|
|
205
|
+
return {
|
|
206
|
+
utilization: window.utilization,
|
|
207
|
+
resetsAt: window.resetsAt,
|
|
208
|
+
...(window.absent ? { absent: true } : {}),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Project a quota window onto the history-sample shape, keeping the `absent`
|
|
213
|
+
* marker so summaries and the derived snapshot do not mistake "no such
|
|
214
|
+
* window" for "0% used".
|
|
215
|
+
*/
|
|
216
|
+
function quotaHistoryWindow(window) {
|
|
217
|
+
return historyWindowToQuota(window);
|
|
218
|
+
}
|
|
203
219
|
function sampleToQuotaState(sample) {
|
|
204
220
|
const providerId = runtimeProviderToSnapshotProvider(sample.runtimeProvider);
|
|
205
221
|
return {
|
|
206
|
-
fiveHour:
|
|
207
|
-
sevenDay:
|
|
222
|
+
fiveHour: historyWindowToQuota(sample.fiveHour),
|
|
223
|
+
sevenDay: historyWindowToQuota(sample.sevenDay),
|
|
208
224
|
available: sample.available,
|
|
209
225
|
error: sample.error,
|
|
210
226
|
providerId,
|
|
@@ -370,12 +386,22 @@ async function readQuotaHistoryDailyBuckets(options) {
|
|
|
370
386
|
let maxSeven = 0;
|
|
371
387
|
let sumFive = 0;
|
|
372
388
|
let sumSeven = 0;
|
|
389
|
+
// Averages count only samples where the window exists, so a plan without
|
|
390
|
+
// a five-hour limit does not drag the five-hour average toward zero.
|
|
391
|
+
let fiveCount = 0;
|
|
392
|
+
let sevenCount = 0;
|
|
373
393
|
let anyUnavailable = false;
|
|
374
394
|
for (const s of daySamples) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
395
|
+
if (!s.fiveHour.absent) {
|
|
396
|
+
maxFive = Math.max(maxFive, s.fiveHour.utilization);
|
|
397
|
+
sumFive += s.fiveHour.utilization;
|
|
398
|
+
fiveCount += 1;
|
|
399
|
+
}
|
|
400
|
+
if (!s.sevenDay.absent) {
|
|
401
|
+
maxSeven = Math.max(maxSeven, s.sevenDay.utilization);
|
|
402
|
+
sumSeven += s.sevenDay.utilization;
|
|
403
|
+
sevenCount += 1;
|
|
404
|
+
}
|
|
379
405
|
if (!s.available)
|
|
380
406
|
anyUnavailable = true;
|
|
381
407
|
}
|
|
@@ -385,8 +411,8 @@ async function readQuotaHistoryDailyBuckets(options) {
|
|
|
385
411
|
samples: n,
|
|
386
412
|
maxUtilizationFiveHour: maxFive,
|
|
387
413
|
maxUtilizationSevenDay: maxSeven,
|
|
388
|
-
avgUtilizationFiveHour: Math.round((sumFive /
|
|
389
|
-
avgUtilizationSevenDay: Math.round((sumSeven /
|
|
414
|
+
avgUtilizationFiveHour: fiveCount ? Math.round((sumFive / fiveCount) * 100) / 100 : 0,
|
|
415
|
+
avgUtilizationSevenDay: sevenCount ? Math.round((sumSeven / sevenCount) * 100) / 100 : 0,
|
|
390
416
|
anyUnavailable,
|
|
391
417
|
});
|
|
392
418
|
}
|
package/dist/quotaPoller.d.ts
CHANGED
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module quotaPoller
|
|
8
8
|
*/
|
|
9
|
-
import type { QuotaState } from './quota';
|
|
9
|
+
import type { ClaudePlanInfo, QuotaState } from './quota';
|
|
10
10
|
import { type AccountsChangedEvent } from './accountChanges';
|
|
11
11
|
/** Disposable subscription handle. */
|
|
12
12
|
export interface Disposable {
|
|
13
13
|
dispose(): void;
|
|
14
14
|
}
|
|
15
15
|
/** Options for QuotaPoller construction. */
|
|
16
|
+
/** Credential fields the poller reads when `getAccessToken` returns a record. */
|
|
17
|
+
export interface QuotaPollerCredentials extends ClaudePlanInfo {
|
|
18
|
+
accessToken: string;
|
|
19
|
+
}
|
|
16
20
|
export interface QuotaPollerOptions {
|
|
17
21
|
/** Polling interval when actively monitored (ms). Default: 60_000 (1 minute). */
|
|
18
22
|
activeIntervalMs?: number;
|
|
@@ -20,8 +24,12 @@ export interface QuotaPollerOptions {
|
|
|
20
24
|
idleIntervalMs?: number;
|
|
21
25
|
/** Maximum backoff delay for retries (ms). Default: 120_000 (2 minutes). */
|
|
22
26
|
maxBackoffMs?: number;
|
|
23
|
-
/**
|
|
24
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Returns the current access token, or the credentials record itself so the
|
|
29
|
+
* poller can also stamp the subscription plan (`planLabel`, e.g. `Ultra`).
|
|
30
|
+
* Called before each fetch.
|
|
31
|
+
*/
|
|
32
|
+
getAccessToken: () => Promise<string | QuotaPollerCredentials | null | undefined>;
|
|
25
33
|
/** Optional cheap account-presence check performed before credential access. */
|
|
26
34
|
hasAccount?: () => boolean | Promise<boolean>;
|
|
27
35
|
/** Override the process-wide login/logout signal (primarily for embedded hosts/tests). */
|
package/dist/quotaPoller.js
CHANGED
|
@@ -128,7 +128,8 @@ class QuotaPoller {
|
|
|
128
128
|
this.dormant = true;
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const credentials = await this.getAccessToken();
|
|
132
|
+
const token = typeof credentials === 'string' ? credentials : credentials?.accessToken;
|
|
132
133
|
if (!token) {
|
|
133
134
|
if (this.hasAccount) {
|
|
134
135
|
// The account exists but its token was unreadable (locked keychain,
|
|
@@ -144,7 +145,9 @@ class QuotaPoller {
|
|
|
144
145
|
}
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
|
-
const state = await (0, quota_1.fetchQuota)(token
|
|
148
|
+
const state = await (0, quota_1.fetchQuota)(token, {
|
|
149
|
+
plan: typeof credentials === 'object' && credentials !== null ? credentials : null,
|
|
150
|
+
});
|
|
148
151
|
if (state.available) {
|
|
149
152
|
this.latest = state;
|
|
150
153
|
this.consecutiveFailures = 0;
|
package/dist/quotaResolver.js
CHANGED
|
@@ -66,9 +66,18 @@ function resolveIdentity(options) {
|
|
|
66
66
|
return { accountId: options.accountId ?? ZAI_DEFAULT_ACCOUNT_ID, codexAccount: null };
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
/** Token plus the plan facts stored beside it (the plan label needs no extra read). */
|
|
70
|
+
async function claudeTokenAndPlan(options) {
|
|
71
|
+
if (options.getClaudeAccessToken) {
|
|
72
|
+
return { token: await options.getClaudeAccessToken(), plan: null };
|
|
73
|
+
}
|
|
70
74
|
const credentials = await (0, credentials_1.readClaudeMaxCredentials)();
|
|
71
|
-
return
|
|
75
|
+
return {
|
|
76
|
+
token: credentials?.accessToken ?? null,
|
|
77
|
+
plan: credentials
|
|
78
|
+
? { subscriptionType: credentials.subscriptionType, rateLimitTier: credentials.rateLimitTier }
|
|
79
|
+
: null,
|
|
80
|
+
};
|
|
72
81
|
}
|
|
73
82
|
function zeroWindows() {
|
|
74
83
|
return { fiveHour: { utilization: 0, resetsAt: '' }, sevenDay: { utilization: 0, resetsAt: '' } };
|
|
@@ -87,7 +96,7 @@ function unavailableState(providerId, error, capturedAt) {
|
|
|
87
96
|
async function fetchFromApi(options, identity, capturedAt) {
|
|
88
97
|
switch (options.providerId) {
|
|
89
98
|
case 'claude-code': {
|
|
90
|
-
const token = await (options
|
|
99
|
+
const { token, plan } = await claudeTokenAndPlan(options);
|
|
91
100
|
if (!token) {
|
|
92
101
|
return {
|
|
93
102
|
...zeroWindows(),
|
|
@@ -99,7 +108,7 @@ async function fetchFromApi(options, identity, capturedAt) {
|
|
|
99
108
|
capturedAt,
|
|
100
109
|
};
|
|
101
110
|
}
|
|
102
|
-
const state = await (0, quota_1.fetchQuota)(token, { fetchImpl: options.fetchImpl });
|
|
111
|
+
const state = await (0, quota_1.fetchQuota)(token, { fetchImpl: options.fetchImpl, plan });
|
|
103
112
|
return { ...state, providerId: 'claude-code', source: 'api', capturedAt };
|
|
104
113
|
}
|
|
105
114
|
case 'codex':
|
|
@@ -181,7 +190,10 @@ async function resolveQuota(options) {
|
|
|
181
190
|
const stored = identity.accountId
|
|
182
191
|
? readSnapshot(snapshotProviderId(providerId), identity.accountId, now)
|
|
183
192
|
: null;
|
|
184
|
-
|
|
193
|
+
// A sample whose every window has reset since says nothing about current
|
|
194
|
+
// usage; it is reported as expired instead of being shown as live numbers.
|
|
195
|
+
const storedExpired = Boolean(stored?.available && (0, quota_1.quotaSampleExpired)(stored, now.getTime()));
|
|
196
|
+
const snapshot = stored?.available && !storedExpired ? stored : null;
|
|
185
197
|
if (preferFresh && snapshot && snapshot.freshness === 'fresh') {
|
|
186
198
|
return finish(snapshot, 'snapshot-fresh');
|
|
187
199
|
}
|
|
@@ -227,8 +239,21 @@ async function resolveQuota(options) {
|
|
|
227
239
|
const fallback = finish(snapshot, snapshotResolution(snapshot));
|
|
228
240
|
return apiState ? { ...fallback, failure: (0, quotaPresentation_1.describeQuotaFailure)(apiState) } : fallback;
|
|
229
241
|
}
|
|
242
|
+
if (storedExpired && stored) {
|
|
243
|
+
const expired = unavailableState(providerId, expiredSampleMessage(stored, now), capturedAt);
|
|
244
|
+
return apiState
|
|
245
|
+
? { ...finish(expired, 'unavailable'), failure: (0, quotaPresentation_1.describeQuotaFailure)(apiState) }
|
|
246
|
+
: finish(expired, 'unavailable');
|
|
247
|
+
}
|
|
230
248
|
return finish(apiState ??
|
|
231
249
|
unavailableState(providerId, stored
|
|
232
250
|
? 'The last persisted quota sample was unavailable.'
|
|
233
251
|
: 'No quota data is available yet; run the provider once so a sample can be recorded.', capturedAt), 'unavailable');
|
|
234
252
|
}
|
|
253
|
+
function expiredSampleMessage(stored, now) {
|
|
254
|
+
const capturedMs = stored.capturedAt ? Date.parse(stored.capturedAt) : NaN;
|
|
255
|
+
const when = Number.isFinite(capturedMs)
|
|
256
|
+
? ` from ${new Date(capturedMs).toISOString().slice(0, 10)} (${(0, quota_1.formatQuotaAge)(now.getTime() - capturedMs)})`
|
|
257
|
+
: '';
|
|
258
|
+
return `The last quota sample${when} has expired: every window has reset since. No current data.`;
|
|
259
|
+
}
|
package/dist/quotaSnapshots.js
CHANGED
|
@@ -83,6 +83,27 @@ function windowResetMs(value) {
|
|
|
83
83
|
const ms = Date.parse(value);
|
|
84
84
|
return Number.isFinite(ms) ? ms : 0;
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Rank two samples by one window's reset time. A later reset means a newer
|
|
88
|
+
* window, so it wins — except that an existing window which had already reset
|
|
89
|
+
* by the time the newer sample was captured is obsolete and always yields.
|
|
90
|
+
* Without that exception a pre-reset sample outranks every later sample whose
|
|
91
|
+
* window has not started yet (empty reset), and the snapshot freezes.
|
|
92
|
+
* Returns `undefined` when the reset times tie.
|
|
93
|
+
*/
|
|
94
|
+
function compareWindowResets(existing, next, asOfMs) {
|
|
95
|
+
const existingReset = windowResetMs(existing.resetsAt);
|
|
96
|
+
const nextReset = windowResetMs(next.resetsAt);
|
|
97
|
+
if (existingReset === nextReset)
|
|
98
|
+
return undefined;
|
|
99
|
+
if (existingReset > 0 && asOfMs > 0 && existingReset <= asOfMs)
|
|
100
|
+
return false;
|
|
101
|
+
return existingReset > nextReset;
|
|
102
|
+
}
|
|
103
|
+
function windowPresenceChanged(existing, next) {
|
|
104
|
+
return (Boolean(existing.fiveHour.absent) !== Boolean(next.fiveHour.absent) ||
|
|
105
|
+
Boolean(existing.sevenDay.absent) !== Boolean(next.sevenDay.absent));
|
|
106
|
+
}
|
|
86
107
|
// Preserve the best-known same-window snapshot while still allowing lower
|
|
87
108
|
// utilization after Codex advances to a newer reset window.
|
|
88
109
|
function shouldKeepExistingSnapshot(existing, next) {
|
|
@@ -95,20 +116,50 @@ function shouldKeepExistingSnapshot(existing, next) {
|
|
|
95
116
|
const nextAggregate = (0, codex_1.isAggregateCodexLimit)(next.limitId);
|
|
96
117
|
if (existingAggregate !== nextAggregate)
|
|
97
118
|
return existingAggregate;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
// The plan's window layout changed (a window appeared or disappeared): the
|
|
120
|
+
// reset times are not comparable, so the newer capture wins.
|
|
121
|
+
if (windowPresenceChanged(existing, next)) {
|
|
122
|
+
return snapshotTimeMs(existing) > snapshotTimeMs(next);
|
|
123
|
+
}
|
|
124
|
+
const asOfMs = snapshotTimeMs(next);
|
|
125
|
+
const primary = compareWindowResets(existing.fiveHour, next.fiveHour, asOfMs);
|
|
126
|
+
if (primary !== undefined)
|
|
127
|
+
return primary;
|
|
128
|
+
const secondary = compareWindowResets(existing.sevenDay, next.sevenDay, asOfMs);
|
|
129
|
+
if (secondary !== undefined)
|
|
130
|
+
return secondary;
|
|
106
131
|
const existingUtilization = existing.fiveHour.utilization + existing.sevenDay.utilization;
|
|
107
132
|
const nextUtilization = next.fiveHour.utilization + next.sevenDay.utilization;
|
|
108
133
|
if (existingUtilization !== nextUtilization)
|
|
109
134
|
return existingUtilization > nextUtilization;
|
|
110
135
|
return snapshotTimeMs(existing) > snapshotTimeMs(next);
|
|
111
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* Status-line and history samples only know the two headline windows. Keep
|
|
139
|
+
* the plan label, extra usage, and still-running extra meters (e.g. a Fable
|
|
140
|
+
* weekly cap) an earlier API sample recorded, so a fresh status-line write
|
|
141
|
+
* does not erase them from every snapshot reader.
|
|
142
|
+
*/
|
|
143
|
+
function carryApiOnlyFields(existing, next) {
|
|
144
|
+
const merged = { ...next };
|
|
145
|
+
if (merged.planLabel === undefined && existing.planLabel !== undefined) {
|
|
146
|
+
merged.planLabel = existing.planLabel;
|
|
147
|
+
}
|
|
148
|
+
if (merged.planType === undefined && existing.planType !== undefined) {
|
|
149
|
+
merged.planType = existing.planType;
|
|
150
|
+
}
|
|
151
|
+
if (merged.extraUsage === undefined && existing.extraUsage !== undefined) {
|
|
152
|
+
merged.extraUsage = existing.extraUsage;
|
|
153
|
+
}
|
|
154
|
+
if (merged.limits === undefined && existing.limits !== undefined) {
|
|
155
|
+
const asOfMs = snapshotTimeMs(next);
|
|
156
|
+
// Headline meters duplicate the fresher windows on `next`; carry only the extras.
|
|
157
|
+
const running = (0, quota_1.extraQuotaRows)(existing).filter((row) => windowResetMs(row.resetsAt) > asOfMs);
|
|
158
|
+
if (running.length > 0)
|
|
159
|
+
merged.limits = running;
|
|
160
|
+
}
|
|
161
|
+
return merged;
|
|
162
|
+
}
|
|
112
163
|
function writeQuotaSnapshot(providerId, accountId, quota) {
|
|
113
164
|
withSnapshotStoreLock(() => {
|
|
114
165
|
const store = readStore();
|
|
@@ -130,7 +181,11 @@ function writeQuotaSnapshot(providerId, accountId, quota) {
|
|
|
130
181
|
};
|
|
131
182
|
if (index >= 0 && shouldKeepExistingSnapshot(store.snapshots[index].quota, snapshot))
|
|
132
183
|
return;
|
|
133
|
-
const record = {
|
|
184
|
+
const record = {
|
|
185
|
+
providerId,
|
|
186
|
+
accountId,
|
|
187
|
+
quota: existingQuota ? carryApiOnlyFields(existingQuota, snapshot) : snapshot,
|
|
188
|
+
};
|
|
134
189
|
if (index >= 0)
|
|
135
190
|
store.snapshots[index] = record;
|
|
136
191
|
else
|
package/dist/quotaThresholds.js
CHANGED
|
@@ -55,8 +55,13 @@ function evaluateWindow(window, quota, thresholds, previous) {
|
|
|
55
55
|
function evaluateQuotaThresholds(quota, config = exports.DEFAULT_QUOTA_THRESHOLDS, memory = {}) {
|
|
56
56
|
if (!quota.available)
|
|
57
57
|
return { alerts: [], memory };
|
|
58
|
-
|
|
59
|
-
const
|
|
58
|
+
// A window the plan does not have (Ultra's missing five-hour limit) never alerts.
|
|
59
|
+
const fiveHour = quota.fiveHour.absent
|
|
60
|
+
? { alert: null, memory: memory.fiveHour ?? { resetsAt: '', level: 0 } }
|
|
61
|
+
: evaluateWindow('fiveHour', quota.fiveHour, config.fiveHour, memory.fiveHour);
|
|
62
|
+
const sevenDay = quota.sevenDay.absent
|
|
63
|
+
? { alert: null, memory: memory.sevenDay ?? { resetsAt: '', level: 0 } }
|
|
64
|
+
: evaluateWindow('sevenDay', quota.sevenDay, config.sevenDay, memory.sevenDay);
|
|
60
65
|
return {
|
|
61
66
|
alerts: [fiveHour.alert, sevenDay.alert].filter((alert) => alert !== null),
|
|
62
67
|
memory: { fiveHour: fiveHour.memory, sevenDay: sevenDay.memory },
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { transcriptSourceProvenanceSchema, canonicalTranscriptBlockSchema, canon
|
|
|
23
23
|
export type { CanonicalSessionTranscript, CanonicalTranscriptMessage, CanonicalToolCall, TranscriptSourceProvenance, } from '../transcript';
|
|
24
24
|
export { observationProvenanceV1Schema, observedAgentSessionV1Schema, observedValueV1Schema, pendingUserRequestV1Schema, providerCapabilitiesV1Schema, providerSessionAdapterV1Schema, sessionEvidenceRefV1Schema, } from './observedSessionV1';
|
|
25
25
|
export type { ObservationProvenanceV1, ObservedAgentSessionV1, ObservedValueV1, PendingUserRequestV1, ProviderCapabilitiesV1, ProviderSessionAdapterV1, SessionEvidenceRefV1, } from '../types/observedSessionV1';
|
|
26
|
-
export { quotaWindowSchema, quotaStateSchema, quotaFailureKindSchema, quotaProviderIdSchema, quotaSourceSchema, codexResetCreditSchema, codexResetCreditsSnapshotSchema, peakHoursStateSchema, quotaFailureDescriptorSchema, runtimeQuotaProviderSchema, providerQuotaStateSchema, claudeProviderQuotaStateSchema, codexProviderQuotaStateSchema, zaiProviderQuotaStateSchema, providerQuotaMapSchema, } from './quota';
|
|
26
|
+
export { quotaWindowSchema, quotaStateSchema, quotaLimitRowSchema, quotaExtraUsageSchema, quotaFailureKindSchema, quotaProviderIdSchema, quotaSourceSchema, codexResetCreditSchema, codexResetCreditsSnapshotSchema, peakHoursStateSchema, quotaFailureDescriptorSchema, runtimeQuotaProviderSchema, providerQuotaStateSchema, claudeProviderQuotaStateSchema, codexProviderQuotaStateSchema, zaiProviderQuotaStateSchema, providerQuotaMapSchema, } from './quota';
|
|
27
27
|
export type { CodexResetCredit, CodexResetCreditsSnapshot, QuotaWindow, QuotaState, } from '../quota';
|
|
28
28
|
export type { PeakHoursState } from '../peakHours';
|
|
29
29
|
export type { QuotaFailureDescriptor } from '../quotaPresentation';
|
|
@@ -43,5 +43,5 @@ export type { AccountLaunchEnv } from '../accountLaunch';
|
|
|
43
43
|
export type { RunningAccountConsumer, RunningProcess } from '../processDetection';
|
|
44
44
|
export { assistantTurnEventSchema, assistantTurnEventTypeSchema, assistantTurnNarrationStepSchema, assistantTurnProcessSchema, assistantTurnProcessStepSchema, assistantTurnProjectionSchema, assistantTurnReasoningTimelineItemSchema, assistantTurnSubagentSchema, assistantTurnSubagentStatusSchema, assistantTurnTimelineItemSchema, assistantTurnToolGroupStepSchema, assistantTurnToolRefSchema, } from './assistantTurn';
|
|
45
45
|
export type { AssistantTurnEvent, AssistantTurnEventType, AssistantTurnProcess, AssistantTurnProcessStep, AssistantTurnProjection, AssistantTurnSubagent, AssistantTurnSubagentStatus, AssistantTurnTimelineItem, AssistantTurnToolRef, } from '../turns/assistantTurn';
|
|
46
|
-
export { sidekickStateFileSchema, stateFileAccountSchema, stateFileBillingBlockSchema, stateFileContextSchema, stateFileQuotaSchema, stateFileQuotaWindowSchema, stateFileSessionSchema, stateFileWriterSchema, } from './stateFile';
|
|
47
|
-
export type { SidekickStateFile, StateFileAccount, StateFileBillingBlock, StateFileContext, StateFileQuota, StateFileQuotaWindow, StateFileSession, StateFileWriter, } from '../stateFile';
|
|
46
|
+
export { sidekickStateFileSchema, stateFileAccountSchema, stateFileBillingBlockSchema, stateFileContextSchema, stateFileQuotaSchema, stateFileQuotaWindowSchema, stateFileQuotaLimitSchema, stateFileSessionSchema, stateFileWriterSchema, } from './stateFile';
|
|
47
|
+
export type { SidekickStateFile, StateFileAccount, StateFileBillingBlock, StateFileContext, StateFileQuota, StateFileQuotaWindow, StateFileQuotaLimit, StateFileSession, StateFileWriter, } from '../stateFile';
|
package/dist/schemas/index.js
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* subpath is self-sufficient for boundary-validation modules.
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
16
|
-
exports.stateFileWriterSchema = exports.stateFileSessionSchema = exports.stateFileQuotaWindowSchema = exports.stateFileQuotaSchema = exports.stateFileContextSchema = exports.stateFileBillingBlockSchema = exports.stateFileAccountSchema = exports.sidekickStateFileSchema = exports.assistantTurnToolRefSchema = exports.assistantTurnToolGroupStepSchema = exports.assistantTurnTimelineItemSchema = exports.assistantTurnSubagentStatusSchema = exports.assistantTurnSubagentSchema = exports.assistantTurnReasoningTimelineItemSchema = exports.assistantTurnProjectionSchema = exports.assistantTurnProcessStepSchema = exports.assistantTurnProcessSchema = exports.assistantTurnNarrationStepSchema = exports.assistantTurnEventTypeSchema = exports.assistantTurnEventSchema = exports.accountLaunchEnvSchema = exports.syncReportSchema = exports.providerSyncReportSchema = exports.lastSwitchRecordSchema = exports.switchAccountResultSchema = exports.runningAccountConsumerSchema = exports.accountConsumerKindSchema = exports.runningProcessSchema = exports.accountViewSchema = exports.accountHealthSchema = exports.accountHealthSidecarSchema = exports.accountHealthSourceSchema = exports.accountHealthStateSchema = exports.listAllAccountsResultSchema = exports.savedAccountProfileSchema = exports.accountEntrySchema = exports.accountLoginStatusSchema = exports.beginAccountLoginResultSchema = exports.accountManagerResultSchema = exports.accountProviderIdSchema = exports.activeAccountStatusSchema = exports.activeProviderAccountStatusSchema = exports.quotaHistoryDailyBucketSchema = exports.quotaHistorySampleSchema = void 0;
|
|
15
|
+
exports.zaiProviderQuotaStateSchema = exports.codexProviderQuotaStateSchema = exports.claudeProviderQuotaStateSchema = exports.providerQuotaStateSchema = exports.runtimeQuotaProviderSchema = exports.quotaFailureDescriptorSchema = exports.peakHoursStateSchema = exports.codexResetCreditsSnapshotSchema = exports.codexResetCreditSchema = exports.quotaSourceSchema = exports.quotaProviderIdSchema = exports.quotaFailureKindSchema = exports.quotaExtraUsageSchema = exports.quotaLimitRowSchema = exports.quotaStateSchema = exports.quotaWindowSchema = exports.sessionEvidenceRefV1Schema = exports.providerSessionAdapterV1Schema = exports.providerCapabilitiesV1Schema = exports.pendingUserRequestV1Schema = exports.observedValueV1Schema = exports.observedAgentSessionV1Schema = exports.observationProvenanceV1Schema = exports.canonicalSessionTranscriptSchema = exports.canonicalTranscriptMessageSchema = exports.canonicalToolCallSchema = exports.canonicalTranscriptBlockSchema = exports.transcriptSourceProvenanceSchema = exports.providerFailureDiagnosisSchema = exports.providerRetryAfterSchema = exports.providerFailureEvidenceSchema = exports.providerAuthenticationEvidenceSchema = exports.tokenEstimateSchema = exports.normalizedUsageCostSchema = exports.normalizedUsageSchema = exports.toolResultSessionEventSchema = exports.toolUseSessionEventSchema = exports.systemSessionEventSchema = exports.summarySessionEventSchema = exports.assistantSessionEventSchema = exports.userSessionEventSchema = exports.extractSessionEvents = exports.permissionModeSchema = exports.sessionEventSchema = exports.sessionMessageSchema = exports.messageUsageSchema = exports.SESSION_PROVIDER_IDS = exports.RUNTIME_QUOTA_PROVIDER_IDS = exports.QUOTA_PROVIDER_IDS = exports.ACCOUNT_PROVIDER_IDS = void 0;
|
|
16
|
+
exports.stateFileWriterSchema = exports.stateFileSessionSchema = exports.stateFileQuotaLimitSchema = exports.stateFileQuotaWindowSchema = exports.stateFileQuotaSchema = exports.stateFileContextSchema = exports.stateFileBillingBlockSchema = exports.stateFileAccountSchema = exports.sidekickStateFileSchema = exports.assistantTurnToolRefSchema = exports.assistantTurnToolGroupStepSchema = exports.assistantTurnTimelineItemSchema = exports.assistantTurnSubagentStatusSchema = exports.assistantTurnSubagentSchema = exports.assistantTurnReasoningTimelineItemSchema = exports.assistantTurnProjectionSchema = exports.assistantTurnProcessStepSchema = exports.assistantTurnProcessSchema = exports.assistantTurnNarrationStepSchema = exports.assistantTurnEventTypeSchema = exports.assistantTurnEventSchema = exports.accountLaunchEnvSchema = exports.syncReportSchema = exports.providerSyncReportSchema = exports.lastSwitchRecordSchema = exports.switchAccountResultSchema = exports.runningAccountConsumerSchema = exports.accountConsumerKindSchema = exports.runningProcessSchema = exports.accountViewSchema = exports.accountHealthSchema = exports.accountHealthSidecarSchema = exports.accountHealthSourceSchema = exports.accountHealthStateSchema = exports.listAllAccountsResultSchema = exports.savedAccountProfileSchema = exports.accountEntrySchema = exports.accountLoginStatusSchema = exports.beginAccountLoginResultSchema = exports.accountManagerResultSchema = exports.accountProviderIdSchema = exports.activeAccountStatusSchema = exports.activeProviderAccountStatusSchema = exports.quotaHistoryDailyBucketSchema = exports.quotaHistorySampleSchema = exports.quotaHistoryRuntimeProviderSchema = exports.providerQuotaMapSchema = void 0;
|
|
17
17
|
var providerIds_1 = require("../providerIds");
|
|
18
18
|
Object.defineProperty(exports, "ACCOUNT_PROVIDER_IDS", { enumerable: true, get: function () { return providerIds_1.ACCOUNT_PROVIDER_IDS; } });
|
|
19
19
|
Object.defineProperty(exports, "QUOTA_PROVIDER_IDS", { enumerable: true, get: function () { return providerIds_1.QUOTA_PROVIDER_IDS; } });
|
|
@@ -58,6 +58,8 @@ Object.defineProperty(exports, "sessionEvidenceRefV1Schema", { enumerable: true,
|
|
|
58
58
|
var quota_1 = require("./quota");
|
|
59
59
|
Object.defineProperty(exports, "quotaWindowSchema", { enumerable: true, get: function () { return quota_1.quotaWindowSchema; } });
|
|
60
60
|
Object.defineProperty(exports, "quotaStateSchema", { enumerable: true, get: function () { return quota_1.quotaStateSchema; } });
|
|
61
|
+
Object.defineProperty(exports, "quotaLimitRowSchema", { enumerable: true, get: function () { return quota_1.quotaLimitRowSchema; } });
|
|
62
|
+
Object.defineProperty(exports, "quotaExtraUsageSchema", { enumerable: true, get: function () { return quota_1.quotaExtraUsageSchema; } });
|
|
61
63
|
Object.defineProperty(exports, "quotaFailureKindSchema", { enumerable: true, get: function () { return quota_1.quotaFailureKindSchema; } });
|
|
62
64
|
Object.defineProperty(exports, "quotaProviderIdSchema", { enumerable: true, get: function () { return quota_1.quotaProviderIdSchema; } });
|
|
63
65
|
Object.defineProperty(exports, "quotaSourceSchema", { enumerable: true, get: function () { return quota_1.quotaSourceSchema; } });
|
|
@@ -119,5 +121,6 @@ Object.defineProperty(exports, "stateFileBillingBlockSchema", { enumerable: true
|
|
|
119
121
|
Object.defineProperty(exports, "stateFileContextSchema", { enumerable: true, get: function () { return stateFile_1.stateFileContextSchema; } });
|
|
120
122
|
Object.defineProperty(exports, "stateFileQuotaSchema", { enumerable: true, get: function () { return stateFile_1.stateFileQuotaSchema; } });
|
|
121
123
|
Object.defineProperty(exports, "stateFileQuotaWindowSchema", { enumerable: true, get: function () { return stateFile_1.stateFileQuotaWindowSchema; } });
|
|
124
|
+
Object.defineProperty(exports, "stateFileQuotaLimitSchema", { enumerable: true, get: function () { return stateFile_1.stateFileQuotaLimitSchema; } });
|
|
122
125
|
Object.defineProperty(exports, "stateFileSessionSchema", { enumerable: true, get: function () { return stateFile_1.stateFileSessionSchema; } });
|
|
123
126
|
Object.defineProperty(exports, "stateFileWriterSchema", { enumerable: true, get: function () { return stateFile_1.stateFileWriterSchema; } });
|