@manifesto-ai/core 2.6.0 → 2.7.1

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 (182) hide show
  1. package/README.md +4 -4
  2. package/dist/index.d.ts +1750 -19
  3. package/dist/index.js +18480 -36
  4. package/dist/index.js.map +1 -1
  5. package/package.json +5 -3
  6. package/dist/__tests__/apply.test.d.ts +0 -2
  7. package/dist/__tests__/apply.test.d.ts.map +0 -1
  8. package/dist/__tests__/apply.test.js +0 -320
  9. package/dist/__tests__/apply.test.js.map +0 -1
  10. package/dist/__tests__/defaults.test.d.ts +0 -2
  11. package/dist/__tests__/defaults.test.d.ts.map +0 -1
  12. package/dist/__tests__/defaults.test.js +0 -74
  13. package/dist/__tests__/defaults.test.js.map +0 -1
  14. package/dist/__tests__/jcs.test.d.ts +0 -2
  15. package/dist/__tests__/jcs.test.d.ts.map +0 -1
  16. package/dist/__tests__/jcs.test.js +0 -45
  17. package/dist/__tests__/jcs.test.js.map +0 -1
  18. package/dist/core/apply.d.ts +0 -17
  19. package/dist/core/apply.d.ts.map +0 -1
  20. package/dist/core/apply.js +0 -198
  21. package/dist/core/apply.js.map +0 -1
  22. package/dist/core/compute.d.ts +0 -17
  23. package/dist/core/compute.d.ts.map +0 -1
  24. package/dist/core/compute.js +0 -305
  25. package/dist/core/compute.js.map +0 -1
  26. package/dist/core/compute.test.d.ts +0 -2
  27. package/dist/core/compute.test.d.ts.map +0 -1
  28. package/dist/core/compute.test.js +0 -950
  29. package/dist/core/compute.test.js.map +0 -1
  30. package/dist/core/explain.d.ts +0 -14
  31. package/dist/core/explain.d.ts.map +0 -1
  32. package/dist/core/explain.js +0 -78
  33. package/dist/core/explain.js.map +0 -1
  34. package/dist/core/index.d.ts +0 -5
  35. package/dist/core/index.d.ts.map +0 -1
  36. package/dist/core/index.js +0 -5
  37. package/dist/core/index.js.map +0 -1
  38. package/dist/core/validate.d.ts +0 -16
  39. package/dist/core/validate.d.ts.map +0 -1
  40. package/dist/core/validate.js +0 -361
  41. package/dist/core/validate.js.map +0 -1
  42. package/dist/core/validate.test.d.ts +0 -2
  43. package/dist/core/validate.test.d.ts.map +0 -1
  44. package/dist/core/validate.test.js +0 -719
  45. package/dist/core/validate.test.js.map +0 -1
  46. package/dist/core/validation-utils.d.ts +0 -20
  47. package/dist/core/validation-utils.d.ts.map +0 -1
  48. package/dist/core/validation-utils.js +0 -351
  49. package/dist/core/validation-utils.js.map +0 -1
  50. package/dist/errors.d.ts +0 -30
  51. package/dist/errors.d.ts.map +0 -1
  52. package/dist/errors.js +0 -51
  53. package/dist/errors.js.map +0 -1
  54. package/dist/evaluator/computed.d.ts +0 -14
  55. package/dist/evaluator/computed.d.ts.map +0 -1
  56. package/dist/evaluator/computed.js +0 -60
  57. package/dist/evaluator/computed.js.map +0 -1
  58. package/dist/evaluator/context.d.ts +0 -62
  59. package/dist/evaluator/context.d.ts.map +0 -1
  60. package/dist/evaluator/context.js +0 -44
  61. package/dist/evaluator/context.js.map +0 -1
  62. package/dist/evaluator/dag.d.ts +0 -30
  63. package/dist/evaluator/dag.d.ts.map +0 -1
  64. package/dist/evaluator/dag.js +0 -121
  65. package/dist/evaluator/dag.js.map +0 -1
  66. package/dist/evaluator/expr.d.ts +0 -11
  67. package/dist/evaluator/expr.d.ts.map +0 -1
  68. package/dist/evaluator/expr.js +0 -1030
  69. package/dist/evaluator/expr.js.map +0 -1
  70. package/dist/evaluator/expr.test.d.ts +0 -2
  71. package/dist/evaluator/expr.test.d.ts.map +0 -1
  72. package/dist/evaluator/expr.test.js +0 -1235
  73. package/dist/evaluator/expr.test.js.map +0 -1
  74. package/dist/evaluator/flow.d.ts +0 -36
  75. package/dist/evaluator/flow.d.ts.map +0 -1
  76. package/dist/evaluator/flow.js +0 -390
  77. package/dist/evaluator/flow.js.map +0 -1
  78. package/dist/evaluator/flow.test.d.ts +0 -2
  79. package/dist/evaluator/flow.test.d.ts.map +0 -1
  80. package/dist/evaluator/flow.test.js +0 -499
  81. package/dist/evaluator/flow.test.js.map +0 -1
  82. package/dist/evaluator/index.d.ts +0 -6
  83. package/dist/evaluator/index.d.ts.map +0 -1
  84. package/dist/evaluator/index.js +0 -6
  85. package/dist/evaluator/index.js.map +0 -1
  86. package/dist/factories.d.ts +0 -22
  87. package/dist/factories.d.ts.map +0 -1
  88. package/dist/factories.js +0 -44
  89. package/dist/factories.js.map +0 -1
  90. package/dist/index.d.ts.map +0 -1
  91. package/dist/index.test.d.ts +0 -2
  92. package/dist/index.test.d.ts.map +0 -1
  93. package/dist/index.test.js +0 -14
  94. package/dist/index.test.js.map +0 -1
  95. package/dist/schema/action.d.ts +0 -14
  96. package/dist/schema/action.d.ts.map +0 -1
  97. package/dist/schema/action.js +0 -30
  98. package/dist/schema/action.js.map +0 -1
  99. package/dist/schema/common.d.ts +0 -37
  100. package/dist/schema/common.d.ts.map +0 -1
  101. package/dist/schema/common.js +0 -20
  102. package/dist/schema/common.js.map +0 -1
  103. package/dist/schema/computed.d.ts +0 -23
  104. package/dist/schema/computed.d.ts.map +0 -1
  105. package/dist/schema/computed.js +0 -34
  106. package/dist/schema/computed.js.map +0 -1
  107. package/dist/schema/defaults.d.ts +0 -12
  108. package/dist/schema/defaults.d.ts.map +0 -1
  109. package/dist/schema/defaults.js +0 -19
  110. package/dist/schema/defaults.js.map +0 -1
  111. package/dist/schema/domain.d.ts +0 -50
  112. package/dist/schema/domain.d.ts.map +0 -1
  113. package/dist/schema/domain.js +0 -60
  114. package/dist/schema/domain.js.map +0 -1
  115. package/dist/schema/expr.d.ts +0 -483
  116. package/dist/schema/expr.d.ts.map +0 -1
  117. package/dist/schema/expr.js +0 -445
  118. package/dist/schema/expr.js.map +0 -1
  119. package/dist/schema/field.d.ts +0 -48
  120. package/dist/schema/field.d.ts.map +0 -1
  121. package/dist/schema/field.js +0 -31
  122. package/dist/schema/field.js.map +0 -1
  123. package/dist/schema/flow.d.ts +0 -103
  124. package/dist/schema/flow.d.ts.map +0 -1
  125. package/dist/schema/flow.js +0 -82
  126. package/dist/schema/flow.js.map +0 -1
  127. package/dist/schema/host-context.d.ts +0 -12
  128. package/dist/schema/host-context.d.ts.map +0 -1
  129. package/dist/schema/host-context.js +0 -23
  130. package/dist/schema/host-context.js.map +0 -1
  131. package/dist/schema/index.d.ts +0 -15
  132. package/dist/schema/index.d.ts.map +0 -1
  133. package/dist/schema/index.js +0 -28
  134. package/dist/schema/index.js.map +0 -1
  135. package/dist/schema/patch.d.ts +0 -59
  136. package/dist/schema/patch.d.ts.map +0 -1
  137. package/dist/schema/patch.js +0 -60
  138. package/dist/schema/patch.js.map +0 -1
  139. package/dist/schema/result.d.ts +0 -142
  140. package/dist/schema/result.d.ts.map +0 -1
  141. package/dist/schema/result.js +0 -94
  142. package/dist/schema/result.js.map +0 -1
  143. package/dist/schema/snapshot.d.ts +0 -153
  144. package/dist/schema/snapshot.d.ts.map +0 -1
  145. package/dist/schema/snapshot.js +0 -160
  146. package/dist/schema/snapshot.js.map +0 -1
  147. package/dist/schema/trace.d.ts +0 -98
  148. package/dist/schema/trace.d.ts.map +0 -1
  149. package/dist/schema/trace.js +0 -90
  150. package/dist/schema/trace.js.map +0 -1
  151. package/dist/schema/type-spec.d.ts +0 -34
  152. package/dist/schema/type-spec.d.ts.map +0 -1
  153. package/dist/schema/type-spec.js +0 -40
  154. package/dist/schema/type-spec.js.map +0 -1
  155. package/dist/utils/canonical.d.ts +0 -37
  156. package/dist/utils/canonical.d.ts.map +0 -1
  157. package/dist/utils/canonical.js +0 -122
  158. package/dist/utils/canonical.js.map +0 -1
  159. package/dist/utils/canonical.test.d.ts +0 -2
  160. package/dist/utils/canonical.test.d.ts.map +0 -1
  161. package/dist/utils/canonical.test.js +0 -183
  162. package/dist/utils/canonical.test.js.map +0 -1
  163. package/dist/utils/hash.d.ts +0 -55
  164. package/dist/utils/hash.d.ts.map +0 -1
  165. package/dist/utils/hash.js +0 -183
  166. package/dist/utils/hash.js.map +0 -1
  167. package/dist/utils/hash.test.d.ts +0 -2
  168. package/dist/utils/hash.test.d.ts.map +0 -1
  169. package/dist/utils/hash.test.js +0 -253
  170. package/dist/utils/hash.test.js.map +0 -1
  171. package/dist/utils/index.d.ts +0 -4
  172. package/dist/utils/index.d.ts.map +0 -1
  173. package/dist/utils/index.js +0 -4
  174. package/dist/utils/index.js.map +0 -1
  175. package/dist/utils/path.d.ts +0 -42
  176. package/dist/utils/path.d.ts.map +0 -1
  177. package/dist/utils/path.js +0 -170
  178. package/dist/utils/path.js.map +0 -1
  179. package/dist/utils/path.test.d.ts +0 -2
  180. package/dist/utils/path.test.d.ts.map +0 -1
  181. package/dist/utils/path.test.js +0 -248
  182. package/dist/utils/path.test.js.map +0 -1
@@ -1,14 +0,0 @@
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.computeSync).toBeInstanceOf(Function);
9
- expect(core.apply).toBeInstanceOf(Function);
10
- expect(core.validate).toBeInstanceOf(Function);
11
- expect(core.explain).toBeInstanceOf(Function);
12
- });
13
- });
14
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
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,WAAW,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAClD,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"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,30 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,37 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,20 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,34 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,12 +0,0 @@
1
- import type { StateSpec } from "./field.js";
2
- /**
3
- * Extract top-level default values from a StateSpec.
4
- *
5
- * Iterates `stateSpec.fields` and collects fields with an explicit `default`.
6
- * Returns a flat record of field names to default values.
7
- *
8
- * @param stateSpec - The state specification from a DomainSchema
9
- * @returns Record of field names to their default values
10
- */
11
- export declare function extractDefaults(stateSpec: StateSpec): Record<string, unknown>;
12
- //# sourceMappingURL=defaults.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/schema/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,GACnB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Extract top-level default values from a StateSpec.
3
- *
4
- * Iterates `stateSpec.fields` and collects fields with an explicit `default`.
5
- * Returns a flat record of field names to default values.
6
- *
7
- * @param stateSpec - The state specification from a DomainSchema
8
- * @returns Record of field names to their default values
9
- */
10
- export function extractDefaults(stateSpec) {
11
- const defaults = {};
12
- for (const [name, spec] of Object.entries(stateSpec.fields)) {
13
- if (spec.default !== undefined) {
14
- defaults[name] = spec.default;
15
- }
16
- }
17
- return defaults;
18
- }
19
- //# sourceMappingURL=defaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/schema/defaults.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAoB;IAEpB,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5D,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,50 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,60 +0,0 @@
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
@@ -1 +0,0 @@
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"}