vigiles 20.0.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/claude-code/typed-spec.d.ts +38 -1
- package/dist/adapters/claude-code/typed-spec.js +20 -3
- package/dist/core/spec.d.ts +61 -13
- package/dist/core/spec.js +42 -12
- package/dist/linting.d.ts +1 -1
- package/dist/linting.js +2 -3
- package/dist/scaffold-test.js +1 -1
- package/package.json +1 -1
|
@@ -48,7 +48,44 @@ export interface ClaudeCodeToolVocabulary extends ToolVocabulary {
|
|
|
48
48
|
* runtime (it IS the core builder); the only difference is the typed `tools`
|
|
49
49
|
* constraint. `P` is inferred from the literal `purity` field.
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
declare function agentSpec<const P extends AuthoredPurity | undefined = undefined>(spec: AgentSpecInput<P, ClaudeCodeToolVocabulary>): AgentSpec;
|
|
52
|
+
/**
|
|
53
|
+
* The Claude Code subagent root. Carries the SAME vocabulary members as the core
|
|
54
|
+
* builder, and it must: they stopped being standalone exports when the vocabulary
|
|
55
|
+
* moved onto the root, so an author who picked this door would otherwise have no
|
|
56
|
+
* way to reach them — the same asymmetry `experimental_skill.input()` closed.
|
|
57
|
+
*
|
|
58
|
+
* @experimental
|
|
59
|
+
*/
|
|
60
|
+
export declare const experimental_agent: typeof agentSpec & {
|
|
61
|
+
result: <const Ok extends import("../../core/spec.js").Shape, const Err extends import("../../core/spec.js").Shape>(ok: Ok, err: Err) => import("../../core/spec.js").OutputContract<Ok, Err>;
|
|
62
|
+
delegate: (agent: string, task?: string, needsContract?: import("../../core/spec.js").Shape) => import("../../core/spec.js").RailwayStep;
|
|
63
|
+
railway: (spec: Omit<import("../../core/spec.js").Railway, "_specType">) => import("../../core/spec.js").Railway;
|
|
64
|
+
needs: <const N extends import("../../core/spec.js").Shape>(shape: N) => import("../../core/spec.js").NeedsContract<N>;
|
|
65
|
+
pipeStep: <Needs extends import("../../core/spec.js").Shape, Ok extends import("../../core/spec.js").Shape, Err extends import("../../core/spec.js").Shape>(a: import("../../core/spec.js").TypedAgentSpec<Ok, Err>, needsContract?: Needs) => import("../../core/spec.js").PipeStep<Needs, Ok, Err>;
|
|
66
|
+
start: <Ok extends import("../../core/spec.js").Shape, Err extends import("../../core/spec.js").Shape>(first: import("../../core/spec.js").PipeStep<Record<string, never>, Ok, Err> | import("../../core/spec.js").TypedAgentSpec<Ok, Err>) => import("../../core/spec.js").Pipeline<Ok, Err>;
|
|
67
|
+
andThen: <PriorOk extends import("../../core/spec.js").Shape, PriorErr extends import("../../core/spec.js").Shape, Needs extends import("../../core/spec.js").Shape, Ok extends import("../../core/spec.js").Shape, Err extends import("../../core/spec.js").Shape>(prior: import("../../core/spec.js").Pipeline<PriorOk, PriorErr>, next: import("../../core/spec.js").Supplies<PriorOk, Needs> extends true ? import("../../core/spec.js").PipeStep<Needs, Ok, Err> : {
|
|
68
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<PriorOk, Needs>;
|
|
69
|
+
}) => import("../../core/spec.js").Pipeline<Ok, PriorErr | Err>;
|
|
70
|
+
pipe: {
|
|
71
|
+
<A extends import("../../core/spec.js").Shape, AE extends import("../../core/spec.js").Shape>(a: import("../../core/spec.js").TypedAgentSpec<A, AE>): import("../../core/spec.js").Pipeline<A, AE>;
|
|
72
|
+
<A extends import("../../core/spec.js").Shape, AE extends import("../../core/spec.js").Shape, BN extends import("../../core/spec.js").Shape, B extends import("../../core/spec.js").Shape, BE extends import("../../core/spec.js").Shape>(a: import("../../core/spec.js").TypedAgentSpec<A, AE>, b: import("../../core/spec.js").Supplies<A, BN> extends true ? import("../../core/spec.js").PipeStep<BN, B, BE> : {
|
|
73
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<A, BN>;
|
|
74
|
+
}): import("../../core/spec.js").Pipeline<B, AE | BE>;
|
|
75
|
+
<A extends import("../../core/spec.js").Shape, AE extends import("../../core/spec.js").Shape, BN extends import("../../core/spec.js").Shape, B extends import("../../core/spec.js").Shape, BE extends import("../../core/spec.js").Shape, CN extends import("../../core/spec.js").Shape, C extends import("../../core/spec.js").Shape, CE extends import("../../core/spec.js").Shape>(a: import("../../core/spec.js").TypedAgentSpec<A, AE>, b: import("../../core/spec.js").Supplies<A, BN> extends true ? import("../../core/spec.js").PipeStep<BN, B, BE> : {
|
|
76
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<A, BN>;
|
|
77
|
+
}, c: import("../../core/spec.js").Supplies<B, CN> extends true ? import("../../core/spec.js").PipeStep<CN, C, CE> : {
|
|
78
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<B, CN>;
|
|
79
|
+
}): import("../../core/spec.js").Pipeline<C, AE | BE | CE>;
|
|
80
|
+
<A extends import("../../core/spec.js").Shape, AE extends import("../../core/spec.js").Shape, BN extends import("../../core/spec.js").Shape, B extends import("../../core/spec.js").Shape, BE extends import("../../core/spec.js").Shape, CN extends import("../../core/spec.js").Shape, C extends import("../../core/spec.js").Shape, CE extends import("../../core/spec.js").Shape, DN extends import("../../core/spec.js").Shape, D extends import("../../core/spec.js").Shape, DE extends import("../../core/spec.js").Shape>(a: import("../../core/spec.js").TypedAgentSpec<A, AE>, b: import("../../core/spec.js").Supplies<A, BN> extends true ? import("../../core/spec.js").PipeStep<BN, B, BE> : {
|
|
81
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<A, BN>;
|
|
82
|
+
}, c: import("../../core/spec.js").Supplies<B, CN> extends true ? import("../../core/spec.js").PipeStep<CN, C, CE> : {
|
|
83
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<B, CN>;
|
|
84
|
+
}, d: import("../../core/spec.js").Supplies<C, DN> extends true ? import("../../core/spec.js").PipeStep<DN, D, DE> : {
|
|
85
|
+
readonly __HANDOFF_ERROR: import("../../core/spec.js").Supplies<C, DN>;
|
|
86
|
+
}): import("../../core/spec.js").Pipeline<D, AE | BE | CE | DE>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
52
89
|
/**
|
|
53
90
|
* Define a Claude Code skill with the purity floor enforced AT COMPILE TIME
|
|
54
91
|
* against the Claude Code tool catalog. Identical to the core
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.experimental_skill = void 0;
|
|
4
|
-
exports.experimental_agent = experimental_agent;
|
|
3
|
+
exports.experimental_skill = exports.experimental_agent = void 0;
|
|
5
4
|
/**
|
|
6
5
|
* Typed Claude Code authoring surface — the compile-time half of the purity
|
|
7
6
|
* contract, bound to the Claude Code tool vocabulary.
|
|
@@ -41,9 +40,27 @@ const spec_js_1 = require("../../core/spec.js");
|
|
|
41
40
|
* runtime (it IS the core builder); the only difference is the typed `tools`
|
|
42
41
|
* constraint. `P` is inferred from the literal `purity` field.
|
|
43
42
|
*/
|
|
44
|
-
function
|
|
43
|
+
function agentSpec(spec) {
|
|
45
44
|
return (0, spec_js_1.experimental_agent)(spec);
|
|
46
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* The Claude Code subagent root. Carries the SAME vocabulary members as the core
|
|
48
|
+
* builder, and it must: they stopped being standalone exports when the vocabulary
|
|
49
|
+
* moved onto the root, so an author who picked this door would otherwise have no
|
|
50
|
+
* way to reach them — the same asymmetry `experimental_skill.input()` closed.
|
|
51
|
+
*
|
|
52
|
+
* @experimental
|
|
53
|
+
*/
|
|
54
|
+
exports.experimental_agent = Object.assign(agentSpec, {
|
|
55
|
+
result: spec_js_1.experimental_agent.result,
|
|
56
|
+
delegate: spec_js_1.experimental_agent.delegate,
|
|
57
|
+
railway: spec_js_1.experimental_agent.railway,
|
|
58
|
+
needs: spec_js_1.experimental_agent.needs,
|
|
59
|
+
pipeStep: spec_js_1.experimental_agent.pipeStep,
|
|
60
|
+
start: spec_js_1.experimental_agent.start,
|
|
61
|
+
andThen: spec_js_1.experimental_agent.andThen,
|
|
62
|
+
pipe: spec_js_1.experimental_agent.pipe,
|
|
63
|
+
});
|
|
47
64
|
/**
|
|
48
65
|
* Define a Claude Code skill with the purity floor enforced AT COMPILE TIME
|
|
49
66
|
* against the Claude Code tool catalog. Identical to the core
|
package/dist/core/spec.d.ts
CHANGED
|
@@ -717,7 +717,7 @@ export type OkOf<T> = T extends TypedOutcome<infer Ok, Shape> ? Ok : Shape;
|
|
|
717
717
|
* loaded a compiled `agents/code-reviewer.md`, dispatched to it and read it,
|
|
718
718
|
* 100% of trials — stronger end-to-end evidence than `experimental_skill` has.
|
|
719
719
|
*/
|
|
720
|
-
|
|
720
|
+
declare function agentSpec<const P extends AuthoredPurity | undefined = undefined, V extends ToolVocabulary = OpenToolVocabulary, Ok extends Shape = Shape, Err extends Shape = Shape>(spec: AgentSpecInput<P, V, Ok, Err>): TypedAgentSpec<Ok, Err>;
|
|
721
721
|
/**
|
|
722
722
|
* The field types a result contract can declare (kept tiny + dependency-free).
|
|
723
723
|
*
|
|
@@ -771,8 +771,9 @@ export interface OutputContract<Ok extends Shape = Shape, Err extends Shape = Sh
|
|
|
771
771
|
* cross-reference one agent's `ok` against the next agent's needs at `tsc` time.
|
|
772
772
|
* The return is still an `OutputContract`, so every existing consumer (the
|
|
773
773
|
* `output:` field, `renderOutputContract`, `parseAgentResult`) is unchanged.
|
|
774
|
+
|
|
774
775
|
*/
|
|
775
|
-
|
|
776
|
+
declare function result<const Ok extends Shape, const Err extends Shape>(ok: Ok, err: Err): OutputContract<Ok, Err>;
|
|
776
777
|
/** One step on a railway: dispatch a flat subagent (the "activity"). */
|
|
777
778
|
export interface RailwayStep {
|
|
778
779
|
readonly _step: "delegate";
|
|
@@ -803,8 +804,9 @@ export interface RailwayStep {
|
|
|
803
804
|
* handoff that doesn't line up is a `tsc` error naming the offending field.
|
|
804
805
|
* Omitting it (the historical 1-/2-arg call) keeps the exact string-path
|
|
805
806
|
* behavior — fully backwards-compatible.
|
|
807
|
+
|
|
806
808
|
*/
|
|
807
|
-
|
|
809
|
+
declare function delegate(agent: string, task?: string, needsContract?: Shape): RailwayStep;
|
|
808
810
|
/**
|
|
809
811
|
* A railway over flat subagents. `steps` run in order on the success track; the
|
|
810
812
|
* first step that returns an error short-circuits to `onError`. `recover`
|
|
@@ -833,8 +835,9 @@ export interface Railway {
|
|
|
833
835
|
* onError: delegate("reporter"),
|
|
834
836
|
* recover: { step: delegate("fixer"), max: 2 },
|
|
835
837
|
* })
|
|
838
|
+
|
|
836
839
|
*/
|
|
837
|
-
|
|
840
|
+
declare function railway(spec: Omit<Railway, "_specType">): Railway;
|
|
838
841
|
/**
|
|
839
842
|
* A subagent's INPUT contract — the fields it reads from the prior step's `ok`.
|
|
840
843
|
* Declared via `needs(...)` and threaded into the typed agent so `pipe` can
|
|
@@ -854,8 +857,9 @@ export type NeedsContract<N extends Shape> = N;
|
|
|
854
857
|
*
|
|
855
858
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
856
859
|
* public API (pre-1.0); may change without a major bump.
|
|
860
|
+
|
|
857
861
|
*/
|
|
858
|
-
|
|
862
|
+
declare function experimental_needs<const N extends Shape>(shape: N): NeedsContract<N>;
|
|
859
863
|
/**
|
|
860
864
|
* A typed pipeline step: a `TypedAgentSpec` paired with the input `needs` it
|
|
861
865
|
* reads from the prior step's `ok`. `step()` builds one; `pipe` checks that the
|
|
@@ -878,8 +882,9 @@ export interface PipeStep<Needs extends Shape, Ok extends Shape, Err extends Sha
|
|
|
878
882
|
*
|
|
879
883
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
880
884
|
* public API (pre-1.0); may change without a major bump.
|
|
885
|
+
|
|
881
886
|
*/
|
|
882
|
-
|
|
887
|
+
declare function experimental_pipeStep<Needs extends Shape, Ok extends Shape, Err extends Shape>(a: TypedAgentSpec<Ok, Err>, needsContract?: Needs): PipeStep<Needs, Ok, Err>;
|
|
883
888
|
/**
|
|
884
889
|
* True iff `Producer` provides EVERY field `Consumer` needs, with matching
|
|
885
890
|
* field types. When satisfiable it is `true`; otherwise it collapses to a
|
|
@@ -940,8 +945,9 @@ export interface Pipeline<Ok extends Shape, Err extends Shape> {
|
|
|
940
945
|
*
|
|
941
946
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
942
947
|
* public API (pre-1.0); may change without a major bump.
|
|
948
|
+
|
|
943
949
|
*/
|
|
944
|
-
|
|
950
|
+
declare function experimental_start<Ok extends Shape, Err extends Shape>(first: PipeStep<Record<string, never>, Ok, Err> | TypedAgentSpec<Ok, Err>): Pipeline<Ok, Err>;
|
|
945
951
|
/**
|
|
946
952
|
* Append a step to a typed pipeline. The handoff is CHECKED: the constraint
|
|
947
953
|
* `Supplies<PriorOk, Needs>` must be `true`, else the `next` parameter's type
|
|
@@ -955,8 +961,9 @@ export declare function experimental_start<Ok extends Shape, Err extends Shape>(
|
|
|
955
961
|
*
|
|
956
962
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
957
963
|
* public API (pre-1.0); may change without a major bump.
|
|
964
|
+
|
|
958
965
|
*/
|
|
959
|
-
|
|
966
|
+
declare function experimental_andThen<PriorOk extends Shape, PriorErr extends Shape, Needs extends Shape, Ok extends Shape, Err extends Shape>(prior: Pipeline<PriorOk, PriorErr>, next: Supplies<PriorOk, Needs> extends true ? PipeStep<Needs, Ok, Err> : {
|
|
960
967
|
readonly __HANDOFF_ERROR: Supplies<PriorOk, Needs>;
|
|
961
968
|
}): Pipeline<Ok, PriorErr | Err>;
|
|
962
969
|
/**
|
|
@@ -979,16 +986,16 @@ export declare function experimental_andThen<PriorOk extends Shape, PriorErr ext
|
|
|
979
986
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
980
987
|
* public API (pre-1.0); may change without a major bump.
|
|
981
988
|
*/
|
|
982
|
-
|
|
983
|
-
|
|
989
|
+
declare function experimental_pipe<A extends Shape, AE extends Shape>(a: TypedAgentSpec<A, AE>): Pipeline<A, AE>;
|
|
990
|
+
declare function experimental_pipe<A extends Shape, AE extends Shape, BN extends Shape, B extends Shape, BE extends Shape>(a: TypedAgentSpec<A, AE>, b: Supplies<A, BN> extends true ? PipeStep<BN, B, BE> : {
|
|
984
991
|
readonly __HANDOFF_ERROR: Supplies<A, BN>;
|
|
985
992
|
}): Pipeline<B, AE | BE>;
|
|
986
|
-
|
|
993
|
+
declare function experimental_pipe<A extends Shape, AE extends Shape, BN extends Shape, B extends Shape, BE extends Shape, CN extends Shape, C extends Shape, CE extends Shape>(a: TypedAgentSpec<A, AE>, b: Supplies<A, BN> extends true ? PipeStep<BN, B, BE> : {
|
|
987
994
|
readonly __HANDOFF_ERROR: Supplies<A, BN>;
|
|
988
995
|
}, c: Supplies<B, CN> extends true ? PipeStep<CN, C, CE> : {
|
|
989
996
|
readonly __HANDOFF_ERROR: Supplies<B, CN>;
|
|
990
997
|
}): Pipeline<C, AE | BE | CE>;
|
|
991
|
-
|
|
998
|
+
declare function experimental_pipe<A extends Shape, AE extends Shape, BN extends Shape, B extends Shape, BE extends Shape, CN extends Shape, C extends Shape, CE extends Shape, DN extends Shape, D extends Shape, DE extends Shape>(a: TypedAgentSpec<A, AE>, b: Supplies<A, BN> extends true ? PipeStep<BN, B, BE> : {
|
|
992
999
|
readonly __HANDOFF_ERROR: Supplies<A, BN>;
|
|
993
1000
|
}, c: Supplies<B, CN> extends true ? PipeStep<CN, C, CE> : {
|
|
994
1001
|
readonly __HANDOFF_ERROR: Supplies<B, CN>;
|
|
@@ -1063,6 +1070,38 @@ export declare const claude: typeof instructionFile;
|
|
|
1063
1070
|
* {@link instructionFile} builds. Removed one major AFTER the one that introduces it.
|
|
1064
1071
|
*/
|
|
1065
1072
|
export declare const instructions: typeof prose;
|
|
1073
|
+
/**
|
|
1074
|
+
* Define a subagent — and the ROOT of the subagent vocabulary.
|
|
1075
|
+
*
|
|
1076
|
+
* Everything that only makes sense for subagents hangs off this one symbol:
|
|
1077
|
+
* `experimental_agent.result()` (the outcome contract), `.railway()` / `.delegate()`
|
|
1078
|
+
* (the flat orchestrator), and `.pipe()` / `.start()` / `.andThen()` / `.pipeStep()` /
|
|
1079
|
+
* `.needs()` (the typed pipeline). Same chokepoint as `experimental_skill.input()`.
|
|
1080
|
+
*
|
|
1081
|
+
* WHY a root and not a prefix on each name: `railway()` and `delegate()` are
|
|
1082
|
+
* meaningless without a subagent, yet they shipped under STABLE names while the
|
|
1083
|
+
* builder they depend on is experimental — a stable name resting on an unstable
|
|
1084
|
+
* one. Prefixing each would carry the warning but multiply the vocabulary; a
|
|
1085
|
+
* namespace OBJECT was rejected for the reason the `vigiles/experimental` subpath
|
|
1086
|
+
* was retired in #169 — it marks the import line, out of view by the time anyone
|
|
1087
|
+
* reads the call. A member reached through the marked root cannot be destructured
|
|
1088
|
+
* free of its warning without renaming it, so the warning rides every call site.
|
|
1089
|
+
*
|
|
1090
|
+
* The rule this establishes: ONE experimental root per feature, everything else a
|
|
1091
|
+
* member of it, TYPES excluded (a type annotation is not a call site).
|
|
1092
|
+
*
|
|
1093
|
+
* @experimental
|
|
1094
|
+
*/
|
|
1095
|
+
export declare const experimental_agent: typeof agentSpec & {
|
|
1096
|
+
result: typeof result;
|
|
1097
|
+
delegate: typeof delegate;
|
|
1098
|
+
railway: typeof railway;
|
|
1099
|
+
needs: typeof experimental_needs;
|
|
1100
|
+
pipeStep: typeof experimental_pipeStep;
|
|
1101
|
+
start: typeof experimental_start;
|
|
1102
|
+
andThen: typeof experimental_andThen;
|
|
1103
|
+
pipe: typeof experimental_pipe;
|
|
1104
|
+
};
|
|
1066
1105
|
/**
|
|
1067
1106
|
* @deprecated Renamed to {@link experimental_agent} — the shape is not settled.
|
|
1068
1107
|
* Removed one major AFTER the one that introduces it.
|
|
@@ -1073,6 +1112,15 @@ export declare const instructions: typeof prose;
|
|
|
1073
1112
|
* the unprefixed name keeps compiling for one major. It carries the tag because
|
|
1074
1113
|
* it is the same function, and the tag is what the deprecation notice points at.
|
|
1075
1114
|
*/
|
|
1076
|
-
export declare const agent: typeof
|
|
1115
|
+
export declare const agent: typeof agentSpec & {
|
|
1116
|
+
result: typeof result;
|
|
1117
|
+
delegate: typeof delegate;
|
|
1118
|
+
railway: typeof railway;
|
|
1119
|
+
needs: typeof experimental_needs;
|
|
1120
|
+
pipeStep: typeof experimental_pipeStep;
|
|
1121
|
+
start: typeof experimental_start;
|
|
1122
|
+
andThen: typeof experimental_andThen;
|
|
1123
|
+
pipe: typeof experimental_pipe;
|
|
1124
|
+
};
|
|
1077
1125
|
export {};
|
|
1078
1126
|
//# sourceMappingURL=spec.d.ts.map
|
package/dist/core/spec.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* guidance() — prose only, no mechanical enforcement
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.agent = exports.instructions = exports.claude = exports.experimental_skill = exports.BUILTIN_LINTERS = void 0;
|
|
13
|
+
exports.agent = exports.experimental_agent = exports.instructions = exports.claude = exports.experimental_skill = exports.BUILTIN_LINTERS = void 0;
|
|
14
14
|
exports.enforce = enforce;
|
|
15
15
|
exports.guidance = guidance;
|
|
16
16
|
exports.guard = guard;
|
|
@@ -24,15 +24,6 @@ exports.prose = prose;
|
|
|
24
24
|
exports.experimental_effect = experimental_effect;
|
|
25
25
|
exports.instructionFile = instructionFile;
|
|
26
26
|
exports.project = project;
|
|
27
|
-
exports.experimental_agent = experimental_agent;
|
|
28
|
-
exports.result = result;
|
|
29
|
-
exports.delegate = delegate;
|
|
30
|
-
exports.railway = railway;
|
|
31
|
-
exports.experimental_needs = experimental_needs;
|
|
32
|
-
exports.experimental_pipeStep = experimental_pipeStep;
|
|
33
|
-
exports.experimental_start = experimental_start;
|
|
34
|
-
exports.experimental_andThen = experimental_andThen;
|
|
35
|
-
exports.experimental_pipe = experimental_pipe;
|
|
36
27
|
exports.defineConfig = defineConfig;
|
|
37
28
|
// ---------------------------------------------------------------------------
|
|
38
29
|
// Template literal types for type-safe linter references
|
|
@@ -332,7 +323,7 @@ exports.experimental_skill = Object.assign(skillSpec, { input, step });
|
|
|
332
323
|
* loaded a compiled `agents/code-reviewer.md`, dispatched to it and read it,
|
|
333
324
|
* 100% of trials — stronger end-to-end evidence than `experimental_skill` has.
|
|
334
325
|
*/
|
|
335
|
-
function
|
|
326
|
+
function agentSpec(spec) {
|
|
336
327
|
return { _specType: "agent", ...spec };
|
|
337
328
|
}
|
|
338
329
|
/**
|
|
@@ -351,6 +342,7 @@ function experimental_agent(spec) {
|
|
|
351
342
|
* cross-reference one agent's `ok` against the next agent's needs at `tsc` time.
|
|
352
343
|
* The return is still an `OutputContract`, so every existing consumer (the
|
|
353
344
|
* `output:` field, `renderOutputContract`, `parseAgentResult`) is unchanged.
|
|
345
|
+
|
|
354
346
|
*/
|
|
355
347
|
function result(ok, err) {
|
|
356
348
|
return { _ref: "output", ok, err };
|
|
@@ -368,6 +360,7 @@ function result(ok, err) {
|
|
|
368
360
|
* handoff that doesn't line up is a `tsc` error naming the offending field.
|
|
369
361
|
* Omitting it (the historical 1-/2-arg call) keeps the exact string-path
|
|
370
362
|
* behavior — fully backwards-compatible.
|
|
363
|
+
|
|
371
364
|
*/
|
|
372
365
|
function delegate(agent, task, needsContract) {
|
|
373
366
|
const base = task === undefined
|
|
@@ -384,6 +377,7 @@ function delegate(agent, task, needsContract) {
|
|
|
384
377
|
* onError: delegate("reporter"),
|
|
385
378
|
* recover: { step: delegate("fixer"), max: 2 },
|
|
386
379
|
* })
|
|
380
|
+
|
|
387
381
|
*/
|
|
388
382
|
function railway(spec) {
|
|
389
383
|
return { _specType: "railway", ...spec };
|
|
@@ -397,6 +391,7 @@ function railway(spec) {
|
|
|
397
391
|
*
|
|
398
392
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
399
393
|
* public API (pre-1.0); may change without a major bump.
|
|
394
|
+
|
|
400
395
|
*/
|
|
401
396
|
function experimental_needs(shape) {
|
|
402
397
|
return shape;
|
|
@@ -410,6 +405,7 @@ function experimental_needs(shape) {
|
|
|
410
405
|
*
|
|
411
406
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
412
407
|
* public API (pre-1.0); may change without a major bump.
|
|
408
|
+
|
|
413
409
|
*/
|
|
414
410
|
function experimental_pipeStep(a, needsContract = {}) {
|
|
415
411
|
return { _step: "typed-delegate", agent: a, needs: needsContract };
|
|
@@ -421,6 +417,7 @@ function experimental_pipeStep(a, needsContract = {}) {
|
|
|
421
417
|
*
|
|
422
418
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
423
419
|
* public API (pre-1.0); may change without a major bump.
|
|
420
|
+
|
|
424
421
|
*/
|
|
425
422
|
function experimental_start(first) {
|
|
426
423
|
const step = "_step" in first
|
|
@@ -451,6 +448,7 @@ function experimental_start(first) {
|
|
|
451
448
|
*
|
|
452
449
|
* @experimental Experimental typed-composition surface — NOT part of the frozen
|
|
453
450
|
* public API (pre-1.0); may change without a major bump.
|
|
451
|
+
|
|
454
452
|
*/
|
|
455
453
|
function experimental_andThen(prior, next) {
|
|
456
454
|
const real = next;
|
|
@@ -511,6 +509,38 @@ exports.claude = instructionFile;
|
|
|
511
509
|
* {@link instructionFile} builds. Removed one major AFTER the one that introduces it.
|
|
512
510
|
*/
|
|
513
511
|
exports.instructions = prose;
|
|
512
|
+
/**
|
|
513
|
+
* Define a subagent — and the ROOT of the subagent vocabulary.
|
|
514
|
+
*
|
|
515
|
+
* Everything that only makes sense for subagents hangs off this one symbol:
|
|
516
|
+
* `experimental_agent.result()` (the outcome contract), `.railway()` / `.delegate()`
|
|
517
|
+
* (the flat orchestrator), and `.pipe()` / `.start()` / `.andThen()` / `.pipeStep()` /
|
|
518
|
+
* `.needs()` (the typed pipeline). Same chokepoint as `experimental_skill.input()`.
|
|
519
|
+
*
|
|
520
|
+
* WHY a root and not a prefix on each name: `railway()` and `delegate()` are
|
|
521
|
+
* meaningless without a subagent, yet they shipped under STABLE names while the
|
|
522
|
+
* builder they depend on is experimental — a stable name resting on an unstable
|
|
523
|
+
* one. Prefixing each would carry the warning but multiply the vocabulary; a
|
|
524
|
+
* namespace OBJECT was rejected for the reason the `vigiles/experimental` subpath
|
|
525
|
+
* was retired in #169 — it marks the import line, out of view by the time anyone
|
|
526
|
+
* reads the call. A member reached through the marked root cannot be destructured
|
|
527
|
+
* free of its warning without renaming it, so the warning rides every call site.
|
|
528
|
+
*
|
|
529
|
+
* The rule this establishes: ONE experimental root per feature, everything else a
|
|
530
|
+
* member of it, TYPES excluded (a type annotation is not a call site).
|
|
531
|
+
*
|
|
532
|
+
* @experimental
|
|
533
|
+
*/
|
|
534
|
+
exports.experimental_agent = Object.assign(agentSpec, {
|
|
535
|
+
result,
|
|
536
|
+
delegate,
|
|
537
|
+
railway,
|
|
538
|
+
needs: experimental_needs,
|
|
539
|
+
pipeStep: experimental_pipeStep,
|
|
540
|
+
start: experimental_start,
|
|
541
|
+
andThen: experimental_andThen,
|
|
542
|
+
pipe: experimental_pipe,
|
|
543
|
+
});
|
|
514
544
|
/**
|
|
515
545
|
* @deprecated Renamed to {@link experimental_agent} — the shape is not settled.
|
|
516
546
|
* Removed one major AFTER the one that introduces it.
|
|
@@ -521,5 +551,5 @@ exports.instructions = prose;
|
|
|
521
551
|
* the unprefixed name keeps compiling for one major. It carries the tag because
|
|
522
552
|
* it is the same function, and the tag is what the deprecation notice points at.
|
|
523
553
|
*/
|
|
524
|
-
exports.agent = experimental_agent;
|
|
554
|
+
exports.agent = exports.experimental_agent;
|
|
525
555
|
//# sourceMappingURL=spec.js.map
|
package/dist/linting.d.ts
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* `OutputContract` TYPE stays, because `compileAgent`/`compileSkill` name it in
|
|
31
31
|
* their own types. A consumer who needs to BUILD one imports `vigiles/spec`.
|
|
32
32
|
*/
|
|
33
|
-
export { instructionFile, prose, experimental_effect, enforce, guidance, guard, file, cmd, symbol, ref, dir, glob, project, experimental_skill, experimental_agent,
|
|
33
|
+
export { instructionFile, prose, experimental_effect, enforce, guidance, guard, file, cmd, symbol, ref, dir, glob, project, experimental_skill, experimental_agent,
|
|
34
34
|
/** @deprecated Renamed to `instructionFile`. Removed one major AFTER the one that introduces it. */
|
|
35
35
|
claude,
|
|
36
36
|
/** @deprecated Renamed to `prose`. Removed one major AFTER the one that introduces it. */
|
package/dist/linting.js
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* their own types. A consumer who needs to BUILD one imports `vigiles/spec`.
|
|
33
33
|
*/
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.compileRailway = exports.compileAgent = exports.compileSkill = exports.compileClaude = exports.BUILTIN_LINTERS = exports.agent = exports.instructions = exports.claude = exports.
|
|
35
|
+
exports.compileRailway = exports.compileAgent = exports.compileSkill = exports.compileClaude = exports.BUILTIN_LINTERS = exports.agent = exports.instructions = exports.claude = exports.experimental_agent = exports.experimental_skill = exports.project = exports.glob = exports.dir = exports.ref = exports.symbol = exports.cmd = exports.file = exports.guard = exports.guidance = exports.enforce = exports.experimental_effect = exports.prose = exports.instructionFile = void 0;
|
|
36
36
|
// --- the spec authoring builders: rules, refs, prose, and the three spec kinds ---
|
|
37
37
|
var spec_js_1 = require("./core/spec.js");
|
|
38
38
|
// instruction files
|
|
@@ -53,9 +53,8 @@ Object.defineProperty(exports, "glob", { enumerable: true, get: function () { re
|
|
|
53
53
|
Object.defineProperty(exports, "project", { enumerable: true, get: function () { return spec_js_1.project; } });
|
|
54
54
|
// the other two spec kinds + how a railway wires them
|
|
55
55
|
Object.defineProperty(exports, "experimental_skill", { enumerable: true, get: function () { return spec_js_1.experimental_skill; } });
|
|
56
|
+
// the subagent ROOT — `railway`/`delegate`/`result`/`pipe`… are its members
|
|
56
57
|
Object.defineProperty(exports, "experimental_agent", { enumerable: true, get: function () { return spec_js_1.experimental_agent; } });
|
|
57
|
-
Object.defineProperty(exports, "railway", { enumerable: true, get: function () { return spec_js_1.railway; } });
|
|
58
|
-
Object.defineProperty(exports, "delegate", { enumerable: true, get: function () { return spec_js_1.delegate; } });
|
|
59
58
|
// ─── ОКНО АЛИАСА (один мажор) — see core/spec.ts for why a window is not
|
|
60
59
|
// politeness here. Kept on THIS door too: a consumer importing `claude` from
|
|
61
60
|
// `vigiles/linting` never saw `vigiles/spec`, so the window over there does
|
package/dist/scaffold-test.js
CHANGED
|
@@ -151,7 +151,7 @@ function outcomeSection(input, contract) {
|
|
|
151
151
|
? `// TODO: assert the VALUES you expect (the shape is already validated above), e.g.:\n// assert.ok(value.${firstField}, "expected a ${firstField}");`
|
|
152
152
|
: "";
|
|
153
153
|
return `import assert from "node:assert/strict";
|
|
154
|
-
import {
|
|
154
|
+
import { experimental_agent } from "vigiles/spec";\nconst { result } = experimental_agent;
|
|
155
155
|
import { assertAgentOk } from "vigiles";
|
|
156
156
|
|
|
157
157
|
// Reconstructed from ${input.name}'s ## Output contract (its compiled .md) — the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vigiles",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Audit, test and measure the harness your AI agent runs on — grade your CLAUDE.md / AGENTS.md, skills, subagents and hooks, run them against a scripted model, and measure whether they actually fire.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|