@manifesto-ai/sdk 3.18.1 → 5.1.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 (40) hide show
  1. package/README.md +30 -14
  2. package/dist/chunk-DPFMD6LR.js +1 -0
  3. package/dist/chunk-OW22XF26.js +1 -0
  4. package/dist/chunk-TG2UPPZN.js +1 -0
  5. package/dist/compat/internal.d.ts +5 -84
  6. package/dist/effects.d.ts +2 -2
  7. package/dist/effects.js +1 -1
  8. package/dist/errors.d.ts +4 -0
  9. package/dist/extensions-types.d.ts +7 -5
  10. package/dist/extensions.js +1 -1
  11. package/dist/index.d.ts +13 -2
  12. package/dist/index.js +6 -6
  13. package/dist/manifest/compile-schema.d.ts +3 -1
  14. package/dist/manifest/create-manifesto.d.ts +2 -2
  15. package/dist/manifest/resolve-schema.d.ts +2 -2
  16. package/dist/manifest/shared.d.ts +3 -1
  17. package/dist/manifest.d.ts +1 -1
  18. package/dist/projection/snapshot-projection.d.ts +11 -13
  19. package/dist/provider.d.ts +12 -1
  20. package/dist/provider.js +1 -1
  21. package/dist/runtime/action-payload.d.ts +9 -0
  22. package/dist/runtime/admission-failure.d.ts +16 -0
  23. package/dist/runtime/admission.d.ts +6 -5
  24. package/dist/runtime/base-dispatch.d.ts +12 -10
  25. package/dist/runtime/base-runtime.d.ts +9 -2
  26. package/dist/runtime/context.d.ts +4 -0
  27. package/dist/runtime/facets.d.ts +13 -10
  28. package/dist/runtime/kernel-contract.d.ts +111 -0
  29. package/dist/runtime/kernel.d.ts +1 -1
  30. package/dist/runtime/publication.d.ts +3 -4
  31. package/dist/runtime/reports.d.ts +3 -3
  32. package/dist/runtime/simulation.d.ts +1 -1
  33. package/dist/runtime/state-store.d.ts +1 -1
  34. package/dist/types.d.ts +425 -45
  35. package/package.json +8 -8
  36. package/dist/chunk-BDIXNUQ3.js +0 -1
  37. package/dist/chunk-BSGOCNTO.js +0 -1
  38. package/dist/chunk-JM42OG2H.js +0 -1
  39. package/dist/manifest/system-get.d.ts +0 -4
  40. package/dist/runtime/events.d.ts +0 -7
package/dist/provider.js CHANGED
@@ -1 +1 @@
1
- import{a as c}from"./chunk-JM42OG2H.js";import{k as e,l as t,m as n,n as a,p as r,q as o,r as i}from"./chunk-BSGOCNTO.js";import"./chunk-BDIXNUQ3.js";export{i as activateComposable,o as assertComposableNotActivated,a as attachExtensionKernel,t as attachRuntimeKernelFactory,c as createBaseRuntimeInstance,e as createRuntimeKernel,r as getActivationState,n as getRuntimeKernelFactory};
1
+ import{a as s}from"./chunk-OW22XF26.js";import{j as e,k as t,l as a,m as n,n as o,o as r,q as i,r as l,s as m}from"./chunk-DPFMD6LR.js";import"./chunk-TG2UPPZN.js";export{m as activateComposable,l as assertComposableNotActivated,r as attachExtensionKernel,n as attachRuntimeKernelFactory,s as createBaseRuntimeInstance,e as createRuntimeKernel,i as getActivationState,o as getRuntimeKernelFactory,a as mapBlockedAdmission,t as toBlocker};
@@ -0,0 +1,9 @@
1
+ import { ManifestoError } from "../errors.js";
2
+ export declare function cloneAndFreezeActionPayload<T>(value: T): T;
3
+ export declare function tryCloneAndFreezeActionPayload<T>(value: T): {
4
+ readonly ok: true;
5
+ readonly value: T;
6
+ } | {
7
+ readonly ok: false;
8
+ readonly error: ManifestoError;
9
+ };
@@ -0,0 +1,16 @@
1
+ import type { AdmissionFailure, Blocker, DispatchBlocker } from "../types.js";
2
+ /**
3
+ * Shared admission-failure mapping for runtime surfaces.
4
+ *
5
+ * The base, lineage, and governance runtimes expose the same
6
+ * action-candidate admission contract; this module is the single source
7
+ * for narrowing a blocked kernel admission into the public
8
+ * AdmissionFailure shape (previously triplicated across the three
9
+ * runtime files).
10
+ */
11
+ export declare function toBlocker(blocker: DispatchBlocker, code: Blocker["code"]): Blocker;
12
+ export declare function mapBlockedAdmission<Name extends string>(actionName: Name, admission: {
13
+ readonly failure: {
14
+ readonly kind: string;
15
+ };
16
+ }, fallbackMessage?: string): AdmissionFailure<Name>;
@@ -1,5 +1,5 @@
1
- import { type DomainSchema, type Snapshot as CoreSnapshot } from "@manifesto-ai/core";
2
- import type { CanonicalSnapshot, ManifestoDomainShape, ManifestoEventMap, Snapshot, TypedIntent } from "../types.js";
1
+ import { type ActionAvailabilityEvaluation, type ActionDispatchabilityEvaluation, type DomainSchema, type Snapshot as CoreSnapshot } from "@manifesto-ai/core";
2
+ import type { CanonicalSnapshot, ManifestoDomainShape, ProjectedSnapshot, TypedIntent } from "../types.js";
3
3
  import type { RuntimeAdmission, RuntimeSimulateSync } from "./facets.js";
4
4
  type RuntimeAdmissionOptions<T extends ManifestoDomainShape> = {
5
5
  readonly schema: DomainSchema;
@@ -7,9 +7,10 @@ type RuntimeAdmissionOptions<T extends ManifestoDomainShape> = {
7
7
  readonly getAvailableActionsFor: (snapshot: CanonicalSnapshot<T["state"]>) => readonly (keyof T["actions"])[];
8
8
  readonly isActionAvailableFor: (snapshot: CanonicalSnapshot<T["state"]>, name: keyof T["actions"]) => boolean;
9
9
  readonly isIntentDispatchableFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => boolean;
10
- readonly projectSnapshotFromCanonical: (snapshot: CoreSnapshot) => Snapshot<T["state"]>;
10
+ readonly evaluateActionAvailabilityFor: (snapshot: CanonicalSnapshot<T["state"]>, name: keyof T["actions"]) => ActionAvailabilityEvaluation;
11
+ readonly evaluateIntentDispatchabilityFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => ActionDispatchabilityEvaluation;
12
+ readonly projectSnapshotFromCanonical: (snapshot: CoreSnapshot) => ProjectedSnapshot<T>;
11
13
  readonly getSimulateSync: () => RuntimeSimulateSync<T>;
12
- readonly emitEvent: <K extends keyof ManifestoEventMap<T>>(event: K, payload: ManifestoEventMap<T>[K]) => void;
13
14
  };
14
- export declare function createRuntimeAdmission<T extends ManifestoDomainShape>({ schema, ensureIntentId, getAvailableActionsFor, isActionAvailableFor, isIntentDispatchableFor, projectSnapshotFromCanonical, getSimulateSync, emitEvent, }: RuntimeAdmissionOptions<T>): RuntimeAdmission<T>;
15
+ export declare function createRuntimeAdmission<T extends ManifestoDomainShape>({ schema, ensureIntentId, getAvailableActionsFor, isActionAvailableFor, evaluateActionAvailabilityFor, evaluateIntentDispatchabilityFor, projectSnapshotFromCanonical, getSimulateSync, }: RuntimeAdmissionOptions<T>): RuntimeAdmission<T>;
15
16
  export {};
@@ -1,8 +1,7 @@
1
- import type { DispatchReport, ExecutionDiagnostics, ExecutionFailureInfo, ExecutionOutcome, IntentAdmission, ManifestoDomainShape, Snapshot, TypedIntent } from "../types.js";
1
+ import type { DispatchReport, ExecutionDiagnostics, ExecutionFailureInfo, DispatchExecutionOutcome, IntentAdmission, ManifestoDomainShape, ProjectedSnapshot, TypedIntent } from "../types.js";
2
2
  import type { ExtensionKernel } from "../extensions-types.js";
3
3
  import type { RuntimeKernel } from "../compat/internal.js";
4
4
  import { ManifestoError } from "../errors.js";
5
- import { emitDispatchRejectedEvent } from "./events.js";
6
5
  import type { RuntimePublicationHelpers } from "./facets.js";
7
6
  type RejectedAttempt<T extends ManifestoDomainShape> = {
8
7
  readonly kind: "rejected";
@@ -10,9 +9,12 @@ type RejectedAttempt<T extends ManifestoDomainShape> = {
10
9
  readonly admission: Extract<IntentAdmission<T>, {
11
10
  readonly kind: "blocked";
12
11
  }>;
13
- readonly beforeSnapshot: Snapshot<T["state"]>;
12
+ readonly beforeSnapshot: ProjectedSnapshot<T>;
14
13
  readonly beforeCanonicalSnapshot: ReturnType<RuntimeKernel<T>["getCanonicalSnapshot"]>;
15
- readonly rejection: ReturnType<typeof emitDispatchRejectedEvent<T>>;
14
+ readonly rejection: {
15
+ readonly code: "ACTION_UNAVAILABLE" | "INTENT_NOT_DISPATCHABLE" | "INVALID_INPUT";
16
+ readonly reason: string;
17
+ };
16
18
  readonly rejectionError: ManifestoError;
17
19
  };
18
20
  type FailedAttempt<T extends ManifestoDomainShape> = {
@@ -21,13 +23,13 @@ type FailedAttempt<T extends ManifestoDomainShape> = {
21
23
  readonly admission: Extract<IntentAdmission<T>, {
22
24
  readonly kind: "admitted";
23
25
  }>;
24
- readonly beforeSnapshot: Snapshot<T["state"]>;
26
+ readonly beforeSnapshot: ProjectedSnapshot<T>;
25
27
  readonly beforeCanonicalSnapshot: ReturnType<RuntimeKernel<T>["getCanonicalSnapshot"]>;
26
28
  readonly failure: Error;
27
29
  readonly errorInfo: ExecutionFailureInfo;
28
30
  readonly published: boolean;
29
31
  readonly diagnostics?: ExecutionDiagnostics;
30
- readonly outcome?: ExecutionOutcome<T>;
32
+ readonly outcome?: DispatchExecutionOutcome<T>;
31
33
  };
32
34
  type CompletedAttempt<T extends ManifestoDomainShape> = {
33
35
  readonly kind: "completed";
@@ -35,12 +37,12 @@ type CompletedAttempt<T extends ManifestoDomainShape> = {
35
37
  readonly admission: Extract<IntentAdmission<T>, {
36
38
  readonly kind: "admitted";
37
39
  }>;
38
- readonly publishedSnapshot: Snapshot<T["state"]>;
39
- readonly outcome: ExecutionOutcome<T>;
40
+ readonly publishedSnapshot: ProjectedSnapshot<T>;
41
+ readonly outcome: DispatchExecutionOutcome<T>;
40
42
  readonly diagnostics: ExecutionDiagnostics;
41
43
  };
42
44
  export type BaseDispatchAttemptResult<T extends ManifestoDomainShape = ManifestoDomainShape> = RejectedAttempt<T> | FailedAttempt<T> | CompletedAttempt<T>;
43
- export declare function runBaseDispatchAttempt<T extends ManifestoDomainShape>(kernel: RuntimeKernel<T>, extensionKernel: Pick<ExtensionKernel<T>, "projectSnapshot">, publication: Pick<RuntimePublicationHelpers<T>, "publishCompletedHostResult" | "publishFailedHostResult">, intent: TypedIntent<T>): Promise<BaseDispatchAttemptResult<T>>;
44
- export declare function attemptToDispatchAsyncResult<T extends ManifestoDomainShape>(attempt: BaseDispatchAttemptResult<T>): Snapshot<T["state"]>;
45
+ export declare function runBaseDispatchAttempt<T extends ManifestoDomainShape>(kernel: RuntimeKernel<T>, extensionKernel: Pick<ExtensionKernel<T>, "projectSnapshot">, publication: Pick<RuntimePublicationHelpers<T>, "publishCompletedHostResult" | "publishFailedHostResult">, intent: TypedIntent<T>, context: ReturnType<RuntimeKernel<T>["createComputeContext"]>): Promise<BaseDispatchAttemptResult<T>>;
46
+ export declare function attemptToDispatchAsyncResult<T extends ManifestoDomainShape>(attempt: BaseDispatchAttemptResult<T>): ProjectedSnapshot<T>;
45
47
  export declare function attemptToDispatchReport<T extends ManifestoDomainShape>(attempt: BaseDispatchAttemptResult<T>): DispatchReport<T>;
46
48
  export {};
@@ -1,3 +1,10 @@
1
- import type { ManifestoBaseInstance, ManifestoDomainShape } from "../types.js";
1
+ import type { ManifestoApp, ManifestoDomainShape, PreviewDiagnosticsMode, SubmitReportMode } from "../types.js";
2
2
  import { type RuntimeKernel } from "../compat/internal.js";
3
- export declare function createBaseRuntimeInstance<T extends ManifestoDomainShape>(kernel: RuntimeKernel<T>): ManifestoBaseInstance<T>;
3
+ type BaseMode = "base";
4
+ type RuntimeExecutionView<T extends ManifestoDomainShape> = {
5
+ readonly context?: ReturnType<RuntimeKernel<T>["getExternalContext"]>;
6
+ readonly diagnostics?: PreviewDiagnosticsMode;
7
+ readonly report?: SubmitReportMode;
8
+ };
9
+ export declare function createBaseRuntimeInstance<T extends ManifestoDomainShape>(kernel: RuntimeKernel<T>, view?: RuntimeExecutionView<T>, isView?: boolean): ManifestoApp<T, BaseMode>;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type DomainSchema } from "@manifesto-ai/core";
2
+ import type { DomainExternalContext, ManifestoDomainShape } from "../types.js";
3
+ export declare function materializeExternalContext<T extends ManifestoDomainShape>(schema: DomainSchema, value: unknown, source: string): DomainExternalContext<T>;
4
+ export declare function captureExternalContext<T extends ManifestoDomainShape>(schema: DomainSchema, current: DomainExternalContext<T>, override: unknown, source: string): DomainExternalContext<T>;
@@ -1,24 +1,24 @@
1
- import type { ComputeStatus, Patch, Requirement, Snapshot as CoreSnapshot, SystemDelta } from "@manifesto-ai/core";
1
+ import type { Context, ComputeStatus, Patch, Requirement, Snapshot as CoreSnapshot, SystemDelta } from "@manifesto-ai/core";
2
2
  import type { HostResult } from "@manifesto-ai/host";
3
- import type { DispatchBlocker, CanonicalSnapshot, ExecutionDiagnostics, ExecutionFailureInfo, ExecutionOutcome, IntentAdmission, IntentExplanation, ManifestoDomainShape, ManifestoEvent, ManifestoEventMap, SimulationDiagnostics, Snapshot, TypedIntent, TypedOn, TypedSubscribe } from "../types.js";
3
+ import type { DispatchBlocker, CanonicalSnapshot, DomainExternalContext, DispatchExecutionOutcome, ExecutionDiagnostics, ExecutionFailureInfo, IntentAdmission, IntentExplanation, ManifestoDomainShape, ManifestoEvent, ManifestoEventPayloadMap, ProjectedSnapshot, SimulationDiagnostics, TypedIntent, TypedOn, TypedSubscribe } from "../types.js";
4
4
  import type { ManifestoError } from "../errors.js";
5
5
  export interface RuntimeStateStore<T extends ManifestoDomainShape> {
6
6
  readonly subscribe: TypedSubscribe<T>;
7
7
  readonly on: TypedOn<T>;
8
- readonly getSnapshot: () => Snapshot<T["state"]>;
8
+ readonly getSnapshot: () => ProjectedSnapshot<T>;
9
9
  readonly getCanonicalSnapshot: () => CanonicalSnapshot<T["state"]>;
10
10
  readonly getVisibleCoreSnapshot: () => CoreSnapshot;
11
11
  readonly setVisibleSnapshot: (snapshot: CoreSnapshot, options?: {
12
12
  readonly notify?: boolean;
13
- }) => Snapshot<T["state"]>;
13
+ }) => ProjectedSnapshot<T>;
14
14
  readonly restoreVisibleSnapshot: () => void;
15
- readonly emitEvent: <K extends ManifestoEvent>(event: K, payload: ManifestoEventMap<T>[K]) => void;
15
+ readonly emitEvent: <K extends ManifestoEvent>(event: K, payload: ManifestoEventPayloadMap[K]) => void;
16
16
  readonly enqueue: <R>(task: () => Promise<R>) => Promise<R>;
17
17
  readonly dispose: () => void;
18
18
  readonly isDisposed: () => boolean;
19
19
  }
20
20
  export interface RuntimeReportHelpers<T extends ManifestoDomainShape> {
21
- readonly deriveExecutionOutcome: (beforeSnapshot: CanonicalSnapshot<T["state"]>, afterSnapshot: CanonicalSnapshot<T["state"]>) => ExecutionOutcome<T>;
21
+ readonly deriveExecutionOutcome: (beforeSnapshot: CanonicalSnapshot<T["state"]>, afterSnapshot: CanonicalSnapshot<T["state"]>) => DispatchExecutionOutcome<T>;
22
22
  readonly classifyExecutionFailure: (error: unknown, stage: "host" | "seal") => ExecutionFailureInfo;
23
23
  readonly createExecutionDiagnostics: (result: HostResult) => ExecutionDiagnostics;
24
24
  }
@@ -49,7 +49,10 @@ export type RuntimeSimulationResult<T extends ManifestoDomainShape = ManifestoDo
49
49
  readonly requirements: readonly Requirement[];
50
50
  readonly diagnostics?: SimulationDiagnostics;
51
51
  };
52
- export type RuntimeSimulateSync<T extends ManifestoDomainShape = ManifestoDomainShape> = (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => RuntimeSimulationResult<T>;
52
+ export type RuntimeSimulateSync<T extends ManifestoDomainShape = ManifestoDomainShape> = (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>, options?: {
53
+ readonly externalContext?: DomainExternalContext<T>;
54
+ readonly context?: Context;
55
+ }) => RuntimeSimulationResult<T>;
53
56
  export interface RuntimeAdmission<T extends ManifestoDomainShape> {
54
57
  readonly getIntentBlockersFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => readonly DispatchBlocker[];
55
58
  readonly validateIntentInputFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => ManifestoError | null;
@@ -63,12 +66,12 @@ export interface RuntimeAdmission<T extends ManifestoDomainShape> {
63
66
  readonly rejectNotDispatchable: (intent: TypedIntent<T>) => never;
64
67
  }
65
68
  export type PublishedRuntimeSnapshot<T extends ManifestoDomainShape = ManifestoDomainShape> = {
66
- readonly publishedSnapshot: Snapshot<T["state"]>;
69
+ readonly publishedSnapshot: ProjectedSnapshot<T>;
67
70
  readonly publishedCanonicalSnapshot: CanonicalSnapshot<T["state"]>;
68
71
  };
69
72
  export interface RuntimePublicationHelpers<T extends ManifestoDomainShape> {
70
73
  readonly replaceVisibleSnapshot: RuntimeStateStore<T>["setVisibleSnapshot"];
71
74
  readonly restoreVisibleSnapshot: RuntimeStateStore<T>["restoreVisibleSnapshot"];
72
- readonly publishCompletedHostResult: (intent: TypedIntent<T>, snapshot: CoreSnapshot) => PublishedRuntimeSnapshot<T>;
73
- readonly publishFailedHostResult: (intent: TypedIntent<T>, error: Error, snapshot: CoreSnapshot) => PublishedRuntimeSnapshot<T>;
75
+ readonly publishCompletedHostResult: (snapshot: CoreSnapshot) => PublishedRuntimeSnapshot<T>;
76
+ readonly publishFailedHostResult: (snapshot: CoreSnapshot) => PublishedRuntimeSnapshot<T>;
74
77
  }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Runtime kernel contract: the full kernel interface, its facet
3
+ * decomposition, and the decorator-facing kernel aliases (#421).
4
+ *
5
+ * This file is the design home of the seam types. The facet aliases
6
+ * (LineageRuntimeKernel, GovernanceRuntimeKernel,
7
+ * WaitForProposalRuntimeKernel) are the primary dependency surfaces for
8
+ * decorator and provider code; the broad RuntimeKernel aggregate exists
9
+ * for kernel assembly and compatibility, not as the unit new code should
10
+ * depend on. compat/internal re-exports everything here unchanged, so
11
+ * the provider seam stays source-compatible.
12
+ */
13
+ import { type ComputeStatus, type DomainSchema, type JsonValue, type Patch, type Requirement, type Snapshot as CoreSnapshot, type SystemDelta } from "@manifesto-ai/core";
14
+ import type { HostContextProvider, HostResult, ManifestoHost } from "@manifesto-ai/host";
15
+ import type { Context } from "@manifesto-ai/core";
16
+ import type { ActionAnnotation, CanonicalSnapshot, ContextUpdater, DispatchExecutionOutcome, DispatchBlocker, DomainExternalContext, ExternalContext, ExecutionDiagnostics, ExecutionFailureInfo, IntentAdmission, ManifestoDomainShape, ManifestoEvent, ManifestoEventPayloadMap, ProjectedSnapshot, SchemaGraph, SimulationDiagnostics, TypedCreateIntent, TypedDomainRefs, TypedGetActionMetadata, TypedGetIntentBlockers, TypedIntent, TypedIsIntentDispatchable, TypedMEL, TypedOn, TypedSimulate, TypedSimulateIntent, TypedSubscribe } from "../types.js";
17
+ import type { SnapshotProjectionPlan } from "../projection/snapshot-projection.js";
18
+ import type { IntentLegalityEvaluation } from "./facets.js";
19
+ import type { ManifestoError } from "../errors.js";
20
+ import type { ExtensionKernel } from "../extensions-types.js";
21
+ import { EXTENSION_KERNEL } from "../compat/runtime-symbols.js";
22
+ export type HostDispatchOptions = NonNullable<Parameters<ManifestoHost["dispatch"]>[1]>;
23
+ export type SimulateResult<T extends ManifestoDomainShape = ManifestoDomainShape> = {
24
+ readonly snapshot: CanonicalSnapshot<T["state"]>;
25
+ readonly patches: readonly Patch[];
26
+ readonly systemDelta: Readonly<SystemDelta>;
27
+ readonly status: ComputeStatus;
28
+ readonly requirements: readonly Requirement[];
29
+ readonly diagnostics?: SimulationDiagnostics;
30
+ };
31
+ export interface RuntimeKernel<T extends ManifestoDomainShape> {
32
+ readonly schema: DomainSchema;
33
+ readonly refs: TypedDomainRefs<T>;
34
+ /** @deprecated Use refs. */
35
+ readonly MEL: TypedMEL<T>;
36
+ readonly createIntent: TypedCreateIntent<T>;
37
+ readonly subscribe: TypedSubscribe<T>;
38
+ readonly on: TypedOn<T>;
39
+ readonly getSnapshot: () => ProjectedSnapshot<T>;
40
+ readonly getCanonicalSnapshot: () => CanonicalSnapshot<T["state"]>;
41
+ readonly getAvailableActionsFor: (snapshot: CanonicalSnapshot<T["state"]>) => readonly (keyof T["actions"])[];
42
+ readonly getAvailableActions: () => readonly (keyof T["actions"])[];
43
+ readonly getIntentBlockersFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => readonly DispatchBlocker[];
44
+ readonly getActionMetadata: TypedGetActionMetadata<T>;
45
+ readonly isActionAvailableFor: (snapshot: CanonicalSnapshot<T["state"]>, name: keyof T["actions"]) => boolean;
46
+ readonly isActionAvailable: (name: keyof T["actions"]) => boolean;
47
+ readonly isIntentDispatchableFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => boolean;
48
+ readonly isIntentDispatchable: TypedIsIntentDispatchable<T>;
49
+ readonly getIntentBlockers: TypedGetIntentBlockers<T>;
50
+ readonly getSchemaGraph: () => SchemaGraph;
51
+ readonly simulateSync: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>, options?: {
52
+ readonly externalContext?: DomainExternalContext<T>;
53
+ readonly context?: Context;
54
+ }) => SimulateResult<T>;
55
+ readonly simulate: TypedSimulate<T>;
56
+ readonly simulateIntent: TypedSimulateIntent<T>;
57
+ readonly dispose: () => void;
58
+ readonly isDisposed: () => boolean;
59
+ readonly getVisibleCoreSnapshot: () => CoreSnapshot;
60
+ readonly setVisibleSnapshot: (snapshot: CoreSnapshot, options?: {
61
+ readonly notify?: boolean;
62
+ }) => ProjectedSnapshot<T>;
63
+ readonly rehydrateSnapshot: (snapshot: CoreSnapshot) => CoreSnapshot;
64
+ readonly restoreVisibleSnapshot: () => void;
65
+ readonly emitEvent: <K extends ManifestoEvent>(event: K, payload: ManifestoEventPayloadMap[K]) => void;
66
+ readonly enqueue: <R>(task: () => Promise<R>) => Promise<R>;
67
+ readonly ensureIntentId: (intent: TypedIntent<T>) => TypedIntent<T>;
68
+ readonly executeHost: (intent: TypedIntent<T>, options?: HostDispatchOptions) => Promise<HostResult>;
69
+ readonly createComputeContext: (intent: TypedIntent<T>, externalContext?: ExternalContext) => Context;
70
+ readonly getExternalContext: () => DomainExternalContext<T>;
71
+ readonly replaceExternalContext: (next: DomainExternalContext<T>) => DomainExternalContext<T>;
72
+ readonly updateExternalContext: (updater: ContextUpdater<DomainExternalContext<T>>) => DomainExternalContext<T>;
73
+ readonly captureExternalContext: (override?: ExternalContext) => DomainExternalContext<T>;
74
+ readonly validateIntentInputFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => ManifestoError | null;
75
+ readonly evaluateIntentLegalityFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => IntentLegalityEvaluation<T>;
76
+ readonly deriveIntentAdmission: (snapshot: CanonicalSnapshot<T["state"]>, legality: IntentLegalityEvaluation<T>) => IntentAdmission<T>;
77
+ readonly deriveExecutionOutcome: (beforeSnapshot: CanonicalSnapshot<T["state"]>, afterSnapshot: CanonicalSnapshot<T["state"]>) => DispatchExecutionOutcome<T>;
78
+ readonly classifyExecutionFailure: (error: unknown, stage: "host" | "seal") => ExecutionFailureInfo;
79
+ readonly createExecutionDiagnostics: (result: HostResult) => ExecutionDiagnostics;
80
+ readonly createUnavailableError: (intent: TypedIntent<T>) => ManifestoError;
81
+ readonly createNotDispatchableError: (intent: TypedIntent<T>) => ManifestoError;
82
+ readonly rejectInvalidInput: (intent: TypedIntent<T>, message: string) => never;
83
+ readonly rejectUnavailable: (intent: TypedIntent<T>) => never;
84
+ readonly rejectNotDispatchable: (intent: TypedIntent<T>) => never;
85
+ readonly [EXTENSION_KERNEL]: ExtensionKernel<T>;
86
+ }
87
+ export type RuntimePublicReadFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "schema" | "MEL" | "createIntent" | "subscribe" | "on" | "getSnapshot" | "getCanonicalSnapshot" | "getAvailableActionsFor" | "getAvailableActions" | "isIntentDispatchable" | "getIntentBlockers" | "getActionMetadata" | "isActionAvailable" | "getSchemaGraph" | "simulateSync" | "simulate" | "simulateIntent" | "getExternalContext" | "replaceExternalContext" | "updateExternalContext" | "captureExternalContext">;
88
+ export type RuntimeLifecycleFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "dispose" | "isDisposed" | "enqueue">;
89
+ export type RuntimeExecutionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "ensureIntentId" | "executeHost" | "createComputeContext" | "captureExternalContext">;
90
+ export type RuntimeSealAdmissionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "isActionAvailable" | "isActionAvailableFor" | "validateIntentInputFor" | "isIntentDispatchableFor" | "rejectUnavailable" | "rejectInvalidInput" | "rejectNotDispatchable">;
91
+ export type RuntimeReportAdmissionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "evaluateIntentLegalityFor" | "deriveIntentAdmission" | "createUnavailableError" | "createNotDispatchableError">;
92
+ export type RuntimePublicationFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "getVisibleCoreSnapshot" | "setVisibleSnapshot" | "rehydrateSnapshot" | "restoreVisibleSnapshot">;
93
+ export type RuntimeReportingFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "deriveExecutionOutcome" | "classifyExecutionFailure" | "createExecutionDiagnostics">;
94
+ export type RuntimeDispatchEventsFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "emitEvent">;
95
+ export type RuntimeExtensionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, typeof EXTENSION_KERNEL>;
96
+ export type LineageRuntimeKernel<T extends ManifestoDomainShape> = RuntimePublicReadFacet<T> & RuntimeLifecycleFacet<T> & RuntimeExecutionFacet<T> & RuntimeSealAdmissionFacet<T> & RuntimeReportAdmissionFacet<T> & RuntimePublicationFacet<T> & RuntimeReportingFacet<T> & RuntimeDispatchEventsFacet<T> & RuntimeExtensionFacet<T>;
97
+ export type LineageRuntimeKernelFactory<T extends ManifestoDomainShape> = () => LineageRuntimeKernel<T>;
98
+ export type GovernanceRuntimeKernel<T extends ManifestoDomainShape> = RuntimePublicReadFacet<T> & RuntimeLifecycleFacet<T> & RuntimeExecutionFacet<T> & RuntimeSealAdmissionFacet<T> & RuntimeReportAdmissionFacet<T> & RuntimePublicationFacet<T> & Pick<RuntimeKernel<T>, "deriveExecutionOutcome"> & RuntimeDispatchEventsFacet<T> & RuntimeExtensionFacet<T>;
99
+ export type GovernanceRuntimeKernelFactory<T extends ManifestoDomainShape> = () => GovernanceRuntimeKernel<T>;
100
+ export type WaitForProposalRuntimeKernel<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "isDisposed" | "deriveExecutionOutcome">;
101
+ export type RuntimeKernelFactory<T extends ManifestoDomainShape> = () => RuntimeKernel<T>;
102
+ export type RuntimeKernelOptions<T extends ManifestoDomainShape> = {
103
+ readonly schema: DomainSchema;
104
+ readonly projectionPlan: SnapshotProjectionPlan;
105
+ readonly actionAnnotations: Readonly<Record<string, ActionAnnotation>>;
106
+ readonly host: ManifestoHost;
107
+ readonly hostContextProvider: HostContextProvider;
108
+ readonly MEL: TypedMEL<T>;
109
+ readonly createIntent: TypedCreateIntent<T>;
110
+ readonly initialContext?: Record<string, JsonValue>;
111
+ };
@@ -1,3 +1,3 @@
1
1
  import type { ManifestoDomainShape } from "../types.js";
2
2
  import type { RuntimeKernel, RuntimeKernelOptions } from "../compat/internal.js";
3
- export declare function createRuntimeKernel<T extends ManifestoDomainShape>({ schema, projectionPlan, host, hostContextProvider, MEL, createIntent, }: RuntimeKernelOptions<T>): RuntimeKernel<T>;
3
+ export declare function createRuntimeKernel<T extends ManifestoDomainShape>({ schema, projectionPlan, actionAnnotations, host, hostContextProvider, MEL, createIntent, initialContext, }: RuntimeKernelOptions<T>): RuntimeKernel<T>;
@@ -1,13 +1,12 @@
1
1
  import type { Snapshot as CoreSnapshot } from "@manifesto-ai/core";
2
- import type { CanonicalSnapshot, ManifestoDomainShape, ManifestoEventMap, Snapshot } from "../types.js";
2
+ import type { CanonicalSnapshot, ManifestoDomainShape, ProjectedSnapshot } from "../types.js";
3
3
  import type { RuntimePublicationHelpers } from "./facets.js";
4
4
  type RuntimePublicationOptions<T extends ManifestoDomainShape> = {
5
5
  readonly setVisibleSnapshot: (snapshot: CoreSnapshot, options?: {
6
6
  readonly notify?: boolean;
7
- }) => Snapshot<T["state"]>;
7
+ }) => ProjectedSnapshot<T>;
8
8
  readonly restoreVisibleSnapshot: () => void;
9
9
  readonly getCanonicalSnapshot: () => CanonicalSnapshot<T["state"]>;
10
- readonly emitEvent: <K extends keyof ManifestoEventMap<T>>(event: K, payload: ManifestoEventMap<T>[K]) => void;
11
10
  };
12
- export declare function createRuntimePublication<T extends ManifestoDomainShape>({ setVisibleSnapshot, restoreVisibleSnapshot, getCanonicalSnapshot, emitEvent, }: RuntimePublicationOptions<T>): RuntimePublicationHelpers<T>;
11
+ export declare function createRuntimePublication<T extends ManifestoDomainShape>({ setVisibleSnapshot, restoreVisibleSnapshot, getCanonicalSnapshot, }: RuntimePublicationOptions<T>): RuntimePublicationHelpers<T>;
13
12
  export {};
@@ -1,10 +1,10 @@
1
1
  import type { Snapshot as CoreSnapshot } from "@manifesto-ai/core";
2
- import type { CanonicalSnapshot, ManifestoDomainShape, Snapshot } from "../types.js";
2
+ import type { CanonicalSnapshot, ChangedPath, ManifestoDomainShape, ProjectedSnapshot, Snapshot } from "../types.js";
3
3
  import type { RuntimeReportHelpers } from "./facets.js";
4
4
  type RuntimeReportHelperOptions<T extends ManifestoDomainShape> = {
5
5
  readonly getAvailableActionsFor: (snapshot: CanonicalSnapshot<T["state"]>) => readonly (keyof T["actions"])[];
6
- readonly projectSnapshotFromCanonical: (snapshot: CoreSnapshot) => Snapshot<T["state"]>;
6
+ readonly projectSnapshotFromCanonical: (snapshot: CoreSnapshot) => ProjectedSnapshot<T>;
7
7
  };
8
8
  export declare function createRuntimeReportHelpers<T extends ManifestoDomainShape>({ getAvailableActionsFor, projectSnapshotFromCanonical, }: RuntimeReportHelperOptions<T>): RuntimeReportHelpers<T>;
9
- export declare function diffProjectedPaths<T>(left: Snapshot<T>, right: Snapshot<T>): readonly string[];
9
+ export declare function diffProjectedPaths<T>(left: Snapshot<T>, right: Snapshot<T>): readonly ChangedPath[];
10
10
  export {};
@@ -9,7 +9,7 @@ type RuntimeSimulationOptions<T extends ManifestoDomainShape> = {
9
9
  readonly evaluateIntentLegalityFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => IntentLegalityEvaluation<T>;
10
10
  };
11
11
  export declare function createRuntimeSimulation<T extends ManifestoDomainShape>({ schema, hostContextProvider, evaluateIntentLegalityFor, }: RuntimeSimulationOptions<T>): Readonly<{
12
- withHostIntentSlot: (snapshot: CoreSnapshot, intent: TypedIntent<T>, context: ReturnType<HostContextProvider["createFrozenContext"]>) => CoreSnapshot;
12
+ withHostIntentSlot: (snapshot: CoreSnapshot, intent: TypedIntent<T>) => CoreSnapshot;
13
13
  createSimulationUnavailableError: (intent: TypedIntent<T>) => ManifestoError;
14
14
  createSimulationNotDispatchableError: (intent: TypedIntent<T>) => ManifestoError;
15
15
  simulateSync: RuntimeSimulateSync<T>;
@@ -5,7 +5,7 @@ import type { RuntimeStateStore } from "./facets.js";
5
5
  type RuntimeStateStoreOptions<T extends ManifestoDomainShape> = {
6
6
  readonly host: ManifestoHost;
7
7
  readonly initialCanonicalSnapshot: CoreSnapshot;
8
- readonly projectSnapshotFromCanonical: (snapshot: CoreSnapshot) => Snapshot<T["state"]>;
8
+ readonly projectSnapshotFromCanonical: (snapshot: CoreSnapshot) => Snapshot<T["state"], T["computed"]>;
9
9
  };
10
10
  export declare function createRuntimeStateStore<T extends ManifestoDomainShape>({ host, initialCanonicalSnapshot, projectSnapshotFromCanonical, }: RuntimeStateStoreOptions<T>): RuntimeStateStore<T>;
11
11
  export {};