@xiaoso/dsh-tool-plus 0.1.16 → 0.1.17-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/lib/{abort-DZ54CaKU.mjs → abort-BTblp0Rt.mjs} +2 -2
- package/lib/{alibaba-coding-plan-DODpkcqi.mjs → alibaba-coding-plan-t3R4YKCB.mjs} +3 -3
- package/lib/{alibaba-token-plan-C6lpKCda.mjs → alibaba-token-plan-CO4djG1y.mjs} +4 -4
- package/lib/{alibaba-token-plan-CHGyWOfX.mjs → alibaba-token-plan-CUjYJX0-.mjs} +1 -1
- package/lib/{anthropic-Dv_GGX6g.mjs → anthropic-nf7w6so1.mjs} +48 -21
- package/lib/{api-key-validation-MnMf_ihX.mjs → api-key-validation-C_tZ7Y9a.mjs} +2 -2
- package/lib/behavior-BwvTUtag.mjs +111 -0
- package/lib/{browser-render-BZXt548F.mjs → browser-render-BQaEVK_n.mjs} +4 -4
- package/lib/{reference-CtvM4zLU.mjs → bundled-references-CrQ4dQcT.mjs} +57 -4
- package/lib/cascade-BWjRTD1q.mjs +30265 -0
- package/lib/{cline-pass-BT9CBEOj.mjs → cline-pass-Bjm-O8GG.mjs} +2 -2
- package/lib/cloudflare-CKXRJ0l9.mjs +37 -0
- package/lib/{cloudflare-ai-gateway-DReN6ohJ.mjs → cloudflare-ai-gateway-BpnBSjwV.mjs} +8 -4
- package/lib/cloudflare-workers-ai-odj9XswL.mjs +32 -0
- package/lib/collapse-_nkb2dn7.mjs +1945 -0
- package/lib/{coreweave-C82HrLpb.mjs → coreweave-CGDZOD8-.mjs} +1 -1
- package/lib/{coreweave-C68UgRQO.mjs → coreweave-DwffcgW5.mjs} +4 -4
- package/lib/cursor-BgOuV7Qf.mjs +794 -0
- package/lib/{cursor-_gHHq-Dq.mjs → cursor-CF1iHHbv.mjs} +68 -19
- package/lib/{cursor-proto-Cr_WEMuv.mjs → cursor-proto-BuNTjX3L.mjs} +823 -23
- package/lib/{devin-QpfTSl9H.mjs → devin-7OEeEb80.mjs} +112 -31
- package/lib/{devin-proto-DYhp4Ty6.mjs → devin-proto-C-QreeAv.mjs} +71 -5
- package/lib/{dom-DG3sPESc.mjs → dom-BmbZv4v9.mjs} +598 -182
- package/lib/{error-O63pC8zg.mjs → error-8LVo7tug.mjs} +725 -104
- package/lib/factory-droid-ChhmsGWb.mjs +71 -0
- package/lib/{fs-promises-shim-B2YFWkcd.mjs → fs-promises-shim-CANAxFWh.mjs} +10 -1
- package/lib/{github-copilot-BMEcw8N1.mjs → github-copilot-QwevdT30.mjs} +4 -4
- package/lib/{github-copilot-headers-DnjGEbko.mjs → github-copilot-headers-CAUZ0rUD.mjs} +138 -26
- package/lib/{gitlab-duo-DnHqJjFY.mjs → gitlab-duo-DigV7k_o.mjs} +2 -2
- package/lib/{google-antigravity-B1mSckrK.mjs → google-antigravity-D-oe0r8A.mjs} +6 -7
- package/lib/{google-gemini-cli-DJwThCCn.mjs → google-gemini-cli-CQBHgGJT.mjs} +5 -6
- package/lib/{google-oauth-shared-BctLpVUN.mjs → google-oauth-shared-CvgVIUwJ.mjs} +2 -2
- package/lib/google-validation-CdvRj4ec.mjs +126 -0
- package/lib/id-EJwVLDHE.mjs +2548 -0
- package/lib/index.mjs +248 -258
- package/lib/{kilo-BEgEwMJQ.mjs → kilo-5r6OffCa.mjs} +2 -2
- package/lib/{kimi-T9NldEIJ.mjs → kimi-DOOtbXmm.mjs} +9 -10
- package/lib/{launch-BIWNyrBB.mjs → launch-DkAjib7h.mjs} +1 -1
- package/lib/{markit-Dvp2JPdT.mjs → markit-CCcyeAds.mjs} +359 -140
- package/lib/{models-DnXMYGcJ.mjs → models-DCpDT_im.mjs} +199203 -112275
- package/lib/{muse-code-CNvqqAp6.mjs → muse-code-CYf8zj_B.mjs} +5 -5
- package/lib/{openai-codex-D5-CyTxa.mjs → openai-codex-Cj-TvSFh.mjs} +13 -10
- package/lib/{perplexity-A2PEoGaC.mjs → perplexity-Dh_Qgsmx.mjs} +68 -25
- package/lib/{pkce-BYjmugmw.mjs → pkce-DO-jBJLV.mjs} +1 -1
- package/lib/pricing-DusBEhwm.mjs +593 -0
- package/lib/{readability-uGhqb4GC.mjs → readability-XHK0o3bv.mjs} +287 -27
- package/lib/{scrapers-C1ujjV8k.mjs → scrapers-B6PADOVm.mjs} +13 -13
- package/lib/slugify-ynYWBIA5.mjs +11 -0
- package/lib/snowflake-B_jap6lz.mjs +666 -0
- package/lib/snowflake-Cu1ZyOp6.mjs +151 -0
- package/lib/{src-AELUUb5U.mjs → src-BhinCSpi.mjs} +1172 -458
- package/lib/{stream-AVOoe5Hj.mjs → stream-D2ivg3GH.mjs} +3740 -5311
- package/lib/{turndown-D6fof1OX.mjs → turndown-Vya8SavL.mjs} +82 -30
- package/lib/types/tools/hashline/native/index.d.ts +2 -2
- package/lib/types/tools/hashline/native/policy.d.ts +19 -21
- package/lib/types/tools/omp/session/agent-storage.d.ts +3 -3
- package/lib/types/tools/shared/bun-named-shim.d.ts +5 -0
- package/lib/{types-BLrLohwK.mjs → types-tH1v9uRm.mjs} +2 -2
- package/lib/{utils-cZX3f_Ls.mjs → utils-C_Ncya1r.mjs} +1737 -509
- package/lib/utils-D2tK38xq.mjs +34006 -0
- package/lib/{utils-I4I8azHN.mjs → utils-DrDwmNtu.mjs} +8 -3
- package/lib/{xai-oauth-CbeldUSV.mjs → xai-oauth-DLLzX6my.mjs} +4 -4
- package/lib/{xiaomi-Dl3VSs04.mjs → xiaomi-CqK-KivK.mjs} +2 -2
- package/lib/{zai-FyjGSypr.mjs → zai-DoJ2xPIH.mjs} +2 -2
- package/lib/{zip-DRrycScC.mjs → zip-DG1mUV6X.mjs} +1 -1
- package/package.json +8 -8
- package/lib/amazon-bedrock-Dx0rr9dY.mjs +0 -996
- package/lib/anthropic-ClCw0PV_.mjs +0 -3624
- package/lib/anthropic-wire-lbGAFzYb.mjs +0 -927
- package/lib/azure-openai-responses-WE_bgFWp.mjs +0 -285
- package/lib/bundled-references-DY3EJxZV.mjs +0 -56
- package/lib/cloudflare-ai-gateway-CrMa97Ap.mjs +0 -44
- package/lib/collapse-CkMNRNr7.mjs +0 -2304
- package/lib/cursor-C6jaIJDg.mjs +0 -283
- package/lib/cursor-D-XZYDf_.mjs +0 -4544
- package/lib/deterministic-id-CUEIMSqR.mjs +0 -17
- package/lib/devin-ExGIghmx.mjs +0 -69
- package/lib/devin-u0ljw5P6.mjs +0 -628
- package/lib/effort-BdtQMN-_.mjs +0 -23
- package/lib/event-stream-BKEtb45Y.mjs +0 -167
- package/lib/gemini-headers-Co9cVvex.mjs +0 -54
- package/lib/google-auth-qAN-6DMW.mjs +0 -232
- package/lib/google-gemini-cli-B2Aw1S5w.mjs +0 -844
- package/lib/google-lTxuq28n.mjs +0 -38
- package/lib/google-shared-Y01j9xOr.mjs +0 -856
- package/lib/google-validation-BEkNs-Bx.mjs +0 -18
- package/lib/google-vertex-DcM-FRC5.mjs +0 -99
- package/lib/hosts-00rjRzUD.mjs +0 -203
- package/lib/id-AL5obQzR.mjs +0 -71
- package/lib/idle-iterator-D0ZXEcUq.mjs +0 -366
- package/lib/ollama-6R0oXZks.mjs +0 -574
- package/lib/openai-codex-responses-C8bnBWOe.mjs +0 -3232
- package/lib/openai-completions-DNr3mUsn.mjs +0 -1430
- package/lib/openai-configuration-update-xMYUjaK_.mjs +0 -150
- package/lib/openai-reasoning-fallback-Ju-5pSR8.mjs +0 -380
- package/lib/openai-responses-CjpafAEr.mjs +0 -861
- package/lib/protobuf-BMgDYu_U.mjs +0 -717
- package/lib/provider-response-SqKSkkUc.mjs +0 -22
- package/lib/proxy-DxvCQOCA.mjs +0 -230
- package/lib/request-debug-BwPOqN_j.mjs +0 -183
- package/lib/sanitize-text-BCf5KmCf.mjs +0 -33
- package/lib/sse-debug-B-tkLCPW.mjs +0 -11
- package/lib/stream-markup-healing-CN3RsqG9.mjs +0 -267
- package/lib/strict-tool-validation-CBTz1dAA.mjs +0 -105
- package/lib/taxonomy-DSIM99rS.mjs +0 -15392
- package/lib/thinking-ngMwf_1Y.mjs +0 -336
- package/lib/type-guards-CttAANEx.mjs +0 -11
- package/lib/utils-CE3DSebh.mjs +0 -11763
- package/lib/vision-guard-BCpXWUj3.mjs +0 -77
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
3
|
+
import { b as AbortError } from "./error-8LVo7tug.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/utils/abort.ts
|
|
5
5
|
/**
|
|
6
6
|
* Tracks whether a merged request signal was aborted by the caller or by provider-local logic.
|
|
7
7
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
import { n as validateApiKeyAgainstModelsEndpoint, r as validateOpenAICompatibleApiKey } from "./api-key-validation-
|
|
5
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
3
|
+
import { _ as LoginCancelledError, g as ApiKeyRequiredError, t as ConfigurationError, y as OnPromptRequiredError } from "./error-8LVo7tug.mjs";
|
|
4
|
+
import { n as validateApiKeyAgainstModelsEndpoint, r as validateOpenAICompatibleApiKey } from "./api-key-validation-C_tZ7Y9a.mjs";
|
|
5
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/alibaba-coding-plan.ts
|
|
6
6
|
const DEFAULT_AUTH_URL = "https://modelstudio.console.alibabacloud.com/";
|
|
7
7
|
const CHINA_AUTH_URL = "https://bailian.console.aliyun.com/?tab=model#/api-key";
|
|
8
8
|
const DEFAULT_API_BASE_URL = "https://coding-intl.dashscope.aliyuncs.com/v1";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
3
|
+
import { _ as LoginCancelledError, g as ApiKeyRequiredError, t as ConfigurationError, y as OnPromptRequiredError } from "./error-8LVo7tug.mjs";
|
|
4
|
+
import { n as validateApiKeyAgainstModelsEndpoint } from "./api-key-validation-C_tZ7Y9a.mjs";
|
|
5
|
+
import { i as serializeAlibabaTokenPlanCredential, n as ALIBABA_TOKEN_PLAN_CN_BASE_URL, t as ALIBABA_TOKEN_PLAN_BASE_URL } from "./alibaba-token-plan-CUjYJX0-.mjs";
|
|
6
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/alibaba-token-plan.ts
|
|
7
7
|
const INTERNATIONAL_AUTH_URL = "https://home.qwencloud.com/billing/subscription/token-plan-individual";
|
|
8
8
|
const CHINA_AUTH_URL = "https://www.aliyun.com/benefit/scene/tokenplan";
|
|
9
9
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.
|
|
3
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.12.6/node_modules/@oh-my-pi/pi-catalog/src/wire/alibaba-token-plan.ts
|
|
4
4
|
/**
|
|
5
5
|
* International (Singapore) Token Plan endpoint. Default region; keys issued by
|
|
6
6
|
* the international product authenticate only here.
|
|
@@ -1,29 +1,57 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/providers/claude-code-fingerprint.ts
|
|
6
|
-
/**
|
|
7
|
-
* Claude Code inference-fingerprint constants, kept in a leaf module so consumers
|
|
8
|
-
* outside the provider (`registry/oauth/anthropic`, `usage/claude`) don't
|
|
9
|
-
* import the heavy `providers/anthropic` module.
|
|
10
|
-
*
|
|
11
|
-
* That import edge was a live init cycle: `providers/anthropic` → `stream` →
|
|
12
|
-
* `registry` → `registry/oauth/anthropic` → back into the still-initializing
|
|
13
|
-
* provider module.
|
|
14
|
-
*/
|
|
15
|
-
/** Current Claude Code CLI version represented on the Anthropic wire. */
|
|
16
|
-
const claudeCodeVersion = "2.1.257";
|
|
3
|
+
import { i as __exportAll } from "./fs-promises-shim-CANAxFWh.mjs";
|
|
4
|
+
import { X as ProviderHttpError, h as OAuthError } from "./error-8LVo7tug.mjs";
|
|
17
5
|
/** `@anthropic-ai/sdk` version bundled by the current Claude Code release. */
|
|
18
6
|
const claudeCodeSdkVersion = "0.112.1";
|
|
7
|
+
const SEMVER_PATTERN = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
8
|
+
const VERSION_TOO_OLD_CODE = "claude_code_version_too_old";
|
|
9
|
+
const REQUIRED_VERSION_PATTERN = /version (\d+\.\d+\.\d+) or newer is required/i;
|
|
10
|
+
let adoptedClaudeCodeVersion = null;
|
|
11
|
+
/**
|
|
12
|
+
* Claude Code CLI version represented on the Anthropic wire (User-Agent, billing
|
|
13
|
+
* header): `PI_AI_CLAUDE_CODE_VERSION` → version adopted from a server rejection
|
|
14
|
+
* (see {@link adoptRequiredClaudeCodeVersion}) → {@link DEFAULT_CLAUDE_CODE_VERSION}.
|
|
15
|
+
*/
|
|
16
|
+
function getClaudeCodeVersion() {
|
|
17
|
+
return process.env.PI_AI_CLAUDE_CODE_VERSION || adoptedClaudeCodeVersion || "2.1.280";
|
|
18
|
+
}
|
|
19
19
|
/** User-Agent emitted by Claude Code's CLI inference entrypoint. */
|
|
20
|
-
|
|
20
|
+
function getClaudeCodeUserAgent() {
|
|
21
|
+
return `claude-cli/${getClaudeCodeVersion()} (external, cli)`;
|
|
22
|
+
}
|
|
23
|
+
function compareSemver(a, b) {
|
|
24
|
+
const pa = SEMVER_PATTERN.exec(a);
|
|
25
|
+
const pb = SEMVER_PATTERN.exec(b);
|
|
26
|
+
if (!pa || !pb) return 0;
|
|
27
|
+
for (let i = 1; i <= 3; i++) {
|
|
28
|
+
const diff = Number(pa[i]) - Number(pb[i]);
|
|
29
|
+
if (diff !== 0) return diff;
|
|
30
|
+
}
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Adopts the minimum version named by an Anthropic `claude_code_version_too_old`
|
|
35
|
+
* rejection for the rest of the process, so the pinned fallback going stale costs
|
|
36
|
+
* one rejected request instead of a hard failure.
|
|
37
|
+
*
|
|
38
|
+
* Returns true only when the wire version actually increased — callers retry on
|
|
39
|
+
* true, so a repeated rejection at the same version cannot loop. Always false
|
|
40
|
+
* while `PI_AI_CLAUDE_CODE_VERSION` pins the version explicitly.
|
|
41
|
+
*/
|
|
42
|
+
function adoptRequiredClaudeCodeVersion(error) {
|
|
43
|
+
if (process.env.PI_AI_CLAUDE_CODE_VERSION) return false;
|
|
44
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
45
|
+
if (!message.includes(VERSION_TOO_OLD_CODE)) return false;
|
|
46
|
+
const required = REQUIRED_VERSION_PATTERN.exec(message)?.[1];
|
|
47
|
+
if (!required || compareSemver(required, getClaudeCodeVersion()) <= 0) return false;
|
|
48
|
+
adoptedClaudeCodeVersion = required;
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
21
51
|
/** Identity block prepended by Claude Code's CLI runtime. */
|
|
22
52
|
const claudeCodeSystemInstruction = "You are Claude Code, Anthropic's official CLI for Claude.";
|
|
23
|
-
/** Claude Code's per-request output-token ceiling. */
|
|
24
|
-
const CLAUDE_CODE_MAX_OUTPUT_TOKENS = 64e3;
|
|
25
53
|
//#endregion
|
|
26
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
54
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/anthropic.ts
|
|
27
55
|
/**
|
|
28
56
|
* Anthropic (Claude Pro/Max) sign-in residue. The OAuth flow itself is
|
|
29
57
|
* declared in `rules/auth/anthropic.kdl`; this module supplies the
|
|
@@ -38,7 +66,6 @@ var anthropic_exports = /* @__PURE__ */ __exportAll({
|
|
|
38
66
|
});
|
|
39
67
|
const BOOTSTRAP_URL = "https://api.anthropic.com/api/claude_cli/bootstrap";
|
|
40
68
|
const CLAUDE_CODE_BOOTSTRAP_MODEL = "claude-opus-4-8";
|
|
41
|
-
const CLAUDE_CODE_BOOTSTRAP_USER_AGENT = `claude-code/${claudeCodeVersion}`;
|
|
42
69
|
function nonEmpty(value) {
|
|
43
70
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
44
71
|
}
|
|
@@ -51,7 +78,7 @@ async function fetchAnthropicBootstrapIdentity(accessToken, fetchImpl) {
|
|
|
51
78
|
Accept: "application/json, text/plain, */*",
|
|
52
79
|
Authorization: `Bearer ${accessToken}`,
|
|
53
80
|
"Content-Type": "application/json",
|
|
54
|
-
"User-Agent":
|
|
81
|
+
"User-Agent": `claude-code/${getClaudeCodeVersion()}`,
|
|
55
82
|
"anthropic-beta": "oauth-2025-04-20"
|
|
56
83
|
},
|
|
57
84
|
signal: AbortSignal.timeout(3e4)
|
|
@@ -102,4 +129,4 @@ const anthropicIdentityHook = async (credentials, context) => {
|
|
|
102
129
|
}
|
|
103
130
|
};
|
|
104
131
|
//#endregion
|
|
105
|
-
export {
|
|
132
|
+
export { getClaudeCodeUserAgent as a, claudeCodeSystemInstruction as i, adoptRequiredClaudeCodeVersion as n, getClaudeCodeVersion as o, claudeCodeSdkVersion as r, anthropic_exports as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.
|
|
3
|
+
import { X as ProviderHttpError, Y as OpenAIHttpError } from "./error-8LVo7tug.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.12.6/node_modules/@oh-my-pi/pi-ai/src/registry/api-key-validation.ts
|
|
5
5
|
const VALIDATION_TIMEOUT_MS = 15e3;
|
|
6
6
|
function normalizeAnthropicCompatibleBaseUrl(baseUrl) {
|
|
7
7
|
const trimmed = baseUrl.trim().replace(/\/+$/, "");
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
|
+
__installBunShim();
|
|
3
|
+
import { a as behavior$1, t as globMatch } from "./cascade-BWjRTD1q.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.12.6/node_modules/@oh-my-pi/pi-catalog/src/compat/behavior.ts
|
|
5
|
+
/**
|
|
6
|
+
* Typed accessors over the compiled runtime-behavior vocabulary
|
|
7
|
+
* (`rules/runtime/behavior.kdl`): provider/model heuristics that run before
|
|
8
|
+
* or outside exact bundled-model lookup — responses routing, API routing,
|
|
9
|
+
* quota tiers, plan requirements, model limits, roster and discovery-mode
|
|
10
|
+
* exclusions, hosted defaults, pricing peers, and per-role default models.
|
|
11
|
+
*/
|
|
12
|
+
const behavior = behavior$1;
|
|
13
|
+
function matchesList(match, model, modelLower) {
|
|
14
|
+
if (match.exact?.some((candidate) => candidate === model)) return true;
|
|
15
|
+
if (match.prefix?.some((prefix) => model.startsWith(prefix))) return true;
|
|
16
|
+
if (match.substring?.some((sub) => model.includes(sub))) return true;
|
|
17
|
+
if (match.token !== void 0) {
|
|
18
|
+
const parts = modelLower.split(/[^a-z0-9]+/);
|
|
19
|
+
if (match.token.some((token) => parts.includes(token))) return true;
|
|
20
|
+
}
|
|
21
|
+
if (match.glob?.some((pattern) => globMatch(pattern, modelLower))) return true;
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Conservative heuristic for a normalized, lowercase discovered model id with
|
|
26
|
+
* no exact bundled record: whether it likely rides the OpenAI Responses API.
|
|
27
|
+
*/
|
|
28
|
+
function isLikelyOpenAIResponsesId(model) {
|
|
29
|
+
const rule = behavior.openaiResponsesHeuristic;
|
|
30
|
+
if (!rule) return false;
|
|
31
|
+
if (rule.excludePrefixes.some((prefix) => model.startsWith(prefix))) return false;
|
|
32
|
+
if (rule.excludeSubstrings.some((sub) => model.includes(sub))) return false;
|
|
33
|
+
return rule.includePrefixes.some((prefix) => model.startsWith(prefix));
|
|
34
|
+
}
|
|
35
|
+
/** Fixed Cursor `requestedModel` parameters declared for an exact wire model. */
|
|
36
|
+
function cursorModelParameters(model) {
|
|
37
|
+
return behavior.cursorParameters.filter((parameter) => parameter.model === model);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The catalog-declared quota scope or display tier for a provider model id.
|
|
41
|
+
* Exact authored memberships win; provider-authored substring fallbacks
|
|
42
|
+
* preserve quota semantics for newly discovered ids.
|
|
43
|
+
*/
|
|
44
|
+
function quotaTierFor(provider, model) {
|
|
45
|
+
const rule = behavior.quotaTiers.find((candidate) => candidate.provider === provider);
|
|
46
|
+
if (!rule) return void 0;
|
|
47
|
+
for (const tier of rule.tiers) if (tier.models.includes(model)) return tier.label;
|
|
48
|
+
for (const fallback of rule.fallbacks) if (model.includes(fallback.substring)) return fallback.label;
|
|
49
|
+
return rule.defaultTier;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolves the declared API route for a provider model id. Routes match in
|
|
53
|
+
* declaration order; a `strip-prefix` route with a prefix matcher strips the
|
|
54
|
+
* matched prefix off the wire id. Falls back to the node's `default` API.
|
|
55
|
+
*/
|
|
56
|
+
function apiRouteFor(provider, model) {
|
|
57
|
+
const table = behavior.apiRoutes.find((candidate) => candidate.provider === provider);
|
|
58
|
+
if (!table) return void 0;
|
|
59
|
+
const lower = model.toLowerCase();
|
|
60
|
+
for (const route of table.routes) {
|
|
61
|
+
if (!matchesList(route.match, model, lower)) continue;
|
|
62
|
+
const out = { api: route.api };
|
|
63
|
+
if (route.stripPrefix) {
|
|
64
|
+
const prefix = route.match.prefix?.find((candidate) => model.startsWith(candidate));
|
|
65
|
+
if (prefix) out.requestModelId = model.slice(prefix.length);
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
return table.default !== void 0 ? { api: table.default } : void 0;
|
|
70
|
+
}
|
|
71
|
+
/** Exact model ids named by a provider's api-routes rules (cache-migration drop lists). */
|
|
72
|
+
function apiRouteExactModelIds(provider) {
|
|
73
|
+
const table = behavior.apiRoutes.find((candidate) => candidate.provider === provider);
|
|
74
|
+
if (!table) return [];
|
|
75
|
+
const ids = [];
|
|
76
|
+
for (const route of table.routes) for (const id of route.match.exact ?? []) if (!ids.includes(id)) ids.push(id);
|
|
77
|
+
return ids;
|
|
78
|
+
}
|
|
79
|
+
/** Declared context-window / max-token pins for a provider model id. */
|
|
80
|
+
function modelLimitsFor(provider, model) {
|
|
81
|
+
for (const table of behavior.modelLimits) {
|
|
82
|
+
if (table.provider !== provider) continue;
|
|
83
|
+
const limit = table.limits.find((entry) => entry.model === model);
|
|
84
|
+
if (limit) {
|
|
85
|
+
const out = {};
|
|
86
|
+
if (limit.context !== void 0) out.context = limit.context;
|
|
87
|
+
if (limit.maxTokens !== void 0) out.maxTokens = limit.maxTokens;
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Whether a provider roster entry is a declared non-chat/unsupported SKU. */
|
|
93
|
+
function isExcludedModel(provider, model) {
|
|
94
|
+
const lower = model.toLowerCase();
|
|
95
|
+
return behavior.excludeModels.some((rule) => rule.provider === provider && matchesList(rule.match, lower, lower));
|
|
96
|
+
}
|
|
97
|
+
/** Whether an exact upstream discovery mode is excluded from a provider's coding-model roster. */
|
|
98
|
+
function isExcludedDiscoveryMode(provider, mode) {
|
|
99
|
+
return behavior.excludeDiscoveryModes.some((rule) => rule.provider === provider && rule.modes.includes(mode));
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Whether a provider's bundled rows may seed cross-provider bare-id enrichment
|
|
103
|
+
* references. Gateway-namespaced providers (ClinePass) are isolated so their
|
|
104
|
+
* limits, pricing, and reasoning controls never contaminate an unrelated proxy
|
|
105
|
+
* model that happens to advertise the same bare id.
|
|
106
|
+
*/
|
|
107
|
+
function isBareIdReferenceProvider(provider) {
|
|
108
|
+
return !behavior.referenceIsolatedProviders.includes(provider);
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { isExcludedDiscoveryMode as a, modelLimitsFor as c, isBareIdReferenceProvider as i, quotaTierFor as l, apiRouteFor as n, isExcludedModel as o, cursorModelParameters as r, isLikelyOpenAIResponsesId as s, apiRouteExactModelIds as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { t as ensureChromiumExecutable } from "./launch-
|
|
4
|
-
import { l as htmlToBasicMarkdown } from "./types-
|
|
3
|
+
import { t as ensureChromiumExecutable } from "./launch-DkAjib7h.mjs";
|
|
4
|
+
import { l as htmlToBasicMarkdown } from "./types-tH1v9uRm.mjs";
|
|
5
5
|
//#region src/tools/omp/browser/readable.ts
|
|
6
6
|
/** Trim to non-empty string or undefined. */
|
|
7
7
|
function normalize(text) {
|
|
@@ -9,12 +9,12 @@ function normalize(text) {
|
|
|
9
9
|
}
|
|
10
10
|
let readabilityModule;
|
|
11
11
|
async function loadReadability() {
|
|
12
|
-
if (!readabilityModule) readabilityModule = await import("./readability-
|
|
12
|
+
if (!readabilityModule) readabilityModule = await import("./readability-XHK0o3bv.mjs");
|
|
13
13
|
return readabilityModule;
|
|
14
14
|
}
|
|
15
15
|
let domModule;
|
|
16
16
|
async function loadDom() {
|
|
17
|
-
if (!domModule) domModule = await import("./dom-
|
|
17
|
+
if (!domModule) domModule = await import("./dom-BmbZv4v9.mjs");
|
|
18
18
|
return domModule;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import {
|
|
4
|
-
import { i as getModelLikeIdSegments, n as getBracketStrippedModelIdCandidates, r as getLongestModelLikeIdSegment } from "./id-
|
|
5
|
-
|
|
3
|
+
import { i as isBareIdReferenceProvider } from "./behavior-BwvTUtag.mjs";
|
|
4
|
+
import { A as withoutUnverifiedThinking, i as getModelLikeIdSegments, n as getBracketStrippedModelIdCandidates, r as getLongestModelLikeIdSegment } from "./id-EJwVLDHE.mjs";
|
|
5
|
+
import { d as collapseVocabulary, f as discoveryVocabulary } from "./pricing-DusBEhwm.mjs";
|
|
6
|
+
import { i as getBundledProviders, r as getBundledModels } from "./models-DCpDT_im.mjs";
|
|
7
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.12.6/node_modules/@oh-my-pi/pi-catalog/src/identity/reference.ts
|
|
6
8
|
/**
|
|
7
9
|
* Proxy/reseller reference lookup: given a custom model id served through a
|
|
8
10
|
* proxy (`[Kiro] claude-opus-4-8`, `gpt-5.4:cloud`, `vendor/claude-sonnet-4-6-thinking`),
|
|
@@ -111,4 +113,55 @@ function resolveModelReference(modelId, index) {
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
//#endregion
|
|
114
|
-
|
|
116
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-catalog@18.12.6/node_modules/@oh-my-pi/pi-catalog/src/provider-models/bundled-references.ts
|
|
117
|
+
/**
|
|
118
|
+
* Project a built `Model` back to spec stage: `compat` becomes the verbatim
|
|
119
|
+
* sparse override record (`compatConfig`), never the resolved view. Discovery
|
|
120
|
+
* mappers spread these references into the specs they hand to the model
|
|
121
|
+
* manager, which rebuilds via `buildModel`.
|
|
122
|
+
*/
|
|
123
|
+
function toModelSpec(model) {
|
|
124
|
+
const { compat: _compat, compatConfig, supportsComputerUse: _derivedComputerUse, supportsComputerUseConfig, ...rest } = model;
|
|
125
|
+
return withoutUnverifiedThinking({
|
|
126
|
+
...rest,
|
|
127
|
+
...supportsComputerUseConfig !== void 0 ? { supportsComputerUse: supportsComputerUseConfig } : {},
|
|
128
|
+
compat: compatConfig
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function createBundledReferenceMap(provider) {
|
|
132
|
+
const references = /* @__PURE__ */ new Map();
|
|
133
|
+
for (const model of getBundledModels(provider)) references.set(model.id, toModelSpec(model));
|
|
134
|
+
return references;
|
|
135
|
+
}
|
|
136
|
+
let globalReferences;
|
|
137
|
+
function getGlobalReferences() {
|
|
138
|
+
if (globalReferences) return globalReferences;
|
|
139
|
+
const references = /* @__PURE__ */ new Map();
|
|
140
|
+
for (const provider of getBundledProviders()) for (const model of getBundledModels(provider)) {
|
|
141
|
+
const candidate = model;
|
|
142
|
+
if (!isBareIdReferenceProvider(candidate.provider) || isZeroCostXaiOAuthReference(candidate)) continue;
|
|
143
|
+
const existing = references.get(candidate.id);
|
|
144
|
+
if (!existing) references.set(candidate.id, candidate);
|
|
145
|
+
else if (candidate.contextWindow !== existing.contextWindow) {
|
|
146
|
+
if ((candidate.contextWindow ?? 0) > (existing.contextWindow ?? 0)) references.set(candidate.id, candidate);
|
|
147
|
+
} else if (candidate.maxTokens !== existing.maxTokens) {
|
|
148
|
+
if ((candidate.maxTokens ?? 0) > (existing.maxTokens ?? 0)) references.set(candidate.id, candidate);
|
|
149
|
+
} else if (existing.provider !== "openai" && candidate.provider === "openai") references.set(candidate.id, candidate);
|
|
150
|
+
}
|
|
151
|
+
globalReferences = references;
|
|
152
|
+
return references;
|
|
153
|
+
}
|
|
154
|
+
function createReferenceResolver(providerReferenceSource) {
|
|
155
|
+
let lazyProviderReferences;
|
|
156
|
+
const getProviderReferences = typeof providerReferenceSource === "function" ? () => lazyProviderReferences ??= providerReferenceSource() : () => providerReferenceSource;
|
|
157
|
+
return (modelId) => {
|
|
158
|
+
const providerRefs = getProviderReferences();
|
|
159
|
+
const globalRefs = getGlobalReferences();
|
|
160
|
+
const providerRef = providerRefs.get(modelId);
|
|
161
|
+
if (providerRef) return providerRef;
|
|
162
|
+
const globalRef = globalRefs.get(modelId);
|
|
163
|
+
return globalRef ? toModelSpec(globalRef) : void 0;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
export { resolveModelReference as a, buildModelReferenceIndex as i, createReferenceResolver as n, toModelSpec as r, createBundledReferenceMap as t };
|