@manifesto-ai/core 0.3.0 → 1.3.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.
- package/README.md +148 -498
- package/dist/__tests__/apply.test.d.ts +2 -0
- package/dist/__tests__/apply.test.d.ts.map +1 -0
- package/dist/__tests__/apply.test.js +144 -0
- package/dist/__tests__/apply.test.js.map +1 -0
- package/dist/__tests__/jcs.test.d.ts +2 -0
- package/dist/__tests__/jcs.test.d.ts.map +1 -0
- package/dist/__tests__/jcs.test.js +45 -0
- package/dist/__tests__/jcs.test.js.map +1 -0
- package/dist/core/apply.d.ts +17 -0
- package/dist/core/apply.d.ts.map +1 -0
- package/dist/core/apply.js +130 -0
- package/dist/core/apply.js.map +1 -0
- package/dist/core/compute.d.ts +17 -0
- package/dist/core/compute.d.ts.map +1 -0
- package/dist/core/compute.js +287 -0
- package/dist/core/compute.js.map +1 -0
- package/dist/core/compute.test.d.ts +2 -0
- package/dist/core/compute.test.d.ts.map +1 -0
- package/dist/core/compute.test.js +633 -0
- package/dist/core/compute.test.js.map +1 -0
- package/dist/core/explain.d.ts +14 -0
- package/dist/core/explain.d.ts.map +1 -0
- package/dist/core/explain.js +78 -0
- package/dist/core/explain.js.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/validate.d.ts +16 -0
- package/dist/core/validate.d.ts.map +1 -0
- package/dist/core/validate.js +361 -0
- package/dist/core/validate.js.map +1 -0
- package/dist/core/validate.test.d.ts +2 -0
- package/dist/core/validate.test.d.ts.map +1 -0
- package/dist/core/validate.test.js +638 -0
- package/dist/core/validate.test.js.map +1 -0
- package/dist/core/validation-utils.d.ts +20 -0
- package/dist/core/validation-utils.d.ts.map +1 -0
- package/dist/core/validation-utils.js +289 -0
- package/dist/core/validation-utils.js.map +1 -0
- package/dist/errors.d.ts +30 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +51 -0
- package/dist/errors.js.map +1 -0
- package/dist/evaluator/computed.d.ts +14 -0
- package/dist/evaluator/computed.d.ts.map +1 -0
- package/dist/evaluator/computed.js +60 -0
- package/dist/evaluator/computed.js.map +1 -0
- package/dist/evaluator/context.d.ts +59 -0
- package/dist/evaluator/context.d.ts.map +1 -0
- package/dist/evaluator/context.js +41 -0
- package/dist/evaluator/context.js.map +1 -0
- package/dist/evaluator/dag.d.ts +30 -0
- package/dist/evaluator/dag.d.ts.map +1 -0
- package/dist/evaluator/dag.js +121 -0
- package/dist/evaluator/dag.js.map +1 -0
- package/dist/evaluator/expr.d.ts +11 -0
- package/dist/evaluator/expr.d.ts.map +1 -0
- package/dist/evaluator/expr.js +649 -0
- package/dist/evaluator/expr.js.map +1 -0
- package/dist/evaluator/expr.test.d.ts +2 -0
- package/dist/evaluator/expr.test.d.ts.map +1 -0
- package/dist/evaluator/expr.test.js +449 -0
- package/dist/evaluator/expr.test.js.map +1 -0
- package/dist/evaluator/flow.d.ts +35 -0
- package/dist/evaluator/flow.d.ts.map +1 -0
- package/dist/evaluator/flow.js +387 -0
- package/dist/evaluator/flow.js.map +1 -0
- package/dist/evaluator/flow.test.d.ts +2 -0
- package/dist/evaluator/flow.test.d.ts.map +1 -0
- package/dist/evaluator/flow.test.js +499 -0
- package/dist/evaluator/flow.test.js.map +1 -0
- package/dist/evaluator/index.d.ts +6 -0
- package/dist/evaluator/index.d.ts.map +1 -0
- package/dist/evaluator/index.js +6 -0
- package/dist/evaluator/index.js.map +1 -0
- package/dist/factories.d.ts +22 -0
- package/dist/factories.d.ts.map +1 -0
- package/dist/factories.js +44 -0
- package/dist/factories.js.map +1 -0
- package/dist/index.d.ts +47 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -45
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +13 -0
- package/dist/index.test.js.map +1 -0
- package/dist/schema/action.d.ts +14 -0
- package/dist/schema/action.d.ts.map +1 -0
- package/dist/schema/action.js +30 -0
- package/dist/schema/action.js.map +1 -0
- package/dist/schema/common.d.ts +37 -0
- package/dist/schema/common.d.ts.map +1 -0
- package/dist/schema/common.js +20 -0
- package/dist/schema/common.js.map +1 -0
- package/dist/schema/computed.d.ts +23 -0
- package/dist/schema/computed.d.ts.map +1 -0
- package/dist/schema/computed.js +34 -0
- package/dist/schema/computed.js.map +1 -0
- package/dist/schema/domain.d.ts +50 -0
- package/dist/schema/domain.d.ts.map +1 -0
- package/dist/schema/domain.js +60 -0
- package/dist/schema/domain.js.map +1 -0
- package/dist/schema/expr.d.ts +303 -0
- package/dist/schema/expr.d.ts.map +1 -0
- package/dist/schema/expr.js +283 -0
- package/dist/schema/expr.js.map +1 -0
- package/dist/schema/field.d.ts +48 -0
- package/dist/schema/field.d.ts.map +1 -0
- package/dist/schema/field.js +31 -0
- package/dist/schema/field.js.map +1 -0
- package/dist/schema/flow.d.ts +103 -0
- package/dist/schema/flow.d.ts.map +1 -0
- package/dist/schema/flow.js +82 -0
- package/dist/schema/flow.js.map +1 -0
- package/dist/schema/host-context.d.ts +12 -0
- package/dist/schema/host-context.d.ts.map +1 -0
- package/dist/schema/host-context.js +23 -0
- package/dist/schema/host-context.js.map +1 -0
- package/dist/schema/index.d.ts +13 -2
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +25 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/patch.d.ts +59 -0
- package/dist/schema/patch.d.ts.map +1 -0
- package/dist/schema/patch.js +60 -0
- package/dist/schema/patch.js.map +1 -0
- package/dist/schema/result.d.ts +142 -0
- package/dist/schema/result.d.ts.map +1 -0
- package/dist/schema/result.js +94 -0
- package/dist/schema/result.js.map +1 -0
- package/dist/schema/snapshot.d.ts +153 -0
- package/dist/schema/snapshot.d.ts.map +1 -0
- package/dist/schema/snapshot.js +160 -0
- package/dist/schema/snapshot.js.map +1 -0
- package/dist/schema/trace.d.ts +98 -0
- package/dist/schema/trace.d.ts.map +1 -0
- package/dist/schema/trace.js +90 -0
- package/dist/schema/trace.js.map +1 -0
- package/dist/schema/type-spec.d.ts +34 -0
- package/dist/schema/type-spec.d.ts.map +1 -0
- package/dist/schema/type-spec.js +40 -0
- package/dist/schema/type-spec.js.map +1 -0
- package/dist/utils/canonical.d.ts +37 -0
- package/dist/utils/canonical.d.ts.map +1 -0
- package/dist/utils/canonical.js +122 -0
- package/dist/utils/canonical.js.map +1 -0
- package/dist/utils/canonical.test.d.ts +2 -0
- package/dist/utils/canonical.test.d.ts.map +1 -0
- package/dist/utils/canonical.test.js +183 -0
- package/dist/utils/canonical.test.js.map +1 -0
- package/dist/utils/hash.d.ts +28 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +152 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/hash.test.d.ts +2 -0
- package/dist/utils/hash.test.d.ts.map +1 -0
- package/dist/utils/hash.test.js +170 -0
- package/dist/utils/hash.test.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/path.d.ts +40 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +132 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/path.test.d.ts +2 -0
- package/dist/utils/path.test.d.ts.map +1 -0
- package/dist/utils/path.test.js +191 -0
- package/dist/utils/path.test.js.map +1 -0
- package/package.json +28 -41
- package/LICENSE +0 -21
- package/dist/dag/graph.d.ts +0 -62
- package/dist/dag/graph.d.ts.map +0 -1
- package/dist/dag/graph.js +0 -244
- package/dist/dag/graph.js.map +0 -1
- package/dist/dag/index.d.ts +0 -4
- package/dist/dag/index.d.ts.map +0 -1
- package/dist/dag/index.js +0 -4
- package/dist/dag/index.js.map +0 -1
- package/dist/dag/propagation.d.ts +0 -58
- package/dist/dag/propagation.d.ts.map +0 -1
- package/dist/dag/propagation.js +0 -224
- package/dist/dag/propagation.js.map +0 -1
- package/dist/dag/topological.d.ts +0 -33
- package/dist/dag/topological.d.ts.map +0 -1
- package/dist/dag/topological.js +0 -173
- package/dist/dag/topological.js.map +0 -1
- package/dist/domain/define.d.ts +0 -82
- package/dist/domain/define.d.ts.map +0 -1
- package/dist/domain/define.js +0 -105
- package/dist/domain/define.js.map +0 -1
- package/dist/domain/index.d.ts +0 -4
- package/dist/domain/index.d.ts.map +0 -1
- package/dist/domain/index.js +0 -4
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/types.d.ts +0 -203
- package/dist/domain/types.d.ts.map +0 -1
- package/dist/domain/types.js +0 -2
- package/dist/domain/types.js.map +0 -1
- package/dist/domain/validate.d.ts +0 -17
- package/dist/domain/validate.d.ts.map +0 -1
- package/dist/domain/validate.js +0 -204
- package/dist/domain/validate.js.map +0 -1
- package/dist/effect/index.d.ts +0 -4
- package/dist/effect/index.d.ts.map +0 -1
- package/dist/effect/index.js +0 -4
- package/dist/effect/index.js.map +0 -1
- package/dist/effect/result.d.ts +0 -100
- package/dist/effect/result.d.ts.map +0 -1
- package/dist/effect/result.js +0 -163
- package/dist/effect/result.js.map +0 -1
- package/dist/effect/runner.d.ts +0 -98
- package/dist/effect/runner.d.ts.map +0 -1
- package/dist/effect/runner.js +0 -321
- package/dist/effect/runner.js.map +0 -1
- package/dist/effect/types.d.ts +0 -169
- package/dist/effect/types.d.ts.map +0 -1
- package/dist/effect/types.js +0 -28
- package/dist/effect/types.js.map +0 -1
- package/dist/expression/analyzer.d.ts +0 -42
- package/dist/expression/analyzer.d.ts.map +0 -1
- package/dist/expression/analyzer.js +0 -166
- package/dist/expression/analyzer.js.map +0 -1
- package/dist/expression/evaluator.d.ts +0 -16
- package/dist/expression/evaluator.d.ts.map +0 -1
- package/dist/expression/evaluator.js +0 -382
- package/dist/expression/evaluator.js.map +0 -1
- package/dist/expression/index.d.ts +0 -5
- package/dist/expression/index.d.ts.map +0 -1
- package/dist/expression/index.js +0 -5
- package/dist/expression/index.js.map +0 -1
- package/dist/expression/parser.d.ts +0 -37
- package/dist/expression/parser.d.ts.map +0 -1
- package/dist/expression/parser.js +0 -201
- package/dist/expression/parser.js.map +0 -1
- package/dist/expression/types.d.ts +0 -123
- package/dist/expression/types.d.ts.map +0 -1
- package/dist/expression/types.js +0 -10
- package/dist/expression/types.js.map +0 -1
- package/dist/policy/field-policy.d.ts +0 -63
- package/dist/policy/field-policy.d.ts.map +0 -1
- package/dist/policy/field-policy.js +0 -138
- package/dist/policy/field-policy.js.map +0 -1
- package/dist/policy/index.d.ts +0 -3
- package/dist/policy/index.d.ts.map +0 -1
- package/dist/policy/index.js +0 -3
- package/dist/policy/index.js.map +0 -1
- package/dist/policy/precondition.d.ts +0 -58
- package/dist/policy/precondition.d.ts.map +0 -1
- package/dist/policy/precondition.js +0 -115
- package/dist/policy/precondition.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -4
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -4
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/runtime.d.ts +0 -94
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js +0 -294
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/snapshot.d.ts +0 -39
- package/dist/runtime/snapshot.d.ts.map +0 -1
- package/dist/runtime/snapshot.js +0 -264
- package/dist/runtime/snapshot.js.map +0 -1
- package/dist/runtime/subscription.d.ts +0 -82
- package/dist/runtime/subscription.d.ts.map +0 -1
- package/dist/runtime/subscription.js +0 -222
- package/dist/runtime/subscription.js.map +0 -1
- package/dist/schema/integration.d.ts +0 -89
- package/dist/schema/integration.d.ts.map +0 -1
- package/dist/schema/integration.js +0 -171
- package/dist/schema/integration.js.map +0 -1
- package/dist/schema/validation.d.ts +0 -51
- package/dist/schema/validation.d.ts.map +0 -1
- package/dist/schema/validation.js +0 -212
- package/dist/schema/validation.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @manifesto-ai/core
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Manifesto Core - A Pure Semantic Calculator for Domain State
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* AI Agent가 UI를 이해하고 안전하게 조작할 수 있게 하는 AI Native Semantic Layer입니다.
|
|
6
|
+
* Core computes. Host executes. These concerns never mix.
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
import type { DomainSchema } from "./schema/domain.js";
|
|
9
|
+
import type { Snapshot } from "./schema/snapshot.js";
|
|
10
|
+
import type { Intent, Patch } from "./schema/patch.js";
|
|
11
|
+
import type { SemanticPath } from "./schema/common.js";
|
|
12
|
+
import type { ComputeResult, ValidationResult, ExplainResult } from "./schema/result.js";
|
|
13
|
+
import type { HostContext } from "./schema/host-context.js";
|
|
14
|
+
import { compute } from "./core/compute.js";
|
|
15
|
+
import { apply } from "./core/apply.js";
|
|
16
|
+
import { validate } from "./core/validate.js";
|
|
17
|
+
import { explain } from "./core/explain.js";
|
|
18
|
+
/**
|
|
19
|
+
* ManifestoCore interface
|
|
20
|
+
*/
|
|
21
|
+
export interface ManifestoCore {
|
|
22
|
+
/**
|
|
23
|
+
* Compute the result of dispatching an intent.
|
|
24
|
+
*
|
|
25
|
+
* This is the ONLY entry point for computation.
|
|
26
|
+
* Each call is independent - there is no suspended context.
|
|
27
|
+
*/
|
|
28
|
+
compute(schema: DomainSchema, snapshot: Snapshot, intent: Intent, context: HostContext): Promise<ComputeResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Apply patches to a snapshot.
|
|
31
|
+
* Returns new snapshot with recomputed values.
|
|
32
|
+
*/
|
|
33
|
+
apply(schema: DomainSchema, snapshot: Snapshot, patches: readonly Patch[], context: HostContext): Snapshot;
|
|
34
|
+
/**
|
|
35
|
+
* Validate a schema.
|
|
36
|
+
*/
|
|
37
|
+
validate(schema: unknown): ValidationResult;
|
|
38
|
+
/**
|
|
39
|
+
* Explain why a value is what it is.
|
|
40
|
+
*/
|
|
41
|
+
explain(schema: DomainSchema, snapshot: Snapshot, path: SemanticPath): ExplainResult;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create a ManifestoCore instance
|
|
45
|
+
*/
|
|
46
|
+
export declare function createCore(): ManifestoCore;
|
|
47
|
+
export * from "./schema/index.js";
|
|
48
|
+
export * from "./utils/index.js";
|
|
49
|
+
export * from "./evaluator/index.js";
|
|
50
|
+
export * from "./errors.js";
|
|
51
|
+
export * from "./factories.js";
|
|
52
|
+
export { compute, apply, validate, explain };
|
|
17
53
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,OAAO,CACL,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,CAAC,CAAC;IAE1B;;;OAGG;IACH,KAAK,CACH,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,WAAW,GACnB,QAAQ,CAAC;IAEZ;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB,CAAC;IAE5C;;OAEG;IACH,OAAO,CACL,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,YAAY,GACjB,aAAa,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,aAAa,CAO1C;AAKD,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,51 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @manifesto-ai/core
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Manifesto Core - A Pure Semantic Calculator for Domain State
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* AI Agent가 UI를 이해하고 안전하게 조작할 수 있게 하는 AI Native Semantic Layer입니다.
|
|
6
|
+
* Core computes. Host executes. These concerns never mix.
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
export
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
export {
|
|
37
|
-
// Policy - 정책 평가
|
|
38
|
-
export {
|
|
39
|
-
// Precondition
|
|
40
|
-
evaluatePrecondition, evaluateAllPreconditions, checkActionAvailability, extractPreconditionDependencies, analyzePreconditionRequirements,
|
|
41
|
-
// Field Policy
|
|
42
|
-
evaluateFieldPolicy, policyToUIState, extractFieldPolicyDependencies, evaluateMultipleFieldPolicies, explainFieldPolicy, } from './policy/index.js';
|
|
43
|
-
// Schema - Zod 통합
|
|
44
|
-
export {
|
|
45
|
-
// Integration
|
|
46
|
-
schemaToSource, CommonSchemas, SchemaUtils, getSchemaDefault, getSchemaMetadata, toJsonSchema,
|
|
47
|
-
// Validation
|
|
48
|
-
zodErrorToValidationResult, validateValue, validatePartial, validateDomainData, validateFields, validateAsync, mergeValidationResults, groupValidationByPath, filterBySeverity, getErrors, getWarnings, getSuggestions, } from './schema/index.js';
|
|
49
|
-
// Re-export Zod for convenience
|
|
50
|
-
export { z } from 'zod';
|
|
8
|
+
import { compute } from "./core/compute.js";
|
|
9
|
+
import { apply } from "./core/apply.js";
|
|
10
|
+
import { validate } from "./core/validate.js";
|
|
11
|
+
import { explain } from "./core/explain.js";
|
|
12
|
+
/**
|
|
13
|
+
* Create a ManifestoCore instance
|
|
14
|
+
*/
|
|
15
|
+
export function createCore() {
|
|
16
|
+
return {
|
|
17
|
+
compute,
|
|
18
|
+
apply,
|
|
19
|
+
validate,
|
|
20
|
+
explain,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// ============ Re-exports ============
|
|
24
|
+
// Schema types
|
|
25
|
+
export * from "./schema/index.js";
|
|
26
|
+
// Utilities
|
|
27
|
+
export * from "./utils/index.js";
|
|
28
|
+
// Evaluators (for advanced usage)
|
|
29
|
+
export * from "./evaluator/index.js";
|
|
30
|
+
// Errors
|
|
31
|
+
export * from "./errors.js";
|
|
32
|
+
// Factories
|
|
33
|
+
export * from "./factories.js";
|
|
34
|
+
// Core functions (for direct usage)
|
|
35
|
+
export { compute, apply, validate, explain };
|
|
51
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AA6C5C;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO;QACL,OAAO;QACP,KAAK;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED,uCAAuC;AAEvC,eAAe;AACf,cAAc,mBAAmB,CAAC;AAElC,YAAY;AACZ,cAAc,kBAAkB,CAAC;AAEjC,kCAAkC;AAClC,cAAc,sBAAsB,CAAC;AAErC,SAAS;AACT,cAAc,aAAa,CAAC;AAE5B,YAAY;AACZ,cAAc,gBAAgB,CAAC;AAE/B,oCAAoC;AACpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { createCore } from "./index.js";
|
|
3
|
+
describe("core", () => {
|
|
4
|
+
it("should create a ManifestoCore instance", () => {
|
|
5
|
+
const core = createCore();
|
|
6
|
+
expect(core).toBeDefined();
|
|
7
|
+
expect(core.compute).toBeInstanceOf(Function);
|
|
8
|
+
expect(core.apply).toBeInstanceOf(Function);
|
|
9
|
+
expect(core.validate).toBeInstanceOf(Function);
|
|
10
|
+
expect(core.explain).toBeInstanceOf(Function);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;QAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FieldSpec } from "./field.js";
|
|
3
|
+
/**
|
|
4
|
+
* ActionSpec - Maps intents to flows
|
|
5
|
+
* An action defines what happens when a particular intent is dispatched.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ActionSpec: z.ZodObject<{
|
|
8
|
+
flow: z.ZodType<import("./flow.js").FlowNode, unknown, z.core.$ZodTypeInternals<import("./flow.js").FlowNode, unknown>>;
|
|
9
|
+
input: z.ZodOptional<z.ZodType<FieldSpec, unknown, z.core.$ZodTypeInternals<FieldSpec, unknown>>>;
|
|
10
|
+
available: z.ZodOptional<z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>>;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type ActionSpec = z.infer<typeof ActionSpec>;
|
|
14
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/schema/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;iBAuBrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { FieldSpec } from "./field.js";
|
|
3
|
+
import { ExprNodeSchema } from "./expr.js";
|
|
4
|
+
import { FlowNodeSchema } from "./flow.js";
|
|
5
|
+
/**
|
|
6
|
+
* ActionSpec - Maps intents to flows
|
|
7
|
+
* An action defines what happens when a particular intent is dispatched.
|
|
8
|
+
*/
|
|
9
|
+
export const ActionSpec = z.object({
|
|
10
|
+
/**
|
|
11
|
+
* The flow to execute when this action is invoked
|
|
12
|
+
*/
|
|
13
|
+
flow: FlowNodeSchema,
|
|
14
|
+
/**
|
|
15
|
+
* Input schema for validation.
|
|
16
|
+
* If defined, Core MUST validate input against this schema.
|
|
17
|
+
*/
|
|
18
|
+
input: FieldSpec.optional(),
|
|
19
|
+
/**
|
|
20
|
+
* Availability condition.
|
|
21
|
+
* If defined, Core MUST check it before executing the flow.
|
|
22
|
+
* Expression MUST return boolean.
|
|
23
|
+
*/
|
|
24
|
+
available: ExprNodeSchema.optional(),
|
|
25
|
+
/**
|
|
26
|
+
* Human-readable description
|
|
27
|
+
*/
|
|
28
|
+
description: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/schema/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC;;OAEG;IACH,IAAI,EAAE,cAAc;IAEpB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE;IAE3B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE;IAEpC;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Dot-separated path for accessing values (e.g., "user.profile.name")
|
|
4
|
+
*/
|
|
5
|
+
export declare const SemanticPath: z.ZodString;
|
|
6
|
+
export type SemanticPath = z.infer<typeof SemanticPath>;
|
|
7
|
+
/**
|
|
8
|
+
* Result type for functions that can fail without throwing
|
|
9
|
+
*/
|
|
10
|
+
export declare const Result: <T extends z.ZodTypeAny, E extends z.ZodTypeAny>(valueSchema: T, errorSchema: E) => z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
ok: z.ZodLiteral<true>;
|
|
12
|
+
value: T;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
ok: z.ZodLiteral<false>;
|
|
15
|
+
error: E;
|
|
16
|
+
}, z.core.$strip>], "ok">;
|
|
17
|
+
export type Result<T, E> = {
|
|
18
|
+
ok: true;
|
|
19
|
+
value: T;
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
22
|
+
error: E;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Helper functions for Result type
|
|
26
|
+
*/
|
|
27
|
+
export declare const ok: <T>(value: T) => Result<T, never>;
|
|
28
|
+
export declare const err: <E>(error: E) => Result<never, E>;
|
|
29
|
+
export declare const isOk: <T, E>(result: Result<T, E>) => result is {
|
|
30
|
+
ok: true;
|
|
31
|
+
value: T;
|
|
32
|
+
};
|
|
33
|
+
export declare const isErr: <T, E>(result: Result<T, E>) => result is {
|
|
34
|
+
ok: false;
|
|
35
|
+
error: E;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/schema/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC,UAAU,EACnE,aAAa,CAAC,EACd,aAAa,CAAC;;;;;;yBAKZ,CAAC;AAEL,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,IACnB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,EAAE,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAA0B,CAAC;AAC3E,eAAO,MAAM,GAAG,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAA2B,CAAC;AAE7E,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,MAAM,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CACrE,CAAC;AAEZ,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAG,MAAM,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CACtE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Dot-separated path for accessing values (e.g., "user.profile.name")
|
|
4
|
+
*/
|
|
5
|
+
export const SemanticPath = z.string().min(1);
|
|
6
|
+
/**
|
|
7
|
+
* Result type for functions that can fail without throwing
|
|
8
|
+
*/
|
|
9
|
+
export const Result = (valueSchema, errorSchema) => z.discriminatedUnion("ok", [
|
|
10
|
+
z.object({ ok: z.literal(true), value: valueSchema }),
|
|
11
|
+
z.object({ ok: z.literal(false), error: errorSchema }),
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* Helper functions for Result type
|
|
15
|
+
*/
|
|
16
|
+
export const ok = (value) => ({ ok: true, value });
|
|
17
|
+
export const err = (error) => ({ ok: false, error });
|
|
18
|
+
export const isOk = (result) => result.ok;
|
|
19
|
+
export const isErr = (result) => !result.ok;
|
|
20
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/schema/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAG9C;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,WAAc,EACd,WAAc,EACd,EAAE,CACF,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE;IACzB,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IACrD,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;CACvD,CAAC,CAAC;AAML;;GAEG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAI,KAAQ,EAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,GAAG,GAAG,CAAI,KAAQ,EAAoB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAE7E,MAAM,CAAC,MAAM,IAAI,GAAG,CAAO,MAAoB,EAAoC,EAAE,CACnF,MAAM,CAAC,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,KAAK,GAAG,CAAO,MAAoB,EAAqC,EAAE,CACrF,CAAC,MAAM,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* ComputedFieldSpec - Definition of a single computed field
|
|
4
|
+
*/
|
|
5
|
+
export declare const ComputedFieldSpec: z.ZodObject<{
|
|
6
|
+
deps: z.ZodArray<z.ZodString>;
|
|
7
|
+
expr: z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type ComputedFieldSpec = z.infer<typeof ComputedFieldSpec>;
|
|
11
|
+
/**
|
|
12
|
+
* ComputedSpec - Collection of computed field definitions
|
|
13
|
+
* Computed values form a Directed Acyclic Graph (DAG).
|
|
14
|
+
*/
|
|
15
|
+
export declare const ComputedSpec: z.ZodObject<{
|
|
16
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
17
|
+
deps: z.ZodArray<z.ZodString>;
|
|
18
|
+
expr: z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type ComputedSpec = z.infer<typeof ComputedSpec>;
|
|
23
|
+
//# sourceMappingURL=computed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computed.d.ts","sourceRoot":"","sources":["../../src/schema/computed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;iBAiB5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;iBAMvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SemanticPath } from "./common.js";
|
|
3
|
+
import { ExprNodeSchema } from "./expr.js";
|
|
4
|
+
/**
|
|
5
|
+
* ComputedFieldSpec - Definition of a single computed field
|
|
6
|
+
*/
|
|
7
|
+
export const ComputedFieldSpec = z.object({
|
|
8
|
+
/**
|
|
9
|
+
* Paths this computed value depends on.
|
|
10
|
+
* Must accurately reflect all paths referenced in expr.
|
|
11
|
+
*/
|
|
12
|
+
deps: z.array(SemanticPath),
|
|
13
|
+
/**
|
|
14
|
+
* Expression to compute the value.
|
|
15
|
+
* Must be pure and total (always produce a value, never throw).
|
|
16
|
+
*/
|
|
17
|
+
expr: ExprNodeSchema,
|
|
18
|
+
/**
|
|
19
|
+
* Human-readable description
|
|
20
|
+
*/
|
|
21
|
+
description: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* ComputedSpec - Collection of computed field definitions
|
|
25
|
+
* Computed values form a Directed Acyclic Graph (DAG).
|
|
26
|
+
*/
|
|
27
|
+
export const ComputedSpec = z.object({
|
|
28
|
+
/**
|
|
29
|
+
* Computed field definitions keyed by their semantic path.
|
|
30
|
+
* Paths typically start with "computed." prefix.
|
|
31
|
+
*/
|
|
32
|
+
fields: z.record(SemanticPath, ComputedFieldSpec),
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=computed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computed.js","sourceRoot":"","sources":["../../src/schema/computed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC;;;OAGG;IACH,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;IAE3B;;;OAGG;IACH,IAAI,EAAE,cAAc;IAEpB;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schema metadata
|
|
4
|
+
*/
|
|
5
|
+
export declare const SchemaMeta: z.ZodObject<{
|
|
6
|
+
name: z.ZodOptional<z.ZodString>;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type SchemaMeta = z.infer<typeof SchemaMeta>;
|
|
11
|
+
/**
|
|
12
|
+
* DomainSchema - Complete schema definition
|
|
13
|
+
*
|
|
14
|
+
* Defines:
|
|
15
|
+
* - What the domain looks like (StateSpec)
|
|
16
|
+
* - What can be derived (ComputedSpec)
|
|
17
|
+
* - How state transitions occur (Actions → FlowSpec)
|
|
18
|
+
*/
|
|
19
|
+
export declare const DomainSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
version: z.ZodString;
|
|
22
|
+
hash: z.ZodString;
|
|
23
|
+
types: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
definition: z.ZodType<import("./type-spec.js").TypeDefinition, unknown, z.core.$ZodTypeInternals<import("./type-spec.js").TypeDefinition, unknown>>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
state: z.ZodObject<{
|
|
28
|
+
fields: z.ZodRecord<z.ZodString, z.ZodType<import("./field.js").FieldSpec, unknown, z.core.$ZodTypeInternals<import("./field.js").FieldSpec, unknown>>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
computed: z.ZodObject<{
|
|
31
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
32
|
+
deps: z.ZodArray<z.ZodString>;
|
|
33
|
+
expr: z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>;
|
|
34
|
+
description: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
actions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
38
|
+
flow: z.ZodType<import("./flow.js").FlowNode, unknown, z.core.$ZodTypeInternals<import("./flow.js").FlowNode, unknown>>;
|
|
39
|
+
input: z.ZodOptional<z.ZodType<import("./field.js").FieldSpec, unknown, z.core.$ZodTypeInternals<import("./field.js").FieldSpec, unknown>>>;
|
|
40
|
+
available: z.ZodOptional<z.ZodType<import("./expr.js").ExprNode, unknown, z.core.$ZodTypeInternals<import("./expr.js").ExprNode, unknown>>>;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
description: z.ZodOptional<z.ZodString>;
|
|
46
|
+
authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type DomainSchema = z.infer<typeof DomainSchema>;
|
|
50
|
+
//# sourceMappingURL=domain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/schema/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,UAAU;;;;iBAIrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4CvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { StateSpec } from "./field.js";
|
|
3
|
+
import { ComputedSpec } from "./computed.js";
|
|
4
|
+
import { ActionSpec } from "./action.js";
|
|
5
|
+
import { TypeSpec } from "./type-spec.js";
|
|
6
|
+
/**
|
|
7
|
+
* Schema metadata
|
|
8
|
+
*/
|
|
9
|
+
export const SchemaMeta = z.object({
|
|
10
|
+
name: z.string().optional(),
|
|
11
|
+
description: z.string().optional(),
|
|
12
|
+
authors: z.array(z.string()).optional(),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* DomainSchema - Complete schema definition
|
|
16
|
+
*
|
|
17
|
+
* Defines:
|
|
18
|
+
* - What the domain looks like (StateSpec)
|
|
19
|
+
* - What can be derived (ComputedSpec)
|
|
20
|
+
* - How state transitions occur (Actions → FlowSpec)
|
|
21
|
+
*/
|
|
22
|
+
export const DomainSchema = z.object({
|
|
23
|
+
/**
|
|
24
|
+
* Unique identifier for this schema.
|
|
25
|
+
* MUST be a valid URI or UUID.
|
|
26
|
+
*/
|
|
27
|
+
id: z.string(),
|
|
28
|
+
/**
|
|
29
|
+
* Semantic version.
|
|
30
|
+
* MUST follow Semantic Versioning 2.0.
|
|
31
|
+
*/
|
|
32
|
+
version: z.string(),
|
|
33
|
+
/**
|
|
34
|
+
* Content hash for integrity verification.
|
|
35
|
+
* MUST be computed using the Canonical Form algorithm.
|
|
36
|
+
*/
|
|
37
|
+
hash: z.string(),
|
|
38
|
+
/**
|
|
39
|
+
* Named type declarations (compiler v0.3.3).
|
|
40
|
+
* Pure metadata; Core does not interpret these.
|
|
41
|
+
*/
|
|
42
|
+
types: z.record(z.string(), TypeSpec),
|
|
43
|
+
/**
|
|
44
|
+
* State structure definition
|
|
45
|
+
*/
|
|
46
|
+
state: StateSpec,
|
|
47
|
+
/**
|
|
48
|
+
* Computed values (DAG)
|
|
49
|
+
*/
|
|
50
|
+
computed: ComputedSpec,
|
|
51
|
+
/**
|
|
52
|
+
* Intent-to-Flow mappings
|
|
53
|
+
*/
|
|
54
|
+
actions: z.record(z.string(), ActionSpec),
|
|
55
|
+
/**
|
|
56
|
+
* Schema metadata
|
|
57
|
+
*/
|
|
58
|
+
meta: SchemaMeta.optional(),
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../src/schema/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxC,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC;;;OAGG;IACH,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IAEd;;;OAGG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IAEnB;;;OAGG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAEhB;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC;IAErC;;OAEG;IACH,KAAK,EAAE,SAAS;IAEhB;;OAEG;IACH,QAAQ,EAAE,YAAY;IAEtB;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAEzC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC"}
|