@cortexkit/antigravity-auth-core 3.0.5 → 3.0.7

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 (121) hide show
  1. package/dist/account-manager.d.ts +15 -23
  2. package/dist/account-manager.d.ts.map +1 -1
  3. package/dist/account-manager.js +18 -32
  4. package/dist/account-manager.js.map +1 -1
  5. package/dist/account-migration.d.ts +1 -1
  6. package/dist/account-migration.d.ts.map +1 -1
  7. package/dist/account-migration.js +228 -53
  8. package/dist/account-migration.js.map +1 -1
  9. package/dist/account-repository-types.d.ts +1 -1
  10. package/dist/account-selector.d.ts +13 -27
  11. package/dist/account-selector.d.ts.map +1 -1
  12. package/dist/account-selector.js +38 -145
  13. package/dist/account-selector.js.map +1 -1
  14. package/dist/account-types.d.ts +1 -3
  15. package/dist/account-types.d.ts.map +1 -1
  16. package/dist/agy-transport.d.ts.map +1 -1
  17. package/dist/agy-transport.js +2 -0
  18. package/dist/agy-transport.js.map +1 -1
  19. package/dist/antigravity/oauth.d.ts +5 -1
  20. package/dist/antigravity/oauth.d.ts.map +1 -1
  21. package/dist/antigravity/oauth.js +43 -9
  22. package/dist/antigravity/oauth.js.map +1 -1
  23. package/dist/antigravity-command-menu.d.ts +4 -8
  24. package/dist/antigravity-command-menu.d.ts.map +1 -1
  25. package/dist/antigravity-command-menu.js +14 -37
  26. package/dist/antigravity-command-menu.js.map +1 -1
  27. package/dist/common-auth-embedded/claustrum/consumer.d.ts +44 -4
  28. package/dist/common-auth-embedded/claustrum/consumer.js +134 -2
  29. package/dist/common-auth-embedded/claustrum/custody.d.ts +33 -1
  30. package/dist/common-auth-embedded/claustrum/custody.js +17 -0
  31. package/dist/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
  32. package/dist/common-auth-embedded/claustrum/enrollment.js +6 -1
  33. package/dist/common-auth-embedded/claustrum/index.d.ts +3 -2
  34. package/dist/common-auth-embedded/claustrum/index.js +5 -3
  35. package/dist/common-auth-embedded/claustrum/insula.d.ts +69 -0
  36. package/dist/common-auth-embedded/claustrum/insula.js +152 -0
  37. package/dist/common-auth-embedded/claustrum/roster.d.ts +13 -0
  38. package/dist/common-auth-embedded/claustrum/roster.js +33 -3
  39. package/dist/common-auth-embedded/fs/refresh-file-lock.d.ts +8 -2
  40. package/dist/common-auth-embedded/fs/refresh-file-lock.js +26 -12
  41. package/dist/common-auth-embedded/pi-slot/lock.js +7 -3
  42. package/dist/common-auth-embedded/quota/codec.d.ts +2 -0
  43. package/dist/common-auth-embedded/quota/codec.js +2 -1
  44. package/dist/common-auth-embedded/quota/format.d.ts +40 -3
  45. package/dist/common-auth-embedded/quota/format.js +196 -43
  46. package/dist/common-auth-embedded/quota/index.d.ts +4 -4
  47. package/dist/common-auth-embedded/quota/index.js +2 -2
  48. package/dist/common-auth-embedded/quota/map.d.ts +11 -0
  49. package/dist/common-auth-embedded/quota/map.js +36 -1
  50. package/dist/common-auth-embedded/quota/merge.d.ts +3 -1
  51. package/dist/common-auth-embedded/quota/merge.js +21 -5
  52. package/dist/common-auth-embedded/quota/projection.d.ts +2 -1
  53. package/dist/common-auth-embedded/quota/projection.js +3 -1
  54. package/dist/common-auth-embedded/source-output.json +117 -101
  55. package/dist/common-auth-embedded/store/pool.d.ts +1 -1
  56. package/dist/common-auth-embedded/store/pool.js +0 -1
  57. package/dist/common-auth-embedded/store/refresh-lock.d.ts +0 -1
  58. package/dist/common-auth-embedded/store/refresh-lock.js +0 -1
  59. package/dist/common-auth-embedded/store/schema.d.ts +2 -0
  60. package/dist/common-auth-embedded/store/schema.js +3 -2
  61. package/dist/common-auth-runtime.d.ts +2 -1
  62. package/dist/common-auth-runtime.d.ts.map +1 -1
  63. package/dist/common-auth-runtime.js +2 -1
  64. package/dist/common-auth-runtime.js.map +1 -1
  65. package/dist/constants.d.ts +1 -26
  66. package/dist/constants.d.ts.map +1 -1
  67. package/dist/constants.js +1 -37
  68. package/dist/constants.js.map +1 -1
  69. package/dist/credential-redaction.d.ts +8 -4
  70. package/dist/credential-redaction.d.ts.map +1 -1
  71. package/dist/credential-redaction.js +55 -28
  72. package/dist/credential-redaction.js.map +1 -1
  73. package/dist/index.d.ts +5 -1
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +5 -1
  76. package/dist/index.js.map +1 -1
  77. package/dist/model-registry.d.ts +0 -1
  78. package/dist/model-registry.d.ts.map +1 -1
  79. package/dist/model-registry.js +3 -60
  80. package/dist/model-registry.js.map +1 -1
  81. package/dist/pi-paths.d.ts +14 -0
  82. package/dist/pi-paths.d.ts.map +1 -0
  83. package/dist/pi-paths.js +27 -0
  84. package/dist/pi-paths.js.map +1 -0
  85. package/dist/pre-response-deadline.d.ts +41 -0
  86. package/dist/pre-response-deadline.d.ts.map +1 -0
  87. package/dist/pre-response-deadline.js +150 -0
  88. package/dist/pre-response-deadline.js.map +1 -0
  89. package/dist/quota-manager.d.ts +7 -32
  90. package/dist/quota-manager.d.ts.map +1 -1
  91. package/dist/quota-manager.js +27 -76
  92. package/dist/quota-manager.js.map +1 -1
  93. package/dist/quota-types.d.ts +2 -11
  94. package/dist/quota-types.d.ts.map +1 -1
  95. package/dist/transform/index.d.ts +1 -1
  96. package/dist/transform/index.d.ts.map +1 -1
  97. package/dist/transform/index.js +1 -1
  98. package/dist/transform/index.js.map +1 -1
  99. package/dist/transform/model-resolver.d.ts +4 -28
  100. package/dist/transform/model-resolver.d.ts.map +1 -1
  101. package/dist/transform/model-resolver.js +33 -130
  102. package/dist/transform/model-resolver.js.map +1 -1
  103. package/dist/transform/types.d.ts +0 -5
  104. package/dist/transform/types.d.ts.map +1 -1
  105. package/dist/vault-account-source.d.ts +24 -3
  106. package/dist/vault-account-source.d.ts.map +1 -1
  107. package/dist/vault-account-source.js +39 -12
  108. package/dist/vault-account-source.js.map +1 -1
  109. package/dist/vault-folder-refusal.d.ts +32 -0
  110. package/dist/vault-folder-refusal.d.ts.map +1 -0
  111. package/dist/vault-folder-refusal.js +68 -0
  112. package/dist/vault-folder-refusal.js.map +1 -0
  113. package/dist/vault-grant-reach.d.ts +23 -0
  114. package/dist/vault-grant-reach.d.ts.map +1 -0
  115. package/dist/vault-grant-reach.js +15 -0
  116. package/dist/vault-grant-reach.js.map +1 -0
  117. package/dist/vault-provider-state.d.ts +1 -0
  118. package/dist/vault-provider-state.d.ts.map +1 -1
  119. package/dist/vault-provider-state.js +6 -0
  120. package/dist/vault-provider-state.js.map +1 -1
  121. package/package.json +3 -2
@@ -83,6 +83,40 @@ export function isCreditBudgetEntry(value) {
83
83
  optional(value, 'remaining', isFiniteNumber) &&
84
84
  optional(value, 'unit', isString));
85
85
  }
86
+ function isQuotaCounter(value) {
87
+ return (isRecord(value) &&
88
+ isFiniteNumber(value.value) &&
89
+ Number.isInteger(value.value) &&
90
+ value.value >= 0 &&
91
+ isFiniteNumber(value.checkedAt));
92
+ }
93
+ export function isQuotaCounters(value) {
94
+ return isRecord(value) && Object.values(value).every(isQuotaCounter);
95
+ }
96
+ /** Keep usable counters without letting one malformed count hide a quota map. */
97
+ export function readQuotaCounters(value) {
98
+ if (!isRecord(value))
99
+ return undefined;
100
+ const entries = Object.entries(value).filter(([, entry]) => isQuotaCounter(entry));
101
+ return entries.length === 0
102
+ ? undefined
103
+ : Object.fromEntries(entries);
104
+ }
105
+ /** Decode persisted quota, dropping malformed counters but not limit evidence. */
106
+ export function decodeQuotaMap(value) {
107
+ // A valid map is returned as the same object, so stored quota keeps the
108
+ // identity it had before counters existed; only a map with a malformed
109
+ // counter is copied without it.
110
+ if (isQuotaMap(value))
111
+ return value;
112
+ if (!isRecord(value))
113
+ return undefined;
114
+ const { counters: rawCounters, ...rest } = value;
115
+ if (!isQuotaMap(rest))
116
+ return undefined;
117
+ const counters = readQuotaCounters(rawCounters);
118
+ return { ...rest, ...(counters === undefined ? {} : { counters }) };
119
+ }
86
120
  /**
87
121
  * True when `value` is a well-formed quota map. Unrecognised top-level keys
88
122
  * are tolerated (and preserved by merge) so a newer writer's additions
@@ -101,5 +135,6 @@ export function isQuotaMap(value) {
101
135
  return false;
102
136
  seen.add(key);
103
137
  }
104
- return optional(value, 'budget', isCreditBudgetEntry);
138
+ return (optional(value, 'budget', isCreditBudgetEntry) &&
139
+ optional(value, 'counters', isQuotaCounters));
105
140
  }
@@ -1,4 +1,4 @@
1
- import { type QuotaMap } from './map.js';
1
+ import { type QuotaCounter, type QuotaMap } from './map.js';
2
2
  export interface ObservedReading {
3
3
  /** Defaults to `all`. */
4
4
  scope?: string;
@@ -32,6 +32,8 @@ export interface QuotaObservation {
32
32
  coverage?: ObservedPair[];
33
33
  /** Absent means the observation says nothing about the budget. */
34
34
  budget?: ObservedBudget;
35
+ /** Each named count uses its own time, independently of limits and budget. */
36
+ counters?: Record<string, QuotaCounter>;
35
37
  }
36
38
  /** Thrown by `mergeQuotaObservation` when either argument is malformed. */
37
39
  export declare class QuotaCodecError extends TypeError {
@@ -11,7 +11,7 @@
11
11
  // no entry gets an absence record. A pair outside the coverage is never
12
12
  // touched, so a header-shaped partial observation (which covers only what it
13
13
  // carries) cannot erase a family limit or the budget.
14
- import { ALL_SCOPE, entryTime, isQuotaMap, limitKey, } from './map.js';
14
+ import { ALL_SCOPE, decodeQuotaMap, entryTime, isQuotaCounters, limitKey, } from './map.js';
15
15
  /** Thrown by `mergeQuotaObservation` when either argument is malformed. */
16
16
  export class QuotaCodecError extends TypeError {
17
17
  constructor(message) {
@@ -83,7 +83,8 @@ export function isQuotaObservation(value) {
83
83
  }
84
84
  if (!coverage.every(isObservedPair))
85
85
  return false;
86
- return value.budget === undefined || isObservedBudget(value.budget);
86
+ return ((value.budget === undefined || isObservedBudget(value.budget)) &&
87
+ (value.counters === undefined || isQuotaCounters(value.counters)));
87
88
  }
88
89
  function compareEntries(left, right) {
89
90
  if (left.scope !== right.scope)
@@ -99,6 +100,16 @@ function mergeBudget(stored, observed, checkedAt) {
99
100
  return stored;
100
101
  return { ...observed, checkedAt };
101
102
  }
103
+ function mergeCounters(stored, observed) {
104
+ const counters = new Map(Object.entries(stored ?? {}));
105
+ for (const [name, counter] of Object.entries(observed ?? {})) {
106
+ const existing = counters.get(name);
107
+ if (existing === undefined || counter.checkedAt >= existing.checkedAt) {
108
+ counters.set(name, counter);
109
+ }
110
+ }
111
+ return counters.size === 0 ? undefined : Object.fromEntries(counters);
112
+ }
102
113
  /**
103
114
  * Applies `observation` to `stored` (undefined for a row with no map yet) and
104
115
  * returns the new map. Pure: neither argument is modified. Throws
@@ -106,13 +117,16 @@ function mergeBudget(stored, observed, checkedAt) {
106
117
  * write rather than persisting a map it could not read back.
107
118
  */
108
119
  export function mergeQuotaObservation(stored, observation) {
109
- if (stored !== undefined && !isQuotaMap(stored)) {
120
+ // Decode the stored map the way reads do, so a malformed counter that reads
121
+ // already hide is dropped here too instead of refusing every later write.
122
+ const decoded = stored === undefined ? undefined : decodeQuotaMap(stored);
123
+ if (stored !== undefined && decoded === undefined) {
110
124
  throw new QuotaCodecError('stored quota map is malformed');
111
125
  }
112
126
  if (!isQuotaObservation(observation)) {
113
127
  throw new QuotaCodecError('quota observation is malformed');
114
128
  }
115
- const base = stored ?? { limits: [] };
129
+ const base = decoded ?? { limits: [] };
116
130
  const at = observation.checkedAt;
117
131
  const entries = new Map();
118
132
  for (const entry of base.limits) {
@@ -152,11 +166,13 @@ export function mergeQuotaObservation(stored, observation) {
152
166
  : { scope, label: pair.label, kind: 'retired', retiredAt: at });
153
167
  }
154
168
  // Keys this module does not recognise are carried over untouched.
155
- const { limits: _limits, budget: _budget, ...unknownKeys } = base;
169
+ const { limits: _limits, budget: _budget, counters: _counters, ...unknownKeys } = base;
156
170
  const budget = mergeBudget(base.budget, observation.budget, at);
171
+ const counters = mergeCounters(base.counters, observation.counters);
157
172
  return {
158
173
  ...unknownKeys,
159
174
  limits: [...entries.values()].sort(compareEntries),
160
175
  ...(budget === undefined ? {} : { budget }),
176
+ ...(counters === undefined ? {} : { counters }),
161
177
  };
162
178
  }
@@ -1,4 +1,4 @@
1
- import { type QuotaMap } from './map.js';
1
+ import { type QuotaCounter, type QuotaMap } from './map.js';
2
2
  export interface ProjectedLimit {
3
3
  scope: string;
4
4
  label: string;
@@ -30,6 +30,7 @@ export interface ProjectedQuota {
30
30
  checkedAt?: number;
31
31
  /** Present only when the stored budget is a reading, not cleared. */
32
32
  budget?: ProjectedBudget;
33
+ counters?: Record<string, QuotaCounter>;
33
34
  }
34
35
  /**
35
36
  * Resolves `map` for a request in `scope` (`all` or a model family). A family
@@ -6,7 +6,7 @@
6
6
  // scope, orders the result the way the primitives expect, and carries each
7
7
  // entry's (scope, label) so a decision names the limit it judged rather than
8
8
  // the position it occupied.
9
- import { ALL_SCOPE, } from './map.js';
9
+ import { ALL_SCOPE, readQuotaCounters, } from './map.js';
10
10
  function project(entry) {
11
11
  if (entry.kind === 'retired') {
12
12
  return {
@@ -94,11 +94,13 @@ export function projectQuota(map, scope = ALL_SCOPE) {
94
94
  ? Math.min(...stamped.map((limit) => limit.checkedAt))
95
95
  : undefined;
96
96
  const budget = map?.budget?.kind === 'reading' ? projectBudget(map.budget) : undefined;
97
+ const counters = readQuotaCounters(map?.counters);
97
98
  return {
98
99
  scope,
99
100
  limits,
100
101
  ...(checkedAt === undefined ? {} : { checkedAt }),
101
102
  ...(budget === undefined ? {} : { budget }),
103
+ ...(counters === undefined ? {} : { counters }),
102
104
  };
103
105
  }
104
106
  /**
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "package": "@cortexkit/common-auth",
4
- "version": "0.15.0",
5
- "artifactStatus": "released",
4
+ "version": "0.19.0",
5
+ "artifactStatus": "published",
6
6
  "publicRoots": {
7
7
  "./store": {
8
8
  "types": "./dist/store/index.d.ts",
@@ -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.15.0.tgz",
41
- "tarballSha256": "a23db89b43bedba8d371cd9d45e5f35306040cda3f425efb49fbce5610aa9c6b",
42
- "sri": "sha512-1EQVggxbrijCtfdyv4z60eSl0dmZRGO6i1q2m8w20VxwdowWkUV0Y/7kErhp1/2ZNvmDZK65RICMiTcokidxiw==",
43
- "canonicalFiles": 131,
44
- "canonicalBytes": 730840,
40
+ "input": "tools/common-auth-build/inputs/cortexkit-common-auth-0.19.0.tgz",
41
+ "tarballSha256": "dd32b53e849a7d98ed861a5f9d3d81645b31169350257ef1732f7827b8684885",
42
+ "sri": "sha512-p7oy26dBllFF6mkQinsyyqqFP8FKoyVvHyt/aQWEGTljn0AbVRj++Co5Mict4ffQUPrujlQwThilUoPn/AsB8Q==",
43
+ "canonicalFiles": 133,
44
+ "canonicalBytes": 766798,
45
45
  "generator": {
46
46
  "path": "packages/opencode/scripts/embed-common-auth.ts",
47
47
  "version": 3,
48
- "sha256": "158eda37ce92ca20155ccf2c74aca00072a600d976e7d74d8bce0059ea351867"
48
+ "sha256": "c701471b1c52e731528039f0ed121c9cfa4328f533fe9023c0a49eecca17ba2b"
49
49
  },
50
50
  "files": [
51
51
  {
@@ -211,49 +211,49 @@
211
211
  {
212
212
  "source": "package/dist/claustrum/consumer.d.ts",
213
213
  "output": "claustrum/consumer.d.ts",
214
- "bytes": 5064,
215
- "sourceSha256": "8be8fd17170daddc8ad93a78fe33334358eb4fe717f55b8acfff880122bb9609",
216
- "outputSha256": "8be8fd17170daddc8ad93a78fe33334358eb4fe717f55b8acfff880122bb9609",
214
+ "bytes": 7516,
215
+ "sourceSha256": "5bd8eae33d4d0098376fe5b6d6d0171eb6041ba1d0ae9ef5da40e569a36897bd",
216
+ "outputSha256": "5bd8eae33d4d0098376fe5b6d6d0171eb6041ba1d0ae9ef5da40e569a36897bd",
217
217
  "transform": "verbatim"
218
218
  },
219
219
  {
220
220
  "source": "package/dist/claustrum/consumer.js",
221
221
  "output": "claustrum/consumer.js",
222
- "bytes": 12321,
223
- "sourceSha256": "248a328c03690d6309ba45701d1548e2094fd503bf2978d4850df1611212a1ac",
224
- "outputSha256": "248a328c03690d6309ba45701d1548e2094fd503bf2978d4850df1611212a1ac",
222
+ "bytes": 18272,
223
+ "sourceSha256": "82726ae5b1f14f5bb3a19d1e9a9d312dd8f8339f837f1efbecd65e8195f3c01c",
224
+ "outputSha256": "82726ae5b1f14f5bb3a19d1e9a9d312dd8f8339f837f1efbecd65e8195f3c01c",
225
225
  "transform": "verbatim"
226
226
  },
227
227
  {
228
228
  "source": "package/dist/claustrum/custody.d.ts",
229
229
  "output": "claustrum/custody.d.ts",
230
- "bytes": 8713,
231
- "sourceSha256": "46ddac6c6641853dac313b7ddda106037a5b9fd512da5244c2767bfc0345536d",
232
- "outputSha256": "46ddac6c6641853dac313b7ddda106037a5b9fd512da5244c2767bfc0345536d",
230
+ "bytes": 10126,
231
+ "sourceSha256": "053619f193ea68739125624cf1bcb078c78cb38e506c7009894d92c672f88b88",
232
+ "outputSha256": "053619f193ea68739125624cf1bcb078c78cb38e506c7009894d92c672f88b88",
233
233
  "transform": "verbatim"
234
234
  },
235
235
  {
236
236
  "source": "package/dist/claustrum/custody.js",
237
237
  "output": "claustrum/custody.js",
238
- "bytes": 15071,
239
- "sourceSha256": "8dae16f4afc9f39855e84a340a224d77d663d42ce53a0b425d2427d0e2f0eff0",
240
- "outputSha256": "8dae16f4afc9f39855e84a340a224d77d663d42ce53a0b425d2427d0e2f0eff0",
238
+ "bytes": 15835,
239
+ "sourceSha256": "ba5c42a9ad00f66b4e33ae8e810d1b0e8a57c433179dec7c939706c682e49a8f",
240
+ "outputSha256": "ba5c42a9ad00f66b4e33ae8e810d1b0e8a57c433179dec7c939706c682e49a8f",
241
241
  "transform": "verbatim"
242
242
  },
243
243
  {
244
244
  "source": "package/dist/claustrum/enrollment.d.ts",
245
245
  "output": "claustrum/enrollment.d.ts",
246
- "bytes": 7528,
247
- "sourceSha256": "5b2f01bd0a6dd5f92a8450c43619717f08d1ca9aea0ed20f3f7071cc94c1c1bf",
248
- "outputSha256": "5b2f01bd0a6dd5f92a8450c43619717f08d1ca9aea0ed20f3f7071cc94c1c1bf",
246
+ "bytes": 7743,
247
+ "sourceSha256": "7503e56a09f94e77a94a7ae15fd616f149ec9f675ec7c79bdea4a014ca014143",
248
+ "outputSha256": "7503e56a09f94e77a94a7ae15fd616f149ec9f675ec7c79bdea4a014ca014143",
249
249
  "transform": "verbatim"
250
250
  },
251
251
  {
252
252
  "source": "package/dist/claustrum/enrollment.js",
253
253
  "output": "claustrum/enrollment.js",
254
- "bytes": 33305,
255
- "sourceSha256": "e03e33e3f43daf5563d7e2138450c6a5347017a82627c5b8e1d1998b4ce4c42f",
256
- "outputSha256": "e03e33e3f43daf5563d7e2138450c6a5347017a82627c5b8e1d1998b4ce4c42f",
254
+ "bytes": 33520,
255
+ "sourceSha256": "eeac604495c093503007478ab803c05b6e0bce8bf281f8bf9bbfee44c8ff85f1",
256
+ "outputSha256": "eeac604495c093503007478ab803c05b6e0bce8bf281f8bf9bbfee44c8ff85f1",
257
257
  "transform": "verbatim"
258
258
  },
259
259
  {
@@ -291,17 +291,33 @@
291
291
  {
292
292
  "source": "package/dist/claustrum/index.d.ts",
293
293
  "output": "claustrum/index.d.ts",
294
- "bytes": 2735,
295
- "sourceSha256": "b1b1184bed9c3586017123c06725750dd3f7d2ac3b2710e65ed9b3f3075210af",
296
- "outputSha256": "b1b1184bed9c3586017123c06725750dd3f7d2ac3b2710e65ed9b3f3075210af",
294
+ "bytes": 2939,
295
+ "sourceSha256": "cd2f374dec9e06a7962d2c262c08c965213610107ff1f4f972c2c76c35fe8254",
296
+ "outputSha256": "cd2f374dec9e06a7962d2c262c08c965213610107ff1f4f972c2c76c35fe8254",
297
297
  "transform": "verbatim"
298
298
  },
299
299
  {
300
300
  "source": "package/dist/claustrum/index.js",
301
301
  "output": "claustrum/index.js",
302
- "bytes": 1967,
303
- "sourceSha256": "ced1f8aa152e634ce9d5e4088e25985822ae0e280344e0de903e4320c850d864",
304
- "outputSha256": "ced1f8aa152e634ce9d5e4088e25985822ae0e280344e0de903e4320c850d864",
302
+ "bytes": 2141,
303
+ "sourceSha256": "33dc58809d432ea7bbe3f3d4425fe575589a018854444b63e0874f917981ab19",
304
+ "outputSha256": "33dc58809d432ea7bbe3f3d4425fe575589a018854444b63e0874f917981ab19",
305
+ "transform": "verbatim"
306
+ },
307
+ {
308
+ "source": "package/dist/claustrum/insula.d.ts",
309
+ "output": "claustrum/insula.d.ts",
310
+ "bytes": 2489,
311
+ "sourceSha256": "21a92525f04810a15a877e1c1ff9d7cf2fc2eb4ffe8a6aa408db22da6337d30f",
312
+ "outputSha256": "21a92525f04810a15a877e1c1ff9d7cf2fc2eb4ffe8a6aa408db22da6337d30f",
313
+ "transform": "verbatim"
314
+ },
315
+ {
316
+ "source": "package/dist/claustrum/insula.js",
317
+ "output": "claustrum/insula.js",
318
+ "bytes": 6097,
319
+ "sourceSha256": "1db6a99b9db96635bbf846e58ab54eaaa1892bf8939801a181741022d47ce428",
320
+ "outputSha256": "1db6a99b9db96635bbf846e58ab54eaaa1892bf8939801a181741022d47ce428",
305
321
  "transform": "verbatim"
306
322
  },
307
323
  {
@@ -323,17 +339,17 @@
323
339
  {
324
340
  "source": "package/dist/claustrum/roster.d.ts",
325
341
  "output": "claustrum/roster.d.ts",
326
- "bytes": 9312,
327
- "sourceSha256": "45a63920ad5998b68b1bcba9a2208e7adab99cb1999df55d798b0a2b088d7d39",
328
- "outputSha256": "45a63920ad5998b68b1bcba9a2208e7adab99cb1999df55d798b0a2b088d7d39",
342
+ "bytes": 9932,
343
+ "sourceSha256": "7c5684ff5c3f66d418f3624d07565a08556662f445cb96a7575a270851fab9c3",
344
+ "outputSha256": "7c5684ff5c3f66d418f3624d07565a08556662f445cb96a7575a270851fab9c3",
329
345
  "transform": "verbatim"
330
346
  },
331
347
  {
332
348
  "source": "package/dist/claustrum/roster.js",
333
349
  "output": "claustrum/roster.js",
334
- "bytes": 23840,
335
- "sourceSha256": "8f9d247e7d614e997cebb9728eaeb96fd0f32955cebfccc3d016351ad39a3947",
336
- "outputSha256": "8f9d247e7d614e997cebb9728eaeb96fd0f32955cebfccc3d016351ad39a3947",
350
+ "bytes": 25106,
351
+ "sourceSha256": "e6ac8f59dab51db4756ccbaa89fc73acd213a7a4795fdf5a7c7e4f653455fe94",
352
+ "outputSha256": "e6ac8f59dab51db4756ccbaa89fc73acd213a7a4795fdf5a7c7e4f653455fe94",
337
353
  "transform": "verbatim"
338
354
  },
339
355
  {
@@ -499,17 +515,17 @@
499
515
  {
500
516
  "source": "package/dist/fs/refresh-file-lock.d.ts",
501
517
  "output": "fs/refresh-file-lock.d.ts",
502
- "bytes": 1765,
503
- "sourceSha256": "72996a1247d498a34ac157d23c34ef03bcbdb68c79e8751be4874885aed7e843",
504
- "outputSha256": "72996a1247d498a34ac157d23c34ef03bcbdb68c79e8751be4874885aed7e843",
518
+ "bytes": 2125,
519
+ "sourceSha256": "ec643f4e081c108c1b42ceb17a83cf3e7e9997a4c75e1a61ffc33b5b44ccd414",
520
+ "outputSha256": "ec643f4e081c108c1b42ceb17a83cf3e7e9997a4c75e1a61ffc33b5b44ccd414",
505
521
  "transform": "verbatim"
506
522
  },
507
523
  {
508
524
  "source": "package/dist/fs/refresh-file-lock.js",
509
525
  "output": "fs/refresh-file-lock.js",
510
- "bytes": 28985,
511
- "sourceSha256": "6bf0f944bd70c60f1679bdc4c2764d19ed0047c77dbf737c13088bb8c478e5e2",
512
- "outputSha256": "6bf0f944bd70c60f1679bdc4c2764d19ed0047c77dbf737c13088bb8c478e5e2",
526
+ "bytes": 29704,
527
+ "sourceSha256": "5c52aad573e84e8065dcf06259ecf38345e8b5a2c401029a23d942f28c7a8521",
528
+ "outputSha256": "5c52aad573e84e8065dcf06259ecf38345e8b5a2c401029a23d942f28c7a8521",
513
529
  "transform": "verbatim"
514
530
  },
515
531
  {
@@ -611,9 +627,9 @@
611
627
  {
612
628
  "source": "package/dist/pi-slot/lock.js",
613
629
  "output": "pi-slot/lock.js",
614
- "bytes": 7109,
615
- "sourceSha256": "92ad2fbf7792624b8dae99d7239e1e6f0f7d7f6da10be8b1594500700c7c3077",
616
- "outputSha256": "92ad2fbf7792624b8dae99d7239e1e6f0f7d7f6da10be8b1594500700c7c3077",
630
+ "bytes": 7385,
631
+ "sourceSha256": "68b0c7c764b88391e466f3b9fa172df176bf21529399606bf84475f3b920db8b",
632
+ "outputSha256": "68b0c7c764b88391e466f3b9fa172df176bf21529399606bf84475f3b920db8b",
617
633
  "transform": "verbatim"
618
634
  },
619
635
  {
@@ -635,97 +651,97 @@
635
651
  {
636
652
  "source": "package/dist/quota/codec.d.ts",
637
653
  "output": "quota/codec.d.ts",
638
- "bytes": 451,
639
- "sourceSha256": "35ceda009b4be9d0bcb7969d03d42225efb15fcc4e9df1a928a2a9c98aada5f4",
640
- "outputSha256": "35ceda009b4be9d0bcb7969d03d42225efb15fcc4e9df1a928a2a9c98aada5f4",
654
+ "bytes": 585,
655
+ "sourceSha256": "8289f7c656a2eedd444cddb83c412dd24bf726421e7706bf19df93b55877db06",
656
+ "outputSha256": "8289f7c656a2eedd444cddb83c412dd24bf726421e7706bf19df93b55877db06",
641
657
  "transform": "verbatim"
642
658
  },
643
659
  {
644
660
  "source": "package/dist/quota/codec.js",
645
661
  "output": "quota/codec.js",
646
- "bytes": 447,
647
- "sourceSha256": "71a07337a0403c12541cc5125b4923c03c17a07e9fafe311d52d14ef2a5b2701",
648
- "outputSha256": "71a07337a0403c12541cc5125b4923c03c17a07e9fafe311d52d14ef2a5b2701",
662
+ "bytes": 491,
663
+ "sourceSha256": "4e496ce03a8a23536b467168f1dc6a7ceffb06d00ae80cb8a8868f311b2f3a8a",
664
+ "outputSha256": "4e496ce03a8a23536b467168f1dc6a7ceffb06d00ae80cb8a8868f311b2f3a8a",
649
665
  "transform": "verbatim"
650
666
  },
651
667
  {
652
668
  "source": "package/dist/quota/format.d.ts",
653
669
  "output": "quota/format.d.ts",
654
- "bytes": 2345,
655
- "sourceSha256": "87ec0c819d5ba567bcd106abe0a224d91daa030fe33942b33f931e6ea833cf5b",
656
- "outputSha256": "87ec0c819d5ba567bcd106abe0a224d91daa030fe33942b33f931e6ea833cf5b",
670
+ "bytes": 4260,
671
+ "sourceSha256": "f76541a2f0e1e04782ee8b61a3d0f6b3ba3c156bc0e57bfcbd427e00baf279b4",
672
+ "outputSha256": "f76541a2f0e1e04782ee8b61a3d0f6b3ba3c156bc0e57bfcbd427e00baf279b4",
657
673
  "transform": "verbatim"
658
674
  },
659
675
  {
660
676
  "source": "package/dist/quota/format.js",
661
677
  "output": "quota/format.js",
662
- "bytes": 5819,
663
- "sourceSha256": "a6911f852a33e5305d7ea86bd2fe0c62e12207e17e01b11b23db6e1de7b1aea7",
664
- "outputSha256": "a6911f852a33e5305d7ea86bd2fe0c62e12207e17e01b11b23db6e1de7b1aea7",
678
+ "bytes": 12897,
679
+ "sourceSha256": "69e546dbc935300ff3b01294479844177be3e288626e5edf0341e820a20c5580",
680
+ "outputSha256": "69e546dbc935300ff3b01294479844177be3e288626e5edf0341e820a20c5580",
665
681
  "transform": "verbatim"
666
682
  },
667
683
  {
668
684
  "source": "package/dist/quota/index.d.ts",
669
685
  "output": "quota/index.d.ts",
670
- "bytes": 955,
671
- "sourceSha256": "c51ad163eb1a16d20d88773abdeab90aea1e7c5543d7223acddec31494707056",
672
- "outputSha256": "c51ad163eb1a16d20d88773abdeab90aea1e7c5543d7223acddec31494707056",
686
+ "bytes": 1047,
687
+ "sourceSha256": "1ed8a3feaf208860182d738c2ba732fbaa61b6613c1e0e14442418a76d743663",
688
+ "outputSha256": "1ed8a3feaf208860182d738c2ba732fbaa61b6613c1e0e14442418a76d743663",
673
689
  "transform": "verbatim"
674
690
  },
675
691
  {
676
692
  "source": "package/dist/quota/index.js",
677
693
  "output": "quota/index.js",
678
- "bytes": 463,
679
- "sourceSha256": "05814a130847a52cbcbc9a1a67cad43c807abe179b1ac0a83b0b3c3f6b2fd4b7",
680
- "outputSha256": "05814a130847a52cbcbc9a1a67cad43c807abe179b1ac0a83b0b3c3f6b2fd4b7",
694
+ "bytes": 511,
695
+ "sourceSha256": "691e7db4bf6025770991f98adda82ca4cb9be45eeefa3709b114fb2decfdf66e",
696
+ "outputSha256": "691e7db4bf6025770991f98adda82ca4cb9be45eeefa3709b114fb2decfdf66e",
681
697
  "transform": "verbatim"
682
698
  },
683
699
  {
684
700
  "source": "package/dist/quota/map.d.ts",
685
701
  "output": "quota/map.d.ts",
686
- "bytes": 2270,
687
- "sourceSha256": "a2f7370148018247eae306b830ca824a2941aa53ece71cf301063a67ba9eb4a1",
688
- "outputSha256": "a2f7370148018247eae306b830ca824a2941aa53ece71cf301063a67ba9eb4a1",
702
+ "bytes": 2901,
703
+ "sourceSha256": "28ba151926d76d45051065b243032ae4f698a3c4f94b44f32341c97467c7faf6",
704
+ "outputSha256": "28ba151926d76d45051065b243032ae4f698a3c4f94b44f32341c97467c7faf6",
689
705
  "transform": "verbatim"
690
706
  },
691
707
  {
692
708
  "source": "package/dist/quota/map.js",
693
709
  "output": "quota/map.js",
694
- "bytes": 4271,
695
- "sourceSha256": "61fb25c789389e57ff8cceb450f6872c2b6e4961cec3c4650f6af699ab5a27f2",
696
- "outputSha256": "61fb25c789389e57ff8cceb450f6872c2b6e4961cec3c4650f6af699ab5a27f2",
710
+ "bytes": 5669,
711
+ "sourceSha256": "95339af4c80684b4e462f5ba32affeaa5f8b5885db599dc5e8ac1ffd1890d729",
712
+ "outputSha256": "95339af4c80684b4e462f5ba32affeaa5f8b5885db599dc5e8ac1ffd1890d729",
697
713
  "transform": "verbatim"
698
714
  },
699
715
  {
700
716
  "source": "package/dist/quota/merge.d.ts",
701
717
  "output": "quota/merge.d.ts",
702
- "bytes": 1628,
703
- "sourceSha256": "88998476cd9de8037577065098894fd2ab4b5faed3f07edf5ac35b8f5bf6bcc1",
704
- "outputSha256": "88998476cd9de8037577065098894fd2ab4b5faed3f07edf5ac35b8f5bf6bcc1",
718
+ "bytes": 1775,
719
+ "sourceSha256": "3531d738712f40b79415cd58940c55bf4cce6827c500fc3912368ff012e31f25",
720
+ "outputSha256": "3531d738712f40b79415cd58940c55bf4cce6827c500fc3912368ff012e31f25",
705
721
  "transform": "verbatim"
706
722
  },
707
723
  {
708
724
  "source": "package/dist/quota/merge.js",
709
725
  "output": "quota/merge.js",
710
- "bytes": 6513,
711
- "sourceSha256": "c21d7490b7ced3f646e94069d4de2e15b97231a96b3227b03c3a3197738359ad",
712
- "outputSha256": "c21d7490b7ced3f646e94069d4de2e15b97231a96b3227b03c3a3197738359ad",
726
+ "bytes": 7439,
727
+ "sourceSha256": "64440806fd70d214eb6a6f4c98f3a6ba442ca48d39762395a202c25fbf08a23e",
728
+ "outputSha256": "64440806fd70d214eb6a6f4c98f3a6ba442ca48d39762395a202c25fbf08a23e",
713
729
  "transform": "verbatim"
714
730
  },
715
731
  {
716
732
  "source": "package/dist/quota/projection.d.ts",
717
733
  "output": "quota/projection.d.ts",
718
- "bytes": 2911,
719
- "sourceSha256": "e410a8db0ff2ae805dbe342088d08ab555a701466159479f2e838f585b820c92",
720
- "outputSha256": "e410a8db0ff2ae805dbe342088d08ab555a701466159479f2e838f585b820c92",
734
+ "bytes": 2975,
735
+ "sourceSha256": "65a1b13db0a4d21f8b4136af65888494c6d8a7e117e80879c96f75fc0b763ad9",
736
+ "outputSha256": "65a1b13db0a4d21f8b4136af65888494c6d8a7e117e80879c96f75fc0b763ad9",
721
737
  "transform": "verbatim"
722
738
  },
723
739
  {
724
740
  "source": "package/dist/quota/projection.js",
725
741
  "output": "quota/projection.js",
726
- "bytes": 5509,
727
- "sourceSha256": "1fd24078f42e7658c31c31f08116f96bf7b53b91948650deefca9a4add481d76",
728
- "outputSha256": "1fd24078f42e7658c31c31f08116f96bf7b53b91948650deefca9a4add481d76",
742
+ "bytes": 5640,
743
+ "sourceSha256": "be7012f1df5845a1f3377b148f35ffe029583c1b9b5426f70a7ba96f7b49a150",
744
+ "outputSha256": "be7012f1df5845a1f3377b148f35ffe029583c1b9b5426f70a7ba96f7b49a150",
729
745
  "transform": "verbatim"
730
746
  },
731
747
  {
@@ -907,17 +923,17 @@
907
923
  {
908
924
  "source": "package/dist/store/pool.d.ts",
909
925
  "output": "store/pool.d.ts",
910
- "bytes": 10754,
911
- "sourceSha256": "901b2881e94f067c6b454002f1e3922b75f248f2a25ef7548c399cafd9611159",
912
- "outputSha256": "901b2881e94f067c6b454002f1e3922b75f248f2a25ef7548c399cafd9611159",
926
+ "bytes": 10785,
927
+ "sourceSha256": "192ea359d2ce746b31693cf06795a281f2e06804c567975f127ea05fa6fb4aef",
928
+ "outputSha256": "192ea359d2ce746b31693cf06795a281f2e06804c567975f127ea05fa6fb4aef",
913
929
  "transform": "verbatim"
914
930
  },
915
931
  {
916
932
  "source": "package/dist/store/pool.js",
917
933
  "output": "store/pool.js",
918
- "bytes": 5713,
919
- "sourceSha256": "678cca0578ac32eb1d9e45408614c6a7b56a6dcb94672a961c8c13bca55171fd",
920
- "outputSha256": "678cca0578ac32eb1d9e45408614c6a7b56a6dcb94672a961c8c13bca55171fd",
934
+ "bytes": 5671,
935
+ "sourceSha256": "8dc0d27b37204c2c3229296e8efbbfac6bcb30538b39d8d95771267487a06292",
936
+ "outputSha256": "8dc0d27b37204c2c3229296e8efbbfac6bcb30538b39d8d95771267487a06292",
921
937
  "transform": "verbatim"
922
938
  },
923
939
  {
@@ -971,17 +987,17 @@
971
987
  {
972
988
  "source": "package/dist/store/refresh-lock.d.ts",
973
989
  "output": "store/refresh-lock.d.ts",
974
- "bytes": 2442,
975
- "sourceSha256": "5b4230fad8b94abc23d9b4a9c72cf21d7c961ac6359561a4da28e1e807bcb0ca",
976
- "outputSha256": "5b4230fad8b94abc23d9b4a9c72cf21d7c961ac6359561a4da28e1e807bcb0ca",
990
+ "bytes": 2419,
991
+ "sourceSha256": "50401b2e9b69b73592e0a4391fc1992a380539360b7cabfe5fce6d35fb29c648",
992
+ "outputSha256": "50401b2e9b69b73592e0a4391fc1992a380539360b7cabfe5fce6d35fb29c648",
977
993
  "transform": "verbatim"
978
994
  },
979
995
  {
980
996
  "source": "package/dist/store/refresh-lock.js",
981
997
  "output": "store/refresh-lock.js",
982
- "bytes": 4681,
983
- "sourceSha256": "035a03e02a0690ec51d92df0b61e2ae6abb7b8d6a141112640f8d649eb583949",
984
- "outputSha256": "035a03e02a0690ec51d92df0b61e2ae6abb7b8d6a141112640f8d649eb583949",
998
+ "bytes": 4655,
999
+ "sourceSha256": "f2a316af681d1a14254873b9dc2d608a76919b7ba930636ee9f266c99195fb67",
1000
+ "outputSha256": "f2a316af681d1a14254873b9dc2d608a76919b7ba930636ee9f266c99195fb67",
985
1001
  "transform": "verbatim"
986
1002
  },
987
1003
  {
@@ -1043,17 +1059,17 @@
1043
1059
  {
1044
1060
  "source": "package/dist/store/schema.d.ts",
1045
1061
  "output": "store/schema.d.ts",
1046
- "bytes": 22168,
1047
- "sourceSha256": "2099f309023c62e6ed8b82906a8b5c7eaa8d42e1a134908dc65bece83711de9f",
1048
- "outputSha256": "2099f309023c62e6ed8b82906a8b5c7eaa8d42e1a134908dc65bece83711de9f",
1062
+ "bytes": 22290,
1063
+ "sourceSha256": "51a47144ee965680e517e8ec91210742908336f6b781f8be2026124d6d0a6bbf",
1064
+ "outputSha256": "51a47144ee965680e517e8ec91210742908336f6b781f8be2026124d6d0a6bbf",
1049
1065
  "transform": "verbatim"
1050
1066
  },
1051
1067
  {
1052
1068
  "source": "package/dist/store/schema.js",
1053
1069
  "output": "store/schema.js",
1054
- "bytes": 31460,
1055
- "sourceSha256": "349c1bac2b8417dd941a16148f49521ea8a9c1fefb5e3a6ee82bb461bd050312",
1056
- "outputSha256": "349c1bac2b8417dd941a16148f49521ea8a9c1fefb5e3a6ee82bb461bd050312",
1070
+ "bytes": 31533,
1071
+ "sourceSha256": "ae55f6f875ff8a9e9a09795eac1bedfd4bf795bd6802e8de37b52586b61208d0",
1072
+ "outputSha256": "ae55f6f875ff8a9e9a09795eac1bedfd4bf795bd6802e8de37b52586b61208d0",
1057
1073
  "transform": "verbatim"
1058
1074
  },
1059
1075
  {
@@ -42,7 +42,7 @@ export interface OpenPoolStoreOptions {
42
42
  requireCredentialStamps?: boolean;
43
43
  /** Require an exact secret fingerprint for every roster-publication removal. */
44
44
  requireRemovedFingerprint?: boolean;
45
- /** Injected clock for leases, refresh stamps and `addedAt`. */
45
+ /** Logical clock for refresh stamps and `addedAt`; filesystem leases always use wall time. */
46
46
  now?: () => number;
47
47
  /**
48
48
  * Ordered store-lock list held across every read-modify-write. Defaults to
@@ -57,7 +57,6 @@ export function openPoolStore(options) {
57
57
  ],
58
58
  lockDefaults,
59
59
  lockEnv: {
60
- now: options.now ?? Date.now,
61
60
  ...(options.onLockEvent ? { onLockEvent: options.onLockEvent } : {}),
62
61
  ...(options.onLockStep ? { onLockStep: options.onLockStep } : {}),
63
62
  ...(options.onRenewalTimer
@@ -24,7 +24,6 @@ export type LockEvent = {
24
24
  path: string;
25
25
  };
26
26
  export interface LockEnvironment {
27
- now: () => number;
28
27
  onLockEvent?: (event: LockEvent) => void;
29
28
  onLockStep?: (lock: {
30
29
  name: string;
@@ -42,7 +42,6 @@ export async function acquirePoolLock(spec, defaults, env) {
42
42
  name: spec.name,
43
43
  path: spec.path,
44
44
  ttlMs: options.ttlMs,
45
- now: env.now,
46
45
  renew: options.renew,
47
46
  onContended: () => emit('contended'),
48
47
  ...(env.onRenewalTimer
@@ -49,6 +49,8 @@ export type StoredCredential = (OAuthCredential & {
49
49
  /** Quota codec supplied by `/quota`: the store never interprets the map itself. */
50
50
  export interface QuotaCodec {
51
51
  validate(value: unknown): boolean;
52
+ /** Normalize persisted quota before validation, when the codec supports it. */
53
+ decode?(value: unknown): unknown;
52
54
  merge(stored: unknown | undefined, observation: unknown): unknown;
53
55
  }
54
56
  /**