@xiaoso/dsh-tool-plus 0.1.5 → 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.
Files changed (120) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +9 -3
  3. package/lib/{abort-Cwwm4Err.mjs → abort-Caqff3M6.mjs} +2 -2
  4. package/lib/alibaba-coding-plan-DTupMiAi.mjs +73 -0
  5. package/lib/alibaba-token-plan-CHGyWOfX.mjs +46 -0
  6. package/lib/alibaba-token-plan-Dj3OZhEE.mjs +82 -0
  7. package/lib/{amazon-bedrock-TVMpUTRG.mjs → amazon-bedrock-DbFSYXfJ.mjs} +117 -38
  8. package/lib/{anthropic-BL6LFDQS.mjs → anthropic-CTJ3IQVa.mjs} +675 -166
  9. package/lib/anthropic-CXfWlp-x.mjs +105 -0
  10. package/lib/{aws-credentials-B20dliS7.mjs → anthropic-wire-CKuhDwZ1.mjs} +74 -14
  11. package/lib/{api-key-login-CIDnXeYd.mjs → api-key-validation-CGCJFbFr.mjs} +27 -68
  12. package/lib/{azure-openai-responses-BkhsLmN3.mjs → azure-openai-responses-ChFbWaGj.mjs} +27 -16
  13. package/lib/{browser-render-CmgvSNte.mjs → browser-render-9o0Rknop.mjs} +4 -4
  14. package/lib/bun-shim.mjs +71 -2
  15. package/lib/{bundled-references-ChZSPDFw.mjs → bundled-references-DY3EJxZV.mjs} +6 -5
  16. package/lib/cline-pass-Bwg3esu9.mjs +44 -0
  17. package/lib/cloudflare-ai-gateway-BupNXyKK.mjs +35 -0
  18. package/lib/cloudflare-ai-gateway-EWo0VkP5.mjs +44 -0
  19. package/lib/collapse-DOR8sOGf.mjs +2304 -0
  20. package/lib/coreweave-C82HrLpb.mjs +31 -0
  21. package/lib/coreweave-Ct8cF-da.mjs +14 -0
  22. package/lib/{cursor-B6HcmplF.mjs → cursor-B95LzVWV.mjs} +11 -3
  23. package/lib/{cursor-CRpLpaZ3.mjs → cursor-DJV_dcgB.mjs} +887 -1784
  24. package/lib/{cursor-B8m6SqAH.mjs → cursor-LKGjucn2.mjs} +48 -38
  25. package/lib/cursor-proto-B8Wj8bv9.mjs +10513 -0
  26. package/lib/{deterministic-id-D-yIV_eI.mjs → deterministic-id-CUEIMSqR.mjs} +1 -1
  27. package/lib/devin-BMTdx_hx.mjs +316 -0
  28. package/lib/{devin-DUAfvBsW.mjs → devin-DSp0Rw_E.mjs} +172 -86
  29. package/lib/devin-ExGIghmx.mjs +69 -0
  30. package/lib/devin-proto-Br8fdyNl.mjs +2888 -0
  31. package/lib/{dom-CawWi8fa.mjs → dom-DG3sPESc.mjs} +8 -8
  32. package/lib/effort-BdtQMN-_.mjs +23 -0
  33. package/lib/{error-C-f_Wnw4.mjs → error-CORgGg5a.mjs} +275 -154
  34. package/lib/{event-stream-Dh2guZxS.mjs → event-stream-ulcDenZD.mjs} +20 -4
  35. package/lib/{gemini-headers-DKUShltF.mjs → gemini-headers-Co9cVvex.mjs} +2 -2
  36. package/lib/{github-copilot-suDymKrx.mjs → github-copilot-Dstq1D3s.mjs} +69 -29
  37. package/lib/github-copilot-headers-DOh1gt_w.mjs +312 -0
  38. package/lib/gitlab-duo-DSCMrU0m.mjs +11 -0
  39. package/lib/google-CtsKkOQK.mjs +38 -0
  40. package/lib/google-antigravity-z-5KsEci.mjs +252 -0
  41. package/lib/{google-auth-DYJLM792.mjs → google-auth-ieLBaneO.mjs} +4 -4
  42. package/lib/{google-gemini-cli-8BT513Ul.mjs → google-gemini-cli-C6NE5mWz.mjs} +28 -54
  43. package/lib/{google-gemini-cli-D6cSmfvB.mjs → google-gemini-cli-CAIPSl7e.mjs} +23 -29
  44. package/lib/google-oauth-shared-DhMllAkt.mjs +53 -0
  45. package/lib/{google-shared-CVbHK5vZ.mjs → google-shared-B0aNCYEH.mjs} +140 -44
  46. package/lib/{google-validation-Cgbn3tWJ.mjs → google-validation-BEkNs-Bx.mjs} +1 -1
  47. package/lib/{google-vertex-Bui-ypAe.mjs → google-vertex-Bbd1tYNc.mjs} +8 -8
  48. package/lib/hosts-00rjRzUD.mjs +203 -0
  49. package/lib/id-AL5obQzR.mjs +71 -0
  50. package/lib/{idle-iterator-CYAxUkSD.mjs → idle-iterator-DlUkEfzW.mjs} +3 -3
  51. package/lib/index.mjs +587 -5266
  52. package/lib/kilo-ChJL54wq.mjs +81 -0
  53. package/lib/kimi-C2c_Zq8A.mjs +67 -0
  54. package/lib/{launch-BmgEUycu.mjs → launch-DKDH71En.mjs} +1 -1
  55. package/lib/markit-CmRfm4E2.mjs +9885 -0
  56. package/lib/models-DnXMYGcJ.mjs +381604 -0
  57. package/lib/muse-code-Di1VZmB1.mjs +143 -0
  58. package/lib/{ollama-Df9ce-Cp.mjs → ollama-B8ic3sEp.mjs} +15 -30
  59. package/lib/{openai-codex-CAVI3Me-.mjs → openai-codex-DuJNC99x.mjs} +29 -99
  60. package/lib/{openai-codex-responses-BcnOotRB.mjs → openai-codex-responses-BL29nh9K.mjs} +204 -116
  61. package/lib/{openai-completions-Bq4WT47M.mjs → openai-completions-BK2f2dBv.mjs} +152 -82
  62. package/lib/openai-configuration-update-xMYUjaK_.mjs +150 -0
  63. package/lib/{openai-reasoning-fallback-DXsfiSXO.mjs → openai-reasoning-fallback-BdB3RCbj.mjs} +106 -12
  64. package/lib/{openai-responses-Mq_-PjvE.mjs → openai-responses-CGQPlIIy.mjs} +76 -82
  65. package/lib/{perplexity-XgLF73E7.mjs → perplexity-TBjz3VMB.mjs} +52 -9
  66. package/lib/{pkce-BlQikGPu.mjs → pkce-BYjmugmw.mjs} +1 -1
  67. package/lib/protobuf-aab1UGVn.mjs +717 -0
  68. package/lib/{provider-response-C6vcbQyO.mjs → provider-response-SqKSkkUc.mjs} +1 -1
  69. package/lib/{proxy-D9lm7ONA.mjs → proxy-5nWqRL1f.mjs} +45 -5
  70. package/lib/{readability-Cpm-ocau.mjs → readability-uGhqb4GC.mjs} +2 -2
  71. package/lib/reference-CtvM4zLU.mjs +114 -0
  72. package/lib/{request-debug-HJMoJncL.mjs → request-debug-NQN0BjHH.mjs} +1 -1
  73. package/lib/{sanitize-text-CfcXzw5X.mjs → sanitize-text-BCf5KmCf.mjs} +1 -1
  74. package/lib/{scrapers-CE_qK1yk.mjs → scrapers-D8oWspgW.mjs} +12 -12
  75. package/lib/{src-BcD0_rQR.mjs → src-BwW51vA5.mjs} +979 -388
  76. package/lib/{sse-debug-CYdjOC96.mjs → sse-debug-B-tkLCPW.mjs} +1 -1
  77. package/lib/{stream-Bjq8wjfr.mjs → stream-B_7qN-bA.mjs} +3802 -2623
  78. package/lib/stream-markup-healing-DKT1lnkW.mjs +267 -0
  79. package/lib/{strict-tool-validation-imVLUcbI.mjs → strict-tool-validation-CBTz1dAA.mjs} +2 -2
  80. package/lib/taxonomy-DSIM99rS.mjs +15392 -0
  81. package/lib/{stream-markup-healing-DZ6bVDxH.mjs → thinking-CiLa2LFB.mjs} +31 -186
  82. package/lib/{turndown-DN7ByzEI.mjs → turndown-DrX1M4WG.mjs} +4 -4
  83. package/lib/{type-guards-B9VVjRDK.mjs → type-guards-CttAANEx.mjs} +1 -1
  84. package/lib/{types-DX_bvuus.mjs → types-PVueGi9S.mjs} +2 -2
  85. package/lib/{utils-APrc-TBB.mjs → utils-CCfhUQen.mjs} +2364 -2676
  86. package/lib/{utils-Cp2Mxf_U.mjs → utils-CUPhpw9A.mjs} +413 -134
  87. package/lib/{utils-CQHPEQ3W.mjs → utils-DeWqNWV8.mjs} +2 -2
  88. package/lib/{vision-guard-mBmtAHx0.mjs → vision-guard-_XwsL1DF.mjs} +14 -29
  89. package/lib/xai-oauth-CXhnz0gO.mjs +210 -0
  90. package/lib/{xiaomi-7mE345KX.mjs → xiaomi-psoUItal.mjs} +8 -37
  91. package/lib/{zai-CeNpMV3W.mjs → zai-ApJ8HBgT.mjs} +8 -71
  92. package/lib/{zip-BK7UHCwX.mjs → zip-Kd602XNe.mjs} +1 -1
  93. package/package.json +43 -41
  94. package/presets/package.json +1 -1
  95. package/presets/tool-plus-ptc/agent.cordis.yml +13 -4
  96. package/presets/tool-plus-standard/agent.cordis.yml +11 -3
  97. package/lib/agent_pb-Rizyt9Zg.mjs +0 -805
  98. package/lib/anthropic-CDmj476p.mjs +0 -262
  99. package/lib/api_server_pb-CDZgLMta.mjs +0 -252
  100. package/lib/callback-server-CFJK-jvK.mjs +0 -398
  101. package/lib/codex-P1dGpX7G.mjs +0 -54
  102. package/lib/device-code-CuXTWYwY.mjs +0 -51
  103. package/lib/devin-BcQwht1W.mjs +0 -114
  104. package/lib/devin-BvMfGevz.mjs +0 -95
  105. package/lib/github-copilot-B3kQl0g0.mjs +0 -104
  106. package/lib/gitlab-duo-BriUTP8k.mjs +0 -155
  107. package/lib/gitlab-duo-workflow-wK5Ljzmc.mjs +0 -91
  108. package/lib/google-CE5tFDod.mjs +0 -30
  109. package/lib/google-antigravity-C1jgNljz.mjs +0 -198
  110. package/lib/google-oauth-shared-BLVTvokk.mjs +0 -147
  111. package/lib/grammar-D-NqNUxQ.mjs +0 -49
  112. package/lib/identity-HNO1Oe9B.mjs +0 -219
  113. package/lib/kimi-DgcUpPtK.mjs +0 -236
  114. package/lib/markit-DtGoRE6M.mjs +0 -1417
  115. package/lib/minimax-code-Y3h5li9N.mjs +0 -53
  116. package/lib/models-DRA2c_8U.mjs +0 -104660
  117. package/lib/opencode-BsVw9rCD.mjs +0 -38
  118. package/lib/to-binary-B1BEBIPC.mjs +0 -6002
  119. package/lib/wafer-BlhWLweO.mjs +0 -17
  120. 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 { A as semverGte, D as bareModelId, O as parseGlmModel, r as getBundledModels, y as isKimiK3ModelId } from "./models-DRA2c_8U.mjs";
4
- import "./identity-HNO1Oe9B.mjs";
5
- import { r as toModelSpec } from "./bundled-references-ChZSPDFw.mjs";
6
- import { E as create, i as fromBinary, t as toBinary } from "./to-binary-B1BEBIPC.mjs";
7
- import { H as GetUsableModelsRequestSchema, U as GetUsableModelsResponseSchema } from "./agent_pb-Rizyt9Zg.mjs";
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@17.3.5/node_modules/@oh-my-pi/pi-catalog/src/discovery/cursor.ts
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 = isKimiK3ModelId(id) || Boolean(details.thinkingDetails) || reference?.reasoning === true;
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: inferInputFromCursorId(id),
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
- if (CURSOR_1M_NAME_PATTERN.test(id) || [
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)) || isCursorNative1MModelId(id) || model.maxMode && CURSOR_MAX_MODE_1M_ID_PATTERN.test(id)) return Math.max(fallback ?? 0, CURSOR_1M_CONTEXT_WINDOW);
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: Kimi K3 and
233
- * GLM 5.2+ coding SKUs. The shared family parsers cover namespace forms
234
- * (`moonshotai/kimi-k3`, `z-ai/glm-5.2`) and future GLM versions (`glm-5.10`,
235
- * `glm-6`); vision and sub-1M variants stay out via the same gates as
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
- if (isKimiK3ModelId(id) || CURSOR_KIMI_K3_BARE_ID_PATTERN.test(id)) return true;
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
- * Infers input modalities for Cursor models without a bundled reference.
262
- *
263
- * `GetUsableModels` carries no per-model modality metadata, so classification
264
- * falls back to the model family: families that are multimodal in OMP's own
265
- * native catalogs accept images, everything else stays text-only. Mirrors
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 inferInputFromCursorId(id) {
269
- if (CURSOR_MULTIMODAL_ID_PATTERN.test(id.toLowerCase())) return ["text", "image"];
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 };