@qontinui/shared-types 0.8.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/index.cjs.map +1 -1
  2. package/dist/index.d.cts +412 -1
  3. package/dist/index.d.ts +412 -1
  4. package/package.json +1 -1
  5. package/src/generated/AgentCommand.d.ts +81 -0
  6. package/src/generated/AgentCommandError.d.ts +23 -0
  7. package/src/generated/AgentCommandVersion.d.ts +67 -0
  8. package/src/generated/App.d.ts +34 -0
  9. package/src/generated/AppError.d.ts +5 -0
  10. package/src/generated/ComponentActionInfo.d.ts +33 -0
  11. package/src/generated/ElementState.d.ts +27 -1
  12. package/src/generated/GitCommitLite.d.ts +24 -0
  13. package/src/generated/GitLite.d.ts +27 -0
  14. package/src/generated/HealthLevel.d.ts +11 -0
  15. package/src/generated/HealthLite.d.ts +28 -0
  16. package/src/generated/HelperAnswer.d.ts +47 -0
  17. package/src/generated/HelperAnswerSchema.d.ts +40 -0
  18. package/src/generated/HelperTask.d.ts +59 -0
  19. package/src/generated/HelperTaskKind.d.ts +16 -0
  20. package/src/generated/HelperTaskPayload.d.ts +37 -0
  21. package/src/generated/HelperTaskSource.d.ts +31 -0
  22. package/src/generated/HelperTaskStatus.d.ts +14 -0
  23. package/src/generated/HelperVerdict.d.ts +21 -0
  24. package/src/generated/PendingQuestion.d.ts +32 -0
  25. package/src/generated/ProcessStatusLite.d.ts +38 -0
  26. package/src/generated/ProjectSnapshot.d.ts +63 -0
  27. package/src/generated/RegisterAppRequest.d.ts +24 -0
  28. package/src/generated/SavedProject.d.ts +102 -0
  29. package/src/generated/SessionLite.d.ts +44 -0
  30. package/src/generated/SessionSource.d.ts +11 -0
  31. package/src/generated/SpecCheckResult.d.ts +7 -0
  32. package/src/generated/StateMatchResult.d.ts +5 -0
  33. package/src/generated/UIBridgeComponent.d.ts +10 -0
  34. package/src/generated/UpdateAppRequest.d.ts +24 -0
  35. package/src/generated/index.ts +21 -0
  36. package/src/index.ts +14 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/render-log.ts","../src/discovery.ts","../src/workflow/_api.ts","../src/execution/_api.ts","../src/known-issues/index.ts"],"sourcesContent":["/**\n * @qontinui/shared-types\n *\n * Shared TypeScript types for the Qontinui ecosystem.\n */\n\n// Render logging types\nexport * from \"./render-log\";\n\n// Spec-check distinctness validation (Plan 04). Surfaced from the\n// auto-generated Rust mirror — see qontinui-schemas/rust/src/spec_check.rs.\nexport type { SpecValidation } from \"./generated/SpecValidation\";\nexport type { ProposalStatus } from \"./generated/ProposalStatus\";\n\n// State discovery types\nexport * from \"./discovery\";\n\n// Workflow types — import from _api directly (not the ./workflow entry) so\n// rollup's dts bundler doesn't see the same types in two entry graphs and\n// suffix collisions with $1/$2/$3. See tsup.config.ts for the entry list.\nexport * from \"./workflow/_api\";\n\n// Task run types\nexport * from \"./task-run/_api\";\n\n// Execution types\nexport * from \"./execution/_api\";\n\n// Scheduler types\nexport * from \"./scheduler/_api\";\n\n// Runner types (canonical Runner entity)\nexport * from \"./runner/_api\";\n\n// Memory types — coord-mediated memory federation (plan\n// `2026-05-22-memories-on-coord-cross-machine.md` Phase 6).\nexport * from \"./memory/_api\";\n\n// Library types\nexport * from \"./library/_api\";\n\n// Chat types\nexport * from \"./chat/_api\";\n\n// Canvas types\nexport * from \"./canvas\";\n\n// Known Issues types\nexport * from \"./known-issues\";\n\n// State Machine types\nexport * from \"./state-machine/_api\";\n\n// Constraint Engine types\nexport * from \"./constraints/_api\";\n\n// Geometry types (screen coordinates, regions, monitors) — see\n// `@qontinui/shared-types/geometry` subpath export.\nexport * from \"./geometry/_api\";\n\n// Tree event types (execution logging) are NOT re-exported here because\n// `tree_events.ActionType` collides with `execution.ActionType` (different\n// enums, same name). Consumers should import from the subpath:\n// import { TreeEvent, ActionType } from \"@qontinui/shared-types/tree-events\";\n\n// Accessibility tree types (CDP / UIA / AT-SPI / AX capture + selectors).\nexport * from \"./accessibility/_api\";\n\n// Config types (AI context + workflow category) are NOT re-exported here\n// because `config.Context` (AI-task context) collides with `library.Context`\n// (library item with richer shape). Consumers use the subpath:\n// import { Context, Category } from \"@qontinui/shared-types/config\";\n\n// Target configuration (discriminated union for action targets) is subpath\n// only — `SearchStrategy` and other names overlap with action-schema\n// internals in consumer repos and the type surface is large.\n// import { TargetConfig } from \"@qontinui/shared-types/targets\";\n\n// RAG API types are subpath only — `SearchResultItem` and `JobStatus`\n// collide with other modules that model unrelated \"search result\" / \"job\"\n// concepts.\n// import { JobStatus, RAGDashboardStats } from \"@qontinui/shared-types/rag\";\n","/**\n * Shared Render Log Types\n *\n * These types define the render logging schema used across:\n * - qontinui-runner (Tauri desktop app) - Component-level logging\n * - qontinui-web (Next.js web app) - Full DOM snapshot logging\n *\n * The runner reads both its own logs and web's logs for verification\n * in AI feedback loops.\n *\n * NOTE: Field names use snake_case to match Rust/Python JSON serialization.\n * This ensures compatibility across all services.\n */\n\n// =============================================================================\n// Common Types\n// =============================================================================\n\n/**\n * Trigger types for render log capture.\n * What caused the render log to be captured.\n */\nexport type RenderLogTrigger =\n | \"mount\" // Component/page mounted\n | \"navigation\" // Page navigation occurred\n | \"mutation\" // DOM mutation detected (web only)\n | \"data_update\" // Data changed (runner components)\n | \"prop_change\" // Props changed (runner components)\n | \"manual\" // Explicitly triggered capture\n | \"interval\"; // Periodic capture\n\n/**\n * DOM mutation types (for web's MutationObserver).\n */\nexport type DomMutationType = \"childList\" | \"attributes\" | \"characterData\";\n\n// =============================================================================\n// Base Render Log Entry\n// =============================================================================\n\n/**\n * Base render log entry with common fields.\n * Extended by component logs and DOM snapshot logs.\n */\nexport interface RenderLogEntryBase {\n /** Unique identifier for this log entry */\n id: string;\n\n /** Unix timestamp in milliseconds when the capture occurred */\n timestamp: number;\n\n /** What triggered this capture */\n trigger: RenderLogTrigger;\n\n /** Session ID for grouping related captures */\n session_id?: string;\n}\n\n// =============================================================================\n// Runner Component Render Log (Lightweight)\n// =============================================================================\n\n/**\n * Component-level render log entry.\n * Used by qontinui-runner to log what data components render.\n *\n * Components explicitly call logRender() with their rendered data.\n * This is lightweight and focused on verifying data display.\n */\nexport interface ComponentRenderLogEntry extends RenderLogEntryBase {\n /** Type discriminator */\n type: \"component\";\n\n /** Component name (e.g., \"RunRecapTab\", \"StatusBanner\") */\n component: string;\n\n /** The data that was rendered (component-specific structure) */\n data: Record<string, unknown>;\n\n /** Sections that are visible/expanded in the component */\n visible_sections?: string[];\n\n /** Associated task run ID if applicable */\n task_run_id?: number;\n}\n\n// =============================================================================\n// Web DOM Snapshot Render Log (Comprehensive)\n// =============================================================================\n\n/**\n * Bounding rectangle for an element.\n */\nexport interface ElementRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * Single DOM element in a snapshot.\n * Recursive structure representing the DOM tree.\n */\nexport interface DomElementSnapshot {\n /** HTML tag name (lowercase) */\n tag: string;\n\n /** Element ID if present */\n id?: string;\n\n /** CSS class list */\n class_list: string[];\n\n /** Direct text content (not from children) */\n text_content?: string;\n\n /** Length of innerHTML (for size estimation) */\n inner_html_length?: number;\n\n /** Bounding rectangle relative to viewport */\n rect?: ElementRect;\n\n /** Whether the element is visible */\n is_visible: boolean;\n\n /** Computed opacity */\n opacity?: number;\n\n /** Computed display value */\n display?: string;\n\n /** Key HTML attributes */\n attributes: Record<string, string>;\n\n /** Selected computed styles */\n computed_styles?: Record<string, string>;\n\n /** Child elements (recursive) */\n children: DomElementSnapshot[];\n}\n\n/**\n * Form data extracted from the page.\n */\nexport interface FormSnapshot {\n id?: string;\n action?: string;\n method?: string;\n inputs: Array<{\n type: string;\n name: string;\n value: string;\n }>;\n}\n\n/**\n * Link data extracted from the page.\n */\nexport interface LinkSnapshot {\n href: string;\n text: string;\n}\n\n/**\n * Image data extracted from the page.\n */\nexport interface ImageSnapshot {\n src: string;\n alt?: string;\n width?: number;\n height?: number;\n}\n\n/**\n * Full DOM snapshot data.\n * Contains the entire page state for debugging.\n *\n * NOTE: The snapshot is stored as JSONB in the database, so field names\n * in the nested structure (root, forms, links, images) may vary by\n * implementation. The web frontend uses camelCase internally but that's\n * stored as-is in the JSONB field.\n */\nexport interface DomSnapshot {\n /** Root element tree (document.body) */\n root: DomElementSnapshot | null;\n\n /** Total number of elements in the tree */\n total_elements: number;\n\n /** Concatenated visible text (truncated) */\n visible_text?: string;\n\n /** Forms on the page */\n forms: FormSnapshot[];\n\n /** Links on the page */\n links: LinkSnapshot[];\n\n /** Images on the page */\n images: ImageSnapshot[];\n\n /** JavaScript console errors captured */\n errors: string[];\n\n /** JavaScript console warnings captured */\n warnings: string[];\n}\n\n/**\n * Full DOM snapshot render log entry.\n * Used by qontinui-web to capture entire page state.\n *\n * Automatically captured via MutationObserver on DOM changes.\n * Provides comprehensive debugging data.\n */\nexport interface DomSnapshotRenderLogEntry extends RenderLogEntryBase {\n /** Type discriminator */\n type: \"dom_snapshot\";\n\n /** Current page URL */\n page_url: string;\n\n /** Page title */\n page_title?: string;\n\n /** Type of DOM mutation that triggered capture (if mutation trigger) */\n mutation_type?: DomMutationType;\n\n /** CSS selector of the element that was mutated */\n target_selector?: string;\n\n /** The full DOM snapshot */\n snapshot: DomSnapshot;\n\n /** Viewport dimensions */\n viewport_width?: number;\n viewport_height?: number;\n\n /** Scroll position */\n scroll_x?: number;\n scroll_y?: number;\n\n /** Time taken to capture the snapshot in milliseconds */\n capture_duration_ms?: number;\n\n /** Number of elements captured */\n element_count?: number;\n\n /** User ID if authenticated (web only) */\n user_id?: string;\n}\n\n// =============================================================================\n// Union Type\n// =============================================================================\n\n/**\n * Any render log entry.\n * Use the `type` field to discriminate.\n */\nexport type RenderLogEntry =\n | ComponentRenderLogEntry\n | DomSnapshotRenderLogEntry;\n\n// =============================================================================\n// API Types (for REST endpoints)\n// =============================================================================\n\n/**\n * Request to create a render log entry (web API).\n */\nexport interface CreateRenderLogRequest {\n session_id: string;\n page_url: string;\n page_title?: string;\n trigger: RenderLogTrigger;\n mutation_type?: DomMutationType;\n target_selector?: string;\n snapshot: DomSnapshot;\n viewport_width?: number;\n viewport_height?: number;\n scroll_x?: number;\n scroll_y?: number;\n capture_duration_ms?: number;\n element_count?: number;\n}\n\n/**\n * Render log response from web API.\n * Includes database-generated fields.\n */\nexport interface RenderLogResponse {\n id: number;\n session_id: string;\n timestamp: string; // ISO 8601 datetime\n page_url: string;\n page_title?: string;\n trigger: RenderLogTrigger;\n mutation_type?: DomMutationType;\n target_selector?: string;\n snapshot: DomSnapshot;\n viewport_width?: number;\n viewport_height?: number;\n scroll_x?: number;\n scroll_y?: number;\n capture_duration_ms?: number;\n element_count?: number;\n user_id?: string;\n}\n\n/**\n * Summary of a render log (without full snapshot).\n */\nexport interface RenderLogSummary {\n id: number;\n session_id: string;\n timestamp: string;\n page_url: string;\n page_title?: string;\n trigger: RenderLogTrigger;\n mutation_type?: DomMutationType;\n element_count?: number;\n capture_duration_ms?: number;\n}\n\n/**\n * Paginated list of render logs.\n */\nexport interface RenderLogList {\n items: RenderLogSummary[];\n total: number;\n page: number;\n page_size: number;\n has_more: boolean;\n}\n\n/**\n * Render logging statistics.\n */\nexport interface RenderLogStats {\n enabled: boolean;\n total_snapshots: number;\n total_sessions: number;\n oldest_snapshot?: string;\n newest_snapshot?: string;\n storage_used_bytes: number;\n image_count: number;\n}\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Check if a render log entry is a component log.\n */\nexport function isComponentRenderLog(\n entry: RenderLogEntry,\n): entry is ComponentRenderLogEntry {\n return entry.type === \"component\";\n}\n\n/**\n * Check if a render log entry is a DOM snapshot log.\n */\nexport function isDomSnapshotRenderLog(\n entry: RenderLogEntry,\n): entry is DomSnapshotRenderLogEntry {\n return entry.type === \"dom_snapshot\";\n}\n","/**\n * Unified State Discovery Result types.\n *\n * These types represent the output of state discovery from any source:\n * - Playwright (web extraction)\n * - UI Bridge (render log analysis)\n * - Recording (user session recording)\n * - Vision (screenshot analysis)\n * - Manual (user-defined)\n *\n * All types use camelCase field names to match the generated types from Rust\n * schemas. Converter functions are provided to transform snake_case API\n * responses into these typed objects.\n */\n\n// =============================================================================\n// Re-exports from generated types\n// =============================================================================\n\nexport type { DiscoverySourceType } from \"./generated/DiscoverySourceType\";\nexport type { TransitionTriggerType } from \"./generated/TransitionTriggerType\";\nexport type { DiscoveryBoundingBox } from \"./generated/DiscoveryBoundingBox\";\nexport type { DiscoveryTransitionTrigger } from \"./generated/DiscoveryTransitionTrigger\";\nexport type { DiscoveredStateImage } from \"./generated/DiscoveredStateImage\";\nexport type { DiscoveredState } from \"./generated/DiscoveredState\";\nexport type { DiscoveredTransition } from \"./generated/DiscoveredTransition\";\nexport type { StateDiscoveryResult } from \"./generated/StateDiscoveryResult\";\nexport type { StateDiscoveryResultSummary } from \"./generated/StateDiscoveryResultSummary\";\nexport type { StateDiscoveryResultListResponse } from \"./generated/StateDiscoveryResultListResponse\";\nexport type { StateDiscoveryResultCreate } from \"./generated/StateDiscoveryResultCreate\";\nexport type { StateDiscoveryResultUpdate } from \"./generated/StateDiscoveryResultUpdate\";\n\n// =============================================================================\n// Export/Import\n// =============================================================================\n\nexport type { StateMachineExport } from \"./generated/StateMachineExport\";\nexport type { StateMachineImport } from \"./generated/StateMachineImport\";\n\nimport type { DiscoverySourceType } from \"./generated/DiscoverySourceType\";\nimport type { DiscoveredStateImage } from \"./generated/DiscoveredStateImage\";\nimport type { DiscoveredState } from \"./generated/DiscoveredState\";\nimport type { DiscoveredTransition } from \"./generated/DiscoveredTransition\";\n\n// =============================================================================\n// Display Helpers\n// =============================================================================\n\nexport const SOURCE_TYPE_LABELS: Record<DiscoverySourceType, string> = {\n playwright: \"Web Extraction\",\n ui_bridge: \"UI Bridge\",\n recording: \"Recording\",\n vision: \"Vision\",\n manual: \"Manual\",\n};\n\nexport const SOURCE_TYPE_COLORS: Record<DiscoverySourceType, string> = {\n playwright: \"bg-blue-500/20 text-blue-400 border-blue-500/30\",\n ui_bridge: \"bg-purple-500/20 text-purple-400 border-purple-500/30\",\n recording: \"bg-green-500/20 text-green-400 border-green-500/30\",\n vision: \"bg-orange-500/20 text-orange-400 border-orange-500/30\",\n manual: \"bg-gray-500/20 text-gray-400 border-gray-500/30\",\n};\n\n// =============================================================================\n// Converter Functions (snake_case API responses -> camelCase typed objects)\n// =============================================================================\n\nimport type { StateDiscoveryResult } from \"./generated/StateDiscoveryResult\";\nimport type { StateDiscoveryResultSummary } from \"./generated/StateDiscoveryResultSummary\";\nimport type { DiscoveryBoundingBox } from \"./generated/DiscoveryBoundingBox\";\nimport type { DiscoveryTransitionTrigger } from \"./generated/DiscoveryTransitionTrigger\";\nimport type { TransitionTriggerType } from \"./generated/TransitionTriggerType\";\n\nexport function toStateDiscoveryResult(\n data: Record<string, unknown>,\n): StateDiscoveryResult {\n return {\n id: data.id as string,\n projectId: (data.projectId ?? data.project_id) as string,\n name: data.name as string,\n description: data.description as string | undefined,\n sourceType: (data.sourceType ?? data.source_type) as DiscoverySourceType,\n sourceSessionId: (data.sourceSessionId ?? data.source_session_id) as\n | string\n | undefined,\n discoveryStrategy: (data.discoveryStrategy ?? data.discovery_strategy) as\n | string\n | undefined,\n images: ((data.images as unknown[]) || []).map(toDiscoveredStateImage),\n states: ((data.states as unknown[]) || []).map(toDiscoveredState),\n transitions: ((data.transitions as unknown[]) || []).map(\n toDiscoveredTransition,\n ),\n elementToRenders:\n ((data.elementToRenders ?? data.element_to_renders) as Record<\n string,\n string[]\n >) || {},\n imageCount: (data.imageCount ?? data.image_count) as number,\n stateCount: (data.stateCount ?? data.state_count) as number,\n transitionCount: (data.transitionCount ?? data.transition_count) as number,\n renderCount: (data.renderCount ?? data.render_count) as number,\n uniqueElementCount: (data.uniqueElementCount ??\n data.unique_element_count) as number,\n confidence: data.confidence as number,\n discoveryMetadata:\n ((data.discoveryMetadata ?? data.discovery_metadata) as Record<\n string,\n unknown\n >) || {},\n createdAt: (data.createdAt ?? data.created_at) as string,\n updatedAt: (data.updatedAt ?? data.updated_at) as string,\n };\n}\n\nexport function toDiscoveredStateImage(data: unknown): DiscoveredStateImage {\n const d = data as Record<string, unknown>;\n return {\n id: d.id as string,\n screenshotId: (d.screenshotId ?? d.screenshot_id) as string | undefined,\n screenshotUrl: (d.screenshotUrl ?? d.screenshot_url) as string | undefined,\n bbox: d.bbox as DiscoveryBoundingBox,\n pixelHash: (d.pixelHash ?? d.pixel_hash) as string | undefined,\n stateId: (d.stateId ?? d.state_id) as string | undefined,\n elementType: (d.elementType ?? d.element_type) as string | undefined,\n label: d.label as string | undefined,\n confidence: (d.confidence as number) ?? 1.0,\n metadata: d.metadata as Record<string, unknown> | undefined,\n };\n}\n\nexport function toDiscoveredState(data: unknown): DiscoveredState {\n const d = data as Record<string, unknown>;\n return {\n id: d.id as string,\n name: d.name as string,\n imageIds: ((d.imageIds ?? d.image_ids) as string[]) || [],\n renderIds: ((d.renderIds ?? d.render_ids) as string[]) || [],\n elementIds: ((d.elementIds ?? d.element_ids) as string[]) || [],\n confidence: (d.confidence as number) ?? 1.0,\n description: d.description as string | undefined,\n metadata: d.metadata as Record<string, unknown> | undefined,\n };\n}\n\nexport function toDiscoveredTransition(data: unknown): DiscoveredTransition {\n const d = data as Record<string, unknown>;\n const trigger = d.trigger as Record<string, unknown> | undefined;\n return {\n id: d.id as string,\n fromStateId: (d.fromStateId ?? d.from_state_id) as string,\n toStateId: (d.toStateId ?? d.to_state_id) as string,\n trigger: trigger\n ? {\n type: (trigger.type as TransitionTriggerType) ?? \"click\",\n imageId: (trigger.imageId ?? trigger.image_id) as string | undefined,\n elementId: (trigger.elementId ?? trigger.element_id) as\n | string\n | undefined,\n selector: trigger.selector as string | undefined,\n value: trigger.value as string | undefined,\n }\n : undefined,\n confidence: (d.confidence as number) ?? 1.0,\n metadata: d.metadata as Record<string, unknown> | undefined,\n };\n}\n\nexport function toStateDiscoveryResultSummary(\n data: Record<string, unknown>,\n): StateDiscoveryResultSummary {\n return {\n id: data.id as string,\n projectId: (data.projectId ?? data.project_id) as string,\n name: data.name as string,\n description: data.description as string | undefined,\n sourceType: (data.sourceType ?? data.source_type) as DiscoverySourceType,\n discoveryStrategy: (data.discoveryStrategy ?? data.discovery_strategy) as\n | string\n | undefined,\n imageCount: (data.imageCount ?? data.image_count) as number,\n stateCount: (data.stateCount ?? data.state_count) as number,\n transitionCount: (data.transitionCount ?? data.transition_count) as number,\n confidence: data.confidence as number,\n createdAt: (data.createdAt ?? data.created_at) as string,\n };\n}\n","/**\n * Workflow Types\n *\n * Canonical type definitions for the unified Workflow Builder system.\n * Shared across qontinui-runner and qontinui-web.\n *\n * All automation is organized into four phases: Setup, Verification, Agentic, Completion.\n *\n * Execution Order:\n * Setup (once) -> [Verification <-> Agentic]* -> Completion (once)\n *\n * Step Types (4 core types):\n * command - Shell commands, checks, check groups, tests\n * ui_bridge - UI Bridge SDK interactions (navigate, execute, assert, snapshot)\n * prompt - AI task instructions\n * workflow - Run a saved workflow inline (composition)\n */\n\n// =============================================================================\n// Generated frame types — source of truth is qontinui-schemas/rust/src/workflow.rs\n// These are produced by the schemars -> JSON Schema -> json-schema-to-typescript\n// pipeline. Do NOT redeclare them here; re-export from ../generated/*.\n//\n// Step arrays on UnifiedWorkflow / WorkflowStage are typed as `unknown[]` by\n// the generator. Typed step arrays are part of the Wave 4 step migration and\n// remain hand-authored below (BaseStep, CommandStep, PromptStep, UiBridgeStep,\n// WorkflowStep, and the per-phase aliases).\n// =============================================================================\n\nexport type { LogSourceSelection } from \"../generated/LogSourceSelection\";\nexport type { HealthCheckUrl } from \"../generated/HealthCheckUrl\";\nexport type { RoutingRule } from \"../generated/RoutingRule\";\nexport type { ModelOverrideConfig } from \"../generated/ModelOverrideConfig\";\nexport type { StageCondition } from \"../generated/StageCondition\";\nexport type { RetryPolicy } from \"../generated/RetryPolicy\";\nexport type { StageOutput } from \"../generated/StageOutput\";\nexport type { StageInput } from \"../generated/StageInput\";\nexport type { WorkflowStage } from \"../generated/WorkflowStage\";\nexport type { UnifiedWorkflow } from \"../generated/UnifiedWorkflow\";\nexport type { WorkflowArchitecture } from \"../generated/WorkflowArchitecture\";\n\nexport type { BaseStepFields } from \"../generated/BaseStepFields\";\nexport type { RetrySpec } from \"../generated/RetrySpec\";\n\n// Step DTOs (generated from qontinui-types::workflow_step)\nexport type { CommandStep } from \"../generated/CommandStep\";\nexport type { PromptStep } from \"../generated/PromptStep\";\nexport type { UiBridgeStep } from \"../generated/UiBridgeStep\";\nexport type { WorkflowStep } from \"../generated/WorkflowStep\";\nexport type { UnifiedStep } from \"../generated/UnifiedStep\";\nexport type { CanonicalStep } from \"../generated/CanonicalStep\";\nexport type { HttpMethod } from \"../generated/HttpMethod\";\nexport type { ApiContentType } from \"../generated/ApiContentType\";\nexport type { ApiAssertion } from \"../generated/ApiAssertion\";\nexport type { ApiVariableExtraction } from \"../generated/ApiVariableExtraction\";\nexport type { TestType } from \"../generated/TestType\";\nexport type { PlaywrightExecutionMode } from \"../generated/PlaywrightExecutionMode\";\nexport type { CheckType } from \"../generated/CheckType\";\nexport type { CommandMode } from \"../generated/CommandMode\";\nexport type { UiBridgeAction } from \"../generated/UiBridgeAction\";\nexport type { VerificationCategoryKind } from \"../generated/VerificationCategoryKind\";\n\n// ModelOverrides is a hand-authored convenience alias: the generated\n// UnifiedWorkflow / WorkflowStage type `model_overrides` as an open\n// `{ [k: string]: ModelOverrideConfig }`, but downstream code prefers a\n// named type with known phase keys. Keep as a local alias over the generated\n// per-phase config.\nimport type { ModelOverrideConfig as _ModelOverrideConfig } from \"../generated/ModelOverrideConfig\";\n\nexport type ModelOverrides = {\n setup?: _ModelOverrideConfig;\n agentic?: _ModelOverrideConfig;\n completion?: _ModelOverrideConfig;\n verification?: _ModelOverrideConfig;\n investigation?: _ModelOverrideConfig;\n summary?: _ModelOverrideConfig;\n generation?: _ModelOverrideConfig;\n};\n\n// =============================================================================\n// Phases\n// =============================================================================\n\nexport type WorkflowPhase = \"setup\" | \"verification\" | \"agentic\" | \"completion\";\n\n// =============================================================================\n// Skill Types (re-exported from ./skill)\n// =============================================================================\n\nexport type {\n SkillCategory,\n SkillAuthor,\n SkillParameterOption,\n SkillParameter,\n SingleStepTemplate,\n MultiStepTemplate,\n CompositionTemplate,\n SkillRef,\n SkillTemplate,\n SkillDefinition,\n SkillOrigin,\n SkillExportManifest,\n SkillExport,\n SkillImportResult,\n} from \"./skill\";\n\nexport type {\n PlannedActionType,\n ElementTarget,\n PlannedAction,\n ActionPlan,\n PlannedActionResult,\n ActionPlanResult,\n ActionPlanExecuteRequest,\n} from \"./action-plan\";\n\n// =============================================================================\n// Step Types — generated from qontinui-types::workflow_step\n//\n// The four canonical step variants (CommandStep, PromptStep, UiBridgeStep,\n// WorkflowStep) and their helper unions (HttpMethod, ApiContentType, …) are\n// re-exported at the top of this file from ../generated/*. The remaining\n// hand-authored types in this section are TS-only sugar: a `BaseStep` alias\n// for consumers that still want a name for the shared-fields subset, a\n// `StepTypeName` literal that includes non-canonical runner-side variants\n// (e.g. native_accessibility) for UI listings, and the phase-alias types.\n//\n// Phase narrowing is TS-only sugar — not a wire concern. The generator emits\n// a narrow `phase` field on each variant; these aliases just group the four\n// variants by the phase that can carry them.\n// =============================================================================\n\nimport type { CommandStep as _CommandStep } from \"../generated/CommandStep\";\nimport type { PromptStep as _PromptStep } from \"../generated/PromptStep\";\nimport type { UiBridgeStep as _UiBridgeStep } from \"../generated/UiBridgeStep\";\nimport type { WorkflowStep as _WorkflowStep } from \"../generated/WorkflowStep\";\n\n/**\n * Shared-fields subset carried by every canonical step variant.\n *\n * Alias for the generated `BaseStepFields` so downstream code can still\n * reference `BaseStep` by name. Source of truth:\n * `qontinui-types::workflow_step::BaseStepFields`.\n */\nimport type { BaseStepFields as _BaseStepFields } from \"../generated/BaseStepFields\";\nexport type BaseStep = _BaseStepFields;\n\n// =============================================================================\n// Step Type Names\n// =============================================================================\n\n// Includes runner-side non-canonical variants (e.g. `native_accessibility`)\n// that appear in the UI listing but are not part of the `UnifiedStep` DTO.\nexport type StepTypeName = \"command\" | \"ui_bridge\" | \"prompt\" | \"workflow\" | \"native_accessibility\";\n\n// =============================================================================\n// Phase-alias types (TS-only sugar over the generated UnifiedStep)\n// =============================================================================\n\nexport type SetupStep = _CommandStep | _PromptStep | _UiBridgeStep | _WorkflowStep;\nexport type VerificationStep = _CommandStep | _PromptStep | _UiBridgeStep | _WorkflowStep;\nexport type AgenticStep = _PromptStep;\nexport type CompletionStep = _CommandStep | _PromptStep | _UiBridgeStep | _WorkflowStep;\n\n// =============================================================================\n// Verification Categories\n// =============================================================================\n\n// Alias for the generated `VerificationCategoryKind` union. Source of truth:\n// `qontinui-types::workflow_step::VerificationCategoryKind`. `VerificationCategoryKind`\n// itself is re-exported earlier in this file.\nimport type { VerificationCategoryKind as _VerificationCategoryKind } from \"../generated/VerificationCategoryKind\";\nexport type VerificationCategory = _VerificationCategoryKind;\n\n// =============================================================================\n// Dependency Graph\n// =============================================================================\n\nexport interface DependencyNode {\n id: string;\n label: string;\n type: string;\n phase: WorkflowPhase;\n is_referenced: boolean;\n cost_category?: string;\n}\n\nexport interface DependencyEdge {\n source: string;\n target: string;\n label?: string;\n edge_type: \"explicit_depends_on\" | \"implicit_reference\" | \"setup_provides\";\n}\n\nexport interface DependencyGraph {\n nodes: DependencyNode[];\n edges: DependencyEdge[];\n}\n\n// =============================================================================\n// Cost Annotations\n// =============================================================================\n\nexport type CostCategory =\n | \"network\"\n | \"ai_call\"\n | \"setup\"\n | \"ui_interaction\";\n\nexport interface StepCost {\n step_id: string;\n name: string;\n estimated_ms: number;\n category: CostCategory;\n has_side_effects: boolean;\n}\n\nexport interface CostAnnotations {\n steps: StepCost[];\n total_estimated_ms: number;\n}\n\n// =============================================================================\n// Quality Report\n// =============================================================================\n\nexport type QualityFindingSeverity = \"critical\" | \"warning\" | \"info\";\n\nexport type QualityFindingCategory =\n | \"verification_gap\"\n | \"missing_criterion\"\n | \"unnecessary_step\"\n | \"weak_retry\"\n | \"required_flag_violation\"\n | \"retry_inconsistency\"\n | \"data_contract_violation\"\n | \"false_positive_risk\";\n\nexport interface QualityFinding {\n finding_id: string;\n step_id?: string;\n severity: QualityFindingSeverity;\n category: QualityFindingCategory;\n description: string;\n suggested_fix?: string;\n}\n\nexport interface CoverageMatrix {\n criteria_to_steps: Record<string, string[]>;\n steps_to_criteria: Record<string, string[]>;\n uncovered_criteria: string[];\n unlinked_steps: string[];\n}\n\nexport interface QualityReport {\n findings: QualityFinding[];\n score: number;\n pass: boolean;\n coverage_matrix?: CoverageMatrix;\n}\n\n// =============================================================================\n// Export/Import Types\n// =============================================================================\n\nimport type { UnifiedWorkflow as _UnifiedWorkflow } from \"../generated/UnifiedWorkflow\";\n\nexport interface WorkflowExportManifest {\n version: string;\n exported_at: string;\n app_version: string;\n content_type: \"unified_workflow\";\n}\n\nexport interface WorkflowExport {\n manifest: WorkflowExportManifest;\n workflow: _UnifiedWorkflow;\n}\n\nexport interface WorkflowImportResult {\n workflow: _UnifiedWorkflow;\n overwritten: boolean;\n original_id: string | null;\n}\n\n// =============================================================================\n// Feature Detection\n// =============================================================================\n\nexport interface WorkflowFeatures {\n hasSetup: boolean;\n hasVerification: boolean;\n hasAgentic: boolean;\n hasCompletion: boolean;\n hasUiBridge: boolean;\n showIterationSettings: boolean;\n hasAiPrompts: boolean;\n}\n\n// =============================================================================\n// Step Type Display Info\n// =============================================================================\n\nexport interface StepTypeInfo {\n type: string;\n label: string;\n description: string;\n icon: string;\n color: string;\n phase: WorkflowPhase;\n}\n\n// =============================================================================\n// Step Type Constants\n// =============================================================================\n\nexport const STEP_TYPES: Record<WorkflowPhase, StepTypeInfo[]> = {\n setup: [\n {\n type: \"command\",\n label: \"Command\",\n description: \"Run shell commands, checks, or tests\",\n icon: \"Terminal\",\n color: \"gray\",\n phase: \"setup\",\n },\n {\n type: \"ui_bridge\",\n label: \"UI Bridge\",\n description: \"Interact with UI via UI Bridge SDK\",\n icon: \"Monitor\",\n color: \"emerald\",\n phase: \"setup\",\n },\n {\n type: \"prompt\",\n label: \"AI Task\",\n description: \"AI-driven task\",\n icon: \"Bot\",\n color: \"violet\",\n phase: \"setup\",\n },\n {\n type: \"workflow\",\n label: \"Workflow\",\n description: \"Run a saved workflow\",\n icon: \"Workflow\",\n color: \"blue\",\n phase: \"setup\",\n },\n ],\n verification: [\n {\n type: \"command\",\n label: \"Command\",\n description: \"Run commands, checks, or tests for verification\",\n icon: \"Terminal\",\n color: \"gray\",\n phase: \"verification\",\n },\n {\n type: \"ui_bridge\",\n label: \"UI Bridge\",\n description: \"Verify UI state via UI Bridge\",\n icon: \"Monitor\",\n color: \"emerald\",\n phase: \"verification\",\n },\n {\n type: \"prompt\",\n label: \"AI Verification\",\n description: \"AI-evaluated criteria\",\n icon: \"Bot\",\n color: \"violet\",\n phase: \"verification\",\n },\n {\n type: \"workflow\",\n label: \"Workflow\",\n description: \"Run a saved workflow for verification\",\n icon: \"Workflow\",\n color: \"blue\",\n phase: \"verification\",\n },\n {\n type: \"native_accessibility\",\n label: \"Native Accessibility\",\n description: \"Run a native accessibility audit using OS-level APIs\",\n icon: \"Accessibility\",\n color: \"teal\",\n phase: \"verification\",\n },\n ],\n agentic: [\n {\n type: \"prompt\",\n label: \"Prompt\",\n description: \"AI task instructions\",\n icon: \"MessageSquare\",\n color: \"amber\",\n phase: \"agentic\",\n },\n ],\n completion: [\n {\n type: \"command\",\n label: \"Command\",\n description: \"Run cleanup commands or final tests\",\n icon: \"Terminal\",\n color: \"gray\",\n phase: \"completion\",\n },\n {\n type: \"ui_bridge\",\n label: \"UI Bridge\",\n description: \"Final UI interactions\",\n icon: \"Monitor\",\n color: \"emerald\",\n phase: \"completion\",\n },\n {\n type: \"prompt\",\n label: \"AI Completion\",\n description: \"Final AI actions\",\n icon: \"Bot\",\n color: \"violet\",\n phase: \"completion\",\n },\n {\n type: \"workflow\",\n label: \"Workflow\",\n description: \"Run a saved workflow as a completion step\",\n icon: \"Workflow\",\n color: \"blue\",\n phase: \"completion\",\n },\n ],\n};\n\n// =============================================================================\n// Phase Display Info\n// =============================================================================\n\nexport const PHASE_INFO: Record<\n WorkflowPhase,\n { label: string; description: string; color: string }\n> = {\n setup: {\n label: \"Setup\",\n description: \"Runs once at the beginning\",\n color: \"blue\",\n },\n verification: {\n label: \"Verification\",\n description: \"Checks success criteria, loops with agentic\",\n color: \"green\",\n },\n agentic: {\n label: \"Agentic\",\n description: \"AI work, iterates until verification passes\",\n color: \"amber\",\n },\n completion: {\n label: \"Completion\",\n description: \"Runs once after the loop exits\",\n color: \"purple\",\n },\n};\n\n// =============================================================================\n// Summary Step Constants\n// =============================================================================\n\nexport const DEFAULT_SUMMARY_PROMPT = `Write a one-paragraph summary of all the tasks completed in this workflow. Include what was accomplished, whether the stated goal was achieved, any issues encountered and how they were resolved, and remaining work if the goal was not fully achieved. Be concise but comprehensive.`;\n","/**\n * Execution Types\n *\n * Type definitions for the unified execution reporting API that supports\n * multiple run types: QA testing, integration testing, live automation,\n * recording sessions, and debug runs.\n *\n * Tier 1 (enums) and Tier 2 (request/response DTOs) are generated from Rust\n * (source of truth: qontinui-schemas/rust/src/execution.rs). Do not edit\n * those sections by hand — regenerate via `just generate-types` (or\n * `qontinui-runner/src-tauri/scripts/generate_types.sh`).\n *\n * Tier 3 (UI display / live-status-stream types) remains hand-authored below.\n */\n\n// ============================================================================\n// Enums (Tier 1, generated)\n// ============================================================================\n//\n// For enums that had named-constant call-site syntax in the old hand-authored\n// TS (e.g. `RunType.QA_TEST`), we import the generated literal union under an\n// alias, re-export it as the type name, and declare a companion `const` object\n// with the same name so `RunType.QA_TEST` still resolves as a value. TS merges\n// the type alias and const value into one declaration usable in both\n// positions.\n\nimport type { RunType as _RunType } from \"../generated/RunType\";\nexport type RunType = _RunType;\nexport const RunType = {\n QA_TEST: \"qa_test\",\n INTEGRATION_TEST: \"integration_test\",\n LIVE_AUTOMATION: \"live_automation\",\n RECORDING: \"recording\",\n DEBUG: \"debug\",\n} as const;\n\nimport type { RunStatus as _RunStatus } from \"../generated/RunStatus\";\nexport type RunStatus = _RunStatus;\nexport const RunStatus = {\n PENDING: \"pending\",\n RUNNING: \"running\",\n COMPLETED: \"completed\",\n FAILED: \"failed\",\n TIMEOUT: \"timeout\",\n CANCELLED: \"cancelled\",\n PAUSED: \"paused\",\n} as const;\n\nimport type { ActionStatus as _ActionStatus } from \"../generated/ActionStatus\";\nexport type ActionStatus = _ActionStatus;\nexport const ActionStatus = {\n SUCCESS: \"success\",\n FAILED: \"failed\",\n TIMEOUT: \"timeout\",\n SKIPPED: \"skipped\",\n ERROR: \"error\",\n PENDING: \"pending\",\n} as const;\n\n// `ActionType` collides with `tree_events::ActionType` on the Rust side, so\n// the generated symbol is `ExecutionActionType`. We preserve the local name\n// `ActionType` for backward compatibility.\nimport type { ExecutionActionType as _ActionType } from \"../generated/ExecutionActionType\";\nexport type ActionType = _ActionType;\nexport const ActionType = {\n // Vision actions\n FIND: \"find\",\n FIND_ALL: \"find_all\",\n WAIT_FOR: \"wait_for\",\n WAIT_UNTIL_GONE: \"wait_until_gone\",\n\n // Input actions\n CLICK: \"click\",\n DOUBLE_CLICK: \"double_click\",\n RIGHT_CLICK: \"right_click\",\n TYPE: \"type\",\n PRESS_KEY: \"press_key\",\n HOTKEY: \"hotkey\",\n SCROLL: \"scroll\",\n DRAG: \"drag\",\n\n // State machine actions\n GO_TO_STATE: \"go_to_state\",\n TRANSITION: \"transition\",\n VERIFY_STATE: \"verify_state\",\n\n // Control flow\n CONDITIONAL: \"conditional\",\n LOOP: \"loop\",\n PARALLEL: \"parallel\",\n SEQUENCE: \"sequence\",\n\n // Utility\n WAIT: \"wait\",\n SCREENSHOT: \"screenshot\",\n LOG: \"log\",\n ASSERT: \"assert\",\n\n // AI actions\n AI_PROMPT: \"ai_prompt\",\n RUN_PROMPT_SEQUENCE: \"run_prompt_sequence\",\n\n // Custom/plugin\n CUSTOM: \"custom\",\n} as const;\n\nimport type { ErrorType as _ErrorType } from \"../generated/ErrorType\";\nexport type ErrorType = _ErrorType;\nexport const ErrorType = {\n ELEMENT_NOT_FOUND: \"element_not_found\",\n TIMEOUT: \"timeout\",\n ASSERTION_FAILED: \"assertion_failed\",\n CRASH: \"crash\",\n NETWORK_ERROR: \"network_error\",\n VALIDATION_ERROR: \"validation_error\",\n OTHER: \"other\",\n} as const;\n\nimport type { IssueSeverity as _IssueSeverity } from \"../generated/IssueSeverity\";\nexport type IssueSeverity = _IssueSeverity;\nexport const IssueSeverity = {\n CRITICAL: \"critical\",\n HIGH: \"high\",\n MEDIUM: \"medium\",\n LOW: \"low\",\n INFORMATIONAL: \"informational\",\n} as const;\n\nimport type { ScreenshotType as _ScreenshotType } from \"../generated/ScreenshotType\";\nexport type ScreenshotType = _ScreenshotType;\nexport const ScreenshotType = {\n ERROR: \"error\",\n SUCCESS: \"success\",\n MANUAL: \"manual\",\n PERIODIC: \"periodic\",\n ACTION_RESULT: \"action_result\",\n STATE_VERIFICATION: \"state_verification\",\n} as const;\n\n// Shape of annotation overlay on a screenshot. Was inline on\n// `ExecutionScreenshotCreate.annotations[].type` previously. No call sites\n// used a named-constant syntax, so a plain re-export suffices.\nexport type { ScreenshotAnnotationShape } from \"../generated/ScreenshotAnnotationShape\";\n\n// ============================================================================\n// Metadata & DTO Types (Tier 2, generated)\n// ============================================================================\n\nexport type { RunnerMetadata } from \"../generated/RunnerMetadata\";\nexport type { WorkflowMetadata } from \"../generated/WorkflowMetadata\";\nexport type { ExecutionStats } from \"../generated/ExecutionStats\";\nexport type { CoverageData } from \"../generated/CoverageData\";\nexport type { LLMMetrics } from \"../generated/LLMMetrics\";\n\n// ============================================================================\n// Request/Create + Response Types (Tier 2, generated)\n// ============================================================================\n\nexport type { ExecutionRunCreate } from \"../generated/ExecutionRunCreate\";\nexport type { ExecutionRunResponse } from \"../generated/ExecutionRunResponse\";\n\n// `MatchLocation` collides with `tree_events::MatchLocation` on the Rust\n// side, so the generated symbol is `ExecutionMatchLocation`. Preserve the\n// local name via a re-export alias.\nexport type { ExecutionMatchLocation as MatchLocation } from \"../generated/ExecutionMatchLocation\";\n\nexport type { ActionExecutionCreate } from \"../generated/ActionExecutionCreate\";\nexport type { ActionExecutionResponse } from \"../generated/ActionExecutionResponse\";\n\nexport type { ScreenshotAnnotation } from \"../generated/ScreenshotAnnotation\";\nexport type { ExecutionScreenshotCreate } from \"../generated/ExecutionScreenshotCreate\";\nexport type { ExecutionScreenshotResponse } from \"../generated/ExecutionScreenshotResponse\";\n\nexport type { ExecutionIssueCreate } from \"../generated/ExecutionIssueCreate\";\nexport type { ExecutionIssueResponse } from \"../generated/ExecutionIssueResponse\";\n\nexport type { ExecutionRunComplete } from \"../generated/ExecutionRunComplete\";\nexport type { ExecutionRunCompleteResponse } from \"../generated/ExecutionRunCompleteResponse\";\n\n// ============================================================================\n// Execution Status Types (real-time display) — Tier 3, hand-authored\n// ============================================================================\n\nexport type TaskComplexity = \"simple\" | \"medium\" | \"complex\";\n\nexport interface RoutingFactor {\n description: string;\n complexity: TaskComplexity;\n weight: number;\n}\n\nexport interface RoutingDecision {\n complexity: TaskComplexity;\n confidence: number;\n factors: string[];\n selectedModel: string;\n timestamp: number;\n promptPreview?: string;\n fileCount?: number;\n criteriaCount?: number;\n}\n\nexport interface RoutingStatus {\n enabled: boolean;\n decision: RoutingDecision | null;\n config: {\n simpleModel: string;\n mediumModel: string;\n complexModel: string;\n };\n}\n\nexport interface RetryAttempt {\n attemptNumber: number;\n error: string;\n timestamp: string;\n delayMs: number;\n feedbackInjected: boolean;\n}\n\nexport interface RetryState {\n attempt: number;\n lastError: string | null;\n lastAttemptAt: string | null;\n totalDelayMs: number;\n errorHistory: RetryAttempt[];\n}\n\nexport interface RetryStatus {\n enabled: boolean;\n maxRetries: number;\n feedbackInjection: boolean;\n state: RetryState;\n nextRetryDelayMs: number | null;\n exhausted: boolean;\n}\n\nexport interface TokenCount {\n total: number;\n findings: number;\n observations: number;\n feedback: number;\n solutions: number;\n other: number;\n entryCount: number;\n}\n\nexport interface CompressionResult {\n originalTokens: number;\n compressedTokens: number;\n itemsSummarized: number;\n summaryEntriesCreated: number;\n compressedCategories: string[];\n timestamp: string;\n}\n\nexport interface CompressionStatus {\n enabled: boolean;\n thresholdTokens: number;\n targetTokens: number;\n currentTokenCount: TokenCount | null;\n lastCompression: CompressionResult | null;\n thresholdPercentage: number;\n compressionImminent: boolean;\n}\n\nexport type HookTrigger =\n | \"pre_execution\"\n | \"post_execution\"\n | \"on_error\"\n | \"on_verification_fail\"\n | \"on_complete\"\n | \"pre_iteration\"\n | \"post_iteration\";\n\nexport interface HookExecutionResult {\n hookId: string;\n hookName: string;\n trigger: HookTrigger;\n success: boolean;\n output: string | null;\n error: string | null;\n durationMs: number;\n timestamp: string;\n}\n\nexport interface HookDefinition {\n id: string;\n name: string;\n trigger: HookTrigger;\n enabled: boolean;\n actionType: string;\n}\n\nexport interface HookStatus {\n hooks: HookDefinition[];\n executionHistory: HookExecutionResult[];\n currentlyExecuting: string | null;\n}\n\nexport type SubStepStatus =\n | \"pending\"\n | \"running\"\n | \"completed\"\n | \"failed\"\n | \"skipped\";\n\nexport interface SubStepInfo {\n id: string;\n parentId: string;\n name: string;\n status: SubStepStatus;\n index: number;\n totalCount: number;\n startedAt: number | null;\n completedAt: number | null;\n durationMs: number | null;\n phase?: string;\n}\n\nexport interface SubStepStatusDisplay {\n current: SubStepInfo | null;\n steps: SubStepInfo[];\n progressPercent: number;\n completedCount: number;\n totalCount: number;\n isActive: boolean;\n currentPhase: string | null;\n}\n\nexport interface ExecutionStatus {\n taskRunId: string | null;\n taskName: string | null;\n iteration: number;\n status: \"idle\" | \"running\" | \"completed\" | \"failed\" | \"paused\";\n routing: RoutingStatus;\n retry: RetryStatus;\n compression: CompressionStatus;\n hooks: HookStatus;\n subSteps: SubStepStatusDisplay;\n lastUpdated: number;\n}\n\n// ============================================================================\n// Raw Event Types (snake_case from backend) — Tier 3, hand-authored\n// ============================================================================\n\nexport interface RawExecutionStatusEventBase {\n type: string;\n task_run_id: string;\n timestamp: number;\n}\n\nexport interface RawRoutingDecisionPayload {\n complexity: string;\n confidence: number;\n factors: string[];\n selected_model: string;\n prompt_preview?: string;\n file_count?: number;\n criteria_count?: number;\n}\n\nexport interface RawRetryAttemptPayload {\n attempt_number: number;\n error: string;\n attempt_timestamp: string;\n delay_ms: number;\n feedback_injected: boolean;\n}\n\nexport interface RawRetryStatePayload {\n attempt: number;\n last_error: string | null;\n last_attempt_at: string | null;\n total_delay_ms: number;\n error_history: RawRetryAttemptPayload[];\n}\n\nexport interface RawTokenCountPayload {\n total: number;\n findings: number;\n observations: number;\n feedback: number;\n solutions: number;\n other: number;\n entry_count: number;\n}\n\nexport interface RawCompressionResultPayload {\n original_tokens: number;\n compressed_tokens: number;\n items_summarized: number;\n summary_entries_created: number;\n compressed_categories: string[];\n timestamp: string;\n}\n\nexport interface RawHookExecutionPayload {\n hook_id: string;\n hook_name: string;\n trigger: string;\n success: boolean;\n output: string | null;\n error: string | null;\n duration_ms: number;\n timestamp: string;\n}\n\nexport interface RawRoutingDecisionEvent extends RawExecutionStatusEventBase {\n type: \"routing_decision\";\n decision: RawRoutingDecisionPayload;\n}\n\nexport interface RawRetryAttemptEvent extends RawExecutionStatusEventBase {\n type: \"retry_attempt\";\n attempt: RawRetryAttemptPayload;\n state: RawRetryStatePayload;\n exhausted: boolean;\n next_retry_delay_ms: number | null;\n}\n\nexport interface RawCompressionEvent extends RawExecutionStatusEventBase {\n type: \"compression\";\n result: RawCompressionResultPayload;\n current_token_count: RawTokenCountPayload;\n}\n\nexport interface RawTokenCountUpdateEvent extends RawExecutionStatusEventBase {\n type: \"token_count_update\";\n token_count: RawTokenCountPayload;\n threshold_percentage: number;\n compression_imminent: boolean;\n}\n\nexport interface RawHookExecutionEvent extends RawExecutionStatusEventBase {\n type: \"hook_execution\";\n result: RawHookExecutionPayload;\n}\n\nexport interface RawHookStartedEvent extends RawExecutionStatusEventBase {\n type: \"hook_started\";\n hook_id: string;\n hook_name: string;\n trigger: string;\n}\n\nexport interface RawStatusChangeEvent extends RawExecutionStatusEventBase {\n type: \"status_change\";\n status: string;\n iteration: number;\n task_name: string | null;\n}\n\nexport interface RawSubStepCompleteEvent {\n type: \"sub_step_complete\";\n checkpoint_id: string;\n task_run_id: string;\n sub_step_id: string;\n description: string | null;\n timestamp: number;\n}\n\nexport interface RawSubStepStartedEvent {\n type: \"sub_step_started\";\n checkpoint_id: string;\n task_run_id: string;\n sub_step_id: string;\n sub_step_index: number;\n total_sub_steps: number;\n description: string | null;\n phase: string | null;\n timestamp: number;\n}\n\nexport type RawExecutionStatusEvent =\n | RawRoutingDecisionEvent\n | RawRetryAttemptEvent\n | RawCompressionEvent\n | RawTokenCountUpdateEvent\n | RawHookExecutionEvent\n | RawHookStartedEvent\n | RawStatusChangeEvent;\n","/**\n * Known Issues Registry Types\n *\n * Persistent known issue tracking that survives across workflow runs.\n * Issues are scoped to specs, URLs, components, or global.\n */\n\nexport type IssueCategory =\n | \"duplication\"\n | \"rendering\"\n | \"data_integrity\"\n | \"timing\"\n | \"layout\"\n | \"state\"\n | \"performance\"\n | \"encoding\"\n | \"navigation\"\n | \"authentication\"\n | \"other\";\n\nexport type ScopeType = \"global\" | \"spec\" | \"url\" | \"component\" | \"feature\";\n\nexport type DetectionMethod =\n | \"algorithmic\"\n | \"ai_judgment\"\n | \"visual\"\n | \"command\"\n | \"ui_bridge\";\n\nexport type KnownIssueSeverity = \"critical\" | \"high\" | \"medium\" | \"low\";\n\nexport type IssueStatus = \"active\" | \"resolved\" | \"monitoring\" | \"wont_fix\";\n\nexport type IssueProvenance =\n | \"manual\"\n | \"auto_detected\"\n | \"reflection\"\n | \"imported\";\n\nexport interface KnownIssue {\n id: string;\n title: string;\n description: string;\n category: IssueCategory;\n scope_type: ScopeType;\n scope_value: string | null;\n scope_tags: string[];\n detection_method: DetectionMethod;\n detection_config: Record<string, unknown>;\n pattern_template_id: string | null;\n reproduction_context: string | null;\n trigger_conditions: string[];\n severity: KnownIssueSeverity;\n status: IssueStatus;\n confidence: number;\n provenance: IssueProvenance;\n source_finding_ids: string[];\n source_task_run_id: string | null;\n verification_hint: string | null;\n verification_step_template: Record<string, unknown> | null;\n times_detected: number;\n times_checked: number;\n last_detected_at: string | null;\n last_checked_at: string | null;\n resolved_at: string | null;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CreateKnownIssueRequest {\n title: string;\n description: string;\n category: IssueCategory;\n scope_type: ScopeType;\n scope_value?: string | null;\n scope_tags?: string[];\n detection_method: DetectionMethod;\n detection_config?: Record<string, unknown>;\n pattern_template_id?: string | null;\n reproduction_context?: string | null;\n trigger_conditions?: string[];\n severity: KnownIssueSeverity;\n provenance?: IssueProvenance;\n source_finding_ids?: string[];\n source_task_run_id?: string | null;\n verification_hint?: string | null;\n verification_step_template?: Record<string, unknown> | null;\n}\n\nexport interface UpdateKnownIssueRequest {\n title?: string;\n description?: string;\n category?: IssueCategory;\n scope_type?: ScopeType;\n scope_value?: string | null;\n scope_tags?: string[];\n detection_method?: DetectionMethod;\n detection_config?: Record<string, unknown>;\n pattern_template_id?: string | null;\n reproduction_context?: string | null;\n trigger_conditions?: string[];\n severity?: KnownIssueSeverity;\n status?: IssueStatus;\n confidence?: number;\n verification_hint?: string | null;\n verification_step_template?: Record<string, unknown> | null;\n}\n\nexport interface ListKnownIssuesQuery {\n scope_type?: string;\n scope_value?: string;\n category?: string;\n severity?: string;\n status?: string;\n spec_id?: string;\n}\n\nexport interface CreatePatternTemplateRequest {\n name: string;\n description: string;\n category: string;\n detection_type: string;\n ai_prompt_template?: string | null;\n parameters?: string | null;\n}\n\nexport interface TemplateParameter {\n name: string;\n type: string;\n description: string;\n default?: unknown;\n}\n\nexport interface IssuePatternTemplate {\n id: string;\n name: string;\n description: string;\n category: string;\n detection_type: string;\n step_template: Record<string, unknown> | null;\n ai_prompt_template: string | null;\n parameters: TemplateParameter[];\n built_in: boolean;\n status: string;\n created_at: string;\n updated_at: string;\n}\n\n/** All issue categories with display labels */\nexport const ISSUE_CATEGORIES: { value: IssueCategory; label: string }[] = [\n { value: \"duplication\", label: \"Duplication\" },\n { value: \"rendering\", label: \"Rendering\" },\n { value: \"data_integrity\", label: \"Data Integrity\" },\n { value: \"timing\", label: \"Timing\" },\n { value: \"layout\", label: \"Layout\" },\n { value: \"state\", label: \"State\" },\n { value: \"performance\", label: \"Performance\" },\n { value: \"encoding\", label: \"Encoding\" },\n { value: \"navigation\", label: \"Navigation\" },\n { value: \"authentication\", label: \"Authentication\" },\n { value: \"other\", label: \"Other\" },\n];\n\n/** All severity levels with display labels */\nexport const ISSUE_SEVERITIES: { value: KnownIssueSeverity; label: string }[] = [\n { value: \"critical\", label: \"Critical\" },\n { value: \"high\", label: \"High\" },\n { value: \"medium\", label: \"Medium\" },\n { value: \"low\", label: \"Low\" },\n];\n\n/** All detection methods with display labels */\nexport const DETECTION_METHODS: { value: DetectionMethod; label: string }[] = [\n { value: \"algorithmic\", label: \"Algorithmic (automatic)\" },\n { value: \"ai_judgment\", label: \"AI Judgment\" },\n { value: \"visual\", label: \"Visual (screenshot)\" },\n { value: \"command\", label: \"Shell Command\" },\n { value: \"ui_bridge\", label: \"UI Bridge\" },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqWO,SAAS,qBACd,OACkC;AAClC,SAAO,MAAM,SAAS;AACxB;AAKO,SAAS,uBACd,OACoC;AACpC,SAAO,MAAM,SAAS;AACxB;;;AClUO,IAAM,qBAA0D;AAAA,EACrE,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AACV;AAEO,IAAM,qBAA0D;AAAA,EACrE,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AACV;AAYO,SAAS,uBACd,MACsB;A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AE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,SAAS,OAAO,QAAQ;AAAA,EACjC,EAAE,OAAO,eAAe,OAAO,cAAc;AAAA,EAC7C,EAAE,OAAO,YAAY,OAAO,WAAW;AAAA,EACvC,EAAE,OAAO,cAAc,OAAO,aAAa;AAAA,EAC3C,EAAE,OAAO,kBAAkB,OAAO,iBAAiB;AAAA,EACnD,EAAE,OAAO,SAAS,OAAO,QAAQ;AACnC;AAGO,IAAM,mBAAmE;AAAA,EAC9E,EAAE,OAAO,YAAY,OAAO,WAAW;AAAA,EACvC,EAAE,OAAO,QAAQ,OAAO,OAAO;AAAA,EAC/B,EAAE,OAAO,UAAU,OAAO,SAAS;AAAA,EACnC,EAAE,OAAO,OAAO,OAAO,MAAM;AAC/B;AAGO,IAAM,oBAAiE;AAAA,EAC5E,EAAE,OAAO,eAAe,OAAO,0BAA0B;AAAA,EACzD,EAAE,OAAO,eAAe,OAAO,cAAc;AAAA,EAC7C,EAAE,OAAO,UAAU,OAAO,sBAAsB;AAAA,EAChD,EAAE,OAAO,WAAW,OAAO,gBAAgB;AAAA,EAC3C,EAAE,OAAO,aAAa,OAAO,YAAY;AAC3C;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/render-log.ts","../src/discovery.ts","../src/workflow/_api.ts","../src/execution/_api.ts","../src/known-issues/index.ts"],"sourcesContent":["/**\n * @qontinui/shared-types\n *\n * Shared TypeScript types for the Qontinui ecosystem.\n */\n\n// Render logging types\nexport * from \"./render-log\";\n\n// Spec-check distinctness validation (Plan 04). Surfaced from the\n// auto-generated Rust mirror — see qontinui-schemas/rust/src/spec_check.rs.\nexport type { SpecValidation } from \"./generated/SpecValidation\";\nexport type { ProposalStatus } from \"./generated/ProposalStatus\";\n\n// Projects dashboard — the saved-project registry and its joined snapshot\n// view. Generated from `rust/src/projects.rs`; `SavedProject` replaces the\n// hand-written interface the runner carried in `hooks/useSavedProjects.ts`.\nexport type { SavedProject } from \"./generated/SavedProject\";\nexport type { ProjectSnapshot } from \"./generated/ProjectSnapshot\";\nexport type { ProcessStatusLite } from \"./generated/ProcessStatusLite\";\nexport type { SessionLite } from \"./generated/SessionLite\";\nexport type { SessionSource } from \"./generated/SessionSource\";\nexport type { GitLite } from \"./generated/GitLite\";\nexport type { GitCommitLite } from \"./generated/GitCommitLite\";\nexport type { PendingQuestion } from \"./generated/PendingQuestion\";\nexport type { HealthLite } from \"./generated/HealthLite\";\nexport type { HealthLevel } from \"./generated/HealthLevel\";\n\n// State discovery types\nexport * from \"./discovery\";\n\n// Workflow types — import from _api directly (not the ./workflow entry) so\n// rollup's dts bundler doesn't see the same types in two entry graphs and\n// suffix collisions with $1/$2/$3. See tsup.config.ts for the entry list.\nexport * from \"./workflow/_api\";\n\n// Task run types\nexport * from \"./task-run/_api\";\n\n// Execution types\nexport * from \"./execution/_api\";\n\n// Scheduler types\nexport * from \"./scheduler/_api\";\n\n// Runner types (canonical Runner entity)\nexport * from \"./runner/_api\";\n\n// Memory types — coord-mediated memory federation (plan\n// `2026-05-22-memories-on-coord-cross-machine.md` Phase 6).\nexport * from \"./memory/_api\";\n\n// Library types\nexport * from \"./library/_api\";\n\n// Chat types\nexport * from \"./chat/_api\";\n\n// Canvas types\nexport * from \"./canvas\";\n\n// Known Issues types\nexport * from \"./known-issues\";\n\n// State Machine types\nexport * from \"./state-machine/_api\";\n\n// Constraint Engine types\nexport * from \"./constraints/_api\";\n\n// Geometry types (screen coordinates, regions, monitors) — see\n// `@qontinui/shared-types/geometry` subpath export.\nexport * from \"./geometry/_api\";\n\n// Tree event types (execution logging) are NOT re-exported here because\n// `tree_events.ActionType` collides with `execution.ActionType` (different\n// enums, same name). Consumers should import from the subpath:\n// import { TreeEvent, ActionType } from \"@qontinui/shared-types/tree-events\";\n\n// Accessibility tree types (CDP / UIA / AT-SPI / AX capture + selectors).\nexport * from \"./accessibility/_api\";\n\n// Config types (AI context + workflow category) are NOT re-exported here\n// because `config.Context` (AI-task context) collides with `library.Context`\n// (library item with richer shape). Consumers use the subpath:\n// import { Context, Category } from \"@qontinui/shared-types/config\";\n\n// Target configuration (discriminated union for action targets) is subpath\n// only — `SearchStrategy` and other names overlap with action-schema\n// internals in consumer repos and the type surface is large.\n// import { TargetConfig } from \"@qontinui/shared-types/targets\";\n\n// RAG API types are subpath only — `SearchResultItem` and `JobStatus`\n// collide with other modules that model unrelated \"search result\" / \"job\"\n// concepts.\n// import { JobStatus, RAGDashboardStats } from \"@qontinui/shared-types/rag\";\n","/**\n * Shared Render Log Types\n *\n * These types define the render logging schema used across:\n * - qontinui-runner (Tauri desktop app) - Component-level logging\n * - qontinui-web (Next.js web app) - Full DOM snapshot logging\n *\n * The runner reads both its own logs and web's logs for verification\n * in AI feedback loops.\n *\n * NOTE: Field names use snake_case to match Rust/Python JSON serialization.\n * This ensures compatibility across all services.\n */\n\n// =============================================================================\n// Common Types\n// =============================================================================\n\n/**\n * Trigger types for render log capture.\n * What caused the render log to be captured.\n */\nexport type RenderLogTrigger =\n | \"mount\" // Component/page mounted\n | \"navigation\" // Page navigation occurred\n | \"mutation\" // DOM mutation detected (web only)\n | \"data_update\" // Data changed (runner components)\n | \"prop_change\" // Props changed (runner components)\n | \"manual\" // Explicitly triggered capture\n | \"interval\"; // Periodic capture\n\n/**\n * DOM mutation types (for web's MutationObserver).\n */\nexport type DomMutationType = \"childList\" | \"attributes\" | \"characterData\";\n\n// =============================================================================\n// Base Render Log Entry\n// =============================================================================\n\n/**\n * Base render log entry with common fields.\n * Extended by component logs and DOM snapshot logs.\n */\nexport interface RenderLogEntryBase {\n /** Unique identifier for this log entry */\n id: string;\n\n /** Unix timestamp in milliseconds when the capture occurred */\n timestamp: number;\n\n /** What triggered this capture */\n trigger: RenderLogTrigger;\n\n /** Session ID for grouping related captures */\n session_id?: string;\n}\n\n// =============================================================================\n// Runner Component Render Log (Lightweight)\n// =============================================================================\n\n/**\n * Component-level render log entry.\n * Used by qontinui-runner to log what data components render.\n *\n * Components explicitly call logRender() with their rendered data.\n * This is lightweight and focused on verifying data display.\n */\nexport interface ComponentRenderLogEntry extends RenderLogEntryBase {\n /** Type discriminator */\n type: \"component\";\n\n /** Component name (e.g., \"RunRecapTab\", \"StatusBanner\") */\n component: string;\n\n /** The data that was rendered (component-specific structure) */\n data: Record<string, unknown>;\n\n /** Sections that are visible/expanded in the component */\n visible_sections?: string[];\n\n /** Associated task run ID if applicable */\n task_run_id?: number;\n}\n\n// =============================================================================\n// Web DOM Snapshot Render Log (Comprehensive)\n// =============================================================================\n\n/**\n * Bounding rectangle for an element.\n */\nexport interface ElementRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/**\n * Single DOM element in a snapshot.\n * Recursive structure representing the DOM tree.\n */\nexport interface DomElementSnapshot {\n /** HTML tag name (lowercase) */\n tag: string;\n\n /** Element ID if present */\n id?: string;\n\n /** CSS class list */\n class_list: string[];\n\n /** Direct text content (not from children) */\n text_content?: string;\n\n /** Length of innerHTML (for size estimation) */\n inner_html_length?: number;\n\n /** Bounding rectangle relative to viewport */\n rect?: ElementRect;\n\n /** Whether the element is visible */\n is_visible: boolean;\n\n /** Computed opacity */\n opacity?: number;\n\n /** Computed display value */\n display?: string;\n\n /** Key HTML attributes */\n attributes: Record<string, string>;\n\n /** Selected computed styles */\n computed_styles?: Record<string, string>;\n\n /** Child elements (recursive) */\n children: DomElementSnapshot[];\n}\n\n/**\n * Form data extracted from the page.\n */\nexport interface FormSnapshot {\n id?: string;\n action?: string;\n method?: string;\n inputs: Array<{\n type: string;\n name: string;\n value: string;\n }>;\n}\n\n/**\n * Link data extracted from the page.\n */\nexport interface LinkSnapshot {\n href: string;\n text: string;\n}\n\n/**\n * Image data extracted from the page.\n */\nexport interface ImageSnapshot {\n src: string;\n alt?: string;\n width?: number;\n height?: number;\n}\n\n/**\n * Full DOM snapshot data.\n * Contains the entire page state for debugging.\n *\n * NOTE: The snapshot is stored as JSONB in the database, so field names\n * in the nested structure (root, forms, links, images) may vary by\n * implementation. The web frontend uses camelCase internally but that's\n * stored as-is in the JSONB field.\n */\nexport interface DomSnapshot {\n /** Root element tree (document.body) */\n root: DomElementSnapshot | null;\n\n /** Total number of elements in the tree */\n total_elements: number;\n\n /** Concatenated visible text (truncated) */\n visible_text?: string;\n\n /** Forms on the page */\n forms: FormSnapshot[];\n\n /** Links on the page */\n links: LinkSnapshot[];\n\n /** Images on the page */\n images: ImageSnapshot[];\n\n /** JavaScript console errors captured */\n errors: string[];\n\n /** JavaScript console warnings captured */\n warnings: string[];\n}\n\n/**\n * Full DOM snapshot render log entry.\n * Used by qontinui-web to capture entire page state.\n *\n * Automatically captured via MutationObserver on DOM changes.\n * Provides comprehensive debugging data.\n */\nexport interface DomSnapshotRenderLogEntry extends RenderLogEntryBase {\n /** Type discriminator */\n type: \"dom_snapshot\";\n\n /** Current page URL */\n page_url: string;\n\n /** Page title */\n page_title?: string;\n\n /** Type of DOM mutation that triggered capture (if mutation trigger) */\n mutation_type?: DomMutationType;\n\n /** CSS selector of the element that was mutated */\n target_selector?: string;\n\n /** The full DOM snapshot */\n snapshot: DomSnapshot;\n\n /** Viewport dimensions */\n viewport_width?: number;\n viewport_height?: number;\n\n /** Scroll position */\n scroll_x?: number;\n scroll_y?: number;\n\n /** Time taken to capture the snapshot in milliseconds */\n capture_duration_ms?: number;\n\n /** Number of elements captured */\n element_count?: number;\n\n /** User ID if authenticated (web only) */\n user_id?: string;\n}\n\n// =============================================================================\n// Union Type\n// =============================================================================\n\n/**\n * Any render log entry.\n * Use the `type` field to discriminate.\n */\nexport type RenderLogEntry =\n | ComponentRenderLogEntry\n | DomSnapshotRenderLogEntry;\n\n// =============================================================================\n// API Types (for REST endpoints)\n// =============================================================================\n\n/**\n * Request to create a render log entry (web API).\n */\nexport interface CreateRenderLogRequest {\n session_id: string;\n page_url: string;\n page_title?: string;\n trigger: RenderLogTrigger;\n mutation_type?: DomMutationType;\n target_selector?: string;\n snapshot: DomSnapshot;\n viewport_width?: number;\n viewport_height?: number;\n scroll_x?: number;\n scroll_y?: number;\n capture_duration_ms?: number;\n element_count?: number;\n}\n\n/**\n * Render log response from web API.\n * Includes database-generated fields.\n */\nexport interface RenderLogResponse {\n id: number;\n session_id: string;\n timestamp: string; // ISO 8601 datetime\n page_url: string;\n page_title?: string;\n trigger: RenderLogTrigger;\n mutation_type?: DomMutationType;\n target_selector?: string;\n snapshot: DomSnapshot;\n viewport_width?: number;\n viewport_height?: number;\n scroll_x?: number;\n scroll_y?: number;\n capture_duration_ms?: number;\n element_count?: number;\n user_id?: string;\n}\n\n/**\n * Summary of a render log (without full snapshot).\n */\nexport interface RenderLogSummary {\n id: number;\n session_id: string;\n timestamp: string;\n page_url: string;\n page_title?: string;\n trigger: RenderLogTrigger;\n mutation_type?: DomMutationType;\n element_count?: number;\n capture_duration_ms?: number;\n}\n\n/**\n * Paginated list of render logs.\n */\nexport interface RenderLogList {\n items: RenderLogSummary[];\n total: number;\n page: number;\n page_size: number;\n has_more: boolean;\n}\n\n/**\n * Render logging statistics.\n */\nexport interface RenderLogStats {\n enabled: boolean;\n total_snapshots: number;\n total_sessions: number;\n oldest_snapshot?: string;\n newest_snapshot?: string;\n storage_used_bytes: number;\n image_count: number;\n}\n\n// =============================================================================\n// Type Guards\n// =============================================================================\n\n/**\n * Check if a render log entry is a component log.\n */\nexport function isComponentRenderLog(\n entry: RenderLogEntry,\n): entry is ComponentRenderLogEntry {\n return entry.type === \"component\";\n}\n\n/**\n * Check if a render log entry is a DOM snapshot log.\n */\nexport function isDomSnapshotRenderLog(\n entry: RenderLogEntry,\n): entry is DomSnapshotRenderLogEntry {\n return entry.type === \"dom_snapshot\";\n}\n","/**\n * Unified State Discovery Result types.\n *\n * These types represent the output of state discovery from any source:\n * - Playwright (web extraction)\n * - UI Bridge (render log analysis)\n * - Recording (user session recording)\n * - Vision (screenshot analysis)\n * - Manual (user-defined)\n *\n * All types use camelCase field names to match the generated types from Rust\n * schemas. Converter functions are provided to transform snake_case API\n * responses into these typed objects.\n */\n\n// =============================================================================\n// Re-exports from generated types\n// =============================================================================\n\nexport type { DiscoverySourceType } from \"./generated/DiscoverySourceType\";\nexport type { TransitionTriggerType } from \"./generated/TransitionTriggerType\";\nexport type { DiscoveryBoundingBox } from \"./generated/DiscoveryBoundingBox\";\nexport type { DiscoveryTransitionTrigger } from \"./generated/DiscoveryTransitionTrigger\";\nexport type { DiscoveredStateImage } from \"./generated/DiscoveredStateImage\";\nexport type { DiscoveredState } from \"./generated/DiscoveredState\";\nexport type { DiscoveredTransition } from \"./generated/DiscoveredTransition\";\nexport type { StateDiscoveryResult } from \"./generated/StateDiscoveryResult\";\nexport type { StateDiscoveryResultSummary } from \"./generated/StateDiscoveryResultSummary\";\nexport type { StateDiscoveryResultListResponse } from \"./generated/StateDiscoveryResultListResponse\";\nexport type { StateDiscoveryResultCreate } from \"./generated/StateDiscoveryResultCreate\";\nexport type { StateDiscoveryResultUpdate } from \"./generated/StateDiscoveryResultUpdate\";\n\n// =============================================================================\n// Export/Import\n// =============================================================================\n\nexport type { StateMachineExport } from \"./generated/StateMachineExport\";\nexport type { StateMachineImport } from \"./generated/StateMachineImport\";\n\nimport type { DiscoverySourceType } from \"./generated/DiscoverySourceType\";\nimport type { DiscoveredStateImage } from \"./generated/DiscoveredStateImage\";\nimport type { DiscoveredState } from \"./generated/DiscoveredState\";\nimport type { DiscoveredTransition } from \"./generated/DiscoveredTransition\";\n\n// =============================================================================\n// Display Helpers\n// =============================================================================\n\nexport const SOURCE_TYPE_LABELS: Record<DiscoverySourceType, string> = {\n playwright: \"Web Extraction\",\n ui_bridge: \"UI Bridge\",\n recording: \"Recording\",\n vision: \"Vision\",\n manual: \"Manual\",\n};\n\nexport const SOURCE_TYPE_COLORS: Record<DiscoverySourceType, string> = {\n playwright: \"bg-blue-500/20 text-blue-400 border-blue-500/30\",\n ui_bridge: \"bg-purple-500/20 text-purple-400 border-purple-500/30\",\n recording: \"bg-green-500/20 text-green-400 border-green-500/30\",\n vision: \"bg-orange-500/20 text-orange-400 border-orange-500/30\",\n manual: \"bg-gray-500/20 text-gray-400 border-gray-500/30\",\n};\n\n// =============================================================================\n// Converter Functions (snake_case API responses -> camelCase typed objects)\n// =============================================================================\n\nimport type { StateDiscoveryResult } from \"./generated/StateDiscoveryResult\";\nimport type { StateDiscoveryResultSummary } from \"./generated/StateDiscoveryResultSummary\";\nimport type { DiscoveryBoundingBox } from \"./generated/DiscoveryBoundingBox\";\nimport type { DiscoveryTransitionTrigger } from \"./generated/DiscoveryTransitionTrigger\";\nimport type { TransitionTriggerType } from \"./generated/TransitionTriggerType\";\n\nexport function toStateDiscoveryResult(\n data: Record<string, unknown>,\n): StateDiscoveryResult {\n return {\n id: data.id as string,\n projectId: (data.projectId ?? data.project_id) as string,\n name: data.name as string,\n description: data.description as string | undefined,\n sourceType: (data.sourceType ?? data.source_type) as DiscoverySourceType,\n sourceSessionId: (data.sourceSessionId ?? data.source_session_id) as\n | string\n | undefined,\n discoveryStrategy: (data.discoveryStrategy ?? data.discovery_strategy) as\n | string\n | undefined,\n images: ((data.images as unknown[]) || []).map(toDiscoveredStateImage),\n states: ((data.states as unknown[]) || []).map(toDiscoveredState),\n transitions: ((data.transitions as unknown[]) || []).map(\n toDiscoveredTransition,\n ),\n elementToRenders:\n ((data.elementToRenders ?? data.element_to_renders) as Record<\n string,\n string[]\n >) || {},\n imageCount: (data.imageCount ?? data.image_count) as number,\n stateCount: (data.stateCount ?? data.state_count) as number,\n transitionCount: (data.transitionCount ?? data.transition_count) as number,\n renderCount: (data.renderCount ?? data.render_count) as number,\n uniqueElementCount: (data.uniqueElementCount ??\n data.unique_element_count) as number,\n confidence: data.confidence as number,\n discoveryMetadata:\n ((data.discoveryMetadata ?? data.discovery_metadata) as Record<\n string,\n unknown\n >) || {},\n createdAt: (data.createdAt ?? data.created_at) as string,\n updatedAt: (data.updatedAt ?? data.updated_at) as string,\n };\n}\n\nexport function toDiscoveredStateImage(data: unknown): DiscoveredStateImage {\n const d = data as Record<string, unknown>;\n return {\n id: d.id as string,\n screenshotId: (d.screenshotId ?? d.screenshot_id) as string | undefined,\n screenshotUrl: (d.screenshotUrl ?? d.screenshot_url) as string | undefined,\n bbox: d.bbox as DiscoveryBoundingBox,\n pixelHash: (d.pixelHash ?? d.pixel_hash) as string | undefined,\n stateId: (d.stateId ?? d.state_id) as string | undefined,\n elementType: (d.elementType ?? d.element_type) as string | undefined,\n label: d.label as string | undefined,\n confidence: (d.confidence as number) ?? 1.0,\n metadata: d.metadata as Record<string, unknown> | undefined,\n };\n}\n\nexport function toDiscoveredState(data: unknown): DiscoveredState {\n const d = data as Record<string, unknown>;\n return {\n id: d.id as string,\n name: d.name as string,\n imageIds: ((d.imageIds ?? d.image_ids) as string[]) || [],\n renderIds: ((d.renderIds ?? d.render_ids) as string[]) || [],\n elementIds: ((d.elementIds ?? d.element_ids) as string[]) || [],\n confidence: (d.confidence as number) ?? 1.0,\n description: d.description as string | undefined,\n metadata: d.metadata as Record<string, unknown> | undefined,\n };\n}\n\nexport function toDiscoveredTransition(data: unknown): DiscoveredTransition {\n const d = data as Record<string, unknown>;\n const trigger = d.trigger as Record<string, unknown> | undefined;\n return {\n id: d.id as string,\n fromStateId: (d.fromStateId ?? d.from_state_id) as string,\n toStateId: (d.toStateId ?? d.to_state_id) as string,\n trigger: trigger\n ? {\n type: (trigger.type as TransitionTriggerType) ?? \"click\",\n imageId: (trigger.imageId ?? trigger.image_id) as string | undefined,\n elementId: (trigger.elementId ?? trigger.element_id) as\n | string\n | undefined,\n selector: trigger.selector as string | undefined,\n value: trigger.value as string | undefined,\n }\n : undefined,\n confidence: (d.confidence as number) ?? 1.0,\n metadata: d.metadata as Record<string, unknown> | undefined,\n };\n}\n\nexport function toStateDiscoveryResultSummary(\n data: Record<string, unknown>,\n): StateDiscoveryResultSummary {\n return {\n id: data.id as string,\n projectId: (data.projectId ?? data.project_id) as string,\n name: data.name as string,\n description: data.description as string | undefined,\n sourceType: (data.sourceType ?? data.source_type) as DiscoverySourceType,\n discoveryStrategy: (data.discoveryStrategy ?? data.discovery_strategy) as\n | string\n | undefined,\n imageCount: (data.imageCount ?? data.image_count) as number,\n stateCount: (data.stateCount ?? data.state_count) as number,\n transitionCount: (data.transitionCount ?? data.transition_count) as number,\n confidence: data.confidence as number,\n createdAt: (data.createdAt ?? data.created_at) as string,\n };\n}\n","/**\n * Workflow Types\n *\n * Canonical type definitions for the unified Workflow Builder system.\n * Shared across qontinui-runner and qontinui-web.\n *\n * All automation is organized into four phases: Setup, Verification, Agentic, Completion.\n *\n * Execution Order:\n * Setup (once) -> [Verification <-> Agentic]* -> Completion (once)\n *\n * Step Types (4 core types):\n * command - Shell commands, checks, check groups, tests\n * ui_bridge - UI Bridge SDK interactions (navigate, execute, assert, snapshot)\n * prompt - AI task instructions\n * workflow - Run a saved workflow inline (composition)\n */\n\n// =============================================================================\n// Generated frame types — source of truth is qontinui-schemas/rust/src/workflow.rs\n// These are produced by the schemars -> JSON Schema -> json-schema-to-typescript\n// pipeline. Do NOT redeclare them here; re-export from ../generated/*.\n//\n// Step arrays on UnifiedWorkflow / WorkflowStage are typed as `unknown[]` by\n// the generator. Typed step arrays are part of the Wave 4 step migration and\n// remain hand-authored below (BaseStep, CommandStep, PromptStep, UiBridgeStep,\n// WorkflowStep, and the per-phase aliases).\n// =============================================================================\n\nexport type { LogSourceSelection } from \"../generated/LogSourceSelection\";\nexport type { HealthCheckUrl } from \"../generated/HealthCheckUrl\";\nexport type { RoutingRule } from \"../generated/RoutingRule\";\nexport type { ModelOverrideConfig } from \"../generated/ModelOverrideConfig\";\nexport type { StageCondition } from \"../generated/StageCondition\";\nexport type { RetryPolicy } from \"../generated/RetryPolicy\";\nexport type { StageOutput } from \"../generated/StageOutput\";\nexport type { StageInput } from \"../generated/StageInput\";\nexport type { WorkflowStage } from \"../generated/WorkflowStage\";\nexport type { UnifiedWorkflow } from \"../generated/UnifiedWorkflow\";\nexport type { WorkflowArchitecture } from \"../generated/WorkflowArchitecture\";\n\nexport type { BaseStepFields } from \"../generated/BaseStepFields\";\nexport type { RetrySpec } from \"../generated/RetrySpec\";\n\n// Step DTOs (generated from qontinui-types::workflow_step)\nexport type { CommandStep } from \"../generated/CommandStep\";\nexport type { PromptStep } from \"../generated/PromptStep\";\nexport type { UiBridgeStep } from \"../generated/UiBridgeStep\";\nexport type { WorkflowStep } from \"../generated/WorkflowStep\";\nexport type { UnifiedStep } from \"../generated/UnifiedStep\";\nexport type { CanonicalStep } from \"../generated/CanonicalStep\";\nexport type { HttpMethod } from \"../generated/HttpMethod\";\nexport type { ApiContentType } from \"../generated/ApiContentType\";\nexport type { ApiAssertion } from \"../generated/ApiAssertion\";\nexport type { ApiVariableExtraction } from \"../generated/ApiVariableExtraction\";\nexport type { TestType } from \"../generated/TestType\";\nexport type { PlaywrightExecutionMode } from \"../generated/PlaywrightExecutionMode\";\nexport type { CheckType } from \"../generated/CheckType\";\nexport type { CommandMode } from \"../generated/CommandMode\";\nexport type { UiBridgeAction } from \"../generated/UiBridgeAction\";\nexport type { VerificationCategoryKind } from \"../generated/VerificationCategoryKind\";\n\n// ModelOverrides is a hand-authored convenience alias: the generated\n// UnifiedWorkflow / WorkflowStage type `model_overrides` as an open\n// `{ [k: string]: ModelOverrideConfig }`, but downstream code prefers a\n// named type with known phase keys. Keep as a local alias over the generated\n// per-phase config.\nimport type { ModelOverrideConfig as _ModelOverrideConfig } from \"../generated/ModelOverrideConfig\";\n\nexport type ModelOverrides = {\n setup?: _ModelOverrideConfig;\n agentic?: _ModelOverrideConfig;\n completion?: _ModelOverrideConfig;\n verification?: _ModelOverrideConfig;\n investigation?: _ModelOverrideConfig;\n summary?: _ModelOverrideConfig;\n generation?: _ModelOverrideConfig;\n};\n\n// =============================================================================\n// Phases\n// =============================================================================\n\nexport type WorkflowPhase = \"setup\" | \"verification\" | \"agentic\" | \"completion\";\n\n// =============================================================================\n// Skill Types (re-exported from ./skill)\n// =============================================================================\n\nexport type {\n SkillCategory,\n SkillAuthor,\n SkillParameterOption,\n SkillParameter,\n SingleStepTemplate,\n MultiStepTemplate,\n CompositionTemplate,\n SkillRef,\n SkillTemplate,\n SkillDefinition,\n SkillOrigin,\n SkillExportManifest,\n SkillExport,\n SkillImportResult,\n} from \"./skill\";\n\nexport type {\n PlannedActionType,\n ElementTarget,\n PlannedAction,\n ActionPlan,\n PlannedActionResult,\n ActionPlanResult,\n ActionPlanExecuteRequest,\n} from \"./action-plan\";\n\n// =============================================================================\n// Step Types — generated from qontinui-types::workflow_step\n//\n// The four canonical step variants (CommandStep, PromptStep, UiBridgeStep,\n// WorkflowStep) and their helper unions (HttpMethod, ApiContentType, …) are\n// re-exported at the top of this file from ../generated/*. The remaining\n// hand-authored types in this section are TS-only sugar: a `BaseStep` alias\n// for consumers that still want a name for the shared-fields subset, a\n// `StepTypeName` literal that includes non-canonical runner-side variants\n// (e.g. native_accessibility) for UI listings, and the phase-alias types.\n//\n// Phase narrowing is TS-only sugar — not a wire concern. The generator emits\n// a narrow `phase` field on each variant; these aliases just group the four\n// variants by the phase that can carry them.\n// =============================================================================\n\nimport type { CommandStep as _CommandStep } from \"../generated/CommandStep\";\nimport type { PromptStep as _PromptStep } from \"../generated/PromptStep\";\nimport type { UiBridgeStep as _UiBridgeStep } from \"../generated/UiBridgeStep\";\nimport type { WorkflowStep as _WorkflowStep } from \"../generated/WorkflowStep\";\n\n/**\n * Shared-fields subset carried by every canonical step variant.\n *\n * Alias for the generated `BaseStepFields` so downstream code can still\n * reference `BaseStep` by name. Source of truth:\n * `qontinui-types::workflow_step::BaseStepFields`.\n */\nimport type { BaseStepFields as _BaseStepFields } from \"../generated/BaseStepFields\";\nexport type BaseStep = _BaseStepFields;\n\n// =============================================================================\n// Step Type Names\n// =============================================================================\n\n// Includes runner-side non-canonical variants (e.g. `native_accessibility`)\n// that appear in the UI listing but are not part of the `UnifiedStep` DTO.\nexport type StepTypeName = \"command\" | \"ui_bridge\" | \"prompt\" | \"workflow\" | \"native_accessibility\";\n\n// =============================================================================\n// Phase-alias types (TS-only sugar over the generated UnifiedStep)\n// =============================================================================\n\nexport type SetupStep = _CommandStep | _PromptStep | _UiBridgeStep | _WorkflowStep;\nexport type VerificationStep = _CommandStep | _PromptStep | _UiBridgeStep | _WorkflowStep;\nexport type AgenticStep = _PromptStep;\nexport type CompletionStep = _CommandStep | _PromptStep | _UiBridgeStep | _WorkflowStep;\n\n// =============================================================================\n// Verification Categories\n// =============================================================================\n\n// Alias for the generated `VerificationCategoryKind` union. Source of truth:\n// `qontinui-types::workflow_step::VerificationCategoryKind`. `VerificationCategoryKind`\n// itself is re-exported earlier in this file.\nimport type { VerificationCategoryKind as _VerificationCategoryKind } from \"../generated/VerificationCategoryKind\";\nexport type VerificationCategory = _VerificationCategoryKind;\n\n// =============================================================================\n// Dependency Graph\n// =============================================================================\n\nexport interface DependencyNode {\n id: string;\n label: string;\n type: string;\n phase: WorkflowPhase;\n is_referenced: boolean;\n cost_category?: string;\n}\n\nexport interface DependencyEdge {\n source: string;\n target: string;\n label?: string;\n edge_type: \"explicit_depends_on\" | \"implicit_reference\" | \"setup_provides\";\n}\n\nexport interface DependencyGraph {\n nodes: DependencyNode[];\n edges: DependencyEdge[];\n}\n\n// =============================================================================\n// Cost Annotations\n// =============================================================================\n\nexport type CostCategory =\n | \"network\"\n | \"ai_call\"\n | \"setup\"\n | \"ui_interaction\";\n\nexport interface StepCost {\n step_id: string;\n name: string;\n estimated_ms: number;\n category: CostCategory;\n has_side_effects: boolean;\n}\n\nexport interface CostAnnotations {\n steps: StepCost[];\n total_estimated_ms: number;\n}\n\n// =============================================================================\n// Quality Report\n// =============================================================================\n\nexport type QualityFindingSeverity = \"critical\" | \"warning\" | \"info\";\n\nexport type QualityFindingCategory =\n | \"verification_gap\"\n | \"missing_criterion\"\n | \"unnecessary_step\"\n | \"weak_retry\"\n | \"required_flag_violation\"\n | \"retry_inconsistency\"\n | \"data_contract_violation\"\n | \"false_positive_risk\";\n\nexport interface QualityFinding {\n finding_id: string;\n step_id?: string;\n severity: QualityFindingSeverity;\n category: QualityFindingCategory;\n description: string;\n suggested_fix?: string;\n}\n\nexport interface CoverageMatrix {\n criteria_to_steps: Record<string, string[]>;\n steps_to_criteria: Record<string, string[]>;\n uncovered_criteria: string[];\n unlinked_steps: string[];\n}\n\nexport interface QualityReport {\n findings: QualityFinding[];\n score: number;\n pass: boolean;\n coverage_matrix?: CoverageMatrix;\n}\n\n// =============================================================================\n// Export/Import Types\n// =============================================================================\n\nimport type { UnifiedWorkflow as _UnifiedWorkflow } from \"../generated/UnifiedWorkflow\";\n\nexport interface WorkflowExportManifest {\n version: string;\n exported_at: string;\n app_version: string;\n content_type: \"unified_workflow\";\n}\n\nexport interface WorkflowExport {\n manifest: WorkflowExportManifest;\n workflow: _UnifiedWorkflow;\n}\n\nexport interface WorkflowImportResult {\n workflow: _UnifiedWorkflow;\n overwritten: boolean;\n original_id: string | null;\n}\n\n// =============================================================================\n// Feature Detection\n// =============================================================================\n\nexport interface WorkflowFeatures {\n hasSetup: boolean;\n hasVerification: boolean;\n hasAgentic: boolean;\n hasCompletion: boolean;\n hasUiBridge: boolean;\n showIterationSettings: boolean;\n hasAiPrompts: boolean;\n}\n\n// =============================================================================\n// Step Type Display Info\n// =============================================================================\n\nexport interface StepTypeInfo {\n type: string;\n label: string;\n description: string;\n icon: string;\n color: string;\n phase: WorkflowPhase;\n}\n\n// =============================================================================\n// Step Type Constants\n// =============================================================================\n\nexport const STEP_TYPES: Record<WorkflowPhase, StepTypeInfo[]> = {\n setup: [\n {\n type: \"command\",\n label: \"Command\",\n description: \"Run shell commands, checks, or tests\",\n icon: \"Terminal\",\n color: \"gray\",\n phase: \"setup\",\n },\n {\n type: \"ui_bridge\",\n label: \"UI Bridge\",\n description: \"Interact with UI via UI Bridge SDK\",\n icon: \"Monitor\",\n color: \"emerald\",\n phase: \"setup\",\n },\n {\n type: \"prompt\",\n label: \"AI Task\",\n description: \"AI-driven task\",\n icon: \"Bot\",\n color: \"violet\",\n phase: \"setup\",\n },\n {\n type: \"workflow\",\n label: \"Workflow\",\n description: \"Run a saved workflow\",\n icon: \"Workflow\",\n color: \"blue\",\n phase: \"setup\",\n },\n ],\n verification: [\n {\n type: \"command\",\n label: \"Command\",\n description: \"Run commands, checks, or tests for verification\",\n icon: \"Terminal\",\n color: \"gray\",\n phase: \"verification\",\n },\n {\n type: \"ui_bridge\",\n label: \"UI Bridge\",\n description: \"Verify UI state via UI Bridge\",\n icon: \"Monitor\",\n color: \"emerald\",\n phase: \"verification\",\n },\n {\n type: \"prompt\",\n label: \"AI Verification\",\n description: \"AI-evaluated criteria\",\n icon: \"Bot\",\n color: \"violet\",\n phase: \"verification\",\n },\n {\n type: \"workflow\",\n label: \"Workflow\",\n description: \"Run a saved workflow for verification\",\n icon: \"Workflow\",\n color: \"blue\",\n phase: \"verification\",\n },\n {\n type: \"native_accessibility\",\n label: \"Native Accessibility\",\n description: \"Run a native accessibility audit using OS-level APIs\",\n icon: \"Accessibility\",\n color: \"teal\",\n phase: \"verification\",\n },\n ],\n agentic: [\n {\n type: \"prompt\",\n label: \"Prompt\",\n description: \"AI task instructions\",\n icon: \"MessageSquare\",\n color: \"amber\",\n phase: \"agentic\",\n },\n ],\n completion: [\n {\n type: \"command\",\n label: \"Command\",\n description: \"Run cleanup commands or final tests\",\n icon: \"Terminal\",\n color: \"gray\",\n phase: \"completion\",\n },\n {\n type: \"ui_bridge\",\n label: \"UI Bridge\",\n description: \"Final UI interactions\",\n icon: \"Monitor\",\n color: \"emerald\",\n phase: \"completion\",\n },\n {\n type: \"prompt\",\n label: \"AI Completion\",\n description: \"Final AI actions\",\n icon: \"Bot\",\n color: \"violet\",\n phase: \"completion\",\n },\n {\n type: \"workflow\",\n label: \"Workflow\",\n description: \"Run a saved workflow as a completion step\",\n icon: \"Workflow\",\n color: \"blue\",\n phase: \"completion\",\n },\n ],\n};\n\n// =============================================================================\n// Phase Display Info\n// =============================================================================\n\nexport const PHASE_INFO: Record<\n WorkflowPhase,\n { label: string; description: string; color: string }\n> = {\n setup: {\n label: \"Setup\",\n description: \"Runs once at the beginning\",\n color: \"blue\",\n },\n verification: {\n label: \"Verification\",\n description: \"Checks success criteria, loops with agentic\",\n color: \"green\",\n },\n agentic: {\n label: \"Agentic\",\n description: \"AI work, iterates until verification passes\",\n color: \"amber\",\n },\n completion: {\n label: \"Completion\",\n description: \"Runs once after the loop exits\",\n color: \"purple\",\n },\n};\n\n// =============================================================================\n// Summary Step Constants\n// =============================================================================\n\nexport const DEFAULT_SUMMARY_PROMPT = `Write a one-paragraph summary of all the tasks completed in this workflow. Include what was accomplished, whether the stated goal was achieved, any issues encountered and how they were resolved, and remaining work if the goal was not fully achieved. Be concise but comprehensive.`;\n","/**\n * Execution Types\n *\n * Type definitions for the unified execution reporting API that supports\n * multiple run types: QA testing, integration testing, live automation,\n * recording sessions, and debug runs.\n *\n * Tier 1 (enums) and Tier 2 (request/response DTOs) are generated from Rust\n * (source of truth: qontinui-schemas/rust/src/execution.rs). Do not edit\n * those sections by hand — regenerate via `just generate-types` (or\n * `qontinui-runner/src-tauri/scripts/generate_types.sh`).\n *\n * Tier 3 (UI display / live-status-stream types) remains hand-authored below.\n */\n\n// ============================================================================\n// Enums (Tier 1, generated)\n// ============================================================================\n//\n// For enums that had named-constant call-site syntax in the old hand-authored\n// TS (e.g. `RunType.QA_TEST`), we import the generated literal union under an\n// alias, re-export it as the type name, and declare a companion `const` object\n// with the same name so `RunType.QA_TEST` still resolves as a value. TS merges\n// the type alias and const value into one declaration usable in both\n// positions.\n\nimport type { RunType as _RunType } from \"../generated/RunType\";\nexport type RunType = _RunType;\nexport const RunType = {\n QA_TEST: \"qa_test\",\n INTEGRATION_TEST: \"integration_test\",\n LIVE_AUTOMATION: \"live_automation\",\n RECORDING: \"recording\",\n DEBUG: \"debug\",\n} as const;\n\nimport type { RunStatus as _RunStatus } from \"../generated/RunStatus\";\nexport type RunStatus = _RunStatus;\nexport const RunStatus = {\n PENDING: \"pending\",\n RUNNING: \"running\",\n COMPLETED: \"completed\",\n FAILED: \"failed\",\n TIMEOUT: \"timeout\",\n CANCELLED: \"cancelled\",\n PAUSED: \"paused\",\n} as const;\n\nimport type { ActionStatus as _ActionStatus } from \"../generated/ActionStatus\";\nexport type ActionStatus = _ActionStatus;\nexport const ActionStatus = {\n SUCCESS: \"success\",\n FAILED: \"failed\",\n TIMEOUT: \"timeout\",\n SKIPPED: \"skipped\",\n ERROR: \"error\",\n PENDING: \"pending\",\n} as const;\n\n// `ActionType` collides with `tree_events::ActionType` on the Rust side, so\n// the generated symbol is `ExecutionActionType`. We preserve the local name\n// `ActionType` for backward compatibility.\nimport type { ExecutionActionType as _ActionType } from \"../generated/ExecutionActionType\";\nexport type ActionType = _ActionType;\nexport const ActionType = {\n // Vision actions\n FIND: \"find\",\n FIND_ALL: \"find_all\",\n WAIT_FOR: \"wait_for\",\n WAIT_UNTIL_GONE: \"wait_until_gone\",\n\n // Input actions\n CLICK: \"click\",\n DOUBLE_CLICK: \"double_click\",\n RIGHT_CLICK: \"right_click\",\n TYPE: \"type\",\n PRESS_KEY: \"press_key\",\n HOTKEY: \"hotkey\",\n SCROLL: \"scroll\",\n DRAG: \"drag\",\n\n // State machine actions\n GO_TO_STATE: \"go_to_state\",\n TRANSITION: \"transition\",\n VERIFY_STATE: \"verify_state\",\n\n // Control flow\n CONDITIONAL: \"conditional\",\n LOOP: \"loop\",\n PARALLEL: \"parallel\",\n SEQUENCE: \"sequence\",\n\n // Utility\n WAIT: \"wait\",\n SCREENSHOT: \"screenshot\",\n LOG: \"log\",\n ASSERT: \"assert\",\n\n // AI actions\n AI_PROMPT: \"ai_prompt\",\n RUN_PROMPT_SEQUENCE: \"run_prompt_sequence\",\n\n // Custom/plugin\n CUSTOM: \"custom\",\n} as const;\n\nimport type { ErrorType as _ErrorType } from \"../generated/ErrorType\";\nexport type ErrorType = _ErrorType;\nexport const ErrorType = {\n ELEMENT_NOT_FOUND: \"element_not_found\",\n TIMEOUT: \"timeout\",\n ASSERTION_FAILED: \"assertion_failed\",\n CRASH: \"crash\",\n NETWORK_ERROR: \"network_error\",\n VALIDATION_ERROR: \"validation_error\",\n OTHER: \"other\",\n} as const;\n\nimport type { IssueSeverity as _IssueSeverity } from \"../generated/IssueSeverity\";\nexport type IssueSeverity = _IssueSeverity;\nexport const IssueSeverity = {\n CRITICAL: \"critical\",\n HIGH: \"high\",\n MEDIUM: \"medium\",\n LOW: \"low\",\n INFORMATIONAL: \"informational\",\n} as const;\n\nimport type { ScreenshotType as _ScreenshotType } from \"../generated/ScreenshotType\";\nexport type ScreenshotType = _ScreenshotType;\nexport const ScreenshotType = {\n ERROR: \"error\",\n SUCCESS: \"success\",\n MANUAL: \"manual\",\n PERIODIC: \"periodic\",\n ACTION_RESULT: \"action_result\",\n STATE_VERIFICATION: \"state_verification\",\n} as const;\n\n// Shape of annotation overlay on a screenshot. Was inline on\n// `ExecutionScreenshotCreate.annotations[].type` previously. No call sites\n// used a named-constant syntax, so a plain re-export suffices.\nexport type { ScreenshotAnnotationShape } from \"../generated/ScreenshotAnnotationShape\";\n\n// ============================================================================\n// Metadata & DTO Types (Tier 2, generated)\n// ============================================================================\n\nexport type { RunnerMetadata } from \"../generated/RunnerMetadata\";\nexport type { WorkflowMetadata } from \"../generated/WorkflowMetadata\";\nexport type { ExecutionStats } from \"../generated/ExecutionStats\";\nexport type { CoverageData } from \"../generated/CoverageData\";\nexport type { LLMMetrics } from \"../generated/LLMMetrics\";\n\n// ============================================================================\n// Request/Create + Response Types (Tier 2, generated)\n// ============================================================================\n\nexport type { ExecutionRunCreate } from \"../generated/ExecutionRunCreate\";\nexport type { ExecutionRunResponse } from \"../generated/ExecutionRunResponse\";\n\n// `MatchLocation` collides with `tree_events::MatchLocation` on the Rust\n// side, so the generated symbol is `ExecutionMatchLocation`. Preserve the\n// local name via a re-export alias.\nexport type { ExecutionMatchLocation as MatchLocation } from \"../generated/ExecutionMatchLocation\";\n\nexport type { ActionExecutionCreate } from \"../generated/ActionExecutionCreate\";\nexport type { ActionExecutionResponse } from \"../generated/ActionExecutionResponse\";\n\nexport type { ScreenshotAnnotation } from \"../generated/ScreenshotAnnotation\";\nexport type { ExecutionScreenshotCreate } from \"../generated/ExecutionScreenshotCreate\";\nexport type { ExecutionScreenshotResponse } from \"../generated/ExecutionScreenshotResponse\";\n\nexport type { ExecutionIssueCreate } from \"../generated/ExecutionIssueCreate\";\nexport type { ExecutionIssueResponse } from \"../generated/ExecutionIssueResponse\";\n\nexport type { ExecutionRunComplete } from \"../generated/ExecutionRunComplete\";\nexport type { ExecutionRunCompleteResponse } from \"../generated/ExecutionRunCompleteResponse\";\n\n// ============================================================================\n// Execution Status Types (real-time display) — Tier 3, hand-authored\n// ============================================================================\n\nexport type TaskComplexity = \"simple\" | \"medium\" | \"complex\";\n\nexport interface RoutingFactor {\n description: string;\n complexity: TaskComplexity;\n weight: number;\n}\n\nexport interface RoutingDecision {\n complexity: TaskComplexity;\n confidence: number;\n factors: string[];\n selectedModel: string;\n timestamp: number;\n promptPreview?: string;\n fileCount?: number;\n criteriaCount?: number;\n}\n\nexport interface RoutingStatus {\n enabled: boolean;\n decision: RoutingDecision | null;\n config: {\n simpleModel: string;\n mediumModel: string;\n complexModel: string;\n };\n}\n\nexport interface RetryAttempt {\n attemptNumber: number;\n error: string;\n timestamp: string;\n delayMs: number;\n feedbackInjected: boolean;\n}\n\nexport interface RetryState {\n attempt: number;\n lastError: string | null;\n lastAttemptAt: string | null;\n totalDelayMs: number;\n errorHistory: RetryAttempt[];\n}\n\nexport interface RetryStatus {\n enabled: boolean;\n maxRetries: number;\n feedbackInjection: boolean;\n state: RetryState;\n nextRetryDelayMs: number | null;\n exhausted: boolean;\n}\n\nexport interface TokenCount {\n total: number;\n findings: number;\n observations: number;\n feedback: number;\n solutions: number;\n other: number;\n entryCount: number;\n}\n\nexport interface CompressionResult {\n originalTokens: number;\n compressedTokens: number;\n itemsSummarized: number;\n summaryEntriesCreated: number;\n compressedCategories: string[];\n timestamp: string;\n}\n\nexport interface CompressionStatus {\n enabled: boolean;\n thresholdTokens: number;\n targetTokens: number;\n currentTokenCount: TokenCount | null;\n lastCompression: CompressionResult | null;\n thresholdPercentage: number;\n compressionImminent: boolean;\n}\n\nexport type HookTrigger =\n | \"pre_execution\"\n | \"post_execution\"\n | \"on_error\"\n | \"on_verification_fail\"\n | \"on_complete\"\n | \"pre_iteration\"\n | \"post_iteration\";\n\nexport interface HookExecutionResult {\n hookId: string;\n hookName: string;\n trigger: HookTrigger;\n success: boolean;\n output: string | null;\n error: string | null;\n durationMs: number;\n timestamp: string;\n}\n\nexport interface HookDefinition {\n id: string;\n name: string;\n trigger: HookTrigger;\n enabled: boolean;\n actionType: string;\n}\n\nexport interface HookStatus {\n hooks: HookDefinition[];\n executionHistory: HookExecutionResult[];\n currentlyExecuting: string | null;\n}\n\nexport type SubStepStatus =\n | \"pending\"\n | \"running\"\n | \"completed\"\n | \"failed\"\n | \"skipped\";\n\nexport interface SubStepInfo {\n id: string;\n parentId: string;\n name: string;\n status: SubStepStatus;\n index: number;\n totalCount: number;\n startedAt: number | null;\n completedAt: number | null;\n durationMs: number | null;\n phase?: string;\n}\n\nexport interface SubStepStatusDisplay {\n current: SubStepInfo | null;\n steps: SubStepInfo[];\n progressPercent: number;\n completedCount: number;\n totalCount: number;\n isActive: boolean;\n currentPhase: string | null;\n}\n\nexport interface ExecutionStatus {\n taskRunId: string | null;\n taskName: string | null;\n iteration: number;\n status: \"idle\" | \"running\" | \"completed\" | \"failed\" | \"paused\";\n routing: RoutingStatus;\n retry: RetryStatus;\n compression: CompressionStatus;\n hooks: HookStatus;\n subSteps: SubStepStatusDisplay;\n lastUpdated: number;\n}\n\n// ============================================================================\n// Raw Event Types (snake_case from backend) — Tier 3, hand-authored\n// ============================================================================\n\nexport interface RawExecutionStatusEventBase {\n type: string;\n task_run_id: string;\n timestamp: number;\n}\n\nexport interface RawRoutingDecisionPayload {\n complexity: string;\n confidence: number;\n factors: string[];\n selected_model: string;\n prompt_preview?: string;\n file_count?: number;\n criteria_count?: number;\n}\n\nexport interface RawRetryAttemptPayload {\n attempt_number: number;\n error: string;\n attempt_timestamp: string;\n delay_ms: number;\n feedback_injected: boolean;\n}\n\nexport interface RawRetryStatePayload {\n attempt: number;\n last_error: string | null;\n last_attempt_at: string | null;\n total_delay_ms: number;\n error_history: RawRetryAttemptPayload[];\n}\n\nexport interface RawTokenCountPayload {\n total: number;\n findings: number;\n observations: number;\n feedback: number;\n solutions: number;\n other: number;\n entry_count: number;\n}\n\nexport interface RawCompressionResultPayload {\n original_tokens: number;\n compressed_tokens: number;\n items_summarized: number;\n summary_entries_created: number;\n compressed_categories: string[];\n timestamp: string;\n}\n\nexport interface RawHookExecutionPayload {\n hook_id: string;\n hook_name: string;\n trigger: string;\n success: boolean;\n output: string | null;\n error: string | null;\n duration_ms: number;\n timestamp: string;\n}\n\nexport interface RawRoutingDecisionEvent extends RawExecutionStatusEventBase {\n type: \"routing_decision\";\n decision: RawRoutingDecisionPayload;\n}\n\nexport interface RawRetryAttemptEvent extends RawExecutionStatusEventBase {\n type: \"retry_attempt\";\n attempt: RawRetryAttemptPayload;\n state: RawRetryStatePayload;\n exhausted: boolean;\n next_retry_delay_ms: number | null;\n}\n\nexport interface RawCompressionEvent extends RawExecutionStatusEventBase {\n type: \"compression\";\n result: RawCompressionResultPayload;\n current_token_count: RawTokenCountPayload;\n}\n\nexport interface RawTokenCountUpdateEvent extends RawExecutionStatusEventBase {\n type: \"token_count_update\";\n token_count: RawTokenCountPayload;\n threshold_percentage: number;\n compression_imminent: boolean;\n}\n\nexport interface RawHookExecutionEvent extends RawExecutionStatusEventBase {\n type: \"hook_execution\";\n result: RawHookExecutionPayload;\n}\n\nexport interface RawHookStartedEvent extends RawExecutionStatusEventBase {\n type: \"hook_started\";\n hook_id: string;\n hook_name: string;\n trigger: string;\n}\n\nexport interface RawStatusChangeEvent extends RawExecutionStatusEventBase {\n type: \"status_change\";\n status: string;\n iteration: number;\n task_name: string | null;\n}\n\nexport interface RawSubStepCompleteEvent {\n type: \"sub_step_complete\";\n checkpoint_id: string;\n task_run_id: string;\n sub_step_id: string;\n description: string | null;\n timestamp: number;\n}\n\nexport interface RawSubStepStartedEvent {\n type: \"sub_step_started\";\n checkpoint_id: string;\n task_run_id: string;\n sub_step_id: string;\n sub_step_index: number;\n total_sub_steps: number;\n description: string | null;\n phase: string | null;\n timestamp: number;\n}\n\nexport type RawExecutionStatusEvent =\n | RawRoutingDecisionEvent\n | RawRetryAttemptEvent\n | RawCompressionEvent\n | RawTokenCountUpdateEvent\n | RawHookExecutionEvent\n | RawHookStartedEvent\n | RawStatusChangeEvent;\n","/**\n * Known Issues Registry Types\n *\n * Persistent known issue tracking that survives across workflow runs.\n * Issues are scoped to specs, URLs, components, or global.\n */\n\nexport type IssueCategory =\n | \"duplication\"\n | \"rendering\"\n | \"data_integrity\"\n | \"timing\"\n | \"layout\"\n | \"state\"\n | \"performance\"\n | \"encoding\"\n | \"navigation\"\n | \"authentication\"\n | \"other\";\n\nexport type ScopeType = \"global\" | \"spec\" | \"url\" | \"component\" | \"feature\";\n\nexport type DetectionMethod =\n | \"algorithmic\"\n | \"ai_judgment\"\n | \"visual\"\n | \"command\"\n | \"ui_bridge\";\n\nexport type KnownIssueSeverity = \"critical\" | \"high\" | \"medium\" | \"low\";\n\nexport type IssueStatus = \"active\" | \"resolved\" | \"monitoring\" | \"wont_fix\";\n\nexport type IssueProvenance =\n | \"manual\"\n | \"auto_detected\"\n | \"reflection\"\n | \"imported\";\n\nexport interface KnownIssue {\n id: string;\n title: string;\n description: string;\n category: IssueCategory;\n scope_type: ScopeType;\n scope_value: string | null;\n scope_tags: string[];\n detection_method: DetectionMethod;\n detection_config: Record<string, unknown>;\n pattern_template_id: string | null;\n reproduction_context: string | null;\n trigger_conditions: string[];\n severity: KnownIssueSeverity;\n status: IssueStatus;\n confidence: number;\n provenance: IssueProvenance;\n source_finding_ids: string[];\n source_task_run_id: string | null;\n verification_hint: string | null;\n verification_step_template: Record<string, unknown> | null;\n times_detected: number;\n times_checked: number;\n last_detected_at: string | null;\n last_checked_at: string | null;\n resolved_at: string | null;\n created_at: string;\n updated_at: string;\n}\n\nexport interface CreateKnownIssueRequest {\n title: string;\n description: string;\n category: IssueCategory;\n scope_type: ScopeType;\n scope_value?: string | null;\n scope_tags?: string[];\n detection_method: DetectionMethod;\n detection_config?: Record<string, unknown>;\n pattern_template_id?: string | null;\n reproduction_context?: string | null;\n trigger_conditions?: string[];\n severity: KnownIssueSeverity;\n provenance?: IssueProvenance;\n source_finding_ids?: string[];\n source_task_run_id?: string | null;\n verification_hint?: string | null;\n verification_step_template?: Record<string, unknown> | null;\n}\n\nexport interface UpdateKnownIssueRequest {\n title?: string;\n description?: string;\n category?: IssueCategory;\n scope_type?: ScopeType;\n scope_value?: string | null;\n scope_tags?: string[];\n detection_method?: DetectionMethod;\n detection_config?: Record<string, unknown>;\n pattern_template_id?: string | null;\n reproduction_context?: string | null;\n trigger_conditions?: string[];\n severity?: KnownIssueSeverity;\n status?: IssueStatus;\n confidence?: number;\n verification_hint?: string | null;\n verification_step_template?: Record<string, unknown> | null;\n}\n\nexport interface ListKnownIssuesQuery {\n scope_type?: string;\n scope_value?: string;\n category?: string;\n severity?: string;\n status?: string;\n spec_id?: string;\n}\n\nexport interface CreatePatternTemplateRequest {\n name: string;\n description: string;\n category: string;\n detection_type: string;\n ai_prompt_template?: string | null;\n parameters?: string | null;\n}\n\nexport interface TemplateParameter {\n name: string;\n type: string;\n description: string;\n default?: unknown;\n}\n\nexport interface IssuePatternTemplate {\n id: string;\n name: string;\n description: string;\n category: string;\n detection_type: string;\n step_template: Record<string, unknown> | null;\n ai_prompt_template: string | null;\n parameters: TemplateParameter[];\n built_in: boolean;\n status: string;\n created_at: string;\n updated_at: string;\n}\n\n/** All issue categories with display labels */\nexport const ISSUE_CATEGORIES: { value: IssueCategory; label: string }[] = [\n { value: \"duplication\", label: \"Duplication\" },\n { value: \"rendering\", label: \"Rendering\" },\n { value: \"data_integrity\", label: \"Data Integrity\" },\n { value: \"timing\", label: \"Timing\" },\n { value: \"layout\", label: \"Layout\" },\n { value: \"state\", label: \"State\" },\n { value: \"performance\", label: \"Performance\" },\n { value: \"encoding\", label: \"Encoding\" },\n { value: \"navigation\", label: \"Navigation\" },\n { value: \"authentication\", label: \"Authentication\" },\n { value: \"other\", label: \"Other\" },\n];\n\n/** All severity levels with display labels */\nexport const ISSUE_SEVERITIES: { value: KnownIssueSeverity; label: string }[] = [\n { value: \"critical\", label: \"Critical\" },\n { value: \"high\", label: \"High\" },\n { value: \"medium\", label: \"Medium\" },\n { value: \"low\", label: \"Low\" },\n];\n\n/** All detection methods with display labels */\nexport const DETECTION_METHODS: { value: DetectionMethod; label: string }[] = [\n { value: \"algorithmic\", label: \"Algorithmic (automatic)\" },\n { value: \"ai_judgment\", label: \"AI Judgment\" },\n { value: \"visual\", label: \"Visual (screenshot)\" },\n { value: \"command\", label: \"Shell Command\" },\n { value: \"ui_bridge\", label: \"UI Bridge\" },\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACqWO,SAAS,qBACd,OACkC;AAClC,SAAO,MAAM,SAAS;AACxB;AAKO,SAAS,uBACd,OACoC;AACpC,SAAO,MAAM,SAAS;AACxB;;;AClUO,IAAM,qBAA0D;AAAA,EACrE,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AACV;AAEO,IAAM,qBAA0D;AAAA,EACrE,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AACV;AAYO,SAAS,uBACd,MACsB;AACtB,SAAO;AAAA,IACL,IAAI,KAAK;AAAA,IACT,WAAY,KAAK,aAAa,KAAK;AAAA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