@manifesto-ai/sdk 3.4.0 → 3.5.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.
@@ -1,6 +1,7 @@
1
1
  import { type DomainSchema, type Snapshot as CoreSnapshot } from "@manifesto-ai/core";
2
- import type { HostResult, ManifestoHost } from "@manifesto-ai/host";
3
- import type { BaseLaws, CanonicalSnapshot, ComposableManifesto, ManifestoBaseInstance, ManifestoDomainShape, ManifestoEvent, ManifestoEventMap, Snapshot, TypedCreateIntent, TypedGetActionMetadata, TypedIntent, TypedMEL, TypedOn, TypedSubscribe } from "./types.js";
2
+ import type { HostContextProvider, HostResult, ManifestoHost } from "@manifesto-ai/host";
3
+ import { ManifestoError } from "./errors.js";
4
+ import type { BaseLaws, CanonicalSnapshot, ComposableManifesto, ManifestoBaseInstance, ManifestoDomainShape, ManifestoEvent, ManifestoEventMap, SchemaGraph, Snapshot, TypedCreateIntent, TypedGetActionMetadata, TypedIntent, TypedMEL, TypedOn, TypedSimulate, TypedSubscribe } from "./types.js";
4
5
  import { type SnapshotProjectionPlan } from "./snapshot-projection.js";
5
6
  export declare const ACTION_PARAM_NAMES: unique symbol;
6
7
  export declare const RUNTIME_KERNEL_FACTORY: unique symbol;
@@ -20,6 +21,8 @@ export interface RuntimeKernel<T extends ManifestoDomainShape> {
20
21
  readonly getAvailableActions: () => readonly (keyof T["actions"])[];
21
22
  readonly getActionMetadata: TypedGetActionMetadata<T>;
22
23
  readonly isActionAvailable: (name: keyof T["actions"]) => boolean;
24
+ readonly getSchemaGraph: () => SchemaGraph;
25
+ readonly simulate: TypedSimulate<T>;
23
26
  readonly dispose: () => void;
24
27
  readonly isDisposed: () => boolean;
25
28
  readonly getVisibleCoreSnapshot: () => CoreSnapshot;
@@ -31,6 +34,7 @@ export interface RuntimeKernel<T extends ManifestoDomainShape> {
31
34
  readonly enqueue: <R>(task: () => Promise<R>) => Promise<R>;
32
35
  readonly ensureIntentId: (intent: TypedIntent<T>) => TypedIntent<T>;
33
36
  readonly executeHost: (intent: TypedIntent<T>, options?: HostDispatchOptions) => Promise<HostResult>;
37
+ readonly createUnavailableError: (intent: TypedIntent<T>) => ManifestoError;
34
38
  readonly rejectUnavailable: (intent: TypedIntent<T>) => never;
35
39
  }
36
40
  export type RuntimeKernelFactory<T extends ManifestoDomainShape> = () => RuntimeKernel<T>;
@@ -42,6 +46,7 @@ type RuntimeKernelOptions<T extends ManifestoDomainShape> = {
42
46
  readonly schema: DomainSchema;
43
47
  readonly projectionPlan: SnapshotProjectionPlan;
44
48
  readonly host: ManifestoHost;
49
+ readonly hostContextProvider: HostContextProvider;
45
50
  readonly MEL: TypedMEL<T>;
46
51
  readonly createIntent: TypedCreateIntent<T>;
47
52
  };
@@ -50,6 +55,6 @@ export declare function getRuntimeKernelFactory<T extends ManifestoDomainShape,
50
55
  export declare function getActivationState<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>): ActivationState;
51
56
  export declare function assertComposableNotActivated<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>): void;
52
57
  export declare function activateComposable<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>): void;
53
- export declare function createRuntimeKernel<T extends ManifestoDomainShape>({ schema, projectionPlan, host, MEL, createIntent, }: RuntimeKernelOptions<T>): RuntimeKernel<T>;
58
+ export declare function createRuntimeKernel<T extends ManifestoDomainShape>({ schema, projectionPlan, host, hostContextProvider, MEL, createIntent, }: RuntimeKernelOptions<T>): RuntimeKernel<T>;
54
59
  export declare function createBaseRuntimeInstance<T extends ManifestoDomainShape>(kernel: RuntimeKernel<T>): ManifestoBaseInstance<T>;
55
60
  export {};
package/dist/provider.js CHANGED
@@ -1,17 +1,2 @@
1
- import {
2
- activateComposable,
3
- assertComposableNotActivated,
4
- attachRuntimeKernelFactory,
5
- createRuntimeKernel,
6
- getActivationState,
7
- getRuntimeKernelFactory
8
- } from "./chunk-2YBJP5JT.js";
9
- export {
10
- activateComposable,
11
- assertComposableNotActivated,
12
- attachRuntimeKernelFactory,
13
- createRuntimeKernel,
14
- getActivationState,
15
- getRuntimeKernelFactory
16
- };
1
+ import{j as t,k as e,l as a,m as o,n,o as r}from"./chunk-N774NZRO.js";export{n as activateComposable,o as assertComposableNotActivated,t as attachRuntimeKernelFactory,r as createRuntimeKernel,a as getActivationState,e as getRuntimeKernelFactory};
17
2
  //# sourceMappingURL=provider.js.map
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import type { DomainSchema, Intent, Patch } from "@manifesto-ai/core";
1
+ import type { ComputeStatus, DomainSchema, Intent, Patch, Requirement } from "@manifesto-ai/core";
2
+ import type { SchemaGraph as CompilerSchemaGraph, SchemaGraphEdge, SchemaGraphEdgeRelation, SchemaGraphNode, SchemaGraphNodeId, SchemaGraphNodeKind } from "@manifesto-ai/compiler";
2
3
  import type { CanonicalPlatformNamespaces, CanonicalSnapshot, Snapshot } from "./snapshot-projection.js";
3
4
  type ActionFn = {
4
5
  bivarianceHack(...args: unknown[]): unknown;
@@ -35,10 +36,12 @@ export type TypedActionRef<T extends ManifestoDomainShape, K extends keyof T["ac
35
36
  };
36
37
  export type FieldRef<TValue> = {
37
38
  readonly __kind: "FieldRef";
39
+ readonly name: string;
38
40
  readonly _type?: TValue;
39
41
  };
40
42
  export type ComputedRef<TValue> = {
41
43
  readonly __kind: "ComputedRef";
44
+ readonly name: string;
42
45
  readonly _type?: TValue;
43
46
  };
44
47
  export type TypedMEL<T extends ManifestoDomainShape> = {
@@ -67,6 +70,21 @@ export type TypedIntent<T extends ManifestoDomainShape, K extends keyof T["actio
67
70
  export type TypedCreateIntent<T extends ManifestoDomainShape> = <K extends keyof T["actions"]>(action: TypedActionRef<T, K>, ...args: CreateIntentArgs<T, K>) => TypedIntent<T, K>;
68
71
  export type TypedDispatchAsync<T extends ManifestoDomainShape> = (intent: TypedIntent<T>) => Promise<Snapshot<T["state"]>>;
69
72
  export type TypedCommitAsync<T extends ManifestoDomainShape> = TypedDispatchAsync<T>;
73
+ export type SchemaGraphNodeRef = TypedActionRef<ManifestoDomainShape> | FieldRef<unknown> | ComputedRef<unknown>;
74
+ export type SchemaGraph = CompilerSchemaGraph & {
75
+ traceUp(ref: SchemaGraphNodeRef): SchemaGraph;
76
+ traceUp(nodeId: SchemaGraphNodeId): SchemaGraph;
77
+ traceDown(ref: SchemaGraphNodeRef): SchemaGraph;
78
+ traceDown(nodeId: SchemaGraphNodeId): SchemaGraph;
79
+ };
80
+ export type SimulateResult<T extends ManifestoDomainShape = ManifestoDomainShape> = {
81
+ readonly snapshot: Snapshot<T["state"]>;
82
+ readonly changedPaths: readonly string[];
83
+ readonly newAvailableActions: readonly (keyof T["actions"])[];
84
+ readonly requirements: readonly Requirement[];
85
+ readonly status: ComputeStatus;
86
+ };
87
+ export type TypedSimulate<T extends ManifestoDomainShape> = <K extends keyof T["actions"]>(action: TypedActionRef<T, K>, ...args: CreateIntentArgs<T, K>) => SimulateResult<T>;
70
88
  export type TypedSubscribe<T extends ManifestoDomainShape> = <R>(selector: Selector<T["state"], R>, listener: (value: R) => void) => Unsubscribe;
71
89
  export type TypedActionMetadata<T extends ManifestoDomainShape, K extends keyof T["actions"] = keyof T["actions"]> = {
72
90
  readonly name: K;
@@ -109,6 +127,8 @@ export type ManifestoBaseInstance<T extends ManifestoDomainShape> = {
109
127
  readonly getAvailableActions: () => readonly (keyof T["actions"])[];
110
128
  readonly getActionMetadata: TypedGetActionMetadata<T>;
111
129
  readonly isActionAvailable: (name: keyof T["actions"]) => boolean;
130
+ readonly getSchemaGraph: () => SchemaGraph;
131
+ readonly simulate: TypedSimulate<T>;
112
132
  readonly MEL: TypedMEL<T>;
113
133
  readonly schema: DomainSchema;
114
134
  readonly dispose: () => void;
@@ -124,7 +144,7 @@ export type ActivatedInstance<T extends ManifestoDomainShape, Laws> = Laws exten
124
144
  } ? Runtime : never : Laws extends LineageLaws ? ResolvedManifestoRuntimeByLaws<T> extends {
125
145
  readonly lineage: infer Runtime;
126
146
  } ? Runtime : never : ManifestoRuntimeByLaws<T>["base"];
127
- export type { CanonicalPlatformNamespaces, CanonicalSnapshot, Snapshot, };
147
+ export type { CanonicalPlatformNamespaces, CanonicalSnapshot, Snapshot, SchemaGraphEdge, SchemaGraphEdgeRelation, SchemaGraphNode, SchemaGraphNodeId, SchemaGraphNodeKind, };
128
148
  export type ComposableManifesto<T extends ManifestoDomainShape, Laws extends BaseLaws = BaseComposableLaws> = {
129
149
  readonly _laws: Laws;
130
150
  readonly schema: DomainSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifesto-ai/sdk",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "description": "Manifesto SDK - Activation-first public API for the base runtime",
5
5
  "author": "eggplantiny <eggplantiny@gmail.com>",
6
6
  "license": "MIT",
@@ -39,9 +39,9 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@manifesto-ai/compiler": "3.1.1",
43
- "@manifesto-ai/core": "2.9.0",
44
- "@manifesto-ai/host": "2.6.0"
42
+ "@manifesto-ai/compiler": "3.2.0",
43
+ "@manifesto-ai/core": "2.10.0",
44
+ "@manifesto-ai/host": "2.7.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "typescript": "^5.9.3",