jev-recipes 0.6.1 → 0.7.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.
Files changed (74) hide show
  1. package/README.md +57 -11
  2. package/dist/catalog/generated/details/completion-gate.json +110 -0
  3. package/dist/catalog/generated/details/context-prune.json +59 -0
  4. package/dist/catalog/generated/details/diff-hazards.json +112 -0
  5. package/dist/catalog/generated/details/model-route.json +82 -0
  6. package/dist/catalog/generated/details/route-many.json +68 -0
  7. package/dist/catalog/generated/details/tool-call-gate.json +123 -0
  8. package/dist/catalog/generated/details/wake-gate.json +40 -0
  9. package/dist/catalog/generated/loaders.js +7 -0
  10. package/dist/catalog/generated/metadata.js +217 -14
  11. package/dist/catalog/generated/names.d.ts +1 -1
  12. package/dist/catalog/generated/names.js +7 -0
  13. package/dist/catalog/schema.d.ts +7 -0
  14. package/dist/cli/schema.d.ts +21 -0
  15. package/dist/recipes/cancellation-check/schema.d.ts +6 -6
  16. package/dist/recipes/clarify/index.js +2 -2
  17. package/dist/recipes/completion-gate/demo.json +29 -0
  18. package/dist/recipes/completion-gate/index.d.ts +5 -0
  19. package/dist/recipes/completion-gate/index.js +53 -0
  20. package/dist/recipes/completion-gate/schema.d.ts +103 -0
  21. package/dist/recipes/completion-gate/schema.js +33 -0
  22. package/dist/recipes/context-prune/demo.json +40 -0
  23. package/dist/recipes/context-prune/index.d.ts +5 -0
  24. package/dist/recipes/context-prune/index.js +42 -0
  25. package/dist/recipes/context-prune/schema.d.ts +58 -0
  26. package/dist/recipes/context-prune/schema.js +23 -0
  27. package/dist/recipes/diff-hazards/demo.json +18 -0
  28. package/dist/recipes/diff-hazards/index.d.ts +5 -0
  29. package/dist/recipes/diff-hazards/index.js +48 -0
  30. package/dist/recipes/diff-hazards/schema.d.ts +96 -0
  31. package/dist/recipes/diff-hazards/schema.js +24 -0
  32. package/dist/recipes/extraction-fidelity/schema.d.ts +2 -2
  33. package/dist/recipes/handoff/schema.d.ts +1 -1
  34. package/dist/recipes/model-route/demo.json +45 -0
  35. package/dist/recipes/model-route/index.d.ts +5 -0
  36. package/dist/recipes/model-route/index.js +35 -0
  37. package/dist/recipes/model-route/schema.d.ts +51 -0
  38. package/dist/recipes/model-route/schema.js +16 -0
  39. package/dist/recipes/mood-match/schema.d.ts +2 -2
  40. package/dist/recipes/performance-feedback-facets/demo.json +1 -1
  41. package/dist/recipes/performance-feedback-facets/index.js +2 -2
  42. package/dist/recipes/product-match/schema.d.ts +2 -2
  43. package/dist/recipes/route-many/demo.json +53 -0
  44. package/dist/recipes/route-many/index.d.ts +5 -0
  45. package/dist/recipes/route-many/index.js +48 -0
  46. package/dist/recipes/route-many/schema.d.ts +49 -0
  47. package/dist/recipes/route-many/schema.js +30 -0
  48. package/dist/recipes/sound-match/schema.d.ts +2 -2
  49. package/dist/recipes/step-complete/demo.json +1 -1
  50. package/dist/recipes/step-complete/index.js +2 -2
  51. package/dist/recipes/symptom-facets/demo.json +1 -1
  52. package/dist/recipes/symptom-facets/index.js +3 -3
  53. package/dist/recipes/tool-call-gate/demo.json +26 -0
  54. package/dist/recipes/tool-call-gate/index.d.ts +5 -0
  55. package/dist/recipes/tool-call-gate/index.js +67 -0
  56. package/dist/recipes/tool-call-gate/schema.d.ts +134 -0
  57. package/dist/recipes/tool-call-gate/schema.js +34 -0
  58. package/dist/recipes/trip-purpose-kind/schema.d.ts +3 -3
  59. package/dist/recipes/verify/index.js +4 -3
  60. package/dist/recipes/wake-gate/demo.json +20 -0
  61. package/dist/recipes/wake-gate/index.d.ts +5 -0
  62. package/dist/recipes/wake-gate/index.js +16 -0
  63. package/dist/recipes/wake-gate/schema.d.ts +40 -0
  64. package/dist/recipes/wake-gate/schema.js +15 -0
  65. package/dist/src/answers.js +10 -4
  66. package/dist/src/batch.d.ts +12 -0
  67. package/dist/src/batch.js +23 -0
  68. package/dist/src/fanout.d.ts +20 -0
  69. package/dist/src/fanout.js +39 -0
  70. package/dist/src/index.d.ts +14 -0
  71. package/dist/src/index.js +7 -0
  72. package/dist/src/selection.d.ts +18 -0
  73. package/dist/src/selection.js +41 -11
  74. package/package.json +34 -3
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  <!-- BEGIN GENERATED: summary -->
13
13
 
14
- 236 focused recipes for JavaScript and TypeScript. Route messages, check evidence, and label model responses with a function call.
14
+ 243 focused recipes for JavaScript and TypeScript. Route messages, check evidence, and label model responses with a function call.
15
15
 
16
16
  <!-- END GENERATED: summary -->
17
17
 
@@ -117,16 +117,20 @@ The TypeSafe SDK handles API calls and typed answers. Recipes add the instructio
117
117
 
118
118
  ## Find your recipe
119
119
 
120
- | Your task | Start with |
121
- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
122
- | Send a request to the right team | [`route`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/route/README.md) |
123
- | Find useful passages | [`rerank`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/rerank/README.md) |
124
- | Check whether the evidence is enough to answer | [`answerability`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/answerability/README.md) |
125
- | Check claims against supplied evidence | [`verify`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/verify/README.md) |
126
- | Find missing or ambiguous requirements | [`clarify`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/clarify/README.md) |
127
- | Label a response's stance toward a claim | [`claim-stance`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/claim-stance/README.md) |
128
- | Choose a move from available game actions | [`choose-action`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/choose-action/README.md) |
129
- | Choose a checkers move from your board and legal moves | [`checkers-move`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/checkers-move/README.md) |
120
+ | Your task | Start with |
121
+ | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
122
+ | Send a request to the right team | [`route`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/route/README.md) |
123
+ | Find useful passages | [`rerank`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/rerank/README.md) |
124
+ | Check whether the evidence is enough to answer | [`answerability`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/answerability/README.md) |
125
+ | Check claims against supplied evidence | [`verify`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/verify/README.md) |
126
+ | Find missing or ambiguous requirements | [`clarify`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/clarify/README.md) |
127
+ | Label a response's stance toward a claim | [`claim-stance`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/claim-stance/README.md) |
128
+ | Choose a move from available game actions | [`choose-action`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/choose-action/README.md) |
129
+ | Choose a checkers move from your board and legal moves | [`checkers-move`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/checkers-move/README.md) |
130
+ | Allow, ask, or deny an agent's tool call | [`tool-call-gate`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/tool-call-gate/README.md) |
131
+ | Check an agent's "done" against evidence | [`completion-gate`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/completion-gate/README.md) |
132
+ | Pick a model tier and effort per request | [`model-route`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/model-route/README.md) |
133
+ | Route a backlog of messages in a few calls | [`route-many`](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/route-many/README.md) |
130
134
 
131
135
  Search, inspect inputs, and try saved results without a key:
132
136
 
@@ -140,6 +144,8 @@ npx jev-recipes demo answerability
140
144
 
141
145
  For games, use [game-action](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/game-action/README.md) with your existing JSON state and actions. It returns the original selected action, preserving your game IDs. [checkers-move](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/checkers-move/README.md) accepts a structured checkers board and legal moves; the [checkers example](https://github.com/agencyenterprise/jev-recipes/blob/main/examples/checkers/README.md) shows how to run its visual demo locally.
142
146
 
147
+ For agent harnesses, browse [Agent harness](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/README.md#agent-harness) for the decisions inside an agent loop: `tool-call-gate` before a tool runs, `model-route` per turn, `context-prune` before compaction, `wake-gate` for paused agents, `diff-hazards` before a commit, and `completion-gate` before accepting a result. Search with `npx jev-recipes list harness`.
148
+
143
149
  For psychology, browse [Psychology & behavior](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/README.md#psychology--behavior) for gain/loss framing, causal explanations, stated motivation, and related wording annotations. Search with `npx jev-recipes list psychology`.
144
150
 
145
151
  For music, browse [Music & sound](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/README.md#music--sound) for generation-loop decisions such as `next-note` and `phrase-complete`, listener steering such as `listener-request-kind`, and instrument or music-software tooling. Pass musical state as text or JSON. Search with `npx jev-recipes list music`.
@@ -179,6 +185,46 @@ Batch recipes expose their own summaries, such as `verify.allSupported` and its
179
185
 
180
186
  Pass `{ client, model, signal }` as the optional second argument to configure a call. [Shared behavior and limits](https://github.com/agencyenterprise/jev-recipes/blob/main/recipes/README.md#shared-options-and-behavior) covers configuration, input limits, and uncertainty.
181
187
 
188
+ ## Batch many inputs
189
+
190
+ A Jev request evaluates every question in parallel, so several inputs that share the same decision can travel together. `route-many` routes up to 500 requests in batches of 20 by default, making one call per batch instead of one per request:
191
+
192
+ ```js
193
+ import { routeMany } from 'jev-recipes/route-many';
194
+
195
+ const result = await routeMany({
196
+ requests: tickets.map((ticket) => ({ id: ticket.id, text: ticket.body })),
197
+ routes: { billing: 'Payments and refunds', technical: 'Errors and outages' },
198
+ batchSize: 20,
199
+ });
200
+
201
+ for (const item of result.items) {
202
+ if (item.status === 'ready') assign(item.id, item.route);
203
+ else queueForReview(item.id, item.suggestedRoute);
204
+ }
205
+ console.log(`${result.requestsMade} calls for ${result.requestCount} tickets`);
206
+ ```
207
+
208
+ Accuracy can drop as batches grow. Measure on your own labeled data and tune `batchSize`; the [eval harness](https://github.com/agencyenterprise/jev-recipes/blob/main/CONTRIBUTING.md#model-evaluation) reports calibration per threshold.
209
+
210
+ ## Use a local or alternative decision model
211
+
212
+ Recipes talk to any server that implements the TypeSafe `systemOne` wire format. Point the SDK client at it with `baseURL`, or set `TYPESAFE_BASE_URL` in the environment, and pass the client to any recipe:
213
+
214
+ ```js
215
+ import { createClient } from 'jev-recipes';
216
+ import { route } from 'jev-recipes/route';
217
+
218
+ const client = createClient({
219
+ baseURL: 'http://localhost:11434', // a self-hosted, TypeSafe-compatible server
220
+ apiKey: 'local',
221
+ });
222
+
223
+ const result = await route({ request, routes }, { client, model: 'my-local-model' });
224
+ ```
225
+
226
+ The `model` option selects a model name on that server. Recipes validate every response against the same schemas, so a server that returns malformed probabilities fails loudly rather than silently. The tooling tests exercise this path against a local HTTP server.
227
+
182
228
  ## Verification and scope
183
229
 
184
230
  The [CI workflow](https://github.com/agencyenterprise/jev-recipes/actions/workflows/ci.yml) runs on Node.js 22 and 24. `make ci` checks types, formatting, generated-file consistency, recipe test coverage, tooling, and the installable package.
@@ -0,0 +1,110 @@
1
+ {
2
+ "inputSchema": {
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "task": { "type": "string" },
7
+ "report": { "type": "string" },
8
+ "evidence": { "type": "string" },
9
+ "minConfidence": { "type": "number", "minimum": 0, "maximum": 1 }
10
+ },
11
+ "required": ["task", "report"]
12
+ },
13
+ "resultSchema": {
14
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
15
+ "type": "object",
16
+ "properties": {
17
+ "model": { "type": "string" },
18
+ "usage": {
19
+ "type": "object",
20
+ "properties": {
21
+ "input_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
22
+ "output_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
23
+ },
24
+ "required": ["input_tokens", "output_tokens"],
25
+ "additionalProperties": false
26
+ },
27
+ "status": { "type": "string", "enum": ["ready", "review"] },
28
+ "verdict": { "type": "string", "enum": ["complete", "incomplete", "unverified", "unclear"] },
29
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
30
+ "probabilities": {
31
+ "type": "object",
32
+ "propertyNames": {
33
+ "type": "string",
34
+ "enum": ["complete", "incomplete", "unverified", "unclear"]
35
+ },
36
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 },
37
+ "required": ["complete", "incomplete", "unverified", "unclear"]
38
+ },
39
+ "signals": {
40
+ "type": "object",
41
+ "properties": {
42
+ "claimsWithoutEvidence": {
43
+ "type": "object",
44
+ "properties": {
45
+ "status": { "type": "string", "enum": ["ready", "review"] },
46
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
47
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
48
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
49
+ },
50
+ "required": ["status", "verdict", "probability", "confidence"],
51
+ "additionalProperties": false
52
+ },
53
+ "scopeNarrowed": {
54
+ "type": "object",
55
+ "properties": {
56
+ "status": { "type": "string", "enum": ["ready", "review"] },
57
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
58
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
59
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
60
+ },
61
+ "required": ["status", "verdict", "probability", "confidence"],
62
+ "additionalProperties": false
63
+ },
64
+ "openQuestions": {
65
+ "type": "object",
66
+ "properties": {
67
+ "status": { "type": "string", "enum": ["ready", "review"] },
68
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
69
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
70
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
71
+ },
72
+ "required": ["status", "verdict", "probability", "confidence"],
73
+ "additionalProperties": false
74
+ },
75
+ "unresolvedErrors": {
76
+ "type": "object",
77
+ "properties": {
78
+ "status": { "type": "string", "enum": ["ready", "review"] },
79
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
80
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
81
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
82
+ },
83
+ "required": ["status", "verdict", "probability", "confidence"],
84
+ "additionalProperties": false
85
+ }
86
+ },
87
+ "required": ["claimsWithoutEvidence", "scopeNarrowed", "openQuestions", "unresolvedErrors"],
88
+ "additionalProperties": false
89
+ },
90
+ "detected": {
91
+ "type": "array",
92
+ "items": {
93
+ "type": "string",
94
+ "enum": ["claimsWithoutEvidence", "scopeNarrowed", "openQuestions", "unresolvedErrors"]
95
+ }
96
+ }
97
+ },
98
+ "required": [
99
+ "model",
100
+ "usage",
101
+ "status",
102
+ "verdict",
103
+ "confidence",
104
+ "probabilities",
105
+ "signals",
106
+ "detected"
107
+ ],
108
+ "additionalProperties": false
109
+ }
110
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "inputSchema": {
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "objective": { "type": "string" },
7
+ "items": {
8
+ "minItems": 1,
9
+ "maxItems": 50,
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": { "id": { "type": "string" }, "text": { "type": "string" } },
14
+ "required": ["id", "text"]
15
+ }
16
+ },
17
+ "recent": { "type": "string" },
18
+ "minConfidence": { "type": "number", "minimum": 0, "maximum": 1 }
19
+ },
20
+ "required": ["objective", "items"]
21
+ },
22
+ "resultSchema": {
23
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
24
+ "type": "object",
25
+ "properties": {
26
+ "model": { "type": "string" },
27
+ "usage": {
28
+ "type": "object",
29
+ "properties": {
30
+ "input_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
31
+ "output_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
32
+ },
33
+ "required": ["input_tokens", "output_tokens"],
34
+ "additionalProperties": false
35
+ },
36
+ "status": { "type": "string", "enum": ["ready", "review"] },
37
+ "items": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "object",
41
+ "properties": {
42
+ "id": { "type": "string" },
43
+ "status": { "type": "string", "enum": ["ready", "review"] },
44
+ "verdict": { "type": "string", "enum": ["keep", "drop"] },
45
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
46
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
47
+ },
48
+ "required": ["id", "status", "verdict", "probability", "confidence"],
49
+ "additionalProperties": false
50
+ }
51
+ },
52
+ "keep": { "type": "array", "items": { "type": "string" } },
53
+ "drop": { "type": "array", "items": { "type": "string" } },
54
+ "evaluated": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
55
+ },
56
+ "required": ["model", "usage", "status", "items", "keep", "drop", "evaluated"],
57
+ "additionalProperties": false
58
+ }
59
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "inputSchema": {
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "diff": { "type": "string" },
7
+ "context": { "type": "string" },
8
+ "minConfidence": { "type": "number", "minimum": 0, "maximum": 1 }
9
+ },
10
+ "required": ["diff"]
11
+ },
12
+ "resultSchema": {
13
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
14
+ "type": "object",
15
+ "properties": {
16
+ "model": { "type": "string" },
17
+ "usage": {
18
+ "type": "object",
19
+ "properties": {
20
+ "input_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
21
+ "output_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
22
+ },
23
+ "required": ["input_tokens", "output_tokens"],
24
+ "additionalProperties": false
25
+ },
26
+ "status": { "type": "string", "enum": ["ready", "review"] },
27
+ "detected": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "string",
31
+ "enum": [
32
+ "secretLeak",
33
+ "destructiveCommand",
34
+ "debugLeftover",
35
+ "testsWeakened",
36
+ "dependencyChange"
37
+ ]
38
+ }
39
+ },
40
+ "labels": {
41
+ "type": "object",
42
+ "properties": {
43
+ "secretLeak": {
44
+ "type": "object",
45
+ "properties": {
46
+ "status": { "type": "string", "enum": ["ready", "review"] },
47
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
48
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
49
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
50
+ },
51
+ "required": ["status", "verdict", "probability", "confidence"],
52
+ "additionalProperties": false
53
+ },
54
+ "destructiveCommand": {
55
+ "type": "object",
56
+ "properties": {
57
+ "status": { "type": "string", "enum": ["ready", "review"] },
58
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
59
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
60
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
61
+ },
62
+ "required": ["status", "verdict", "probability", "confidence"],
63
+ "additionalProperties": false
64
+ },
65
+ "debugLeftover": {
66
+ "type": "object",
67
+ "properties": {
68
+ "status": { "type": "string", "enum": ["ready", "review"] },
69
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
70
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
71
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
72
+ },
73
+ "required": ["status", "verdict", "probability", "confidence"],
74
+ "additionalProperties": false
75
+ },
76
+ "testsWeakened": {
77
+ "type": "object",
78
+ "properties": {
79
+ "status": { "type": "string", "enum": ["ready", "review"] },
80
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
81
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
82
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
83
+ },
84
+ "required": ["status", "verdict", "probability", "confidence"],
85
+ "additionalProperties": false
86
+ },
87
+ "dependencyChange": {
88
+ "type": "object",
89
+ "properties": {
90
+ "status": { "type": "string", "enum": ["ready", "review"] },
91
+ "verdict": { "type": "string", "enum": ["present", "absent"] },
92
+ "probability": { "type": "number", "minimum": 0, "maximum": 1 },
93
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 }
94
+ },
95
+ "required": ["status", "verdict", "probability", "confidence"],
96
+ "additionalProperties": false
97
+ }
98
+ },
99
+ "required": [
100
+ "secretLeak",
101
+ "destructiveCommand",
102
+ "debugLeftover",
103
+ "testsWeakened",
104
+ "dependencyChange"
105
+ ],
106
+ "additionalProperties": false
107
+ }
108
+ },
109
+ "required": ["model", "usage", "status", "detected", "labels"],
110
+ "additionalProperties": false
111
+ }
112
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "inputSchema": {
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "request": { "type": "string" },
7
+ "models": {
8
+ "minItems": 1,
9
+ "maxItems": 50,
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": { "id": { "type": "string" }, "text": { "type": "string" } },
14
+ "required": ["id", "text"]
15
+ }
16
+ },
17
+ "context": { "type": "string" },
18
+ "minConfidence": { "type": "number", "minimum": 0, "maximum": 1 }
19
+ },
20
+ "required": ["request", "models"]
21
+ },
22
+ "resultSchema": {
23
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
24
+ "type": "object",
25
+ "properties": {
26
+ "model": { "type": "string" },
27
+ "usage": {
28
+ "type": "object",
29
+ "properties": {
30
+ "input_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
31
+ "output_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
32
+ },
33
+ "required": ["input_tokens", "output_tokens"],
34
+ "additionalProperties": false
35
+ },
36
+ "status": { "type": "string", "enum": ["ready", "review"] },
37
+ "verdict": { "type": "string", "enum": ["matched", "none", "ambiguous"] },
38
+ "selection": { "type": ["string", "null"] },
39
+ "suggestedSelection": { "type": ["string", "null"] },
40
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
41
+ "probabilities": {
42
+ "type": "object",
43
+ "properties": {
44
+ "candidates": {
45
+ "type": "object",
46
+ "propertyNames": { "type": "string" },
47
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
48
+ },
49
+ "none": { "type": "number", "minimum": 0, "maximum": 1 },
50
+ "ambiguous": { "type": "number", "minimum": 0, "maximum": 1 }
51
+ },
52
+ "required": ["candidates", "none", "ambiguous"],
53
+ "additionalProperties": false
54
+ },
55
+ "effort": { "type": "string", "enum": ["low", "medium", "high"] },
56
+ "effortLevel": { "type": "integer", "minimum": 0, "maximum": 2 },
57
+ "effortScore": { "type": "number", "minimum": 0, "maximum": 2 },
58
+ "effortConfidence": { "type": "number", "minimum": 0, "maximum": 1 },
59
+ "effortProbabilities": {
60
+ "type": "object",
61
+ "propertyNames": { "type": "string" },
62
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
63
+ }
64
+ },
65
+ "required": [
66
+ "model",
67
+ "usage",
68
+ "status",
69
+ "verdict",
70
+ "selection",
71
+ "suggestedSelection",
72
+ "confidence",
73
+ "probabilities",
74
+ "effort",
75
+ "effortLevel",
76
+ "effortScore",
77
+ "effortConfidence",
78
+ "effortProbabilities"
79
+ ],
80
+ "additionalProperties": false
81
+ }
82
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "inputSchema": {
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "requests": {
7
+ "minItems": 1,
8
+ "maxItems": 500,
9
+ "type": "array",
10
+ "items": {
11
+ "type": "object",
12
+ "properties": { "id": { "type": "string" }, "text": { "type": "string" } },
13
+ "required": ["id", "text"]
14
+ }
15
+ },
16
+ "routes": {
17
+ "type": "object",
18
+ "propertyNames": { "type": "string" },
19
+ "additionalProperties": { "type": "string" }
20
+ },
21
+ "batchSize": { "type": "integer", "minimum": 1, "maximum": 50 },
22
+ "minConfidence": { "type": "number", "minimum": 0, "maximum": 1 }
23
+ },
24
+ "required": ["requests", "routes"]
25
+ },
26
+ "resultSchema": {
27
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
28
+ "type": "object",
29
+ "properties": {
30
+ "model": { "type": "string" },
31
+ "usage": {
32
+ "type": "object",
33
+ "properties": {
34
+ "input_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
35
+ "output_tokens": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
36
+ },
37
+ "required": ["input_tokens", "output_tokens"],
38
+ "additionalProperties": false
39
+ },
40
+ "status": { "type": "string", "enum": ["ready", "review"] },
41
+ "items": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "object",
45
+ "properties": {
46
+ "id": { "type": "string" },
47
+ "status": { "type": "string", "enum": ["ready", "review"] },
48
+ "route": { "type": ["string", "null"] },
49
+ "suggestedRoute": { "type": ["string", "null"] },
50
+ "confidence": { "type": "number", "minimum": 0, "maximum": 1 },
51
+ "probabilities": {
52
+ "type": "object",
53
+ "propertyNames": { "type": "string" },
54
+ "additionalProperties": { "type": "number", "minimum": 0, "maximum": 1 }
55
+ }
56
+ },
57
+ "required": ["id", "status", "route", "suggestedRoute", "confidence", "probabilities"],
58
+ "additionalProperties": false
59
+ }
60
+ },
61
+ "routed": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
62
+ "requestCount": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 },
63
+ "requestsMade": { "type": "integer", "exclusiveMinimum": 0, "maximum": 9007199254740991 }
64
+ },
65
+ "required": ["model", "usage", "status", "items", "routed", "requestCount", "requestsMade"],
66
+ "additionalProperties": false
67
+ }
68
+ }