@astrale-os/kernel-core 0.9.0-beta.20 → 0.9.0-beta.23

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/CHANGELOG.md CHANGED
@@ -6,6 +6,112 @@
6
6
 
7
7
  * remove endpoint, route, serving issuer, Publication ETag, and View placement properties from the
8
8
  Function and UI schema; graph projection now contains declaration meaning only
9
+ ## [0.9.0-beta.23](https://github.com/astrale-os/kernel/compare/kernel-core-v0.9.0-beta.22...kernel-core-v0.9.0-beta.23) (2026-08-29)
10
+
11
+
12
+ ### Features
13
+
14
+ * **api:** carry view iframe requirements ([#531](https://github.com/astrale-os/kernel/issues/531)) ([4eedb0b](https://github.com/astrale-os/kernel/commit/4eedb0b3430f5f642942e913cf1c5806e09b7cf1))
15
+
16
+ ## [0.9.0-beta.22](https://github.com/astrale-os/kernel/compare/kernel-core-v0.9.0-beta.21...kernel-core-v0.9.0-beta.22) (2026-08-29)
17
+
18
+
19
+ ### ⚠ BREAKING CHANGES
20
+
21
+ * View declarations now contain only target and optional description. Legacy View.auth fields are rejected; callable authorization, View.resolve admission, Policies, and Shell handshakes remain independent.
22
+ * **dsl:** make edge direction explicit
23
+
24
+ ### Features
25
+
26
+ * add aliased domain dependency projection ([afb799b](https://github.com/astrale-os/kernel/commit/afb799b0d61fd6f7436fe659f558a6a62ef1e7a1))
27
+ * add aliased Domain dependency projection ([9c4c4fb](https://github.com/astrale-os/kernel/commit/9c4c4fb4f942c0c5e3961faf4428ed299d42f847))
28
+ * add compiled remote domain serving ([ac9e365](https://github.com/astrale-os/kernel/commit/ac9e36538982a91359712e4cbbc68353ea2cc1a2))
29
+ * add compiled remote Domain serving ([6149628](https://github.com/astrale-os/kernel/commit/6149628820d1294981156ff5b50ceaa522ea0403))
30
+ * add source-qualified Invocation identity ([#331](https://github.com/astrale-os/kernel/issues/331)) ([ac87f3c](https://github.com/astrale-os/kernel/commit/ac87f3c67907290f43b21ca1efe2c3b51541c73d))
31
+ * **callable:** preserve native binary streams and status ([d14c6f1](https://github.com/astrale-os/kernel/commit/d14c6f13492c14a3363b2c4af59c738034752fa2))
32
+ * **core:** refine class and binding authoring ([0c9349d](https://github.com/astrale-os/kernel/commit/0c9349dcad4bb8519736e21242a6dee54bfa1c40))
33
+ * **core:** refine class and binding authoring ([b4b0f2e](https://github.com/astrale-os/kernel/commit/b4b0f2ea6af67752309ee4f9570af8c3b508860a))
34
+ * **core:** support identities without authentication ([#490](https://github.com/astrale-os/kernel/issues/490)) ([b22f726](https://github.com/astrale-os/kernel/commit/b22f7261342cbe071d0c8f35710f6db7a83e12fa))
35
+ * **dsl:** authorize Edge value reads with policies ([#502](https://github.com/astrale-os/kernel/issues/502)) ([a27e129](https://github.com/astrale-os/kernel/commit/a27e129378ff64e69031a011cbfa21299998a35e))
36
+ * **dsl:** make edge direction explicit ([3f05bf5](https://github.com/astrale-os/kernel/commit/3f05bf52ce5b20e9f549ec0fd98cb0e4e03de1ea))
37
+ * **graph:** accept direct node targets in authoring facades ([d370356](https://github.com/astrale-os/kernel/commit/d370356fb441857681c531078d4888d853e1d5c7))
38
+ * **graph:** accept direct node targets in authoring facades ([762e88d](https://github.com/astrale-os/kernel/commit/762e88db1509f8fd2b733b8c43a0ad692bb89ff6))
39
+ * **operations:** scope schema replay by principal ([#330](https://github.com/astrale-os/kernel/issues/330)) ([b97bfd5](https://github.com/astrale-os/kernel/commit/b97bfd5a2101696121e1aef0ffe821ea0edb78e5))
40
+ * remove Property visibility and cut DSL V2 ([#518](https://github.com/astrale-os/kernel/issues/518)) ([4d99e8f](https://github.com/astrale-os/kernel/commit/4d99e8f0837136cf6be257ab3a6df666b62e06b5))
41
+ * remove View authentication declarations ([4a5bfe0](https://github.com/astrale-os/kernel/commit/4a5bfe016717267d31257748f95e7f646782f876))
42
+ * **runtime:** support buffered and streaming binary ([fcd73f9](https://github.com/astrale-os/kernel/commit/fcd73f99c75963257b595449b1a0e0e4e234a05d))
43
+ * **schema:** make atomic installs convergent ([ed198fb](https://github.com/astrale-os/kernel/commit/ed198fba6d8d9d4e0092cd1bc64f454b717851e5))
44
+ * **schema:** split inspection and add convergence ([6afbd39](https://github.com/astrale-os/kernel/commit/6afbd39506b8a9e37225aded1c02f94ffa64e54b))
45
+ * **schema:** split ready reads and make atomic installs convergent ([dd96d3e](https://github.com/astrale-os/kernel/commit/dd96d3ed13c374b0db19f7edbfeff1dc65ae03f9))
46
+
47
+
48
+ ### Bug Fixes
49
+
50
+ * align the official kernel package cohort ([#371](https://github.com/astrale-os/kernel/issues/371)) ([30fda63](https://github.com/astrale-os/kernel/commit/30fda63157bbaf756af2d46efed4e2fc5bc17d4b))
51
+ * **api:** retain visibility-free DSL as V1 ([#526](https://github.com/astrale-os/kernel/issues/526)) ([e24c1ea](https://github.com/astrale-os/kernel/commit/e24c1ea257e8567d9bd33c6ada0de63bb346a496))
52
+ * **ci:** enforce the official Kernel cohort ([#469](https://github.com/astrale-os/kernel/issues/469)) ([f6ea87a](https://github.com/astrale-os/kernel/commit/f6ea87a47f7b1f9c415e404dc1a09b480a2a3f5f))
53
+ * **core:** clarify Path anchor diagnostic ([#335](https://github.com/astrale-os/kernel/issues/335)) ([5c72368](https://github.com/astrale-os/kernel/commit/5c72368b95d1a734c9e2bbe991418e98772fe26f))
54
+ * **core:** preserve callable identity and runtime boundaries ([#394](https://github.com/astrale-os/kernel/issues/394)) ([ad67dad](https://github.com/astrale-os/kernel/commit/ad67dad84aef3c8b79f769009595ea1f1229026b))
55
+ * **core:** reject legacy definition query sources ([afd2067](https://github.com/astrale-os/kernel/commit/afd2067b02fdc21a2c414638ebf40e2f217b9f2b))
56
+ * **deps:** refresh the Kernel dependency cohort ([#393](https://github.com/astrale-os/kernel/issues/393)) ([883e7bb](https://github.com/astrale-os/kernel/commit/883e7bb7ce17eecb7dad1c94ad2089c576ba3746))
57
+ * **dsl:** close semantic qualification gaps ([4a48cd7](https://github.com/astrale-os/kernel/commit/4a48cd729bcaf839ceda880b26ade064d6505fe2))
58
+ * **dsl:** keep schema projections declaration-nameable ([#432](https://github.com/astrale-os/kernel/issues/432)) ([448d23d](https://github.com/astrale-os/kernel/commit/448d23d58fc2b564ef93be4a54dc8ebd385b5066))
59
+ * **dsl:** make schema declarations portable ([55e13c0](https://github.com/astrale-os/kernel/commit/55e13c06896eb5d6cf195607aec10f176b585504))
60
+ * **dsl:** make schema declarations portable ([90c04ac](https://github.com/astrale-os/kernel/commit/90c04acfa5af714c70a92dc90999675d53f159bc))
61
+ * **graph:** validate undirected endpoint pairs ([dc363db](https://github.com/astrale-os/kernel/commit/dc363db646e7e61d972e7747579e6e1ee7062cc8))
62
+ * **packages:** keep workspace guard private ([e0ba76c](https://github.com/astrale-os/kernel/commit/e0ba76c5ae163245e31115e2a72e0663db0f5320))
63
+ * **packages:** keep workspace guard private ([d260a52](https://github.com/astrale-os/kernel/commit/d260a52329cde5ce4b0260c43a3bbf28cb78f408))
64
+ * **packages:** keep workspace guard private ([a3e82ec](https://github.com/astrale-os/kernel/commit/a3e82ec671f07252a5966b4de988e275e4078b8c))
65
+ * publish a TypeScript-compatible cohort ([#406](https://github.com/astrale-os/kernel/issues/406)) ([f1a0cd0](https://github.com/astrale-os/kernel/commit/f1a0cd09f2f0b4498f9fa8924b2e319cac6552b7))
66
+ * **release:** add package repository metadata ([8238077](https://github.com/astrale-os/kernel/commit/8238077d47a96c0f7b50a1bae8769fe4faab45b7))
67
+ * **release:** align the published beta cohort ([8f2dc4a](https://github.com/astrale-os/kernel/commit/8f2dc4a7156aeee4dc9034624d2ffa2b3583d5b8))
68
+ * **release:** publish exact Kernel cohort edges ([04629b8](https://github.com/astrale-os/kernel/commit/04629b89515aa665ede2f9fe058888bad45ab896))
69
+ * **release:** publish exact Kernel cohort edges ([14f2c52](https://github.com/astrale-os/kernel/commit/14f2c52329874fdad43114a964521599c8313eab))
70
+ * **runtime:** clarify Domain transition Foundation without narrowing behavior ([bce2184](https://github.com/astrale-os/kernel/commit/bce21848e645d2570cf056d56cc0d4489c656d14))
71
+ * **runtime:** close domain transition foundation drift ([310f95f](https://github.com/astrale-os/kernel/commit/310f95fadfb1a85fb19ac52b69a58427d22a5788))
72
+ * **runtime:** qualify local Domain production journey ([d35b1be](https://github.com/astrale-os/kernel/commit/d35b1be05b2463eb51a6d93f8ea1811fd489a7ab))
73
+ * **runtime:** qualify local Domain production journey ([396351a](https://github.com/astrale-os/kernel/commit/396351ae2fcfe67ef49f624e4ef0214bad2448c3))
74
+ * stabilize governed Kernel integration ([#347](https://github.com/astrale-os/kernel/issues/347)) ([6869e3f](https://github.com/astrale-os/kernel/commit/6869e3fc4de1e73ff701bb38383e89c934ddfdf2))
75
+ * **system:** clear Codegraph diagnostic debt ([f7a8e1f](https://github.com/astrale-os/kernel/commit/f7a8e1f5c5694d9c3c45d95fde184f0d5f2c7343))
76
+ * **system:** clear Codegraph diagnostic debt ([45f86a9](https://github.com/astrale-os/kernel/commit/45f86a9ce14a224efed0e07966a5df8d7a892078))
77
+
78
+
79
+ ### Performance Improvements
80
+
81
+ * **operations:** release only the Host production closure ([3f9d61a](https://github.com/astrale-os/kernel/commit/3f9d61afe6b4f19f4dfd0bd5e454e38f951aaf2a))
82
+ * **server:** cache successful CORS preflights ([#514](https://github.com/astrale-os/kernel/issues/514)) ([a9a3d7c](https://github.com/astrale-os/kernel/commit/a9a3d7ccb4c6e5ca763e5d0798a3c905f5936b28))
83
+
84
+
85
+ ### Documentation
86
+
87
+ * **release:** align kernel beta changelogs ([ad59dbc](https://github.com/astrale-os/kernel/commit/ad59dbc8df458d8bd025692d594b0b4666cd2e1f))
88
+
89
+
90
+ ### Dependencies
91
+
92
+ * The following workspace dependencies were updated
93
+ * dependencies
94
+ * @astrale-os/kernel-dsl bumped to 0.2.0-beta.17
95
+
96
+ ## [0.9.0-beta.21](https://github.com/astrale-os/kernel/compare/kernel-core-v0.9.0-beta.20...kernel-core-v0.9.0-beta.21) (2026-08-29)
97
+
98
+
99
+ ### Features
100
+
101
+ * remove Property visibility and cut DSL V2 ([#518](https://github.com/astrale-os/kernel/issues/518)) ([4d99e8f](https://github.com/astrale-os/kernel/commit/4d99e8f0837136cf6be257ab3a6df666b62e06b5))
102
+
103
+
104
+ ### Bug Fixes
105
+
106
+ * **api:** retain visibility-free DSL as V1 ([#526](https://github.com/astrale-os/kernel/issues/526)) ([e24c1ea](https://github.com/astrale-os/kernel/commit/e24c1ea257e8567d9bd33c6ada0de63bb346a496))
107
+
108
+
109
+ ### Dependencies
110
+
111
+ * The following workspace dependencies were updated
112
+ * dependencies
113
+ * @astrale-os/kernel-dsl bumped to 0.2.0-beta.16
114
+
9
115
  ## [0.9.0-beta.20](https://github.com/astrale-os/kernel/compare/kernel-core-v0.9.0-beta.19...kernel-core-v0.9.0-beta.20) (2026-08-28)
10
116
 
11
117
 
@@ -94,13 +94,6 @@ function admit(input, path, locals, subjectBound, depth) {
94
94
  class: classRef(value.class, `${path}/class`),
95
95
  evidence: evidence(value.evidence, `${path}/evidence`),
96
96
  };
97
- case 'domain-control':
98
- exact(value, ['identity', 'op', 'origin'], path);
99
- return {
100
- op: 'domain-control',
101
- identity: term(value.identity, `${path}/identity`, locals, subjectBound),
102
- origin: domainOrigin(value.origin, `${path}/origin`),
103
- };
104
97
  default:
105
98
  invalid(`${path}/op`, 'Unsupported authority operation');
106
99
  }
@@ -1,7 +1,7 @@
1
1
  import type { ClassRef, CoreRef, Key } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import type { NodeId } from '../../../graph/node/index.js';
3
3
  import type { Grant } from '../../grant/index.js';
4
- export declare const AUTHORITY_PREDICATE_VERSION: 5;
4
+ export declare const AUTHORITY_PREDICATE_VERSION: 6;
5
5
  export type Operation = 'create' | 'read' | 'traverse' | 'update' | 'delete';
6
6
  export type Input = 'object' | 'source' | 'target';
7
7
  export type { ClassRef } from '@astrale-os/kernel-dsl/v1/addressing';
@@ -34,17 +34,13 @@ export interface LocalDeclaration {
34
34
  readonly id: number;
35
35
  readonly class: ClassRef;
36
36
  }
37
- export type Requirement = {
37
+ export interface Requirement {
38
38
  readonly op: 'class-authority';
39
39
  readonly identity: Term;
40
40
  readonly operation: Operation;
41
41
  readonly class: ClassRef;
42
42
  readonly evidence: 'allowed' | 'owner';
43
- } | {
44
- readonly op: 'domain-control';
45
- readonly identity: Term;
46
- readonly origin: Key.Origin;
47
- };
43
+ }
48
44
  export type AuthorityExpr = {
49
45
  readonly op: 'true';
50
46
  } | {
@@ -1 +1 @@
1
- export const AUTHORITY_PREDICATE_VERSION = 5;
1
+ export const AUTHORITY_PREDICATE_VERSION = 6;
@@ -71,12 +71,6 @@ function normalize(expr, path, locals, subjectBound) {
71
71
  class: Object.freeze({ ...expr.class }),
72
72
  evidence: expr.evidence,
73
73
  });
74
- case 'domain-control':
75
- return Object.freeze({
76
- op: 'domain-control',
77
- identity: normalizeTerm(expr.identity),
78
- origin: expr.origin,
79
- });
80
74
  }
81
75
  }
82
76
  function normalizeBoolean(op, input, path, locals, subjectBound) {
@@ -9,7 +9,7 @@ export const GovernedBy = edgeClass.directed({
9
9
  description: 'The protected projection of one Class read or traverse Policy assignment.',
10
10
  extends: [Edge],
11
11
  properties: {
12
- operations: property({ enum: [['read'], ['traverse'], ['read', 'traverse']] }, { visibility: 'private' }),
12
+ operations: property({ enum: [['read'], ['traverse'], ['read', 'traverse']] }, {}),
13
13
  },
14
14
  constraints: { noSelf: true },
15
15
  });
@@ -9,7 +9,7 @@ export const MethodOf = edgeClass.directed({
9
9
  description: 'A Function declaration belongs to one Class for dispatch.',
10
10
  extends: [Edge],
11
11
  properties: {
12
- name: property({ type: 'string', minLength: 1 }, { visibility: 'private' }),
13
- static: property({ type: 'boolean' }, { visibility: 'private' }),
12
+ name: property({ type: 'string', minLength: 1 }, {}),
13
+ static: property({ type: 'boolean' }, {}),
14
14
  },
15
15
  });
@@ -42,6 +42,10 @@ export declare const View: builder.NodeClass<{
42
42
  };
43
43
  href: string;
44
44
  handshake: "none" | "shell";
45
+ iframe?: {
46
+ sandbox?: string[] | undefined;
47
+ allow?: string[] | undefined;
48
+ } | undefined;
45
49
  issuer: string;
46
50
  etag: string;
47
51
  revision: string;
@@ -81,6 +85,10 @@ export declare const View: builder.NodeClass<{
81
85
  };
82
86
  href: string;
83
87
  handshake: "none" | "shell";
88
+ iframe?: {
89
+ sandbox?: string[] | undefined;
90
+ allow?: string[] | undefined;
91
+ } | undefined;
84
92
  issuer: string;
85
93
  etag: string;
86
94
  revision: string;
@@ -9,8 +9,8 @@ export const Domain = nodeClass({
9
9
  type: 'string',
10
10
  pattern: '[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+',
11
11
  },
12
- dependencyContext: property({ type: 'array', items: { type: 'object' } }, { visibility: 'private', required: false }),
13
- schema: property({ type: 'object' }, { visibility: 'private' }),
14
- schemaRevision: property({ type: 'string', pattern: 'sha256:[0-9a-f]{64}' }, { visibility: 'private' }),
12
+ dependencyContext: property({ type: 'array', items: { type: 'object' } }, { required: false }),
13
+ schema: property({ type: 'object' }, {}),
14
+ schemaRevision: property({ type: 'string', pattern: 'sha256:[0-9a-f]{64}' }, {}),
15
15
  },
16
16
  });
@@ -9,6 +9,6 @@ export const OfDomain = edgeClass.directed({
9
9
  extends: [Edge],
10
10
  constraints: { noSelf: true },
11
11
  properties: {
12
- member: property({ type: 'string', minLength: 3 }, { visibility: 'private' }),
12
+ member: property({ type: 'string', minLength: 3 }, {}),
13
13
  },
14
14
  });
@@ -9,10 +9,9 @@ export const Identity = nodeClass({
9
9
  properties: {
10
10
  iss: property({ type: 'string', minLength: 1 }, { required: false }),
11
11
  sub: property({ type: 'string', minLength: 1 }, { required: false }),
12
- frozen: property({ type: 'boolean' }, { required: false, visibility: 'private' }),
12
+ frozen: property({ type: 'boolean' }, { required: false }),
13
13
  requiredClaims: property(requiredClaimsSchema, {
14
14
  required: false,
15
- visibility: 'private',
16
15
  }),
17
16
  },
18
17
  methods: IdentityMethods,
@@ -4269,6 +4269,10 @@ declare const KernelDefinitions: {
4269
4269
  };
4270
4270
  href: string;
4271
4271
  handshake: "none" | "shell";
4272
+ iframe?: {
4273
+ sandbox?: string[] | undefined;
4274
+ allow?: string[] | undefined;
4275
+ } | undefined;
4272
4276
  issuer: string;
4273
4277
  etag: string;
4274
4278
  revision: string;
@@ -4308,6 +4312,10 @@ declare const KernelDefinitions: {
4308
4312
  };
4309
4313
  href: string;
4310
4314
  handshake: "none" | "shell";
4315
+ iframe?: {
4316
+ sandbox?: string[] | undefined;
4317
+ allow?: string[] | undefined;
4318
+ } | undefined;
4311
4319
  issuer: string;
4312
4320
  etag: string;
4313
4321
  revision: string;
@@ -5614,16 +5622,6 @@ export declare const AuthorityRelations: Readonly<{
5614
5622
  }>;
5615
5623
  /** Exact authorized Kernel Functions for which pristine Root receives direct can_use authority. */
5616
5624
  export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
5617
- kind: "bundle" | "inspect";
5618
- origin: string;
5619
- }, {
5620
- readonly mode: 'binary';
5621
- }, "authenticated", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>> & {
5622
- readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"introspect"> & {
5623
- readonly origin: "kernel.astrale.ai";
5624
- };
5625
- readonly key: "kernel.astrale.ai:function.introspect";
5626
- }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
5627
5625
  operation: string;
5628
5626
  domains: ({
5629
5627
  artifact: {
@@ -5648,6 +5646,16 @@ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-
5648
5646
  readonly origin: "kernel.astrale.ai";
5649
5647
  };
5650
5648
  readonly key: "kernel.astrale.ai:function.install";
5649
+ }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
5650
+ kind: "bundle" | "inspect";
5651
+ origin: string;
5652
+ }, {
5653
+ readonly mode: 'binary';
5654
+ }, "authenticated", import("@astrale-os/kernel-dsl/v1").PolicyCheckExpression<import("@astrale-os/kernel-dsl/v1").PolicyRef, import("@astrale-os/kernel-dsl/v1/language").PolicyCheckObject>> & {
5655
+ readonly ref: import("@astrale-os/kernel-dsl/v1").FunctionRef<"introspect"> & {
5656
+ readonly origin: "kernel.astrale.ai";
5657
+ };
5658
+ readonly key: "kernel.astrale.ai:function.introspect";
5651
5659
  }) | (import("@astrale-os/kernel-dsl/v1").ResolvedFunction<{
5652
5660
  invocation?: {
5653
5661
  source: string;
@@ -6508,6 +6516,10 @@ export declare const KernelRootFunctions: readonly ((import("@astrale-os/kernel-
6508
6516
  };
6509
6517
  href: string;
6510
6518
  handshake: "none" | "shell";
6519
+ iframe?: {
6520
+ sandbox?: string[] | undefined;
6521
+ allow?: string[] | undefined;
6522
+ } | undefined;
6511
6523
  issuer: string;
6512
6524
  etag: string;
6513
6525
  revision: string;
@@ -24,6 +24,10 @@ export declare const viewResolveOutput: z.ZodObject<{
24
24
  none: "none";
25
25
  shell: "shell";
26
26
  }>;
27
+ iframe: z.ZodOptional<z.ZodObject<{
28
+ sandbox: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
+ allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
+ }, z.core.$strict>>;
27
31
  issuer: z.ZodString;
28
32
  etag: z.ZodString;
29
33
  revision: z.ZodString;
@@ -13,6 +13,10 @@ const declaration = z.strictObject({
13
13
  z.strictObject({ kind: z.literal('definition'), definitions: z.array(definition).min(1) }),
14
14
  ]),
15
15
  });
16
+ const iframeRequirements = z.strictObject({
17
+ sandbox: z.array(z.string()).optional(),
18
+ allow: z.array(z.string()).optional(),
19
+ });
16
20
  export const viewResolveInput = z.strictObject({ target: z.string().min(1) });
17
21
  export const viewResolveOutput = z.strictObject({
18
22
  snapshot: z.string().min(1),
@@ -21,6 +25,7 @@ export const viewResolveOutput = z.strictObject({
21
25
  declaration,
22
26
  href: z.string().min(1),
23
27
  handshake: z.enum(['shell', 'none']),
28
+ iframe: iframeRequirements.optional(),
24
29
  issuer: z.string().min(1),
25
30
  etag: z.string().min(1),
26
31
  revision: z.string().min(1),
@@ -922,6 +922,10 @@ export declare const ViewMethods: Readonly<{
922
922
  };
923
923
  href: string;
924
924
  handshake: "none" | "shell";
925
+ iframe?: {
926
+ sandbox?: string[] | undefined;
927
+ allow?: string[] | undefined;
928
+ } | undefined;
925
929
  issuer: string;
926
930
  etag: string;
927
931
  revision: string;
@@ -22,6 +22,10 @@ export declare const ViewResolve: builder.Method<builder.CallableProjection<{
22
22
  };
23
23
  href: string;
24
24
  handshake: "none" | "shell";
25
+ iframe?: {
26
+ sandbox?: string[] | undefined;
27
+ allow?: string[] | undefined;
28
+ } | undefined;
25
29
  issuer: string;
26
30
  etag: string;
27
31
  revision: string;
@@ -6,10 +6,15 @@ export interface ResolvedView {
6
6
  readonly declaration: ViewDeclaration;
7
7
  readonly href: string;
8
8
  readonly handshake: 'shell' | 'none';
9
+ readonly iframe?: IframeRequirements;
9
10
  readonly issuer: IssuerId;
10
11
  readonly etag: `sha256:${string}`;
11
12
  readonly revision: Revision;
12
13
  }
14
+ export interface IframeRequirements {
15
+ readonly sandbox?: readonly string[];
16
+ readonly allow?: readonly string[];
17
+ }
13
18
  type ViewDeclaration = Omit<ViewDefinition, 'ref'>;
14
19
  export interface ViewResolution {
15
20
  readonly snapshot: `sha256:${string}`;
@@ -23,11 +23,13 @@ export function acceptViewResolution(input) {
23
23
  if (!issuer.is(view.issuer))
24
24
  invalid(`Resolved View ${index} issuer is not canonical.`);
25
25
  const declaration = acceptDeclaration(view.declaration, index);
26
+ const iframe = acceptIframeRequirements(view.iframe, view.handshake, index);
26
27
  return Object.freeze({
27
28
  key,
28
29
  declaration,
29
30
  href: view.href,
30
31
  handshake: view.handshake,
32
+ ...(iframe === undefined ? {} : { iframe }),
31
33
  issuer: view.issuer,
32
34
  etag: digest(view.etag, `Resolved View ${index} ETag`),
33
35
  revision: digest(view.revision, `Resolved View ${index} revision`),
@@ -43,6 +45,85 @@ export function acceptViewResolution(input) {
43
45
  views: Object.freeze(views),
44
46
  });
45
47
  }
48
+ const IFRAME_TOKEN = /^[a-z][a-z0-9-]*$/u;
49
+ function acceptIframeRequirements(input, handshake, viewIndex) {
50
+ if (input === undefined)
51
+ return undefined;
52
+ if (input === null || typeof input !== 'object' || Array.isArray(input)) {
53
+ invalid(`Resolved View ${viewIndex} iframe requirements are invalid.`);
54
+ }
55
+ const prototype = Object.getPrototypeOf(input);
56
+ if (prototype !== Object.prototype && prototype !== null) {
57
+ invalid(`Resolved View ${viewIndex} iframe requirements are invalid.`);
58
+ }
59
+ const value = input;
60
+ if (Reflect.ownKeys(value).some((key) => key !== 'sandbox' && key !== 'allow')) {
61
+ invalid(`Resolved View ${viewIndex} iframe requirements contain unknown fields.`);
62
+ }
63
+ const sandbox = acceptTokens(dataValue(value, 'sandbox', viewIndex), viewIndex, 'sandbox');
64
+ const allow = acceptTokens(dataValue(value, 'allow', viewIndex), viewIndex, 'allow');
65
+ const baselineSandbox = new Set(handshake === 'shell' ? ['allow-same-origin', 'allow-scripts'] : ['allow-scripts']);
66
+ const baselineAllow = new Set(handshake === 'shell' ? ['clipboard-write'] : []);
67
+ if (sandbox.some((token) => baselineSandbox.has(token)) ||
68
+ allow.some((token) => baselineAllow.has(token))) {
69
+ invalid(`Resolved View ${viewIndex} iframe requirements repeat a fixed handshake baseline.`);
70
+ }
71
+ const tokens = new Set(sandbox);
72
+ if (tokens.has('allow-popups-to-escape-sandbox') && !tokens.has('allow-popups')) {
73
+ invalid(`Resolved View ${viewIndex} popup escape requires popup authority.`);
74
+ }
75
+ if (tokens.has('allow-top-navigation') && tokens.has('allow-top-navigation-by-user-activation')) {
76
+ invalid(`Resolved View ${viewIndex} iframe navigation requirements are redundant.`);
77
+ }
78
+ if (tokens.has('allow-top-navigation-to-custom-protocols') &&
79
+ (tokens.has('allow-top-navigation') || tokens.has('allow-popups'))) {
80
+ invalid(`Resolved View ${viewIndex} custom-protocol requirements are redundant.`);
81
+ }
82
+ if (sandbox.length === 0 && allow.length === 0) {
83
+ invalid(`Resolved View ${viewIndex} empty iframe requirements must be omitted.`);
84
+ }
85
+ return Object.freeze({ sandbox: Object.freeze(sandbox), allow: Object.freeze(allow) });
86
+ }
87
+ function dataValue(input, key, viewIndex) {
88
+ const descriptor = Object.getOwnPropertyDescriptor(input, key);
89
+ if (descriptor === undefined)
90
+ return undefined;
91
+ if (!('value' in descriptor)) {
92
+ invalid(`Resolved View ${viewIndex} iframe requirements are invalid.`);
93
+ }
94
+ return descriptor.value;
95
+ }
96
+ function acceptTokens(input, viewIndex, field) {
97
+ if (input === undefined)
98
+ return [];
99
+ if (!Array.isArray(input))
100
+ invalid(`Resolved View ${viewIndex} iframe ${field} is invalid.`);
101
+ const descriptors = Object.getOwnPropertyDescriptors(input);
102
+ const values = [];
103
+ for (let index = 0; index < input.length; index += 1) {
104
+ const descriptor = descriptors[String(index)];
105
+ if (descriptor === undefined ||
106
+ !('value' in descriptor) ||
107
+ typeof descriptor.value !== 'string' ||
108
+ !IFRAME_TOKEN.test(descriptor.value)) {
109
+ invalid(`Resolved View ${viewIndex} iframe ${field} contains an invalid token.`);
110
+ }
111
+ values.push(descriptor.value);
112
+ }
113
+ for (const key of Reflect.ownKeys(descriptors)) {
114
+ if (key === 'length')
115
+ continue;
116
+ if (typeof key !== 'string' || !/^(0|[1-9][0-9]*)$/u.test(key) || Number(key) >= input.length) {
117
+ invalid(`Resolved View ${viewIndex} iframe ${field} is invalid.`);
118
+ }
119
+ }
120
+ for (let index = 1; index < values.length; index += 1) {
121
+ if (values[index - 1] >= values[index]) {
122
+ invalid(`Resolved View ${viewIndex} iframe ${field} is not in strict canonical order.`);
123
+ }
124
+ }
125
+ return values;
126
+ }
46
127
  function acceptDeclaration(input, viewIndex) {
47
128
  if (input.target.kind === 'domain') {
48
129
  return Object.freeze({
@@ -26,6 +26,10 @@ export declare const resolve: import("./model.js").MethodSyscall<Readonly<{
26
26
  };
27
27
  href: string;
28
28
  handshake: "none" | "shell";
29
+ iframe?: {
30
+ sandbox?: string[] | undefined;
31
+ allow?: string[] | undefined;
32
+ } | undefined;
29
33
  issuer: string;
30
34
  etag: string;
31
35
  revision: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-core",
3
- "version": "0.9.0-beta.20",
3
+ "version": "0.9.0-beta.23",
4
4
  "description": "Astrale Kernel Core - Types, Invariants, and Pure Logic",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -160,7 +160,7 @@
160
160
  "access": "public"
161
161
  },
162
162
  "dependencies": {
163
- "@astrale-os/kernel-dsl": "0.2.0-beta.15",
163
+ "@astrale-os/kernel-dsl": "0.2.0-beta.17",
164
164
  "@noble/hashes": "2.3.0",
165
165
  "@types/json-schema": "^7.0.15",
166
166
  "dequal": "2.0.3"