@dan-ai-studio/dshopencodego 0.1.73 → 0.1.75
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.en.md +9 -11
- package/README.md +8 -10
- package/lib/client.js +60 -0
- package/lib/index.js +285 -142
- package/lib/types/config.d.ts +21 -6
- package/lib/types/image-budget.d.ts +32 -0
- package/lib/types/index.d.ts +1 -1
- package/package.json +26 -26
package/lib/types/config.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { RetryPolicyConfig } from '@deepseek-ai/dsh-llm';
|
|
|
15
15
|
import z from '@deepseek-ai/schemastery';
|
|
16
16
|
import { DEFAULT_KEEP_ALIVE_TIMEOUT_MS, DEFAULT_KEEP_ALIVE_TIMEOUT_SECONDS, MAX_KEEP_ALIVE_TIMEOUT_MS, MAX_KEEP_ALIVE_TIMEOUT_SECONDS, TIMER_CEILING_MS } from './network/keep-alive.ts';
|
|
17
17
|
import { DEFAULT_REQUEST_LOG_MAX_ENTRIES, MAX_REQUEST_LOG_MAX_ENTRIES, MIN_REQUEST_LOG_MAX_ENTRIES } from './request-log/limits.ts';
|
|
18
|
+
import type { ImageBudgetPreset } from './image-budget.ts';
|
|
18
19
|
export { DEFAULT_KEEP_ALIVE_TIMEOUT_MS, DEFAULT_KEEP_ALIVE_TIMEOUT_SECONDS, MAX_KEEP_ALIVE_TIMEOUT_MS, MAX_KEEP_ALIVE_TIMEOUT_SECONDS, TIMER_CEILING_MS, };
|
|
19
20
|
export { DEFAULT_REQUEST_LOG_MAX_ENTRIES, MAX_REQUEST_LOG_MAX_ENTRIES, MIN_REQUEST_LOG_MAX_ENTRIES, };
|
|
20
21
|
/** Credential reference resolving the OpenCode Go API key. */
|
|
@@ -62,12 +63,12 @@ export interface OpencodeGoConfig {
|
|
|
62
63
|
* requests.
|
|
63
64
|
*/
|
|
64
65
|
keepAliveTimeoutMs: number;
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Which image-budget preset shapes request images. `dsh` is the default:
|
|
68
|
+
* an unwritten field reads exactly the host route's own budgets, the same
|
|
69
|
+
* numbers a profile that never configured images would get from DSH itself.
|
|
70
|
+
*/
|
|
71
|
+
imageBudgetPreset: ImageBudgetPreset;
|
|
71
72
|
/** Per-model capacity overrides; an absent field inherits the catalog value. */
|
|
72
73
|
modelLimits: OpencodeGoModelLimits;
|
|
73
74
|
/**
|
|
@@ -120,6 +121,20 @@ export type LiveConfig = {
|
|
|
120
121
|
};
|
|
121
122
|
/** Runtime schema for {@link OpencodeGoConfig}; every field stays live. */
|
|
122
123
|
export declare const Config: z<Partial<OpencodeGoConfig>, LiveConfig>;
|
|
124
|
+
/**
|
|
125
|
+
* Validate one request-time idle timeout the schema let through.
|
|
126
|
+
*
|
|
127
|
+
* The schema bounds the persisted profile, but a live reference hands back
|
|
128
|
+
* whatever it holds (and a programmatic mount hands back whatever it returns):
|
|
129
|
+
* `NaN` passes `z.number()`, and a non-positive or overflowing value would
|
|
130
|
+
* otherwise reach `idleWatchdog` mid-request — after the credential was read —
|
|
131
|
+
* as a bare `Error` from its own assertion. Failing here fails before any
|
|
132
|
+
* credential read or network wait, with the route's own message instead of
|
|
133
|
+
* the timer's. Mirrors the resolve-time guard `llm-pi-ai` applies to the same
|
|
134
|
+
* field (`llm-pi-ai/src/config.ts`, "must be a positive finite number").
|
|
135
|
+
* @param value - the configured idle timeout in milliseconds.
|
|
136
|
+
*/
|
|
137
|
+
export declare function assertStreamIdleTimeoutMs(value: unknown): asserts value is number;
|
|
123
138
|
/**
|
|
124
139
|
* Keep the Loader's references: reparsing them would detach live updates.
|
|
125
140
|
*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Image-budget presets: the three numbers every image-bearing request is
|
|
3
|
+
* shaped by — per-image pixels, per-image bytes, whole-request bytes.
|
|
4
|
+
*
|
|
5
|
+
* Two different sources name such numbers, and a third set is this
|
|
6
|
+
* plugin's own history, so the setting names the source rather than
|
|
7
|
+
* repeating the numbers. `dsh` is the default: without an explicit choice
|
|
8
|
+
* a profile reads exactly the host route's own budgets.
|
|
9
|
+
*
|
|
10
|
+
* - `dsh`: DSH's own route defaults (`llm-pi-ai` config).
|
|
11
|
+
* - `dshopencodego`: this plugin's historic, tighter budgets for slow links.
|
|
12
|
+
* - `pi-ai`: the per-model resize profile pi-ai ships in its catalog,
|
|
13
|
+
* uniform across providers. pi-ai publishes no generic request cap, so
|
|
14
|
+
* the request level reuses the common per-model value from its catalog —
|
|
15
|
+
* which coincides with DSH's request default.
|
|
16
|
+
*
|
|
17
|
+
* @module @dan-ai-studio/dshopencodego/image-budget
|
|
18
|
+
*/
|
|
19
|
+
/** The sources an image budget can be taken from, in UI order. */
|
|
20
|
+
export declare const IMAGE_BUDGET_PRESETS: readonly ['dsh', 'dshopencodego', 'pi-ai'];
|
|
21
|
+
/** One of the named image-budget sources. */
|
|
22
|
+
export type ImageBudgetPreset = (typeof IMAGE_BUDGET_PRESETS)[number];
|
|
23
|
+
/** The three image budgets: per-image pixels, per-image bytes, whole-request bytes. */
|
|
24
|
+
export interface ImageBudget {
|
|
25
|
+
readonly maxPixels: number;
|
|
26
|
+
readonly maxBytes: number;
|
|
27
|
+
readonly maxRequestBytes: number;
|
|
28
|
+
}
|
|
29
|
+
/** The effective budgets behind each preset name. */
|
|
30
|
+
export declare const IMAGE_BUDGETS: Record<ImageBudgetPreset, ImageBudget>;
|
|
31
|
+
/** Whether a settings value names a known preset; anything else falls back to `dsh`. */
|
|
32
|
+
export declare function isImageBudgetPreset(value: unknown): value is ImageBudgetPreset;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ declare module '@deepseek-ai/cordis' {
|
|
|
36
36
|
export { OpencodeGoAdapter } from './adapter.ts';
|
|
37
37
|
export type { OpencodeGoAdapterOptions, OpencodeGoImageAccess } from './adapter.ts';
|
|
38
38
|
export { DEFAULT_BASE_URL, CONSOLE_BASE_URL, DISPLAY_NAME, PROVIDER_ID, OpencodeGoCatalog, discoverCatalogModels, fetchModelIds } from './catalog/index.ts';
|
|
39
|
-
export { Config, PlainConfig, assertBaseURL, DEFAULT_API_KEY_ENV } from './config.ts';
|
|
39
|
+
export { Config, PlainConfig, assertBaseURL, assertStreamIdleTimeoutMs, DEFAULT_API_KEY_ENV } from './config.ts';
|
|
40
40
|
export type { OpencodeGoConfig } from './config.ts';
|
|
41
41
|
export { SESSION_HEADER, SESSION_AFFINITY_HEADER, opencodeSessionValue, providerHeaders } from './session-header.ts';
|
|
42
42
|
export { isModelEnabled, sortModels } from './models.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dan-ai-studio/dshopencodego",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.75",
|
|
4
4
|
"description": "OpenCode Go provider for DeepSeek Harness: live gateway catalog, per-conversation session header, usage",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -123,32 +123,32 @@
|
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
125
|
"@deepseek-ai/cordis": "4.0.5",
|
|
126
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.1-rc.
|
|
127
|
-
"@deepseek-ai/dsh-attachment": "0.2.1-rc.
|
|
128
|
-
"@deepseek-ai/dsh-brand": "0.2.1-rc.
|
|
129
|
-
"@deepseek-ai/dsh-client-locale": "0.2.1-rc.
|
|
130
|
-
"@deepseek-ai/dsh-client-store": "0.2.1-rc.
|
|
131
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.
|
|
132
|
-
"@deepseek-ai/dsh-client-ui-layout": "0.2.1-rc.
|
|
133
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.1-rc.
|
|
134
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.
|
|
135
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.
|
|
136
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.
|
|
137
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.1-rc.
|
|
138
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.
|
|
139
|
-
"@deepseek-ai/dsh-credentials": "0.2.1-rc.
|
|
140
|
-
"@deepseek-ai/dsh-fs": "0.2.1-rc.
|
|
141
|
-
"@deepseek-ai/dsh-launch-environment": "0.2.1-rc.
|
|
142
|
-
"@deepseek-ai/dsh-llm": "0.2.1-rc.
|
|
143
|
-
"@deepseek-ai/dsh-sandbox": "0.2.1-rc.
|
|
144
|
-
"@deepseek-ai/dsh-scope": "0.2.1-rc.
|
|
145
|
-
"@deepseek-ai/dsh-session": "0.2.1-rc.
|
|
146
|
-
"@deepseek-ai/dsh-settings": "0.2.1-rc.
|
|
147
|
-
"@deepseek-ai/dsh-timeout": "0.2.1-rc.
|
|
148
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.
|
|
149
|
-
"@deepseek-ai/dsh-typert-registry": "0.2.1-rc.
|
|
126
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.1-rc.3",
|
|
127
|
+
"@deepseek-ai/dsh-attachment": "0.2.1-rc.3",
|
|
128
|
+
"@deepseek-ai/dsh-brand": "0.2.1-rc.3",
|
|
129
|
+
"@deepseek-ai/dsh-client-locale": "0.2.1-rc.3",
|
|
130
|
+
"@deepseek-ai/dsh-client-store": "0.2.1-rc.3",
|
|
131
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.3",
|
|
132
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.2.1-rc.3",
|
|
133
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.1-rc.3",
|
|
134
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.3",
|
|
135
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.3",
|
|
136
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.3",
|
|
137
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.1-rc.3",
|
|
138
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.3",
|
|
139
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-rc.3",
|
|
140
|
+
"@deepseek-ai/dsh-fs": "0.2.1-rc.3",
|
|
141
|
+
"@deepseek-ai/dsh-launch-environment": "0.2.1-rc.3",
|
|
142
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.3",
|
|
143
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-rc.3",
|
|
144
|
+
"@deepseek-ai/dsh-scope": "0.2.1-rc.3",
|
|
145
|
+
"@deepseek-ai/dsh-session": "0.2.1-rc.3",
|
|
146
|
+
"@deepseek-ai/dsh-settings": "0.2.1-rc.3",
|
|
147
|
+
"@deepseek-ai/dsh-timeout": "0.2.1-rc.3",
|
|
148
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.3",
|
|
149
|
+
"@deepseek-ai/dsh-typert-registry": "0.2.1-rc.3",
|
|
150
150
|
"@deepseek-ai/schemastery": "~3.18.5-alpha.2",
|
|
151
|
-
"@earendil-works/pi-ai": "~1.
|
|
151
|
+
"@earendil-works/pi-ai": "~1.4.0",
|
|
152
152
|
"@testing-library/dom": "^10.4.1",
|
|
153
153
|
"@testing-library/react": "^16.3.0",
|
|
154
154
|
"@types/node": "^22.20.0",
|