@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,57 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useUnifiedTriggers } from '@kortix/sdk/react';
|
|
4
|
+
import { PlayIcon, TrashIcon } from '@phosphor-icons/react';
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { useLocale, useTranslations } from '../../i18n/index.js';
|
|
7
|
+
import { relativeTime } from '../../internal/lib/relative-time.js';
|
|
8
|
+
import { Button } from '../../primitives/button.js';
|
|
9
|
+
import { ButtonGroup } from '../../primitives/button-group.js';
|
|
10
|
+
import { ConfirmDialog } from '../../primitives/confirm-dialog.js';
|
|
11
|
+
import { Hint } from '../../primitives/hint.js';
|
|
12
|
+
import { InlineMeta } from '../../primitives/inline-meta.js';
|
|
13
|
+
import { Label } from '../../primitives/label.js';
|
|
14
|
+
import Loading from '../../primitives/loading.js';
|
|
15
|
+
import { Switch } from '../../primitives/switch.js';
|
|
16
|
+
import { errorToast } from '../../primitives/toast.js';
|
|
17
|
+
/** Source labels: the strings the trigger kinds already show, plus the merge. */
|
|
18
|
+
const SOURCE_KEY = {
|
|
19
|
+
schedule: 'textf4830a1dae29',
|
|
20
|
+
webhook: 'text4814f62c108d',
|
|
21
|
+
event: 'textca395c4d19b2',
|
|
22
|
+
app: 'text5441e7146193',
|
|
23
|
+
change_request: 'text5ffd973e20ed',
|
|
24
|
+
};
|
|
25
|
+
/** `true` for a row this page lists: runtime, and (on an agent's page) one that starts that agent. */
|
|
26
|
+
export function runtimeRowsFor(triggers, agentName) {
|
|
27
|
+
return triggers.filter((a) => a.origin === 'runtime' && (!agentName || (a.target.kind === 'agent' && a.target.agent === agentName)));
|
|
28
|
+
}
|
|
29
|
+
function scheduleText(source) {
|
|
30
|
+
if (source.type !== 'schedule')
|
|
31
|
+
return null;
|
|
32
|
+
return source.cron ?? source.every ?? null;
|
|
33
|
+
}
|
|
34
|
+
export function RuntimeTriggers({ projectId, agentName = null }) {
|
|
35
|
+
const t = useTranslations('hardcodedUi.i18nComplete');
|
|
36
|
+
const locale = useLocale();
|
|
37
|
+
const triggers = useUnifiedTriggers(projectId);
|
|
38
|
+
const [deleteTarget, setDeleteTarget] = useState(null);
|
|
39
|
+
const rows = runtimeRowsFor(triggers.data?.triggers ?? [], agentName);
|
|
40
|
+
if (rows.length === 0)
|
|
41
|
+
return null;
|
|
42
|
+
const onError = (error) => errorToast(error?.message ?? String(error));
|
|
43
|
+
const target = (a) => a.target.kind === 'session'
|
|
44
|
+
? t('text89919c510d89', { value0: a.target.session_name || a.target.session_id.slice(0, 8) })
|
|
45
|
+
: a.target.kind === 'agent'
|
|
46
|
+
? t('textba6393ea2b12', { value0: a.target.agent })
|
|
47
|
+
: t('textd7846b4e605e', { value0: a.target.app });
|
|
48
|
+
return (_jsxs("section", { className: "space-y-2 pt-4", children: [_jsxs("div", { className: "space-y-0.5", children: [_jsx(Label, { children: t.raw('text41bec5c0977c') }), _jsx("p", { className: "text-muted-foreground text-xs", children: t.raw('text8898c02a816e') })] }), _jsx("ul", { className: "space-y-2", children: rows.map((a) => {
|
|
49
|
+
const busy = (triggers.update.isPending && triggers.update.variables?.triggerId === a.id) ||
|
|
50
|
+
(triggers.run.isPending && triggers.run.variables?.triggerId === a.id);
|
|
51
|
+
return (_jsxs("li", { className: "bg-popover flex items-center gap-3 rounded-md border px-4 py-2", children: [_jsxs("div", { className: "min-w-0 flex-1 space-y-0.5", children: [_jsx("p", { className: "text-foreground truncate text-sm font-medium", children: a.name ?? a.prompt }), _jsxs(InlineMeta, { children: [_jsx("span", { children: t.raw(SOURCE_KEY[a.source.type]) }), scheduleText(a.source) ? _jsx("span", { className: "font-mono", children: scheduleText(a.source) }) : null, _jsx("span", { className: "truncate", children: target(a) }), a.state === 'active' && a.next_fire_at ? (_jsxs("span", { children: [t.raw('textb3c0ab96930c'), " ", relativeTime(a.next_fire_at, locale)] })) : null, _jsxs("span", { children: [t.raw('text512a48218ba2'), ' ', a.last_fired_at ? relativeTime(a.last_fired_at, locale) : t.raw('text6300ef800bb8')] })] }), a.last_error ? _jsx("p", { className: "text-destructive truncate text-xs", children: a.last_error }) : null] }), busy ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, _jsx(Switch, { checked: a.state === 'active', disabled: a.state === 'done' || busy, "aria-label": a.state === 'active' ? t.raw('text858e4ba7a29f') : t.raw('textd640c7421da0'), onCheckedChange: (enabled) => triggers.update.mutate({ triggerId: a.id, enabled }, { onError }) }), _jsxs(ButtonGroup, { children: [_jsx(Hint, { label: t.raw('text0991397702fa'), children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.raw('text0991397702fa'), disabled: busy, onClick: () => triggers.run.mutate({ triggerId: a.id }, { onError }), children: _jsx(PlayIcon, { className: "size-4 shrink-0" }) }) }), _jsx(Hint, { label: t.raw('texte2d0a54968ea'), children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.raw('texte2d0a54968ea'), onClick: () => setDeleteTarget(a), children: _jsx(TrashIcon, { className: "size-4 shrink-0" }) }) })] })] }, a.id));
|
|
52
|
+
}) }), _jsx(ConfirmDialog, { open: !!deleteTarget, onOpenChange: (next) => {
|
|
53
|
+
if (!next)
|
|
54
|
+
setDeleteTarget(null);
|
|
55
|
+
}, title: t.raw('text08a462df4350'), description: t.raw('textf4f30f5b483c'), confirmLabel: t.raw('texte2d0a54968ea'), confirmVariant: "destructive", isPending: triggers.remove.isPending, onConfirm: () => deleteTarget &&
|
|
56
|
+
triggers.remove.mutate({ triggerId: deleteTarget.id }, { onError, onSettled: () => setDeleteTarget(null) }) })] }));
|
|
57
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* JSON-schema `config_schema` and `payload_schema`; the UI never shows the wire
|
|
7
7
|
* id first and never asks a person to write JSON.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { adminPath } from '../../../lib/routes.js';
|
|
10
10
|
/* ─── Names ─────────────────────────────────────────────────────────────── */
|
|
11
11
|
/** `GITHUB_PULL_REQUEST_EVENT` -> `Github pull request event`. */
|
|
12
12
|
export function humanizeEventType(type) {
|
|
@@ -123,7 +123,7 @@ export function describeEventStatus(event, tI18nComplete, index) {
|
|
|
123
123
|
}
|
|
124
124
|
/** Where a person connects an account for a connector: the Connectors page, detail open. */
|
|
125
125
|
export function connectorHref(projectId, connector) {
|
|
126
|
-
const base =
|
|
126
|
+
const base = adminPath(projectId, 'connectors');
|
|
127
127
|
return connector ? `${base}?c=${encodeURIComponent(connector)}` : base;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useFeatureFlag, useProjectSpaces } from '@kortix/sdk/react';
|
|
4
|
-
import { capitalizeWords,
|
|
4
|
+
import { capitalizeWords, isMyKortixAgentName, MY_KORTIX_DISPLAY_NAME } from '../../../_vendor/kortix-shared.js';
|
|
5
5
|
import { HashIcon, LockSimpleIcon } from '@phosphor-icons/react';
|
|
6
6
|
import { useTranslations } from '../../../i18n/index.js';
|
|
7
7
|
import { AgentMark } from '../../../internal/components/agent-mark.js';
|
|
@@ -45,5 +45,5 @@ export function PostToField({ projectId, draft, patch, baseAccess, }) {
|
|
|
45
45
|
})] })] }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: t('postToHint', { channel: list.find((space) => space.is_default)?.slug ?? 'general' }) })] }));
|
|
46
46
|
}
|
|
47
47
|
function agentLabel(name) {
|
|
48
|
-
return
|
|
48
|
+
return isMyKortixAgentName(name) ? MY_KORTIX_DISPLAY_NAME : capitalizeWords(name);
|
|
49
49
|
}
|
|
@@ -15,16 +15,21 @@ import type { UiTranslator } from '../../../i18n/index.js';
|
|
|
15
15
|
* made these screens read as a config file.
|
|
16
16
|
*/
|
|
17
17
|
import type { ProjectTrigger } from '@kortix/sdk';
|
|
18
|
-
export type TriggerKind = 'cron' | 'webhook' | 'event' | 'app';
|
|
18
|
+
export type TriggerKind = 'cron' | 'webhook' | 'event' | 'app' | 'change_request';
|
|
19
19
|
/**
|
|
20
20
|
* The trigger kinds this screen lists. `ScheduleView` filters every list
|
|
21
21
|
* through this before it reaches the table, the row actions, or the detail
|
|
22
22
|
* sheet, so `trigger.type` is safe to treat as {@link TriggerKind} anywhere
|
|
23
|
-
* downstream of that filter. `app` (an
|
|
24
|
-
*
|
|
23
|
+
* downstream of that filter. `app` (an event that one of the project's Apps
|
|
24
|
+
* sends) and `change_request` (a merged change request) are listed, created
|
|
25
|
+
* and edited here, like the other kinds.
|
|
25
26
|
*/
|
|
26
27
|
export declare function isTriggerKind(type: ProjectTrigger['type']): type is TriggerKind;
|
|
27
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The kinds the composer offers, in its order. Every kind always shows: one
|
|
30
|
+
* the project cannot use yet (`event` with the flag `event_triggers` off,
|
|
31
|
+
* `app` with no App that sends events) says why in its panel.
|
|
32
|
+
*/
|
|
28
33
|
export declare const COMPOSER_KINDS: readonly TriggerKind[];
|
|
29
34
|
/** `every_seconds` as a sentence: "Every 5 minutes", "Every 2 hours". */
|
|
30
35
|
export declare function describeEvery(seconds: number): string;
|
|
@@ -54,7 +59,7 @@ export declare function describeOneOff(iso: string): string;
|
|
|
54
59
|
export declare function describeWhen(trigger: ProjectTrigger, eventNames?: ReadonlyMap<string, string>): string;
|
|
55
60
|
/** Exact cron occurrence and actual scheduled execution, explicitly in UTC. */
|
|
56
61
|
export declare function describeNextRun(trigger: ProjectTrigger): string | null;
|
|
57
|
-
/** Never blank: falls back to what the
|
|
62
|
+
/** Never blank: falls back to what the trigger does, then to its kind. */
|
|
58
63
|
export declare function triggerName(trigger: ProjectTrigger): string;
|
|
59
64
|
export type TriggerStatus = {
|
|
60
65
|
label: 'Active' | 'Paused';
|
|
@@ -124,7 +129,7 @@ export declare const KIND_COPY: Record<TriggerKind, KindCopy>;
|
|
|
124
129
|
*/
|
|
125
130
|
export declare const TRIGGERS_COPY: {
|
|
126
131
|
readonly title: "Triggers";
|
|
127
|
-
readonly description: "
|
|
132
|
+
readonly description: "Start agents or wake sessions on a schedule or an event.";
|
|
128
133
|
readonly noun: "trigger";
|
|
129
134
|
readonly createLabel: "New trigger";
|
|
130
135
|
readonly searchPlaceholder: "Search triggers";
|
|
@@ -5,14 +5,19 @@ import { describeEventTitle } from './event-trigger-copy.js';
|
|
|
5
5
|
* The trigger kinds this screen lists. `ScheduleView` filters every list
|
|
6
6
|
* through this before it reaches the table, the row actions, or the detail
|
|
7
7
|
* sheet, so `trigger.type` is safe to treat as {@link TriggerKind} anywhere
|
|
8
|
-
* downstream of that filter. `app` (an
|
|
9
|
-
*
|
|
8
|
+
* downstream of that filter. `app` (an event that one of the project's Apps
|
|
9
|
+
* sends) and `change_request` (a merged change request) are listed, created
|
|
10
|
+
* and edited here, like the other kinds.
|
|
10
11
|
*/
|
|
11
12
|
export function isTriggerKind(type) {
|
|
12
|
-
return type === 'cron' || type === 'webhook' || type === 'event' || type === 'app';
|
|
13
|
+
return type === 'cron' || type === 'webhook' || type === 'event' || type === 'app' || type === 'change_request';
|
|
13
14
|
}
|
|
14
|
-
/**
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The kinds the composer offers, in its order. Every kind always shows: one
|
|
17
|
+
* the project cannot use yet (`event` with the flag `event_triggers` off,
|
|
18
|
+
* `app` with no App that sends events) says why in its panel.
|
|
19
|
+
*/
|
|
20
|
+
export const COMPOSER_KINDS = ['cron', 'app', 'event', 'webhook', 'change_request'];
|
|
16
21
|
/** `every_seconds` as a sentence: "Every 5 minutes", "Every 2 hours". */
|
|
17
22
|
export function describeEvery(seconds) {
|
|
18
23
|
if (seconds % 3600 === 0)
|
|
@@ -161,6 +166,10 @@ export function describeOneOff(iso) {
|
|
|
161
166
|
export function describeWhen(trigger, eventNames) {
|
|
162
167
|
if (trigger.type === 'webhook')
|
|
163
168
|
return 'When a request arrives';
|
|
169
|
+
if (trigger.type === 'change_request') {
|
|
170
|
+
const base = trigger.filter?.base;
|
|
171
|
+
return typeof base === 'string' ? `When a change request merges into ${base}` : 'When a change request merges';
|
|
172
|
+
}
|
|
164
173
|
if (trigger.type === 'event')
|
|
165
174
|
return describeEventTitle(trigger.event, eventNames);
|
|
166
175
|
if (trigger.type === 'app') {
|
|
@@ -191,7 +200,7 @@ export function describeNextRun(trigger) {
|
|
|
191
200
|
return `Next run ${format(at)}${at.getTime() !== execution.getTime() ? ` · Scheduled execution ${format(execution)}` : ''}`;
|
|
192
201
|
}
|
|
193
202
|
/* ─── Names ─────────────────────────────────────────────────────────────── */
|
|
194
|
-
/** Never blank: falls back to what the
|
|
203
|
+
/** Never blank: falls back to what the trigger does, then to its kind. */
|
|
195
204
|
export function triggerName(trigger) {
|
|
196
205
|
const named = trigger.name?.trim();
|
|
197
206
|
if (named)
|
|
@@ -202,6 +211,8 @@ export function triggerName(trigger) {
|
|
|
202
211
|
return describeWhen(trigger);
|
|
203
212
|
if (trigger.type === 'app')
|
|
204
213
|
return describeWhen(trigger);
|
|
214
|
+
if (trigger.type === 'change_request')
|
|
215
|
+
return describeWhen(trigger);
|
|
205
216
|
return 'Untitled webhook';
|
|
206
217
|
}
|
|
207
218
|
export function triggerStatus(enabled, tI18nComplete) {
|
|
@@ -343,9 +354,19 @@ export const KIND_COPY = {
|
|
|
343
354
|
createLabel: 'New App event',
|
|
344
355
|
searchPlaceholder: 'Search App events',
|
|
345
356
|
emptyTitle: 'No App events yet',
|
|
346
|
-
emptyBody: '
|
|
357
|
+
emptyBody: 'Create one to have an agent run when one of your Apps sends an event.',
|
|
347
358
|
column: 'Status',
|
|
348
359
|
},
|
|
360
|
+
change_request: {
|
|
361
|
+
title: 'Change request merged',
|
|
362
|
+
description: 'Have an agent run when a change request merges.',
|
|
363
|
+
noun: 'change request trigger',
|
|
364
|
+
createLabel: 'New change request trigger',
|
|
365
|
+
searchPlaceholder: 'Search change request triggers',
|
|
366
|
+
emptyTitle: 'No change request triggers yet',
|
|
367
|
+
emptyBody: 'Create one to have an agent run when a change request merges.',
|
|
368
|
+
column: 'Branch',
|
|
369
|
+
},
|
|
349
370
|
};
|
|
350
371
|
/**
|
|
351
372
|
* The unified Triggers screen's own copy — the page that replaced the two
|
|
@@ -355,7 +376,7 @@ export const KIND_COPY = {
|
|
|
355
376
|
*/
|
|
356
377
|
export const TRIGGERS_COPY = {
|
|
357
378
|
title: 'Triggers',
|
|
358
|
-
description: '
|
|
379
|
+
description: 'Start agents or wake sessions on a schedule or an event.',
|
|
359
380
|
noun: 'trigger',
|
|
360
381
|
createLabel: 'New trigger',
|
|
361
382
|
searchPlaceholder: 'Search triggers',
|
|
@@ -34,7 +34,7 @@ import { agentDisplayLabel } from '../../../session/composer/session-chat-input.
|
|
|
34
34
|
import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
|
|
35
35
|
import { cn } from '../../../internal/lib/utils.js';
|
|
36
36
|
import { modelRefToKey, updateProjectTrigger } from '@kortix/sdk';
|
|
37
|
-
import { useProjectTriggerEventApps, useProjectTriggerEventTypes, useVisibleAgents, } from '@kortix/sdk/react';
|
|
37
|
+
import { useProjectApps, useProjectTriggerEventApps, useProjectTriggerEventTypes, useVisibleAgents, } from '@kortix/sdk/react';
|
|
38
38
|
import { BracketsCurlyIcon, DotsThreeIcon, PlayIcon, TrashIcon, XIcon, } from '@phosphor-icons/react';
|
|
39
39
|
import { useMutation } from '@tanstack/react-query';
|
|
40
40
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
@@ -45,7 +45,7 @@ import { PropertyList } from './schedule-fields.js';
|
|
|
45
45
|
import { ThenFields } from './then-fields.js';
|
|
46
46
|
import { EventCheckTimes } from './event-check-times.js';
|
|
47
47
|
import { TriggerCallouts } from './trigger-callouts.js';
|
|
48
|
-
import { findDraftApp, resolveProfile, validate, } from './trigger-composer-logic.js';
|
|
48
|
+
import { eventSendingApps, findDraftApp, resolveProfile, validate, } from './trigger-composer-logic.js';
|
|
49
49
|
import { draftFromTrigger, triggerPatch } from './trigger-edit-logic.js';
|
|
50
50
|
import { PostToField } from './post-to-field.js';
|
|
51
51
|
import { TriggerOptions } from './trigger-options.js';
|
|
@@ -54,6 +54,8 @@ import { TriggerRunsPanel } from './trigger-runs-panel.js';
|
|
|
54
54
|
import { TriggerTestDialog } from './trigger-test-dialog.js';
|
|
55
55
|
import { TriggerTile } from './trigger-tile.js';
|
|
56
56
|
import { useEventAppConnect } from './use-event-app-connect.js';
|
|
57
|
+
import { WhenApp } from './when-app.js';
|
|
58
|
+
import { WhenChangeRequest } from './when-change-request.js';
|
|
57
59
|
import { WhenEvent } from './when-event.js';
|
|
58
60
|
import { WhenEventSummary } from './when-event-summary.js';
|
|
59
61
|
import { WhenSchedule } from './when-schedule.js';
|
|
@@ -160,6 +162,8 @@ function SheetPanel({ projectId, trigger, controls, eventsEnabled, onRun, runnin
|
|
|
160
162
|
function SheetForm({ projectId, trigger, canWrite, eventsEnabled, appIndex, eventNames, agents, savedEventType, savedModel, apps, onMutated, surface, }) {
|
|
161
163
|
const t = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
162
164
|
const { add, canConnect } = useEventAppConnect(projectId);
|
|
165
|
+
// A null project id keeps the hook idle: only an App event trigger lists the project's Apps.
|
|
166
|
+
const kortixApps = eventSendingApps(useProjectApps(trigger.type === 'app' ? projectId : null).data);
|
|
163
167
|
// What the server holds, as a draft. A refetch that changes nothing changes nothing here.
|
|
164
168
|
const server = useMemo(() => draftFromTrigger(trigger, { eventType: savedEventType, model: savedModel }), [trigger, savedEventType, savedModel]);
|
|
165
169
|
const serverKey = JSON.stringify(server);
|
|
@@ -259,7 +263,7 @@ function SheetForm({ projectId, trigger, canWrite, eventsEnabled, appIndex, even
|
|
|
259
263
|
setServerConfig(null);
|
|
260
264
|
};
|
|
261
265
|
const editEvent = () => whenRef.current?.scrollIntoView({ block: 'start', behavior: 'smooth' });
|
|
262
|
-
return (_jsxs("div", { ref: bodyRef, className: "space-y-6", children: [_jsx(TriggerCallouts, { projectId: projectId, trigger: trigger, canEditEvent: canWrite && (app !== null || (!draft.appSlug && !draft.profile)), eventsEnabled: eventsEnabled, apps: appIndex, onEditEvent: editEvent }), _jsx(EventCheckTimes, { trigger: trigger }), canWrite ? (_jsxs(_Fragment, { children: [_jsxs("section", { ref: whenRef, "data-sheet-block": true, "data-block": "when", className: "space-y-3", children: [_jsx(Label, { children: t.raw('textcf9c7aa24a26') }), draft.kind === 'cron' ? (_jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') })) : draft.kind === 'webhook' ? (_jsx(WhenWebhookAddress, { trigger: trigger, draft: draft, patch: patch, canWrite: true })) : app || (!draft.appSlug && !draft.profile) ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(WhenEventSummary, { trigger: trigger, apps: appIndex, eventNames: eventNames, loading: apps.isLoading }))] }), _jsxs("section", { "data-sheet-block": true, "data-block": "then", className: "space-y-3", children: [_jsx(Label, { children: t.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { "data-sheet-block": true, "data-block": "name", className: "space-y-3", children: [_jsx(Label, { htmlFor: "trigger-name", children: t.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: t.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') ? true : undefined }), _jsx(InlineError, { message: blockError('name') }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: base.sessionAccess })] }), _jsx("section", { "data-sheet-block": true, "data-block": "options", children: _jsx(TriggerOptions, { edit: true, projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] })) : (_jsx(TriggerReadOnly, { trigger: trigger, apps: appIndex, eventNames: eventNames, agentLabel: agentDisplayLabel(agents, trigger.agent) })), _jsx("div", { className: "pb-8", children: _jsx(Details, { trigger: trigger }) }), dirty && canWrite ? (
|
|
266
|
+
return (_jsxs("div", { ref: bodyRef, className: "space-y-6", children: [_jsx(TriggerCallouts, { projectId: projectId, trigger: trigger, canEditEvent: canWrite && (app !== null || (!draft.appSlug && !draft.profile)), eventsEnabled: eventsEnabled, apps: appIndex, onEditEvent: editEvent }), _jsx(EventCheckTimes, { trigger: trigger }), canWrite ? (_jsxs(_Fragment, { children: [_jsxs("section", { ref: whenRef, "data-sheet-block": true, "data-block": "when", className: "space-y-3", children: [_jsx(Label, { children: t.raw('textcf9c7aa24a26') }), draft.kind === 'cron' ? (_jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') })) : draft.kind === 'webhook' ? (_jsx(WhenWebhookAddress, { trigger: trigger, draft: draft, patch: patch, canWrite: true })) : draft.kind === 'app' ? (_jsx(WhenApp, { apps: kortixApps, draft: draft, patch: patch, error: blockError('when') })) : draft.kind === 'change_request' ? (_jsx(WhenChangeRequest, { draft: draft, patch: patch })) : app || (!draft.appSlug && !draft.profile) ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(WhenEventSummary, { trigger: trigger, apps: appIndex, eventNames: eventNames, loading: apps.isLoading }))] }), _jsxs("section", { "data-sheet-block": true, "data-block": "then", className: "space-y-3", children: [_jsx(Label, { children: t.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { "data-sheet-block": true, "data-block": "name", className: "space-y-3", children: [_jsx(Label, { htmlFor: "trigger-name", children: t.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: t.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') ? true : undefined }), _jsx(InlineError, { message: blockError('name') }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: base.sessionAccess })] }), _jsx("section", { "data-sheet-block": true, "data-block": "options", children: _jsx(TriggerOptions, { edit: true, projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] })) : (_jsx(TriggerReadOnly, { trigger: trigger, apps: appIndex, eventNames: eventNames, agentLabel: agentDisplayLabel(agents, trigger.agent) })), _jsx("div", { className: "pb-8", children: _jsx(Details, { trigger: trigger }) }), dirty && canWrite ? (
|
|
263
267
|
/* In the sheet's own scroll container, after the body: it sticks to the
|
|
264
268
|
bottom edge while the form is long, and rests under the form when it is short. */
|
|
265
269
|
_jsx(SaveBar, { surface: surface, pending: save.isPending, onSave: submit, onDiscard: discard })) : null] }));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* testable without rendering.
|
|
6
6
|
*/
|
|
7
7
|
import type { UiTranslator } from '../../../i18n/index.js';
|
|
8
|
-
import type { ProjectTriggerEventType } from '@kortix/sdk';
|
|
8
|
+
import type { App, ProjectTriggerEventType, TriggerFilterValue } from '@kortix/sdk';
|
|
9
9
|
import type { ModelKey } from '@kortix/sdk/react';
|
|
10
10
|
import type { SharingSelection } from '../../../access/sharing-picker.js';
|
|
11
11
|
import { type ConfigDraft, type EventApp, type SchemaField } from './event-trigger-copy.js';
|
|
@@ -32,6 +32,12 @@ export interface ComposerDraft {
|
|
|
32
32
|
account: string | null;
|
|
33
33
|
eventType: ProjectTriggerEventType | null;
|
|
34
34
|
configDraft: ConfigDraft;
|
|
35
|
+
/** Slug of the project's App whose events fire the trigger. Null until one is picked. */
|
|
36
|
+
kortixApp: string | null;
|
|
37
|
+
/** The one event name the trigger fires on (`reply.received`). Empty = every event. */
|
|
38
|
+
appEvent: string;
|
|
39
|
+
/** The branch a merge must land on (kortix.yaml `filter.base`). Empty = any branch. */
|
|
40
|
+
crBase: string;
|
|
35
41
|
instruction: string;
|
|
36
42
|
agent: string | null;
|
|
37
43
|
model: ModelKey | null;
|
|
@@ -130,6 +136,25 @@ export declare function validate(draft: ComposerDraft, ctx: {
|
|
|
130
136
|
/** Editing a saved trigger: its app may be missing from the catalog, and a webhook keeps its signing key. */
|
|
131
137
|
edit?: boolean;
|
|
132
138
|
}, tI18nComplete: UiTranslator): ComposerProblem[];
|
|
139
|
+
/**
|
|
140
|
+
* The filter path that names an App event. The API stores an App event
|
|
141
|
+
* trigger's event as this one condition (`on.event` in kortix.yaml); without
|
|
142
|
+
* it the trigger fires on every event of the App.
|
|
143
|
+
*/
|
|
144
|
+
export declare const APP_EVENT_NAME_PATH = "event.name";
|
|
145
|
+
/**
|
|
146
|
+
* The Apps that can send events: every App Kortix runs. An external App
|
|
147
|
+
* (`external_url`) runs elsewhere and has no `KORTIX_APP_TOKEN`.
|
|
148
|
+
*/
|
|
149
|
+
export declare function eventSendingApps(apps: readonly App[] | undefined): App[];
|
|
150
|
+
/** The named event, trimmed. `*` means every event, as in kortix.yaml and the CLI. */
|
|
151
|
+
export declare function appEventName(draft: Pick<ComposerDraft, 'appEvent'>): string;
|
|
152
|
+
/**
|
|
153
|
+
* The filter Create and Save send: the conditions, plus `event.name` for an
|
|
154
|
+
* App event that names one event, plus `base` for a change request merged into
|
|
155
|
+
* one branch.
|
|
156
|
+
*/
|
|
157
|
+
export declare function triggerFilter(draft: Pick<ComposerDraft, 'kind' | 'appEvent' | 'conditions' | 'crBase'>): Record<string, TriggerFilterValue> | null;
|
|
133
158
|
/**
|
|
134
159
|
* The draft after an event is picked: its config resets to the event's
|
|
135
160
|
* defaults, and the instruction is prefilled only while it is empty or still
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { accountToWrite, appConnectors, configProblem, defaultEventName, defaultEventPrompt, selectedAccountLabel, } from './event-trigger-copy.js';
|
|
8
8
|
import { describeCadence, describeOneOff, } from './schedule-copy.js';
|
|
9
|
-
import { conditionNeedsValue } from './schedule-fields.js';
|
|
9
|
+
import { conditionNeedsValue, rowsToConditions } from './schedule-fields.js';
|
|
10
10
|
/** The sharing a space implies: a channel thread is project-visible; a DM thread is the viewer's. */
|
|
11
11
|
export function spaceTriggerAccess(kind, viewerId) {
|
|
12
12
|
return kind === 'dm' && viewerId
|
|
@@ -49,6 +49,9 @@ export function initialDraft(init) {
|
|
|
49
49
|
account: null,
|
|
50
50
|
eventType: null,
|
|
51
51
|
configDraft: {},
|
|
52
|
+
kortixApp: null,
|
|
53
|
+
appEvent: '',
|
|
54
|
+
crBase: '',
|
|
52
55
|
instruction: '',
|
|
53
56
|
agent: init.agent ?? null,
|
|
54
57
|
model: null,
|
|
@@ -102,7 +105,7 @@ export function slugify(input) {
|
|
|
102
105
|
.replace(/[^a-z0-9_-]+/g, '-')
|
|
103
106
|
.replace(/^-+|-+$/g, '')
|
|
104
107
|
.replace(/-{2,}/g, '-')
|
|
105
|
-
.slice(0, 128) || '
|
|
108
|
+
.slice(0, 128) || 'trigger');
|
|
106
109
|
}
|
|
107
110
|
/* ─── Name and summary ──────────────────────────────────────────────────── */
|
|
108
111
|
/** The name the field proposes: it follows the When block until the person types one. */
|
|
@@ -111,6 +114,16 @@ export function autoName(draft, tI18nComplete) {
|
|
|
111
114
|
return draft.eventType ? defaultEventName(draft.eventType) : '';
|
|
112
115
|
if (draft.kind === 'webhook')
|
|
113
116
|
return tI18nComplete.raw('text4814f62c108d');
|
|
117
|
+
if (draft.kind === 'change_request') {
|
|
118
|
+
const branch = draft.crBase.trim();
|
|
119
|
+
return branch ? tI18nComplete('texte608495c45ce', { branch }) : tI18nComplete.raw('text5ffd973e20ed');
|
|
120
|
+
}
|
|
121
|
+
if (draft.kind === 'app') {
|
|
122
|
+
if (!draft.kortixApp)
|
|
123
|
+
return '';
|
|
124
|
+
const event = appEventName(draft);
|
|
125
|
+
return event ? `${draft.kortixApp}: ${event}` : tI18nComplete('texte9b6dc29c812', { app: draft.kortixApp });
|
|
126
|
+
}
|
|
114
127
|
return draft.runAt ? describeOneOff(draft.runAt) : describeCadence(draft.cron);
|
|
115
128
|
}
|
|
116
129
|
export function triggerName(draft, tI18nComplete) {
|
|
@@ -142,6 +155,18 @@ export function summarize(draft, app,
|
|
|
142
155
|
agent, tI18nComplete) {
|
|
143
156
|
if (draft.kind === 'webhook')
|
|
144
157
|
return tI18nComplete('text18ae226f8a22', { agent });
|
|
158
|
+
if (draft.kind === 'change_request') {
|
|
159
|
+
const branch = draft.crBase.trim();
|
|
160
|
+
return branch ? tI18nComplete('text507c24b6792d', { branch, agent }) : tI18nComplete('text05ee1d6181f3', { agent });
|
|
161
|
+
}
|
|
162
|
+
if (draft.kind === 'app') {
|
|
163
|
+
if (!draft.kortixApp)
|
|
164
|
+
return tI18nComplete.raw('textf60eb7723e40');
|
|
165
|
+
const event = appEventName(draft);
|
|
166
|
+
return event
|
|
167
|
+
? tI18nComplete('text860e6ea2b98b', { app: draft.kortixApp, event, agent })
|
|
168
|
+
: tI18nComplete('text2def58884d12', { app: draft.kortixApp, agent });
|
|
169
|
+
}
|
|
145
170
|
if (draft.kind === 'event') {
|
|
146
171
|
if (!draft.eventType)
|
|
147
172
|
return tI18nComplete.raw('textf60eb7723e40');
|
|
@@ -175,6 +200,10 @@ export function validate(draft, ctx, tI18nComplete) {
|
|
|
175
200
|
}
|
|
176
201
|
}
|
|
177
202
|
}
|
|
203
|
+
else if (draft.kind === 'app') {
|
|
204
|
+
if (!draft.kortixApp)
|
|
205
|
+
add('when', tI18nComplete.raw('text69de76117f00'));
|
|
206
|
+
}
|
|
178
207
|
else if (draft.kind === 'cron') {
|
|
179
208
|
if (draft.runAt) {
|
|
180
209
|
if (Number.isNaN(Date.parse(draft.runAt)))
|
|
@@ -185,7 +214,7 @@ export function validate(draft, ctx, tI18nComplete) {
|
|
|
185
214
|
else if (!draft.cron.trim())
|
|
186
215
|
add('when', tI18nComplete.raw('texta1b7270dbe34'));
|
|
187
216
|
}
|
|
188
|
-
else if (!ctx.edit && !draft.signingKey.trim()) {
|
|
217
|
+
else if (draft.kind === 'webhook' && !ctx.edit && !draft.signingKey.trim()) {
|
|
189
218
|
add('when', tI18nComplete.raw('textc10cd37e5462'));
|
|
190
219
|
}
|
|
191
220
|
if (!draft.instruction.trim())
|
|
@@ -203,6 +232,38 @@ export function validate(draft, ctx, tI18nComplete) {
|
|
|
203
232
|
add('options', tI18nComplete.raw('text8f4597a69c3c'));
|
|
204
233
|
return problems;
|
|
205
234
|
}
|
|
235
|
+
/* ─── Kortix App event ──────────────────────────────────────────────────── */
|
|
236
|
+
/**
|
|
237
|
+
* The filter path that names an App event. The API stores an App event
|
|
238
|
+
* trigger's event as this one condition (`on.event` in kortix.yaml); without
|
|
239
|
+
* it the trigger fires on every event of the App.
|
|
240
|
+
*/
|
|
241
|
+
export const APP_EVENT_NAME_PATH = 'event.name';
|
|
242
|
+
/**
|
|
243
|
+
* The Apps that can send events: every App Kortix runs. An external App
|
|
244
|
+
* (`external_url`) runs elsewhere and has no `KORTIX_APP_TOKEN`.
|
|
245
|
+
*/
|
|
246
|
+
export function eventSendingApps(apps) {
|
|
247
|
+
return (apps ?? []).filter((app) => !app.external_url);
|
|
248
|
+
}
|
|
249
|
+
/** The named event, trimmed. `*` means every event, as in kortix.yaml and the CLI. */
|
|
250
|
+
export function appEventName(draft) {
|
|
251
|
+
const name = draft.appEvent.trim();
|
|
252
|
+
return name === '*' ? '' : name;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The filter Create and Save send: the conditions, plus `event.name` for an
|
|
256
|
+
* App event that names one event, plus `base` for a change request merged into
|
|
257
|
+
* one branch.
|
|
258
|
+
*/
|
|
259
|
+
export function triggerFilter(draft) {
|
|
260
|
+
const conditions = rowsToConditions(draft.conditions);
|
|
261
|
+
const event = draft.kind === 'app' ? appEventName(draft) : '';
|
|
262
|
+
const base = draft.kind === 'change_request' ? draft.crBase.trim() : '';
|
|
263
|
+
if (!event && !base)
|
|
264
|
+
return conditions;
|
|
265
|
+
return { ...conditions, ...(event ? { [APP_EVENT_NAME_PATH]: event } : {}), ...(base ? { base } : {}) };
|
|
266
|
+
}
|
|
206
267
|
/* ─── Event pick ────────────────────────────────────────────────────────── */
|
|
207
268
|
/**
|
|
208
269
|
* The draft after an event is picked: its config resets to the event's
|