@manifesto-ai/compiler 1.9.0 → 3.0.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 +17 -5
- package/dist/analyzer/entity-primitives.d.ts +3 -0
- package/dist/analyzer/expr-type-surface.d.ts +21 -0
- package/dist/analyzer/flow-composition.d.ts +7 -0
- package/dist/analyzer/index.d.ts +5 -0
- package/dist/analyzer/scope.d.ts +76 -0
- package/dist/analyzer/validator.d.ts +69 -0
- package/dist/api/compile-mel-patch-collector.d.ts +33 -0
- package/dist/api/compile-mel-patch-expr.d.ts +8 -0
- package/dist/api/compile-mel-patch-location.d.ts +9 -0
- package/dist/api/compile-mel-patch.d.ts +5 -0
- package/dist/api/compile-mel.d.ts +125 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/{chunk-4JJQCFJH.js → chunk-7TT6Y5ZC.js} +6 -2
- package/dist/chunk-7TT6Y5ZC.js.map +1 -0
- package/dist/{chunk-AYZTDA3J.js → chunk-LI5HNMZV.js} +2 -2
- package/dist/chunk-VAFXIS7J.js +101 -0
- package/dist/chunk-VAFXIS7J.js.map +1 -0
- package/dist/diagnostics/codes.d.ts +24 -0
- package/dist/diagnostics/format.d.ts +25 -0
- package/dist/diagnostics/index.d.ts +6 -0
- package/dist/diagnostics/types.d.ts +66 -0
- package/dist/esbuild.d.ts +6 -8
- package/dist/esbuild.js +3 -3
- package/dist/esbuild.js.map +1 -1
- package/dist/evaluation/context.d.ts +90 -0
- package/dist/evaluation/evaluate-expr.d.ts +23 -0
- package/dist/evaluation/evaluate-patch.d.ts +122 -0
- package/dist/evaluation/evaluate-runtime-patch.d.ts +59 -0
- package/dist/evaluation/index.d.ts +14 -0
- package/dist/generator/index.d.ts +6 -0
- package/dist/generator/ir.d.ts +185 -0
- package/dist/generator/lowering.d.ts +10 -0
- package/dist/generator/normalizer.d.ts +15 -0
- package/dist/generator/runtime-lowering.d.ts +2 -0
- package/dist/index.d.ts +19 -2785
- package/dist/index.js +1 -1
- package/dist/lexer/index.d.ts +6 -0
- package/dist/lexer/lexer.d.ts +58 -0
- package/dist/lexer/source-location.d.ts +40 -0
- package/dist/lexer/tokens.d.ts +46 -0
- package/dist/lowering/context.d.ts +95 -0
- package/dist/lowering/errors.d.ts +83 -0
- package/dist/lowering/index.d.ts +19 -0
- package/dist/lowering/lower-expr.d.ts +79 -0
- package/dist/lowering/lower-patch.d.ts +230 -0
- package/dist/lowering/lower-runtime-patch.d.ts +126 -0
- package/dist/lowering/to-mel-expr.d.ts +12 -0
- package/dist/mel-module.d.ts +14 -0
- package/dist/node-loader.d.ts +3 -7
- package/dist/node-loader.js +2 -2
- package/dist/parser/ast.d.ts +367 -0
- package/dist/parser/index.d.ts +6 -0
- package/dist/parser/parser.d.ts +101 -0
- package/dist/parser/precedence.d.ts +43 -0
- package/dist/renderer/expr-node.d.ts +171 -0
- package/dist/renderer/fragment.d.ts +83 -0
- package/dist/renderer/index.d.ts +22 -0
- package/dist/renderer/patch-op.d.ts +81 -0
- package/dist/renderer/type-expr.d.ts +60 -0
- package/dist/rollup.d.ts +6 -8
- package/dist/rollup.js +3 -3
- package/dist/rollup.js.map +1 -1
- package/dist/rspack.d.ts +6 -7
- package/dist/rspack.js +3 -3
- package/dist/rspack.js.map +1 -1
- package/dist/unplugin.d.ts +19 -0
- package/dist/utils/unicode-order.d.ts +5 -0
- package/dist/vite.d.ts +6 -8
- package/dist/vite.js +3 -3
- package/dist/vite.js.map +1 -1
- package/dist/webpack.d.ts +6 -8
- package/dist/webpack.js +3 -3
- package/dist/webpack.js.map +1 -1
- package/package.json +12 -17
- package/dist/chunk-4JJQCFJH.js.map +0 -1
- package/dist/chunk-K4IKHGOP.js +0 -74
- package/dist/chunk-K4IKHGOP.js.map +0 -1
- package/dist/unplugin-6wnvFiEo.d.ts +0 -17
- /package/dist/{chunk-AYZTDA3J.js.map → chunk-LI5HNMZV.js.map} +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExprNode to MEL Renderer
|
|
3
|
+
*
|
|
4
|
+
* Converts ExprNode AST to MEL expression syntax.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // { kind: "lit", value: 5 } -> "5"
|
|
8
|
+
* // { kind: "get", path: "count" } -> "count"
|
|
9
|
+
* // { kind: "add", left: { kind: "get", path: "x" }, right: { kind: "lit", value: 1 } } -> "add(x, 1)"
|
|
10
|
+
* // { kind: "gt", left: { kind: "get", path: "count" }, right: { kind: "lit", value: 0 } } -> "gt(count, 0)"
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* ExprNode type (subset from core package)
|
|
14
|
+
*/
|
|
15
|
+
export type ExprNode = {
|
|
16
|
+
kind: "lit";
|
|
17
|
+
value: unknown;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "get";
|
|
20
|
+
path: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "eq";
|
|
23
|
+
left: ExprNode;
|
|
24
|
+
right: ExprNode;
|
|
25
|
+
} | {
|
|
26
|
+
kind: "neq";
|
|
27
|
+
left: ExprNode;
|
|
28
|
+
right: ExprNode;
|
|
29
|
+
} | {
|
|
30
|
+
kind: "gt";
|
|
31
|
+
left: ExprNode;
|
|
32
|
+
right: ExprNode;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "gte";
|
|
35
|
+
left: ExprNode;
|
|
36
|
+
right: ExprNode;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "lt";
|
|
39
|
+
left: ExprNode;
|
|
40
|
+
right: ExprNode;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "lte";
|
|
43
|
+
left: ExprNode;
|
|
44
|
+
right: ExprNode;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "and";
|
|
47
|
+
args: ExprNode[];
|
|
48
|
+
} | {
|
|
49
|
+
kind: "or";
|
|
50
|
+
args: ExprNode[];
|
|
51
|
+
} | {
|
|
52
|
+
kind: "not";
|
|
53
|
+
arg: ExprNode;
|
|
54
|
+
} | {
|
|
55
|
+
kind: "if";
|
|
56
|
+
cond: ExprNode;
|
|
57
|
+
then: ExprNode;
|
|
58
|
+
else: ExprNode;
|
|
59
|
+
} | {
|
|
60
|
+
kind: "add";
|
|
61
|
+
left: ExprNode;
|
|
62
|
+
right: ExprNode;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "sub";
|
|
65
|
+
left: ExprNode;
|
|
66
|
+
right: ExprNode;
|
|
67
|
+
} | {
|
|
68
|
+
kind: "mul";
|
|
69
|
+
left: ExprNode;
|
|
70
|
+
right: ExprNode;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "div";
|
|
73
|
+
left: ExprNode;
|
|
74
|
+
right: ExprNode;
|
|
75
|
+
} | {
|
|
76
|
+
kind: "mod";
|
|
77
|
+
left: ExprNode;
|
|
78
|
+
right: ExprNode;
|
|
79
|
+
} | {
|
|
80
|
+
kind: "concat";
|
|
81
|
+
args: ExprNode[];
|
|
82
|
+
} | {
|
|
83
|
+
kind: "substring";
|
|
84
|
+
str: ExprNode;
|
|
85
|
+
start: ExprNode;
|
|
86
|
+
end?: ExprNode;
|
|
87
|
+
} | {
|
|
88
|
+
kind: "trim";
|
|
89
|
+
str: ExprNode;
|
|
90
|
+
} | {
|
|
91
|
+
kind: "len";
|
|
92
|
+
arg: ExprNode;
|
|
93
|
+
} | {
|
|
94
|
+
kind: "at";
|
|
95
|
+
array: ExprNode;
|
|
96
|
+
index: ExprNode;
|
|
97
|
+
} | {
|
|
98
|
+
kind: "first";
|
|
99
|
+
array: ExprNode;
|
|
100
|
+
} | {
|
|
101
|
+
kind: "last";
|
|
102
|
+
array: ExprNode;
|
|
103
|
+
} | {
|
|
104
|
+
kind: "slice";
|
|
105
|
+
array: ExprNode;
|
|
106
|
+
start: ExprNode;
|
|
107
|
+
end?: ExprNode;
|
|
108
|
+
} | {
|
|
109
|
+
kind: "includes";
|
|
110
|
+
array: ExprNode;
|
|
111
|
+
item: ExprNode;
|
|
112
|
+
} | {
|
|
113
|
+
kind: "filter";
|
|
114
|
+
array: ExprNode;
|
|
115
|
+
predicate: ExprNode;
|
|
116
|
+
} | {
|
|
117
|
+
kind: "map";
|
|
118
|
+
array: ExprNode;
|
|
119
|
+
mapper: ExprNode;
|
|
120
|
+
} | {
|
|
121
|
+
kind: "find";
|
|
122
|
+
array: ExprNode;
|
|
123
|
+
predicate: ExprNode;
|
|
124
|
+
} | {
|
|
125
|
+
kind: "every";
|
|
126
|
+
array: ExprNode;
|
|
127
|
+
predicate: ExprNode;
|
|
128
|
+
} | {
|
|
129
|
+
kind: "some";
|
|
130
|
+
array: ExprNode;
|
|
131
|
+
predicate: ExprNode;
|
|
132
|
+
} | {
|
|
133
|
+
kind: "append";
|
|
134
|
+
array: ExprNode;
|
|
135
|
+
items: ExprNode[];
|
|
136
|
+
} | {
|
|
137
|
+
kind: "object";
|
|
138
|
+
fields: Record<string, ExprNode>;
|
|
139
|
+
} | {
|
|
140
|
+
kind: "field";
|
|
141
|
+
object: ExprNode;
|
|
142
|
+
property: string;
|
|
143
|
+
} | {
|
|
144
|
+
kind: "keys";
|
|
145
|
+
obj: ExprNode;
|
|
146
|
+
} | {
|
|
147
|
+
kind: "values";
|
|
148
|
+
obj: ExprNode;
|
|
149
|
+
} | {
|
|
150
|
+
kind: "entries";
|
|
151
|
+
obj: ExprNode;
|
|
152
|
+
} | {
|
|
153
|
+
kind: "merge";
|
|
154
|
+
objects: ExprNode[];
|
|
155
|
+
} | {
|
|
156
|
+
kind: "typeof";
|
|
157
|
+
arg: ExprNode;
|
|
158
|
+
} | {
|
|
159
|
+
kind: "isNull";
|
|
160
|
+
arg: ExprNode;
|
|
161
|
+
} | {
|
|
162
|
+
kind: "coalesce";
|
|
163
|
+
args: ExprNode[];
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Renders an ExprNode to MEL expression syntax string.
|
|
167
|
+
*
|
|
168
|
+
* @param expr - The ExprNode to render
|
|
169
|
+
* @returns MEL expression syntax string
|
|
170
|
+
*/
|
|
171
|
+
export declare function renderExprNode(expr: ExprNode): string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PatchFragment to MEL Renderer
|
|
3
|
+
*
|
|
4
|
+
* Converts PatchFragment to MEL syntax with metadata comments.
|
|
5
|
+
*/
|
|
6
|
+
import { PatchOp, RenderOptions } from "./patch-op.js";
|
|
7
|
+
export interface PatchFragment {
|
|
8
|
+
/**
|
|
9
|
+
* Unique fragment identifier (content-addressed)
|
|
10
|
+
*/
|
|
11
|
+
fragmentId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Source intent identifier
|
|
14
|
+
*/
|
|
15
|
+
sourceIntentId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Fragment operation
|
|
18
|
+
*/
|
|
19
|
+
op: PatchOp;
|
|
20
|
+
/**
|
|
21
|
+
* Confidence score (0-1)
|
|
22
|
+
*/
|
|
23
|
+
confidence: number;
|
|
24
|
+
/**
|
|
25
|
+
* Evidence strings
|
|
26
|
+
*/
|
|
27
|
+
evidence: string[];
|
|
28
|
+
/**
|
|
29
|
+
* Creation timestamp (ISO 8601)
|
|
30
|
+
*/
|
|
31
|
+
createdAt: string;
|
|
32
|
+
}
|
|
33
|
+
export interface FragmentRenderOptions extends RenderOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Include fragment metadata as comments
|
|
36
|
+
*/
|
|
37
|
+
includeMetadata?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Include evidence as comments
|
|
40
|
+
*/
|
|
41
|
+
includeEvidence?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Include confidence score
|
|
44
|
+
*/
|
|
45
|
+
includeConfidence?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Include fragment ID
|
|
48
|
+
*/
|
|
49
|
+
includeFragmentId?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Renders a PatchFragment to MEL syntax string with optional metadata.
|
|
53
|
+
*
|
|
54
|
+
* @param fragment - The PatchFragment to render
|
|
55
|
+
* @param options - Rendering options
|
|
56
|
+
* @returns MEL syntax string with metadata comments
|
|
57
|
+
*/
|
|
58
|
+
export declare function renderFragment(fragment: PatchFragment, options?: FragmentRenderOptions): string;
|
|
59
|
+
/**
|
|
60
|
+
* Renders multiple PatchFragments to MEL syntax string.
|
|
61
|
+
*
|
|
62
|
+
* @param fragments - The PatchFragments to render
|
|
63
|
+
* @param options - Rendering options
|
|
64
|
+
* @returns MEL syntax string with all fragments
|
|
65
|
+
*/
|
|
66
|
+
export declare function renderFragments(fragments: PatchFragment[], options?: FragmentRenderOptions): string;
|
|
67
|
+
/**
|
|
68
|
+
* Renders PatchFragments grouped by operation kind.
|
|
69
|
+
*
|
|
70
|
+
* @param fragments - The PatchFragments to render
|
|
71
|
+
* @param options - Rendering options
|
|
72
|
+
* @returns Object with rendered strings grouped by operation kind
|
|
73
|
+
*/
|
|
74
|
+
export declare function renderFragmentsByKind(fragments: PatchFragment[], options?: FragmentRenderOptions): Record<string, string>;
|
|
75
|
+
/**
|
|
76
|
+
* Renders PatchFragments as a complete MEL domain block.
|
|
77
|
+
*
|
|
78
|
+
* @param domainName - The domain name
|
|
79
|
+
* @param fragments - The PatchFragments to render
|
|
80
|
+
* @param options - Rendering options
|
|
81
|
+
* @returns Complete MEL domain string
|
|
82
|
+
*/
|
|
83
|
+
export declare function renderAsDomain(domainName: string, fragments: PatchFragment[], options?: FragmentRenderOptions): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MEL Renderer
|
|
3
|
+
*
|
|
4
|
+
* Converts PatchFragment AST to MEL text syntax.
|
|
5
|
+
*
|
|
6
|
+
* This is the inverse of the parser: Parser (MEL text → AST), Renderer (AST → MEL text).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { renderFragment, renderAsDomain } from '@manifesto-ai/compiler';
|
|
11
|
+
*
|
|
12
|
+
* // Render a single fragment
|
|
13
|
+
* const mel = renderFragment(fragment);
|
|
14
|
+
*
|
|
15
|
+
* // Render multiple fragments as a domain
|
|
16
|
+
* const domain = renderAsDomain('MyDomain', fragments);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export { renderTypeExpr, renderTypeField, renderValue, type TypeExpr, type TypeField, } from "./type-expr.js";
|
|
20
|
+
export { renderExprNode, type ExprNode, } from "./expr-node.js";
|
|
21
|
+
export { renderPatchOp, extractTypeName, type PatchOp, type AddTypeOp, type AddFieldOp, type SetFieldTypeOp, type SetDefaultValueOp, type AddConstraintOp, type AddComputedOp, type AddActionAvailableOp, type RenderOptions, } from "./patch-op.js";
|
|
22
|
+
export { renderFragment, renderFragments, renderFragmentsByKind, renderAsDomain, type PatchFragment, type FragmentRenderOptions, } from "./fragment.js";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PatchOp to MEL Renderer
|
|
3
|
+
*
|
|
4
|
+
* Converts PatchOp AST to MEL syntax snippets.
|
|
5
|
+
*
|
|
6
|
+
* Note: These are fragments, not complete domain definitions.
|
|
7
|
+
* The caller is responsible for assembling fragments into a valid MEL domain.
|
|
8
|
+
*/
|
|
9
|
+
import { TypeExpr, TypeField } from "./type-expr.js";
|
|
10
|
+
import { ExprNode } from "./expr-node.js";
|
|
11
|
+
export type AddTypeOp = {
|
|
12
|
+
kind: "addType";
|
|
13
|
+
typeName: string;
|
|
14
|
+
typeExpr: TypeExpr;
|
|
15
|
+
};
|
|
16
|
+
export type AddFieldOp = {
|
|
17
|
+
kind: "addField";
|
|
18
|
+
typeName: string;
|
|
19
|
+
field: TypeField & {
|
|
20
|
+
defaultValue?: unknown;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export type SetFieldTypeOp = {
|
|
24
|
+
kind: "setFieldType";
|
|
25
|
+
path: string;
|
|
26
|
+
typeExpr: TypeExpr;
|
|
27
|
+
};
|
|
28
|
+
export type SetDefaultValueOp = {
|
|
29
|
+
kind: "setDefaultValue";
|
|
30
|
+
path: string;
|
|
31
|
+
value: unknown;
|
|
32
|
+
};
|
|
33
|
+
export type AddConstraintOp = {
|
|
34
|
+
kind: "addConstraint";
|
|
35
|
+
targetPath: string;
|
|
36
|
+
rule: ExprNode;
|
|
37
|
+
message?: string;
|
|
38
|
+
};
|
|
39
|
+
export type AddComputedOp = {
|
|
40
|
+
kind: "addComputed";
|
|
41
|
+
name: string;
|
|
42
|
+
expr: ExprNode;
|
|
43
|
+
deps?: string[];
|
|
44
|
+
};
|
|
45
|
+
export type AddActionAvailableOp = {
|
|
46
|
+
kind: "addActionAvailable";
|
|
47
|
+
actionName: string;
|
|
48
|
+
expr: ExprNode;
|
|
49
|
+
};
|
|
50
|
+
export type PatchOp = AddTypeOp | AddFieldOp | SetFieldTypeOp | SetDefaultValueOp | AddConstraintOp | AddComputedOp | AddActionAvailableOp;
|
|
51
|
+
export interface RenderOptions {
|
|
52
|
+
/**
|
|
53
|
+
* Indentation string (default: " ")
|
|
54
|
+
*/
|
|
55
|
+
indent?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Include comments with metadata
|
|
58
|
+
*/
|
|
59
|
+
includeComments?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Comment prefix for metadata
|
|
62
|
+
*/
|
|
63
|
+
commentPrefix?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Renders a PatchOp to MEL syntax string.
|
|
67
|
+
*
|
|
68
|
+
* @param op - The PatchOp to render
|
|
69
|
+
* @param options - Rendering options
|
|
70
|
+
* @returns MEL syntax string
|
|
71
|
+
*/
|
|
72
|
+
export declare function renderPatchOp(op: PatchOp, options?: RenderOptions): string;
|
|
73
|
+
/**
|
|
74
|
+
* Gets the type name from a semantic path.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* // "Todo.title" -> "Todo"
|
|
78
|
+
* // "User.address.city" -> "User"
|
|
79
|
+
* // "count" -> undefined
|
|
80
|
+
*/
|
|
81
|
+
export declare function extractTypeName(path: string): string | undefined;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeExpr to MEL Renderer
|
|
3
|
+
*
|
|
4
|
+
* Converts TypeExpr AST to MEL type syntax.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // { kind: "primitive", name: "string" } -> "string"
|
|
8
|
+
* // { kind: "array", element: { kind: "ref", name: "Todo" } } -> "Array<Todo>"
|
|
9
|
+
* // { kind: "union", members: [...] } -> "string | number | null"
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* TypeExpr type from translator package
|
|
13
|
+
*/
|
|
14
|
+
export type TypeExpr = {
|
|
15
|
+
kind: "primitive";
|
|
16
|
+
name: "string" | "number" | "boolean" | "null";
|
|
17
|
+
} | {
|
|
18
|
+
kind: "literal";
|
|
19
|
+
value: string | number | boolean | null;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "ref";
|
|
22
|
+
name: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "array";
|
|
25
|
+
element: TypeExpr;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "record";
|
|
28
|
+
key: TypeExpr;
|
|
29
|
+
value: TypeExpr;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "union";
|
|
32
|
+
members: TypeExpr[];
|
|
33
|
+
} | {
|
|
34
|
+
kind: "object";
|
|
35
|
+
fields: TypeField[];
|
|
36
|
+
};
|
|
37
|
+
export type TypeField = {
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly optional: boolean;
|
|
40
|
+
readonly type: TypeExpr;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Renders a TypeExpr to MEL type syntax string.
|
|
44
|
+
*
|
|
45
|
+
* @param typeExpr - The TypeExpr to render
|
|
46
|
+
* @returns MEL type syntax string
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderTypeExpr(typeExpr: TypeExpr): string;
|
|
49
|
+
/**
|
|
50
|
+
* Renders a TypeField with optional default value.
|
|
51
|
+
*
|
|
52
|
+
* @param field - The TypeField to render
|
|
53
|
+
* @param defaultValue - Optional default value
|
|
54
|
+
* @returns MEL field declaration string
|
|
55
|
+
*/
|
|
56
|
+
export declare function renderTypeField(field: TypeField, defaultValue?: unknown): string;
|
|
57
|
+
/**
|
|
58
|
+
* Renders a JavaScript value to MEL syntax.
|
|
59
|
+
*/
|
|
60
|
+
export declare function renderValue(value: unknown): string;
|
package/dist/rollup.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { MelPluginOptions, melPlugin as default, melPlugin };
|
|
1
|
+
/**
|
|
2
|
+
* Rollup plugin for MEL files.
|
|
3
|
+
*/
|
|
4
|
+
export type { MelPluginOptions, MelCodegenOptions, MelCodegenEmitter, MelCodegenArtifact, } from "./unplugin.js";
|
|
5
|
+
export declare const melPlugin: (options: import("./unplugin.js").MelPluginOptions) => import("unplugin").RollupPlugin<any> | import("unplugin").RollupPlugin<any>[];
|
|
6
|
+
export default melPlugin;
|
package/dist/rollup.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpluginMel
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VAFXIS7J.js";
|
|
4
|
+
import "./chunk-LI5HNMZV.js";
|
|
5
|
+
import "./chunk-7TT6Y5ZC.js";
|
|
6
6
|
|
|
7
7
|
// src/rollup.ts
|
|
8
8
|
var melPlugin = unpluginMel.rollup;
|
package/dist/rollup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rollup.ts"],"sourcesContent":["/**\n * Rollup plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {
|
|
1
|
+
{"version":3,"sources":["../src/rollup.ts"],"sourcesContent":["/**\n * Rollup plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {\n MelPluginOptions,\n MelCodegenOptions,\n MelCodegenEmitter,\n MelCodegenArtifact,\n} from \"./unplugin.js\";\nexport const melPlugin = unpluginMel.rollup;\nexport default melPlugin;\n"],"mappings":";;;;;;;AAYO,IAAM,YAAY,YAAY;AACrC,IAAO,iBAAQ;","names":[]}
|
package/dist/rspack.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const melPlugin: (options: MelPluginOptions) => RspackPluginInstance;
|
|
6
|
-
|
|
7
|
-
export { MelPluginOptions, melPlugin as default, melPlugin };
|
|
1
|
+
/**
|
|
2
|
+
* Rspack plugin for MEL files.
|
|
3
|
+
*/
|
|
4
|
+
export type { MelPluginOptions, MelCodegenOptions, MelCodegenEmitter, MelCodegenArtifact, } from "./unplugin.js";
|
|
5
|
+
export declare const melPlugin: (options: import("./unplugin.js").MelPluginOptions) => RspackPluginInstance;
|
|
6
|
+
export default melPlugin;
|
package/dist/rspack.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpluginMel
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VAFXIS7J.js";
|
|
4
|
+
import "./chunk-LI5HNMZV.js";
|
|
5
|
+
import "./chunk-7TT6Y5ZC.js";
|
|
6
6
|
|
|
7
7
|
// src/rspack.ts
|
|
8
8
|
var melPlugin = unpluginMel.rspack;
|
package/dist/rspack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rspack.ts"],"sourcesContent":["/**\n * Rspack plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {
|
|
1
|
+
{"version":3,"sources":["../src/rspack.ts"],"sourcesContent":["/**\n * Rspack plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {\n MelPluginOptions,\n MelCodegenOptions,\n MelCodegenEmitter,\n MelCodegenArtifact,\n} from \"./unplugin.js\";\nexport const melPlugin = unpluginMel.rspack;\nexport default melPlugin;\n"],"mappings":";;;;;;;AAYO,IAAM,YAAY,YAAY;AACrC,IAAO,iBAAQ;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified MEL plugin via unplugin.
|
|
3
|
+
*
|
|
4
|
+
* Single implementation that targets Vite, Webpack, Rollup, esbuild, and Rspack.
|
|
5
|
+
*/
|
|
6
|
+
import type { DomainSchema } from "@manifesto-ai/core";
|
|
7
|
+
export type MelCodegenArtifact = {
|
|
8
|
+
readonly schema: DomainSchema;
|
|
9
|
+
readonly sourceId: string;
|
|
10
|
+
};
|
|
11
|
+
export type MelCodegenEmitter = (artifact: MelCodegenArtifact) => unknown | Promise<unknown>;
|
|
12
|
+
export type MelCodegenOptions = {
|
|
13
|
+
readonly emit: MelCodegenEmitter;
|
|
14
|
+
};
|
|
15
|
+
export type MelPluginOptions = {
|
|
16
|
+
readonly include?: RegExp;
|
|
17
|
+
readonly codegen?: MelCodegenEmitter | MelCodegenOptions | false;
|
|
18
|
+
};
|
|
19
|
+
export declare const unpluginMel: import("unplugin").UnpluginInstance<MelPluginOptions, boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function compareUnicodeCodePoints(a: string, b: string): number;
|
|
2
|
+
export declare function sortKeysByUnicodeCodePoint(keys: readonly string[]): string[];
|
|
3
|
+
export declare function stableSortByUnicodeObjectKey<T extends {
|
|
4
|
+
key: string;
|
|
5
|
+
}>(items: readonly T[]): T[];
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { MelPluginOptions, melPlugin as default, melPlugin };
|
|
1
|
+
/**
|
|
2
|
+
* Vite plugin for MEL files.
|
|
3
|
+
*/
|
|
4
|
+
export type { MelPluginOptions, MelCodegenOptions, MelCodegenEmitter, MelCodegenArtifact, } from "./unplugin.js";
|
|
5
|
+
export declare const melPlugin: (options: import("./unplugin.js").MelPluginOptions) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
|
|
6
|
+
export default melPlugin;
|
package/dist/vite.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpluginMel
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VAFXIS7J.js";
|
|
4
|
+
import "./chunk-LI5HNMZV.js";
|
|
5
|
+
import "./chunk-7TT6Y5ZC.js";
|
|
6
6
|
|
|
7
7
|
// src/vite.ts
|
|
8
8
|
var melPlugin = unpluginMel.vite;
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vite.ts"],"sourcesContent":["/**\n * Vite plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {
|
|
1
|
+
{"version":3,"sources":["../src/vite.ts"],"sourcesContent":["/**\n * Vite plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {\n MelPluginOptions,\n MelCodegenOptions,\n MelCodegenEmitter,\n MelCodegenArtifact,\n} from \"./unplugin.js\";\nexport const melPlugin = unpluginMel.vite;\nexport default melPlugin;\n"],"mappings":";;;;;;;AAYO,IAAM,YAAY,YAAY;AACrC,IAAO,eAAQ;","names":[]}
|
package/dist/webpack.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { MelPluginOptions, melPlugin as default, melPlugin };
|
|
1
|
+
/**
|
|
2
|
+
* Webpack plugin for MEL files.
|
|
3
|
+
*/
|
|
4
|
+
export type { MelPluginOptions, MelCodegenOptions, MelCodegenEmitter, MelCodegenArtifact, } from "./unplugin.js";
|
|
5
|
+
export declare const melPlugin: (options: import("./unplugin.js").MelPluginOptions) => import("unplugin").WebpackPluginInstance;
|
|
6
|
+
export default melPlugin;
|
package/dist/webpack.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpluginMel
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-VAFXIS7J.js";
|
|
4
|
+
import "./chunk-LI5HNMZV.js";
|
|
5
|
+
import "./chunk-7TT6Y5ZC.js";
|
|
6
6
|
|
|
7
7
|
// src/webpack.ts
|
|
8
8
|
var melPlugin = unpluginMel.webpack;
|
package/dist/webpack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/webpack.ts"],"sourcesContent":["/**\n * Webpack plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {
|
|
1
|
+
{"version":3,"sources":["../src/webpack.ts"],"sourcesContent":["/**\n * Webpack plugin for MEL files.\n */\n\nimport { unpluginMel } from \"./unplugin.js\";\n\nexport type {\n MelPluginOptions,\n MelCodegenOptions,\n MelCodegenEmitter,\n MelCodegenArtifact,\n} from \"./unplugin.js\";\nexport const melPlugin = unpluginMel.webpack;\nexport default melPlugin;\n"],"mappings":";;;;;;;AAYO,IAAM,YAAY,YAAY;AACrC,IAAO,kBAAQ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manifesto-ai/compiler",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Manifesto Compiler - MEL (Manifesto Expression Language) to DomainSchema compiler",
|
|
5
5
|
"author": "eggplantiny <eggplantiny@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,19 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@anthropic-ai/sdk": "^0.26.0",
|
|
64
|
-
"@manifesto-ai/codegen": "^0.1.0",
|
|
65
64
|
"@manifesto-ai/core": "^2.0.0",
|
|
66
65
|
"openai": "^4.0.0",
|
|
67
|
-
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
66
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
68
67
|
"zod": "^4.3.6"
|
|
69
68
|
},
|
|
70
69
|
"peerDependenciesMeta": {
|
|
71
70
|
"@anthropic-ai/sdk": {
|
|
72
71
|
"optional": true
|
|
73
72
|
},
|
|
74
|
-
"@manifesto-ai/codegen": {
|
|
75
|
-
"optional": true
|
|
76
|
-
},
|
|
77
73
|
"openai": {
|
|
78
74
|
"optional": true
|
|
79
75
|
},
|
|
@@ -82,34 +78,33 @@
|
|
|
82
78
|
}
|
|
83
79
|
},
|
|
84
80
|
"dependencies": {
|
|
85
|
-
"ink": "^6.
|
|
81
|
+
"ink": "^6.8.0",
|
|
86
82
|
"ink-select-input": "^6.2.0",
|
|
87
83
|
"ink-spinner": "^5.0.0",
|
|
88
|
-
"meow": "^14.
|
|
84
|
+
"meow": "^14.1.0",
|
|
89
85
|
"react": "^19.2.4",
|
|
90
86
|
"unplugin": "^3.0.0"
|
|
91
87
|
},
|
|
92
88
|
"devDependencies": {
|
|
93
|
-
"@anthropic-ai/sdk": "^0.
|
|
89
|
+
"@anthropic-ai/sdk": "^0.80.0",
|
|
94
90
|
"@types/node": "^25.5.0",
|
|
95
91
|
"@types/react": "^19.2.14",
|
|
96
92
|
"dotenv": "^17.3.1",
|
|
97
|
-
"openai": "^6.
|
|
93
|
+
"openai": "^6.33.0",
|
|
98
94
|
"tsx": "^4.21.0",
|
|
99
95
|
"typescript": "^5.9.3",
|
|
100
|
-
"vite": "^
|
|
101
|
-
"vitest": "^4.1.
|
|
102
|
-
"webpack": "^5.105.
|
|
96
|
+
"vite": "^8.0.3",
|
|
97
|
+
"vitest": "^4.1.2",
|
|
98
|
+
"webpack": "^5.105.4",
|
|
103
99
|
"zod": "^4.3.6",
|
|
104
|
-
"@manifesto-ai/
|
|
105
|
-
"@manifesto-ai/core": "2.7.1",
|
|
106
|
-
"@manifesto-ai/world": "2.6.0"
|
|
100
|
+
"@manifesto-ai/core": "2.8.0"
|
|
107
101
|
},
|
|
108
102
|
"files": [
|
|
109
103
|
"dist"
|
|
110
104
|
],
|
|
111
105
|
"scripts": {
|
|
112
|
-
"build": "tsup",
|
|
106
|
+
"build": "rm -rf dist && tsup && tsc -p tsconfig.build.json --emitDeclarationOnly --declarationMap false --outDir dist",
|
|
107
|
+
"clean": "rm -rf dist",
|
|
113
108
|
"lint": "echo 'lint not configured'",
|
|
114
109
|
"test": "vitest run",
|
|
115
110
|
"test:coverage": "vitest run --coverage",
|