@xiaoso/dsh-tool-plus 0.1.6 → 0.1.7-beta.0
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/THIRD_PARTY_NOTICES.md +9 -3
- package/lib/{abort-Cwwm4Err.mjs → abort-Caqff3M6.mjs} +2 -2
- package/lib/alibaba-coding-plan-DTupMiAi.mjs +73 -0
- package/lib/alibaba-token-plan-CHGyWOfX.mjs +46 -0
- package/lib/alibaba-token-plan-Dj3OZhEE.mjs +82 -0
- package/lib/{amazon-bedrock-TVMpUTRG.mjs → amazon-bedrock-DbFSYXfJ.mjs} +117 -38
- package/lib/{anthropic-BL6LFDQS.mjs → anthropic-CTJ3IQVa.mjs} +675 -166
- package/lib/anthropic-CXfWlp-x.mjs +105 -0
- package/lib/{aws-credentials-B20dliS7.mjs → anthropic-wire-CKuhDwZ1.mjs} +74 -14
- package/lib/{api-key-login-CIDnXeYd.mjs → api-key-validation-CGCJFbFr.mjs} +27 -68
- package/lib/{azure-openai-responses-BkhsLmN3.mjs → azure-openai-responses-ChFbWaGj.mjs} +27 -16
- package/lib/{browser-render-CmgvSNte.mjs → browser-render-9o0Rknop.mjs} +4 -4
- package/lib/bun-shim.mjs +71 -2
- package/lib/{bundled-references-ChZSPDFw.mjs → bundled-references-DY3EJxZV.mjs} +6 -5
- package/lib/cline-pass-Bwg3esu9.mjs +44 -0
- package/lib/cloudflare-ai-gateway-BupNXyKK.mjs +35 -0
- package/lib/cloudflare-ai-gateway-EWo0VkP5.mjs +44 -0
- package/lib/collapse-DOR8sOGf.mjs +2304 -0
- package/lib/coreweave-C82HrLpb.mjs +31 -0
- package/lib/coreweave-Ct8cF-da.mjs +14 -0
- package/lib/{cursor-B6HcmplF.mjs → cursor-B95LzVWV.mjs} +11 -3
- package/lib/{cursor-CRpLpaZ3.mjs → cursor-DJV_dcgB.mjs} +887 -1784
- package/lib/{cursor-B8m6SqAH.mjs → cursor-LKGjucn2.mjs} +48 -38
- package/lib/cursor-proto-B8Wj8bv9.mjs +10513 -0
- package/lib/{deterministic-id-D-yIV_eI.mjs → deterministic-id-CUEIMSqR.mjs} +1 -1
- package/lib/devin-BMTdx_hx.mjs +316 -0
- package/lib/{devin-DUAfvBsW.mjs → devin-DSp0Rw_E.mjs} +172 -86
- package/lib/devin-ExGIghmx.mjs +69 -0
- package/lib/devin-proto-Br8fdyNl.mjs +2888 -0
- package/lib/{dom-CawWi8fa.mjs → dom-DG3sPESc.mjs} +8 -8
- package/lib/effort-BdtQMN-_.mjs +23 -0
- package/lib/{error-C-f_Wnw4.mjs → error-CORgGg5a.mjs} +275 -154
- package/lib/{event-stream-Dh2guZxS.mjs → event-stream-ulcDenZD.mjs} +20 -4
- package/lib/{gemini-headers-DKUShltF.mjs → gemini-headers-Co9cVvex.mjs} +2 -2
- package/lib/{github-copilot-suDymKrx.mjs → github-copilot-Dstq1D3s.mjs} +69 -29
- package/lib/github-copilot-headers-DOh1gt_w.mjs +312 -0
- package/lib/gitlab-duo-DSCMrU0m.mjs +11 -0
- package/lib/google-CtsKkOQK.mjs +38 -0
- package/lib/google-antigravity-z-5KsEci.mjs +252 -0
- package/lib/{google-auth-DYJLM792.mjs → google-auth-ieLBaneO.mjs} +4 -4
- package/lib/{google-gemini-cli-8BT513Ul.mjs → google-gemini-cli-C6NE5mWz.mjs} +28 -54
- package/lib/{google-gemini-cli-D6cSmfvB.mjs → google-gemini-cli-CAIPSl7e.mjs} +23 -29
- package/lib/google-oauth-shared-DhMllAkt.mjs +53 -0
- package/lib/{google-shared-CVbHK5vZ.mjs → google-shared-B0aNCYEH.mjs} +140 -44
- package/lib/{google-validation-Cgbn3tWJ.mjs → google-validation-BEkNs-Bx.mjs} +1 -1
- package/lib/{google-vertex-Bui-ypAe.mjs → google-vertex-Bbd1tYNc.mjs} +8 -8
- package/lib/hosts-00rjRzUD.mjs +203 -0
- package/lib/id-AL5obQzR.mjs +71 -0
- package/lib/{idle-iterator-CYAxUkSD.mjs → idle-iterator-DlUkEfzW.mjs} +3 -3
- package/lib/index.mjs +587 -5266
- package/lib/kilo-ChJL54wq.mjs +81 -0
- package/lib/kimi-C2c_Zq8A.mjs +67 -0
- package/lib/{launch-BmgEUycu.mjs → launch-DKDH71En.mjs} +1 -1
- package/lib/markit-CmRfm4E2.mjs +9885 -0
- package/lib/models-DnXMYGcJ.mjs +381604 -0
- package/lib/muse-code-Di1VZmB1.mjs +143 -0
- package/lib/{ollama-Df9ce-Cp.mjs → ollama-B8ic3sEp.mjs} +15 -30
- package/lib/{openai-codex-CAVI3Me-.mjs → openai-codex-DuJNC99x.mjs} +29 -99
- package/lib/{openai-codex-responses-BcnOotRB.mjs → openai-codex-responses-BL29nh9K.mjs} +204 -116
- package/lib/{openai-completions-Bq4WT47M.mjs → openai-completions-BK2f2dBv.mjs} +152 -82
- package/lib/openai-configuration-update-xMYUjaK_.mjs +150 -0
- package/lib/{openai-reasoning-fallback-DXsfiSXO.mjs → openai-reasoning-fallback-BdB3RCbj.mjs} +106 -12
- package/lib/{openai-responses-Mq_-PjvE.mjs → openai-responses-CGQPlIIy.mjs} +76 -82
- package/lib/{perplexity-XgLF73E7.mjs → perplexity-TBjz3VMB.mjs} +52 -9
- package/lib/{pkce-BlQikGPu.mjs → pkce-BYjmugmw.mjs} +1 -1
- package/lib/protobuf-aab1UGVn.mjs +717 -0
- package/lib/{provider-response-C6vcbQyO.mjs → provider-response-SqKSkkUc.mjs} +1 -1
- package/lib/{proxy-D9lm7ONA.mjs → proxy-5nWqRL1f.mjs} +45 -5
- package/lib/{readability-Cpm-ocau.mjs → readability-uGhqb4GC.mjs} +2 -2
- package/lib/reference-CtvM4zLU.mjs +114 -0
- package/lib/{request-debug-HJMoJncL.mjs → request-debug-NQN0BjHH.mjs} +1 -1
- package/lib/{sanitize-text-CfcXzw5X.mjs → sanitize-text-BCf5KmCf.mjs} +1 -1
- package/lib/{scrapers-Cg5w77td.mjs → scrapers-D8oWspgW.mjs} +12 -12
- package/lib/{src-BcD0_rQR.mjs → src-BwW51vA5.mjs} +979 -388
- package/lib/{sse-debug-CYdjOC96.mjs → sse-debug-B-tkLCPW.mjs} +1 -1
- package/lib/{stream-Bjq8wjfr.mjs → stream-B_7qN-bA.mjs} +3802 -2623
- package/lib/stream-markup-healing-DKT1lnkW.mjs +267 -0
- package/lib/{strict-tool-validation-imVLUcbI.mjs → strict-tool-validation-CBTz1dAA.mjs} +2 -2
- package/lib/taxonomy-DSIM99rS.mjs +15392 -0
- package/lib/{stream-markup-healing-DZ6bVDxH.mjs → thinking-CiLa2LFB.mjs} +31 -186
- package/lib/{turndown-DN7ByzEI.mjs → turndown-DrX1M4WG.mjs} +4 -4
- package/lib/{type-guards-B9VVjRDK.mjs → type-guards-CttAANEx.mjs} +1 -1
- package/lib/{types-DX_bvuus.mjs → types-PVueGi9S.mjs} +2 -2
- package/lib/{utils-C-dSORPa.mjs → utils-CCfhUQen.mjs} +2364 -2676
- package/lib/{utils-Cp2Mxf_U.mjs → utils-CUPhpw9A.mjs} +413 -134
- package/lib/{utils-CQHPEQ3W.mjs → utils-DeWqNWV8.mjs} +2 -2
- package/lib/{vision-guard-mBmtAHx0.mjs → vision-guard-_XwsL1DF.mjs} +14 -29
- package/lib/xai-oauth-CXhnz0gO.mjs +210 -0
- package/lib/{xiaomi-7mE345KX.mjs → xiaomi-psoUItal.mjs} +8 -37
- package/lib/{zai-CeNpMV3W.mjs → zai-ApJ8HBgT.mjs} +8 -71
- package/lib/{zip-BK7UHCwX.mjs → zip-Kd602XNe.mjs} +1 -1
- package/package.json +11 -11
- package/presets/package.json +1 -1
- package/presets/tool-plus-ptc/agent.cordis.yml +1 -1
- package/presets/tool-plus-standard/agent.cordis.yml +1 -1
- package/lib/agent_pb-Rizyt9Zg.mjs +0 -805
- package/lib/anthropic-CDmj476p.mjs +0 -262
- package/lib/api_server_pb-CDZgLMta.mjs +0 -252
- package/lib/callback-server-CFJK-jvK.mjs +0 -398
- package/lib/codex-P1dGpX7G.mjs +0 -54
- package/lib/device-code-CuXTWYwY.mjs +0 -51
- package/lib/devin-BcQwht1W.mjs +0 -114
- package/lib/devin-BvMfGevz.mjs +0 -95
- package/lib/github-copilot-B3kQl0g0.mjs +0 -104
- package/lib/gitlab-duo-BriUTP8k.mjs +0 -155
- package/lib/gitlab-duo-workflow-wK5Ljzmc.mjs +0 -91
- package/lib/google-CE5tFDod.mjs +0 -30
- package/lib/google-antigravity-C1jgNljz.mjs +0 -198
- package/lib/google-oauth-shared-BLVTvokk.mjs +0 -147
- package/lib/grammar-D-NqNUxQ.mjs +0 -49
- package/lib/identity-HNO1Oe9B.mjs +0 -219
- package/lib/kimi-DgcUpPtK.mjs +0 -236
- package/lib/markit-DtGoRE6M.mjs +0 -1417
- package/lib/minimax-code-Y3h5li9N.mjs +0 -53
- package/lib/models-DRA2c_8U.mjs +0 -104660
- package/lib/opencode-BsVw9rCD.mjs +0 -38
- package/lib/to-binary-B1BEBIPC.mjs +0 -6002
- package/lib/wafer-BlhWLweO.mjs +0 -17
- package/lib/xai-oauth-5pORHUrg.mjs +0 -446
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import { r as toModelSpec } from "./bundled-references-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { d as compareRevision, f as parseRevision, n as classifyModel } from "./taxonomy-DSIM99rS.mjs";
|
|
4
|
+
import { r as getBundledModels } from "./models-DnXMYGcJ.mjs";
|
|
5
|
+
import { r as toModelSpec } from "./bundled-references-DY3EJxZV.mjs";
|
|
6
|
+
import { i as fromBinary, o as toBinary, t as create } from "./protobuf-aab1UGVn.mjs";
|
|
7
|
+
import { nt as GetUsableModelsResponseSchema, tt as GetUsableModelsRequestSchema } from "./cursor-proto-B8Wj8bv9.mjs";
|
|
8
8
|
import { type } from "@oh-my-pi/omptype";
|
|
9
9
|
import * as http2$1 from "node:http2";
|
|
10
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@
|
|
10
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.1.17/node_modules/@oh-my-pi/pi-catalog/src/discovery/cursor.ts
|
|
11
11
|
const CURSOR_DEFAULT_BASE_URL = "https://api2.cursor.sh";
|
|
12
12
|
const CURSOR_DEFAULT_CLIENT_VERSION = "cli-2026.02.13-41ac335";
|
|
13
13
|
const CURSOR_GET_USABLE_MODELS_PATH = "/agent.v1.AgentService/GetUsableModels";
|
|
@@ -22,15 +22,6 @@ const DEFAULT_MAX_TOKENS = 64e3;
|
|
|
22
22
|
*/
|
|
23
23
|
const CURSOR_1M_CONTEXT_WINDOW = 1e6;
|
|
24
24
|
const CURSOR_1M_NAME_PATTERN = /\b1m\b/i;
|
|
25
|
-
const CURSOR_MAX_MODE_1M_ID_PATTERN = /claude|gemini/;
|
|
26
|
-
/** Kimi's official bare K3 id (`k3`, `kimi/k3`); `k3-256k` is the 256k SKU and stays out. */
|
|
27
|
-
const CURSOR_KIMI_K3_BARE_ID_PATTERN = /(^|\/)k3$/i;
|
|
28
|
-
/**
|
|
29
|
-
* Model-id families whose native catalogs (anthropic, openai/openai-codex,
|
|
30
|
-
* google) are multimodal. Cursor-only or text-only families (`composer-*`,
|
|
31
|
-
* `grok-code-*`) intentionally stay outside this pattern.
|
|
32
|
-
*/
|
|
33
|
-
const CURSOR_MULTIMODAL_ID_PATTERN = /claude|gemini|gpt-|codex/;
|
|
34
25
|
const OptionalDisplayNameSchema = type("unknown").pipe((raw) => typeof raw === "string" ? raw : void 0);
|
|
35
26
|
const CursorAliasesSchema = type("unknown").pipe((raw) => {
|
|
36
27
|
if (Array.isArray(raw)) return raw.filter((alias) => typeof alias === "string");
|
|
@@ -168,6 +159,25 @@ function decodeConnectUnaryBody(payload) {
|
|
|
168
159
|
}
|
|
169
160
|
return null;
|
|
170
161
|
}
|
|
162
|
+
function isCursorKimiK3(id) {
|
|
163
|
+
const identity = classifyModel("cursor", id, { lenient: true });
|
|
164
|
+
return identity.class === "kimi" && identity.family === "k3";
|
|
165
|
+
}
|
|
166
|
+
function isCursorVersionedGrok(id) {
|
|
167
|
+
const identity = classifyModel("cursor", id, { lenient: true });
|
|
168
|
+
if (identity.class !== "xai" || identity.revision === void 0) return false;
|
|
169
|
+
const revision = parseRevision(identity.revision);
|
|
170
|
+
const floor = parseRevision("4");
|
|
171
|
+
return revision !== void 0 && floor !== void 0 && compareRevision(revision, floor) >= 0;
|
|
172
|
+
}
|
|
173
|
+
function isCursorGlm52CodingModel(id) {
|
|
174
|
+
const identity = classifyModel("cursor", id, { lenient: true });
|
|
175
|
+
if (identity.class !== "glm" || identity.revision === void 0) return false;
|
|
176
|
+
if (identity.family !== void 0 && identity.family !== "air" && identity.family !== "turbo") return false;
|
|
177
|
+
const revision = parseRevision(identity.revision);
|
|
178
|
+
const floor = parseRevision("5.2");
|
|
179
|
+
return revision !== void 0 && floor !== void 0 && compareRevision(revision, floor) >= 0;
|
|
180
|
+
}
|
|
171
181
|
function normalizeCursorModels(models, baseUrlOverride, references) {
|
|
172
182
|
if (!models || models.length === 0) return [];
|
|
173
183
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -186,13 +196,14 @@ function normalizeCursorModel(model, baseUrlOverride, references) {
|
|
|
186
196
|
if (!id) return null;
|
|
187
197
|
const name = pickModelDisplayName(details, id);
|
|
188
198
|
const reference = references.get(id);
|
|
189
|
-
const reasoning =
|
|
199
|
+
const reasoning = isCursorKimiK3(id) || isCursorVersionedGrok(id) || Boolean(details.thinkingDetails) || reference?.reasoning === true;
|
|
190
200
|
if (reference) return {
|
|
191
201
|
...reference,
|
|
192
202
|
id,
|
|
193
203
|
name,
|
|
194
204
|
baseUrl: baseUrlOverride ?? reference.baseUrl,
|
|
195
205
|
reasoning,
|
|
206
|
+
input: resolveCursorInput(id, reference.input),
|
|
196
207
|
contextWindow: resolveCursorContextWindow(details, id, reference.contextWindow),
|
|
197
208
|
cursorMaxMode: details.maxMode
|
|
198
209
|
};
|
|
@@ -203,7 +214,7 @@ function normalizeCursorModel(model, baseUrlOverride, references) {
|
|
|
203
214
|
provider: "cursor",
|
|
204
215
|
baseUrl: baseUrlOverride ?? CURSOR_DEFAULT_BASE_URL,
|
|
205
216
|
reasoning,
|
|
206
|
-
input:
|
|
217
|
+
input: resolveCursorInput(id),
|
|
207
218
|
cost: {
|
|
208
219
|
input: 0,
|
|
209
220
|
output: 0,
|
|
@@ -220,27 +231,25 @@ function normalizeCursorModel(model, baseUrlOverride, references) {
|
|
|
220
231
|
* signal fires (never below a larger bundled reference), else the fallback.
|
|
221
232
|
*/
|
|
222
233
|
function resolveCursorContextWindow(model, id, fallback) {
|
|
223
|
-
|
|
234
|
+
const labeled1M = CURSOR_1M_NAME_PATTERN.test(id) || [
|
|
224
235
|
model.displayName,
|
|
225
236
|
model.displayNameShort,
|
|
226
237
|
model.displayModelId,
|
|
227
238
|
...model.aliases
|
|
228
|
-
].some((candidate) => typeof candidate === "string" && CURSOR_1M_NAME_PATTERN.test(candidate))
|
|
239
|
+
].some((candidate) => typeof candidate === "string" && CURSOR_1M_NAME_PATTERN.test(candidate));
|
|
240
|
+
const identity = classifyModel("cursor", id, { lenient: true });
|
|
241
|
+
const maxMode1M = model.maxMode && (identity.class === "anthropic" || identity.class === "gemini");
|
|
242
|
+
if (labeled1M || isCursorNative1MModelId(id) || maxMode1M) return Math.max(fallback ?? 0, CURSOR_1M_CONTEXT_WINDOW);
|
|
229
243
|
return fallback;
|
|
230
244
|
}
|
|
231
245
|
/**
|
|
232
|
-
* Natively 1M-context families Cursor serves without a "1M" label:
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* `isGlm52ReasoningEffortModelId`.
|
|
246
|
+
* Natively 1M-context families Cursor serves without a "1M" label: GLM 5.2+
|
|
247
|
+
* base/air/turbo coding SKUs (structured family and revision gates exclude
|
|
248
|
+
* vision and sub-1M variants). K3 — including Cursor's bare `k3` alias — is
|
|
249
|
+
* rule-owned via `context-window-floor` in `providers/cursor.kdl`.
|
|
237
250
|
*/
|
|
238
251
|
function isCursorNative1MModelId(id) {
|
|
239
|
-
|
|
240
|
-
const glm = parseGlmModel(bareModelId(id));
|
|
241
|
-
if (!glm || glm.vision) return false;
|
|
242
|
-
if (glm.variant !== "base" && glm.variant !== "air" && glm.variant !== "turbo") return false;
|
|
243
|
-
return semverGte(glm.version, "5.2");
|
|
252
|
+
return isCursorGlm52CodingModel(id);
|
|
244
253
|
}
|
|
245
254
|
function pickModelDisplayName(model, fallbackId) {
|
|
246
255
|
const candidates = [
|
|
@@ -258,16 +267,17 @@ function pickModelDisplayName(model, fallbackId) {
|
|
|
258
267
|
return fallbackId;
|
|
259
268
|
}
|
|
260
269
|
/**
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* `
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* `inferInputFromGeminiId` in ./gemini.ts.
|
|
270
|
+
* Resolves input modalities from a bundled reference when available. The
|
|
271
|
+
* Cursor-verified families (K3, grok-4, composer-2.5) are rule-owned via
|
|
272
|
+
* `input-modalities` in `providers/cursor.kdl` and corrected at build time.
|
|
273
|
+
* Without a reference, families whose native catalogs are multimodal
|
|
274
|
+
* (anthropic, gemini, openai) fall back to id classification.
|
|
267
275
|
*/
|
|
268
|
-
function
|
|
269
|
-
if (
|
|
276
|
+
function resolveCursorInput(id, referenceInput) {
|
|
277
|
+
if (referenceInput) return referenceInput;
|
|
278
|
+
const identity = classifyModel("cursor", id, { lenient: true });
|
|
279
|
+
if (identity.class === "anthropic" || identity.class === "gemini" || identity.class === "openai") return ["text", "image"];
|
|
270
280
|
return ["text"];
|
|
271
281
|
}
|
|
272
282
|
//#endregion
|
|
273
|
-
export { fetchCursorUsableModels };
|
|
283
|
+
export { fetchCursorUsableModels, resolveCursorInput };
|