Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(provider-kiro): add Kiro as an ACP provider #14693

Mergedjuliusmarmingemerged 60 commits intomain fromrefs/pull/14693/headmerged by juliusmarminge View on GitHub

Showing 84 changed files with 25 additions and 2 deletions (loading 82).

x
0 of 84 viewed, 84 left
25 additions and 2 deletionsapps/server/scripts/acp-replay-agent.tsModified
View file
@@ -50,7 +50,27 @@
? Buffer.from(encodedTranscript ?? "", "base64").toString("utf8")
: NodeFS.readFileSync(transcriptPath, "utf8"),
) as ReplayTranscript;
-let cursor = 0;
+/**
+ * A recording can span processes: a `runtime_exit` mid-transcript marks where
+ * one agent process ended, and a respawned replay agent continues from the
+ * cursor the previous one left in the status file.
+ */
+function resumedCursor(): number {
+ try {
+ const previous = JSON.parse(NodeFS.readFileSync(statusPath ?? "", "utf8")) as {
+ readonly cursor?: unknown;
+ readonly failure?: unknown;
+ };
+ const resumeAt = typeof previous.cursor === "number" ? previous.cursor : 0;
+ return previous.failure === undefined &&
+ transcript.entries[resumeAt - 1]?.type === "runtime_exit"
+ ? resumeAt
+ : 0;
+ } catch {
+ return 0;
+ }
+}
+let cursor = resumedCursor();
let stopped = false;
let nextAgentRequestId = 1;
const pendingClientRequestIds = new Map<string, string | number>();