@agentproto/runtime 2.12.0 → 3.1.0
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/command-allowlist.d.ts +38 -1
- package/dist/command-allowlist.mjs +25 -1
- package/dist/command-allowlist.mjs.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.mjs.map +1 -1
- package/dist/index.d.ts +289 -68
- package/dist/index.mjs +3051 -1472
- package/dist/index.mjs.map +1 -1
- package/dist/providers-store.d.ts +1 -0
- package/dist/resume-strategies.mjs +38 -1
- package/dist/resume-strategies.mjs.map +1 -1
- package/dist/session-presence.mjs.map +1 -1
- package/dist/tool-envelope.d.ts +1 -42
- package/dist/tool-envelope.mjs +1 -58
- package/dist/tool-envelope.mjs.map +1 -1
- package/package.json +36 -35
|
@@ -103,8 +103,11 @@ var init_pr_provenance = __esm({
|
|
|
103
103
|
"src/pr-provenance.ts"() {
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
+
function defaultTranscriptBaseDir() {
|
|
107
|
+
return join(homedir(), ".agentproto", "sessions");
|
|
108
|
+
}
|
|
106
109
|
function sessionTranscriptDir(sessionId, baseDir) {
|
|
107
|
-
return join(
|
|
110
|
+
return join(defaultTranscriptBaseDir(), sessionId);
|
|
108
111
|
}
|
|
109
112
|
function sessionEventsPath(sessionId, baseDir) {
|
|
110
113
|
return join(sessionTranscriptDir(sessionId), "events.jsonl");
|
|
@@ -613,6 +616,37 @@ Either the session never drove an agent-cli turn, or it predates this feature.`
|
|
|
613
616
|
}
|
|
614
617
|
const ts = Date.parse(rec.ts);
|
|
615
618
|
const tsOrUndefined = Number.isNaN(ts) ? void 0 : ts;
|
|
619
|
+
if (rec.kind === void 0 && typeof rec.command === "string" && typeof rec.exitCode === "number") {
|
|
620
|
+
flushAssistant();
|
|
621
|
+
const toolName = "command_execute";
|
|
622
|
+
const argsJson = JSON.stringify({
|
|
623
|
+
command: rec.command,
|
|
624
|
+
args: Array.isArray(rec.args) ? rec.args : [],
|
|
625
|
+
...rec.cwd !== void 0 ? { cwd: rec.cwd } : {}
|
|
626
|
+
});
|
|
627
|
+
messages.push({
|
|
628
|
+
role: "assistant",
|
|
629
|
+
toolCalls: [{ name: toolName, args: argsJson }],
|
|
630
|
+
...tsOrUndefined !== void 0 ? { ts: tsOrUndefined } : {}
|
|
631
|
+
});
|
|
632
|
+
const header = `exit code ${rec.exitCode}` + (rec.signal ? `, signal ${rec.signal}` : "") + (typeof rec.durationMs === "number" ? `, ${rec.durationMs}ms` : "");
|
|
633
|
+
const sections = [header];
|
|
634
|
+
if (rec.stdout) sections.push(`stdout:
|
|
635
|
+
${rec.stdout}`);
|
|
636
|
+
if (rec.stderr) sections.push(`stderr:
|
|
637
|
+
${rec.stderr}`);
|
|
638
|
+
if (rec.truncated) sections.push("(output truncated)");
|
|
639
|
+
if (rec.timedOut) sections.push("(timed out)");
|
|
640
|
+
const text = sections.join("\n");
|
|
641
|
+
messages.push({
|
|
642
|
+
role: "tool",
|
|
643
|
+
text: rec.exitCode !== 0 ? `[error] ${text}` : text,
|
|
644
|
+
toolName,
|
|
645
|
+
...tsOrUndefined !== void 0 ? { ts: tsOrUndefined } : {}
|
|
646
|
+
});
|
|
647
|
+
toolCallCount += 1;
|
|
648
|
+
continue;
|
|
649
|
+
}
|
|
616
650
|
switch (rec.kind) {
|
|
617
651
|
case "user-prompt":
|
|
618
652
|
flushAssistant();
|
|
@@ -682,6 +716,9 @@ Either the session never drove an agent-cli turn, or it predates this feature.`
|
|
|
682
716
|
flushAssistant();
|
|
683
717
|
const meta = { source: "daemon-events" };
|
|
684
718
|
if (desc?.label) meta.title = desc.label;
|
|
719
|
+
else if (desc?.command) {
|
|
720
|
+
meta.title = desc.command.length > 120 ? `${desc.command.slice(0, 120)}\u2026` : desc.command;
|
|
721
|
+
}
|
|
685
722
|
if (desc?.model) meta.model = desc.model;
|
|
686
723
|
if (desc?.startedAt) meta.startedAt = desc.startedAt;
|
|
687
724
|
if (desc?.endedAt) meta.endedAt = desc.endedAt;
|