dsh-lcx-codex 0.5.2 → 0.6.0-pre.2
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 +16 -9
- package/THIRD_PARTY_NOTICES.md +3 -2
- package/icon.svg +1 -0
- package/lib/abort-error.js +12 -1
- package/lib/client.js +137 -39
- package/lib/compact-v2.js +16 -56
- package/lib/defaults.js +15 -0
- package/lib/dsh-compat.js +15 -76
- package/lib/dsh-responses.js +172 -71
- package/lib/grok-native-search.js +1 -3
- package/lib/index.js +228 -78
- package/lib/model-catalog.js +5 -7
- package/lib/native-checkpoint.js +57 -182
- package/lib/pi-responses-runtime.js +140 -50
- package/lib/provider-headers.js +31 -0
- package/lib/responses-request.js +4 -12
- package/lib/responses-stream.js +116 -218
- package/lib/route.js +169 -75
- package/lib/search-accounting.js +19 -21
- package/lib/token-budget.js +6 -41
- package/lib/tool-surface.js +106 -0
- package/lib/transport.js +89 -107
- package/lib/types/client/search-media.d.ts +0 -2
- package/lib/types/index.d.ts +4 -0
- package/lib/util.js +21 -0
- package/lib/web-run-output.js +0 -3
- package/lib/web-search-alpha.js +22 -27
- package/lib/web-search-capability.js +1 -3
- package/lib/web-search-hosted.js +2 -2
- package/lib/web-search-ref-store.js +1 -3
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +37 -32
- package/lib/pi086-responses-allowlist.js +0 -131
package/lib/web-search-hosted.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { outputDomains, outputLineRange, parseWebRunOutput } from "./web-run-output.js";
|
|
2
|
+
import { isRecord, codedError } from "./util.js";
|
|
2
3
|
export const HOSTED_SEARCH_PARAMETERS = { type: "object", properties: { query: { type: "string", description: "Advanced Responses Hosted Web Search query. Use DSH web_search for ordinary searches." }, searchContextSize: { type: "string", enum: ["low", "medium", "high"] }, allowedDomains: { type: "array", items: { type: "string" }, description: "Optional allow filter. Omit or use [] for no filter; only nonempty lists are sent." }, blockedDomains: { type: "array", items: { type: "string" }, description: "Optional block filter. Omit or use [] for no filter; only nonempty lists are sent." }, userLocation: { type: "object", properties: { country: { type: "string" }, city: { type: "string" }, region: { type: "string" }, timezone: { type: "string" } }, additionalProperties: false }, externalWebAccess: { type: "boolean" }, returnTokenBudget: { type: "string", enum: ["default", "unlimited"] }, searchContentTypes: { type: "array", items: { type: "string", enum: ["text", "image"] }, description: "Optional content types. Omit unless image results are needed; [] means no explicit content-type override." }, imageSettings: { type: "object", description: "Optional image settings. Omit unless searchContentTypes includes image; ignored (after validation) without image search.", properties: { maxResults: { type: "integer" }, caption: { type: "boolean" } }, additionalProperties: false } }, required: ["query"], additionalProperties: false };
|
|
3
4
|
export const HOSTED_SEARCH_OUTPUT = { type: "object", properties: { mode: { type: "string", enum: ["hosted"] }, action: { type: "string" }, emulation: { type: "string", enum: ["native"] }, content: { type: "string" }, sources: { type: "array", items: { type: "object" } }, citations: { type: "array", items: { type: "object" } }, images: { type: "array", items: { type: "object" } }, warnings: { type: "array", items: { type: "string" } }, outputBlocks: { type: "array", items: { type: "object" } }, domains: { type: "array", items: { type: "string" } }, lineRange: { type: "object" }, requestId: { type: "string" }, responseId: { type: "string" }, retrievedAt: { type: "string" }, truncated: { type: "boolean" }, usage: { type: "object", properties: { inputTokens: { type: "number" }, outputTokens: { type: "number" }, totalTokens: { type: "number" }, cachedInputTokens: { type: "number" }, actionCount: { type: "number" }, serverWebSearchCalls: { type: "number" } }, additionalProperties: false } }, required: ["mode", "action", "emulation", "content", "sources", "citations", "images", "warnings", "requestId", "retrievedAt", "truncated"], additionalProperties: false };
|
|
4
|
-
function failure(message, code = "WEB_INVALID_REQUEST") { return
|
|
5
|
-
function isRecord(value) { return value !== null && typeof value === "object" && !Array.isArray(value); }
|
|
5
|
+
function failure(message, code = "WEB_INVALID_REQUEST") { return codedError(message, code); }
|
|
6
6
|
function isStringArray(value) { return Array.isArray(value) && value.every((item) => typeof item === "string"); }
|
|
7
7
|
function isInteger(value) { return typeof value === "number" && Number.isInteger(value); }
|
|
8
8
|
function httpUrl(value) { if (typeof value !== "string")
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { JsonStore } from "./json-store.js";
|
|
3
|
+
import { isRecord } from "./util.js";
|
|
3
4
|
const VERSION = 2;
|
|
4
|
-
function isRecord(value) {
|
|
5
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6
|
-
}
|
|
7
5
|
function validHttpUrl(value) {
|
|
8
6
|
if (value === undefined)
|
|
9
7
|
return true;
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-lcx-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-pre.2",
|
|
4
4
|
"description": "Model-scoped DSH plugin: GPT Responses lifecycle, Native V2 compaction and Hosted/Alpha Search; Grok native Web/X Search",
|
|
5
|
+
"icon": "./icon.svg",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"deepseek-harness",
|
|
7
8
|
"dsh",
|
|
@@ -37,9 +38,12 @@
|
|
|
37
38
|
"default": "./lib/client.js"
|
|
38
39
|
},
|
|
39
40
|
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
41
|
+
"./locale/*.json": "./locale/*.json",
|
|
40
42
|
"./package.json": "./package.json"
|
|
41
43
|
},
|
|
42
44
|
"files": [
|
|
45
|
+
"icon.svg",
|
|
46
|
+
"locale/*.json",
|
|
43
47
|
"lib/*.js",
|
|
44
48
|
"lib/types/index.d.ts",
|
|
45
49
|
"lib/types/client/index.d.ts",
|
|
@@ -62,9 +66,9 @@
|
|
|
62
66
|
}
|
|
63
67
|
},
|
|
64
68
|
"devDependencies": {
|
|
65
|
-
"@deepseek-ai/dsh": "0.2.
|
|
66
|
-
"@earendil-works/pi-ai": "
|
|
67
|
-
"@deepseek-ai/schemastery": "
|
|
69
|
+
"@deepseek-ai/dsh": "0.2.1-alpha.2",
|
|
70
|
+
"@earendil-works/pi-ai": "1.1.0",
|
|
71
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1",
|
|
68
72
|
"@types/node": "^22.20.0",
|
|
69
73
|
"@types/react": "~18.3.1",
|
|
70
74
|
"esbuild": "^0.28.2",
|
|
@@ -72,31 +76,31 @@
|
|
|
72
76
|
"typescript": "7.0.2"
|
|
73
77
|
},
|
|
74
78
|
"peerDependencies": {
|
|
75
|
-
"@deepseek-ai/cordis": "
|
|
76
|
-
"@deepseek-ai/cordis-plugin-loader": "
|
|
77
|
-
"@deepseek-ai/dsh-agent": ">=0.2.
|
|
78
|
-
"@deepseek-ai/dsh-attachment": ">=0.2.
|
|
79
|
-
"@deepseek-ai/dsh-client-locale": ">=0.2.
|
|
80
|
-
"@deepseek-ai/dsh-client-modules": ">=0.2.
|
|
81
|
-
"@deepseek-ai/dsh-client-store": ">=0.2.
|
|
82
|
-
"@deepseek-ai/dsh-client-ui-chat": ">=0.2.
|
|
83
|
-
"@deepseek-ai/dsh-client-ui-conversation": ">=0.2.
|
|
84
|
-
"@deepseek-ai/dsh-client-ui-plugin-manager": ">=0.2.
|
|
85
|
-
"@deepseek-ai/dsh-client-ui-settings": ">=0.2.
|
|
86
|
-
"@deepseek-ai/dsh-compaction": ">=0.2.
|
|
87
|
-
"@deepseek-ai/dsh-credentials": ">=0.2.
|
|
88
|
-
"@deepseek-ai/dsh-fs": ">=0.2.
|
|
89
|
-
"@deepseek-ai/dsh-llm": ">=0.2.
|
|
90
|
-
"@deepseek-ai/dsh-session": ">=0.2.
|
|
91
|
-
"@deepseek-ai/dsh-session-query": ">=0.2.
|
|
92
|
-
"@deepseek-ai/dsh-settings": ">=0.2.
|
|
93
|
-
"@deepseek-ai/dsh-tool-web": ">=0.2.
|
|
94
|
-
"@deepseek-ai/dsh-tools": ">=0.2.
|
|
95
|
-
"@deepseek-ai/dsh-web": ">=0.2.
|
|
96
|
-
"@deepseek-ai/schemastery": "
|
|
79
|
+
"@deepseek-ai/cordis": ">=4.0.5-alpha.1",
|
|
80
|
+
"@deepseek-ai/cordis-plugin-loader": ">=1.0.6-alpha.1",
|
|
81
|
+
"@deepseek-ai/dsh-agent": ">=0.2.1-alpha.2",
|
|
82
|
+
"@deepseek-ai/dsh-attachment": ">=0.2.1-alpha.2",
|
|
83
|
+
"@deepseek-ai/dsh-client-locale": ">=0.2.1-alpha.2",
|
|
84
|
+
"@deepseek-ai/dsh-client-modules": ">=0.2.1-alpha.2",
|
|
85
|
+
"@deepseek-ai/dsh-client-store": ">=0.2.1-alpha.2",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-chat": ">=0.2.1-alpha.2",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-conversation": ">=0.2.1-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": ">=0.2.1-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-settings": ">=0.2.1-alpha.2",
|
|
90
|
+
"@deepseek-ai/dsh-compaction": ">=0.2.1-alpha.2",
|
|
91
|
+
"@deepseek-ai/dsh-credentials": ">=0.2.1-alpha.2",
|
|
92
|
+
"@deepseek-ai/dsh-fs": ">=0.2.1-alpha.2",
|
|
93
|
+
"@deepseek-ai/dsh-llm": ">=0.2.1-alpha.2",
|
|
94
|
+
"@deepseek-ai/dsh-session": ">=0.2.1-alpha.2",
|
|
95
|
+
"@deepseek-ai/dsh-session-query": ">=0.2.1-alpha.2",
|
|
96
|
+
"@deepseek-ai/dsh-settings": ">=0.2.1-alpha.2",
|
|
97
|
+
"@deepseek-ai/dsh-tool-web": ">=0.2.1-alpha.2",
|
|
98
|
+
"@deepseek-ai/dsh-tools": ">=0.2.1-alpha.2",
|
|
99
|
+
"@deepseek-ai/dsh-web": ">=0.2.1-alpha.2",
|
|
100
|
+
"@deepseek-ai/schemastery": ">=3.18.5-alpha.1",
|
|
97
101
|
"react": "^18.2.0",
|
|
98
|
-
"@deepseek-ai/dsh-token-meter": ">=0.2.
|
|
99
|
-
"@deepseek-ai/dsh-session-projection": ">=0.2.
|
|
102
|
+
"@deepseek-ai/dsh-token-meter": ">=0.2.1-alpha.2",
|
|
103
|
+
"@deepseek-ai/dsh-session-projection": ">=0.2.1-alpha.2",
|
|
100
104
|
"zod": "^4.5.4"
|
|
101
105
|
},
|
|
102
106
|
"peerDependenciesMeta": {
|
|
@@ -168,6 +172,7 @@
|
|
|
168
172
|
"test": "node --test tests/*.test.mjs",
|
|
169
173
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
|
|
170
174
|
"probe:alpha": "node scripts/probe-alpha.mjs",
|
|
175
|
+
"probe:tool-updates": "node scripts/probe-tool-updates.mjs",
|
|
171
176
|
"pack:local": "npm pack --ignore-scripts",
|
|
172
177
|
"test:schema": "node scripts/validate-dsh-schema.mjs"
|
|
173
178
|
},
|
|
@@ -179,9 +184,9 @@
|
|
|
179
184
|
},
|
|
180
185
|
"license": "MIT",
|
|
181
186
|
"lcxCompatibility": {
|
|
182
|
-
"dshInstallRange": ">=0.2.
|
|
183
|
-
"verifiedDsh": "0.2.
|
|
184
|
-
"verifiedHostPi": "
|
|
185
|
-
"verifiedPluginPi": "
|
|
187
|
+
"dshInstallRange": ">=0.2.1-alpha.2",
|
|
188
|
+
"verifiedDsh": "0.2.1-alpha.2",
|
|
189
|
+
"verifiedHostPi": "1.1.0",
|
|
190
|
+
"verifiedPluginPi": "1.1.0"
|
|
186
191
|
}
|
|
187
192
|
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
// Generated by scripts/generate-pi086-allowlist.mjs from the Pi 0.86.0
|
|
2
|
-
// openai-responses catalog snapshot in data/pi086-responses-models.json.
|
|
3
|
-
// Source: Issue #90 Step 0(c) probe/dump.mjs, runtime/pi-catalog/catalog-v0.86.0.json.
|
|
4
|
-
// Keep provider and model paired: an id on another provider has separate authority.
|
|
5
|
-
const responsesModels = {
|
|
6
|
-
"cloudflare-ai-gateway": [
|
|
7
|
-
"gpt-4.1",
|
|
8
|
-
"gpt-4.1-mini",
|
|
9
|
-
"gpt-4.1-nano",
|
|
10
|
-
"gpt-4o",
|
|
11
|
-
"gpt-4o-mini",
|
|
12
|
-
"gpt-5",
|
|
13
|
-
"gpt-5-mini",
|
|
14
|
-
"gpt-5-nano",
|
|
15
|
-
"gpt-5.1",
|
|
16
|
-
"gpt-5.4",
|
|
17
|
-
"gpt-5.4-mini",
|
|
18
|
-
"gpt-5.4-nano",
|
|
19
|
-
"gpt-5.4-pro",
|
|
20
|
-
"gpt-5.5",
|
|
21
|
-
"gpt-5.5-pro",
|
|
22
|
-
"gpt-5.6-luna",
|
|
23
|
-
"gpt-5.6-sol",
|
|
24
|
-
"gpt-5.6-terra",
|
|
25
|
-
"gpt-6-astra",
|
|
26
|
-
"o3",
|
|
27
|
-
"o3-mini",
|
|
28
|
-
"o4-mini"
|
|
29
|
-
],
|
|
30
|
-
"github-copilot": [
|
|
31
|
-
"gpt-5-mini",
|
|
32
|
-
"gpt-5.3-codex",
|
|
33
|
-
"gpt-5.4",
|
|
34
|
-
"gpt-5.4-mini",
|
|
35
|
-
"gpt-5.4-nano",
|
|
36
|
-
"gpt-5.5",
|
|
37
|
-
"gpt-5.6-luna",
|
|
38
|
-
"gpt-5.6-sol",
|
|
39
|
-
"gpt-5.6-terra",
|
|
40
|
-
"gpt-6-astra",
|
|
41
|
-
"grok-4.5",
|
|
42
|
-
"grok-4.6",
|
|
43
|
-
"mai-code-1-flash-picker",
|
|
44
|
-
"mai-code-1.1-flash"
|
|
45
|
-
],
|
|
46
|
-
"openai": [
|
|
47
|
-
"gpt-4",
|
|
48
|
-
"gpt-4-turbo",
|
|
49
|
-
"gpt-4.1",
|
|
50
|
-
"gpt-4.1-mini",
|
|
51
|
-
"gpt-4.1-nano",
|
|
52
|
-
"gpt-4o",
|
|
53
|
-
"gpt-4o-2024-05-13",
|
|
54
|
-
"gpt-4o-2024-08-06",
|
|
55
|
-
"gpt-4o-2024-11-20",
|
|
56
|
-
"gpt-4o-mini",
|
|
57
|
-
"gpt-5",
|
|
58
|
-
"gpt-5-chat-latest",
|
|
59
|
-
"gpt-5-mini",
|
|
60
|
-
"gpt-5-nano",
|
|
61
|
-
"gpt-5-pro",
|
|
62
|
-
"gpt-5.1",
|
|
63
|
-
"gpt-5.2",
|
|
64
|
-
"gpt-5.2-chat-latest",
|
|
65
|
-
"gpt-5.2-pro",
|
|
66
|
-
"gpt-5.3-chat-latest",
|
|
67
|
-
"gpt-5.3-codex",
|
|
68
|
-
"gpt-5.3-codex-spark",
|
|
69
|
-
"gpt-5.4",
|
|
70
|
-
"gpt-5.4-mini",
|
|
71
|
-
"gpt-5.4-nano",
|
|
72
|
-
"gpt-5.4-pro",
|
|
73
|
-
"gpt-5.5",
|
|
74
|
-
"gpt-5.5-pro",
|
|
75
|
-
"gpt-5.6-luna",
|
|
76
|
-
"gpt-5.6-sol",
|
|
77
|
-
"gpt-5.6-terra",
|
|
78
|
-
"gpt-6-astra",
|
|
79
|
-
"gpt-realtime-2.1",
|
|
80
|
-
"o1",
|
|
81
|
-
"o1-pro",
|
|
82
|
-
"o3",
|
|
83
|
-
"o3-mini",
|
|
84
|
-
"o3-pro",
|
|
85
|
-
"o4-mini"
|
|
86
|
-
],
|
|
87
|
-
"opencode": [
|
|
88
|
-
"gpt-5",
|
|
89
|
-
"gpt-5-codex",
|
|
90
|
-
"gpt-5-nano",
|
|
91
|
-
"gpt-5.1",
|
|
92
|
-
"gpt-5.1-codex",
|
|
93
|
-
"gpt-5.1-codex-max",
|
|
94
|
-
"gpt-5.1-codex-mini",
|
|
95
|
-
"gpt-5.2",
|
|
96
|
-
"gpt-5.2-codex",
|
|
97
|
-
"gpt-5.3-codex",
|
|
98
|
-
"gpt-5.4",
|
|
99
|
-
"gpt-5.4-mini",
|
|
100
|
-
"gpt-5.4-nano",
|
|
101
|
-
"gpt-5.4-pro",
|
|
102
|
-
"gpt-5.5",
|
|
103
|
-
"gpt-5.5-pro",
|
|
104
|
-
"gpt-5.6-luna",
|
|
105
|
-
"gpt-5.6-sol",
|
|
106
|
-
"gpt-5.6-terra",
|
|
107
|
-
"gpt-6-astra",
|
|
108
|
-
"grok-4.5",
|
|
109
|
-
"grok-4.6",
|
|
110
|
-
"grok-build-0.1",
|
|
111
|
-
"muse-spark-1.2",
|
|
112
|
-
"muse-spark-1.2-contributor-free",
|
|
113
|
-
"muse-spark-1.3",
|
|
114
|
-
"muse-spark-1.3-contributor-free"
|
|
115
|
-
],
|
|
116
|
-
"opencode-go": [
|
|
117
|
-
"gpt-5.6-luna",
|
|
118
|
-
"grok-4.6",
|
|
119
|
-
"muse-spark-1.2-contributor",
|
|
120
|
-
"muse-spark-1.3-contributor"
|
|
121
|
-
],
|
|
122
|
-
"xai": [
|
|
123
|
-
"grok-4.3",
|
|
124
|
-
"grok-4.5",
|
|
125
|
-
"grok-4.6"
|
|
126
|
-
]
|
|
127
|
-
};
|
|
128
|
-
export function wasPi086ResponsesModel(provider, model) {
|
|
129
|
-
const ids = responsesModels[provider];
|
|
130
|
-
return ids?.includes(model) ?? false;
|
|
131
|
-
}
|