@testchimp/cli 0.1.39 → 0.1.40
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/dist/chimphands/run.js +16 -0
- package/package.json +1 -1
package/dist/chimphands/run.js
CHANGED
|
@@ -11,6 +11,7 @@ import { URL } from "node:url";
|
|
|
11
11
|
import { getBackendUrl, requireApiKey } from "../core/client.js";
|
|
12
12
|
const ROLE_ASSISTANT = "CHIMPHANDS_MESSAGE_ROLE_ASSISTANT";
|
|
13
13
|
const ROLE_TOOL = "CHIMPHANDS_MESSAGE_ROLE_TOOL";
|
|
14
|
+
const ROLE_REASONING = "CHIMPHANDS_MESSAGE_ROLE_REASONING";
|
|
14
15
|
const ROLE_STATUS = "CHIMPHANDS_MESSAGE_ROLE_STATUS";
|
|
15
16
|
const STATUS_RUNNING = "CHIMPHANDS_SESSION_STATUS_RUNNING";
|
|
16
17
|
const STATUS_WAITING_USER = "CHIMPHANDS_SESSION_STATUS_WAITING_USER";
|
|
@@ -217,6 +218,21 @@ function runOpencode(prompt, model, childEnv, postEvent) {
|
|
|
217
218
|
postEvent(ROLE_ASSISTANT, next, undefined, opencodeMessageId("oc_text_", ev.part));
|
|
218
219
|
return;
|
|
219
220
|
}
|
|
221
|
+
case "reasoning": {
|
|
222
|
+
const chunk = ev.part?.text;
|
|
223
|
+
if (!chunk)
|
|
224
|
+
return;
|
|
225
|
+
const partId = ev.part?.id || ev.part?.messageID;
|
|
226
|
+
if (!partId) {
|
|
227
|
+
postEvent(ROLE_REASONING, chunk);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const reasoningKey = `reasoning:${partId}`;
|
|
231
|
+
const next = (textByPartId.get(reasoningKey) || "") + chunk;
|
|
232
|
+
textByPartId.set(reasoningKey, next);
|
|
233
|
+
postEvent(ROLE_REASONING, next, undefined, opencodeMessageId("oc_reasoning_", ev.part));
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
220
236
|
case "tool_use": {
|
|
221
237
|
if (ev.part?.state?.status !== "completed")
|
|
222
238
|
return;
|
package/package.json
CHANGED