@flanksource/clicky-ui 0.3.72 → 0.3.74
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/ai.cjs +5 -0
- package/dist/ai.js +3 -1
- package/dist/comment-anchoring.cjs +3 -0
- package/dist/comment-anchoring.js +2 -1
- package/dist/comments/CommentCapture.cjs +6 -8
- package/dist/comments/CommentCapture.cjs.map +1 -1
- package/dist/comments/CommentCapture.d.ts.map +1 -1
- package/dist/comments/CommentCapture.js +6 -8
- package/dist/comments/CommentCapture.js.map +1 -1
- package/dist/comments/CommentComposer.cjs +12 -8
- package/dist/comments/CommentComposer.cjs.map +1 -1
- package/dist/comments/CommentComposer.d.ts.map +1 -1
- package/dist/comments/CommentComposer.js +12 -8
- package/dist/comments/CommentComposer.js.map +1 -1
- package/dist/comments/CommentThread.cjs +2 -1
- package/dist/comments/CommentThread.cjs.map +1 -1
- package/dist/comments/CommentThread.d.ts +1 -1
- package/dist/comments/CommentThread.d.ts.map +1 -1
- package/dist/comments/CommentThread.js +2 -1
- package/dist/comments/CommentThread.js.map +1 -1
- package/dist/comments/CommentThreadList.cjs +5 -3
- package/dist/comments/CommentThreadList.cjs.map +1 -1
- package/dist/comments/CommentThreadList.d.ts +1 -1
- package/dist/comments/CommentThreadList.d.ts.map +1 -1
- package/dist/comments/CommentThreadList.js +5 -3
- package/dist/comments/CommentThreadList.js.map +1 -1
- package/dist/comments/anchoring/dom-anchor.cjs +32 -4
- package/dist/comments/anchoring/dom-anchor.cjs.map +1 -1
- package/dist/comments/anchoring/dom-anchor.d.ts +8 -4
- package/dist/comments/anchoring/dom-anchor.d.ts.map +1 -1
- package/dist/comments/anchoring/dom-anchor.js +31 -5
- package/dist/comments/anchoring/dom-anchor.js.map +1 -1
- package/dist/comments/anchoring/frame-anchor.cjs +74 -0
- package/dist/comments/anchoring/frame-anchor.cjs.map +1 -0
- package/dist/comments/anchoring/frame-anchor.d.ts +21 -0
- package/dist/comments/anchoring/frame-anchor.d.ts.map +1 -0
- package/dist/comments/anchoring/frame-anchor.js +70 -0
- package/dist/comments/anchoring/frame-anchor.js.map +1 -0
- package/dist/comments/comment-detail.d.ts +1 -0
- package/dist/comments/comment-detail.d.ts.map +1 -1
- package/dist/comments/comment-types.cjs.map +1 -1
- package/dist/comments/comment-types.d.ts +2 -0
- package/dist/comments/comment-types.d.ts.map +1 -1
- package/dist/comments/comment-types.js.map +1 -1
- package/dist/comments/gavel/CommentInbox.cjs +49 -59
- package/dist/comments/gavel/CommentInbox.cjs.map +1 -1
- package/dist/comments/gavel/CommentInbox.d.ts +12 -8
- package/dist/comments/gavel/CommentInbox.d.ts.map +1 -1
- package/dist/comments/gavel/CommentInbox.js +51 -61
- package/dist/comments/gavel/CommentInbox.js.map +1 -1
- package/dist/comments/gavel/CommentInboxThread.cjs.map +1 -1
- package/dist/comments/gavel/CommentInboxThread.d.ts +1 -3
- package/dist/comments/gavel/CommentInboxThread.d.ts.map +1 -1
- package/dist/comments/gavel/CommentInboxThread.js.map +1 -1
- package/dist/comments/gavel/comment-agent-assignment.cjs +41 -0
- package/dist/comments/gavel/comment-agent-assignment.cjs.map +1 -0
- package/dist/comments/gavel/comment-agent-assignment.d.ts +15 -0
- package/dist/comments/gavel/comment-agent-assignment.d.ts.map +1 -0
- package/dist/comments/gavel/comment-agent-assignment.js +39 -0
- package/dist/comments/gavel/comment-agent-assignment.js.map +1 -0
- package/dist/comments/gavel/gavel-projection.cjs +43 -13
- package/dist/comments/gavel/gavel-projection.cjs.map +1 -1
- package/dist/comments/gavel/gavel-projection.d.ts +3 -0
- package/dist/comments/gavel/gavel-projection.d.ts.map +1 -1
- package/dist/comments/gavel/gavel-projection.js +43 -14
- package/dist/comments/gavel/gavel-projection.js.map +1 -1
- package/dist/comments/gavel/inbox-model.cjs +3 -12
- package/dist/comments/gavel/inbox-model.cjs.map +1 -1
- package/dist/comments/gavel/inbox-model.d.ts +2 -2
- package/dist/comments/gavel/inbox-model.d.ts.map +1 -1
- package/dist/comments/gavel/inbox-model.js +4 -12
- package/dist/comments/gavel/inbox-model.js.map +1 -1
- package/dist/comments/gavel/inbox-prompt.cjs +1 -0
- package/dist/comments/gavel/inbox-prompt.cjs.map +1 -1
- package/dist/comments/gavel/inbox-prompt.d.ts.map +1 -1
- package/dist/comments/gavel/inbox-prompt.js +1 -0
- package/dist/comments/gavel/inbox-prompt.js.map +1 -1
- package/dist/comments/gavel/index.d.ts +1 -0
- package/dist/comments/gavel/index.d.ts.map +1 -1
- package/dist/comments-gavel.cjs +5 -1
- package/dist/comments-gavel.js +4 -3
- package/dist/comments.cjs +5 -0
- package/dist/comments.d.ts +1 -0
- package/dist/comments.d.ts.map +1 -1
- package/dist/comments.js +3 -1
- package/dist/components/AccordionList.cjs +2 -2
- package/dist/components/AccordionList.cjs.map +1 -1
- package/dist/components/AccordionList.js +2 -2
- package/dist/components/AccordionList.js.map +1 -1
- package/dist/components/examples/form-extensions/extension.d.ts +1 -1
- package/dist/components/examples/form-extensions/extension.d.ts.map +1 -1
- package/dist/components/json-schema-form-array-add-menu.cjs +44 -0
- package/dist/components/json-schema-form-array-add-menu.cjs.map +1 -0
- package/dist/components/json-schema-form-array-add-menu.d.ts +10 -0
- package/dist/components/json-schema-form-array-add-menu.d.ts.map +1 -0
- package/dist/components/json-schema-form-array-add-menu.js +44 -0
- package/dist/components/json-schema-form-array-add-menu.js.map +1 -0
- package/dist/components/json-schema-form-exclusive-key-select.cjs +28 -0
- package/dist/components/json-schema-form-exclusive-key-select.cjs.map +1 -0
- package/dist/components/json-schema-form-exclusive-key-select.d.ts +12 -0
- package/dist/components/json-schema-form-exclusive-key-select.d.ts.map +1 -0
- package/dist/components/json-schema-form-exclusive-key-select.js +28 -0
- package/dist/components/json-schema-form-exclusive-key-select.js.map +1 -0
- package/dist/components/json-schema-form-exclusive-keys.cjs +23 -0
- package/dist/components/json-schema-form-exclusive-keys.cjs.map +1 -0
- package/dist/components/json-schema-form-exclusive-keys.d.ts +8 -0
- package/dist/components/json-schema-form-exclusive-keys.d.ts.map +1 -0
- package/dist/components/json-schema-form-exclusive-keys.js +22 -0
- package/dist/components/json-schema-form-exclusive-keys.js.map +1 -0
- package/dist/components/json-schema-form-layout.cjs +18 -5
- package/dist/components/json-schema-form-layout.cjs.map +1 -1
- package/dist/components/json-schema-form-layout.d.ts +3 -1
- package/dist/components/json-schema-form-layout.d.ts.map +1 -1
- package/dist/components/json-schema-form-layout.js +19 -6
- package/dist/components/json-schema-form-layout.js.map +1 -1
- package/dist/components/json-schema-form-object-array-view.cjs +13 -7
- package/dist/components/json-schema-form-object-array-view.cjs.map +1 -1
- package/dist/components/json-schema-form-object-array-view.d.ts.map +1 -1
- package/dist/components/json-schema-form-object-array-view.js +13 -7
- package/dist/components/json-schema-form-object-array-view.js.map +1 -1
- package/dist/components/json-schema-form-object.cjs +6 -0
- package/dist/components/json-schema-form-object.cjs.map +1 -1
- package/dist/components/json-schema-form-object.d.ts.map +1 -1
- package/dist/components/json-schema-form-object.js +6 -0
- package/dist/components/json-schema-form-object.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +56 -35
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts +1 -0
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +56 -35
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +1 -0
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts +2 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +1 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +8 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-section-actions.cjs +12 -0
- package/dist/components/json-schema-form-section-actions.cjs.map +1 -0
- package/dist/components/json-schema-form-section-actions.d.ts +8 -0
- package/dist/components/json-schema-form-section-actions.d.ts.map +1 -0
- package/dist/components/json-schema-form-section-actions.js +11 -0
- package/dist/components/json-schema-form-section-actions.js.map +1 -0
- package/dist/components/json-schema-form-sibling-prefix.cjs +23 -0
- package/dist/components/json-schema-form-sibling-prefix.cjs.map +1 -0
- package/dist/components/json-schema-form-sibling-prefix.d.ts +9 -0
- package/dist/components/json-schema-form-sibling-prefix.d.ts.map +1 -0
- package/dist/components/json-schema-form-sibling-prefix.js +23 -0
- package/dist/components/json-schema-form-sibling-prefix.js.map +1 -0
- package/dist/components/json-schema-form-sibling-select.cjs +25 -0
- package/dist/components/json-schema-form-sibling-select.cjs.map +1 -0
- package/dist/components/json-schema-form-sibling-select.d.ts +9 -0
- package/dist/components/json-schema-form-sibling-select.d.ts.map +1 -0
- package/dist/components/json-schema-form-sibling-select.js +25 -0
- package/dist/components/json-schema-form-sibling-select.js.map +1 -0
- package/dist/components/json-schema-form-table-array.cjs +4 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.js +4 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.cjs +54 -24
- package/dist/components/json-schema-form-tags-combobox.cjs.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.d.ts.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.js +55 -25
- package/dist/components/json-schema-form-tags-combobox.js.map +1 -1
- package/dist/components.cjs +2 -0
- package/dist/components.d.ts +2 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +2 -1
- package/dist/data/LogViewer.cjs +90 -19
- package/dist/data/LogViewer.cjs.map +1 -1
- package/dist/data/LogViewer.d.ts +9 -5
- package/dist/data/LogViewer.d.ts.map +1 -1
- package/dist/data/LogViewer.js +91 -20
- package/dist/data/LogViewer.js.map +1 -1
- package/dist/data/TaskProgress.cjs +5 -5
- package/dist/data/TaskProgress.cjs.map +1 -1
- package/dist/data/TaskProgress.js +5 -5
- package/dist/data/TaskProgress.js.map +1 -1
- package/dist/data/ai/SessionChatComposer.cjs +44 -22
- package/dist/data/ai/SessionChatComposer.cjs.map +1 -1
- package/dist/data/ai/SessionChatComposer.d.ts.map +1 -1
- package/dist/data/ai/SessionChatComposer.js +44 -22
- package/dist/data/ai/SessionChatComposer.js.map +1 -1
- package/dist/data/ai/SessionInspector.cjs +1 -1
- package/dist/data/ai/SessionInspector.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.cjs +12 -0
- package/dist/data/ai/SessionInspector.host-tabs.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.d.ts +4 -1
- package/dist/data/ai/SessionInspector.host-tabs.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.js +12 -1
- package/dist/data/ai/SessionInspector.host-tabs.js.map +1 -1
- package/dist/data/ai/SessionInspector.js +2 -2
- package/dist/data/ai/SessionInspector.js.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.cjs +1 -1
- package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.js +2 -2
- package/dist/data/ai/SessionInspector.legacy.js.map +1 -1
- package/dist/data/ai/SessionInspector.transcript.cjs +5 -19
- package/dist/data/ai/SessionInspector.transcript.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.transcript.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.transcript.js +6 -20
- package/dist/data/ai/SessionInspector.transcript.js.map +1 -1
- package/dist/data/ai/SessionPicker.cjs +159 -0
- package/dist/data/ai/SessionPicker.cjs.map +1 -0
- package/dist/data/ai/SessionPicker.d.ts +39 -0
- package/dist/data/ai/SessionPicker.d.ts.map +1 -0
- package/dist/data/ai/SessionPicker.js +159 -0
- package/dist/data/ai/SessionPicker.js.map +1 -0
- package/dist/data/ai/SessionPicker.model.cjs +21 -0
- package/dist/data/ai/SessionPicker.model.cjs.map +1 -0
- package/dist/data/ai/SessionPicker.model.d.ts +26 -0
- package/dist/data/ai/SessionPicker.model.d.ts.map +1 -0
- package/dist/data/ai/SessionPicker.model.js +20 -0
- package/dist/data/ai/SessionPicker.model.js.map +1 -0
- package/dist/data/ai/SessionTail.cjs +25 -15
- package/dist/data/ai/SessionTail.cjs.map +1 -1
- package/dist/data/ai/SessionTail.d.ts.map +1 -1
- package/dist/data/ai/SessionTail.js +25 -15
- package/dist/data/ai/SessionTail.js.map +1 -1
- package/dist/data/ai/SessionViewer.input.cjs +59 -1
- package/dist/data/ai/SessionViewer.input.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.input.d.ts +22 -0
- package/dist/data/ai/SessionViewer.input.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.input.js +58 -2
- package/dist/data/ai/SessionViewer.input.js.map +1 -1
- package/dist/data/ai/SessionViewer.rows.cjs +10 -3
- package/dist/data/ai/SessionViewer.rows.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.rows.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.rows.js +11 -4
- package/dist/data/ai/SessionViewer.rows.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.cjs +35 -0
- package/dist/data/ai/SessionViewer.tool-details.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts +10 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.js +35 -1
- package/dist/data/ai/SessionViewer.tool-details.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.cjs +5 -1
- package/dist/data/ai/SessionViewer.tool-row.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.js +7 -3
- package/dist/data/ai/SessionViewer.tool-row.js.map +1 -1
- package/dist/data/ai/index.d.ts +2 -0
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/code-diff.cjs +51 -45
- package/dist/data/code-diff.cjs.map +1 -1
- package/dist/data/code-diff.d.ts.map +1 -1
- package/dist/data/code-diff.js +51 -45
- package/dist/data/code-diff.js.map +1 -1
- package/dist/data/git/GitChangeList.cjs +40 -7
- package/dist/data/git/GitChangeList.cjs.map +1 -1
- package/dist/data/git/GitChangeList.d.ts +3 -0
- package/dist/data/git/GitChangeList.d.ts.map +1 -1
- package/dist/data/git/GitChangeList.js +40 -7
- package/dist/data/git/GitChangeList.js.map +1 -1
- package/dist/data/git/pickers/GitFilePicker.cjs +19 -7
- package/dist/data/git/pickers/GitFilePicker.cjs.map +1 -1
- package/dist/data/git/pickers/GitFilePicker.d.ts +4 -2
- package/dist/data/git/pickers/GitFilePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/GitFilePicker.js +19 -7
- package/dist/data/git/pickers/GitFilePicker.js.map +1 -1
- package/dist/data/git/pickers/GitPickers.cjs +3 -3
- package/dist/data/git/pickers/GitPickers.cjs.map +1 -1
- package/dist/data/git/pickers/GitPickers.js +3 -3
- package/dist/data/git/pickers/GitPickers.js.map +1 -1
- package/dist/data/git/pickers/GitPickersDemo.d.ts.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.cjs +11 -4
- package/dist/data/git/pickers/GitSourcePicker.cjs.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.d.ts +4 -2
- package/dist/data/git/pickers/GitSourcePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.js +11 -4
- package/dist/data/git/pickers/GitSourcePicker.js.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.cjs +27 -3
- package/dist/data/git/pickers/ReferencePicker.cjs.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.js +27 -3
- package/dist/data/git/pickers/ReferencePicker.js.map +1 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.cjs +2 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.cjs.map +1 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.d.ts +3 -2
- package/dist/data/git/pickers/RepositoryCatalogPicker.d.ts.map +1 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.js +2 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.js.map +1 -1
- package/dist/data/git/pickers/types.d.ts +7 -0
- package/dist/data/git/pickers/types.d.ts.map +1 -1
- package/dist/data/lint/LintList.cjs +89 -89
- package/dist/data/lint/LintList.cjs.map +1 -1
- package/dist/data/lint/LintList.d.ts +3 -2
- package/dist/data/lint/LintList.d.ts.map +1 -1
- package/dist/data/lint/LintList.js +90 -90
- package/dist/data/lint/LintList.js.map +1 -1
- package/dist/data/log-sections.cjs +152 -21
- package/dist/data/log-sections.cjs.map +1 -1
- package/dist/data/log-sections.d.ts +31 -6
- package/dist/data/log-sections.d.ts.map +1 -1
- package/dist/data/log-sections.js +151 -22
- package/dist/data/log-sections.js.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.cjs +1 -1
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +1 -1
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestFailureDetail.cjs +10 -8
- package/dist/data/test-runner/TestFailureDetail.cjs.map +1 -1
- package/dist/data/test-runner/TestFailureDetail.d.ts +3 -2
- package/dist/data/test-runner/TestFailureDetail.d.ts.map +1 -1
- package/dist/data/test-runner/TestFailureDetail.js +10 -8
- package/dist/data/test-runner/TestFailureDetail.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +9 -4
- 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 +9 -4
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/attempts.cjs +2 -1
- package/dist/data/test-runner/attempts.cjs.map +1 -1
- package/dist/data/test-runner/attempts.d.ts.map +1 -1
- package/dist/data/test-runner/attempts.js +2 -1
- package/dist/data/test-runner/attempts.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +1 -2
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +1 -2
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/types.d.ts +3 -0
- package/dist/data/test-runner/types.d.ts.map +1 -1
- package/dist/data/traces/GoProfileView.cjs +10 -7
- package/dist/data/traces/GoProfileView.cjs.map +1 -1
- package/dist/data/traces/GoProfileView.d.ts.map +1 -1
- package/dist/data/traces/GoProfileView.js +10 -7
- package/dist/data/traces/GoProfileView.js.map +1 -1
- package/dist/data/verification/adapters.cjs +1 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +1 -0
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +2 -2
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +2 -2
- package/dist/index.cjs +8 -1
- package/dist/index.js +5 -2
- package/dist/runtime/barrels.json +6604 -6582
- package/dist/runtime/importmap.json +2129 -2120
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/comments/gavel/CommentInboxReview.cjs +0 -169
- package/dist/comments/gavel/CommentInboxReview.cjs.map +0 -1
- package/dist/comments/gavel/CommentInboxReview.d.ts +0 -20
- package/dist/comments/gavel/CommentInboxReview.d.ts.map +0 -1
- package/dist/comments/gavel/CommentInboxReview.js +0 -169
- package/dist/comments/gavel/CommentInboxReview.js.map +0 -1
|
@@ -1,53 +1,184 @@
|
|
|
1
1
|
// src/data/log-sections.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var COMMANDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"group",
|
|
4
|
+
"endgroup",
|
|
5
|
+
"notice",
|
|
6
|
+
"warning",
|
|
7
|
+
"error",
|
|
8
|
+
"debug",
|
|
9
|
+
"progress",
|
|
10
|
+
"description",
|
|
11
|
+
"status",
|
|
12
|
+
"stop-commands"
|
|
13
|
+
]);
|
|
14
|
+
var ANNOTATIONS = {
|
|
15
|
+
error: "Error",
|
|
16
|
+
warning: "Warning",
|
|
17
|
+
notice: "Notice"
|
|
18
|
+
};
|
|
19
|
+
var ESCAPES = {
|
|
20
|
+
"%25": "%",
|
|
21
|
+
"%0D": "\r",
|
|
22
|
+
"%0A": "\n"
|
|
23
|
+
};
|
|
24
|
+
var DOWNLOADED_MARKER = /^##\[(group|endgroup)\](.*)$/;
|
|
25
|
+
var COUNT = /^\s*(\d+)\s*$/;
|
|
26
|
+
function readCommand(line) {
|
|
27
|
+
const marker = DOWNLOADED_MARKER.exec(line);
|
|
28
|
+
if (marker) return {
|
|
29
|
+
name: marker[1],
|
|
30
|
+
properties: {},
|
|
31
|
+
message: marker[2]
|
|
32
|
+
};
|
|
33
|
+
if (!line.startsWith("::")) return void 0;
|
|
34
|
+
const end = line.indexOf("::", 2);
|
|
35
|
+
if (end < 0) return void 0;
|
|
36
|
+
const head = line.slice(2, end);
|
|
37
|
+
const space = head.indexOf(" ");
|
|
38
|
+
const name = space < 0 ? head : head.slice(0, space);
|
|
39
|
+
if (!COMMANDS.has(name)) return void 0;
|
|
40
|
+
const properties = {};
|
|
41
|
+
const list = space < 0 ? "" : head.slice(space + 1).trim();
|
|
42
|
+
for (const property of list ? list.split(",") : []) {
|
|
43
|
+
const [key, ...value] = property.split("=");
|
|
44
|
+
if (!key?.trim() || value.length === 0) return void 0;
|
|
45
|
+
properties[key.trim()] = value.join("=");
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
name,
|
|
49
|
+
properties,
|
|
50
|
+
message: line.slice(end + 2).replace(/%25|%0D|%0A/g, (escape) => ESCAPES[escape])
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** `::progress::3/10` or `::progress done=3,total=10::`; undefined when it is neither. */
|
|
54
|
+
function readProgress({ properties, message }) {
|
|
55
|
+
const slash = message.indexOf("/");
|
|
56
|
+
const named = "done" in properties || "total" in properties;
|
|
57
|
+
const done = COUNT.exec(named ? properties.done ?? "" : message.slice(0, Math.max(slash, 0)));
|
|
58
|
+
const total = COUNT.exec(named ? properties.total ?? "" : message.slice(slash + 1));
|
|
59
|
+
return done && total ? {
|
|
60
|
+
done: Number(done[1]),
|
|
61
|
+
total: Number(total[1])
|
|
62
|
+
} : void 0;
|
|
63
|
+
}
|
|
4
64
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `endgroup` with no open group is dropped (a
|
|
9
|
-
* still open at the end is returned
|
|
65
|
+
* Reads a log's workflow commands, as a step prints them (`::group::name`) or
|
|
66
|
+
* as GitHub's downloaded logs carry group markers (`##[group]name`).
|
|
67
|
+
*
|
|
68
|
+
* Groups become nested sections: an `endgroup` with no open group is dropped (a
|
|
69
|
+
* tail cut its start off) and a group still open at the end is returned
|
|
70
|
+
* unclosed (its output is still arriving). A status is a line of the log unless
|
|
71
|
+
* it repeats the one before it, annotations are lines, and the latest
|
|
72
|
+
* description, status and progress are returned beside the sections. A command
|
|
73
|
+
* that does not parse stays as it was printed.
|
|
10
74
|
*/
|
|
11
75
|
function parseLogSections(logs) {
|
|
12
76
|
const root = [];
|
|
77
|
+
const log = {
|
|
78
|
+
sections: root,
|
|
79
|
+
hasCommands: false
|
|
80
|
+
};
|
|
13
81
|
const stack = [];
|
|
14
82
|
let text = [];
|
|
15
|
-
|
|
83
|
+
let stopToken = "";
|
|
84
|
+
let lastStatus;
|
|
16
85
|
const flush = () => {
|
|
17
|
-
if (text.length > 0)
|
|
86
|
+
if (text.length > 0) (stack[stack.length - 1]?.children ?? root).push({
|
|
18
87
|
kind: "text",
|
|
19
88
|
text: text.join("\n")
|
|
20
89
|
});
|
|
21
90
|
text = [];
|
|
22
91
|
};
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
92
|
+
const add = (shown) => {
|
|
93
|
+
const lines = shown.split("\n").length;
|
|
94
|
+
for (const group of stack) group.lines += lines;
|
|
95
|
+
text.push(shown);
|
|
96
|
+
lastStatus = void 0;
|
|
97
|
+
};
|
|
98
|
+
const apply = (command, raw) => {
|
|
99
|
+
const { name, message } = command;
|
|
100
|
+
if (name === "group") {
|
|
27
101
|
flush();
|
|
28
102
|
const group = {
|
|
29
103
|
kind: "group",
|
|
30
|
-
name:
|
|
104
|
+
name: message.trim(),
|
|
31
105
|
lines: 0,
|
|
32
106
|
closed: false,
|
|
33
107
|
children: []
|
|
34
108
|
};
|
|
35
|
-
|
|
109
|
+
(stack[stack.length - 1]?.children ?? root).push(group);
|
|
36
110
|
stack.push(group);
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (GROUP_END.test(line)) {
|
|
111
|
+
lastStatus = void 0;
|
|
112
|
+
} else if (name === "endgroup") {
|
|
40
113
|
flush();
|
|
41
114
|
const group = stack.pop();
|
|
42
115
|
if (group) group.closed = true;
|
|
116
|
+
lastStatus = void 0;
|
|
117
|
+
} else if (name === "status") {
|
|
118
|
+
log.status = message;
|
|
119
|
+
if (message !== lastStatus) add(message);
|
|
120
|
+
lastStatus = message;
|
|
121
|
+
} else if (name === "description") log.description = message;
|
|
122
|
+
else if (name === "progress") {
|
|
123
|
+
const progress = readProgress(command);
|
|
124
|
+
if (progress) log.progress = progress;
|
|
125
|
+
else add(raw);
|
|
126
|
+
} else if (name === "stop-commands") {
|
|
127
|
+
stopToken = message;
|
|
128
|
+
if (!message) add(raw);
|
|
129
|
+
} else if (name !== "debug") add(`${ANNOTATIONS[name]}: ${message}`);
|
|
130
|
+
};
|
|
131
|
+
for (const raw of logs.split("\n")) {
|
|
132
|
+
const line = raw.replace(/\r$/, "");
|
|
133
|
+
if (stopToken) {
|
|
134
|
+
if (line === `::${stopToken}::`) stopToken = "";
|
|
135
|
+
else add(raw);
|
|
43
136
|
continue;
|
|
44
137
|
}
|
|
45
|
-
|
|
46
|
-
|
|
138
|
+
const command = readCommand(line);
|
|
139
|
+
if (command) {
|
|
140
|
+
log.hasCommands = true;
|
|
141
|
+
apply(command, raw);
|
|
142
|
+
} else add(raw);
|
|
47
143
|
}
|
|
48
144
|
flush();
|
|
49
|
-
return
|
|
145
|
+
return log;
|
|
146
|
+
}
|
|
147
|
+
/** A closed group is the one row it collapses to; an open one its header and contents. */
|
|
148
|
+
function rowsOf(section) {
|
|
149
|
+
if (section.kind === "text") return section.text.split("\n").length;
|
|
150
|
+
return section.closed ? 1 : 1 + countLogRows(section.children);
|
|
151
|
+
}
|
|
152
|
+
function countLogRows(sections) {
|
|
153
|
+
return sections.reduce((rows, section) => rows + rowsOf(section), 0);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The first (`head`) or last (`tail`) rows of a log. A closed group counts as
|
|
157
|
+
* one row and is kept whole; an open group keeps its header.
|
|
158
|
+
*/
|
|
159
|
+
function takeLogRows(sections, limit, from) {
|
|
160
|
+
const taken = [];
|
|
161
|
+
let left = limit;
|
|
162
|
+
for (const section of from === "head" ? sections : [...sections].reverse()) {
|
|
163
|
+
if (left <= 0) break;
|
|
164
|
+
const rows = rowsOf(section);
|
|
165
|
+
if (rows <= left) taken.push(section);
|
|
166
|
+
else if (section.kind === "text") {
|
|
167
|
+
const lines = section.text.split("\n");
|
|
168
|
+
taken.push({
|
|
169
|
+
kind: "text",
|
|
170
|
+
text: (from === "head" ? lines.slice(0, left) : lines.slice(-left)).join("\n")
|
|
171
|
+
});
|
|
172
|
+
} else taken.push({
|
|
173
|
+
...section,
|
|
174
|
+
children: takeLogRows(section.children, left - 1, from)
|
|
175
|
+
});
|
|
176
|
+
left -= rows;
|
|
177
|
+
}
|
|
178
|
+
return from === "head" ? taken : taken.reverse();
|
|
50
179
|
}
|
|
180
|
+
exports.countLogRows = countLogRows;
|
|
51
181
|
exports.parseLogSections = parseLogSections;
|
|
182
|
+
exports.takeLogRows = takeLogRows;
|
|
52
183
|
|
|
53
184
|
//# sourceMappingURL=log-sections.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-sections.cjs","names":[],"sources":["../../src/data/log-sections.ts"],"sourcesContent":["/** A run of plain log lines, or a collapsible group of them. */\nexport type LogSection =\n | { kind: \"text\"; text: string }\n | { kind: \"group\"; name: string; lines: number; closed: boolean; children: LogSection[] };\n\nconst GROUP_START = /^(?:::group::|##\\[group\\])(.*)$/;\nconst GROUP_END = /^(?:::endgroup::|##\\[endgroup\\])\\s*$/;\n\n/**\n * Splits log text into sections at GitHub Actions group markers:\n * `::group::name` / `::endgroup::` as a step prints them, or `##[group]name` /\n * `##[endgroup]` as GitHub's downloaded logs carry them. Groups nest. An\n * `endgroup` with no open group is dropped (a tail cut its start off); a group\n * still open at the end is returned unclosed (its output is still arriving).\n */\nexport function parseLogSections(logs: string): LogSection[] {\n const root: LogSection[] = [];\n const stack: Extract<LogSection, { kind: \"group\" }>[] = [];\n let text: string[] = [];\n const target = () => stack[stack.length - 1]?.children ?? root;\n const flush = () => {\n if (text.length > 0) target().push({ kind: \"text\", text: text.join(\"\\n\") });\n text = [];\n };\n for (const raw of logs.split(\"\\n\")) {\n const line = raw.replace(/\\r$/, \"\");\n const start = GROUP_START.exec(line);\n if (start) {\n flush();\n const group = { kind: \"group\" as const, name: start[1]?.trim() ?? \"\", lines: 0, closed: false, children: [] };\n target().push(group);\n stack.push(group);\n continue;\n }\n if (GROUP_END.test(line)) {\n flush();\n const group = stack.pop();\n if (group) group.closed = true;\n continue;\n }\n for (const group of stack) group.lines++;\n text.push(raw);\n }\n flush();\n return root;\n}\n"],"mappings":";AAKA,IAAM,cAAc;AACpB,IAAM,YAAY;;;;;;;;AASlB,SAAgB,iBAAiB,MAA4B;CAC3D,MAAM,OAAqB,CAAC;CAC5B,MAAM,QAAkD,CAAC;CACzD,IAAI,OAAiB,CAAC;CACtB,MAAM,eAAe,MAAM,MAAM,SAAS,EAAE,EAAE,YAAY;CAC1D,MAAM,cAAc;EAClB,IAAI,KAAK,SAAS,GAAG,OAAO,CAAC,CAAC,KAAK;GAAE,MAAM;GAAQ,MAAM,KAAK,KAAK,IAAI;EAAE,CAAC;EAC1E,OAAO,CAAC;CACV;CACA,KAAK,MAAM,OAAO,KAAK,MAAM,IAAI,GAAG;EAClC,MAAM,OAAO,IAAI,QAAQ,OAAO,EAAE;EAClC,MAAM,QAAQ,YAAY,KAAK,IAAI;EACnC,IAAI,OAAO;GACT,MAAM;GACN,MAAM,QAAQ;IAAE,MAAM;IAAkB,MAAM,MAAM,EAAE,EAAE,KAAK,KAAK;IAAI,OAAO;IAAG,QAAQ;IAAO,UAAU,CAAC;GAAE;GAC5G,OAAO,CAAC,CAAC,KAAK,KAAK;GACnB,MAAM,KAAK,KAAK;GAChB;EACF;EACA,IAAI,UAAU,KAAK,IAAI,GAAG;GACxB,MAAM;GACN,MAAM,QAAQ,MAAM,IAAI;GACxB,IAAI,OAAO,MAAM,SAAS;GAC1B;EACF;EACA,KAAK,MAAM,SAAS,OAAO,MAAM;EACjC,KAAK,KAAK,GAAG;CACf;CACA,MAAM;CACN,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"log-sections.cjs","names":[],"sources":["../../src/data/log-sections.ts"],"sourcesContent":["/** A run of plain log lines, or a collapsible group of them. */\nexport type LogSection =\n | { kind: \"text\"; text: string }\n | { kind: \"group\"; name: string; lines: number; closed: boolean; children: LogSection[] };\n\ntype LogGroup = Extract<LogSection, { kind: \"group\" }>;\n\n/** A log as its workflow commands describe it. */\nexport type ParsedLog = {\n sections: LogSection[];\n /** The latest `::description::`. */\n description?: string;\n /** The latest `::status::`. */\n status?: string;\n /** The latest `::progress::`. */\n progress?: { done: number; total: number };\n /** The log held a command or group marker, so it differs from its sections. */\n hasCommands: boolean;\n};\n\ntype Command = { name: string; properties: Record<string, string>; message: string };\n\n// The commands gavel reads from a fixture step (fixtures/workflow_commands.go);\n// a line naming any other is ordinary output, as on GitHub.\nconst COMMANDS = new Set([\n \"group\", \"endgroup\", \"notice\", \"warning\", \"error\", \"debug\", \"progress\", \"description\", \"status\", \"stop-commands\",\n]);\nconst ANNOTATIONS: Record<string, string> = { error: \"Error\", warning: \"Warning\", notice: \"Notice\" };\nconst ESCAPES: Record<string, string> = { \"%25\": \"%\", \"%0D\": \"\\r\", \"%0A\": \"\\n\" };\nconst DOWNLOADED_MARKER = /^##\\[(group|endgroup)\\](.*)$/;\nconst COUNT = /^\\s*(\\d+)\\s*$/;\n\nfunction readCommand(line: string): Command | undefined {\n const marker = DOWNLOADED_MARKER.exec(line);\n if (marker) return { name: marker[1]!, properties: {}, message: marker[2]! };\n if (!line.startsWith(\"::\")) return undefined;\n const end = line.indexOf(\"::\", 2);\n if (end < 0) return undefined;\n const head = line.slice(2, end);\n const space = head.indexOf(\" \");\n const name = space < 0 ? head : head.slice(0, space);\n if (!COMMANDS.has(name)) return undefined;\n const properties: Record<string, string> = {};\n const list = space < 0 ? \"\" : head.slice(space + 1).trim();\n for (const property of list ? list.split(\",\") : []) {\n const [key, ...value] = property.split(\"=\");\n if (!key?.trim() || value.length === 0) return undefined;\n properties[key.trim()] = value.join(\"=\");\n }\n return { name, properties, message: line.slice(end + 2).replace(/%25|%0D|%0A/g, (escape) => ESCAPES[escape]!) };\n}\n\n/** `::progress::3/10` or `::progress done=3,total=10::`; undefined when it is neither. */\nfunction readProgress({ properties, message }: Command): ParsedLog[\"progress\"] {\n const slash = message.indexOf(\"/\");\n const named = \"done\" in properties || \"total\" in properties;\n const done = COUNT.exec(named ? (properties.done ?? \"\") : message.slice(0, Math.max(slash, 0)));\n const total = COUNT.exec(named ? (properties.total ?? \"\") : message.slice(slash + 1));\n return done && total ? { done: Number(done[1]), total: Number(total[1]) } : undefined;\n}\n\n/**\n * Reads a log's workflow commands, as a step prints them (`::group::name`) or\n * as GitHub's downloaded logs carry group markers (`##[group]name`).\n *\n * Groups become nested sections: an `endgroup` with no open group is dropped (a\n * tail cut its start off) and a group still open at the end is returned\n * unclosed (its output is still arriving). A status is a line of the log unless\n * it repeats the one before it, annotations are lines, and the latest\n * description, status and progress are returned beside the sections. A command\n * that does not parse stays as it was printed.\n */\nexport function parseLogSections(logs: string): ParsedLog {\n const root: LogSection[] = [];\n const log: ParsedLog = { sections: root, hasCommands: false };\n const stack: LogGroup[] = [];\n let text: string[] = [];\n let stopToken = \"\";\n let lastStatus: string | undefined;\n\n const flush = () => {\n if (text.length > 0) (stack[stack.length - 1]?.children ?? root).push({ kind: \"text\", text: text.join(\"\\n\") });\n text = [];\n };\n const add = (shown: string) => {\n const lines = shown.split(\"\\n\").length;\n for (const group of stack) group.lines += lines;\n text.push(shown);\n lastStatus = undefined;\n };\n const apply = (command: Command, raw: string) => {\n const { name, message } = command;\n if (name === \"group\") {\n flush();\n const group: LogGroup = { kind: \"group\", name: message.trim(), lines: 0, closed: false, children: [] };\n (stack[stack.length - 1]?.children ?? root).push(group);\n stack.push(group);\n lastStatus = undefined;\n } else if (name === \"endgroup\") {\n flush();\n const group = stack.pop();\n if (group) group.closed = true;\n lastStatus = undefined;\n } else if (name === \"status\") {\n log.status = message;\n if (message !== lastStatus) add(message);\n lastStatus = message;\n } else if (name === \"description\") {\n log.description = message;\n } else if (name === \"progress\") {\n const progress = readProgress(command);\n if (progress) log.progress = progress;\n else add(raw);\n } else if (name === \"stop-commands\") {\n stopToken = message;\n if (!message) add(raw);\n } else if (name !== \"debug\") {\n add(`${ANNOTATIONS[name]}: ${message}`);\n }\n };\n\n for (const raw of logs.split(\"\\n\")) {\n const line = raw.replace(/\\r$/, \"\");\n if (stopToken) {\n if (line === `::${stopToken}::`) stopToken = \"\";\n else add(raw);\n continue;\n }\n const command = readCommand(line);\n if (command) {\n log.hasCommands = true;\n apply(command, raw);\n } else {\n add(raw);\n }\n }\n flush();\n return log;\n}\n\n/** A closed group is the one row it collapses to; an open one its header and contents. */\nfunction rowsOf(section: LogSection): number {\n if (section.kind === \"text\") return section.text.split(\"\\n\").length;\n return section.closed ? 1 : 1 + countLogRows(section.children);\n}\n\nexport function countLogRows(sections: LogSection[]): number {\n return sections.reduce((rows, section) => rows + rowsOf(section), 0);\n}\n\n/**\n * The first (`head`) or last (`tail`) rows of a log. A closed group counts as\n * one row and is kept whole; an open group keeps its header.\n */\nexport function takeLogRows(sections: LogSection[], limit: number, from: \"head\" | \"tail\"): LogSection[] {\n const taken: LogSection[] = [];\n let left = limit;\n for (const section of from === \"head\" ? sections : [...sections].reverse()) {\n if (left <= 0) break;\n const rows = rowsOf(section);\n if (rows <= left) {\n taken.push(section);\n } else if (section.kind === \"text\") {\n const lines = section.text.split(\"\\n\");\n taken.push({ kind: \"text\", text: (from === \"head\" ? lines.slice(0, left) : lines.slice(-left)).join(\"\\n\") });\n } else {\n taken.push({ ...section, children: takeLogRows(section.children, left - 1, from) });\n }\n left -= rows;\n }\n return from === \"head\" ? taken : taken.reverse();\n}\n"],"mappings":";AAwBA,IAAM,2BAAW,IAAI,IAAI;CACvB;CAAS;CAAY;CAAU;CAAW;CAAS;CAAS;CAAY;CAAe;CAAU;AACnG,CAAC;AACD,IAAM,cAAsC;CAAE,OAAO;CAAS,SAAS;CAAW,QAAQ;AAAS;AACnG,IAAM,UAAkC;CAAE,OAAO;CAAK,OAAO;CAAM,OAAO;AAAK;AAC/E,IAAM,oBAAoB;AAC1B,IAAM,QAAQ;AAEd,SAAS,YAAY,MAAmC;CACtD,MAAM,SAAS,kBAAkB,KAAK,IAAI;CAC1C,IAAI,QAAQ,OAAO;EAAE,MAAM,OAAO;EAAK,YAAY,CAAC;EAAG,SAAS,OAAO;CAAI;CAC3E,IAAI,CAAC,KAAK,WAAW,IAAI,GAAG,OAAO,KAAA;CACnC,MAAM,MAAM,KAAK,QAAQ,MAAM,CAAC;CAChC,IAAI,MAAM,GAAG,OAAO,KAAA;CACpB,MAA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S,QAAQ,MAAM,QAAQ;AACjD"}
|
|
@@ -9,12 +9,37 @@ export type LogSection = {
|
|
|
9
9
|
closed: boolean;
|
|
10
10
|
children: LogSection[];
|
|
11
11
|
};
|
|
12
|
+
/** A log as its workflow commands describe it. */
|
|
13
|
+
export type ParsedLog = {
|
|
14
|
+
sections: LogSection[];
|
|
15
|
+
/** The latest `::description::`. */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** The latest `::status::`. */
|
|
18
|
+
status?: string;
|
|
19
|
+
/** The latest `::progress::`. */
|
|
20
|
+
progress?: {
|
|
21
|
+
done: number;
|
|
22
|
+
total: number;
|
|
23
|
+
};
|
|
24
|
+
/** The log held a command or group marker, so it differs from its sections. */
|
|
25
|
+
hasCommands: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Reads a log's workflow commands, as a step prints them (`::group::name`) or
|
|
29
|
+
* as GitHub's downloaded logs carry group markers (`##[group]name`).
|
|
30
|
+
*
|
|
31
|
+
* Groups become nested sections: an `endgroup` with no open group is dropped (a
|
|
32
|
+
* tail cut its start off) and a group still open at the end is returned
|
|
33
|
+
* unclosed (its output is still arriving). A status is a line of the log unless
|
|
34
|
+
* it repeats the one before it, annotations are lines, and the latest
|
|
35
|
+
* description, status and progress are returned beside the sections. A command
|
|
36
|
+
* that does not parse stays as it was printed.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseLogSections(logs: string): ParsedLog;
|
|
39
|
+
export declare function countLogRows(sections: LogSection[]): number;
|
|
12
40
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `##[endgroup]` as GitHub's downloaded logs carry them. Groups nest. An
|
|
16
|
-
* `endgroup` with no open group is dropped (a tail cut its start off); a group
|
|
17
|
-
* still open at the end is returned unclosed (its output is still arriving).
|
|
41
|
+
* The first (`head`) or last (`tail`) rows of a log. A closed group counts as
|
|
42
|
+
* one row and is kept whole; an open group keeps its header.
|
|
18
43
|
*/
|
|
19
|
-
export declare function
|
|
44
|
+
export declare function takeLogRows(sections: LogSection[], limit: number, from: "head" | "tail"): LogSection[];
|
|
20
45
|
//# sourceMappingURL=log-sections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-sections.d.ts","sourceRoot":"","sources":["../../src/data/log-sections.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"log-sections.d.ts","sourceRoot":"","sources":["../../src/data/log-sections.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAI5F,kDAAkD;AAClD,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,+EAA+E;IAC/E,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AA2CF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAkExD;AAQD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,CAE3D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,EAAE,CAiBtG"}
|
|
@@ -1,53 +1,182 @@
|
|
|
1
1
|
// src/data/log-sections.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var COMMANDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"group",
|
|
4
|
+
"endgroup",
|
|
5
|
+
"notice",
|
|
6
|
+
"warning",
|
|
7
|
+
"error",
|
|
8
|
+
"debug",
|
|
9
|
+
"progress",
|
|
10
|
+
"description",
|
|
11
|
+
"status",
|
|
12
|
+
"stop-commands"
|
|
13
|
+
]);
|
|
14
|
+
var ANNOTATIONS = {
|
|
15
|
+
error: "Error",
|
|
16
|
+
warning: "Warning",
|
|
17
|
+
notice: "Notice"
|
|
18
|
+
};
|
|
19
|
+
var ESCAPES = {
|
|
20
|
+
"%25": "%",
|
|
21
|
+
"%0D": "\r",
|
|
22
|
+
"%0A": "\n"
|
|
23
|
+
};
|
|
24
|
+
var DOWNLOADED_MARKER = /^##\[(group|endgroup)\](.*)$/;
|
|
25
|
+
var COUNT = /^\s*(\d+)\s*$/;
|
|
26
|
+
function readCommand(line) {
|
|
27
|
+
const marker = DOWNLOADED_MARKER.exec(line);
|
|
28
|
+
if (marker) return {
|
|
29
|
+
name: marker[1],
|
|
30
|
+
properties: {},
|
|
31
|
+
message: marker[2]
|
|
32
|
+
};
|
|
33
|
+
if (!line.startsWith("::")) return void 0;
|
|
34
|
+
const end = line.indexOf("::", 2);
|
|
35
|
+
if (end < 0) return void 0;
|
|
36
|
+
const head = line.slice(2, end);
|
|
37
|
+
const space = head.indexOf(" ");
|
|
38
|
+
const name = space < 0 ? head : head.slice(0, space);
|
|
39
|
+
if (!COMMANDS.has(name)) return void 0;
|
|
40
|
+
const properties = {};
|
|
41
|
+
const list = space < 0 ? "" : head.slice(space + 1).trim();
|
|
42
|
+
for (const property of list ? list.split(",") : []) {
|
|
43
|
+
const [key, ...value] = property.split("=");
|
|
44
|
+
if (!key?.trim() || value.length === 0) return void 0;
|
|
45
|
+
properties[key.trim()] = value.join("=");
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
name,
|
|
49
|
+
properties,
|
|
50
|
+
message: line.slice(end + 2).replace(/%25|%0D|%0A/g, (escape) => ESCAPES[escape])
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** `::progress::3/10` or `::progress done=3,total=10::`; undefined when it is neither. */
|
|
54
|
+
function readProgress({ properties, message }) {
|
|
55
|
+
const slash = message.indexOf("/");
|
|
56
|
+
const named = "done" in properties || "total" in properties;
|
|
57
|
+
const done = COUNT.exec(named ? properties.done ?? "" : message.slice(0, Math.max(slash, 0)));
|
|
58
|
+
const total = COUNT.exec(named ? properties.total ?? "" : message.slice(slash + 1));
|
|
59
|
+
return done && total ? {
|
|
60
|
+
done: Number(done[1]),
|
|
61
|
+
total: Number(total[1])
|
|
62
|
+
} : void 0;
|
|
63
|
+
}
|
|
4
64
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `endgroup` with no open group is dropped (a
|
|
9
|
-
* still open at the end is returned
|
|
65
|
+
* Reads a log's workflow commands, as a step prints them (`::group::name`) or
|
|
66
|
+
* as GitHub's downloaded logs carry group markers (`##[group]name`).
|
|
67
|
+
*
|
|
68
|
+
* Groups become nested sections: an `endgroup` with no open group is dropped (a
|
|
69
|
+
* tail cut its start off) and a group still open at the end is returned
|
|
70
|
+
* unclosed (its output is still arriving). A status is a line of the log unless
|
|
71
|
+
* it repeats the one before it, annotations are lines, and the latest
|
|
72
|
+
* description, status and progress are returned beside the sections. A command
|
|
73
|
+
* that does not parse stays as it was printed.
|
|
10
74
|
*/
|
|
11
75
|
function parseLogSections(logs) {
|
|
12
76
|
const root = [];
|
|
77
|
+
const log = {
|
|
78
|
+
sections: root,
|
|
79
|
+
hasCommands: false
|
|
80
|
+
};
|
|
13
81
|
const stack = [];
|
|
14
82
|
let text = [];
|
|
15
|
-
|
|
83
|
+
let stopToken = "";
|
|
84
|
+
let lastStatus;
|
|
16
85
|
const flush = () => {
|
|
17
|
-
if (text.length > 0)
|
|
86
|
+
if (text.length > 0) (stack[stack.length - 1]?.children ?? root).push({
|
|
18
87
|
kind: "text",
|
|
19
88
|
text: text.join("\n")
|
|
20
89
|
});
|
|
21
90
|
text = [];
|
|
22
91
|
};
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
92
|
+
const add = (shown) => {
|
|
93
|
+
const lines = shown.split("\n").length;
|
|
94
|
+
for (const group of stack) group.lines += lines;
|
|
95
|
+
text.push(shown);
|
|
96
|
+
lastStatus = void 0;
|
|
97
|
+
};
|
|
98
|
+
const apply = (command, raw) => {
|
|
99
|
+
const { name, message } = command;
|
|
100
|
+
if (name === "group") {
|
|
27
101
|
flush();
|
|
28
102
|
const group = {
|
|
29
103
|
kind: "group",
|
|
30
|
-
name:
|
|
104
|
+
name: message.trim(),
|
|
31
105
|
lines: 0,
|
|
32
106
|
closed: false,
|
|
33
107
|
children: []
|
|
34
108
|
};
|
|
35
|
-
|
|
109
|
+
(stack[stack.length - 1]?.children ?? root).push(group);
|
|
36
110
|
stack.push(group);
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (GROUP_END.test(line)) {
|
|
111
|
+
lastStatus = void 0;
|
|
112
|
+
} else if (name === "endgroup") {
|
|
40
113
|
flush();
|
|
41
114
|
const group = stack.pop();
|
|
42
115
|
if (group) group.closed = true;
|
|
116
|
+
lastStatus = void 0;
|
|
117
|
+
} else if (name === "status") {
|
|
118
|
+
log.status = message;
|
|
119
|
+
if (message !== lastStatus) add(message);
|
|
120
|
+
lastStatus = message;
|
|
121
|
+
} else if (name === "description") log.description = message;
|
|
122
|
+
else if (name === "progress") {
|
|
123
|
+
const progress = readProgress(command);
|
|
124
|
+
if (progress) log.progress = progress;
|
|
125
|
+
else add(raw);
|
|
126
|
+
} else if (name === "stop-commands") {
|
|
127
|
+
stopToken = message;
|
|
128
|
+
if (!message) add(raw);
|
|
129
|
+
} else if (name !== "debug") add(`${ANNOTATIONS[name]}: ${message}`);
|
|
130
|
+
};
|
|
131
|
+
for (const raw of logs.split("\n")) {
|
|
132
|
+
const line = raw.replace(/\r$/, "");
|
|
133
|
+
if (stopToken) {
|
|
134
|
+
if (line === `::${stopToken}::`) stopToken = "";
|
|
135
|
+
else add(raw);
|
|
43
136
|
continue;
|
|
44
137
|
}
|
|
45
|
-
|
|
46
|
-
|
|
138
|
+
const command = readCommand(line);
|
|
139
|
+
if (command) {
|
|
140
|
+
log.hasCommands = true;
|
|
141
|
+
apply(command, raw);
|
|
142
|
+
} else add(raw);
|
|
47
143
|
}
|
|
48
144
|
flush();
|
|
49
|
-
return
|
|
145
|
+
return log;
|
|
146
|
+
}
|
|
147
|
+
/** A closed group is the one row it collapses to; an open one its header and contents. */
|
|
148
|
+
function rowsOf(section) {
|
|
149
|
+
if (section.kind === "text") return section.text.split("\n").length;
|
|
150
|
+
return section.closed ? 1 : 1 + countLogRows(section.children);
|
|
151
|
+
}
|
|
152
|
+
function countLogRows(sections) {
|
|
153
|
+
return sections.reduce((rows, section) => rows + rowsOf(section), 0);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The first (`head`) or last (`tail`) rows of a log. A closed group counts as
|
|
157
|
+
* one row and is kept whole; an open group keeps its header.
|
|
158
|
+
*/
|
|
159
|
+
function takeLogRows(sections, limit, from) {
|
|
160
|
+
const taken = [];
|
|
161
|
+
let left = limit;
|
|
162
|
+
for (const section of from === "head" ? sections : [...sections].reverse()) {
|
|
163
|
+
if (left <= 0) break;
|
|
164
|
+
const rows = rowsOf(section);
|
|
165
|
+
if (rows <= left) taken.push(section);
|
|
166
|
+
else if (section.kind === "text") {
|
|
167
|
+
const lines = section.text.split("\n");
|
|
168
|
+
taken.push({
|
|
169
|
+
kind: "text",
|
|
170
|
+
text: (from === "head" ? lines.slice(0, left) : lines.slice(-left)).join("\n")
|
|
171
|
+
});
|
|
172
|
+
} else taken.push({
|
|
173
|
+
...section,
|
|
174
|
+
children: takeLogRows(section.children, left - 1, from)
|
|
175
|
+
});
|
|
176
|
+
left -= rows;
|
|
177
|
+
}
|
|
178
|
+
return from === "head" ? taken : taken.reverse();
|
|
50
179
|
}
|
|
51
|
-
export { parseLogSections };
|
|
180
|
+
export { countLogRows, parseLogSections, takeLogRows };
|
|
52
181
|
|
|
53
182
|
//# sourceMappingURL=log-sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-sections.js","names":[],"sources":["../../src/data/log-sections.ts"],"sourcesContent":["/** A run of plain log lines, or a collapsible group of them. */\nexport type LogSection =\n | { kind: \"text\"; text: string }\n | { kind: \"group\"; name: string; lines: number; closed: boolean; children: LogSection[] };\n\nconst GROUP_START = /^(?:::group::|##\\[group\\])(.*)$/;\nconst GROUP_END = /^(?:::endgroup::|##\\[endgroup\\])\\s*$/;\n\n/**\n * Splits log text into sections at GitHub Actions group markers:\n * `::group::name` / `::endgroup::` as a step prints them, or `##[group]name` /\n * `##[endgroup]` as GitHub's downloaded logs carry them. Groups nest. An\n * `endgroup` with no open group is dropped (a tail cut its start off); a group\n * still open at the end is returned unclosed (its output is still arriving).\n */\nexport function parseLogSections(logs: string): LogSection[] {\n const root: LogSection[] = [];\n const stack: Extract<LogSection, { kind: \"group\" }>[] = [];\n let text: string[] = [];\n const target = () => stack[stack.length - 1]?.children ?? root;\n const flush = () => {\n if (text.length > 0) target().push({ kind: \"text\", text: text.join(\"\\n\") });\n text = [];\n };\n for (const raw of logs.split(\"\\n\")) {\n const line = raw.replace(/\\r$/, \"\");\n const start = GROUP_START.exec(line);\n if (start) {\n flush();\n const group = { kind: \"group\" as const, name: start[1]?.trim() ?? \"\", lines: 0, closed: false, children: [] };\n target().push(group);\n stack.push(group);\n continue;\n }\n if (GROUP_END.test(line)) {\n flush();\n const group = stack.pop();\n if (group) group.closed = true;\n continue;\n }\n for (const group of stack) group.lines++;\n text.push(raw);\n }\n flush();\n return root;\n}\n"],"mappings":";AAKA,IAAM,cAAc;AACpB,IAAM,YAAY;;;;;;;;AASlB,SAAgB,iBAAiB,MAA4B;CAC3D,MAAM,OAAqB,CAAC;CAC5B,MAAM,QAAkD,CAAC;CACzD,IAAI,OAAiB,CAAC;CACtB,MAAM,eAAe,MAAM,MAAM,SAAS,EAAE,EAAE,YAAY;CAC1D,MAAM,cAAc;EAClB,IAAI,KAAK,SAAS,GAAG,OAAO,CAAC,CAAC,KAAK;GAAE,MAAM;GAAQ,MAAM,KAAK,KAAK,IAAI;EAAE,CAAC;EAC1E,OAAO,CAAC;CACV;CACA,KAAK,MAAM,OAAO,KAAK,MAAM,IAAI,GAAG;EAClC,MAAM,OAAO,IAAI,QAAQ,OAAO,EAAE;EAClC,MAAM,QAAQ,YAAY,KAAK,IAAI;EACnC,IAAI,OAAO;GACT,MAAM;GACN,MAAM,QAAQ;IAAE,MAAM;IAAkB,MAAM,MAAM,EAAE,EAAE,KAAK,KAAK;IAAI,OAAO;IAAG,QAAQ;IAAO,UAAU,CAAC;GAAE;GAC5G,OAAO,CAAC,CAAC,KAAK,KAAK;GACnB,MAAM,KAAK,KAAK;GAChB;EACF;EACA,IAAI,UAAU,KAAK,IAAI,GAAG;GACxB,MAAM;GACN,MAAM,QAAQ,MAAM,IAAI;GACxB,IAAI,OAAO,MAAM,SAAS;GAC1B;EACF;EACA,KAAK,MAAM,SAAS,OAAO,MAAM;EACjC,KAAK,KAAK,GAAG;CACf;CACA,MAAM;CACN,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"log-sections.js","names":[],"sources":["../../src/data/log-sections.ts"],"sourcesContent":["/** A run of plain log lines, or a collapsible group of them. */\nexport type LogSection =\n | { kind: \"text\"; text: string }\n | { kind: \"group\"; name: string; lines: number; closed: boolean; children: LogSection[] };\n\ntype LogGroup = Extract<LogSection, { kind: \"group\" }>;\n\n/** A log as its workflow commands describe it. */\nexport type ParsedLog = {\n sections: LogSection[];\n /** The latest `::description::`. */\n description?: string;\n /** The latest `::status::`. */\n status?: string;\n /** The latest `::progress::`. */\n progress?: { done: number; total: number };\n /** The log held a command or group marker, so it differs from its sections. */\n hasCommands: boolean;\n};\n\ntype Command = { name: string; properties: Record<string, string>; message: string };\n\n// The commands gavel reads from a fixture step (fixtures/workflow_commands.go);\n// a line naming any other is ordinary output, as on GitHub.\nconst COMMANDS = new Set([\n \"group\", \"endgroup\", \"notice\", \"warning\", \"error\", \"debug\", \"progress\", \"description\", \"status\", \"stop-commands\",\n]);\nconst ANNOTATIONS: Record<string, string> = { error: \"Error\", warning: \"Warning\", notice: \"Notice\" };\nconst ESCAPES: Record<string, string> = { \"%25\": \"%\", \"%0D\": \"\\r\", \"%0A\": \"\\n\" };\nconst DOWNLOADED_MARKER = /^##\\[(group|endgroup)\\](.*)$/;\nconst COUNT = /^\\s*(\\d+)\\s*$/;\n\nfunction readCommand(line: string): Command | undefined {\n const marker = DOWNLOADED_MARKER.exec(line);\n if (marker) return { name: marker[1]!, properties: {}, message: marker[2]! };\n if (!line.startsWith(\"::\")) return undefined;\n const end = line.indexOf(\"::\", 2);\n if (end < 0) return undefined;\n const head = line.slice(2, end);\n const space = head.indexOf(\" \");\n const name = space < 0 ? head : head.slice(0, space);\n if (!COMMANDS.has(name)) return undefined;\n const properties: Record<string, string> = {};\n const list = space < 0 ? \"\" : head.slice(space + 1).trim();\n for (const property of list ? list.split(\",\") : []) {\n const [key, ...value] = property.split(\"=\");\n if (!key?.trim() || value.length === 0) return undefined;\n properties[key.trim()] = value.join(\"=\");\n }\n return { name, properties, message: line.slice(end + 2).replace(/%25|%0D|%0A/g, (escape) => ESCAPES[escape]!) };\n}\n\n/** `::progress::3/10` or `::progress done=3,total=10::`; undefined when it is neither. */\nfunction readProgress({ properties, message }: Command): ParsedLog[\"progress\"] {\n const slash = message.indexOf(\"/\");\n const named = \"done\" in properties || \"total\" in properties;\n const done = COUNT.exec(named ? (properties.done ?? \"\") : message.slice(0, Math.max(slash, 0)));\n const total = COUNT.exec(named ? (properties.total ?? \"\") : message.slice(slash + 1));\n return done && total ? { done: Number(done[1]), total: Number(total[1]) } : undefined;\n}\n\n/**\n * Reads a log's workflow commands, as a step prints them (`::group::name`) or\n * as GitHub's downloaded logs carry group markers (`##[group]name`).\n *\n * Groups become nested sections: an `endgroup` with no open group is dropped (a\n * tail cut its start off) and a group still open at the end is returned\n * unclosed (its output is still arriving). A status is a line of the log unless\n * it repeats the one before it, annotations are lines, and the latest\n * description, status and progress are returned beside the sections. A command\n * that does not parse stays as it was printed.\n */\nexport function parseLogSections(logs: string): ParsedLog {\n const root: LogSection[] = [];\n const log: ParsedLog = { sections: root, hasCommands: false };\n const stack: LogGroup[] = [];\n let text: string[] = [];\n let stopToken = \"\";\n let lastStatus: string | undefined;\n\n const flush = () => {\n if (text.length > 0) (stack[stack.length - 1]?.children ?? root).push({ kind: \"text\", text: text.join(\"\\n\") });\n text = [];\n };\n const add = (shown: string) => {\n const lines = shown.split(\"\\n\").length;\n for (const group of stack) group.lines += lines;\n text.push(shown);\n lastStatus = undefined;\n };\n const apply = (command: Command, raw: string) => {\n const { name, message } = command;\n if (name === \"group\") {\n flush();\n const group: LogGroup = { kind: \"group\", name: message.trim(), lines: 0, closed: false, children: [] };\n (stack[stack.length - 1]?.children ?? root).push(group);\n stack.push(group);\n lastStatus = undefined;\n } else if (name === \"endgroup\") {\n flush();\n const group = stack.pop();\n if (group) group.closed = true;\n lastStatus = undefined;\n } else if (name === \"status\") {\n log.status = message;\n if (message !== lastStatus) add(message);\n lastStatus = message;\n } else if (name === \"description\") {\n log.description = message;\n } else if (name === \"progress\") {\n const progress = readProgress(command);\n if (progress) log.progress = progress;\n else add(raw);\n } else if (name === \"stop-commands\") {\n stopToken = message;\n if (!message) add(raw);\n } else if (name !== \"debug\") {\n add(`${ANNOTATIONS[name]}: ${message}`);\n }\n };\n\n for (const raw of logs.split(\"\\n\")) {\n const line = raw.replace(/\\r$/, \"\");\n if (stopToken) {\n if (line === `::${stopToken}::`) stopToken = \"\";\n else add(raw);\n continue;\n }\n const command = readCommand(line);\n if (command) {\n log.hasCommands = true;\n apply(command, raw);\n } else {\n add(raw);\n }\n }\n flush();\n return log;\n}\n\n/** A closed group is the one row it collapses to; an open one its header and contents. */\nfunction rowsOf(section: LogSection): number {\n if (section.kind === \"text\") return section.text.split(\"\\n\").length;\n return section.closed ? 1 : 1 + countLogRows(section.children);\n}\n\nexport function countLogRows(sections: LogSection[]): number {\n return sections.reduce((rows, section) => rows + rowsOf(section), 0);\n}\n\n/**\n * The first (`head`) or last (`tail`) rows of a log. A closed group counts as\n * one row and is kept whole; an open group keeps its header.\n */\nexport function takeLogRows(sections: LogSection[], limit: number, from: \"head\" | \"tail\"): LogSection[] {\n const taken: LogSection[] = [];\n let left = limit;\n for (const section of from === \"head\" ? sections : [...sections].reverse()) {\n if (left <= 0) break;\n const rows = rowsOf(section);\n if (rows <= left) {\n taken.push(section);\n } else if (section.kind === \"text\") {\n const lines = section.text.split(\"\\n\");\n taken.push({ kind: \"text\", text: (from === \"head\" ? lines.slice(0, left) : lines.slice(-left)).join(\"\\n\") });\n } else {\n taken.push({ ...section, children: takeLogRows(section.children, left - 1, from) });\n }\n left -= rows;\n }\n return from === \"head\" ? taken : taken.reverse();\n}\n"],"mappings":";AAwBA,IAAM,2BAAW,IAAI,IAAI;CACvB;CAAS;CAAY;CAAU;CAAW;CAAS;CAAS;CAAY;CAAe;CAAU;AACnG,CAAC;AACD,IAAM,cAAsC;CAAE,OAAO;CAAS,SAAS;CAAW,QAAQ;AAAS;AACnG,IAAM,UAAkC;CAAE,O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,KAAK,OAAO;OACb,IAAI,QAAQ,SAAS,QAAQ;GAClC,MAAM,QAAQ,QAAQ,KAAK,MAAM,IAAI;GACrC,MAAM,KAAK;IAAE,MAAM;IAAQ,OAAO,SAAS,SAAS,MAAM,MAAM,GAAG,IAAI,IAAI,MAAM,MAAM,CAAC,IAAI,EAAA,CAAG,KAAK,IAAI;GAAE,CAAC;EAC7G,OACE,MAAM,KAAK;GAAE,GAAG;GAAS,UAAU,YAAY,QAAQ,UAAU,OAAO,GAAG,IAAI;EAAE,CAAC;EAEpF,QAAQ;CACV;CACA,OAAO,SAAS,SAAS,QAAQ,MAAM,QAAQ;AACjD"}
|
|
@@ -277,7 +277,7 @@ function TestDetailPanel({ header = "full", tabVariant = "pill" } = {}) {
|
|
|
277
277
|
const detailAdapter = runner.adapters.resolveDetail(node, runner);
|
|
278
278
|
const actionAdapter = runner.adapters.resolveActions(selected, runner);
|
|
279
279
|
const tabs = runner.adapters.resolveTabs(node, runner);
|
|
280
|
-
if ((node.stdout || node.stderr) && !tabs.some((tab) => tab.id === "stdout")) tabs.unshift({
|
|
280
|
+
if ((node.log || node.stdout || node.stderr) && !tabs.some((tab) => tab.id === "stdout")) tabs.unshift({
|
|
281
281
|
id: "stdout",
|
|
282
282
|
label: "Stdout",
|
|
283
283
|
render: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|