opencode-next 1.0.2 → 1.0.3
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/config.js +7 -3
- package/lib/constants.js +1 -0
- package/lib/go/adapter.js +2 -2
- package/lib/index.js +1 -0
- package/package.json +1 -1
package/lib/config.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
GO_CREDENTIAL_ENV_VAR,
|
|
7
7
|
OPENCODE_INFERENCE_URL,
|
|
8
8
|
DEFAULT_STREAM_IDLE_MS,
|
|
9
|
+
GO_DEFAULT_FIRST_EVENT_MS,
|
|
9
10
|
DEFAULT_PROBE_INTERVAL_MS,
|
|
10
11
|
DEFAULT_CATALOG_POLL_MS,
|
|
11
12
|
DEFAULT_IMAGE_PIXEL_BUDGET,
|
|
@@ -148,13 +149,15 @@ export const Config = Schema.object({
|
|
|
148
149
|
providerId: Schema.string().default(GO_PROVIDER),
|
|
149
150
|
providerName: Schema.string().default(GO_PROVIDER_NAME),
|
|
150
151
|
credentialRef: Schema.string().default(GO_CREDENTIAL_ENV_VAR),
|
|
151
|
-
cachePath: Schema.string().default('')
|
|
152
|
+
cachePath: Schema.string().default(''),
|
|
153
|
+
firstEventTimeoutMs: Schema.number().min(1000).default(GO_DEFAULT_FIRST_EVENT_MS)
|
|
152
154
|
}).default({
|
|
153
155
|
enabled: true,
|
|
154
156
|
providerId: GO_PROVIDER,
|
|
155
157
|
providerName: GO_PROVIDER_NAME,
|
|
156
158
|
credentialRef: GO_CREDENTIAL_ENV_VAR,
|
|
157
|
-
cachePath: ''
|
|
159
|
+
cachePath: '',
|
|
160
|
+
firstEventTimeoutMs: GO_DEFAULT_FIRST_EVENT_MS
|
|
158
161
|
}).description('Independent OpenCode Go subscription provider (enabled by default; set enabled: false to disable). Resolves the Console Personal API Key via DSH credential service or environment variable; never stores raw API keys.')
|
|
159
162
|
});
|
|
160
163
|
|
|
@@ -194,7 +197,8 @@ export function resolveConfig(raw = {}) {
|
|
|
194
197
|
providerId: raw.goSubscription?.providerId || GO_PROVIDER,
|
|
195
198
|
providerName: raw.goSubscription?.providerName || GO_PROVIDER_NAME,
|
|
196
199
|
credentialRef: raw.goSubscription?.credentialRef || GO_CREDENTIAL_ENV_VAR,
|
|
197
|
-
cachePath: raw.goSubscription?.cachePath || ''
|
|
200
|
+
cachePath: raw.goSubscription?.cachePath || '',
|
|
201
|
+
firstEventTimeoutMs: Number(raw.goSubscription?.firstEventTimeoutMs) || GO_DEFAULT_FIRST_EVENT_MS
|
|
198
202
|
}
|
|
199
203
|
};
|
|
200
204
|
}
|
package/lib/constants.js
CHANGED
package/lib/go/adapter.js
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
-
DEFAULT_FIRST_EVENT_MS,
|
|
16
15
|
DEFAULT_IMAGE_MAX_BYTES,
|
|
17
16
|
DEFAULT_IMAGE_PIXEL_BUDGET,
|
|
18
17
|
DEFAULT_STREAM_IDLE_MS,
|
|
18
|
+
GO_DEFAULT_FIRST_EVENT_MS,
|
|
19
19
|
GO_PROVIDER,
|
|
20
20
|
GO_PROVIDER_NAME
|
|
21
21
|
} from '../constants.js';
|
|
@@ -414,7 +414,7 @@ export class OpenCodeGoAdapter {
|
|
|
414
414
|
#firstEventMs() {
|
|
415
415
|
const configured = Number(this.#config.firstEventTimeoutMs);
|
|
416
416
|
if (Number.isFinite(configured) && configured > 0) return configured;
|
|
417
|
-
return Math.
|
|
417
|
+
return Math.max(GO_DEFAULT_FIRST_EVENT_MS, this.#idleMs());
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
#pixelBudget() {
|
package/lib/index.js
CHANGED
|
@@ -128,6 +128,7 @@ export function apply(ctx, config) {
|
|
|
128
128
|
providerId: goProviderId,
|
|
129
129
|
providerName: goConfig.providerName || GO_PROVIDER_NAME,
|
|
130
130
|
streamIdleTimeoutMs: resolved.streamIdleTimeoutMs,
|
|
131
|
+
firstEventTimeoutMs: goConfig.firstEventTimeoutMs,
|
|
131
132
|
resolveAttachments,
|
|
132
133
|
imagePixelBudget: resolved.imagePixelBudget,
|
|
133
134
|
imageMaxBytes: resolved.imageMaxBytes
|