@agenteer/stdlib 1.0.0-rc.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.
- package/README.md +98 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/context/context_curator.d.ts +115 -0
- package/dist/context/context_curator.d.ts.map +1 -0
- package/dist/context/context_curator.js +132 -0
- package/dist/context/context_curator.js.map +1 -0
- package/dist/humans/approval_gate.d.ts +82 -0
- package/dist/humans/approval_gate.d.ts.map +1 -0
- package/dist/humans/approval_gate.js +76 -0
- package/dist/humans/approval_gate.js.map +1 -0
- package/dist/humans/ask_user.d.ts +79 -0
- package/dist/humans/ask_user.d.ts.map +1 -0
- package/dist/humans/ask_user.js +101 -0
- package/dist/humans/ask_user.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/meta/cross_check.d.ts +96 -0
- package/dist/meta/cross_check.d.ts.map +1 -0
- package/dist/meta/cross_check.js +165 -0
- package/dist/meta/cross_check.js.map +1 -0
- package/dist/meta/judge_with_stripped_ctx.d.ts +75 -0
- package/dist/meta/judge_with_stripped_ctx.d.ts.map +1 -0
- package/dist/meta/judge_with_stripped_ctx.js +151 -0
- package/dist/meta/judge_with_stripped_ctx.js.map +1 -0
- package/dist/meta/parallel_fanout.d.ts +83 -0
- package/dist/meta/parallel_fanout.d.ts.map +1 -0
- package/dist/meta/parallel_fanout.js +120 -0
- package/dist/meta/parallel_fanout.js.map +1 -0
- package/dist/meta/repair_loop.d.ts +90 -0
- package/dist/meta/repair_loop.d.ts.map +1 -0
- package/dist/meta/repair_loop.js +230 -0
- package/dist/meta/repair_loop.js.map +1 -0
- package/dist/planner/default_planner.d.ts +88 -0
- package/dist/planner/default_planner.d.ts.map +1 -0
- package/dist/planner/default_planner.js +156 -0
- package/dist/planner/default_planner.js.map +1 -0
- package/dist/primitives/file_read.d.ts +60 -0
- package/dist/primitives/file_read.d.ts.map +1 -0
- package/dist/primitives/file_read.js +68 -0
- package/dist/primitives/file_read.js.map +1 -0
- package/dist/primitives/file_write.d.ts +60 -0
- package/dist/primitives/file_write.d.ts.map +1 -0
- package/dist/primitives/file_write.js +66 -0
- package/dist/primitives/file_write.js.map +1 -0
- package/dist/primitives/llm_call.d.ts +85 -0
- package/dist/primitives/llm_call.d.ts.map +1 -0
- package/dist/primitives/llm_call.js +99 -0
- package/dist/primitives/llm_call.js.map +1 -0
- package/dist/primitives/shell_exec.d.ts +66 -0
- package/dist/primitives/shell_exec.d.ts.map +1 -0
- package/dist/primitives/shell_exec.js +106 -0
- package/dist/primitives/shell_exec.js.map +1 -0
- package/dist/primitives/tool_call.d.ts +62 -0
- package/dist/primitives/tool_call.d.ts.map +1 -0
- package/dist/primitives/tool_call.js +69 -0
- package/dist/primitives/tool_call.js.map +1 -0
- package/dist/shared/capture.d.ts +34 -0
- package/dist/shared/capture.d.ts.map +1 -0
- package/dist/shared/capture.js +124 -0
- package/dist/shared/capture.js.map +1 -0
- package/dist/shared/ctx.d.ts +14 -0
- package/dist/shared/ctx.d.ts.map +1 -0
- package/dist/shared/ctx.js +48 -0
- package/dist/shared/ctx.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/validator.d.ts +47 -0
- package/dist/shared/validator.d.ts.map +1 -0
- package/dist/shared/validator.js +41 -0
- package/dist/shared/validator.js.map +1 -0
- package/dist/validators/compile.d.ts +83 -0
- package/dist/validators/compile.d.ts.map +1 -0
- package/dist/validators/compile.js +126 -0
- package/dist/validators/compile.js.map +1 -0
- package/dist/validators/json_schema_validate.d.ts +72 -0
- package/dist/validators/json_schema_validate.d.ts.map +1 -0
- package/dist/validators/json_schema_validate.js +85 -0
- package/dist/validators/json_schema_validate.js.map +1 -0
- package/dist/validators/regex_check.d.ts +64 -0
- package/dist/validators/regex_check.d.ts.map +1 -0
- package/dist/validators/regex_check.js +85 -0
- package/dist/validators/regex_check.js.map +1 -0
- package/dist/validators/test_run.d.ts +74 -0
- package/dist/validators/test_run.d.ts.map +1 -0
- package/dist/validators/test_run.js +149 -0
- package/dist/validators/test_run.js.map +1 -0
- package/dist/validators/typecheck.d.ts +61 -0
- package/dist/validators/typecheck.d.ts.map +1 -0
- package/dist/validators/typecheck.js +89 -0
- package/dist/validators/typecheck.js.map +1 -0
- package/package.json +61 -0
- package/src/context/context_curator.ts +154 -0
- package/src/humans/approval_gate.ts +101 -0
- package/src/humans/ask_user.ts +137 -0
- package/src/index.ts +149 -0
- package/src/meta/cross_check.ts +219 -0
- package/src/meta/judge_with_stripped_ctx.ts +171 -0
- package/src/meta/parallel_fanout.ts +142 -0
- package/src/meta/repair_loop.ts +267 -0
- package/src/planner/default_planner.ts +182 -0
- package/src/primitives/file_read.ts +82 -0
- package/src/primitives/file_write.ts +80 -0
- package/src/primitives/llm_call.ts +113 -0
- package/src/primitives/shell_exec.ts +122 -0
- package/src/primitives/tool_call.ts +84 -0
- package/src/shared/capture.ts +155 -0
- package/src/shared/ctx.ts +45 -0
- package/src/shared/index.ts +17 -0
- package/src/shared/validator.ts +51 -0
- package/src/validators/compile.ts +175 -0
- package/src/validators/json_schema_validate.ts +103 -0
- package/src/validators/regex_check.ts +107 -0
- package/src/validators/test_run.ts +199 -0
- package/src/validators/typecheck.ts +121 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.js","sourceRoot":"","sources":["../../src/validators/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EAMZ,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,MAAM,EACN,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAE5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MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,uBAAuB,WAAW,IAAI,KAAK,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACnF,CAAC;IACD,WAAW,CAAC,MAAM;QAChB,MAAM,MAAM,GAAqB,EAAE,CAAC;QACpC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9C,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,GAAG,IAAI,IAAI,IAAI,IAAI,GAAG,EAAE;gBAC9B,OAAO,EAAE,GAAI,CAAC,IAAI,EAAE;gBACpB,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;aAClD,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC;AAEF,MAAM,QAAQ,GAA8C;IAC1D,UAAU,EAAE,kBAAkB;CAC/B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-json-schema-validate` — deterministic validator (sub-plan 03 §8).
|
|
3
|
+
*
|
|
4
|
+
* Validates a value against a Zod schema in-process. The "JSON Schema"
|
|
5
|
+
* name reflects the published wire contract (sub-plan 02 §2.4); we use
|
|
6
|
+
* Zod as the runtime validator for M2 since all stdlib consumers are
|
|
7
|
+
* TypeScript. ajv-backed JSON-Schema validation lands alongside the
|
|
8
|
+
* registry in M6.
|
|
9
|
+
*
|
|
10
|
+
* R3 note: validators emit `verdict: "fail"` as DATA on output, not as
|
|
11
|
+
* `Failed`. `Failed` is reserved for "couldn't run at all."
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { type Node } from "@agenteer/core";
|
|
15
|
+
declare const InputSchema: z.ZodObject<{
|
|
16
|
+
value: z.ZodUnknown;
|
|
17
|
+
schema: z.ZodUnknown;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
declare const OutputSchema: z.ZodObject<{
|
|
20
|
+
verdict: z.ZodEnum<{
|
|
21
|
+
pass: "pass";
|
|
22
|
+
fail: "fail";
|
|
23
|
+
}>;
|
|
24
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
25
|
+
path: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
26
|
+
message: z.ZodString;
|
|
27
|
+
code: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
type Input = z.infer<typeof InputSchema>;
|
|
32
|
+
type Output = z.infer<typeof OutputSchema>;
|
|
33
|
+
export declare function jsonSchemaValidateFactory(): Node<Input, Output>;
|
|
34
|
+
export declare const jsonSchemaValidateManifest: {
|
|
35
|
+
manifest_version: 1;
|
|
36
|
+
id: string;
|
|
37
|
+
version: string;
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
required_actions: string[];
|
|
41
|
+
required_capabilities: {
|
|
42
|
+
tool_use: boolean;
|
|
43
|
+
vision: boolean;
|
|
44
|
+
structured_output: "any" | "native" | "text_parse";
|
|
45
|
+
min_context_tokens?: number | undefined;
|
|
46
|
+
};
|
|
47
|
+
dynamic_actions: boolean;
|
|
48
|
+
side_effects: {
|
|
49
|
+
writes_fs: boolean;
|
|
50
|
+
network: boolean;
|
|
51
|
+
mutates_ctx: boolean;
|
|
52
|
+
emits_ctx_variants: string[];
|
|
53
|
+
reads_ctx_variants: string[];
|
|
54
|
+
};
|
|
55
|
+
determinism: "deterministic" | "stochastic";
|
|
56
|
+
tags: string[];
|
|
57
|
+
author: string;
|
|
58
|
+
license: string;
|
|
59
|
+
input_schema?: unknown;
|
|
60
|
+
output_schema?: unknown;
|
|
61
|
+
dynamic_action_spec?: string | undefined;
|
|
62
|
+
homepage?: string | undefined;
|
|
63
|
+
repository?: string | undefined;
|
|
64
|
+
planner_hints?: {
|
|
65
|
+
cost_tier?: "cheap" | "medium" | "expensive" | undefined;
|
|
66
|
+
latency_tier?: "medium" | "fast" | "slow" | undefined;
|
|
67
|
+
typical_use?: string | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
sha256?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=json_schema_validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json_schema_validate.d.ts","sourceRoot":"","sources":["../../src/validators/json_schema_validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,gBAAgB,CAAC;AAYxB,QAAA,MAAM,WAAW;;;iBAKf,CAAC;AAQH,QAAA,MAAM,YAAY;;;;;;;;;;;iBAIhB,CAAC;AAEH,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACzC,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,wBAAgB,yBAAyB,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAqC/D;AAWD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAW,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-json-schema-validate` — deterministic validator (sub-plan 03 §8).
|
|
3
|
+
*
|
|
4
|
+
* Validates a value against a Zod schema in-process. The "JSON Schema"
|
|
5
|
+
* name reflects the published wire contract (sub-plan 02 §2.4); we use
|
|
6
|
+
* Zod as the runtime validator for M2 since all stdlib consumers are
|
|
7
|
+
* TypeScript. ajv-backed JSON-Schema validation lands alongside the
|
|
8
|
+
* registry in M6.
|
|
9
|
+
*
|
|
10
|
+
* R3 note: validators emit `verdict: "fail"` as DATA on output, not as
|
|
11
|
+
* `Failed`. `Failed` is reserved for "couldn't run at all."
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { makeManifest, } from "@agenteer/core";
|
|
15
|
+
const MANIFEST = makeManifest({
|
|
16
|
+
id: "@agenteer/node-json-schema-validate",
|
|
17
|
+
name: "json_schema_validate",
|
|
18
|
+
description: "Validate a value against a caller-supplied schema; return verdict + errors.",
|
|
19
|
+
determinism: "deterministic",
|
|
20
|
+
tags: ["validator"],
|
|
21
|
+
});
|
|
22
|
+
// We accept either a Zod schema reference or a raw "any" schema marker.
|
|
23
|
+
// At M2 the common case is Zod; the JSON-Schema path ships later.
|
|
24
|
+
const InputSchema = z.object({
|
|
25
|
+
/** Value to validate. */
|
|
26
|
+
value: z.unknown(),
|
|
27
|
+
/** Zod schema (pass a z.ZodType directly through the factory; runtime accepts unknown to satisfy I/O shape). */
|
|
28
|
+
schema: z.unknown(),
|
|
29
|
+
});
|
|
30
|
+
const ValidationIssueSchema = z.object({
|
|
31
|
+
path: z.array(z.union([z.string(), z.number()])),
|
|
32
|
+
message: z.string(),
|
|
33
|
+
code: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
const OutputSchema = z.object({
|
|
36
|
+
verdict: z.enum(["pass", "fail"]),
|
|
37
|
+
errors: z.array(ValidationIssueSchema),
|
|
38
|
+
value: z.unknown().optional(),
|
|
39
|
+
});
|
|
40
|
+
export function jsonSchemaValidateFactory() {
|
|
41
|
+
return {
|
|
42
|
+
manifest: MANIFEST,
|
|
43
|
+
inputSchema: InputSchema,
|
|
44
|
+
outputSchema: OutputSchema,
|
|
45
|
+
ctx: [],
|
|
46
|
+
model: null,
|
|
47
|
+
async execute(input) {
|
|
48
|
+
const { value, schema } = input.original;
|
|
49
|
+
if (!isZodType(schema)) {
|
|
50
|
+
return {
|
|
51
|
+
kind: "failed",
|
|
52
|
+
reason: "invalid_input:schema_not_zod",
|
|
53
|
+
retryable: false,
|
|
54
|
+
evidence: { verdict: "fail" },
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const parsed = schema.safeParse(value);
|
|
58
|
+
if (parsed.success) {
|
|
59
|
+
return {
|
|
60
|
+
kind: "output",
|
|
61
|
+
value: { verdict: "pass", errors: [], value: parsed.data },
|
|
62
|
+
evidence: { verdict: "pass" },
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const errors = parsed.error.issues.map((i) => ({
|
|
66
|
+
path: [...i.path],
|
|
67
|
+
message: i.message,
|
|
68
|
+
code: i.code,
|
|
69
|
+
}));
|
|
70
|
+
return {
|
|
71
|
+
kind: "output",
|
|
72
|
+
value: { verdict: "fail", errors },
|
|
73
|
+
evidence: { verdict: "fail" },
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function isZodType(x) {
|
|
79
|
+
return (typeof x === "object" &&
|
|
80
|
+
x !== null &&
|
|
81
|
+
"_def" in x &&
|
|
82
|
+
typeof x.safeParse === "function");
|
|
83
|
+
}
|
|
84
|
+
export const jsonSchemaValidateManifest = MANIFEST;
|
|
85
|
+
//# sourceMappingURL=json_schema_validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json_schema_validate.js","sourceRoot":"","sources":["../../src/validators/json_schema_validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,GAKb,MAAM,gBAAgB,CAAC;AAExB,MAAM,QAAQ,GAAiB,Y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B,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-regex-check` — deterministic regex assertion validator.
|
|
3
|
+
*
|
|
4
|
+
* Runs N `must_match` / `must_not_match` patterns against an input string.
|
|
5
|
+
* Returns `verdict: "fail"` as data per ratified resolution — `Failed`
|
|
6
|
+
* is reserved for "couldn't run at all" (invalid regex, missing input).
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { type Node } from "@agenteer/core";
|
|
10
|
+
import { type ValidatorOutput } from "../shared/index.js";
|
|
11
|
+
declare const InputSchema: z.ZodObject<{
|
|
12
|
+
input: z.ZodString;
|
|
13
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
pattern: z.ZodString;
|
|
16
|
+
kind: z.ZodEnum<{
|
|
17
|
+
must_match: "must_match";
|
|
18
|
+
must_not_match: "must_not_match";
|
|
19
|
+
}>;
|
|
20
|
+
flags: z.ZodOptional<z.ZodString>;
|
|
21
|
+
message: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
type Input = z.input<typeof InputSchema>;
|
|
25
|
+
export declare function regexCheckFactory(): Node<Input, ValidatorOutput>;
|
|
26
|
+
export declare const regexCheckManifest: {
|
|
27
|
+
manifest_version: 1;
|
|
28
|
+
id: string;
|
|
29
|
+
version: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
required_actions: string[];
|
|
33
|
+
required_capabilities: {
|
|
34
|
+
tool_use: boolean;
|
|
35
|
+
vision: boolean;
|
|
36
|
+
structured_output: "any" | "native" | "text_parse";
|
|
37
|
+
min_context_tokens?: number | undefined;
|
|
38
|
+
};
|
|
39
|
+
dynamic_actions: boolean;
|
|
40
|
+
side_effects: {
|
|
41
|
+
writes_fs: boolean;
|
|
42
|
+
network: boolean;
|
|
43
|
+
mutates_ctx: boolean;
|
|
44
|
+
emits_ctx_variants: string[];
|
|
45
|
+
reads_ctx_variants: string[];
|
|
46
|
+
};
|
|
47
|
+
determinism: "deterministic" | "stochastic";
|
|
48
|
+
tags: string[];
|
|
49
|
+
author: string;
|
|
50
|
+
license: string;
|
|
51
|
+
input_schema?: unknown;
|
|
52
|
+
output_schema?: unknown;
|
|
53
|
+
dynamic_action_spec?: string | undefined;
|
|
54
|
+
homepage?: string | undefined;
|
|
55
|
+
repository?: string | undefined;
|
|
56
|
+
planner_hints?: {
|
|
57
|
+
cost_tier?: "cheap" | "medium" | "expensive" | undefined;
|
|
58
|
+
latency_tier?: "medium" | "fast" | "slow" | undefined;
|
|
59
|
+
typical_use?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
sha256?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=regex_check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex_check.d.ts","sourceRoot":"","sources":["../../src/validators/regex_check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,IAAI,EAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAqB5B,QAAA,MAAM,WAAW;;;;;;;;;;;;iBAGf,CAAC;AAEH,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzC,wBAAgB,iBAAiB,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,CAsDhE;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAW,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-regex-check` — deterministic regex assertion validator.
|
|
3
|
+
*
|
|
4
|
+
* Runs N `must_match` / `must_not_match` patterns against an input string.
|
|
5
|
+
* Returns `verdict: "fail"` as data per ratified resolution — `Failed`
|
|
6
|
+
* is reserved for "couldn't run at all" (invalid regex, missing input).
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { makeManifest, } from "@agenteer/core";
|
|
10
|
+
import { failOutput, passOutput, ValidatorOutputSchema, } from "../shared/index.js";
|
|
11
|
+
const MANIFEST = makeManifest({
|
|
12
|
+
id: "@agenteer/node-regex-check",
|
|
13
|
+
name: "regex_check",
|
|
14
|
+
description: "Assert an input satisfies a set of must-match / must-not-match regex rules.",
|
|
15
|
+
determinism: "deterministic",
|
|
16
|
+
tags: ["validator"],
|
|
17
|
+
});
|
|
18
|
+
const RuleSchema = z.object({
|
|
19
|
+
id: z.string().min(1),
|
|
20
|
+
pattern: z.string().min(1),
|
|
21
|
+
kind: z.enum(["must_match", "must_not_match"]),
|
|
22
|
+
/** Regex flags (e.g. `i`, `m`). Invalid flags → Failed. */
|
|
23
|
+
flags: z.string().optional(),
|
|
24
|
+
/** Human-readable message used when this rule fails. */
|
|
25
|
+
message: z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
const InputSchema = z.object({
|
|
28
|
+
input: z.string(),
|
|
29
|
+
rules: z.array(RuleSchema).min(1),
|
|
30
|
+
});
|
|
31
|
+
export function regexCheckFactory() {
|
|
32
|
+
return {
|
|
33
|
+
manifest: MANIFEST,
|
|
34
|
+
inputSchema: InputSchema,
|
|
35
|
+
outputSchema: ValidatorOutputSchema,
|
|
36
|
+
ctx: [],
|
|
37
|
+
model: null,
|
|
38
|
+
async execute(input) {
|
|
39
|
+
const { input: text, rules } = input.original;
|
|
40
|
+
const issues = [];
|
|
41
|
+
for (const rule of rules) {
|
|
42
|
+
let re;
|
|
43
|
+
try {
|
|
44
|
+
re = new RegExp(rule.pattern, rule.flags);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
return {
|
|
48
|
+
kind: "failed",
|
|
49
|
+
reason: `invalid_regex:${rule.id}`,
|
|
50
|
+
retryable: false,
|
|
51
|
+
details: { error: err instanceof Error ? err.message : String(err) },
|
|
52
|
+
evidence: { verdict: "fail" },
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const matched = re.test(text);
|
|
56
|
+
if (rule.kind === "must_match" && !matched) {
|
|
57
|
+
issues.push({
|
|
58
|
+
path: rule.id,
|
|
59
|
+
message: rule.message ?? `expected /${rule.pattern}/ to match`,
|
|
60
|
+
code: "must_match",
|
|
61
|
+
severity: "error",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else if (rule.kind === "must_not_match" && matched) {
|
|
65
|
+
issues.push({
|
|
66
|
+
path: rule.id,
|
|
67
|
+
message: rule.message ?? `expected /${rule.pattern}/ NOT to match`,
|
|
68
|
+
code: "must_not_match",
|
|
69
|
+
severity: "error",
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const out = issues.length === 0
|
|
74
|
+
? passOutput(`all ${rules.length} regex rule(s) passed`)
|
|
75
|
+
: failOutput(issues, `${issues.length} of ${rules.length} regex rule(s) failed`);
|
|
76
|
+
return {
|
|
77
|
+
kind: "output",
|
|
78
|
+
value: out,
|
|
79
|
+
evidence: { verdict: out.verdict },
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export const regexCheckManifest = MANIFEST;
|
|
85
|
+
//# sourceMappingURL=regex_check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex_check.js","sourceRoot":"","sources":["../../src/validators/regex_check.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,GAKb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,UAAU,EAGV,qBA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AM,KAAK,CAAC;gBACjB,CAAC,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC;gBACxD,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,OAAO,KAAK,CAAC,MAAM,uBAAuB,CAAC,CAAC;YAErF,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,GAAG;gBACV,QAAQ,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;aACnC,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-test-run` — deterministic test-suite validator
|
|
3
|
+
* (sub-plan 03 §7).
|
|
4
|
+
*
|
|
5
|
+
* M4 ships a vitest adapter. Runs `vitest run --reporter=json` in the
|
|
6
|
+
* declared cwd, parses per-test results, surfaces failures as structured
|
|
7
|
+
* issues. Verdict is DATA; `Failed` is reserved for "couldn't run at all"
|
|
8
|
+
* (binary missing, denylist, capability denied).
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { type Node } from "@agenteer/core";
|
|
12
|
+
import { type ValidatorIssue, type ValidatorOutput } from "../shared/index.js";
|
|
13
|
+
declare const InputSchema: z.ZodObject<{
|
|
14
|
+
framework: z.ZodEnum<{
|
|
15
|
+
vitest: "vitest";
|
|
16
|
+
}>;
|
|
17
|
+
cwd: z.ZodString;
|
|
18
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
19
|
+
flags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
20
|
+
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
type Input = z.input<typeof InputSchema>;
|
|
23
|
+
export declare function testRunFactory(): Node<Input, ValidatorOutput>;
|
|
24
|
+
export declare const testRunManifest: {
|
|
25
|
+
manifest_version: 1;
|
|
26
|
+
id: string;
|
|
27
|
+
version: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
required_actions: string[];
|
|
31
|
+
required_capabilities: {
|
|
32
|
+
tool_use: boolean;
|
|
33
|
+
vision: boolean;
|
|
34
|
+
structured_output: "any" | "native" | "text_parse";
|
|
35
|
+
min_context_tokens?: number | undefined;
|
|
36
|
+
};
|
|
37
|
+
dynamic_actions: boolean;
|
|
38
|
+
side_effects: {
|
|
39
|
+
writes_fs: boolean;
|
|
40
|
+
network: boolean;
|
|
41
|
+
mutates_ctx: boolean;
|
|
42
|
+
emits_ctx_variants: string[];
|
|
43
|
+
reads_ctx_variants: string[];
|
|
44
|
+
};
|
|
45
|
+
determinism: "deterministic" | "stochastic";
|
|
46
|
+
tags: string[];
|
|
47
|
+
author: string;
|
|
48
|
+
license: string;
|
|
49
|
+
input_schema?: unknown;
|
|
50
|
+
output_schema?: unknown;
|
|
51
|
+
dynamic_action_spec?: string | undefined;
|
|
52
|
+
homepage?: string | undefined;
|
|
53
|
+
repository?: string | undefined;
|
|
54
|
+
planner_hints?: {
|
|
55
|
+
cost_tier?: "cheap" | "medium" | "expensive" | undefined;
|
|
56
|
+
latency_tier?: "medium" | "fast" | "slow" | undefined;
|
|
57
|
+
typical_use?: string | undefined;
|
|
58
|
+
} | undefined;
|
|
59
|
+
sha256?: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
export interface TestReport {
|
|
62
|
+
testCount: number;
|
|
63
|
+
issues: ValidatorIssue[];
|
|
64
|
+
}
|
|
65
|
+
export interface TestAdapter {
|
|
66
|
+
readonly framework: string;
|
|
67
|
+
command(opts: {
|
|
68
|
+
filter?: string;
|
|
69
|
+
flags: readonly string[];
|
|
70
|
+
}): string;
|
|
71
|
+
parseReport(stdout: string, stderr: string): TestReport;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=test_run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_run.d.ts","sourceRoot":"","sources":["../../src/validators/test_run.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,IAAI,EAMV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAa5B,QAAA,MAAM,WAAW;;;;;;;;iBAOf,CAAC;AAEH,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzC,wBAAgB,cAAc,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,CAqE7D;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAW,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GAAG,MAAM,CAAC;IACrE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;CACzD"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-test-run` — deterministic test-suite validator
|
|
3
|
+
* (sub-plan 03 §7).
|
|
4
|
+
*
|
|
5
|
+
* M4 ships a vitest adapter. Runs `vitest run --reporter=json` in the
|
|
6
|
+
* declared cwd, parses per-test results, surfaces failures as structured
|
|
7
|
+
* issues. Verdict is DATA; `Failed` is reserved for "couldn't run at all"
|
|
8
|
+
* (binary missing, denylist, capability denied).
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { makeManifest, authorizeOperation, } from "@agenteer/core";
|
|
12
|
+
import { failOutput, passOutput, runCommand, tailOf, ValidatorOutputSchema, } from "../shared/index.js";
|
|
13
|
+
const MANIFEST = makeManifest({
|
|
14
|
+
id: "@agenteer/node-test-run",
|
|
15
|
+
name: "test_run",
|
|
16
|
+
description: "Run a test suite (v1: vitest). Returns structured per-test failures.",
|
|
17
|
+
determinism: "deterministic",
|
|
18
|
+
required_actions: ["shell.exec:"],
|
|
19
|
+
dynamic_actions: true,
|
|
20
|
+
dynamic_action_spec: "fs.read:${input.cwd}",
|
|
21
|
+
tags: ["validator"],
|
|
22
|
+
});
|
|
23
|
+
const InputSchema = z.object({
|
|
24
|
+
framework: z.enum(["vitest"]),
|
|
25
|
+
cwd: z.string().min(1),
|
|
26
|
+
/** Optional test name or path filter. */
|
|
27
|
+
filter: z.string().optional(),
|
|
28
|
+
flags: z.array(z.string()).default([]),
|
|
29
|
+
timeout_ms: z.number().int().min(1).max(1_800_000).default(600_000),
|
|
30
|
+
});
|
|
31
|
+
export function testRunFactory() {
|
|
32
|
+
return {
|
|
33
|
+
manifest: MANIFEST,
|
|
34
|
+
inputSchema: InputSchema,
|
|
35
|
+
outputSchema: ValidatorOutputSchema,
|
|
36
|
+
ctx: [],
|
|
37
|
+
model: null,
|
|
38
|
+
async execute(input, handle) {
|
|
39
|
+
const { framework, cwd, filter, flags } = input.original;
|
|
40
|
+
const timeout_ms = input.original.timeout_ms ?? 600_000;
|
|
41
|
+
try {
|
|
42
|
+
authorizeOperation(handle.granted, { kind: "shell.exec" });
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
return {
|
|
46
|
+
kind: "failed",
|
|
47
|
+
reason: `permission_denied: ${err instanceof Error ? err.message : String(err)}`,
|
|
48
|
+
retryable: false,
|
|
49
|
+
evidence: { verdict: "fail" },
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const adapter = ADAPTERS[framework];
|
|
53
|
+
const command = adapter.command({ ...(filter !== undefined ? { filter } : {}), flags: flags ?? [] });
|
|
54
|
+
try {
|
|
55
|
+
const r = await runCommand(command, { cwd, timeout_ms, signal: handle.signal });
|
|
56
|
+
const parsed = adapter.parseReport(r.stdout, r.stderr);
|
|
57
|
+
const failed = parsed.issues.filter((i) => i.severity === "error");
|
|
58
|
+
const verdict = r.exit_code === 0 && failed.length === 0 ? "pass" : "fail";
|
|
59
|
+
const out = verdict === "pass"
|
|
60
|
+
? {
|
|
61
|
+
...passOutput(`${framework} passed (${parsed.testCount} tests, ${r.duration_ms}ms)`),
|
|
62
|
+
exit_code: r.exit_code,
|
|
63
|
+
}
|
|
64
|
+
: failOutput(parsed.issues.length
|
|
65
|
+
? parsed.issues
|
|
66
|
+
: [
|
|
67
|
+
{
|
|
68
|
+
message: `${framework} exited ${r.exit_code}${r.timed_out ? " (timed out)" : ""}`,
|
|
69
|
+
severity: "error",
|
|
70
|
+
},
|
|
71
|
+
], `${framework}: ${failed.length} test(s) failed`, {
|
|
72
|
+
exit_code: r.exit_code,
|
|
73
|
+
stdout_tail: tailOf(r.stdout),
|
|
74
|
+
stderr_tail: tailOf(r.stderr),
|
|
75
|
+
});
|
|
76
|
+
return { kind: "output", value: out, evidence: { verdict } };
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
return {
|
|
80
|
+
kind: "failed",
|
|
81
|
+
reason: err instanceof Error ? err.message : String(err),
|
|
82
|
+
retryable: true,
|
|
83
|
+
evidence: { verdict: "fail" },
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export const testRunManifest = MANIFEST;
|
|
90
|
+
/** Parse Vitest's `--reporter=json` output when it's present; fall back to stdout. */
|
|
91
|
+
const VITEST_ADAPTER = {
|
|
92
|
+
framework: "vitest",
|
|
93
|
+
command(opts) {
|
|
94
|
+
const filter = opts.filter ? ` ${JSON.stringify(opts.filter)}` : "";
|
|
95
|
+
const extra = opts.flags.join(" ");
|
|
96
|
+
return `npx -y vitest run --reporter=json${filter} ${extra}`.replace(/\s+/g, " ").trim();
|
|
97
|
+
},
|
|
98
|
+
parseReport(stdout, _stderr) {
|
|
99
|
+
const json = extractLastJson(stdout);
|
|
100
|
+
if (!json)
|
|
101
|
+
return { testCount: 0, issues: [] };
|
|
102
|
+
const issues = [];
|
|
103
|
+
let testCount = 0;
|
|
104
|
+
const testResults = json.testResults ??
|
|
105
|
+
[];
|
|
106
|
+
for (const file of testResults) {
|
|
107
|
+
for (const t of file.testResults ?? []) {
|
|
108
|
+
testCount += 1;
|
|
109
|
+
if (t.status === "failed") {
|
|
110
|
+
issues.push({
|
|
111
|
+
path: `${file.name ?? "<file>"}::${t.fullName ?? t.name ?? "<test>"}`,
|
|
112
|
+
message: (t.failureMessages ?? ["failed"]).join("\n"),
|
|
113
|
+
code: "test_failed",
|
|
114
|
+
severity: "error",
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return { testCount, issues };
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
const ADAPTERS = {
|
|
123
|
+
vitest: VITEST_ADAPTER,
|
|
124
|
+
};
|
|
125
|
+
function extractLastJson(text) {
|
|
126
|
+
// Vitest prints the JSON report on its own line; a few noisy warnings
|
|
127
|
+
// can precede it. Walk backwards and take the last balanced `{...}`.
|
|
128
|
+
const idx = text.lastIndexOf("}");
|
|
129
|
+
if (idx < 0)
|
|
130
|
+
return null;
|
|
131
|
+
let depth = 0;
|
|
132
|
+
for (let i = idx; i >= 0; i -= 1) {
|
|
133
|
+
const ch = text[i];
|
|
134
|
+
if (ch === "}")
|
|
135
|
+
depth += 1;
|
|
136
|
+
else if (ch === "{")
|
|
137
|
+
depth -= 1;
|
|
138
|
+
if (depth === 0) {
|
|
139
|
+
try {
|
|
140
|
+
return JSON.parse(text.slice(i, idx + 1));
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=test_run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_run.js","sourceRoot":"","sources":["../../src/validators/test_run.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EAMZ,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,UAAU,EACV,UAAU,EACV,MAAM,EACN,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,QAAQ,GAAiB,YAAY,CAAC;IAC1C,EAAE,EAAE,yBAAyB;IAC7B,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,sEAAsE;IACnF,WAAW,EAAE,eAAe;IAC5B,gBAAgB,EAAE,CAAC,aAAa,CAAC;IACjC,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,sBAAsB;IAC3C,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC7B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtB,yCAAyC;IACzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG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BACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@agenteer/node-typecheck` — thin wrapper over `compile` with
|
|
3
|
+
* types-only flags (sub-plan 03 §10).
|
|
4
|
+
*
|
|
5
|
+
* v1 supports TypeScript (`tsc --noEmit --strict`). The wrapper exists
|
|
6
|
+
* separately from `compile` so planners can distinguish "types only"
|
|
7
|
+
* from "full build"; the underlying adapter is shared.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { type Node } from "@agenteer/core";
|
|
11
|
+
import { type ValidatorOutput } from "../shared/index.js";
|
|
12
|
+
declare const InputSchema: z.ZodObject<{
|
|
13
|
+
language: z.ZodEnum<{
|
|
14
|
+
typescript: "typescript";
|
|
15
|
+
}>;
|
|
16
|
+
cwd: z.ZodString;
|
|
17
|
+
tsconfig: z.ZodOptional<z.ZodString>;
|
|
18
|
+
strict: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
type Input = z.input<typeof InputSchema>;
|
|
22
|
+
export declare function typecheckFactory(): Node<Input, ValidatorOutput>;
|
|
23
|
+
export declare const typecheckManifest: {
|
|
24
|
+
manifest_version: 1;
|
|
25
|
+
id: string;
|
|
26
|
+
version: string;
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
required_actions: string[];
|
|
30
|
+
required_capabilities: {
|
|
31
|
+
tool_use: boolean;
|
|
32
|
+
vision: boolean;
|
|
33
|
+
structured_output: "any" | "native" | "text_parse";
|
|
34
|
+
min_context_tokens?: number | undefined;
|
|
35
|
+
};
|
|
36
|
+
dynamic_actions: boolean;
|
|
37
|
+
side_effects: {
|
|
38
|
+
writes_fs: boolean;
|
|
39
|
+
network: boolean;
|
|
40
|
+
mutates_ctx: boolean;
|
|
41
|
+
emits_ctx_variants: string[];
|
|
42
|
+
reads_ctx_variants: string[];
|
|
43
|
+
};
|
|
44
|
+
determinism: "deterministic" | "stochastic";
|
|
45
|
+
tags: string[];
|
|
46
|
+
author: string;
|
|
47
|
+
license: string;
|
|
48
|
+
input_schema?: unknown;
|
|
49
|
+
output_schema?: unknown;
|
|
50
|
+
dynamic_action_spec?: string | undefined;
|
|
51
|
+
homepage?: string | undefined;
|
|
52
|
+
repository?: string | undefined;
|
|
53
|
+
planner_hints?: {
|
|
54
|
+
cost_tier?: "cheap" | "medium" | "expensive" | undefined;
|
|
55
|
+
latency_tier?: "medium" | "fast" | "slow" | undefined;
|
|
56
|
+
typical_use?: string | undefined;
|
|
57
|
+
} | undefined;
|
|
58
|
+
sha256?: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=typecheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typecheck.d.ts","sourceRoot":"","sources":["../../src/validators/typecheck.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,IAAI,EAMV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,oBAAoB,CAAC;AAa5B,QAAA,MAAM,WAAW;;;;;;;;iBAMf,CAAC;AAEH,KAAK,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAIzC,wBAAgB,gBAAgB,IAAI,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,CAkE/D;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAW,CAAC"}
|