11import type { ContentBlock } from "@agentclientprotocol/sdk" ;
22import { Saga } from "@posthog/shared" ;
3- import { type CodexGoalState , POSTHOG_NOTIFICATIONS } from "../acp-extensions" ;
3+ import { type NativeGoalState , POSTHOG_NOTIFICATIONS } from "../acp-extensions" ;
44import type { PostHogAPIClient } from "../posthog-api" ;
55import type {
66 DeviceInfo ,
@@ -37,7 +37,7 @@ export interface ResumeOutput {
3737 lastDevice ?: DeviceInfo ;
3838 logEntryCount : number ;
3939 sessionId : string | null ;
40- codexGoal ?: CodexGoalState | null ;
40+ nativeGoal ?: NativeGoalState | null ;
4141}
4242
4343export class ResumeSaga extends Saga < ResumeInput , ResumeOutput > {
@@ -92,8 +92,8 @@ export class ResumeSaga extends Saga<ResumeInput, ResumeOutput> {
9292 const sessionId = await this . readOnlyStep ( "find_session_id" , ( ) =>
9393 Promise . resolve ( this . findSessionId ( entries ) ) ,
9494 ) ;
95- const codexGoal = await this . readOnlyStep ( "find_codex_goal " , ( ) =>
96- Promise . resolve ( this . findCodexGoal ( entries ) ) ,
95+ const nativeGoal = await this . readOnlyStep ( "find_native_goal " , ( ) =>
96+ Promise . resolve ( this . findNativeGoal ( entries ) ) ,
9797 ) ;
9898
9999 this . log . info ( "Resume state rebuilt" , {
@@ -110,7 +110,7 @@ export class ResumeSaga extends Saga<ResumeInput, ResumeOutput> {
110110 lastDevice,
111111 logEntryCount : entries . length ,
112112 sessionId,
113- codexGoal ,
113+ nativeGoal ,
114114 } ;
115115 }
116116
@@ -121,14 +121,14 @@ export class ResumeSaga extends Saga<ResumeInput, ResumeOutput> {
121121 interrupted : false ,
122122 logEntryCount : 0 ,
123123 sessionId : null ,
124- codexGoal : undefined ,
124+ nativeGoal : undefined ,
125125 } ;
126126 }
127127
128- private findCodexGoal (
128+ private findNativeGoal (
129129 entries : StoredNotification [ ] ,
130- ) : CodexGoalState | null | undefined {
131- const statuses = new Set < CodexGoalState [ "status" ] > ( [
130+ ) : NativeGoalState | null | undefined {
131+ const statuses = new Set < NativeGoalState [ "status" ] > ( [
132132 "active" ,
133133 "paused" ,
134134 "blocked" ,
@@ -151,11 +151,11 @@ export class ResumeSaga extends Saga<ResumeInput, ResumeOutput> {
151151 if (
152152 typeof value . objective === "string" &&
153153 typeof value . status === "string" &&
154- statuses . has ( value . status as CodexGoalState [ "status" ] )
154+ statuses . has ( value . status as NativeGoalState [ "status" ] )
155155 ) {
156156 return {
157157 objective : value . objective ,
158- status : value . status as CodexGoalState [ "status" ] ,
158+ status : value . status as NativeGoalState [ "status" ] ,
159159 } ;
160160 }
161161 return undefined ;
0 commit comments