@cortexkit/antigravity-auth-core 3.0.10 → 3.0.12
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/agy-transport.d.ts.map +1 -1
- package/dist/agy-transport.js +4 -0
- package/dist/agy-transport.js.map +1 -1
- package/dist/common-auth-embedded/claustrum/consumer.d.ts +7 -1
- package/dist/common-auth-embedded/claustrum/consumer.js +17 -2
- package/dist/common-auth-embedded/claustrum/enrollment.d.ts +5 -0
- package/dist/common-auth-embedded/claustrum/enrollment.js +27 -0
- package/dist/common-auth-embedded/claustrum/errors.d.ts +1 -1
- package/dist/common-auth-embedded/claustrum/index.d.ts +1 -1
- package/dist/common-auth-embedded/claustrum/index.js +1 -1
- package/dist/common-auth-embedded/claustrum/quota-writer.js +4 -54
- package/dist/common-auth-embedded/claustrum/roster.d.ts +31 -0
- package/dist/common-auth-embedded/claustrum/roster.js +72 -0
- package/dist/common-auth-embedded/commands/builtins.d.ts +37 -0
- package/dist/common-auth-embedded/commands/builtins.js +95 -13
- package/dist/common-auth-embedded/commands/index.d.ts +1 -1
- package/dist/common-auth-embedded/fs/private-files.d.ts +2 -0
- package/dist/common-auth-embedded/fs/private-files.js +49 -3
- package/dist/common-auth-embedded/quota/pending.js +48 -0
- package/dist/common-auth-embedded/source-output.json +86 -70
- package/dist/common-auth-embedded/store/attribution.d.ts +5 -0
- package/dist/common-auth-embedded/store/attribution.js +39 -25
- package/dist/common-auth-embedded/store/pool.d.ts +17 -0
- package/dist/common-auth-embedded/store/pool.js +18 -3
- package/dist/common-auth-embedded/store/pull.js +3 -1
- package/dist/common-auth-embedded/store/quota-writer.js +298 -0
- package/dist/common-auth-embedded/store/runtime.d.ts +2 -0
- package/dist/pre-response-deadline.d.ts.map +1 -1
- package/dist/pre-response-deadline.js +6 -5
- package/dist/pre-response-deadline.js.map +1 -1
- package/dist/quota-manager.d.ts +3 -3
- package/dist/quota-manager.d.ts.map +1 -1
- package/dist/quota-manager.js +59 -36
- package/dist/quota-manager.js.map +1 -1
- package/dist/transform/gemini.d.ts.map +1 -1
- package/dist/transform/gemini.js +12 -0
- package/dist/transform/gemini.js.map +1 -1
- package/dist/vault-enrollment-authority.d.ts +2 -0
- package/dist/vault-enrollment-authority.d.ts.map +1 -1
- package/dist/vault-enrollment-authority.js +2 -0
- package/dist/vault-enrollment-authority.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// the same locks as any other writer of those files.
|
|
5
5
|
import { formatQuota, isQuotaMap, projectQuota, quotaWindowName, } from '../quota/index.js';
|
|
6
6
|
import { DEFAULT_FORMER_MAIN_ID, orderForPlacement, resolveRoutingMode, } from '../routing/index.js';
|
|
7
|
-
import { projectFailure, } from './seam.js';
|
|
7
|
+
import { CommandError, projectFailure, } from './seam.js';
|
|
8
8
|
/** `disabledReason` recorded when the user disables an account from the menu. */
|
|
9
9
|
export const MENU_DISABLED_REASON = 'disabled from the command menu';
|
|
10
10
|
function isRecord(value) {
|
|
@@ -65,13 +65,16 @@ function addedText(name, result) {
|
|
|
65
65
|
function failureMessage(error) {
|
|
66
66
|
return projectFailure(error).text;
|
|
67
67
|
}
|
|
68
|
-
async function snapshot(
|
|
68
|
+
async function snapshot(options) {
|
|
69
|
+
const { store } = options;
|
|
69
70
|
const load = await store.read();
|
|
70
71
|
const read = await store.readSettings();
|
|
72
|
+
const vault = await options.routing?.vaultOrder?.();
|
|
71
73
|
return {
|
|
72
74
|
load,
|
|
73
75
|
rows: distinctRows(load),
|
|
74
76
|
settings: read.status === 'error' ? {} : read.settings,
|
|
77
|
+
...(vault ? { vault } : {}),
|
|
75
78
|
};
|
|
76
79
|
}
|
|
77
80
|
function accountView(row, options) {
|
|
@@ -323,6 +326,73 @@ function quotaSection(options, snap) {
|
|
|
323
326
|
},
|
|
324
327
|
};
|
|
325
328
|
}
|
|
329
|
+
/**
|
|
330
|
+
* Sets the vault order. The roster's own refusal of the list (`invalid-order`:
|
|
331
|
+
* an account left out, which it counts without naming) is shown with its own
|
|
332
|
+
* message; any other failure is projected as usual. The kind is read from
|
|
333
|
+
* the error object so the menu does not import the vault client.
|
|
334
|
+
*/
|
|
335
|
+
async function reorderVault(vault, order) {
|
|
336
|
+
try {
|
|
337
|
+
return await vault.reorder(order);
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
if (error instanceof Error &&
|
|
341
|
+
error.name === 'ClaustrumConsumerError' &&
|
|
342
|
+
error.kind === 'invalid-order')
|
|
343
|
+
throw new CommandError('vault-invalid-order', error.message, {
|
|
344
|
+
cause: error,
|
|
345
|
+
});
|
|
346
|
+
throw error;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function invalidVaultOrder(message) {
|
|
350
|
+
return new CommandError('vault-invalid-order', message);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* How the Routing section names vault accounts: by label, since route ids
|
|
354
|
+
* are long and opaque. A typed entry may be a label or a route id, and must
|
|
355
|
+
* name exactly one account. Refusals quote only the entry the user typed.
|
|
356
|
+
*/
|
|
357
|
+
function vaultNames(vault) {
|
|
358
|
+
const rows = vault.rows.map((row) => ({
|
|
359
|
+
id: row.id,
|
|
360
|
+
label: row.label.trim() || row.id,
|
|
361
|
+
}));
|
|
362
|
+
const matches = (entry) => rows.filter((row) => row.id === entry || row.label === entry);
|
|
363
|
+
return {
|
|
364
|
+
ids: rows.map((row) => row.id),
|
|
365
|
+
nameOf: (id) => rows.find((row) => row.id === id)?.label ?? id,
|
|
366
|
+
/**
|
|
367
|
+
* What the order input starts with for an account: its label when
|
|
368
|
+
* typing that label back names this account alone, else its route id
|
|
369
|
+
* (two accounts sharing a label, or a label with a comma or line break
|
|
370
|
+
* in it, either of which would split it into two entries).
|
|
371
|
+
*/
|
|
372
|
+
entryOf: (id) => {
|
|
373
|
+
const row = rows.find((entry) => entry.id === id);
|
|
374
|
+
return row && !/[,\n]/.test(row.label) && matches(row.label).length === 1
|
|
375
|
+
? row.label
|
|
376
|
+
: id;
|
|
377
|
+
},
|
|
378
|
+
/** The route ids the typed entries name, in order; refuses before any write. */
|
|
379
|
+
resolve: (entries) => {
|
|
380
|
+
const ids = [];
|
|
381
|
+
for (const entry of entries) {
|
|
382
|
+
const found = matches(entry);
|
|
383
|
+
if (found.length === 0)
|
|
384
|
+
throw invalidVaultOrder(`"${entry}" is not a vault account.`);
|
|
385
|
+
if (found.length > 1)
|
|
386
|
+
throw invalidVaultOrder(`"${entry}" matches more than one vault account; enter those accounts by route id.`);
|
|
387
|
+
const id = found[0].id;
|
|
388
|
+
if (ids.includes(id))
|
|
389
|
+
throw invalidVaultOrder(`"${entry}" names an account already in the order.`);
|
|
390
|
+
ids.push(id);
|
|
391
|
+
}
|
|
392
|
+
return ids;
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
}
|
|
326
396
|
function routingSection(options, snap) {
|
|
327
397
|
const { store, extraLocks } = options;
|
|
328
398
|
const locks = extraLocks ? { extraLocks } : {};
|
|
@@ -336,14 +406,18 @@ function routingSection(options, snap) {
|
|
|
336
406
|
? raw
|
|
337
407
|
: 'ordered';
|
|
338
408
|
const resolved = resolveRoutingMode(current);
|
|
339
|
-
|
|
409
|
+
// In vault mode routing tries the vault accounts, so their order is the
|
|
410
|
+
// one shown and set here; the pool roster's order is not used.
|
|
411
|
+
const vault = snap.vault ? vaultNames(snap.vault) : undefined;
|
|
412
|
+
const ids = vault ? vault.ids : snap.rows.map((row) => row.id);
|
|
413
|
+
const nameOf = (id) => (vault ? vault.nameOf(id) : id);
|
|
340
414
|
const tried = orderForPlacement(ids, resolved.placement, options.routing?.formerMainId ?? DEFAULT_FORMER_MAIN_ID);
|
|
341
415
|
const label = choices.find((choice) => choice.value === current)?.label ?? current;
|
|
342
416
|
const lines = [`Mode: ${label}`];
|
|
343
417
|
if (ids.length > 0)
|
|
344
|
-
lines.push(
|
|
418
|
+
lines.push(`${vault ? 'Vault account order' : 'Roster order'}: ${ids.map(nameOf).join(', ')}`);
|
|
345
419
|
if (resolved.mode === 'ordered' && tried.join() !== ids.join())
|
|
346
|
-
lines.push(`Tried in order: ${tried.join(', ')}`);
|
|
420
|
+
lines.push(`Tried in order: ${tried.map(nameOf).join(', ')}`);
|
|
347
421
|
const actions = [
|
|
348
422
|
{
|
|
349
423
|
id: 'mode',
|
|
@@ -371,19 +445,27 @@ function routingSection(options, snap) {
|
|
|
371
445
|
{
|
|
372
446
|
kind: 'text',
|
|
373
447
|
id: 'order',
|
|
374
|
-
label:
|
|
375
|
-
|
|
448
|
+
label: vault
|
|
449
|
+
? 'Vault accounts, first to last, separated by commas'
|
|
450
|
+
: 'Account ids, first to last',
|
|
451
|
+
value: vault ? ids.map(vault.entryOf).join(', ') : ids.join(', '),
|
|
376
452
|
required: true,
|
|
377
453
|
},
|
|
378
454
|
],
|
|
379
455
|
run: async ({ values }) => {
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
const
|
|
456
|
+
const text = String(values.order);
|
|
457
|
+
// A vault label may contain spaces, so vault entries are separated by
|
|
458
|
+
// commas or line breaks, not spaces; pool ids never contain spaces.
|
|
459
|
+
const entries = text
|
|
460
|
+
.split(vault ? /[,\n]+/ : /[\s,]+/)
|
|
461
|
+
.map((entry) => entry.trim())
|
|
462
|
+
.filter((entry) => entry.length > 0);
|
|
463
|
+
const result = snap.vault && vault
|
|
464
|
+
? await reorderVault(snap.vault, vault.resolve(entries))
|
|
465
|
+
: await store.reorder(entries, locks);
|
|
384
466
|
return result.outcome === 'unchanged'
|
|
385
467
|
? 'The order is unchanged.'
|
|
386
|
-
: `Order set to ${result.ids.join(', ')}.`;
|
|
468
|
+
: `Order set to ${result.ids.map(nameOf).join(', ')}.`;
|
|
387
469
|
},
|
|
388
470
|
});
|
|
389
471
|
return {
|
|
@@ -524,7 +606,7 @@ function limitsSection(options, snap) {
|
|
|
524
606
|
}
|
|
525
607
|
/** The four built-in sections, in their fixed order, from one read of the store. */
|
|
526
608
|
export async function builtinSections(options) {
|
|
527
|
-
const snap = await snapshot(options
|
|
609
|
+
const snap = await snapshot(options);
|
|
528
610
|
return [
|
|
529
611
|
accountsSection(options, snap),
|
|
530
612
|
quotaSection(options, snap),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { AccountsSectionOptions, LimitsSectionOptions, LoginOutcome, QuotaSectionOptions, RoutingSectionOptions, } from './builtins.js';
|
|
1
|
+
export type { AccountsSectionOptions, LimitsSectionOptions, LoginOutcome, QuotaSectionOptions, RoutingSectionOptions, VaultRoutingOrder, } from './builtins.js';
|
|
2
2
|
export { MENU_DISABLED_REASON } from './builtins.js';
|
|
3
3
|
export type { CommandMenu, CommandMenuOptions, StoreSectionSlot, } from './menu.js';
|
|
4
4
|
export { createCommandMenu, parseApplyRequest } from './menu.js';
|
|
@@ -5,6 +5,8 @@ type Backend = typeof import('@cortexkit/private-files');
|
|
|
5
5
|
type Kind = 'file' | 'directory';
|
|
6
6
|
/** Tests inject a backend here; production always imports the private-files package. */
|
|
7
7
|
export declare function setPrivateFilesBackendForTest(api?: Backend): void;
|
|
8
|
+
/** The fixed `reason` of a refusal because the Windows native addon did not load. */
|
|
9
|
+
export declare const PRIVATE_FILES_UNAVAILABLE_REASON = "native-addon-unavailable";
|
|
8
10
|
export declare class PrivateFileError extends Error {
|
|
9
11
|
readonly path: string;
|
|
10
12
|
readonly stage: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { lstat, readFile, rename, unlink } from 'node:fs/promises';
|
|
3
|
-
import {
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
5
|
export const windowsPrivateFiles = process.platform === 'win32';
|
|
5
6
|
const migrationNotices = new Set();
|
|
6
7
|
function ioCode(detail) {
|
|
@@ -20,8 +21,51 @@ let backend;
|
|
|
20
21
|
export function setPrivateFilesBackendForTest(api) {
|
|
21
22
|
backend = api ? Promise.resolve(api) : undefined;
|
|
22
23
|
}
|
|
24
|
+
/** The fixed `reason` of a refusal because the Windows native addon did not load. */
|
|
25
|
+
export const PRIVATE_FILES_UNAVAILABLE_REASON = 'native-addon-unavailable';
|
|
26
|
+
function privateFilesUnavailable(cause) {
|
|
27
|
+
return Object.assign(new Error('Windows private-files native addon is unavailable', { cause }), {
|
|
28
|
+
code: 'ERR_PRIVATE_FILES_UNAVAILABLE',
|
|
29
|
+
reason: PRIVATE_FILES_UNAVAILABLE_REASON,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function isUnavailable(api, error) {
|
|
33
|
+
return (error instanceof api.PrivateFilesUnavailableError ||
|
|
34
|
+
error?.code ===
|
|
35
|
+
'ERR_PRIVATE_FILES_UNAVAILABLE');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Importing @cortexkit/private-files succeeds even when its Windows addon
|
|
39
|
+
* cannot load: the package loads the addon on first use, and some of its
|
|
40
|
+
* checks then report the failure as an ordinary refusal such as
|
|
41
|
+
* `unsupported-filesystem`. So prove the addon loads before handing the
|
|
42
|
+
* package out. Verifying a path that does not exist loads the addon first and
|
|
43
|
+
* then fails harmlessly; only the package's own "unavailable" error means the
|
|
44
|
+
* addon is missing.
|
|
45
|
+
*/
|
|
46
|
+
async function assertNativeAddonLoads(api) {
|
|
47
|
+
try {
|
|
48
|
+
await api.verifyPrivatePath(join(tmpdir(), `.common-auth-private-files-probe-${randomUUID()}`), 'file');
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if (isUnavailable(api, error))
|
|
52
|
+
throw privateFilesUnavailable(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Load the package once per process. On Windows a failed import or addon load
|
|
57
|
+
* is kept, so every later private-file operation refuses at once with
|
|
58
|
+
* ERR_PRIVATE_FILES_UNAVAILABLE. There is no fallback to permission bits:
|
|
59
|
+
* they do not protect files on Windows.
|
|
60
|
+
*/
|
|
23
61
|
function loadBackend() {
|
|
24
|
-
backend ??= import('@cortexkit/private-files')
|
|
62
|
+
backend ??= import('@cortexkit/private-files').then(async (api) => {
|
|
63
|
+
if (windowsPrivateFiles)
|
|
64
|
+
await assertNativeAddonLoads(api);
|
|
65
|
+
return api;
|
|
66
|
+
}, (cause) => {
|
|
67
|
+
throw windowsPrivateFiles ? privateFilesUnavailable(cause) : cause;
|
|
68
|
+
});
|
|
25
69
|
return backend;
|
|
26
70
|
}
|
|
27
71
|
export class PrivateFileError extends Error {
|
|
@@ -38,7 +82,9 @@ export class PrivateFileError extends Error {
|
|
|
38
82
|
orphanPath;
|
|
39
83
|
constructor(path, stage, cause) {
|
|
40
84
|
const detail = cause;
|
|
41
|
-
super(
|
|
85
|
+
super(detail?.code === 'ERR_PRIVATE_FILES_UNAVAILABLE'
|
|
86
|
+
? `Private file refused at ${stage}: ${path} (${PRIVATE_FILES_UNAVAILABLE_REASON}). The Windows native addon of @cortexkit/private-files could not be loaded, so owner-only access cannot be enforced and nothing was read or written. Reinstall the plugin so the private-files Windows prebuild for this architecture is present; Windows has no safe fallback to permission bits.`
|
|
87
|
+
: `Private file refused at ${stage}: ${path} (${detail?.reason ?? detail?.code ?? 'io-error'}). Keep this file in a folder that only you, the system or administrators can change, such as a folder in your home directory. If other users could read the file before, sign in again to replace the credentials it held. On Windows the file must also be on a local drive that keeps Windows file permissions, such as NTFS.`, { cause });
|
|
42
88
|
this.path = path;
|
|
43
89
|
this.stage = stage;
|
|
44
90
|
this.name = 'PrivateFileError';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Use the same independently dated parts as mergeQuotaObservation. A header
|
|
2
|
+
// reading cannot erase a poll-only window, counter, credits record or budget.
|
|
3
|
+
export function quotaFields(publication, witness = '') {
|
|
4
|
+
const result = new Map();
|
|
5
|
+
const { observation } = publication;
|
|
6
|
+
const add = (key, at, part) => result.set(`${witness}:${key}`, {
|
|
7
|
+
at,
|
|
8
|
+
order: 0,
|
|
9
|
+
publication: { ...publication, observation: part },
|
|
10
|
+
});
|
|
11
|
+
const keyFor = (scope, label) => JSON.stringify([scope ?? 'all', label]);
|
|
12
|
+
const read = new Set();
|
|
13
|
+
for (const reading of observation.readings ?? []) {
|
|
14
|
+
const key = keyFor(reading.scope, reading.label);
|
|
15
|
+
read.add(key);
|
|
16
|
+
add(key, observation.checkedAt, {
|
|
17
|
+
checkedAt: observation.checkedAt,
|
|
18
|
+
readings: [{ ...reading }],
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
for (const pair of observation.coverage ?? []) {
|
|
22
|
+
const key = keyFor(pair.scope, pair.label);
|
|
23
|
+
if (!read.has(key))
|
|
24
|
+
add(key, observation.checkedAt, {
|
|
25
|
+
checkedAt: observation.checkedAt,
|
|
26
|
+
coverage: [{ ...pair }],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (observation.budget)
|
|
30
|
+
add('budget', observation.checkedAt, {
|
|
31
|
+
checkedAt: observation.checkedAt,
|
|
32
|
+
budget: { ...observation.budget },
|
|
33
|
+
});
|
|
34
|
+
for (const [name, counter] of Object.entries(observation.counters ?? {})) {
|
|
35
|
+
add(`counter:${name}`, counter.checkedAt, {
|
|
36
|
+
checkedAt: observation.checkedAt,
|
|
37
|
+
counters: { [name]: { ...counter } },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (observation.credits)
|
|
41
|
+
add('credits', observation.credits.checkedAt, {
|
|
42
|
+
checkedAt: observation.checkedAt,
|
|
43
|
+
credits: { ...observation.credits },
|
|
44
|
+
});
|
|
45
|
+
if (!result.size)
|
|
46
|
+
add('empty', observation.checkedAt, { checkedAt: observation.checkedAt });
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"package": "@cortexkit/common-auth",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.26.0",
|
|
5
5
|
"artifactStatus": "published",
|
|
6
6
|
"publicRoots": {
|
|
7
7
|
"./store": {
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"import": "./dist/pi-slot/index.js"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
"input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.
|
|
41
|
-
"tarballSha256": "
|
|
42
|
-
"sri": "sha512-
|
|
43
|
-
"canonicalFiles":
|
|
44
|
-
"canonicalBytes":
|
|
40
|
+
"input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.26.0.tgz",
|
|
41
|
+
"tarballSha256": "a5a6cb7051ee8c45e86e19cf7a918d0e28ce1b6a80301e982efbc7bb4b98208d",
|
|
42
|
+
"sri": "sha512-qTmQ9aMG+HcyDbhKie8Nq9wxKMRQ6GXH2hKq8Fab9kHqFfzswdp2NpXofGY52RhQ2VxuyMOQr5T6lUrkbny5VQ==",
|
|
43
|
+
"canonicalFiles": 141,
|
|
44
|
+
"canonicalBytes": 888503,
|
|
45
45
|
"generator": {
|
|
46
46
|
"path": "packages/opencode/scripts/embed-common-auth.ts",
|
|
47
47
|
"version": 3,
|
|
48
|
-
"sha256": "
|
|
48
|
+
"sha256": "89dbeb07d77e0657abeb72a40fcc03a900e98292956865252349a01a15999ed0"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
{
|
|
@@ -227,17 +227,17 @@
|
|
|
227
227
|
{
|
|
228
228
|
"source": "package/dist/claustrum/consumer.d.ts",
|
|
229
229
|
"output": "claustrum/consumer.d.ts",
|
|
230
|
-
"bytes":
|
|
231
|
-
"sourceSha256": "
|
|
232
|
-
"outputSha256": "
|
|
230
|
+
"bytes": 9907,
|
|
231
|
+
"sourceSha256": "8001ce3f928af1bc9124223071eb9c85ea3273436cd7be073c588217f942b248",
|
|
232
|
+
"outputSha256": "8001ce3f928af1bc9124223071eb9c85ea3273436cd7be073c588217f942b248",
|
|
233
233
|
"transform": "verbatim"
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
"source": "package/dist/claustrum/consumer.js",
|
|
237
237
|
"output": "claustrum/consumer.js",
|
|
238
|
-
"bytes":
|
|
239
|
-
"sourceSha256": "
|
|
240
|
-
"outputSha256": "
|
|
238
|
+
"bytes": 26470,
|
|
239
|
+
"sourceSha256": "b2087accd6e8759fb49173dc744243ed703520d5011386ef514672be8fe79fbe",
|
|
240
|
+
"outputSha256": "b2087accd6e8759fb49173dc744243ed703520d5011386ef514672be8fe79fbe",
|
|
241
241
|
"transform": "verbatim"
|
|
242
242
|
},
|
|
243
243
|
{
|
|
@@ -259,25 +259,25 @@
|
|
|
259
259
|
{
|
|
260
260
|
"source": "package/dist/claustrum/enrollment.d.ts",
|
|
261
261
|
"output": "claustrum/enrollment.d.ts",
|
|
262
|
-
"bytes":
|
|
263
|
-
"sourceSha256": "
|
|
264
|
-
"outputSha256": "
|
|
262
|
+
"bytes": 7976,
|
|
263
|
+
"sourceSha256": "d6b4e8561ccc0ff2f9b4386856c5fe3dc7c475e13f98314a0666d0b20458d43b",
|
|
264
|
+
"outputSha256": "d6b4e8561ccc0ff2f9b4386856c5fe3dc7c475e13f98314a0666d0b20458d43b",
|
|
265
265
|
"transform": "verbatim"
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
"source": "package/dist/claustrum/enrollment.js",
|
|
269
269
|
"output": "claustrum/enrollment.js",
|
|
270
|
-
"bytes":
|
|
271
|
-
"sourceSha256": "
|
|
272
|
-
"outputSha256": "
|
|
270
|
+
"bytes": 35060,
|
|
271
|
+
"sourceSha256": "a9ca3a23778cc86ab9798051ba19dcb3b2b8e3dc4c4fda356cbd56eca50097db",
|
|
272
|
+
"outputSha256": "a9ca3a23778cc86ab9798051ba19dcb3b2b8e3dc4c4fda356cbd56eca50097db",
|
|
273
273
|
"transform": "verbatim"
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
276
|
"source": "package/dist/claustrum/errors.d.ts",
|
|
277
277
|
"output": "claustrum/errors.d.ts",
|
|
278
|
-
"bytes":
|
|
279
|
-
"sourceSha256": "
|
|
280
|
-
"outputSha256": "
|
|
278
|
+
"bytes": 1163,
|
|
279
|
+
"sourceSha256": "a6e5ec8be3ae7160b78456e642b440494604c2e2cdc987550744521dc873fb40",
|
|
280
|
+
"outputSha256": "a6e5ec8be3ae7160b78456e642b440494604c2e2cdc987550744521dc873fb40",
|
|
281
281
|
"transform": "verbatim"
|
|
282
282
|
},
|
|
283
283
|
{
|
|
@@ -307,17 +307,17 @@
|
|
|
307
307
|
{
|
|
308
308
|
"source": "package/dist/claustrum/index.d.ts",
|
|
309
309
|
"output": "claustrum/index.d.ts",
|
|
310
|
-
"bytes":
|
|
311
|
-
"sourceSha256": "
|
|
312
|
-
"outputSha256": "
|
|
310
|
+
"bytes": 3844,
|
|
311
|
+
"sourceSha256": "36c0b94c5e18972463f48bfd7e1506d9655372aa8df065786b3a47d199cdb5e0",
|
|
312
|
+
"outputSha256": "36c0b94c5e18972463f48bfd7e1506d9655372aa8df065786b3a47d199cdb5e0",
|
|
313
313
|
"transform": "verbatim"
|
|
314
314
|
},
|
|
315
315
|
{
|
|
316
316
|
"source": "package/dist/claustrum/index.js",
|
|
317
317
|
"output": "claustrum/index.js",
|
|
318
|
-
"bytes":
|
|
319
|
-
"sourceSha256": "
|
|
320
|
-
"outputSha256": "
|
|
318
|
+
"bytes": 2529,
|
|
319
|
+
"sourceSha256": "42c9e67bb5ec6749de488933a56fb3ee253c3b9e3588d692f171d87c59bcbd89",
|
|
320
|
+
"outputSha256": "42c9e67bb5ec6749de488933a56fb3ee253c3b9e3588d692f171d87c59bcbd89",
|
|
321
321
|
"transform": "verbatim"
|
|
322
322
|
},
|
|
323
323
|
{
|
|
@@ -363,25 +363,25 @@
|
|
|
363
363
|
{
|
|
364
364
|
"source": "package/dist/claustrum/quota-writer.js",
|
|
365
365
|
"output": "claustrum/quota-writer.js",
|
|
366
|
-
"bytes":
|
|
367
|
-
"sourceSha256": "
|
|
368
|
-
"outputSha256": "
|
|
366
|
+
"bytes": 7579,
|
|
367
|
+
"sourceSha256": "0054a12ca94aab2eecf50f9b5e090879ff184e7f286cc979f32d311e22011906",
|
|
368
|
+
"outputSha256": "0054a12ca94aab2eecf50f9b5e090879ff184e7f286cc979f32d311e22011906",
|
|
369
369
|
"transform": "verbatim"
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
"source": "package/dist/claustrum/roster.d.ts",
|
|
373
373
|
"output": "claustrum/roster.d.ts",
|
|
374
|
-
"bytes":
|
|
375
|
-
"sourceSha256": "
|
|
376
|
-
"outputSha256": "
|
|
374
|
+
"bytes": 12574,
|
|
375
|
+
"sourceSha256": "c9ab3a89e04f72de09c5f15ccf1436b91f8a245e2253f24ec5998120058aebe7",
|
|
376
|
+
"outputSha256": "c9ab3a89e04f72de09c5f15ccf1436b91f8a245e2253f24ec5998120058aebe7",
|
|
377
377
|
"transform": "verbatim"
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
"source": "package/dist/claustrum/roster.js",
|
|
381
381
|
"output": "claustrum/roster.js",
|
|
382
|
-
"bytes":
|
|
383
|
-
"sourceSha256": "
|
|
384
|
-
"outputSha256": "
|
|
382
|
+
"bytes": 30876,
|
|
383
|
+
"sourceSha256": "d02184fd4d32aa8917369919edea4c44328e7332e30f3ddc41ce350e5fd1df07",
|
|
384
|
+
"outputSha256": "d02184fd4d32aa8917369919edea4c44328e7332e30f3ddc41ce350e5fd1df07",
|
|
385
385
|
"transform": "verbatim"
|
|
386
386
|
},
|
|
387
387
|
{
|
|
@@ -403,25 +403,25 @@
|
|
|
403
403
|
{
|
|
404
404
|
"source": "package/dist/commands/builtins.d.ts",
|
|
405
405
|
"output": "commands/builtins.d.ts",
|
|
406
|
-
"bytes":
|
|
407
|
-
"sourceSha256": "
|
|
408
|
-
"outputSha256": "
|
|
406
|
+
"bytes": 4576,
|
|
407
|
+
"sourceSha256": "5ab6cbab696c91fef0fc7288d4b82803cd0bac809b68f939d73671505fc1d894",
|
|
408
|
+
"outputSha256": "5ab6cbab696c91fef0fc7288d4b82803cd0bac809b68f939d73671505fc1d894",
|
|
409
409
|
"transform": "verbatim"
|
|
410
410
|
},
|
|
411
411
|
{
|
|
412
412
|
"source": "package/dist/commands/builtins.js",
|
|
413
413
|
"output": "commands/builtins.js",
|
|
414
|
-
"bytes":
|
|
415
|
-
"sourceSha256": "
|
|
416
|
-
"outputSha256": "
|
|
414
|
+
"bytes": 25155,
|
|
415
|
+
"sourceSha256": "c5f7fca0e36dc2f3253b88e7600d3dbed6a193d2b8abbf07d16913b6b46551e6",
|
|
416
|
+
"outputSha256": "c5f7fca0e36dc2f3253b88e7600d3dbed6a193d2b8abbf07d16913b6b46551e6",
|
|
417
417
|
"transform": "verbatim"
|
|
418
418
|
},
|
|
419
419
|
{
|
|
420
420
|
"source": "package/dist/commands/index.d.ts",
|
|
421
421
|
"output": "commands/index.d.ts",
|
|
422
|
-
"bytes":
|
|
423
|
-
"sourceSha256": "
|
|
424
|
-
"outputSha256": "
|
|
422
|
+
"bytes": 1100,
|
|
423
|
+
"sourceSha256": "4be7eec728211b7ad707121b1f2bbe2c219574aaa4e1c5be3f8964b185d4377c",
|
|
424
|
+
"outputSha256": "4be7eec728211b7ad707121b1f2bbe2c219574aaa4e1c5be3f8964b185d4377c",
|
|
425
425
|
"transform": "verbatim"
|
|
426
426
|
},
|
|
427
427
|
{
|
|
@@ -547,17 +547,17 @@
|
|
|
547
547
|
{
|
|
548
548
|
"source": "package/dist/fs/private-files.d.ts",
|
|
549
549
|
"output": "fs/private-files.d.ts",
|
|
550
|
-
"bytes":
|
|
551
|
-
"sourceSha256": "
|
|
552
|
-
"outputSha256": "
|
|
550
|
+
"bytes": 3398,
|
|
551
|
+
"sourceSha256": "b344509a32fcd983f09e5814286630a53c8e577ad1b973eabe19f8e58659e8d3",
|
|
552
|
+
"outputSha256": "b344509a32fcd983f09e5814286630a53c8e577ad1b973eabe19f8e58659e8d3",
|
|
553
553
|
"transform": "verbatim"
|
|
554
554
|
},
|
|
555
555
|
{
|
|
556
556
|
"source": "package/dist/fs/private-files.js",
|
|
557
557
|
"output": "fs/private-files.js",
|
|
558
|
-
"bytes":
|
|
559
|
-
"sourceSha256": "
|
|
560
|
-
"outputSha256": "
|
|
558
|
+
"bytes": 14779,
|
|
559
|
+
"sourceSha256": "114c06ce4c0998087878d99c5dc37425e90d5fad205f57fe0bdf9694e3c8e31d",
|
|
560
|
+
"outputSha256": "114c06ce4c0998087878d99c5dc37425e90d5fad205f57fe0bdf9694e3c8e31d",
|
|
561
561
|
"transform": "verbatim"
|
|
562
562
|
},
|
|
563
563
|
{
|
|
@@ -776,6 +776,14 @@
|
|
|
776
776
|
"outputSha256": "b1d76faf1fb480b97ef1886ce75dbd2156002baedc39249468559cb4eece5bbb",
|
|
777
777
|
"transform": "verbatim"
|
|
778
778
|
},
|
|
779
|
+
{
|
|
780
|
+
"source": "package/dist/quota/pending.js",
|
|
781
|
+
"output": "quota/pending.js",
|
|
782
|
+
"bytes": 1876,
|
|
783
|
+
"sourceSha256": "e757a3fa9f8440190668c6154468a5baec8a84e20d6c831a6d7935c3b9bebe29",
|
|
784
|
+
"outputSha256": "e757a3fa9f8440190668c6154468a5baec8a84e20d6c831a6d7935c3b9bebe29",
|
|
785
|
+
"transform": "verbatim"
|
|
786
|
+
},
|
|
779
787
|
{
|
|
780
788
|
"source": "package/dist/quota/projection.d.ts",
|
|
781
789
|
"output": "quota/projection.d.ts",
|
|
@@ -875,17 +883,17 @@
|
|
|
875
883
|
{
|
|
876
884
|
"source": "package/dist/store/attribution.d.ts",
|
|
877
885
|
"output": "store/attribution.d.ts",
|
|
878
|
-
"bytes":
|
|
879
|
-
"sourceSha256": "
|
|
880
|
-
"outputSha256": "
|
|
886
|
+
"bytes": 1951,
|
|
887
|
+
"sourceSha256": "16919a55fe944b459ff511c125ac2ba34714949d38db006c8ab047dd48ab51a6",
|
|
888
|
+
"outputSha256": "16919a55fe944b459ff511c125ac2ba34714949d38db006c8ab047dd48ab51a6",
|
|
881
889
|
"transform": "verbatim"
|
|
882
890
|
},
|
|
883
891
|
{
|
|
884
892
|
"source": "package/dist/store/attribution.js",
|
|
885
893
|
"output": "store/attribution.js",
|
|
886
|
-
"bytes":
|
|
887
|
-
"sourceSha256": "
|
|
888
|
-
"outputSha256": "
|
|
894
|
+
"bytes": 3280,
|
|
895
|
+
"sourceSha256": "5b54980a4f158c9b61cd90c4a83a14e83268fe98101fc88409500bb73d1126bb",
|
|
896
|
+
"outputSha256": "5b54980a4f158c9b61cd90c4a83a14e83268fe98101fc88409500bb73d1126bb",
|
|
889
897
|
"transform": "verbatim"
|
|
890
898
|
},
|
|
891
899
|
{
|
|
@@ -971,17 +979,17 @@
|
|
|
971
979
|
{
|
|
972
980
|
"source": "package/dist/store/pool.d.ts",
|
|
973
981
|
"output": "store/pool.d.ts",
|
|
974
|
-
"bytes":
|
|
975
|
-
"sourceSha256": "
|
|
976
|
-
"outputSha256": "
|
|
982
|
+
"bytes": 11743,
|
|
983
|
+
"sourceSha256": "0693e165ef937c22c375a3f63d01209c844d101ddf1a6702c8acc99bb5fc2a9d",
|
|
984
|
+
"outputSha256": "0693e165ef937c22c375a3f63d01209c844d101ddf1a6702c8acc99bb5fc2a9d",
|
|
977
985
|
"transform": "verbatim"
|
|
978
986
|
},
|
|
979
987
|
{
|
|
980
988
|
"source": "package/dist/store/pool.js",
|
|
981
989
|
"output": "store/pool.js",
|
|
982
|
-
"bytes":
|
|
983
|
-
"sourceSha256": "
|
|
984
|
-
"outputSha256": "
|
|
990
|
+
"bytes": 6332,
|
|
991
|
+
"sourceSha256": "45a696753691027dfcadd8e94b38b111ad5085ba1cb4f769225b15efc68125d7",
|
|
992
|
+
"outputSha256": "45a696753691027dfcadd8e94b38b111ad5085ba1cb4f769225b15efc68125d7",
|
|
985
993
|
"transform": "verbatim"
|
|
986
994
|
},
|
|
987
995
|
{
|
|
@@ -1027,9 +1035,17 @@
|
|
|
1027
1035
|
{
|
|
1028
1036
|
"source": "package/dist/store/pull.js",
|
|
1029
1037
|
"output": "store/pull.js",
|
|
1030
|
-
"bytes":
|
|
1031
|
-
"sourceSha256": "
|
|
1032
|
-
"outputSha256": "
|
|
1038
|
+
"bytes": 5602,
|
|
1039
|
+
"sourceSha256": "512a723a49dae3be50aa8c67ca8f6a5c165ec72e8a991a166d8d93e33e895350",
|
|
1040
|
+
"outputSha256": "512a723a49dae3be50aa8c67ca8f6a5c165ec72e8a991a166d8d93e33e895350",
|
|
1041
|
+
"transform": "verbatim"
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"source": "package/dist/store/quota-writer.js",
|
|
1045
|
+
"output": "store/quota-writer.js",
|
|
1046
|
+
"bytes": 12396,
|
|
1047
|
+
"sourceSha256": "ade5fdda516011baf11e40f672263364cea07c45bdcbfc11107e22794e9aef21",
|
|
1048
|
+
"outputSha256": "ade5fdda516011baf11e40f672263364cea07c45bdcbfc11107e22794e9aef21",
|
|
1033
1049
|
"transform": "verbatim"
|
|
1034
1050
|
},
|
|
1035
1051
|
{
|
|
@@ -1091,9 +1107,9 @@
|
|
|
1091
1107
|
{
|
|
1092
1108
|
"source": "package/dist/store/runtime.d.ts",
|
|
1093
1109
|
"output": "store/runtime.d.ts",
|
|
1094
|
-
"bytes":
|
|
1095
|
-
"sourceSha256": "
|
|
1096
|
-
"outputSha256": "
|
|
1110
|
+
"bytes": 2100,
|
|
1111
|
+
"sourceSha256": "34efe7252b6c0aead222cab6164340e76e9c22202049158164c56c3b46bab91f",
|
|
1112
|
+
"outputSha256": "34efe7252b6c0aead222cab6164340e76e9c22202049158164c56c3b46bab91f",
|
|
1097
1113
|
"transform": "verbatim"
|
|
1098
1114
|
},
|
|
1099
1115
|
{
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type StoreContext } from './mutate.js';
|
|
1
2
|
import { type StoreRuntime } from './runtime.js';
|
|
3
|
+
import { type PoolRow } from './schema.js';
|
|
2
4
|
/**
|
|
3
5
|
* What a pull or refresh captured about its row (named by id alongside) when
|
|
4
6
|
* it was issued. A result applies only while the row with that id still has
|
|
@@ -20,6 +22,9 @@ export interface Attribution {
|
|
|
20
22
|
credentialEpoch: number;
|
|
21
23
|
identity?: string;
|
|
22
24
|
}
|
|
25
|
+
export declare function assertQuotaEpoch(id: string, attribution: Attribution): void;
|
|
26
|
+
export declare function assertQuotaRow(id: string, attribution: Attribution, row: PoolRow | undefined): asserts row is PoolRow;
|
|
27
|
+
export declare function mergedQuota(ctx: StoreContext, id: string, stored: unknown, observation: unknown): unknown;
|
|
23
28
|
/**
|
|
24
29
|
* Merges a quota observation into a row's stored map under the store locks,
|
|
25
30
|
* after attribution passes. Needs no row lock, so it is permitted from
|