@contraagent/ui 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -2
- package/custom-elements.json +7286 -0
- package/dist/adapters/check-rows.d.ts +20 -0
- package/dist/adapters/check-rows.d.ts.map +1 -0
- package/dist/adapters/check-rows.js +77 -0
- package/dist/adapters/check-rows.js.map +1 -0
- package/dist/adapters/filters.d.ts +29 -0
- package/dist/adapters/filters.d.ts.map +1 -0
- package/dist/adapters/filters.js +74 -0
- package/dist/adapters/filters.js.map +1 -0
- package/dist/adapters/graph/compound.d.ts +93 -0
- package/dist/adapters/graph/compound.d.ts.map +1 -0
- package/dist/adapters/graph/compound.js +322 -0
- package/dist/adapters/graph/compound.js.map +1 -0
- package/dist/adapters/graph/flow-index.d.ts +54 -0
- package/dist/adapters/graph/flow-index.d.ts.map +1 -0
- package/dist/adapters/graph/flow-index.js +129 -0
- package/dist/adapters/graph/flow-index.js.map +1 -0
- package/dist/adapters/graph/highlight.d.ts +14 -0
- package/dist/adapters/graph/highlight.d.ts.map +1 -0
- package/dist/adapters/graph/highlight.js +33 -0
- package/dist/adapters/graph/highlight.js.map +1 -0
- package/dist/adapters/graph/input.d.ts +50 -0
- package/dist/adapters/graph/input.d.ts.map +1 -0
- package/dist/adapters/graph/input.js +201 -0
- package/dist/adapters/graph/input.js.map +1 -0
- package/dist/adapters/graph/layer.d.ts +33 -0
- package/dist/adapters/graph/layer.d.ts.map +1 -0
- package/dist/adapters/graph/layer.js +94 -0
- package/dist/adapters/graph/layer.js.map +1 -0
- package/dist/adapters/graph/matrix.d.ts +62 -0
- package/dist/adapters/graph/matrix.d.ts.map +1 -0
- package/dist/adapters/graph/matrix.js +96 -0
- package/dist/adapters/graph/matrix.js.map +1 -0
- package/dist/adapters/graph/project.d.ts +49 -0
- package/dist/adapters/graph/project.d.ts.map +1 -0
- package/dist/adapters/graph/project.js +319 -0
- package/dist/adapters/graph/project.js.map +1 -0
- package/dist/adapters/graph/selection.d.ts +31 -0
- package/dist/adapters/graph/selection.d.ts.map +1 -0
- package/dist/adapters/graph/selection.js +48 -0
- package/dist/adapters/graph/selection.js.map +1 -0
- package/dist/adapters/graph/states.d.ts +6 -0
- package/dist/adapters/graph/states.d.ts.map +1 -0
- package/dist/adapters/graph/states.js +5 -0
- package/dist/adapters/graph/states.js.map +1 -0
- package/dist/adapters/graph/types.d.ts +141 -0
- package/dist/adapters/graph/types.d.ts.map +1 -0
- package/dist/adapters/graph/types.js +3 -0
- package/dist/adapters/graph/types.js.map +1 -0
- package/dist/adapters/graph/words.d.ts +48 -0
- package/dist/adapters/graph/words.d.ts.map +1 -0
- package/dist/adapters/graph/words.js +128 -0
- package/dist/adapters/graph/words.js.map +1 -0
- package/dist/adapters/index.d.ts +18 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +23 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/journal-columns.d.ts +21 -0
- package/dist/adapters/journal-columns.d.ts.map +1 -0
- package/dist/adapters/journal-columns.js +179 -0
- package/dist/adapters/journal-columns.js.map +1 -0
- package/dist/adapters/kpi-tiles.d.ts +47 -0
- package/dist/adapters/kpi-tiles.d.ts.map +1 -0
- package/dist/adapters/kpi-tiles.js +173 -0
- package/dist/adapters/kpi-tiles.js.map +1 -0
- package/dist/adapters/lanes.d.ts +31 -0
- package/dist/adapters/lanes.d.ts.map +1 -0
- package/dist/adapters/lanes.js +75 -0
- package/dist/adapters/lanes.js.map +1 -0
- package/dist/adapters/model-shares.d.ts +27 -0
- package/dist/adapters/model-shares.d.ts.map +1 -0
- package/dist/adapters/model-shares.js +52 -0
- package/dist/adapters/model-shares.js.map +1 -0
- package/dist/adapters/panel-body.d.ts +34 -0
- package/dist/adapters/panel-body.d.ts.map +1 -0
- package/dist/adapters/panel-body.js +90 -0
- package/dist/adapters/panel-body.js.map +1 -0
- package/dist/adapters/preflight.d.ts +12 -0
- package/dist/adapters/preflight.d.ts.map +1 -0
- package/dist/adapters/preflight.js +15 -0
- package/dist/adapters/preflight.js.map +1 -0
- package/dist/adapters/task-columns.d.ts +19 -0
- package/dist/adapters/task-columns.d.ts.map +1 -0
- package/dist/adapters/task-columns.js +107 -0
- package/dist/adapters/task-columns.js.map +1 -0
- package/dist/adapters/transcript/index.d.ts +6 -0
- package/dist/adapters/transcript/index.d.ts.map +1 -0
- package/dist/adapters/transcript/index.js +8 -0
- package/dist/adapters/transcript/index.js.map +1 -0
- package/dist/adapters/transcript/model.d.ts +42 -0
- package/dist/adapters/transcript/model.d.ts.map +1 -0
- package/dist/adapters/transcript/model.js +128 -0
- package/dist/adapters/transcript/model.js.map +1 -0
- package/dist/adapters/transcript/rounds.d.ts +15 -0
- package/dist/adapters/transcript/rounds.d.ts.map +1 -0
- package/dist/adapters/transcript/rounds.js +74 -0
- package/dist/adapters/transcript/rounds.js.map +1 -0
- package/dist/adapters/transcript/sections.d.ts +18 -0
- package/dist/adapters/transcript/sections.d.ts.map +1 -0
- package/dist/adapters/transcript/sections.js +69 -0
- package/dist/adapters/transcript/sections.js.map +1 -0
- package/dist/adapters/transcript/web.d.ts +12 -0
- package/dist/adapters/transcript/web.d.ts.map +1 -0
- package/dist/adapters/transcript/web.js +39 -0
- package/dist/adapters/transcript/web.js.map +1 -0
- package/dist/adapters/transcript/who.d.ts +15 -0
- package/dist/adapters/transcript/who.d.ts.map +1 -0
- package/dist/adapters/transcript/who.js +42 -0
- package/dist/adapters/transcript/who.js.map +1 -0
- package/dist/adapters/trends.d.ts +11 -0
- package/dist/adapters/trends.d.ts.map +1 -0
- package/dist/adapters/trends.js +316 -0
- package/dist/adapters/trends.js.map +1 -0
- package/dist/contraagent-ui.js +1028 -0
- package/dist/controllers/locale.d.ts +25 -0
- package/dist/controllers/locale.d.ts.map +1 -0
- package/dist/controllers/locale.js +33 -0
- package/dist/controllers/locale.js.map +1 -0
- package/dist/controllers/shortcuts.d.ts +29 -0
- package/dist/controllers/shortcuts.d.ts.map +1 -0
- package/dist/controllers/shortcuts.js +51 -0
- package/dist/controllers/shortcuts.js.map +1 -0
- package/dist/controllers/stream.d.ts +41 -0
- package/dist/controllers/stream.d.ts.map +1 -0
- package/dist/controllers/stream.js +90 -0
- package/dist/controllers/stream.js.map +1 -0
- package/dist/controllers/task-detail.d.ts +22 -0
- package/dist/controllers/task-detail.d.ts.map +1 -0
- package/dist/controllers/task-detail.js +50 -0
- package/dist/controllers/task-detail.js.map +1 -0
- package/dist/controllers/theme.d.ts +32 -0
- package/dist/controllers/theme.d.ts.map +1 -0
- package/dist/controllers/theme.js +56 -0
- package/dist/controllers/theme.js.map +1 -0
- package/dist/core/events.d.ts +107 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +5 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/i18n.d.ts +21 -0
- package/dist/core/i18n.d.ts.map +1 -0
- package/dist/core/i18n.js +71 -0
- package/dist/core/i18n.js.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +7 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/memory.d.ts +51 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +174 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/scroll.d.ts +21 -0
- package/dist/core/scroll.d.ts.map +1 -0
- package/dist/core/scroll.js +74 -0
- package/dist/core/scroll.js.map +1 -0
- package/dist/core/view-route.d.ts +62 -0
- package/dist/core/view-route.d.ts.map +1 -0
- package/dist/core/view-route.js +143 -0
- package/dist/core/view-route.js.map +1 -0
- package/dist/core/view-router.d.ts +27 -0
- package/dist/core/view-router.d.ts.map +1 -0
- package/dist/core/view-router.js +57 -0
- package/dist/core/view-router.js.map +1 -0
- package/dist/define/all.d.ts +13 -0
- package/dist/define/all.d.ts.map +1 -0
- package/dist/define/all.js +14 -0
- package/dist/define/all.js.map +1 -0
- package/dist/define/contracts.d.ts +2 -0
- package/dist/define/contracts.d.ts.map +1 -0
- package/dist/define/contracts.js +3 -0
- package/dist/define/contracts.js.map +1 -0
- package/dist/define/definitions.d.ts +3 -0
- package/dist/define/definitions.d.ts.map +1 -0
- package/dist/define/definitions.js +4 -0
- package/dist/define/definitions.js.map +1 -0
- package/dist/define/journal-table.d.ts +2 -0
- package/dist/define/journal-table.d.ts.map +1 -0
- package/dist/define/journal-table.js +3 -0
- package/dist/define/journal-table.js.map +1 -0
- package/dist/define/kpis.d.ts +2 -0
- package/dist/define/kpis.d.ts.map +1 -0
- package/dist/define/kpis.js +3 -0
- package/dist/define/kpis.js.map +1 -0
- package/dist/define/monitor.d.ts +2 -0
- package/dist/define/monitor.d.ts.map +1 -0
- package/dist/define/monitor.js +3 -0
- package/dist/define/monitor.js.map +1 -0
- package/dist/define/overview.d.ts +2 -0
- package/dist/define/overview.d.ts.map +1 -0
- package/dist/define/overview.js +3 -0
- package/dist/define/overview.js.map +1 -0
- package/dist/define/pipeline-graph.d.ts +2 -0
- package/dist/define/pipeline-graph.d.ts.map +1 -0
- package/dist/define/pipeline-graph.js +3 -0
- package/dist/define/pipeline-graph.js.map +1 -0
- package/dist/define/procs.d.ts +3 -0
- package/dist/define/procs.d.ts.map +1 -0
- package/dist/define/procs.js +4 -0
- package/dist/define/procs.js.map +1 -0
- package/dist/define/task-table.d.ts +2 -0
- package/dist/define/task-table.d.ts.map +1 -0
- package/dist/define/task-table.js +3 -0
- package/dist/define/task-table.js.map +1 -0
- package/dist/define/task-view.d.ts +2 -0
- package/dist/define/task-view.d.ts.map +1 -0
- package/dist/define/task-view.js +3 -0
- package/dist/define/task-view.js.map +1 -0
- package/dist/define/timeline.d.ts +2 -0
- package/dist/define/timeline.d.ts.map +1 -0
- package/dist/define/timeline.js +3 -0
- package/dist/define/timeline.js.map +1 -0
- package/dist/define/transcript.d.ts +2 -0
- package/dist/define/transcript.d.ts.map +1 -0
- package/dist/define/transcript.js +3 -0
- package/dist/define/transcript.js.map +1 -0
- package/dist/elements/lists/ca-contracts.d.ts +46 -0
- package/dist/elements/lists/ca-contracts.d.ts.map +1 -0
- package/dist/elements/lists/ca-contracts.js +199 -0
- package/dist/elements/lists/ca-contracts.js.map +1 -0
- package/dist/elements/lists/ca-definitions.d.ts +41 -0
- package/dist/elements/lists/ca-definitions.d.ts.map +1 -0
- package/dist/elements/lists/ca-definitions.js +182 -0
- package/dist/elements/lists/ca-definitions.js.map +1 -0
- package/dist/elements/lists/ca-journal-table.d.ts +37 -0
- package/dist/elements/lists/ca-journal-table.d.ts.map +1 -0
- package/dist/elements/lists/ca-journal-table.js +170 -0
- package/dist/elements/lists/ca-journal-table.js.map +1 -0
- package/dist/elements/lists/ca-panel-body.d.ts +42 -0
- package/dist/elements/lists/ca-panel-body.d.ts.map +1 -0
- package/dist/elements/lists/ca-panel-body.js +210 -0
- package/dist/elements/lists/ca-panel-body.js.map +1 -0
- package/dist/elements/lists/ca-panel-view.d.ts +21 -0
- package/dist/elements/lists/ca-panel-view.d.ts.map +1 -0
- package/dist/elements/lists/ca-panel-view.js +59 -0
- package/dist/elements/lists/ca-panel-view.js.map +1 -0
- package/dist/elements/lists/ca-proc-tree.d.ts +16 -0
- package/dist/elements/lists/ca-proc-tree.d.ts.map +1 -0
- package/dist/elements/lists/ca-proc-tree.js +63 -0
- package/dist/elements/lists/ca-proc-tree.js.map +1 -0
- package/dist/elements/lists/ca-procs-view.d.ts +27 -0
- package/dist/elements/lists/ca-procs-view.d.ts.map +1 -0
- package/dist/elements/lists/ca-procs-view.js +91 -0
- package/dist/elements/lists/ca-procs-view.js.map +1 -0
- package/dist/elements/lists/ca-task-table.d.ts +33 -0
- package/dist/elements/lists/ca-task-table.d.ts.map +1 -0
- package/dist/elements/lists/ca-task-table.js +115 -0
- package/dist/elements/lists/ca-task-table.js.map +1 -0
- package/dist/elements/lists/index.d.ts +9 -0
- package/dist/elements/lists/index.d.ts.map +1 -0
- package/dist/elements/lists/index.js +9 -0
- package/dist/elements/lists/index.js.map +1 -0
- package/dist/elements/overview/ca-kpis.d.ts +32 -0
- package/dist/elements/overview/ca-kpis.d.ts.map +1 -0
- package/dist/elements/overview/ca-kpis.js +62 -0
- package/dist/elements/overview/ca-kpis.js.map +1 -0
- package/dist/elements/overview/ca-model-usage.d.ts +25 -0
- package/dist/elements/overview/ca-model-usage.d.ts.map +1 -0
- package/dist/elements/overview/ca-model-usage.js +118 -0
- package/dist/elements/overview/ca-model-usage.js.map +1 -0
- package/dist/elements/overview/ca-overview.d.ts +67 -0
- package/dist/elements/overview/ca-overview.d.ts.map +1 -0
- package/dist/elements/overview/ca-overview.js +463 -0
- package/dist/elements/overview/ca-overview.js.map +1 -0
- package/dist/elements/overview/ca-pipeline-graph.d.ts +211 -0
- package/dist/elements/overview/ca-pipeline-graph.d.ts.map +1 -0
- package/dist/elements/overview/ca-pipeline-graph.js +616 -0
- package/dist/elements/overview/ca-pipeline-graph.js.map +1 -0
- package/dist/elements/overview/ca-quota.d.ts +42 -0
- package/dist/elements/overview/ca-quota.d.ts.map +1 -0
- package/dist/elements/overview/ca-quota.js +179 -0
- package/dist/elements/overview/ca-quota.js.map +1 -0
- package/dist/elements/overview/ca-run-driver.d.ts +33 -0
- package/dist/elements/overview/ca-run-driver.d.ts.map +1 -0
- package/dist/elements/overview/ca-run-driver.js +146 -0
- package/dist/elements/overview/ca-run-driver.js.map +1 -0
- package/dist/elements/overview/ca-services.d.ts +25 -0
- package/dist/elements/overview/ca-services.d.ts.map +1 -0
- package/dist/elements/overview/ca-services.js +77 -0
- package/dist/elements/overview/ca-services.js.map +1 -0
- package/dist/elements/overview/ca-spend-breakdown.d.ts +24 -0
- package/dist/elements/overview/ca-spend-breakdown.d.ts.map +1 -0
- package/dist/elements/overview/ca-spend-breakdown.js +108 -0
- package/dist/elements/overview/ca-spend-breakdown.js.map +1 -0
- package/dist/elements/overview/ca-timeline.d.ts +28 -0
- package/dist/elements/overview/ca-timeline.d.ts.map +1 -0
- package/dist/elements/overview/ca-timeline.js +72 -0
- package/dist/elements/overview/ca-timeline.js.map +1 -0
- package/dist/elements/overview/ca-workers.d.ts +23 -0
- package/dist/elements/overview/ca-workers.d.ts.map +1 -0
- package/dist/elements/overview/ca-workers.js +86 -0
- package/dist/elements/overview/ca-workers.js.map +1 -0
- package/dist/elements/overview/index.d.ts +11 -0
- package/dist/elements/overview/index.d.ts.map +1 -0
- package/dist/elements/overview/index.js +11 -0
- package/dist/elements/overview/index.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/actions.d.ts +16 -0
- package/dist/elements/overview/pipeline-graph/actions.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/actions.js +42 -0
- package/dist/elements/overview/pipeline-graph/actions.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/crumbs.d.ts +15 -0
- package/dist/elements/overview/pipeline-graph/crumbs.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/crumbs.js +70 -0
- package/dist/elements/overview/pipeline-graph/crumbs.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/host.d.ts +24 -0
- package/dist/elements/overview/pipeline-graph/host.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/host.js +2 -0
- package/dist/elements/overview/pipeline-graph/host.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/inspector.d.ts +5 -0
- package/dist/elements/overview/pipeline-graph/inspector.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/inspector.js +100 -0
- package/dist/elements/overview/pipeline-graph/inspector.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/outline.d.ts +53 -0
- package/dist/elements/overview/pipeline-graph/outline.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/outline.js +111 -0
- package/dist/elements/overview/pipeline-graph/outline.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/strings.d.ts +11 -0
- package/dist/elements/overview/pipeline-graph/strings.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/strings.js +49 -0
- package/dist/elements/overview/pipeline-graph/strings.js.map +1 -0
- package/dist/elements/overview/pipeline-graph/styles.d.ts +4 -0
- package/dist/elements/overview/pipeline-graph/styles.d.ts.map +1 -0
- package/dist/elements/overview/pipeline-graph/styles.js +96 -0
- package/dist/elements/overview/pipeline-graph/styles.js.map +1 -0
- package/dist/elements/shared/ca-definition.d.ts +26 -0
- package/dist/elements/shared/ca-definition.d.ts.map +1 -0
- package/dist/elements/shared/ca-definition.js +202 -0
- package/dist/elements/shared/ca-definition.js.map +1 -0
- package/dist/elements/shared/contract-parts.d.ts +35 -0
- package/dist/elements/shared/contract-parts.d.ts.map +1 -0
- package/dist/elements/shared/contract-parts.js +167 -0
- package/dist/elements/shared/contract-parts.js.map +1 -0
- package/dist/elements/shared/file-card.d.ts +17 -0
- package/dist/elements/shared/file-card.d.ts.map +1 -0
- package/dist/elements/shared/file-card.js +37 -0
- package/dist/elements/shared/file-card.js.map +1 -0
- package/dist/elements/shared/prompt-text.d.ts +5 -0
- package/dist/elements/shared/prompt-text.d.ts.map +1 -0
- package/dist/elements/shared/prompt-text.js +13 -0
- package/dist/elements/shared/prompt-text.js.map +1 -0
- package/dist/elements/shared/task-chip.d.ts +10 -0
- package/dist/elements/shared/task-chip.d.ts.map +1 -0
- package/dist/elements/shared/task-chip.js +19 -0
- package/dist/elements/shared/task-chip.js.map +1 -0
- package/dist/elements/shell/ca-clock.d.ts +13 -0
- package/dist/elements/shell/ca-clock.d.ts.map +1 -0
- package/dist/elements/shell/ca-clock.js +30 -0
- package/dist/elements/shell/ca-clock.js.map +1 -0
- package/dist/elements/shell/ca-hosts.d.ts +21 -0
- package/dist/elements/shell/ca-hosts.d.ts.map +1 -0
- package/dist/elements/shell/ca-hosts.js +97 -0
- package/dist/elements/shell/ca-hosts.js.map +1 -0
- package/dist/elements/shell/ca-monitor.d.ts +182 -0
- package/dist/elements/shell/ca-monitor.d.ts.map +1 -0
- package/dist/elements/shell/ca-monitor.js +549 -0
- package/dist/elements/shell/ca-monitor.js.map +1 -0
- package/dist/elements/shell/ca-run-picker.d.ts +71 -0
- package/dist/elements/shell/ca-run-picker.d.ts.map +1 -0
- package/dist/elements/shell/ca-run-picker.js +313 -0
- package/dist/elements/shell/ca-run-picker.js.map +1 -0
- package/dist/elements/shell/ca-theme-switch.d.ts +36 -0
- package/dist/elements/shell/ca-theme-switch.d.ts.map +1 -0
- package/dist/elements/shell/ca-theme-switch.js +186 -0
- package/dist/elements/shell/ca-theme-switch.js.map +1 -0
- package/dist/elements/shell/ca-toasts.d.ts +23 -0
- package/dist/elements/shell/ca-toasts.d.ts.map +1 -0
- package/dist/elements/shell/ca-toasts.js +88 -0
- package/dist/elements/shell/ca-toasts.js.map +1 -0
- package/dist/elements/shell/header.d.ts +13 -0
- package/dist/elements/shell/header.d.ts.map +1 -0
- package/dist/elements/shell/header.js +38 -0
- package/dist/elements/shell/header.js.map +1 -0
- package/dist/elements/shell/styles.d.ts +2 -0
- package/dist/elements/shell/styles.d.ts.map +1 -0
- package/dist/elements/shell/styles.js +72 -0
- package/dist/elements/shell/styles.js.map +1 -0
- package/dist/elements/shell/tabs.d.ts +32 -0
- package/dist/elements/shell/tabs.d.ts.map +1 -0
- package/dist/elements/shell/tabs.js +125 -0
- package/dist/elements/shell/tabs.js.map +1 -0
- package/dist/elements/shell/views.d.ts +27 -0
- package/dist/elements/shell/views.d.ts.map +1 -0
- package/dist/elements/shell/views.js +55 -0
- package/dist/elements/shell/views.js.map +1 -0
- package/dist/elements/task/ca-task-view.d.ts +55 -0
- package/dist/elements/task/ca-task-view.d.ts.map +1 -0
- package/dist/elements/task/ca-task-view.js +199 -0
- package/dist/elements/task/ca-task-view.js.map +1 -0
- package/dist/elements/task/ca-transcript.d.ts +74 -0
- package/dist/elements/task/ca-transcript.d.ts.map +1 -0
- package/dist/elements/task/ca-transcript.js +241 -0
- package/dist/elements/task/ca-transcript.js.map +1 -0
- package/dist/elements/task/context.d.ts +57 -0
- package/dist/elements/task/context.d.ts.map +1 -0
- package/dist/elements/task/context.js +61 -0
- package/dist/elements/task/context.js.map +1 -0
- package/dist/elements/task/header.d.ts +9 -0
- package/dist/elements/task/header.d.ts.map +1 -0
- package/dist/elements/task/header.js +291 -0
- package/dist/elements/task/header.js.map +1 -0
- package/dist/elements/task/index.d.ts +3 -0
- package/dist/elements/task/index.d.ts.map +1 -0
- package/dist/elements/task/index.js +3 -0
- package/dist/elements/task/index.js.map +1 -0
- package/dist/elements/task/inputs.d.ts +28 -0
- package/dist/elements/task/inputs.d.ts.map +1 -0
- package/dist/elements/task/inputs.js +27 -0
- package/dist/elements/task/inputs.js.map +1 -0
- package/dist/elements/task/panes/definition.d.ts +5 -0
- package/dist/elements/task/panes/definition.d.ts.map +1 -0
- package/dist/elements/task/panes/definition.js +5 -0
- package/dist/elements/task/panes/definition.js.map +1 -0
- package/dist/elements/task/panes/io.d.ts +8 -0
- package/dist/elements/task/panes/io.d.ts.map +1 -0
- package/dist/elements/task/panes/io.js +184 -0
- package/dist/elements/task/panes/io.js.map +1 -0
- package/dist/elements/task/panes/transcript.d.ts +5 -0
- package/dist/elements/task/panes/transcript.d.ts.map +1 -0
- package/dist/elements/task/panes/transcript.js +29 -0
- package/dist/elements/task/panes/transcript.js.map +1 -0
- package/dist/elements/task/styles.d.ts +2 -0
- package/dist/elements/task/styles.d.ts.map +1 -0
- package/dist/elements/task/styles.js +66 -0
- package/dist/elements/task/styles.js.map +1 -0
- package/dist/elements/trends/ca-trends.d.ts +55 -0
- package/dist/elements/trends/ca-trends.d.ts.map +1 -0
- package/dist/elements/trends/ca-trends.js +213 -0
- package/dist/elements/trends/ca-trends.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/tone.d.ts +29 -0
- package/dist/lib/tone.d.ts.map +1 -0
- package/dist/lib/tone.js +97 -0
- package/dist/lib/tone.js.map +1 -0
- package/dist/lib/trends.d.ts +15 -0
- package/dist/lib/trends.d.ts.map +1 -0
- package/dist/lib/trends.js +36 -0
- package/dist/lib/trends.js.map +1 -0
- package/dist/locales/codes.d.ts +14 -0
- package/dist/locales/codes.d.ts.map +1 -0
- package/dist/locales/codes.js +21 -0
- package/dist/locales/codes.js.map +1 -0
- package/dist/locales/ja.d.ts +785 -0
- package/dist/locales/ja.d.ts.map +1 -0
- package/dist/locales/ja.js +791 -0
- package/dist/locales/ja.js.map +1 -0
- package/dist/words/api-error.d.ts +4 -0
- package/dist/words/api-error.d.ts.map +1 -0
- package/dist/words/api-error.js +13 -0
- package/dist/words/api-error.js.map +1 -0
- package/dist/words/attempts.d.ts +17 -0
- package/dist/words/attempts.d.ts.map +1 -0
- package/dist/words/attempts.js +26 -0
- package/dist/words/attempts.js.map +1 -0
- package/dist/words/causes.d.ts +33 -0
- package/dist/words/causes.d.ts.map +1 -0
- package/dist/words/causes.js +58 -0
- package/dist/words/causes.js.map +1 -0
- package/dist/words/changes.d.ts +9 -0
- package/dist/words/changes.d.ts.map +1 -0
- package/dist/words/changes.js +23 -0
- package/dist/words/changes.js.map +1 -0
- package/dist/words/claims.d.ts +9 -0
- package/dist/words/claims.d.ts.map +1 -0
- package/dist/words/claims.js +12 -0
- package/dist/words/claims.js.map +1 -0
- package/dist/words/context.d.ts +18 -0
- package/dist/words/context.d.ts.map +1 -0
- package/dist/words/context.js +39 -0
- package/dist/words/context.js.map +1 -0
- package/dist/words/contract.d.ts +25 -0
- package/dist/words/contract.d.ts.map +1 -0
- package/dist/words/contract.js +52 -0
- package/dist/words/contract.js.map +1 -0
- package/dist/words/credential.d.ts +5 -0
- package/dist/words/credential.d.ts.map +1 -0
- package/dist/words/credential.js +7 -0
- package/dist/words/credential.js.map +1 -0
- package/dist/words/executor.d.ts +12 -0
- package/dist/words/executor.d.ts.map +1 -0
- package/dist/words/executor.js +20 -0
- package/dist/words/executor.js.map +1 -0
- package/dist/words/export.d.ts +8 -0
- package/dist/words/export.d.ts.map +1 -0
- package/dist/words/export.js +17 -0
- package/dist/words/export.js.map +1 -0
- package/dist/words/format.d.ts +36 -0
- package/dist/words/format.d.ts.map +1 -0
- package/dist/words/format.js +109 -0
- package/dist/words/format.js.map +1 -0
- package/dist/words/hops.d.ts +12 -0
- package/dist/words/hops.d.ts.map +1 -0
- package/dist/words/hops.js +27 -0
- package/dist/words/hops.js.map +1 -0
- package/dist/words/hosts.d.ts +18 -0
- package/dist/words/hosts.d.ts.map +1 -0
- package/dist/words/hosts.js +22 -0
- package/dist/words/hosts.js.map +1 -0
- package/dist/words/index.d.ts +28 -0
- package/dist/words/index.d.ts.map +1 -0
- package/dist/words/index.js +32 -0
- package/dist/words/index.js.map +1 -0
- package/dist/words/models.d.ts +10 -0
- package/dist/words/models.d.ts.map +1 -0
- package/dist/words/models.js +45 -0
- package/dist/words/models.js.map +1 -0
- package/dist/words/outcome.d.ts +14 -0
- package/dist/words/outcome.d.ts.map +1 -0
- package/dist/words/outcome.js +58 -0
- package/dist/words/outcome.js.map +1 -0
- package/dist/words/panels.d.ts +17 -0
- package/dist/words/panels.d.ts.map +1 -0
- package/dist/words/panels.js +63 -0
- package/dist/words/panels.js.map +1 -0
- package/dist/words/passes.d.ts +11 -0
- package/dist/words/passes.d.ts.map +1 -0
- package/dist/words/passes.js +13 -0
- package/dist/words/passes.js.map +1 -0
- package/dist/words/preflight.d.ts +28 -0
- package/dist/words/preflight.d.ts.map +1 -0
- package/dist/words/preflight.js +30 -0
- package/dist/words/preflight.js.map +1 -0
- package/dist/words/priority.d.ts +5 -0
- package/dist/words/priority.d.ts.map +1 -0
- package/dist/words/priority.js +7 -0
- package/dist/words/priority.js.map +1 -0
- package/dist/words/prompt.d.ts +10 -0
- package/dist/words/prompt.d.ts.map +1 -0
- package/dist/words/prompt.js +17 -0
- package/dist/words/prompt.js.map +1 -0
- package/dist/words/quota.d.ts +35 -0
- package/dist/words/quota.d.ts.map +1 -0
- package/dist/words/quota.js +102 -0
- package/dist/words/quota.js.map +1 -0
- package/dist/words/rests.d.ts +26 -0
- package/dist/words/rests.d.ts.map +1 -0
- package/dist/words/rests.js +77 -0
- package/dist/words/rests.js.map +1 -0
- package/dist/words/rounds.d.ts +14 -0
- package/dist/words/rounds.d.ts.map +1 -0
- package/dist/words/rounds.js +60 -0
- package/dist/words/rounds.js.map +1 -0
- package/dist/words/row-extras.d.ts +7 -0
- package/dist/words/row-extras.d.ts.map +1 -0
- package/dist/words/row-extras.js +26 -0
- package/dist/words/row-extras.js.map +1 -0
- package/dist/words/run-line.d.ts +40 -0
- package/dist/words/run-line.d.ts.map +1 -0
- package/dist/words/run-line.js +66 -0
- package/dist/words/run-line.js.map +1 -0
- package/dist/words/services.d.ts +16 -0
- package/dist/words/services.d.ts.map +1 -0
- package/dist/words/services.js +45 -0
- package/dist/words/services.js.map +1 -0
- package/dist/words/stop.d.ts +6 -0
- package/dist/words/stop.d.ts.map +1 -0
- package/dist/words/stop.js +69 -0
- package/dist/words/stop.js.map +1 -0
- package/dist/words/table.d.ts +4 -0
- package/dist/words/table.d.ts.map +1 -0
- package/dist/words/table.js +8 -0
- package/dist/words/table.js.map +1 -0
- package/dist/words/task-definition.d.ts +23 -0
- package/dist/words/task-definition.d.ts.map +1 -0
- package/dist/words/task-definition.js +27 -0
- package/dist/words/task-definition.js.map +1 -0
- package/dist/words/time-box.d.ts +8 -0
- package/dist/words/time-box.d.ts.map +1 -0
- package/dist/words/time-box.js +12 -0
- package/dist/words/time-box.js.map +1 -0
- package/dist/words/trends.d.ts +86 -0
- package/dist/words/trends.d.ts.map +1 -0
- package/dist/words/trends.js +104 -0
- package/dist/words/trends.js.map +1 -0
- package/docs/embed.md +121 -0
- package/docs/events.md +38 -0
- package/docs/examples/embed.html +31 -0
- package/docs/examples/journal.ts +32 -0
- package/docs/examples/live-transcript.ts +22 -0
- package/docs/examples/vite/index.html +30 -0
- package/docs/examples/vite/main.ts +23 -0
- package/docs/languages.md +48 -0
- package/docs/live-data.md +17 -0
- package/docs/theming.md +21 -0
- package/docs/tsconfig.json +14 -0
- package/package.json +131 -4
- package/src/adapters/check-rows.ts +81 -0
- package/src/adapters/filters.ts +76 -0
- package/src/adapters/graph/compound.ts +359 -0
- package/src/adapters/graph/flow-index.ts +154 -0
- package/src/adapters/graph/highlight.ts +40 -0
- package/src/adapters/graph/input.ts +236 -0
- package/src/adapters/graph/layer.ts +92 -0
- package/src/adapters/graph/matrix.ts +133 -0
- package/src/adapters/graph/plans.fixture.ts +194 -0
- package/src/adapters/graph/project.ts +358 -0
- package/src/adapters/graph/selection.ts +54 -0
- package/src/adapters/graph/states.ts +10 -0
- package/src/adapters/graph/types.ts +148 -0
- package/src/adapters/graph/words.ts +146 -0
- package/src/adapters/index.ts +22 -0
- package/src/adapters/journal-columns.ts +200 -0
- package/src/adapters/kpi-tiles.ts +211 -0
- package/src/adapters/lanes.ts +98 -0
- package/src/adapters/model-shares.ts +62 -0
- package/src/adapters/panel-body.ts +112 -0
- package/src/adapters/preflight.ts +27 -0
- package/src/adapters/task-columns.ts +120 -0
- package/src/adapters/transcript/index.ts +14 -0
- package/src/adapters/transcript/model.ts +156 -0
- package/src/adapters/transcript/rounds.ts +86 -0
- package/src/adapters/transcript/sections.ts +82 -0
- package/src/adapters/transcript/web.ts +40 -0
- package/src/adapters/transcript/who.ts +53 -0
- package/src/adapters/trends.ts +337 -0
- package/src/controllers/locale.ts +47 -0
- package/src/controllers/shortcuts.ts +69 -0
- package/src/controllers/stream.ts +103 -0
- package/src/controllers/task-detail.ts +54 -0
- package/src/controllers/theme.ts +73 -0
- package/src/core/events.ts +120 -0
- package/src/core/i18n.ts +76 -0
- package/src/core/index.ts +6 -0
- package/src/core/memory.ts +177 -0
- package/src/core/scroll.ts +73 -0
- package/src/core/view-route.ts +177 -0
- package/src/core/view-router.ts +66 -0
- package/src/define/all.ts +13 -0
- package/src/define/contracts.ts +2 -0
- package/src/define/definitions.ts +3 -0
- package/src/define/journal-table.ts +2 -0
- package/src/define/kpis.ts +2 -0
- package/src/define/monitor.ts +2 -0
- package/src/define/overview.ts +2 -0
- package/src/define/pipeline-graph.ts +2 -0
- package/src/define/procs.ts +3 -0
- package/src/define/task-table.ts +2 -0
- package/src/define/task-view.ts +2 -0
- package/src/define/timeline.ts +2 -0
- package/src/define/transcript.ts +2 -0
- package/src/elements/lists/ca-contracts.ts +204 -0
- package/src/elements/lists/ca-definitions.ts +170 -0
- package/src/elements/lists/ca-journal-table.ts +141 -0
- package/src/elements/lists/ca-panel-body.ts +200 -0
- package/src/elements/lists/ca-panel-view.ts +50 -0
- package/src/elements/lists/ca-proc-tree.ts +57 -0
- package/src/elements/lists/ca-procs-view.ts +89 -0
- package/src/elements/lists/ca-task-table.ts +94 -0
- package/src/elements/lists/index.ts +8 -0
- package/src/elements/overview/ca-kpis.ts +51 -0
- package/src/elements/overview/ca-model-usage.ts +113 -0
- package/src/elements/overview/ca-overview.ts +499 -0
- package/src/elements/overview/ca-pipeline-graph.ts +617 -0
- package/src/elements/overview/ca-quota.ts +164 -0
- package/src/elements/overview/ca-run-driver.ts +140 -0
- package/src/elements/overview/ca-services.ts +66 -0
- package/src/elements/overview/ca-spend-breakdown.ts +107 -0
- package/src/elements/overview/ca-timeline.ts +57 -0
- package/src/elements/overview/ca-workers.ts +82 -0
- package/src/elements/overview/index.ts +10 -0
- package/src/elements/overview/pipeline-graph/actions.ts +45 -0
- package/src/elements/overview/pipeline-graph/crumbs.ts +75 -0
- package/src/elements/overview/pipeline-graph/host.ts +26 -0
- package/src/elements/overview/pipeline-graph/inspector.ts +104 -0
- package/src/elements/overview/pipeline-graph/outline.ts +150 -0
- package/src/elements/overview/pipeline-graph/strings.ts +53 -0
- package/src/elements/overview/pipeline-graph/styles.ts +97 -0
- package/src/elements/shared/ca-definition.ts +206 -0
- package/src/elements/shared/contract-parts.ts +174 -0
- package/src/elements/shared/file-card.ts +49 -0
- package/src/elements/shared/prompt-text.ts +13 -0
- package/src/elements/shared/task-chip.ts +18 -0
- package/src/elements/shell/ca-clock.ts +27 -0
- package/src/elements/shell/ca-hosts.ts +93 -0
- package/src/elements/shell/ca-monitor.ts +528 -0
- package/src/elements/shell/ca-run-picker.ts +284 -0
- package/src/elements/shell/ca-theme-switch.ts +170 -0
- package/src/elements/shell/ca-toasts.ts +100 -0
- package/src/elements/shell/header.ts +45 -0
- package/src/elements/shell/styles.ts +72 -0
- package/src/elements/shell/tabs.ts +143 -0
- package/src/elements/shell/views.ts +67 -0
- package/src/elements/task/ca-task-view.ts +157 -0
- package/src/elements/task/ca-transcript.ts +214 -0
- package/src/elements/task/context.ts +105 -0
- package/src/elements/task/header.ts +296 -0
- package/src/elements/task/index.ts +2 -0
- package/src/elements/task/inputs.ts +46 -0
- package/src/elements/task/panes/definition.ts +7 -0
- package/src/elements/task/panes/io.ts +190 -0
- package/src/elements/task/panes/transcript.ts +29 -0
- package/src/elements/task/styles.ts +66 -0
- package/src/elements/trends/ca-trends.ts +204 -0
- package/src/index.ts +23 -0
- package/src/lib/tone.ts +109 -0
- package/src/lib/trends.ts +44 -0
- package/src/locales/codes.ts +23 -0
- package/src/locales/ja.ts +795 -0
- package/src/words/api-error.ts +17 -0
- package/src/words/attempts.ts +28 -0
- package/src/words/causes.ts +67 -0
- package/src/words/changes.ts +29 -0
- package/src/words/claims.ts +16 -0
- package/src/words/context.ts +47 -0
- package/src/words/contract.ts +63 -0
- package/src/words/credential.ts +8 -0
- package/src/words/executor.ts +22 -0
- package/src/words/export.ts +22 -0
- package/src/words/format.ts +107 -0
- package/src/words/hops.ts +30 -0
- package/src/words/hosts.ts +37 -0
- package/src/words/index.ts +31 -0
- package/src/words/models.ts +50 -0
- package/src/words/outcome.ts +61 -0
- package/src/words/panels.ts +71 -0
- package/src/words/passes.ts +18 -0
- package/src/words/preflight.ts +53 -0
- package/src/words/priority.ts +8 -0
- package/src/words/prompt.ts +20 -0
- package/src/words/quota.ts +108 -0
- package/src/words/rests.ts +96 -0
- package/src/words/rounds.ts +56 -0
- package/src/words/row-extras.ts +24 -0
- package/src/words/run-line.ts +77 -0
- package/src/words/services.ts +57 -0
- package/src/words/stop.ts +65 -0
- package/src/words/table.ts +10 -0
- package/src/words/task-definition.ts +37 -0
- package/src/words/time-box.ts +21 -0
- package/src/words/trends.ts +118 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// A request to the monitor's API that got no JSON answer, in words: the URL and
|
|
2
|
+
// the cause (render time: msg()).
|
|
3
|
+
import type { ApiError } from '@contraagent/api';
|
|
4
|
+
import { msg, str } from '@lit/localize';
|
|
5
|
+
|
|
6
|
+
/** "No monitor API at http://host/api/runs: the response is HTML, not JSON". */
|
|
7
|
+
export function apiErrorLine({ url, failure, status, type }: ApiError): string {
|
|
8
|
+
const why =
|
|
9
|
+
failure === 'network'
|
|
10
|
+
? msg('network error, no response')
|
|
11
|
+
: failure === 'status'
|
|
12
|
+
? msg(str`the response status is ${status}`)
|
|
13
|
+
: type.includes('html')
|
|
14
|
+
? msg('the response is HTML, not JSON')
|
|
15
|
+
: msg('the response is not JSON');
|
|
16
|
+
return msg(str`No monitor API at ${url}: ${why}`);
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Attempts and corrections, as the reader counts them.
|
|
2
|
+
import { runStarts } from '@contraagent/api';
|
|
3
|
+
import { msg, str } from '@lit/localize';
|
|
4
|
+
import { facts, localTime } from './format.js';
|
|
5
|
+
|
|
6
|
+
/** What a retry is, for tooltips and the transcript's legend. */
|
|
7
|
+
export const retryTip = (): string => msg('An attempt after a failed attempt (retries)');
|
|
8
|
+
|
|
9
|
+
/** The attempt as the reader counts it: "Attempt 1", "Attempt 2" ... (`JournalRow.attempt` is 0-based). */
|
|
10
|
+
export const attemptLabel = (attempt: number | null | undefined): string => msg(str`Attempt ${(attempt ?? 0) + 1}`);
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The names of one task's attempts that ran (its journal rows in order): "Attempt 1",
|
|
14
|
+
* and "Attempt 1 | resumed run" for an attempt of a later start of the run (`runStarts`).
|
|
15
|
+
* Where two names are still the same (a run resumed more than once), each also gets
|
|
16
|
+
* the time its attempt ended.
|
|
17
|
+
*/
|
|
18
|
+
export function attemptNames(rows: readonly { attempt?: number | null | undefined; ts: string }[]): string[] {
|
|
19
|
+
const starts = runStarts(rows);
|
|
20
|
+
const names = rows.map((r, i) => (starts[i] ? facts(attemptLabel(r.attempt), msg('resumed run')) : attemptLabel(r.attempt)));
|
|
21
|
+
return names.map((n, i) => (names.indexOf(n) === names.lastIndexOf(n) ? n : facts(n, localTime(rows[i]?.ts))));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** `1 correction`, `3 corrections`; '' for none. */
|
|
25
|
+
export function correctionsText(n: number): string {
|
|
26
|
+
if (n <= 0) return '';
|
|
27
|
+
return n === 1 ? msg('1 correction') : msg(str`${n} corrections`);
|
|
28
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Why a task waits or did not start, as a phrase that names the cause the data
|
|
2
|
+
// has: the earlier task, the input and what happened to the task that writes it.
|
|
3
|
+
import { inputProblems, isFinished, runRelative, type InputProblem, type Outcome, type TaskOutcome } from '@contraagent/api';
|
|
4
|
+
import { msg, str } from '@lit/localize';
|
|
5
|
+
import { kindUnit } from './format.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Why a waiting task has not run, as a phrase that starts in lower case: the
|
|
9
|
+
* earlier task it waits for (`waits for output of review · zeta`), or how many
|
|
10
|
+
* (`waits for output of 3 earlier tasks`); '' for none.
|
|
11
|
+
*/
|
|
12
|
+
export function waitCause(waits: readonly { kind?: string | null; unit?: string | null }[]): string {
|
|
13
|
+
const first = waits[0];
|
|
14
|
+
if (!first) return '';
|
|
15
|
+
return waits.length === 1 ? msg(str`waits for output of ${kindUnit(first)}`) : msg(str`waits for output of ${waits.length} earlier tasks`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The task that writes an input, as far as the run knows it. */
|
|
19
|
+
export interface InputSource {
|
|
20
|
+
/** `kind · unit`. */
|
|
21
|
+
name: string;
|
|
22
|
+
/** What happened to it, when known. */
|
|
23
|
+
outcome?: Outcome | undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Why an input stopped a task, in one phrase that starts in lower case:
|
|
28
|
+
* `input out/review/zeta.json is missing because review · zeta failed`,
|
|
29
|
+
* `input out/a.json failed checks`, `input out/review/zeta.json is the output of
|
|
30
|
+
* failed task review · zeta`. `path` is already shown run-relative.
|
|
31
|
+
*/
|
|
32
|
+
export function inputCause(path: string, problem: InputProblem['problem'], from?: InputSource): string {
|
|
33
|
+
if (problem === 'failed')
|
|
34
|
+
return from ? msg(str`input ${path} is the output of failed task ${from.name}`) : msg(str`input ${path} is the output of a failed task`);
|
|
35
|
+
if (problem === 'checks') return from ? msg(str`input ${path} from ${from.name} failed checks`) : msg(str`input ${path} failed checks`);
|
|
36
|
+
if (!from) return msg(str`input ${path} is missing`);
|
|
37
|
+
if (from.outcome === 'failed') return msg(str`input ${path} is missing because ${from.name} failed`);
|
|
38
|
+
if (from.outcome === 'not_started') return msg(str`input ${path} is missing because ${from.name} did not start`);
|
|
39
|
+
if (from.outcome && isFinished(from.outcome))
|
|
40
|
+
return msg(str`input ${path} from ${from.name} is missing`);
|
|
41
|
+
return msg(str`input ${path} is missing because ${from.name} did not finish`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Why a task did not start, as a phrase after "Not started: ": the input its
|
|
46
|
+
* refusal names and why that input is not ready (`input out/review/zeta.json is
|
|
47
|
+
* missing because review · zeta failed`), or the earlier task that failed and
|
|
48
|
+
* stopped it (`earlier task review · zeta failed`); '' when the run does not tell.
|
|
49
|
+
* `writerOf` names the task that writes a path, for a reason that names none.
|
|
50
|
+
*/
|
|
51
|
+
export function notStartedCause(
|
|
52
|
+
t: Pick<TaskOutcome, 'attempts' | 'cause'>,
|
|
53
|
+
outcomes: ReadonlyMap<string, TaskOutcome>,
|
|
54
|
+
run: string,
|
|
55
|
+
writerOf?: (path: string) => string | undefined,
|
|
56
|
+
): string {
|
|
57
|
+
const last = t.attempts[t.attempts.length - 1];
|
|
58
|
+
if (last?.stop === 'invalid_input') {
|
|
59
|
+
const p = inputProblems(last.reason)[0];
|
|
60
|
+
if (!p) return runRelative(last.reason, run);
|
|
61
|
+
const key = p.producer || writerOf?.(p.path) || '';
|
|
62
|
+
const w = key ? outcomes.get(key) : undefined;
|
|
63
|
+
return inputCause(runRelative(p.path, run), p.problem, w ? { name: kindUnit(w), outcome: w.outcome } : undefined);
|
|
64
|
+
}
|
|
65
|
+
const c = t.cause ? outcomes.get(t.cause) : undefined;
|
|
66
|
+
return c ? msg(str`earlier task ${kindUnit(c)} failed`) : '';
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Words for a task's changes: the files an attempt created, modified or deleted under
|
|
2
|
+
// the patterns its task declares (`changes` in a journal row).
|
|
3
|
+
import { msg, str } from '@lit/localize';
|
|
4
|
+
|
|
5
|
+
/** What happened to one file in one attempt. `removed`: it created the file, and the file was removed because the attempt failed; `kept`: it created the file, and the file stayed though the attempt failed (`keep_failed_changes`). */
|
|
6
|
+
export type ChangeKind = 'created' | 'modified' | 'deleted' | 'removed' | 'kept';
|
|
7
|
+
|
|
8
|
+
/** `1 changed file`, `3 changed files`. */
|
|
9
|
+
export const changedFiles = (n: number): string => (n === 1 ? msg('1 changed file') : msg(str`${n} changed files`));
|
|
10
|
+
|
|
11
|
+
/** What a task's changed files are, for a tooltip. */
|
|
12
|
+
export const changedFilesTip = (): string =>
|
|
13
|
+
msg("Files under the task's declared patterns that its attempts created, modified or deleted (changes)");
|
|
14
|
+
|
|
15
|
+
/** What happened to a file, in words. */
|
|
16
|
+
export function changeLabel(kind: ChangeKind): string {
|
|
17
|
+
switch (kind) {
|
|
18
|
+
case 'created':
|
|
19
|
+
return msg('created');
|
|
20
|
+
case 'modified':
|
|
21
|
+
return msg('modified');
|
|
22
|
+
case 'deleted':
|
|
23
|
+
return msg('deleted');
|
|
24
|
+
case 'removed':
|
|
25
|
+
return msg('created, removed after the failed attempt');
|
|
26
|
+
case 'kept':
|
|
27
|
+
return msg('created, kept after the failed attempt');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Words for a task's claims: the names it holds while it runs (`claims`), shown as its locks.
|
|
2
|
+
import { msg, str } from '@lit/localize';
|
|
3
|
+
import { facts, listText } from './format.js';
|
|
4
|
+
|
|
5
|
+
/** The label before a task's claims. */
|
|
6
|
+
export const locksLabel = (): string => msg('Locks');
|
|
7
|
+
|
|
8
|
+
/** What a task's claims are, for a tooltip. */
|
|
9
|
+
export const locksTip = (): string => msg('Names this task holds while it runs (claims)');
|
|
10
|
+
|
|
11
|
+
/** A task's claims in a row of the tasks list: by name, or how many when more than two. */
|
|
12
|
+
export const locksShort = (names: readonly string[]): string =>
|
|
13
|
+
names.length > 2 ? msg(str`Locks ${names.length} names`) : msg(str`Locks ${listText(names)}`);
|
|
14
|
+
|
|
15
|
+
/** The tooltip of `locksShort`: what they are, and every name. */
|
|
16
|
+
export const locksNames = (names: readonly string[]): string => facts(locksTip(), listText(names));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Words for the peak context: the whole input of the largest API call of an attempt
|
|
2
|
+
// (`usage.peak_context`), against its kind's context limit (`context_budget`).
|
|
3
|
+
import type { JournalRow } from '@contraagent/api';
|
|
4
|
+
import { msg, str } from '@lit/localize';
|
|
5
|
+
import { facts, tokenCount } from './format.js';
|
|
6
|
+
|
|
7
|
+
/** The label before a peak context. */
|
|
8
|
+
export const peakContextLabel = (): string => msg('Peak context');
|
|
9
|
+
|
|
10
|
+
/** What a peak context is, for its tooltip. */
|
|
11
|
+
export const peakContextTip = (): string => msg('Largest input of one API call, cache read and cache write included (peak_context)');
|
|
12
|
+
|
|
13
|
+
/** A peak context, then its share of the context limit when one is set: `142k | 71% of the context limit 200k`. */
|
|
14
|
+
export function peakContextText(peak: number, budget?: number | null): string {
|
|
15
|
+
const share = budget ? Math.round((100 * peak) / budget) : null;
|
|
16
|
+
return facts(tokenCount(peak), share === null ? '' : msg(str`${share}% of the context limit ${tokenCount(budget)}`));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** An attempt's peak context with its label (`Peak context: 142k | 71% of ...`); '' when it reported none. */
|
|
20
|
+
export function peakContextLine(r: Pick<JournalRow, 'usage' | 'context_budget'>): string {
|
|
21
|
+
const peak = r.usage?.peak_context;
|
|
22
|
+
return peak == null ? '' : msg(str`Peak context: ${peakContextText(peak, r.context_budget)}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The state of an attempt whose peak context passed the warning share of its context limit (`context_warned`). */
|
|
26
|
+
export const contextWarnedLabel = (): string => msg('near the context limit');
|
|
27
|
+
|
|
28
|
+
/** That state with the share of the limit when known: `near the context limit (91%)`. */
|
|
29
|
+
export function contextWarnedText(r: Pick<JournalRow, 'usage' | 'context_budget'>): string {
|
|
30
|
+
const peak = r.usage?.peak_context;
|
|
31
|
+
const budget = r.context_budget;
|
|
32
|
+
if (peak == null || !budget) return contextWarnedLabel();
|
|
33
|
+
return msg(str`near the context limit (${Math.round((100 * peak) / budget)}%)`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** What that state means, for its tooltip. */
|
|
37
|
+
export const contextWarnedTip = (): string => msg('Peak context above the warning threshold (context_warned)');
|
|
38
|
+
|
|
39
|
+
/** Of `tries`, the one with the largest peak context; null when none reported one. */
|
|
40
|
+
export function peakTry<T extends Pick<JournalRow, 'usage'>>(tries: readonly T[]): T | null {
|
|
41
|
+
let best: T | null = null;
|
|
42
|
+
for (const r of tries) {
|
|
43
|
+
const p = r.usage?.peak_context;
|
|
44
|
+
if (p != null && (best === null || p > (best.usage?.peak_context ?? 0))) best = r;
|
|
45
|
+
}
|
|
46
|
+
return best;
|
|
47
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// A contract file's status and its causes, in words (the UI says "checked
|
|
2
|
+
// file"; packages/ui/WORDS.md).
|
|
3
|
+
import { inputProblems, runRelative, type ContractSpec, type ContractStatus, type Outcome } from '@contraagent/api';
|
|
4
|
+
import { msg, str } from '@lit/localize';
|
|
5
|
+
import { inputCause } from './causes.js';
|
|
6
|
+
import { sentence } from './format.js';
|
|
7
|
+
|
|
8
|
+
/** A contract status in words, in the current locale. */
|
|
9
|
+
export function contractStatusLabel(s: ContractStatus): string {
|
|
10
|
+
switch (s) {
|
|
11
|
+
case 'valid':
|
|
12
|
+
return msg('passed');
|
|
13
|
+
case 'invalid':
|
|
14
|
+
return msg('failed checks');
|
|
15
|
+
case 'refused':
|
|
16
|
+
return msg('not written (task not started)');
|
|
17
|
+
case 'failed':
|
|
18
|
+
return msg('not written (task failed)');
|
|
19
|
+
case 'running':
|
|
20
|
+
return msg('not written yet (task running)');
|
|
21
|
+
case 'pending':
|
|
22
|
+
return msg('not written yet (task waiting)');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A fact a contract's status word does not say, for its tooltip; '' when the word says it all. */
|
|
27
|
+
export function contractStatusWhy(s: ContractStatus): string {
|
|
28
|
+
return s === 'failed' ? msg('The task failed before it wrote a file that passes its checks') : '';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** What a correction is, for tooltips. */
|
|
32
|
+
export const correctionTip = (): string => msg('Another round in the same agent session after failed checks (rounds)');
|
|
33
|
+
|
|
34
|
+
/** How many corrections a file took (`rounds` counts the first round too), in words; '' for none. */
|
|
35
|
+
export function correctionsLabel(rounds: number | null | undefined, passed: boolean): string {
|
|
36
|
+
const n = (rounds ?? 1) - 1;
|
|
37
|
+
if (n < 1) return '';
|
|
38
|
+
if (passed) return n === 1 ? msg('after 1 correction') : msg(str`after ${n} corrections`);
|
|
39
|
+
return n === 1 ? msg('1 correction') : msg(str`${n} corrections`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Who writes a file, for naming the task an input should have come from. */
|
|
43
|
+
export interface Producer {
|
|
44
|
+
/** "kind · unit" of the task that writes it. */
|
|
45
|
+
name: string;
|
|
46
|
+
/** The file exists now. */
|
|
47
|
+
written: boolean;
|
|
48
|
+
/** What happened to that task, when known. */
|
|
49
|
+
outcome?: Outcome | undefined;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Why a task never ran, in one line beside its status: the input it was refused
|
|
54
|
+
* for (from its check errors) and, when known, the task that should have written it;
|
|
55
|
+
* '' when the run records no input error.
|
|
56
|
+
*/
|
|
57
|
+
export function notRunText(o: ContractSpec, run: string, producerOf?: (path: string) => Producer | undefined): string {
|
|
58
|
+
const errors = o.errors ?? [];
|
|
59
|
+
const p = inputProblems(`invalid input: ${errors.map((e) => e.replace(/^invalid input:\s*/, '')).join('; ')}`)[0];
|
|
60
|
+
if (!p) return errors[0] ? sentence(runRelative(errors[0], run)) : '';
|
|
61
|
+
const from = producerOf?.(p.path);
|
|
62
|
+
return sentence(inputCause(runRelative(p.path, run), p.problem, from));
|
|
63
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// A credential as the reader knows it (shown as "identity").
|
|
2
|
+
import { msg } from '@lit/localize';
|
|
3
|
+
|
|
4
|
+
/** A credential as the reader knows it: the built-in `ambient` shows as "default". */
|
|
5
|
+
export const credentialLabel = (c: string | null | undefined): string => (!c ? '' : c === 'ambient' ? msg('default') : c);
|
|
6
|
+
|
|
7
|
+
/** What a credential's label leaves out, for its tooltip: the built-in `ambient` is the local credentials. */
|
|
8
|
+
export const credentialTip = (c: string | null | undefined): string => (c === 'ambient' ? msg('local credentials (ambient)') : '');
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// What ran a task, as a small icon before its name: ✦ an agent task, ⚙ a Python task.
|
|
2
|
+
import { icon } from '@contraagent/elements/primitives';
|
|
3
|
+
import { css, type TemplateResult } from 'lit';
|
|
4
|
+
|
|
5
|
+
/** The glyph of who runs a task. */
|
|
6
|
+
export const executorGlyph = (python: boolean): string => (python ? '⚙' : '✦');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Who ran a task, as an icon (`.k-ic`, `.k-ic.llm` for an agent task, unless `cls`
|
|
10
|
+
* names other classes). With a label, the label is its tooltip and what a screen
|
|
11
|
+
* reader reads; without one, it is hidden from screen readers.
|
|
12
|
+
*/
|
|
13
|
+
export function executorIcon(python: boolean, label?: string | null, cls?: string): TemplateResult {
|
|
14
|
+
return icon(executorGlyph(python), label, { cls: cls ?? `k-ic ${python ? '' : 'llm'}` });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Who ran it (identity, a small cue): `.k-ic` for a Python task, `.k-ic.llm` for an agent task. */
|
|
18
|
+
export const executorIconStyles = css`
|
|
19
|
+
.k-ic { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; margin-right: 7px;
|
|
20
|
+
font-size: var(--font-size-sm); background: var(--raise); color: var(--text-muted); flex: none; }
|
|
21
|
+
.k-ic.llm { background: var(--agent-bg); color: var(--agent); }
|
|
22
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Words for an export (`contraagent monitor export`, `Info.export`): the monitor
|
|
2
|
+
// read from files, with no server.
|
|
3
|
+
import type { ExportInfo } from '@contraagent/api';
|
|
4
|
+
import { msg, str } from '@lit/localize';
|
|
5
|
+
import { listText, localTime } from './format.js';
|
|
6
|
+
|
|
7
|
+
/** The header's mark of an export: when it was written. */
|
|
8
|
+
export const exportedLabel = (e: ExportInfo): string =>
|
|
9
|
+
msg(str`Exported ${localTime(e.exported_at, true)}`, { desc: 'The monitor shows files written at this time, not a live server' });
|
|
10
|
+
|
|
11
|
+
/** A view an export does not hold, in words. */
|
|
12
|
+
function leftOutLabel(view: string): string {
|
|
13
|
+
if (view === 'transcripts') return msg('transcripts');
|
|
14
|
+
if (view === 'processes') return msg('processes');
|
|
15
|
+
return view;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** What the export does not hold, for the mark's tooltip: "Not in this export: transcripts, processes". */
|
|
19
|
+
export const exportTip = (e: ExportInfo): string => msg(str`Not in this export: ${listText(e.left_out.map(leftOutLabel))}`);
|
|
20
|
+
|
|
21
|
+
/** Beside an empty view: what it would show is not in the export. */
|
|
22
|
+
export const notInExport = (): string => msg('not in this export');
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Durations, times and small text helpers shared by the views.
|
|
2
|
+
import { msg, str } from '@lit/localize';
|
|
3
|
+
import { getLocale } from '../core/i18n.js';
|
|
4
|
+
|
|
5
|
+
// The formats that read the same in every language are the generic package's.
|
|
6
|
+
export { esc, fmtDur } from '@contraagent/elements';
|
|
7
|
+
|
|
8
|
+
const formats = new Map<string, Intl.DateTimeFormat>();
|
|
9
|
+
function formatter(locale: string, withDate: boolean): Intl.DateTimeFormat {
|
|
10
|
+
const id = `${locale}|${withDate}`;
|
|
11
|
+
let f = formats.get(id);
|
|
12
|
+
if (!f) {
|
|
13
|
+
f = new Intl.DateTimeFormat(locale, {
|
|
14
|
+
...(withDate ? { month: 'short', day: 'numeric' } : {}),
|
|
15
|
+
hour: '2-digit',
|
|
16
|
+
minute: '2-digit',
|
|
17
|
+
second: '2-digit',
|
|
18
|
+
hourCycle: 'h23',
|
|
19
|
+
});
|
|
20
|
+
formats.set(id, f);
|
|
21
|
+
}
|
|
22
|
+
return f;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* An ISO time in the reader's time zone, as the UI locale writes it: `10:38:40`,
|
|
27
|
+
* or with the date `Oct 12, 10:38:40` (the month as a word, so no reader takes
|
|
28
|
+
* the day for the month). '' when there is no time.
|
|
29
|
+
*/
|
|
30
|
+
export function localTime(ts: string | null | undefined, withDate = false, locale: string = getLocale()): string {
|
|
31
|
+
if (!ts) return '';
|
|
32
|
+
const d = new Date(ts);
|
|
33
|
+
if (Number.isNaN(d.getTime())) return ts;
|
|
34
|
+
return formatter(locale, withDate).format(d);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** An ISO time as `just now`, `5m ago`, `3h ago`, `2d ago` (the run picker only; rows and chips show `localTime`). */
|
|
38
|
+
export function relAgo(iso: string | null | undefined, now = Date.now()): string {
|
|
39
|
+
const t = Date.parse(iso || '');
|
|
40
|
+
if (Number.isNaN(t)) return '';
|
|
41
|
+
const s = Math.max(0, (now - t) / 1000);
|
|
42
|
+
if (s < 60) return msg('just now');
|
|
43
|
+
if (s < 3600) return msg(str`${Math.floor(s / 60)}m ago`);
|
|
44
|
+
if (s < 86400) return msg(str`${Math.floor(s / 3600)}h ago`);
|
|
45
|
+
return msg(str`${Math.floor(s / 86400)}d ago`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** `s` as a sentence on its own: its first letter upper-cased (a phrase that also follows a colon starts lower case). */
|
|
49
|
+
export const sentence = (s: string): string => s.charAt(0).toLocaleUpperCase(getLocale()) + s.slice(1);
|
|
50
|
+
|
|
51
|
+
/** The facts of one row, chip or line, in order, without the empty ones (for `factLine`). */
|
|
52
|
+
export const factList = (...xs: (string | null | undefined | false)[]): string[] => xs.filter((x): x is string => !!x);
|
|
53
|
+
|
|
54
|
+
/** Facts of one row, chip or line, in order: `attempt 1 | done | 0.2s`. Empty facts are left out. */
|
|
55
|
+
export const facts = (...xs: (string | null | undefined | false)[]): string => factList(...xs).join(' | ');
|
|
56
|
+
|
|
57
|
+
const lists = new Map<string, Intl.ListFormat>();
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Words a reader reads as a list, as the UI locale writes one: `Pass 1, Pass 2, and Pass 3`
|
|
61
|
+
* in English, `1 周目、2 周目、3 周目` in Japanese. Codes and identifiers are joined with `, ` instead.
|
|
62
|
+
*/
|
|
63
|
+
export function listText(items: readonly string[], locale: string = getLocale()): string {
|
|
64
|
+
let f = lists.get(locale);
|
|
65
|
+
if (!f) {
|
|
66
|
+
f = new Intl.ListFormat(locale, { type: 'conjunction' });
|
|
67
|
+
lists.set(locale, f);
|
|
68
|
+
}
|
|
69
|
+
return f.format(items);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** `kind · unit`, or the bare kind for a run-scope task. */
|
|
73
|
+
export const kindUnit = (x: { kind?: string | null | undefined; unit?: string | null | undefined }, sep = ' · '): string =>
|
|
74
|
+
`${x.kind ?? ''}${x.unit ? sep + x.unit : ''}`;
|
|
75
|
+
|
|
76
|
+
/** The first line of a text, cut at 100 characters. */
|
|
77
|
+
export function firstLine(s: string | null | undefined): string {
|
|
78
|
+
const t = (s || '').trim();
|
|
79
|
+
if (!t) return '';
|
|
80
|
+
const l = (t.split('\n')[0] || '').trim();
|
|
81
|
+
return l.length > 100 ? `${l.slice(0, 100)}…` : l;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** A token count, compact: `950`, `1.2k`, `34k`, `1.3M`. */
|
|
85
|
+
export function tokenCount(n: number | null | undefined): string {
|
|
86
|
+
const v = n ?? 0;
|
|
87
|
+
if (v < 1000) return String(Math.round(v));
|
|
88
|
+
if (v < 10_000) return `${(v / 1000).toFixed(1).replace(/\.0$/, '')}k`;
|
|
89
|
+
if (v < 1_000_000) return `${Math.round(v / 1000)}k`;
|
|
90
|
+
return `${(v / 1_000_000).toFixed(1).replace(/\.0$/, '')}M`;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A cost in USD: `$0.041`, `$1.23`, `<$0.001`; '—' when none was reported. */
|
|
94
|
+
export function usd(v: number | null | undefined): string {
|
|
95
|
+
if (v === null || v === undefined) return '—';
|
|
96
|
+
if (v === 0) return '$0';
|
|
97
|
+
if (v < 0.001) return '<$0.001';
|
|
98
|
+
if (v < 1) return `$${v.toFixed(3)}`; // fixed decimals, so columns of costs line up
|
|
99
|
+
return `$${v.toFixed(2)}`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** A row's unread event types with their counts (`session_settled ×2, x ×1`); '' when none. */
|
|
103
|
+
export function unreadEvents(rows: readonly { unread_events?: Record<string, number> | null }[]): string {
|
|
104
|
+
const total = new Map<string, number>();
|
|
105
|
+
for (const r of rows) for (const [k, n] of Object.entries(r.unread_events ?? {})) total.set(k, (total.get(k) ?? 0) + n);
|
|
106
|
+
return [...total].map(([k, n]) => `${k} ×${n}`).join(', ');
|
|
107
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// A model switch (the hops of one attempt), in words.
|
|
2
|
+
import type { Hop, SkippedHop } from '@contraagent/api';
|
|
3
|
+
import { msg, str } from '@lit/localize';
|
|
4
|
+
import { fmtDur } from './format.js';
|
|
5
|
+
import { skippedHopStep } from './rests.js';
|
|
6
|
+
import { stopLabel } from './stop.js';
|
|
7
|
+
|
|
8
|
+
/** What a model switch is, for tooltips and the transcript's legend. */
|
|
9
|
+
export const modelSwitchTip = (): string => msg('A new agent session on the next model after a failed one (Router hops)');
|
|
10
|
+
|
|
11
|
+
/** One hop's model, or its route when the journal names no model. */
|
|
12
|
+
const hopModel = (h: Pick<Hop, 'model' | 'route'>): string => h.model || h.route || '—';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A model switch in words, the one form every view uses:
|
|
16
|
+
* `primary-model (rate limited) → fallback-model`; '' for a single hop.
|
|
17
|
+
* The hops passed over without an agent session (`skipped`: their identity was
|
|
18
|
+
* paused) come first: `primary-model (identity paused) → fallback-model`.
|
|
19
|
+
* With `time`, the attempt's time follows: `... → fallback-model | 0.2s`.
|
|
20
|
+
*/
|
|
21
|
+
export function modelSwitch(hops: readonly Hop[] | null | undefined, time?: number | null, skipped?: readonly SkippedHop[] | null): string {
|
|
22
|
+
const passed = [...new Map((skipped ?? []).map((h) => [h.route || h.model, h])).values()];
|
|
23
|
+
if (!hops || hops.length + passed.length < 2 || !hops.length) return '';
|
|
24
|
+
const steps = [
|
|
25
|
+
...passed.map(skippedHopStep),
|
|
26
|
+
...hops.map((h, i) => (i < hops.length - 1 ? msg(str`${hopModel(h)} (${stopLabel(h.stop)})`) : hopModel(h))),
|
|
27
|
+
];
|
|
28
|
+
const chain = steps.join(' → ');
|
|
29
|
+
return time === undefined || time === null ? chain : `${chain} | ${fmtDur(time)}`;
|
|
30
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Words for the hosts behind a hub's runs (`Info.hosts`): a host's state, its
|
|
2
|
+
// last report, its runs, and a run whose host stopped reporting. The code's
|
|
3
|
+
// terms (`up`, `last_seen`, `unresponsive`) stay in the data and in tooltips.
|
|
4
|
+
import type { HostSummary } from '@contraagent/api';
|
|
5
|
+
import { msg, str } from '@lit/localize';
|
|
6
|
+
import { facts, localTime } from './format.js';
|
|
7
|
+
|
|
8
|
+
/** A run whose host stopped reporting (`RunSummary.unresponsive`), as a status value. */
|
|
9
|
+
export const noReportLabel = (): string => msg('no report from host');
|
|
10
|
+
|
|
11
|
+
/** A host's state: `up`, or `no report` (its reports stopped, or it never reported). */
|
|
12
|
+
export const hostStateLabel = (h: Pick<HostSummary, 'up'>): string =>
|
|
13
|
+
h.up ? msg('up', { desc: 'A host whose reports keep arriving' }) : msg('no report');
|
|
14
|
+
|
|
15
|
+
/** A host's state with the time of its last report where one is known: `no report since Oct 13, 10:41:03`. */
|
|
16
|
+
export const hostStateSince = (h: Pick<HostSummary, 'up' | 'last_seen'>): string =>
|
|
17
|
+
!h.up && h.last_seen ? msg(str`no report since ${localTime(h.last_seen, true)}`) : hostStateLabel(h);
|
|
18
|
+
|
|
19
|
+
/** When a host last reported: `Last report Oct 13, 10:41:03`; '' when it never did. */
|
|
20
|
+
export const lastReport = (h: Pick<HostSummary, 'last_seen'> | undefined): string =>
|
|
21
|
+
h?.last_seen ? msg(str`Last report ${localTime(h.last_seen, true)}`) : '';
|
|
22
|
+
|
|
23
|
+
/** A host's id as a fact: `Host h1`; for a run whose run.json names none, `No host id`. */
|
|
24
|
+
export const hostFact = (id: string): string => (id ? msg(str`Host ${id}`) : msg('No host id'));
|
|
25
|
+
|
|
26
|
+
/** How many runs: `1 run`, `4 runs`. */
|
|
27
|
+
export const runCount = (n: number): string => (n === 1 ? msg('1 run') : msg(str`${n} runs`));
|
|
28
|
+
|
|
29
|
+
/** How many runs have no report from their host: `1 with no report from host`. */
|
|
30
|
+
export const noReportCount = (n: number): string => msg(str`${n} with no report from host`);
|
|
31
|
+
|
|
32
|
+
/** The hosts in one line: `2 hosts | 1 with no report`. */
|
|
33
|
+
export function hostsLine(hosts: readonly Pick<HostSummary, 'up'>[]): string {
|
|
34
|
+
const quiet = hosts.filter((h) => !h.up).length;
|
|
35
|
+
return facts(hosts.length === 1 ? msg('1 host') : msg(str`${hosts.length} hosts`), quiet ? msg(str`${quiet} with no report`) : '');
|
|
36
|
+
}
|
|
37
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// The words the UI shows for run data, in the reader's terms. The code's own
|
|
2
|
+
// terms (stop values, plan states, round, hop, attempt ...) stay in the data and
|
|
3
|
+
// in tooltips; what the reader sees comes from here, so every screen says the
|
|
4
|
+
// same thing for the same state. The mapping is listed in packages/ui/WORDS.md.
|
|
5
|
+
export * from './format.js';
|
|
6
|
+
export * from './outcome.js';
|
|
7
|
+
export * from './stop.js';
|
|
8
|
+
export * from './causes.js';
|
|
9
|
+
export * from './attempts.js';
|
|
10
|
+
export * from './passes.js';
|
|
11
|
+
export * from './credential.js';
|
|
12
|
+
export * from './hops.js';
|
|
13
|
+
export * from './quota.js';
|
|
14
|
+
export * from './contract.js';
|
|
15
|
+
export * from './run-line.js';
|
|
16
|
+
export * from './hosts.js';
|
|
17
|
+
export * from './table.js';
|
|
18
|
+
export * from './changes.js';
|
|
19
|
+
export * from './claims.js';
|
|
20
|
+
export * from './rests.js';
|
|
21
|
+
export * from './services.js';
|
|
22
|
+
export * from './time-box.js';
|
|
23
|
+
export * from './row-extras.js';
|
|
24
|
+
export * from './models.js';
|
|
25
|
+
export * from './panels.js';
|
|
26
|
+
export * from './export.js';
|
|
27
|
+
export * from './trends.js';
|
|
28
|
+
export * from './priority.js';
|
|
29
|
+
export * from './context.js';
|
|
30
|
+
export * from './preflight.js';
|
|
31
|
+
export * from './task-definition.js';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Words for what each model was used for in a run (`Plan.models`).
|
|
2
|
+
import type { ModelMeasure, ModelUsage } from '@contraagent/api';
|
|
3
|
+
import { modelTokens } from '@contraagent/api';
|
|
4
|
+
import { msg } from '@lit/localize';
|
|
5
|
+
import { fmtDur, tokenCount, usd } from './format.js';
|
|
6
|
+
|
|
7
|
+
/** A measure's name: the name of the column it is in, too. */
|
|
8
|
+
export function measureLabel(m: ModelMeasure): string {
|
|
9
|
+
switch (m) {
|
|
10
|
+
case 'cost':
|
|
11
|
+
return msg('Cost');
|
|
12
|
+
case 'tokens':
|
|
13
|
+
return msg('Tokens');
|
|
14
|
+
case 'time':
|
|
15
|
+
return msg('Time');
|
|
16
|
+
case 'sessions':
|
|
17
|
+
return msg('Agent sessions');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** What a measure counts, for its tooltip. */
|
|
22
|
+
export function measureTip(m: ModelMeasure): string {
|
|
23
|
+
switch (m) {
|
|
24
|
+
case 'cost':
|
|
25
|
+
return msg('Reported by the coding agent');
|
|
26
|
+
case 'tokens':
|
|
27
|
+
return msg('Input, output, cache read and cache write');
|
|
28
|
+
case 'time':
|
|
29
|
+
return msg('Time of the agent sessions, summed');
|
|
30
|
+
case 'sessions':
|
|
31
|
+
return msg('Agent sessions started on the model');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A model's amount of `measure` in words: `$0.12`, `12.3k`, `2m 05s`, `4`; '—' for no cost reported. */
|
|
36
|
+
export function measureText(u: ModelUsage, m: ModelMeasure): string {
|
|
37
|
+
switch (m) {
|
|
38
|
+
case 'cost':
|
|
39
|
+
return u.cost_usd === null || u.cost_usd === undefined ? '—' : usd(u.cost_usd);
|
|
40
|
+
case 'tokens':
|
|
41
|
+
return tokenCount(modelTokens(u));
|
|
42
|
+
case 'time':
|
|
43
|
+
return fmtDur(u.wall_s ?? 0);
|
|
44
|
+
case 'sessions':
|
|
45
|
+
return String(u.sessions);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The name the parts of a share past the colours fold into. */
|
|
50
|
+
export const otherModels = (): string => msg('Other models');
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// A task's outcome in words: its status, a count of tasks in a state, a plan
|
|
2
|
+
// state. The code's terms (`recovered`, `blocked`) stay in the data and in
|
|
3
|
+
// tooltips; the words are the reader's (packages/ui/WORDS.md).
|
|
4
|
+
import { planOutcome, type Outcome, type PlanNode } from '@contraagent/api';
|
|
5
|
+
import { msg, str } from '@lit/localize';
|
|
6
|
+
|
|
7
|
+
/** What happened to a task. */
|
|
8
|
+
export function outcomeLabel(o: Outcome): string {
|
|
9
|
+
switch (o) {
|
|
10
|
+
case 'done':
|
|
11
|
+
return msg('done', { id: 'outcome-done', desc: 'The status of a task: done' });
|
|
12
|
+
case 'recovered':
|
|
13
|
+
return msg('done after retrying');
|
|
14
|
+
case 'partial':
|
|
15
|
+
return msg('partly done', { id: 'outcome-partial', desc: 'The status of a task whose output is a placeholder: a service it needed was unavailable (partial)' });
|
|
16
|
+
case 'failed':
|
|
17
|
+
return msg('failed');
|
|
18
|
+
case 'not_started':
|
|
19
|
+
return msg('not started');
|
|
20
|
+
case 'running':
|
|
21
|
+
return msg('running');
|
|
22
|
+
case 'waiting':
|
|
23
|
+
return msg('waiting');
|
|
24
|
+
case 'skipped':
|
|
25
|
+
return msg('skipped');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** What happened to a task, in a run that is `live` or over: a task still waiting when the run ended is "not run". */
|
|
30
|
+
export const taskStatusLabel = (o: Outcome, live: boolean): string => (o === 'waiting' && !live ? msg('not run') : outcomeLabel(o));
|
|
31
|
+
|
|
32
|
+
/** A plan node's state (the task matrix, progress by kind). */
|
|
33
|
+
export const planStateLabel = (s: PlanNode['state']): string => outcomeLabel(planOutcome(s));
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* How many tasks are in a state, number first: "3 failed", "2 not started".
|
|
37
|
+
* A count only: a cause ("review · zeta failed") has its own message.
|
|
38
|
+
* `not_run`: waiting when the run ended.
|
|
39
|
+
*/
|
|
40
|
+
export function stateCount(s: Outcome | 'not_run', n: number): string {
|
|
41
|
+
switch (s) {
|
|
42
|
+
case 'done':
|
|
43
|
+
return msg(str`${n} done`);
|
|
44
|
+
case 'recovered':
|
|
45
|
+
return msg(str`${n} done after retrying`);
|
|
46
|
+
case 'partial':
|
|
47
|
+
return msg(str`${n} partly done`);
|
|
48
|
+
case 'failed':
|
|
49
|
+
return msg(str`${n} failed`);
|
|
50
|
+
case 'not_started':
|
|
51
|
+
return msg(str`${n} not started`);
|
|
52
|
+
case 'running':
|
|
53
|
+
return msg(str`${n} running`);
|
|
54
|
+
case 'waiting':
|
|
55
|
+
return msg(str`${n} waiting`);
|
|
56
|
+
case 'skipped':
|
|
57
|
+
return msg(str`${n} skipped`);
|
|
58
|
+
case 'not_run':
|
|
59
|
+
return msg(str`${n} not run`);
|
|
60
|
+
}
|
|
61
|
+
}
|