File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import fs from "node:fs/promises" ;
22import readline from "node:readline" ;
33import { SessionManager } from "@mariozechner/pi-coding-agent" ;
4+ import type { AgentMessage } from "@mariozechner/pi-agent-core" ;
45import { normalizeReplyPayload } from "../../auto-reply/reply/normalize-reply.js" ;
56import type { ThinkLevel , VerboseLevel } from "../../auto-reply/thinking.js" ;
67import {
@@ -352,7 +353,7 @@ export function runAgentAttempt(params: {
352353 allowTransientCooldownProbe ?: boolean ;
353354 sessionHasHistory ?: boolean ;
354355 suppressPromptPersistenceOnRetry ?: boolean ;
355- onUserMessagePersisted ?: ( ) => void ;
356+ onUserMessagePersisted ?: ( message : Extract < AgentMessage , { role : "user" } > ) => void ;
356357} ) {
357358 const effectivePrompt = resolveFallbackRetryPrompt ( {
358359 body : params . body ,
Original file line number Diff line number Diff line change @@ -830,8 +830,8 @@ export async function runEmbeddedAttempt(
830830 allowSyntheticToolResults : transcriptPolicy . allowSyntheticToolResults ,
831831 allowedToolNames,
832832 suppressNextUserMessagePersistence : params . suppressNextUserMessagePersistence ,
833- onUserMessagePersisted : ( ) => {
834- params . onUserMessagePersisted ?.( ) ;
833+ onUserMessagePersisted : ( message ) => {
834+ params . onUserMessagePersisted ?.( message ) ;
835835 } ,
836836 } ) ;
837837 trackSessionManagerAccess ( params . sessionFile ) ;
Original file line number Diff line number Diff line change 1+ import type { AgentMessage } from "@mariozechner/pi-agent-core" ;
12import type { ImageContent } from "@mariozechner/pi-ai" ;
23import type { ReplyOperation } from "../../../auto-reply/reply/reply-run-registry.js" ;
34import type { ReasoningLevel , ThinkLevel , VerboseLevel } from "../../../auto-reply/thinking.js" ;
@@ -130,7 +131,7 @@ export type RunEmbeddedPiAgentParams = {
130131 */
131132 allowTransientCooldownProbe ?: boolean ;
132133 suppressNextUserMessagePersistence ?: boolean ;
133- onUserMessagePersisted ?: ( ) => void ;
134+ onUserMessagePersisted ?: ( message : Extract < AgentMessage , { role : "user" } > ) => void ;
134135 /**
135136 * Dispose bundled MCP runtimes when the overall run ends instead of preserving
136137 * the session-scoped cache. Intended for one-shot local CLI runs that must
You can’t perform that action at this time.
0 commit comments