@substrat-run/contracts 0.29.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/deploy.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { z } from 'zod';
2
+ import { type ModuleManifest } from './manifest.js';
3
+ import { type RoleDefinition } from './permission.js';
2
4
  /**
3
5
  * The runtime baseline a `runtimeNeeds` vertical builds against — the platform picks the
4
6
  * compatibility date, the builder never does. Advancing it is a platform release concern
@@ -159,6 +161,46 @@ export declare const permissionRegistry: z.ZodObject<{
159
161
  }, z.core.$strip>>>;
160
162
  }, z.core.$strip>;
161
163
  export type PermissionRegistry = z.infer<typeof permissionRegistry>;
164
+ /**
165
+ * A vertical's declared permission surface, as the **single typed source** — the input the
166
+ * permission checkpoint (`tools/permission-diff.mts`) and `substrat push` both read to derive
167
+ * the {@link permissionRegistry}. It is not the registry itself: keys carry no `declaredBy` yet
168
+ * (that is derived from `modules`), because this is what an author *writes*, once.
169
+ *
170
+ * `modules` is structural on purpose — a `ModuleRegistration[]` (kernel) is assignable, but
171
+ * `contracts` may not depend on the kernel, so it asks only for the `manifest` it reads.
172
+ */
173
+ export interface PermissionsInput {
174
+ /** The modules the host registers — the source of every permission key + description. */
175
+ modules: readonly {
176
+ manifest: ModuleManifest;
177
+ }[];
178
+ /** The role templates provisioning stamps into each tenant. */
179
+ roles: readonly RoleDefinition[];
180
+ /** Entity-narrowed grant shapes — keys reachable outside the role table (default none). */
181
+ entityGrants?: readonly EntityGrantShape[];
182
+ }
183
+ /**
184
+ * Declare a vertical's permission surface, once, in TypeScript. An identity helper: it pins the
185
+ * shape so a missing or mistyped field is a **compile error**, not a silently-skipped vertical,
186
+ * and returns a plain, side-effect-free object safe to import in any Node context to read the
187
+ * surface without running the vertical. A vertical exports the result and points at it from
188
+ * `package.json` `substrat.permissions`; the checkpoint discovers it there rather than from a
189
+ * by-name `seed.ts` re-export.
190
+ */
191
+ export declare function definePermissions(input: PermissionsInput): PermissionsInput;
192
+ /**
193
+ * Derive the machine-readable {@link permissionRegistry} from a vertical's declared surface —
194
+ * the keys+descriptions each module declares (with `declaredBy`), the role templates, and the
195
+ * entity-grant shapes. `substrat push` calls this on the imported `permissions` entry to build
196
+ * what it ships in the manifest; the permission checkpoint uses the same function, so the
197
+ * derived surface is one code path with no room to disagree.
198
+ *
199
+ * Deterministic: every array is sorted (keys, roles, grants, and the members within each), so
200
+ * the output — and therefore `digests.permission` — is a pure function of content, independent
201
+ * of declaration order.
202
+ */
203
+ export declare function buildPermissionRegistry(input: PermissionsInput): PermissionRegistry;
162
204
  /** The JSON part a `substrat push` sends alongside the module files. */
163
205
  export declare const deployManifest: z.ZodObject<{
164
206
  version: z.ZodString;
@@ -196,7 +238,7 @@ export declare const deployManifest: z.ZodObject<{
196
238
  name: z.ZodString;
197
239
  label: z.ZodString;
198
240
  }, z.core.$strip>>>;
199
- registry: z.ZodOptional<z.ZodObject<{
241
+ registry: z.ZodObject<{
200
242
  permissions: z.ZodArray<z.ZodObject<{
201
243
  key: z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">;
202
244
  description: z.ZodString;
@@ -211,7 +253,7 @@ export declare const deployManifest: z.ZodObject<{
211
253
  entityType: z.ZodString;
212
254
  permissions: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
213
255
  }, z.core.$strip>>>;
214
- }, z.core.$strip>>;
256
+ }, z.core.$strip>;
215
257
  digests: z.ZodObject<{
216
258
  manifest: z.ZodString;
217
259
  permission: z.ZodString;
@@ -219,4 +261,70 @@ export declare const deployManifest: z.ZodObject<{
219
261
  }, z.core.$strip>;
220
262
  }, z.core.$strip>;
221
263
  export type DeployManifest = z.infer<typeof deployManifest>;
264
+ /**
265
+ * The same manifest for **reading persisted history**, where `registry` may be absent — a
266
+ * version pushed before it was carried (D-39) or before it was required (D-41). The push trust
267
+ * boundary always parses with the strict {@link deployManifest} (registry required), so a NEW
268
+ * push cannot omit it; only re-reads of already-stored manifests use this lenient form, so an
269
+ * old version stays readable and re-deployable in place (#286) instead of failing to parse.
270
+ */
271
+ export declare const storedDeployManifest: z.ZodObject<{
272
+ version: z.ZodString;
273
+ name: z.ZodOptional<z.ZodString>;
274
+ entry: z.ZodString;
275
+ compatibilityDate: z.ZodString;
276
+ compatibilityFlags: z.ZodDefault<z.ZodArray<z.ZodString>>;
277
+ doClasses: z.ZodDefault<z.ZodArray<z.ZodString>>;
278
+ bindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
279
+ type: z.ZodString;
280
+ name: z.ZodString;
281
+ class_name: z.ZodOptional<z.ZodString>;
282
+ script_name: z.ZodOptional<z.ZodString>;
283
+ id: z.ZodOptional<z.ZodString>;
284
+ }, z.core.$strip>>>;
285
+ tenantStores: z.ZodDefault<z.ZodArray<z.ZodObject<{
286
+ binding: z.ZodString;
287
+ kind: z.ZodDefault<z.ZodLiteral<"relational">>;
288
+ }, z.core.$strip>>>;
289
+ envSpec: z.ZodOptional<z.ZodArray<z.ZodObject<{
290
+ key: z.ZodString;
291
+ label: z.ZodOptional<z.ZodString>;
292
+ description: z.ZodString;
293
+ placeholder: z.ZodOptional<z.ZodString>;
294
+ required: z.ZodDefault<z.ZodBoolean>;
295
+ secret: z.ZodDefault<z.ZodBoolean>;
296
+ default: z.ZodOptional<z.ZodString>;
297
+ group: z.ZodOptional<z.ZodString>;
298
+ }, z.core.$strip>>>;
299
+ ownerGrants: z.ZodOptional<z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>>;
300
+ entitlements: z.ZodOptional<z.ZodArray<z.ZodString>>;
301
+ provides: z.ZodOptional<z.ZodArray<z.ZodString>>;
302
+ requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
303
+ surfaces: z.ZodOptional<z.ZodArray<z.ZodObject<{
304
+ name: z.ZodString;
305
+ label: z.ZodString;
306
+ }, z.core.$strip>>>;
307
+ digests: z.ZodObject<{
308
+ manifest: z.ZodString;
309
+ permission: z.ZodString;
310
+ migration: z.ZodString;
311
+ }, z.core.$strip>;
312
+ registry: z.ZodOptional<z.ZodObject<{
313
+ permissions: z.ZodArray<z.ZodObject<{
314
+ key: z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">;
315
+ description: z.ZodString;
316
+ declaredBy: z.ZodArray<z.core.$ZodBranded<z.ZodString, "ModuleId", "out">>;
317
+ }, z.core.$strip>>;
318
+ roles: z.ZodArray<z.ZodObject<{
319
+ key: z.ZodString;
320
+ permissions: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
321
+ source: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "ModuleId", "out">, z.ZodLiteral<"vertical">]>;
322
+ }, z.core.$strip>>;
323
+ entityGrants: z.ZodDefault<z.ZodArray<z.ZodObject<{
324
+ entityType: z.ZodString;
325
+ permissions: z.ZodArray<z.core.$ZodBranded<z.ZodString, "PermissionKey", "out">>;
326
+ }, z.core.$strip>>>;
327
+ }, z.core.$strip>>;
328
+ }, z.core.$strip>;
329
+ export type StoredDeployManifest = z.infer<typeof storedDeployManifest>;
222
330
  //# sourceMappingURL=deploy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;iBAKpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe;;;iBAK1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
package/dist/deploy.js CHANGED
@@ -163,6 +163,56 @@ export const permissionRegistry = z.object({
163
163
  roles: z.array(roleDefinition),
164
164
  entityGrants: z.array(entityGrantShape).default([]),
165
165
  });
166
+ /**
167
+ * Declare a vertical's permission surface, once, in TypeScript. An identity helper: it pins the
168
+ * shape so a missing or mistyped field is a **compile error**, not a silently-skipped vertical,
169
+ * and returns a plain, side-effect-free object safe to import in any Node context to read the
170
+ * surface without running the vertical. A vertical exports the result and points at it from
171
+ * `package.json` `substrat.permissions`; the checkpoint discovers it there rather than from a
172
+ * by-name `seed.ts` re-export.
173
+ */
174
+ export function definePermissions(input) {
175
+ return input;
176
+ }
177
+ /**
178
+ * Derive the machine-readable {@link permissionRegistry} from a vertical's declared surface —
179
+ * the keys+descriptions each module declares (with `declaredBy`), the role templates, and the
180
+ * entity-grant shapes. `substrat push` calls this on the imported `permissions` entry to build
181
+ * what it ships in the manifest; the permission checkpoint uses the same function, so the
182
+ * derived surface is one code path with no room to disagree.
183
+ *
184
+ * Deterministic: every array is sorted (keys, roles, grants, and the members within each), so
185
+ * the output — and therefore `digests.permission` — is a pure function of content, independent
186
+ * of declaration order.
187
+ */
188
+ export function buildPermissionRegistry(input) {
189
+ const cmp = (a, b) => a.localeCompare(b);
190
+ const sortKeys = (keys) => [...keys].sort(cmp);
191
+ const declaredBy = new Map();
192
+ for (const m of input.modules) {
193
+ for (const p of m.manifest.permissions) {
194
+ const seen = declaredBy.get(p.key);
195
+ if (seen)
196
+ seen.modules.add(m.manifest.id);
197
+ else
198
+ declaredBy.set(p.key, { description: p.description, modules: new Set([m.manifest.id]) });
199
+ }
200
+ }
201
+ const roles = [...input.roles]
202
+ .sort((a, b) => cmp(a.key, b.key))
203
+ .map((r) => {
204
+ if (!r.source)
205
+ throw new Error(`buildPermissionRegistry: role '${r.key}' has no source`);
206
+ return { key: r.key, permissions: sortKeys(r.permissions), source: r.source };
207
+ });
208
+ const permissions = [...declaredBy.entries()]
209
+ .map(([key, v]) => ({ key, description: v.description, declaredBy: [...v.modules].sort(cmp) }))
210
+ .sort((a, b) => cmp(a.key, b.key));
211
+ const entityGrants = [...(input.entityGrants ?? [])]
212
+ .sort((a, b) => cmp(a.entityType, b.entityType))
213
+ .map((g) => ({ entityType: g.entityType, permissions: sortKeys(g.permissions) }));
214
+ return { permissions, roles, entityGrants };
215
+ }
166
216
  /** The JSON part a `substrat push` sends alongside the module files. */
167
217
  export const deployManifest = z.object({
168
218
  version: z.string().min(1),
@@ -191,11 +241,13 @@ export const deployManifest = z.object({
191
241
  /** The surfaces the vertical serves (package.json `substrat.surfaces`, K-26 multi-surface) —
192
242
  * labels only, carried to the registry for the hostname-binding picker. Metadata, not code. */
193
243
  surfaces: z.array(declaredSurface).optional(),
194
- /** The vertical's declared permission surface (D-39): keys+descriptions, role templates,
195
- * entity-grant shapes — the machine-readable PERMISSIONS.md. Optional + additive (D-28);
196
- * `digests.permission` is its content hash. Absent the vertical ships no registry here
197
- * and the permission digest is over the empty surface. */
198
- registry: permissionRegistry.optional(),
244
+ /** The vertical's declared permission surface (D-39/D-41): keys+descriptions, role templates,
245
+ * entity-grant shapes — the machine-readable twin of PERMISSIONS.md, derived at push from the
246
+ * vertical's `definePermissions(...)` entry. REQUIRED: a deployable vertical must declare its
247
+ * surface (an explicit empty registry for one that genuinely exposes nothing), so absence is a
248
+ * parse error at the trust boundary rather than a silent empty surface. `digests.permission` is
249
+ * its content hash. */
250
+ registry: permissionRegistry,
199
251
  /** Computed by the builder's toolchain; what the promotion checkpoint compares. */
200
252
  digests: z.object({
201
253
  manifest: z.string().min(1),
@@ -206,4 +258,14 @@ export const deployManifest = z.object({
206
258
  migration: z.string().min(1),
207
259
  }),
208
260
  });
261
+ /**
262
+ * The same manifest for **reading persisted history**, where `registry` may be absent — a
263
+ * version pushed before it was carried (D-39) or before it was required (D-41). The push trust
264
+ * boundary always parses with the strict {@link deployManifest} (registry required), so a NEW
265
+ * push cannot omit it; only re-reads of already-stored manifests use this lenient form, so an
266
+ * old version stays readable and re-deployable in place (#286) instead of failing to parse.
267
+ */
268
+ export const storedDeployManifest = deployManifest.extend({
269
+ registry: permissionRegistry.optional(),
270
+ });
209
271
  //# sourceMappingURL=deploy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,4EAA4E;AAC5E,wBAAwB;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,oFAAoF;IACpF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC;IAC9C,iDAAiD;IACjD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,2FAA2F;IAC3F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mB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,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACvC;+FAC2F;IAC3F,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IAC9C,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IACxC;oGACgG;IAChG,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IAC7C;;;;;4BAKwB;IACxB,QAAQ,EAAE,kBAAkB;IAC5B,mFAAmF;IACnF,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B;;0CAEkC;QAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7B,CAAC;CACH,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC,MAAM,CAAC;IACxD,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC"}
package/dist/ids.d.ts CHANGED
@@ -11,6 +11,8 @@ export declare const platformActorId: z.core.$ZodBranded<z.ZodString, "PlatformA
11
11
  export type PlatformActorId = z.infer<typeof platformActorId>;
12
12
  export declare const eventId: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
13
13
  export type EventId = z.infer<typeof eventId>;
14
+ export declare const platformRequestId: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
15
+ export type PlatformRequestId = z.infer<typeof platformRequestId>;
14
16
  export declare const dataSubjectId: z.core.$ZodBranded<z.ZodString, "DataSubjectId", "out">;
15
17
  export type DataSubjectId = z.infer<typeof dataSubjectId>;
16
18
  export declare const moduleId: z.core.$ZodBranded<z.ZodString, "ModuleId", "out">;
package/dist/ids.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,QAAQ,oDAA6C,CAAC;AACnE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEhD,eAAO,MAAM,OAAO,mDAA4C,CAAC;AACjE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,WAAW,uDAAgD,CAAC;AACzE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAMtD,eAAO,MAAM,KAAK,iDAA0C,CAAC;AAC7D,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAK1C,eAAO,MAAM,eAAe,2DAAoD,CAAC;AACjF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,OAAO,mDAA4C,CAAC;AACjE,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,aAAa,yDAAkD,CAAC;AAC7E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAG1D,eAAO,MAAM,QAAQ,oDAGC,CAA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,CAAC,CAAC;AAK9C,eAAO,MAAM,iBAAiB,6DAAsD,CAAC;AACrF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,eAAO,MAAM,aAAa,yDAAkD,CAAC;AAC7E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAG1D,eAAO,MAAM,QAAQ,oDAGC,CAAC;AACvB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAGhD,eAAO,MAAM,OAAO,mDAA2D,CAAC;AAChF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;AAG9C,eAAO,MAAM,aAAa,yDAGC,CAAC;AAC5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,IAAI,aAAwD,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,aAEwD,CAAC"}
package/dist/ids.js CHANGED
@@ -16,6 +16,10 @@ export const orgId = z.string().regex(ULID).brand();
16
16
  // in any tenant, and the compiler must refuse to confuse the two.
17
17
  export const platformActorId = z.string().regex(ULID).brand();
18
18
  export const eventId = z.string().regex(ULID).brand();
19
+ // A platform-intent request (platform-intents.md) — the id of a durable `_substrat_platform_requests`
20
+ // row a vertical enqueues via `ctx.requestPlatform` and the platform later drains. Branded like every
21
+ // other id so a request id can't be confused with an event or scope id.
22
+ export const platformRequestId = z.string().regex(ULID).brand();
19
23
  export const dataSubjectId = z.string().regex(ULID).brand();
20
24
  // npm-package-shaped, e.g. '@substrat-run/engine-workorder'
21
25
  export const moduleId = z
package/dist/ids.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAA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28
28
  export * from './events.js';
29
+ export * from './platform-request.js';
29
30
  export * from './manifest.js';
30
31
  export * from './openapi.js';
31
32
  export * from './deploy.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -26,6 +26,7 @@ export * from './connections.js';
26
26
  export * from './control-plane.js';
27
27
  export * from './permission.js';
28
28
  export * from './events.js';
29
+ export * from './platform-request.js';
29
30
  export * from './manifest.js';
30
31
  export * from './openapi.js';
31
32
  export * from './deploy.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Platform intents (docs/design/platform-intents.md) — how a sandbox-clean vertical asks the
4
+ * platform to perform a privileged action (provision a sibling scope, request quota, …) without
5
+ * an upward call. A vertical operation enqueues a typed intent into its own scope's
6
+ * `_substrat_platform_requests` spine table via `ctx.requestPlatform`; the platform pulls and
7
+ * executes it with `HostAdmin` authority, knowing the tenant inherently (it reads that scope's DO).
8
+ */
9
+ export declare const platformRequestStatus: z.ZodEnum<{
10
+ done: "done";
11
+ failed: "failed";
12
+ pending: "pending";
13
+ }>;
14
+ export type PlatformRequestStatus = z.infer<typeof platformRequestStatus>;
15
+ /**
16
+ * What module code passes to `ctx.requestPlatform`. `kind` selects the platform-side handler;
17
+ * `payload` is opaque to the kernel (validated by the handler for that kind at drain time),
18
+ * exactly as `domainEventInput.payload` is opaque to the emit path. Origin fields (id, requestedAt,
19
+ * requestedBy) are stamped kernel-side and are deliberately absent here.
20
+ */
21
+ export declare const platformRequestInput: z.ZodObject<{
22
+ kind: z.ZodString;
23
+ payload: z.ZodUnknown;
24
+ }, z.core.$strip>;
25
+ export type PlatformRequestInput = z.infer<typeof platformRequestInput>;
26
+ /** The full kernel-stamped intent record as it lives in the spine and is read by the drain. */
27
+ export declare const platformRequest: z.ZodObject<{
28
+ id: z.core.$ZodBranded<z.ZodString, "PlatformRequestId", "out">;
29
+ kind: z.ZodString;
30
+ payload: z.ZodUnknown;
31
+ requestedBy: z.ZodUnion<readonly [z.core.$ZodBranded<z.ZodString, "PrincipalId", "out">, z.ZodObject<{
32
+ system: z.core.$ZodBranded<z.ZodString, "ModuleId", "out">;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ connection: z.ZodString;
35
+ }, z.core.$strip>]>;
36
+ status: z.ZodEnum<{
37
+ done: "done";
38
+ failed: "failed";
39
+ pending: "pending";
40
+ }>;
41
+ attempts: z.ZodNumber;
42
+ lastError: z.ZodNullable<z.ZodString>;
43
+ result: z.ZodNullable<z.ZodUnknown>;
44
+ requestedAt: z.core.$ZodBranded<z.ZodString, "Instant", "out">;
45
+ settledAt: z.ZodNullable<z.core.$ZodBranded<z.ZodString, "Instant", "out">>;
46
+ }, z.core.$strip>;
47
+ export type PlatformRequest = z.infer<typeof platformRequest>;
48
+ /**
49
+ * Backpressure bound (platform-intents.md §Resolved decisions): `ctx.requestPlatform` refuses once
50
+ * a scope already holds this many `pending` intents, so a stuck or runaway vertical cannot flood
51
+ * the drain. Shared by every adapter so the limit can't drift between them.
52
+ */
53
+ export declare const MAX_PENDING_PLATFORM_REQUESTS = 32;
54
+ //# sourceMappingURL=platform-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-request.d.ts","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;GAMG;AAEH,eAAO,MAAM,qBAAqB;;;;EAAwC,CAAC;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,+FAA+F;AAC/F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;iBAW1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ import { instant, platformRequestId } from './ids.js';
3
+ import { actor } from './events.js';
4
+ /**
5
+ * Platform intents (docs/design/platform-intents.md) — how a sandbox-clean vertical asks the
6
+ * platform to perform a privileged action (provision a sibling scope, request quota, …) without
7
+ * an upward call. A vertical operation enqueues a typed intent into its own scope's
8
+ * `_substrat_platform_requests` spine table via `ctx.requestPlatform`; the platform pulls and
9
+ * executes it with `HostAdmin` authority, knowing the tenant inherently (it reads that scope's DO).
10
+ */
11
+ export const platformRequestStatus = z.enum(['pending', 'done', 'failed']);
12
+ /**
13
+ * What module code passes to `ctx.requestPlatform`. `kind` selects the platform-side handler;
14
+ * `payload` is opaque to the kernel (validated by the handler for that kind at drain time),
15
+ * exactly as `domainEventInput.payload` is opaque to the emit path. Origin fields (id, requestedAt,
16
+ * requestedBy) are stamped kernel-side and are deliberately absent here.
17
+ */
18
+ export const platformRequestInput = z.object({
19
+ kind: z.string().min(1),
20
+ payload: z.unknown(),
21
+ });
22
+ /** The full kernel-stamped intent record as it lives in the spine and is read by the drain. */
23
+ export const platformRequest = z.object({
24
+ id: platformRequestId,
25
+ kind: z.string().min(1),
26
+ payload: z.unknown(),
27
+ requestedBy: actor, // stamped kernel-side from the operation's ambient actor, like an event's `actor`
28
+ status: platformRequestStatus,
29
+ attempts: z.number().int().nonnegative(),
30
+ lastError: z.string().nullable(),
31
+ result: z.unknown().nullable(),
32
+ requestedAt: instant, // stamped kernel-side
33
+ settledAt: instant.nullable(),
34
+ });
35
+ /**
36
+ * Backpressure bound (platform-intents.md §Resolved decisions): `ctx.requestPlatform` refuses once
37
+ * a scope already holds this many `pending` intents, so a stuck or runaway vertical cannot flood
38
+ * the drain. Shared by every adapter so the limit can't drift between them.
39
+ */
40
+ export const MAX_PENDING_PLATFORM_REQUESTS = 32;
41
+ //# sourceMappingURL=platform-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-request.js","sourceRoot":"","sources":["../src/platform-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC;AAGH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,EAAE,EAAE,iBAAiB;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,WAAW,EAAE,KAAK,EAAE,kFAAkF;IACtG,MAAM,EAAE,qBAAqB;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,OAAO,EAAE,sBAAsB;IAC5C,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@substrat-run/contracts",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "description": "Substrat kernel contract schemas — Zod is the source of truth (master plan D-22); OAS/JSON Schema are emitted artifacts",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {