w-dispatch-ai 1.0.33 → 1.0.35
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 +8 -8
- 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/budgetFor.mjs.html +1 -1
- package/docs/buildValidator.mjs.html +1 -1
- package/docs/castPintOr.mjs.html +1 -1
- package/docs/dfTimeoutMs.mjs.html +1 -1
- package/docs/dispatchAi.mjs.html +1 -1
- package/docs/dispatchAiFallback.mjs.html +1 -1
- package/docs/dispatchAiWkf.mjs.html +1 -1
- package/docs/dispatchAntigravity.mjs.html +1 -1
- package/docs/dispatchApiOpenaiCompat.mjs.html +1 -1
- package/docs/dispatchApiOpenaiResponses.mjs.html +1 -1
- package/docs/dispatchApiTypesafeSystemone.mjs.html +1 -1
- package/docs/dispatchClaude.mjs.html +13 -3
- package/docs/dispatchCodex.mjs.html +2 -2
- package/docs/dispatchOpencode.mjs.html +43 -11
- package/docs/getCliArgs.mjs.html +1 -1
- package/docs/getErrorResult.mjs.html +1 -1
- package/docs/getErrorType.mjs.html +1 -1
- package/docs/global.html +9 -9
- package/docs/index.html +1 -1
- package/docs/quota_dfQuotaTimeoutMs.mjs.html +1 -1
- package/docs/quota_fetchQuotaJson.mjs.html +1 -1
- package/docs/quota_fromCodexUsageHttp.mjs.html +1 -1
- package/docs/quota_getQuotaAntigravity.mjs.html +1 -1
- package/docs/quota_getQuotaClaude.mjs.html +1 -1
- package/docs/quota_getQuotaCodex.mjs.html +1 -1
- package/docs/quota_readJsonOrNull.mjs.html +1 -1
- package/docs/quota_toQuotaLabel.mjs.html +1 -1
- package/docs/quota_toQuotaResult.mjs.html +1 -1
- package/docs/quota_toQuotaScopedLabel.mjs.html +1 -1
- package/docs/quota_toQuotaWindow.mjs.html +1 -1
- package/docs/readEnvFile.mjs.html +1 -1
- package/docs/resolveProviders.mjs.html +2 -2
- package/docs/wkf_callAiWithFallback.mjs.html +2 -2
- package/docs/wkf_createFileStore.mjs.html +1 -1
- package/docs/wkf_createUsageCounter.mjs.html +1 -1
- package/docs/wkf_extractJsonLoose.mjs.html +1 -1
- package/docs/wkf_noSideEffectPrefix.mjs.html +4 -3
- package/docs/wkf_runFanout.mjs.html +1 -1
- package/docs/wkf_runFanoutPipeline.mjs.html +1 -1
- package/docs/wkf_runRolePipeline.mjs.html +1 -1
- package/docs/wkf_salvageTruncatedArray.mjs.html +1 -1
- package/package.json +1 -1
- package/src/dispatchClaude.mjs +12 -2
- package/src/dispatchCodex.mjs +1 -1
- package/src/dispatchOpencode.mjs +41 -9
- package/src/providers.mjs +41 -2
- package/src/resolveProviders.mjs +1 -1
- package/src/wkf/callAiWithFallback.mjs +1 -1
- package/src/wkf/noSideEffectPrefix.mjs +3 -2
- package/test/tools/fakeCliForTest.mjs +1 -0
- package/test/unit-dispatchOpencode.test.mjs +21 -0
- package/test/unit-providers.test.mjs +6 -1
|
@@ -132,7 +132,7 @@ export default WDispatchAi
|
|
|
132
132
|
<br class="clear">
|
|
133
133
|
|
|
134
134
|
<footer>
|
|
135
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
135
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
136
136
|
</footer>
|
|
137
137
|
|
|
138
138
|
<script>prettyPrint();</script>
|
package/docs/adapters.mjs.html
CHANGED
|
@@ -134,7 +134,7 @@ export default adapters
|
|
|
134
134
|
<br class="clear">
|
|
135
135
|
|
|
136
136
|
<footer>
|
|
137
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
137
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
138
138
|
</footer>
|
|
139
139
|
|
|
140
140
|
<script>prettyPrint();</script>
|
package/docs/budgetFor.mjs.html
CHANGED
|
@@ -111,7 +111,7 @@ export default budgetFor
|
|
|
111
111
|
<br class="clear">
|
|
112
112
|
|
|
113
113
|
<footer>
|
|
114
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
114
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
115
115
|
</footer>
|
|
116
116
|
|
|
117
117
|
<script>prettyPrint();</script>
|
|
@@ -153,7 +153,7 @@ export default buildValidator
|
|
|
153
153
|
<br class="clear">
|
|
154
154
|
|
|
155
155
|
<footer>
|
|
156
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
156
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
157
157
|
</footer>
|
|
158
158
|
|
|
159
159
|
<script>prettyPrint();</script>
|
package/docs/castPintOr.mjs.html
CHANGED
|
@@ -96,7 +96,7 @@ export default castPintOr
|
|
|
96
96
|
<br class="clear">
|
|
97
97
|
|
|
98
98
|
<footer>
|
|
99
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
99
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
100
100
|
</footer>
|
|
101
101
|
|
|
102
102
|
<script>prettyPrint();</script>
|
|
@@ -85,7 +85,7 @@ export default dfTimeoutMs
|
|
|
85
85
|
<br class="clear">
|
|
86
86
|
|
|
87
87
|
<footer>
|
|
88
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
88
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
89
89
|
</footer>
|
|
90
90
|
|
|
91
91
|
<script>prettyPrint();</script>
|
package/docs/dispatchAi.mjs.html
CHANGED
|
@@ -121,7 +121,7 @@ export default dispatchAi
|
|
|
121
121
|
<br class="clear">
|
|
122
122
|
|
|
123
123
|
<footer>
|
|
124
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
124
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
125
125
|
</footer>
|
|
126
126
|
|
|
127
127
|
<script>prettyPrint();</script>
|
|
@@ -555,7 +555,7 @@ export default dispatchAiFallback
|
|
|
555
555
|
<br class="clear">
|
|
556
556
|
|
|
557
557
|
<footer>
|
|
558
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
558
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
559
559
|
</footer>
|
|
560
560
|
|
|
561
561
|
<script>prettyPrint();</script>
|
|
@@ -193,7 +193,7 @@ export default dispatchAiWkf
|
|
|
193
193
|
<br class="clear">
|
|
194
194
|
|
|
195
195
|
<footer>
|
|
196
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
196
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
197
197
|
</footer>
|
|
198
198
|
|
|
199
199
|
<script>prettyPrint();</script>
|
|
@@ -258,7 +258,7 @@ export default dispatchAntigravity
|
|
|
258
258
|
<br class="clear">
|
|
259
259
|
|
|
260
260
|
<footer>
|
|
261
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
261
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
262
262
|
</footer>
|
|
263
263
|
|
|
264
264
|
<script>prettyPrint();</script>
|
|
@@ -427,7 +427,7 @@ export default dispatchApiOpenaiCompat
|
|
|
427
427
|
<br class="clear">
|
|
428
428
|
|
|
429
429
|
<footer>
|
|
430
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
430
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
431
431
|
</footer>
|
|
432
432
|
|
|
433
433
|
<script>prettyPrint();</script>
|
|
@@ -485,7 +485,7 @@ export { extractOutputText }
|
|
|
485
485
|
<br class="clear">
|
|
486
486
|
|
|
487
487
|
<footer>
|
|
488
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
488
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
489
489
|
</footer>
|
|
490
490
|
|
|
491
491
|
<script>prettyPrint();</script>
|
|
@@ -434,7 +434,7 @@ export default dispatchApiTypesafeSystemone
|
|
|
434
434
|
<br class="clear">
|
|
435
435
|
|
|
436
436
|
<footer>
|
|
437
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
437
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
438
438
|
</footer>
|
|
439
439
|
|
|
440
440
|
<script>prettyPrint();</script>
|
|
@@ -66,6 +66,16 @@ import dfTimeoutMs from './dfTimeoutMs.mjs'
|
|
|
66
66
|
//
|
|
67
67
|
// 【認證】沿用Claude Code既有登入狀態(帳號層級),不需也不支援逐次注入API key,
|
|
68
68
|
// 故本轉接器無key參數——輪替時它是「一個獨立的供應商」而非「另一把金鑰」。
|
|
69
|
+
//
|
|
70
|
+
// 【勿帶--bare, 並留意其未來成為-p預設(2026-09-23查官方headless文件)】文件原文:
|
|
71
|
+
// 「--bare is the recommended mode for scripted and SDK calls, and will become the default for -p in a
|
|
72
|
+
// future release」且「In bare mode, Claude Code never reads OAuth credentials or the system keychain」。
|
|
73
|
+
// 本轉接器靠訂閱登入(OAuth), 故extraArgs勿帶--bare(會直接認證失敗); 若日後某版把-p預設改為bare,
|
|
74
|
+
// 所有訂閱條目會一併失效——徵狀為非零離開碼, 失敗訊息印在stdout而非stderr(官方: 執行期失敗如未登入
|
|
75
|
+
// 以result印在stdout)。2.1.280尚無退出bare之旗標, 無法預先處理; 每次升級Claude Code後跑一次claude
|
|
76
|
+
// 條目即可偵測, 屆時再查該版之退出方式調整此處。
|
|
77
|
+
// 另兩點同日查證: stdin傳入之prompt上限10MB(超過即非零離開, 見@param prompt);
|
|
78
|
+
// 2.1.280起Pro/Team Standard方案未給model時預設由Sonnet改為Opus(只影響未帶--model之呼叫)。
|
|
69
79
|
|
|
70
80
|
|
|
71
81
|
//預設值
|
|
@@ -88,10 +98,10 @@ let OWN_KEYS = ['exe', 'model', 'skipPermissions', 'extraArgs', 'input']
|
|
|
88
98
|
* 可給予skipPermissions為false保留CLI權限閘門;
|
|
89
99
|
* 本函數不會reject,一律以結果物件之ok與error欄位回報成敗
|
|
90
100
|
*
|
|
91
|
-
* @param {String} prompt 輸入提示詞字串,一律以stdin傳入子進程
|
|
101
|
+
* @param {String} prompt 輸入提示詞字串,一律以stdin傳入子進程(Claude Code之stdin上限10MB,超過即非零離開)
|
|
92
102
|
* @param {Object} [opt={}] 輸入設定物件,預設{}
|
|
93
103
|
* @param {String} [opt.exe='claude'] 輸入claude執行檔名稱或絕對路徑字串,給予名稱時由execCli自系統PATH解析,預設'claude'
|
|
94
|
-
* @param {String} [opt.model=''] 輸入模型別名或模型ID字串,例如'
|
|
104
|
+
* @param {String} [opt.model=''] 輸入模型別名或模型ID字串,例如'claude-opus-5-5'(全名, 固定版本)、'opus'或'sonnet'(別名, 隨CLI指向最新版),預設''代表不帶`--model`旗標,由CLI依方案決定(2.1.280起Pro/Team Standard亦預設Opus)
|
|
95
105
|
* @param {Boolean} [opt.skipPermissions=true] 輸入是否帶`--dangerously-skip-permissions`旗標布林值,false代表保留CLI權限閘門,預設true
|
|
96
106
|
* @param {Array} [opt.extraArgs=[]] 輸入額外命令列旗標字串陣列,將接於固定旗標之後,預設[]
|
|
97
107
|
* @param {Number} [opt.timeoutMs=300000] 輸入逾時毫秒正整數,逾時將強制關閉子進程及其子孫程序,全套件統一預設300000
|
|
@@ -185,7 +195,7 @@ export default dispatchClaude
|
|
|
185
195
|
<br class="clear">
|
|
186
196
|
|
|
187
197
|
<footer>
|
|
188
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
198
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
189
199
|
</footer>
|
|
190
200
|
|
|
191
201
|
<script>prettyPrint();</script>
|
|
@@ -101,7 +101,7 @@ let OWN_KEYS = ['exe', 'model', 'sandbox', 'extraArgs', 'input']
|
|
|
101
101
|
* @param {String} prompt 輸入提示詞字串,一律以stdin傳入子進程
|
|
102
102
|
* @param {Object} [opt={}] 輸入設定物件,預設{}
|
|
103
103
|
* @param {String} [opt.exe='codex'] 輸入codex執行檔名稱或絕對路徑字串,給予名稱時由execCli自系統PATH解析,預設'codex'
|
|
104
|
-
* @param {String} [opt.model=''] 輸入模型ID字串,例如'gpt-5.6-luna',預設''代表不帶`-m`旗標
|
|
104
|
+
* @param {String} [opt.model=''] 輸入模型ID字串,例如'gpt-5.6-luna'、'gpt-6-sol',預設''代表不帶`-m`旗標
|
|
105
105
|
* @param {String} [opt.sandbox='workspace-write'] 輸入沙箱模式字串,例如'read-only'、'workspace-write'、'danger-full-access',預設'workspace-write'
|
|
106
106
|
* @param {Array} [opt.extraArgs=[]] 輸入額外命令列旗標字串陣列,例如['--config', 'model_reasoning_effort="max"'],將接於固定旗標之後,預設[]
|
|
107
107
|
* @param {Number} [opt.timeoutMs=300000] 輸入逾時毫秒正整數,逾時將強制關閉子進程及其子孫程序,全套件統一預設300000
|
|
@@ -196,7 +196,7 @@ export default dispatchCodex
|
|
|
196
196
|
<br class="clear">
|
|
197
197
|
|
|
198
198
|
<footer>
|
|
199
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
199
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
200
200
|
</footer>
|
|
201
201
|
|
|
202
202
|
<script>prettyPrint();</script>
|
|
@@ -45,7 +45,8 @@
|
|
|
45
45
|
|
|
46
46
|
<section>
|
|
47
47
|
<article>
|
|
48
|
-
<pre class="prettyprint source linenums"><code>import
|
|
48
|
+
<pre class="prettyprint source linenums"><code>import path from 'path'
|
|
49
|
+
import get from 'lodash-es/get.js'
|
|
49
50
|
import omit from 'lodash-es/omit.js'
|
|
50
51
|
import isobj from 'wsemi/src/isobj.mjs'
|
|
51
52
|
import isestr from 'wsemi/src/isestr.mjs'
|
|
@@ -69,16 +70,30 @@ import dfTimeoutMs from './dfTimeoutMs.mjs'
|
|
|
69
70
|
// `if (process.env.OPENCODE_AUTH_CONTENT) return JSON.parse(...)`, 解析成功即整份取代, 不與auth.json合併;
|
|
70
71
|
// 空字串為falsy、非法JSON會落回讀auth.json。auth.json位於<XDG_DATA_HOME|~/.local/share>/opencode/。
|
|
71
72
|
//
|
|
72
|
-
// 【本轉接器只驗證過opencode v1(實測至1.18.
|
|
73
|
-
// opencode已另發布v2(
|
|
74
|
-
// 官方〈Migrate from V1〉明載「OpenCode 1 and OpenCode 2 both use the opencode
|
|
75
|
-
// installed side by side by default... the V2 curl installer replaces the V1 binary
|
|
76
|
-
// v2
|
|
73
|
+
// 【本轉接器只驗證過opencode v1(實測至1.18.32), v2尚未支援(2026-09-22查證, 2026-09-23補④)】
|
|
74
|
+
// opencode已另發布v2(2026-09-23已至2.0.15, npm套件@opencode/cli, bin另含opencode2; 文件自成一棵樹
|
|
75
|
+
// https://opencode.ai/v2/docs), 官方〈Migrate from V1〉明載「OpenCode 1 and OpenCode 2 both use the opencode
|
|
76
|
+
// command and are no longer installed side by side by default... the V2 curl installer replaces the V1 binary」
|
|
77
|
+
// ——即升級v2會取代同名執行檔。v1之npm套件opencode-ai(1.18.32)仍為latest且未標deprecated。
|
|
78
|
+
// v2仍有`opencode run`(文件列為自動化用途)與`--agent`, 但至少四處與本轉接器之假設不同, 升級前須逐一實測:
|
|
77
79
|
// ① 模型旗標: v2文件一律寫`--model provider/model`, 本轉接器用`-m`(v2是否保留為別名未驗證);
|
|
78
|
-
// ② provider設定形狀: v2改為`providers.<id>.package
|
|
80
|
+
// ② provider設定形狀: v2改為`providers.<id>.package`(單數provider→providers, npm→package並加aisdk:前綴),
|
|
79
81
|
// 與本轉接器經OPENCODE_CONFIG_CONTENT注入之v1形狀(provider.<id>.npm)不同;
|
|
80
|
-
// ③ 金鑰注入: v2憑證走/connect與新憑證庫, OPENCODE_AUTH_CONTENT
|
|
81
|
-
//
|
|
82
|
+
// ③ 金鑰注入: v2憑證走/connect與新憑證庫, OPENCODE_AUTH_CONTENT是否仍被讀取未驗證;
|
|
83
|
+
// ④ 權限設定形狀: v2改為單一有序`permissions`陣列, 動作亦改名(bash→shell、task→subagent、write/patch→edit),
|
|
84
|
+
// providers.mjs之OC_READONLY({edit:'deny', bash:'ask'})為v1形狀, 在v2不會被認得——唯讀鎖等同失效,
|
|
85
|
+
// 升v2前須以金絲雀(要求寫檔, 驗未落地)重驗防寫, 不可假設仍有效。
|
|
86
|
+
// 故本機若升v2, 請先以單一呼叫實測上述四項再調整本檔; 條目端可先以exe指定v1執行檔路徑過渡。
|
|
87
|
+
//
|
|
88
|
+
// 【cwd須同步PWD環境變數(2026-09-23實測後新增)】opencode run決定session目錄之原始碼為
|
|
89
|
+
// `const root = Filesystem.resolve(process.env.PWD ?? process.cwd())`(packages/opencode/src/cli/cmd/run.ts),
|
|
90
|
+
// 即「繼承來的PWD優先於子進程真實cwd」。Git Bash與Linux/macOS之shell皆會設PWD, 故呼叫端給opt.cwd而
|
|
91
|
+
// 父進程PWD指向他處時, opencode會在父進程目錄作業: 讀相對路徑落空(回NOTFOUND且ok:true, 靜默失敗),
|
|
92
|
+
// 允許寫檔時檔案落在父進程目錄(本專案曾因此於根目錄留下金絲雀孤兒檔, 當時誤判為「以git根目錄為準」)。
|
|
93
|
+
// 實測(cwd指向探針目錄, 父PWD=專案根): 不處理→working directory為專案根、讀MARKER.txt失敗;
|
|
94
|
+
// 注入PWD=cwd→正確; 帶--dir亦正確。採注入PWD: 不動命令列(與--attach等extraArgs無衝突), 語意即shell
|
|
95
|
+
// 於該目錄啟動程式時之環境; 且以本函數之值蓋過opt.env之PWD(呼叫端常整份展開process.env, 若讓其覆寫
|
|
96
|
+
// 則缺陷靜默回歸)。claude與codex以同組探針實測皆遵循spawn cwd, 不受影響, 故只在本轉接器處理。
|
|
82
97
|
//
|
|
83
98
|
// 【Zen免費層閘門與config注入(2026-09-18實測)】opencode自2026-09-17起限制免費模型只准在opencode本體內使用
|
|
84
99
|
// (403 FreeTierError: free tier can only be used from within OpenCode)。CLI本身可通, 但經OPENCODE_CONFIG_CONTENT
|
|
@@ -86,6 +101,14 @@ import dfTimeoutMs from './dfTimeoutMs.mjs'
|
|
|
86
101
|
// 少了bash即被判非opencode而403; 改permission.bash:'ask'則通過, 且非互動run下ask自動拒絕, 仍為機械防寫。
|
|
87
102
|
// 詳見providers.mjs檔頭【Zen免費層閘門】與OC_READONLY常數。
|
|
88
103
|
//
|
|
104
|
+
// 【Zen免費層429限流時run不會結束(2026-09-23實測, 1.18.32)】REST探測0.7s即回429 FreeUsageLimitError
|
|
105
|
+
// (Rate limit exceeded), 但`opencode run`收到同一錯誤後不退出: 預設stderr只有session標頭, 直到呼叫端逾時;
|
|
106
|
+
// 帶--print-logs --log-level DEBUG可見`stream error ... AI_APICallError: Rate limit exceeded`, 其後再無輸出。
|
|
107
|
+
// 不經本套件直接跑原始CLI亦同, 非本轉接器所致。對本套件之意義: 此情形以TIMEOUT回報(errorType 'timeout'),
|
|
108
|
+
// dispatchAiFallback內建之TIMEOUT冷卻觸發可涵蓋, 但每次嘗試都耗滿timeoutMs——免費oc:條目宜以
|
|
109
|
+
// resolveProviders之patch給較短timeoutMs; 需在stderr看到字樣(供coolDetect)時於extraArgs加
|
|
110
|
+
// --print-logs --log-level ERROR。
|
|
111
|
+
//
|
|
89
112
|
// 【不讀auth.json之匿名呼叫: useStoredAuth:false(2026-09-17實測後新增)】
|
|
90
113
|
// 未注入金鑰時opencode會自動沿用auth.json之登入; 該帳號工作區若未開某免費模型(如union-alpha),
|
|
91
114
|
// 就回`Error: Model is disabled`, 而同一模型在「無auth.json」之機器上匿名可用——結果隨執行機器而異。
|
|
@@ -142,7 +165,7 @@ let OWN_KEYS = ['exe', 'model', 'key', 'provider', 'useStoredAuth', 'agent', 'co
|
|
|
142
165
|
* @param {Array} [opt.extraArgs=[]] 輸入額外命令列旗標字串陣列,將接於固定旗標之後,預設[]
|
|
143
166
|
* @param {Object} [opt.env=undefined] 輸入本次調用額外注入之環境變數物件,同時給予key與provider時會再併入OPENCODE_AUTH_CONTENT,預設undefined
|
|
144
167
|
* @param {Number} [opt.timeoutMs=300000] 輸入逾時毫秒正整數,逾時將強制關閉子進程及其子孫程序,全套件統一預設300000
|
|
145
|
-
* @param {String} [opt.cwd=process.cwd()] 輸入子進程工作目錄字串,預設process.cwd()
|
|
168
|
+
* @param {String} [opt.cwd=process.cwd()] 輸入子進程工作目錄字串,預設process.cwd();其絕對路徑並同步注入環境變數PWD(opencode以繼承之PWD優先於真實cwd決定session目錄,見檔頭),呼叫端env內之PWD會被覆寫
|
|
146
169
|
* @param {String|Function} [opt.validate=undefined] 輸入stdout驗證規則字串或自訂驗證函數,規則字串支援'nonempty'、'json'、'min:100',多規則可用逗號串接,預設undefined代表不驗證
|
|
147
170
|
* @param {Number} [opt.maxRetries=0] 輸入失敗後最大重試次數非負整數,預設0
|
|
148
171
|
* @returns {Promise} 回傳Promise,resolve回傳結果物件,內含ok(是否成功布林值)、stdout(標準輸出字串)、stderr(標準錯誤字串)、code(離開碼)、error(錯誤訊息字串,成功時為空字串)、durationMs(耗時毫秒)、attempts(實際嘗試次數),本函數不會reject
|
|
@@ -261,6 +284,15 @@ async function dispatchOpencode(prompt, opt = {}) {
|
|
|
261
284
|
}
|
|
262
285
|
}
|
|
263
286
|
|
|
287
|
+
//PWD同步為有效cwd之絕對路徑(有給cwd則解析之, 否則process.cwd(), 與execCli之spawn cwd同源),
|
|
288
|
+
//以本值蓋過呼叫端env之PWD——opencode以繼承之PWD優先於真實cwd決定session目錄(見檔頭【cwd須同步PWD】)
|
|
289
|
+
let cwdEff = get(opt, 'cwd', null)
|
|
290
|
+
cwdEff = isestr(cwdEff) ? path.resolve(cwdEff) : process.cwd()
|
|
291
|
+
env = {
|
|
292
|
+
...env,
|
|
293
|
+
PWD: cwdEff,
|
|
294
|
+
}
|
|
295
|
+
|
|
264
296
|
//timeoutMs, 無效回退全套件統一預設(dfTimeoutMs=300000), 各轉接器一致令呼叫方無須記多套數字
|
|
265
297
|
let timeoutMs = castPintOr(get(opt, 'timeoutMs', null), dfTimeoutMs)
|
|
266
298
|
|
|
@@ -293,7 +325,7 @@ export default dispatchOpencode
|
|
|
293
325
|
<br class="clear">
|
|
294
326
|
|
|
295
327
|
<footer>
|
|
296
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
328
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
297
329
|
</footer>
|
|
298
330
|
|
|
299
331
|
<script>prettyPrint();</script>
|
package/docs/getCliArgs.mjs.html
CHANGED
|
@@ -113,7 +113,7 @@ export default getCliArgs
|
|
|
113
113
|
<br class="clear">
|
|
114
114
|
|
|
115
115
|
<footer>
|
|
116
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
116
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
117
117
|
</footer>
|
|
118
118
|
|
|
119
119
|
<script>prettyPrint();</script>
|
|
@@ -109,7 +109,7 @@ export default getErrorResult
|
|
|
109
109
|
<br class="clear">
|
|
110
110
|
|
|
111
111
|
<footer>
|
|
112
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
112
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
113
113
|
</footer>
|
|
114
114
|
|
|
115
115
|
<script>prettyPrint();</script>
|
|
@@ -161,7 +161,7 @@ export { attachErrorType }
|
|
|
161
161
|
<br class="clear">
|
|
162
162
|
|
|
163
163
|
<footer>
|
|
164
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
164
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
165
165
|
</footer>
|
|
166
166
|
|
|
167
167
|
<script>prettyPrint();</script>
|
package/docs/global.html
CHANGED
|
@@ -143,7 +143,7 @@ callAiWithFallback預設自動掛上(傳promptPrefix:''關閉),
|
|
|
143
143
|
|
|
144
144
|
<dt class="tag-source">Source:</dt>
|
|
145
145
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
146
|
-
<a href="wkf_noSideEffectPrefix.mjs.html">wkf/noSideEffectPrefix.mjs</a>, <a href="wkf_noSideEffectPrefix.mjs.html#
|
|
146
|
+
<a href="wkf_noSideEffectPrefix.mjs.html">wkf/noSideEffectPrefix.mjs</a>, <a href="wkf_noSideEffectPrefix.mjs.html#line41">line 41</a>
|
|
147
147
|
</li></ul></dd>
|
|
148
148
|
|
|
149
149
|
|
|
@@ -9138,7 +9138,7 @@ prompt一律走stdin而非位置參數,因摘要內文可達數萬字,當命
|
|
|
9138
9138
|
|
|
9139
9139
|
<dt class="tag-source">Source:</dt>
|
|
9140
9140
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
9141
|
-
<a href="dispatchClaude.mjs.html">dispatchClaude.mjs</a>, <a href="dispatchClaude.mjs.html#
|
|
9141
|
+
<a href="dispatchClaude.mjs.html">dispatchClaude.mjs</a>, <a href="dispatchClaude.mjs.html#line87">line 87</a>
|
|
9142
9142
|
</li></ul></dd>
|
|
9143
9143
|
|
|
9144
9144
|
|
|
@@ -9266,7 +9266,7 @@ await test()
|
|
|
9266
9266
|
</td>
|
|
9267
9267
|
|
|
9268
9268
|
|
|
9269
|
-
<td class="description last"><p>輸入提示詞字串,一律以stdin
|
|
9269
|
+
<td class="description last"><p>輸入提示詞字串,一律以stdin傳入子進程(Claude Code之stdin上限10MB,超過即非零離開)</p></td>
|
|
9270
9270
|
</tr>
|
|
9271
9271
|
|
|
9272
9272
|
|
|
@@ -9409,7 +9409,7 @@ await test()
|
|
|
9409
9409
|
</td>
|
|
9410
9410
|
|
|
9411
9411
|
|
|
9412
|
-
<td class="description last"><p>輸入模型別名或模型ID字串,例如'
|
|
9412
|
+
<td class="description last"><p>輸入模型別名或模型ID字串,例如'claude-opus-5-5'(全名, 固定版本)、'opus'或'sonnet'(別名, 隨CLI指向最新版),預設''代表不帶<code>--model</code>旗標,由CLI依方案決定(2.1.280起Pro/Team Standard亦預設Opus)</p></td>
|
|
9413
9413
|
</tr>
|
|
9414
9414
|
|
|
9415
9415
|
|
|
@@ -10003,7 +10003,7 @@ await test()
|
|
|
10003
10003
|
</td>
|
|
10004
10004
|
|
|
10005
10005
|
|
|
10006
|
-
<td class="description last"><p>輸入模型ID字串,例如'gpt-5.6-luna',預設''代表不帶<code>-m</code>旗標</p></td>
|
|
10006
|
+
<td class="description last"><p>輸入模型ID字串,例如'gpt-5.6-luna'、'gpt-6-sol',預設''代表不帶<code>-m</code>旗標</p></td>
|
|
10007
10007
|
</tr>
|
|
10008
10008
|
|
|
10009
10009
|
|
|
@@ -10328,7 +10328,7 @@ prompt一律走stdin而非位置參數,因摘要內文可達數萬字,當命
|
|
|
10328
10328
|
|
|
10329
10329
|
<dt class="tag-source">Source:</dt>
|
|
10330
10330
|
<dd class="tag-source"><ul class="dummy"><li>
|
|
10331
|
-
<a href="dispatchOpencode.mjs.html">dispatchOpencode.mjs</a>, <a href="dispatchOpencode.mjs.html#
|
|
10331
|
+
<a href="dispatchOpencode.mjs.html">dispatchOpencode.mjs</a>, <a href="dispatchOpencode.mjs.html#line171">line 171</a>
|
|
10332
10332
|
</li></ul></dd>
|
|
10333
10333
|
|
|
10334
10334
|
|
|
@@ -10984,7 +10984,7 @@ await test()
|
|
|
10984
10984
|
</td>
|
|
10985
10985
|
|
|
10986
10986
|
|
|
10987
|
-
<td class="description last"><p>輸入子進程工作目錄字串,預設process.cwd()
|
|
10987
|
+
<td class="description last"><p>輸入子進程工作目錄字串,預設process.cwd();其絕對路徑並同步注入環境變數PWD(opencode以繼承之PWD優先於真實cwd決定session目錄,見檔頭),呼叫端env內之PWD會被覆寫</p></td>
|
|
10988
10988
|
</tr>
|
|
10989
10989
|
|
|
10990
10990
|
|
|
@@ -17167,7 +17167,7 @@ providers與table同源產出故必然一致;
|
|
|
17167
17167
|
|
|
17168
17168
|
<h5 class="h5-examples">Example</h5>
|
|
17169
17169
|
|
|
17170
|
-
<pre class="prettyprint"><code>import resolveProviders from './src/resolveProviders.mjs'
|
|
17171
17170
|
env,
|
|
17172
17171
|
pick: ['agnes:agnes-3.0-flash', 'claude:sonnet'],
|
|
17173
17172
|
exes: { claude: 'C:/Users/x/.local/bin/claude.exe' },
|
|
17174
17173
|
patch: { 'claude:sonnet': { timeoutMs: 360000 } },
|
|
17174
|
+
<pre class="prettyprint"><code>import resolveProviders from './src/resolveProviders.mjs'
|
|
17175
17175
|
env,
|
|
17176
17176
|
pick: ['agnes:agnes-3.0-flash', 'claude:sonnet'],
|
|
17177
17177
|
exes: { claude: 'C:/Users/x/.local/bin/claude.exe' },
|
|
17178
17178
|
patch: { 'claude:sonnet': { timeoutMs: 360000 } },
|
|
17179
17179
|
|
|
17180
17180
|
|
|
17181
17181
|
|
|
@@ -21417,7 +21417,7 @@ console.log(w.label, w.remainingPercent)
|
|
|
21417
21417
|
<br class="clear">
|
|
21418
21418
|
|
|
21419
21419
|
<footer>
|
|
21420
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
21420
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
21421
21421
|
</footer>
|
|
21422
21422
|
|
|
21423
21423
|
<script>prettyPrint();</script>
|
package/docs/index.html
CHANGED
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<br class="clear">
|
|
72
72
|
|
|
73
73
|
<footer>
|
|
74
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
75
75
|
</footer>
|
|
76
76
|
|
|
77
77
|
<script>prettyPrint();</script>
|
|
@@ -86,7 +86,7 @@ export default dfQuotaTimeoutMs
|
|
|
86
86
|
<br class="clear">
|
|
87
87
|
|
|
88
88
|
<footer>
|
|
89
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
89
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
90
90
|
</footer>
|
|
91
91
|
|
|
92
92
|
<script>prettyPrint();</script>
|
|
@@ -335,7 +335,7 @@ export default fetchQuotaJson
|
|
|
335
335
|
<br class="clear">
|
|
336
336
|
|
|
337
337
|
<footer>
|
|
338
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
338
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
339
339
|
</footer>
|
|
340
340
|
|
|
341
341
|
<script>prettyPrint();</script>
|
|
@@ -322,7 +322,7 @@ export default fromCodexUsageHttp
|
|
|
322
322
|
<br class="clear">
|
|
323
323
|
|
|
324
324
|
<footer>
|
|
325
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
325
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
326
326
|
</footer>
|
|
327
327
|
|
|
328
328
|
<script>prettyPrint();</script>
|
|
@@ -450,7 +450,7 @@ export default getQuotaAntigravity
|
|
|
450
450
|
<br class="clear">
|
|
451
451
|
|
|
452
452
|
<footer>
|
|
453
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
453
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
454
454
|
</footer>
|
|
455
455
|
|
|
456
456
|
<script>prettyPrint();</script>
|
|
@@ -444,7 +444,7 @@ export default getQuotaClaude
|
|
|
444
444
|
<br class="clear">
|
|
445
445
|
|
|
446
446
|
<footer>
|
|
447
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
447
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
448
448
|
</footer>
|
|
449
449
|
|
|
450
450
|
<script>prettyPrint();</script>
|
|
@@ -502,7 +502,7 @@ export default getQuotaCodex
|
|
|
502
502
|
<br class="clear">
|
|
503
503
|
|
|
504
504
|
<footer>
|
|
505
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
505
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
506
506
|
</footer>
|
|
507
507
|
|
|
508
508
|
<script>prettyPrint();</script>
|
|
@@ -100,7 +100,7 @@ export default readJsonOrNull
|
|
|
100
100
|
<br class="clear">
|
|
101
101
|
|
|
102
102
|
<footer>
|
|
103
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
103
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
104
104
|
</footer>
|
|
105
105
|
|
|
106
106
|
<script>prettyPrint();</script>
|
|
@@ -133,7 +133,7 @@ export default toQuotaLabel
|
|
|
133
133
|
<br class="clear">
|
|
134
134
|
|
|
135
135
|
<footer>
|
|
136
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
136
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
137
137
|
</footer>
|
|
138
138
|
|
|
139
139
|
<script>prettyPrint();</script>
|
|
@@ -201,7 +201,7 @@ export default toQuotaResult
|
|
|
201
201
|
<br class="clear">
|
|
202
202
|
|
|
203
203
|
<footer>
|
|
204
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
204
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
205
205
|
</footer>
|
|
206
206
|
|
|
207
207
|
<script>prettyPrint();</script>
|
|
@@ -104,7 +104,7 @@ export default toQuotaScopedLabel
|
|
|
104
104
|
<br class="clear">
|
|
105
105
|
|
|
106
106
|
<footer>
|
|
107
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
107
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
108
108
|
</footer>
|
|
109
109
|
|
|
110
110
|
<script>prettyPrint();</script>
|
|
@@ -226,7 +226,7 @@ export default toQuotaWindow
|
|
|
226
226
|
<br class="clear">
|
|
227
227
|
|
|
228
228
|
<footer>
|
|
229
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
229
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
230
230
|
</footer>
|
|
231
231
|
|
|
232
232
|
<script>prettyPrint();</script>
|
|
@@ -119,7 +119,7 @@ export default readEnvFile
|
|
|
119
119
|
<br class="clear">
|
|
120
120
|
|
|
121
121
|
<footer>
|
|
122
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
122
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
123
123
|
</footer>
|
|
124
124
|
|
|
125
125
|
<script>prettyPrint();</script>
|
|
@@ -104,7 +104,7 @@ import strFindSimilar from 'wsemi/src/strFindSimilar.mjs'
|
|
|
104
104
|
* //全取: envVar展開為keys, 缺環境變數者列入skipped
|
|
105
105
|
* let { providers, table, skipped } = resolveProviders(providersAll, { env })
|
|
106
106
|
* console.log(providers.length, skipped)
|
|
107
|
-
* // =>
|
|
107
|
+
* // => 15 []
|
|
108
108
|
*
|
|
109
109
|
* //pick打錯字時, missing附拼寫提示hints(最接近之可用id)
|
|
110
110
|
* let rm = resolveProviders(providersAll, { env, pick: ['poolside/laguna-s-2.1'] })
|
|
@@ -240,7 +240,7 @@ export default resolveProviders
|
|
|
240
240
|
<br class="clear">
|
|
241
241
|
|
|
242
242
|
<footer>
|
|
243
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
243
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
244
244
|
</footer>
|
|
245
245
|
|
|
246
246
|
<script>prettyPrint();</script>
|
|
@@ -70,7 +70,7 @@ import NO_SIDE_EFFECT from './noSideEffectPrefix.mjs'
|
|
|
70
70
|
// 與金鑰無關之失敗而「整組跳過換下一家」(不換組內金鑰——同模型換金鑰仍是
|
|
71
71
|
// 同樣的產出習慣); 端點不穩而偶發空回的模型, 以maxRetries調高令同鍵重試。
|
|
72
72
|
//
|
|
73
|
-
// 【防寫檔前綴】agentic CLI
|
|
73
|
+
// 【防寫檔前綴】agentic CLI之cwd不是隔離邊界(可用絕對路徑寫到cwd外),
|
|
74
74
|
// 故預設在prompt前掛「禁止建檔」約束(實測有效); 不需要時傳promptPrefix:''關閉。
|
|
75
75
|
// 措辭已移至獨立模組wkf/noSideEffectPrefix.mjs(單一來源)——不經本層、
|
|
76
76
|
// 直接呼叫dispatchAiFallback的呼叫端亦應引用同一份, 措辭修正時全體同步;
|
|
@@ -274,7 +274,7 @@ export { buildChain, NO_SIDE_EFFECT }
|
|
|
274
274
|
<br class="clear">
|
|
275
275
|
|
|
276
276
|
<footer>
|
|
277
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on
|
|
277
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Wed Sep 23 2026 18:02:52 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
278
278
|
</footer>
|
|
279
279
|
|
|
280
280
|
<script>prettyPrint();</script>
|