@astrale-os/kernel-core 0.9.0-beta.65 → 0.9.0-beta.66

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 (93) hide show
  1. package/dist/auth/authority/admission/admission.d.ts +0 -1
  2. package/dist/auth/authority/admission/admission.js +8 -141
  3. package/dist/auth/authority/admission/references.d.ts +13 -0
  4. package/dist/auth/authority/admission/references.js +38 -0
  5. package/dist/auth/authority/admission/term.d.ts +6 -0
  6. package/dist/auth/authority/admission/term.js +60 -0
  7. package/dist/auth/authority/admission/wire.d.ts +8 -0
  8. package/dist/auth/authority/admission/wire.js +33 -0
  9. package/dist/graph/graph/index.d.ts +1 -1
  10. package/dist/graph/graph/index.js +1 -1
  11. package/dist/graph/graph/model/codec.js +3 -3
  12. package/dist/graph/graph/model/index.d.ts +1 -1
  13. package/dist/graph/graph/model/index.js +1 -1
  14. package/dist/graph/graph/model/model.d.ts +7 -7
  15. package/dist/graph/graph/model/model.js +6 -6
  16. package/dist/graph/graph/model/wire.d.ts +0 -20
  17. package/dist/graph/graph/model/wire.js +2 -2
  18. package/dist/graph/mutate/authoring/builder.d.ts +2 -2
  19. package/dist/graph/mutate/authoring/builder.js +2 -2
  20. package/dist/graph/mutate/index.d.ts +1 -1
  21. package/dist/graph/mutate/language/codec.js +3 -3
  22. package/dist/graph/mutate/language/model.d.ts +4 -4
  23. package/dist/graph/mutate/result/index.d.ts +3 -3
  24. package/dist/graph/mutate/result/index.js +5 -5
  25. package/dist/graph/node/identity/id.d.ts +0 -3
  26. package/dist/graph/node/identity/id.js +0 -4
  27. package/dist/graph/query/language/codec.js +3 -3
  28. package/dist/graph/query/language/model.d.ts +3 -3
  29. package/dist/graph/reconcile/condition/model.d.ts +2 -2
  30. package/dist/graph/reconcile/condition/references.d.ts +0 -1
  31. package/dist/graph/reconcile/condition/references.js +4 -4
  32. package/dist/graph/reconcile/correspondence.d.ts +9 -8
  33. package/dist/graph/reconcile/evidence.d.ts +2 -2
  34. package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
  35. package/dist/graph/reconcile/observation.d.ts +4 -3
  36. package/dist/graph/reconcile/planning/context.d.ts +3 -3
  37. package/dist/graph/reconcile/planning/model.d.ts +4 -4
  38. package/dist/schema/callables/{view-for.d.ts → entrypoint.d.ts} +7 -5
  39. package/dist/schema/callables/entrypoint.js +12 -0
  40. package/dist/schema/callables/function.d.ts +0 -120
  41. package/dist/schema/callables/index.d.ts +1 -1
  42. package/dist/schema/callables/index.js +1 -1
  43. package/dist/schema/callables/view.d.ts +2 -24
  44. package/dist/schema/domain/domain.d.ts +2 -121
  45. package/dist/schema/domain/domain.js +3 -0
  46. package/dist/schema/identity/identity.d.ts +0 -8
  47. package/dist/schema/kernel/projection/core.d.ts +7 -0
  48. package/dist/schema/kernel/projection/core.js +51 -0
  49. package/dist/schema/kernel/projection/definitions.d.ts +13 -0
  50. package/dist/schema/kernel/projection/definitions.js +71 -0
  51. package/dist/schema/kernel/projection/methods.d.ts +5 -0
  52. package/dist/schema/kernel/projection/methods.js +41 -0
  53. package/dist/schema/kernel/projection/part.d.ts +34 -0
  54. package/dist/schema/kernel/projection/part.js +42 -0
  55. package/dist/schema/kernel/projection/paths.d.ts +6 -0
  56. package/dist/schema/kernel/projection/{keys.js → paths.js} +11 -12
  57. package/dist/schema/kernel/projection/project.d.ts +1 -1
  58. package/dist/schema/kernel/projection/project.js +16 -290
  59. package/dist/schema/kernel/projection/properties.d.ts +11 -0
  60. package/dist/schema/kernel/projection/properties.js +36 -0
  61. package/dist/schema/kernel/projection/relations.d.ts +7 -0
  62. package/dist/schema/kernel/projection/relations.js +49 -0
  63. package/dist/schema/kernel/projection/types.d.ts +4 -4
  64. package/dist/schema/kernel/schema.d.ts +74 -357
  65. package/dist/schema/kernel/schema.js +3 -2
  66. package/dist/schema/kernel/syscalls/contracts/blob.d.ts +12 -2
  67. package/dist/schema/kernel/syscalls/contracts/blob.js +10 -2
  68. package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +0 -4
  69. package/dist/schema/kernel/syscalls/contracts/delegate.js +0 -3
  70. package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -1
  71. package/dist/schema/kernel/syscalls/contracts/index.js +1 -1
  72. package/dist/schema/kernel/syscalls/contracts/install.d.ts +3 -20
  73. package/dist/schema/kernel/syscalls/contracts/install.js +0 -2
  74. package/dist/schema/kernel/syscalls/contracts/installation.d.ts +0 -36
  75. package/dist/schema/kernel/syscalls/contracts/installation.js +3 -3
  76. package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +3 -14
  77. package/dist/schema/kernel/syscalls/contracts/view-resolve.js +3 -18
  78. package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +0 -4
  79. package/dist/schema/kernel/syscalls/declarations/download.d.ts +5 -0
  80. package/dist/schema/kernel/syscalls/declarations/index.d.ts +6 -24
  81. package/dist/schema/kernel/syscalls/declarations/install.d.ts +0 -8
  82. package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +1 -12
  83. package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +0 -4
  84. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +2 -13
  85. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +4 -119
  86. package/dist/schema/kernel/syscalls/descriptors/view.d.ts +1 -12
  87. package/package.json +2 -2
  88. package/dist/schema/callables/view-for.js +0 -12
  89. package/dist/schema/kernel/projection/keys.d.ts +0 -3
  90. package/dist/schema/kernel/syscalls/contracts/legacy/delegate.d.ts +0 -5
  91. package/dist/schema/kernel/syscalls/contracts/legacy/delegate.js +0 -25
  92. package/dist/schema/kernel/syscalls/contracts/legacy/install.d.ts +0 -22
  93. package/dist/schema/kernel/syscalls/contracts/legacy/install.js +0 -31
@@ -1,4 +1,4 @@
1
- import { Key, patterns } from '@astrale-os/kernel-dsl/v1/addressing';
1
+ import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import * as portable from '@astrale-os/kernel-dsl/value';
3
3
  import { issuer } from '../../../../../auth/index.js';
4
4
  import { viewResolveOutput } from '../../contracts/index.js';
@@ -25,17 +25,15 @@ export function acceptViewResolution(input) {
25
25
  if (!issuer.is(view.issuer))
26
26
  invalid(`Resolved View ${index} issuer is not canonical.`);
27
27
  const declaration = acceptDeclaration(view.declaration, index);
28
- const iframe = acceptIframeRequirements(view.iframe, view.handshake, index);
29
28
  const host = acceptViewHostRequirements(view.host, view.handshake);
30
29
  return Object.freeze({
31
30
  key,
32
31
  declaration,
33
32
  href: view.href,
34
33
  handshake: view.handshake,
35
- ...(iframe === undefined ? {} : { iframe }),
36
34
  ...(host === undefined ? {} : { host }),
37
35
  issuer: view.issuer,
38
- etag: digest(view.etag, `Resolved View ${index} ETag`),
36
+ release: digest(view.release, `Resolved View ${index} release`),
39
37
  revision: digest(view.revision, `Resolved View ${index} revision`),
40
38
  });
41
39
  });
@@ -49,130 +47,17 @@ export function acceptViewResolution(input) {
49
47
  views: Object.freeze(views),
50
48
  });
51
49
  }
52
- const IFRAME_TOKEN = /^[a-z][a-z0-9-]*$/u;
53
- function acceptIframeRequirements(input, handshake, viewIndex) {
54
- if (input === undefined)
55
- return undefined;
56
- if (input === null || typeof input !== 'object' || Array.isArray(input)) {
57
- invalid(`Resolved View ${viewIndex} iframe requirements are invalid.`);
58
- }
59
- const prototype = Object.getPrototypeOf(input);
60
- if (prototype !== Object.prototype && prototype !== null) {
61
- invalid(`Resolved View ${viewIndex} iframe requirements are invalid.`);
62
- }
63
- const value = input;
64
- if (Reflect.ownKeys(value).some((key) => key !== 'sandbox' && key !== 'allow')) {
65
- invalid(`Resolved View ${viewIndex} iframe requirements contain unknown fields.`);
66
- }
67
- const sandbox = acceptTokens(dataValue(value, 'sandbox', viewIndex), viewIndex, 'sandbox');
68
- const allow = acceptTokens(dataValue(value, 'allow', viewIndex), viewIndex, 'allow');
69
- const baselineSandbox = new Set(handshake === 'shell' ? ['allow-same-origin', 'allow-scripts'] : ['allow-scripts']);
70
- const baselineAllow = new Set(handshake === 'shell' ? ['clipboard-write'] : []);
71
- if (sandbox.some((token) => baselineSandbox.has(token)) ||
72
- allow.some((token) => baselineAllow.has(token))) {
73
- invalid(`Resolved View ${viewIndex} iframe requirements repeat a fixed handshake baseline.`);
74
- }
75
- const tokens = new Set(sandbox);
76
- if (tokens.has('allow-popups-to-escape-sandbox') && !tokens.has('allow-popups')) {
77
- invalid(`Resolved View ${viewIndex} popup escape requires popup authority.`);
78
- }
79
- if (tokens.has('allow-top-navigation') && tokens.has('allow-top-navigation-by-user-activation')) {
80
- invalid(`Resolved View ${viewIndex} iframe navigation requirements are redundant.`);
81
- }
82
- if (tokens.has('allow-top-navigation-to-custom-protocols') &&
83
- (tokens.has('allow-top-navigation') || tokens.has('allow-popups'))) {
84
- invalid(`Resolved View ${viewIndex} custom-protocol requirements are redundant.`);
85
- }
86
- if (sandbox.length === 0 && allow.length === 0) {
87
- invalid(`Resolved View ${viewIndex} empty iframe requirements must be omitted.`);
88
- }
89
- return Object.freeze({ sandbox: Object.freeze(sandbox), allow: Object.freeze(allow) });
90
- }
91
- function dataValue(input, key, viewIndex) {
92
- const descriptor = Object.getOwnPropertyDescriptor(input, key);
93
- if (descriptor === undefined)
94
- return undefined;
95
- if (!('value' in descriptor)) {
96
- invalid(`Resolved View ${viewIndex} iframe requirements are invalid.`);
97
- }
98
- return descriptor.value;
99
- }
100
- function acceptTokens(input, viewIndex, field) {
101
- if (input === undefined)
102
- return [];
103
- if (!Array.isArray(input))
104
- invalid(`Resolved View ${viewIndex} iframe ${field} is invalid.`);
105
- const descriptors = Object.getOwnPropertyDescriptors(input);
106
- const values = [];
107
- for (let index = 0; index < input.length; index += 1) {
108
- const descriptor = descriptors[String(index)];
109
- if (descriptor === undefined ||
110
- !('value' in descriptor) ||
111
- typeof descriptor.value !== 'string' ||
112
- !IFRAME_TOKEN.test(descriptor.value)) {
113
- invalid(`Resolved View ${viewIndex} iframe ${field} contains an invalid token.`);
114
- }
115
- values.push(descriptor.value);
116
- }
117
- for (const key of Reflect.ownKeys(descriptors)) {
118
- if (key === 'length')
119
- continue;
120
- if (typeof key !== 'string' || !/^(0|[1-9][0-9]*)$/u.test(key) || Number(key) >= input.length) {
121
- invalid(`Resolved View ${viewIndex} iframe ${field} is invalid.`);
122
- }
123
- }
124
- for (let index = 1; index < values.length; index += 1) {
125
- if (values[index - 1] >= values[index]) {
126
- invalid(`Resolved View ${viewIndex} iframe ${field} is not in strict canonical order.`);
127
- }
128
- }
129
- return values;
130
- }
131
- function acceptDeclaration(input, viewIndex) {
132
- if (input.target.kind === 'domain') {
133
- return Object.freeze({
134
- ...(input.description === undefined ? {} : { description: input.description }),
135
- target: Object.freeze({ kind: 'domain' }),
136
- });
137
- }
138
- const definitions = input.target.definitions.map((definition, definitionIndex) => {
139
- if (!patterns.origin.test(definition.origin) ||
140
- definition.kind !== 'class' ||
141
- !patterns.memberName.test(definition.name)) {
142
- invalid(`Resolved View ${viewIndex} target definition ${definitionIndex} is invalid.`);
143
- }
144
- return Object.freeze({
145
- origin: definition.origin,
146
- kind: definition.kind,
147
- name: definition.name,
148
- });
149
- });
150
- for (let index = 1; index < definitions.length; index++) {
151
- if (compareDefinitionRefs(definitions[index - 1], definitions[index]) >= 0) {
152
- invalid(`Resolved View ${viewIndex} target definitions are not in strict canonical order.`);
153
- }
154
- }
50
+ function acceptDeclaration(input, _viewIndex) {
155
51
  return Object.freeze({
156
52
  ...(input.description === undefined ? {} : { description: input.description }),
157
- target: Object.freeze({
158
- kind: 'definition',
159
- definitions: Object.freeze(definitions),
160
- }),
53
+ target: Object.freeze({ kind: 'domain' }),
161
54
  });
162
55
  }
163
- function compareDefinitionRefs(left, right) {
164
- return (compare(left.origin, right.origin) ||
165
- compare(left.kind, right.kind) ||
166
- compare(left.name, right.name));
167
- }
168
56
  function digest(input, label) {
169
57
  if (!/^sha256:[0-9a-f]{64}$/u.test(input))
170
58
  invalid(`${label} is invalid.`);
171
59
  return input;
172
60
  }
173
- function compare(left, right) {
174
- return left < right ? -1 : left > right ? 1 : 0;
175
- }
176
61
  function invalid(message) {
177
62
  throw new TypeError(message);
178
63
  }
@@ -15,21 +15,10 @@ export declare const resolve: import("./model.js").MethodSyscall<Readonly<{
15
15
  description?: string | undefined;
16
16
  target: {
17
17
  kind: "domain";
18
- } | {
19
- kind: "definition";
20
- definitions: {
21
- origin: string;
22
- kind: "class";
23
- name: string;
24
- }[];
25
18
  };
26
19
  };
27
20
  href: string;
28
21
  handshake: "none" | "shell";
29
- iframe?: {
30
- sandbox?: string[] | undefined;
31
- allow?: string[] | undefined;
32
- } | undefined;
33
22
  host?: {
34
23
  navigation: {
35
24
  external: {
@@ -38,7 +27,7 @@ export declare const resolve: import("./model.js").MethodSyscall<Readonly<{
38
27
  };
39
28
  } | undefined;
40
29
  issuer: string;
41
- etag: string;
30
+ release: string;
42
31
  revision: string;
43
32
  }[];
44
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/kernel-core",
3
- "version": "0.9.0-beta.65",
3
+ "version": "0.9.0-beta.66",
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.47",
163
+ "@astrale-os/kernel-dsl": "0.2.0-beta.48",
164
164
  "@noble/hashes": "2.3.0",
165
165
  "@types/json-schema": "^7.0.15",
166
166
  "dequal": "2.0.3"
@@ -1,12 +0,0 @@
1
- import { edgeClass } from '@astrale-os/kernel-dsl/v1';
2
- import { Class } from '../definitions/index.js';
3
- import { Domain } from '../domain/index.js';
4
- import { Edge } from '../meta/index.js';
5
- import { View } from './view.js';
6
- export const ViewFor = edgeClass.directed({
7
- abstract: false,
8
- source: { as: 'view', accepts: [View], outgoing: '1..*' },
9
- target: { as: 'target', accepts: [Class, Domain], incoming: '0..*' },
10
- description: 'A View declaration targets one Domain or a non-empty set of Classes.',
11
- extends: [Edge],
12
- });
@@ -1,3 +0,0 @@
1
- import type { Domain } from '@astrale-os/kernel-dsl/v1';
2
- export declare function managedKeys(domain: Domain): readonly string[];
3
- export declare function coreKeys(domain: Domain): readonly string[];
@@ -1,5 +0,0 @@
1
- /** @deprecated The only `attenuation` value `Identity.delegate` still admits, and ignores. */
2
- export declare const selfAttenuation: import("zod").ZodObject<{
3
- kind: import("zod").ZodLiteral<"identity">;
4
- self: import("zod").ZodLiteral<true>;
5
- }, import("zod/v4/core").$strict>;
@@ -1,25 +0,0 @@
1
- /**
2
- * `Identity.delegate` keeps admitting the one `attenuation` value published Clients send: the self
3
- * expression `{ kind: 'identity', self: true }`. It names the caller the delegation preserves
4
- * anyway, so it carries no meaning: the handler ignores it and issues exactly the credential the
5
- * same input without the field yields. Every other value, `null` included, stays refused.
6
- *
7
- * @deprecated Omit `attenuation`; a delegation always preserves the authenticated caller (ADR-3).
8
- *
9
- * Short-term consumers: `@astrale-os/kernel-client` 0.6.0-beta.77 to beta.85, whose Domain token
10
- * exchange always sends it (`client/session/exchange/exchange.ts`, `SELF_ATTENUATION`), so the
11
- * Console, the GUI, the Admin upgrade executor and the CLI through 1.0.0-beta.126 (exchange and
12
- * `astrale token`). The 1Pact Host runs Kernel 0.12.0-beta.117, which requires the field, so a
13
- * Client that serves both Kernels sends it.
14
- *
15
- * Removal, in a separate breaking release, once every consumer runs a Client that omits the field
16
- * and the 0.12.0-beta.117 consumer Host is retired: delete this file and the `attenuation` member
17
- * of `../delegate.ts`, then make the self vectors of TEST-REJECTS-AUTHORITY-EXPRESSIONS-IN-ISSUANCE-INPUTS
18
- * and of the SYS-6 dispatch test expect refusal again.
19
- */
20
- import { literal, strictObject } from 'zod';
21
- /** @deprecated The only `attenuation` value `Identity.delegate` still admits, and ignores. */
22
- export const selfAttenuation = strictObject({
23
- kind: literal('identity'),
24
- self: literal(true),
25
- }).meta({ deprecated: true });
@@ -1,22 +0,0 @@
1
- import type { InstallationDigest } from '../install.js';
2
- /** @deprecated Successor: the `release` request of `../install.ts`. */
3
- export declare const publicationRequest: import("zod").ZodObject<{
4
- publication: import("zod").ZodObject<{
5
- url: import("zod").ZodString;
6
- token: import("zod").ZodOptional<import("zod").ZodString>;
7
- etag: import("zod").ZodOptional<import("zod").ZodString>;
8
- }, import("zod/v4/core").$strict>;
9
- revision: import("zod").ZodOptional<import("zod").ZodString>;
10
- currentRevision: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
11
- }, import("zod/v4/core").$strict>;
12
- /** @deprecated Use `ReleaseRequest` to guard the release digest. */
13
- export interface PublicationRequest {
14
- readonly publication: {
15
- readonly url: string;
16
- readonly token?: string;
17
- /** ETag of the v3 document the source serves: its own, or the projection of a v4 release. */
18
- readonly etag?: InstallationDigest;
19
- };
20
- readonly revision?: string;
21
- readonly currentRevision?: string | null;
22
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * The `publication` Domain request of `schema.install` keeps its v3 meaning: `etag` guards the
3
- * ETag of the v3 document the source serves, including the frozen projection of a v4 release.
4
- *
5
- * @deprecated Use the `release` request of `../install.ts`, whose `digest` is the release digest.
6
- *
7
- * Short-term consumers: the Admin instance gateway and the CLI until they send `release`, the SDK
8
- * e2e controller, and this repository's own callers (`__e2e__`, `host/e2e`,
9
- * `host/qualification/falkor`) and tests. The 1Pact Host runs its own Kernel .117 and does not
10
- * depend on this module.
11
- *
12
- * Removal, in a separate breaking release, once the Admin gateway and the CLI send `release` to
13
- * every Kernel that accepts it and the SDK e2e controller has moved: move this repository's callers
14
- * and tests first, then delete this folder, the `publication` branch of `domainRequest`, Runtime
15
- * `PublicationDomainInput` with the `publication` branch of `installDomain`,
16
- * `DesiredInstallation.targetEtag`, `InstallRoot.targetEtag` and
17
- * `CUTOVER_PUBLICATION_ETAG_CONFLICT`. The legacy fingerprint keys stay frozen: retained operations
18
- * store their digests.
19
- */
20
- import { strictObject } from 'zod';
21
- import { installationText } from '../installation.js';
22
- /** @deprecated Successor: the `release` request of `../install.ts`. */
23
- export const publicationRequest = strictObject({
24
- publication: strictObject({
25
- url: installationText,
26
- token: installationText.optional(),
27
- etag: installationText.optional(),
28
- }),
29
- revision: installationText.optional(),
30
- currentRevision: installationText.nullable().optional(),
31
- });