@acpus/core 0.5.6 → 0.7.0-alpha.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 +128 -4
- package/dist/.tsbuildinfo +1 -0
- package/dist/graph/builder.d.ts +103 -0
- package/dist/graph/builder.d.ts.map +1 -0
- package/dist/graph/builder.js +209 -0
- package/dist/graph/builder.js.map +1 -0
- package/dist/graph/lowering.d.ts +8 -0
- package/dist/graph/lowering.d.ts.map +1 -0
- package/dist/graph/lowering.js +45 -0
- package/dist/graph/lowering.js.map +1 -0
- package/dist/graph/refs.d.ts +11 -0
- package/dist/graph/refs.d.ts.map +1 -0
- package/dist/graph/refs.js +12 -0
- package/dist/graph/refs.js.map +1 -0
- package/dist/graph/scope.d.ts +21 -0
- package/dist/graph/scope.d.ts.map +1 -0
- package/dist/graph/scope.js +22 -0
- package/dist/graph/scope.js.map +1 -0
- package/dist/index.d.ts +11 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -15
- package/dist/index.js.map +1 -1
- package/dist/internal/symbols.d.ts +9 -0
- package/dist/internal/symbols.d.ts.map +1 -0
- package/dist/internal/symbols.js +9 -0
- package/dist/internal/symbols.js.map +1 -0
- package/dist/internal/type-utils.d.ts +7 -0
- package/dist/internal/type-utils.d.ts.map +1 -0
- package/dist/internal/type-utils.js +8 -0
- package/dist/internal/type-utils.js.map +1 -0
- package/dist/ir/types.d.ts +218 -0
- package/dist/ir/types.d.ts.map +1 -0
- package/dist/ir/types.js.map +1 -0
- package/dist/ir/validator.d.ts +3 -0
- package/dist/ir/validator.d.ts.map +1 -0
- package/dist/ir/validator.js +671 -0
- package/dist/ir/validator.js.map +1 -0
- package/dist/ir.d.ts +3 -0
- package/dist/ir.d.ts.map +1 -0
- package/dist/ir.js +2 -0
- package/dist/ir.js.map +1 -0
- package/dist/nodes/composite/fanout.d.ts +24 -0
- package/dist/nodes/composite/fanout.d.ts.map +1 -0
- package/dist/nodes/composite/fanout.js +24 -0
- package/dist/nodes/composite/fanout.js.map +1 -0
- package/dist/nodes/composite/if.d.ts +12 -0
- package/dist/nodes/composite/if.d.ts.map +1 -0
- package/dist/nodes/composite/if.js +13 -0
- package/dist/nodes/composite/if.js.map +1 -0
- package/dist/nodes/composite/loop.d.ts +17 -0
- package/dist/nodes/composite/loop.d.ts.map +1 -0
- package/dist/nodes/composite/loop.js +22 -0
- package/dist/nodes/composite/loop.js.map +1 -0
- package/dist/nodes/composite/parallel.d.ts +29 -0
- package/dist/nodes/composite/parallel.d.ts.map +1 -0
- package/dist/nodes/composite/parallel.js +18 -0
- package/dist/nodes/composite/parallel.js.map +1 -0
- package/dist/nodes/composite/shared.d.ts +38 -0
- package/dist/nodes/composite/shared.d.ts.map +1 -0
- package/dist/nodes/composite/shared.js +2 -0
- package/dist/nodes/composite/shared.js.map +1 -0
- package/dist/nodes/composite/switch.d.ts +22 -0
- package/dist/nodes/composite/switch.d.ts.map +1 -0
- package/dist/nodes/composite/switch.js +12 -0
- package/dist/nodes/composite/switch.js.map +1 -0
- package/dist/nodes/control/assert.d.ts +10 -0
- package/dist/nodes/control/assert.d.ts.map +1 -0
- package/dist/nodes/control/assert.js +14 -0
- package/dist/nodes/control/assert.js.map +1 -0
- package/dist/nodes/leaf/agent.d.ts +63 -0
- package/dist/nodes/leaf/agent.d.ts.map +1 -0
- package/dist/nodes/leaf/agent.js +56 -0
- package/dist/nodes/leaf/agent.js.map +1 -0
- package/dist/nodes/leaf/shared.d.ts +11 -0
- package/dist/nodes/leaf/shared.d.ts.map +1 -0
- package/dist/nodes/leaf/shared.js +2 -0
- package/dist/nodes/leaf/shared.js.map +1 -0
- package/dist/nodes/leaf/signal.d.ts +27 -0
- package/dist/nodes/leaf/signal.d.ts.map +1 -0
- package/dist/nodes/leaf/signal.js +18 -0
- package/dist/nodes/leaf/signal.js.map +1 -0
- package/dist/nodes/leaf/task.d.ts +71 -0
- package/dist/nodes/leaf/task.d.ts.map +1 -0
- package/dist/nodes/leaf/task.js +88 -0
- package/dist/nodes/leaf/task.js.map +1 -0
- package/dist/runtime/dollar.d.ts +42 -0
- package/dist/runtime/dollar.d.ts.map +1 -0
- package/dist/runtime/dollar.js +82 -0
- package/dist/runtime/dollar.js.map +1 -0
- package/dist/runtime/secret.d.ts +10 -0
- package/dist/runtime/secret.d.ts.map +1 -0
- package/dist/runtime/secret.js +12 -0
- package/dist/runtime/secret.js.map +1 -0
- package/dist/runtime/task-context.d.ts +28 -0
- package/dist/runtime/task-context.d.ts.map +1 -0
- package/dist/runtime/task-context.js +2 -0
- package/dist/runtime/task-context.js.map +1 -0
- package/dist/runtime.d.ts +5 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +3 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schema/index.d.ts +6 -2
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/lower.d.ts +25 -0
- package/dist/schema/lower.d.ts.map +1 -0
- package/dist/schema/lower.js +198 -0
- package/dist/schema/lower.js.map +1 -0
- package/dist/schema/validate.d.ts +18 -0
- package/dist/schema/validate.d.ts.map +1 -0
- package/dist/schema/validate.js +22 -0
- package/dist/schema/validate.js.map +1 -0
- package/dist/schema/zod.d.ts +17 -0
- package/dist/schema/zod.d.ts.map +1 -0
- package/dist/schema/zod.js +15 -0
- package/dist/schema/zod.js.map +1 -0
- package/dist/schema.d.ts +3 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -0
- package/dist/template/template.d.ts +5 -0
- package/dist/template/template.d.ts.map +1 -0
- package/dist/template/template.js +10 -0
- package/dist/template/template.js.map +1 -0
- package/dist/workflow.d.ts +3 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +2 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +35 -20
- package/dist/agent-overrides.d.ts +0 -33
- package/dist/agent-overrides.d.ts.map +0 -1
- package/dist/agent-overrides.js +0 -178
- package/dist/agent-overrides.js.map +0 -1
- package/dist/cel-ast.d.ts +0 -39
- package/dist/cel-ast.d.ts.map +0 -1
- package/dist/cel-ast.js +0 -157
- package/dist/cel-ast.js.map +0 -1
- package/dist/cel-environment.d.ts +0 -6
- package/dist/cel-environment.d.ts.map +0 -1
- package/dist/cel-environment.js +0 -44
- package/dist/cel-environment.js.map +0 -1
- package/dist/compiler.d.ts +0 -4
- package/dist/compiler.d.ts.map +0 -1
- package/dist/compiler.js +0 -651
- package/dist/compiler.js.map +0 -1
- package/dist/composite-contract.d.ts +0 -46
- package/dist/composite-contract.d.ts.map +0 -1
- package/dist/composite-contract.js +0 -89
- package/dist/composite-contract.js.map +0 -1
- package/dist/diagnostics.d.ts +0 -9
- package/dist/diagnostics.d.ts.map +0 -1
- package/dist/diagnostics.js +0 -16
- package/dist/diagnostics.js.map +0 -1
- package/dist/duration.d.ts +0 -13
- package/dist/duration.d.ts.map +0 -1
- package/dist/duration.js +0 -32
- package/dist/duration.js.map +0 -1
- package/dist/expression-scope.d.ts +0 -23
- package/dist/expression-scope.d.ts.map +0 -1
- package/dist/expression-scope.js +0 -545
- package/dist/expression-scope.js.map +0 -1
- package/dist/expressions-shared.d.ts +0 -19
- package/dist/expressions-shared.d.ts.map +0 -1
- package/dist/expressions-shared.js +0 -25
- package/dist/expressions-shared.js.map +0 -1
- package/dist/expressions.d.ts +0 -9
- package/dist/expressions.d.ts.map +0 -1
- package/dist/expressions.js +0 -95
- package/dist/expressions.js.map +0 -1
- package/dist/hash.d.ts +0 -19
- package/dist/hash.d.ts.map +0 -1
- package/dist/hash.js +0 -120
- package/dist/hash.js.map +0 -1
- package/dist/hook-validation.d.ts +0 -9
- package/dist/hook-validation.d.ts.map +0 -1
- package/dist/hook-validation.js +0 -73
- package/dist/hook-validation.js.map +0 -1
- package/dist/hooks.d.ts +0 -150
- package/dist/hooks.d.ts.map +0 -1
- package/dist/hooks.js +0 -18
- package/dist/hooks.js.map +0 -1
- package/dist/schedule.d.ts +0 -3
- package/dist/schedule.d.ts.map +0 -1
- package/dist/schedule.js +0 -21
- package/dist/schedule.js.map +0 -1
- package/dist/schema/dsl.d.ts +0 -34
- package/dist/schema/dsl.d.ts.map +0 -1
- package/dist/schema/dsl.js +0 -231
- package/dist/schema/dsl.js.map +0 -1
- package/dist/schema/helpers.d.ts +0 -24
- package/dist/schema/helpers.d.ts.map +0 -1
- package/dist/schema/helpers.js +0 -61
- package/dist/schema/helpers.js.map +0 -1
- package/dist/schema-validator.d.ts +0 -29
- package/dist/schema-validator.d.ts.map +0 -1
- package/dist/schema-validator.js +0 -622
- package/dist/schema-validator.js.map +0 -1
- package/dist/source-resolver.d.ts +0 -22
- package/dist/source-resolver.d.ts.map +0 -1
- package/dist/source-resolver.js +0 -43
- package/dist/source-resolver.js.map +0 -1
- package/dist/types.d.ts +0 -125
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/workflow-schema.d.ts +0 -10
- package/dist/workflow-schema.d.ts.map +0 -1
- package/dist/workflow-schema.js +0 -485
- package/dist/workflow-schema.js.map +0 -1
- /package/dist/{types.js → ir/types.js} +0 -0
package/dist/schema/dsl.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Acpus recursive schema DSL compiler.
|
|
3
|
-
*
|
|
4
|
-
* User-facing YAML examples:
|
|
5
|
-
*
|
|
6
|
-
* ok: boolean
|
|
7
|
-
* summary?: string
|
|
8
|
-
* issues:
|
|
9
|
-
* - description: string
|
|
10
|
-
* severity?: string
|
|
11
|
-
* metadata:
|
|
12
|
-
* title: string
|
|
13
|
-
*
|
|
14
|
-
* The compiler emits JSON Schema for IR/runtime validation. The user-facing
|
|
15
|
-
* DSL is intentionally smaller than JSON Schema and rejects unsupported
|
|
16
|
-
* object-form schema keys rather than silently ignoring them.
|
|
17
|
-
*/
|
|
18
|
-
import { isRecord, normalizeType, parseDefaultValue, parseKey, VALID_TYPES, } from "./helpers.js";
|
|
19
|
-
const OBJECT_FORM_KEYS = new Set(["type", "required", "default", "description"]);
|
|
20
|
-
const UNSUPPORTED_SCHEMA_KEY_HINTS = new Set(["items", "properties", "elements"]);
|
|
21
|
-
/**
|
|
22
|
-
* Compile an Acpus recursive schema DSL map into JSON Schema.
|
|
23
|
-
*/
|
|
24
|
-
export function compileSchemaDsl(schemaDsl, options) {
|
|
25
|
-
const strict = options?.strictObjectKeys ?? true;
|
|
26
|
-
return compileSchemaMap(schemaDsl, "", strict);
|
|
27
|
-
}
|
|
28
|
-
function compileSchemaMap(map, path, strict) {
|
|
29
|
-
const properties = {};
|
|
30
|
-
const required = [];
|
|
31
|
-
const errors = [];
|
|
32
|
-
for (const [rawKey, value] of Object.entries(map)) {
|
|
33
|
-
const { name, optional } = parseKey(rawKey);
|
|
34
|
-
if (name.length === 0) {
|
|
35
|
-
errors.push({ field: path, message: `Schema DSL field name from key '${rawKey}' must be non-empty.` });
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
|
-
const fieldPath = path ? `${path}.${name}` : name;
|
|
39
|
-
const result = parseFieldValue(name, value, optional, fieldPath, strict);
|
|
40
|
-
errors.push(...result.errors);
|
|
41
|
-
// Only include the field in properties when it has no errors.
|
|
42
|
-
// Sibling valid fields are preserved; the caller checks errors to
|
|
43
|
-
// decide whether to use the schema.
|
|
44
|
-
if (result.errors.length === 0) {
|
|
45
|
-
properties[name] = result.property;
|
|
46
|
-
if (result.isRequired) {
|
|
47
|
-
required.push(name);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
const schema = {
|
|
52
|
-
type: "object",
|
|
53
|
-
properties,
|
|
54
|
-
};
|
|
55
|
-
if (strict) {
|
|
56
|
-
schema.additionalProperties = false;
|
|
57
|
-
}
|
|
58
|
-
if (required.length > 0) {
|
|
59
|
-
schema.required = required;
|
|
60
|
-
}
|
|
61
|
-
return { schema, errors };
|
|
62
|
-
}
|
|
63
|
-
function parseFieldValue(name, value, keyOptional, path, strict) {
|
|
64
|
-
if (typeof value === "string") {
|
|
65
|
-
return parseStringShorthand(name, value, keyOptional, path, strict);
|
|
66
|
-
}
|
|
67
|
-
if (Array.isArray(value)) {
|
|
68
|
-
return parseArrayShorthand(name, value, keyOptional, path, strict);
|
|
69
|
-
}
|
|
70
|
-
if (isRecord(value)) {
|
|
71
|
-
if ("type" in value) {
|
|
72
|
-
return parseObjectForm(name, value, keyOptional, path, strict);
|
|
73
|
-
}
|
|
74
|
-
return parseNestedObject(name, value, keyOptional, path, strict);
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
property: {},
|
|
78
|
-
isRequired: false,
|
|
79
|
-
errors: [{ field: path, message: `schema DSL field '${name}' must be a type string, a nested object map, an array schema, or an object form with type.` }],
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function parseStringShorthand(name, value, keyOptional, path, strict) {
|
|
83
|
-
const eqIndex = value.indexOf("=");
|
|
84
|
-
let typePart;
|
|
85
|
-
let defaultValue = undefined;
|
|
86
|
-
let hasDefault = false;
|
|
87
|
-
if (eqIndex !== -1) {
|
|
88
|
-
typePart = value.slice(0, eqIndex).trim();
|
|
89
|
-
const rawDefault = value.slice(eqIndex + 1).trim();
|
|
90
|
-
hasDefault = true;
|
|
91
|
-
defaultValue = parseDefaultValue(rawDefault);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
typePart = value.trim();
|
|
95
|
-
}
|
|
96
|
-
const normalized = normalizeType(typePart);
|
|
97
|
-
if (!normalized) {
|
|
98
|
-
return invalidType(name, typePart, path);
|
|
99
|
-
}
|
|
100
|
-
const property = { type: normalized };
|
|
101
|
-
if (normalized === "object" && strict) {
|
|
102
|
-
property.additionalProperties = false;
|
|
103
|
-
}
|
|
104
|
-
if (hasDefault) {
|
|
105
|
-
property.default = defaultValue;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
property,
|
|
109
|
-
isRequired: !keyOptional && !hasDefault,
|
|
110
|
-
errors: [],
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function parseArrayShorthand(name, value, keyOptional, path, strict) {
|
|
114
|
-
if (value.length !== 1) {
|
|
115
|
-
return {
|
|
116
|
-
property: {},
|
|
117
|
-
isRequired: false,
|
|
118
|
-
errors: [{ field: path, message: `Array schema for field '${name}' must contain exactly one item schema.` }],
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
const itemSchema = value[0];
|
|
122
|
-
const itemResult = parseArrayItemSchema(`${name}[]`, itemSchema, `${path}[]`, strict);
|
|
123
|
-
if (itemResult.errors.length > 0) {
|
|
124
|
-
return { property: {}, isRequired: false, errors: itemResult.errors };
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
property: {
|
|
128
|
-
type: "array",
|
|
129
|
-
items: itemResult.property,
|
|
130
|
-
},
|
|
131
|
-
isRequired: !keyOptional,
|
|
132
|
-
errors: [],
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
function parseArrayItemSchema(name, value, path, strict) {
|
|
136
|
-
if (typeof value === "string") {
|
|
137
|
-
const parsed = parseStringShorthand(name, value, false, path, strict);
|
|
138
|
-
return { property: parsed.property, errors: parsed.errors };
|
|
139
|
-
}
|
|
140
|
-
if (Array.isArray(value)) {
|
|
141
|
-
const parsed = parseArrayShorthand(name, value, false, path, strict);
|
|
142
|
-
return { property: parsed.property, errors: parsed.errors };
|
|
143
|
-
}
|
|
144
|
-
if (isRecord(value)) {
|
|
145
|
-
if ("type" in value) {
|
|
146
|
-
const parsed = parseObjectForm(name, value, false, path, strict);
|
|
147
|
-
return { property: parsed.property, errors: parsed.errors };
|
|
148
|
-
}
|
|
149
|
-
const nested = compileSchemaMap(value, path, strict);
|
|
150
|
-
return { property: nested.schema, errors: nested.errors };
|
|
151
|
-
}
|
|
152
|
-
return {
|
|
153
|
-
property: {},
|
|
154
|
-
errors: [{ field: path, message: `Array item schema for field '${name}' must be a type string, a nested object map, an array schema, or an object form with type.` }],
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function parseNestedObject(_name, value, keyOptional, path, strict) {
|
|
158
|
-
const nested = compileSchemaMap(value, path, strict);
|
|
159
|
-
return {
|
|
160
|
-
property: nested.schema,
|
|
161
|
-
isRequired: !keyOptional,
|
|
162
|
-
errors: nested.errors,
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function parseObjectForm(name, value, keyOptional, path, strict) {
|
|
166
|
-
// Collect ALL errors before returning so the user gets a complete picture.
|
|
167
|
-
const errors = validateObjectFormKeys(name, value, path);
|
|
168
|
-
const rawType = value.type;
|
|
169
|
-
if (typeof rawType !== "string") {
|
|
170
|
-
errors.push({ field: path, message: `Object form for field '${name}' must include a string 'type'.` });
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
// Also validate the type string even if there are unsupported-key errors,
|
|
174
|
-
// so the user sees all problems at once.
|
|
175
|
-
const normalized = normalizeType(rawType);
|
|
176
|
-
if (!normalized) {
|
|
177
|
-
errors.push({ field: path, message: `Invalid type '${rawType}' for field '${name}'. Valid types: ${[...VALID_TYPES].join(", ")}.` });
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
if (errors.length > 0) {
|
|
181
|
-
return { property: {}, isRequired: false, errors };
|
|
182
|
-
}
|
|
183
|
-
const normalized = normalizeType(rawType);
|
|
184
|
-
const property = { type: normalized };
|
|
185
|
-
if (normalized === "object" && strict) {
|
|
186
|
-
property.additionalProperties = false;
|
|
187
|
-
}
|
|
188
|
-
if ("description" in value && typeof value.description === "string") {
|
|
189
|
-
property.description = value.description;
|
|
190
|
-
}
|
|
191
|
-
if ("default" in value) {
|
|
192
|
-
property.default = value.default;
|
|
193
|
-
}
|
|
194
|
-
const hasDefault = "default" in value;
|
|
195
|
-
const explicitRequired = value.required;
|
|
196
|
-
let isRequired;
|
|
197
|
-
if (explicitRequired !== undefined) {
|
|
198
|
-
isRequired = !!explicitRequired;
|
|
199
|
-
}
|
|
200
|
-
else if (hasDefault) {
|
|
201
|
-
isRequired = false;
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
isRequired = !keyOptional;
|
|
205
|
-
}
|
|
206
|
-
return { property, isRequired, errors: [] };
|
|
207
|
-
}
|
|
208
|
-
function validateObjectFormKeys(name, value, path) {
|
|
209
|
-
const errors = [];
|
|
210
|
-
for (const key of Object.keys(value)) {
|
|
211
|
-
if (OBJECT_FORM_KEYS.has(key)) {
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
const suffix = UNSUPPORTED_SCHEMA_KEY_HINTS.has(key)
|
|
215
|
-
? " Use the Acpus recursive DSL instead of raw schema keys."
|
|
216
|
-
: "";
|
|
217
|
-
errors.push({
|
|
218
|
-
field: `${path}.${key}`,
|
|
219
|
-
message: `Unsupported object-form key '${key}' for field '${name}'. Allowed keys: ${[...OBJECT_FORM_KEYS].join(", ")}.${suffix}`,
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
return errors;
|
|
223
|
-
}
|
|
224
|
-
function invalidType(name, rawType, path) {
|
|
225
|
-
return {
|
|
226
|
-
property: {},
|
|
227
|
-
isRequired: false,
|
|
228
|
-
errors: [{ field: path, message: `Invalid type '${rawType}' for field '${name}'. Valid types: ${[...VALID_TYPES].join(", ")}.` }],
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
//# sourceMappingURL=dsl.js.map
|
package/dist/schema/dsl.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dsl.js","sourceRoot":"","sources":["../../src/schema/dsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,WAAW,GACZ,MAAM,cAAc,CAAC;AAuBtB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CA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IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE;SACjI,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe,EAAE,IAAY;IAC9D,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,iBAAiB,OAAO,gBAAgB,IAAI,mBAAmB,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;KAClI,CAAC;AACJ,CAAC"}
|
package/dist/schema/helpers.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared schema helpers used by the recursive schema DSL compiler (dsl.ts).
|
|
3
|
-
*/
|
|
4
|
-
/** JSON Schema primitive types allowed in Acpus schema DSL shorthand. */
|
|
5
|
-
export declare const VALID_TYPES: Set<string>;
|
|
6
|
-
/** Alias map: common short forms → canonical JSON Schema type names. */
|
|
7
|
-
export declare const TYPE_ALIASES: Record<string, string>;
|
|
8
|
-
/** Normalize a type string to its canonical JSON Schema form. */
|
|
9
|
-
export declare function normalizeType(raw: string): string | undefined;
|
|
10
|
-
/** Parse `field?` into `{ name: "field", optional: true }`. */
|
|
11
|
-
export declare function parseKey(rawKey: string): {
|
|
12
|
-
name: string;
|
|
13
|
-
optional: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Parse a default value string into its JS representation.
|
|
17
|
-
*
|
|
18
|
-
* Handles: integers, floats, booleans, null, quoted strings, and
|
|
19
|
-
* falls through to raw string for anything else.
|
|
20
|
-
*/
|
|
21
|
-
export declare function parseDefaultValue(raw: string): unknown;
|
|
22
|
-
/** Type guard for plain record objects (not null, not array). */
|
|
23
|
-
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
24
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/schema/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,yEAAyE;AACzE,eAAO,MAAM,WAAW,aAOtB,CAAC;AAEH,wEAAwE;AACxE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK/C,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG7D;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAK5E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAiBtD;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
|
package/dist/schema/helpers.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared schema helpers used by the recursive schema DSL compiler (dsl.ts).
|
|
3
|
-
*/
|
|
4
|
-
/** JSON Schema primitive types allowed in Acpus schema DSL shorthand. */
|
|
5
|
-
export const VALID_TYPES = new Set([
|
|
6
|
-
"string",
|
|
7
|
-
"integer",
|
|
8
|
-
"number",
|
|
9
|
-
"boolean",
|
|
10
|
-
"array",
|
|
11
|
-
"object",
|
|
12
|
-
]);
|
|
13
|
-
/** Alias map: common short forms → canonical JSON Schema type names. */
|
|
14
|
-
export const TYPE_ALIASES = {
|
|
15
|
-
int: "integer",
|
|
16
|
-
str: "string",
|
|
17
|
-
bool: "boolean",
|
|
18
|
-
num: "number",
|
|
19
|
-
};
|
|
20
|
-
/** Normalize a type string to its canonical JSON Schema form. */
|
|
21
|
-
export function normalizeType(raw) {
|
|
22
|
-
const lower = raw.toLowerCase();
|
|
23
|
-
return TYPE_ALIASES[lower] ?? (VALID_TYPES.has(lower) ? lower : undefined);
|
|
24
|
-
}
|
|
25
|
-
/** Parse `field?` into `{ name: "field", optional: true }`. */
|
|
26
|
-
export function parseKey(rawKey) {
|
|
27
|
-
if (rawKey.endsWith("?")) {
|
|
28
|
-
return { name: rawKey.slice(0, -1), optional: true };
|
|
29
|
-
}
|
|
30
|
-
return { name: rawKey, optional: false };
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Parse a default value string into its JS representation.
|
|
34
|
-
*
|
|
35
|
-
* Handles: integers, floats, booleans, null, quoted strings, and
|
|
36
|
-
* falls through to raw string for anything else.
|
|
37
|
-
*/
|
|
38
|
-
export function parseDefaultValue(raw) {
|
|
39
|
-
if (/^-?\d+$/.test(raw)) {
|
|
40
|
-
return parseInt(raw, 10);
|
|
41
|
-
}
|
|
42
|
-
if (/^-?\d+\.\d+$/.test(raw)) {
|
|
43
|
-
return parseFloat(raw);
|
|
44
|
-
}
|
|
45
|
-
if (raw === "true")
|
|
46
|
-
return true;
|
|
47
|
-
if (raw === "false")
|
|
48
|
-
return false;
|
|
49
|
-
if (raw === "null")
|
|
50
|
-
return null;
|
|
51
|
-
if ((raw.startsWith('"') && raw.endsWith('"')) ||
|
|
52
|
-
(raw.startsWith("'") && raw.endsWith("'"))) {
|
|
53
|
-
return raw.slice(1, -1);
|
|
54
|
-
}
|
|
55
|
-
return raw;
|
|
56
|
-
}
|
|
57
|
-
/** Type guard for plain record objects (not null, not array). */
|
|
58
|
-
export function isRecord(value) {
|
|
59
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/schema/helpers.ts"],"names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,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,GAAG,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAChC,IACE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC1C,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAC1C,CAAC;QACD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schema-based structural validation for Acpus workflow specs.
|
|
3
|
-
*
|
|
4
|
-
* Compiles WORKFLOW_SCHEMA with Ajv and maps validation errors to
|
|
5
|
-
* diagnostic codes used by the compiler. This handles:
|
|
6
|
-
* - Unknown fields (additionalProperties: false)
|
|
7
|
-
* - Type / enum / required constraints
|
|
8
|
-
* - if/then cross-field dependencies
|
|
9
|
-
* - oneOf step-kind dispatch
|
|
10
|
-
*
|
|
11
|
-
* Duration format validation and semantic checks (cross-references,
|
|
12
|
-
* DSL compilation) remain in the hand-written compiler code.
|
|
13
|
-
*/
|
|
14
|
-
import type { DiagnosticBag } from "./diagnostics.js";
|
|
15
|
-
/**
|
|
16
|
-
* Map Ajv validation errors to compiler diagnostics.
|
|
17
|
-
*
|
|
18
|
-
* Strategy:
|
|
19
|
-
* - `additionalProperties` → SPEC_SHAPE / AGENT_SHAPE / STEP_SHAPE based on path
|
|
20
|
-
* - `required` → specific code based on missingProperty
|
|
21
|
-
* - `enum` / `const` → specific code based on allowedValues context
|
|
22
|
-
* - Step-level oneOf failures: suppress structural oneOf/const errors that are
|
|
23
|
-
* artifacts of branch-matching; only report STEP_KIND if no specific
|
|
24
|
-
* property-level error can be extracted.
|
|
25
|
-
* - Sub-oneOf errors (timeout, cmd, fanout.over) are classified individually.
|
|
26
|
-
* - Everything else → SPEC_SHAPE as fallback
|
|
27
|
-
*/
|
|
28
|
-
export declare function validateWithSchema(spec: unknown, diagnostics: DiagnosticBag): void;
|
|
29
|
-
//# sourceMappingURL=schema-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-validator.d.ts","sourceRoot":"","sources":["../src/schema-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAStD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,GAAG,IAAI,CAKlF"}
|