@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
|
@@ -4,11 +4,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* New trigger: one "When → Then" composer.
|
|
5
5
|
*
|
|
6
6
|
* A trigger is one sentence. The modal shows all of it at once: when it
|
|
7
|
-
* starts (a schedule, an
|
|
7
|
+
* starts (a schedule, an event from one of the project's Apps, a connector
|
|
8
|
+
* event, a webhook, or a merged change request), what the agent does, a name,
|
|
8
9
|
* and the options with sane defaults folded away. There is no Next or Back, so
|
|
9
10
|
* the whole trigger is visible at every moment and the header sums it up in a
|
|
10
11
|
* sentence. Browsing an app's events creates nothing; Create adds the app's
|
|
11
12
|
* connector first when the project has none, then the trigger.
|
|
13
|
+
*
|
|
14
|
+
* Every source always shows. One the project cannot use yet says why in its
|
|
15
|
+
* panel and links to the fix: no App sends events (Apps), or connector events
|
|
16
|
+
* are off (the beta flag `event_triggers`, Project admin › Feature flags).
|
|
12
17
|
*/
|
|
13
18
|
import { Button } from '../../../primitives/button.js';
|
|
14
19
|
import { InfoBanner } from '../../../primitives/info-banner.js';
|
|
@@ -16,27 +21,31 @@ import { Input } from '../../../primitives/input.js';
|
|
|
16
21
|
import { Label } from '../../../primitives/label.js';
|
|
17
22
|
import Loading from '../../../primitives/loading.js';
|
|
18
23
|
import { Modal, ModalBody, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalTitle, } from '../../../primitives/modal.js';
|
|
24
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../primitives/select.js';
|
|
19
25
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../../../primitives/tabs.js';
|
|
20
26
|
import { successToast } from '../../../primitives/toast.js';
|
|
21
27
|
import { agentDisplayLabel } from '../../../session/composer/session-chat-input.js';
|
|
22
28
|
import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
|
|
23
29
|
import { useProjectFeatureFlags } from '../../../internal/lib/use-project-feature-flags.js';
|
|
24
|
-
import { useUiViewerId } from '../../../providers/ui-provider.js';
|
|
30
|
+
import { UiLink as Link, useUiViewerId } from '../../../providers/ui-provider.js';
|
|
31
|
+
import { uiRoutes } from '../../../lib/routes.js';
|
|
32
|
+
import { projectSettingsSectionHref } from '../../project-settings/project-settings-sections.js';
|
|
25
33
|
import { createProjectTrigger, upsertProjectSecret } from '@kortix/sdk';
|
|
26
|
-
import { modelKeyToWire, useProjectTriggerEventApps, useVisibleAgents } from '@kortix/sdk/react';
|
|
27
|
-
import { AppWindowIcon, LightningIcon, TimerIcon, WebhooksLogoIcon } from '@phosphor-icons/react';
|
|
34
|
+
import { modelKeyToWire, useProjectApps, useProjectTriggerEventApps, useVisibleAgents, } from '@kortix/sdk/react';
|
|
35
|
+
import { AppWindowIcon, GitMergeIcon, LightningIcon, TimerIcon, WebhooksLogoIcon } from '@phosphor-icons/react';
|
|
28
36
|
import { useMutation } from '@tanstack/react-query';
|
|
29
37
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
30
38
|
import { InlineError } from './composer-parts.js';
|
|
31
39
|
import { appConnectors, describeEventStatus, draftToConfig, eventAppTarget, parseConfigErrors, schemaFields, } from './event-trigger-copy.js';
|
|
32
|
-
import { describeCadence, describeOneOff } from './schedule-copy.js';
|
|
40
|
+
import { COMPOSER_KINDS, describeCadence, describeOneOff } from './schedule-copy.js';
|
|
33
41
|
import { triggerToastEntity } from './trigger-toast.js';
|
|
34
|
-
import { rowsToConditions } from './schedule-fields.js';
|
|
35
42
|
import { ThenFields } from './then-fields.js';
|
|
36
|
-
import { runCapFromInput, findDraftApp, initialDraft, normalizeSecretName, runCreate, slugify, spaceTriggerAccess, summarize, triggerConnection, triggerName, validate, withKind, } from './trigger-composer-logic.js';
|
|
43
|
+
import { runCapFromInput, eventSendingApps, findDraftApp, initialDraft, normalizeSecretName, runCreate, slugify, spaceTriggerAccess, summarize, triggerConnection, triggerFilter, triggerName, validate, withKind, } from './trigger-composer-logic.js';
|
|
37
44
|
import { PostToField } from './post-to-field.js';
|
|
38
45
|
import { TriggerOptions } from './trigger-options.js';
|
|
39
46
|
import { useEventAppConnect } from './use-event-app-connect.js';
|
|
47
|
+
import { WhenApp } from './when-app.js';
|
|
48
|
+
import { WhenChangeRequest } from './when-change-request.js';
|
|
40
49
|
import { WhenEvent } from './when-event.js';
|
|
41
50
|
import { WhenSchedule } from './when-schedule.js';
|
|
42
51
|
import { WhenWebhook } from './when-webhook.js';
|
|
@@ -64,21 +73,29 @@ const BLOCK_LABELS = {
|
|
|
64
73
|
event: LightningIcon,
|
|
65
74
|
webhook: WebhooksLogoIcon,
|
|
66
75
|
app: AppWindowIcon,
|
|
76
|
+
change_request: GitMergeIcon,
|
|
77
|
+
};
|
|
78
|
+
/** The source picker's labels (the words each kind shows elsewhere). */
|
|
79
|
+
const KIND_LABEL_KEY = {
|
|
80
|
+
cron: 'textf4830a1dae29',
|
|
81
|
+
app: 'text5441e7146193',
|
|
82
|
+
event: 'textca395c4d19b2',
|
|
83
|
+
webhook: 'text4814f62c108d',
|
|
67
84
|
};
|
|
85
|
+
/** A source this project cannot use yet: one sentence on why, and the link that fixes it. */
|
|
86
|
+
function Unavailable({ children, action }) {
|
|
87
|
+
return (_jsx(InfoBanner, { tone: "info", className: "text-xs", action: action, children: children }));
|
|
88
|
+
}
|
|
68
89
|
function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null, initialKind = null, initialApp = null, initialConnector = null, initialSpace = null, onBusyChange, }) {
|
|
69
90
|
const viewerId = useUiViewerId();
|
|
70
91
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
71
92
|
const tComposer = useI18nTranslations('triggerComposer');
|
|
72
|
-
//
|
|
73
|
-
//
|
|
93
|
+
// Connector events are a beta feature behind the project flag `event_triggers`. Off: the tab
|
|
94
|
+
// stays and its panel says how to turn it on; no catalog request is sent.
|
|
74
95
|
const eventsOn = useProjectFeatureFlags(projectId).flags.event_triggers === true;
|
|
75
96
|
const [draft, setDraft] = useState(() => ({
|
|
76
97
|
...initialDraft({
|
|
77
|
-
kind:
|
|
78
|
-
? (initialKind ?? (initialApp || initialConnector ? 'event' : null))
|
|
79
|
-
: initialKind === 'event'
|
|
80
|
-
? null
|
|
81
|
-
: initialKind,
|
|
98
|
+
kind: initialKind ?? (initialApp || initialConnector ? 'event' : null),
|
|
82
99
|
agent: initialAgent,
|
|
83
100
|
appSlug: initialApp?.app ?? null,
|
|
84
101
|
appSource: initialApp?.source ?? initialApp?.provider ?? null,
|
|
@@ -104,6 +121,13 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
104
121
|
const agents = useVisibleAgents({ projectId });
|
|
105
122
|
// A null project id keeps the hook idle: with events off nothing asks for the catalog.
|
|
106
123
|
const apps = useProjectTriggerEventApps(eventsOn ? projectId : null);
|
|
124
|
+
// App events need no flag; with no App that can send one, the panel says so and links to Apps.
|
|
125
|
+
const projectApps = useProjectApps(projectId);
|
|
126
|
+
const kortixApps = eventSendingApps(projectApps.data);
|
|
127
|
+
const appsHref = uiRoutes().apps(projectId);
|
|
128
|
+
// A source the project cannot use yet: its panel says why, and Create waits.
|
|
129
|
+
const unavailable = (draft.kind === 'event' && !eventsOn) ||
|
|
130
|
+
(draft.kind === 'app' && kortixApps.length === 0 && !draft.kortixApp && !projectApps.isLoading);
|
|
107
131
|
const { add, canConnect } = useEventAppConnect(projectId);
|
|
108
132
|
// Create adds the app's connector, which refreshes the app list. Hold the
|
|
109
133
|
// app as it was at the click so the form does not rearrange under the spinner.
|
|
@@ -156,6 +180,7 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
156
180
|
const slug = slugify(draft.customId.trim() || trimmedName);
|
|
157
181
|
const isCron = draft.kind === 'cron';
|
|
158
182
|
const isEvent = draft.kind === 'event';
|
|
183
|
+
const isApp = draft.kind === 'app';
|
|
159
184
|
let secretEnv;
|
|
160
185
|
if (draft.kind === 'webhook') {
|
|
161
186
|
secretEnv =
|
|
@@ -171,7 +196,7 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
171
196
|
});
|
|
172
197
|
}
|
|
173
198
|
const needsConnector = isEvent && app !== null && appConnectors(app).length === 0;
|
|
174
|
-
const filter =
|
|
199
|
+
const filter = triggerFilter(draft);
|
|
175
200
|
return runCreate({
|
|
176
201
|
addConnector: needsConnector && app
|
|
177
202
|
? async () => {
|
|
@@ -211,13 +236,18 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
211
236
|
event: draft.eventType?.type,
|
|
212
237
|
event_config: draftToConfig(configFields, draft.configDraft),
|
|
213
238
|
}
|
|
214
|
-
:
|
|
239
|
+
: isApp
|
|
240
|
+
? { app: draft.kortixApp ?? undefined }
|
|
241
|
+
: draft.kind === 'change_request'
|
|
242
|
+
? {}
|
|
243
|
+
: { secret_env: secretEnv }),
|
|
215
244
|
}),
|
|
216
245
|
});
|
|
217
246
|
},
|
|
218
247
|
onSuccess: (listing) => {
|
|
219
248
|
const isEvent = draft.kind === 'event';
|
|
220
249
|
const isCron = draft.kind === 'cron';
|
|
250
|
+
const isApp = draft.kind === 'app';
|
|
221
251
|
const created = listing.triggers
|
|
222
252
|
.filter((t) => t.type === draft.kind && t.name === name.trim())
|
|
223
253
|
.slice(-1)[0];
|
|
@@ -226,11 +256,14 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
226
256
|
? describeOneOff(draft.runAt)
|
|
227
257
|
: describeCadence(draft.cron.trim())
|
|
228
258
|
: undefined;
|
|
229
|
-
|
|
259
|
+
const isChangeRequest = draft.kind === 'change_request';
|
|
260
|
+
successToast(isEvent || isApp
|
|
230
261
|
? tI18nComplete.raw('text840993da3129')
|
|
231
262
|
: isCron
|
|
232
263
|
? tI18nComplete.raw('text84e98b45ad8b')
|
|
233
|
-
:
|
|
264
|
+
: isChangeRequest
|
|
265
|
+
? tI18nComplete.raw('text80ca527b0d55')
|
|
266
|
+
: tI18nComplete.raw('text20bf63f7b46f'), {
|
|
234
267
|
entity: triggerToastEntity({ name: name.trim(), type: draft.kind }, cadence),
|
|
235
268
|
description: isEvent
|
|
236
269
|
? created?.event
|
|
@@ -239,7 +272,7 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
239
272
|
: (describeEventStatus(created.event, tI18nComplete).detail ??
|
|
240
273
|
tI18nComplete.raw('text80273a6c8918'))
|
|
241
274
|
: undefined
|
|
242
|
-
: isCron
|
|
275
|
+
: isCron || isApp || isChangeRequest
|
|
243
276
|
? undefined
|
|
244
277
|
: tI18nComplete.raw('text4aded5c6750d'),
|
|
245
278
|
});
|
|
@@ -281,5 +314,9 @@ function ComposerForm({ projectId, onOpenChange, onCreated, initialAgent = null,
|
|
|
281
314
|
const Icon = BLOCK_LABELS[kind];
|
|
282
315
|
return _jsx(Icon, { className: "size-3.5 shrink-0", weight: "fill" });
|
|
283
316
|
};
|
|
284
|
-
|
|
317
|
+
const kindLabel = (kind) => kind === 'change_request' ? tComposer('crTab') : tI18nComplete.raw(KIND_LABEL_KEY[kind]);
|
|
318
|
+
const pickKind = (kind) => setDraft((d) => withKind(d, kind));
|
|
319
|
+
return (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { className: "pr-12 pb-3", children: [_jsx(ModalTitle, { children: tI18nComplete.raw('texta38f4ea67a30') }), _jsx(ModalDescription, { className: "text-pretty", "aria-live": "polite", children: summarize(draft, app, agentDisplayLabel(agents, draft.agent), tI18nComplete) })] }), _jsx(ModalBody, { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4 lg:max-h-[min(calc(100dvh-13rem),44rem)] lg:flex-none", children: _jsxs("div", { ref: bodyRef, className: "space-y-8", children: [_jsxs("section", { "data-block": "when", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('textcf9c7aa24a26') }), _jsxs(Tabs, { value: draft.kind, onValueChange: pickKind, children: [_jsxs(Select, { value: draft.kind, onValueChange: pickKind, children: [_jsx(SelectTrigger, { className: "w-full cursor-pointer text-sm lg:hidden", "aria-label": tI18nComplete.raw('textcf9c7aa24a26'), children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: COMPOSER_KINDS.map((kind) => (_jsx(SelectItem, { value: kind, className: "cursor-pointer", children: _jsxs("span", { className: "flex items-center gap-1.5", children: [tabIcon(kind), kindLabel(kind)] }) }, kind))) })] }), _jsx(TabsList, { className: "hidden w-full lg:flex", children: COMPOSER_KINDS.map((kind) => (_jsxs(TabsTrigger, { value: kind, className: "flex-1 gap-1.5", children: [tabIcon(kind), kindLabel(kind)] }, kind))) }), _jsx(TabsContent, { value: "cron", className: "pt-3", children: _jsx(WhenSchedule, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "app", className: "pt-3", children: kortixApps.length > 0 || draft.kortixApp || projectApps.isLoading ? (_jsx(WhenApp, { apps: kortixApps, draft: draft, patch: patch, error: blockError('when') })) : (_jsx(Unavailable, { action: appsHref ? (_jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: appsHref, children: tComposer('openApps') }) })) : null, children: tComposer.rich('noApps', {
|
|
320
|
+
code: (chunks) => (_jsx("code", { className: "bg-muted text-foreground rounded-sm px-1 py-0.5 font-mono text-xs", children: chunks })),
|
|
321
|
+
}) })) }), _jsx(TabsContent, { value: "event", className: "pt-3", children: eventsOn ? (_jsx(WhenEvent, { projectId: projectId, apps: apps, draft: draft, patch: patch, setDraft: setDraft, configFields: configFields, configErrors: configErrors, canConnect: canConnect, error: blockError('when') })) : (_jsx(Unavailable, { action: _jsx(Button, { asChild: true, size: "sm", variant: "outline", children: _jsx(Link, { href: projectSettingsSectionHref(projectId, 'feature-flags'), children: tI18nComplete.raw('text20a2e59ba129') }) }), children: tComposer('eventsOff') })) }), _jsx(TabsContent, { value: "webhook", className: "pt-3", children: _jsx(WhenWebhook, { draft: draft, patch: patch, error: blockError('when') }) }), _jsx(TabsContent, { value: "change_request", className: "pt-3", children: _jsx(WhenChangeRequest, { draft: draft, patch: patch }) })] })] }), _jsxs("section", { "data-block": "then", className: "space-y-3", children: [_jsx(SectionTitle, { children: tI18nComplete.raw('text0597f441dcca') }), _jsx(ThenFields, { agents: agents, draft: draft, patch: patch, payloadSchema: draft.eventType?.payload_schema, error: blockError('then') })] }), _jsxs("section", { className: "space-y-3", children: [_jsx(SectionTitle, { children: tComposer('details') }), _jsxs("div", { "data-block": "name", className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-name", className: "text-xs", children: tI18nComplete.raw('textdcd1d5223f73') }), _jsx(Input, { id: "trigger-name", value: name, onChange: (e) => patch({ nameOverride: e.target.value }), placeholder: tI18nComplete.raw('textc8cf587a3b6c'), maxLength: 64, "aria-invalid": blockError('name') || nameError ? true : undefined }), _jsx(InlineError, { message: blockError('name') ?? nameError })] }), _jsx(PostToField, { projectId: projectId, draft: draft, patch: patch, baseAccess: initialDraft({}).sessionAccess }), _jsx("div", { "data-block": "options", children: _jsx(TriggerOptions, { projectId: projectId, draft: draft, patch: patch, name: name, open: optionsOpen, onOpenChange: setOptionsOpen, error: blockError('options') }) })] }), error ? (_jsx("div", { ref: errorRef, children: _jsx(InfoBanner, { tone: "destructive", className: "text-xs", children: error }) })) : null] }) }), _jsxs(ModalFooter, { className: "mt-0 shrink-0 flex-row gap-2 border-t px-5 py-3 sm:space-x-0", children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: create.isPending, onClick: () => onOpenChange(false), children: tI18nComplete.raw('text19766ed6ccb2') }), _jsxs(Button, { size: "sm", className: "gap-1.5", onClick: submit, disabled: create.isPending || unavailable, children: [create.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tI18nComplete.raw('texte18bbdd15a81')] })] })] }));
|
|
285
322
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { modelKeyToWire } from '@kortix/sdk/react';
|
|
7
7
|
import { configToDraft, draftToConfig, humanizeEventType, schemaFields, } from './event-trigger-copy.js';
|
|
8
|
-
import { conditionsToRows,
|
|
9
|
-
import { initialDraft, runCapFromInput } from './trigger-composer-logic.js';
|
|
8
|
+
import { conditionsToRows, sameConditions } from './schedule-fields.js';
|
|
9
|
+
import { APP_EVENT_NAME_PATH, initialDraft, runCapFromInput, triggerFilter } from './trigger-composer-logic.js';
|
|
10
10
|
/** The event type the catalog has no entry for: enough to name it and keep its saved config. */
|
|
11
11
|
function stubEventType(event) {
|
|
12
12
|
return {
|
|
@@ -22,6 +22,11 @@ function stubEventType(event) {
|
|
|
22
22
|
/** The saved trigger as a draft. `eventType` is the catalog entry for an event trigger, when it loaded. */
|
|
23
23
|
export function draftFromTrigger(trigger, saved) {
|
|
24
24
|
const event = trigger.event;
|
|
25
|
+
// An App event's event name is its `event.name` condition: the When block shows it, not the conditions.
|
|
26
|
+
const { [APP_EVENT_NAME_PATH]: appEvent, base: crBase } = trigger.filter ?? {};
|
|
27
|
+
const named = trigger.type === 'app' && typeof appEvent === 'string';
|
|
28
|
+
// A change request's branch is its `base` condition: the When block shows it, not the conditions.
|
|
29
|
+
const branch = trigger.type === 'change_request' && typeof crBase === 'string' ? crBase : null;
|
|
25
30
|
const eventType = event ? (saved.eventType ?? stubEventType(event)) : null;
|
|
26
31
|
return {
|
|
27
32
|
...initialDraft({ kind: trigger.type, agent: trigger.agent }),
|
|
@@ -36,13 +41,18 @@ export function draftFromTrigger(trigger, saved) {
|
|
|
36
41
|
configDraft: eventType
|
|
37
42
|
? configToDraft(schemaFields(eventType.config_schema), event?.config ?? {})
|
|
38
43
|
: {},
|
|
44
|
+
kortixApp: trigger.type === 'app' ? (trigger.app ?? null) : null,
|
|
45
|
+
appEvent: named ? appEvent : '',
|
|
46
|
+
crBase: branch ?? '',
|
|
39
47
|
instruction: trigger.prompt_template,
|
|
40
48
|
model: saved.model,
|
|
41
49
|
nameOverride: trigger.name,
|
|
42
50
|
mode: trigger.session_mode,
|
|
43
51
|
pinnedSessionId: trigger.session_id,
|
|
44
52
|
sessionKey: trigger.session_key ?? '',
|
|
45
|
-
conditions: conditionsToRows(
|
|
53
|
+
conditions: conditionsToRows(named || branch !== null
|
|
54
|
+
? Object.fromEntries(Object.entries(trigger.filter ?? {}).filter(([path]) => !(named && path === APP_EVENT_NAME_PATH) && !(branch !== null && path === 'base')))
|
|
55
|
+
: trigger.filter),
|
|
46
56
|
secretName: trigger.secret_env ?? '',
|
|
47
57
|
startActive: trigger.enabled,
|
|
48
58
|
sessionAccess: trigger.session_access,
|
|
@@ -88,8 +98,11 @@ export function triggerPatch(saved, draft) {
|
|
|
88
98
|
: { cron: draft.cron.trim(), run_at: null, timezone: draft.timezone });
|
|
89
99
|
}
|
|
90
100
|
}
|
|
91
|
-
else if (!sameConditions(
|
|
92
|
-
out.filter =
|
|
101
|
+
else if (!sameConditions(triggerFilter(draft), triggerFilter(saved))) {
|
|
102
|
+
out.filter = triggerFilter(draft);
|
|
103
|
+
}
|
|
104
|
+
if (draft.kind === 'app' && draft.kortixApp && draft.kortixApp !== saved.kortixApp) {
|
|
105
|
+
out.app = draft.kortixApp;
|
|
93
106
|
}
|
|
94
107
|
if (draft.kind === 'webhook') {
|
|
95
108
|
const secret = draft.secretName.trim();
|
|
@@ -11,6 +11,16 @@ export type TriggerFilter = 'all' | TriggerKind;
|
|
|
11
11
|
export declare const TRIGGER_FILTERS: readonly TriggerFilter[];
|
|
12
12
|
/** An unknown or missing `?type=` is `all`, and so is one the page does not offer (`event` while events are off). */
|
|
13
13
|
export declare function parseTriggerFilter(value: string | null | undefined, offered?: readonly TriggerFilter[]): TriggerFilter;
|
|
14
|
+
/**
|
|
15
|
+
* Whether `trigger` starts `agentName`. A trigger that names no agent is
|
|
16
|
+
* stored as `default` (the manifest sentinel, `apps/api/src/projects/lib/
|
|
17
|
+
* triggers.ts`), which means "the project's default agent" — so the default
|
|
18
|
+
* agent's page owns those rows too, or a trigger created with the agent left
|
|
19
|
+
* on its default would show up nowhere.
|
|
20
|
+
*/
|
|
21
|
+
export declare function triggerStartsAgent(trigger: Pick<ProjectTrigger, 'agent'>, agentName: string, defaultAgent: string | null | undefined): boolean;
|
|
22
|
+
/** The triggers that start `agentName` — the Triggers page in agent scope. */
|
|
23
|
+
export declare function triggersForAgent<T extends Pick<ProjectTrigger, 'agent'>>(triggers: readonly T[], agentName: string, defaultAgent?: string | null | undefined): T[];
|
|
14
24
|
export declare function filterTriggers(triggers: ProjectTrigger[], filter: TriggerFilter): ProjectTrigger[];
|
|
15
25
|
export interface TriggerAppGroup {
|
|
16
26
|
/** Provider app slug, falling back to the connector slug. */
|
|
@@ -10,6 +10,22 @@ export const TRIGGER_FILTERS = ['all', 'cron', 'event', 'app', 'webhook'];
|
|
|
10
10
|
export function parseTriggerFilter(value, offered = TRIGGER_FILTERS) {
|
|
11
11
|
return offered.find((f) => f === value) ?? 'all';
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Whether `trigger` starts `agentName`. A trigger that names no agent is
|
|
15
|
+
* stored as `default` (the manifest sentinel, `apps/api/src/projects/lib/
|
|
16
|
+
* triggers.ts`), which means "the project's default agent" — so the default
|
|
17
|
+
* agent's page owns those rows too, or a trigger created with the agent left
|
|
18
|
+
* on its default would show up nowhere.
|
|
19
|
+
*/
|
|
20
|
+
export function triggerStartsAgent(trigger, agentName, defaultAgent) {
|
|
21
|
+
if (trigger.agent === agentName)
|
|
22
|
+
return true;
|
|
23
|
+
return trigger.agent === 'default' && !!defaultAgent && defaultAgent === agentName;
|
|
24
|
+
}
|
|
25
|
+
/** The triggers that start `agentName` — the Triggers page in agent scope. */
|
|
26
|
+
export function triggersForAgent(triggers, agentName, defaultAgent = null) {
|
|
27
|
+
return triggers.filter((trigger) => triggerStartsAgent(trigger, agentName, defaultAgent));
|
|
28
|
+
}
|
|
13
29
|
export function filterTriggers(triggers, filter) {
|
|
14
30
|
return filter === 'all' ? triggers : triggers.filter((t) => t.type === filter);
|
|
15
31
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
3
3
|
import { projectSessionHref } from '../../../internal/lib/navigation/session-href.js';
|
|
4
|
-
import { AppWindowIcon, ClockIcon, LightningIcon, PulseIcon, WebhooksLogoIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { AppWindowIcon, ClockIcon, GitMergeIcon, LightningIcon, PulseIcon, WebhooksLogoIcon } from '@phosphor-icons/react';
|
|
5
5
|
/**
|
|
6
6
|
* The entity row a trigger toast carries: the kind's glyph and the trigger's
|
|
7
7
|
* name ("Trigger created / ⏱ Weekly revenue digest · Mon 9:00 / View").
|
|
@@ -13,6 +13,7 @@ const TRIGGER_TOAST_ICON = {
|
|
|
13
13
|
monitor: PulseIcon,
|
|
14
14
|
event: LightningIcon,
|
|
15
15
|
app: AppWindowIcon,
|
|
16
|
+
change_request: GitMergeIcon,
|
|
16
17
|
};
|
|
17
18
|
export function triggerToastEntity(trigger, detail) {
|
|
18
19
|
const Icon = TRIGGER_TOAST_ICON[trigger.type] ?? ClockIcon;
|
|
@@ -3,7 +3,7 @@ import { type ProjectTrigger } from '@kortix/sdk';
|
|
|
3
3
|
/**
|
|
4
4
|
* The run and delete mutations both trigger surfaces fire — the Triggers tab
|
|
5
5
|
* (`schedule-view.tsx`) and the agent page's Triggers section
|
|
6
|
-
* (
|
|
6
|
+
* (the former agent Triggers section) kept two copies that had already drifted (the
|
|
7
7
|
* run-failure toast key differed). Both get this one lifecycle, against their
|
|
8
8
|
* own `qk.project.triggers(projectId)` key through `invalidate`.
|
|
9
9
|
*
|
|
@@ -8,7 +8,7 @@ import { useMutation } from '@tanstack/react-query';
|
|
|
8
8
|
/**
|
|
9
9
|
* The run and delete mutations both trigger surfaces fire — the Triggers tab
|
|
10
10
|
* (`schedule-view.tsx`) and the agent page's Triggers section
|
|
11
|
-
* (
|
|
11
|
+
* (the former agent Triggers section) kept two copies that had already drifted (the
|
|
12
12
|
* run-failure toast key differed). Both get this one lifecycle, against their
|
|
13
13
|
* own `qk.project.triggers(projectId)` key through `invalidate`.
|
|
14
14
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { App } from '@kortix/sdk';
|
|
2
|
+
import { type PatchDraft } from './composer-parts.js';
|
|
3
|
+
import type { ComposerDraft } from './trigger-composer-logic.js';
|
|
4
|
+
/**
|
|
5
|
+
* When: one of the project's Kortix Apps sends an event. The App posts it to
|
|
6
|
+
* `KORTIX_APP_EVENTS_URL` with its `KORTIX_APP_TOKEN`; an empty event name
|
|
7
|
+
* fires on every event of the App.
|
|
8
|
+
*/
|
|
9
|
+
export declare function WhenApp({ apps, draft, patch, error, }: {
|
|
10
|
+
/** The project's Apps that can send events. */
|
|
11
|
+
apps: App[];
|
|
12
|
+
draft: ComposerDraft;
|
|
13
|
+
patch: PatchDraft;
|
|
14
|
+
error?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
4
|
+
import { Input } from '../../../primitives/input.js';
|
|
5
|
+
import { Label } from '../../../primitives/label.js';
|
|
6
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../primitives/select.js';
|
|
7
|
+
import { InlineError } from './composer-parts.js';
|
|
8
|
+
const APP_ERROR_ID = 'trigger-kortix-app-error';
|
|
9
|
+
/**
|
|
10
|
+
* When: one of the project's Kortix Apps sends an event. The App posts it to
|
|
11
|
+
* `KORTIX_APP_EVENTS_URL` with its `KORTIX_APP_TOKEN`; an empty event name
|
|
12
|
+
* fires on every event of the App.
|
|
13
|
+
*/
|
|
14
|
+
export function WhenApp({ apps, draft, patch, error, }) {
|
|
15
|
+
const t = useTranslations('triggerComposer');
|
|
16
|
+
// A saved trigger whose App is gone still shows its slug, so the form never reads as blank.
|
|
17
|
+
const unknown = draft.kortixApp && !apps.some((app) => app.slug === draft.kortixApp);
|
|
18
|
+
return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-kortix-app", className: "text-xs", children: t('appLabel') }), _jsxs(Select, { value: draft.kortixApp ?? '', onValueChange: (kortixApp) => patch({ kortixApp }), children: [_jsx(SelectTrigger, { id: "trigger-kortix-app", className: "w-full cursor-pointer text-sm", "aria-invalid": error ? true : undefined, "aria-describedby": error ? APP_ERROR_ID : undefined, children: _jsx(SelectValue, { placeholder: t('appPlaceholder') }) }), _jsxs(SelectContent, { children: [unknown ? (_jsx(SelectItem, { value: draft.kortixApp, className: "cursor-pointer", children: draft.kortixApp })) : null, apps.map((app) => (_jsx(SelectItem, { value: app.slug, className: "cursor-pointer", children: app.name }, app.app_id)))] })] }), _jsx(InlineError, { id: APP_ERROR_ID, message: error })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-app-event", className: "text-xs", children: t('appEventLabel') }), _jsx(Input, { id: "trigger-app-event", value: draft.appEvent, onChange: (e) => patch({ appEvent: e.target.value }), placeholder: t('appEventPlaceholder'), maxLength: 128, className: "font-mono text-sm" }), _jsx("p", { className: "text-muted-foreground text-xs leading-relaxed text-pretty", children: t.rich('appEventHelp', {
|
|
19
|
+
code: (chunks) => (_jsx("code", { className: "bg-muted text-foreground rounded-sm px-1 py-0.5 font-mono text-xs", children: chunks })),
|
|
20
|
+
}) })] })] }));
|
|
21
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PatchDraft } from './composer-parts.js';
|
|
2
|
+
import type { ComposerDraft } from './trigger-composer-logic.js';
|
|
3
|
+
/**
|
|
4
|
+
* When: a change request of the project merges. An empty branch fires on every
|
|
5
|
+
* merge; a branch fires on merges into it only (kortix.yaml `filter.base`).
|
|
6
|
+
*/
|
|
7
|
+
export declare function WhenChangeRequest({ draft, patch }: {
|
|
8
|
+
draft: ComposerDraft;
|
|
9
|
+
patch: PatchDraft;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from '../../../i18n/index.js';
|
|
4
|
+
import { Input } from '../../../primitives/input.js';
|
|
5
|
+
import { Label } from '../../../primitives/label.js';
|
|
6
|
+
/**
|
|
7
|
+
* When: a change request of the project merges. An empty branch fires on every
|
|
8
|
+
* merge; a branch fires on merges into it only (kortix.yaml `filter.base`).
|
|
9
|
+
*/
|
|
10
|
+
export function WhenChangeRequest({ draft, patch }) {
|
|
11
|
+
const t = useTranslations('triggerComposer');
|
|
12
|
+
return (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "trigger-cr-branch", className: "text-xs", children: t('crBranchLabel') }), _jsx(Input, { id: "trigger-cr-branch", value: draft.crBase, onChange: (e) => patch({ crBase: e.target.value }), placeholder: t('crBranchPlaceholder'), maxLength: 255, className: "font-mono text-sm" }), _jsx("p", { className: "text-muted-foreground text-xs leading-relaxed text-pretty", children: t.rich('crBranchHelp', {
|
|
13
|
+
code: (chunks) => (_jsx("code", { className: "bg-muted text-foreground rounded-sm px-1 py-0.5 font-mono text-xs", children: chunks })),
|
|
14
|
+
}) })] }));
|
|
15
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResourceScope } from '../shared/agent-resource-scope.js';
|
|
1
2
|
/**
|
|
2
3
|
* Pure: no hooks, no data fetching. The toolbar's ⋯ menu (Paper C03 `6O9-0`
|
|
3
4
|
* + `6YS-0`) for a viewer who may update triggers; `null` for anyone else.
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
* {@link TriggerActivationMenu} so the gate renders under
|
|
7
8
|
* `renderToStaticMarkup` without a QueryClient.
|
|
8
9
|
*/
|
|
9
|
-
export declare function TriggerToolbarMenu({ canManage, paused, isPending, onToggle, onSelectMode, }: {
|
|
10
|
+
export declare function TriggerToolbarMenu({ canManage, paused, isPending, onToggle, onSelectMode, projectSwitch, }: {
|
|
10
11
|
canManage: boolean;
|
|
11
12
|
/** The project-wide switch (`triggers_paused`). */
|
|
12
13
|
paused: boolean;
|
|
@@ -14,6 +15,10 @@ export declare function TriggerToolbarMenu({ canManage, paused, isPending, onTog
|
|
|
14
15
|
onToggle: (next: boolean) => void;
|
|
15
16
|
/** Turns on multi-select; absent when there is nothing to select. */
|
|
16
17
|
onSelectMode?: () => void;
|
|
18
|
+
/** `false` on one agent's page: Pause all and Resume all act on the whole
|
|
19
|
+
* project, so they stay on the project's Triggers page. Select remains, and
|
|
20
|
+
* its bulk Pause and Resume act on this agent's triggers only. */
|
|
21
|
+
projectSwitch?: boolean;
|
|
17
22
|
}): import("react").JSX.Element | null;
|
|
18
23
|
/**
|
|
19
24
|
* The project-wide pause switch (`PATCH /projects/:id/triggers/activation`):
|
|
@@ -47,10 +52,19 @@ export declare function useTriggersActivation(projectId: string): import("@tanst
|
|
|
47
52
|
*
|
|
48
53
|
* Exported for `trigger-activation-menu.test.tsx`, which renders it per role.
|
|
49
54
|
*/
|
|
50
|
-
export declare function TriggerActivationMenu({ projectId, onSelectMode, }: {
|
|
55
|
+
export declare function TriggerActivationMenu({ projectId, onSelectMode, projectSwitch, }: {
|
|
51
56
|
projectId: string;
|
|
52
57
|
onSelectMode?: () => void;
|
|
58
|
+
/** See {@link TriggerToolbarMenu}. */
|
|
59
|
+
projectSwitch?: boolean;
|
|
53
60
|
}): import("react").JSX.Element;
|
|
54
|
-
export declare function ScheduleView({ projectId }: {
|
|
61
|
+
export declare function ScheduleView({ projectId, surface, defaultAgent, }: {
|
|
55
62
|
projectId: string;
|
|
63
|
+
/** `global` (default) lists every trigger in the project. `agent` is the same
|
|
64
|
+
* screen on one agent's page (`agent-page.tsx`): only the triggers that
|
|
65
|
+
* start that agent, and New trigger opens with the agent picked. */
|
|
66
|
+
surface?: ResourceScope;
|
|
67
|
+
/** The project's default agent, in `agent` scope: a trigger stored as
|
|
68
|
+
* `default` starts it (`triggerStartsAgent`). */
|
|
69
|
+
defaultAgent?: string | null;
|
|
56
70
|
}): import("react").JSX.Element;
|