@flanksource/clicky-ui 0.3.83 → 0.3.85
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/dist/components/Combobox.cjs +8 -6
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox.js +8 -6
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ComboboxMenu.cjs +7 -4
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts +3 -2
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +7 -4
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/DateField.cjs.map +1 -1
- package/dist/components/DateField.d.ts +3 -2
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.js.map +1 -1
- package/dist/components/DatePicker.cjs +9 -61
- package/dist/components/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker.d.ts +5 -19
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +11 -63
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DateTimePicker.cjs +9 -78
- package/dist/components/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker.d.ts +5 -19
- package/dist/components/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker.js +11 -80
- package/dist/components/DateTimePicker.js.map +1 -1
- package/dist/components/FilterBar.cjs +64 -47
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +20 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +63 -46
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/TimeRange.cjs +156 -128
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts +8 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +156 -128
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/calendar-grid.cjs +83 -0
- package/dist/components/calendar-grid.cjs.map +1 -0
- package/dist/components/calendar-grid.d.ts +9 -0
- package/dist/components/calendar-grid.d.ts.map +1 -0
- package/dist/components/calendar-grid.js +83 -0
- package/dist/components/calendar-grid.js.map +1 -0
- package/dist/components/combobox-types.d.ts +5 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/date-input-field.cjs +88 -0
- package/dist/components/date-input-field.cjs.map +1 -0
- package/dist/components/date-input-field.d.ts +37 -0
- package/dist/components/date-input-field.d.ts.map +1 -0
- package/dist/components/date-input-field.js +88 -0
- package/dist/components/date-input-field.js.map +1 -0
- package/dist/components/date-math.cjs +67 -0
- package/dist/components/date-math.cjs.map +1 -0
- package/dist/components/date-math.d.ts +33 -0
- package/dist/components/date-math.d.ts.map +1 -0
- package/dist/components/date-math.js +60 -0
- package/dist/components/date-math.js.map +1 -0
- package/dist/components/date-picker-menu.cjs +129 -0
- package/dist/components/date-picker-menu.cjs.map +1 -0
- package/dist/components/date-picker-menu.d.ts +18 -0
- package/dist/components/date-picker-menu.d.ts.map +1 -0
- package/dist/components/date-picker-menu.js +129 -0
- package/dist/components/date-picker-menu.js.map +1 -0
- package/dist/components/filter-bar-context.cjs.map +1 -1
- package/dist/components/filter-bar-context.d.ts +2 -0
- package/dist/components/filter-bar-context.d.ts.map +1 -1
- package/dist/components/filter-bar-context.js.map +1 -1
- package/dist/components/filter-bar-field-utils.cjs +18 -4
- package/dist/components/filter-bar-field-utils.cjs.map +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +3 -2
- package/dist/components/filter-bar-field-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-field-utils.js +19 -5
- package/dist/components/filter-bar-field-utils.js.map +1 -1
- package/dist/components/filter-bar-menu.cjs +189 -0
- package/dist/components/filter-bar-menu.cjs.map +1 -0
- package/dist/components/filter-bar-menu.d.ts +25 -0
- package/dist/components/filter-bar-menu.d.ts.map +1 -0
- package/dist/components/filter-bar-menu.js +189 -0
- package/dist/components/filter-bar-menu.js.map +1 -0
- package/dist/components/filter-bar-multi.cjs +1 -1
- package/dist/components/filter-bar-multi.cjs.map +1 -1
- package/dist/components/filter-bar-multi.js +2 -2
- package/dist/components/filter-bar-multi.js.map +1 -1
- package/dist/components/filter-bar-popup.cjs +37 -0
- package/dist/components/filter-bar-popup.cjs.map +1 -0
- package/dist/components/filter-bar-popup.d.ts +32 -0
- package/dist/components/filter-bar-popup.d.ts.map +1 -0
- package/dist/components/filter-bar-popup.js +37 -0
- package/dist/components/filter-bar-popup.js.map +1 -0
- package/dist/components/filter-bar-tree.cjs +1 -1
- package/dist/components/filter-bar-tree.cjs.map +1 -1
- package/dist/components/filter-bar-tree.js +2 -2
- package/dist/components/filter-bar-tree.js.map +1 -1
- package/dist/components/json-schema-form-date-math.cjs +15 -11
- package/dist/components/json-schema-form-date-math.cjs.map +1 -1
- package/dist/components/json-schema-form-date-math.d.ts +3 -0
- package/dist/components/json-schema-form-date-math.d.ts.map +1 -1
- package/dist/components/json-schema-form-date-math.js +15 -12
- package/dist/components/json-schema-form-date-math.js.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +5 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +5 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +1 -1
- package/dist/connections/ConnectionPicker.cjs +6 -2
- package/dist/connections/ConnectionPicker.cjs.map +1 -1
- package/dist/connections/ConnectionPicker.d.ts.map +1 -1
- package/dist/connections/ConnectionPicker.js +6 -2
- package/dist/connections/ConnectionPicker.js.map +1 -1
- package/dist/connections/CreateConnectionDialog.cjs +8 -21
- package/dist/connections/CreateConnectionDialog.cjs.map +1 -1
- package/dist/connections/CreateConnectionDialog.d.ts +2 -1
- package/dist/connections/CreateConnectionDialog.d.ts.map +1 -1
- package/dist/connections/CreateConnectionDialog.js +8 -21
- package/dist/connections/CreateConnectionDialog.js.map +1 -1
- package/dist/data/ExpandableMarkdown.cjs +59 -0
- package/dist/data/ExpandableMarkdown.cjs.map +1 -0
- package/dist/data/ExpandableMarkdown.d.ts +17 -0
- package/dist/data/ExpandableMarkdown.d.ts.map +1 -0
- package/dist/data/ExpandableMarkdown.js +59 -0
- package/dist/data/ExpandableMarkdown.js.map +1 -0
- package/dist/data/MultiGaugeBar.cjs +49 -21
- package/dist/data/MultiGaugeBar.cjs.map +1 -1
- package/dist/data/MultiGaugeBar.d.ts +5 -2
- package/dist/data/MultiGaugeBar.d.ts.map +1 -1
- package/dist/data/MultiGaugeBar.js +49 -21
- package/dist/data/MultiGaugeBar.js.map +1 -1
- package/dist/data/PromptDialog.cjs +19 -5
- package/dist/data/PromptDialog.cjs.map +1 -1
- package/dist/data/PromptDialog.d.ts +15 -1
- package/dist/data/PromptDialog.d.ts.map +1 -1
- package/dist/data/PromptDialog.js +19 -5
- package/dist/data/PromptDialog.js.map +1 -1
- package/dist/data/PromptIndicator.cjs +3 -2
- package/dist/data/PromptIndicator.cjs.map +1 -1
- package/dist/data/PromptIndicator.d.ts +4 -1
- package/dist/data/PromptIndicator.d.ts.map +1 -1
- package/dist/data/PromptIndicator.js +3 -2
- package/dist/data/PromptIndicator.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +155 -110
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +155 -110
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/flow-node/BoxNode.cjs +45 -0
- package/dist/data/flow-node/BoxNode.cjs.map +1 -0
- package/dist/data/flow-node/BoxNode.d.ts +28 -0
- package/dist/data/flow-node/BoxNode.d.ts.map +1 -0
- package/dist/data/flow-node/BoxNode.js +45 -0
- package/dist/data/flow-node/BoxNode.js.map +1 -0
- package/dist/data/flow-node/FlowMetrics.cjs +208 -0
- package/dist/data/flow-node/FlowMetrics.cjs.map +1 -0
- package/dist/data/flow-node/FlowMetrics.d.ts +60 -0
- package/dist/data/flow-node/FlowMetrics.d.ts.map +1 -0
- package/dist/data/flow-node/FlowMetrics.js +206 -0
- package/dist/data/flow-node/FlowMetrics.js.map +1 -0
- package/dist/data/flow-node/WorkloadNode.cjs +63 -0
- package/dist/data/flow-node/WorkloadNode.cjs.map +1 -0
- package/dist/data/flow-node/WorkloadNode.d.ts +42 -0
- package/dist/data/flow-node/WorkloadNode.d.ts.map +1 -0
- package/dist/data/flow-node/WorkloadNode.js +63 -0
- package/dist/data/flow-node/WorkloadNode.js.map +1 -0
- package/dist/data/flow-node/index.d.ts +5 -0
- package/dist/data/flow-node/index.d.ts.map +1 -0
- package/dist/data/flow-node/latency.cjs +37 -0
- package/dist/data/flow-node/latency.cjs.map +1 -0
- package/dist/data/flow-node/latency.d.ts +13 -0
- package/dist/data/flow-node/latency.d.ts.map +1 -0
- package/dist/data/flow-node/latency.js +35 -0
- package/dist/data/flow-node/latency.js.map +1 -0
- package/dist/data/test-runner/TestDetailPanel.cjs +109 -46
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +110 -47
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +84 -63
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +84 -63
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/adapter.cjs.map +1 -1
- package/dist/data/test-runner/adapter.d.ts +2 -2
- package/dist/data/test-runner/adapter.d.ts.map +1 -1
- package/dist/data/test-runner/adapter.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +62 -10
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts +52 -9
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +60 -11
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +1 -1
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/traces/index.d.ts +1 -0
- package/dist/data/traces/index.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.cjs +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs +90 -56
- package/dist/data/traces/otel/OtelTraceSearch.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.js +91 -57
- package/dist/data/traces/otel/OtelTraceSearch.js.map +1 -1
- package/dist/data/traces/otel/QueryBar.cjs +83 -10
- package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
- package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
- package/dist/data/traces/otel/QueryBar.js +83 -10
- package/dist/data/traces/otel/QueryBar.js.map +1 -1
- package/dist/data/traces/otel/TraceResults.cjs +81 -13
- package/dist/data/traces/otel/TraceResults.cjs.map +1 -1
- package/dist/data/traces/otel/TraceResults.d.ts +11 -3
- package/dist/data/traces/otel/TraceResults.d.ts.map +1 -1
- package/dist/data/traces/otel/TraceResults.js +81 -13
- package/dist/data/traces/otel/TraceResults.js.map +1 -1
- package/dist/data/traces/otel/api.cjs.map +1 -1
- package/dist/data/traces/otel/api.d.ts +14 -0
- package/dist/data/traces/otel/api.d.ts.map +1 -1
- package/dist/data/traces/otel/api.js.map +1 -1
- package/dist/data/traces/otel/query.cjs +2 -2
- package/dist/data/traces/otel/query.cjs.map +1 -1
- package/dist/data/traces/otel/query.d.ts +1 -1
- package/dist/data/traces/otel/query.d.ts.map +1 -1
- package/dist/data/traces/otel/query.js +2 -2
- package/dist/data/traces/otel/query.js.map +1 -1
- package/dist/data/verification/StepFilesView.cjs +90 -0
- package/dist/data/verification/StepFilesView.cjs.map +1 -0
- package/dist/data/verification/StepFilesView.d.ts +9 -0
- package/dist/data/verification/StepFilesView.d.ts.map +1 -0
- package/dist/data/verification/StepFilesView.js +90 -0
- package/dist/data/verification/StepFilesView.js.map +1 -0
- package/dist/data/verification/adapterViews.cjs +129 -69
- package/dist/data/verification/adapterViews.cjs.map +1 -1
- package/dist/data/verification/adapterViews.d.ts +3 -1
- package/dist/data/verification/adapterViews.d.ts.map +1 -1
- package/dist/data/verification/adapterViews.js +130 -70
- package/dist/data/verification/adapterViews.js.map +1 -1
- package/dist/data/verification/adapters.cjs +9 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts +2 -0
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +11 -2
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/verification/index.d.ts +2 -1
- package/dist/data/verification/index.d.ts.map +1 -1
- package/dist/data/verification/stepKind.cjs +63 -7
- package/dist/data/verification/stepKind.cjs.map +1 -1
- package/dist/data/verification/stepKind.d.ts +55 -6
- package/dist/data/verification/stepKind.d.ts.map +1 -1
- package/dist/data/verification/stepKind.js +62 -8
- package/dist/data/verification/stepKind.js.map +1 -1
- package/dist/data/verification/stepKindViews.cjs +318 -106
- package/dist/data/verification/stepKindViews.cjs.map +1 -1
- package/dist/data/verification/stepKindViews.d.ts +17 -6
- package/dist/data/verification/stepKindViews.d.ts.map +1 -1
- package/dist/data/verification/stepKindViews.js +319 -108
- package/dist/data/verification/stepKindViews.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.cjs.map +1 -1
- package/dist/data/version-info.js +3 -3
- package/dist/data/version-info.js.map +1 -1
- package/dist/data/workload-panel/MemoryStack.cjs +38 -1
- package/dist/data/workload-panel/MemoryStack.cjs.map +1 -1
- package/dist/data/workload-panel/MemoryStack.d.ts.map +1 -1
- package/dist/data/workload-panel/MemoryStack.js +38 -1
- package/dist/data/workload-panel/MemoryStack.js.map +1 -1
- package/dist/data.cjs +22 -1
- package/dist/data.d.ts +3 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +10 -3
- package/dist/file-findings/AnnotatedCode.cjs +18 -2
- package/dist/file-findings/AnnotatedCode.cjs.map +1 -1
- package/dist/file-findings/AnnotatedCode.d.ts +2 -0
- package/dist/file-findings/AnnotatedCode.d.ts.map +1 -1
- package/dist/file-findings/AnnotatedCode.js +18 -2
- package/dist/file-findings/AnnotatedCode.js.map +1 -1
- package/dist/file-findings/FileFindingsView.cjs.map +1 -1
- package/dist/file-findings/FileFindingsView.d.ts +2 -0
- package/dist/file-findings/FileFindingsView.d.ts.map +1 -1
- package/dist/file-findings/FileFindingsView.js.map +1 -1
- package/dist/file-findings/file-review/FileReview.cjs +2 -1
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts +3 -1
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +2 -1
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/hooks/use-prompts.cjs +52 -30
- package/dist/hooks/use-prompts.cjs.map +1 -1
- package/dist/hooks/use-prompts.d.ts +6 -0
- package/dist/hooks/use-prompts.d.ts.map +1 -1
- package/dist/hooks/use-prompts.js +52 -30
- package/dist/hooks/use-prompts.js.map +1 -1
- package/dist/index.cjs +23 -2
- package/dist/index.js +11 -4
- package/dist/profiles/editor/profileEditor.cjs +29 -30
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +29 -30
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.cjs +44 -43
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.d.ts +10 -5
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.js +44 -43
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +153 -48
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts +16 -2
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +155 -50
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/sampleError.cjs +29 -0
- package/dist/profiles/editor/sampleError.cjs.map +1 -0
- package/dist/profiles/editor/sampleError.d.ts +16 -0
- package/dist/profiles/editor/sampleError.d.ts.map +1 -0
- package/dist/profiles/editor/sampleError.js +27 -0
- package/dist/profiles/editor/sampleError.js.map +1 -0
- package/dist/profiles/query/profileSampleResult.cjs.map +1 -1
- package/dist/profiles/query/profileSampleResult.d.ts +2 -0
- package/dist/profiles/query/profileSampleResult.d.ts.map +1 -1
- package/dist/profiles/query/profileSampleResult.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts +2 -0
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/react-grab/core/index.js +1 -1
- package/dist/react-grab/{core-BERtFDWh.js → core-BK5CU6Lb.js} +2 -2
- package/dist/react-grab/index.js +1 -1
- package/dist/react-grab/{renderer-KT3FY3K2.js → renderer-DcHrsQ8k.js} +1 -1
- package/dist/rpc/apiClient.cjs +12 -15
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.js +12 -15
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/runtime/barrels.json +6507 -6460
- package/dist/runtime/importmap.json +2198 -2185
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapters.js","names":[],"sources":["../../../src/data/verification/adapters.tsx"],"sourcesContent":["// Domain node adapters for VerificationResults: a checklist adapter for the\n// synthesized \"Acceptance criteria\" node and its items, and a fixture/CEL\n// adapter for the failing-step detail. Rendering lives in adapterViews.tsx —\n// split out so this file's only exports are the registry (react/only-export-\n// components forbids mixing component declarations with plain exports).\n\nimport type { ReactNode } from \"react\";\nimport { ChecklistDetail, FixtureDetail } from \"./adapterViews\";\nimport { StepOutputs, StepRowBadge, StepSourceSection } from \"./stepKindViews\";\nimport { verifyNodeTest } from \"./verifyReportTests\";\nimport { UiTerminal } from \"../../icons\";\nimport { hasStepDetail, readQuery, readStepDetail, stepFormState, stepKindCopy, stepQueryCopy, type WaitDetail } from \"./stepKind\";\nimport { readStepSource, sourceTabLabel, stepSourceCopy } from \"./stepSource\";\nimport {\n createTestRunnerRegistry,\n outcomeFor,\n type BriefSection,\n type CopySections,\n type FixtureContext,\n type Test,\n type TestNodeAdapter,\n type TestNodeAdapterRegistry,\n type TestOutcome,\n type TestSummary,\n} from \"../test-runner\";\n\nfunction isChecklistNode(node: Test): boolean {\n return node.framework === \"checklist\";\n}\n\nfunction checklistMark(item: Test): string {\n if (item.failed) return \"[ ]\";\n if (item.passed) return \"[x]\";\n return \"[?]\";\n}\n\n/** `- [x]/[ ]/[?] criterion — reason` for each item, or the leaf itself. */\nfunction checklistCopy(node: Test): CopySections {\n const items = node.children && node.children.length > 0 ? node.children : [node];\n const lines = items.map(\n (item) => `- ${checklistMark(item)} ${item.name}${item.message ? ` — ${item.message}` : \"\"}`,\n );\n return { brief: [{ title: \"Criteria\", body: lines.join(\"\\n\") }] };\n}\n\nconst checklistAdapter: TestNodeAdapter = {\n id: \"verification-checklist\",\n match: isChecklistNode,\n renderDetail: ({ node }) => <ChecklistDetail node={node} />,\n copy: ({ node }) => checklistCopy(node),\n};\n\n// A typed step kind (services, todo, …) may report no command or CEL context at\n// all, so `detail.step` claims the node as well. A \"fixture\" leaf is a step whose\n// result has not arrived yet (a live or background step): it carries only the\n// execution node, which FixtureDetail renders as a header. Fixture parents\n// (markdown tables, runner steps) have children and stay with the default body.\nfunction isFixtureNode(node: Test): boolean {\n if (node.context !== undefined || hasStepDetail(node.detail)) return true;\n return node.framework === \"fixture\" && (node.children?.length ?? 0) === 0;\n}\n\n// ── Copy sections for fixture steps (exec / query / table / test / lint) ───\n\nfunction readCelTrace(detail: unknown): string | undefined {\n if (detail && typeof detail === \"object\" && !Array.isArray(detail)) {\n const value = (detail as Record<string, unknown>).cel_trace;\n if (typeof value === \"string\" && value.length > 0) return value;\n }\n return undefined;\n}\n\n// Mirrors CelDetails: without a CEL gate, a command step's `actual` is the whole\n// command result object, already covered by the Command section and output.\nfunction comparisonValue(hasCelGate: boolean, value: unknown): unknown {\n if (value === undefined) return undefined;\n if (hasCelGate) return value;\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) return undefined;\n return value;\n}\n\nfunction formatValue(value: unknown): string {\n return typeof value === \"string\" ? value : JSON.stringify(value, null, 2);\n}\n\nfunction commandSection(node: Test, context: FixtureContext | undefined): BriefSection[] {\n const command = context?.command ?? node.command;\n if (!command) return [];\n const cwd = context?.cwd ?? node.work_dir;\n const exit = context?.exit_code;\n const lines = [`$ ${command}`, cwd && `cwd: ${cwd}`, exit !== undefined && `exit: ${exit}`];\n return [{ title: \"Command\", lang: \"sh\", body: lines.filter(Boolean).join(\"\\n\") }];\n}\n\nfunction assertionSection(node: Test, context: FixtureContext | undefined): BriefSection[] {\n const expression = context?.cel_expression;\n const trace = readCelTrace(node.detail);\n const hasCelGate = !!(expression || trace);\n const vars = context?.cel_vars ?? {};\n const expected = comparisonValue(hasCelGate, context?.expected);\n const actual = comparisonValue(hasCelGate, context?.actual);\n const lines = [\n expression && `expression: ${expression}`,\n trace && `trace:\\n${trace}`,\n Object.keys(vars).length > 0 && `vars: ${formatValue(vars)}`,\n expected !== undefined && `expected: ${formatValue(expected)}`,\n actual !== undefined && `actual: ${formatValue(actual)}`,\n ].filter(Boolean);\n return lines.length > 0 ? [{ title: \"Assertion\", body: lines.join(\"\\n\") }] : [];\n}\n\nconst OUTCOME_GLYPH: Record<TestOutcome, string> = {\n passed: \"✓\",\n failed: \"✗\",\n errored: \"✗\",\n timedout: \"⏱\",\n warned: \"!\",\n aborted: \"■\",\n skipped: \"-\",\n pending: \"○\",\n running: \"…\",\n};\n\nfunction childLine(child: Test): string {\n const outcome = outcomeFor(child);\n const exit = (child.context as FixtureContext | undefined)?.exit_code;\n const reason = child.message ?? (exit ? `exit ${exit}` : undefined);\n return `${outcome ? OUTCOME_GLYPH[outcome] : \"·\"} ${child.name}${reason ? ` — ${reason}` : \"\"}`;\n}\n\nfunction summaryLine(summary: TestSummary): string {\n const counts: [number | undefined, string][] = [\n [summary.Passed, \"passed\"],\n [summary.Failed, \"failed\"],\n [summary.Warned, \"warned\"],\n [summary.Timedout, \"timed out\"],\n [summary.Skipped, \"skipped\"],\n [summary.Pending, \"pending\"],\n [summary.Running, \"running\"],\n ];\n const parts = counts.filter(([n]) => !!n).map(([n, label]) => `${n} ${label}`);\n return [`${summary.Total} total`, ...parts].join(\" · \");\n}\n\nfunction resultsSection(node: Test): BriefSection[] {\n const lines = [\n ...(node.summary ? [summaryLine(node.summary)] : []),\n ...(node.children ?? []).map(childLine),\n ];\n return lines.length > 0 ? [{ title: \"Results\", body: lines.join(\"\\n\") }] : [];\n}\n\n/** Command, CEL assertion and per-child verdicts for a fixture step or its parent. */\nfunction fixtureCopy(node: Test): CopySections {\n const context = node.context as FixtureContext | undefined;\n const command = context?.command ?? node.command;\n const stepDetail = readStepDetail(node.detail);\n const source = readStepSource(node.detail);\n const query = readQuery(node.detail);\n return {\n brief: [\n ...(query.kind === \"query\" ? stepQueryCopy(query.query) : commandSection(node, context)),\n ...assertionSection(node, context),\n ...(source.kind === \"source\" ? stepSourceCopy(source.source) : []),\n ...(stepDetail.kind === \"step\" ? stepKindCopy(stepDetail.step) : []),\n ...resultsSection(node),\n ],\n items: command ? [{ label: \"Copy command\", icon: UiTerminal, value: command }] : [],\n };\n}\n\n// gavel's FixtureResult.Type values plus \"fixture\" (a markdown table of rows)\n// and the typed step kinds. Table and runner-step parents carry no `context`,\n// so the fixture adapter never claims them; this copy-only adapter gives them\n// the same sections. \"playwright\" is also a test framework, so it counts as a\n// step only when the node carries `detail.step`.\nconst FIXTURE_STEP_FRAMEWORKS = new Set([\n \"exec\",\n \"query\",\n \"fixture\",\n \"test\",\n \"lint\",\n \"verify\",\n \"services\",\n \"todo\",\n \"todo_prompt\",\n \"ai\",\n \"browser\",\n \"playwright\",\n \"agent-browser\",\n]);\n\nfunction isFixtureStepNode(node: Test): boolean {\n const framework = node.framework ?? \"\";\n if (framework === \"playwright\") return hasStepDetail(node.detail);\n return FIXTURE_STEP_FRAMEWORKS.has(framework);\n}\n\nconst fixtureStepCopyAdapter: TestNodeAdapter = {\n id: \"verification-step-copy\",\n match: isFixtureStepNode,\n copy: ({ node }) => fixtureCopy(node),\n};\n\n// Claims only the rows it badges, so a host's own row decoration still wins for every other node.\nconst stepBadgeAdapter: TestNodeAdapter = {\n id: \"verification-step-badge\",\n match: (node) => node.waiting === true || stepFormState(node) !== undefined,\n renderRowLeading: ({ node }) => <StepRowBadge node={node} />,\n};\n\n/** Default node adapters for VerificationResults: checklist items and\n * fixture/CEL steps. Registration order matters only when a node could match\n * both — a checklist node never carries a `context`, so the two never race. */\nexport type VerificationAdapterOptions = {\n /** Override the wait section while retaining the fixture's other detail sections. */\n renderWait?: (wait: WaitDetail) => ReactNode;\n /**\n * The answerable form of a step waiting on a person (`node.waiting`), shown in\n * its own section at the top of the step's detail. The host resolves which\n * pending prompt belongs to the node and answers it (e.g. with PromptForm).\n */\n renderPendingPrompt?: (node: Test) => ReactNode;\n};\n\n// The attempt a step is waiting in: it carries the step's name and task id (the\n// host finds the step's prompt by them) and `waiting`, and, when its result has\n// nothing marking it a fixture step, the step reference, so the fixture detail\n// (and its pending form) still renders it.\nfunction liveAttemptNode(step: Test, attempt: Test, ref: { id: string; kind: string }): Test {\n const live: Test = { ...attempt, name: step.name, ...(step.task_id !== undefined ? { task_id: step.task_id } : {}), waiting: true };\n if (isFixtureNode(live)) return live;\n // readStepDetail has already checked that an attempt result's detail is an object.\n return { ...live, detail: { ...(attempt.detail as Record<string, unknown> | undefined), step: ref } };\n}\n\nexport function verificationAdapters(options: VerificationAdapterOptions = {}): TestNodeAdapterRegistry {\n const fixtureAdapter: TestNodeAdapter = {\n id: \"verification-fixture\",\n match: isFixtureNode,\n renderDetail: ({ node }) => <FixtureDetail node={node} {...options} />,\n detailAttempts: ({ node }) => {\n const detail = readStepDetail(node.detail);\n if (detail.kind !== \"step\") return [];\n const live = detail.step.attempts.length - 1;\n return detail.step.attempts.map((attempt, index) => {\n const attemptNode: Test = attempt.result ? verifyNodeTest(attempt.result) : {\n name: node.name, message: `Attempt ${attempt.attempt}: execution evidence was not stored in this report.`,\n detail: { step: detail.step.step },\n };\n // The step waits in its last attempt; that one keeps the step's identity so the host finds its prompt.\n const waiting = node.waiting === true && index === live;\n // A finished step's log is its last attempt's; a report's attempts carry none.\n if (index === live && node.log !== undefined && !node.running) attemptNode.log = node.log;\n return {\n id: attempt.attempt, status: attempt.status,\n ...(attempt.durationMs !== undefined ? { durationMs: attempt.durationMs } : {}),\n node: waiting ? liveAttemptNode(node, attemptNode, detail.step.step) : attemptNode,\n };\n });\n },\n detailTabs: ({ node }) => {\n const tabs = [];\n const detail = readStepDetail(node.detail);\n if (detail.kind === \"step\" && detail.step.outputs !== undefined) {\n tabs.push({ id: \"outputs\", label: \"Outputs\", render: () => <StepOutputs outputs={detail.step.outputs} /> });\n }\n const source = readStepSource(node.detail);\n if (source.kind !== \"none\") {\n tabs.push({ id: \"source\", label: sourceTabLabel(source), render: () => <StepSourceSection result={source} /> });\n }\n return tabs;\n },\n copy: ({ node }) => fixtureCopy(node),\n };\n return createTestRunnerRegistry([checklistAdapter, fixtureAdapter, fixtureStepCopyAdapter, stepBadgeAdapter]);\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAS,gBAAgB,MAAqB;CAC5C,OAAO,KAAK,cAAc;AAC5B;AAEA,SAAS,cAAc,MAAoB;CACzC,IAAI,KAAK,QAAQ,OAAO;CACxB,IAAI,KAAK,QAAQ,OAAO;CACxB,OAAO;AACT;;AAGA,SAAS,cAAc,MAA0B;CAK/C,OAAO,EAAE,OAAO,CAAC;EAAE,OAAO;EAAY,OAJxB,KAAK,YAAY,KAAK,SAAS,SAAS,IAAI,KAAK,WAAW,CAAC,IAAI,EAAA,CAC3D,KACjB,SAAS,KAAK,cAAc,IAAI,EAAE,GAAG,KAAK,OAAO,KAAK,UAAU,MAAM,KAAK,YAAY,IAE9C,CAAA,CAAM,KAAK,IAAI;CAAE,CAAC,EAAE;AAClE;AAEA,IAAM,mBAAoC;CACxC,IAAI;CACJ,OAAO;CACP,eAAe,EAAE,WAAW,oBAAC,iBAAD,EAAuB,KAAO,CAAA;CAC1D,OAAO,EAAE,WAAW,cAAc,IAAI;AACxC;AAOA,SAAS,cAAc,MAAqB;CAC1C,IAAI,KAAK,YAAY,KAAA,KAAa,cAAc,KAAK,MAAM,GAAG,OAAO;CACrE,OAAO,KAAK,cAAc,cAAc,KAAK,UAAU,UAAU,OAAO;AAC1E;AAIA,SAAS,aAAa,QAAqC;CACzD,IAAI,UAAU,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,MAAM,GAAG;EAClE,MAAM,QAAS,OAAmC;EAClD,IAAI,OAAO,UAAU,YAAY,MAAM,SAAS,GAAG,OAAO;CAC5D;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zC,IAAI,OAAO,SAAS,QAClB,KAAK,KAAK;KAAE,IAAI;KAAU,OAAO,eAAe,MAAM;KAAG,cAAc,oBAAC,mBAAD,EAAmB,QAAQ,OAAS,CAAA;IAAE,CAAC;IAEhH,OAAO;GACT;GACA,OAAO,EAAE,WAAW,YAAY,IAAI;EAEa;EAAgB;EAAwB;CAAgB,CAAC;AAC9G"}
|
|
1
|
+
{"version":3,"file":"adapters.js","names":[],"sources":["../../../src/data/verification/adapters.tsx"],"sourcesContent":["// Domain node adapters for VerificationResults: a checklist adapter for the\n// synthesized \"Acceptance criteria\" node and its items, and a fixture/CEL\n// adapter for the failing-step detail. Rendering lives in adapterViews.tsx —\n// split out so this file's only exports are the registry (react/only-export-\n// components forbids mixing component declarations with plain exports).\n\nimport type { ReactNode } from \"react\";\nimport { ChecklistDetail, FixtureDetail } from \"./adapterViews\";\nimport { StepOutputs, StepPdfFiles, StepRowBadge, StepSourceSection } from \"./stepKindViews\";\nimport { verifyNodeTest } from \"./verifyReportTests\";\nimport { UiTerminal } from \"../../icons\";\nimport { hasStepDetail, isPdfFile, readQuery, readStepDetail, stepFormState, stepKindCopy, stepQueryCopy, type WaitDetail } from \"./stepKind\";\nimport { readStepSource, sourceTabLabel, stepSourceCopy } from \"./stepSource\";\nimport {\n createTestRunnerRegistry,\n outcomeFor,\n type BriefSection,\n type CopySections,\n type FixtureContext,\n type Test,\n type TestNodeAdapter,\n type TestNodeAdapterRegistry,\n type TestOutcome,\n type TestSummary,\n} from \"../test-runner\";\n\nfunction isChecklistNode(node: Test): boolean {\n return node.framework === \"checklist\";\n}\n\nfunction checklistMark(item: Test): string {\n if (item.failed) return \"[ ]\";\n if (item.passed) return \"[x]\";\n return \"[?]\";\n}\n\n/** `- [x]/[ ]/[?] criterion — reason` for each item, or the leaf itself. */\nfunction checklistCopy(node: Test): CopySections {\n const items = node.children && node.children.length > 0 ? node.children : [node];\n const lines = items.map(\n (item) => `- ${checklistMark(item)} ${item.name}${item.message ? ` — ${item.message}` : \"\"}`,\n );\n return { brief: [{ title: \"Criteria\", body: lines.join(\"\\n\") }] };\n}\n\nconst checklistAdapter: TestNodeAdapter = {\n id: \"verification-checklist\",\n match: isChecklistNode,\n renderDetail: ({ node }) => <ChecklistDetail node={node} />,\n copy: ({ node }) => checklistCopy(node),\n};\n\n// A typed step kind (services, todo, …) may report no command or CEL context at\n// all, so `detail.step` claims the node as well. A \"fixture\" leaf is a step whose\n// result has not arrived yet (a live or background step): it carries only the\n// execution node, which FixtureDetail renders as a header. Fixture parents\n// (markdown tables, runner steps) have children and stay with the default body.\nfunction isFixtureNode(node: Test): boolean {\n if (node.context !== undefined || hasStepDetail(node.detail)) return true;\n return node.framework === \"fixture\" && (node.children?.length ?? 0) === 0;\n}\n\n// ── Copy sections for fixture steps (exec / query / table / test / lint) ───\n\nfunction readCelTrace(detail: unknown): string | undefined {\n if (detail && typeof detail === \"object\" && !Array.isArray(detail)) {\n const value = (detail as Record<string, unknown>).cel_trace;\n if (typeof value === \"string\" && value.length > 0) return value;\n }\n return undefined;\n}\n\n// Mirrors CelDetails: without a CEL gate, a command step's `actual` is the whole\n// command result object, already covered by the Command section and output.\nfunction comparisonValue(hasCelGate: boolean, value: unknown): unknown {\n if (value === undefined) return undefined;\n if (hasCelGate) return value;\n if (value !== null && typeof value === \"object\" && !Array.isArray(value)) return undefined;\n return value;\n}\n\nfunction formatValue(value: unknown): string {\n return typeof value === \"string\" ? value : JSON.stringify(value, null, 2);\n}\n\nfunction commandSection(node: Test, context: FixtureContext | undefined): BriefSection[] {\n const command = context?.command ?? node.command;\n if (!command) return [];\n const cwd = context?.cwd ?? node.work_dir;\n const exit = context?.exit_code;\n const lines = [`$ ${command}`, cwd && `cwd: ${cwd}`, exit !== undefined && `exit: ${exit}`];\n return [{ title: \"Command\", lang: \"sh\", body: lines.filter(Boolean).join(\"\\n\") }];\n}\n\nfunction assertionSection(node: Test, context: FixtureContext | undefined): BriefSection[] {\n const expression = context?.cel_expression;\n const trace = readCelTrace(node.detail);\n const hasCelGate = !!(expression || trace);\n const vars = context?.cel_vars ?? {};\n const expected = comparisonValue(hasCelGate, context?.expected);\n const actual = comparisonValue(hasCelGate, context?.actual);\n const lines = [\n expression && `expression: ${expression}`,\n trace && `trace:\\n${trace}`,\n Object.keys(vars).length > 0 && `vars: ${formatValue(vars)}`,\n expected !== undefined && `expected: ${formatValue(expected)}`,\n actual !== undefined && `actual: ${formatValue(actual)}`,\n ].filter(Boolean);\n return lines.length > 0 ? [{ title: \"Assertion\", body: lines.join(\"\\n\") }] : [];\n}\n\nconst OUTCOME_GLYPH: Record<TestOutcome, string> = {\n passed: \"✓\",\n failed: \"✗\",\n errored: \"✗\",\n timedout: \"⏱\",\n warned: \"!\",\n aborted: \"■\",\n skipped: \"-\",\n pending: \"○\",\n running: \"…\",\n};\n\nfunction childLine(child: Test): string {\n const outcome = outcomeFor(child);\n const exit = (child.context as FixtureContext | undefined)?.exit_code;\n const reason = child.message ?? (exit ? `exit ${exit}` : undefined);\n return `${outcome ? OUTCOME_GLYPH[outcome] : \"·\"} ${child.name}${reason ? ` — ${reason}` : \"\"}`;\n}\n\nfunction summaryLine(summary: TestSummary): string {\n const counts: [number | undefined, string][] = [\n [summary.Passed, \"passed\"],\n [summary.Failed, \"failed\"],\n [summary.Warned, \"warned\"],\n [summary.Timedout, \"timed out\"],\n [summary.Skipped, \"skipped\"],\n [summary.Pending, \"pending\"],\n [summary.Running, \"running\"],\n ];\n const parts = counts.filter(([n]) => !!n).map(([n, label]) => `${n} ${label}`);\n return [`${summary.Total} total`, ...parts].join(\" · \");\n}\n\nfunction resultsSection(node: Test): BriefSection[] {\n const lines = [\n ...(node.summary ? [summaryLine(node.summary)] : []),\n ...(node.children ?? []).map(childLine),\n ];\n return lines.length > 0 ? [{ title: \"Results\", body: lines.join(\"\\n\") }] : [];\n}\n\n/** Command, CEL assertion and per-child verdicts for a fixture step or its parent. */\nfunction fixtureCopy(node: Test): CopySections {\n const context = node.context as FixtureContext | undefined;\n const command = context?.command ?? node.command;\n const stepDetail = readStepDetail(node.detail);\n const source = readStepSource(node.detail);\n const query = readQuery(node.detail);\n return {\n brief: [\n ...(query.kind === \"query\" ? stepQueryCopy(query.query) : commandSection(node, context)),\n ...assertionSection(node, context),\n ...(source.kind === \"source\" ? stepSourceCopy(source.source) : []),\n ...(stepDetail.kind === \"step\" ? stepKindCopy(stepDetail.step) : []),\n ...resultsSection(node),\n ],\n items: command ? [{ label: \"Copy command\", icon: UiTerminal, value: command }] : [],\n };\n}\n\n// gavel's FixtureResult.Type values plus \"fixture\" (a markdown table of rows)\n// and the typed step kinds. Table and runner-step parents carry no `context`,\n// so the fixture adapter never claims them; this copy-only adapter gives them\n// the same sections. \"playwright\" is also a test framework, so it counts as a\n// step only when the node carries `detail.step`.\nconst FIXTURE_STEP_FRAMEWORKS = new Set([\n \"exec\",\n \"query\",\n \"fixture\",\n \"test\",\n \"lint\",\n \"verify\",\n \"services\",\n \"todo\",\n \"todo_prompt\",\n \"ai\",\n \"browser\",\n \"playwright\",\n \"agent-browser\",\n]);\n\nfunction isFixtureStepNode(node: Test): boolean {\n const framework = node.framework ?? \"\";\n if (framework === \"playwright\") return hasStepDetail(node.detail);\n return FIXTURE_STEP_FRAMEWORKS.has(framework);\n}\n\nconst fixtureStepCopyAdapter: TestNodeAdapter = {\n id: \"verification-step-copy\",\n match: isFixtureStepNode,\n copy: ({ node }) => fixtureCopy(node),\n};\n\n// Claims only the rows it badges, so a host's own row decoration still wins for every other node.\nconst stepBadgeAdapter: TestNodeAdapter = {\n id: \"verification-step-badge\",\n match: (node) => node.waiting === true || stepFormState(node) !== undefined,\n renderRowLeading: ({ node }) => <StepRowBadge node={node} />,\n};\n\n/** Default node adapters for VerificationResults: checklist items and\n * fixture/CEL steps. Registration order matters only when a node could match\n * both — a checklist node never carries a `context`, so the two never race. */\nexport type VerificationAdapterOptions = {\n /** Override the wait section while retaining the fixture's other detail sections. */\n renderWait?: (wait: WaitDetail) => ReactNode;\n /**\n * The answerable form of a step waiting on a person (`node.waiting`), shown in\n * its own section at the top of the step's detail. The host resolves which\n * pending prompt belongs to the node and answers it (e.g. with PromptForm).\n */\n renderPendingPrompt?: (node: Test) => ReactNode;\n /** Where the host serves a file a step attached (`detail.files[].path`), e.g. `/api/step-files?path=…`. */\n fileUrl?: (path: string) => string;\n};\n\n// The attempt a step is waiting in: it carries the step's name and task id (the\n// host finds the step's prompt by them) and `waiting`, and, when its result has\n// nothing marking it a fixture step, the step reference, so the fixture detail\n// (and its pending form) still renders it.\nfunction liveAttemptNode(step: Test, attempt: Test, ref: { id: string; kind: string }): Test {\n const live: Test = { ...attempt, name: step.name, ...(step.task_id !== undefined ? { task_id: step.task_id } : {}), waiting: true };\n if (isFixtureNode(live)) return live;\n // readStepDetail has already checked that an attempt result's detail is an object.\n return { ...live, detail: { ...(attempt.detail as Record<string, unknown> | undefined), step: ref } };\n}\n\nexport function verificationAdapters(options: VerificationAdapterOptions = {}): TestNodeAdapterRegistry {\n const fixtureAdapter: TestNodeAdapter = {\n id: \"verification-fixture\",\n match: isFixtureNode,\n renderDetail: ({ node }) => <FixtureDetail node={node} {...options} />,\n detailAttempts: ({ node }) => {\n const detail = readStepDetail(node.detail);\n if (detail.kind !== \"step\") return [];\n const live = detail.step.attempts.length - 1;\n return detail.step.attempts.map((attempt, index) => {\n const attemptNode: Test = attempt.result ? verifyNodeTest(attempt.result) : {\n name: node.name, message: `Attempt ${attempt.attempt}: execution evidence was not stored in this report.`,\n detail: { step: detail.step.step },\n };\n // The step waits in its last attempt; that one keeps the step's identity so the host finds its prompt.\n const waiting = node.waiting === true && index === live;\n // A finished step's log is its last attempt's; a report's attempts carry none.\n if (index === live && node.log !== undefined && !node.running) attemptNode.log = node.log;\n return {\n id: attempt.attempt, status: attempt.status,\n ...(attempt.durationMs !== undefined ? { durationMs: attempt.durationMs } : {}),\n node: waiting ? liveAttemptNode(node, attemptNode, detail.step.step) : attemptNode,\n };\n });\n },\n detailTabs: ({ node }) => {\n const tabs = [];\n const detail = readStepDetail(node.detail);\n if (detail.kind === \"step\" && detail.step.outputs !== undefined) {\n tabs.push({ id: \"outputs\", label: \"Outputs\", render: () => <StepOutputs outputs={detail.step.outputs} /> });\n }\n const pdfs = detail.kind === \"step\" ? (detail.step.files ?? []).filter(isPdfFile) : [];\n if (pdfs.length > 0) {\n tabs.push({ id: \"pdf\", label: \"PDF\", render: () => <StepPdfFiles files={pdfs} {...(options.fileUrl ? { fileUrl: options.fileUrl } : {})} /> });\n }\n const source = readStepSource(node.detail);\n if (source.kind !== \"none\") {\n tabs.push({ id: \"source\", label: sourceTabLabel(source), render: () => <StepSourceSection result={source} /> });\n }\n return tabs;\n },\n copy: ({ node }) => fixtureCopy(node),\n };\n return createTestRunnerRegistry([checklistAdapter, fixtureAdapter, fixtureStepCopyAdapter, stepBadgeAdapter]);\n}\n"],"mappings":";;;;;;;;;;AA0BA,SAAS,gBAAgB,MAAqB;CAC5C,OAAO,KAAK,cAAc;AAC5B;AAEA,SAAS,cAAc,MAAoB;CACzC,IAAI,KAAK,QAAQ,OAAO;CACxB,IAAI,KAAK,QAAQ,OAAO;CACxB,OAAO;AACT;;AAGA,SAAS,cAAc,MAA0B;CAK/C,OAAO,EAAE,OAAO,CAAC;EAAE,OAAO;EAAY,OAJxB,KAAK,YAAY,KAAK,SAAS,SAAS,IAAI,KAAK,WAAW,CAAC,IAAI,EAAA,CAC3D,KACjB,SAAS,KAAK,cAAc,IAAI,EAAE,GAAG,KAAK,OAAO,KAAK,UAAU,MAAM,KAAK,YAAY,IAE9C,CAAA,CAAM,KAAK,IAAI;CAAE,CAAC,EAAE;AAClE;AAEA,IAAM,mBAAoC;CACxC,IAAI;CACJ,OAAO;CACP,eAAe,EAAE,WAAW,oBAAC,iBAAD,EAAuB,KAAO,CAAA;CAC1D,OAAO,EAAE,WAAW,cAAc,IAAI;AACxC;AAOA,SAAS,cAAc,MAAqB;CAC1C,IAAI,KAAK,YAAY,KAAA,KAAa,cAAc,KAAK,MAA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OAAO,CAAC;IACd,MAAM,SAAS,eAAe,KAAK,MAAM;IACzC,IAAI,OAAO,SAAS,UAAU,OAAO,KAAK,YAAY,KAAA,GACpD,KAAK,KAAK;KAAE,IAAI;KAAW,OAAO;KAAW,cAAc,oBAAC,aAAD,EAAa,SAAS,OAAO,KAAK,QAAU,CAAA;IAAE,CAAC;IAE5G,MAAM,OAAO,OAAO,SAAS,UAAU,OAAO,KAAK,SAAS,CAAC,EAAA,CAAG,OAAO,SAAS,IAAI,CAAC;IACrF,IAAI,KAAK,SAAS,GAChB,KAAK,KAAK;KAAE,IAAI;KAAO,OAAO;KAAO,cAAc,oBAAC,cAAD;MAAc,OAAO;MAAM,GAAK,QAAQ,UAAU,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;KAAK,CAAA;IAAE,CAAC;IAE/I,MAAM,SAAS,eAAe,KAAK,MAAM;IACzC,IAAI,OAAO,SAAS,QAClB,KAAK,KAAK;KAAE,IAAI;KAAU,OAAO,eAAe,MAAM;KAAG,cAAc,oBAAC,mBAAD,EAAmB,QAAQ,OAAS,CAAA;IAAE,CAAC;IAEhH,OAAO;GACT;GACA,OAAO,EAAE,WAAW,YAAY,IAAI;EAEa;EAAgB;EAAwB;CAAgB,CAAC;AAC9G"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { emptyVerifySummary, summarizeVerifyNodes, type VerifyChecklistItem, type VerifyNode, type VerifyNodeContext, type VerifyNodeProgress, type VerifyReport, type VerifyState, type VerifySummary, } from './verify-report.js';
|
|
2
2
|
export { verifyNodeTest, verifyReportCounts, verifyReportTests } from './verifyReportTests.js';
|
|
3
3
|
export { StepKindSections, StepOutputs, StepWait } from './stepKindViews.js';
|
|
4
|
-
export {
|
|
4
|
+
export { StepFilesView, type StepFilesViewProps } from './StepFilesView.js';
|
|
5
|
+
export { clockTime, formatDelay, formatExportValue, policySummary, readQuery, readStepDetail, readViolation, type StepQuery, type StepQueryBatch, type StepQueryConnection, type StepQueryResult, type StepQuerySample, type StepQuerySession, type ViolationDetail, type ViolationDetailResult, type StepAttempt, type StepDetail, type StepDetailResult, type StepExport, type StepFile, type WaitDetail, type WaitOutcome, type WaitPolicy, type WatcherEvent, } from './stepKind.js';
|
|
5
6
|
export { verificationAdapters, type VerificationAdapterOptions } from './adapters.js';
|
|
6
7
|
export { VerificationResults, type VerificationResultsProps } from './VerificationResults.js';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/verification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -17,11 +17,24 @@ var STEP_FORM_STATES = [
|
|
|
17
17
|
"supplied",
|
|
18
18
|
"unanswered"
|
|
19
19
|
];
|
|
20
|
+
/** How a step file is previewed, decided by its mime type. */
|
|
21
|
+
function previewKind(mime) {
|
|
22
|
+
const type = mime.split(";", 1)[0].trim().toLowerCase();
|
|
23
|
+
if (type === "text/html") return "html";
|
|
24
|
+
if (type === "application/pdf") return "pdf";
|
|
25
|
+
if (type.startsWith("image/")) return "image";
|
|
26
|
+
return "none";
|
|
27
|
+
}
|
|
28
|
+
/** PDFs get their own detail tab; every other attached file previews in the step's detail. */
|
|
29
|
+
function isPdfFile(file) {
|
|
30
|
+
return previewKind(file.mime) === "pdf";
|
|
31
|
+
}
|
|
20
32
|
var STEP_KEYS = /* @__PURE__ */ new Set([
|
|
21
33
|
"step",
|
|
22
34
|
"outputs",
|
|
23
35
|
"view",
|
|
24
36
|
"form",
|
|
37
|
+
"files",
|
|
25
38
|
"exports",
|
|
26
39
|
"wait",
|
|
27
40
|
"attempts",
|
|
@@ -76,6 +89,19 @@ function readForm(value) {
|
|
|
76
89
|
...optional(form, "answeredAt", (v) => str(v, "detail.form.answeredAt"))
|
|
77
90
|
};
|
|
78
91
|
}
|
|
92
|
+
/** A step's `files`: what it attached through StepContext.AttachFile. */
|
|
93
|
+
function readFiles(value) {
|
|
94
|
+
return list(value, "detail.files").map((raw, index) => {
|
|
95
|
+
const path = `detail.files[${index}]`;
|
|
96
|
+
const file = record(raw, path);
|
|
97
|
+
return {
|
|
98
|
+
path: str(file.path, `${path}.path`),
|
|
99
|
+
name: str(file.name, `${path}.name`),
|
|
100
|
+
mime: str(file.mime, `${path}.mime`),
|
|
101
|
+
...optional(file, "title", (v) => str(v, `${path}.title`))
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
}
|
|
79
105
|
/** Durations arrive as Go-style strings ("15s"); a bare number is nanoseconds like every other duration on the wire. */
|
|
80
106
|
function durationText(value, path) {
|
|
81
107
|
if (typeof value === "string") return value;
|
|
@@ -202,6 +228,7 @@ function readStep(detail) {
|
|
|
202
228
|
...detail.outputs === void 0 ? {} : { outputs: detail.outputs },
|
|
203
229
|
...optional(detail, "view", readView),
|
|
204
230
|
...optional(detail, "form", readForm),
|
|
231
|
+
...optional(detail, "files", readFiles),
|
|
205
232
|
exports: detail.exports == null ? [] : readExports(detail.exports),
|
|
206
233
|
...optional(detail, "wait", readWait),
|
|
207
234
|
attempts: readAttempts(detail.attempts ?? []),
|
|
@@ -368,7 +395,7 @@ function readQuerySession(value) {
|
|
|
368
395
|
const s = record(value, path);
|
|
369
396
|
return {
|
|
370
397
|
engine: str(s.engine, `${path}.engine`),
|
|
371
|
-
sessionId
|
|
398
|
+
...optional(s, "sessionId", (v) => num(v, `${path}.sessionId`)),
|
|
372
399
|
...optional(s, "queryId", (v) => str(v, `${path}.queryId`)),
|
|
373
400
|
...optional(s, "server", (v) => str(v, `${path}.server`)),
|
|
374
401
|
...optional(s, "database", (v) => str(v, `${path}.database`)),
|
|
@@ -388,9 +415,17 @@ var SAMPLE_STRINGS = [
|
|
|
388
415
|
"startedAt",
|
|
389
416
|
"transactionStartedAt",
|
|
390
417
|
"queryId",
|
|
391
|
-
"sql"
|
|
418
|
+
"sql",
|
|
419
|
+
"taskId",
|
|
420
|
+
"node",
|
|
421
|
+
"action",
|
|
422
|
+
"description",
|
|
423
|
+
"cluster",
|
|
424
|
+
"status",
|
|
425
|
+
"totalRelation"
|
|
392
426
|
];
|
|
393
427
|
var SAMPLE_NUMBERS = [
|
|
428
|
+
"sessionId",
|
|
394
429
|
"requestId",
|
|
395
430
|
"blockedBy",
|
|
396
431
|
"waitMs",
|
|
@@ -401,19 +436,37 @@ var SAMPLE_NUMBERS = [
|
|
|
401
436
|
"reads",
|
|
402
437
|
"writes",
|
|
403
438
|
"memoryBytes",
|
|
404
|
-
"openTransactions"
|
|
439
|
+
"openTransactions",
|
|
440
|
+
"percentComplete",
|
|
441
|
+
"estimatedRemainingMs",
|
|
442
|
+
"activeShardsPercent",
|
|
443
|
+
"unassignedShards",
|
|
444
|
+
"relocatingShards",
|
|
445
|
+
"pendingTasks",
|
|
446
|
+
"heapPercent",
|
|
447
|
+
"cpuPercent",
|
|
448
|
+
"searchActive",
|
|
449
|
+
"searchQueue",
|
|
450
|
+
"searchRejected",
|
|
451
|
+
"pages",
|
|
452
|
+
"rowsRead",
|
|
453
|
+
"totalHits"
|
|
454
|
+
];
|
|
455
|
+
var SAMPLE_BOOLEANS = [
|
|
456
|
+
"blocked",
|
|
457
|
+
"cancellable",
|
|
458
|
+
"cancelled"
|
|
405
459
|
];
|
|
406
460
|
function readQuerySample(value, index) {
|
|
407
461
|
const path = `detail.query.diagnose[${index}]`;
|
|
408
462
|
const s = record(value, path);
|
|
409
463
|
const sample = {
|
|
410
464
|
sampledAt: str(s.sampledAt, `${path}.sampledAt`),
|
|
411
|
-
engine: str(s.engine, `${path}.engine`)
|
|
412
|
-
sessionId: num(s.sessionId, `${path}.sessionId`),
|
|
413
|
-
...optional(s, "blocked", (v) => bool(v, `${path}.blocked`))
|
|
465
|
+
engine: str(s.engine, `${path}.engine`)
|
|
414
466
|
};
|
|
415
467
|
for (const key of SAMPLE_STRINGS) Object.assign(sample, optional(s, key, (v) => str(v, `${path}.${key}`)));
|
|
416
468
|
for (const key of SAMPLE_NUMBERS) Object.assign(sample, optional(s, key, (v) => num(v, `${path}.${key}`)));
|
|
469
|
+
for (const key of SAMPLE_BOOLEANS) Object.assign(sample, optional(s, key, (v) => bool(v, `${path}.${key}`)));
|
|
417
470
|
return sample;
|
|
418
471
|
}
|
|
419
472
|
function readQueryRecord(value) {
|
|
@@ -469,7 +522,8 @@ function stepQueryCopy(query) {
|
|
|
469
522
|
{
|
|
470
523
|
title: query.queryFile ? `Template (${query.queryFile})` : "Template",
|
|
471
524
|
lang: "sql",
|
|
472
|
-
body: query.template
|
|
525
|
+
body: query.template,
|
|
526
|
+
...query.queryFile ? { source: query.queryFile } : {}
|
|
473
527
|
},
|
|
474
528
|
...query.sql ? [{
|
|
475
529
|
title: "SQL",
|
|
@@ -638,7 +692,9 @@ exports.clockTime = clockTime;
|
|
|
638
692
|
exports.formatDelay = formatDelay;
|
|
639
693
|
exports.formatExportValue = formatExportValue;
|
|
640
694
|
exports.hasStepDetail = hasStepDetail;
|
|
695
|
+
exports.isPdfFile = isPdfFile;
|
|
641
696
|
exports.policySummary = policySummary;
|
|
697
|
+
exports.previewKind = previewKind;
|
|
642
698
|
exports.readQuery = readQuery;
|
|
643
699
|
exports.readStepDetail = readStepDetail;
|
|
644
700
|
exports.readViolation = readViolation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepKind.cjs","names":["formatTestDuration"],"sources":["../../../src/data/verification/stepKind.ts"],"sourcesContent":["// The typed step-kind detail gavel's fixture verifier attaches to a node\n// (fixtures/verifier/report.go): `detail.step` names the kind and id, beside\n// the structured `wait`, `attempts`, `exports`, `outputs` and (for a\n// background Playwright watcher) `events`. Parsed here, once, so the detail\n// view and the copy brief read the same typed shape. A present-but-malformed\n// field is reported by path instead of being guessed at.\n\nimport type { BriefSection, Test } from \"../test-runner\";\nimport { formatTestDuration } from \"../test-runner\";\nimport type { VerifyNode } from \"./verify-report\";\nimport type { ClickyDocument } from \"../Clicky\";\nimport type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport type {\n LintSeverity,\n Violation,\n ViolationEntity,\n ViolationImageRegion,\n ViolationLocation,\n ViolationUrlTarget,\n} from \"../lint/types\";\n\nexport type StepRef = { id: string; kind: string };\n\nexport type WaitPolicy = {\n until?: string;\n failWhen?: string;\n interval?: string;\n backoff?: { factor?: number; max?: string };\n jitter?: string;\n timeout?: string;\n};\n\nexport const WAIT_OUTCOMES = [\"satisfied\", \"failed\", \"timeout\"] as const;\nexport type WaitOutcome = (typeof WAIT_OUTCOMES)[number];\n\nexport type WaitDetail = {\n policy: WaitPolicy;\n outcome: WaitOutcome;\n durationMs: number;\n /** The CEL expression that decided the outcome: policy.failWhen when it fired, else policy.until. */\n expression?: string;\n /** Domain reason the wait ended unsatisfied; may span several lines. */\n cause?: string;\n outputs?: unknown;\n error?: string;\n trace?: string;\n};\n\nexport type StepAttempt = { attempt: number; status: string; error?: string; durationMs?: number; result?: VerifyNode };\n\nexport type StepExport = { name: string; value: unknown; step: string };\n\nexport const WATCHER_EVENT_TYPES = [\"alert\", \"console\", \"pageerror\", \"response\"] as const;\nexport type WatcherEventType = (typeof WATCHER_EVENT_TYPES)[number];\n\nexport type WatcherEvent = {\n type: WatcherEventType;\n text?: string;\n url?: string;\n status?: number;\n detail?: string;\n};\n\nexport const STEP_FORM_STATES = [\"answered\", \"rejected\", \"supplied\", \"unanswered\"] as const;\nexport type StepFormState = (typeof STEP_FORM_STATES)[number];\n\nexport type StepForm = {\n title: string;\n description?: string;\n schema: JsonSchemaObject;\n values: Record<string, unknown>;\n state: StepFormState;\n answeredBy?: string;\n answeredAt?: string;\n};\n\nexport type StepDetail = {\n step: StepRef;\n outputs?: unknown;\n /** What the step returned, rendered by its kind as a clicky document (a query step's rows). */\n view?: ClickyDocument;\n /** The form a `form` step (or a fixture's `params:`) showed, and how it was answered. */\n form?: StepForm;\n exports: StepExport[];\n wait?: WaitDetail;\n attempts: StepAttempt[];\n events: WatcherEvent[];\n /** Whether the step runs in the background until teardown (a watcher). */\n background: boolean;\n /** Everything else in `node.detail` (cel_trace, run, recordings, …). */\n rest: Record<string, unknown>;\n};\n\nexport type StepDetailResult =\n | { kind: \"none\" }\n | { kind: \"step\"; step: StepDetail }\n | { kind: \"invalid\"; error: string };\n\nconst STEP_KEYS = new Set([\"step\", \"outputs\", \"view\", \"form\", \"exports\", \"wait\", \"attempts\", \"events\", \"background\"]);\n\nclass StepDetailError extends Error {}\n\nfunction fail(path: string, expectation: string): never {\n throw new StepDetailError(`${path} must be ${expectation}`);\n}\n\ntype Rec = Record<string, unknown>;\n\nconst isRecord = (value: unknown): value is Rec =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\n\nfunction record(value: unknown, path: string): Rec {\n return isRecord(value) ? value : fail(path, \"an object\");\n}\n\nfunction list(value: unknown, path: string): unknown[] {\n return Array.isArray(value) ? value : fail(path, \"an array\");\n}\n\nfunction str(value: unknown, path: string): string {\n return typeof value === \"string\" ? value : fail(path, \"a string\");\n}\n\nfunction num(value: unknown, path: string): number {\n return typeof value === \"number\" && Number.isFinite(value) ? value : fail(path, \"a number\");\n}\n\nfunction bool(value: unknown, path: string): boolean {\n return typeof value === \"boolean\" ? value : fail(path, \"a boolean\");\n}\n\nfunction oneOf<T extends string>(value: unknown, allowed: readonly T[], path: string): T {\n return allowed.includes(value as T)\n ? (value as T)\n : fail(path, `one of ${allowed.join(\", \")} (got ${JSON.stringify(value)})`);\n}\n\n/** `{ [key]: read(value) }` when the optional field is present, else `{}` — absent stays an absent key. */\nfunction optional<K extends string, T>(source: Rec, key: K, read: (value: unknown) => T): { [P in K]?: T } {\n return source[key] === undefined || source[key] === null ? {} : ({ [key]: read(source[key]) } as { [P in K]?: T });\n}\n\n/** A step's `view`: the clicky document (formatters.NewClickyDocument) its kind rendered. */\nfunction readView(value: unknown): ClickyDocument {\n const view = record(value, \"detail.view\");\n num(view.version, \"detail.view.version\");\n record(view.node, \"detail.view.node\");\n return view as unknown as ClickyDocument;\n}\n\n/** A step's `form`: the schema it showed, the values it ended with and how it was answered. */\nfunction readForm(value: unknown): StepForm {\n const form = record(value, \"detail.form\");\n const schema = record(form.schema, \"detail.form.schema\");\n return {\n title: str(form.title, \"detail.form.title\"),\n schema: schema as JsonSchemaObject,\n values: record(form.values, \"detail.form.values\"),\n state: oneOf(form.state, STEP_FORM_STATES, \"detail.form.state\"),\n ...optional(form, \"description\", (v) => str(v, \"detail.form.description\")),\n ...optional(form, \"answeredBy\", (v) => str(v, \"detail.form.answeredBy\")),\n ...optional(form, \"answeredAt\", (v) => str(v, \"detail.form.answeredAt\")),\n };\n}\n\n/** Durations arrive as Go-style strings (\"15s\"); a bare number is nanoseconds like every other duration on the wire. */\nfunction durationText(value: unknown, path: string): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\") return formatTestDuration(value);\n return fail(path, \"a duration string or nanosecond number\");\n}\n\nfunction scalarText(value: unknown, path: string): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\") return String(value);\n return fail(path, \"a string or number\");\n}\n\nfunction readPolicy(value: unknown): WaitPolicy {\n const path = \"detail.wait.policy\";\n const policy = record(value, path);\n const backoff = (raw: unknown) => {\n const b = record(raw, `${path}.backoff`);\n return {\n ...optional(b, \"factor\", (v) => num(v, `${path}.backoff.factor`)),\n ...optional(b, \"max\", (v) => durationText(v, `${path}.backoff.max`)),\n };\n };\n return {\n ...optional(policy, \"until\", (v) => str(v, `${path}.until`)),\n ...optional(policy, \"failWhen\", (v) => str(v, `${path}.failWhen`)),\n ...optional(policy, \"interval\", (v) => durationText(v, `${path}.interval`)),\n ...optional(policy, \"backoff\", backoff),\n ...optional(policy, \"jitter\", (v) => scalarText(v, `${path}.jitter`)),\n ...optional(policy, \"timeout\", (v) => durationText(v, `${path}.timeout`)),\n };\n}\n\nfunction readWait(value: unknown): WaitDetail {\n const wait = record(value, \"detail.wait\");\n return {\n policy: readPolicy(wait.policy ?? {}),\n outcome: oneOf(wait.outcome, WAIT_OUTCOMES, \"detail.wait.outcome\"),\n durationMs: nonnegative(wait.durationMs, \"detail.wait.durationMs\"),\n ...(wait.outputs === undefined ? {} : { outputs: wait.outputs }),\n ...optional(wait, \"expression\", (v) => str(v, \"detail.wait.expression\")),\n ...optional(wait, \"cause\", (v) => str(v, \"detail.wait.cause\")),\n ...optional(wait, \"error\", (v) => str(v, \"detail.wait.error\")),\n ...optional(wait, \"trace\", (v) => str(v, \"detail.wait.trace\")),\n };\n}\n\nfunction nonnegative(value: unknown, path: string): number {\n const result = num(value, path);\n return result >= 0 ? result : fail(path, \"non-negative\");\n}\n\nfunction readAttemptResult(value: unknown, path: string): VerifyNode {\n const node = record(value, path);\n str(node.name, `${path}.name`);\n for (const key of [\"framework\", \"message\", \"command\", \"work_dir\", \"stdout\", \"stderr\"]) {\n if (node[key] !== undefined) str(node[key], `${path}.${key}`);\n }\n for (const key of [\"passed\", \"failed\", \"timed_out\", \"warned\", \"skipped\", \"pending\", \"running\"]) {\n if (node[key] !== undefined) bool(node[key], `${path}.${key}`);\n }\n if (node.duration !== undefined) nonnegative(node.duration, `${path}.duration`);\n if (node.detail !== undefined) record(node.detail, `${path}.detail`);\n if (node.children !== undefined) list(node.children, `${path}.children`).forEach((child, i) => readAttemptResult(child, `${path}.children[${i}]`));\n return { ...node, name: str(node.name, `${path}.name`) } as VerifyNode;\n}\n\nfunction readAttempt(value: unknown, index: number): StepAttempt {\n const path = `detail.attempts[${index}]`;\n const a = record(value, path);\n return {\n attempt: num(a.attempt, `${path}.attempt`),\n status: str(a.status, `${path}.status`),\n ...optional(a, \"error\", (v) => str(v, `${path}.error`)),\n ...optional(a, \"durationMs\", (v) => nonnegative(v, `${path}.durationMs`)),\n ...optional(a, \"result\", (v) => readAttemptResult(v, `${path}.result`)),\n };\n}\n\nfunction readAttempts(value: unknown): StepAttempt[] {\n const attempts = list(value, \"detail.attempts\").map(readAttempt);\n attempts.forEach((attempt, index) => {\n if (attempt.attempt !== index + 1) fail(`detail.attempts[${index}].attempt`, `the sequence number ${index + 1}`);\n });\n return attempts;\n}\n\nfunction readExports(value: unknown): StepExport[] {\n return Object.entries(record(value, \"detail.exports\")).map(([name, raw]) => {\n const path = `detail.exports.${name}`;\n const entry = record(raw, path);\n return { name, value: entry.value, step: str(entry.step, `${path}.step`) };\n });\n}\n\nfunction readEvent(value: unknown, index: number): WatcherEvent {\n const path = `detail.events[${index}]`;\n const e = record(value, path);\n return {\n type: oneOf(e.type, WATCHER_EVENT_TYPES, `${path}.type`),\n ...optional(e, \"text\", (v) => str(v, `${path}.text`)),\n ...optional(e, \"url\", (v) => str(v, `${path}.url`)),\n ...optional(e, \"status\", (v) => num(v, `${path}.status`)),\n ...optional(e, \"detail\", (v) => str(v, `${path}.detail`)),\n };\n}\n\nfunction readStep(detail: Rec): StepDetail {\n const ref = record(detail.step, \"detail.step\");\n const rest = Object.fromEntries(Object.entries(detail).filter(([key]) => !STEP_KEYS.has(key)));\n return {\n step: { id: str(ref.id, \"detail.step.id\"), kind: str(ref.kind, \"detail.step.kind\") },\n ...(detail.outputs === undefined ? {} : { outputs: detail.outputs }),\n ...optional(detail, \"view\", readView),\n ...optional(detail, \"form\", readForm),\n exports: detail.exports == null ? [] : readExports(detail.exports),\n ...optional(detail, \"wait\", readWait),\n attempts: readAttempts(detail.attempts ?? []),\n events: list(detail.events ?? [], \"detail.events\").map(readEvent),\n background: bool(detail.background ?? false, \"detail.background\"),\n rest,\n };\n}\n\n/**\n * Whether `node.detail` carries a typed step (`detail.step`), and if so its\n * parsed contents. A node without `detail.step` is \"none\" whatever else its\n * detail holds; a `step` whose fields violate the contract is \"invalid\" with\n * the offending path, so the view can say so rather than render a guess.\n */\nexport function readStepDetail(detail: unknown): StepDetailResult {\n if (!isRecord(detail) || detail.step === undefined) return { kind: \"none\" };\n try {\n return { kind: \"step\", step: readStep(detail) };\n } catch (error) {\n if (error instanceof StepDetailError) return { kind: \"invalid\", error: error.message };\n throw error;\n }\n}\n\nexport type ViolationDetail = Violation & { locations: ViolationLocation[] };\n\nexport type ViolationDetailResult =\n | { kind: \"none\" }\n | { kind: \"violation\"; violation: ViolationDetail }\n | { kind: \"invalid\"; error: string };\n\nconst SEVERITIES = [\"error\", \"warning\", \"info\"] as const satisfies readonly LintSeverity[];\n\nfunction readEntity(value: unknown, path: string): ViolationEntity {\n const entity = record(value, path);\n return {\n kind: str(entity.kind, `${path}.kind`),\n id: str(entity.id, `${path}.id`),\n ...optional(entity, \"name\", (v) => str(v, `${path}.name`)),\n };\n}\n\nconst URL_STRATEGIES = [\"css\", \"xpath\", \"testId\", \"role\", \"text\"] as const;\n\nfunction readUrlTarget(value: unknown, path: string): ViolationUrlTarget {\n const target = record(value, path);\n const read: ViolationUrlTarget = {\n url: str(target.url, `${path}.url`),\n ...Object.assign({}, ...[...URL_STRATEGIES, \"name\"].map((key) => optional(target, key, (v) => str(v, `${path}.${key}`)))),\n };\n const strategies = URL_STRATEGIES.filter((key) => read[key] !== undefined);\n if (strategies.length > 1) fail(path, `a target with at most one selector strategy (got ${strategies.join(\", \")})`);\n if (read.name !== undefined && read.role === undefined) fail(`${path}.name`, \"paired with a role\");\n return read;\n}\n\nfunction readImage(value: unknown, path: string): ViolationImageRegion {\n const image = record(value, path);\n return {\n src: str(image.src, `${path}.src`),\n x: num(image.x, `${path}.x`),\n y: num(image.y, `${path}.y`),\n width: num(image.width, `${path}.width`),\n height: num(image.height, `${path}.height`),\n };\n}\n\nfunction readLocation(value: unknown, index: number): ViolationLocation {\n const path = `detail.violation.locations[${index}]`;\n const l = record(value, path);\n const location: ViolationLocation = {\n ...optional(l, \"file\", (v) => str(v, `${path}.file`)),\n ...optional(l, \"line\", (v) => num(v, `${path}.line`)),\n ...optional(l, \"column\", (v) => num(v, `${path}.column`)),\n ...optional(l, \"end_line\", (v) => num(v, `${path}.end_line`)),\n ...optional(l, \"ref\", (v) => str(v, `${path}.ref`)),\n ...optional(l, \"entity\", (v) => readEntity(v, `${path}.entity`)),\n ...optional(l, \"url\", (v) => readUrlTarget(v, `${path}.url`)),\n ...optional(l, \"image\", (v) => readImage(v, `${path}.image`)),\n ...optional(l, \"message\", (v) => str(v, `${path}.message`)),\n };\n if (!(location.file || location.entity || location.url || location.image || location.message)) {\n fail(path, \"a location naming a file, entity, url, image or message\");\n }\n return location;\n}\n\nfunction readRule(value: unknown): NonNullable<Violation[\"rule\"]> {\n const path = \"detail.violation.rule\";\n const rule = record(value, path);\n return {\n ...optional(rule, \"method\", (v) => str(v, `${path}.method`)),\n ...optional(rule, \"description\", (v) => str(v, `${path}.description`)),\n ...optional(rule, \"pattern\", (v) => str(v, `${path}.pattern`)),\n ...optional(rule, \"package\", (v) => str(v, `${path}.package`)),\n };\n}\n\nfunction readViolationRecord(value: unknown): ViolationDetail {\n const path = \"detail.violation\";\n const v = record(value, path);\n return {\n ...optional(v, \"severity\", (s) => oneOf(s, SEVERITIES, `${path}.severity`)),\n ...optional(v, \"message\", (m) => str(m, `${path}.message`)),\n ...optional(v, \"rule\", readRule),\n ...optional(v, \"source\", (s) => str(s, `${path}.source`)),\n ...optional(v, \"file\", (f) => str(f, `${path}.file`)),\n ...optional(v, \"line\", (n) => num(n, `${path}.line`)),\n locations: list(v.locations ?? [], `${path}.locations`).map(readLocation),\n };\n}\n\n/**\n * The lint violation a finding node carries in `detail.violation` (gavel\n * models.Violation, published under fixtures.ViolationMetadataKey). Read apart\n * from the typed step: a finding has no `detail.step`. A violation whose fields\n * break the contract is \"invalid\" with the offending path.\n */\nexport function readViolation(detail: unknown): ViolationDetailResult {\n if (!isRecord(detail) || detail.violation === undefined) return { kind: \"none\" };\n try {\n return { kind: \"violation\", violation: readViolationRecord(detail.violation) };\n } catch (error) {\n if (error instanceof StepDetailError) return { kind: \"invalid\", error: error.message };\n throw error;\n }\n}\n\nfunction withoutKey(detail: unknown, key: string): unknown {\n if (!isRecord(detail) || !(key in detail)) return detail;\n const rest = Object.fromEntries(Object.entries(detail).filter(([k]) => k !== key));\n return Object.keys(rest).length > 0 ? rest : undefined;\n}\n\n/** `detail` without its `violation`, which the Locations section shows instead of the raw block. */\nexport function withoutViolation(detail: unknown): unknown {\n return withoutKey(detail, \"violation\");\n}\n\n/**\n * What a query step ran (gavel fixtures.QueryMetadataKey): the query as authored,\n * its `$(.params.x)` / `{{.params.x}}` references intact; the statement\n * commons-db issued with them bound to driver placeholders; the bound values in\n * placeholder order; the step's params by name; and the file the template came from.\n */\nexport type StepQuery = {\n template: string;\n sql?: string;\n arguments?: unknown[];\n params?: Record<string, unknown>;\n queryFile?: string;\n /** The connection the query runs on and where it points; never its secrets. */\n connection?: StepQueryConnection;\n /** The batches of a SQL program that have ended, with the rows each changed where the driver reports it. */\n batches?: StepQueryBatch[];\n /** The server session the query ran on (SPID, backend PID, connection id or ClickHouse query id). */\n session?: StepQuerySession;\n /** AutoDiagnose samples of that session while the statement ran, oldest first (gavel keeps the last 100). */\n diagnose?: StepQuerySample[];\n /** How many older samples gavel dropped beyond the ones in `diagnose`. */\n diagnoseDropped?: number;\n /** Why sampling stopped (a missing grant, a read error); the query itself is unaffected. */\n diagnoseError?: string;\n};\n\n/** commons-db query.ServerSession. `engine` is postgres, sqlserver, mysql or clickhouse; `sessionId` is 0 for clickhouse, which uses `queryId`. */\nexport type StepQuerySession = {\n engine: string;\n sessionId: number;\n queryId?: string;\n server?: string;\n database?: string;\n user?: string;\n page?: number;\n};\n\n/**\n * commons-db sqlactivity.Sample as JSON. A zero metric means the engine does not\n * report it; `blockedBy` 0 means not blocked; `transactionStartedAt` may be the\n * zero time (\"0001-01-01T00:00:00Z\").\n */\nexport type StepQuerySample = {\n sampledAt: string;\n engine: string;\n sessionId: number;\n database?: string;\n requestId?: number;\n blockedBy?: number;\n blocked?: boolean;\n user?: string;\n application?: string;\n clientHost?: string;\n state?: string;\n command?: string;\n waitType?: string;\n waitResource?: string;\n waitMs?: number;\n startedAt?: string;\n transactionStartedAt?: string;\n elapsedMs?: number;\n transactionMs?: number;\n cpuMs?: number;\n logicalReads?: number;\n reads?: number;\n writes?: number;\n memoryBytes?: number;\n openTransactions?: number;\n queryId?: string;\n sql?: string;\n};\n\nexport type StepQueryConnection = {\n name: string;\n type: string;\n host?: string;\n port?: string;\n user?: string;\n database?: string;\n};\n\n/** `run` is the batch's repetition under `GO <count>`, 1 for a batch that runs once. */\nexport type StepQueryBatch = { batch: number; run: number; rowsAffected?: number };\n\nfunction readQueryConnection(value: unknown): StepQueryConnection {\n const path = \"detail.query.connection\";\n const c = record(value, path);\n return {\n name: str(c.name, `${path}.name`),\n type: str(c.type, `${path}.type`),\n ...optional(c, \"host\", (v) => str(v, `${path}.host`)),\n ...optional(c, \"port\", (v) => str(v, `${path}.port`)),\n ...optional(c, \"user\", (v) => str(v, `${path}.user`)),\n ...optional(c, \"database\", (v) => str(v, `${path}.database`)),\n };\n}\n\nfunction readQueryBatch(value: unknown, index: number): StepQueryBatch {\n const path = `detail.query.batches[${index}]`;\n const b = record(value, path);\n return {\n batch: num(b.batch, `${path}.batch`),\n run: num(b.run, `${path}.run`),\n ...optional(b, \"rowsAffected\", (v) => num(v, `${path}.rowsAffected`)),\n };\n}\n\nfunction readQuerySession(value: unknown): StepQuerySession {\n const path = \"detail.query.session\";\n const s = record(value, path);\n return {\n engine: str(s.engine, `${path}.engine`),\n sessionId: num(s.sessionId, `${path}.sessionId`),\n ...optional(s, \"queryId\", (v) => str(v, `${path}.queryId`)),\n ...optional(s, \"server\", (v) => str(v, `${path}.server`)),\n ...optional(s, \"database\", (v) => str(v, `${path}.database`)),\n ...optional(s, \"user\", (v) => str(v, `${path}.user`)),\n ...optional(s, \"page\", (v) => num(v, `${path}.page`)),\n };\n}\n\nconst SAMPLE_STRINGS = [\n \"database\", \"user\", \"application\", \"clientHost\", \"state\", \"command\", \"waitType\", \"waitResource\",\n \"startedAt\", \"transactionStartedAt\", \"queryId\", \"sql\",\n] as const;\nconst SAMPLE_NUMBERS = [\n \"requestId\", \"blockedBy\", \"waitMs\", \"elapsedMs\", \"transactionMs\", \"cpuMs\", \"logicalReads\", \"reads\", \"writes\",\n \"memoryBytes\", \"openTransactions\",\n] as const;\n\nfunction readQuerySample(value: unknown, index: number): StepQuerySample {\n const path = `detail.query.diagnose[${index}]`;\n const s = record(value, path);\n const sample: StepQuerySample = {\n sampledAt: str(s.sampledAt, `${path}.sampledAt`),\n engine: str(s.engine, `${path}.engine`),\n sessionId: num(s.sessionId, `${path}.sessionId`),\n ...optional(s, \"blocked\", (v) => bool(v, `${path}.blocked`)),\n };\n for (const key of SAMPLE_STRINGS) Object.assign(sample, optional(s, key, (v) => str(v, `${path}.${key}`)));\n for (const key of SAMPLE_NUMBERS) Object.assign(sample, optional(s, key, (v) => num(v, `${path}.${key}`)));\n return sample;\n}\n\nexport type StepQueryResult =\n | { kind: \"none\" }\n | { kind: \"query\"; query: StepQuery }\n | { kind: \"invalid\"; error: string };\n\nfunction readQueryRecord(value: unknown): StepQuery {\n const path = \"detail.query\";\n const q = record(value, path);\n return {\n template: str(q.template, `${path}.template`),\n ...optional(q, \"sql\", (v) => str(v, `${path}.sql`)),\n ...optional(q, \"arguments\", (v) => list(v, `${path}.arguments`)),\n ...optional(q, \"params\", (v) => record(v, `${path}.params`)),\n ...optional(q, \"queryFile\", (v) => str(v, `${path}.queryFile`)),\n ...optional(q, \"connection\", readQueryConnection),\n ...optional(q, \"batches\", (v) => list(v, `${path}.batches`).map(readQueryBatch)),\n ...optional(q, \"session\", readQuerySession),\n ...optional(q, \"diagnose\", (v) => list(v, `${path}.diagnose`).map(readQuerySample)),\n ...optional(q, \"diagnoseDropped\", (v) => num(v, `${path}.diagnoseDropped`)),\n ...optional(q, \"diagnoseError\", (v) => str(v, `${path}.diagnoseError`)),\n };\n}\n\n/**\n * The query a query step carries in `detail.query`, read apart from the typed\n * step like the violation (a markdown query row has no `detail.step`). A record\n * whose fields break the contract is \"invalid\" with the offending path.\n */\nexport function readQuery(detail: unknown): StepQueryResult {\n if (!isRecord(detail) || detail.query === undefined) return { kind: \"none\" };\n try {\n return { kind: \"query\", query: readQueryRecord(detail.query) };\n } catch (error) {\n if (error instanceof StepDetailError) return { kind: \"invalid\", error: error.message };\n throw error;\n }\n}\n\n/** `detail` without its `query`, which the Query section shows instead of the raw block. */\nexport function withoutQuery(detail: unknown): unknown {\n return withoutKey(detail, \"query\");\n}\n\n/** Brief sections for the \"Copy details\" button: the template, the issued SQL and the params it bound. */\nexport function stepQueryCopy(query: StepQuery): BriefSection[] {\n const params = Object.entries(query.params ?? {});\n const connection = query.connection;\n return [\n ...(connection ? [{ title: \"Connection\", body: connectionCopy(connection) }] : []),\n { title: query.queryFile ? `Template (${query.queryFile})` : \"Template\", lang: \"sql\", body: query.template },\n ...(query.sql ? [{ title: \"SQL\", lang: \"sql\", body: query.sql }] : []),\n ...(params.length > 0 ? [{ title: \"Params\", body: params.map(([name, value]) => `${name}=${formatExportValue(value)}`).join(\"\\n\") }] : []),\n ...(query.arguments && query.arguments.length > 0\n ? [{ title: \"Arguments\", body: query.arguments.map((value, i) => `${i + 1}: ${formatExportValue(value)}`).join(\"\\n\") }]\n : []),\n ];\n}\n\n/** The connection as the badges show it: `name (type)`, then host:port, user and db where known. */\nfunction connectionCopy(connection: StepQueryConnection): string {\n const host = connection.host && (connection.port ? `${connection.host}:${connection.port}` : connection.host);\n return [\n `${connection.name} (${connection.type})`,\n host && `host: ${host}`,\n connection.user && `user: ${connection.user}`,\n connection.database && `db: ${connection.database}`,\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\n/** How a `form` step's form was answered, or undefined for a node that is no (valid) form step. */\nexport function stepFormState(node: Pick<Test, \"detail\">): StepFormState | undefined {\n const parsed = readStepDetail(node.detail);\n return parsed.kind === \"step\" ? parsed.step.form?.state : undefined;\n}\n\n/** The step detail when there is one, for matchers that only need to know. */\nexport function hasStepDetail(detail: unknown): boolean {\n return readStepDetail(detail).kind !== \"none\";\n}\n\n/** The fixtures.ExecutionNode fields gavel puts at the top of `node.detail`, shown as a header instead of raw JSON. */\nexport type ExecutionHeader = {\n kind?: string;\n state?: string;\n file?: string;\n sectionPath?: string;\n /** Zero-based row of the step within its section. */\n rowIndex?: number;\n line?: number;\n startedAt?: string;\n finishedAt?: string;\n /** Nanoseconds. */\n durationNs?: number;\n error?: string;\n};\n\nconst isString = (value: unknown): value is string => typeof value === \"string\";\nconst isNumber = (value: unknown): value is number => typeof value === \"number\" && Number.isFinite(value);\n\n/**\n * Splits the ExecutionNode fields (name, kind, state, origin, started_at,\n * finished_at, duration, error) off `detail` into a header, dropping the\n * internal `key`. A field of an unexpected type is not consumed — it stays in\n * `rest`, so it is visible in the raw block rather than silently hidden.\n */\nexport function splitExecutionDetail(detail: unknown): { header: ExecutionHeader; rest: unknown } {\n if (!isRecord(detail)) return { header: {}, rest: detail };\n const rest: Rec = { ...detail };\n delete rest.key;\n const take = <T>(key: string, guard: (value: unknown) => value is T): T | undefined => {\n const value = rest[key];\n if (!guard(value)) return undefined;\n delete rest[key];\n return value;\n };\n const header: ExecutionHeader = {};\n const assign = <K extends keyof ExecutionHeader>(field: K, value: ExecutionHeader[K] | undefined) => {\n if (value !== undefined) header[field] = value;\n };\n take(\"name\", isString);\n assign(\"kind\", take(\"kind\", isString));\n assign(\"state\", take(\"state\", isString));\n assign(\"startedAt\", take(\"started_at\", isString));\n assign(\"finishedAt\", take(\"finished_at\", isString));\n assign(\"durationNs\", take(\"duration\", isNumber));\n assign(\"error\", take(\"error\", isString));\n const origin = take(\"origin\", isRecord);\n if (origin) {\n assign(\"file\", isString(origin.file) ? origin.file : undefined);\n assign(\"sectionPath\", isString(origin.section_path) ? origin.section_path : undefined);\n assign(\"rowIndex\", isNumber(origin.row_index) ? origin.row_index : undefined);\n assign(\"line\", isNumber(origin.line) ? origin.line : undefined);\n }\n return { header, rest: Object.keys(rest).length > 0 ? rest : undefined };\n}\n\nexport type WaitCondition = \"until\" | \"failWhen\";\n\n/** Which of the wait's two conditions decided its outcome. `expression` is authoritative; older payloads without it are inferred from the outcome. */\nexport function waitDecidedBy(wait: WaitDetail): WaitCondition {\n if (wait.expression !== undefined) return wait.expression === wait.policy.failWhen ? \"failWhen\" : \"until\";\n return wait.outcome === \"failed\" && wait.policy.failWhen ? \"failWhen\" : \"until\";\n}\n\n/** `09:00:04` from an RFC 3339 timestamp, as written (no timezone conversion); anything else verbatim. */\nexport function clockTime(at: string): string {\n return /T(\\d{2}:\\d{2}:\\d{2})/.exec(at)?.[1] ?? at;\n}\n\nexport function formatDelay(ms: number): string {\n return ms <= 0 ? \"0ms\" : formatTestDuration(ms * 1e6);\n}\n\n/** `every 1s · backoff ×1.5 up to 10s · jitter ±20% · timeout 3m`, skipping what the policy leaves unset. */\nexport function policySummary(policy: WaitPolicy): string {\n const backoff = [\n policy.backoff?.factor !== undefined && `×${policy.backoff.factor}`,\n policy.backoff?.max && `up to ${policy.backoff.max}`,\n ].filter(Boolean);\n return [\n policy.interval && `every ${policy.interval}`,\n backoff.length > 0 && `backoff ${backoff.join(\" \")}`,\n policy.jitter && `jitter ±${policy.jitter}`,\n policy.timeout && `timeout ${policy.timeout}`,\n ]\n .filter(Boolean)\n .join(\" · \");\n}\n\nexport function formatExportValue(value: unknown): string {\n if (value === undefined) return \"\";\n return typeof value === \"string\" ? value : JSON.stringify(value);\n}\n\nfunction waitCopy(wait: WaitDetail): BriefSection {\n const { policy } = wait;\n const lines = [\n `outcome: ${wait.outcome}`,\n `elapsed: ${formatDelay(wait.durationMs)}`,\n `policy: ${policySummary(policy)}`,\n policy.until && `until: ${policy.until}`,\n policy.failWhen && `failWhen: ${policy.failWhen}`,\n wait.expression && `decided by: ${wait.expression}`,\n wait.cause && `cause: ${wait.cause}`,\n wait.error && `error: ${wait.error}`,\n wait.trace && `trace: ${wait.trace}`,\n wait.outputs !== undefined && `outputs: ${JSON.stringify(wait.outputs)}`,\n ];\n return { title: \"Wait\", body: lines.filter(Boolean).join(\"\\n\") };\n}\n\nfunction attemptLine(a: StepAttempt): string {\n const head = [`#${a.attempt}`, a.status, a.durationMs !== undefined && formatDelay(a.durationMs)];\n return `${head.filter(Boolean).join(\" \")}${a.error ? ` — ${a.error}` : \"\"}`;\n}\n\nfunction eventLine(e: WatcherEvent): string {\n const body = [e.status, e.text, e.url].filter((part) => part !== undefined).join(\" \");\n return `[${e.type}]${body ? ` ${body}` : \"\"}${e.detail ? ` — ${e.detail}` : \"\"}`;\n}\n\n/** Brief sections for the \"Copy details\" button: wait trace, retry attempts, exports and watcher events. */\nexport function stepKindCopy(step: StepDetail): BriefSection[] {\n return [\n ...(step.outputs !== undefined ? [{ title: \"Outputs\", body: JSON.stringify(step.outputs, null, 2), lang: \"json\" }] : []),\n ...(step.wait ? [waitCopy(step.wait)] : []),\n ...(step.attempts.length > 0 ? [{ title: \"Attempts\", body: step.attempts.map(attemptLine).join(\"\\n\") }] : []),\n ...(step.exports.length > 0\n ? [{ title: \"Exports\", body: step.exports.map((e) => `${e.name}=${formatExportValue(e.value)} (from ${e.step})`).join(\"\\n\") }]\n : []),\n ...(step.events.length > 0 ? [{ title: \"Events\", body: step.events.map(eventLine).join(\"\\n\") }] : []),\n ];\n}\n"],"mappings":";;AAgCA,IAAa,gBAAgB;CAAC;CAAa;CAAU;AAAS;AAoB9D,IAAa,sBAAsB;CAAC;CAAS;CAAW;CAAa;AAAU;AAW/E,IAAa,mBAAmB;CAAC;CAAY;CAAY;CAAY;AAAY;AAmCjF,IAAM,4BAAY,IAAI,IAAI;CAAC;CAAQ;CAAW;CAAQ;CAAQ;CAAW;CAAQ;CAAY;CAAU;AAAY,CAAC;AAEpH,IAAM,kBAAN,cAA8B,MAAM,CAAC;AAErC,SAAS,KAAK,MAAc,aAA4B;CACtD,MAAM,IAAI,gBAAgB,GAAG,KAAK,WAAW,aAAa;AAC5D;AAIA,IAAM,YAAY,UAChB,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAErE,SAAS,OAAO,OAAgB,MAAmB;CACjD,OAAO,SAAS,KAAK,IAAI,QAAQ,KAAK,MAAM,WAAW;AACzD;AAEA,SAAS,KAAK,OAAgB,MAAyB;CACrD,OAAO,MAAM,QAAQ,KAAK,IAAI,QAAQ,KAAK,MAAM,UAAU;AAC7D;AAEA,SAAS,IAAI,OAAgB,MAAsB;CACjD,OAAO,OAAO,UAAU,WAAW,QAAQ,KAAK,MAAM,UAAU;AAClE;AAEA,SAAS,IAAI,OAAgB,MAAsB;CACjD,OAAO,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,IAAI,QAAQ,KAAK,MAAM,UAAU;AAC5F;AAEA,SAAS,KAAK,OAAgB,MAAuB;CACnD,OAAO,OAAO,UAAU,YAAY,QAAQ,KAAK,MAAM,WAAW;AACpE;AAEA,SAAS,MAAwB,OAAgB,SAAuB,MAAiB;CACvF,OAAO,QAAQ,SAAS,KAAU,IAC7B,QACD,KAAK,MAAM,UAAU,QAAQ,KAAK,IAAI,EAA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AAG;CACpF,OAAO,IAAI,EAAE,KAAK,GAAG,OAAO,IAAI,SAAS,KAAK,EAAE,SAAS,MAAM,EAAE,WAAW;AAC9E;;AAGA,SAAgB,aAAa,MAAkC;CAC7D,OAAO;EACL,GAAI,KAAK,YAAY,KAAA,IAAY,CAAC;GAAE,OAAO;GAAW,MAAM,KAAK,UAAU,KAAK,SAAS,MAAM,CAAC;GAAG,MAAM;EAAO,CAAC,IAAI,CAAC;EACtH,GAAI,KAAK,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,IAAI,CAAC;EACzC,GAAI,KAAK,SAAS,SAAS,IAAI,CAAC;GAAE,OAAO;GAAY,MAAM,KAAK,SAAS,IAAI,WAAW,CAAC,CAAC,KAAK,IAAI;EAAE,CAAC,IAAI,CAAC;EAC3G,GAAI,KAAK,QAAQ,SAAS,IACtB,CAAC;GAAE,OAAO;GAAW,MAAM,KAAK,QAAQ,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI;EAAE,CAAC,IAC3H,CAAC;EACL,GAAI,KAAK,OAAO,SAAS,IAAI,CAAC;GAAE,OAAO;GAAU,MAAM,KAAK,OAAO,IAAI,SAAS,CAAC,CAAC,KAAK,IAAI;EAAE,CAAC,IAAI,CAAC;CACrG;AACF"}
|
|
1
|
+
{"version":3,"file":"stepKind.cjs","names":["formatTestDuration"],"sources":["../../../src/data/verification/stepKind.ts"],"sourcesContent":["// The typed step-kind detail gavel's fixture verifier attaches to a node\n// (fixtures/verifier/report.go): `detail.step` names the kind and id, beside\n// the structured `wait`, `attempts`, `exports`, `outputs` and (for a\n// background Playwright watcher) `events`. Parsed here, once, so the detail\n// view and the copy brief read the same typed shape. A present-but-malformed\n// field is reported by path instead of being guessed at.\n\nimport type { BriefSection, Test } from \"../test-runner\";\nimport { formatTestDuration } from \"../test-runner\";\nimport type { VerifyNode } from \"./verify-report\";\nimport type { ClickyDocument } from \"../Clicky\";\nimport type { JsonSchemaObject } from \"../../components/json-schema-form-types\";\nimport type {\n LintSeverity,\n Violation,\n ViolationEntity,\n ViolationImageRegion,\n ViolationLocation,\n ViolationUrlTarget,\n} from \"../lint/types\";\n\nexport type StepRef = { id: string; kind: string };\n\nexport type WaitPolicy = {\n until?: string;\n failWhen?: string;\n interval?: string;\n backoff?: { factor?: number; max?: string };\n jitter?: string;\n timeout?: string;\n};\n\nexport const WAIT_OUTCOMES = [\"satisfied\", \"failed\", \"timeout\"] as const;\nexport type WaitOutcome = (typeof WAIT_OUTCOMES)[number];\n\nexport type WaitDetail = {\n policy: WaitPolicy;\n outcome: WaitOutcome;\n durationMs: number;\n /** The CEL expression that decided the outcome: policy.failWhen when it fired, else policy.until. */\n expression?: string;\n /** Domain reason the wait ended unsatisfied; may span several lines. */\n cause?: string;\n outputs?: unknown;\n error?: string;\n trace?: string;\n};\n\nexport type StepAttempt = { attempt: number; status: string; error?: string; durationMs?: number; result?: VerifyNode };\n\nexport type StepExport = { name: string; value: unknown; step: string };\n\nexport const WATCHER_EVENT_TYPES = [\"alert\", \"console\", \"pageerror\", \"response\"] as const;\nexport type WatcherEventType = (typeof WATCHER_EVENT_TYPES)[number];\n\nexport type WatcherEvent = {\n type: WatcherEventType;\n text?: string;\n url?: string;\n status?: number;\n detail?: string;\n};\n\nexport const STEP_FORM_STATES = [\"answered\", \"rejected\", \"supplied\", \"unanswered\"] as const;\nexport type StepFormState = (typeof STEP_FORM_STATES)[number];\n\nexport type StepForm = {\n title: string;\n description?: string;\n schema: JsonSchemaObject;\n values: Record<string, unknown>;\n state: StepFormState;\n answeredBy?: string;\n answeredAt?: string;\n};\n\n/** A file a step attached (gavel fixtures.StepFile): an absolute `path` the host serves, with its mime type. */\nexport type StepFile = { path: string; name: string; mime: string; title?: string };\n\nexport type FilePreview = \"html\" | \"pdf\" | \"image\" | \"none\";\n\n/** How a step file is previewed, decided by its mime type. */\nexport function previewKind(mime: string): FilePreview {\n const type = mime.split(\";\", 1)[0]!.trim().toLowerCase();\n if (type === \"text/html\") return \"html\";\n if (type === \"application/pdf\") return \"pdf\";\n if (type.startsWith(\"image/\")) return \"image\";\n return \"none\";\n}\n\n/** PDFs get their own detail tab; every other attached file previews in the step's detail. */\nexport function isPdfFile(file: StepFile): boolean {\n return previewKind(file.mime) === \"pdf\";\n}\n\nexport type StepDetail = {\n step: StepRef;\n outputs?: unknown;\n /** What the step returned, rendered by its kind as a clicky document (a query step's rows). */\n view?: ClickyDocument;\n /** The form a `form` step (or a fixture's `params:`) showed, and how it was answered. */\n form?: StepForm;\n /** Files the step attached (a facet report's html/pdf/png), previewed through the host's `fileUrl`. */\n files?: StepFile[];\n exports: StepExport[];\n wait?: WaitDetail;\n attempts: StepAttempt[];\n events: WatcherEvent[];\n /** Whether the step runs in the background until teardown (a watcher). */\n background: boolean;\n /** Everything else in `node.detail` (cel_trace, run, recordings, …). */\n rest: Record<string, unknown>;\n};\n\nexport type StepDetailResult =\n | { kind: \"none\" }\n | { kind: \"step\"; step: StepDetail }\n | { kind: \"invalid\"; error: string };\n\nconst STEP_KEYS = new Set([\"step\", \"outputs\", \"view\", \"form\", \"files\", \"exports\", \"wait\", \"attempts\", \"events\", \"background\"]);\n\nclass StepDetailError extends Error {}\n\nfunction fail(path: string, expectation: string): never {\n throw new StepDetailError(`${path} must be ${expectation}`);\n}\n\ntype Rec = Record<string, unknown>;\n\nconst isRecord = (value: unknown): value is Rec =>\n value !== null && typeof value === \"object\" && !Array.isArray(value);\n\nfunction record(value: unknown, path: string): Rec {\n return isRecord(value) ? value : fail(path, \"an object\");\n}\n\nfunction list(value: unknown, path: string): unknown[] {\n return Array.isArray(value) ? value : fail(path, \"an array\");\n}\n\nfunction str(value: unknown, path: string): string {\n return typeof value === \"string\" ? value : fail(path, \"a string\");\n}\n\nfunction num(value: unknown, path: string): number {\n return typeof value === \"number\" && Number.isFinite(value) ? value : fail(path, \"a number\");\n}\n\nfunction bool(value: unknown, path: string): boolean {\n return typeof value === \"boolean\" ? value : fail(path, \"a boolean\");\n}\n\nfunction oneOf<T extends string>(value: unknown, allowed: readonly T[], path: string): T {\n return allowed.includes(value as T)\n ? (value as T)\n : fail(path, `one of ${allowed.join(\", \")} (got ${JSON.stringify(value)})`);\n}\n\n/** `{ [key]: read(value) }` when the optional field is present, else `{}` — absent stays an absent key. */\nfunction optional<K extends string, T>(source: Rec, key: K, read: (value: unknown) => T): { [P in K]?: T } {\n return source[key] === undefined || source[key] === null ? {} : ({ [key]: read(source[key]) } as { [P in K]?: T });\n}\n\n/** A step's `view`: the clicky document (formatters.NewClickyDocument) its kind rendered. */\nfunction readView(value: unknown): ClickyDocument {\n const view = record(value, \"detail.view\");\n num(view.version, \"detail.view.version\");\n record(view.node, \"detail.view.node\");\n return view as unknown as ClickyDocument;\n}\n\n/** A step's `form`: the schema it showed, the values it ended with and how it was answered. */\nfunction readForm(value: unknown): StepForm {\n const form = record(value, \"detail.form\");\n const schema = record(form.schema, \"detail.form.schema\");\n return {\n title: str(form.title, \"detail.form.title\"),\n schema: schema as JsonSchemaObject,\n values: record(form.values, \"detail.form.values\"),\n state: oneOf(form.state, STEP_FORM_STATES, \"detail.form.state\"),\n ...optional(form, \"description\", (v) => str(v, \"detail.form.description\")),\n ...optional(form, \"answeredBy\", (v) => str(v, \"detail.form.answeredBy\")),\n ...optional(form, \"answeredAt\", (v) => str(v, \"detail.form.answeredAt\")),\n };\n}\n\n/** A step's `files`: what it attached through StepContext.AttachFile. */\nfunction readFiles(value: unknown): StepFile[] {\n return list(value, \"detail.files\").map((raw, index) => {\n const path = `detail.files[${index}]`;\n const file = record(raw, path);\n return {\n path: str(file.path, `${path}.path`),\n name: str(file.name, `${path}.name`),\n mime: str(file.mime, `${path}.mime`),\n ...optional(file, \"title\", (v) => str(v, `${path}.title`)),\n };\n });\n}\n\n/** Durations arrive as Go-style strings (\"15s\"); a bare number is nanoseconds like every other duration on the wire. */\nfunction durationText(value: unknown, path: string): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\") return formatTestDuration(value);\n return fail(path, \"a duration string or nanosecond number\");\n}\n\nfunction scalarText(value: unknown, path: string): string {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\") return String(value);\n return fail(path, \"a string or number\");\n}\n\nfunction readPolicy(value: unknown): WaitPolicy {\n const path = \"detail.wait.policy\";\n const policy = record(value, path);\n const backoff = (raw: unknown) => {\n const b = record(raw, `${path}.backoff`);\n return {\n ...optional(b, \"factor\", (v) => num(v, `${path}.backoff.factor`)),\n ...optional(b, \"max\", (v) => durationText(v, `${path}.backoff.max`)),\n };\n };\n return {\n ...optional(policy, \"until\", (v) => str(v, `${path}.until`)),\n ...optional(policy, \"failWhen\", (v) => str(v, `${path}.failWhen`)),\n ...optional(policy, \"interval\", (v) => durationText(v, `${path}.interval`)),\n ...optional(policy, \"backoff\", backoff),\n ...optional(policy, \"jitter\", (v) => scalarText(v, `${path}.jitter`)),\n ...optional(policy, \"timeout\", (v) => durationText(v, `${path}.timeout`)),\n };\n}\n\nfunction readWait(value: unknown): WaitDetail {\n const wait = record(value, \"detail.wait\");\n return {\n policy: readPolicy(wait.policy ?? {}),\n outcome: oneOf(wait.outcome, WAIT_OUTCOMES, \"detail.wait.outcome\"),\n durationMs: nonnegative(wait.durationMs, \"detail.wait.durationMs\"),\n ...(wait.outputs === undefined ? {} : { outputs: wait.outputs }),\n ...optional(wait, \"expression\", (v) => str(v, \"detail.wait.expression\")),\n ...optional(wait, \"cause\", (v) => str(v, \"detail.wait.cause\")),\n ...optional(wait, \"error\", (v) => str(v, \"detail.wait.error\")),\n ...optional(wait, \"trace\", (v) => str(v, \"detail.wait.trace\")),\n };\n}\n\nfunction nonnegative(value: unknown, path: string): number {\n const result = num(value, path);\n return result >= 0 ? result : fail(path, \"non-negative\");\n}\n\nfunction readAttemptResult(value: unknown, path: string): VerifyNode {\n const node = record(value, path);\n str(node.name, `${path}.name`);\n for (const key of [\"framework\", \"message\", \"command\", \"work_dir\", \"stdout\", \"stderr\"]) {\n if (node[key] !== undefined) str(node[key], `${path}.${key}`);\n }\n for (const key of [\"passed\", \"failed\", \"timed_out\", \"warned\", \"skipped\", \"pending\", \"running\"]) {\n if (node[key] !== undefined) bool(node[key], `${path}.${key}`);\n }\n if (node.duration !== undefined) nonnegative(node.duration, `${path}.duration`);\n if (node.detail !== undefined) record(node.detail, `${path}.detail`);\n if (node.children !== undefined) list(node.children, `${path}.children`).forEach((child, i) => readAttemptResult(child, `${path}.children[${i}]`));\n return { ...node, name: str(node.name, `${path}.name`) } as VerifyNode;\n}\n\nfunction readAttempt(value: unknown, index: number): StepAttempt {\n const path = `detail.attempts[${index}]`;\n const a = record(value, path);\n return {\n attempt: num(a.attempt, `${path}.attempt`),\n status: str(a.status, `${path}.status`),\n ...optional(a, \"error\", (v) => str(v, `${path}.error`)),\n ...optional(a, \"durationMs\", (v) => nonnegative(v, `${path}.durationMs`)),\n ...optional(a, \"result\", (v) => readAttemptResult(v, `${path}.result`)),\n };\n}\n\nfunction readAttempts(value: unknown): StepAttempt[] {\n const attempts = list(value, \"detail.attempts\").map(readAttempt);\n attempts.forEach((attempt, index) => {\n if (attempt.attempt !== index + 1) fail(`detail.attempts[${index}].attempt`, `the sequence number ${index + 1}`);\n });\n return attempts;\n}\n\nfunction readExports(value: unknown): StepExport[] {\n return Object.entries(record(value, \"detail.exports\")).map(([name, raw]) => {\n const path = `detail.exports.${name}`;\n const entry = record(raw, path);\n return { name, value: entry.value, step: str(entry.step, `${path}.step`) };\n });\n}\n\nfunction readEvent(value: unknown, index: number): WatcherEvent {\n const path = `detail.events[${index}]`;\n const e = record(value, path);\n return {\n type: oneOf(e.type, WATCHER_EVENT_TYPES, `${path}.type`),\n ...optional(e, \"text\", (v) => str(v, `${path}.text`)),\n ...optional(e, \"url\", (v) => str(v, `${path}.url`)),\n ...optional(e, \"status\", (v) => num(v, `${path}.status`)),\n ...optional(e, \"detail\", (v) => str(v, `${path}.detail`)),\n };\n}\n\nfunction readStep(detail: Rec): StepDetail {\n const ref = record(detail.step, \"detail.step\");\n const rest = Object.fromEntries(Object.entries(detail).filter(([key]) => !STEP_KEYS.has(key)));\n return {\n step: { id: str(ref.id, \"detail.step.id\"), kind: str(ref.kind, \"detail.step.kind\") },\n ...(detail.outputs === undefined ? {} : { outputs: detail.outputs }),\n ...optional(detail, \"view\", readView),\n ...optional(detail, \"form\", readForm),\n ...optional(detail, \"files\", readFiles),\n exports: detail.exports == null ? [] : readExports(detail.exports),\n ...optional(detail, \"wait\", readWait),\n attempts: readAttempts(detail.attempts ?? []),\n events: list(detail.events ?? [], \"detail.events\").map(readEvent),\n background: bool(detail.background ?? false, \"detail.background\"),\n rest,\n };\n}\n\n/**\n * Whether `node.detail` carries a typed step (`detail.step`), and if so its\n * parsed contents. A node without `detail.step` is \"none\" whatever else its\n * detail holds; a `step` whose fields violate the contract is \"invalid\" with\n * the offending path, so the view can say so rather than render a guess.\n */\nexport function readStepDetail(detail: unknown): StepDetailResult {\n if (!isRecord(detail) || detail.step === undefined) return { kind: \"none\" };\n try {\n return { kind: \"step\", step: readStep(detail) };\n } catch (error) {\n if (error instanceof StepDetailError) return { kind: \"invalid\", error: error.message };\n throw error;\n }\n}\n\nexport type ViolationDetail = Violation & { locations: ViolationLocation[] };\n\nexport type ViolationDetailResult =\n | { kind: \"none\" }\n | { kind: \"violation\"; violation: ViolationDetail }\n | { kind: \"invalid\"; error: string };\n\nconst SEVERITIES = [\"error\", \"warning\", \"info\"] as const satisfies readonly LintSeverity[];\n\nfunction readEntity(value: unknown, path: string): ViolationEntity {\n const entity = record(value, path);\n return {\n kind: str(entity.kind, `${path}.kind`),\n id: str(entity.id, `${path}.id`),\n ...optional(entity, \"name\", (v) => str(v, `${path}.name`)),\n };\n}\n\nconst URL_STRATEGIES = [\"css\", \"xpath\", \"testId\", \"role\", \"text\"] as const;\n\nfunction readUrlTarget(value: unknown, path: string): ViolationUrlTarget {\n const target = record(value, path);\n const read: ViolationUrlTarget = {\n url: str(target.url, `${path}.url`),\n ...Object.assign({}, ...[...URL_STRATEGIES, \"name\"].map((key) => optional(target, key, (v) => str(v, `${path}.${key}`)))),\n };\n const strategies = URL_STRATEGIES.filter((key) => read[key] !== undefined);\n if (strategies.length > 1) fail(path, `a target with at most one selector strategy (got ${strategies.join(\", \")})`);\n if (read.name !== undefined && read.role === undefined) fail(`${path}.name`, \"paired with a role\");\n return read;\n}\n\nfunction readImage(value: unknown, path: string): ViolationImageRegion {\n const image = record(value, path);\n return {\n src: str(image.src, `${path}.src`),\n x: num(image.x, `${path}.x`),\n y: num(image.y, `${path}.y`),\n width: num(image.width, `${path}.width`),\n height: num(image.height, `${path}.height`),\n };\n}\n\nfunction readLocation(value: unknown, index: number): ViolationLocation {\n const path = `detail.violation.locations[${index}]`;\n const l = record(value, path);\n const location: ViolationLocation = {\n ...optional(l, \"file\", (v) => str(v, `${path}.file`)),\n ...optional(l, \"line\", (v) => num(v, `${path}.line`)),\n ...optional(l, \"column\", (v) => num(v, `${path}.column`)),\n ...optional(l, \"end_line\", (v) => num(v, `${path}.end_line`)),\n ...optional(l, \"ref\", (v) => str(v, `${path}.ref`)),\n ...optional(l, \"entity\", (v) => readEntity(v, `${path}.entity`)),\n ...optional(l, \"url\", (v) => readUrlTarget(v, `${path}.url`)),\n ...optional(l, \"image\", (v) => readImage(v, `${path}.image`)),\n ...optional(l, \"message\", (v) => str(v, `${path}.message`)),\n };\n if (!(location.file || location.entity || location.url || location.image || location.message)) {\n fail(path, \"a location naming a file, entity, url, image or message\");\n }\n return location;\n}\n\nfunction readRule(value: unknown): NonNullable<Violation[\"rule\"]> {\n const path = \"detail.violation.rule\";\n const rule = record(value, path);\n return {\n ...optional(rule, \"method\", (v) => str(v, `${path}.method`)),\n ...optional(rule, \"description\", (v) => str(v, `${path}.description`)),\n ...optional(rule, \"pattern\", (v) => str(v, `${path}.pattern`)),\n ...optional(rule, \"package\", (v) => str(v, `${path}.package`)),\n };\n}\n\nfunction readViolationRecord(value: unknown): ViolationDetail {\n const path = \"detail.violation\";\n const v = record(value, path);\n return {\n ...optional(v, \"severity\", (s) => oneOf(s, SEVERITIES, `${path}.severity`)),\n ...optional(v, \"message\", (m) => str(m, `${path}.message`)),\n ...optional(v, \"rule\", readRule),\n ...optional(v, \"source\", (s) => str(s, `${path}.source`)),\n ...optional(v, \"file\", (f) => str(f, `${path}.file`)),\n ...optional(v, \"line\", (n) => num(n, `${path}.line`)),\n locations: list(v.locations ?? [], `${path}.locations`).map(readLocation),\n };\n}\n\n/**\n * The lint violation a finding node carries in `detail.violation` (gavel\n * models.Violation, published under fixtures.ViolationMetadataKey). Read apart\n * from the typed step: a finding has no `detail.step`. A violation whose fields\n * break the contract is \"invalid\" with the offending path.\n */\nexport function readViolation(detail: unknown): ViolationDetailResult {\n if (!isRecord(detail) || detail.violation === undefined) return { kind: \"none\" };\n try {\n return { kind: \"violation\", violation: readViolationRecord(detail.violation) };\n } catch (error) {\n if (error instanceof StepDetailError) return { kind: \"invalid\", error: error.message };\n throw error;\n }\n}\n\nfunction withoutKey(detail: unknown, key: string): unknown {\n if (!isRecord(detail) || !(key in detail)) return detail;\n const rest = Object.fromEntries(Object.entries(detail).filter(([k]) => k !== key));\n return Object.keys(rest).length > 0 ? rest : undefined;\n}\n\n/** `detail` without its `violation`, which the Locations section shows instead of the raw block. */\nexport function withoutViolation(detail: unknown): unknown {\n return withoutKey(detail, \"violation\");\n}\n\n/**\n * What a query step ran (gavel fixtures.QueryMetadataKey): the query as authored,\n * its `$(.params.x)` / `{{.params.x}}` references intact; the statement\n * commons-db issued with them bound to driver placeholders; the bound values in\n * placeholder order; the step's params by name; and the file the template came from.\n */\nexport type StepQuery = {\n template: string;\n sql?: string;\n arguments?: unknown[];\n params?: Record<string, unknown>;\n queryFile?: string;\n /** The connection the query runs on and where it points; never its secrets. */\n connection?: StepQueryConnection;\n /** The batches of a SQL program that have ended, with the rows each changed where the driver reports it. */\n batches?: StepQueryBatch[];\n /** The server session the query ran on (SPID, backend PID, connection id or ClickHouse query id). */\n session?: StepQuerySession;\n /** AutoDiagnose samples of that session while the statement ran, oldest first (gavel keeps the last 100). */\n diagnose?: StepQuerySample[];\n /** How many older samples gavel dropped beyond the ones in `diagnose`. */\n diagnoseDropped?: number;\n /** Why sampling stopped (a missing grant, a read error); the query itself is unaffected. */\n diagnoseError?: string;\n};\n\n/**\n * commons-db query.ServerSession. `engine` is postgres, sqlserver, mysql, clickhouse or\n * opensearch; `sessionId` is 0 or absent for the engines that identify the session by `queryId`\n * (clickhouse, opensearch, where `server` is the cluster and `database` the index).\n */\nexport type StepQuerySession = {\n engine: string;\n sessionId?: number;\n queryId?: string;\n server?: string;\n database?: string;\n user?: string;\n page?: number;\n};\n\n/**\n * commons-db sqlactivity.Sample or searchactivity.Sample as JSON. For SQL a zero\n * metric means the engine does not report it; `blockedBy` 0 means not blocked;\n * `transactionStartedAt` may be the zero time (\"0001-01-01T00:00:00Z\"). An\n * opensearch sample (`engine` \"opensearch\") has no `sessionId`; its task fields\n * (`taskId` to `memoryBytes`) are absent while the walk is between pages, and\n * `cpuMs` / `memoryBytes` only on OpenSearch 2.9 and later.\n */\nexport type StepQuerySample = {\n sampledAt: string;\n engine: string;\n sessionId?: number;\n database?: string;\n requestId?: number;\n blockedBy?: number;\n blocked?: boolean;\n user?: string;\n application?: string;\n clientHost?: string;\n state?: string;\n command?: string;\n waitType?: string;\n waitResource?: string;\n waitMs?: number;\n startedAt?: string;\n transactionStartedAt?: string;\n elapsedMs?: number;\n transactionMs?: number;\n cpuMs?: number;\n logicalReads?: number;\n reads?: number;\n writes?: number;\n memoryBytes?: number;\n openTransactions?: number;\n queryId?: string;\n sql?: string;\n /** SQL Server: percent_complete of long commands (backup, rebuild, ...); 0 for the rest. */\n percentComplete?: number;\n /** SQL Server: the server's estimate of the time left, in ms. */\n estimatedRemainingMs?: number;\n taskId?: string;\n node?: string;\n action?: string;\n description?: string;\n cancellable?: boolean;\n cancelled?: boolean;\n cluster?: string;\n /** Cluster health: \"green\", \"yellow\" or \"red\". */\n status?: string;\n activeShardsPercent?: number;\n unassignedShards?: number;\n relocatingShards?: number;\n pendingTasks?: number;\n /** Heap and CPU of the node running the task (else the worst data node). */\n heapPercent?: number;\n cpuPercent?: number;\n searchActive?: number;\n searchQueue?: number;\n searchRejected?: number;\n /** Walk progress: pages fetched, rows read, the total hit count and whether it is exact (\"eq\") or a lower bound (\"gte\"). */\n pages?: number;\n rowsRead?: number;\n totalHits?: number;\n totalRelation?: string;\n};\n\nexport type StepQueryConnection = {\n name: string;\n type: string;\n host?: string;\n port?: string;\n user?: string;\n database?: string;\n};\n\n/** `run` is the batch's repetition under `GO <count>`, 1 for a batch that runs once. */\nexport type StepQueryBatch = { batch: number; run: number; rowsAffected?: number };\n\nfunction readQueryConnection(value: unknown): StepQueryConnection {\n const path = \"detail.query.connection\";\n const c = record(value, path);\n return {\n name: str(c.name, `${path}.name`),\n type: str(c.type, `${path}.type`),\n ...optional(c, \"host\", (v) => str(v, `${path}.host`)),\n ...optional(c, \"port\", (v) => str(v, `${path}.port`)),\n ...optional(c, \"user\", (v) => str(v, `${path}.user`)),\n ...optional(c, \"database\", (v) => str(v, `${path}.database`)),\n };\n}\n\nfunction readQueryBatch(value: unknown, index: number): StepQueryBatch {\n const path = `detail.query.batches[${index}]`;\n const b = record(value, path);\n return {\n batch: num(b.batch, `${path}.batch`),\n run: num(b.run, `${path}.run`),\n ...optional(b, \"rowsAffected\", (v) => num(v, `${path}.rowsAffected`)),\n };\n}\n\nfunction readQuerySession(value: unknown): StepQuerySession {\n const path = \"detail.query.session\";\n const s = record(value, path);\n return {\n engine: str(s.engine, `${path}.engine`),\n ...optional(s, \"sessionId\", (v) => num(v, `${path}.sessionId`)),\n ...optional(s, \"queryId\", (v) => str(v, `${path}.queryId`)),\n ...optional(s, \"server\", (v) => str(v, `${path}.server`)),\n ...optional(s, \"database\", (v) => str(v, `${path}.database`)),\n ...optional(s, \"user\", (v) => str(v, `${path}.user`)),\n ...optional(s, \"page\", (v) => num(v, `${path}.page`)),\n };\n}\n\nconst SAMPLE_STRINGS = [\n \"database\", \"user\", \"application\", \"clientHost\", \"state\", \"command\", \"waitType\", \"waitResource\",\n \"startedAt\", \"transactionStartedAt\", \"queryId\", \"sql\",\n \"taskId\", \"node\", \"action\", \"description\", \"cluster\", \"status\", \"totalRelation\",\n] as const;\nconst SAMPLE_NUMBERS = [\n \"sessionId\", \"requestId\", \"blockedBy\", \"waitMs\", \"elapsedMs\", \"transactionMs\", \"cpuMs\", \"logicalReads\", \"reads\", \"writes\",\n \"memoryBytes\", \"openTransactions\", \"percentComplete\", \"estimatedRemainingMs\",\n \"activeShardsPercent\", \"unassignedShards\", \"relocatingShards\", \"pendingTasks\",\n \"heapPercent\", \"cpuPercent\", \"searchActive\", \"searchQueue\", \"searchRejected\",\n \"pages\", \"rowsRead\", \"totalHits\",\n] as const;\nconst SAMPLE_BOOLEANS = [\"blocked\", \"cancellable\", \"cancelled\"] as const;\n\nfunction readQuerySample(value: unknown, index: number): StepQuerySample {\n const path = `detail.query.diagnose[${index}]`;\n const s = record(value, path);\n const sample: StepQuerySample = {\n sampledAt: str(s.sampledAt, `${path}.sampledAt`),\n engine: str(s.engine, `${path}.engine`),\n };\n for (const key of SAMPLE_STRINGS) Object.assign(sample, optional(s, key, (v) => str(v, `${path}.${key}`)));\n for (const key of SAMPLE_NUMBERS) Object.assign(sample, optional(s, key, (v) => num(v, `${path}.${key}`)));\n for (const key of SAMPLE_BOOLEANS) Object.assign(sample, optional(s, key, (v) => bool(v, `${path}.${key}`)));\n return sample;\n}\n\nexport type StepQueryResult =\n | { kind: \"none\" }\n | { kind: \"query\"; query: StepQuery }\n | { kind: \"invalid\"; error: string };\n\nfunction readQueryRecord(value: unknown): StepQuery {\n const path = \"detail.query\";\n const q = record(value, path);\n return {\n template: str(q.template, `${path}.template`),\n ...optional(q, \"sql\", (v) => str(v, `${path}.sql`)),\n ...optional(q, \"arguments\", (v) => list(v, `${path}.arguments`)),\n ...optional(q, \"params\", (v) => record(v, `${path}.params`)),\n ...optional(q, \"queryFile\", (v) => str(v, `${path}.queryFile`)),\n ...optional(q, \"connection\", readQueryConnection),\n ...optional(q, \"batches\", (v) => list(v, `${path}.batches`).map(readQueryBatch)),\n ...optional(q, \"session\", readQuerySession),\n ...optional(q, \"diagnose\", (v) => list(v, `${path}.diagnose`).map(readQuerySample)),\n ...optional(q, \"diagnoseDropped\", (v) => num(v, `${path}.diagnoseDropped`)),\n ...optional(q, \"diagnoseError\", (v) => str(v, `${path}.diagnoseError`)),\n };\n}\n\n/**\n * The query a query step carries in `detail.query`, read apart from the typed\n * step like the violation (a markdown query row has no `detail.step`). A record\n * whose fields break the contract is \"invalid\" with the offending path.\n */\nexport function readQuery(detail: unknown): StepQueryResult {\n if (!isRecord(detail) || detail.query === undefined) return { kind: \"none\" };\n try {\n return { kind: \"query\", query: readQueryRecord(detail.query) };\n } catch (error) {\n if (error instanceof StepDetailError) return { kind: \"invalid\", error: error.message };\n throw error;\n }\n}\n\n/** `detail` without its `query`, which the Query section shows instead of the raw block. */\nexport function withoutQuery(detail: unknown): unknown {\n return withoutKey(detail, \"query\");\n}\n\n/** Brief sections for the \"Copy details\" button: the template, the issued SQL and the params it bound. */\nexport function stepQueryCopy(query: StepQuery): BriefSection[] {\n const params = Object.entries(query.params ?? {});\n const connection = query.connection;\n return [\n ...(connection ? [{ title: \"Connection\", body: connectionCopy(connection) }] : []),\n { title: query.queryFile ? `Template (${query.queryFile})` : \"Template\", lang: \"sql\", body: query.template, ...(query.queryFile ? { source: query.queryFile } : {}) },\n ...(query.sql ? [{ title: \"SQL\", lang: \"sql\", body: query.sql }] : []),\n ...(params.length > 0 ? [{ title: \"Params\", body: params.map(([name, value]) => `${name}=${formatExportValue(value)}`).join(\"\\n\") }] : []),\n ...(query.arguments && query.arguments.length > 0\n ? [{ title: \"Arguments\", body: query.arguments.map((value, i) => `${i + 1}: ${formatExportValue(value)}`).join(\"\\n\") }]\n : []),\n ];\n}\n\n/** The connection as the badges show it: `name (type)`, then host:port, user and db where known. */\nfunction connectionCopy(connection: StepQueryConnection): string {\n const host = connection.host && (connection.port ? `${connection.host}:${connection.port}` : connection.host);\n return [\n `${connection.name} (${connection.type})`,\n host && `host: ${host}`,\n connection.user && `user: ${connection.user}`,\n connection.database && `db: ${connection.database}`,\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\n/** How a `form` step's form was answered, or undefined for a node that is no (valid) form step. */\nexport function stepFormState(node: Pick<Test, \"detail\">): StepFormState | undefined {\n const parsed = readStepDetail(node.detail);\n return parsed.kind === \"step\" ? parsed.step.form?.state : undefined;\n}\n\n/** The step detail when there is one, for matchers that only need to know. */\nexport function hasStepDetail(detail: unknown): boolean {\n return readStepDetail(detail).kind !== \"none\";\n}\n\n/** The fixtures.ExecutionNode fields gavel puts at the top of `node.detail`, shown as a header instead of raw JSON. */\nexport type ExecutionHeader = {\n kind?: string;\n state?: string;\n file?: string;\n sectionPath?: string;\n /** Zero-based row of the step within its section. */\n rowIndex?: number;\n line?: number;\n startedAt?: string;\n finishedAt?: string;\n /** Nanoseconds. */\n durationNs?: number;\n error?: string;\n};\n\nconst isString = (value: unknown): value is string => typeof value === \"string\";\nconst isNumber = (value: unknown): value is number => typeof value === \"number\" && Number.isFinite(value);\n\n/**\n * Splits the ExecutionNode fields (name, kind, state, origin, started_at,\n * finished_at, duration, error) off `detail` into a header, dropping the\n * internal `key`. A field of an unexpected type is not consumed — it stays in\n * `rest`, so it is visible in the raw block rather than silently hidden.\n */\nexport function splitExecutionDetail(detail: unknown): { header: ExecutionHeader; rest: unknown } {\n if (!isRecord(detail)) return { header: {}, rest: detail };\n const rest: Rec = { ...detail };\n delete rest.key;\n const take = <T>(key: string, guard: (value: unknown) => value is T): T | undefined => {\n const value = rest[key];\n if (!guard(value)) return undefined;\n delete rest[key];\n return value;\n };\n const header: ExecutionHeader = {};\n const assign = <K extends keyof ExecutionHeader>(field: K, value: ExecutionHeader[K] | undefined) => {\n if (value !== undefined) header[field] = value;\n };\n take(\"name\", isString);\n assign(\"kind\", take(\"kind\", isString));\n assign(\"state\", take(\"state\", isString));\n assign(\"startedAt\", take(\"started_at\", isString));\n assign(\"finishedAt\", take(\"finished_at\", isString));\n assign(\"durationNs\", take(\"duration\", isNumber));\n assign(\"error\", take(\"error\", isString));\n const origin = take(\"origin\", isRecord);\n if (origin) {\n assign(\"file\", isString(origin.file) ? origin.file : undefined);\n assign(\"sectionPath\", isString(origin.section_path) ? origin.section_path : undefined);\n assign(\"rowIndex\", isNumber(origin.row_index) ? origin.row_index : undefined);\n assign(\"line\", isNumber(origin.line) ? origin.line : undefined);\n }\n return { header, rest: Object.keys(rest).length > 0 ? rest : undefined };\n}\n\nexport type WaitCondition = \"until\" | \"failWhen\";\n\n/** Which of the wait's two conditions decided its outcome. `expression` is authoritative; older payloads without it are inferred from the outcome. */\nexport function waitDecidedBy(wait: WaitDetail): WaitCondition {\n if (wait.expression !== undefined) return wait.expression === wait.policy.failWhen ? \"failWhen\" : \"until\";\n return wait.outcome === \"failed\" && wait.policy.failWhen ? \"failWhen\" : \"until\";\n}\n\n/** `09:00:04` from an RFC 3339 timestamp, as written (no timezone conversion); anything else verbatim. */\nexport function clockTime(at: string): string {\n return /T(\\d{2}:\\d{2}:\\d{2})/.exec(at)?.[1] ?? at;\n}\n\nexport function formatDelay(ms: number): string {\n return ms <= 0 ? \"0ms\" : formatTestDuration(ms * 1e6);\n}\n\n/** `every 1s · backoff ×1.5 up to 10s · jitter ±20% · timeout 3m`, skipping what the policy leaves unset. */\nexport function policySummary(policy: WaitPolicy): string {\n const backoff = [\n policy.backoff?.factor !== undefined && `×${policy.backoff.factor}`,\n policy.backoff?.max && `up to ${policy.backoff.max}`,\n ].filter(Boolean);\n return [\n policy.interval && `every ${policy.interval}`,\n backoff.length > 0 && `backoff ${backoff.join(\" \")}`,\n policy.jitter && `jitter ±${policy.jitter}`,\n policy.timeout && `timeout ${policy.timeout}`,\n ]\n .filter(Boolean)\n .join(\" · \");\n}\n\nexport function formatExportValue(value: unknown): string {\n if (value === undefined) return \"\";\n return typeof value === \"string\" ? value : JSON.stringify(value);\n}\n\nfunction waitCopy(wait: WaitDetail): BriefSection {\n const { policy } = wait;\n const lines = [\n `outcome: ${wait.outcome}`,\n `elapsed: ${formatDelay(wait.durationMs)}`,\n `policy: ${policySummary(policy)}`,\n policy.until && `until: ${policy.until}`,\n policy.failWhen && `failWhen: ${policy.failWhen}`,\n wait.expression && `decided by: ${wait.expression}`,\n wait.cause && `cause: ${wait.cause}`,\n wait.error && `error: ${wait.error}`,\n wait.trace && `trace: ${wait.trace}`,\n wait.outputs !== undefined && `outputs: ${JSON.stringify(wait.outputs)}`,\n ];\n return { title: \"Wait\", body: lines.filter(Boolean).join(\"\\n\") };\n}\n\nfunction attemptLine(a: StepAttempt): string {\n const head = [`#${a.attempt}`, a.status, a.durationMs !== undefined && formatDelay(a.durationMs)];\n return `${head.filter(Boolean).join(\" \")}${a.error ? ` — ${a.error}` : \"\"}`;\n}\n\nfunction eventLine(e: WatcherEvent): string {\n const body = [e.status, e.text, e.url].filter((part) => part !== undefined).join(\" \");\n return `[${e.type}]${body ? ` ${body}` : \"\"}${e.detail ? ` — ${e.detail}` : \"\"}`;\n}\n\n/** Brief sections for the \"Copy details\" button: wait trace, retry attempts, exports and watcher events. */\nexport function stepKindCopy(step: StepDetail): BriefSection[] {\n return [\n ...(step.outputs !== undefined ? [{ title: \"Outputs\", body: JSON.stringify(step.outputs, null, 2), lang: \"json\" }] : []),\n ...(step.wait ? [waitCopy(step.wait)] : []),\n ...(step.attempts.length > 0 ? [{ title: \"Attempts\", body: step.attempts.map(attemptLine).join(\"\\n\") }] : []),\n ...(step.exports.length > 0\n ? [{ title: \"Exports\", body: step.exports.map((e) => `${e.name}=${formatExportValue(e.value)} (from ${e.step})`).join(\"\\n\") }]\n : []),\n ...(step.events.length > 0 ? [{ title: \"Events\", body: step.events.map(eventLine).join(\"\\n\") }] : []),\n ];\n}\n"],"mappings":";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,IAAI,CAAC;EACzC,GAAI,KAAK,SAAS,SAAS,IAAI,CAAC;GAAE,OAAO;GAAY,MAAM,KAAK,SAAS,IAAI,WAAW,CAAC,CAAC,KAAK,IAAI;EAAE,CAAC,IAAI,CAAC;EAC3G,GAAI,KAAK,QAAQ,SAAS,IACtB,CAAC;GAAE,OAAO;GAAW,MAAM,KAAK,QAAQ,KAAK,MAAM,GAAG,EAAE,KAAK,GAAG,kBAAkB,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI;EAAE,CAAC,IAC3H,CAAC;EACL,GAAI,KAAK,OAAO,SAAS,IAAI,CAAC;GAAE,OAAO;GAAU,MAAM,KAAK,OAAO,IAAI,SAAS,CAAC,CAAC,KAAK,IAAI;EAAE,CAAC,IAAI,CAAC;CACrG;AACF"}
|
|
@@ -64,6 +64,18 @@ export type StepForm = {
|
|
|
64
64
|
answeredBy?: string;
|
|
65
65
|
answeredAt?: string;
|
|
66
66
|
};
|
|
67
|
+
/** A file a step attached (gavel fixtures.StepFile): an absolute `path` the host serves, with its mime type. */
|
|
68
|
+
export type StepFile = {
|
|
69
|
+
path: string;
|
|
70
|
+
name: string;
|
|
71
|
+
mime: string;
|
|
72
|
+
title?: string;
|
|
73
|
+
};
|
|
74
|
+
export type FilePreview = "html" | "pdf" | "image" | "none";
|
|
75
|
+
/** How a step file is previewed, decided by its mime type. */
|
|
76
|
+
export declare function previewKind(mime: string): FilePreview;
|
|
77
|
+
/** PDFs get their own detail tab; every other attached file previews in the step's detail. */
|
|
78
|
+
export declare function isPdfFile(file: StepFile): boolean;
|
|
67
79
|
export type StepDetail = {
|
|
68
80
|
step: StepRef;
|
|
69
81
|
outputs?: unknown;
|
|
@@ -71,6 +83,8 @@ export type StepDetail = {
|
|
|
71
83
|
view?: ClickyDocument;
|
|
72
84
|
/** The form a `form` step (or a fixture's `params:`) showed, and how it was answered. */
|
|
73
85
|
form?: StepForm;
|
|
86
|
+
/** Files the step attached (a facet report's html/pdf/png), previewed through the host's `fileUrl`. */
|
|
87
|
+
files?: StepFile[];
|
|
74
88
|
exports: StepExport[];
|
|
75
89
|
wait?: WaitDetail;
|
|
76
90
|
attempts: StepAttempt[];
|
|
@@ -142,10 +156,14 @@ export type StepQuery = {
|
|
|
142
156
|
/** Why sampling stopped (a missing grant, a read error); the query itself is unaffected. */
|
|
143
157
|
diagnoseError?: string;
|
|
144
158
|
};
|
|
145
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* commons-db query.ServerSession. `engine` is postgres, sqlserver, mysql, clickhouse or
|
|
161
|
+
* opensearch; `sessionId` is 0 or absent for the engines that identify the session by `queryId`
|
|
162
|
+
* (clickhouse, opensearch, where `server` is the cluster and `database` the index).
|
|
163
|
+
*/
|
|
146
164
|
export type StepQuerySession = {
|
|
147
165
|
engine: string;
|
|
148
|
-
sessionId
|
|
166
|
+
sessionId?: number;
|
|
149
167
|
queryId?: string;
|
|
150
168
|
server?: string;
|
|
151
169
|
database?: string;
|
|
@@ -153,14 +171,17 @@ export type StepQuerySession = {
|
|
|
153
171
|
page?: number;
|
|
154
172
|
};
|
|
155
173
|
/**
|
|
156
|
-
* commons-db sqlactivity.Sample as JSON.
|
|
157
|
-
* report it; `blockedBy` 0 means not blocked;
|
|
158
|
-
* zero time ("0001-01-01T00:00:00Z").
|
|
174
|
+
* commons-db sqlactivity.Sample or searchactivity.Sample as JSON. For SQL a zero
|
|
175
|
+
* metric means the engine does not report it; `blockedBy` 0 means not blocked;
|
|
176
|
+
* `transactionStartedAt` may be the zero time ("0001-01-01T00:00:00Z"). An
|
|
177
|
+
* opensearch sample (`engine` "opensearch") has no `sessionId`; its task fields
|
|
178
|
+
* (`taskId` to `memoryBytes`) are absent while the walk is between pages, and
|
|
179
|
+
* `cpuMs` / `memoryBytes` only on OpenSearch 2.9 and later.
|
|
159
180
|
*/
|
|
160
181
|
export type StepQuerySample = {
|
|
161
182
|
sampledAt: string;
|
|
162
183
|
engine: string;
|
|
163
|
-
sessionId
|
|
184
|
+
sessionId?: number;
|
|
164
185
|
database?: string;
|
|
165
186
|
requestId?: number;
|
|
166
187
|
blockedBy?: number;
|
|
@@ -185,6 +206,34 @@ export type StepQuerySample = {
|
|
|
185
206
|
openTransactions?: number;
|
|
186
207
|
queryId?: string;
|
|
187
208
|
sql?: string;
|
|
209
|
+
/** SQL Server: percent_complete of long commands (backup, rebuild, ...); 0 for the rest. */
|
|
210
|
+
percentComplete?: number;
|
|
211
|
+
/** SQL Server: the server's estimate of the time left, in ms. */
|
|
212
|
+
estimatedRemainingMs?: number;
|
|
213
|
+
taskId?: string;
|
|
214
|
+
node?: string;
|
|
215
|
+
action?: string;
|
|
216
|
+
description?: string;
|
|
217
|
+
cancellable?: boolean;
|
|
218
|
+
cancelled?: boolean;
|
|
219
|
+
cluster?: string;
|
|
220
|
+
/** Cluster health: "green", "yellow" or "red". */
|
|
221
|
+
status?: string;
|
|
222
|
+
activeShardsPercent?: number;
|
|
223
|
+
unassignedShards?: number;
|
|
224
|
+
relocatingShards?: number;
|
|
225
|
+
pendingTasks?: number;
|
|
226
|
+
/** Heap and CPU of the node running the task (else the worst data node). */
|
|
227
|
+
heapPercent?: number;
|
|
228
|
+
cpuPercent?: number;
|
|
229
|
+
searchActive?: number;
|
|
230
|
+
searchQueue?: number;
|
|
231
|
+
searchRejected?: number;
|
|
232
|
+
/** Walk progress: pages fetched, rows read, the total hit count and whether it is exact ("eq") or a lower bound ("gte"). */
|
|
233
|
+
pages?: number;
|
|
234
|
+
rowsRead?: number;
|
|
235
|
+
totalHits?: number;
|
|
236
|
+
totalRelation?: string;
|
|
188
237
|
};
|
|
189
238
|
export type StepQueryConnection = {
|
|
190
239
|
name: string;
|