w-dispatch-ai 1.0.6 → 1.0.7
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 +4 -1
- package/dist/w-dispatch-ai.umd.js +2 -2
- package/dist/w-dispatch-ai.umd.js.map +1 -1
- package/docs/WDispatchAi.mjs.html +1 -1
- package/docs/adapters.mjs.html +1 -1
- package/docs/dfTimeoutMs.mjs.html +1 -1
- package/docs/dispatchAi.mjs.html +1 -1
- package/docs/dispatchAiFallback.mjs.html +71 -6
- package/docs/dispatchAiWkf.mjs.html +1 -1
- package/docs/dispatchAntigravity.mjs.html +1 -1
- package/docs/dispatchApiOpenaiCompat.mjs.html +1 -1
- package/docs/dispatchClaude.mjs.html +1 -1
- package/docs/dispatchCodex.mjs.html +1 -1
- package/docs/dispatchOpencode.mjs.html +1 -1
- package/docs/getCliArgs.mjs.html +1 -1
- package/docs/getErrorResult.mjs.html +1 -1
- package/docs/global.html +48 -8
- package/docs/index.html +1 -1
- package/docs/resolveProviders.mjs.html +1 -1
- package/docs/wkf_callAiWithFallback.mjs.html +1 -1
- package/docs/wkf_extractJsonLoose.mjs.html +1 -1
- package/docs/wkf_runFanout.mjs.html +11 -8
- package/docs/wkf_runFanoutPipeline.mjs.html +2 -2
- package/docs/wkf_runRolePipeline.mjs.html +1 -1
- package/package.json +1 -1
- package/src/dispatchAiFallback.mjs +70 -5
- package/src/wkf/runFanout.mjs +10 -7
- package/src/wkf/runFanoutPipeline.mjs +1 -1
- package/test/unit-dispatchAiFallback.test.mjs +95 -0
- package/test/unit-dispatchApiOpenaiCompat.test.mjs +28 -0
- package/test/unit-runFanout.test.mjs +46 -0
|
@@ -156,6 +156,52 @@ describe('runFanout', function() {
|
|
|
156
156
|
assert.strict.deepEqual(r, rr)
|
|
157
157
|
})
|
|
158
158
|
|
|
159
|
+
it('integrate可帶獨立check(終稿判準), 未給則沿用頂層check', async function() {
|
|
160
|
+
//頂層check放行所有echo物件; integrate.check要求stdin含候選標記(僅整合者符合)
|
|
161
|
+
let t1 = await runFanout({
|
|
162
|
+
providers,
|
|
163
|
+
task: 'abc',
|
|
164
|
+
agents: [{ use: 'p-a' }, { use: 'p-b' }],
|
|
165
|
+
integrate: { use: 'p-int', check: (j) => j.stdin.includes('【候選 1】') },
|
|
166
|
+
check: (j) => Array.isArray(j.args),
|
|
167
|
+
callOpt,
|
|
168
|
+
})
|
|
169
|
+
//integrate.check不通過時整合失敗, 但候選不受影響(判準不再互相牽制)
|
|
170
|
+
let t2 = await runFanout({
|
|
171
|
+
providers,
|
|
172
|
+
task: 'abc',
|
|
173
|
+
agents: [{ use: 'p-a' }, { use: 'p-b' }],
|
|
174
|
+
integrate: { use: 'p-int', check: () => false },
|
|
175
|
+
check: (j) => Array.isArray(j.args),
|
|
176
|
+
callOpt,
|
|
177
|
+
})
|
|
178
|
+
let r = [
|
|
179
|
+
[t1.ok, t1.integrated],
|
|
180
|
+
[t2.ok, t2.integrated, t2.candidates.length, t2.error.indexOf('integrate failed:') === 0],
|
|
181
|
+
]
|
|
182
|
+
let rr = [
|
|
183
|
+
[true, true],
|
|
184
|
+
[false, false, 2, true],
|
|
185
|
+
]
|
|
186
|
+
assert.strict.deepEqual(r, rr)
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
it('名額規格可帶獨立check覆寫頂層(曾為被靜默覆蓋之死鍵)', async function() {
|
|
190
|
+
let t = await runFanout({
|
|
191
|
+
providers,
|
|
192
|
+
task: 'abc',
|
|
193
|
+
agents: [
|
|
194
|
+
{ use: 'p-a', check: () => false }, //此名額專屬判準: 必不過
|
|
195
|
+
{ use: 'p-b' }, //沿用頂層(未給即預設放行)
|
|
196
|
+
],
|
|
197
|
+
integrate: { use: 'p-int' },
|
|
198
|
+
callOpt,
|
|
199
|
+
})
|
|
200
|
+
let r = [t.ok, t.integrated, t.agents[0].ok, t.agents[1].ok, t.candidates.length]
|
|
201
|
+
let rr = [true, false, false, true, 1] //單稿放行(integrated:false)
|
|
202
|
+
assert.strict.deepEqual(r, rr)
|
|
203
|
+
})
|
|
204
|
+
|
|
159
205
|
it('defaultIntegratePrompt嵌入候選數與schema', function() {
|
|
160
206
|
let s = defaultIntegratePrompt([{ a: 1 }, { b: 2 }], { schema: '{"x":"..."}' })
|
|
161
207
|
let r = [s.includes('2 個獨立執行'), s.includes('{"x":"..."}'), s.includes('【候選 2】')]
|