@theoklitosbam7/verdict-kit 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +625 -2
- package/config/routing/engineering.action-risk.consensus.v1.json +16 -0
- package/config/routing/engineering.task-route.cascade.v1.json +21 -0
- package/dist/action-policy.d.ts +104 -0
- package/dist/action-policy.js +173 -0
- package/dist/cache.d.ts +17 -0
- package/dist/cache.js +139 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +142 -0
- package/dist/concurrency.d.ts +12 -0
- package/dist/concurrency.js +110 -0
- package/dist/config.d.ts +61 -0
- package/dist/config.js +247 -0
- package/dist/decision.d.ts +75 -0
- package/dist/decision.js +278 -0
- package/dist/engine.d.ts +63 -0
- package/dist/engine.js +79 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +19 -0
- package/dist/http.d.ts +18 -0
- package/dist/http.js +140 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -0
- package/dist/package-info.d.ts +1 -0
- package/dist/package-info.js +5 -0
- package/dist/policy/evaluate.d.ts +7 -0
- package/dist/policy/evaluate.js +39 -0
- package/dist/policy/events.d.ts +32 -0
- package/dist/policy/events.js +31 -0
- package/dist/policy/payload.d.ts +6 -0
- package/dist/policy/payload.js +11 -0
- package/dist/policy/registry.d.ts +22 -0
- package/dist/policy/registry.js +89 -0
- package/dist/policy/schema.d.ts +198 -0
- package/dist/policy/schema.js +112 -0
- package/dist/policy/scope.d.ts +5 -0
- package/dist/policy/scope.js +120 -0
- package/dist/probability.d.ts +1 -0
- package/dist/probability.js +3 -0
- package/dist/providers/discovery.d.ts +10 -0
- package/dist/providers/discovery.js +113 -0
- package/dist/providers/index.d.ts +56 -0
- package/dist/providers/index.js +83 -0
- package/dist/providers/ollama.d.ts +12 -0
- package/dist/providers/ollama.js +93 -0
- package/dist/providers/opencode-go.d.ts +3 -0
- package/dist/providers/opencode-go.js +40 -0
- package/dist/providers/system-one.d.ts +21 -0
- package/dist/providers/system-one.js +44 -0
- package/dist/providers/typesafe.d.ts +3 -0
- package/dist/providers/typesafe.js +36 -0
- package/dist/public.d.ts +5 -0
- package/dist/public.js +5 -0
- package/dist/response.d.ts +6 -0
- package/dist/response.js +104 -0
- package/dist/routing/cascade.d.ts +112 -0
- package/dist/routing/cascade.js +220 -0
- package/dist/routing/consensus.d.ts +148 -0
- package/dist/routing/consensus.js +367 -0
- package/dist/routing/retry.d.ts +3 -0
- package/dist/routing/retry.js +47 -0
- package/dist/routing/router.d.ts +12 -0
- package/dist/routing/router.js +27 -0
- package/dist/schemas.d.ts +339 -0
- package/dist/schemas.js +283 -0
- package/dist/server.d.ts +42 -0
- package/dist/server.js +416 -0
- package/dist/telemetry/events.d.ts +15 -0
- package/dist/telemetry/events.js +87 -0
- package/dist/telemetry/sink.d.ts +7 -0
- package/dist/telemetry/sink.js +59 -0
- package/dist/templates/registry.d.ts +13 -0
- package/dist/templates/registry.js +100 -0
- package/dist/templates/schema.d.ts +115 -0
- package/dist/templates/schema.js +70 -0
- package/dist/types.d.ts +86 -0
- package/dist/types.js +2 -0
- package/package.json +77 -3
- package/policies/engineering-default.v1.json +36 -0
- package/policies/engineering-strict.v1.json +36 -0
- package/templates/engineering.action-risk.v1.json +32 -0
- package/templates/engineering.compatibility.v1.json +25 -0
- package/templates/engineering.pr-risk.v1.json +26 -0
- package/templates/engineering.security-sensitivity.v1.json +20 -0
- package/templates/engineering.task-route.v1.json +27 -0
- package/templates/engineering.test-depth.v1.json +26 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export declare const withinPayloadLimit: (value: unknown) => boolean;
|
|
3
|
+
export declare const jsonValueSchema: z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
4
|
+
export declare const finiteJsonSchema: z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>;
|
|
5
|
+
export declare const providerFields: {
|
|
6
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
7
|
+
model: z.ZodOptional<z.ZodString>;
|
|
8
|
+
};
|
|
9
|
+
export declare const choiceQuestionSchema: z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"choice">;
|
|
11
|
+
instructions: z.ZodString;
|
|
12
|
+
criteria: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const noulQuestionSchema: z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"noul">;
|
|
16
|
+
instructions: z.ZodString;
|
|
17
|
+
criteria: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
true: z.ZodOptional<z.ZodString>;
|
|
19
|
+
false: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export declare const scoreQuestionSchema: z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"score">;
|
|
24
|
+
instructions: z.ZodString;
|
|
25
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const questionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"choice">;
|
|
29
|
+
instructions: z.ZodString;
|
|
30
|
+
criteria: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
31
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"noul">;
|
|
33
|
+
instructions: z.ZodString;
|
|
34
|
+
criteria: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
true: z.ZodOptional<z.ZodString>;
|
|
36
|
+
false: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"score">;
|
|
40
|
+
instructions: z.ZodString;
|
|
41
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>], "type">;
|
|
43
|
+
export declare const questionsSchema: z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"choice">;
|
|
45
|
+
instructions: z.ZodString;
|
|
46
|
+
criteria: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"noul">;
|
|
49
|
+
instructions: z.ZodString;
|
|
50
|
+
criteria: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
true: z.ZodOptional<z.ZodString>;
|
|
52
|
+
false: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"score">;
|
|
56
|
+
instructions: z.ZodString;
|
|
57
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>], "type">>>;
|
|
59
|
+
export declare const decideInputSchema: z.ZodObject<{
|
|
60
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
61
|
+
model: z.ZodOptional<z.ZodString>;
|
|
62
|
+
state: z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
63
|
+
questions: z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"choice">;
|
|
65
|
+
instructions: z.ZodString;
|
|
66
|
+
criteria: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
67
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"noul">;
|
|
69
|
+
instructions: z.ZodString;
|
|
70
|
+
criteria: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
true: z.ZodOptional<z.ZodString>;
|
|
72
|
+
false: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
type: z.ZodLiteral<"score">;
|
|
76
|
+
instructions: z.ZodString;
|
|
77
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>], "type">>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export declare const classifyInputSchema: z.ZodObject<{
|
|
81
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
82
|
+
model: z.ZodOptional<z.ZodString>;
|
|
83
|
+
state: z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
84
|
+
labels: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
85
|
+
instructions: z.ZodDefault<z.ZodString>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
export declare const booleanInputSchema: z.ZodObject<{
|
|
88
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
89
|
+
model: z.ZodOptional<z.ZodString>;
|
|
90
|
+
state: z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
91
|
+
question: z.ZodString;
|
|
92
|
+
true_description: z.ZodOptional<z.ZodString>;
|
|
93
|
+
false_description: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export declare const scoreInputSchema: z.ZodObject<{
|
|
96
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
97
|
+
model: z.ZodOptional<z.ZodString>;
|
|
98
|
+
state: z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
99
|
+
instructions: z.ZodString;
|
|
100
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const batchInputSchema: z.ZodObject<{
|
|
103
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
104
|
+
model: z.ZodOptional<z.ZodString>;
|
|
105
|
+
states: z.ZodArray<z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
106
|
+
questions: z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
107
|
+
type: z.ZodLiteral<"choice">;
|
|
108
|
+
instructions: z.ZodString;
|
|
109
|
+
criteria: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>;
|
|
110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"noul">;
|
|
112
|
+
instructions: z.ZodString;
|
|
113
|
+
criteria: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
true: z.ZodOptional<z.ZodString>;
|
|
115
|
+
false: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"score">;
|
|
119
|
+
instructions: z.ZodString;
|
|
120
|
+
criteria: z.ZodArray<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>], "type">>>;
|
|
122
|
+
concurrency: z.ZodDefault<z.ZodNumber>;
|
|
123
|
+
failure_mode: z.ZodDefault<z.ZodEnum<{
|
|
124
|
+
fail_fast: "fail_fast";
|
|
125
|
+
partial: "partial";
|
|
126
|
+
}>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
export declare const actionPolicyInputSchema: z.ZodObject<{
|
|
129
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
130
|
+
model: z.ZodOptional<z.ZodString>;
|
|
131
|
+
tool_name: z.ZodString;
|
|
132
|
+
tool_input: z.ZodUnknown;
|
|
133
|
+
scope: z.ZodDefault<z.ZodEnum<{
|
|
134
|
+
all: "all";
|
|
135
|
+
consequential: "consequential";
|
|
136
|
+
strict: "strict";
|
|
137
|
+
}>>;
|
|
138
|
+
output: z.ZodDefault<z.ZodEnum<{
|
|
139
|
+
claude_code_pre_tool_use: "claude_code_pre_tool_use";
|
|
140
|
+
codex_pre_tool_use: "codex_pre_tool_use";
|
|
141
|
+
result: "result";
|
|
142
|
+
}>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export declare const noulGateRuleSchema: z.ZodObject<{
|
|
145
|
+
block_above: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
review_above: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strict>;
|
|
148
|
+
export declare const choiceGateRuleSchema: z.ZodObject<{
|
|
149
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
150
|
+
review: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
block: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
152
|
+
}, z.core.$strict>;
|
|
153
|
+
export declare const gatePolicySchema: z.ZodObject<{
|
|
154
|
+
min_confidence: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
noul: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
156
|
+
block_above: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
review_above: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
}, z.core.$strict>>>;
|
|
159
|
+
choice: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
160
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
161
|
+
review: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
block: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
}, z.core.$strict>>>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
export type GatePolicy = z.infer<typeof gatePolicySchema>;
|
|
166
|
+
export declare const gateInputSchema: z.ZodObject<{
|
|
167
|
+
answers: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
168
|
+
policy: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
min_confidence: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
noul: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
171
|
+
block_above: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
review_above: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
}, z.core.$strict>>>;
|
|
174
|
+
choice: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
175
|
+
allow: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
176
|
+
review: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
|
+
block: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
178
|
+
}, z.core.$strict>>>;
|
|
179
|
+
}, z.core.$strict>>;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export declare const gateOutputSchema: z.ZodObject<{
|
|
182
|
+
action: z.ZodEnum<{
|
|
183
|
+
allow: "allow";
|
|
184
|
+
block: "block";
|
|
185
|
+
review: "review";
|
|
186
|
+
}>;
|
|
187
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
export declare const answerLegendSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
190
|
+
export declare const decisionAnswersSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
191
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
193
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
194
|
+
type: z.ZodLiteral<"choice">;
|
|
195
|
+
choice: z.ZodString;
|
|
196
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
197
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
199
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
200
|
+
type: z.ZodLiteral<"noul">;
|
|
201
|
+
noul: z.ZodNumber;
|
|
202
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
203
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
205
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
206
|
+
type: z.ZodLiteral<"score">;
|
|
207
|
+
score: z.ZodNumber;
|
|
208
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>], "type">>;
|
|
209
|
+
export declare const decisionOutputSchema: z.ZodObject<{
|
|
210
|
+
provider: z.ZodString;
|
|
211
|
+
model: z.ZodOptional<z.ZodString>;
|
|
212
|
+
answers: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
213
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
215
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
216
|
+
type: z.ZodLiteral<"choice">;
|
|
217
|
+
choice: z.ZodString;
|
|
218
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
219
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
221
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
222
|
+
type: z.ZodLiteral<"noul">;
|
|
223
|
+
noul: z.ZodNumber;
|
|
224
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
225
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
226
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
227
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
228
|
+
type: z.ZodLiteral<"score">;
|
|
229
|
+
score: z.ZodNumber;
|
|
230
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>], "type">>;
|
|
231
|
+
usage: z.ZodOptional<z.ZodJSONSchema>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export declare const batchOutputSchema: z.ZodObject<{
|
|
234
|
+
results: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
235
|
+
provider: z.ZodString;
|
|
236
|
+
model: z.ZodOptional<z.ZodString>;
|
|
237
|
+
answers: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
238
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
240
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
241
|
+
type: z.ZodLiteral<"choice">;
|
|
242
|
+
choice: z.ZodString;
|
|
243
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
244
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
245
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
246
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
247
|
+
type: z.ZodLiteral<"noul">;
|
|
248
|
+
noul: z.ZodNumber;
|
|
249
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
250
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
252
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
253
|
+
type: z.ZodLiteral<"score">;
|
|
254
|
+
score: z.ZodNumber;
|
|
255
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>], "type">>;
|
|
256
|
+
usage: z.ZodOptional<z.ZodJSONSchema>;
|
|
257
|
+
}, z.core.$strip>>, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
258
|
+
index: z.ZodNumber;
|
|
259
|
+
status: z.ZodLiteral<"ok">;
|
|
260
|
+
result: z.ZodObject<{
|
|
261
|
+
provider: z.ZodString;
|
|
262
|
+
model: z.ZodOptional<z.ZodString>;
|
|
263
|
+
answers: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
264
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
266
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
267
|
+
type: z.ZodLiteral<"choice">;
|
|
268
|
+
choice: z.ZodString;
|
|
269
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
270
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
271
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
272
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
273
|
+
type: z.ZodLiteral<"noul">;
|
|
274
|
+
noul: z.ZodNumber;
|
|
275
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>, z.ZodObject<{
|
|
276
|
+
confidence: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
probabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
278
|
+
legend: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
279
|
+
type: z.ZodLiteral<"score">;
|
|
280
|
+
score: z.ZodNumber;
|
|
281
|
+
}, z.core.$catchall<z.ZodPipe<z.ZodUnknown, z.ZodJSONSchema>>>], "type">>;
|
|
282
|
+
usage: z.ZodOptional<z.ZodJSONSchema>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
285
|
+
index: z.ZodNumber;
|
|
286
|
+
status: z.ZodLiteral<"error">;
|
|
287
|
+
code: z.ZodEnum<{
|
|
288
|
+
cancelled: "cancelled";
|
|
289
|
+
configuration: "configuration";
|
|
290
|
+
http: "http";
|
|
291
|
+
internal: "internal";
|
|
292
|
+
invalid_request: "invalid_request";
|
|
293
|
+
invalid_response: "invalid_response";
|
|
294
|
+
output_limit: "output_limit";
|
|
295
|
+
overload: "overload";
|
|
296
|
+
timeout: "timeout";
|
|
297
|
+
transport: "transport";
|
|
298
|
+
}>;
|
|
299
|
+
}, z.core.$strict>], "status">>]>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
export declare const providersOutputSchema: z.ZodObject<{
|
|
302
|
+
default: z.ZodString;
|
|
303
|
+
providers: z.ZodArray<z.ZodObject<{
|
|
304
|
+
id: z.ZodString;
|
|
305
|
+
description: z.ZodString;
|
|
306
|
+
ok: z.ZodBoolean;
|
|
307
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
308
|
+
readiness: z.ZodEnum<{
|
|
309
|
+
model_missing: "model_missing";
|
|
310
|
+
model_unsupported: "model_unsupported";
|
|
311
|
+
not_configured: "not_configured";
|
|
312
|
+
ready: "ready";
|
|
313
|
+
unauthenticated: "unauthenticated";
|
|
314
|
+
unknown: "unknown";
|
|
315
|
+
unreachable: "unreachable";
|
|
316
|
+
}>;
|
|
317
|
+
questionTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
318
|
+
choice: "choice";
|
|
319
|
+
noul: "noul";
|
|
320
|
+
score: "score";
|
|
321
|
+
}>>>;
|
|
322
|
+
models: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
323
|
+
name: z.ZodString;
|
|
324
|
+
default: z.ZodBoolean;
|
|
325
|
+
status: z.ZodEnum<{
|
|
326
|
+
missing: "missing";
|
|
327
|
+
ready: "ready";
|
|
328
|
+
unknown: "unknown";
|
|
329
|
+
unsupported: "unsupported";
|
|
330
|
+
}>;
|
|
331
|
+
locality: z.ZodEnum<{
|
|
332
|
+
local: "local";
|
|
333
|
+
"non-local": "non-local";
|
|
334
|
+
unknown: "unknown";
|
|
335
|
+
}>;
|
|
336
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
337
|
+
}, z.core.$strip>>>;
|
|
338
|
+
}, z.core.$strip>>;
|
|
339
|
+
}, z.core.$strip>;
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { decisionErrorCodes } from "./errors.js";
|
|
3
|
+
import { MAX_BATCH_CONCURRENCY, MAX_BATCH_STATES } from "./types.js";
|
|
4
|
+
const MAX_TEXT_LENGTH = 32_768;
|
|
5
|
+
const MAX_DESCRIPTION_LENGTH = 4_096;
|
|
6
|
+
const MAX_NAME_LENGTH = 128;
|
|
7
|
+
const MAX_RECORD_KEYS = 100;
|
|
8
|
+
const MAX_QUESTIONS = 50;
|
|
9
|
+
const MAX_PAYLOAD_BYTES = 1_048_576;
|
|
10
|
+
const MAX_JSON_DEPTH = 64;
|
|
11
|
+
export const withinPayloadLimit = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
const serialized = JSON.stringify(value);
|
|
14
|
+
return serialized !== undefined && Buffer.byteLength(serialized) <= MAX_PAYLOAD_BYTES;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function jsonStructureError(value, depth = 0) {
|
|
21
|
+
if (typeof value !== "object" || value === null)
|
|
22
|
+
return;
|
|
23
|
+
if (depth >= MAX_JSON_DEPTH)
|
|
24
|
+
return `JSON nesting depth must not exceed ${MAX_JSON_DEPTH}.`;
|
|
25
|
+
if (Object.hasOwn(value, "__proto__"))
|
|
26
|
+
return "JSON objects must not contain a __proto__ key.";
|
|
27
|
+
for (const child of Object.values(value)) {
|
|
28
|
+
const error = jsonStructureError(child, depth + 1);
|
|
29
|
+
if (error)
|
|
30
|
+
return error;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const jsonStructureSchema = z.unknown().superRefine((value, ctx) => {
|
|
34
|
+
const error = jsonStructureError(value);
|
|
35
|
+
if (error)
|
|
36
|
+
ctx.addIssue({ code: "custom", message: error });
|
|
37
|
+
});
|
|
38
|
+
const boundedJsonSchema = z.lazy(() => z.union([
|
|
39
|
+
z.string().max(MAX_TEXT_LENGTH),
|
|
40
|
+
z.number().finite(),
|
|
41
|
+
z.boolean(),
|
|
42
|
+
z.null(),
|
|
43
|
+
z.array(boundedJsonSchema).max(1_000),
|
|
44
|
+
z
|
|
45
|
+
.record(z.string().min(1).max(MAX_NAME_LENGTH), boundedJsonSchema)
|
|
46
|
+
.refine((value) => Object.keys(value).length <= MAX_RECORD_KEYS, {
|
|
47
|
+
message: `JSON objects may contain at most ${MAX_RECORD_KEYS} keys.`,
|
|
48
|
+
}),
|
|
49
|
+
]));
|
|
50
|
+
export const jsonValueSchema = jsonStructureSchema.pipe(boundedJsonSchema);
|
|
51
|
+
export const finiteJsonSchema = jsonStructureSchema.pipe(z.json());
|
|
52
|
+
export const providerFields = {
|
|
53
|
+
provider: z
|
|
54
|
+
.string()
|
|
55
|
+
.min(1)
|
|
56
|
+
.max(MAX_NAME_LENGTH)
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("Decision provider, for example 'ollama', 'typesafe' or 'opencode-go'. Uses DECISION_PROVIDER when omitted."),
|
|
59
|
+
model: z
|
|
60
|
+
.string()
|
|
61
|
+
.min(1)
|
|
62
|
+
.max(256)
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Model name accepted by the selected provider. Ollama models must support /v1/systemone."),
|
|
65
|
+
};
|
|
66
|
+
export const choiceQuestionSchema = z.object({
|
|
67
|
+
type: z.literal("choice"),
|
|
68
|
+
instructions: z.string().min(1).max(MAX_TEXT_LENGTH),
|
|
69
|
+
criteria: z
|
|
70
|
+
.record(z.string().min(1).max(MAX_NAME_LENGTH), z.string().max(MAX_DESCRIPTION_LENGTH).nullable())
|
|
71
|
+
.refine((criteria) => Object.keys(criteria).length >= 2, {
|
|
72
|
+
message: "Choice criteria must include at least two options.",
|
|
73
|
+
})
|
|
74
|
+
.refine((criteria) => Object.keys(criteria).length <= 50, {
|
|
75
|
+
message: "Choice criteria may include at most 50 options.",
|
|
76
|
+
}),
|
|
77
|
+
});
|
|
78
|
+
export const noulQuestionSchema = z.object({
|
|
79
|
+
type: z.literal("noul"),
|
|
80
|
+
instructions: z.string().min(1).max(MAX_TEXT_LENGTH),
|
|
81
|
+
criteria: z
|
|
82
|
+
.object({
|
|
83
|
+
true: z.string().max(MAX_DESCRIPTION_LENGTH).optional(),
|
|
84
|
+
false: z.string().max(MAX_DESCRIPTION_LENGTH).optional(),
|
|
85
|
+
})
|
|
86
|
+
.optional(),
|
|
87
|
+
});
|
|
88
|
+
export const scoreQuestionSchema = z.object({
|
|
89
|
+
type: z.literal("score"),
|
|
90
|
+
instructions: z.string().min(1).max(MAX_TEXT_LENGTH),
|
|
91
|
+
criteria: z.array(z.string().min(1).max(MAX_DESCRIPTION_LENGTH)).min(2).max(10),
|
|
92
|
+
});
|
|
93
|
+
export const questionSchema = z.discriminatedUnion("type", [
|
|
94
|
+
choiceQuestionSchema,
|
|
95
|
+
noulQuestionSchema,
|
|
96
|
+
scoreQuestionSchema,
|
|
97
|
+
]);
|
|
98
|
+
const namedQuestionsSchema = z
|
|
99
|
+
.record(z.string().min(1).max(MAX_NAME_LENGTH), questionSchema)
|
|
100
|
+
.refine((questions) => Object.keys(questions).length > 0, {
|
|
101
|
+
message: "At least one question is required.",
|
|
102
|
+
})
|
|
103
|
+
.refine((questions) => Object.keys(questions).length <= MAX_QUESTIONS, {
|
|
104
|
+
message: `At most ${MAX_QUESTIONS} questions are allowed.`,
|
|
105
|
+
});
|
|
106
|
+
export const questionsSchema = jsonStructureSchema.pipe(namedQuestionsSchema);
|
|
107
|
+
export const decideInputSchema = z
|
|
108
|
+
.object({
|
|
109
|
+
...providerFields,
|
|
110
|
+
state: jsonValueSchema.describe("Text or structured JSON to evaluate."),
|
|
111
|
+
questions: questionsSchema.describe("Named choice, noul, or score questions."),
|
|
112
|
+
})
|
|
113
|
+
.refine(withinPayloadLimit, { message: "Request payload is too large." });
|
|
114
|
+
export const classifyInputSchema = z
|
|
115
|
+
.object({
|
|
116
|
+
...providerFields,
|
|
117
|
+
state: jsonValueSchema,
|
|
118
|
+
labels: z
|
|
119
|
+
.record(z.string().min(1).max(MAX_NAME_LENGTH), z.string().max(MAX_DESCRIPTION_LENGTH).nullable())
|
|
120
|
+
.refine((labels) => Object.keys(labels).length >= 2, {
|
|
121
|
+
message: "Provide at least two labels.",
|
|
122
|
+
})
|
|
123
|
+
.refine((labels) => Object.keys(labels).length <= 50, {
|
|
124
|
+
message: "Provide at most 50 labels.",
|
|
125
|
+
}),
|
|
126
|
+
instructions: z
|
|
127
|
+
.string()
|
|
128
|
+
.min(1)
|
|
129
|
+
.max(MAX_TEXT_LENGTH)
|
|
130
|
+
.default("Choose the best matching label for this state."),
|
|
131
|
+
})
|
|
132
|
+
.refine(withinPayloadLimit, { message: "Request payload is too large." });
|
|
133
|
+
export const booleanInputSchema = z
|
|
134
|
+
.object({
|
|
135
|
+
...providerFields,
|
|
136
|
+
state: jsonValueSchema,
|
|
137
|
+
question: z.string().min(1).max(MAX_TEXT_LENGTH),
|
|
138
|
+
true_description: z.string().min(1).max(MAX_DESCRIPTION_LENGTH).optional(),
|
|
139
|
+
false_description: z.string().min(1).max(MAX_DESCRIPTION_LENGTH).optional(),
|
|
140
|
+
})
|
|
141
|
+
.refine(withinPayloadLimit, { message: "Request payload is too large." });
|
|
142
|
+
export const scoreInputSchema = z
|
|
143
|
+
.object({
|
|
144
|
+
...providerFields,
|
|
145
|
+
state: jsonValueSchema,
|
|
146
|
+
instructions: z.string().min(1).max(MAX_TEXT_LENGTH),
|
|
147
|
+
criteria: z.array(z.string().min(1).max(MAX_DESCRIPTION_LENGTH)).min(2).max(10),
|
|
148
|
+
})
|
|
149
|
+
.refine(withinPayloadLimit, { message: "Request payload is too large." });
|
|
150
|
+
export const batchInputSchema = z
|
|
151
|
+
.object({
|
|
152
|
+
...providerFields,
|
|
153
|
+
states: z.array(jsonValueSchema).min(1).max(MAX_BATCH_STATES),
|
|
154
|
+
questions: questionsSchema,
|
|
155
|
+
concurrency: z.number().int().min(1).max(MAX_BATCH_CONCURRENCY).default(4),
|
|
156
|
+
failure_mode: z.enum(["fail_fast", "partial"]).default("fail_fast"),
|
|
157
|
+
})
|
|
158
|
+
.refine(withinPayloadLimit, { message: "Request payload is too large." });
|
|
159
|
+
export const actionPolicyInputSchema = z
|
|
160
|
+
.object({
|
|
161
|
+
...providerFields,
|
|
162
|
+
tool_name: z.string().min(1).max(256),
|
|
163
|
+
tool_input: z.unknown(),
|
|
164
|
+
scope: z.enum(["consequential", "strict", "all"]).default("consequential"),
|
|
165
|
+
output: z.enum(["result", "codex_pre_tool_use", "claude_code_pre_tool_use"]).default("result"),
|
|
166
|
+
})
|
|
167
|
+
.refine(withinPayloadLimit, { message: "Action policy payload is too large." });
|
|
168
|
+
const gateProbabilitySchema = z.number().min(0).max(1);
|
|
169
|
+
export const noulGateRuleSchema = z
|
|
170
|
+
.strictObject({
|
|
171
|
+
block_above: gateProbabilitySchema.optional(),
|
|
172
|
+
review_above: gateProbabilitySchema.optional(),
|
|
173
|
+
})
|
|
174
|
+
.refine(({ block_above, review_above }) => block_above === undefined || review_above === undefined || review_above <= block_above, {
|
|
175
|
+
message: "The block threshold must be at least the review threshold.",
|
|
176
|
+
path: ["block_above"],
|
|
177
|
+
});
|
|
178
|
+
const gateChoiceLabelsSchema = z.array(z.string().max(MAX_NAME_LENGTH)).max(100).optional();
|
|
179
|
+
export const choiceGateRuleSchema = z
|
|
180
|
+
.strictObject({
|
|
181
|
+
allow: gateChoiceLabelsSchema,
|
|
182
|
+
review: gateChoiceLabelsSchema,
|
|
183
|
+
block: gateChoiceLabelsSchema,
|
|
184
|
+
})
|
|
185
|
+
.refine(({ allow, review, block }) => {
|
|
186
|
+
const allowed = new Set(allow);
|
|
187
|
+
const reviewed = new Set(review);
|
|
188
|
+
return (!review?.some((label) => allowed.has(label)) &&
|
|
189
|
+
!block?.some((label) => allowed.has(label) || reviewed.has(label)));
|
|
190
|
+
}, { message: "A choice label may belong to only one outcome." });
|
|
191
|
+
export const gatePolicySchema = z.strictObject({
|
|
192
|
+
min_confidence: gateProbabilitySchema.optional(),
|
|
193
|
+
noul: z.record(z.string().min(1).max(MAX_NAME_LENGTH), noulGateRuleSchema).optional(),
|
|
194
|
+
choice: z.record(z.string().min(1).max(MAX_NAME_LENGTH), choiceGateRuleSchema).optional(),
|
|
195
|
+
});
|
|
196
|
+
export const gateInputSchema = z
|
|
197
|
+
.object({
|
|
198
|
+
answers: z
|
|
199
|
+
.record(z.string().min(1).max(MAX_NAME_LENGTH), jsonValueSchema)
|
|
200
|
+
.refine((answers) => Object.keys(answers).length <= MAX_QUESTIONS, {
|
|
201
|
+
message: `At most ${MAX_QUESTIONS} answers are allowed.`,
|
|
202
|
+
}),
|
|
203
|
+
policy: gatePolicySchema.optional(),
|
|
204
|
+
})
|
|
205
|
+
.refine(withinPayloadLimit, { message: "Gate payload is too large." });
|
|
206
|
+
export const gateOutputSchema = z.object({
|
|
207
|
+
action: z.enum(["allow", "review", "block"]),
|
|
208
|
+
reasons: z.array(z.string()),
|
|
209
|
+
});
|
|
210
|
+
export const answerLegendSchema = z.record(z.string(), z.string());
|
|
211
|
+
const answerMetadata = {
|
|
212
|
+
confidence: gateProbabilitySchema.optional(),
|
|
213
|
+
probabilities: z.record(z.string(), gateProbabilitySchema).optional(),
|
|
214
|
+
legend: answerLegendSchema.optional(),
|
|
215
|
+
};
|
|
216
|
+
export const decisionAnswersSchema = z.record(z.string(), z.discriminatedUnion("type", [
|
|
217
|
+
z
|
|
218
|
+
.object({ type: z.literal("choice"), choice: z.string(), ...answerMetadata })
|
|
219
|
+
.catchall(finiteJsonSchema),
|
|
220
|
+
z
|
|
221
|
+
.object({ type: z.literal("noul"), noul: gateProbabilitySchema, ...answerMetadata })
|
|
222
|
+
.catchall(finiteJsonSchema),
|
|
223
|
+
z
|
|
224
|
+
.object({ type: z.literal("score"), score: z.number(), ...answerMetadata })
|
|
225
|
+
.catchall(finiteJsonSchema),
|
|
226
|
+
]));
|
|
227
|
+
export const decisionOutputSchema = z.object({
|
|
228
|
+
provider: z.string(),
|
|
229
|
+
model: z.string().optional(),
|
|
230
|
+
answers: decisionAnswersSchema,
|
|
231
|
+
usage: z.json().optional(),
|
|
232
|
+
});
|
|
233
|
+
const batchItemSchema = z.discriminatedUnion("status", [
|
|
234
|
+
z.strictObject({
|
|
235
|
+
index: z
|
|
236
|
+
.number()
|
|
237
|
+
.int()
|
|
238
|
+
.min(0)
|
|
239
|
+
.max(MAX_BATCH_STATES - 1),
|
|
240
|
+
status: z.literal("ok"),
|
|
241
|
+
result: decisionOutputSchema,
|
|
242
|
+
}),
|
|
243
|
+
z.strictObject({
|
|
244
|
+
index: z
|
|
245
|
+
.number()
|
|
246
|
+
.int()
|
|
247
|
+
.min(0)
|
|
248
|
+
.max(MAX_BATCH_STATES - 1),
|
|
249
|
+
status: z.literal("error"),
|
|
250
|
+
code: z.enum([...decisionErrorCodes, "internal"]),
|
|
251
|
+
}),
|
|
252
|
+
]);
|
|
253
|
+
export const batchOutputSchema = z.object({
|
|
254
|
+
results: z.union([z.array(decisionOutputSchema), z.array(batchItemSchema)]),
|
|
255
|
+
});
|
|
256
|
+
export const providersOutputSchema = z.object({
|
|
257
|
+
default: z.string(),
|
|
258
|
+
providers: z.array(z.object({
|
|
259
|
+
id: z.string(),
|
|
260
|
+
description: z.string(),
|
|
261
|
+
ok: z.boolean(),
|
|
262
|
+
detail: z.string().optional(),
|
|
263
|
+
readiness: z.enum([
|
|
264
|
+
"ready",
|
|
265
|
+
"not_configured",
|
|
266
|
+
"unreachable",
|
|
267
|
+
"unauthenticated",
|
|
268
|
+
"model_missing",
|
|
269
|
+
"model_unsupported",
|
|
270
|
+
"unknown",
|
|
271
|
+
]),
|
|
272
|
+
questionTypes: z.array(z.enum(["choice", "noul", "score"])).optional(),
|
|
273
|
+
models: z
|
|
274
|
+
.array(z.object({
|
|
275
|
+
name: z.string(),
|
|
276
|
+
default: z.boolean(),
|
|
277
|
+
status: z.enum(["ready", "missing", "unsupported", "unknown"]),
|
|
278
|
+
locality: z.enum(["local", "non-local", "unknown"]),
|
|
279
|
+
revision: z.string().optional(),
|
|
280
|
+
}))
|
|
281
|
+
.optional(),
|
|
282
|
+
})),
|
|
283
|
+
});
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/server";
|
|
2
|
+
import type * as z from "zod/v4";
|
|
3
|
+
import { type CascadeRegistry } from "./routing/cascade.js";
|
|
4
|
+
import { type ConsensusRegistry } from "./routing/consensus.js";
|
|
5
|
+
import { type TelemetrySink } from "./telemetry/sink.js";
|
|
6
|
+
import type { ProviderRegistry } from "./providers/index.js";
|
|
7
|
+
import type { DecisionRequest } from "./types.js";
|
|
8
|
+
import { type TemplateRegistry } from "./templates/registry.js";
|
|
9
|
+
import { templateRunInputSchema, templateValidateInputSchema } from "./templates/schema.js";
|
|
10
|
+
export declare function expandTemplateRun(templates: TemplateRegistry, { template, state, provider, model }: z.infer<typeof templateRunInputSchema>): Promise<DecisionRequest>;
|
|
11
|
+
export declare function validateTemplateState(templates: TemplateRegistry, { template, state }: z.infer<typeof templateValidateInputSchema>): Promise<{
|
|
12
|
+
template: {
|
|
13
|
+
id: string;
|
|
14
|
+
version: number;
|
|
15
|
+
};
|
|
16
|
+
valid: true;
|
|
17
|
+
message?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
template: {
|
|
20
|
+
id: string;
|
|
21
|
+
version: number;
|
|
22
|
+
};
|
|
23
|
+
valid: false;
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function listProviderStatus(registry: ProviderRegistry, signal?: AbortSignal): Promise<{
|
|
27
|
+
default: "ollama" | "opencode-go" | "typesafe";
|
|
28
|
+
providers: {
|
|
29
|
+
ok: boolean;
|
|
30
|
+
detail?: string;
|
|
31
|
+
questionTypes?: Array<import("./types.js").DecisionQuestion["type"]>;
|
|
32
|
+
models?: import("./types.js").ModelReadiness[];
|
|
33
|
+
id: string;
|
|
34
|
+
description: string;
|
|
35
|
+
readiness: import("./types.js").ProviderReadiness;
|
|
36
|
+
}[];
|
|
37
|
+
}>;
|
|
38
|
+
export declare function createServer(registry: ProviderRegistry, templates?: TemplateRegistry, profile?: {
|
|
39
|
+
definition: import("./policy/schema.js").PolicyProfile;
|
|
40
|
+
questions: import("./types.js").DecisionQuestions;
|
|
41
|
+
validateState: (state: unknown) => Promise<boolean>;
|
|
42
|
+
}, mode?: import("./policy/events.js").PolicyAdapterMode, cascades?: CascadeRegistry, consensuses?: ConsensusRegistry, actionConsensus?: import("./routing/consensus.js").ResolvedConsensus | undefined, telemetry?: TelemetrySink): McpServer;
|