@eddyskywalker/dsh-chatgpt-subscription 0.1.30 → 0.1.32
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/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as LlmModule from "@deepseek-ai/dsh-llm";
|
|
2
|
+
import { HarnessError, LlmAdapter, LlmError, ProviderRequestId, ReasoningEffortId, attributionHeaders, resolveRetryPolicy } from "@deepseek-ai/dsh-llm";
|
|
2
3
|
import { WebError } from "@deepseek-ai/dsh-web";
|
|
3
4
|
import { createUserMessage } from "@deepseek-ai/dsh-llm/message";
|
|
4
5
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
@@ -6,7 +7,7 @@ import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
|
6
7
|
import http from "node:http";
|
|
7
8
|
import { execSync, spawn } from "node:child_process";
|
|
8
9
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
9
|
-
import
|
|
10
|
+
import * as SettingsModule from "@deepseek-ai/dsh-settings";
|
|
10
11
|
import z from "@deepseek-ai/schemastery";
|
|
11
12
|
import { constants } from "node:fs";
|
|
12
13
|
import { chmod, lstat, mkdir, open, rename, stat, unlink } from "node:fs/promises";
|
|
@@ -1326,7 +1327,8 @@ function isProxyMode(value) {
|
|
|
1326
1327
|
//#endregion
|
|
1327
1328
|
//#region src/host/preferences.ts
|
|
1328
1329
|
function registerPreferenceStore(settings) {
|
|
1329
|
-
|
|
1330
|
+
const registerFn = settings.register;
|
|
1331
|
+
return new SettingsPreferenceStore(registerFn(SettingsModule.settingsNamespace ? SettingsModule.settingsNamespace(PREFERENCES_NAMESPACE) : PREFERENCES_NAMESPACE, z.object({
|
|
1330
1332
|
quickQuotaVisible: z.boolean().default(DEFAULT_PREFERENCES.quickQuotaVisible),
|
|
1331
1333
|
fastMode: z.boolean().default(DEFAULT_PREFERENCES.fastMode),
|
|
1332
1334
|
outputVerbosity: z.union([
|
|
@@ -1823,6 +1825,10 @@ function record$2(value) {
|
|
|
1823
1825
|
}
|
|
1824
1826
|
//#endregion
|
|
1825
1827
|
//#region src/host/responses-client.ts
|
|
1828
|
+
const toToolCallId = (id) => {
|
|
1829
|
+
const mod = LlmModule;
|
|
1830
|
+
return (mod.ToolCallId ?? mod.CallId ?? ((x) => x))(id);
|
|
1831
|
+
};
|
|
1826
1832
|
const MAX_VISIBLE_REASONING_CHARS = 12e3;
|
|
1827
1833
|
const REASONING_DELTA_FLUSH_CHARS = 768;
|
|
1828
1834
|
const REASONING_TRUNCATED_NOTICE = "\n\n[Reasoning summary truncated to keep the DSH web UI responsive.]";
|
|
@@ -1984,7 +1990,7 @@ async function* parseResponsesStream(response, signal, hiddenSandboxControls = /
|
|
|
1984
1990
|
yield {
|
|
1985
1991
|
type: "tool-call-delta",
|
|
1986
1992
|
index: tool.index,
|
|
1987
|
-
id:
|
|
1993
|
+
id: toToolCallId(tool.id),
|
|
1988
1994
|
name: tool.name || void 0,
|
|
1989
1995
|
argumentsDelta: initial
|
|
1990
1996
|
};
|
|
@@ -2007,7 +2013,7 @@ async function* parseResponsesStream(response, signal, hiddenSandboxControls = /
|
|
|
2007
2013
|
yield {
|
|
2008
2014
|
type: "tool-call-delta",
|
|
2009
2015
|
index: tool.index,
|
|
2010
|
-
id:
|
|
2016
|
+
id: toToolCallId(tool.id),
|
|
2011
2017
|
name: tool.name || void 0,
|
|
2012
2018
|
argumentsDelta: delta
|
|
2013
2019
|
};
|
|
@@ -2107,7 +2113,7 @@ async function* parseResponsesStream(response, signal, hiddenSandboxControls = /
|
|
|
2107
2113
|
index: tool.index,
|
|
2108
2114
|
block: {
|
|
2109
2115
|
type: "tool-call",
|
|
2110
|
-
id:
|
|
2116
|
+
id: toToolCallId(tool.id),
|
|
2111
2117
|
name: tool.name,
|
|
2112
2118
|
arguments: tool.arguments
|
|
2113
2119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/host/preferences.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/host/preferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAsB,MAAM,2BAA2B,CAAA;AAcrF,OAAO,KAAK,EACV,0BAA0B,EAC1B,gCAAgC,EACjC,MAAM,wBAAwB,CAAA;AAE/B,MAAM,WAAW,2BAA2B;IAC1C,MAAM,IAAI,0BAA0B,CAAA;IACpC,MAAM,CAAC,KAAK,EAAE,gCAAgC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;IACpF,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,0BAA0B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAA;CAC1H;AAID,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,2BAA2B,CAyB/F;AA+DD,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAG5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses-client.d.ts","sourceRoot":"","sources":["../../../src/host/responses-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"responses-client.d.ts","sourceRoot":"","sources":["../../../src/host/responses-client.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEjB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAwD,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEvH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;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