@substrat-run/contracts 0.141.0 → 0.142.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,11 +89,11 @@ export type CapabilityMintInput = z.infer<typeof capabilityMintInput>;
89
89
  * exchanging it yields a principal instead of a session, the shape an owner claim link and
90
90
  * a member invite are ("whoever opens this becomes that seat").
91
91
  *
92
- * Platform-only in this first cut, deliberately. `become` is impersonation by another name
93
- * — the holder acquires everything the principal holds — so the bound on who may mint one
94
- * from module code is designed with the invite and claim migrations, not guessed here.
95
- * Expiry and a use limit are REQUIRED for the same reason: an unbounded `become` is a
96
- * standing credential for a person.
92
+ * `become` is impersonation by another name — the holder acquires everything the principal
93
+ * holds — so module code never mints one. The platform mints this shape (an owner claim link);
94
+ * a PRINCIPAL mints one only through a host's bounded verb (a member invite,
95
+ * `principalBecomeCapabilityInput`, #1686). Expiry and a use limit are REQUIRED here: an
96
+ * unbounded platform `become` is a standing credential for a person.
97
97
  */
98
98
  export declare const becomeCapabilityInput: z.ZodObject<{
99
99
  principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
@@ -102,6 +102,27 @@ export declare const becomeCapabilityInput: z.ZodObject<{
102
102
  label: z.ZodOptional<z.ZodString>;
103
103
  }, z.core.$strip>;
104
104
  export type BecomeCapabilityInput = z.infer<typeof becomeCapabilityInput>;
105
+ /**
106
+ * What a PRINCIPAL may mint through a host's bounded verb (#1686) — a `become` capability
107
+ * whose minter is a person rather than the platform: the shape a member invite is.
108
+ *
109
+ * The bound is the host's, checked in the same scope task as the write: the minter must hold,
110
+ * at this node, every permission the target principal holds there, and every entity-narrowed
111
+ * grant the target holds must be one the minter can exercise on that entity too. Otherwise
112
+ * minting a `become` would hand someone more than the minter has — impersonation upward.
113
+ *
114
+ * `expiresAt` absent means no expiry, because a member invite has never had one; the use
115
+ * limit is still required, as on every `become`. The minter is not re-checked when the secret
116
+ * is exchanged: the target's authority was bounded when it was conferred and when this was
117
+ * minted, and withdrawing the invite (revoking this) is the lever.
118
+ */
119
+ export declare const principalBecomeCapabilityInput: z.ZodObject<{
120
+ principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
121
+ expiresAt: z.ZodOptional<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
122
+ maxUses: z.ZodNumber;
123
+ label: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>;
125
+ export type PrincipalBecomeCapabilityInput = z.infer<typeof principalBecomeCapabilityInput>;
105
126
  /**
106
127
  * Who minted or revoked a capability: the principal whose operation did it, or a platform
107
128
  * actor through `HostAdmin`. Two members rather than a principal with a flag, because an
@@ -132,6 +153,9 @@ export declare const capabilityRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
132
153
  revokedBy: z.ZodNullable<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">, z.ZodObject<{
133
154
  platform: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
134
155
  }, z.core.$strip>]>>;
156
+ revokedReason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
157
+ "holdings-changed": "holdings-changed";
158
+ }>>>;
135
159
  mode: z.ZodLiteral<"act">;
136
160
  entity: z.ZodObject<{
137
161
  entityType: z.ZodString;
@@ -155,6 +179,9 @@ export declare const capabilityRecord: z.ZodDiscriminatedUnion<[z.ZodObject<{
155
179
  revokedBy: z.ZodNullable<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">, z.ZodObject<{
156
180
  platform: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
157
181
  }, z.core.$strip>]>>;
182
+ revokedReason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
183
+ "holdings-changed": "holdings-changed";
184
+ }>>>;
158
185
  mode: z.ZodLiteral<"become">;
159
186
  principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
160
187
  }, z.core.$strip>], "mode">;
@@ -169,6 +196,100 @@ export declare const mintedCapability: z.ZodObject<{
169
196
  expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
170
197
  }, z.core.$strip>;
171
198
  export type MintedCapability = z.infer<typeof mintedCapability>;
199
+ /**
200
+ * Why a host's bounded `become` mint refused (#1686), with nothing written:
201
+ * - `coverage` — what the minter lacks of what the target holds;
202
+ * - `target-holds-nothing` — the target holds nothing at the node. Its own answer because a
203
+ * `Coverage` refusal must name a missing key and there is none: an empty set would cover
204
+ * trivially, and the link would yield whatever that principal is granted later;
205
+ * - `target-already-claimed` — some `become` capability for the target has already been
206
+ * exchanged in this scope: somebody already is that principal, and a second link would let a
207
+ * second person become them too. A principal-minted `become` is for a seat nobody has taken.
208
+ */
209
+ export declare const becomeMintRefusal: z.ZodUnion<readonly [z.ZodObject<{
210
+ ok: z.ZodLiteral<false>;
211
+ coverage: z.ZodDiscriminatedUnion<[z.ZodObject<{
212
+ covered: z.ZodLiteral<true>;
213
+ missing: z.ZodTuple<[], null>;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ covered: z.ZodLiteral<false>;
216
+ missing: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
217
+ }, z.core.$strip>], "covered">;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ ok: z.ZodLiteral<false>;
220
+ refused: z.ZodEnum<{
221
+ "target-already-claimed": "target-already-claimed";
222
+ "target-holds-nothing": "target-holds-nothing";
223
+ }>;
224
+ }, z.core.$strip>]>;
225
+ export type BecomeMintRefusal = z.infer<typeof becomeMintRefusal>;
226
+ /** What a host's bounded `become` mint answers (#1686): the minted capability, or the refusal. */
227
+ export declare const boundedBecomeMint: z.ZodUnion<readonly [z.ZodObject<{
228
+ ok: z.ZodLiteral<true>;
229
+ minted: z.ZodObject<{
230
+ id: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
231
+ secret: z.ZodString;
232
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
233
+ }, z.core.$strip>;
234
+ }, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
235
+ ok: z.ZodLiteral<false>;
236
+ coverage: z.ZodDiscriminatedUnion<[z.ZodObject<{
237
+ covered: z.ZodLiteral<true>;
238
+ missing: z.ZodTuple<[], null>;
239
+ }, z.core.$strip>, z.ZodObject<{
240
+ covered: z.ZodLiteral<false>;
241
+ missing: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
242
+ }, z.core.$strip>], "covered">;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ ok: z.ZodLiteral<false>;
245
+ refused: z.ZodEnum<{
246
+ "target-already-claimed": "target-already-claimed";
247
+ "target-holds-nothing": "target-holds-nothing";
248
+ }>;
249
+ }, z.core.$strip>]>]>;
250
+ export type BoundedBecomeMint = z.infer<typeof boundedBecomeMint>;
251
+ /**
252
+ * What a host's bounded `become` revoke answers (#1686): whether this call revoked it, or the
253
+ * coverage that refused the revoker — who must be the link's minter, or hold everything its
254
+ * principal holds now (whoever could have minted it). A refusal writes nothing.
255
+ */
256
+ export declare const boundedBecomeRevoke: z.ZodUnion<readonly [z.ZodObject<{
257
+ ok: z.ZodLiteral<true>;
258
+ revoked: z.ZodBoolean;
259
+ }, z.core.$strip>, z.ZodObject<{
260
+ ok: z.ZodLiteral<false>;
261
+ coverage: z.ZodDiscriminatedUnion<[z.ZodObject<{
262
+ covered: z.ZodLiteral<true>;
263
+ missing: z.ZodTuple<[], null>;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ covered: z.ZodLiteral<false>;
266
+ missing: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
267
+ }, z.core.$strip>], "covered">;
268
+ }, z.core.$strip>]>;
269
+ export type BoundedBecomeRevoke = z.infer<typeof boundedBecomeRevoke>;
270
+ /**
271
+ * Where a `become` link stands (#1686) — what a pending-invite list shows beside each invite, so
272
+ * a link the kernel revoked is never shown as open. `used`: exchanged up to its limit. A
273
+ * capability the scope does not hold reads as `revoked`.
274
+ */
275
+ export declare const becomeLinkState: z.ZodObject<{
276
+ state: z.ZodEnum<{
277
+ expired: "expired";
278
+ open: "open";
279
+ revoked: "revoked";
280
+ used: "used";
281
+ }>;
282
+ reason: z.ZodNullable<z.ZodEnum<{
283
+ "holdings-changed": "holdings-changed";
284
+ }>>;
285
+ }, z.core.$strip>;
286
+ export type BecomeLinkState = z.infer<typeof becomeLinkState>;
287
+ /**
288
+ * The most links one `becomeLinkStates` call may name — the cap other id-list reads take
289
+ * (`CONNECT_LINK_LIST_MAX_IDS`, a grant-scoped read's maximum). Over it the read refuses rather
290
+ * than truncate; a list longer than this asks in pages of it.
291
+ */
292
+ export declare const BECOME_LINK_STATES_MAX_IDS = 100;
172
293
  /**
173
294
  * What an exchange yields: a session to act as the capability (`act`), or the principal
174
295
  * the holder becomes (`become`). A refused exchange — an unknown, expired, revoked or
@@ -230,6 +351,9 @@ export declare const capabilityPage: z.ZodObject<{
230
351
  revokedBy: z.ZodNullable<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">, z.ZodObject<{
231
352
  platform: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
232
353
  }, z.core.$strip>]>>;
354
+ revokedReason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
355
+ "holdings-changed": "holdings-changed";
356
+ }>>>;
233
357
  mode: z.ZodLiteral<"act">;
234
358
  entity: z.ZodObject<{
235
359
  entityType: z.ZodString;
@@ -253,6 +377,9 @@ export declare const capabilityPage: z.ZodObject<{
253
377
  revokedBy: z.ZodNullable<z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">, z.ZodObject<{
254
378
  platform: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
255
379
  }, z.core.$strip>]>>;
380
+ revokedReason: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
381
+ "holdings-changed": "holdings-changed";
382
+ }>>>;
256
383
  mode: z.ZodLiteral<"become">;
257
384
  principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
258
385
  }, z.core.$strip>], "mode">>;
@@ -319,6 +446,13 @@ export declare const CAPABILITY_REVOKED = "capability.revoked";
319
446
  * capability itself (`capability:<id>`) for `become`; actor: `{ capability }`.
320
447
  */
321
448
  export declare const CAPABILITY_EXERCISED = "capability.exercised";
449
+ /**
450
+ * A principal minted a `become` capability through a host's bounded verb (#1686) — a member
451
+ * invite. Entity: the capability itself (`capability:<id>`), as on a `become`'s
452
+ * `capability.exercised`; actor: the minter. Its own type rather than `capability.minted`,
453
+ * whose payload is an `act` capability's (an entity and its keys) and is frozen.
454
+ */
455
+ export declare const CAPABILITY_BECOME_MINTED = "capability.become-minted";
322
456
  export declare const capabilityMintedPayload: z.ZodObject<{
323
457
  capabilityId: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
324
458
  entity: z.ZodObject<{
@@ -333,6 +467,15 @@ export declare const capabilityMintedPayload: z.ZodObject<{
333
467
  mintedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
334
468
  }, z.core.$strip>;
335
469
  export type CapabilityMintedPayload = z.infer<typeof capabilityMintedPayload>;
470
+ export declare const capabilityBecomeMintedPayload: z.ZodObject<{
471
+ capabilityId: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
472
+ principal: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
473
+ expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
474
+ maxUses: z.ZodNumber;
475
+ label: z.ZodNullable<z.ZodString>;
476
+ mintedBy: z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">;
477
+ }, z.core.$strip>;
478
+ export type CapabilityBecomeMintedPayload = z.infer<typeof capabilityBecomeMintedPayload>;
336
479
  export declare const capabilityRevokedPayload: z.ZodObject<{
337
480
  capabilityId: z.core.$ZodBranded<z.ZodString, "CapabilityId", "out">;
338
481
  entity: z.ZodObject<{
@@ -1 +1 @@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,GAAG,MAAM,CAGjE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;GAyB9B,CAAC;AASL,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AACrD,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAEnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBASlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E,eAAO,MAAM,6BAA6B;;;;;;;iBAQxC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE1F,eAAO,MAAM,wBAAwB;;;;;;;iBAInC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAUrC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { entityRef } from './events.js';
3
3
  import { capabilityId, instant, permissionKey, platformActorId, principalId } from './ids.js';
4
+ import { coverage } from './permission.js';
4
5
  /**
5
6
  * Capabilities (#1672) — authority carried by a SECRET rather than held by a principal.
6
7
  *
@@ -80,11 +81,11 @@ export const capabilityMintInput = capabilityAuthority.extend({
80
81
  * exchanging it yields a principal instead of a session, the shape an owner claim link and
81
82
  * a member invite are ("whoever opens this becomes that seat").
82
83
  *
83
- * Platform-only in this first cut, deliberately. `become` is impersonation by another name
84
- * — the holder acquires everything the principal holds — so the bound on who may mint one
85
- * from module code is designed with the invite and claim migrations, not guessed here.
86
- * Expiry and a use limit are REQUIRED for the same reason: an unbounded `become` is a
87
- * standing credential for a person.
84
+ * `become` is impersonation by another name — the holder acquires everything the principal
85
+ * holds — so module code never mints one. The platform mints this shape (an owner claim link);
86
+ * a PRINCIPAL mints one only through a host's bounded verb (a member invite,
87
+ * `principalBecomeCapabilityInput`, #1686). Expiry and a use limit are REQUIRED here: an
88
+ * unbounded platform `become` is a standing credential for a person.
88
89
  */
89
90
  export const becomeCapabilityInput = z.object({
90
91
  principal: principalId,
@@ -92,6 +93,26 @@ export const becomeCapabilityInput = z.object({
92
93
  maxUses: z.number().int().positive(),
93
94
  label: capabilityLabel.optional(),
94
95
  });
96
+ /**
97
+ * What a PRINCIPAL may mint through a host's bounded verb (#1686) — a `become` capability
98
+ * whose minter is a person rather than the platform: the shape a member invite is.
99
+ *
100
+ * The bound is the host's, checked in the same scope task as the write: the minter must hold,
101
+ * at this node, every permission the target principal holds there, and every entity-narrowed
102
+ * grant the target holds must be one the minter can exercise on that entity too. Otherwise
103
+ * minting a `become` would hand someone more than the minter has — impersonation upward.
104
+ *
105
+ * `expiresAt` absent means no expiry, because a member invite has never had one; the use
106
+ * limit is still required, as on every `become`. The minter is not re-checked when the secret
107
+ * is exchanged: the target's authority was bounded when it was conferred and when this was
108
+ * minted, and withdrawing the invite (revoking this) is the lever.
109
+ */
110
+ export const principalBecomeCapabilityInput = z.object({
111
+ principal: principalId,
112
+ expiresAt: instant.optional(),
113
+ maxUses: z.number().int().positive(),
114
+ label: capabilityLabel.optional(),
115
+ });
95
116
  /**
96
117
  * Who minted or revoked a capability: the principal whose operation did it, or a platform
97
118
  * actor through `HostAdmin`. Two members rather than a principal with a flag, because an
@@ -113,6 +134,12 @@ const capabilityRecordCommon = {
113
134
  lastUsedAt: instant.nullable(),
114
135
  revokedAt: instant.nullable(),
115
136
  revokedBy: capabilityAuthor.nullable(),
137
+ /**
138
+ * Why the kernel itself revoked it, when it did (#1686): `holdings-changed` — a principal-minted
139
+ * `become` whose principal's holdings changed between mint and exchange. Null for a revoke a
140
+ * person or the platform made, and for a live capability. Absent from a host that predates it.
141
+ */
142
+ revokedReason: z.enum(['holdings-changed']).nullable().optional(),
116
143
  };
117
144
  /**
118
145
  * A capability as the directory holds it — what `ctx.capabilities.list` returns. Carries
@@ -145,6 +172,47 @@ export const mintedCapability = z.object({
145
172
  secret: z.string().startsWith(CAPABILITY_SECRET_PREFIX),
146
173
  expiresAt: instant.nullable(),
147
174
  });
175
+ /**
176
+ * Why a host's bounded `become` mint refused (#1686), with nothing written:
177
+ * - `coverage` — what the minter lacks of what the target holds;
178
+ * - `target-holds-nothing` — the target holds nothing at the node. Its own answer because a
179
+ * `Coverage` refusal must name a missing key and there is none: an empty set would cover
180
+ * trivially, and the link would yield whatever that principal is granted later;
181
+ * - `target-already-claimed` — some `become` capability for the target has already been
182
+ * exchanged in this scope: somebody already is that principal, and a second link would let a
183
+ * second person become them too. A principal-minted `become` is for a seat nobody has taken.
184
+ */
185
+ export const becomeMintRefusal = z.union([
186
+ z.object({ ok: z.literal(false), coverage }),
187
+ z.object({ ok: z.literal(false), refused: z.enum(['target-holds-nothing', 'target-already-claimed']) }),
188
+ ]);
189
+ /** What a host's bounded `become` mint answers (#1686): the minted capability, or the refusal. */
190
+ export const boundedBecomeMint = z.union([z.object({ ok: z.literal(true), minted: mintedCapability }), becomeMintRefusal]);
191
+ /**
192
+ * What a host's bounded `become` revoke answers (#1686): whether this call revoked it, or the
193
+ * coverage that refused the revoker — who must be the link's minter, or hold everything its
194
+ * principal holds now (whoever could have minted it). A refusal writes nothing.
195
+ */
196
+ export const boundedBecomeRevoke = z.union([
197
+ z.object({ ok: z.literal(true), revoked: z.boolean() }),
198
+ z.object({ ok: z.literal(false), coverage }),
199
+ ]);
200
+ /**
201
+ * Where a `become` link stands (#1686) — what a pending-invite list shows beside each invite, so
202
+ * a link the kernel revoked is never shown as open. `used`: exchanged up to its limit. A
203
+ * capability the scope does not hold reads as `revoked`.
204
+ */
205
+ export const becomeLinkState = z.object({
206
+ state: z.enum(['open', 'used', 'revoked', 'expired']),
207
+ /** Why the kernel revoked it, when it did; null otherwise. */
208
+ reason: z.enum(['holdings-changed']).nullable(),
209
+ });
210
+ /**
211
+ * The most links one `becomeLinkStates` call may name — the cap other id-list reads take
212
+ * (`CONNECT_LINK_LIST_MAX_IDS`, a grant-scoped read's maximum). Over it the read refuses rather
213
+ * than truncate; a list longer than this asks in pages of it.
214
+ */
215
+ export const BECOME_LINK_STATES_MAX_IDS = 100;
148
216
  /**
149
217
  * What an exchange yields: a session to act as the capability (`act`), or the principal
150
218
  * the holder becomes (`become`). A refused exchange — an unknown, expired, revoked or
@@ -274,6 +342,13 @@ export const CAPABILITY_REVOKED = 'capability.revoked';
274
342
  * capability itself (`capability:<id>`) for `become`; actor: `{ capability }`.
275
343
  */
276
344
  export const CAPABILITY_EXERCISED = 'capability.exercised';
345
+ /**
346
+ * A principal minted a `become` capability through a host's bounded verb (#1686) — a member
347
+ * invite. Entity: the capability itself (`capability:<id>`), as on a `become`'s
348
+ * `capability.exercised`; actor: the minter. Its own type rather than `capability.minted`,
349
+ * whose payload is an `act` capability's (an entity and its keys) and is frozen.
350
+ */
351
+ export const CAPABILITY_BECOME_MINTED = 'capability.become-minted';
277
352
  export const capabilityMintedPayload = z.object({
278
353
  capabilityId,
279
354
  entity: entityRef,
@@ -284,6 +359,15 @@ export const capabilityMintedPayload = z.object({
284
359
  label: capabilityLabel.nullable(),
285
360
  mintedBy: principalId,
286
361
  });
362
+ export const capabilityBecomeMintedPayload = z.object({
363
+ capabilityId,
364
+ /** The principal whoever exchanges the secret becomes. */
365
+ principal: principalId,
366
+ expiresAt: instant.nullable(),
367
+ maxUses: z.number().int().positive(),
368
+ label: capabilityLabel.nullable(),
369
+ mintedBy: principalId,
370
+ });
287
371
  export const capabilityRevokedPayload = z.object({
288
372
  capabilityId,
289
373
  entity: entityRef,
@@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AC"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { type EntityHistoryInput, type EventCauseInput, type EventEffectsInput, type InvocationEventsInput, type DeadLettersInput, type EventFacetInput, type EventFacetResult, type QueryScopeInput, type ReadScopeTableInput } from './introspection.js';
3
3
  import type { DenialFilter } from './denial.js';
4
- import type { CapabilityFilter } from './capability.js';
4
+ import { type CapabilityFilter } from './capability.js';
5
5
  import type { LifecycleFlowInput } from './lifecycle-flow.js';
6
6
  import type { OperationSeriesInput } from './operation-series.js';
7
7
  export declare const adminAction: z.ZodEnum<{
@@ -10,6 +10,7 @@ export declare const adminAction: z.ZodEnum<{
10
10
  admitVersion: "admitVersion";
11
11
  archiveScope: "archiveScope";
12
12
  assignRole: "assignRole";
13
+ backfillScopeCopy: "backfillScopeCopy";
13
14
  beginImpersonation: "beginImpersonation";
14
15
  bindHostname: "bindHostname";
15
16
  bindScopeVersion: "bindScopeVersion";
@@ -312,6 +313,17 @@ export declare const scopeMemberInvite: z.ZodObject<{
312
313
  roles: z.ZodArray<z.ZodString>;
313
314
  email: z.ZodNullable<z.ZodString>;
314
315
  createdAt: z.ZodNumber;
316
+ link: z.ZodOptional<z.ZodNullable<z.ZodObject<{
317
+ state: z.ZodEnum<{
318
+ expired: "expired";
319
+ open: "open";
320
+ revoked: "revoked";
321
+ used: "used";
322
+ }>;
323
+ reason: z.ZodNullable<z.ZodEnum<{
324
+ "holdings-changed": "holdings-changed";
325
+ }>>;
326
+ }, z.core.$strip>>>;
315
327
  }, z.core.$strip>;
316
328
  export declare const scopeMembers: z.ZodObject<{
317
329
  roles: z.ZodArray<z.ZodString>;
@@ -328,6 +340,17 @@ export declare const scopeMembers: z.ZodObject<{
328
340
  roles: z.ZodArray<z.ZodString>;
329
341
  email: z.ZodNullable<z.ZodString>;
330
342
  createdAt: z.ZodNumber;
343
+ link: z.ZodOptional<z.ZodNullable<z.ZodObject<{
344
+ state: z.ZodEnum<{
345
+ expired: "expired";
346
+ open: "open";
347
+ revoked: "revoked";
348
+ used: "used";
349
+ }>;
350
+ reason: z.ZodNullable<z.ZodEnum<{
351
+ "holdings-changed": "holdings-changed";
352
+ }>>;
353
+ }, z.core.$strip>>>;
331
354
  }, z.core.$strip>>;
332
355
  }, z.core.$strip>;
333
356
  export type ScopeMember = z.infer<typeof scopeMember>;
@@ -1121,6 +1144,7 @@ export declare const adminLogEntry: z.ZodObject<{
1121
1144
  admitVersion: "admitVersion";
1122
1145
  archiveScope: "archiveScope";
1123
1146
  assignRole: "assignRole";
1147
+ backfillScopeCopy: "backfillScopeCopy";
1124
1148
  beginImpersonation: "beginImpersonation";
1125
1149
  bindHostname: "bindHostname";
1126
1150
  bindScopeVersion: "bindScopeVersion";
@@ -1572,6 +1596,14 @@ export declare const tenantExport: z.ZodObject<{
1572
1596
  expiresAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1573
1597
  servingRef: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1574
1598
  archivedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1599
+ archivedFromStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
1600
+ active: "active";
1601
+ archived: "archived";
1602
+ archiving: "archiving";
1603
+ provisioning: "provisioning";
1604
+ reaped: "reaped";
1605
+ suspended: "suspended";
1606
+ }>>>;
1575
1607
  createdAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
1576
1608
  }, z.core.$strip>>;
1577
1609
  orgs: z.ZodArray<z.ZodObject<{
@@ -1678,6 +1710,7 @@ export declare const tenantExport: z.ZodObject<{
1678
1710
  admitVersion: "admitVersion";
1679
1711
  archiveScope: "archiveScope";
1680
1712
  assignRole: "assignRole";
1713
+ backfillScopeCopy: "backfillScopeCopy";
1681
1714
  beginImpersonation: "beginImpersonation";
1682
1715
  bindHostname: "bindHostname";
1683
1716
  bindScopeVersion: "bindScopeVersion";
@@ -1840,6 +1873,61 @@ export declare const meterScopeCounts: z.ZodObject<{
1840
1873
  reaped: z.ZodNumber;
1841
1874
  }, z.core.$strip>;
1842
1875
  export type MeterScopeCounts = z.infer<typeof meterScopeCounts>;
1876
+ /**
1877
+ * What a storage figure deliberately does NOT count, named on every figure so a consumer
1878
+ * cannot mistake the number for the whole bill:
1879
+ * - `attachments`: attachment bytes live in a blob store. The scope holds only their rows.
1880
+ * - `tenant-stores`: per-tenant D1 databases are separate databases.
1881
+ * - `lake`: shipped event history is volume in the lake, not in any scope.
1882
+ */
1883
+ export declare const storageExclusion: z.ZodEnum<{
1884
+ attachments: "attachments";
1885
+ lake: "lake";
1886
+ "tenant-stores": "tenant-stores";
1887
+ }>;
1888
+ export type StorageExclusion = z.infer<typeof storageExclusion>;
1889
+ /** Every exclusion, in the order a surface lists them. A reading always carries all three. */
1890
+ export declare const STORAGE_EXCLUSIONS: readonly StorageExclusion[];
1891
+ /**
1892
+ * The STORED storage gauge (#1524), as `/meters` shows it: the sum of each scope's latest
1893
+ * sampled database size. It is read from the directory, so serving it wakes no scope.
1894
+ *
1895
+ * The scheduled pass samples a scope only when an earlier phase of the same pass already
1896
+ * reached it, at most once a day, so a figure is a set of readings taken at different
1897
+ * instants. `oldestReadAt` is the honest "as of": every scope in the sum was read at or
1898
+ * after it. `sampled < total` means some scopes have never been read (a new scope, or one
1899
+ * no pass reached), and a surface must not call `bytes` the tenant's total then.
1900
+ */
1901
+ export declare const storageGauge: z.ZodObject<{
1902
+ basis: z.ZodLiteral<"scope-databases">;
1903
+ excluded: z.ZodArray<z.ZodEnum<{
1904
+ attachments: "attachments";
1905
+ lake: "lake";
1906
+ "tenant-stores": "tenant-stores";
1907
+ }>>;
1908
+ bytes: z.ZodNumber;
1909
+ sampled: z.ZodNumber;
1910
+ total: z.ZodNumber;
1911
+ oldestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1912
+ newestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1913
+ failing: z.ZodNumber;
1914
+ lastFailedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1915
+ }, z.core.$strip>;
1916
+ export type StorageGauge = z.infer<typeof storageGauge>;
1917
+ /**
1918
+ * One stored storage sample (#1524): a scope's database size as last read on one UTC day.
1919
+ * A later reading on the same day replaces it; the next day starts a new row. That is what
1920
+ * makes byte-days computable later without storing every pass's reading. Kept 13 months
1921
+ * (`STORAGE_GAUGE_RETENTION_MONTHS`).
1922
+ */
1923
+ export declare const scopeStorageSample: z.ZodObject<{
1924
+ tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
1925
+ scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
1926
+ day: z.ZodString;
1927
+ bytes: z.ZodNumber;
1928
+ readAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
1929
+ }, z.core.$strip>;
1930
+ export type ScopeStorageSample = z.infer<typeof scopeStorageSample>;
1843
1931
  /** Meter 1, per tenant: the scopes under it, and how many SKUs it holds. */
1844
1932
  export declare const tenantMeterRow: z.ZodObject<{
1845
1933
  tenantId: z.core.$ZodBranded<z.ZodString, "TenantId", "out">;
@@ -1863,6 +1951,21 @@ export declare const tenantMeterRow: z.ZodObject<{
1863
1951
  live: z.ZodNumber;
1864
1952
  expired: z.ZodNumber;
1865
1953
  }, z.core.$strip>;
1954
+ storage: z.ZodOptional<z.ZodObject<{
1955
+ basis: z.ZodLiteral<"scope-databases">;
1956
+ excluded: z.ZodArray<z.ZodEnum<{
1957
+ attachments: "attachments";
1958
+ lake: "lake";
1959
+ "tenant-stores": "tenant-stores";
1960
+ }>>;
1961
+ bytes: z.ZodNumber;
1962
+ sampled: z.ZodNumber;
1963
+ total: z.ZodNumber;
1964
+ oldestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1965
+ newestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1966
+ failing: z.ZodNumber;
1967
+ lastFailedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1968
+ }, z.core.$strip>>;
1866
1969
  }, z.core.$strip>;
1867
1970
  export type TenantMeterRow = z.infer<typeof tenantMeterRow>;
1868
1971
  /**
@@ -1934,32 +2037,49 @@ export declare const meterReading: z.ZodObject<{
1934
2037
  live: z.ZodNumber;
1935
2038
  expired: z.ZodNumber;
1936
2039
  }, z.core.$strip>;
2040
+ storage: z.ZodOptional<z.ZodObject<{
2041
+ basis: z.ZodLiteral<"scope-databases">;
2042
+ excluded: z.ZodArray<z.ZodEnum<{
2043
+ attachments: "attachments";
2044
+ lake: "lake";
2045
+ "tenant-stores": "tenant-stores";
2046
+ }>>;
2047
+ bytes: z.ZodNumber;
2048
+ sampled: z.ZodNumber;
2049
+ total: z.ZodNumber;
2050
+ oldestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
2051
+ newestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
2052
+ failing: z.ZodNumber;
2053
+ lastFailedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
2054
+ }, z.core.$strip>>;
2055
+ }, z.core.$strip>>;
2056
+ storage: z.ZodOptional<z.ZodObject<{
2057
+ basis: z.ZodLiteral<"scope-databases">;
2058
+ excluded: z.ZodArray<z.ZodEnum<{
2059
+ attachments: "attachments";
2060
+ lake: "lake";
2061
+ "tenant-stores": "tenant-stores";
2062
+ }>>;
2063
+ bytes: z.ZodNumber;
2064
+ sampled: z.ZodNumber;
2065
+ total: z.ZodNumber;
2066
+ oldestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
2067
+ newestReadAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
2068
+ failing: z.ZodNumber;
2069
+ lastFailedAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
1937
2070
  }, z.core.$strip>>;
1938
2071
  }, z.core.$strip>;
1939
2072
  export type MeterReading = z.infer<typeof meterReading>;
1940
2073
  /**
1941
- * Storage, read on demand (#1524): the size of each of one tenant's scope DATABASES,
1942
- * and their sum. Read-only first, by decision — nothing is stored, no sweep takes it,
1943
- * and there is no fleet-wide form. Reading a scope's size wakes that scope's Durable
1944
- * Object, so a periodic or fleet-wide reading would bill a DO invocation per idle scope
1945
- * per interval. The reading is taken when a person asks for it and costs what they asked.
2074
+ * Storage, read on demand (#1524): the size of each of one tenant's scope DATABASES, and
2075
+ * their sum, read live when a person asks. Reading a scope's size wakes that scope's Durable
2076
+ * Object, so this reading is paged and has no fleet-wide form. The stored daily figure that
2077
+ * `/meters` serves without a wake is `storageGauge`.
1946
2078
  *
1947
2079
  * What it counts: `SqlStorage.databaseSize` on Cloudflare, `page_count × page_size` on
1948
2080
  * SQLite. That is rows, indexes, the spine, and free pages the database has not given back.
1949
- * What it deliberately does NOT count, named in `excluded` so a consumer cannot mistake
1950
- * the number for the whole bill:
1951
- * - `attachments`: attachment bytes live in a blob store. The scope holds only their rows.
1952
- * - `tenant-stores`: per-tenant D1 databases are separate databases.
1953
- * - `lake`: shipped event history is volume in the lake, not in any scope.
2081
+ * What it does not count is named in `excluded` (`storageExclusion`).
1954
2082
  */
1955
- export declare const storageExclusion: z.ZodEnum<{
1956
- attachments: "attachments";
1957
- lake: "lake";
1958
- "tenant-stores": "tenant-stores";
1959
- }>;
1960
- export type StorageExclusion = z.infer<typeof storageExclusion>;
1961
- /** Every exclusion, in the order a surface lists them. A reading always carries all three. */
1962
- export declare const STORAGE_EXCLUSIONS: readonly StorageExclusion[];
1963
2083
  /** One scope's database size, or why it could not be read. Exactly one of the two is set. */
1964
2084
  export declare const scopeStorageReading: z.ZodUnion<readonly [z.ZodObject<{
1965
2085
  scopeId: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;