@substrat-run/contracts 0.197.1 → 0.198.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.
Files changed (56) hide show
  1. package/dist/auth-diagnostics.d.ts +2 -1
  2. package/dist/auth-diagnostics.d.ts.map +1 -1
  3. package/dist/auth-diagnostics.js +2 -1
  4. package/dist/auth-diagnostics.js.map +1 -1
  5. package/dist/changes.d.ts +100 -0
  6. package/dist/changes.d.ts.map +1 -0
  7. package/dist/changes.js +53 -0
  8. package/dist/changes.js.map +1 -0
  9. package/dist/delegation-surface.d.ts +40 -0
  10. package/dist/delegation-surface.d.ts.map +1 -0
  11. package/dist/delegation-surface.js +38 -0
  12. package/dist/delegation-surface.js.map +1 -0
  13. package/dist/delegations.d.ts +72 -9
  14. package/dist/delegations.d.ts.map +1 -1
  15. package/dist/delegations.js +64 -9
  16. package/dist/delegations.js.map +1 -1
  17. package/dist/denial.d.ts +3 -0
  18. package/dist/denial.d.ts.map +1 -1
  19. package/dist/denial.js +10 -0
  20. package/dist/denial.js.map +1 -1
  21. package/dist/deploy.d.ts +97 -0
  22. package/dist/deploy.d.ts.map +1 -1
  23. package/dist/deploy.js +156 -1
  24. package/dist/deploy.js.map +1 -1
  25. package/dist/entitlement-namespace.d.ts +1 -1
  26. package/dist/entitlement-namespace.d.ts.map +1 -1
  27. package/dist/entitlement-namespace.js +2 -2
  28. package/dist/entitlement-namespace.js.map +1 -1
  29. package/dist/events.d.ts +15 -0
  30. package/dist/events.d.ts.map +1 -1
  31. package/dist/events.js +17 -0
  32. package/dist/events.js.map +1 -1
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +2 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/manifest.d.ts +28 -0
  38. package/dist/manifest.d.ts.map +1 -1
  39. package/dist/manifest.js +45 -0
  40. package/dist/manifest.js.map +1 -1
  41. package/dist/peer-transport.d.ts +39 -0
  42. package/dist/peer-transport.d.ts.map +1 -1
  43. package/dist/peer-transport.js +31 -0
  44. package/dist/peer-transport.js.map +1 -1
  45. package/dist/platform-request.d.ts +3 -0
  46. package/dist/platform-request.d.ts.map +1 -1
  47. package/dist/registry-diff.d.ts +28 -0
  48. package/dist/registry-diff.d.ts.map +1 -1
  49. package/dist/registry-diff.js +49 -3
  50. package/dist/registry-diff.js.map +1 -1
  51. package/dist/source-build.d.ts +3 -0
  52. package/dist/source-build.d.ts.map +1 -1
  53. package/dist/source-build.js.map +1 -1
  54. package/dist/vertical-connector.d.ts +3 -0
  55. package/dist/vertical-connector.d.ts.map +1 -1
  56. package/package.json +1 -1
@@ -4,7 +4,8 @@
4
4
  * A diagnostic describes a check, never grants authority. Unknown fields are discarded
5
5
  * on both write and read; tokens, claims, identities and exception messages have no slot.
6
6
  */
7
- export declare const AUTH_CHECK_STAGES: readonly ['bearer', 'session', 'mcp-audience', 'mcp-caller'];
7
+ /** `peer`: the door a plugin admits its master's call for a person through (`resolveOnBehalf`). */
8
+ export declare const AUTH_CHECK_STAGES: readonly ['bearer', 'session', 'mcp-audience', 'mcp-caller', 'peer'];
8
9
  export declare const AUTH_CHECK_OUTCOMES: readonly ['accepted', 'refused', 'absent', 'error'];
9
10
  export declare const AUTH_CHECK_REASONS: readonly ['verified', 'session-invalid', 'credential-missing', 'discovery-failed', 'key-resolution-failed', 'token-expired', 'token-not-active', 'issuer-invalid', 'audience-invalid', 'claims-invalid', 'signature-invalid', 'token-invalid', 'verification-failed', 'subject-missing', 'assertion-not-access-token', 'delegation-refused', 'token-not-for-app', 'resource-mismatch', 'caller-resolved', 'caller-refused', 'caller-error'];
10
11
  export interface AuthCheck {
@@ -1 +1 @@
1
- {"version":3,"file":"auth-diagnostics.d.ts","sourceRoot":"","sources":["../src/auth-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,YAAI,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,CAAU,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,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAOjE;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAAE,CAMxD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI,CAM5E;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAStD"}
@@ -4,7 +4,8 @@
4
4
  * A diagnostic describes a check, never grants authority. Unknown fields are discarded
5
5
  * on both write and read; tokens, claims, identities and exception messages have no slot.
6
6
  */
7
- export const AUTH_CHECK_STAGES = ['bearer', 'session', 'mcp-audience', 'mcp-caller'];
7
+ /** `peer`: the door a plugin admits its master's call for a person through (`resolveOnBehalf`). */
8
+ export const AUTH_CHECK_STAGES = ['bearer', 'session', 'mcp-audience', 'mcp-caller', 'peer'];
8
9
  export const AUTH_CHECK_OUTCOMES = ['accepted', 'refused', 'absent', 'error'];
9
10
  export const AUTH_CHECK_REASONS = [
10
11
  'verified', 'session-invalid', 'credential-missing', 'discovery-failed', 'key-resolution-failed',
@@ -1 +1 @@
1
- {"version":3,"file":"auth-diagnostics.js","sourceRoot":"","sources":["../src/auth-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,CAAU,CAAC;AAC9F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AACvF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,uBAAuB;IAChG,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB;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CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAqB,EAAE,KAAgB;IACpE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,KAAK,EAAE,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,GAAG,cAAc;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;QAClD,MAAM,CAAC,iBAAiB,GAAG,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACtE,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,MAAM,IAAI,GAAI,UAAsC,CAAC,oBAAoB,CAAoC,CAAC;QAC9G,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,4DAA4D;IAC9D,CAAC;AACH,CAAC"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * The open changes of one vertical (`GET /verticals/:slug/changes`): its GitHub pull requests,
3
+ * or a hosted repository's `builder/<id>` chat branches, each with its checks and its preview.
4
+ * One provider-neutral shape, read by `substrat changes`, the plugin's approvals pane and the
5
+ * dashboard alike.
6
+ */
7
+ import { z } from 'zod';
8
+ export declare const changeChecks: z.ZodObject<{
9
+ state: z.ZodEnum<{
10
+ failure: "failure";
11
+ none: "none";
12
+ pending: "pending";
13
+ success: "success";
14
+ unknown: "unknown";
15
+ }>;
16
+ failing: z.ZodArray<z.ZodString>;
17
+ }, z.core.$strip>;
18
+ export type ChangeChecks = z.infer<typeof changeChecks>;
19
+ export declare const verticalChange: z.ZodObject<{
20
+ id: z.ZodString;
21
+ title: z.ZodString;
22
+ branch: z.ZodString;
23
+ url: z.ZodNullable<z.ZodString>;
24
+ author: z.ZodNullable<z.ZodString>;
25
+ updatedAt: z.ZodString;
26
+ head: z.ZodNullable<z.ZodString>;
27
+ checks: z.ZodObject<{
28
+ state: z.ZodEnum<{
29
+ failure: "failure";
30
+ none: "none";
31
+ pending: "pending";
32
+ success: "success";
33
+ unknown: "unknown";
34
+ }>;
35
+ failing: z.ZodArray<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ preview: z.ZodNullable<z.ZodObject<{
38
+ tag: z.ZodString;
39
+ url: z.ZodNullable<z.ZodString>;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>;
42
+ export type VerticalChange = z.infer<typeof verticalChange>;
43
+ export declare const verticalChanges: z.ZodObject<{
44
+ provider: z.ZodNullable<z.ZodEnum<{
45
+ artifacts: "artifacts";
46
+ github: "github";
47
+ }>>;
48
+ repository: z.ZodNullable<z.ZodString>;
49
+ changes: z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ title: z.ZodString;
52
+ branch: z.ZodString;
53
+ url: z.ZodNullable<z.ZodString>;
54
+ author: z.ZodNullable<z.ZodString>;
55
+ updatedAt: z.ZodString;
56
+ head: z.ZodNullable<z.ZodString>;
57
+ checks: z.ZodObject<{
58
+ state: z.ZodEnum<{
59
+ failure: "failure";
60
+ none: "none";
61
+ pending: "pending";
62
+ success: "success";
63
+ unknown: "unknown";
64
+ }>;
65
+ failing: z.ZodArray<z.ZodString>;
66
+ }, z.core.$strip>;
67
+ preview: z.ZodNullable<z.ZodObject<{
68
+ tag: z.ZodString;
69
+ url: z.ZodNullable<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>>;
72
+ reason: z.ZodOptional<z.ZodString>;
73
+ }, z.core.$strip>;
74
+ export type VerticalChanges = z.infer<typeof verticalChanges>;
75
+ /**
76
+ * The builder studio's answer for one project (`GET /internal/changes?slug=`): its repository and,
77
+ * for a hosted one, the chat branches with work the base does not have. A GitHub project's chats
78
+ * merge by pull request, so the control plane reads those from GitHub instead.
79
+ */
80
+ export declare const hostedChanges: z.ZodObject<{
81
+ repository: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
82
+ kind: z.ZodLiteral<"artifacts">;
83
+ name: z.ZodString;
84
+ branch: z.ZodString;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"github">;
87
+ owner: z.ZodString;
88
+ repo: z.ZodString;
89
+ branch: z.ZodString;
90
+ }, z.core.$strip>], "kind">>;
91
+ changes: z.ZodArray<z.ZodObject<{
92
+ id: z.ZodString;
93
+ title: z.ZodString;
94
+ branch: z.ZodString;
95
+ updatedAt: z.ZodString;
96
+ head: z.ZodNullable<z.ZodString>;
97
+ }, z.core.$strip>>;
98
+ }, z.core.$strip>;
99
+ export type HostedChanges = z.infer<typeof hostedChanges>;
100
+ //# sourceMappingURL=changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../src/changes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;;;;;;;;iBAQvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;iBAazB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;iBAOxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The open changes of one vertical (`GET /verticals/:slug/changes`): its GitHub pull requests,
3
+ * or a hosted repository's `builder/<id>` chat branches, each with its checks and its preview.
4
+ * One provider-neutral shape, read by `substrat changes`, the plugin's approvals pane and the
5
+ * dashboard alike.
6
+ */
7
+ import { z } from 'zod';
8
+ export const changeChecks = z.object({
9
+ /**
10
+ * `none`: nothing reports on this head (or a hosted branch, which runs no checks). `unknown`:
11
+ * they could not be read (the answer's `reason` says why).
12
+ */
13
+ state: z.enum(['success', 'failure', 'pending', 'none', 'unknown']),
14
+ /** The names of the checks that failed. */
15
+ failing: z.array(z.string()),
16
+ });
17
+ export const verticalChange = z.object({
18
+ /** `#12` for a pull request, the chat id for a hosted branch. */
19
+ id: z.string().min(1),
20
+ title: z.string(),
21
+ branch: z.string().min(1),
22
+ url: z.string().nullable(),
23
+ author: z.string().nullable(),
24
+ updatedAt: z.string(),
25
+ /** The head commit, or null for a branch with none yet. */
26
+ head: z.string().nullable(),
27
+ checks: changeChecks,
28
+ /** The PR's preview (its sticky `pr-<n>` tag, else its newest build tag); null when none runs. */
29
+ preview: z.object({ tag: z.string(), url: z.string().nullable() }).nullable(),
30
+ });
31
+ export const verticalChanges = z.object({
32
+ /** Null when no repository could be read: `reason` says why. */
33
+ provider: z.enum(['github', 'artifacts']).nullable(),
34
+ /** `owner/repo`, or a hosted repository's name. */
35
+ repository: z.string().nullable(),
36
+ changes: z.array(verticalChange),
37
+ /** Why no repository could be read, or why part of what is shown (its checks) could not be. */
38
+ reason: z.string().optional(),
39
+ });
40
+ /**
41
+ * The builder studio's answer for one project (`GET /internal/changes?slug=`): its repository and,
42
+ * for a hosted one, the chat branches with work the base does not have. A GitHub project's chats
43
+ * merge by pull request, so the control plane reads those from GitHub instead.
44
+ */
45
+ export const hostedChanges = z.object({
46
+ /** Null: the studio keeps no project for that slug. */
47
+ repository: z.discriminatedUnion('kind', [
48
+ z.object({ kind: z.literal('artifacts'), name: z.string(), branch: z.string() }),
49
+ z.object({ kind: z.literal('github'), owner: z.string(), repo: z.string(), branch: z.string() }),
50
+ ]).nullable(),
51
+ changes: z.array(z.object({ id: z.string(), title: z.string(), branch: z.string(), updatedAt: z.string(), head: z.string().nullable() })),
52
+ });
53
+ //# sourceMappingURL=changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changes.js","sourceRoot":"","sources":["../src/changes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACnE,2CAA2C;IAC3C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,iEAAiE;IACjE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,2DAA2D;IAC3D,IAAI,EAAE,CAAC,CAAC,MAAM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AAQ,EAAE;IACb,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;CAC1I,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * A vertical's declared delegations (#3161) judged against its permission surface: the one
3
+ * reading `lint:permissions` (`tools/permission-diff.mts`), `buildPermissionRegistry` and so
4
+ * `substrat push` all apply, so none of them can admit a delegated key another refuses.
5
+ *
6
+ * A delegation's keys are a ceiling over what the PERSON holds here. A key no module declares can
7
+ * never be held, and a key declared `holder: 'system'` is never a person's, so either one is a
8
+ * ceiling that admits nothing while reading as one that works.
9
+ *
10
+ * Pure and dependency-free, so `tools/` can load it from source.
11
+ */
12
+ /** The part of a module a delegation is read from: its manifest's id and `delegations`. */
13
+ export interface DelegationSource {
14
+ manifest: {
15
+ id: string;
16
+ delegations?: readonly {
17
+ actor: string;
18
+ permissions: readonly string[];
19
+ channels?: readonly string[];
20
+ }[];
21
+ };
22
+ }
23
+ export interface DelegationOffence {
24
+ module: string;
25
+ actor: string;
26
+ key: string;
27
+ /** `undeclared`: no module declares the key. `reserved`: a module declares it `holder: 'system'`. */
28
+ reason: 'undeclared' | 'reserved';
29
+ }
30
+ /** Every delegated key that is undeclared or reserved, in module, delegation and key order. */
31
+ export declare function delegationOffences(modules: readonly DelegationSource[], declared: {
32
+ has(key: string): boolean;
33
+ }, reserved: {
34
+ has(key: string): boolean;
35
+ }): DelegationOffence[];
36
+ /** One offence as `lint:permissions` lists it: ``delegation `todo` → `notes:read` ``. */
37
+ export declare function delegationOffenceLine(o: Pick<DelegationOffence, 'actor' | 'key'>): string;
38
+ /** The refusal for delegated keys reserved to a system principal, naming the vertical (`where`) and each one. */
39
+ export declare function reservedDelegationMessage(where: string, offences: readonly Pick<DelegationOffence, 'actor' | 'key'>[]): string;
40
+ //# sourceMappingURL=delegation-surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-surface.d.ts","sourceRoot":"","sources":["../src/delegation-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2FAA2F;AAC3F,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,CAAC,EAAE,SAAS;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;YAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;SAAE,EAAE,CAAC;KAC1G,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,qGAAqG;IACrG,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;CACnC;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EACpC,QAAQ,EAAE;IAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EACvC,QAAQ,EAAE;IAAE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACtC,iBAAiB,EAAE,CAWrB;AAED,yFAAyF;AACzF,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG,MAAM,CAEzF;AAED,iHAAiH;AACjH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,KAAK,CAAC,EAAE,GAAG,MAAM,CAO9H"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * A vertical's declared delegations (#3161) judged against its permission surface: the one
3
+ * reading `lint:permissions` (`tools/permission-diff.mts`), `buildPermissionRegistry` and so
4
+ * `substrat push` all apply, so none of them can admit a delegated key another refuses.
5
+ *
6
+ * A delegation's keys are a ceiling over what the PERSON holds here. A key no module declares can
7
+ * never be held, and a key declared `holder: 'system'` is never a person's, so either one is a
8
+ * ceiling that admits nothing while reading as one that works.
9
+ *
10
+ * Pure and dependency-free, so `tools/` can load it from source.
11
+ */
12
+ /** Every delegated key that is undeclared or reserved, in module, delegation and key order. */
13
+ export function delegationOffences(modules, declared, reserved) {
14
+ const out = [];
15
+ for (const m of modules) {
16
+ for (const d of m.manifest.delegations ?? []) {
17
+ for (const key of d.permissions) {
18
+ if (!declared.has(key))
19
+ out.push({ module: m.manifest.id, actor: d.actor, key, reason: 'undeclared' });
20
+ else if (reserved.has(key))
21
+ out.push({ module: m.manifest.id, actor: d.actor, key, reason: 'reserved' });
22
+ }
23
+ }
24
+ }
25
+ return out;
26
+ }
27
+ /** One offence as `lint:permissions` lists it: ``delegation `todo` → `notes:read` ``. */
28
+ export function delegationOffenceLine(o) {
29
+ return `delegation \`${o.actor}\` → \`${o.key}\``;
30
+ }
31
+ /** The refusal for delegated keys reserved to a system principal, naming the vertical (`where`) and each one. */
32
+ export function reservedDelegationMessage(where, offences) {
33
+ return (`${where} delegates ${offences.length} key(s) reserved to a system principal:\n` +
34
+ offences.map((o) => ` ${delegationOffenceLine(o)}`).join('\n') +
35
+ `\n\n A delegated call runs as the person, and no person holds a key declared\n` +
36
+ ` \`holder: 'system'\`, so the delegation could never use it. Remove it from the delegation.`);
37
+ }
38
+ //# sourceMappingURL=delegation-surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegation-surface.js","sourceRoot":"","sources":["../src/delegation-surface.ts"],"names":[],"mappings":"AAAA;;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AI,CAAC,IAAI,CAAC;QACjE,iFAAiF;QACjF,8FAA8F,CAC/F,CAAC;AACJ,CAAC"}
@@ -1,19 +1,36 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * DELEGATION between two apps that sign in at one team auth-server (#1824).
3
+ * DELEGATION between two apps that sign in at one team auth-server (#1824, #3161).
4
4
  *
5
- * A host app's users are signed in at the issuer. Another app of the same team, the ACTOR
6
- * (a help desk's assistant, say), wants to call the host's MCP endpoint on behalf of one of
7
- * those users. The issuer answers that with RFC 8693 token exchange, in two steps: the host
8
- * asks for an assertion addressed to the actor, and the actor trades it for an access token
9
- * for the host's MCP endpoint. Neither step is allowed unless the platform said the host
10
- * delegates to that actor, and for which of the host's permissions.
5
+ * A host app's users are signed in at the issuer. Another app of the same team, the ACTOR, wants
6
+ * to call the host on behalf of one of those people. The issuer answers that with RFC 8693 token
7
+ * exchange, on one of two CHANNELS, and neither is allowed unless the platform said the host
8
+ * delegates to that actor, on that channel, and for which of the host's permissions.
9
+ *
10
+ * - **`mcp`** (#1824): two steps. The HOST asks for an assertion addressed to the actor, and the
11
+ * actor trades it for an access token for the host's MCP endpoint. A help desk's assistant
12
+ * acting in another app is the shape: the host takes a step for every person it lets the actor
13
+ * act for.
14
+ * - **`peer`** (#3161): one step. The ACTOR presents the live token of a person signed in to the
15
+ * actor, names the host's OIDC client id as `audience`, and asks for an access token
16
+ * (`requested_token_type` = {@link TOKEN_TYPE}.accessToken, which is what tells this exchange
17
+ * from the second step of `mcp`). The token it gets has `sub` = the person, `aud` = the host's
18
+ * client id, `act.sub` = the actor's client id, and `scope` = the granted keys, and the actor
19
+ * presents it on a peer call (`peerCallRequest.onBehalf`). A master app calling its plugin as
20
+ * the signed-in person is the shape.
21
+ *
22
+ * A grant names its channels, and one that names none means `mcp` alone ({@link channelsOf}), so
23
+ * every grant delivered before `peer` existed keeps exactly the meaning it had. `peer` has to be
24
+ * asked for by name because it is the wider of the two: with it, the actor can act for ANYONE
25
+ * signed in to the actor, and the host takes no step per person. An `mcp` grant never allowed
26
+ * that, so no grant may come to mean it by a default.
11
27
  *
12
28
  * This module is that statement's vocabulary. The dashboard delivers it, per host app, through
13
29
  * the issuer's platform-gated `/internal/configure`:
14
30
  *
15
31
  * substrat:delegations:<host app scope id> = [{ "actor": "<actor app scope id>",
16
- * "permissions": ["tickets.read", …] }, …]
32
+ * "permissions": ["tickets.read", …],
33
+ * "channels": ["peer"] }, …]
17
34
  *
18
35
  * The value is the host's WHOLE set, not a delta, so re-sending it is a no-op, an actor that
19
36
  * drops out loses its grant, and `""` or `[]` revokes every one. The issuer re-reads the grant
@@ -40,12 +57,36 @@ export declare const DELEGATION_ASSERTION_AUDIENCE = "urn:substrat:delegation-as
40
57
  export declare const MAX_DELEGATED_PERMISSIONS = 64;
41
58
  /** More actors than any host delegates to; a bound on what one delivery writes. */
42
59
  export declare const MAX_DELEGATION_ACTORS = 64;
43
- /** One actor the host delegates to, and which of the host's permissions it may act with. */
60
+ /** The exchanges a grant may admit. See the module header for what each one is. */
61
+ export declare const DELEGATION_CHANNELS: readonly ['mcp', 'peer'];
62
+ export declare const delegationChannel: z.ZodEnum<{
63
+ mcp: "mcp";
64
+ peer: "peer";
65
+ }>;
66
+ export type DelegationChannel = z.infer<typeof delegationChannel>;
67
+ /**
68
+ * Channels as a grant or a manifest names them: at least one, each once. A channel named twice
69
+ * is refused rather than collapsed, so a delivery reads back exactly as it was written.
70
+ */
71
+ export declare const delegationChannels: z.ZodArray<z.ZodEnum<{
72
+ mcp: "mcp";
73
+ peer: "peer";
74
+ }>>;
75
+ /**
76
+ * One actor the host delegates to, which of the host's permissions it may act with, and on which
77
+ * channels. `channels` absent is `['mcp']`; read it through {@link channelsOf}, never directly.
78
+ */
44
79
  export declare const delegationGrant: z.ZodObject<{
45
80
  actor: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
46
81
  permissions: z.ZodArray<z.ZodString>;
82
+ channels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
83
+ mcp: "mcp";
84
+ peer: "peer";
85
+ }>>>;
47
86
  }, z.core.$strict>;
48
87
  export type DelegationGrant = z.infer<typeof delegationGrant>;
88
+ /** The channels a grant admits, with the default applied: absent is `mcp` alone, never `peer`. */
89
+ export declare const channelsOf: (grant: Pick<DelegationGrant, 'channels'>) => DelegationChannel[];
49
90
  /**
50
91
  * A host's whole set. An actor named twice is refused: which of the two grants would win is
51
92
  * not a question this should answer by accident.
@@ -53,5 +94,27 @@ export type DelegationGrant = z.infer<typeof delegationGrant>;
53
94
  export declare const delegationGrants: z.ZodArray<z.ZodObject<{
54
95
  actor: z.core.$ZodBranded<z.ZodString, "ScopeId", "out">;
55
96
  permissions: z.ZodArray<z.ZodString>;
97
+ channels: z.ZodOptional<z.ZodArray<z.ZodEnum<{
98
+ mcp: "mcp";
99
+ peer: "peer";
100
+ }>>>;
56
101
  }, z.core.$strict>>;
102
+ /**
103
+ * What a call made FOR a person by another app leaves on the spine (#3176): which app acted.
104
+ *
105
+ * The call runs as the person, so the envelope's `actor` (and a denial's) is the person: the
106
+ * permission model answered about them, the domain fact is theirs. This says which app was
107
+ * making the call for them, the way K-42's `impersonation` says who held the keyboard. It is
108
+ * the delegation's `actor`, the app's client id as the issuer names it, and nothing else: the
109
+ * delegated keys are the app's declaration (its manifest and `PERMISSIONS.md`), and the keys
110
+ * this call actually used are already in the event's `authorization` (K-34), so repeating up
111
+ * to {@link MAX_DELEGATED_PERMISSIONS} keys on every row would add bytes and no fact.
112
+ *
113
+ * Stamped kernel-side on K-34's pattern: absent from `DomainEventInput`, so module code can
114
+ * neither claim a delegation nor drop one.
115
+ */
116
+ export declare const delegationStamp: z.ZodObject<{
117
+ actor: z.ZodString;
118
+ }, z.core.$strip>;
119
+ export type DelegationStamp = z.infer<typeof delegationStamp>;
57
120
  //# sourceMappingURL=delegations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delegations.d.ts","sourceRoot":"","sources":["../src/delegations.ts"],"names":[],"mappings":"AAAA,OAAO,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;AAaxC,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,YAAI,KAAK,EAAE,MAAM,CAAU,CAAC;AAC5D,eAAO,MAAM,iBAAiB;;;EAA8B,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAKlE;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;GAG8C,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;kBAMjB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,kGAAkG;AAClG,eAAO,MAAM,UAAU,UAAW,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,KAAG,iBAAiB,EAEtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;mBAG+E,CAAC;AAE7G;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe;;iBAE1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -1,20 +1,37 @@
1
1
  import { z } from 'zod';
2
2
  import { scopeId } from './ids.js';
3
3
  /**
4
- * DELEGATION between two apps that sign in at one team auth-server (#1824).
4
+ * DELEGATION between two apps that sign in at one team auth-server (#1824, #3161).
5
5
  *
6
- * A host app's users are signed in at the issuer. Another app of the same team, the ACTOR
7
- * (a help desk's assistant, say), wants to call the host's MCP endpoint on behalf of one of
8
- * those users. The issuer answers that with RFC 8693 token exchange, in two steps: the host
9
- * asks for an assertion addressed to the actor, and the actor trades it for an access token
10
- * for the host's MCP endpoint. Neither step is allowed unless the platform said the host
11
- * delegates to that actor, and for which of the host's permissions.
6
+ * A host app's users are signed in at the issuer. Another app of the same team, the ACTOR, wants
7
+ * to call the host on behalf of one of those people. The issuer answers that with RFC 8693 token
8
+ * exchange, on one of two CHANNELS, and neither is allowed unless the platform said the host
9
+ * delegates to that actor, on that channel, and for which of the host's permissions.
10
+ *
11
+ * - **`mcp`** (#1824): two steps. The HOST asks for an assertion addressed to the actor, and the
12
+ * actor trades it for an access token for the host's MCP endpoint. A help desk's assistant
13
+ * acting in another app is the shape: the host takes a step for every person it lets the actor
14
+ * act for.
15
+ * - **`peer`** (#3161): one step. The ACTOR presents the live token of a person signed in to the
16
+ * actor, names the host's OIDC client id as `audience`, and asks for an access token
17
+ * (`requested_token_type` = {@link TOKEN_TYPE}.accessToken, which is what tells this exchange
18
+ * from the second step of `mcp`). The token it gets has `sub` = the person, `aud` = the host's
19
+ * client id, `act.sub` = the actor's client id, and `scope` = the granted keys, and the actor
20
+ * presents it on a peer call (`peerCallRequest.onBehalf`). A master app calling its plugin as
21
+ * the signed-in person is the shape.
22
+ *
23
+ * A grant names its channels, and one that names none means `mcp` alone ({@link channelsOf}), so
24
+ * every grant delivered before `peer` existed keeps exactly the meaning it had. `peer` has to be
25
+ * asked for by name because it is the wider of the two: with it, the actor can act for ANYONE
26
+ * signed in to the actor, and the host takes no step per person. An `mcp` grant never allowed
27
+ * that, so no grant may come to mean it by a default.
12
28
  *
13
29
  * This module is that statement's vocabulary. The dashboard delivers it, per host app, through
14
30
  * the issuer's platform-gated `/internal/configure`:
15
31
  *
16
32
  * substrat:delegations:<host app scope id> = [{ "actor": "<actor app scope id>",
17
- * "permissions": ["tickets.read", …] }, …]
33
+ * "permissions": ["tickets.read", …],
34
+ * "channels": ["peer"] }, …]
18
35
  *
19
36
  * The value is the host's WHOLE set, not a delta, so re-sending it is a no-op, an actor that
20
37
  * drops out loses its grant, and `""` or `[]` revokes every one. The issuer re-reads the grant
@@ -51,13 +68,34 @@ const delegatedPermission = z
51
68
  .min(1)
52
69
  .max(128)
53
70
  .regex(/^[\x21\x23-\x5b\x5d-\x7e]+$/, 'an OAuth scope token (RFC 6749 §3.3)');
54
- /** One actor the host delegates to, and which of the host's permissions it may act with. */
71
+ /** The exchanges a grant may admit. See the module header for what each one is. */
72
+ export const DELEGATION_CHANNELS = ['mcp', 'peer'];
73
+ export const delegationChannel = z.enum(DELEGATION_CHANNELS);
74
+ /** What a grant that names no channel admits: the one channel there was before #3161. */
75
+ const DEFAULT_CHANNELS = ['mcp'];
76
+ /**
77
+ * Channels as a grant or a manifest names them: at least one, each once. A channel named twice
78
+ * is refused rather than collapsed, so a delivery reads back exactly as it was written.
79
+ */
80
+ export const delegationChannels = z
81
+ .array(delegationChannel)
82
+ .min(1)
83
+ .refine((cs) => new Set(cs).size === cs.length, 'a channel is named twice');
84
+ /**
85
+ * One actor the host delegates to, which of the host's permissions it may act with, and on which
86
+ * channels. `channels` absent is `['mcp']`; read it through {@link channelsOf}, never directly.
87
+ */
55
88
  export const delegationGrant = z
56
89
  .object({
57
90
  actor: scopeId,
58
91
  permissions: z.array(delegatedPermission).min(1).max(MAX_DELEGATED_PERMISSIONS),
92
+ channels: delegationChannels.optional(),
59
93
  })
60
94
  .strict();
95
+ /** The channels a grant admits, with the default applied: absent is `mcp` alone, never `peer`. */
96
+ export const channelsOf = (grant) => [
97
+ ...(grant.channels ?? DEFAULT_CHANNELS),
98
+ ];
61
99
  /**
62
100
  * A host's whole set. An actor named twice is refused: which of the two grants would win is
63
101
  * not a question this should answer by accident.
@@ -66,4 +104,21 @@ export const delegationGrants = z
66
104
  .array(delegationGrant)
67
105
  .max(MAX_DELEGATION_ACTORS)
68
106
  .refine((grants) => new Set(grants.map((g) => g.actor)).size === grants.length, 'an actor is named twice');
107
+ /**
108
+ * What a call made FOR a person by another app leaves on the spine (#3176): which app acted.
109
+ *
110
+ * The call runs as the person, so the envelope's `actor` (and a denial's) is the person: the
111
+ * permission model answered about them, the domain fact is theirs. This says which app was
112
+ * making the call for them, the way K-42's `impersonation` says who held the keyboard. It is
113
+ * the delegation's `actor`, the app's client id as the issuer names it, and nothing else: the
114
+ * delegated keys are the app's declaration (its manifest and `PERMISSIONS.md`), and the keys
115
+ * this call actually used are already in the event's `authorization` (K-34), so repeating up
116
+ * to {@link MAX_DELEGATED_PERMISSIONS} keys on every row would add bytes and no fact.
117
+ *
118
+ * Stamped kernel-side on K-34's pattern: absent from `DomainEventInput`, so module code can
119
+ * neither claim a delegation nor drop one.
120
+ */
121
+ export const delegationStamp = z.object({
122
+ actor: z.string().min(1),
123
+ });
69
124
  //# sourceMappingURL=delegations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"delegations.js","sourceRoot":"","sources":["../src/delegations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAEjE,mEAAmE;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,iDAAiD,CAAC;AAE3F,sGAAsG;AACtG,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW,EAAE,+CAA+C;IAC5D,OAAO,EAAE,2CAA2C;IACpD,GAAG,EAAE,sCAAsC;CACnC,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,mCAAmC,CAAC;AAEjF,iFAAiF;AACjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,mFAAmF;AACnF,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,6BAA6B,EAAE,sCAAsC,CAAC,CAAC;AAEhF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,mB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AAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAE7G;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC"}
package/dist/denial.d.ts CHANGED
@@ -52,6 +52,9 @@ export declare const permissionDenial: z.ZodObject<{
52
52
  session: z.core.$ZodBranded<z.ZodString, "ImpersonationSessionId", "out">;
53
53
  by: z.core.$ZodBranded<z.ZodString, "PlatformActorId", "out">;
54
54
  }, z.core.$strip>>;
55
+ delegation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
56
+ actor: z.ZodString;
57
+ }, z.core.$strip>>>;
55
58
  invocationId: z.ZodNullable<z.ZodString>;
56
59
  at: z.ZodString;
57
60
  drainedAt: z.ZodNullable<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"denial.d.ts","sourceRoot":"","sources":["../src/denial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;iBAgD3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa;;;EAA4C,CAAC;AACvE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC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AM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,qFAAqF;AACrF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAGxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
package/dist/denial.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { actor } from './events.js';
3
+ import { delegationStamp } from './delegations.js';
3
4
  import { impersonationStamp } from './impersonation.js';
4
5
  import { permissionKey, scopeId, tenantId } from './ids.js';
5
6
  /**
@@ -53,6 +54,15 @@ export const permissionDenial = z.object({
53
54
  * this log exists to answer — and `actor` alone would answer it wrongly.
54
55
  */
55
56
  impersonation: impersonationStamp.nullable(),
57
+ /**
58
+ * The app the refused call was made FOR the person by (#3176), or null: nobody acted for
59
+ * anyone. `actor` is the person, whose holdings the check read; a delegated call is also
60
+ * capped by the keys delegated to the app, so a refusal here may be the ceiling's rather
61
+ * than the person's, and this is what tells a reader to look there. Optional as well as
62
+ * nullable for version skew only, as on `historyEntry`; every read from this version on
63
+ * sets it.
64
+ */
65
+ delegation: delegationStamp.nullable().optional(),
56
66
  /**
57
67
  * The invocation this refusal happened during (#1525), or null.
58
68
  *
@@ -1 +1 @@
1
- {"version":3,"file":"denial.js","sourceRoot":"","sources":["../src/denial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD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