feat(goal-run): add multi-checkpoint goal orchestration with H5 and admin surfaces.

Persist goal runs in MySQL, bind agent runs to checkpoints, expose awaiting-approval
UX in chat, and add admin inspection routes with local verify scripts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-01 17:03:16 +08:00
parent 43bc8bbc2b
commit 666db0b939
47 changed files with 4417 additions and 4 deletions
+39
View File
@@ -181,6 +181,40 @@ export type UserMemorySyncResponse = {
syncedToSession: boolean;
};
export type GoalRunCheckpoint = {
id: string;
goalRunId: string;
sequence: number;
title: string;
description: string | null;
status: string;
agentRunId: string | null;
outputSummary: string | null;
userFeedback: string | null;
approvedAt: number | null;
createdAt: number;
updatedAt: number;
startedAt: number | null;
completedAt: number | null;
};
export type GoalRun = {
id: string;
userId: string;
title: string;
intentSummary: string;
status: string;
priority: number;
sourceChannel: string;
sourceSessionId: string | null;
sourceMessageId: string | null;
currentCheckpointId: string | null;
checkpoints: GoalRunCheckpoint[];
createdAt: number;
updatedAt: number;
completedAt: number | null;
};
export type ChatState = 'idle' | 'loading' | 'connecting' | 'streaming' | 'waiting' | 'error';
export type ToolConfirmation = {
@@ -913,6 +947,10 @@ export type AgentCodeRunClientPolicy = {
};
};
export type GoalRunClientPolicy = {
enabled?: boolean;
};
export type AuthStatus = {
authenticated: boolean;
mode?: 'user' | 'legacy' | 'none' | 'unavailable';
@@ -922,6 +960,7 @@ export type AuthStatus = {
grantedSkills?: string[];
unrestricted?: boolean;
agentCodeRun?: AgentCodeRunClientPolicy | null;
goalRun?: GoalRunClientPolicy | null;
};
export type PathGrant = {