w-dispatch-ai 1.0.26 → 1.0.27
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 +1 -0
- 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 +1 -1
- package/docs/dispatchCodex.mjs.html +1 -1
- package/docs/dispatchOpencode.mjs.html +26 -4
- 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 +43 -3
- 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 +1 -1
- package/docs/wkf_callAiWithFallback.mjs.html +1 -1
- 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 +1 -1
- 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/dispatchOpencode.mjs +25 -3
- package/src/providers.mjs +6 -3
- package/test/unit-dispatchOpencode.test.mjs +25 -0
- package/test/unit-providers.test.mjs +7 -0
|
@@ -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 Thu Sep 17 2026
|
|
135
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
137
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
114
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
156
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
99
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
88
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
124
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
125
125
|
</footer>
|
|
126
126
|
|
|
127
127
|
<script>prettyPrint();</script>
|
|
@@ -556,7 +556,7 @@ export default dispatchAiFallback
|
|
|
556
556
|
<br class="clear">
|
|
557
557
|
|
|
558
558
|
<footer>
|
|
559
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
559
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
560
560
|
</footer>
|
|
561
561
|
|
|
562
562
|
<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 Thu Sep 17 2026
|
|
196
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
261
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
262
262
|
</footer>
|
|
263
263
|
|
|
264
264
|
<script>prettyPrint();</script>
|
|
@@ -426,7 +426,7 @@ export default dispatchApiOpenaiCompat
|
|
|
426
426
|
<br class="clear">
|
|
427
427
|
|
|
428
428
|
<footer>
|
|
429
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
429
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
430
430
|
</footer>
|
|
431
431
|
|
|
432
432
|
<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 Thu Sep 17 2026
|
|
488
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
437
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
438
438
|
</footer>
|
|
439
439
|
|
|
440
440
|
<script>prettyPrint();</script>
|
|
@@ -185,7 +185,7 @@ export default dispatchClaude
|
|
|
185
185
|
<br class="clear">
|
|
186
186
|
|
|
187
187
|
<footer>
|
|
188
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
188
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
189
189
|
</footer>
|
|
190
190
|
|
|
191
191
|
<script>prettyPrint();</script>
|
|
@@ -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 Thu Sep 17 2026
|
|
199
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
200
200
|
</footer>
|
|
201
201
|
|
|
202
202
|
<script>prettyPrint();</script>
|
|
@@ -65,6 +65,19 @@ import dfTimeoutMs from './dfTimeoutMs.mjs'
|
|
|
65
65
|
// 帶入真實key → 正常回應。以env傳入「不會改寫」auth.json(實測md5前後一致),
|
|
66
66
|
// 屬process層級,可與同時執行的其他專案並行而互不干擾。
|
|
67
67
|
// 註:OPENCODE_API_KEY在auth.json已有憑證時不生效,故一律走OPENCODE_AUTH_CONTENT。
|
|
68
|
+
// 原始碼依據(anomalyco/opencode dev, packages/opencode/src/auth/index.ts之Auth.all):
|
|
69
|
+
// `if (process.env.OPENCODE_AUTH_CONTENT) return JSON.parse(...)`, 解析成功即整份取代, 不與auth.json合併;
|
|
70
|
+
// 空字串為falsy、非法JSON會落回讀auth.json。auth.json位於<XDG_DATA_HOME|~/.local/share>/opencode/。
|
|
71
|
+
//
|
|
72
|
+
// 【不讀auth.json之匿名呼叫: useStoredAuth:false(2026-09-17實測後新增)】
|
|
73
|
+
// 未注入金鑰時opencode會自動沿用auth.json之登入; 該帳號工作區若未開某免費模型(如union-alpha),
|
|
74
|
+
// 就回`Error: Model is disabled`, 而同一模型在「無auth.json」之機器上匿名可用——結果隨執行機器而異。
|
|
75
|
+
// useStoredAuth:false時注入OPENCODE_AUTH_CONTENT='{}'(空憑證), 令本次不讀auth.json而以匿名免費存取。
|
|
76
|
+
// 實測(以XDG_DATA_HOME指向內含opencode金鑰之暫存auth.json): 不帶key→Model is disabled;
|
|
77
|
+
// 加'{}'→7.0s成功; 改注入''→仍Model is disabled(空字串無效, 故不可讓呼叫端自填); auth.json前後md5一致。
|
|
78
|
+
// 同時給key與provider時金鑰注入本就整份取代auth.json, 此旗標不再作用。
|
|
79
|
+
// 風險備忘: 原始碼Auth.set會以Auth.all()(即注入內容)為底寫回auth.json, 僅於OAuth權杖刷新等寫入時發生;
|
|
80
|
+
// api型金鑰與空憑證皆無刷新, 實測未觸發。
|
|
68
81
|
//
|
|
69
82
|
// 【provider與model必須配對】不同provider的金鑰不可互換:
|
|
70
83
|
// 實測把agnes-ai的金鑰用於opencode/...模型 → `Invalid API key`。
|
|
@@ -85,7 +98,7 @@ let DEFAULT_AGENT = 'build'
|
|
|
85
98
|
|
|
86
99
|
|
|
87
100
|
//本轉接器自用之設定鍵, 其餘鍵一律原樣轉傳execCli
|
|
88
|
-
let OWN_KEYS = ['exe', 'model', 'key', 'provider', 'agent', 'config', 'extraArgs', 'input', 'env']
|
|
101
|
+
let OWN_KEYS = ['exe', 'model', 'key', 'provider', 'useStoredAuth', 'agent', 'config', 'extraArgs', 'input', 'env']
|
|
89
102
|
|
|
90
103
|
|
|
91
104
|
/**
|
|
@@ -96,7 +109,7 @@ let OWN_KEYS = ['exe', 'model', 'key', 'provider', 'agent', 'config', 'extraArgs
|
|
|
96
109
|
* 而opencode run未帶位置message時即從stdin讀取;
|
|
97
110
|
* 同時給予key與provider時,以OPENCODE_AUTH_CONTENT環境變數逐次注入金鑰,
|
|
98
111
|
* 該注入僅作用於當次子進程且不改寫auth.json,故可多把金鑰輪替並與其他程序並行;
|
|
99
|
-
* 未給key或provider時沿用CLI
|
|
112
|
+
* 未給key或provider時沿用CLI既有登入狀態(auth.json),useStoredAuth為false則改以匿名存取;
|
|
100
113
|
* 使用opencode未內建之第三方provider時,須另以config給予其provider定義;
|
|
101
114
|
* 本函數不會reject,一律以結果物件之ok與error欄位回報成敗
|
|
102
115
|
*
|
|
@@ -106,6 +119,7 @@ let OWN_KEYS = ['exe', 'model', 'key', 'provider', 'agent', 'config', 'extraArgs
|
|
|
106
119
|
* @param {String} [opt.model=''] 輸入模型ID字串,例如'opencode/deepseek-v4-flash-free',預設''代表不帶`-m`旗標
|
|
107
120
|
* @param {String} [opt.key=''] 輸入該provider之API key字串,須與provider同時給予才會注入,預設''代表沿用CLI既有登入狀態
|
|
108
121
|
* @param {String} [opt.provider=''] 輸入key所屬provider名稱字串,須與key同時給予才會注入,且須與model為同一組,預設''
|
|
122
|
+
* @param {Boolean} [opt.useStoredAuth=true] 輸入未注入金鑰時是否沿用本機auth.json之登入布林值,false代表注入空憑證令本次以匿名存取(適用opencode之免費模型,避免結果隨本機登入帳號而異);已同時給key與provider時不作用,預設true
|
|
109
123
|
* @param {Object|String} [opt.config=null] 輸入opencode設定內容物件或其JSON字串,將以OPENCODE_CONFIG_CONTENT逐次注入,供補上第三方provider之定義,預設null代表沿用使用者既有設定檔
|
|
110
124
|
* @param {String} [opt.agent='build'] 輸入opencode代理名稱字串,預設'build'
|
|
111
125
|
* @param {Array} [opt.extraArgs=[]] 輸入額外命令列旗標字串陣列,將接於固定旗標之後,預設[]
|
|
@@ -213,15 +227,23 @@ async function dispatchOpencode(prompt, opt = {}) {
|
|
|
213
227
|
}
|
|
214
228
|
}
|
|
215
229
|
|
|
216
|
-
//key與provider皆有效才注入, 否則沿用auth.json既有登入狀態(單金鑰時即為原有行為)
|
|
230
|
+
//key與provider皆有效才注入, 否則沿用auth.json既有登入狀態(單金鑰時即為原有行為);
|
|
231
|
+
//useStoredAuth為false且未注入金鑰時, 注入'{}'令opencode本次不讀auth.json(匿名, 見檔頭)
|
|
217
232
|
let key = get(opt, 'key', null)
|
|
218
233
|
let provider = get(opt, 'provider', null)
|
|
234
|
+
let useStoredAuth = get(opt, 'useStoredAuth', null) !== false
|
|
219
235
|
if (isestr(key) && isestr(provider)) {
|
|
220
236
|
env = {
|
|
221
237
|
...env,
|
|
222
238
|
OPENCODE_AUTH_CONTENT: JSON.stringify({ [provider]: { type: 'api', key } }),
|
|
223
239
|
}
|
|
224
240
|
}
|
|
241
|
+
else if (!useStoredAuth) {
|
|
242
|
+
env = {
|
|
243
|
+
...env,
|
|
244
|
+
OPENCODE_AUTH_CONTENT: '{}',
|
|
245
|
+
}
|
|
246
|
+
}
|
|
225
247
|
|
|
226
248
|
//timeoutMs, 無效回退全套件統一預設(dfTimeoutMs=300000), 各轉接器一致令呼叫方無須記多套數字
|
|
227
249
|
let timeoutMs = castPintOr(get(opt, 'timeoutMs', null), dfTimeoutMs)
|
|
@@ -255,7 +277,7 @@ export default dispatchOpencode
|
|
|
255
277
|
<br class="clear">
|
|
256
278
|
|
|
257
279
|
<footer>
|
|
258
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
280
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
259
281
|
</footer>
|
|
260
282
|
|
|
261
283
|
<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 Thu Sep 17 2026
|
|
116
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
112
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
164
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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
|
@@ -10320,7 +10320,7 @@ prompt一律走stdin而非位置參數,因摘要內文可達數萬字,當命
|
|
|
10320
10320
|
而opencode run未帶位置message時即從stdin讀取;
|
|
10321
10321
|
同時給予key與provider時,以OPENCODE_AUTH_CONTENT環境變數逐次注入金鑰,
|
|
10322
10322
|
該注入僅作用於當次子進程且不改寫auth.json,故可多把金鑰輪替並與其他程序並行;
|
|
10323
|
-
未給key或provider時沿用CLI
|
|
10323
|
+
未給key或provider時沿用CLI既有登入狀態(auth.json),useStoredAuth為false則改以匿名存取;
|
|
10324
10324
|
使用opencode未內建之第三方provider時,須另以config給予其provider定義;
|
|
10325
10325
|
本函數不會reject,一律以結果物件之ok與error欄位回報成敗</p></li></ul></dd>
|
|
10326
10326
|
|
|
@@ -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#line132">line 132</a>
|
|
10332
10332
|
</li></ul></dd>
|
|
10333
10333
|
|
|
10334
10334
|
|
|
@@ -10709,6 +10709,46 @@ await test()
|
|
|
10709
10709
|
|
|
10710
10710
|
|
|
10711
10711
|
|
|
10712
|
+
<tr>
|
|
10713
|
+
|
|
10714
|
+
<td class="name"><code>useStoredAuth</code></td>
|
|
10715
|
+
|
|
10716
|
+
|
|
10717
|
+
<td class="type">
|
|
10718
|
+
|
|
10719
|
+
|
|
10720
|
+
<span class="param-type">Boolean</span>
|
|
10721
|
+
|
|
10722
|
+
|
|
10723
|
+
|
|
10724
|
+
|
|
10725
|
+
</td>
|
|
10726
|
+
|
|
10727
|
+
|
|
10728
|
+
<td class="attributes">
|
|
10729
|
+
|
|
10730
|
+
<optional><br>
|
|
10731
|
+
|
|
10732
|
+
|
|
10733
|
+
|
|
10734
|
+
|
|
10735
|
+
|
|
10736
|
+
</td>
|
|
10737
|
+
|
|
10738
|
+
|
|
10739
|
+
|
|
10740
|
+
<td class="default">
|
|
10741
|
+
|
|
10742
|
+
<code>true</code>
|
|
10743
|
+
|
|
10744
|
+
</td>
|
|
10745
|
+
|
|
10746
|
+
|
|
10747
|
+
<td class="description last"><p>輸入未注入金鑰時是否沿用本機auth.json之登入布林值,false代表注入空憑證令本次以匿名存取(適用opencode之免費模型,避免結果隨本機登入帳號而異);已同時給key與provider時不作用,預設true</p></td>
|
|
10748
|
+
</tr>
|
|
10749
|
+
|
|
10750
|
+
|
|
10751
|
+
|
|
10712
10752
|
<tr>
|
|
10713
10753
|
|
|
10714
10754
|
<td class="name"><code>config</code></td>
|
|
@@ -21378,7 +21418,7 @@ console.log(w.label, w.remainingPercent)
|
|
|
21378
21418
|
<br class="clear">
|
|
21379
21419
|
|
|
21380
21420
|
<footer>
|
|
21381
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
21421
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
21382
21422
|
</footer>
|
|
21383
21423
|
|
|
21384
21424
|
<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 Thu Sep 17 2026
|
|
74
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
89
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
338
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
325
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
453
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
447
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
505
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
103
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
136
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
204
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
107
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
229
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 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 Thu Sep 17 2026
|
|
122
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
123
123
|
</footer>
|
|
124
124
|
|
|
125
125
|
<script>prettyPrint();</script>
|
|
@@ -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 Thu Sep 17 2026
|
|
243
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
244
244
|
</footer>
|
|
245
245
|
|
|
246
246
|
<script>prettyPrint();</script>
|
|
@@ -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 Thu Sep 17 2026
|
|
277
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
278
278
|
</footer>
|
|
279
279
|
|
|
280
280
|
<script>prettyPrint();</script>
|
|
@@ -162,7 +162,7 @@ export default createFileStore
|
|
|
162
162
|
<br class="clear">
|
|
163
163
|
|
|
164
164
|
<footer>
|
|
165
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
165
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
166
166
|
</footer>
|
|
167
167
|
|
|
168
168
|
<script>prettyPrint();</script>
|
|
@@ -200,7 +200,7 @@ export default createUsageCounter
|
|
|
200
200
|
<br class="clear">
|
|
201
201
|
|
|
202
202
|
<footer>
|
|
203
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
203
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
204
204
|
</footer>
|
|
205
205
|
|
|
206
206
|
<script>prettyPrint();</script>
|
|
@@ -167,7 +167,7 @@ export default extractJsonLoose
|
|
|
167
167
|
<br class="clear">
|
|
168
168
|
|
|
169
169
|
<footer>
|
|
170
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
170
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
171
171
|
</footer>
|
|
172
172
|
|
|
173
173
|
<script>prettyPrint();</script>
|
|
@@ -108,7 +108,7 @@ export default NO_SIDE_EFFECT
|
|
|
108
108
|
<br class="clear">
|
|
109
109
|
|
|
110
110
|
<footer>
|
|
111
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
111
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
112
112
|
</footer>
|
|
113
113
|
|
|
114
114
|
<script>prettyPrint();</script>
|
|
@@ -217,7 +217,7 @@ export { defaultIntegratePrompt }
|
|
|
217
217
|
<br class="clear">
|
|
218
218
|
|
|
219
219
|
<footer>
|
|
220
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
220
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
221
221
|
</footer>
|
|
222
222
|
|
|
223
223
|
<script>prettyPrint();</script>
|
|
@@ -161,7 +161,7 @@ export default runFanoutPipeline
|
|
|
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 Thu Sep 17 2026
|
|
164
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
165
165
|
</footer>
|
|
166
166
|
|
|
167
167
|
<script>prettyPrint();</script>
|
|
@@ -183,7 +183,7 @@ export default runRolePipeline
|
|
|
183
183
|
<br class="clear">
|
|
184
184
|
|
|
185
185
|
<footer>
|
|
186
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
186
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
187
187
|
</footer>
|
|
188
188
|
|
|
189
189
|
<script>prettyPrint();</script>
|
|
@@ -154,7 +154,7 @@ export default salvageTruncatedArray
|
|
|
154
154
|
<br class="clear">
|
|
155
155
|
|
|
156
156
|
<footer>
|
|
157
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026
|
|
157
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Thu Sep 17 2026 20:41:36 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
158
158
|
</footer>
|
|
159
159
|
|
|
160
160
|
<script>prettyPrint();</script>
|