@molecule/api-ai-decisions-kev 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -61
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -3,15 +3,11 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-26T04:21:55.720Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-ai-decisions-kev
|
|
10
10
|
|
|
11
|
-
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
-
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
-
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
-
|
|
15
11
|
Kev decisions provider for molecule.dev — typed decisions from the
|
|
16
12
|
open-weights Kev models on a `kev.serve` host you run.
|
|
17
13
|
|
|
@@ -23,6 +19,10 @@ generate no text. Its README recommends Kev-4B as the default. `kev.serve`
|
|
|
23
19
|
speaks TypeSafe Jev's `/v1/systemone` protocol, so swapping to
|
|
24
20
|
`@molecule/api-ai-decisions-jev`, `-laya` or `-jeff` is a one-line change.
|
|
25
21
|
|
|
22
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
23
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
24
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
25
|
+
|
|
26
26
|
## Quick Start
|
|
27
27
|
|
|
28
28
|
```bash
|
|
@@ -104,26 +104,15 @@ interface KevConfig {
|
|
|
104
104
|
}
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
#### `
|
|
107
|
+
#### `WireQuestion`
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
One question as sent on the wire.
|
|
110
110
|
|
|
111
111
|
```typescript
|
|
112
|
-
interface
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
apiKey?: string
|
|
117
|
-
/** Extra headers resolved before the request (merged over the defaults). */
|
|
118
|
-
headers?: () => Record<string, string> | Promise<Record<string, string>>
|
|
119
|
-
/** Request body. */
|
|
120
|
-
body: Record<string, unknown>
|
|
121
|
-
/** Abort signal. */
|
|
122
|
-
signal?: AbortSignal
|
|
123
|
-
/** Label for error messages (`'Kev'`). */
|
|
124
|
-
label: string
|
|
125
|
-
/** Max retries on a retryable status (default 3). */
|
|
126
|
-
maxRetries?: number
|
|
112
|
+
interface WireQuestion {
|
|
113
|
+
type: 'choice' | 'score' | 'noul'
|
|
114
|
+
instructions: string
|
|
115
|
+
criteria?: Record<string, string> | string[]
|
|
127
116
|
}
|
|
128
117
|
```
|
|
129
118
|
|
|
@@ -141,18 +130,6 @@ interface WireAnswer {
|
|
|
141
130
|
}
|
|
142
131
|
```
|
|
143
132
|
|
|
144
|
-
#### `WireQuestion`
|
|
145
|
-
|
|
146
|
-
One question as sent on the wire.
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
interface WireQuestion {
|
|
150
|
-
type: 'choice' | 'score' | 'noul'
|
|
151
|
-
instructions: string
|
|
152
|
-
criteria?: Record<string, string> | string[]
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
133
|
#### `WireResponse`
|
|
157
134
|
|
|
158
135
|
The response body (only the fields we read).
|
|
@@ -165,6 +142,29 @@ interface WireResponse {
|
|
|
165
142
|
}
|
|
166
143
|
```
|
|
167
144
|
|
|
145
|
+
#### `PostOptions`
|
|
146
|
+
|
|
147
|
+
Options for {@link postSystemOne}.
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
interface PostOptions {
|
|
151
|
+
/** Full endpoint URL. */
|
|
152
|
+
url: string
|
|
153
|
+
/** Bearer token, if any. */
|
|
154
|
+
apiKey?: string
|
|
155
|
+
/** Extra headers resolved before the request (merged over the defaults). */
|
|
156
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>
|
|
157
|
+
/** Request body. */
|
|
158
|
+
body: Record<string, unknown>
|
|
159
|
+
/** Abort signal. */
|
|
160
|
+
signal?: AbortSignal
|
|
161
|
+
/** Label for error messages (`'Kev'`). */
|
|
162
|
+
label: string
|
|
163
|
+
/** Max retries on a retryable status (default 3). */
|
|
164
|
+
maxRetries?: number
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
168
|
### Functions
|
|
169
169
|
|
|
170
170
|
#### `createProvider(config)`
|
|
@@ -179,6 +179,18 @@ function createProvider(config?: KevConfig): AIDecisionsProvider
|
|
|
179
179
|
|
|
180
180
|
**Returns:** An `AIDecisionsProvider` backed by a `kev.serve` host.
|
|
181
181
|
|
|
182
|
+
#### `toWireQuestions(questions)`
|
|
183
|
+
|
|
184
|
+
Converts the core's questions into wire questions (`yesNo` → `noul`).
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
function toWireQuestions(questions: Record<string, DecisionQuestion>): Record<string, WireQuestion>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
- `questions` — The questions keyed by id.
|
|
191
|
+
|
|
192
|
+
**Returns:** The wire `questions` object.
|
|
193
|
+
|
|
182
194
|
#### `fromWireAnswer(id, question, wire, minConfidence)`
|
|
183
195
|
|
|
184
196
|
Converts one wire answer into the core's answer for `question`.
|
|
@@ -204,7 +216,11 @@ function fromWireAnswer(
|
|
|
204
216
|
Converts a whole wire response into the core's result.
|
|
205
217
|
|
|
206
218
|
```typescript
|
|
207
|
-
function fromWireResponse
|
|
219
|
+
function fromWireResponse<Q extends Record<string, DecisionQuestion>>(
|
|
220
|
+
questions: Q,
|
|
221
|
+
body: WireResponse,
|
|
222
|
+
minConfidence?: number,
|
|
223
|
+
): DecideResult<Q>
|
|
208
224
|
```
|
|
209
225
|
|
|
210
226
|
- `questions` — The questions that were asked.
|
|
@@ -226,26 +242,22 @@ function postSystemOne(opts: PostOptions): Promise<WireResponse>
|
|
|
226
242
|
|
|
227
243
|
**Returns:** The parsed response body.
|
|
228
244
|
|
|
229
|
-
|
|
245
|
+
### Constants
|
|
230
246
|
|
|
231
|
-
|
|
247
|
+
#### `DEFAULT_KEV_URL`
|
|
248
|
+
|
|
249
|
+
`kev.serve`'s default bind (`--port` defaults to 8008; its README examples use 8009).
|
|
232
250
|
|
|
233
251
|
```typescript
|
|
234
|
-
|
|
252
|
+
const DEFAULT_KEV_URL: 'http://localhost:8008'
|
|
235
253
|
```
|
|
236
254
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
**Returns:** The wire `questions` object.
|
|
240
|
-
|
|
241
|
-
### Constants
|
|
242
|
-
|
|
243
|
-
#### `aiDecisionsKevSecretDefinitions`
|
|
255
|
+
#### `DEFAULT_KEV_MODEL`
|
|
244
256
|
|
|
245
|
-
|
|
257
|
+
The model id `kev.serve` documents; any string is echoed back, none selects a checkpoint.
|
|
246
258
|
|
|
247
259
|
```typescript
|
|
248
|
-
const
|
|
260
|
+
const DEFAULT_KEV_MODEL: 'kev-latest'
|
|
249
261
|
```
|
|
250
262
|
|
|
251
263
|
#### `DEFAULT_KEV_MAX_OPTIONS`
|
|
@@ -256,14 +268,6 @@ Most `choice` options or `score` levels `kev.serve` accepts (`MAX_OPTIONS` in `k
|
|
|
256
268
|
const DEFAULT_KEV_MAX_OPTIONS: 255
|
|
257
269
|
```
|
|
258
270
|
|
|
259
|
-
#### `DEFAULT_KEV_MODEL`
|
|
260
|
-
|
|
261
|
-
The model id `kev.serve` documents; any string is echoed back, none selects a checkpoint.
|
|
262
|
-
|
|
263
|
-
```typescript
|
|
264
|
-
const DEFAULT_KEV_MODEL: 'kev-latest'
|
|
265
|
-
```
|
|
266
|
-
|
|
267
271
|
#### `DEFAULT_KEV_TIMEOUT_MS`
|
|
268
272
|
|
|
269
273
|
Default per-call timeout: room for a scale-to-zero cold start (~35 s on Modal).
|
|
@@ -272,20 +276,20 @@ Default per-call timeout: room for a scale-to-zero cold start (~35 s on Modal).
|
|
|
272
276
|
const DEFAULT_KEV_TIMEOUT_MS: 120000
|
|
273
277
|
```
|
|
274
278
|
|
|
275
|
-
#### `
|
|
279
|
+
#### `provider`
|
|
276
280
|
|
|
277
|
-
|
|
281
|
+
The provider implementation — lazy, so env vars are read on first use.
|
|
278
282
|
|
|
279
283
|
```typescript
|
|
280
|
-
const
|
|
284
|
+
const provider: AIDecisionsProvider
|
|
281
285
|
```
|
|
282
286
|
|
|
283
|
-
#### `
|
|
287
|
+
#### `aiDecisionsKevSecretDefinitions`
|
|
284
288
|
|
|
285
|
-
|
|
289
|
+
Secret definitions used by the Kev decisions bond.
|
|
286
290
|
|
|
287
291
|
```typescript
|
|
288
|
-
const
|
|
292
|
+
const aiDecisionsKevSecretDefinitions: SecretDefinition[]
|
|
289
293
|
```
|
|
290
294
|
|
|
291
295
|
## Core Interface
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-ai-decisions-kev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Kev decisions provider for molecule.dev — typed choice/score/yes-no answers from the open-weights Kev models (Qwen-based, 0.8B–27B) on your own kev.serve host",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@molecule/api-secrets": "^1.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@molecule/api-ai-decisions": "1.1.
|
|
38
|
+
"@molecule/api-ai-decisions": "1.1.2",
|
|
39
39
|
"@molecule/api-secrets": "1.0.2",
|
|
40
|
-
"@types/node": "26.
|
|
40
|
+
"@types/node": "26.6.5",
|
|
41
41
|
"typescript": "6.0.3",
|
|
42
|
-
"vitest": "4.1.
|
|
42
|
+
"vitest": "4.1.12"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|