|
|
@@ -1,125 +1,103 @@
|
|
|
+export type StepType = "plan" | "execute" | "validate" | "decide";
|
|
|
+export type ZoomLevel = "journey" | "steps" | "evidence";
|
|
|
+
|
|
|
export interface RunSummary {
|
|
|
script_build_id: number;
|
|
|
- title: string;
|
|
|
status: string;
|
|
|
- checkpoint: string;
|
|
|
- root_trace_id: string;
|
|
|
- revision: number;
|
|
|
- task_count: number;
|
|
|
- attempt_count: number;
|
|
|
- planner_turn_count: number;
|
|
|
- current_focus_task_id: string | null;
|
|
|
- current_gap: string;
|
|
|
- created_at: string;
|
|
|
- updated_at: string;
|
|
|
+ summary: string;
|
|
|
+ started_at: string | null;
|
|
|
+ completed_at: string | null;
|
|
|
}
|
|
|
|
|
|
-export interface TaskNode {
|
|
|
- task_id: string;
|
|
|
- display_path: string;
|
|
|
- parent_task_id: string | null;
|
|
|
- child_task_ids: string[];
|
|
|
- task_kind: string;
|
|
|
- phase: string;
|
|
|
- objective: string;
|
|
|
- status: string;
|
|
|
- blocked_reason: string | null;
|
|
|
- attempt_count: number;
|
|
|
- validation_count: number;
|
|
|
- decision_count: number;
|
|
|
- current_spec_version: number;
|
|
|
- acceptance_criteria: Array<Record<string, unknown>>;
|
|
|
- context_refs: string[];
|
|
|
- created_at: string;
|
|
|
- updated_at: string;
|
|
|
+export interface DataRef {
|
|
|
+ label: string;
|
|
|
+ kind: string;
|
|
|
+ ref: string | null;
|
|
|
+ detail: string | null;
|
|
|
}
|
|
|
|
|
|
-export interface PlannerTurn {
|
|
|
- turn_id: string;
|
|
|
- order: number;
|
|
|
- message_sequence: number;
|
|
|
- phase: string;
|
|
|
+export interface ContractNarration {
|
|
|
action: string;
|
|
|
- action_label: string;
|
|
|
- summary: string;
|
|
|
- observable_reasoning: string;
|
|
|
- result_summary: string;
|
|
|
- status: "succeeded" | "failed" | "unknown";
|
|
|
- focus_task_id: string | null;
|
|
|
- affected_task_ids: string[];
|
|
|
- visible_task_ids: string[];
|
|
|
- tool_name: string;
|
|
|
- tool_arguments: Record<string, unknown>;
|
|
|
- tokens: number;
|
|
|
- cost: number;
|
|
|
- created_at: string;
|
|
|
+ reasoning: string;
|
|
|
+ goals: string[];
|
|
|
+ inputs: string[];
|
|
|
+ output: string;
|
|
|
+ criteria: string[];
|
|
|
}
|
|
|
|
|
|
-export interface LifecycleEvent {
|
|
|
- event_id: string;
|
|
|
- kind: "task" | "attempt" | "validation" | "decision";
|
|
|
+export interface JourneyStep {
|
|
|
+ step_id: string;
|
|
|
+ sequence: number;
|
|
|
+ step_type: StepType;
|
|
|
title: string;
|
|
|
status: string;
|
|
|
- summary: string;
|
|
|
- created_at: string;
|
|
|
+ task_id: string;
|
|
|
attempt_id: string | null;
|
|
|
-}
|
|
|
-
|
|
|
-export interface AgentStep {
|
|
|
- sequence: number;
|
|
|
- role: string;
|
|
|
- step_kind: "instruction" | "explanation" | "tool_call" | "tool_result";
|
|
|
- title: string;
|
|
|
- text: string;
|
|
|
- tool_name: string | null;
|
|
|
- tool_arguments: Record<string, unknown> | null;
|
|
|
- tokens: number;
|
|
|
- cost: number;
|
|
|
+ validation_id: string | null;
|
|
|
+ decision_id: string | null;
|
|
|
+ reasoning: string;
|
|
|
+ reasoning_source: "observable" | "contract" | "validation" | "decision" | "system";
|
|
|
+ process: {
|
|
|
+ label: string;
|
|
|
+ actor: string;
|
|
|
+ tool_name: string | null;
|
|
|
+ trace_id: string | null;
|
|
|
+ details: Record<string, unknown>;
|
|
|
+ };
|
|
|
+ input_data: DataRef[];
|
|
|
+ output_data: DataRef[];
|
|
|
+ contract: ContractNarration | null;
|
|
|
+ parallel_group_id: string | null;
|
|
|
+ parallel_position: number | null;
|
|
|
+ parallel_total: number | null;
|
|
|
+ model: string | null;
|
|
|
+ tokens: number | null;
|
|
|
+ cost: number | null;
|
|
|
duration_ms: number | null;
|
|
|
created_at: string;
|
|
|
+ evidence: {
|
|
|
+ contract: Record<string, unknown> | null;
|
|
|
+ tool_calls: Array<Record<string, unknown>>;
|
|
|
+ artifact_refs: Array<Record<string, unknown>>;
|
|
|
+ validation: Record<string, unknown> | null;
|
|
|
+ decision: Record<string, unknown> | null;
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
-export interface AttemptDetail {
|
|
|
- attempt_id: string;
|
|
|
- task_id: string;
|
|
|
- status: string;
|
|
|
- worker_preset: string | null;
|
|
|
- worker_trace_id: string | null;
|
|
|
- execution_mode: string | null;
|
|
|
- started_at: string | null;
|
|
|
- completed_at: string | null;
|
|
|
- total_tokens: number;
|
|
|
- total_cost: number;
|
|
|
- error: unknown;
|
|
|
- submission: Record<string, unknown> | null;
|
|
|
- validation: Record<string, unknown> | null;
|
|
|
- decision: Record<string, unknown> | null;
|
|
|
- prompt: string;
|
|
|
- steps: AgentStep[];
|
|
|
-}
|
|
|
-
|
|
|
-export interface DataUsage {
|
|
|
- inherited_inputs: Array<Record<string, unknown>>;
|
|
|
- confirmed_reads: Array<Record<string, unknown>>;
|
|
|
- produced_outputs: Array<Record<string, unknown>>;
|
|
|
- adoption: Array<Record<string, unknown>>;
|
|
|
-}
|
|
|
-
|
|
|
-export interface TaskDetail {
|
|
|
- task: TaskNode;
|
|
|
- contract: Record<string, unknown> | null;
|
|
|
- lifecycle: LifecycleEvent[];
|
|
|
- attempts: AttemptDetail[];
|
|
|
- data_usage: DataUsage;
|
|
|
+export interface JourneyEdge {
|
|
|
+ edge_id: string;
|
|
|
+ source: string;
|
|
|
+ target: string;
|
|
|
+ relation: "sequence" | "creates" | "validates" | "decides" | "loop";
|
|
|
+ label: string;
|
|
|
}
|
|
|
|
|
|
-export interface ExecutionView {
|
|
|
- schema_version: "script-build-execution-view/v1";
|
|
|
- data_mode: "persisted-real-run";
|
|
|
+export interface JourneyView {
|
|
|
+ schema_version: "script-build-journey/v1";
|
|
|
generated_at: string;
|
|
|
- run: RunSummary;
|
|
|
- planner_turns: PlannerTurn[];
|
|
|
- tasks: TaskNode[];
|
|
|
- snapshot_basis: string;
|
|
|
+ script_build_id: number;
|
|
|
+ root_trace_id: string;
|
|
|
+ status: string;
|
|
|
+ objective: string;
|
|
|
+ input_summary: {
|
|
|
+ topic: string;
|
|
|
+ account_name: string | null;
|
|
|
+ persona_point_count: number;
|
|
|
+ strategy_names: string[];
|
|
|
+ snapshot_id: string;
|
|
|
+ digest: string;
|
|
|
+ };
|
|
|
+ steps: JourneyStep[];
|
|
|
+ edges: JourneyEdge[];
|
|
|
warnings: string[];
|
|
|
}
|
|
|
+
|
|
|
+export interface TaskCycle {
|
|
|
+ taskId: string;
|
|
|
+ title: string;
|
|
|
+ status: string;
|
|
|
+ steps: JourneyStep[];
|
|
|
+ goals: string[];
|
|
|
+ loopCount: number;
|
|
|
+ parallel: boolean;
|
|
|
+}
|