@llm4ts/flow 3.0.0 → 3.2.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 (61) hide show
  1. package/dist/Activity.d.ts +1 -1
  2. package/dist/Activity.d.ts.map +1 -1
  3. package/dist/Activity.js +20 -0
  4. package/dist/Activity.js.map +1 -1
  5. package/dist/Pack.d.ts +11 -0
  6. package/dist/Pack.d.ts.map +1 -1
  7. package/dist/Pack.js +2 -0
  8. package/dist/Pack.js.map +1 -1
  9. package/dist/endpoint/Auth.d.ts +194 -0
  10. package/dist/endpoint/Auth.d.ts.map +1 -0
  11. package/dist/endpoint/Auth.js +302 -0
  12. package/dist/endpoint/Auth.js.map +1 -0
  13. package/dist/endpoint/Endpoints.d.ts +21 -0
  14. package/dist/endpoint/Endpoints.d.ts.map +1 -0
  15. package/dist/endpoint/Endpoints.js +40 -0
  16. package/dist/endpoint/Endpoints.js.map +1 -0
  17. package/dist/endpoint/Transport.d.ts +90 -0
  18. package/dist/endpoint/Transport.d.ts.map +1 -0
  19. package/dist/endpoint/Transport.js +306 -0
  20. package/dist/endpoint/Transport.js.map +1 -0
  21. package/dist/tools/Builtin.d.ts +5 -0
  22. package/dist/tools/Builtin.d.ts.map +1 -0
  23. package/dist/tools/Builtin.js +7 -0
  24. package/dist/tools/Builtin.js.map +1 -0
  25. package/dist/tools/Diff.d.ts +8 -0
  26. package/dist/tools/Diff.d.ts.map +1 -0
  27. package/dist/tools/Diff.js +45 -0
  28. package/dist/tools/Diff.js.map +1 -0
  29. package/dist/tools/HttpCall.d.ts +14 -0
  30. package/dist/tools/HttpCall.d.ts.map +1 -0
  31. package/dist/tools/HttpCall.js +134 -0
  32. package/dist/tools/HttpCall.js.map +1 -0
  33. package/dist/tools/JsonSchemaCheck.d.ts +36 -0
  34. package/dist/tools/JsonSchemaCheck.d.ts.map +1 -0
  35. package/dist/tools/JsonSchemaCheck.js +342 -0
  36. package/dist/tools/JsonSchemaCheck.js.map +1 -0
  37. package/dist/tools/JsonValidate.d.ts +11 -0
  38. package/dist/tools/JsonValidate.d.ts.map +1 -0
  39. package/dist/tools/JsonValidate.js +84 -0
  40. package/dist/tools/JsonValidate.js.map +1 -0
  41. package/dist/tools/Tool.d.ts +126 -0
  42. package/dist/tools/Tool.d.ts.map +1 -0
  43. package/dist/tools/Tool.js +218 -0
  44. package/dist/tools/Tool.js.map +1 -0
  45. package/dist/tools/TreeDiff.d.ts +42 -0
  46. package/dist/tools/TreeDiff.d.ts.map +1 -0
  47. package/dist/tools/TreeDiff.js +276 -0
  48. package/dist/tools/TreeDiff.js.map +1 -0
  49. package/package.json +12 -2
  50. package/src/Activity.ts +22 -0
  51. package/src/Pack.ts +16 -0
  52. package/src/endpoint/Auth.ts +446 -0
  53. package/src/endpoint/Endpoints.ts +60 -0
  54. package/src/endpoint/Transport.ts +456 -0
  55. package/src/tools/Builtin.ts +10 -0
  56. package/src/tools/Diff.ts +61 -0
  57. package/src/tools/HttpCall.ts +160 -0
  58. package/src/tools/JsonSchemaCheck.ts +457 -0
  59. package/src/tools/JsonValidate.ts +106 -0
  60. package/src/tools/Tool.ts +351 -0
  61. package/src/tools/TreeDiff.ts +386 -0
@@ -0,0 +1,342 @@
1
+ /**
2
+ * A JSON Schema subset validator for the schema objects a tool is likely to
3
+ * meet: draft-07, 2020-12 and OpenAPI 3.0/3.1 schema objects. It reports every
4
+ * issue it finds in one pass, with JSONPath-style locations, and never throws
5
+ * on a malformed schema: a bad `pattern`, a dangling `$ref` or a reference
6
+ * cycle become issues of their own.
7
+ *
8
+ * `format` and every keyword not listed in `validateJson`'s documentation are
9
+ * ignored, so a schema that uses them still validates the parts this module
10
+ * understands.
11
+ */
12
+ /** Schema applications nested deeper than this are reported, not followed. */
13
+ const maxDepth = 64;
14
+ const nestingTooDeep = "schema nesting too deep";
15
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
16
+ const jsonTypeOf = (value) => {
17
+ if (value === null)
18
+ return "null";
19
+ if (Array.isArray(value))
20
+ return "array";
21
+ return typeof value;
22
+ };
23
+ const identifier = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
24
+ const childPath = (path, key) => identifier.test(key) ? `${path}.${key}` : `${path}[${JSON.stringify(key)}]`;
25
+ const indexPath = (path, index) => `${path}[${index}]`;
26
+ const renderLimit = 80;
27
+ const render = (value) => {
28
+ const text = value === undefined ? "undefined" : JSON.stringify(value);
29
+ return text.length > renderLimit ? `${text.slice(0, renderLimit - 1)}…` : text;
30
+ };
31
+ const jsonEquals = (left, right) => {
32
+ if (left === right)
33
+ return true;
34
+ if (typeof left === "number" && typeof right === "number")
35
+ return left === right;
36
+ if (Array.isArray(left) && Array.isArray(right)) {
37
+ return (left.length === right.length && left.every((item, index) => jsonEquals(item, right[index])));
38
+ }
39
+ if (isRecord(left) && isRecord(right)) {
40
+ const leftKeys = Object.keys(left).filter((key) => left[key] !== undefined);
41
+ const rightKeys = Object.keys(right).filter((key) => right[key] !== undefined);
42
+ return (leftKeys.length === rightKeys.length &&
43
+ leftKeys.every((key) => key in right && jsonEquals(left[key], right[key])));
44
+ }
45
+ return false;
46
+ };
47
+ const hasValue = (record, key) => Object.prototype.hasOwnProperty.call(record, key) && record[key] !== undefined;
48
+ const matchesType = (name, value) => {
49
+ switch (name) {
50
+ case "integer":
51
+ return typeof value === "number" && Number.isInteger(value);
52
+ case "number":
53
+ return typeof value === "number";
54
+ case "string":
55
+ return typeof value === "string";
56
+ case "boolean":
57
+ return typeof value === "boolean";
58
+ case "null":
59
+ return value === null;
60
+ case "array":
61
+ return Array.isArray(value);
62
+ case "object":
63
+ return isRecord(value);
64
+ default:
65
+ return true;
66
+ }
67
+ };
68
+ const typeNames = (type) => {
69
+ if (typeof type === "string")
70
+ return [type];
71
+ if (Array.isArray(type))
72
+ return type.filter((name) => typeof name === "string");
73
+ return [];
74
+ };
75
+ /** Resolves a local JSON pointer (`#/a/b~1c`) against a root document. */
76
+ const resolvePointer = (root, ref) => {
77
+ if (!ref.startsWith("#"))
78
+ return { found: false, value: undefined };
79
+ const fragment = ref.slice(1);
80
+ if (fragment === "")
81
+ return { found: true, value: root };
82
+ if (!fragment.startsWith("/"))
83
+ return { found: false, value: undefined };
84
+ let current = root;
85
+ for (const rawToken of fragment.slice(1).split("/")) {
86
+ let token = rawToken;
87
+ try {
88
+ token = decodeURIComponent(rawToken);
89
+ }
90
+ catch {
91
+ token = rawToken;
92
+ }
93
+ token = token.replace(/~1/g, "/").replace(/~0/g, "~");
94
+ if (Array.isArray(current)) {
95
+ const index = Number(token);
96
+ if (!Number.isInteger(index) || index < 0 || index >= current.length) {
97
+ return { found: false, value: undefined };
98
+ }
99
+ current = current[index];
100
+ }
101
+ else if (isRecord(current) && Object.prototype.hasOwnProperty.call(current, token)) {
102
+ current = current[token];
103
+ }
104
+ else {
105
+ return { found: false, value: undefined };
106
+ }
107
+ }
108
+ return { found: true, value: current };
109
+ };
110
+ const report = (collector, path, detail) => {
111
+ const key = `${path}\u0000${detail}`;
112
+ if (collector.seen.has(key))
113
+ return;
114
+ collector.seen.add(key);
115
+ collector.issues.push({ path, detail });
116
+ };
117
+ const reportOnce = (collector, path, detail) => {
118
+ if (collector.once.has(detail))
119
+ return;
120
+ collector.once.add(detail);
121
+ report(collector.top ?? collector, path, detail);
122
+ };
123
+ const branch = (collector) => ({
124
+ root: collector.root,
125
+ issues: [],
126
+ seen: new Set(),
127
+ once: collector.once,
128
+ patterns: collector.patterns,
129
+ top: collector.top ?? collector
130
+ });
131
+ const passes = (collector, schema, value, path, depth) => {
132
+ const probe = branch(collector);
133
+ validate(probe, schema, value, path, depth);
134
+ return probe.issues.length === 0;
135
+ };
136
+ const compilePattern = (collector, source) => {
137
+ const cached = collector.patterns.get(source);
138
+ if (cached !== undefined)
139
+ return cached;
140
+ let compiled;
141
+ try {
142
+ compiled = new RegExp(source, "u");
143
+ }
144
+ catch {
145
+ compiled = undefined;
146
+ }
147
+ collector.patterns.set(source, compiled);
148
+ return compiled;
149
+ };
150
+ const validateString = (collector, schema, value, path) => {
151
+ const length = Array.from(value).length;
152
+ if (typeof schema.minLength === "number" && length < schema.minLength) {
153
+ report(collector, path, `expected at least ${schema.minLength} characters, found ${length}`);
154
+ }
155
+ if (typeof schema.maxLength === "number" && length > schema.maxLength) {
156
+ report(collector, path, `expected at most ${schema.maxLength} characters, found ${length}`);
157
+ }
158
+ if (typeof schema.pattern === "string") {
159
+ const pattern = compilePattern(collector, schema.pattern);
160
+ if (pattern === undefined) {
161
+ reportOnce(collector, path, `invalid pattern ${JSON.stringify(schema.pattern)}`);
162
+ }
163
+ else if (!pattern.test(value)) {
164
+ report(collector, path, `value ${render(value)} does not match pattern ${JSON.stringify(schema.pattern)}`);
165
+ }
166
+ }
167
+ };
168
+ const validateNumber = (collector, schema, value, path) => {
169
+ const rendered = render(value);
170
+ if (typeof schema.minimum === "number") {
171
+ if (schema.exclusiveMinimum === true) {
172
+ if (value <= schema.minimum) {
173
+ report(collector, path, `value ${rendered} is not greater than the exclusive minimum ${schema.minimum}`);
174
+ }
175
+ }
176
+ else if (value < schema.minimum) {
177
+ report(collector, path, `value ${rendered} is less than the minimum ${schema.minimum}`);
178
+ }
179
+ }
180
+ if (typeof schema.exclusiveMinimum === "number" && value <= schema.exclusiveMinimum) {
181
+ report(collector, path, `value ${rendered} is not greater than the exclusive minimum ${schema.exclusiveMinimum}`);
182
+ }
183
+ if (typeof schema.maximum === "number") {
184
+ if (schema.exclusiveMaximum === true) {
185
+ if (value >= schema.maximum) {
186
+ report(collector, path, `value ${rendered} is not less than the exclusive maximum ${schema.maximum}`);
187
+ }
188
+ }
189
+ else if (value > schema.maximum) {
190
+ report(collector, path, `value ${rendered} is greater than the maximum ${schema.maximum}`);
191
+ }
192
+ }
193
+ if (typeof schema.exclusiveMaximum === "number" && value >= schema.exclusiveMaximum) {
194
+ report(collector, path, `value ${rendered} is not less than the exclusive maximum ${schema.exclusiveMaximum}`);
195
+ }
196
+ if (typeof schema.multipleOf === "number" && schema.multipleOf > 0) {
197
+ const quotient = value / schema.multipleOf;
198
+ if (Math.abs(quotient - Math.round(quotient)) > 1e-9) {
199
+ report(collector, path, `value ${rendered} is not a multiple of ${schema.multipleOf}`);
200
+ }
201
+ }
202
+ };
203
+ const validateArray = (collector, schema, value, path, depth) => {
204
+ if (typeof schema.minItems === "number" && value.length < schema.minItems) {
205
+ report(collector, path, `expected at least ${schema.minItems} items, found ${value.length}`);
206
+ }
207
+ if (typeof schema.maxItems === "number" && value.length > schema.maxItems) {
208
+ report(collector, path, `expected at most ${schema.maxItems} items, found ${value.length}`);
209
+ }
210
+ if (schema.uniqueItems === true) {
211
+ for (let index = 1; index < value.length; index++) {
212
+ const twin = value.findIndex((item, earlier) => earlier < index && jsonEquals(item, value[index]));
213
+ if (twin >= 0) {
214
+ report(collector, path, `items are not unique: item ${index} duplicates item ${twin}`);
215
+ }
216
+ }
217
+ }
218
+ const items = schema.items;
219
+ if (Array.isArray(items)) {
220
+ items.forEach((itemSchema, index) => {
221
+ if (index < value.length)
222
+ validate(collector, itemSchema, value[index], indexPath(path, index), depth);
223
+ });
224
+ }
225
+ else if (items !== undefined) {
226
+ value.forEach((item, index) => validate(collector, items, item, indexPath(path, index), depth));
227
+ }
228
+ };
229
+ const validateObject = (collector, schema, value, path, depth) => {
230
+ const properties = isRecord(schema.properties) ? schema.properties : {};
231
+ if (Array.isArray(schema.required)) {
232
+ for (const name of schema.required) {
233
+ if (typeof name === "string" && !hasValue(value, name)) {
234
+ report(collector, path, `missing required property ${JSON.stringify(name)}`);
235
+ }
236
+ }
237
+ }
238
+ for (const key of Object.keys(value)) {
239
+ if (!hasValue(value, key))
240
+ continue;
241
+ const child = childPath(path, key);
242
+ if (Object.prototype.hasOwnProperty.call(properties, key)) {
243
+ validate(collector, properties[key], value[key], child, depth);
244
+ }
245
+ else if (schema.additionalProperties === false) {
246
+ report(collector, path, `unexpected property ${JSON.stringify(key)}`);
247
+ }
248
+ else if (schema.additionalProperties !== undefined && schema.additionalProperties !== true) {
249
+ validate(collector, schema.additionalProperties, value[key], child, depth);
250
+ }
251
+ }
252
+ };
253
+ const validate = (collector, schema, value, path, depth) => {
254
+ if (depth > maxDepth) {
255
+ reportOnce(collector, path, nestingTooDeep);
256
+ return;
257
+ }
258
+ if (schema === true)
259
+ return;
260
+ if (schema === false) {
261
+ report(collector, path, "value is not allowed by a false schema");
262
+ return;
263
+ }
264
+ if (!isRecord(schema)) {
265
+ reportOnce(collector, path, `invalid schema of type ${jsonTypeOf(schema)}`);
266
+ return;
267
+ }
268
+ const next = depth + 1;
269
+ if (value === null && schema.nullable === true)
270
+ return;
271
+ if (typeof schema.$ref === "string") {
272
+ const resolved = resolvePointer(collector.root, schema.$ref);
273
+ if (resolved.found) {
274
+ validate(collector, resolved.value, value, path, next);
275
+ }
276
+ else {
277
+ report(collector, path, `cannot resolve $ref ${JSON.stringify(schema.$ref)}`);
278
+ }
279
+ }
280
+ const expected = typeNames(schema.type);
281
+ if (expected.length > 0 && !expected.some((name) => matchesType(name, value))) {
282
+ report(collector, path, `expected ${expected.join(" or ")}, found ${jsonTypeOf(value)}`);
283
+ }
284
+ if (Array.isArray(schema.enum) &&
285
+ !schema.enum.some((candidate) => jsonEquals(candidate, value))) {
286
+ report(collector, path, `value ${render(value)} is not one of [${schema.enum.map(render).join(", ")}]`);
287
+ }
288
+ if (hasValue(schema, "const") && !jsonEquals(schema.const, value)) {
289
+ report(collector, path, `value ${render(value)} is not the constant ${render(schema.const)}`);
290
+ }
291
+ if (typeof value === "string")
292
+ validateString(collector, schema, value, path);
293
+ else if (typeof value === "number")
294
+ validateNumber(collector, schema, value, path);
295
+ else if (Array.isArray(value))
296
+ validateArray(collector, schema, value, path, next);
297
+ else if (isRecord(value))
298
+ validateObject(collector, schema, value, path, next);
299
+ if (Array.isArray(schema.allOf)) {
300
+ for (const member of schema.allOf)
301
+ validate(collector, member, value, path, next);
302
+ }
303
+ if (Array.isArray(schema.anyOf)) {
304
+ const matched = schema.anyOf.some((member) => passes(collector, member, value, path, next));
305
+ if (!matched) {
306
+ report(collector, path, `value does not match any of the ${schema.anyOf.length} anyOf schemas`);
307
+ }
308
+ }
309
+ if (Array.isArray(schema.oneOf)) {
310
+ const matched = schema.oneOf.filter((member) => passes(collector, member, value, path, next)).length;
311
+ if (matched !== 1) {
312
+ report(collector, path, `expected exactly one of the ${schema.oneOf.length} oneOf schemas to match, ${matched} matched`);
313
+ }
314
+ }
315
+ if (schema.not !== undefined && passes(collector, schema.not, value, path, next)) {
316
+ report(collector, path, "value matches the not schema");
317
+ }
318
+ };
319
+ /**
320
+ * Validates `document` against `schema` and returns every issue found, in
321
+ * document order, without duplicates.
322
+ *
323
+ * Supported keywords: `type` (a name or a list; `integer` is a whole number),
324
+ * `nullable`, `enum`, `const`, `properties`, `required`, `additionalProperties`,
325
+ * `items`, `minItems`, `maxItems`, `uniqueItems`, `minLength`, `maxLength`,
326
+ * `pattern`, `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`
327
+ * (numeric, or the draft-04 boolean form), `multipleOf`, `allOf`, `anyOf`,
328
+ * `oneOf`, `not`, `$ref` to a local pointer, and the boolean schemas.
329
+ */
330
+ export const validateJson = (schema, document, options) => {
331
+ const collector = {
332
+ root: options?.root ?? schema,
333
+ issues: [],
334
+ seen: new Set(),
335
+ once: new Set(),
336
+ patterns: new Map(),
337
+ top: undefined
338
+ };
339
+ validate(collector, schema, document, "$", 0);
340
+ return collector.issues;
341
+ };
342
+ //# sourceMappingURL=JsonSchemaCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonSchemaCheck.js","sourceRoot":"","sources":["../../src/tools/JsonSchemaCheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,8EAA8E;AAC9E,MAAM,QAAQ,GAAG,EAAE,CAAA;AAEnB,MAAM,cAAc,GAAG,yBAAyB,CAAA;AAIhD,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAuB,EAAE,CACvD,OAAO,KA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C5B,MAAM,SAAS,GAAc;QAC3B,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,MAAM;QAC7B,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,IAAI,GAAG,EAAE;QACf,IAAI,EAAE,IAAI,GAAG,EAAE;QACf,QAAQ,EAAE,IAAI,GAAG,EAAE;QACnB,GAAG,EAAE,SAAS;KACf,CAAA;IACD,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;IAC7C,OAAO,SAAS,CAAC,MAAM,CAAA;AACzB,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Validates a JSON document against a JSON Schema file, or against one
3
+ * component schema of an OpenAPI document (`$ref`s resolve inside it).
4
+ */
5
+ export declare const jsonValidate: import("./Tool.ts").Tool<{
6
+ readonly document: string;
7
+ readonly component?: string;
8
+ readonly schema?: string;
9
+ readonly openapi?: string;
10
+ }>;
11
+ //# sourceMappingURL=JsonValidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonValidate.d.ts","sourceRoot":"","sources":["../../src/tools/JsonValidate.ts"],"names":[],"mappings":"AA8CA;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;EAuDvB,CAAA"}
@@ -0,0 +1,84 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Schema from "effect/Schema";
3
+ import { validateJson } from "./JsonSchemaCheck.js";
4
+ import { ToolError, defineTool, parseJsonDocument, readToolFile, report } from "./Tool.js";
5
+ const name = "json-validate";
6
+ const Input = Schema.Struct({
7
+ document: Schema.String,
8
+ schema: Schema.optionalKey(Schema.String),
9
+ openapi: Schema.optionalKey(Schema.String),
10
+ component: Schema.optionalKey(Schema.String)
11
+ });
12
+ const componentOf = (openapi, component, path) => {
13
+ const schemas = typeof openapi === "object" &&
14
+ openapi !== null &&
15
+ "components" in openapi &&
16
+ typeof openapi.components === "object" &&
17
+ openapi.components !== null &&
18
+ "schemas" in openapi.components &&
19
+ typeof openapi.components.schemas === "object" &&
20
+ openapi.components.schemas !== null
21
+ ? openapi.components.schemas
22
+ : undefined;
23
+ if (schemas === undefined) {
24
+ return Effect.fail(new ToolError({ tool: name, message: `${path} has no components.schemas` }));
25
+ }
26
+ const found = Object.entries(schemas).find(([key]) => key === component);
27
+ if (found === undefined) {
28
+ const known = Object.keys(schemas).sort().slice(0, 20).join(", ");
29
+ return Effect.fail(new ToolError({
30
+ tool: name,
31
+ message: `${path} has no component schema '${component}'; known: ${known}`
32
+ }));
33
+ }
34
+ return Effect.succeed(found[1]);
35
+ };
36
+ /**
37
+ * Validates a JSON document against a JSON Schema file, or against one
38
+ * component schema of an OpenAPI document (`$ref`s resolve inside it).
39
+ */
40
+ export const jsonValidate = defineTool({
41
+ name,
42
+ purpose: "Validate a JSON document against a JSON Schema file, or against a component schema of an OpenAPI document",
43
+ args: {
44
+ document: { description: "Path of the JSON document to check", kind: "path", required: true },
45
+ schema: { description: "Path of a JSON Schema file", kind: "path" },
46
+ openapi: {
47
+ description: "Path of an OpenAPI document (JSON); use with --component",
48
+ kind: "path"
49
+ },
50
+ component: {
51
+ description: "Name under components.schemas of the OpenAPI document",
52
+ kind: "string"
53
+ }
54
+ },
55
+ input: Input,
56
+ run: (input) => Effect.gen(function* () {
57
+ const document = yield* parseJsonDocument(name, input.document, yield* readToolFile(name, input.document));
58
+ let schema;
59
+ let root;
60
+ let against;
61
+ if (input.schema !== undefined) {
62
+ schema = yield* parseJsonDocument(name, input.schema, yield* readToolFile(name, input.schema));
63
+ root = schema;
64
+ against = input.schema;
65
+ }
66
+ else if (input.openapi !== undefined) {
67
+ if (input.component === undefined) {
68
+ return yield* new ToolError({ tool: name, message: "--openapi needs --component <name>" });
69
+ }
70
+ root = yield* parseJsonDocument(name, input.openapi, yield* readToolFile(name, input.openapi));
71
+ schema = yield* componentOf(root, input.component, input.openapi);
72
+ against = `${input.openapi}#/components/schemas/${input.component}`;
73
+ }
74
+ else {
75
+ return yield* new ToolError({
76
+ tool: name,
77
+ message: "give --schema <file> or --openapi <file> --component <name>"
78
+ });
79
+ }
80
+ const issues = validateJson(schema, document, { root });
81
+ return report(name, issues, `${input.document} is valid against ${against}`);
82
+ })
83
+ });
84
+ //# sourceMappingURL=JsonValidate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonValidate.js","sourceRoot":"","sources":["../../src/tools/JsonValidate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE1F,MAAM,IAAI,GAAG,eAAe,CAAA;AAE5B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM;IACvB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;CAC7C,CAAC,CAAA;AAEF,MAAM,WAAW,GAAG,CAClB,OAAgB,EAChB,SAAiB,EACjB,IAAY,EACuB,EAAE;IACrC,MAAM,OAAO,GACX,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,YAAY,IAAI,OAAO;QACvB,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ;QACtC,OAAO,CAAC,UAAU,KAAK,IAAI;QAC3B,SAAS,IAAI,OAAO,CAAC,UAAU;QAC/B,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,QAAQ;QAC9C,OAAO,CAAC,UAAU,CAAC,OAAO,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CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YACjE,OAAO,GAAG,GAAG,KAAK,CAAC,OAAO,wBAAwB,KAAK,CAAC,SAAS,EAAE,CAAA;QACrE,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC;gBAC1B,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,6DAA6D;aACvE,CAAC,CAAA;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;QACvD,OAAO,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,qBAAqB,OAAO,EAAE,CAAC,CAAA;IAC9E,CAAC,CAAC;CACL,CAAC,CAAA"}
@@ -0,0 +1,126 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Schema from "effect/Schema";
4
+ import type { SoapTransport } from "../endpoint/Transport.ts";
5
+ import { PlainFileStore } from "../Persistence.ts";
6
+ declare const ToolError_base: Schema.Class<ToolError, Schema.TaggedStruct<"ToolError", {
7
+ readonly tool: Schema.String;
8
+ readonly message: Schema.String;
9
+ }>, import("effect/Cause").YieldableError>;
10
+ /**
11
+ * A tool is one repeatable action a coding agent would otherwise improvise
12
+ * — validate a document, compare two outputs, probe an endpoint — packaged
13
+ * as a module with a typed input, a typed report and an Effect `run`
14
+ * (ADR 0048). The `llm4ts tool` CLI lists, describes and runs them; a pack
15
+ * names presets over them so a story sees the same command every run.
16
+ */
17
+ export declare class ToolError extends ToolError_base {
18
+ }
19
+ declare const ToolIssue_base: Schema.Class<ToolIssue, Schema.Struct<{
20
+ readonly path: Schema.String;
21
+ readonly detail: Schema.String;
22
+ }>, {}>;
23
+ export declare class ToolIssue extends ToolIssue_base {
24
+ }
25
+ declare const ToolReport_base: Schema.Class<ToolReport, Schema.Struct<{
26
+ readonly tool: Schema.String;
27
+ readonly ok: Schema.Boolean;
28
+ readonly summary: Schema.String;
29
+ readonly issues: Schema.$Array<typeof ToolIssue>;
30
+ /** Issues cut from `issues` by the output cap; `--all` lifts it. */
31
+ readonly truncated: Schema.Int;
32
+ readonly data: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
33
+ }>, {}>;
34
+ /** What every tool prints: a verdict, one line, and the issues behind it. */
35
+ export declare class ToolReport extends ToolReport_base {
36
+ }
37
+ export declare const ToolArgKind: Schema.Literals<readonly ["string", "path", "integer", "boolean", "json"]>;
38
+ export type ToolArgKind = typeof ToolArgKind.Type;
39
+ export interface ToolArg {
40
+ readonly description: string;
41
+ readonly kind: ToolArgKind;
42
+ readonly required?: boolean;
43
+ readonly default?: string;
44
+ }
45
+ export interface ToolContextShape {
46
+ /** The project the tool runs for: the main checkout of a worktree (`.llm4ts/` lives here). */
47
+ readonly projectRoot: string;
48
+ /** The process environment, for `env:NAME` secret references; never printed. */
49
+ readonly environment: Readonly<Record<string, string | undefined>>;
50
+ }
51
+ declare const ToolContext_base: Context.ServiceClass<ToolContext, "@llm4ts/flow/tools/ToolContext", ToolContextShape>;
52
+ /** Where a tool runs: provided by the CLI, or by `runToolMain` from its arguments. */
53
+ export declare class ToolContext extends ToolContext_base {
54
+ }
55
+ /**
56
+ * The services a tool may use: file reads, its context, and the endpoint
57
+ * transport (3.2, ADR 0048) — nothing else.
58
+ */
59
+ export type ToolServices = PlainFileStore | ToolContext | SoapTransport;
60
+ /** A tool with its input type erased: what a catalog holds and the CLI runs. */
61
+ export interface ToolShape {
62
+ readonly name: string;
63
+ readonly purpose: string;
64
+ readonly args: Readonly<Record<string, ToolArg>>;
65
+ /** Decodes parsed arguments with the tool's schema, then runs it. */
66
+ readonly execute: (values: Record<string, unknown>) => Effect.Effect<ToolReport, ToolError | ToolArgsError, ToolServices>;
67
+ }
68
+ export interface Tool<I> extends ToolShape {
69
+ readonly input: Schema.Codec<I, unknown>;
70
+ readonly run: (input: I) => Effect.Effect<ToolReport, ToolError, ToolServices>;
71
+ }
72
+ export interface ToolDefinition<I> {
73
+ readonly name: string;
74
+ readonly purpose: string;
75
+ readonly args: Readonly<Record<string, ToolArg>>;
76
+ readonly input: Schema.Codec<I, unknown>;
77
+ readonly run: (input: I) => Effect.Effect<ToolReport, ToolError, ToolServices>;
78
+ }
79
+ export declare const defineTool: <I>(definition: ToolDefinition<I>) => Tool<I>;
80
+ declare const ToolSpec_base: Schema.Class<ToolSpec, Schema.Struct<{
81
+ readonly name: Schema.String;
82
+ readonly purpose: Schema.String;
83
+ readonly args: Schema.$Record<Schema.String, Schema.Struct<{
84
+ readonly description: Schema.String;
85
+ readonly kind: Schema.Literals<readonly ["string", "path", "integer", "boolean", "json"]>;
86
+ readonly required: Schema.optionalKey<Schema.Boolean>;
87
+ readonly default: Schema.optionalKey<Schema.String>;
88
+ }>>;
89
+ }>, {}>;
90
+ /** The spec the CLI prints for `describe` and the brief quotes per preset. */
91
+ export declare class ToolSpec extends ToolSpec_base {
92
+ }
93
+ export declare const specOf: (tool: Pick<ToolShape, "name" | "purpose" | "args">) => ToolSpec;
94
+ export declare const isToolName: (name: string) => boolean;
95
+ /** `describe` text: purpose, then one line per argument. */
96
+ export declare const renderSpec: (spec: ToolSpec) => string;
97
+ /** The one-line usage the brief quotes: `name --a <kind> [--b <kind>]`. */
98
+ export declare const renderUsage: (spec: ToolSpec) => string;
99
+ declare const ToolArgsError_base: Schema.Class<ToolArgsError, Schema.TaggedStruct<"ToolArgsError", {
100
+ readonly tool: Schema.String;
101
+ readonly message: Schema.String;
102
+ }>, import("effect/Cause").YieldableError>;
103
+ export declare class ToolArgsError extends ToolArgsError_base {
104
+ }
105
+ /**
106
+ * `--name value` pairs (a boolean flag stands alone) to the record a tool's
107
+ * input schema decodes: kinds coerce the text, unknown names and a missing
108
+ * required argument are errors that quote the spec.
109
+ */
110
+ export declare const parseToolArgs: (spec: ToolSpec, argv: ReadonlyArray<string>) => Effect.Effect<Record<string, unknown>, ToolArgsError>;
111
+ /** Decodes parsed arguments with the tool's own schema; a failure quotes the spec. */
112
+ export declare const decodeToolInput: <I>(tool: ToolDefinition<I>, values: Record<string, unknown>) => Effect.Effect<I, ToolArgsError>;
113
+ export declare const defaultIssueCap = 50;
114
+ /** The report the CLI prints: issues capped unless `all`, the rest counted. */
115
+ export declare const capReport: (report: ToolReport, all: boolean) => ToolReport;
116
+ /** A plain-text rendering for terminals; the CLI default is JSON. */
117
+ export declare const renderReport: (report: ToolReport) => string;
118
+ /** Reads a document for a tool; a missing file is a `ToolError` naming it. */
119
+ export declare const readToolFile: (tool: string, path: string) => Effect.Effect<string, ToolError, PlainFileStore>;
120
+ export declare const parseJsonDocument: (tool: string, path: string, text: string) => Effect.Effect<unknown, ToolError>;
121
+ export declare const report: (tool: string, issues: ReadonlyArray<{
122
+ readonly path: string;
123
+ readonly detail: string;
124
+ }>, okSummary: string, data?: typeof Schema.Json.Type) => ToolReport;
125
+ export {};
126
+ //# sourceMappingURL=Tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tool.d.ts","sourceRoot":"","sources":["../../src/tools/Tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;;;;;AAElD;;;;;;GAMG;AAEH,qBAAa,SAAU,SAAQ,cAG7B;CAAG;;;;;AAEL,qBAAa,SAAU,SAAQ,cAG7B;CAAG;;;;;;IAQH,oEAAoE;;;;AANtE,6EAA6E;AAC7E,qBAAa,UAAW,SAAQ,eAQ9B;CAAG;AAEL,eAAO,MAAM,WAAW,4EAAoE,CAAA;AAC5F,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAA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