@tekyzinc/gsd-t 3.10.13 → 3.10.15
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/CHANGELOG.md +32 -0
- package/bin/gsd-t-unattended-platform.cjs +381 -0
- package/bin/gsd-t-unattended-safety.cjs +766 -0
- package/bin/gsd-t-unattended.cjs +1259 -0
- package/bin/gsd-t.js +7 -1
- package/bin/handoff-lock.cjs +249 -0
- package/bin/headless-auto-spawn.cjs +328 -0
- package/bin/runway-estimator.cjs +242 -0
- package/bin/token-optimizer.cjs +471 -0
- package/bin/token-telemetry.cjs +246 -0
- package/commands/gsd-t-backlog-list.md +2 -2
- package/commands/gsd-t-complete-milestone.md +1 -1
- package/commands/gsd-t-debug.md +5 -5
- package/commands/gsd-t-doc-ripple.md +1 -1
- package/commands/gsd-t-execute.md +3 -3
- package/commands/gsd-t-integrate.md +3 -3
- package/commands/gsd-t-optimization-apply.md +3 -3
- package/commands/gsd-t-optimization-reject.md +3 -3
- package/commands/gsd-t-quick.md +3 -3
- package/commands/gsd-t-resume.md +1 -1
- package/commands/gsd-t-status.md +1 -1
- package/commands/gsd-t-unattended.md +2 -2
- package/commands/gsd-t-wave.md +3 -3
- package/package.json +1 -1
- package/scripts/context-meter/transcript-parser.js +63 -1
- package/scripts/context-meter/transcript-parser.test.js +53 -3
|
@@ -176,6 +176,15 @@ test("tool_use / tool_result pairing by tool_use_id preserved in order", async (
|
|
|
176
176
|
|
|
177
177
|
test("tool_result with array content (text blocks) is normalized", async () => {
|
|
178
178
|
const { dir, file } = mkTmpFile([
|
|
179
|
+
{
|
|
180
|
+
type: "assistant",
|
|
181
|
+
message: {
|
|
182
|
+
role: "assistant",
|
|
183
|
+
content: [
|
|
184
|
+
{ type: "tool_use", id: "toolu_02", name: "Read", input: { file_path: "/tmp/x" } },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
},
|
|
179
188
|
{
|
|
180
189
|
type: "user",
|
|
181
190
|
message: {
|
|
@@ -196,8 +205,8 @@ test("tool_result with array content (text blocks) is normalized", async () => {
|
|
|
196
205
|
]);
|
|
197
206
|
try {
|
|
198
207
|
const got = await parseTranscript(file);
|
|
199
|
-
|
|
200
|
-
const tr =
|
|
208
|
+
const userMsg = got.messages.find(m => m.role === "user");
|
|
209
|
+
const tr = userMsg.content[0];
|
|
201
210
|
assert.equal(tr.type, "tool_result");
|
|
202
211
|
assert.deepEqual(tr.content, [
|
|
203
212
|
{ type: "text", text: "line 1" },
|
|
@@ -210,6 +219,15 @@ test("tool_result with array content (text blocks) is normalized", async () => {
|
|
|
210
219
|
|
|
211
220
|
test("tool_result with is_error:true preserved", async () => {
|
|
212
221
|
const { dir, file } = mkTmpFile([
|
|
222
|
+
{
|
|
223
|
+
type: "assistant",
|
|
224
|
+
message: {
|
|
225
|
+
role: "assistant",
|
|
226
|
+
content: [
|
|
227
|
+
{ type: "tool_use", id: "toolu_03", name: "Bash", input: { command: "false" } },
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
213
231
|
{
|
|
214
232
|
type: "user",
|
|
215
233
|
message: {
|
|
@@ -222,7 +240,8 @@ test("tool_result with is_error:true preserved", async () => {
|
|
|
222
240
|
]);
|
|
223
241
|
try {
|
|
224
242
|
const got = await parseTranscript(file);
|
|
225
|
-
|
|
243
|
+
const userMsg = got.messages.find(m => m.role === "user");
|
|
244
|
+
assert.equal(userMsg.content[0].is_error, true);
|
|
226
245
|
} finally {
|
|
227
246
|
cleanup(dir);
|
|
228
247
|
}
|
|
@@ -318,3 +337,34 @@ test("message with content array but no recognized blocks → message skipped",
|
|
|
318
337
|
cleanup(dir);
|
|
319
338
|
}
|
|
320
339
|
});
|
|
340
|
+
|
|
341
|
+
test("orphaned tool_use without matching tool_result is stripped", async () => {
|
|
342
|
+
const { dir, file } = mkTmpFile([
|
|
343
|
+
{ type: "user", message: { role: "user", content: "hello" } },
|
|
344
|
+
{
|
|
345
|
+
type: "assistant",
|
|
346
|
+
message: {
|
|
347
|
+
role: "assistant",
|
|
348
|
+
content: [
|
|
349
|
+
{ type: "text", text: "I will read a file" },
|
|
350
|
+
{ type: "tool_use", id: "toolu_orphan", name: "Read", input: { file_path: "/tmp/x" } },
|
|
351
|
+
],
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
{ type: "user", message: { role: "user", content: "thanks" } },
|
|
355
|
+
]);
|
|
356
|
+
try {
|
|
357
|
+
const got = await parseTranscript(file);
|
|
358
|
+
const assistantMsg = got.messages.find(
|
|
359
|
+
(m) => m.role === "assistant" && m.content.some((b) => b.type === "text")
|
|
360
|
+
);
|
|
361
|
+
assert.ok(assistantMsg, "assistant message preserved");
|
|
362
|
+
assert.ok(
|
|
363
|
+
!assistantMsg.content.some((b) => b.type === "tool_use"),
|
|
364
|
+
"orphaned tool_use stripped"
|
|
365
|
+
);
|
|
366
|
+
assert.equal(assistantMsg.content[0].text, "I will read a file");
|
|
367
|
+
} finally {
|
|
368
|
+
cleanup(dir);
|
|
369
|
+
}
|
|
370
|
+
});
|