@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,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent page's Overview tab: the agent at a glance.
|
|
3
|
+
*
|
|
4
|
+
* One centered column, in reading order: the description, then the
|
|
5
|
+
* instructions (edited in place as a formatted document), then Properties
|
|
6
|
+
* (the switches a person flips most) and Source (where the agent is saved).
|
|
7
|
+
* What it may touch, its model, workspace and triggers are tabs, and who may
|
|
8
|
+
* use it is the header's Share: the Overview repeats none of them. The
|
|
9
|
+
* description and the instructions write the page's draft in place; there is
|
|
10
|
+
* no separate editor.
|
|
11
|
+
*
|
|
12
|
+
* One component for the editable and the read-only page. With `editor` the
|
|
13
|
+
* Properties switches and selects write the shared draft; without it they show
|
|
14
|
+
* their values.
|
|
15
|
+
*/
|
|
16
|
+
import type { AgentCapabilityGrant, AgentConfigBlock, ProjectConfigSummary } from '@kortix/sdk';
|
|
17
|
+
import { type Icon } from '@phosphor-icons/react';
|
|
18
|
+
import { type AgentConfigSectionKey, type AgentDraft } from '../sections/view/agent-editor.js';
|
|
19
|
+
type Agent = ProjectConfigSummary['agents'][number];
|
|
20
|
+
/** One glyph per section: the Overview rows and the Access switcher draw the same one. */
|
|
21
|
+
export declare const SECTION_ICON: Record<AgentConfigSectionKey, Icon>;
|
|
22
|
+
/** The grant a block holds for one Access view. Drives has none in the block; `tools` omitted is every tool. */
|
|
23
|
+
export declare function grantOf(block: AgentConfigBlock, view: AgentConfigSectionKey): AgentCapabilityGrant | undefined;
|
|
24
|
+
/** How many ids a grant names: `all` (also `{ exclude }`: all but some), a number, or 0 for None. */
|
|
25
|
+
export declare function grantCount(value: AgentCapabilityGrant | undefined): number | 'all';
|
|
26
|
+
/** The names `{ exclude }` leaves out, else none. */
|
|
27
|
+
export declare function grantExcluded(value: AgentCapabilityGrant | undefined): string[];
|
|
28
|
+
export interface OverviewFacts {
|
|
29
|
+
/** The project's size of each catalog, when known: "6 of 24". */
|
|
30
|
+
totals: Partial<Record<AgentConfigSectionKey, number>>;
|
|
31
|
+
/** Granted connectors whose connection needs a sign-in. */
|
|
32
|
+
needsSignIn: string[];
|
|
33
|
+
peopleCount?: number;
|
|
34
|
+
triggerCount?: number;
|
|
35
|
+
}
|
|
36
|
+
/** A space slug from what a person typed: the API's `SPACE_SLUG_RE` shape. */
|
|
37
|
+
export declare function spaceSlug(input: string): string;
|
|
38
|
+
export declare function AgentOverview({ agent, config, block, prompt, editor, sourcePath, onAskMyKortix, focusInstructions, showSpace, }: {
|
|
39
|
+
agent: Agent;
|
|
40
|
+
config: ProjectConfigSummary;
|
|
41
|
+
/** The draft (editable) or the served block (read-only). */
|
|
42
|
+
block: AgentConfigBlock;
|
|
43
|
+
/** The instructions; null while a reader's source file loads. */
|
|
44
|
+
prompt: string | null;
|
|
45
|
+
editor?: AgentDraft;
|
|
46
|
+
sourcePath: string;
|
|
47
|
+
onAskMyKortix?: () => void;
|
|
48
|
+
/** Unfold the instructions with the cursor in them (the old Instructions tab link). */
|
|
49
|
+
focusInstructions?: boolean;
|
|
50
|
+
/** Show the Space row. Spaces are Work in progress: pass `useSpacesEnabled(projectId)`. */
|
|
51
|
+
showSpace?: boolean;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { BookOpenTextIcon, CommandIcon, CpuIcon, CubeIcon, EyedropperIcon, FileTextIcon, GlobeIcon, HardDriveIcon, KeyIcon, PlugsConnectedIcon, PencilSimpleIcon, PuzzlePieceIcon, SlidersHorizontalIcon, SquaresFourIcon, TerminalWindowIcon, TimerIcon, TreeStructureIcon, UsersIcon, WrenchIcon, } from '@phosphor-icons/react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { useTranslations as useI18nTranslations } from '../../i18n/index.js';
|
|
6
|
+
import { agentDisplayName } from '../../internal/components/agent-mark.js';
|
|
7
|
+
import { cn } from '../../internal/lib/utils.js';
|
|
8
|
+
import { Input } from '../../primitives/input.js';
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectSeparator, SelectTrigger, SelectValue, } from '../../primitives/select.js';
|
|
10
|
+
import { StatusDot } from '../../primitives/status.js';
|
|
11
|
+
import { Switch } from '../../primitives/switch.js';
|
|
12
|
+
import { AGENT_MODE_LABEL, AGENT_MODES } from '../sections/view/agent-editor-catalog.js';
|
|
13
|
+
import { EditorSection, EditorSectionStyleProvider, SettingRow } from '../sections/view/agent-editor-primitives.js';
|
|
14
|
+
import { AgentInstructions } from './agent-instructions.js';
|
|
15
|
+
/** One glyph per section: the Overview rows and the Access switcher draw the same one. */
|
|
16
|
+
export const SECTION_ICON = {
|
|
17
|
+
overview: SquaresFourIcon,
|
|
18
|
+
instructions: FileTextIcon,
|
|
19
|
+
people: UsersIcon,
|
|
20
|
+
basics: SlidersHorizontalIcon,
|
|
21
|
+
triggers: TimerIcon,
|
|
22
|
+
skills: BookOpenTextIcon,
|
|
23
|
+
subagents: TreeStructureIcon,
|
|
24
|
+
commands: CommandIcon,
|
|
25
|
+
extensions: PuzzlePieceIcon,
|
|
26
|
+
connectors: PlugsConnectedIcon,
|
|
27
|
+
secrets: KeyIcon,
|
|
28
|
+
apps: GlobeIcon,
|
|
29
|
+
drives: HardDriveIcon,
|
|
30
|
+
actions: TerminalWindowIcon,
|
|
31
|
+
model: CpuIcon,
|
|
32
|
+
tools: WrenchIcon,
|
|
33
|
+
workspace: CubeIcon,
|
|
34
|
+
};
|
|
35
|
+
/** The grant a block holds for one Access view. Drives has none in the block; `tools` omitted is every tool. */
|
|
36
|
+
export function grantOf(block, view) {
|
|
37
|
+
switch (view) {
|
|
38
|
+
case 'actions':
|
|
39
|
+
return block.kortix_permissions ?? block.kortix_cli;
|
|
40
|
+
case 'skills':
|
|
41
|
+
case 'connectors':
|
|
42
|
+
case 'secrets':
|
|
43
|
+
case 'apps':
|
|
44
|
+
case 'subagents':
|
|
45
|
+
case 'commands':
|
|
46
|
+
case 'extensions':
|
|
47
|
+
return block[view];
|
|
48
|
+
case 'tools': {
|
|
49
|
+
// `codemode: off` removes codemode as an exclude does, so the counts agree.
|
|
50
|
+
const tools = block.tools ?? 'all';
|
|
51
|
+
if (block.codemode !== 'off')
|
|
52
|
+
return tools;
|
|
53
|
+
if (tools === 'all')
|
|
54
|
+
return { exclude: ['codemode'] };
|
|
55
|
+
if (typeof tools === 'object' && !Array.isArray(tools) && 'exclude' in tools) {
|
|
56
|
+
return tools.exclude.includes('codemode') ? tools : { exclude: [...tools.exclude, 'codemode'] };
|
|
57
|
+
}
|
|
58
|
+
return Array.isArray(tools) ? tools.filter((id) => id !== 'codemode') : tools;
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** How many ids a grant names: `all` (also `{ exclude }`: all but some), a number, or 0 for None. */
|
|
65
|
+
export function grantCount(value) {
|
|
66
|
+
if (value === 'all' || (value !== undefined && !Array.isArray(value) && typeof value === 'object'))
|
|
67
|
+
return 'all';
|
|
68
|
+
return Array.isArray(value) ? value.length : 0;
|
|
69
|
+
}
|
|
70
|
+
/** The names `{ exclude }` leaves out, else none. */
|
|
71
|
+
export function grantExcluded(value) {
|
|
72
|
+
return value !== undefined && !Array.isArray(value) && typeof value === 'object' ? value.exclude : [];
|
|
73
|
+
}
|
|
74
|
+
// ─── Main column ─────────────────────────────────────────────────────────────
|
|
75
|
+
/** Grows a textarea to its text: one line or ten, never a scrollbar. */
|
|
76
|
+
function fitHeight(el) {
|
|
77
|
+
if (!el)
|
|
78
|
+
return;
|
|
79
|
+
el.style.height = 'auto';
|
|
80
|
+
el.style.height = `${el.scrollHeight}px`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The description, edited in place: a filled box with a pencil. Click it and
|
|
84
|
+
* it becomes a field in the same box; Enter or leaving keeps the edit in the
|
|
85
|
+
* draft, Escape puts back what was there.
|
|
86
|
+
*/
|
|
87
|
+
function AboutDescription({ value, onChange, subagent, }) {
|
|
88
|
+
const t = useI18nTranslations('agentEditor.page');
|
|
89
|
+
const tTabs = useI18nTranslations('agentEditor.tabs');
|
|
90
|
+
const [editing, setEditing] = useState(null);
|
|
91
|
+
const box = 'bg-popover block w-full rounded-md border px-3 py-2.5 text-left text-sm text-pretty';
|
|
92
|
+
if (!onChange) {
|
|
93
|
+
return value ? (_jsx("p", { className: cn(box, 'text-foreground'), children: value })) : (_jsx("p", { className: "text-muted-foreground text-sm", children: tTabs('noDescription') }));
|
|
94
|
+
}
|
|
95
|
+
if (editing !== null) {
|
|
96
|
+
const finish = (keep) => {
|
|
97
|
+
if (!keep)
|
|
98
|
+
onChange(editing);
|
|
99
|
+
setEditing(null);
|
|
100
|
+
};
|
|
101
|
+
return (
|
|
102
|
+
// The field takes the box: the same inset, line and fill, so nothing moves.
|
|
103
|
+
_jsxs("div", { className: "space-y-1.5", children: [_jsx("textarea", { ref: fitHeight, autoFocus: true, rows: 1, "aria-label": t('description'), value: value, placeholder: t('descriptionPlaceholder'), className: cn(box, 'text-foreground placeholder:text-muted-foreground focus-visible:ring-ring/50 resize-none overflow-hidden outline-none focus-visible:ring-2'), onFocus: (e) => e.currentTarget.setSelectionRange(e.currentTarget.value.length, e.currentTarget.value.length), onChange: (e) => {
|
|
104
|
+
onChange(e.target.value.replace(/\n/g, ' '));
|
|
105
|
+
fitHeight(e.target);
|
|
106
|
+
}, onBlur: () => finish(true), onKeyDown: (e) => {
|
|
107
|
+
if (e.key === 'Enter') {
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
finish(true);
|
|
110
|
+
}
|
|
111
|
+
else if (e.key === 'Escape') {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
finish(false);
|
|
114
|
+
}
|
|
115
|
+
} }), _jsx("p", { className: "text-muted-foreground px-3 text-xs text-pretty", children: subagent ? t('descriptionHelpSubagent') : t('descriptionHelp') })] }));
|
|
116
|
+
}
|
|
117
|
+
return (_jsxs("button", { type: "button", onClick: () => setEditing(value), "aria-label": t('description'), className: cn(box, 'group/about hover:border-foreground/20 focus-visible:ring-ring/50 flex items-start gap-3 transition-colors duration-fast focus-visible:ring-2 focus-visible:outline-none', value ? 'text-foreground' : 'text-muted-foreground'), children: [_jsx("span", { className: "min-w-0 flex-1", children: value || t('descriptionPlaceholder') }), _jsx(PencilSimpleIcon, { className: "text-muted-foreground group-hover/about:text-foreground mt-1.5 size-3.5 shrink-0 transition-colors duration-fast" })] }));
|
|
118
|
+
}
|
|
119
|
+
// ─── Aside ───────────────────────────────────────────────────────────────────
|
|
120
|
+
const PROJECT_WIDE = '__project_wide__';
|
|
121
|
+
const INHERIT = '__inherit__';
|
|
122
|
+
const NEW_SPACE = '__new_space__';
|
|
123
|
+
/** A space slug from what a person typed: the API's `SPACE_SLUG_RE` shape. */
|
|
124
|
+
export function spaceSlug(input) {
|
|
125
|
+
return input
|
|
126
|
+
.trim()
|
|
127
|
+
.toLowerCase()
|
|
128
|
+
.replace(/[^a-z0-9-]+/g, '-')
|
|
129
|
+
.replace(/^-+|-+$/g, '')
|
|
130
|
+
.slice(0, 63);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The Space select's "New space…": an inline field for a space kortix.yaml
|
|
134
|
+
* does not declare yet. Enter keeps it (as a slug), Escape or an empty value
|
|
135
|
+
* goes back to the select.
|
|
136
|
+
*/
|
|
137
|
+
function NewSpaceInput({ onDone }) {
|
|
138
|
+
const t = useI18nTranslations('agentEditor.tabs');
|
|
139
|
+
const [value, setValue] = useState('');
|
|
140
|
+
return (_jsx(Input, { autoFocus: true, size: "sm", "aria-label": t('newSpace'), placeholder: t('newSpacePlaceholder'), value: value, onChange: (e) => setValue(e.target.value), onBlur: () => onDone(spaceSlug(value) || null), onKeyDown: (e) => {
|
|
141
|
+
if (e.key === 'Enter') {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
onDone(spaceSlug(value) || null);
|
|
144
|
+
}
|
|
145
|
+
else if (e.key === 'Escape') {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
onDone(null);
|
|
148
|
+
}
|
|
149
|
+
} }));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The agent's color: the brand accents as swatches, none, or any hex typed or
|
|
153
|
+
* picked with the system picker. kortix.yaml stores a hex, so each swatch
|
|
154
|
+
* carries the hex of its token (`visual-system.json` `color.accents`).
|
|
155
|
+
*/
|
|
156
|
+
const AGENT_COLORS = [
|
|
157
|
+
{ name: 'colorBlue', token: 'bg-kortix-blue', hex: '#2b91f7' }, // audit:allow stored value, the token's hex
|
|
158
|
+
{ name: 'colorGreen', token: 'bg-kortix-green', hex: '#199338' }, // audit:allow stored value, the token's hex
|
|
159
|
+
{ name: 'colorYellow', token: 'bg-kortix-yellow', hex: '#cca300' }, // audit:allow stored value, the token's hex
|
|
160
|
+
{ name: 'colorOrange', token: 'bg-kortix-orange', hex: '#d18b19' }, // audit:allow stored value, the token's hex
|
|
161
|
+
{ name: 'colorRed', token: 'bg-kortix-red', hex: '#f14b4c' }, // audit:allow stored value, the token's hex
|
|
162
|
+
{ name: 'colorPurple', token: 'bg-kortix-purple', hex: '#ab80d6' }, // audit:allow stored value, the token's hex
|
|
163
|
+
];
|
|
164
|
+
const HEX = /^#[0-9a-f]{6}$/;
|
|
165
|
+
const SWATCH = cn('size-5 shrink-0 cursor-pointer rounded-sm', 'ring-offset-background transition-[scale,box-shadow] duration-fast active:scale-[0.96]', 'focus-visible:ring-ring/50 focus-visible:ring-2 focus-visible:outline-none');
|
|
166
|
+
const SELECTED = 'ring-foreground ring-[1.5px] ring-offset-2';
|
|
167
|
+
/** The color's swatch and name: the value of the Color row. */
|
|
168
|
+
function colorFace(value, t) {
|
|
169
|
+
const current = value?.toLowerCase();
|
|
170
|
+
const named = AGENT_COLORS.find((c) => c.hex === current);
|
|
171
|
+
return {
|
|
172
|
+
swatch: named ? named.token : current ? undefined : 'bg-muted-foreground',
|
|
173
|
+
style: current && !named ? { backgroundColor: current } : undefined,
|
|
174
|
+
label: named ? t(named.name) : current ? t('colorCustom') : t('colorNone'),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/** Swatches, then a hex field whose eyedropper opens the system picker. */
|
|
178
|
+
function AgentColorField({ value, onChange }) {
|
|
179
|
+
const t = useI18nTranslations('agentEditor.tabs');
|
|
180
|
+
const current = value?.toLowerCase();
|
|
181
|
+
const [typed, setTyped] = useState(null);
|
|
182
|
+
const commit = (raw) => {
|
|
183
|
+
const hex = `#${raw.replace(/^#/, '').trim().toLowerCase()}`;
|
|
184
|
+
if (raw.trim() === '')
|
|
185
|
+
onChange(undefined);
|
|
186
|
+
else if (HEX.test(hex))
|
|
187
|
+
onChange(hex);
|
|
188
|
+
setTyped(null);
|
|
189
|
+
};
|
|
190
|
+
return (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { role: "radiogroup", "aria-label": t('color'), className: "flex items-center gap-1.5", children: [_jsx("button", { type: "button", role: "radio", "aria-checked": !current, "aria-label": t('colorNone'), onClick: () => onChange(undefined), className: cn(SWATCH, 'bg-muted-foreground', !current && SELECTED) }), AGENT_COLORS.map((c) => (_jsx("button", { type: "button", role: "radio", "aria-checked": current === c.hex, "aria-label": t(c.name), onClick: () => onChange(c.hex), className: cn(SWATCH, c.token, current === c.hex && SELECTED) }, c.hex)))] }), _jsxs("div", { className: "bg-secondary flex h-7 items-center gap-1.5 rounded-md px-2", children: [_jsx("span", { className: "text-muted-foreground font-mono text-xs", children: "#" }), _jsx("input", { "aria-label": t('color'), value: typed ?? current?.slice(1).toUpperCase() ?? '', placeholder: "\u2014", maxLength: 7, spellCheck: false, className: "text-foreground placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent font-mono text-xs outline-none", onChange: (e) => setTyped(e.target.value), onBlur: (e) => commit(e.target.value), onKeyDown: (e) => {
|
|
191
|
+
if (e.key === 'Enter')
|
|
192
|
+
commit(e.currentTarget.value);
|
|
193
|
+
else if (e.key === 'Escape')
|
|
194
|
+
setTyped(null);
|
|
195
|
+
} }), _jsxs("label", { "aria-label": t('colorCustom'), className: "text-muted-foreground hover:text-foreground relative flex size-4 cursor-pointer items-center justify-center transition-colors duration-fast", children: [_jsx(EyedropperIcon, { className: "size-3.5" }), _jsx("input", { type: "color", value: current && HEX.test(current) ? current : AGENT_COLORS[0].hex, onChange: (e) => onChange(e.target.value), className: "absolute inset-0 cursor-pointer opacity-0" })] })] })] }));
|
|
196
|
+
}
|
|
197
|
+
/** The value side of a Source row: a mono path, right-aligned. */
|
|
198
|
+
function SourceValue({ value }) {
|
|
199
|
+
return (_jsx("p", { className: "text-foreground truncate font-mono text-xs sm:text-right", title: value, children: value }));
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Below the instructions, in the Settings dialect (`EditorSection`, `panel`
|
|
203
|
+
* style): Properties (the switches a person flips most) and where the agent
|
|
204
|
+
* is saved. A title per group, rows in one
|
|
205
|
+
* bordered group, no sentence under a title.
|
|
206
|
+
*/
|
|
207
|
+
function OverviewSettings({ agent, config, block, editor, showSpace, sourcePath, }) {
|
|
208
|
+
const t = useI18nTranslations('agentEditor.tabs');
|
|
209
|
+
const behavior = block.behavior ?? {};
|
|
210
|
+
const enabled = block.enabled !== false;
|
|
211
|
+
const shown = !behavior.hidden;
|
|
212
|
+
// Editable: the draft alone, so choosing Project-wide shows Project-wide
|
|
213
|
+
// (the save drops the key, which clears it). Read-only: the served block,
|
|
214
|
+
// which already carries the agent's space.
|
|
215
|
+
const space = (editor ? block.space : (block.space ?? agent.space)) || null;
|
|
216
|
+
const [addingSpace, setAddingSpace] = useState(false);
|
|
217
|
+
const spaces = config.spaces ?? [];
|
|
218
|
+
const spaceNames = new Set(spaces.map((s) => s.name));
|
|
219
|
+
const modeLabel = behavior.mode ? AGENT_MODE_LABEL[behavior.mode] : t('modeDefault');
|
|
220
|
+
const face = colorFace(behavior.color, t);
|
|
221
|
+
const value = (text) => _jsx("p", { className: "text-foreground text-sm sm:text-right", children: text });
|
|
222
|
+
return (_jsxs(_Fragment, { children: [_jsxs(EditorSection, { title: t('properties'), children: [_jsx(SettingRow, { label: t('enabled'), help: t('enabledHelp', { name: agentDisplayName(agent.name) }), children: _jsx("div", { className: "flex sm:justify-end", children: editor ? (_jsx(Switch, { "aria-label": t('enabled'), checked: enabled, onCheckedChange: (v) => editor.set('enabled', v ? undefined : false) })) : (_jsxs("span", { className: "text-foreground flex items-center gap-1.5 text-sm", children: [_jsx(StatusDot, { tone: enabled ? 'success' : 'neutral' }), enabled ? t('statusEnabled') : t('statusDisabled')] })) }) }), _jsx(SettingRow, { label: t('whoStarts'), children: editor ? (_jsxs(Select, { value: behavior.mode ?? INHERIT, onValueChange: (v) => editor.setOc('mode', v === INHERIT ? undefined : v), children: [_jsx(SelectTrigger, { "aria-label": t('whoStarts'), size: "sm", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: INHERIT, children: t('modeDefault') }), AGENT_MODES.map((mode) => (_jsx(SelectItem, { value: mode, children: AGENT_MODE_LABEL[mode] }, mode)))] })] })) : (value(modeLabel)) }), _jsx(SettingRow, { label: t('showInPickers'), help: t('showInPickersHelp'), children: _jsx("div", { className: "flex sm:justify-end", children: editor ? (_jsx(Switch, { "aria-label": t('showInPickers'), checked: shown, onCheckedChange: (v) => editor.setOc('hidden', v ? undefined : true) })) : (value(shown ? t('pickerShown') : t('pickerHidden'))) }) }), showSpace ? (_jsx(SettingRow, { label: t('space'), children: editor ? (addingSpace ? (_jsx(NewSpaceInput, { onDone: (slug) => {
|
|
223
|
+
setAddingSpace(false);
|
|
224
|
+
if (slug)
|
|
225
|
+
editor.set('space', slug);
|
|
226
|
+
} })) : (_jsxs(Select, { value: space ?? PROJECT_WIDE, onValueChange: (v) => {
|
|
227
|
+
if (v === NEW_SPACE)
|
|
228
|
+
return setAddingSpace(true);
|
|
229
|
+
editor.set('space', v === PROJECT_WIDE ? undefined : v);
|
|
230
|
+
}, children: [_jsx(SelectTrigger, { "aria-label": t('space'), size: "sm", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: PROJECT_WIDE, children: t('projectWide') }), spaces.map((s) => (_jsxs(SelectItem, { value: s.name, children: ["# ", s.label || s.name] }, s.name))), space && !spaceNames.has(space) ? _jsxs(SelectItem, { value: space, children: ["# ", space] }) : null, _jsx(SelectSeparator, {}), _jsx(SelectItem, { value: NEW_SPACE, children: t('newSpace') })] })] }))) : (value(space ? `# ${space}` : t('projectWide'))) })) : null, _jsx(SettingRow, { label: t('color'), help: t('colorHelp'), children: editor ? (_jsx(AgentColorField, { value: behavior.color, onChange: (next) => editor.setOc('color', next) })) : (_jsxs("span", { className: "text-foreground flex items-center gap-2 text-sm sm:justify-end", children: [_jsx("span", { className: cn('size-3.5 shrink-0 rounded-sm', face.swatch), style: face.style }), face.label] })) })] }), _jsxs(EditorSection, { title: t('source'), children: [_jsx(SettingRow, { label: t('sourceConfig'), children: _jsx(SourceValue, { value: "kortix.yaml" }) }), _jsx(SettingRow, { label: t('sourceKey'), children: _jsx(SourceValue, { value: `agents.${agent.name}` }) }), _jsx(SettingRow, { label: t('sourceInstructions'), children: _jsx(SourceValue, { value: sourcePath }) })] })] }));
|
|
231
|
+
}
|
|
232
|
+
// ─── The tab ─────────────────────────────────────────────────────────────────
|
|
233
|
+
export function AgentOverview({ agent, config, block, prompt, editor, sourcePath, onAskMyKortix, focusInstructions = false, showSpace = false, }) {
|
|
234
|
+
const t = useI18nTranslations('agentEditor.tabs');
|
|
235
|
+
const tPage = useI18nTranslations('agentEditor.page');
|
|
236
|
+
// Editable: the draft alone, so clearing the description shows it cleared.
|
|
237
|
+
const description = (editor ? editor.oc.description : (block.behavior?.description ?? agent.description)) ?? '';
|
|
238
|
+
return (
|
|
239
|
+
// One centered column, the Settings page's shape: the description and the
|
|
240
|
+
// instructions, then the settings below them.
|
|
241
|
+
_jsx(EditorSectionStyleProvider, { value: "panel", children: _jsxs("div", { className: "mx-auto w-full max-w-3xl space-y-8", children: [_jsx(EditorSection, { title: t('tabOverview'), lead: true, bare: true, children: _jsxs("div", { className: "space-y-2", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: tPage('description') }), _jsx(AboutDescription, { value: description, onChange: editor ? (next) => editor.setOc('description', next) : undefined, subagent: (editor?.oc.mode ?? block.behavior?.mode) === 'subagent' })] }) }), _jsx(AgentInstructions, { value: prompt, onChange: editor ? (next) => editor.setOc('prompt', next) : undefined, onAskMyKortix: onAskMyKortix, autoFocus: focusInstructions }), _jsx(OverviewSettings, { agent: agent, config: config, block: block, editor: editor, showSpace: showSpace, sourcePath: sourcePath })] }) }));
|
|
242
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent page's frame: one identity header, one row of tabs under it, and
|
|
3
|
+
* the content below, all on one left edge. A tab with several views
|
|
4
|
+
* (Capabilities, Access) lists them in a rail left of its content.
|
|
5
|
+
*
|
|
6
|
+
* ┌ ▣ researcher [Share] [Start session] [⋯] ┐
|
|
7
|
+
* │ ● Enabled · Space: workspace · People start it │
|
|
8
|
+
* │ Overview Model Capabilities Access Workspace Triggers 1 │
|
|
9
|
+
* ├──────────────────────────────────────────────────────────────────┤
|
|
10
|
+
* │ Tools All but 2 │ content (the one scroller) │
|
|
11
|
+
* │ Skills 4 of 9 │ (a tab with several views: the rail; │
|
|
12
|
+
* │ … │ below `md`, a row of pills instead) │
|
|
13
|
+
* └──────────────────────── [ ● Unsaved changes Skills Discard Save ⌘S ]
|
|
14
|
+
*
|
|
15
|
+
* The header echoes the Space channel header (`space-page.tsx`): a tile, the
|
|
16
|
+
* name at `text-xl font-medium`, one muted line. It is also the window's
|
|
17
|
+
* title-bar row (`kx-titlebar-row`), so it holds the sidebar opener and the
|
|
18
|
+
* desktop drag band: the page adds no bar for either.
|
|
19
|
+
*/
|
|
20
|
+
import { type MouseEvent, type ReactNode } from 'react';
|
|
21
|
+
import { type StatusTone } from '../../primitives/status.js';
|
|
22
|
+
import type { AgentRailKey } from './agent-tabs.js';
|
|
23
|
+
/** One fact on the header's meta line. A `tone` draws the status dot first. */
|
|
24
|
+
export interface HeaderFact {
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
tone?: StatusTone;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The one header of every Customize page: the agent page, My Kortix, the
|
|
30
|
+
* Agents index, Review and the error / not-found states. Same top offset, same
|
|
31
|
+
* title rung, same height, so moving between them never makes the title jump.
|
|
32
|
+
* `slug` draws the agent's mark; a page that is not one agent has no tile.
|
|
33
|
+
* `rule` draws the bottom hairline; the agent page leaves it to its tab row.
|
|
34
|
+
* It is the window's title-bar row (`kx-titlebar-row`), so it holds the
|
|
35
|
+
* sidebar opener and the desktop drag band.
|
|
36
|
+
*/
|
|
37
|
+
export declare function CustomizeHeader({ slug, title, facts, description, actions, rule, }: {
|
|
38
|
+
slug?: string;
|
|
39
|
+
title: ReactNode;
|
|
40
|
+
facts?: HeaderFact[];
|
|
41
|
+
/** One muted line under the title, for a page with no facts. */
|
|
42
|
+
description?: ReactNode;
|
|
43
|
+
actions?: ReactNode;
|
|
44
|
+
rule?: boolean;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
/** The agent page's name for the header. */
|
|
47
|
+
export declare const AgentIdentityHeader: typeof CustomizeHeader;
|
|
48
|
+
export interface AgentRailItem {
|
|
49
|
+
key: AgentRailKey;
|
|
50
|
+
label: string;
|
|
51
|
+
href: string;
|
|
52
|
+
count?: number | string;
|
|
53
|
+
}
|
|
54
|
+
/** One top tab of the agent page: one view, or several shown as pills. */
|
|
55
|
+
export interface AgentTabGroup {
|
|
56
|
+
key: string;
|
|
57
|
+
label: string;
|
|
58
|
+
items: AgentRailItem[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The agent page's navigation: one row of tabs under the header, and, when the
|
|
62
|
+
* active tab holds several views, one row of pills for them. Every
|
|
63
|
+
* `agents.<name>` key in kortix.yaml lives on exactly one tab or pill
|
|
64
|
+
* (`YAML_KEY_ROW`). A tab or pill holding an unsaved edit carries a dot. The
|
|
65
|
+
* row scrolls sideways on a narrow window instead of wrapping.
|
|
66
|
+
*/
|
|
67
|
+
export declare function AgentTabBar({ groups, active, dirty, }: {
|
|
68
|
+
groups: AgentTabGroup[];
|
|
69
|
+
active: AgentRailKey;
|
|
70
|
+
dirty?: readonly AgentRailKey[];
|
|
71
|
+
}): import("react").JSX.Element;
|
|
72
|
+
/**
|
|
73
|
+
* A tab, view or rail link on the agent page only changes the query
|
|
74
|
+
* (`?tab=&view=`): the page and its draft stay mounted. A plain click writes
|
|
75
|
+
* the URL to history (`useUiShallowNavigate`) instead of a router navigation,
|
|
76
|
+
* which in Next.js waits on a server round trip for the same route. A
|
|
77
|
+
* modified or middle click keeps the link's own behavior (a new tab).
|
|
78
|
+
*/
|
|
79
|
+
export declare function useInPageNavigate(): (event: MouseEvent<HTMLAnchorElement>, href: string) => void;
|
|
80
|
+
/** The scroller under the tabs, on the page gutter. */
|
|
81
|
+
export declare function AgentTabBody({ children, className }: {
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
className?: string;
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
|
+
/**
|
|
86
|
+
* The page before its reads land: the header, the tab row, and the Overview's
|
|
87
|
+
* centered column as three grouped blocks (description, instructions,
|
|
88
|
+
* properties). Grouped on purpose: a line per field reads as noise.
|
|
89
|
+
*/
|
|
90
|
+
export declare function AgentPageSkeleton(): import("react").JSX.Element;
|
|
91
|
+
/**
|
|
92
|
+
* A page that has a header and a single state under it (error, not found):
|
|
93
|
+
* the same header slot, so the sidebar opener is always reachable. No tile:
|
|
94
|
+
* the page is not (yet) an agent.
|
|
95
|
+
*/
|
|
96
|
+
export declare function AgentStatePage({ title, children }: {
|
|
97
|
+
title: ReactNode;
|
|
98
|
+
children: ReactNode;
|
|
99
|
+
}): import("react").JSX.Element;
|
|
100
|
+
/**
|
|
101
|
+
* The unsaved-edits bar, in the shape of the select-mode bar every list uses
|
|
102
|
+
* (`SelectionBar`, the Triggers bulk bar): one popover card, the state on the
|
|
103
|
+
* left with the changed tabs muted after it, then one secondary ButtonGroup of
|
|
104
|
+
* text buttons (Discard, Save ⌘S). It rises in like that bar and leaves at
|
|
105
|
+
* once. While the save runs, the session dot matrix leads and both disable.
|
|
106
|
+
*/
|
|
107
|
+
export declare function SaveBar({ dirty, pending, changed, onDiscard, onSave, }: {
|
|
108
|
+
dirty: boolean;
|
|
109
|
+
pending: boolean;
|
|
110
|
+
/** The changed tabs, already joined for reading ("Overview and Access"). */
|
|
111
|
+
changed: string;
|
|
112
|
+
onDiscard: () => void;
|
|
113
|
+
onSave: () => void;
|
|
114
|
+
}): import("react").JSX.Element | null;
|
|
115
|
+
/**
|
|
116
|
+
* Asked when a link would leave the page with unsaved edits. Three answers:
|
|
117
|
+
* stay, leave and lose the edits, or save first and then leave.
|
|
118
|
+
*/
|
|
119
|
+
export declare function LeaveDialog({ open, changed, pending, onStay, onLeave, onSaveAndLeave, }: {
|
|
120
|
+
open: boolean;
|
|
121
|
+
changed: string;
|
|
122
|
+
pending: boolean;
|
|
123
|
+
onStay: () => void;
|
|
124
|
+
onLeave: () => void;
|
|
125
|
+
onSaveAndLeave: () => void;
|
|
126
|
+
}): import("react").JSX.Element;
|
|
127
|
+
/** The agent's display name, for header titles. */
|
|
128
|
+
export declare function agentTitle(slug: string): string;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* The agent page's frame: one identity header, one row of tabs under it, and
|
|
5
|
+
* the content below, all on one left edge. A tab with several views
|
|
6
|
+
* (Capabilities, Access) lists them in a rail left of its content.
|
|
7
|
+
*
|
|
8
|
+
* ┌ ▣ researcher [Share] [Start session] [⋯] ┐
|
|
9
|
+
* │ ● Enabled · Space: workspace · People start it │
|
|
10
|
+
* │ Overview Model Capabilities Access Workspace Triggers 1 │
|
|
11
|
+
* ├──────────────────────────────────────────────────────────────────┤
|
|
12
|
+
* │ Tools All but 2 │ content (the one scroller) │
|
|
13
|
+
* │ Skills 4 of 9 │ (a tab with several views: the rail; │
|
|
14
|
+
* │ … │ below `md`, a row of pills instead) │
|
|
15
|
+
* └──────────────────────── [ ● Unsaved changes Skills Discard Save ⌘S ]
|
|
16
|
+
*
|
|
17
|
+
* The header echoes the Space channel header (`space-page.tsx`): a tile, the
|
|
18
|
+
* name at `text-xl font-medium`, one muted line. It is also the window's
|
|
19
|
+
* title-bar row (`kx-titlebar-row`), so it holds the sidebar opener and the
|
|
20
|
+
* desktop drag band: the page adds no bar for either.
|
|
21
|
+
*/
|
|
22
|
+
import { useCallback } from 'react';
|
|
23
|
+
import { useTranslations as useI18nTranslations } from '../../i18n/index.js';
|
|
24
|
+
import { AgentMark, agentDisplayName } from '../../internal/components/agent-mark.js';
|
|
25
|
+
import { SidebarToggle } from '../../internal/layout/sidebar-toggle.js';
|
|
26
|
+
import { useInCustomizeFrame } from '../shared/customize-tab-bar.js';
|
|
27
|
+
import { cn } from '../../internal/lib/utils.js';
|
|
28
|
+
import { Button } from '../../primitives/button.js';
|
|
29
|
+
import { ButtonGroup } from '../../primitives/button-group.js';
|
|
30
|
+
import { SessionDotMatrix } from '../../primitives/dot-matrix/session-dot-matrix.js';
|
|
31
|
+
import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../../primitives/alert-dialog.js';
|
|
32
|
+
import { Kbd } from '../../primitives/kbd.js';
|
|
33
|
+
import { useOptionalSidebar } from '../../primitives/sidebar.js';
|
|
34
|
+
import { Skeleton } from '../../primitives/skeleton.js';
|
|
35
|
+
import { StatusDot } from '../../primitives/status.js';
|
|
36
|
+
import { UiLink as Link, useUiShallowNavigate } from '../../providers/ui-provider.js';
|
|
37
|
+
import { m, useReducedMotion } from 'motion/react';
|
|
38
|
+
import { FadedScrollArea } from '../../primitives/faded-scroll-area.js';
|
|
39
|
+
/**
|
|
40
|
+
* The one header of every Customize page: the agent page, My Kortix, the
|
|
41
|
+
* Agents index, Review and the error / not-found states. Same top offset, same
|
|
42
|
+
* title rung, same height, so moving between them never makes the title jump.
|
|
43
|
+
* `slug` draws the agent's mark; a page that is not one agent has no tile.
|
|
44
|
+
* `rule` draws the bottom hairline; the agent page leaves it to its tab row.
|
|
45
|
+
* It is the window's title-bar row (`kx-titlebar-row`), so it holds the
|
|
46
|
+
* sidebar opener and the desktop drag band.
|
|
47
|
+
*/
|
|
48
|
+
export function CustomizeHeader({ slug, title, facts, description, actions, rule = false, }) {
|
|
49
|
+
const sidebar = useOptionalSidebar();
|
|
50
|
+
// Under the Customize bar, the bar is the title-bar row and holds the opener.
|
|
51
|
+
const framed = useInCustomizeFrame();
|
|
52
|
+
return (_jsxs("header", { className: cn(
|
|
53
|
+
// The Customize tab bar's height and inset: a 48px row, 16px sides.
|
|
54
|
+
'flex min-h-12 shrink-0 items-center gap-3 px-4 py-2', !framed && 'kx-titlebar-row', rule && 'border-b'), "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [framed ? null : _jsx(SidebarToggle, {}), slug ? _jsx(AgentMark, { slug: slug, size: 21 }) : null, _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("h1", { className: "text-foreground truncate text-base font-medium", children: title }), description && !(facts && facts.length > 0) ? (_jsx("p", { className: "text-muted-foreground truncate text-sm", children: description })) : null, facts && facts.length > 0 ? (_jsx("p", { className: "text-muted-foreground flex min-w-0 items-center gap-1.5 truncate text-sm", children: facts.map((fact, index) => (_jsxs("span", { className: "flex min-w-0 shrink-0 items-center gap-1.5 last:shrink", children: [index > 0 ? _jsx("span", { "aria-hidden": true, children: "\u00B7" }) : null, fact.tone ? _jsx(StatusDot, { tone: fact.tone }) : null, _jsx("span", { className: "truncate", children: fact.label })] }, index))) })) : null] }), actions ? _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions }) : null] }));
|
|
55
|
+
}
|
|
56
|
+
/** The agent page's name for the header. */
|
|
57
|
+
export const AgentIdentityHeader = CustomizeHeader;
|
|
58
|
+
/**
|
|
59
|
+
* The agent page's navigation: one row of tabs under the header, and, when the
|
|
60
|
+
* active tab holds several views, one row of pills for them. Every
|
|
61
|
+
* `agents.<name>` key in kortix.yaml lives on exactly one tab or pill
|
|
62
|
+
* (`YAML_KEY_ROW`). A tab or pill holding an unsaved edit carries a dot. The
|
|
63
|
+
* row scrolls sideways on a narrow window instead of wrapping.
|
|
64
|
+
*/
|
|
65
|
+
export function AgentTabBar({ groups, active, dirty, }) {
|
|
66
|
+
const t = useI18nTranslations('agentEditor.tabs');
|
|
67
|
+
const go = useInPageNavigate();
|
|
68
|
+
const shown = groups.filter((group) => group.items.length > 0);
|
|
69
|
+
const current = shown.find((group) => group.items.some((item) => item.key === active)) ?? shown[0];
|
|
70
|
+
const dot = _jsx("span", { role: "img", "aria-label": t('unsavedTab'), className: "bg-foreground size-1.5 shrink-0 rounded-full" });
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx("nav", { "aria-label": t('tabsLabel'), className: "shrink-0 border-b", children: _jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", children: _jsx("div", { className: "flex w-max items-center gap-1 px-2", children: shown.map((group) => {
|
|
72
|
+
const on = group === current;
|
|
73
|
+
const single = group.items.length === 1 ? group.items[0] : null;
|
|
74
|
+
return (_jsxs(Link, { href: group.items[0].href, prefetch: false, onClick: (e) => go(e, group.items[0].href), "aria-current": on ? 'page' : undefined, "data-testid": `agent-tab-${group.key}`, className: cn('-mb-px flex h-10 items-center gap-1.5 border-b-2 px-2 text-sm whitespace-nowrap transition-colors', on ? 'border-foreground text-foreground' : 'text-muted-foreground hover:text-foreground border-transparent'), children: [group.label, group.items.some((item) => dirty?.includes(item.key)) ? dot : null, single && single.key === 'triggers' && single.count !== undefined ? (_jsx("span", { className: "text-muted-foreground tabular-nums", children: single.count })) : null] }, group.key));
|
|
75
|
+
}) }) }) }), current && current.items.length > 1 ? (
|
|
76
|
+
// Below `md` only: wider, the content's rail (`agent-section-rail.tsx`) lists the views.
|
|
77
|
+
_jsx("div", { className: "shrink-0 md:hidden", children: _jsx(FadedScrollArea, { orientation: "horizontal", fadeColor: "from-background", children: _jsx("div", { className: "flex w-max items-center gap-1 px-2 pt-4", children: current.items.map((item) => {
|
|
78
|
+
const on = item.key === active;
|
|
79
|
+
return (_jsxs(Link, { href: item.href, prefetch: false, onClick: (e) => go(e, item.href), "aria-current": on ? 'page' : undefined, "data-testid": `agent-view-${item.key}`, className: cn('flex h-7 items-center gap-1.5 rounded-md px-2.5 text-sm whitespace-nowrap transition-colors', on ? 'bg-muted text-foreground' : 'text-muted-foreground hover:bg-hover hover:text-foreground'), children: [item.label, dirty?.includes(item.key) ? dot : null, item.count !== undefined ? _jsx("span", { className: "text-muted-foreground tabular-nums", children: item.count }) : null] }, item.key));
|
|
80
|
+
}) }) }) })) : null] }));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A tab, view or rail link on the agent page only changes the query
|
|
84
|
+
* (`?tab=&view=`): the page and its draft stay mounted. A plain click writes
|
|
85
|
+
* the URL to history (`useUiShallowNavigate`) instead of a router navigation,
|
|
86
|
+
* which in Next.js waits on a server round trip for the same route. A
|
|
87
|
+
* modified or middle click keeps the link's own behavior (a new tab).
|
|
88
|
+
*/
|
|
89
|
+
export function useInPageNavigate() {
|
|
90
|
+
const navigate = useUiShallowNavigate();
|
|
91
|
+
return useCallback((event, href) => {
|
|
92
|
+
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
93
|
+
return;
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
navigate(href);
|
|
96
|
+
}, [navigate]);
|
|
97
|
+
}
|
|
98
|
+
/** The scroller under the tabs, on the page gutter. */
|
|
99
|
+
export function AgentTabBody({ children, className }) {
|
|
100
|
+
return (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx("div", { className: cn('w-full px-4 pt-5 pb-24 md:px-8', className), children: children }) }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The page before its reads land: the header, the tab row, and the Overview's
|
|
104
|
+
* centered column as three grouped blocks (description, instructions,
|
|
105
|
+
* properties). Grouped on purpose: a line per field reads as noise.
|
|
106
|
+
*/
|
|
107
|
+
export function AgentPageSkeleton() {
|
|
108
|
+
const sidebar = useOptionalSidebar();
|
|
109
|
+
const framed = useInCustomizeFrame();
|
|
110
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 flex-1 flex-col", "aria-busy": true, children: [_jsxs("header", { className: cn('flex min-h-12 shrink-0 items-center gap-3 px-4 py-2', !framed && 'kx-titlebar-row'), "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [framed ? null : _jsx(SidebarToggle, {}), _jsx(Skeleton, { className: "shrink-0 rounded-md py-0", style: { width: 28, height: 28 } }), _jsx(Skeleton, { className: "h-4 w-40 rounded-sm py-0" })] }), _jsxs("div", { className: "flex h-10 shrink-0 items-center gap-4 border-b px-4", "aria-hidden": true, children: [_jsx(Skeleton, { className: "h-3.5 w-16 rounded-sm py-0" }), _jsx(Skeleton, { className: "h-3.5 w-16 rounded-sm py-0" }), _jsx(Skeleton, { className: "h-3.5 w-16 rounded-sm py-0" })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-hidden px-4 pt-5 md:px-8", "aria-hidden": true, children: _jsxs("div", { className: "mx-auto w-full max-w-3xl space-y-6", children: [_jsx(Skeleton, { className: "h-20 w-full rounded-md py-0" }), _jsx(Skeleton, { className: "h-80 w-full rounded-lg py-0" }), _jsx(Skeleton, { className: "h-48 w-full rounded-md py-0" })] }) })] }));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A page that has a header and a single state under it (error, not found):
|
|
114
|
+
* the same header slot, so the sidebar opener is always reachable. No tile:
|
|
115
|
+
* the page is not (yet) an agent.
|
|
116
|
+
*/
|
|
117
|
+
export function AgentStatePage({ title, children }) {
|
|
118
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 flex-1 flex-col", children: [_jsx(CustomizeHeader, { title: title, rule: true }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsx("div", { className: "mx-auto w-full max-w-xl px-4 py-16", children: children }) })] }));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The unsaved-edits bar, in the shape of the select-mode bar every list uses
|
|
122
|
+
* (`SelectionBar`, the Triggers bulk bar): one popover card, the state on the
|
|
123
|
+
* left with the changed tabs muted after it, then one secondary ButtonGroup of
|
|
124
|
+
* text buttons (Discard, Save ⌘S). It rises in like that bar and leaves at
|
|
125
|
+
* once. While the save runs, the session dot matrix leads and both disable.
|
|
126
|
+
*/
|
|
127
|
+
export function SaveBar({ dirty, pending, changed, onDiscard, onSave, }) {
|
|
128
|
+
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
129
|
+
const reduceMotion = useReducedMotion();
|
|
130
|
+
if (!dirty)
|
|
131
|
+
return null;
|
|
132
|
+
return (_jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-4 z-30 flex justify-center px-4", children: _jsxs(m.div, { initial: { opacity: 0, transform: reduceMotion ? 'translateY(0px)' : 'translateY(8px)' }, animate: { opacity: 1, transform: 'translateY(0px)', transition: { duration: 0.18, ease: [0.23, 1, 0.32, 1] } }, className: "bg-popover text-popover-foreground border-border pointer-events-auto flex w-full items-center gap-3 rounded-lg border p-2 pl-3.5 shadow-md md:w-auto md:min-w-md md:max-w-full", children: [_jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-2 text-sm font-medium", "aria-live": "polite", children: [pending ? _jsx(SessionDotMatrix, { size: 14, className: "shrink-0" }) : null, _jsx("span", { className: "shrink-0", children: tI18nComplete.raw('textefa5855ff509') }), _jsx("span", { className: "text-muted-foreground min-w-0 truncate font-normal", children: changed })] }), _jsxs(ButtonGroup, { className: "shrink-0", children: [_jsx(Button, { type: "button", variant: "secondary", size: "sm", className: "h-8 shrink-0", onClick: onDiscard, disabled: pending, children: tI18nComplete.raw('texteb1a70e39274') }), _jsxs(Button, { type: "button", variant: "secondary", size: "sm", className: "h-8 shrink-0 gap-1.5", onClick: onSave, disabled: pending, "aria-busy": pending || undefined, children: [tI18nComplete.raw('text1509f561f241'), _jsx(Kbd, { children: tI18nComplete.raw('text8cd003e6301b') })] })] })] }) }));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Asked when a link would leave the page with unsaved edits. Three answers:
|
|
136
|
+
* stay, leave and lose the edits, or save first and then leave.
|
|
137
|
+
*/
|
|
138
|
+
export function LeaveDialog({ open, changed, pending, onStay, onLeave, onSaveAndLeave, }) {
|
|
139
|
+
const t = useI18nTranslations('agentEditor.tabs');
|
|
140
|
+
return (_jsx(AlertDialog, { open: open, onOpenChange: (next) => (next ? undefined : onStay()), children: _jsxs(AlertDialogContent, { className: "sm:max-w-md", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: t('leaveTitle') }), _jsx(AlertDialogDescription, { children: t('leaveBody', { tabs: changed }) })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: pending, children: t('stay') }), _jsx(Button, { variant: "secondary", size: "sm", onClick: onLeave, disabled: pending, children: t('leave') }), _jsx(Button, { size: "sm", onClick: onSaveAndLeave, disabled: pending, "aria-busy": pending || undefined, children: t('saveAndLeave') })] })] }) }));
|
|
141
|
+
}
|
|
142
|
+
/** The agent's display name, for header titles. */
|
|
143
|
+
export function agentTitle(slug) {
|
|
144
|
+
return agentDisplayName(slug);
|
|
145
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type AgentGrant } from '../shared/agent-resource-scope.js';
|
|
3
|
+
/**
|
|
4
|
+
* A host's Apps screen in agent mode: the ONE Apps component (it lives in
|
|
5
|
+
* the host app) with this agent's grant. Without it Access → Apps is hidden.
|
|
6
|
+
*/
|
|
7
|
+
export type RenderAgentApps = (args: {
|
|
8
|
+
agentName: string;
|
|
9
|
+
grant: AgentGrant;
|
|
10
|
+
needsAppRead: boolean;
|
|
11
|
+
}) => ReactNode;
|
|
12
|
+
export declare function AgentPage({ projectId, agentName, renderApps, }: {
|
|
2
13
|
projectId: string;
|
|
3
14
|
agentName: string;
|
|
15
|
+
renderApps?: RenderAgentApps;
|
|
4
16
|
}): import("react").JSX.Element;
|