mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-05-24 09:34:11 +02:00
16de74e0be
- Remove empty section markers (// === ... ===, // --- ... ---) that duplicate JSDoc or function names - Remove "what" comments that restate the next line of code (e.g. // Save to disk, // Check for retryable patterns) - Remove file-level descriptions that restate the filename (e.g. // Pure functions for formatting console output) - Fix "Added by client" comment referencing implementation history → "Used for audit correlation" - Preserve all WHY comments: error classification groups, billing/session limit explanations, ESM interop, exactOptionalPropertyTypes, mutex reasoning
64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
import { defineQuery } from '@temporalio/workflow';
|
|
|
|
export type { AgentMetrics } from '../types/metrics.js';
|
|
import type { AgentMetrics } from '../types/metrics.js';
|
|
|
|
export interface PipelineInput {
|
|
webUrl: string;
|
|
repoPath: string;
|
|
configPath?: string;
|
|
outputPath?: string;
|
|
pipelineTestingMode?: boolean;
|
|
workflowId?: string; // Used for audit correlation
|
|
sessionId?: string; // Workspace directory name (distinct from workflowId for named workspaces)
|
|
resumeFromWorkspace?: string; // Workspace name to resume from
|
|
terminatedWorkflows?: string[]; // Workflows terminated during resume
|
|
}
|
|
|
|
export interface ResumeState {
|
|
workspaceName: string;
|
|
originalUrl: string;
|
|
completedAgents: string[];
|
|
checkpointHash: string;
|
|
originalWorkflowId: string;
|
|
}
|
|
|
|
export interface PipelineSummary {
|
|
totalCostUsd: number;
|
|
totalDurationMs: number; // Wall-clock time (end - start)
|
|
totalTurns: number;
|
|
agentCount: number;
|
|
}
|
|
|
|
export interface PipelineState {
|
|
status: 'running' | 'completed' | 'failed';
|
|
currentPhase: string | null;
|
|
currentAgent: string | null;
|
|
completedAgents: string[];
|
|
failedAgent: string | null;
|
|
error: string | null;
|
|
startTime: number;
|
|
agentMetrics: Record<string, AgentMetrics>;
|
|
summary: PipelineSummary | null;
|
|
}
|
|
|
|
// Extended state returned by getProgress query (includes computed fields)
|
|
export interface PipelineProgress extends PipelineState {
|
|
workflowId: string;
|
|
elapsedMs: number;
|
|
}
|
|
|
|
// Result from a single vuln→exploit pipeline
|
|
export interface VulnExploitPipelineResult {
|
|
vulnType: string;
|
|
vulnMetrics: AgentMetrics | null;
|
|
exploitMetrics: AgentMetrics | null;
|
|
exploitDecision: {
|
|
shouldExploit: boolean;
|
|
vulnerabilityCount: number;
|
|
} | null;
|
|
error: string | null;
|
|
}
|
|
|
|
export const getProgress = defineQuery<PipelineProgress>('getProgress');
|