@kortix/ui 0.14.12 → 0.14.14
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 +1 -1
- package/dist/_vendor/kortix-shared.js +521 -7045
- package/dist/_vendor/shared/app-config.d.ts +8 -0
- package/dist/_vendor/shared/artifact-annotations.d.ts +708 -0
- package/dist/_vendor/shared/artifact-comments.d.ts +327 -0
- package/dist/_vendor/shared/index.d.ts +3 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +40 -0
- package/dist/_vendor/shared/peer-message-prompt.d.ts +35 -0
- package/dist/_vendor/shared/pixel-mark.d.ts +11 -0
- package/dist/_vendor/shared/prompt-attachments.d.ts +1 -0
- package/dist/_vendor/shared/reminder-prompt.d.ts +8 -2
- package/dist/_vendor/shared/runtime-versions.d.ts +8 -0
- package/dist/artifacts/artifact-frame.d.ts +1 -0
- package/dist/artifacts/artifact-frame.js +18 -5
- package/dist/artifacts/frame-policy.d.ts +1 -1
- package/dist/artifacts/frame-policy.js +10 -5
- package/dist/customize/agents/agent-access-text.d.ts +16 -0
- package/dist/customize/agents/agent-access-text.js +54 -0
- package/dist/customize/agents/agent-approval-rules.d.ts +8 -0
- package/dist/customize/agents/agent-approval-rules.js +26 -0
- package/dist/customize/agents/agent-authority-card.js +4 -1
- package/dist/customize/agents/agent-cover-card.d.ts +4 -1
- package/dist/customize/agents/agent-cover-card.js +2 -2
- package/dist/customize/agents/agent-detail-aside.d.ts +1 -2
- package/dist/customize/agents/agent-detail-aside.js +8 -11
- package/dist/customize/agents/agent-drives-section.d.ts +23 -7
- package/dist/customize/agents/agent-drives-section.js +107 -41
- package/dist/customize/agents/agent-instructions.d.ts +11 -0
- package/dist/customize/agents/agent-instructions.js +114 -0
- package/dist/customize/agents/agent-model-view.d.ts +17 -0
- package/dist/customize/agents/agent-model-view.js +67 -0
- package/dist/customize/agents/agent-overview.d.ts +53 -0
- package/dist/customize/agents/agent-overview.js +242 -0
- package/dist/customize/agents/agent-page-chrome.d.ts +128 -0
- package/dist/customize/agents/agent-page-chrome.js +145 -0
- package/dist/customize/agents/agent-page.d.ts +13 -1
- package/dist/customize/agents/agent-page.js +478 -367
- package/dist/customize/agents/agent-pin-button.d.ts +10 -0
- package/dist/customize/agents/agent-pin-button.js +20 -0
- package/dist/customize/agents/agent-policy-sets-section.d.ts +16 -0
- package/dist/customize/agents/agent-policy-sets-section.js +80 -0
- package/dist/customize/agents/agent-policy-sets.js +1 -1
- package/dist/customize/agents/agent-section-rail.d.ts +21 -0
- package/dist/customize/agents/agent-section-rail.js +23 -0
- package/dist/customize/agents/agent-share-control.d.ts +4 -3
- package/dist/customize/agents/agent-share-control.js +15 -16
- package/dist/customize/agents/{agent-people-section.d.ts → agent-share-dialog.d.ts} +3 -1
- package/dist/customize/agents/{agent-people-section.js → agent-share-dialog.js} +21 -21
- package/dist/customize/agents/agent-tabs.d.ts +95 -0
- package/dist/customize/agents/agent-tabs.js +199 -0
- package/dist/customize/agents/agents-page.d.ts +0 -21
- package/dist/customize/agents/agents-page.js +104 -118
- package/dist/customize/agents/connectors-required.d.ts +16 -0
- package/dist/customize/agents/connectors-required.js +19 -0
- package/dist/customize/agents/create-agent-modal.d.ts +19 -0
- package/dist/customize/agents/create-agent-modal.js +94 -0
- package/dist/customize/connectors/agent-access.d.ts +4 -4
- package/dist/customize/connectors/agent-access.js +7 -10
- package/dist/customize/connectors/connector-identity.d.ts +12 -0
- package/dist/customize/connectors/connector-identity.js +15 -2
- package/dist/customize/connectors/connector-routes.js +2 -2
- package/dist/customize/connectors/connectors-page.d.ts +14 -1
- package/dist/customize/connectors/connectors-page.js +101 -32
- package/dist/customize/connectors/detail/app-page.js +1 -1
- package/dist/customize/connectors/detail/connector-agents.js +0 -3
- package/dist/customize/connectors/detail/connector-page.d.ts +1 -1
- package/dist/customize/connectors/detail/connector-page.js +5 -2
- package/dist/customize/connectors/detail/connector-policy-sets.js +1 -1
- package/dist/customize/connectors/detail/connector-triggers.js +2 -2
- package/dist/customize/connectors/use-agent-access.d.ts +7 -5
- package/dist/customize/connectors/use-agent-access.js +2 -6
- package/dist/customize/models/models-page.d.ts +7 -1
- package/dist/customize/models/models-page.js +2 -2
- package/dist/customize/project-settings/project-admin-sections.d.ts +63 -0
- package/dist/customize/project-settings/project-admin-sections.js +80 -0
- package/dist/customize/project-settings/project-settings-page.d.ts +1 -1
- package/dist/customize/project-settings/project-settings-page.js +4 -13
- package/dist/customize/project-settings/project-settings-sections.d.ts +5 -5
- package/dist/customize/project-settings/project-settings-sections.js +6 -20
- package/dist/customize/providers/provider-accordion.js +29 -17
- package/dist/customize/providers/provider-connect.js +1 -1
- package/dist/customize/providers/provider-sheet.d.ts +4 -1
- package/dist/customize/providers/provider-sheet.js +15 -5
- package/dist/customize/secrets/secrets-page.d.ts +5 -1
- package/dist/customize/secrets/secrets-page.js +2 -2
- package/dist/customize/sections/gateway-view.d.ts +10 -2
- package/dist/customize/sections/gateway-view.js +16 -4
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +12 -5
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +131 -8
- package/dist/customize/sections/llm-provider/claude-code-step.d.ts +10 -0
- package/dist/customize/sections/llm-provider/claude-code-step.js +32 -0
- package/dist/customize/sections/llm-provider/models-tab.js +5 -1
- package/dist/customize/sections/view/account-secret-resources-panel.d.ts +5 -3
- package/dist/customize/sections/view/account-secret-resources-panel.js +122 -19
- package/dist/customize/sections/view/agent-editor-access-fields.d.ts +1 -1
- package/dist/customize/sections/view/agent-editor-access-fields.js +8 -4
- package/dist/customize/sections/view/agent-editor-basics-fields.d.ts +4 -1
- package/dist/customize/sections/view/agent-editor-basics-fields.js +33 -4
- package/dist/customize/sections/view/agent-editor-catalog.d.ts +2 -2
- package/dist/customize/sections/view/agent-editor-catalog.js +10 -12
- package/dist/customize/sections/view/agent-editor-primitives.d.ts +1 -1
- package/dist/customize/sections/view/agent-editor-primitives.js +4 -4
- package/dist/customize/sections/view/agent-editor.d.ts +37 -26
- package/dist/customize/sections/view/agent-editor.js +19 -19
- package/dist/customize/sections/view/grant-mode-field.d.ts +8 -20
- package/dist/customize/sections/view/grant-mode-field.js +31 -57
- package/dist/customize/sections/view/permission-editor.d.ts +3 -1
- package/dist/customize/sections/view/permission-editor.js +19 -10
- package/dist/customize/sections/view/review-view.d.ts +8 -0
- package/dist/customize/sections/view/review-view.js +12 -1
- package/dist/customize/sections/view/secret-delivery.js +1 -4
- package/dist/customize/sections/view/secrets-view.d.ts +7 -1
- package/dist/customize/sections/view/secrets-view.js +42 -6
- package/dist/customize/settings/rail.js +2 -8
- package/dist/customize/settings/settings-tabs.d.ts +2 -2
- package/dist/customize/settings/settings-tabs.js +17 -19
- package/dist/customize/settings/tabs/experimental-tab.d.ts +3 -0
- package/dist/customize/settings/tabs/experimental-tab.js +6 -1
- package/dist/customize/settings/tabs/sandbox-tab.d.ts +4 -6
- package/dist/customize/settings/tabs/sandbox-tab.js +9 -9
- package/dist/customize/shared/access-list.d.ts +39 -0
- package/dist/customize/shared/access-list.js +62 -0
- package/dist/customize/shared/agent-resource-scope.d.ts +87 -0
- package/dist/customize/shared/agent-resource-scope.js +123 -0
- package/dist/customize/shared/capability-library.d.ts +41 -0
- package/dist/customize/shared/capability-library.js +271 -0
- package/dist/customize/shared/capability-page-shell.d.ts +18 -1
- package/dist/customize/shared/capability-page-shell.js +21 -1
- package/dist/customize/shared/catalog/catalog-space-tabs.d.ts +14 -0
- package/dist/customize/shared/catalog/catalog-space-tabs.js +20 -0
- package/dist/customize/shared/customize-tab-bar.d.ts +13 -0
- package/dist/customize/shared/customize-tab-bar.js +95 -0
- package/dist/customize/shared/entity/entity-modal.d.ts +17 -1
- package/dist/customize/shared/entity/entity-modal.js +10 -9
- package/dist/customize/shared/leave-guard.d.ts +23 -0
- package/dist/customize/shared/leave-guard.js +87 -0
- package/dist/customize/shared/standalone-settings-nav.js +4 -1
- package/dist/customize/shared/tool-rules.d.ts +11 -0
- package/dist/customize/shared/tool-rules.js +29 -0
- package/dist/customize/skills/builtin-skill-modal.d.ts +6 -0
- package/dist/customize/skills/builtin-skill-modal.js +41 -0
- package/dist/customize/skills/skills-page.d.ts +21 -18
- package/dist/customize/skills/skills-page.js +16 -110
- package/dist/customize/triggers/runtime-triggers.d.ts +17 -0
- package/dist/customize/triggers/runtime-triggers.js +57 -0
- package/dist/customize/triggers/schedule/event-trigger-copy.js +2 -2
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/schedule-copy.d.ts +11 -6
- package/dist/customize/triggers/schedule/schedule-copy.js +29 -8
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +7 -3
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +26 -1
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +64 -3
- package/dist/customize/triggers/schedule/trigger-composer.js +57 -20
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +18 -5
- package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -0
- package/dist/customize/triggers/schedule/trigger-filter.js +16 -0
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
- package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
- package/dist/customize/triggers/schedule/use-trigger-mutations.d.ts +1 -1
- package/dist/customize/triggers/schedule/use-trigger-mutations.js +1 -1
- package/dist/customize/triggers/schedule/when-app.d.ts +15 -0
- package/dist/customize/triggers/schedule/when-app.js +21 -0
- package/dist/customize/triggers/schedule/when-change-request.d.ts +10 -0
- package/dist/customize/triggers/schedule/when-change-request.js +15 -0
- package/dist/customize/triggers/schedule-view.d.ts +17 -3
- package/dist/customize/triggers/schedule-view.js +46 -16
- package/dist/customize/triggers/triggers-page.d.ts +3 -3
- package/dist/customize/triggers/triggers-page.js +2 -2
- package/dist/customize/use-configure-thread.d.ts +8 -2
- package/dist/customize/use-configure-thread.js +30 -18
- package/dist/files/project/components/change-request-detail-dialog.js +2 -3
- package/dist/files/project/components/drive-explorer.js +6 -5
- package/dist/files/project/explorer-source.d.ts +3 -0
- package/dist/files/project/upload-batch.d.ts +3 -3
- package/dist/files/project/upload-batch.js +7 -6
- package/dist/files/runtime/sandbox-explorer-source.js +3 -3
- package/dist/i18n/en.d.ts +1330 -53
- package/dist/i18n/en.js +1422 -145
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +16 -7
- package/dist/internal/auth/auth-primitives.d.ts +1 -3
- package/dist/internal/auth/auth-primitives.js +2 -2
- package/dist/internal/billing/session-cost-format.d.ts +1 -0
- package/dist/internal/billing/session-cost-format.js +11 -0
- package/dist/internal/components/agent-mark.d.ts +12 -1
- package/dist/internal/components/agent-mark.js +34 -11
- package/dist/internal/components/nav-rail.d.ts +22 -0
- package/dist/internal/components/nav-rail.js +16 -0
- package/dist/internal/components/repository-disconnected.js +2 -2
- package/dist/internal/goals/goal-meta.d.ts +15 -1
- package/dist/internal/goals/goal-meta.js +42 -2
- package/dist/internal/hooks/projects/use-agent-config.d.ts +11 -7
- package/dist/internal/hooks/projects/use-agent-config.js +28 -11
- package/dist/internal/hooks/use-slash-focus.d.ts +7 -1
- package/dist/internal/hooks/use-slash-focus.js +9 -3
- package/dist/internal/layout/project-capability-nav.d.ts +24 -0
- package/dist/internal/layout/project-capability-nav.js +86 -0
- package/dist/internal/layout/project-page-header.d.ts +1 -1
- package/dist/internal/layout/project-page-header.js +1 -1
- package/dist/internal/layout/project-settings-nav.d.ts +3 -2
- package/dist/internal/layout/project-settings-nav.js +5 -3
- package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
- package/dist/internal/lib/capability-tab-routes.d.ts +34 -3
- package/dist/internal/lib/capability-tab-routes.js +76 -8
- package/dist/internal/lib/manifest-health.d.ts +10 -0
- package/dist/internal/lib/manifest-health.js +20 -0
- package/dist/internal/lib/pixel-mark.d.ts +4 -1
- package/dist/internal/lib/pixel-mark.js +33 -6
- package/dist/internal/lib/project-actions.d.ts +1 -1
- package/dist/internal/lib/project-actions.js +0 -4
- package/dist/internal/lib/provider-branding.js +2 -0
- package/dist/internal/lib/space-scope.d.ts +29 -0
- package/dist/internal/lib/space-scope.js +28 -0
- package/dist/internal/lib/use-project-feature-flags.js +3 -3
- package/dist/internal/lib/web-notifications.d.ts +74 -8
- package/dist/internal/lib/web-notifications.js +243 -117
- package/dist/internal/notifications/notification-rows.d.ts +14 -7
- package/dist/internal/notifications/notification-rows.js +21 -14
- package/dist/internal/notifications/session-toast-cards.d.ts +2 -2
- package/dist/internal/reminders/reminder-format.d.ts +6 -2
- package/dist/internal/reminders/reminder-format.js +7 -1
- package/dist/internal/stores/active-space-store.d.ts +35 -0
- package/dist/internal/stores/active-space-store.js +29 -0
- package/dist/internal/stores/kortix-computer-store.js +13 -4
- package/dist/internal/stores/pinned-agents-store.d.ts +26 -0
- package/dist/internal/stores/pinned-agents-store.js +20 -0
- package/dist/internal/stores/session-panel-memory-store.js +3 -0
- package/dist/internal/stores/turn-attention-store.d.ts +5 -4
- package/dist/lib/routes.d.ts +16 -1
- package/dist/lib/routes.js +15 -3
- package/dist/markdown/doc-editor/doc-embed.d.ts +31 -0
- package/dist/markdown/doc-editor/doc-embed.js +168 -0
- package/dist/markdown/doc-editor/doc-extensions.d.ts +26 -0
- package/dist/markdown/doc-editor/doc-extensions.js +149 -0
- package/dist/markdown/doc-editor/doc-menus.d.ts +9 -0
- package/dist/markdown/doc-editor/doc-menus.js +56 -0
- package/dist/markdown/doc-editor/markdown.d.ts +12 -0
- package/dist/markdown/doc-editor/markdown.js +140 -0
- package/dist/markdown/genui/components/inline.d.ts +1 -1
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/pixel-kortix-mark.d.ts +5 -4
- package/dist/primitives/pixel-kortix-mark.js +5 -15
- package/dist/primitives/tag.d.ts +1 -1
- package/dist/primitives/textarea.js +14 -0
- package/dist/primitives/toast.d.ts +2 -0
- package/dist/primitives/toast.js +4 -2
- package/dist/providers/ui-provider.d.ts +16 -0
- package/dist/session/actions/session-label.d.ts +1 -1
- package/dist/session/actions/session-label.js +3 -3
- package/dist/session/agents/agent-model.d.ts +92 -0
- package/dist/session/agents/agent-model.js +123 -0
- package/dist/session/agents/agent-state-mark.d.ts +10 -0
- package/dist/session/agents/agent-state-mark.js +22 -0
- package/dist/session/agents/agent-strip.d.ts +58 -0
- package/dist/session/agents/agent-strip.js +259 -0
- package/dist/session/agents/held-messages.d.ts +33 -0
- package/dist/session/agents/held-messages.js +50 -0
- package/dist/session/agents/legacy-subagent-chat.d.ts +11 -0
- package/dist/session/agents/legacy-subagent-chat.js +19 -0
- package/dist/session/agents/session-peek.d.ts +20 -0
- package/dist/session/agents/session-peek.js +67 -0
- package/dist/session/agents/session-prompt.d.ts +13 -0
- package/dist/session/agents/session-prompt.js +18 -0
- package/dist/session/agents/steer-session.d.ts +13 -0
- package/dist/session/agents/steer-session.js +29 -0
- package/dist/session/agents/subagent-dialog-content.d.ts +11 -0
- package/dist/session/agents/subagent-dialog-content.js +115 -0
- package/dist/session/agents/subagent-view.d.ts +8 -0
- package/dist/session/agents/subagent-view.js +18 -0
- package/dist/session/agents/tasks-panel.d.ts +13 -0
- package/dist/session/agents/tasks-panel.js +41 -0
- package/dist/session/agents/workflow-run-controls.d.ts +43 -0
- package/dist/session/agents/workflow-run-controls.js +141 -0
- package/dist/session/composer/ComposerCard.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +3 -3
- package/dist/session/composer/agent-selector.js +13 -19
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +2 -2
- package/dist/session/composer/composer.d.ts +5 -0
- package/dist/session/composer/composer.js +16 -10
- package/dist/session/composer/editor/composer-editor.js +19 -8
- package/dist/session/composer/editor/ultracode.d.ts +34 -0
- package/dist/session/composer/editor/ultracode.js +127 -0
- package/dist/session/composer/send-blockers.d.ts +1 -11
- package/dist/session/composer/send-blockers.js +1 -11
- package/dist/session/composer/session-composer-readiness.d.ts +1 -28
- package/dist/session/composer/session-composer-readiness.js +5 -16
- package/dist/session/header/reminder-parts.d.ts +1 -1
- package/dist/session/header/session-site-header.js +6 -3
- package/dist/session/header/subagent-hover-card.d.ts +0 -2
- package/dist/session/header/subagent-hover-card.js +1 -4
- package/dist/session/models/claude-connection-slot.d.ts +11 -0
- package/dist/session/models/claude-connection-slot.js +30 -0
- package/dist/session/models/model-availability.d.ts +3 -1
- package/dist/session/models/model-availability.js +3 -0
- package/dist/session/models/model-selector.js +11 -12
- package/dist/session/models/model-tags.d.ts +9 -0
- package/dist/session/models/model-tags.js +8 -0
- package/dist/session/panel/easy/easy-panel.js +1 -1
- package/dist/session/panel/easy/step-icon.js +5 -1
- package/dist/session/panel/mobile-tool-drawer.js +1 -1
- package/dist/session/panel/session-action-panel-column.js +1 -1
- package/dist/session/panel/session-desktop.js +41 -14
- package/dist/session/panel/session-panel-provider.d.ts +1 -1
- package/dist/session/panel/session-panel-provider.js +7 -11
- package/dist/session/prompts/question-prompt.js +3 -1
- package/dist/session/status/session-error-banner.js +4 -1
- package/dist/session/thread/session-chat.js +286 -296
- package/dist/session/thread/session-context-modal.js +29 -10
- package/dist/session/thread/session-context-spawned-sessions.d.ts +13 -0
- package/dist/session/thread/session-context-spawned-sessions.js +44 -0
- package/dist/session/thread/session-context-sub-sessions.js +3 -8
- package/dist/session/thread/transcript.d.ts +3 -0
- package/dist/session/thread/transcript.js +32 -8
- package/dist/session/tool/shared/full-view-action.d.ts +29 -0
- package/dist/session/tool/shared/full-view-action.js +43 -0
- package/dist/session/tool/tool-part-renderer.js +10 -2
- package/dist/session/tool/tools/agent-message-tool.js +2 -2
- package/dist/session/tool/tools/agent-spawn-tool.js +2 -2
- package/dist/session/tool/tools/agent-status-tool.js +2 -2
- package/dist/session/tool/tools/kortix-action-tool.d.ts +2 -0
- package/dist/session/tool/tools/kortix-action-tool.js +148 -0
- package/dist/session/tool/tools/kortix-tool-card.d.ts +83 -0
- package/dist/session/tool/tools/kortix-tool-card.js +186 -0
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +11 -0
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +141 -0
- package/dist/session/tool/tools/multi-agent-tool-data.d.ts +63 -0
- package/dist/session/tool/tools/multi-agent-tool-data.js +118 -0
- package/dist/session/tool/tools/multi-agent-tools.d.ts +9 -0
- package/dist/session/tool/tools/multi-agent-tools.js +38 -0
- package/dist/session/tool/tools/question-tool.js +1 -1
- package/dist/session/tool/tools/register.d.ts +3 -0
- package/dist/session/tool/tools/register.js +3 -0
- package/dist/session/tool/tools/session-spawn-tool.js +2 -2
- package/dist/session/tool/tools/task-tool.d.ts +1 -1
- package/dist/session/tool/tools/task-tool.js +29 -41
- package/dist/session/tool/tools/workflow-progress.d.ts +34 -0
- package/dist/session/tool/tools/workflow-progress.js +186 -0
- package/dist/session/tool/tools/workflow-run.d.ts +128 -0
- package/dist/session/tool/tools/workflow-run.js +251 -0
- package/dist/session/tool/tools/workflow-tool.d.ts +9 -0
- package/dist/session/tool/tools/workflow-tool.js +253 -0
- package/dist/session/turn/notice-batch-group.d.ts +12 -0
- package/dist/session/turn/notice-batch-group.js +17 -0
- package/dist/session/turn/peer-message-row.d.ts +14 -0
- package/dist/session/turn/peer-message-row.js +57 -0
- package/dist/session/turn/subagent-notice-row.d.ts +4 -0
- package/dist/session/turn/subagent-notice-row.js +50 -0
- package/dist/session/turn/subagent-notice.d.ts +58 -0
- package/dist/session/turn/subagent-notice.js +111 -0
- package/dist/session/turn/user-message.js +24 -5
- package/dist/styles/tokens.css +2 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +1 -1
- package/dist/workspace/admin/project-admin-dashboard.d.ts +53 -0
- package/dist/workspace/admin/project-admin-dashboard.js +252 -0
- package/dist/workspace/admin/project-admin-nav.d.ts +20 -0
- package/dist/workspace/admin/project-admin-nav.js +41 -0
- package/dist/workspace/home/welcome-body.js +25 -3
- package/dist/workspace/index.d.ts +6 -2
- package/dist/workspace/index.js +12 -2
- package/dist/workspace/layout/new-session-create.js +3 -3
- package/dist/workspace/layout/project-home.js +3 -3
- package/dist/workspace/memory/memory-labels.js +5 -0
- package/dist/workspace/repository-disconnected.js +2 -2
- package/dist/workspace/sessions/board-dispatch.d.ts +52 -0
- package/dist/workspace/sessions/board-dispatch.js +110 -0
- package/dist/workspace/sessions/board-grouping.d.ts +63 -0
- package/dist/workspace/sessions/board-grouping.js +141 -0
- package/dist/workspace/sessions/board-peek.d.ts +15 -0
- package/dist/workspace/sessions/board-peek.js +54 -0
- package/dist/workspace/sessions/board-state-mark.d.ts +15 -0
- package/dist/workspace/sessions/board-state-mark.js +24 -0
- package/dist/workspace/sessions/project-sessions-view.js +42 -31
- package/dist/workspace/sessions/sessions-board.d.ts +12 -0
- package/dist/workspace/sessions/sessions-board.js +214 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +46 -0
- package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +85 -0
- package/dist/workspace/sidebar/footer/sidebar-alert.js +1 -1
- package/dist/workspace/sidebar/new-agent-modal-provider.d.ts +12 -0
- package/dist/workspace/sidebar/new-agent-modal-provider.js +19 -0
- package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
- package/dist/workspace/sidebar/project-nav-items.js +53 -5
- package/dist/workspace/sidebar/project-session-list.js +35 -12
- package/dist/workspace/sidebar/project-sidebar.js +6 -3
- package/dist/workspace/sidebar/session-filter-menu.js +2 -1
- package/dist/workspace/space/space-blocks.d.ts +25 -0
- package/dist/workspace/space/space-blocks.js +124 -0
- package/dist/workspace/space/space-filter-tabs.d.ts +17 -0
- package/dist/workspace/space/space-filter-tabs.js +31 -0
- package/dist/workspace/space/space-page.d.ts +24 -0
- package/dist/workspace/space/space-page.js +157 -0
- package/dist/workspace/space/space-room.d.ts +20 -0
- package/dist/workspace/space/space-room.js +27 -0
- package/dist/workspace/space/space-tab-menu.d.ts +14 -0
- package/dist/workspace/space/space-tab-menu.js +127 -0
- package/dist/workspace/space/space-tab-panels.d.ts +9 -0
- package/dist/workspace/space/space-tab-panels.js +203 -0
- package/dist/workspace/space/space-templates.d.ts +34 -0
- package/dist/workspace/space/space-templates.js +71 -0
- package/dist/workspace/space/use-space-filter.d.ts +10 -0
- package/dist/workspace/space/use-space-filter.js +40 -0
- package/dist/workspace/space/use-space-manifest.d.ts +8 -0
- package/dist/workspace/space/use-space-manifest.js +27 -0
- package/dist/workspace/spaces/space-timeline.js +2 -2
- package/package.json +56 -53
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +10 -4
- package/skills/kortix-ui/references/modules.md +10 -8
- package/dist/_vendor/shared/meta-agent.d.ts +0 -7
- package/dist/customize/agents/agent-grant-pages.d.ts +0 -37
- package/dist/customize/agents/agent-grant-pages.js +0 -226
- package/dist/customize/agents/agent-triggers-section.d.ts +0 -17
- package/dist/customize/agents/agent-triggers-section.js +0 -109
- package/dist/customize/migrate-to-v2/index.d.ts +0 -5
- package/dist/customize/migrate-to-v2/index.js +0 -5
- package/dist/customize/migrate-to-v2/migration-prompt.d.ts +0 -16
- package/dist/customize/migrate-to-v2/migration-prompt.js +0 -59
- package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +0 -30
- package/dist/customize/migrate-to-v2/upgrade-defs.js +0 -43
- package/dist/customize/migrate-to-v2/upgrade-view.d.ts +0 -32
- package/dist/customize/migrate-to-v2/upgrade-view.js +0 -152
- package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +0 -18
- package/dist/customize/migrate-to-v2/use-run-upgrade.js +0 -16
- package/dist/customize/shared/capability-tabs.d.ts +0 -3
- package/dist/customize/shared/capability-tabs.js +0 -137
- package/dist/customize/skills/skill-scope.d.ts +0 -14
- package/dist/customize/skills/skill-scope.js +0 -18
- package/dist/internal/lib/manifest-version.d.ts +0 -21
- package/dist/internal/lib/manifest-version.js +0 -55
- package/dist/session/composer/hooks/use-composer-escape-stop.d.ts +0 -6
- package/dist/session/composer/hooks/use-composer-escape-stop.js +0 -28
- package/dist/session/thread/sub-session-modal-content.d.ts +0 -8
- package/dist/session/thread/sub-session-modal-content.js +0 -23
- package/dist/session/thread/sub-session-modal.d.ts +0 -2
- package/dist/session/thread/sub-session-modal.js +0 -14
- package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.d.ts +0 -13
- package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +0 -48
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `workflow` tool's part metadata, parsed defensively, and the pure helpers
|
|
3
|
+
* its card draws from.
|
|
4
|
+
*
|
|
5
|
+
* The shape is `WorkflowRunMetadata` in `packages/api-contract/src/kortix-tool-card.ts`.
|
|
6
|
+
* `@kortix/ui` does not depend on that package, so the types are mirrored here
|
|
7
|
+
* and every field is checked. pi pushes it live with every change of the run,
|
|
8
|
+
* and the final copy when the call returns.
|
|
9
|
+
*/
|
|
10
|
+
export type WorkflowRunStatus = 'running' | 'done' | 'failed' | 'stopped';
|
|
11
|
+
/** `pending`: declared in the script's `meta.phases`, not started yet. */
|
|
12
|
+
export type WorkflowPhaseStatus = WorkflowRunStatus | 'pending';
|
|
13
|
+
export type WorkflowAgentStatus = 'starting' | 'running' | 'done' | 'failed' | 'stopped';
|
|
14
|
+
export interface WorkflowRunPhase {
|
|
15
|
+
title: string;
|
|
16
|
+
status: WorkflowPhaseStatus;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkflowRunAgent {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
agent?: string;
|
|
22
|
+
phase?: string;
|
|
23
|
+
status: WorkflowAgentStatus;
|
|
24
|
+
sessionId?: string;
|
|
25
|
+
summary?: string;
|
|
26
|
+
/** Resumed run: the saved result of the earlier run was reused; no session started. */
|
|
27
|
+
cached?: true;
|
|
28
|
+
/** The model the script asked for. */
|
|
29
|
+
model?: string;
|
|
30
|
+
/** The answer is JSON checked against a schema. */
|
|
31
|
+
structured?: true;
|
|
32
|
+
/** 1 for the first attempt; a stalled agent restarts with the same prompt. */
|
|
33
|
+
attempt?: number;
|
|
34
|
+
/** Epoch ms. */
|
|
35
|
+
startedAt?: number;
|
|
36
|
+
endedAt?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface WorkflowRun {
|
|
39
|
+
runId: string;
|
|
40
|
+
title: string;
|
|
41
|
+
status: WorkflowRunStatus;
|
|
42
|
+
phases: WorkflowRunPhase[];
|
|
43
|
+
agents: WorkflowRunAgent[];
|
|
44
|
+
startedAt?: number;
|
|
45
|
+
endedAt?: number;
|
|
46
|
+
error?: string;
|
|
47
|
+
/** The most agents this run may start. */
|
|
48
|
+
maxAgents?: number;
|
|
49
|
+
/** A saved workflow run by name. */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** The script's newest `log()` lines, oldest first. */
|
|
52
|
+
logs: string[];
|
|
53
|
+
/** More than 25 agents: the card warns, as Claude Code's "Large workflow". */
|
|
54
|
+
large?: true;
|
|
55
|
+
/** The run this one resumed. */
|
|
56
|
+
resumedFrom?: string;
|
|
57
|
+
/** The run goes on in its own runner session; this call returned at once. */
|
|
58
|
+
background?: {
|
|
59
|
+
sessionId: string;
|
|
60
|
+
};
|
|
61
|
+
/** `pause` held new agents back; running agents finish. Cleared by `resume`. */
|
|
62
|
+
paused?: true;
|
|
63
|
+
}
|
|
64
|
+
/** The run in a `workflow` call's metadata; `null` when the metadata is not a run. */
|
|
65
|
+
export declare function parseWorkflowRun(metadata: unknown): WorkflowRun | null;
|
|
66
|
+
/** True for pi's `workflow` tool, under any of its spellings, and for no other name ending in `workflow`. */
|
|
67
|
+
export declare function isWorkflowTool(name: string): boolean;
|
|
68
|
+
/** The filter of the agent list, as Claude Code's `f` cycles it. */
|
|
69
|
+
export type AgentFilter = 'all' | 'running' | 'failed' | 'done';
|
|
70
|
+
export declare const AGENT_FILTERS: readonly AgentFilter[];
|
|
71
|
+
/** Whether an agent belongs under a filter. `stopped` is listed under `all` only. */
|
|
72
|
+
export declare function agentMatches(agent: WorkflowRunAgent, filter: AgentFilter): boolean;
|
|
73
|
+
export interface AgentCounts {
|
|
74
|
+
total: number;
|
|
75
|
+
running: number;
|
|
76
|
+
failed: number;
|
|
77
|
+
done: number;
|
|
78
|
+
}
|
|
79
|
+
export declare function countAgents(agents: readonly WorkflowRunAgent[]): AgentCounts;
|
|
80
|
+
/** One group of the progress list: a phase and its agents, or the agents started before any phase. */
|
|
81
|
+
export interface AgentGroup {
|
|
82
|
+
/** `null`: the agents that belong to no phase. They come first and have no header. */
|
|
83
|
+
phase: WorkflowRunPhase | null;
|
|
84
|
+
agents: WorkflowRunAgent[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The agents grouped under their phases, in the run's phase order. An agent whose
|
|
88
|
+
* phase the list does not name gets a group of its own after the named ones, as a
|
|
89
|
+
* `phase()` title with no `meta.phases` entry does in Claude Code.
|
|
90
|
+
*/
|
|
91
|
+
export declare function groupAgents(run: Pick<WorkflowRun, 'phases' | 'agents'>): AgentGroup[];
|
|
92
|
+
/** `12s`, `3m 04s`, `1h 05m`. Seconds and minutes are zero-padded so a ticking label keeps its width. */
|
|
93
|
+
export declare function formatElapsed(ms: number): string;
|
|
94
|
+
/** How long a run or an agent took, or has taken by `now`; undefined when its start is unknown or it never ran. */
|
|
95
|
+
export declare function elapsedMs(item: {
|
|
96
|
+
startedAt?: number;
|
|
97
|
+
endedAt?: number;
|
|
98
|
+
}, live: boolean, now: number): number | undefined;
|
|
99
|
+
export type StructuredSummary = {
|
|
100
|
+
kind: 'object';
|
|
101
|
+
keys: number;
|
|
102
|
+
pretty: string;
|
|
103
|
+
} | {
|
|
104
|
+
kind: 'array';
|
|
105
|
+
items: number;
|
|
106
|
+
pretty: string;
|
|
107
|
+
} | {
|
|
108
|
+
kind: 'value';
|
|
109
|
+
pretty: string;
|
|
110
|
+
} | {
|
|
111
|
+
kind: 'text';
|
|
112
|
+
pretty: string;
|
|
113
|
+
};
|
|
114
|
+
/** A `structured` agent's summary: the JSON it holds, or its text when it does not parse (a cut answer). */
|
|
115
|
+
export declare function structuredSummary(summary: string): StructuredSummary;
|
|
116
|
+
export type WorkflowResult = {
|
|
117
|
+
kind: 'json';
|
|
118
|
+
text: string;
|
|
119
|
+
} | {
|
|
120
|
+
kind: 'markdown';
|
|
121
|
+
text: string;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* The script's return value in a finished call's output (`<workflow_result>…</workflow_result>`):
|
|
125
|
+
* pretty JSON when it parses as an object or a list, else Markdown. Null when the output has no
|
|
126
|
+
* result block (an older run, or a run that failed).
|
|
127
|
+
*/
|
|
128
|
+
export declare function parseWorkflowResult(output: string): WorkflowResult | null;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `workflow` tool's part metadata, parsed defensively, and the pure helpers
|
|
3
|
+
* its card draws from.
|
|
4
|
+
*
|
|
5
|
+
* The shape is `WorkflowRunMetadata` in `packages/api-contract/src/kortix-tool-card.ts`.
|
|
6
|
+
* `@kortix/ui` does not depend on that package, so the types are mirrored here
|
|
7
|
+
* and every field is checked. pi pushes it live with every change of the run,
|
|
8
|
+
* and the final copy when the call returns.
|
|
9
|
+
*/
|
|
10
|
+
const RUN_STATUSES = new Set(['running', 'done', 'failed', 'stopped']);
|
|
11
|
+
const PHASE_STATUSES = new Set(['pending', 'running', 'done', 'failed', 'stopped']);
|
|
12
|
+
const AGENT_STATUSES = new Set(['starting', 'running', 'done', 'failed', 'stopped']);
|
|
13
|
+
/** A run's rows stay a list a person can read; the rest is the session list's job. */
|
|
14
|
+
const MAX_AGENTS = 200;
|
|
15
|
+
/** The contract sends at most 5 `log()` lines; a longer list keeps the newest 5. */
|
|
16
|
+
const MAX_LOGS = 5;
|
|
17
|
+
const MAX_LOG_CHARS = 500;
|
|
18
|
+
const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
19
|
+
const text = (value) => typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
20
|
+
const time = (value) => typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
21
|
+
const count = (value) => typeof value === 'number' && Number.isFinite(value) && value >= 1 ? Math.floor(value) : undefined;
|
|
22
|
+
function phase(entry) {
|
|
23
|
+
if (!isObject(entry))
|
|
24
|
+
return undefined;
|
|
25
|
+
const title = text(entry.title);
|
|
26
|
+
return title && PHASE_STATUSES.has(entry.status)
|
|
27
|
+
? { title, status: entry.status }
|
|
28
|
+
: undefined;
|
|
29
|
+
}
|
|
30
|
+
function agent(entry, index) {
|
|
31
|
+
if (!isObject(entry) || !AGENT_STATUSES.has(entry.status))
|
|
32
|
+
return undefined;
|
|
33
|
+
const label = text(entry.label) ?? text(entry.agent);
|
|
34
|
+
if (!label)
|
|
35
|
+
return undefined;
|
|
36
|
+
const name = text(entry.agent);
|
|
37
|
+
const phaseTitle = text(entry.phase);
|
|
38
|
+
const sessionId = text(entry.sessionId);
|
|
39
|
+
const summary = text(entry.summary);
|
|
40
|
+
const model = text(entry.model);
|
|
41
|
+
const attempt = count(entry.attempt);
|
|
42
|
+
const startedAt = time(entry.startedAt);
|
|
43
|
+
const endedAt = time(entry.endedAt);
|
|
44
|
+
return {
|
|
45
|
+
id: text(entry.id) ?? `a${index + 1}`,
|
|
46
|
+
label,
|
|
47
|
+
...(name ? { agent: name } : {}),
|
|
48
|
+
...(phaseTitle ? { phase: phaseTitle } : {}),
|
|
49
|
+
status: entry.status,
|
|
50
|
+
...(sessionId ? { sessionId } : {}),
|
|
51
|
+
...(summary ? { summary } : {}),
|
|
52
|
+
...(entry.cached === true ? { cached: true } : {}),
|
|
53
|
+
...(model ? { model } : {}),
|
|
54
|
+
...(entry.structured === true ? { structured: true } : {}),
|
|
55
|
+
...(attempt !== undefined ? { attempt } : {}),
|
|
56
|
+
...(startedAt !== undefined ? { startedAt } : {}),
|
|
57
|
+
...(endedAt !== undefined ? { endedAt } : {}),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function logs(value) {
|
|
61
|
+
if (!Array.isArray(value))
|
|
62
|
+
return [];
|
|
63
|
+
return value
|
|
64
|
+
.map((line) => text(line))
|
|
65
|
+
.filter((line) => line !== undefined)
|
|
66
|
+
.slice(-MAX_LOGS)
|
|
67
|
+
.map((line) => line.slice(0, MAX_LOG_CHARS));
|
|
68
|
+
}
|
|
69
|
+
/** The run in a `workflow` call's metadata; `null` when the metadata is not a run. */
|
|
70
|
+
export function parseWorkflowRun(metadata) {
|
|
71
|
+
if (!isObject(metadata))
|
|
72
|
+
return null;
|
|
73
|
+
// A background call that handed its run to a runner may say `started`: the run runs.
|
|
74
|
+
if (metadata.status === 'started')
|
|
75
|
+
metadata = { ...metadata, status: 'running', agents: Array.isArray(metadata.agents) ? metadata.agents : [] };
|
|
76
|
+
if (!isObject(metadata) || !RUN_STATUSES.has(metadata.status))
|
|
77
|
+
return null;
|
|
78
|
+
if (!Array.isArray(metadata.agents))
|
|
79
|
+
return null;
|
|
80
|
+
const agents = [];
|
|
81
|
+
for (const [index, entry] of metadata.agents.slice(0, MAX_AGENTS).entries()) {
|
|
82
|
+
const parsed = agent(entry, index);
|
|
83
|
+
if (parsed)
|
|
84
|
+
agents.push(parsed);
|
|
85
|
+
}
|
|
86
|
+
const phases = Array.isArray(metadata.phases)
|
|
87
|
+
? metadata.phases.map(phase).filter((p) => p !== undefined)
|
|
88
|
+
: [];
|
|
89
|
+
const startedAt = time(metadata.startedAt);
|
|
90
|
+
const endedAt = time(metadata.endedAt);
|
|
91
|
+
const error = text(metadata.error);
|
|
92
|
+
const maxAgents = count(metadata.maxAgents);
|
|
93
|
+
const name = text(metadata.name);
|
|
94
|
+
const resumedFrom = text(metadata.resumedFrom);
|
|
95
|
+
// A background run names its runner session as `background.sessionId`, or (a started call's
|
|
96
|
+
// details) as `runnerSessionId` / `runner_session_id`.
|
|
97
|
+
const backgroundSession = (isObject(metadata.background) ? text(metadata.background.sessionId) : undefined) ??
|
|
98
|
+
text(metadata.runnerSessionId) ??
|
|
99
|
+
text(metadata.runner_session_id);
|
|
100
|
+
return {
|
|
101
|
+
runId: text(metadata.runId) ?? '',
|
|
102
|
+
title: text(metadata.title) ?? '',
|
|
103
|
+
status: metadata.status,
|
|
104
|
+
phases,
|
|
105
|
+
agents,
|
|
106
|
+
...(startedAt !== undefined ? { startedAt } : {}),
|
|
107
|
+
...(endedAt !== undefined ? { endedAt } : {}),
|
|
108
|
+
...(error ? { error } : {}),
|
|
109
|
+
...(maxAgents !== undefined ? { maxAgents } : {}),
|
|
110
|
+
...(name ? { name } : {}),
|
|
111
|
+
logs: logs(metadata.logs),
|
|
112
|
+
...(metadata.large === true ? { large: true } : {}),
|
|
113
|
+
...(resumedFrom ? { resumedFrom } : {}),
|
|
114
|
+
...(backgroundSession ? { background: { sessionId: backgroundSession } } : {}),
|
|
115
|
+
...(metadata.paused === true ? { paused: true } : {}),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** True for pi's `workflow` tool, under any of its spellings, and for no other name ending in `workflow`. */
|
|
119
|
+
export function isWorkflowTool(name) {
|
|
120
|
+
return name.replace(/^oc[-_]/, '') === 'workflow';
|
|
121
|
+
}
|
|
122
|
+
export const AGENT_FILTERS = ['all', 'running', 'failed', 'done'];
|
|
123
|
+
/** Whether an agent belongs under a filter. `stopped` is listed under `all` only. */
|
|
124
|
+
export function agentMatches(agent, filter) {
|
|
125
|
+
switch (filter) {
|
|
126
|
+
case 'all':
|
|
127
|
+
return true;
|
|
128
|
+
case 'running':
|
|
129
|
+
return agent.status === 'starting' || agent.status === 'running';
|
|
130
|
+
case 'failed':
|
|
131
|
+
return agent.status === 'failed';
|
|
132
|
+
case 'done':
|
|
133
|
+
return agent.status === 'done';
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
export function countAgents(agents) {
|
|
137
|
+
const counts = { total: agents.length, running: 0, failed: 0, done: 0 };
|
|
138
|
+
for (const agent of agents) {
|
|
139
|
+
if (agentMatches(agent, 'running'))
|
|
140
|
+
counts.running += 1;
|
|
141
|
+
else if (agent.status === 'failed')
|
|
142
|
+
counts.failed += 1;
|
|
143
|
+
else if (agent.status === 'done')
|
|
144
|
+
counts.done += 1;
|
|
145
|
+
}
|
|
146
|
+
return counts;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The agents grouped under their phases, in the run's phase order. An agent whose
|
|
150
|
+
* phase the list does not name gets a group of its own after the named ones, as a
|
|
151
|
+
* `phase()` title with no `meta.phases` entry does in Claude Code.
|
|
152
|
+
*/
|
|
153
|
+
export function groupAgents(run) {
|
|
154
|
+
const loose = [];
|
|
155
|
+
const byPhase = new Map();
|
|
156
|
+
for (const phase of run.phases)
|
|
157
|
+
if (!byPhase.has(phase.title))
|
|
158
|
+
byPhase.set(phase.title, []);
|
|
159
|
+
const extra = [];
|
|
160
|
+
for (const agent of run.agents) {
|
|
161
|
+
if (!agent.phase) {
|
|
162
|
+
loose.push(agent);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
let list = byPhase.get(agent.phase);
|
|
166
|
+
if (!list) {
|
|
167
|
+
list = [];
|
|
168
|
+
byPhase.set(agent.phase, list);
|
|
169
|
+
extra.push(agent.phase);
|
|
170
|
+
}
|
|
171
|
+
list.push(agent);
|
|
172
|
+
}
|
|
173
|
+
const groups = loose.length > 0 ? [{ phase: null, agents: loose }] : [];
|
|
174
|
+
const seen = new Set();
|
|
175
|
+
for (const phase of run.phases) {
|
|
176
|
+
if (seen.has(phase.title))
|
|
177
|
+
continue;
|
|
178
|
+
seen.add(phase.title);
|
|
179
|
+
groups.push({ phase, agents: byPhase.get(phase.title) ?? [] });
|
|
180
|
+
}
|
|
181
|
+
for (const title of extra) {
|
|
182
|
+
const agents = byPhase.get(title) ?? [];
|
|
183
|
+
groups.push({ phase: { title, status: derivedStatus(agents) }, agents });
|
|
184
|
+
}
|
|
185
|
+
return groups;
|
|
186
|
+
}
|
|
187
|
+
function derivedStatus(agents) {
|
|
188
|
+
if (agents.some((agent) => agentMatches(agent, 'running')))
|
|
189
|
+
return 'running';
|
|
190
|
+
if (agents.some((agent) => agent.status === 'failed'))
|
|
191
|
+
return 'failed';
|
|
192
|
+
return 'done';
|
|
193
|
+
}
|
|
194
|
+
// ── Time ─────────────────────────────────────────────────────────────────────
|
|
195
|
+
/** `12s`, `3m 04s`, `1h 05m`. Seconds and minutes are zero-padded so a ticking label keeps its width. */
|
|
196
|
+
export function formatElapsed(ms) {
|
|
197
|
+
const seconds = Math.max(0, Math.floor(ms / 1000));
|
|
198
|
+
if (seconds < 60)
|
|
199
|
+
return `${seconds}s`;
|
|
200
|
+
const minutes = Math.floor(seconds / 60);
|
|
201
|
+
if (minutes < 60)
|
|
202
|
+
return `${minutes}m ${String(seconds % 60).padStart(2, '0')}s`;
|
|
203
|
+
return `${Math.floor(minutes / 60)}h ${String(minutes % 60).padStart(2, '0')}m`;
|
|
204
|
+
}
|
|
205
|
+
/** How long a run or an agent took, or has taken by `now`; undefined when its start is unknown or it never ran. */
|
|
206
|
+
export function elapsedMs(item, live, now) {
|
|
207
|
+
if (item.startedAt === undefined)
|
|
208
|
+
return undefined;
|
|
209
|
+
if (item.endedAt !== undefined)
|
|
210
|
+
return Math.max(0, item.endedAt - item.startedAt);
|
|
211
|
+
return live ? Math.max(0, now - item.startedAt) : undefined;
|
|
212
|
+
}
|
|
213
|
+
/** A `structured` agent's summary: the JSON it holds, or its text when it does not parse (a cut answer). */
|
|
214
|
+
export function structuredSummary(summary) {
|
|
215
|
+
try {
|
|
216
|
+
const value = JSON.parse(summary);
|
|
217
|
+
const pretty = JSON.stringify(value, null, 2);
|
|
218
|
+
if (Array.isArray(value))
|
|
219
|
+
return { kind: 'array', items: value.length, pretty };
|
|
220
|
+
if (isObject(value))
|
|
221
|
+
return { kind: 'object', keys: Object.keys(value).length, pretty };
|
|
222
|
+
return { kind: 'value', pretty };
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
return { kind: 'text', pretty: summary };
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The script's return value in a finished call's output (`<workflow_result>…</workflow_result>`):
|
|
230
|
+
* pretty JSON when it parses as an object or a list, else Markdown. Null when the output has no
|
|
231
|
+
* result block (an older run, or a run that failed).
|
|
232
|
+
*/
|
|
233
|
+
export function parseWorkflowResult(output) {
|
|
234
|
+
const open = output.indexOf('<workflow_result>');
|
|
235
|
+
if (open === -1)
|
|
236
|
+
return null;
|
|
237
|
+
const start = open + '<workflow_result>'.length;
|
|
238
|
+
const close = output.indexOf('</workflow_result>', start);
|
|
239
|
+
const body = (close === -1 ? output.slice(start) : output.slice(start, close)).trim();
|
|
240
|
+
if (!body)
|
|
241
|
+
return null;
|
|
242
|
+
if (body.startsWith('{') || body.startsWith('[')) {
|
|
243
|
+
try {
|
|
244
|
+
return { kind: 'json', text: JSON.stringify(JSON.parse(body), null, 2) };
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
// A cut or hand-written block: show it as text.
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return { kind: 'markdown', text: body };
|
|
251
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolProps } from '../shared/types.js';
|
|
2
|
+
import { type ProjectSession } from '@kortix/sdk';
|
|
3
|
+
import { type WorkflowRun } from './workflow-run.js';
|
|
4
|
+
/**
|
|
5
|
+
* A live run read from this session's children: each `agent()` is a child session named after
|
|
6
|
+
* its label, started after the call. Null until the first child exists.
|
|
7
|
+
*/
|
|
8
|
+
export declare function runFromChildren(children: ProjectSession[], startedMs: number, input: unknown): WorkflowRun | null;
|
|
9
|
+
export declare function WorkflowTool(props: ToolProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Badge } from '../../../primitives/badge.js';
|
|
4
|
+
import { Hint } from '../../../primitives/hint.js';
|
|
5
|
+
import { TextShimmer } from '../../../primitives/text-shimmer.js';
|
|
6
|
+
import { errorToast } from '../../../primitives/toast.js';
|
|
7
|
+
import { SubagentDialog } from '../../agents/subagent-view.js';
|
|
8
|
+
import { GenericTool } from '../generic-tool.js';
|
|
9
|
+
import { BasicTool, partError, partMetadata, partOutput, partStatus, ToolOutcomeContext, ToolRunningContext, useToolIndent, } from '../shared/infrastructure.js';
|
|
10
|
+
import { FoldedSection, OutputBlock } from '../shared/output-block.js';
|
|
11
|
+
import { ToolRegistry } from '../shared/registry.js';
|
|
12
|
+
import { ToolError } from '../tool-error.js';
|
|
13
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
14
|
+
import { cn } from '../../../lib/utils.js';
|
|
15
|
+
import { FlowArrowIcon } from '@phosphor-icons/react';
|
|
16
|
+
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
17
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
18
|
+
import { qk, useProjectSession, useSessionChildren } from '@kortix/sdk/react';
|
|
19
|
+
import { stopProjectSession } from '@kortix/sdk';
|
|
20
|
+
import { useSessionIds } from '../../../providers/session-ids.js';
|
|
21
|
+
import { WorkflowLogs, WorkflowProgress } from './workflow-progress.js';
|
|
22
|
+
import { isLargeRun, LargeRunBadge, useLiveWorkflowRun, useRestartAgent, WorkflowRunControls, } from '../../agents/workflow-run-controls.js';
|
|
23
|
+
import { countAgents, elapsedMs, formatElapsed, isWorkflowTool, parseWorkflowResult, parseWorkflowRun, } from './workflow-run.js';
|
|
24
|
+
/**
|
|
25
|
+
* The card of pi's `workflow` tool: one script that runs several agents, each in
|
|
26
|
+
* its own child session. It is Claude Code's `/workflows` progress view, inside the chat.
|
|
27
|
+
*
|
|
28
|
+
* The run arrives as part metadata (`WorkflowRunMetadata` in
|
|
29
|
+
* `packages/api-contract/src/kortix-tool-card.ts`), pushed live with every change.
|
|
30
|
+
* The header says what runs and how far it got ("3 of 8 done · 1 failed · 2m 04s"),
|
|
31
|
+
* with a "Large run" chip past 25 agents and a "Resumed" chip for a relaunch. The
|
|
32
|
+
* body is the script's newest log lines, then the phases with their agents
|
|
33
|
+
* (`workflow-progress.tsx`): a row opens that agent's session in place, as a task
|
|
34
|
+
* row does (`SubagentDialog`), and a running row has a Stop button. A finished run
|
|
35
|
+
* folds the script's result away under "Result".
|
|
36
|
+
*
|
|
37
|
+
* A run started with `background: true` returned at once: its progress lives in its
|
|
38
|
+
* own runner session, so the card is one row that opens that session.
|
|
39
|
+
*
|
|
40
|
+
* A call that settled with metadata that is not a run renders as the generic card.
|
|
41
|
+
*/
|
|
42
|
+
function WorkflowTrigger({ title, subtitle, chips, live, }) {
|
|
43
|
+
return (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden text-sm", children: [live ? (_jsx(TextShimmer, { duration: 1, spread: 2, className: "min-w-0 truncate text-sm", children: title })) : (_jsx("span", { className: "text-foreground min-w-0 truncate", title: title, children: title })), chips, subtitle && (_jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate tabular-nums", title: subtitle, children: subtitle }))] }));
|
|
44
|
+
}
|
|
45
|
+
function RunChips({ run }) {
|
|
46
|
+
const t = useTranslations('tools.workflow');
|
|
47
|
+
const large = isLargeRun(run);
|
|
48
|
+
if (!large && !run.resumedFrom)
|
|
49
|
+
return null;
|
|
50
|
+
return (_jsxs(_Fragment, { children: [run.resumedFrom && (_jsx(Hint, { label: t('resumedHint'), side: "top", children: _jsx(Badge, { variant: "default", children: t('resumed') }) })), large && _jsx(LargeRunBadge, {})] }));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The way into a run's own session, at the right edge of the header. A `span
|
|
54
|
+
* role="button"`: the header renders inside the row's own `role="button"`, and a
|
|
55
|
+
* button inside a button is invalid HTML (the task row's "Full view" is the same).
|
|
56
|
+
*/
|
|
57
|
+
function OpenRunAction({ onOpen }) {
|
|
58
|
+
const t = useTranslations('tools.workflow');
|
|
59
|
+
return (_jsx("span", { role: "button", tabIndex: 0, "aria-label": t('openRunLabel'), onClick: (event) => {
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
onOpen();
|
|
62
|
+
}, onKeyDown: (event) => {
|
|
63
|
+
if (event.key !== 'Enter' && event.key !== ' ')
|
|
64
|
+
return;
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
onOpen();
|
|
68
|
+
}, className: "text-muted-foreground hover:text-foreground cursor-pointer text-xs whitespace-nowrap underline-offset-2 hover:underline", children: t('openRun') }));
|
|
69
|
+
}
|
|
70
|
+
/** The current time, every second while `active`: a live run's elapsed labels tick. */
|
|
71
|
+
function useNow(active) {
|
|
72
|
+
const [now, setNow] = useState(() => Date.now());
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!active)
|
|
75
|
+
return;
|
|
76
|
+
const timer = setInterval(() => setNow(Date.now()), 1_000);
|
|
77
|
+
return () => clearInterval(timer);
|
|
78
|
+
}, [active]);
|
|
79
|
+
return now;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A live run read from this session's children: each `agent()` is a child session named after
|
|
83
|
+
* its label, started after the call. Null until the first child exists.
|
|
84
|
+
*/
|
|
85
|
+
export function runFromChildren(children, startedMs, input) {
|
|
86
|
+
const mine = children.filter((child) => !Number.isFinite(startedMs) || Date.parse(child.created_at) >= startedMs - 5_000);
|
|
87
|
+
if (mine.length === 0)
|
|
88
|
+
return null;
|
|
89
|
+
const description = typeof input?.description === 'string' ? input.description : '';
|
|
90
|
+
return {
|
|
91
|
+
runId: '',
|
|
92
|
+
title: description,
|
|
93
|
+
status: 'running',
|
|
94
|
+
phases: [],
|
|
95
|
+
logs: [],
|
|
96
|
+
...(Number.isFinite(startedMs) ? { startedAt: startedMs } : {}),
|
|
97
|
+
agents: mine
|
|
98
|
+
.slice()
|
|
99
|
+
.sort((a, b) => Date.parse(a.created_at) - Date.parse(b.created_at))
|
|
100
|
+
.map((child, index) => {
|
|
101
|
+
const status = child.status === 'completed' ? 'done' : child.status === 'failed' ? 'failed' : 'running';
|
|
102
|
+
const created = Date.parse(child.created_at);
|
|
103
|
+
return {
|
|
104
|
+
id: `a${index + 1}`,
|
|
105
|
+
label: (child.name ?? '').replace(/\s*\([^)]*\)\s*$/, '') || child.agent_name || child.session_id.slice(0, 8),
|
|
106
|
+
...(child.agent_name ? { agent: child.agent_name } : {}),
|
|
107
|
+
status,
|
|
108
|
+
sessionId: child.session_id,
|
|
109
|
+
// A child that settled has no end time in the list: only a running one shows its elapsed time.
|
|
110
|
+
...(status === 'running' && Number.isFinite(created) ? { startedAt: created } : {}),
|
|
111
|
+
};
|
|
112
|
+
}),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export function WorkflowTool(props) {
|
|
116
|
+
const { call, defaultOpen, forceOpen, locked } = props;
|
|
117
|
+
const t = useTranslations('tools.workflow');
|
|
118
|
+
const tm = useTranslations('multiAgent.workflow');
|
|
119
|
+
const running = useContext(ToolRunningContext);
|
|
120
|
+
const status = partStatus(call);
|
|
121
|
+
const settled = status === 'completed' || status === 'error';
|
|
122
|
+
const metadata = partMetadata(call);
|
|
123
|
+
const parsed = useMemo(() => parseWorkflowRun(metadata), [metadata]);
|
|
124
|
+
// The session log carries a running call's run document only once the call settles, so a
|
|
125
|
+
// page that reads it (the v2 stream) has no live run. The run's agents are this session's
|
|
126
|
+
// children started since the call began: list them until the document arrives.
|
|
127
|
+
const ids = useSessionIds();
|
|
128
|
+
const startedMs = call.started_at ? Date.parse(call.started_at) : NaN;
|
|
129
|
+
const needChildren = !settled && !parsed && !!ids.projectId && !!ids.sessionId;
|
|
130
|
+
const { sessions: children } = useSessionChildren(ids.projectId ?? '', ids.sessionId ?? '', { enabled: needChildren, limit: 20 });
|
|
131
|
+
const cardRun = useMemo(() => parsed ?? (needChildren ? runFromChildren(children, startedMs, call.input) : null), [parsed, needChildren, children, startedMs, call.input]);
|
|
132
|
+
// A background run's progress lives on its runner's box: read it from there, so the card
|
|
133
|
+
// keeps updating after this session's turn ended (the call settled long ago).
|
|
134
|
+
const { run, controlSessionId, fromRunner } = useLiveWorkflowRun(ids.projectId, ids.sessionId, cardRun);
|
|
135
|
+
// A background run's own session: whether it still works says what the header reads.
|
|
136
|
+
const runner = useProjectSession(ids.projectId, run?.background?.sessionId, { enabled: !!run?.background && !fromRunner });
|
|
137
|
+
// Live: a foreground run while its call runs, or a background run its runner still runs.
|
|
138
|
+
const live = !!run && run.status === 'running' && (fromRunner || (!settled && !run.background && running));
|
|
139
|
+
const restart = useRestartAgent(ids.projectId, controlSessionId, live ? run : null);
|
|
140
|
+
const now = useNow(live);
|
|
141
|
+
const [open, setOpen] = useState(null);
|
|
142
|
+
const onOpen = useCallback((agent) => {
|
|
143
|
+
if (agent.sessionId)
|
|
144
|
+
setOpen({ sessionId: agent.sessionId, title: agent.agent ? `${agent.label} · ${agent.agent}` : agent.label });
|
|
145
|
+
}, []);
|
|
146
|
+
// Claude Code's `x` on an agent: stop that child session. The run sees the child stop and
|
|
147
|
+
// marks the agent `stopped`; until the next update the row shows the stop in flight.
|
|
148
|
+
const queryClient = useQueryClient();
|
|
149
|
+
const [stopping, setStopping] = useState(() => new Set());
|
|
150
|
+
const stopAgent = useMutation({
|
|
151
|
+
mutationFn: (agent) => stopProjectSession(ids.projectId, agent.sessionId),
|
|
152
|
+
onSuccess: () => {
|
|
153
|
+
if (ids.projectId)
|
|
154
|
+
void queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(ids.projectId) });
|
|
155
|
+
},
|
|
156
|
+
onError: (error, agent) => {
|
|
157
|
+
setStopping((previous) => {
|
|
158
|
+
const next = new Set(previous);
|
|
159
|
+
next.delete(agent.sessionId);
|
|
160
|
+
return next;
|
|
161
|
+
});
|
|
162
|
+
errorToast(t('stopFailed', { label: agent.label }), {
|
|
163
|
+
description: error instanceof Error ? error.message : undefined,
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
const { mutate: mutateStop } = stopAgent;
|
|
168
|
+
const { enabled: canRestart, restarting, restart: restartAgent } = restart;
|
|
169
|
+
const stop = useMemo(() => ({
|
|
170
|
+
enabled: !!ids.projectId,
|
|
171
|
+
pending: stopping,
|
|
172
|
+
stop: (agent) => {
|
|
173
|
+
if (!agent.sessionId)
|
|
174
|
+
return;
|
|
175
|
+
setStopping((previous) => new Set(previous).add(agent.sessionId));
|
|
176
|
+
mutateStop(agent);
|
|
177
|
+
},
|
|
178
|
+
...(canRestart ? { restart: { pending: restarting, run: restartAgent } } : {}),
|
|
179
|
+
}), [ids.projectId, stopping, mutateStop, canRestart, restarting, restartAgent]);
|
|
180
|
+
if (!isWorkflowTool(call.name) || (settled && !run)) {
|
|
181
|
+
return _jsx(GenericTool, { call: call, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked });
|
|
182
|
+
}
|
|
183
|
+
const icon = _jsx(FlowArrowIcon, { className: "size-4 shrink-0" });
|
|
184
|
+
if (!run) {
|
|
185
|
+
return (_jsx(BasicTool, { icon: icon, trigger: _jsx(WorkflowTrigger, { title: t('starting'), live: running }), defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked }));
|
|
186
|
+
}
|
|
187
|
+
const title = run.title || run.name || t('fallbackTitle');
|
|
188
|
+
const modal = open && (_jsx(SubagentDialog, { open: true, onOpenChange: (next) => {
|
|
189
|
+
if (!next)
|
|
190
|
+
setOpen(null);
|
|
191
|
+
}, sessionId: open.sessionId, title: open.title }));
|
|
192
|
+
if (run.background && !fromRunner) {
|
|
193
|
+
const runnerSession = run.background.sessionId;
|
|
194
|
+
const openRunner = () => setOpen({ sessionId: runnerSession, title });
|
|
195
|
+
const subtitle = runner.data?.working?.state === 'idle' ? t('backgroundIdle') : t('background');
|
|
196
|
+
return (_jsxs(_Fragment, { children: [_jsx(BasicTool, { icon: icon, trigger: _jsx(WorkflowTrigger, { title: title, subtitle: subtitle, chips: _jsx(RunChips, { run: run }), live: false }), triggerAction: _jsx(OpenRunAction, { onOpen: openRunner }), onClick: openRunner, locked: locked }), modal] }));
|
|
197
|
+
}
|
|
198
|
+
const counts = countAgents(run.agents);
|
|
199
|
+
const progress = counts.total > 0 ? t('progress', { done: counts.done, total: counts.total }) : undefined;
|
|
200
|
+
const failedPart = counts.failed > 0 ? t('failedSuffix', { count: counts.failed }) : undefined;
|
|
201
|
+
const runElapsed = elapsedMs(run, live, now);
|
|
202
|
+
const elapsed = runElapsed !== undefined && runElapsed >= 1_000 ? formatElapsed(runElapsed) : undefined;
|
|
203
|
+
const join = (...parts) => parts.filter(Boolean).join(' · ') || undefined;
|
|
204
|
+
const paused = run.paused ? tm('paused') : undefined;
|
|
205
|
+
const subtitle = run.status === 'running'
|
|
206
|
+
? // A call that returned while its run goes on: the run works on without this turn.
|
|
207
|
+
settled || run.background
|
|
208
|
+
? join(paused ?? t('background'), progress, failedPart)
|
|
209
|
+
: join(paused, progress, failedPart, elapsed)
|
|
210
|
+
: run.status === 'failed'
|
|
211
|
+
? (run.error?.split('\n')[0] ?? (counts.total > 0 ? t('failedCount', { failed: counts.failed, total: counts.total }) : undefined))
|
|
212
|
+
: run.status === 'stopped'
|
|
213
|
+
? join(t('status.stopped'), progress)
|
|
214
|
+
: join(counts.total === 0 ? undefined : counts.failed > 0 ? t('failedCount', { failed: counts.failed, total: counts.total }) : t('agents', { count: counts.total }), elapsed);
|
|
215
|
+
const callError = status === 'error' ? partError(call) : undefined;
|
|
216
|
+
const runError = run.error ?? callError;
|
|
217
|
+
const output = status === 'completed' ? partOutput(call) : '';
|
|
218
|
+
const result = output && run.status === 'done' ? parseWorkflowResult(output) : null;
|
|
219
|
+
// A failed or stopped run's output is its error block, which the error row above already says.
|
|
220
|
+
const rawOutput = !result && output && !output.trimStart().startsWith('<workflow_error>') ? output : '';
|
|
221
|
+
const hasProgress = run.agents.length > 0 || run.phases.length > 0;
|
|
222
|
+
const facts = [
|
|
223
|
+
run.name && run.name !== title ? t('savedName', { name: run.name }) : undefined,
|
|
224
|
+
run.status === 'running' && run.maxAgents ? t('upTo', { count: run.maxAgents }) : undefined,
|
|
225
|
+
].filter((fact) => !!fact);
|
|
226
|
+
return (
|
|
227
|
+
// A failed run leads with the shared failure triangle, as every failed call does. A
|
|
228
|
+
// completed call whose run did not fail is not a failure, whatever its output says.
|
|
229
|
+
_jsxs(ToolOutcomeContext.Provider, { value: run.status === 'failed' || status === 'error' ? 'failed' : 'ok', children: [_jsx(BasicTool, { icon: icon, trigger: _jsx(WorkflowTrigger, { title: title, subtitle: subtitle, chips: _jsx(RunChips, { run: run }), live: live }), defaultOpen: defaultOpen,
|
|
230
|
+
// A running run is the thing to watch, and a failure must not hide behind a closed
|
|
231
|
+
// row: either opens itself, so the rows say which agent is at work or broke.
|
|
232
|
+
forceOpen: forceOpen || (hasProgress && (run.status === 'running' || run.status === 'failed' || status === 'error')), locked: locked, children: _jsxs(_Fragment, { children: [_jsx(RunToolbar, { facts: facts, controls: live || (!!run.runId && !run.name && !!ids.sessionId) ? (_jsx(WorkflowRunControls, { projectId: ids.projectId, controlSessionId: live ? controlSessionId : undefined, ownerSessionId: ids.sessionId, run: run })) : null, onOpen: run.background ? () => setOpen({ sessionId: run.background.sessionId, title }) : undefined }), _jsx(WorkflowLogs, { logs: run.logs }), hasProgress && _jsx(WorkflowProgress, { run: run, live: live, now: now, onOpen: onOpen, stop: stop }), runError && run.status !== 'running' && _jsx(ToolError, { error: runError, toolName: call.name }), result ? _jsx(WorkflowResultFold, { result: result }) : rawOutput ? _jsx(WorkflowDetails, { output: rawOutput }) : null] }) }), modal] }));
|
|
233
|
+
}
|
|
234
|
+
/** The facts line and the run's controls, above the progress. A background run opens its runner session here too. */
|
|
235
|
+
function RunToolbar({ facts, controls, onOpen }) {
|
|
236
|
+
const t = useTranslations('tools.workflow');
|
|
237
|
+
const indent = useToolIndent();
|
|
238
|
+
if (facts.length === 0 && !controls && !onOpen)
|
|
239
|
+
return null;
|
|
240
|
+
return (_jsxs("div", { className: cn('flex min-h-6 items-center gap-2 text-xs', indent && 'mt-1.5', indent), children: [_jsx("p", { className: "text-muted-foreground min-w-0 flex-1 truncate", children: facts.join(' · ') }), onOpen && (_jsx("button", { type: "button", "aria-label": t('openRunLabel'), onClick: onOpen, className: "text-muted-foreground hover:text-foreground cursor-pointer whitespace-nowrap underline-offset-2 transition-colors hover:underline", children: t('openRun') })), controls] }));
|
|
241
|
+
}
|
|
242
|
+
/** The script's return value, folded: pretty JSON in mono, anything else as Markdown. */
|
|
243
|
+
function WorkflowResultFold({ result }) {
|
|
244
|
+
const t = useTranslations('tools.workflow');
|
|
245
|
+
const indent = useToolIndent();
|
|
246
|
+
return (_jsx("div", { className: cn(indent && 'mt-1.5', indent), children: _jsx(FoldedSection, { label: t('result'), children: _jsx(OutputBlock, { text: result.text, markdown: result.kind === 'markdown' }) }) }));
|
|
247
|
+
}
|
|
248
|
+
function WorkflowDetails({ output }) {
|
|
249
|
+
const t = useTranslations('tools.workflow');
|
|
250
|
+
const indent = useToolIndent();
|
|
251
|
+
return (_jsx("div", { className: cn(indent && 'mt-1.5', indent), children: _jsx(FoldedSection, { label: t('showDetails'), children: _jsx(OutputBlock, { text: output.length > 8_000 ? `${output.slice(0, 8_000)}\n…` : output }) }) }));
|
|
252
|
+
}
|
|
253
|
+
ToolRegistry.register('workflow', WorkflowTool);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NoticeBatchItem } from './subagent-notice.js';
|
|
2
|
+
/**
|
|
3
|
+
* Several notices the API coalesced into one delivered prompt
|
|
4
|
+
* (`session-notice-batch.ts`): background subagents that ended, teammates that
|
|
5
|
+
* went idle, sessions that answered a `notify_when_idle`. One header line ("3
|
|
6
|
+
* agents finished") and one compact row each, with no user bubble around them:
|
|
7
|
+
* nobody typed this turn.
|
|
8
|
+
*/
|
|
9
|
+
export declare function NoticeBatchGroup({ items, actions }: {
|
|
10
|
+
items: NoticeBatchItem[];
|
|
11
|
+
actions?: React.ReactNode;
|
|
12
|
+
}): import("react").JSX.Element;
|