@qontinui/shared-types 0.2.1
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.
- package/README.md +128 -0
- package/dist/Region.d-BbpFAWF4.d.cts +88 -0
- package/dist/Region.d-BbpFAWF4.d.ts +88 -0
- package/dist/accessibility.cjs +19 -0
- package/dist/accessibility.cjs.map +1 -0
- package/dist/accessibility.d.cts +396 -0
- package/dist/accessibility.d.ts +396 -0
- package/dist/accessibility.js +1 -0
- package/dist/accessibility.js.map +1 -0
- package/dist/chat.cjs +19 -0
- package/dist/chat.cjs.map +1 -0
- package/dist/chat.d.cts +13 -0
- package/dist/chat.d.ts +13 -0
- package/dist/chat.js +1 -0
- package/dist/chat.js.map +1 -0
- package/dist/chunk-YXD4WCYQ.js +95 -0
- package/dist/chunk-YXD4WCYQ.js.map +1 -0
- package/dist/chunk-ZK5MJEGT.js +153 -0
- package/dist/chunk-ZK5MJEGT.js.map +1 -0
- package/dist/config.cjs +19 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +112 -0
- package/dist/config.d.ts +112 -0
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -0
- package/dist/constraints.cjs +19 -0
- package/dist/constraints.cjs.map +1 -0
- package/dist/constraints.d.cts +401 -0
- package/dist/constraints.d.ts +401 -0
- package/dist/constraints.js +1 -0
- package/dist/constraints.js.map +1 -0
- package/dist/execution.cjs +127 -0
- package/dist/execution.cjs.map +1 -0
- package/dist/execution.d.cts +1269 -0
- package/dist/execution.d.ts +1269 -0
- package/dist/execution.js +19 -0
- package/dist/execution.js.map +1 -0
- package/dist/geometry.cjs +19 -0
- package/dist/geometry.cjs.map +1 -0
- package/dist/geometry.d.cts +89 -0
- package/dist/geometry.d.ts +89 -0
- package/dist/geometry.js +1 -0
- package/dist/geometry.js.map +1 -0
- package/dist/index.cjs +443 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1325 -0
- package/dist/index.d.ts +1325 -0
- package/dist/index.js +178 -0
- package/dist/index.js.map +1 -0
- package/dist/library.cjs +19 -0
- package/dist/library.cjs.map +1 -0
- package/dist/library.d.cts +205 -0
- package/dist/library.d.ts +205 -0
- package/dist/library.js +1 -0
- package/dist/library.js.map +1 -0
- package/dist/rag.cjs +19 -0
- package/dist/rag.cjs.map +1 -0
- package/dist/rag.d.cts +630 -0
- package/dist/rag.d.ts +630 -0
- package/dist/rag.js +1 -0
- package/dist/rag.js.map +1 -0
- package/dist/runner.cjs +19 -0
- package/dist/runner.cjs.map +1 -0
- package/dist/runner.d.cts +156 -0
- package/dist/runner.d.ts +156 -0
- package/dist/runner.js +1 -0
- package/dist/runner.js.map +1 -0
- package/dist/scheduler.cjs +19 -0
- package/dist/scheduler.cjs.map +1 -0
- package/dist/scheduler.d.cts +729 -0
- package/dist/scheduler.d.ts +729 -0
- package/dist/scheduler.js +1 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/state-machine.cjs +19 -0
- package/dist/state-machine.cjs.map +1 -0
- package/dist/state-machine.d.cts +1240 -0
- package/dist/state-machine.d.ts +1240 -0
- package/dist/state-machine.js +1 -0
- package/dist/state-machine.js.map +1 -0
- package/dist/targets.cjs +19 -0
- package/dist/targets.cjs.map +1 -0
- package/dist/targets.d.cts +352 -0
- package/dist/targets.d.ts +352 -0
- package/dist/targets.js +1 -0
- package/dist/targets.js.map +1 -0
- package/dist/task-run.cjs +19 -0
- package/dist/task-run.cjs.map +1 -0
- package/dist/task-run.d.cts +1566 -0
- package/dist/task-run.d.ts +1566 -0
- package/dist/task-run.js +1 -0
- package/dist/task-run.js.map +1 -0
- package/dist/tree-events.cjs +19 -0
- package/dist/tree-events.cjs.map +1 -0
- package/dist/tree-events.d.cts +522 -0
- package/dist/tree-events.d.ts +522 -0
- package/dist/tree-events.js +1 -0
- package/dist/tree-events.js.map +1 -0
- package/dist/ui-bridge-ir.cjs +376 -0
- package/dist/ui-bridge-ir.cjs.map +1 -0
- package/dist/ui-bridge-ir.d.cts +820 -0
- package/dist/ui-bridge-ir.d.ts +820 -0
- package/dist/ui-bridge-ir.js +343 -0
- package/dist/ui-bridge-ir.js.map +1 -0
- package/dist/workflow.cjs +181 -0
- package/dist/workflow.cjs.map +1 -0
- package/dist/workflow.d.cts +2092 -0
- package/dist/workflow.d.ts +2092 -0
- package/dist/workflow.js +11 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +136 -0
- package/src/accessibility/_api.ts +17 -0
- package/src/accessibility/index.ts +1 -0
- package/src/canvas/index.ts +319 -0
- package/src/chat/_api.ts +23 -0
- package/src/chat/index.ts +1 -0
- package/src/config/_api.ts +13 -0
- package/src/config/index.ts +1 -0
- package/src/constraints/_api.ts +17 -0
- package/src/constraints/index.ts +1 -0
- package/src/discovery.ts +188 -0
- package/src/execution/_api.ts +483 -0
- package/src/execution/index.ts +1 -0
- package/src/generated/A11yAction.d.ts +11 -0
- package/src/generated/AccessibilityBackend.d.ts +12 -0
- package/src/generated/AccessibilityBounds.d.ts +17 -0
- package/src/generated/AccessibilityNode.d.ts +73 -0
- package/src/generated/AccessibilityRole.d.ts +93 -0
- package/src/generated/AccessibilityRoleCriterion.d.ts +13 -0
- package/src/generated/AccessibilitySelector.d.ts +76 -0
- package/src/generated/AccessibilitySnapshot.d.ts +43 -0
- package/src/generated/AccessibilityState.d.ts +67 -0
- package/src/generated/ActionExecutionBatch.d.ts +23 -0
- package/src/generated/ActionExecutionBatchResponse.d.ts +24 -0
- package/src/generated/ActionExecutionCreate.d.ts +124 -0
- package/src/generated/ActionExecutionListResponse.d.ts +20 -0
- package/src/generated/ActionExecutionResponse.d.ts +24 -0
- package/src/generated/ActionReliabilityStats.d.ts +54 -0
- package/src/generated/ActionResponse.d.ts +45 -0
- package/src/generated/ActionStatus.d.ts +11 -0
- package/src/generated/ActionType.d.ts +41 -0
- package/src/generated/ActiveStatesResult.d.ts +32 -0
- package/src/generated/AgenticPhaseOutput.d.ts +50 -0
- package/src/generated/AgenticStatus.d.ts +11 -0
- package/src/generated/AiWorkflow.d.ts +76 -0
- package/src/generated/ApiAssertion.d.ts +35 -0
- package/src/generated/ApiAssertionOperator.d.ts +11 -0
- package/src/generated/ApiAssertionType.d.ts +11 -0
- package/src/generated/ApiContentType.d.ts +11 -0
- package/src/generated/ApiVariableExtraction.d.ts +24 -0
- package/src/generated/AppEvent.d.ts +586 -0
- package/src/generated/AvailableTransitionsResult.d.ts +34 -0
- package/src/generated/BaseStepFields.d.ts +72 -0
- package/src/generated/BatchComputeEmbeddingRequest.d.ts +27 -0
- package/src/generated/BatchComputeEmbeddingResponse.d.ts +23 -0
- package/src/generated/BatchEmbeddingResult.d.ts +23 -0
- package/src/generated/BetweenIterations.d.ts +35 -0
- package/src/generated/BoundingBox.d.ts +18 -0
- package/src/generated/BuildPhaseConfig.d.ts +24 -0
- package/src/generated/BuiltinOverrideProposal.d.ts +27 -0
- package/src/generated/CanonicalStep.d.ts +60 -0
- package/src/generated/CatchUpPolicy.d.ts +12 -0
- package/src/generated/Category.d.ts +24 -0
- package/src/generated/CheckIssueDetail.d.ts +40 -0
- package/src/generated/CheckType.d.ts +21 -0
- package/src/generated/CodeExecutionStep.d.ts +88 -0
- package/src/generated/CommandMode.d.ts +11 -0
- package/src/generated/CommandStep.d.ts +183 -0
- package/src/generated/CommandStepPhase.d.ts +11 -0
- package/src/generated/ComponentActionInfo.d.ts +24 -0
- package/src/generated/ComponentActionRequest.d.ts +22 -0
- package/src/generated/ComputeEmbeddingRequest.d.ts +24 -0
- package/src/generated/ComputeEmbeddingResponse.d.ts +38 -0
- package/src/generated/ComputeTextEmbeddingRequest.d.ts +20 -0
- package/src/generated/ComputeTextEmbeddingResponse.d.ts +32 -0
- package/src/generated/ConditionScheduleConfig.d.ts +17 -0
- package/src/generated/ConditionStatus.d.ts +29 -0
- package/src/generated/Confidence.d.ts +11 -0
- package/src/generated/ConfidenceLevel.d.ts +11 -0
- package/src/generated/Constraint.d.ts +33 -0
- package/src/generated/ConstraintCheck.d.ts +64 -0
- package/src/generated/ConstraintProposal.d.ts +37 -0
- package/src/generated/ConstraintResult.d.ts +32 -0
- package/src/generated/ConstraintSeverity.d.ts +16 -0
- package/src/generated/ConstraintViolation.d.ts +24 -0
- package/src/generated/Context.d.ts +50 -0
- package/src/generated/ContextAutoInclude.d.ts +34 -0
- package/src/generated/CoordinateSystem.d.ts +12 -0
- package/src/generated/Coordinates.d.ts +33 -0
- package/src/generated/CostTrendDataPoint.d.ts +36 -0
- package/src/generated/CostTrendResponse.d.ts +41 -0
- package/src/generated/CoverageData.d.ts +52 -0
- package/src/generated/CreateMcpCallInput.d.ts +59 -0
- package/src/generated/CreateMcpServerInput.d.ts +48 -0
- package/src/generated/CreateOlConfigRequest.d.ts +27 -0
- package/src/generated/CreateScheduledTaskRequest.d.ts +63 -0
- package/src/generated/CreateTaskRunRequest.d.ts +51 -0
- package/src/generated/CriterionOverride.d.ts +39 -0
- package/src/generated/CriterionType.d.ts +11 -0
- package/src/generated/DagApprovalStep.d.ts +80 -0
- package/src/generated/DagCancelStep.d.ts +76 -0
- package/src/generated/DagLoopStep.d.ts +80 -0
- package/src/generated/DecomposerConfig.d.ts +31 -0
- package/src/generated/DiagnosePhaseConfig.d.ts +34 -0
- package/src/generated/DiagnosticResult.d.ts +40 -0
- package/src/generated/DiscoveredElement.d.ts +48 -0
- package/src/generated/DiscoveredState.d.ts +49 -0
- package/src/generated/DiscoveredStateImage.d.ts +56 -0
- package/src/generated/DiscoveredTransition.d.ts +44 -0
- package/src/generated/DiscoveryBoundingBox.d.ts +32 -0
- package/src/generated/DiscoveryRequest.d.ts +40 -0
- package/src/generated/DiscoveryResponse.d.ts +32 -0
- package/src/generated/DiscoverySourceType.d.ts +14 -0
- package/src/generated/DiscoveryStrategy.d.ts +13 -0
- package/src/generated/DiscoveryTransitionTrigger.d.ts +38 -0
- package/src/generated/DisplayNode.d.ts +45 -0
- package/src/generated/DomainAssignment.d.ts +50 -0
- package/src/generated/DomainKnowledge.d.ts +29 -0
- package/src/generated/DomainVerificationResult.d.ts +36 -0
- package/src/generated/ElementActionRequest.d.ts +28 -0
- package/src/generated/ElementBbox.d.ts +36 -0
- package/src/generated/ElementIdentifier.d.ts +40 -0
- package/src/generated/ElementRect.d.ts +48 -0
- package/src/generated/ElementState.d.ts +47 -0
- package/src/generated/ElementType.d.ts +45 -0
- package/src/generated/EmbeddedElement.d.ts +36 -0
- package/src/generated/EmbeddingItem.d.ts +49 -0
- package/src/generated/EmbeddingListResponse.d.ts +22 -0
- package/src/generated/EmbeddingResultItem.d.ts +29 -0
- package/src/generated/EmbeddingResultsRequest.d.ts +19 -0
- package/src/generated/EmbeddingResultsResponse.d.ts +17 -0
- package/src/generated/ErrorType.d.ts +18 -0
- package/src/generated/ExecutePlaybookStep.d.ts +84 -0
- package/src/generated/ExecutionActionType.d.ts +40 -0
- package/src/generated/ExecutionIssueBatch.d.ts +19 -0
- package/src/generated/ExecutionIssueBatchResponse.d.ts +24 -0
- package/src/generated/ExecutionIssueCreate.d.ts +57 -0
- package/src/generated/ExecutionIssueDetail.d.ts +89 -0
- package/src/generated/ExecutionIssueListResponse.d.ts +26 -0
- package/src/generated/ExecutionIssueResponse.d.ts +24 -0
- package/src/generated/ExecutionIssueUpdate.d.ts +31 -0
- package/src/generated/ExecutionMatchLocation.d.ts +31 -0
- package/src/generated/ExecutionRunComplete.d.ts +34 -0
- package/src/generated/ExecutionRunCompleteResponse.d.ts +38 -0
- package/src/generated/ExecutionRunCreate.d.ts +40 -0
- package/src/generated/ExecutionRunDetail.d.ts +76 -0
- package/src/generated/ExecutionRunListResponse.d.ts +22 -0
- package/src/generated/ExecutionRunResponse.d.ts +41 -0
- package/src/generated/ExecutionScreenshotCreate.d.ts +59 -0
- package/src/generated/ExecutionScreenshotResponse.d.ts +36 -0
- package/src/generated/ExecutionStats.d.ts +56 -0
- package/src/generated/ExecutionStep.d.ts +78 -0
- package/src/generated/ExecutionTreeResponse.d.ts +42 -0
- package/src/generated/ExecutionTrendDataPoint.d.ts +36 -0
- package/src/generated/ExecutionTrendResponse.d.ts +46 -0
- package/src/generated/ExitCheckResult.d.ts +20 -0
- package/src/generated/ExitStrategy.d.ts +27 -0
- package/src/generated/ExportResult.d.ts +30 -0
- package/src/generated/ExtendIterationsRequest.d.ts +20 -0
- package/src/generated/FileChange.d.ts +20 -0
- package/src/generated/Finding.d.ts +40 -0
- package/src/generated/FindingActionType.d.ts +13 -0
- package/src/generated/FindingBatchCreate.d.ts +27 -0
- package/src/generated/FindingCategory.d.ts +25 -0
- package/src/generated/FindingCodeContext.d.ts +31 -0
- package/src/generated/FindingCreate.d.ts +52 -0
- package/src/generated/FindingDetail.d.ts +78 -0
- package/src/generated/FindingListResponse.d.ts +40 -0
- package/src/generated/FindingOutput.d.ts +36 -0
- package/src/generated/FindingSeverity.d.ts +14 -0
- package/src/generated/FindingStatus.d.ts +15 -0
- package/src/generated/FindingSummary.d.ts +53 -0
- package/src/generated/FindingUpdate.d.ts +33 -0
- package/src/generated/FindingUserInput.d.ts +27 -0
- package/src/generated/FindingsSummary.d.ts +47 -0
- package/src/generated/FlowEvent.d.ts +66 -0
- package/src/generated/FullRunnerStep.d.ts +144 -0
- package/src/generated/GUIElementChunk.d.ts +151 -0
- package/src/generated/GateEvaluationResult.d.ts +36 -0
- package/src/generated/HealthCheckUrl.d.ts +35 -0
- package/src/generated/HistoricalActionQuery.d.ts +42 -0
- package/src/generated/HistoricalActionResult.d.ts +57 -0
- package/src/generated/HttpConfig.d.ts +27 -0
- package/src/generated/HttpMethod.d.ts +13 -0
- package/src/generated/IdleCondition.d.ts +17 -0
- package/src/generated/ImplementFixesConfig.d.ts +25 -0
- package/src/generated/IndividualCheckResult.d.ts +50 -0
- package/src/generated/InitialStateRef.d.ts +23 -0
- package/src/generated/InitialStatesSource.d.ts +18 -0
- package/src/generated/IssueSeverity.d.ts +11 -0
- package/src/generated/IssueSource.d.ts +11 -0
- package/src/generated/IssueStatus.d.ts +11 -0
- package/src/generated/IssueType.d.ts +21 -0
- package/src/generated/IterationResult.d.ts +65 -0
- package/src/generated/IterationVerificationResults.d.ts +53 -0
- package/src/generated/JobItem.d.ts +31 -0
- package/src/generated/JobListResponse.d.ts +20 -0
- package/src/generated/JobStatus.d.ts +11 -0
- package/src/generated/JobSummary.d.ts +30 -0
- package/src/generated/LLMCostSummary.d.ts +38 -0
- package/src/generated/LLMMetrics.d.ts +42 -0
- package/src/generated/LogSourceSelection.d.ts +25 -0
- package/src/generated/LoopInstanceStatus.d.ts +28 -0
- package/src/generated/LoopPhase.d.ts +26 -0
- package/src/generated/MatchAdjustment.d.ts +23 -0
- package/src/generated/MatchLocation.d.ts +22 -0
- package/src/generated/MatchMethod.d.ts +11 -0
- package/src/generated/McpCallRecord.d.ts +35 -0
- package/src/generated/McpCallsResult.d.ts +44 -0
- package/src/generated/McpConnectionRef.d.ts +25 -0
- package/src/generated/McpServerConfig.d.ts +77 -0
- package/src/generated/McpServerStatus.d.ts +42 -0
- package/src/generated/McpToolCallResult.d.ts +38 -0
- package/src/generated/McpToolInfo.d.ts +23 -0
- package/src/generated/McpToolInputSchema.d.ts +34 -0
- package/src/generated/McpTransport.d.ts +15 -0
- package/src/generated/ModelCostBreakdown.d.ts +36 -0
- package/src/generated/ModelOverrideConfig.d.ts +47 -0
- package/src/generated/Monitor.d.ts +48 -0
- package/src/generated/MonitorPosition.d.ts +13 -0
- package/src/generated/MouseButton.d.ts +13 -0
- package/src/generated/MultiLoopConfig.d.ts +32 -0
- package/src/generated/MultiLoopEntry.d.ts +32 -0
- package/src/generated/MultiLoopStatus.d.ts +37 -0
- package/src/generated/NativeAccessibilityStep.d.ts +121 -0
- package/src/generated/NavigationResult.d.ts +40 -0
- package/src/generated/NewConstraintProposal.d.ts +20 -0
- package/src/generated/NextTaskInfo.d.ts +24 -0
- package/src/generated/NodeMetadata.d.ts +47 -0
- package/src/generated/NodeStatus.d.ts +11 -0
- package/src/generated/NodeType.d.ts +11 -0
- package/src/generated/OcrEngine.d.ts +11 -0
- package/src/generated/OlConfig.d.ts +48 -0
- package/src/generated/OrchestrationLoopConfig.d.ts +87 -0
- package/src/generated/OrchestrationLoopStatus.d.ts +59 -0
- package/src/generated/Outcome.d.ts +15 -0
- package/src/generated/OutputLine.d.ts +23 -0
- package/src/generated/OutputStream.d.ts +11 -0
- package/src/generated/OverrideCollection.d.ts +18 -0
- package/src/generated/Pagination.d.ts +28 -0
- package/src/generated/ParserType.d.ts +17 -0
- package/src/generated/PathElement.d.ts +17 -0
- package/src/generated/PathfindingRequest.d.ts +24 -0
- package/src/generated/PathfindingResult.d.ts +30 -0
- package/src/generated/PathfindingStep.d.ts +36 -0
- package/src/generated/PatternOptions.d.ts +32 -0
- package/src/generated/PipelineConfig.d.ts +31 -0
- package/src/generated/PlaybackFrameRequest.d.ts +21 -0
- package/src/generated/PlaywrightExecutionMode.d.ts +11 -0
- package/src/generated/Point.d.ts +20 -0
- package/src/generated/PollingConfig.d.ts +14 -0
- package/src/generated/ProcessConfig.d.ts +96 -0
- package/src/generated/ProcessState.d.ts +15 -0
- package/src/generated/ProcessStatus.d.ts +41 -0
- package/src/generated/PromptStep.d.ts +92 -0
- package/src/generated/PromptStepPhase.d.ts +13 -0
- package/src/generated/RAGDashboardStats.d.ts +26 -0
- package/src/generated/RagCompletionEvent.d.ts +25 -0
- package/src/generated/RagProcessingStatus.d.ts +11 -0
- package/src/generated/RagProgressEvent.d.ts +27 -0
- package/src/generated/ReadConfigResponse.d.ts +20 -0
- package/src/generated/ReflectionFixOutput.d.ts +20 -0
- package/src/generated/Region.d.ts +39 -0
- package/src/generated/RepositoryInactiveCondition.d.ts +24 -0
- package/src/generated/RepositoryWatch.d.ts +20 -0
- package/src/generated/ResolvedInitialStates.d.ts +29 -0
- package/src/generated/ResolvedInitialStatesResult.d.ts +40 -0
- package/src/generated/ResourceLimits.d.ts +33 -0
- package/src/generated/RestartProcessStep.d.ts +88 -0
- package/src/generated/RetryPolicy.d.ts +24 -0
- package/src/generated/RetrySpec.d.ts +24 -0
- package/src/generated/RoleCriterion.d.ts +14 -0
- package/src/generated/RootCauseCategory.d.ts +18 -0
- package/src/generated/RoutingRule.d.ts +38 -0
- package/src/generated/RunPromptRequest.d.ts +56 -0
- package/src/generated/RunPromptResponse.d.ts +50 -0
- package/src/generated/RunPromptResponseData.d.ts +20 -0
- package/src/generated/RunStatus.d.ts +11 -0
- package/src/generated/RunType.d.ts +11 -0
- package/src/generated/Runner.d.ts +81 -0
- package/src/generated/RunnerCrash.d.ts +32 -0
- package/src/generated/RunnerMetadata.d.ts +42 -0
- package/src/generated/RunnerStatus.d.ts +12 -0
- package/src/generated/RunnerUiError.d.ts +28 -0
- package/src/generated/RuntimeData.d.ts +40 -0
- package/src/generated/SaveWorkflowArtifactStep.d.ts +80 -0
- package/src/generated/ScheduleConditions.d.ts +29 -0
- package/src/generated/ScheduleExpression.d.ts +39 -0
- package/src/generated/ScheduledTask.d.ts +104 -0
- package/src/generated/ScheduledTaskStatus.d.ts +19 -0
- package/src/generated/ScheduledTaskType.d.ts +126 -0
- package/src/generated/SchedulerSettings.d.ts +28 -0
- package/src/generated/SchedulerStatus.d.ts +31 -0
- package/src/generated/ScreenshotAnnotation.d.ts +39 -0
- package/src/generated/ScreenshotAnnotationShape.d.ts +11 -0
- package/src/generated/ScreenshotType.d.ts +11 -0
- package/src/generated/ScrollDirection.d.ts +13 -0
- package/src/generated/SearchOptions.d.ts +33 -0
- package/src/generated/SearchResultItem.d.ts +19 -0
- package/src/generated/SearchStrategy.d.ts +14 -0
- package/src/generated/SemanticSearchRequest.d.ts +26 -0
- package/src/generated/SemanticSearchResponse.d.ts +21 -0
- package/src/generated/StageCondition.d.ts +37 -0
- package/src/generated/StageInput.d.ts +27 -0
- package/src/generated/StageOutput.d.ts +20 -0
- package/src/generated/StageTransition.d.ts +30 -0
- package/src/generated/StallDetectorConfig.d.ts +31 -0
- package/src/generated/StandardActionType.d.ts +40 -0
- package/src/generated/StateContext.d.ts +17 -0
- package/src/generated/StateDiscoveryResult.d.ts +104 -0
- package/src/generated/StateDiscoveryResultCreate.d.ts +65 -0
- package/src/generated/StateDiscoveryResultListResponse.d.ts +23 -0
- package/src/generated/StateDiscoveryResultSummary.d.ts +57 -0
- package/src/generated/StateDiscoveryResultUpdate.d.ts +47 -0
- package/src/generated/StateFilterItem.d.ts +18 -0
- package/src/generated/StateMachineConfig.d.ts +45 -0
- package/src/generated/StateMachineConfigCreate.d.ts +20 -0
- package/src/generated/StateMachineConfigFull.d.ts +67 -0
- package/src/generated/StateMachineConfigUpdate.d.ts +20 -0
- package/src/generated/StateMachineExport.d.ts +64 -0
- package/src/generated/StateMachineExportFormat.d.ts +39 -0
- package/src/generated/StateMachineImport.d.ts +25 -0
- package/src/generated/StateMachineState.d.ts +71 -0
- package/src/generated/StateMachineStateCreate.d.ts +52 -0
- package/src/generated/StateMachineStateUpdate.d.ts +48 -0
- package/src/generated/StateMachineTransition.d.ts +75 -0
- package/src/generated/StateMachineTransitionCreate.d.ts +53 -0
- package/src/generated/StateMachineTransitionUpdate.d.ts +53 -0
- package/src/generated/StateNodeData.d.ts +71 -0
- package/src/generated/StatesResponse.d.ts +19 -0
- package/src/generated/StdioConfig.d.ts +34 -0
- package/src/generated/StepExecutionConfig.d.ts +37 -0
- package/src/generated/StructuredFinding.d.ts +32 -0
- package/src/generated/StructuredOverride.d.ts +24 -0
- package/src/generated/StructuredSignal.d.ts +20 -0
- package/src/generated/SuccessCriterion.d.ts +57 -0
- package/src/generated/SummarizationConfig.d.ts +35 -0
- package/src/generated/TargetConfig.d.ts +108 -0
- package/src/generated/TaskCompletionResult.d.ts +90 -0
- package/src/generated/TaskExecutionRecord.d.ts +61 -0
- package/src/generated/TaskRun.d.ts +88 -0
- package/src/generated/TaskRunBackend.d.ts +86 -0
- package/src/generated/TaskRunBackendDetail.d.ts +99 -0
- package/src/generated/TaskRunCreate.d.ts +62 -0
- package/src/generated/TaskRunFilters.d.ts +38 -0
- package/src/generated/TaskRunFinding.d.ts +100 -0
- package/src/generated/TaskRunFindingActionType.d.ts +11 -0
- package/src/generated/TaskRunFindingCategory.d.ts +24 -0
- package/src/generated/TaskRunFindingCreate.d.ts +79 -0
- package/src/generated/TaskRunFindingFilters.d.ts +28 -0
- package/src/generated/TaskRunFindingSeverity.d.ts +11 -0
- package/src/generated/TaskRunFindingStatus.d.ts +11 -0
- package/src/generated/TaskRunFindingSummary.d.ts +34 -0
- package/src/generated/TaskRunFindingUpdate.d.ts +34 -0
- package/src/generated/TaskRunFindingsListResponse.d.ts +24 -0
- package/src/generated/TaskRunListResponse.d.ts +21 -0
- package/src/generated/TaskRunSession.d.ts +40 -0
- package/src/generated/TaskRunStatus.d.ts +11 -0
- package/src/generated/TaskRunUpdate.d.ts +47 -0
- package/src/generated/TaskType.d.ts +11 -0
- package/src/generated/TerminalExitEvent.d.ts +26 -0
- package/src/generated/TerminalInfo.d.ts +69 -0
- package/src/generated/TerminalOutputEvent.d.ts +29 -0
- package/src/generated/TestType.d.ts +11 -0
- package/src/generated/TextMatchType.d.ts +11 -0
- package/src/generated/TextSearchOptions.d.ts +30 -0
- package/src/generated/Ticket.d.ts +53 -0
- package/src/generated/TicketComment.d.ts +28 -0
- package/src/generated/TicketProviderConfig.d.ts +55 -0
- package/src/generated/TicketSource.d.ts +17 -0
- package/src/generated/TicketState.d.ts +15 -0
- package/src/generated/TimingInfo.d.ts +23 -0
- package/src/generated/TopMatch.d.ts +17 -0
- package/src/generated/TransitionAction.d.ts +93 -0
- package/src/generated/TransitionActionValue.d.ts +14 -0
- package/src/generated/TransitionEdgeData.d.ts +46 -0
- package/src/generated/TransitionExecutionResult.d.ts +30 -0
- package/src/generated/TransitionInfo.d.ts +29 -0
- package/src/generated/TransitionTriggerType.d.ts +13 -0
- package/src/generated/TreeEvent.d.ts +47 -0
- package/src/generated/TreeEventCreate.d.ts +30 -0
- package/src/generated/TreeEventListResponse.d.ts +30 -0
- package/src/generated/TreeEventResponse.d.ts +47 -0
- package/src/generated/TreeEventType.d.ts +20 -0
- package/src/generated/TreeNode.d.ts +54 -0
- package/src/generated/UIBridgeCapturedToast.d.ts +22 -0
- package/src/generated/UIBridgeComponent.d.ts +45 -0
- package/src/generated/UIBridgeElement.d.ts +62 -0
- package/src/generated/UIBridgeModalInfo.d.ts +40 -0
- package/src/generated/UIBridgeModalStack.d.ts +19 -0
- package/src/generated/UIBridgeSnapshot.d.ts +67 -0
- package/src/generated/UIBridgeToastContext.d.ts +17 -0
- package/src/generated/UIBridgeUndoContext.d.ts +19 -0
- package/src/generated/UiBridgeAction.d.ts +18 -0
- package/src/generated/UiBridgeAssertType.d.ts +11 -0
- package/src/generated/UiBridgeComparisonMode.d.ts +11 -0
- package/src/generated/UiBridgeDesignAuditStep.d.ts +76 -0
- package/src/generated/UiBridgeSeverity.d.ts +11 -0
- package/src/generated/UiBridgeStep.d.ts +127 -0
- package/src/generated/UiBridgeStepPhase.d.ts +14 -0
- package/src/generated/UiBridgeVisualAssertionStep.d.ts +97 -0
- package/src/generated/UnifiedStep.d.ts +57 -0
- package/src/generated/UnifiedWorkflow.d.ts +411 -0
- package/src/generated/UpdateMcpServerInput.d.ts +28 -0
- package/src/generated/UpdateOlConfigRequest.d.ts +32 -0
- package/src/generated/UpdateScheduledTaskRequest.d.ts +71 -0
- package/src/generated/ValidateConfigRequest.d.ts +16 -0
- package/src/generated/ValidateConfigResponse.d.ts +28 -0
- package/src/generated/VectorSearchResult.d.ts +48 -0
- package/src/generated/VerificationAgentContext.d.ts +25 -0
- package/src/generated/VerificationCategoryKind.d.ts +19 -0
- package/src/generated/VerificationMethod.d.ts +20 -0
- package/src/generated/VerificationPhaseResult.d.ts +63 -0
- package/src/generated/VerificationPlan.d.ts +43 -0
- package/src/generated/VerificationResult.d.ts +44 -0
- package/src/generated/VerificationResultResponse.d.ts +65 -0
- package/src/generated/VerificationResultsListResponse.d.ts +41 -0
- package/src/generated/VerificationStepDetails.d.ts +55 -0
- package/src/generated/VerificationStepResult.d.ts +68 -0
- package/src/generated/VgaAction.d.ts +61 -0
- package/src/generated/VgaActionKind.d.ts +14 -0
- package/src/generated/VgaAutomateStep.d.ts +110 -0
- package/src/generated/VirtualDesktop.d.ts +23 -0
- package/src/generated/VisualAssertionType.d.ts +11 -0
- package/src/generated/VisualComparisonResult.d.ts +40 -0
- package/src/generated/WaitOptions.d.ts +35 -0
- package/src/generated/WorkerCoordinationMessage.d.ts +93 -0
- package/src/generated/WorkerDomain.d.ts +29 -0
- package/src/generated/WorkerInstance.d.ts +62 -0
- package/src/generated/WorkerOutput.d.ts +53 -0
- package/src/generated/WorkerSignal.d.ts +48 -0
- package/src/generated/WorkerStatus.d.ts +11 -0
- package/src/generated/WorkflowArchitecture.d.ts +16 -0
- package/src/generated/WorkflowFixupMode.d.ts +11 -0
- package/src/generated/WorkflowFixupStep.d.ts +85 -0
- package/src/generated/WorkflowInfo.d.ts +28 -0
- package/src/generated/WorkflowMetadata.d.ts +44 -0
- package/src/generated/WorkflowRefStep.d.ts +94 -0
- package/src/generated/WorkflowStage.d.ts +126 -0
- package/src/generated/WorkflowStep.d.ts +80 -0
- package/src/generated/WorkflowStepPhase.d.ts +11 -0
- package/src/generated/WriteConfigRequest.d.ts +20 -0
- package/src/generated/WriteConfigResponse.d.ts +24 -0
- package/src/generated/index.ts +421 -0
- package/src/geometry/_api.ts +16 -0
- package/src/geometry/index.ts +1 -0
- package/src/index.ts +73 -0
- package/src/known-issues/index.ts +179 -0
- package/src/library/_api.ts +326 -0
- package/src/library/index.ts +1 -0
- package/src/rag/_api.ts +47 -0
- package/src/rag/index.ts +1 -0
- package/src/render-log.ts +371 -0
- package/src/runner/_api.ts +14 -0
- package/src/runner/index.ts +1 -0
- package/src/scheduler/_api.ts +21 -0
- package/src/scheduler/index.ts +1 -0
- package/src/state-machine/_api.ts +145 -0
- package/src/state-machine/index.ts +1 -0
- package/src/targets/_api.ts +47 -0
- package/src/targets/index.ts +1 -0
- package/src/task-run/_api.ts +108 -0
- package/src/task-run/index.ts +1 -0
- package/src/tree-events/_api.ts +42 -0
- package/src/tree-events/index.ts +1 -0
- package/src/ui-bridge-ir/__tests__/legacy-roster.test.ts +182 -0
- package/src/ui-bridge-ir/__tests__/projection.test.ts +1029 -0
- package/src/ui-bridge-ir/adapter.ts +220 -0
- package/src/ui-bridge-ir/document.ts +43 -0
- package/src/ui-bridge-ir/element-criteria.ts +48 -0
- package/src/ui-bridge-ir/index.ts +23 -0
- package/src/ui-bridge-ir/ir.schema.json +210 -0
- package/src/ui-bridge-ir/primitives.ts +102 -0
- package/src/ui-bridge-ir/projection.ts +863 -0
- package/src/ui-bridge-ir/state.ts +90 -0
- package/src/ui-bridge-ir/transition.ts +92 -0
- package/src/workflow/_api.ts +474 -0
- package/src/workflow/action-plan.ts +208 -0
- package/src/workflow/index.ts +1 -0
- package/src/workflow/skill.ts +152 -0
|
@@ -0,0 +1,820 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitive IR shapes shared by states, transitions, and adapters.
|
|
3
|
+
*
|
|
4
|
+
* IR-only fields (provenance, metadata, effect) live here so that the runtime
|
|
5
|
+
* adapter can identify and strip them in one place.
|
|
6
|
+
*
|
|
7
|
+
* See ADR-001 (qontinui-dev-notes/ui-bridge-redesign/section-1-foundations/)
|
|
8
|
+
* for the rationale on each field.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Origin of an IR node. Set by the build plugin when extracting JSX wrappers,
|
|
12
|
+
* by hand when authoring a JSON IR file directly, or by a generation pipeline.
|
|
13
|
+
*/
|
|
14
|
+
interface IRProvenance {
|
|
15
|
+
/** How this declaration was authored. */
|
|
16
|
+
source: "hand-authored" | "build-plugin" | "ai-generated" | "migrated";
|
|
17
|
+
/** Source file (relative to the build root). */
|
|
18
|
+
file?: string;
|
|
19
|
+
/** Line number in the source file (1-based). */
|
|
20
|
+
line?: number;
|
|
21
|
+
/** Column in the source file (1-based). */
|
|
22
|
+
column?: number;
|
|
23
|
+
/** Build-plugin version that produced this node, if applicable. */
|
|
24
|
+
pluginVersion?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Human-authored semantic context for an IR node. Aligns with the existing
|
|
28
|
+
* ElementAnnotation shape (ui-bridge/packages/ui-bridge/src/annotations/types.ts)
|
|
29
|
+
* so the runtime SDK can write straight into the global annotation store
|
|
30
|
+
* without parallel infrastructure.
|
|
31
|
+
*/
|
|
32
|
+
interface IRMetadata {
|
|
33
|
+
/** Short human-readable description of what this state/transition represents. */
|
|
34
|
+
description?: string;
|
|
35
|
+
/** What this state/transition is for, intent-wise. */
|
|
36
|
+
purpose?: string;
|
|
37
|
+
/** Tags for grouping, filtering, and search. */
|
|
38
|
+
tags?: string[];
|
|
39
|
+
/** IDs of related elements/states/transitions. */
|
|
40
|
+
relatedElements?: string[];
|
|
41
|
+
/** Free-form notes for nuance that doesn't fit description/purpose. */
|
|
42
|
+
notes?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Whether a transition is read-only, mutating, or destructive.
|
|
46
|
+
*
|
|
47
|
+
* - "read" — query/navigate; no persistent state change.
|
|
48
|
+
* - "write" — modifies persistent state but is reversible (or has an undo).
|
|
49
|
+
* - "destructive" — irreversible state change (delete, send, charge, deploy).
|
|
50
|
+
*
|
|
51
|
+
* Drives counterfactual analysis (section 6) and gates auto-regression
|
|
52
|
+
* generation (section 9) — destructive transitions are excluded from
|
|
53
|
+
* automatic walks.
|
|
54
|
+
*/
|
|
55
|
+
type IREffect = "read" | "write" | "destructive";
|
|
56
|
+
/**
|
|
57
|
+
* Pointer from one IR document to a state/transition declared elsewhere.
|
|
58
|
+
* Used when a transition activates a state owned by another page's IR doc.
|
|
59
|
+
*/
|
|
60
|
+
interface IRCrossRef {
|
|
61
|
+
/** Document ID containing the referenced node. */
|
|
62
|
+
doc: string;
|
|
63
|
+
/** ID of the referenced state or transition within that document. */
|
|
64
|
+
ref: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Pointer to a captured visual reference (screenshot region, design token).
|
|
68
|
+
* Optional companion data — populated by section 8's visual-fusion work.
|
|
69
|
+
*/
|
|
70
|
+
interface IRVisualRef {
|
|
71
|
+
/** Path or content-addressable ID of the captured asset. */
|
|
72
|
+
asset: string;
|
|
73
|
+
/** Capture region in viewport coordinates, if applicable. */
|
|
74
|
+
region?: {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
};
|
|
80
|
+
/** Capture timestamp (epoch ms). */
|
|
81
|
+
capturedAt?: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* IR's canonical element-matching shape.
|
|
86
|
+
*
|
|
87
|
+
* Per decision #7 (SESSION_PROMPTS.md): IR adopts ui-bridge-auto's
|
|
88
|
+
* `ElementCriteria` as the canonical authoring shape — criteria survive ID
|
|
89
|
+
* drift and are descriptive rather than identity-based. The shape mirrors
|
|
90
|
+
* ui-bridge-auto/src/types/match.ts:20 exactly so the IR -> WorkflowConfig
|
|
91
|
+
* adapter is structurally identity (no rewriting at the criteria level).
|
|
92
|
+
*
|
|
93
|
+
* `elementIds: string[]` is an OPTIONAL companion the runtime SDK fills in at
|
|
94
|
+
* registration time when criteria resolve to specific registered elements.
|
|
95
|
+
* Authors write criteria; the runtime caches resolutions.
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* Minimal criteria to identify a DOM element.
|
|
99
|
+
*
|
|
100
|
+
* Mirrors `ElementCriteria` from `ui-bridge-auto/src/types/match.ts:20`.
|
|
101
|
+
* Kept as a separate copy here (not re-exported) so the IR module has no
|
|
102
|
+
* runtime dependency on ui-bridge-auto. The adapter is the single point of
|
|
103
|
+
* type-level reconciliation.
|
|
104
|
+
*/
|
|
105
|
+
interface IRElementCriteria {
|
|
106
|
+
/** ARIA role or inferred role. */
|
|
107
|
+
role?: string;
|
|
108
|
+
/** HTML tag name (e.g. "div", "button"). Heavily used in legacy specs. */
|
|
109
|
+
tagName?: string;
|
|
110
|
+
/** Exact text content (trimmed). */
|
|
111
|
+
text?: string;
|
|
112
|
+
/** Substring match on text content (case-insensitive). */
|
|
113
|
+
textContains?: string;
|
|
114
|
+
/**
|
|
115
|
+
* ARIA label (case-insensitive substring match). Synonym of `accessibleName`
|
|
116
|
+
* for the runtime SDK; the projection prefers `accessibleName` when both are
|
|
117
|
+
* present.
|
|
118
|
+
*/
|
|
119
|
+
ariaLabel?: string;
|
|
120
|
+
/**
|
|
121
|
+
* Computed accessible name (the same concept legacy specs serialize as
|
|
122
|
+
* `accessibleName`). Added section 3 so the inverse projection can
|
|
123
|
+
* round-trip without rewriting to `ariaLabel`.
|
|
124
|
+
*/
|
|
125
|
+
accessibleName?: string;
|
|
126
|
+
/** Element ID (exact string or pattern-source string). */
|
|
127
|
+
id?: string;
|
|
128
|
+
/** HTML attributes to check (exact string match). */
|
|
129
|
+
attributes?: Record<string, string>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* IR-level state declaration.
|
|
134
|
+
*
|
|
135
|
+
* Authoring-time superset of ui-bridge-auto's runtime State shape. The
|
|
136
|
+
* IR -> WorkflowConfig adapter strips IR-only fields (provenance, metadata,
|
|
137
|
+
* elementIds, incomingTransitions, visualRefs) before handing to the runtime.
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Property-level condition on a matched element. Mirrors
|
|
142
|
+
* `StateCondition` in ui-bridge-auto/src/types/state.ts:83.
|
|
143
|
+
*/
|
|
144
|
+
interface IRStateCondition {
|
|
145
|
+
element: IRElementCriteria;
|
|
146
|
+
property: "visible" | "enabled" | "checked" | "expanded" | "selected" | "text" | "value";
|
|
147
|
+
expected: unknown;
|
|
148
|
+
comparator?: "equals" | "contains" | "matches" | "greaterThan" | "lessThan";
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* IR state declaration.
|
|
152
|
+
*
|
|
153
|
+
* Anchored to ui-bridge-auto's `State` shape (ui-bridge-auto/src/types/state.ts:23)
|
|
154
|
+
* — extends it with IR-only fields. Runtime tracking fields (enteredAt,
|
|
155
|
+
* exitedAt, observationCount) are deliberately absent: those are managed by
|
|
156
|
+
* the state machine at execution time.
|
|
157
|
+
*/
|
|
158
|
+
interface IRState {
|
|
159
|
+
id: string;
|
|
160
|
+
name: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
/** Element criteria that must ALL be satisfied for this state to be active. */
|
|
163
|
+
requiredElements: IRElementCriteria[];
|
|
164
|
+
/** Element criteria where NONE may be satisfied (any match disqualifies). */
|
|
165
|
+
excludedElements?: IRElementCriteria[];
|
|
166
|
+
/** Additional property checks on matched elements. */
|
|
167
|
+
conditions?: IRStateCondition[];
|
|
168
|
+
/** Whether this is a valid initial/starting state. */
|
|
169
|
+
isInitial?: boolean;
|
|
170
|
+
/** Whether this is a terminal state (no outgoing transitions). */
|
|
171
|
+
isTerminal?: boolean;
|
|
172
|
+
/** Whether this state is modal/blocking (e.g., a dialog). */
|
|
173
|
+
blocking?: boolean;
|
|
174
|
+
/** Logical group this state belongs to. */
|
|
175
|
+
group?: string;
|
|
176
|
+
/** Navigation cost weight for pathfinding (default 1.0). */
|
|
177
|
+
pathCost?: number;
|
|
178
|
+
/**
|
|
179
|
+
* Free-text precondition required for this state to be entered, mirroring
|
|
180
|
+
* legacy `assertion.precondition` strings (e.g., "A workflow is paused at a
|
|
181
|
+
* breakpoint"). Authoring-time documentation; not enforced at runtime.
|
|
182
|
+
*/
|
|
183
|
+
precondition?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Optional companion list of element IDs that resolved at registration
|
|
186
|
+
* time. The runtime SDK fills this in when criteria resolve to specific
|
|
187
|
+
* registered elements. Authors do not set this directly.
|
|
188
|
+
*/
|
|
189
|
+
elementIds?: string[];
|
|
190
|
+
/**
|
|
191
|
+
* Derived/computed at IR-emission time — list of transitions that activate
|
|
192
|
+
* this state. Authoring-time hint for visualization; not authored directly.
|
|
193
|
+
*/
|
|
194
|
+
incomingTransitions?: string[];
|
|
195
|
+
/** Semantic metadata routed through useUIAnnotation store at runtime. */
|
|
196
|
+
metadata?: IRMetadata;
|
|
197
|
+
/** Where this declaration came from. */
|
|
198
|
+
provenance?: IRProvenance;
|
|
199
|
+
/** Cross-document references. */
|
|
200
|
+
crossRefs?: IRCrossRef[];
|
|
201
|
+
/** Optional visual reference (section 8). */
|
|
202
|
+
visualRefs?: IRVisualRef[];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* IR-level transition declaration.
|
|
207
|
+
*
|
|
208
|
+
* Anchored to ui-bridge-auto's `Transition` shape
|
|
209
|
+
* (ui-bridge-auto/src/types/transition.ts:103) and extended with IR-only
|
|
210
|
+
* fields (effect, provenance, crossRefs).
|
|
211
|
+
*
|
|
212
|
+
* `exitStates` is a HINT at the IR level — when omitted, the adapter populates
|
|
213
|
+
* `[]` so the runtime contract (which requires the field) is satisfied.
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Wait specification for the runtime to settle after an action.
|
|
218
|
+
* Mirrors `WaitSpec` in ui-bridge-auto/src/types/transition.ts:56.
|
|
219
|
+
*/
|
|
220
|
+
interface IRWaitSpec {
|
|
221
|
+
type: "idle" | "element" | "state" | "time" | "condition" | "vanish" | "change" | "stable";
|
|
222
|
+
query?: IRElementCriteria;
|
|
223
|
+
stateId?: string;
|
|
224
|
+
ms?: number;
|
|
225
|
+
timeout?: number;
|
|
226
|
+
property?: string;
|
|
227
|
+
quietPeriodMs?: number;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A single action step within a transition. Mirrors `TransitionAction` in
|
|
231
|
+
* ui-bridge-auto/src/types/transition.ts:81 with the difference that `type`
|
|
232
|
+
* is a free-form string here — the IR doesn't bind authors to a specific
|
|
233
|
+
* action vocabulary; that constraint applies at the runtime adapter layer.
|
|
234
|
+
*/
|
|
235
|
+
interface IRTransitionAction {
|
|
236
|
+
/** The action to perform (e.g., "click", "type", "submit"). */
|
|
237
|
+
type: string;
|
|
238
|
+
/** Criteria to find the target element. */
|
|
239
|
+
target: IRElementCriteria;
|
|
240
|
+
/** Action-specific parameters. */
|
|
241
|
+
params?: Record<string, unknown>;
|
|
242
|
+
/** Optional wait specification applied after this action completes. */
|
|
243
|
+
waitAfter?: IRWaitSpec;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* IR transition declaration.
|
|
247
|
+
*
|
|
248
|
+
* Authoring-time superset of ui-bridge-auto's `Transition`. Reliability
|
|
249
|
+
* tracking fields (successCount, failureCount, averageDurationMs,
|
|
250
|
+
* lastExecutedAt) are deliberately absent — the runtime owns them.
|
|
251
|
+
*/
|
|
252
|
+
interface IRTransition {
|
|
253
|
+
id: string;
|
|
254
|
+
name: string;
|
|
255
|
+
description?: string;
|
|
256
|
+
/** Precondition: all of these states must be active. */
|
|
257
|
+
fromStates: string[];
|
|
258
|
+
/** States to enter after the transition completes. */
|
|
259
|
+
activateStates: string[];
|
|
260
|
+
/**
|
|
261
|
+
* States to leave after the transition completes.
|
|
262
|
+
*
|
|
263
|
+
* IR-level HINT: omit it and the adapter defaults to `[]`. The runtime
|
|
264
|
+
* type (`Transition.exitStates: string[]` in
|
|
265
|
+
* ui-bridge-auto/src/types/transition.ts:116) requires the field; the
|
|
266
|
+
* adapter normalizes.
|
|
267
|
+
*/
|
|
268
|
+
exitStates?: string[];
|
|
269
|
+
actions: IRTransitionAction[];
|
|
270
|
+
/** Navigation cost for pathfinding (default 1.0). */
|
|
271
|
+
pathCost?: number;
|
|
272
|
+
/** Whether this transition can be reversed. */
|
|
273
|
+
bidirectional?: boolean;
|
|
274
|
+
/** Side-effect annotation. Drives counterfactual + auto-regression gating. */
|
|
275
|
+
effect?: IREffect;
|
|
276
|
+
/** Semantic metadata routed through useUIAnnotation store at runtime. */
|
|
277
|
+
metadata?: IRMetadata;
|
|
278
|
+
/** Where this declaration came from. */
|
|
279
|
+
provenance?: IRProvenance;
|
|
280
|
+
/** Cross-document references. */
|
|
281
|
+
crossRefs?: IRCrossRef[];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Top-level IR document.
|
|
286
|
+
*
|
|
287
|
+
* Versioned (`'1.0'`) container for the states + transitions that describe
|
|
288
|
+
* a page or scope of an application. Build plugins emit this shape; the
|
|
289
|
+
* adapter folds it into ui-bridge-auto's `WorkflowConfig`.
|
|
290
|
+
*/
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* IR schema version. Bump when the shape changes in a backwards-incompatible
|
|
294
|
+
* way. The adapter rejects documents whose version it does not understand.
|
|
295
|
+
*/
|
|
296
|
+
type IRVersion = "1.0";
|
|
297
|
+
/**
|
|
298
|
+
* Top-level IR document.
|
|
299
|
+
*/
|
|
300
|
+
interface IRDocument {
|
|
301
|
+
/** Schema version. */
|
|
302
|
+
version: IRVersion;
|
|
303
|
+
/** Stable document identifier (typically the page or scope name). */
|
|
304
|
+
id: string;
|
|
305
|
+
/** Human-readable document name. */
|
|
306
|
+
name: string;
|
|
307
|
+
/** Optional description of what this document covers. */
|
|
308
|
+
description?: string;
|
|
309
|
+
/** Document-level semantic metadata. */
|
|
310
|
+
metadata?: IRMetadata;
|
|
311
|
+
/** Where this document came from. */
|
|
312
|
+
provenance?: IRProvenance;
|
|
313
|
+
/** State declarations within this document. */
|
|
314
|
+
states: IRState[];
|
|
315
|
+
/** Transition declarations within this document. */
|
|
316
|
+
transitions: IRTransition[];
|
|
317
|
+
/** ID of the initial/starting state, if applicable. */
|
|
318
|
+
initialState?: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* IR -> WorkflowConfig adapter.
|
|
323
|
+
*
|
|
324
|
+
* Single point of translation between authoring-time IR (with provenance,
|
|
325
|
+
* metadata, effect, crossRefs, visualRefs) and the runtime/storage shape
|
|
326
|
+
* that ui-bridge-auto consumes. See ADR-001 (decision #6 / #7) for the
|
|
327
|
+
* boundary rationale.
|
|
328
|
+
*
|
|
329
|
+
* The output is intentionally typed structurally — this module has no
|
|
330
|
+
* runtime dependency on ui-bridge-auto. ui-bridge-auto's own tests verify
|
|
331
|
+
* end-to-end compatibility with `engine.defineStates(...)` /
|
|
332
|
+
* `engine.defineTransitions(...)` (see
|
|
333
|
+
* `ui-bridge-auto/src/__tests__/spike-ir-contract.test.ts`).
|
|
334
|
+
*/
|
|
335
|
+
|
|
336
|
+
/** Mirrors `StateConfig` from ui-bridge-auto/src/config/workflow.ts:47. */
|
|
337
|
+
interface AdaptedState {
|
|
338
|
+
id: string;
|
|
339
|
+
name: string;
|
|
340
|
+
description?: string;
|
|
341
|
+
requiredElements: IRElementCriteria[];
|
|
342
|
+
excludedElements?: IRElementCriteria[];
|
|
343
|
+
conditions?: IRStateCondition[];
|
|
344
|
+
isInitial?: boolean;
|
|
345
|
+
isTerminal?: boolean;
|
|
346
|
+
blocking?: boolean;
|
|
347
|
+
group?: string;
|
|
348
|
+
pathCost?: number;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Mirrors the runtime `TransitionDefinition` shape from
|
|
352
|
+
* ui-bridge-auto/src/state/state-machine.ts:40.
|
|
353
|
+
*
|
|
354
|
+
* Note: ui-bridge-auto has two related Transition shapes — the storage shape
|
|
355
|
+
* (`TransitionConfig` in config/workflow.ts:54, with action field named
|
|
356
|
+
* `type`) and the runtime engine shape (`TransitionDefinition` in
|
|
357
|
+
* state-machine.ts:40, with action field named `action`). The runtime engine
|
|
358
|
+
* is what consumers actually pass adapter output into via
|
|
359
|
+
* `engine.defineTransitions(...)`, so the adapter targets the runtime shape.
|
|
360
|
+
*/
|
|
361
|
+
interface AdaptedTransition {
|
|
362
|
+
id: string;
|
|
363
|
+
name: string;
|
|
364
|
+
description?: string;
|
|
365
|
+
fromStates: string[];
|
|
366
|
+
activateStates: string[];
|
|
367
|
+
/** Adapter normalizes IR's optional `exitStates` to a required array. */
|
|
368
|
+
exitStates: string[];
|
|
369
|
+
actions: AdaptedTransitionAction[];
|
|
370
|
+
pathCost?: number;
|
|
371
|
+
bidirectional?: boolean;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Mirrors the runtime `TransitionAction` from
|
|
375
|
+
* ui-bridge-auto/src/state/state-machine.ts:55.
|
|
376
|
+
*
|
|
377
|
+
* The IR uses `type` for the action verb (matching the storage-shape
|
|
378
|
+
* convention); the adapter renames it to `action` for the runtime engine.
|
|
379
|
+
*
|
|
380
|
+
* `waitAfter` is narrower than `IRWaitSpec` — the runtime engine accepts
|
|
381
|
+
* only a subset of wait types and a subset of fields. The adapter drops
|
|
382
|
+
* IR-only wait variants (e.g., `state`, `condition`) and IR-only fields
|
|
383
|
+
* (e.g., `property`, `quietPeriodMs`). Authors can still express richer
|
|
384
|
+
* waits in the IR; they just don't survive the runtime contract.
|
|
385
|
+
*/
|
|
386
|
+
interface AdaptedWaitAfter {
|
|
387
|
+
type: "idle" | "element" | "time" | "vanish" | "change" | "stable";
|
|
388
|
+
query?: IRElementCriteria;
|
|
389
|
+
ms?: number;
|
|
390
|
+
timeout?: number;
|
|
391
|
+
}
|
|
392
|
+
interface AdaptedTransitionAction {
|
|
393
|
+
/** Action verb — renamed from IR's `type` to match the runtime contract. */
|
|
394
|
+
action: string;
|
|
395
|
+
target: IRElementCriteria;
|
|
396
|
+
params?: Record<string, unknown>;
|
|
397
|
+
waitAfter?: AdaptedWaitAfter;
|
|
398
|
+
}
|
|
399
|
+
/** Mirrors `WorkflowConfig` from ui-bridge-auto/src/config/workflow.ts:67. */
|
|
400
|
+
interface AdaptedWorkflowConfig {
|
|
401
|
+
id: string;
|
|
402
|
+
name: string;
|
|
403
|
+
description?: string;
|
|
404
|
+
version?: string;
|
|
405
|
+
states: AdaptedState[];
|
|
406
|
+
transitions: AdaptedTransition[];
|
|
407
|
+
initialState?: string;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Convert an IR state declaration into the runtime/storage state shape.
|
|
411
|
+
* Strips IR-only fields (metadata, provenance, elementIds,
|
|
412
|
+
* incomingTransitions, crossRefs, visualRefs).
|
|
413
|
+
*/
|
|
414
|
+
declare function adaptIRState(state: IRState): AdaptedState;
|
|
415
|
+
/**
|
|
416
|
+
* Convert an IR transition action into the runtime action shape.
|
|
417
|
+
* Renames IR's `type` to runtime's `action`; narrows `waitAfter` to the
|
|
418
|
+
* runtime-accepted subset.
|
|
419
|
+
*/
|
|
420
|
+
declare function adaptIRTransitionAction(action: IRTransitionAction): AdaptedTransitionAction;
|
|
421
|
+
/**
|
|
422
|
+
* Convert an IR transition declaration into the runtime/storage transition
|
|
423
|
+
* shape. Strips IR-only fields (effect, metadata, provenance, crossRefs)
|
|
424
|
+
* and defaults `exitStates` to `[]` when omitted.
|
|
425
|
+
*/
|
|
426
|
+
declare function adaptIRTransition(transition: IRTransition): AdaptedTransition;
|
|
427
|
+
/**
|
|
428
|
+
* Convert a top-level IR document into the runtime `WorkflowConfig` shape.
|
|
429
|
+
*
|
|
430
|
+
* Throws on unknown IR versions to fail loudly rather than silently emit
|
|
431
|
+
* stale shapes.
|
|
432
|
+
*/
|
|
433
|
+
declare function adaptIRDocumentToWorkflowConfig(doc: IRDocument): AdaptedWorkflowConfig;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* IR -> Bundled-Page Legacy Spec projection.
|
|
437
|
+
*
|
|
438
|
+
* Single point of translation between authoring-time IR (`IRDocument`) and the
|
|
439
|
+
* legacy `*.spec.uibridge.json` shape that existing tooling still consumes
|
|
440
|
+
* (`/update-spec`, runner spec drift / verify, error monitor curator,
|
|
441
|
+
* spec experimentation, AI session). See ADR-001 (decision #6 / #7) for the
|
|
442
|
+
* boundary rationale; section 2 of the UI Bridge redesign for the projection's
|
|
443
|
+
* role in keeping legacy consumers working through the migration.
|
|
444
|
+
*
|
|
445
|
+
* The projection is a PURE FUNCTION — same input always produces byte-identical
|
|
446
|
+
* output. Keys within objects are sorted lexicographically, arrays preserve
|
|
447
|
+
* input order, and no timestamps / random IDs are introduced. Downstream tests
|
|
448
|
+
* may hash the JSON output for byte-stable assertions.
|
|
449
|
+
*
|
|
450
|
+
* ---------------------------------------------------------------------------
|
|
451
|
+
* Mapping rules (worked example below)
|
|
452
|
+
* ---------------------------------------------------------------------------
|
|
453
|
+
*
|
|
454
|
+
* IRDocument LegacySpec
|
|
455
|
+
* ---------- ----------
|
|
456
|
+
* doc.id -> metadata.component
|
|
457
|
+
* doc.metadata?.purpose ?? doc.id -> metadata.component (purpose wins if present)
|
|
458
|
+
* doc.description ?? doc.name -> description
|
|
459
|
+
* doc.metadata?.tags -> metadata.tags
|
|
460
|
+
*
|
|
461
|
+
* For each IRState:
|
|
462
|
+
* state -> one entry in groups[]
|
|
463
|
+
* state.id -> group.id
|
|
464
|
+
* state.name -> group.name
|
|
465
|
+
* state.description ??
|
|
466
|
+
* state.metadata?.description -> group.description
|
|
467
|
+
* "element-presence" -> group.category (default)
|
|
468
|
+
* state.provenance?.source ??
|
|
469
|
+
* "ai-generated" -> group.source
|
|
470
|
+
*
|
|
471
|
+
* For each requiredElement of state:
|
|
472
|
+
* (state, criteria, index) -> one assertion in group.assertions[]
|
|
473
|
+
* "${state.id}-elem-${index}" -> assertion.id
|
|
474
|
+
* state.metadata?.description ?? -> assertion.description
|
|
475
|
+
* "Required element ${index} ..."
|
|
476
|
+
* "element-presence" -> assertion.category
|
|
477
|
+
* "critical" -> assertion.severity
|
|
478
|
+
* "exists" -> assertion.assertionType
|
|
479
|
+
* {
|
|
480
|
+
* type: "search",
|
|
481
|
+
* criteria: convert(criteria), -> assertion.target
|
|
482
|
+
* label: "Required element ..."
|
|
483
|
+
* }
|
|
484
|
+
* "ai-generated" -> assertion.source
|
|
485
|
+
* false -> assertion.reviewed
|
|
486
|
+
* true -> assertion.enabled
|
|
487
|
+
*
|
|
488
|
+
* If state has zero requiredElements, the projected `group.assertions[]`
|
|
489
|
+
* is the empty array — legacy specs ship architecture-only groups with
|
|
490
|
+
* empty assertions, and the inverse projection's identity round-trip
|
|
491
|
+
* depends on preserving that emptiness. (Earlier versions emitted a
|
|
492
|
+
* placeholder assertion here, which silently grew the assertion count
|
|
493
|
+
* during round-trip and tripped `check-spec-pairing`.)
|
|
494
|
+
*
|
|
495
|
+
* Each IRState -> one entry in stateMachine.states[]
|
|
496
|
+
* state.id -> sm-state.id
|
|
497
|
+
* state.name -> sm-state.name
|
|
498
|
+
* state.description ?? "" -> sm-state.description
|
|
499
|
+
* state.requiredElements (converted) -> sm-state.elements
|
|
500
|
+
* state.isInitial ??
|
|
501
|
+
* (state.id === doc.initialState) -> sm-state.isInitial
|
|
502
|
+
* transitions originating from state -> sm-state.transitions
|
|
503
|
+
*
|
|
504
|
+
* For each IRTransition:
|
|
505
|
+
* For each fromState in transition.fromStates:
|
|
506
|
+
* transition -> one entry in
|
|
507
|
+
* stateMachine.states[fromState].transitions[]
|
|
508
|
+
* transition.id -> sm-transition.id
|
|
509
|
+
* transition.name -> sm-transition.name
|
|
510
|
+
* transition.activateStates -> sm-transition.activateStates
|
|
511
|
+
* transition.exitStates ?? [] -> sm-transition.deactivateStates
|
|
512
|
+
* (exitStates.length === 0) -> sm-transition.staysVisible
|
|
513
|
+
*
|
|
514
|
+
* For each action in transition.actions:
|
|
515
|
+
* action.type -> process[].action (rename type -> action)
|
|
516
|
+
* action.target -> process[].target (criteria converted)
|
|
517
|
+
* action.waitAfter -> process[].waitAfter (passed through)
|
|
518
|
+
*
|
|
519
|
+
* Element-criteria conversion (IRElementCriteria -> legacy criteria):
|
|
520
|
+
* text -> textContent
|
|
521
|
+
* ariaLabel -> accessibleName
|
|
522
|
+
* attributes -> dataAttributes
|
|
523
|
+
* (others — role, textContains, id — pass through unchanged)
|
|
524
|
+
*
|
|
525
|
+
* ---------------------------------------------------------------------------
|
|
526
|
+
* Worked example
|
|
527
|
+
* ---------------------------------------------------------------------------
|
|
528
|
+
*
|
|
529
|
+
* const ir: IRDocument = {
|
|
530
|
+
* version: "1.0",
|
|
531
|
+
* id: "active",
|
|
532
|
+
* name: "Active Dashboard",
|
|
533
|
+
* description: "Real-time monitoring hub",
|
|
534
|
+
* metadata: { tags: ["monitoring", "tier-1"] },
|
|
535
|
+
* states: [
|
|
536
|
+
* {
|
|
537
|
+
* id: "running",
|
|
538
|
+
* name: "Running",
|
|
539
|
+
* description: "Workflow executing",
|
|
540
|
+
* requiredElements: [{ role: "button", text: "Stop" }],
|
|
541
|
+
* isInitial: false,
|
|
542
|
+
* },
|
|
543
|
+
* ],
|
|
544
|
+
* transitions: [
|
|
545
|
+
* {
|
|
546
|
+
* id: "running-to-idle",
|
|
547
|
+
* name: "Stop",
|
|
548
|
+
* fromStates: ["running"],
|
|
549
|
+
* activateStates: ["idle"],
|
|
550
|
+
* exitStates: ["running"],
|
|
551
|
+
* actions: [
|
|
552
|
+
* {
|
|
553
|
+
* type: "click",
|
|
554
|
+
* target: { role: "button", text: "Stop" },
|
|
555
|
+
* waitAfter: { type: "idle", timeout: 3000 },
|
|
556
|
+
* },
|
|
557
|
+
* ],
|
|
558
|
+
* },
|
|
559
|
+
* ],
|
|
560
|
+
* initialState: "idle",
|
|
561
|
+
* };
|
|
562
|
+
*
|
|
563
|
+
* projectIRToBundledPage(ir, "Notes from author")
|
|
564
|
+
* // -> {
|
|
565
|
+
* // version: "1.0.0",
|
|
566
|
+
* // description: "Real-time monitoring hub\n\nNotes from author",
|
|
567
|
+
* // groups: [{
|
|
568
|
+
* // id: "running",
|
|
569
|
+
* // name: "Running",
|
|
570
|
+
* // description: "Workflow executing",
|
|
571
|
+
* // category: "element-presence",
|
|
572
|
+
* // assertions: [{
|
|
573
|
+
* // id: "running-elem-0",
|
|
574
|
+
* // description: "Required element 0 for state Running",
|
|
575
|
+
* // category: "element-presence",
|
|
576
|
+
* // severity: "critical",
|
|
577
|
+
* // assertionType: "exists",
|
|
578
|
+
* // target: {
|
|
579
|
+
* // type: "search",
|
|
580
|
+
* // criteria: { role: "button", textContent: "Stop" },
|
|
581
|
+
* // label: "Required element for Running",
|
|
582
|
+
* // },
|
|
583
|
+
* // source: "ai-generated",
|
|
584
|
+
* // reviewed: false,
|
|
585
|
+
* // enabled: true,
|
|
586
|
+
* // }],
|
|
587
|
+
* // source: "ai-generated",
|
|
588
|
+
* // }],
|
|
589
|
+
* // stateMachine: {
|
|
590
|
+
* // states: [{
|
|
591
|
+
* // id: "running",
|
|
592
|
+
* // name: "Running",
|
|
593
|
+
* // description: "Workflow executing",
|
|
594
|
+
* // elements: [{ role: "button", textContent: "Stop" }],
|
|
595
|
+
* // isInitial: false,
|
|
596
|
+
* // transitions: [{
|
|
597
|
+
* // id: "running-to-idle",
|
|
598
|
+
* // name: "Stop",
|
|
599
|
+
* // activateStates: ["idle"],
|
|
600
|
+
* // deactivateStates: ["running"],
|
|
601
|
+
* // staysVisible: false,
|
|
602
|
+
* // process: [{
|
|
603
|
+
* // action: "click",
|
|
604
|
+
* // target: { role: "button", textContent: "Stop" },
|
|
605
|
+
* // waitAfter: { type: "idle", timeout: 3000 },
|
|
606
|
+
* // }],
|
|
607
|
+
* // }],
|
|
608
|
+
* // }],
|
|
609
|
+
* // },
|
|
610
|
+
* // metadata: { component: "active", tags: ["monitoring", "tier-1"] },
|
|
611
|
+
* // }
|
|
612
|
+
*/
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Projection version. Bump on shape changes that consumers must adapt to.
|
|
616
|
+
* Independent from `IRVersion` because the legacy spec shape and the IR shape
|
|
617
|
+
* evolve on different cadences.
|
|
618
|
+
*/
|
|
619
|
+
declare const projectionVersion = "1.0";
|
|
620
|
+
/**
|
|
621
|
+
* Legacy element-criteria shape (after conversion from `IRElementCriteria`).
|
|
622
|
+
*
|
|
623
|
+
* The differences from `IRElementCriteria`:
|
|
624
|
+
* - `text` -> `textContent`
|
|
625
|
+
* - `ariaLabel` -> `accessibleName` (when IR has no explicit `accessibleName`)
|
|
626
|
+
* - `attributes` -> `dataAttributes`
|
|
627
|
+
*
|
|
628
|
+
* Other fields (`role`, `tagName`, `textContains`, `accessibleName`, `id`)
|
|
629
|
+
* pass through unchanged. Index signature stays open for legacy fields the
|
|
630
|
+
* IR doesn't yet model.
|
|
631
|
+
*/
|
|
632
|
+
interface LegacyCriteria {
|
|
633
|
+
role?: string;
|
|
634
|
+
tagName?: string;
|
|
635
|
+
textContent?: string;
|
|
636
|
+
textContains?: string;
|
|
637
|
+
accessibleName?: string;
|
|
638
|
+
id?: string;
|
|
639
|
+
dataAttributes?: Record<string, string>;
|
|
640
|
+
[key: string]: unknown;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Legacy assertion target. Always `type: "search"` for the projection — the
|
|
644
|
+
* legacy schema also supports point/region targets, but the IR doesn't
|
|
645
|
+
* express those.
|
|
646
|
+
*/
|
|
647
|
+
interface LegacyAssertionTarget {
|
|
648
|
+
type: "search";
|
|
649
|
+
criteria: LegacyCriteria;
|
|
650
|
+
label: string;
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Legacy assertion. Mirrors the shape used by `groups[].assertions[]` in
|
|
654
|
+
* `*.spec.uibridge.json`.
|
|
655
|
+
*/
|
|
656
|
+
interface LegacyAssertion {
|
|
657
|
+
id: string;
|
|
658
|
+
description: string;
|
|
659
|
+
category: string;
|
|
660
|
+
severity: "critical" | "warning" | "info";
|
|
661
|
+
assertionType: string;
|
|
662
|
+
target: LegacyAssertionTarget;
|
|
663
|
+
source: string;
|
|
664
|
+
reviewed: boolean;
|
|
665
|
+
enabled: boolean;
|
|
666
|
+
precondition?: string;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Legacy group. One per IR state.
|
|
670
|
+
*/
|
|
671
|
+
interface LegacyGroup {
|
|
672
|
+
id: string;
|
|
673
|
+
name: string;
|
|
674
|
+
description: string;
|
|
675
|
+
category: string;
|
|
676
|
+
assertions: LegacyAssertion[];
|
|
677
|
+
source: string;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Process step within a transition. Note `action` (not `type`) — matches the
|
|
681
|
+
* runtime engine's `TransitionAction` shape.
|
|
682
|
+
*/
|
|
683
|
+
interface LegacyProcessStep {
|
|
684
|
+
action: string;
|
|
685
|
+
target: LegacyCriteria;
|
|
686
|
+
waitAfter?: IRWaitSpec;
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Legacy state-machine transition.
|
|
690
|
+
*/
|
|
691
|
+
interface LegacyTransition {
|
|
692
|
+
id: string;
|
|
693
|
+
name: string;
|
|
694
|
+
activateStates: string[];
|
|
695
|
+
deactivateStates: string[];
|
|
696
|
+
staysVisible: boolean;
|
|
697
|
+
process: LegacyProcessStep[];
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Legacy state-machine state.
|
|
701
|
+
*/
|
|
702
|
+
interface LegacyStateMachineState {
|
|
703
|
+
id: string;
|
|
704
|
+
name: string;
|
|
705
|
+
description: string;
|
|
706
|
+
elements: LegacyCriteria[];
|
|
707
|
+
isInitial: boolean;
|
|
708
|
+
transitions: LegacyTransition[];
|
|
709
|
+
}
|
|
710
|
+
/**
|
|
711
|
+
* Legacy state-machine block.
|
|
712
|
+
*/
|
|
713
|
+
interface LegacyStateMachine {
|
|
714
|
+
states: LegacyStateMachineState[];
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* Legacy spec metadata block. The projection writes a deterministic subset;
|
|
718
|
+
* downstream tooling may layer additional keys on hand-authored specs.
|
|
719
|
+
*/
|
|
720
|
+
interface LegacyMetadata {
|
|
721
|
+
component: string;
|
|
722
|
+
tags?: string[];
|
|
723
|
+
[key: string]: unknown;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Top-level legacy spec shape.
|
|
727
|
+
*/
|
|
728
|
+
interface LegacySpec {
|
|
729
|
+
version: string;
|
|
730
|
+
description: string;
|
|
731
|
+
groups: LegacyGroup[];
|
|
732
|
+
stateMachine: LegacyStateMachine;
|
|
733
|
+
metadata: LegacyMetadata;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Project an IR document into the legacy bundled-page spec shape.
|
|
737
|
+
*
|
|
738
|
+
* Pure / deterministic: same input always produces structurally identical
|
|
739
|
+
* output (and byte-identical when JSON-serialized via the standard
|
|
740
|
+
* `JSON.stringify` ordering). Arrays preserve input order; object keys are
|
|
741
|
+
* sorted lexicographically.
|
|
742
|
+
*
|
|
743
|
+
* @param doc The IR document to project.
|
|
744
|
+
* @param notes Optional human-authored notes (carried in the page's
|
|
745
|
+
* `notes.md` companion file). Appended to `description` as a
|
|
746
|
+
* separate paragraph (separator: two newlines).
|
|
747
|
+
*/
|
|
748
|
+
declare function projectIRToBundledPage(doc: IRDocument, notes?: string): LegacySpec;
|
|
749
|
+
/**
|
|
750
|
+
* Options for the inverse projection.
|
|
751
|
+
*
|
|
752
|
+
* - `docId` — explicit IRDocument.id override. Falls back to
|
|
753
|
+
* `legacy.metadata.component` (or `fallbackName` if absent).
|
|
754
|
+
* - `fallbackName` — used when `legacy.metadata.component` is missing AND no
|
|
755
|
+
* `docId` was supplied.
|
|
756
|
+
*/
|
|
757
|
+
interface ProjectLegacyToIROptions {
|
|
758
|
+
docId?: string;
|
|
759
|
+
fallbackName?: string;
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Project a legacy bundled-page spec back into IR.
|
|
763
|
+
*
|
|
764
|
+
* Pure / deterministic: same input always produces structurally identical
|
|
765
|
+
* output. Collapses transition duplicates (forward emits one copy per
|
|
766
|
+
* `fromState`), preserves group/assertion ordering, and tags every node with
|
|
767
|
+
* `provenance.source = "migrated"` so downstream tooling can distinguish
|
|
768
|
+
* migrated content from hand-authored.
|
|
769
|
+
*
|
|
770
|
+
* The mapping is the structural inverse of `projectIRToBundledPage`:
|
|
771
|
+
*
|
|
772
|
+
* LegacySpec IRDocument
|
|
773
|
+
* ---------- ----------
|
|
774
|
+
* metadata.component -> id (or opts.docId override)
|
|
775
|
+
* metadata.tags -> metadata.tags
|
|
776
|
+
* description -> description (kept verbatim;
|
|
777
|
+
* authored notes appended via
|
|
778
|
+
* forward `notes` arg are not
|
|
779
|
+
* stripped — that round-trip is
|
|
780
|
+
* best-effort and Phase A4 will
|
|
781
|
+
* split them back out)
|
|
782
|
+
*
|
|
783
|
+
* groups[] -> states[] (one per group)
|
|
784
|
+
* group.id / name / description -> state.id / name / description
|
|
785
|
+
* assertion.target.criteria -> state.requiredElements[i] (or,
|
|
786
|
+
* preferred, smState.elements when
|
|
787
|
+
* the stateMachine block is present)
|
|
788
|
+
* first-found assertion.precondition -> state.precondition
|
|
789
|
+
*
|
|
790
|
+
* stateMachine.states[] -> contributes isInitial + elements
|
|
791
|
+
* smState.transitions[] -> transitions[] (deduped by id)
|
|
792
|
+
* transition.activateStates -> transition.activateStates
|
|
793
|
+
* transition.deactivateStates -> transition.exitStates
|
|
794
|
+
* transition.process[] -> transition.actions[]
|
|
795
|
+
* step.action -> action.type
|
|
796
|
+
* step.target -> action.target (criteria inverted)
|
|
797
|
+
* step.waitAfter -> action.waitAfter
|
|
798
|
+
*
|
|
799
|
+
* Documented losses (acceptable for Phase A2):
|
|
800
|
+
* - Legacy assertion ids (`{stateId}-elem-{i}`) are NOT preserved across the
|
|
801
|
+
* round-trip — the forward direction regenerates them from index, so any
|
|
802
|
+
* hand-edited ids are lost. See Phase A4.
|
|
803
|
+
* - Legacy `assertionType` / `severity` / `category` / `source` per
|
|
804
|
+
* assertion are reduced to defaults on round-trip.
|
|
805
|
+
* - Legacy `expected` / `assertionType: "count"` and `notExists` semantics
|
|
806
|
+
* are not modeled in IR — the assertion's criteria still survive (as a
|
|
807
|
+
* state requiredElement) but the assertion-flavor metadata is dropped.
|
|
808
|
+
* - Legacy `testing` block + extra metadata keys outside `component` /
|
|
809
|
+
* `tags` are ignored. Authors keep them via the legacy spec file directly
|
|
810
|
+
* during Phase A2 — they will move into IR companion files in Phase A4.
|
|
811
|
+
* - The forward `notes` argument's appended paragraph is currently kept
|
|
812
|
+
* in `description`; Phase A4 will split it back out into a dedicated
|
|
813
|
+
* companion file.
|
|
814
|
+
*
|
|
815
|
+
* @param legacy The legacy spec to invert.
|
|
816
|
+
* @param opts Optional doc-level overrides.
|
|
817
|
+
*/
|
|
818
|
+
declare function projectLegacyToIR(legacy: LegacySpec, opts?: ProjectLegacyToIROptions): IRDocument;
|
|
819
|
+
|
|
820
|
+
export { type AdaptedState, type AdaptedTransition, type AdaptedTransitionAction, type AdaptedWaitAfter, type AdaptedWorkflowConfig, type IRCrossRef, type IRDocument, type IREffect, type IRElementCriteria, type IRMetadata, type IRProvenance, type IRState, type IRStateCondition, type IRTransition, type IRTransitionAction, type IRVersion, type IRVisualRef, type IRWaitSpec, type LegacyAssertion, type LegacyAssertionTarget, type LegacyCriteria, type LegacyGroup, type LegacyMetadata, type LegacyProcessStep, type LegacySpec, type LegacyStateMachine, type LegacyStateMachineState, type LegacyTransition, type ProjectLegacyToIROptions, adaptIRDocumentToWorkflowConfig, adaptIRState, adaptIRTransition, adaptIRTransitionAction, projectIRToBundledPage, projectLegacyToIR, projectionVersion };
|