@astrale-os/kernel-core 0.9.0-beta.64 → 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.
- package/dist/auth/authority/admission/admission.d.ts +0 -1
- package/dist/auth/authority/admission/admission.js +8 -141
- package/dist/auth/authority/admission/references.d.ts +13 -0
- package/dist/auth/authority/admission/references.js +38 -0
- package/dist/auth/authority/admission/term.d.ts +6 -0
- package/dist/auth/authority/admission/term.js +60 -0
- package/dist/auth/authority/admission/wire.d.ts +8 -0
- package/dist/auth/authority/admission/wire.js +33 -0
- package/dist/graph/graph/index.d.ts +1 -1
- package/dist/graph/graph/index.js +1 -1
- package/dist/graph/graph/model/codec.js +3 -3
- package/dist/graph/graph/model/index.d.ts +1 -1
- package/dist/graph/graph/model/index.js +1 -1
- package/dist/graph/graph/model/model.d.ts +7 -7
- package/dist/graph/graph/model/model.js +6 -6
- package/dist/graph/graph/model/wire.d.ts +0 -20
- package/dist/graph/graph/model/wire.js +2 -2
- package/dist/graph/mutate/authoring/builder.d.ts +2 -2
- package/dist/graph/mutate/authoring/builder.js +2 -2
- package/dist/graph/mutate/index.d.ts +1 -1
- package/dist/graph/mutate/language/codec.js +3 -3
- package/dist/graph/mutate/language/model.d.ts +4 -4
- package/dist/graph/mutate/result/index.d.ts +3 -3
- package/dist/graph/mutate/result/index.js +5 -5
- package/dist/graph/node/identity/id.d.ts +0 -3
- package/dist/graph/node/identity/id.js +0 -4
- package/dist/graph/query/language/codec.js +3 -3
- package/dist/graph/query/language/model.d.ts +3 -3
- package/dist/graph/reconcile/condition/model.d.ts +2 -2
- package/dist/graph/reconcile/condition/references.d.ts +0 -1
- package/dist/graph/reconcile/condition/references.js +4 -4
- package/dist/graph/reconcile/correspondence.d.ts +9 -8
- package/dist/graph/reconcile/evidence.d.ts +2 -2
- package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
- package/dist/graph/reconcile/observation.d.ts +4 -3
- package/dist/graph/reconcile/planning/context.d.ts +3 -3
- package/dist/graph/reconcile/planning/model.d.ts +4 -4
- package/dist/schema/callables/{view-for.d.ts → entrypoint.d.ts} +7 -5
- package/dist/schema/callables/entrypoint.js +12 -0
- package/dist/schema/callables/function.d.ts +0 -90
- package/dist/schema/callables/index.d.ts +1 -1
- package/dist/schema/callables/index.js +1 -1
- package/dist/schema/callables/view.d.ts +2 -24
- package/dist/schema/domain/domain.d.ts +2 -91
- package/dist/schema/domain/domain.js +3 -0
- package/dist/schema/identity/identity.d.ts +0 -6
- package/dist/schema/kernel/projection/core.d.ts +7 -0
- package/dist/schema/kernel/projection/core.js +51 -0
- package/dist/schema/kernel/projection/definitions.d.ts +13 -0
- package/dist/schema/kernel/projection/definitions.js +71 -0
- package/dist/schema/kernel/projection/methods.d.ts +5 -0
- package/dist/schema/kernel/projection/methods.js +41 -0
- package/dist/schema/kernel/projection/part.d.ts +34 -0
- package/dist/schema/kernel/projection/part.js +42 -0
- package/dist/schema/kernel/projection/paths.d.ts +6 -0
- package/dist/schema/kernel/projection/{keys.js → paths.js} +11 -12
- package/dist/schema/kernel/projection/project.d.ts +1 -1
- package/dist/schema/kernel/projection/project.js +16 -290
- package/dist/schema/kernel/projection/properties.d.ts +11 -0
- package/dist/schema/kernel/projection/properties.js +36 -0
- package/dist/schema/kernel/projection/relations.d.ts +7 -0
- package/dist/schema/kernel/projection/relations.js +49 -0
- package/dist/schema/kernel/projection/types.d.ts +4 -4
- package/dist/schema/kernel/schema.d.ts +125 -347
- package/dist/schema/kernel/schema.js +3 -2
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +12 -2
- package/dist/schema/kernel/syscalls/contracts/blob.js +10 -2
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +0 -1
- package/dist/schema/kernel/syscalls/contracts/delegate.js +1 -3
- package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +0 -1
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/contracts/index.js +1 -1
- package/dist/schema/kernel/syscalls/contracts/install.d.ts +3 -20
- package/dist/schema/kernel/syscalls/contracts/install.js +0 -2
- package/dist/schema/kernel/syscalls/contracts/installation.d.ts +0 -36
- package/dist/schema/kernel/syscalls/contracts/installation.js +3 -3
- package/dist/schema/kernel/syscalls/contracts/mint.d.ts +0 -1
- package/dist/schema/kernel/syscalls/contracts/mint.js +1 -2
- package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +3 -14
- package/dist/schema/kernel/syscalls/contracts/view-resolve.js +3 -18
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +0 -1
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +5 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +0 -1
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +6 -23
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +0 -8
- package/dist/schema/kernel/syscalls/declarations/mint.d.ts +0 -1
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +1 -12
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +0 -3
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +2 -13
- package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +4 -119
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +1 -12
- package/package.json +2 -2
- package/dist/schema/callables/view-for.js +0 -12
- package/dist/schema/kernel/projection/keys.d.ts +0 -3
- package/dist/schema/kernel/syscalls/contracts/legacy/install.d.ts +0 -22
- package/dist/schema/kernel/syscalls/contracts/legacy/install.js +0 -31
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NodeId } from '../../node/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LocalAlias } from '../language/index.js';
|
|
3
3
|
export type MutationResult = {
|
|
4
|
-
readonly createdNodes: Readonly<Record<
|
|
4
|
+
readonly createdNodes: Readonly<Record<LocalAlias, NodeId>>;
|
|
5
5
|
};
|
|
6
6
|
export declare const MutationResult: {
|
|
7
7
|
decode(input: unknown): MutationResult;
|
|
@@ -12,5 +12,5 @@ export { MutationResultDecodeError } from './error.js';
|
|
|
12
12
|
export { mutationResultSchema } from './wire.js';
|
|
13
13
|
/** Re-admit one mutation result before it crosses a trust or transport boundary. */
|
|
14
14
|
export declare function encodeMutationResult(input: MutationResult): MutationResult;
|
|
15
|
-
/** Decode unknown JSON into immutable admitted
|
|
15
|
+
/** Decode unknown JSON into immutable admitted LocalAlias-to-NodeId results. */
|
|
16
16
|
export declare function decodeMutationResult(input: unknown): MutationResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
|
-
import {
|
|
2
|
+
import { isLocalAlias, LocalAlias as LocalAliasValue } from '#graph/graph';
|
|
3
3
|
import { NodeId as nodeId } from '../../node/index.js';
|
|
4
4
|
import { decodeWire } from '../../wire.js';
|
|
5
5
|
import { MutationResultDecodeError } from './error.js';
|
|
@@ -8,7 +8,7 @@ export const MutationResult = Object.freeze({
|
|
|
8
8
|
decode: decodeMutationResult,
|
|
9
9
|
encode: encodeMutationResult,
|
|
10
10
|
createdNode(result, binding) {
|
|
11
|
-
return result.createdNodes[
|
|
11
|
+
return result.createdNodes[LocalAliasValue(binding)];
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
14
|
export { MutationResultDecodeError } from './error.js';
|
|
@@ -17,7 +17,7 @@ export { mutationResultSchema } from './wire.js';
|
|
|
17
17
|
export function encodeMutationResult(input) {
|
|
18
18
|
return decodeMutationResult(input);
|
|
19
19
|
}
|
|
20
|
-
/** Decode unknown JSON into immutable admitted
|
|
20
|
+
/** Decode unknown JSON into immutable admitted LocalAlias-to-NodeId results. */
|
|
21
21
|
export function decodeMutationResult(input) {
|
|
22
22
|
try {
|
|
23
23
|
const encoded = decodeWire(mutationResultSchema, portable.accept(input), invalid).createdNodes;
|
|
@@ -46,8 +46,8 @@ export function decodeMutationResult(input) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
function requireBinding(value, path) {
|
|
49
|
-
if (!
|
|
50
|
-
invalid(path, 'Invalid
|
|
49
|
+
if (!isLocalAlias(value))
|
|
50
|
+
invalid(path, 'Invalid LocalAlias');
|
|
51
51
|
}
|
|
52
52
|
function escapePointer(value) {
|
|
53
53
|
return value.replaceAll('~', '~0').replaceAll('/', '~1');
|
|
@@ -11,7 +11,4 @@ export declare class NodeIdError extends TypeError {
|
|
|
11
11
|
/** Admit opaque 1-255 character ASCII NodeId text without repair or format-specific semantics. */
|
|
12
12
|
export declare function NodeId(input: string): NodeId;
|
|
13
13
|
export declare function isNodeId(input: unknown): input is NodeId;
|
|
14
|
-
export declare const nodeIdSchema: import("zod").ZodPipe<import("zod").ZodString & import("zod").ZodType<NodeId, string, import("zod/v4/core").$ZodTypeInternals<NodeId, string>>, import("zod").ZodTransform<NodeId, string & {
|
|
15
|
-
readonly [NODE_ID_BRAND]: true;
|
|
16
|
-
}>>;
|
|
17
14
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { string } from 'zod';
|
|
2
1
|
const NODE_ID_MAX_LENGTH = 255;
|
|
3
2
|
const NODE_ID_INVALID_CHARACTER = /[^A-Za-z0-9._-]/u;
|
|
4
3
|
const NODE_ID_ERROR_MESSAGE = 'NodeId must be 1-255 ASCII characters drawn from [A-Za-z0-9._-].';
|
|
@@ -23,6 +22,3 @@ export function isNodeId(input) {
|
|
|
23
22
|
input.length <= NODE_ID_MAX_LENGTH &&
|
|
24
23
|
!NODE_ID_INVALID_CHARACTER.test(input));
|
|
25
24
|
}
|
|
26
|
-
export const nodeIdSchema = string()
|
|
27
|
-
.refine(isNodeId, NODE_ID_ERROR_MESSAGE)
|
|
28
|
-
.transform((value) => value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { patterns, PropertyKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
4
|
-
import {
|
|
4
|
+
import { LocalAlias } from '../../graph/index.js';
|
|
5
5
|
import { NodeId } from '../../node/index.js';
|
|
6
6
|
import { NodePath } from '../../path/index.js';
|
|
7
7
|
import { decodeWire } from '../../wire.js';
|
|
@@ -237,7 +237,7 @@ function decodeClass(input, path) {
|
|
|
237
237
|
function introduce(input, kind, path, symbols) {
|
|
238
238
|
let name;
|
|
239
239
|
try {
|
|
240
|
-
name =
|
|
240
|
+
name = LocalAlias(input);
|
|
241
241
|
}
|
|
242
242
|
catch (cause) {
|
|
243
243
|
invalid(path, 'Invalid binding name', cause);
|
|
@@ -250,7 +250,7 @@ function introduce(input, kind, path, symbols) {
|
|
|
250
250
|
function reference(input, expected, path, symbols) {
|
|
251
251
|
let name;
|
|
252
252
|
try {
|
|
253
|
-
name =
|
|
253
|
+
name = LocalAlias(input);
|
|
254
254
|
}
|
|
255
255
|
catch (cause) {
|
|
256
256
|
invalid(path, 'Invalid binding name', cause);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClassRef, PropertyKey } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import type * as portable from '@astrale-os/kernel-dsl/value';
|
|
3
3
|
import type { EdgeKey } from '../../edge/index.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { LocalAlias } from '../../graph/index.js';
|
|
5
5
|
import type { NodeId } from '../../node/index.js';
|
|
6
6
|
import type { NodePath } from '../../path/index.js';
|
|
7
7
|
export declare const QUERY_AST_FORMAT: 'astrale.graph.query';
|
|
@@ -20,10 +20,10 @@ export type QueryUnrankedPlacement = 'first' | 'last';
|
|
|
20
20
|
export type QueryFingerprint = `sha256:${string}`;
|
|
21
21
|
declare const NODE_BINDING: unique symbol;
|
|
22
22
|
declare const EDGE_BINDING: unique symbol;
|
|
23
|
-
export type NodeBinding =
|
|
23
|
+
export type NodeBinding = LocalAlias & {
|
|
24
24
|
readonly [NODE_BINDING]: true;
|
|
25
25
|
};
|
|
26
|
-
export type EdgeBinding =
|
|
26
|
+
export type EdgeBinding = LocalAlias & {
|
|
27
27
|
readonly [EDGE_BINDING]: true;
|
|
28
28
|
};
|
|
29
29
|
export type QueryBinding = NodeBinding | EdgeBinding;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { PropertyKey } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import type { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import type { EdgeKey, EdgeSlug } from '../../edge/index.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { LocalAlias, MergeConflict as GraphMergeConflict } from '../../graph/index.js';
|
|
5
5
|
import type { NodeId } from '../../node/index.js';
|
|
6
6
|
import type { DesiredProperties } from '../../properties/index.js';
|
|
7
7
|
import type { QueryEdgeAST, QueryNodeAST } from '../../query/index.js';
|
|
8
8
|
declare const DESIRED_BRAND: unique symbol;
|
|
9
9
|
export type DesiredNodeRef = NodeId | {
|
|
10
|
-
readonly desired:
|
|
10
|
+
readonly desired: LocalAlias;
|
|
11
11
|
};
|
|
12
12
|
export interface DesiredEdgeRef {
|
|
13
13
|
readonly source: DesiredNodeRef;
|
|
@@ -2,7 +2,6 @@ import type { DesiredEdge, DesiredEdgeRef, DesiredNode, DesiredNodeRef, Expectat
|
|
|
2
2
|
import { type EdgeKey, type EdgeSlug } from '../../edge/index.js';
|
|
3
3
|
export declare function admitDesiredNode(node: DesiredNode): DesiredNode;
|
|
4
4
|
export declare function admitDesiredEdge(edge: DesiredEdge): DesiredEdge;
|
|
5
|
-
export declare function admitNodeRef(ref: DesiredNodeRef): DesiredNodeRef;
|
|
6
5
|
export declare function admitEdgeRef(ref: DesiredEdgeRef | EdgeKey): DesiredEdgeRef;
|
|
7
6
|
export declare function equalExpectation(left: Expectation<EdgeSlug>, right: Expectation<EdgeSlug>): boolean;
|
|
8
7
|
export declare function encodeDesiredNodeRef(ref: DesiredNodeRef): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
2
|
import { isEdgeSlug } from '../../edge/index.js';
|
|
3
|
-
import {
|
|
3
|
+
import { LocalAlias, isLocalAlias } from '../../graph/index.js';
|
|
4
4
|
import { isNodeId } from '../../node/index.js';
|
|
5
5
|
export function admitDesiredNode(node) {
|
|
6
6
|
const ref = admitNodeRef(node.node);
|
|
@@ -29,14 +29,14 @@ export function admitDesiredEdge(edge) {
|
|
|
29
29
|
properties: edge.properties,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
function admitNodeRef(ref) {
|
|
33
33
|
if (typeof ref === 'string') {
|
|
34
34
|
requireNodeId(ref);
|
|
35
35
|
return ref;
|
|
36
36
|
}
|
|
37
|
-
if (!
|
|
37
|
+
if (!isLocalAlias(ref.desired))
|
|
38
38
|
throw new TypeError(`Invalid desired Node binding.`);
|
|
39
|
-
return Object.freeze({ desired:
|
|
39
|
+
return Object.freeze({ desired: LocalAlias(ref.desired) });
|
|
40
40
|
}
|
|
41
41
|
export function admitEdgeRef(ref) {
|
|
42
42
|
if (!ClassKey.is(ref.class))
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { NodeId } from '../node/index.js';
|
|
3
3
|
import type { QueryObservation } from './evidence.js';
|
|
4
4
|
export type CorrespondenceEntry = {
|
|
5
|
-
readonly desired:
|
|
5
|
+
readonly desired: LocalAlias;
|
|
6
6
|
readonly kind: 'present';
|
|
7
7
|
readonly node: NodeId;
|
|
8
8
|
readonly observation: Extract<QueryObservation, {
|
|
@@ -11,7 +11,7 @@ export type CorrespondenceEntry = {
|
|
|
11
11
|
};
|
|
12
12
|
}>;
|
|
13
13
|
} | {
|
|
14
|
-
readonly desired:
|
|
14
|
+
readonly desired: LocalAlias;
|
|
15
15
|
readonly kind: 'absent';
|
|
16
16
|
readonly observation: Extract<QueryObservation, {
|
|
17
17
|
readonly selection: {
|
|
@@ -24,18 +24,19 @@ export interface Correspondence {
|
|
|
24
24
|
}
|
|
25
25
|
export type CorrespondenceConflict = {
|
|
26
26
|
readonly kind: 'correspondence-duplicate';
|
|
27
|
-
readonly desired:
|
|
27
|
+
readonly desired: LocalAlias;
|
|
28
28
|
} | {
|
|
29
29
|
readonly kind: 'correspondence-noninjective';
|
|
30
30
|
readonly node: NodeId;
|
|
31
|
-
readonly desired: readonly
|
|
31
|
+
readonly desired: readonly LocalAlias[];
|
|
32
32
|
} | {
|
|
33
33
|
readonly kind: 'correspondence-observation-invalid';
|
|
34
|
-
readonly desired:
|
|
34
|
+
readonly desired: LocalAlias;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
readonly entries: ReadonlyMap<
|
|
36
|
+
interface CorrespondenceAnalysis {
|
|
37
|
+
readonly entries: ReadonlyMap<LocalAlias, CorrespondenceEntry>;
|
|
38
38
|
readonly conflicts: readonly CorrespondenceConflict[];
|
|
39
39
|
}
|
|
40
40
|
/** Canonically index correspondence and classify duplicate or non-injective mappings. */
|
|
41
41
|
export declare function analyzeCorrespondence(entries: readonly CorrespondenceEntry[]): CorrespondenceAnalysis;
|
|
42
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { NodeId } from '../node/index.js';
|
|
3
3
|
import type { QueryEdgeAST, QueryNodeAST, QuerySelection } from '../query/index.js';
|
|
4
4
|
import { type EdgeKey } from '../edge/index.js';
|
|
5
5
|
export type ObservationRequirement = {
|
|
6
6
|
readonly kind: 'correspondence';
|
|
7
|
-
readonly desired:
|
|
7
|
+
readonly desired: LocalAlias;
|
|
8
8
|
} | {
|
|
9
9
|
readonly kind: 'selection';
|
|
10
10
|
readonly query: QueryNodeAST | QueryEdgeAST;
|
|
@@ -4,7 +4,7 @@ export type QueryPremise = Extract<ReconciliationPlan['premises'][number], {
|
|
|
4
4
|
kind: 'query';
|
|
5
5
|
}>;
|
|
6
6
|
export type PointPremise = Exclude<ReconciliationPlan['premises'][number], QueryPremise>;
|
|
7
|
-
|
|
7
|
+
type MutationAssessment = {
|
|
8
8
|
readonly kind: 'supported';
|
|
9
9
|
readonly pointPremises: readonly PointPremise[];
|
|
10
10
|
readonly queryPremises: readonly QueryPremise[];
|
|
@@ -14,3 +14,4 @@ export type MutationAssessment = {
|
|
|
14
14
|
};
|
|
15
15
|
/** Classify whether one complete semantic plan fits the target's atomic Mutation profile. */
|
|
16
16
|
export declare function assess(plan: ReconciliationPlan, profile: MutationRealizationProfile): MutationAssessment;
|
|
17
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphData,
|
|
1
|
+
import type { GraphData, LocalAlias } from '../graph/index.js';
|
|
2
2
|
import type { Node, NodeId } from '../node/index.js';
|
|
3
3
|
import type { Correspondence, CorrespondenceEntry } from './correspondence.js';
|
|
4
4
|
import type { EvidenceRequirement, ObservationEvidence } from './evidence.js';
|
|
@@ -16,11 +16,12 @@ export type ObservationConflict = {
|
|
|
16
16
|
readonly kind: 'observation-evidence-contradiction';
|
|
17
17
|
readonly requirement: EvidenceRequirement;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
interface ObservationAnalysis {
|
|
20
20
|
readonly nodes: ReadonlyMap<NodeId, Node>;
|
|
21
21
|
readonly edges: ReadonlyMap<string, Edge>;
|
|
22
22
|
readonly evidence: readonly ObservationEvidence[];
|
|
23
23
|
readonly conflicts: readonly ObservationConflict[];
|
|
24
24
|
}
|
|
25
25
|
/** Index finite facts and classify contradictory or duplicate evidence. */
|
|
26
|
-
export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<
|
|
26
|
+
export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<LocalAlias, CorrespondenceEntry>): ObservationAnalysis;
|
|
27
|
+
export {};
|
|
@@ -2,15 +2,15 @@ import { type CorrespondenceEntry } from '#graph/reconcile/correspondence';
|
|
|
2
2
|
import { type ObservationEvidence, type ObservationRequirement } from '#graph/reconcile/evidence';
|
|
3
3
|
import { type Observation } from '#graph/reconcile/observation';
|
|
4
4
|
import type { Edge } from '../../edge/index.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { LocalAlias } from '../../graph/index.js';
|
|
6
6
|
import type { Node, NodeId } from '../../node/index.js';
|
|
7
7
|
import type { Effect, PlanningBlocker, PlanningConflict, Premise } from './model.js';
|
|
8
8
|
import { type DesiredProperties } from '../../properties/index.js';
|
|
9
9
|
export interface PlanningContext {
|
|
10
10
|
readonly nodes: ReadonlyMap<NodeId, Node>;
|
|
11
11
|
readonly edges: ReadonlyMap<string, Edge>;
|
|
12
|
-
readonly correspondence: ReadonlyMap<
|
|
13
|
-
readonly created: Set<
|
|
12
|
+
readonly correspondence: ReadonlyMap<LocalAlias, CorrespondenceEntry>;
|
|
13
|
+
readonly created: Set<LocalAlias>;
|
|
14
14
|
readonly evidence: readonly ObservationEvidence[];
|
|
15
15
|
readonly premises: Premise[];
|
|
16
16
|
readonly effects: Effect[];
|
|
@@ -3,12 +3,12 @@ import type { CorrespondenceConflict } from '#graph/reconcile/correspondence';
|
|
|
3
3
|
import type { ObservationRequirement, QueryObservation } from '#graph/reconcile/evidence';
|
|
4
4
|
import type { ObservationConflict } from '#graph/reconcile/observation';
|
|
5
5
|
import type { EdgeKey, EdgeSlug } from '../../edge/index.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { LocalAlias } from '../../graph/index.js';
|
|
7
7
|
import type { NodeId } from '../../node/index.js';
|
|
8
8
|
import type { Delta, DesiredProperties, Properties } from '../../properties/index.js';
|
|
9
9
|
import type { DesiredFingerprint, DesiredSelection, Expectation, ReconcileConflict } from '../condition/index.js';
|
|
10
10
|
export type ResolvedNodeRef = NodeId | {
|
|
11
|
-
readonly created:
|
|
11
|
+
readonly created: LocalAlias;
|
|
12
12
|
};
|
|
13
13
|
export interface ResolvedEdgeRef {
|
|
14
14
|
readonly source: ResolvedNodeRef;
|
|
@@ -35,7 +35,7 @@ export interface QueryPremise {
|
|
|
35
35
|
}
|
|
36
36
|
export type Effect = {
|
|
37
37
|
readonly op: 'node.create';
|
|
38
|
-
readonly as:
|
|
38
|
+
readonly as: LocalAlias;
|
|
39
39
|
readonly class: ClassKey;
|
|
40
40
|
readonly properties: Properties;
|
|
41
41
|
} | {
|
|
@@ -63,7 +63,7 @@ export type Effect = {
|
|
|
63
63
|
};
|
|
64
64
|
export type PlanningConflict = ReconcileConflict | CorrespondenceConflict | ObservationConflict | {
|
|
65
65
|
readonly kind: 'desired-binding-uncreated';
|
|
66
|
-
readonly desired:
|
|
66
|
+
readonly desired: LocalAlias;
|
|
67
67
|
} | {
|
|
68
68
|
readonly kind: 'node-class-observed';
|
|
69
69
|
readonly node: NodeId;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type builder } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const Entrypoint: builder.DirectedEdgeClass<{
|
|
3
3
|
readonly depth: 1;
|
|
4
4
|
readonly abstract: false;
|
|
5
5
|
readonly extends: readonly [builder.ClassReferenceProjection<"edge", {
|
|
@@ -19,12 +19,14 @@ export declare const ViewFor: builder.DirectedEdgeClass<{
|
|
|
19
19
|
readonly properties: never;
|
|
20
20
|
readonly source: {
|
|
21
21
|
readonly as: "view";
|
|
22
|
-
readonly outgoing: "1
|
|
22
|
+
readonly outgoing: "0..1";
|
|
23
23
|
};
|
|
24
24
|
readonly target: {
|
|
25
|
-
readonly as: "
|
|
26
|
-
readonly incoming: "0
|
|
25
|
+
readonly as: "domain";
|
|
26
|
+
readonly incoming: "0..1";
|
|
27
|
+
};
|
|
28
|
+
readonly constraints: {
|
|
29
|
+
readonly noSelf: true;
|
|
27
30
|
};
|
|
28
|
-
readonly constraints: Record<never, never>;
|
|
29
31
|
readonly effectiveProperties: never;
|
|
30
32
|
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { edgeClass } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import { Domain } from '../domain/index.js';
|
|
3
|
+
import { Edge } from '../meta/index.js';
|
|
4
|
+
import { View } from './view.js';
|
|
5
|
+
export const Entrypoint = edgeClass.directed({
|
|
6
|
+
abstract: false,
|
|
7
|
+
source: { as: 'view', accepts: [View], outgoing: '0..1' },
|
|
8
|
+
target: { as: 'domain', accepts: [Domain], incoming: '0..1' },
|
|
9
|
+
description: 'The one View a Domain opens by default; a Domain declares at most one.',
|
|
10
|
+
extends: [Edge],
|
|
11
|
+
constraints: { noSelf: true },
|
|
12
|
+
});
|