@shuind/dsh-codex-harness 0.2.9 → 0.2.10
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 +15 -1
- package/lib/types/activity.js +18 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { credentialRef } from "@deepseek-ai/dsh-credentials";
|
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
8
8
|
import { homedir } from "node:os";
|
|
9
|
-
import { isTokenDelta } from "@deepseek-ai/dsh-llm/message";
|
|
10
9
|
import { z as z$1 } from "zod";
|
|
11
10
|
import BasicCompactionEngine from "@deepseek-ai/dsh-compaction-basic";
|
|
12
11
|
//#region lib/types/patch.js
|
|
@@ -1107,6 +1106,21 @@ function remoteCompactStream(ctx, options, next, wireOptions = {}) {
|
|
|
1107
1106
|
//#endregion
|
|
1108
1107
|
//#region lib/types/activity.js
|
|
1109
1108
|
/** Host-side activity projection for the Codex status line. */
|
|
1109
|
+
/**
|
|
1110
|
+
* Whether a stream chunk carries visible model output.
|
|
1111
|
+
*
|
|
1112
|
+
* DSH 0.1.2 removed the runtime `isTokenDelta` helper from `dsh-llm/message`
|
|
1113
|
+
* while keeping the StreamChunk vocabulary unchanged. Keep this small
|
|
1114
|
+
* predicate local so the harness works with both the old and new DSH bundles.
|
|
1115
|
+
*/
|
|
1116
|
+
function isTokenDelta(chunk) {
|
|
1117
|
+
switch (chunk.type) {
|
|
1118
|
+
case "text-delta":
|
|
1119
|
+
case "reasoning-delta": return chunk.text !== "";
|
|
1120
|
+
case "tool-call-delta": return chunk.argumentsDelta !== "" || chunk.name !== void 0;
|
|
1121
|
+
default: return false;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1110
1124
|
/** Only a non-empty model delta starts the reply phase; usage and finish frames do not. */
|
|
1111
1125
|
function startsModelReply(event) {
|
|
1112
1126
|
if (event.type === "assistant/message") return true;
|
package/lib/types/activity.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
/** Host-side activity projection for the Codex status line. */
|
|
2
|
-
import { isTokenDelta } from '@deepseek-ai/dsh-llm/message';
|
|
3
2
|
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Whether a stream chunk carries visible model output.
|
|
5
|
+
*
|
|
6
|
+
* DSH 0.1.2 removed the runtime `isTokenDelta` helper from `dsh-llm/message`
|
|
7
|
+
* while keeping the StreamChunk vocabulary unchanged. Keep this small
|
|
8
|
+
* predicate local so the harness works with both the old and new DSH bundles.
|
|
9
|
+
*/
|
|
10
|
+
function isTokenDelta(chunk) {
|
|
11
|
+
switch (chunk.type) {
|
|
12
|
+
case 'text-delta':
|
|
13
|
+
case 'reasoning-delta':
|
|
14
|
+
return chunk.text !== '';
|
|
15
|
+
case 'tool-call-delta':
|
|
16
|
+
return chunk.argumentsDelta !== '' || chunk.name !== undefined;
|
|
17
|
+
default:
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
4
21
|
/** Only a non-empty model delta starts the reply phase; usage and finish frames do not. */
|
|
5
22
|
function startsModelReply(event) {
|
|
6
23
|
if (event.type === 'assistant/message')
|