@goodandready/dsh-moa 0.2.64 → 0.2.66
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/lib/client.js +2000 -2245
- package/lib/commands.js +83 -0
- package/lib/errors.js +176 -0
- package/lib/index.js +21 -0
- package/lib/moa-candidates.js +33 -11
- package/lib/moa-model-validator.js +242 -0
- package/lib/moa-service.js +21 -0
- package/lib/routes/presets.js +11 -0
- package/package.json +4 -2
package/lib/routes/presets.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { validateAllPresets } from '../moa-model-validator.js'
|
|
1
2
|
import { writeJson, readBody, assertAuthorizedRequest } from '../access.js'
|
|
2
3
|
import { isSafeWriteRequest } from '../updater.js'
|
|
3
4
|
import { resolvePresetForPrompt } from '../moa-router.js'
|
|
@@ -134,10 +135,15 @@ ctx.effect(() => {
|
|
|
134
135
|
if (!assertAuthorizedRequest(req, res, ctx)) return
|
|
135
136
|
const cfg = live()
|
|
136
137
|
if (req.method === 'GET') {
|
|
138
|
+
let validation = null
|
|
139
|
+
try {
|
|
140
|
+
validation = await validateAllPresets(cfg.presets || [], ctx)
|
|
141
|
+
} catch (_e) {}
|
|
137
142
|
writeJson(res, 200, {
|
|
138
143
|
ok: true,
|
|
139
144
|
defaultPreset: cfg.default_preset || 'default',
|
|
140
145
|
presets: cfg.presets || [],
|
|
146
|
+
validation,
|
|
141
147
|
})
|
|
142
148
|
return
|
|
143
149
|
}
|
|
@@ -179,12 +185,17 @@ ctx.effect(() => {
|
|
|
179
185
|
}
|
|
180
186
|
|
|
181
187
|
const unwrapped = typeof plainConfig === 'function' ? plainConfig(validated) : validated
|
|
188
|
+
let validation = null
|
|
189
|
+
try {
|
|
190
|
+
validation = await validateAllPresets(unwrapped.presets || [], ctx)
|
|
191
|
+
} catch (_e) {}
|
|
182
192
|
writeJson(res, 200, {
|
|
183
193
|
ok: true,
|
|
184
194
|
persisted: persistResult?.persisted ?? false,
|
|
185
195
|
enabled: unwrapped.enabled !== false,
|
|
186
196
|
defaultPreset: unwrapped.default_preset,
|
|
187
197
|
presets: unwrapped.presets,
|
|
198
|
+
validation,
|
|
188
199
|
})
|
|
189
200
|
} catch (err) { writeJson(res, 400, { ok: false, error: err?.message || String(err) }) }
|
|
190
201
|
return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goodandready/dsh-moa",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.66",
|
|
4
4
|
"description": "Mixture of Agents (MoA) plugin for DeepSeek Harness with /moa slash command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"LICENSE"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"test": "node --import ./test/_setup.mjs --test test/*.test.mjs",
|
|
22
|
+
"test": "node scripts/build-client.mjs --check && node --import ./test/_setup.mjs --test test/*.test.mjs",
|
|
23
23
|
"build:client": "node scripts/build-client.mjs"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
@@ -66,6 +66,8 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
+
"esbuild": "^0.28.2",
|
|
70
|
+
"eslint": "^10.14.0",
|
|
69
71
|
"react": "^18.3.1",
|
|
70
72
|
"react-dom": "^18.3.1"
|
|
71
73
|
}
|