jinzd-ai-cli 0.2.17 → 0.2.18
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.
|
@@ -1161,6 +1161,7 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1161
1161
|
timeout: request.timeout ?? this.defaultTimeout,
|
|
1162
1162
|
signal: request.signal
|
|
1163
1163
|
});
|
|
1164
|
+
let thinkingStarted = false;
|
|
1164
1165
|
for await (const chunk of stream) {
|
|
1165
1166
|
const choice = chunk.choices[0];
|
|
1166
1167
|
const done = choice?.finish_reason != null && choice.finish_reason !== "";
|
|
@@ -1175,7 +1176,20 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1175
1176
|
};
|
|
1176
1177
|
continue;
|
|
1177
1178
|
}
|
|
1179
|
+
const reasoningDelta = choice?.delta?.reasoning_content;
|
|
1180
|
+
if (reasoningDelta) {
|
|
1181
|
+
if (!thinkingStarted) {
|
|
1182
|
+
yield { delta: "<think>", done: false };
|
|
1183
|
+
thinkingStarted = true;
|
|
1184
|
+
}
|
|
1185
|
+
yield { delta: reasoningDelta, done: false };
|
|
1186
|
+
continue;
|
|
1187
|
+
}
|
|
1178
1188
|
const delta = choice?.delta?.content ?? "";
|
|
1189
|
+
if (thinkingStarted && delta) {
|
|
1190
|
+
thinkingStarted = false;
|
|
1191
|
+
yield { delta: "</think>", done: false };
|
|
1192
|
+
}
|
|
1179
1193
|
yield { delta, done };
|
|
1180
1194
|
}
|
|
1181
1195
|
} catch (err) {
|
|
@@ -1326,9 +1340,14 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1326
1340
|
});
|
|
1327
1341
|
const toolCallAccumulators = /* @__PURE__ */ new Map();
|
|
1328
1342
|
let toolCallsEnded = false;
|
|
1343
|
+
let thinkingStarted = false;
|
|
1329
1344
|
for await (const chunk of stream) {
|
|
1330
1345
|
const choice = chunk.choices[0];
|
|
1331
1346
|
if (!choice && chunk.usage) {
|
|
1347
|
+
if (thinkingStarted) {
|
|
1348
|
+
yield { type: "thinking_end" };
|
|
1349
|
+
thinkingStarted = false;
|
|
1350
|
+
}
|
|
1332
1351
|
if (!toolCallsEnded && toolCallAccumulators.size > 0) {
|
|
1333
1352
|
for (const [idx] of toolCallAccumulators) {
|
|
1334
1353
|
yield { type: "tool_call_end", index: idx };
|
|
@@ -1346,6 +1365,19 @@ var OpenAICompatibleProvider = class extends BaseProvider {
|
|
|
1346
1365
|
}
|
|
1347
1366
|
if (!choice) continue;
|
|
1348
1367
|
const delta = choice.delta;
|
|
1368
|
+
const reasoningDelta = delta?.reasoning_content;
|
|
1369
|
+
if (reasoningDelta) {
|
|
1370
|
+
if (!thinkingStarted) {
|
|
1371
|
+
yield { type: "thinking_start" };
|
|
1372
|
+
thinkingStarted = true;
|
|
1373
|
+
}
|
|
1374
|
+
yield { type: "thinking_delta", delta: reasoningDelta };
|
|
1375
|
+
continue;
|
|
1376
|
+
}
|
|
1377
|
+
if (thinkingStarted && (delta?.content || delta?.tool_calls)) {
|
|
1378
|
+
yield { type: "thinking_end" };
|
|
1379
|
+
thinkingStarted = false;
|
|
1380
|
+
}
|
|
1349
1381
|
if (delta?.content) {
|
|
1350
1382
|
yield { type: "text_delta", delta: delta.content };
|
|
1351
1383
|
}
|
|
@@ -1461,15 +1493,17 @@ var DeepSeekProvider = class extends OpenAICompatibleProvider {
|
|
|
1461
1493
|
models: [
|
|
1462
1494
|
{
|
|
1463
1495
|
id: "deepseek-chat",
|
|
1464
|
-
displayName: "DeepSeek Chat (V3)",
|
|
1496
|
+
displayName: "DeepSeek Chat (V3.2)",
|
|
1465
1497
|
contextWindow: 131072,
|
|
1466
|
-
supportsStreaming: true
|
|
1498
|
+
supportsStreaming: true,
|
|
1499
|
+
supportsThinking: true
|
|
1467
1500
|
},
|
|
1468
1501
|
{
|
|
1469
1502
|
id: "deepseek-reasoner",
|
|
1470
1503
|
displayName: "DeepSeek Reasoner (R1)",
|
|
1471
1504
|
contextWindow: 65536,
|
|
1472
|
-
supportsStreaming: true
|
|
1505
|
+
supportsStreaming: true,
|
|
1506
|
+
supportsThinking: true
|
|
1473
1507
|
}
|
|
1474
1508
|
]
|
|
1475
1509
|
};
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
theme,
|
|
36
36
|
truncateOutput,
|
|
37
37
|
undoStack
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LXBTSYBY.js";
|
|
39
39
|
import {
|
|
40
40
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
41
41
|
AUTHOR,
|
|
@@ -5507,7 +5507,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
5507
5507
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
5508
5508
|
process.exit(1);
|
|
5509
5509
|
}
|
|
5510
|
-
const { startWebServer } = await import("./server-
|
|
5510
|
+
const { startWebServer } = await import("./server-YQKOLA5A.js");
|
|
5511
5511
|
await startWebServer({ port, host: options.host });
|
|
5512
5512
|
});
|
|
5513
5513
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
|