@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.
- package/README.md +1 -1
- 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-CE_qK1yk.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-APrc-TBB.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 +43 -41
- package/presets/package.json +1 -1
- package/presets/tool-plus-ptc/agent.cordis.yml +13 -4
- package/presets/tool-plus-standard/agent.cordis.yml +11 -3
- 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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
|
+
__installBunShim();
|
|
3
|
+
import { f as OAuthError, m as LoginCancelledError } from "./error-CORgGg5a.mjs";
|
|
4
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/kilo.ts
|
|
5
|
+
const KILO_DEVICE_AUTH_BASE_URL = "https://api.kilo.ai/api/device-auth";
|
|
6
|
+
const POLL_INTERVAL_MS = 5e3;
|
|
7
|
+
const ONE_YEAR_MS = 31536e6;
|
|
8
|
+
async function loginKilo(callbacks) {
|
|
9
|
+
const fetchImpl = callbacks.fetch ?? fetch;
|
|
10
|
+
const initiateResponse = await fetchImpl(`${KILO_DEVICE_AUTH_BASE_URL}/codes`, {
|
|
11
|
+
method: "POST",
|
|
12
|
+
headers: { "Content-Type": "application/json" }
|
|
13
|
+
});
|
|
14
|
+
if (!initiateResponse.ok) {
|
|
15
|
+
if (initiateResponse.status === 429) throw new OAuthError("Too many pending authorization requests. Please try again later.", {
|
|
16
|
+
kind: "polling",
|
|
17
|
+
provider: "kilo",
|
|
18
|
+
status: initiateResponse.status
|
|
19
|
+
});
|
|
20
|
+
throw new OAuthError(`Failed to initiate device authorization: ${initiateResponse.status}`, {
|
|
21
|
+
kind: "device-auth",
|
|
22
|
+
provider: "kilo",
|
|
23
|
+
status: initiateResponse.status
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const initiateData = await initiateResponse.json();
|
|
27
|
+
const userCode = initiateData.code;
|
|
28
|
+
const verificationUrl = initiateData.verificationUrl;
|
|
29
|
+
const expiresInSeconds = initiateData.expiresIn;
|
|
30
|
+
if (!userCode || !verificationUrl || typeof expiresInSeconds !== "number" || expiresInSeconds <= 0) throw new OAuthError("Kilo device authorization response missing required fields", {
|
|
31
|
+
kind: "validation",
|
|
32
|
+
provider: "kilo"
|
|
33
|
+
});
|
|
34
|
+
callbacks.onAuth?.({
|
|
35
|
+
url: verificationUrl,
|
|
36
|
+
instructions: `Enter code: ${userCode}`
|
|
37
|
+
});
|
|
38
|
+
const deadline = Date.now() + expiresInSeconds * 1e3;
|
|
39
|
+
while (Date.now() < deadline) {
|
|
40
|
+
if (callbacks.signal?.aborted) throw new LoginCancelledError();
|
|
41
|
+
const pollResponse = await fetchImpl(`${KILO_DEVICE_AUTH_BASE_URL}/codes/${encodeURIComponent(userCode)}`);
|
|
42
|
+
if (pollResponse.status === 202) {
|
|
43
|
+
await Bun.sleep(POLL_INTERVAL_MS);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (pollResponse.status === 403) throw new OAuthError("Authorization was denied", {
|
|
47
|
+
kind: "device-auth",
|
|
48
|
+
provider: "kilo"
|
|
49
|
+
});
|
|
50
|
+
if (pollResponse.status === 410) throw new OAuthError("Authorization code expired. Please try again.", {
|
|
51
|
+
kind: "device-auth",
|
|
52
|
+
provider: "kilo"
|
|
53
|
+
});
|
|
54
|
+
if (!pollResponse.ok) throw new OAuthError(`Failed to poll device authorization: ${pollResponse.status}`, {
|
|
55
|
+
kind: "polling",
|
|
56
|
+
provider: "kilo",
|
|
57
|
+
status: pollResponse.status
|
|
58
|
+
});
|
|
59
|
+
const pollData = await pollResponse.json();
|
|
60
|
+
if (pollData.status === "approved" && pollData.token) return {
|
|
61
|
+
refresh: "",
|
|
62
|
+
access: pollData.token,
|
|
63
|
+
expires: Date.now() + ONE_YEAR_MS
|
|
64
|
+
};
|
|
65
|
+
if (pollData.status === "denied") throw new OAuthError("Authorization was denied", {
|
|
66
|
+
kind: "device-auth",
|
|
67
|
+
provider: "kilo"
|
|
68
|
+
});
|
|
69
|
+
if (pollData.status === "expired") throw new OAuthError("Authorization code expired. Please try again.", {
|
|
70
|
+
kind: "device-auth",
|
|
71
|
+
provider: "kilo"
|
|
72
|
+
});
|
|
73
|
+
await Bun.sleep(POLL_INTERVAL_MS);
|
|
74
|
+
}
|
|
75
|
+
throw new OAuthError("Authentication timed out. Please try again.", {
|
|
76
|
+
kind: "timeout",
|
|
77
|
+
provider: "kilo"
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { loginKilo };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
|
+
__installBunShim();
|
|
3
|
+
import { r as __exportAll } from "./fs-promises-shim-Bx0fpxuk.mjs";
|
|
4
|
+
import { H as getAgentDir } from "./src-BwW51vA5.mjs";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
import * as path from "node:path";
|
|
7
|
+
import * as os from "node:os";
|
|
8
|
+
import * as crypto from "node:crypto";
|
|
9
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/package.json
|
|
10
|
+
var version = "18.1.17";
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region node_modules/.pnpm/@oh-my-pi+pi-ai@18.1.17/node_modules/@oh-my-pi/pi-ai/src/registry/oauth/kimi.ts
|
|
13
|
+
/**
|
|
14
|
+
* Kimi Code OAuth flow (device authorization grant)
|
|
15
|
+
*/
|
|
16
|
+
var kimi_exports = /* @__PURE__ */ __exportAll({ getKimiCommonHeaders: () => getKimiCommonHeaders });
|
|
17
|
+
const DEVICE_ID_FILENAME = "kimi-device-id";
|
|
18
|
+
function formatDeviceModel(system, release, arch) {
|
|
19
|
+
return [
|
|
20
|
+
system,
|
|
21
|
+
release,
|
|
22
|
+
arch
|
|
23
|
+
].filter(Boolean).join(" ").trim();
|
|
24
|
+
}
|
|
25
|
+
function getDeviceModel() {
|
|
26
|
+
const platform = os.platform();
|
|
27
|
+
const release = os.release();
|
|
28
|
+
const arch = os.arch();
|
|
29
|
+
if (platform === "darwin") return formatDeviceModel("macOS", release, arch);
|
|
30
|
+
if (platform === "win32") return formatDeviceModel("Windows", release, arch);
|
|
31
|
+
return formatDeviceModel(platform === "linux" ? "Linux" : platform, release, arch);
|
|
32
|
+
}
|
|
33
|
+
let getDeviceId = () => {
|
|
34
|
+
const deviceIdPath = path.join(getAgentDir(), DEVICE_ID_FILENAME);
|
|
35
|
+
try {
|
|
36
|
+
const existing = fs.readFileSync(deviceIdPath, "utf-8").trim();
|
|
37
|
+
if (existing) {
|
|
38
|
+
getDeviceId = () => existing;
|
|
39
|
+
return existing;
|
|
40
|
+
}
|
|
41
|
+
} catch {}
|
|
42
|
+
const deviceId = crypto.randomUUID().replace(/-/g, "");
|
|
43
|
+
try {
|
|
44
|
+
fs.mkdirSync(path.dirname(deviceIdPath), { recursive: true });
|
|
45
|
+
fs.writeFileSync(deviceIdPath, `${deviceId}\n`, { mode: 384 });
|
|
46
|
+
} catch {}
|
|
47
|
+
getDeviceId = () => deviceId;
|
|
48
|
+
return deviceId;
|
|
49
|
+
};
|
|
50
|
+
function sanitizeHeaderValue(value, fallback = "") {
|
|
51
|
+
return value.replace(/[^\x20-\x7E]/g, "").trim() || fallback;
|
|
52
|
+
}
|
|
53
|
+
let getKimiCommonHeaders = () => {
|
|
54
|
+
const headers = Object.freeze({
|
|
55
|
+
"User-Agent": `KimiCLI/${version}`,
|
|
56
|
+
"X-Msh-Platform": "kimi_cli",
|
|
57
|
+
"X-Msh-Version": version,
|
|
58
|
+
"X-Msh-Device-Name": sanitizeHeaderValue(os.hostname(), "unknown"),
|
|
59
|
+
"X-Msh-Device-Model": sanitizeHeaderValue(getDeviceModel(), "unknown"),
|
|
60
|
+
"X-Msh-Os-Version": sanitizeHeaderValue(os.version(), "unknown"),
|
|
61
|
+
"X-Msh-Device-Id": sanitizeHeaderValue(getDeviceId(), "unknown")
|
|
62
|
+
});
|
|
63
|
+
getKimiCommonHeaders = () => headers;
|
|
64
|
+
return headers;
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { kimi_exports as n, getKimiCommonHeaders as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { installBunShim as __installBunShim } from "./bun-shim.mjs";
|
|
2
2
|
__installBunShim();
|
|
3
|
-
import { d as $which, l as exec } from "./src-
|
|
3
|
+
import { d as $which, l as exec } from "./src-BwW51vA5.mjs";
|
|
4
4
|
import * as fs from "node:fs";
|
|
5
5
|
import * as path from "node:path";
|
|
6
6
|
import * as os from "node:os";
|