agentrace 0.0.6 → 0.0.7
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/commands/send.js +24 -0
- package/dist/utils/http.d.ts +4 -0
- package/package.json +1 -1
package/dist/commands/send.js
CHANGED
|
@@ -69,6 +69,25 @@ async function sendTranscript(params) {
|
|
|
69
69
|
}
|
|
70
70
|
process.exit(0);
|
|
71
71
|
}
|
|
72
|
+
// Detect subagent (Task tool) sessions from first transcript line
|
|
73
|
+
const firstLine = transcriptLines[0];
|
|
74
|
+
const isSidechain = firstLine?.isSidechain === true;
|
|
75
|
+
const agentId = typeof firstLine?.agentId === "string" ? firstLine.agentId : undefined;
|
|
76
|
+
// For subagents, sessionId in transcript is the parent session ID
|
|
77
|
+
const parentSessionId = isSidechain && typeof firstLine?.sessionId === "string"
|
|
78
|
+
? firstLine.sessionId
|
|
79
|
+
: undefined;
|
|
80
|
+
// Generate title for subagents from first user message
|
|
81
|
+
let subagentTitle;
|
|
82
|
+
if (isSidechain) {
|
|
83
|
+
const firstUserMsg = transcriptLines.find((line) => typeof line === "object" &&
|
|
84
|
+
line !== null &&
|
|
85
|
+
line.type === "user");
|
|
86
|
+
if (firstUserMsg?.message && typeof firstUserMsg.message?.content === "string") {
|
|
87
|
+
const content = firstUserMsg.message.content;
|
|
88
|
+
subagentTitle = content.slice(0, 100) + (content.length > 100 ? "..." : "");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
72
91
|
// Extract git info only on first send (when cursor doesn't exist yet)
|
|
73
92
|
let gitRemoteUrl;
|
|
74
93
|
let gitBranch;
|
|
@@ -83,6 +102,11 @@ async function sendTranscript(params) {
|
|
|
83
102
|
cwd: cwd,
|
|
84
103
|
git_remote_url: gitRemoteUrl,
|
|
85
104
|
git_branch: gitBranch,
|
|
105
|
+
// Subagent fields
|
|
106
|
+
parent_session_id: parentSessionId,
|
|
107
|
+
agent_id: agentId,
|
|
108
|
+
is_sidechain: isSidechain || undefined,
|
|
109
|
+
title: subagentTitle,
|
|
86
110
|
});
|
|
87
111
|
if (result.ok) {
|
|
88
112
|
// Update cursor on success
|
package/dist/utils/http.d.ts
CHANGED