@akagilnc/pi-workflow-roles 0.1.3280 → 0.1.3287
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/public-cli/main.js +6 -3
- package/package.json +1 -1
- package/src/diarist-mechanical.ts +16 -5
package/dist/public-cli/main.js
CHANGED
|
@@ -27444,8 +27444,11 @@ function readCcSessionBlocks(options) {
|
|
|
27444
27444
|
}
|
|
27445
27445
|
if (!isRecord15(parsed)) continue;
|
|
27446
27446
|
const type = typeof parsed.type === "string" ? parsed.type : "";
|
|
27447
|
-
|
|
27448
|
-
|
|
27447
|
+
const queuedCommand = type === "attachment" && isRecord15(parsed.attachment) && parsed.attachment.type === "queued_command" && isRecord15(parsed.attachment.origin) && parsed.attachment.origin.kind === "human" && typeof parsed.attachment.prompt === "string" ? parsed.attachment.prompt : void 0;
|
|
27448
|
+
if (type !== "user" && type !== "assistant" && queuedCommand === void 0) {
|
|
27449
|
+
continue;
|
|
27450
|
+
}
|
|
27451
|
+
const transcript = queuedCommand ?? messageText(parsed.message ?? parsed);
|
|
27449
27452
|
if (transcript.trim() === "") continue;
|
|
27450
27453
|
const entryId = typeof parsed.uuid === "string" ? parsed.uuid : typeof parsed.id === "string" ? parsed.id : `${basename7(sessionFile)}:${lineNo + 1}`;
|
|
27451
27454
|
const timestamp2 = typeof parsed.timestamp === "string" ? parsed.timestamp : (/* @__PURE__ */ new Date(0)).toISOString();
|
|
@@ -27455,7 +27458,7 @@ function readCcSessionBlocks(options) {
|
|
|
27455
27458
|
sourceRef: { sessionFile, entryId },
|
|
27456
27459
|
transcript,
|
|
27457
27460
|
timestamp: timestamp2,
|
|
27458
|
-
isUserTurn: type === "user",
|
|
27461
|
+
isUserTurn: type === "user" || queuedCommand !== void 0,
|
|
27459
27462
|
isNotification: notification
|
|
27460
27463
|
});
|
|
27461
27464
|
}
|
package/package.json
CHANGED
|
@@ -223,7 +223,7 @@ function isNotificationRow(type: string, text: string): boolean {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* Enumerate cc session user/assistant turns under Claude projects roots.
|
|
226
|
+
* Enumerate cc session user/assistant turns and human queued-command attachments under Claude projects roots.
|
|
227
227
|
* cc-sessions-first source family (ADR 0075).
|
|
228
228
|
* Directory/file/non-empty JSONL line failures throw DiaristSourceReadError
|
|
229
229
|
* (失败诚实:不得把未读懂洗成没有来源块).
|
|
@@ -301,11 +301,22 @@ export function readCcSessionBlocks(
|
|
|
301
301
|
{ cause: error },
|
|
302
302
|
);
|
|
303
303
|
}
|
|
304
|
-
// Unknown row shape (not user/assistant) is ignored — not a read failure.
|
|
304
|
+
// Unknown row shape (not user/assistant or a human queued-command attachment) is ignored — not a read failure.
|
|
305
305
|
if (!isRecord(parsed)) continue;
|
|
306
306
|
const type = typeof parsed.type === "string" ? parsed.type : "";
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
const queuedCommand =
|
|
308
|
+
type === "attachment" &&
|
|
309
|
+
isRecord(parsed.attachment) &&
|
|
310
|
+
parsed.attachment.type === "queued_command" &&
|
|
311
|
+
isRecord(parsed.attachment.origin) &&
|
|
312
|
+
parsed.attachment.origin.kind === "human" &&
|
|
313
|
+
typeof parsed.attachment.prompt === "string"
|
|
314
|
+
? parsed.attachment.prompt
|
|
315
|
+
: undefined;
|
|
316
|
+
if (type !== "user" && type !== "assistant" && queuedCommand === undefined) {
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
const transcript = queuedCommand ?? messageText(parsed.message ?? parsed);
|
|
309
320
|
if (transcript.trim() === "") continue;
|
|
310
321
|
const entryId =
|
|
311
322
|
typeof parsed.uuid === "string"
|
|
@@ -323,7 +334,7 @@ export function readCcSessionBlocks(
|
|
|
323
334
|
sourceRef: { sessionFile, entryId },
|
|
324
335
|
transcript,
|
|
325
336
|
timestamp,
|
|
326
|
-
isUserTurn: type === "user",
|
|
337
|
+
isUserTurn: type === "user" || queuedCommand !== undefined,
|
|
327
338
|
isNotification: notification,
|
|
328
339
|
});
|
|
329
340
|
}
|