@kortix/ui 0.14.7 → 0.14.9
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 +2 -2
- package/dist/_vendor/kortix-shared.js +64 -4
- package/dist/_vendor/shared/app-config.d.ts +175 -0
- package/dist/_vendor/shared/channel-message.d.ts +34 -5
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/runtime-versions.d.ts +4 -0
- package/dist/_vendor/shared/space-slug.d.ts +37 -0
- package/dist/access/access/access-detail-shell.js +1 -1
- package/dist/access/access/access-dialog-share.js +4 -7
- package/dist/access/access/access-dialog.js +2 -1
- package/dist/access/access/principal-picker.d.ts +11 -0
- package/dist/access/access/principal-picker.js +9 -7
- package/dist/apps/app-preview-pool.d.ts +7 -2
- package/dist/apps/app-preview-pool.js +11 -5
- package/dist/apps/app-shared.d.ts +22 -15
- package/dist/apps/app-shared.js +37 -19
- package/dist/apps/index.d.ts +2 -2
- package/dist/apps/index.js +2 -2
- package/dist/artifacts/artifact-frame.d.ts +16 -0
- package/dist/artifacts/artifact-frame.js +51 -0
- package/dist/artifacts/artifact-session.d.ts +18 -0
- package/dist/artifacts/artifact-session.js +101 -0
- package/dist/artifacts/frame-policy.d.ts +30 -0
- package/dist/artifacts/frame-policy.js +61 -0
- package/dist/artifacts/index.d.ts +3 -0
- package/dist/artifacts/index.js +5 -0
- package/dist/browser/sandbox-browser-chrome.d.ts +4 -1
- package/dist/browser/sandbox-browser-chrome.js +2 -2
- package/dist/customize/agents/agent-cover-card.d.ts +17 -0
- package/dist/customize/agents/agent-cover-card.js +13 -0
- package/dist/customize/agents/agent-grant-pages.d.ts +5 -1
- package/dist/customize/agents/agent-grant-pages.js +30 -4
- package/dist/customize/agents/agent-page.js +8 -33
- package/dist/customize/agents/agent-policy-sets.d.ts +43 -0
- package/dist/customize/agents/agent-policy-sets.js +72 -0
- package/dist/customize/agents/agent-triggers-section.js +2 -1
- package/dist/customize/agents/agents-page.js +43 -49
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.d.ts +6 -1
- package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +10 -4
- package/dist/customize/connectors/agent-access.d.ts +35 -0
- package/dist/customize/connectors/agent-access.js +77 -0
- package/dist/customize/connectors/catalog/browse-sections.d.ts +2 -29
- package/dist/customize/connectors/catalog/browse-sections.js +7 -74
- package/dist/customize/connectors/catalog/catalog-entry.d.ts +18 -37
- package/dist/customize/connectors/catalog/catalog-entry.js +28 -40
- package/dist/customize/connectors/catalog/connector-browse.d.ts +3 -32
- package/dist/customize/connectors/catalog/connector-browse.js +19 -50
- package/dist/customize/connectors/catalog/use-catalog.d.ts +20 -59
- package/dist/customize/connectors/catalog/use-catalog.js +48 -175
- package/dist/customize/connectors/connector-identity.d.ts +9 -11
- package/dist/customize/connectors/connector-identity.js +13 -42
- package/dist/customize/connectors/connector-moves-banner.d.ts +2 -1
- package/dist/customize/connectors/connector-moves-banner.js +4 -6
- package/dist/customize/connectors/connector-routes.d.ts +21 -9
- package/dist/customize/connectors/connector-routes.js +29 -20
- package/dist/customize/connectors/connectors-page.js +53 -82
- package/dist/customize/connectors/detail/app-page.js +226 -98
- package/dist/customize/connectors/detail/computer-app-page.d.ts +16 -0
- package/dist/customize/connectors/detail/computer-app-page.js +39 -0
- package/dist/customize/connectors/detail/connector-accounts.js +3 -1
- package/dist/customize/connectors/detail/connector-advanced-tools.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-advanced-tools.js +2 -2
- package/dist/customize/connectors/detail/connector-agents.d.ts +14 -0
- package/dist/customize/connectors/detail/connector-agents.js +69 -0
- package/dist/customize/connectors/detail/connector-detail-tabs.js +2 -1
- package/dist/customize/connectors/detail/connector-move-row.d.ts +8 -5
- package/dist/customize/connectors/detail/connector-move-row.js +23 -14
- package/dist/customize/connectors/detail/connector-page.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-page.js +14 -10
- package/dist/customize/connectors/detail/connector-policy-sets.d.ts +28 -0
- package/dist/customize/connectors/detail/connector-policy-sets.js +203 -0
- package/dist/customize/connectors/detail/connector-settings.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-settings.js +7 -3
- package/dist/customize/connectors/detail/connector-status.d.ts +19 -6
- package/dist/customize/connectors/detail/connector-status.js +34 -10
- package/dist/customize/connectors/detail/connector-tabs.d.ts +4 -1
- package/dist/customize/connectors/detail/connector-tabs.js +8 -2
- package/dist/customize/connectors/detail/connector-tools.d.ts +3 -3
- package/dist/customize/connectors/detail/connector-tools.js +105 -48
- package/dist/customize/connectors/detail/email-inboxes.d.ts +43 -0
- package/dist/customize/connectors/detail/email-inboxes.js +184 -0
- package/dist/customize/connectors/detail/provider-info.d.ts +1 -1
- package/dist/customize/connectors/detail/provider-info.js +2 -2
- package/dist/customize/connectors/detail/status-badge.d.ts +1 -1
- package/dist/customize/connectors/detail/status-badge.js +4 -5
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +6 -0
- package/dist/customize/connectors/detail/use-connector-detail.js +14 -4
- package/dist/customize/connectors/install/install-dialog.d.ts +23 -0
- package/dist/customize/connectors/install/install-dialog.js +40 -0
- package/dist/customize/connectors/install/install.d.ts +13 -2
- package/dist/customize/connectors/install/install.js +9 -4
- package/dist/customize/connectors/install/use-install.d.ts +19 -2
- package/dist/customize/connectors/install/use-install.js +65 -37
- package/dist/customize/connectors/install/way-kind.d.ts +5 -0
- package/dist/customize/connectors/install/way-kind.js +16 -0
- package/dist/customize/connectors/provider-label.d.ts +2 -1
- package/dist/customize/connectors/provider-label.js +13 -3
- package/dist/customize/connectors/tools/pattern-rule-draft.d.ts +4 -0
- package/dist/customize/connectors/tools/pattern-rule-draft.js +12 -3
- package/dist/customize/connectors/tools/policy-sets.d.ts +27 -0
- package/dist/customize/connectors/tools/policy-sets.js +41 -0
- package/dist/customize/connectors/tools/tool-groups.d.ts +32 -9
- package/dist/customize/connectors/tools/tool-groups.js +78 -16
- package/dist/customize/connectors/tools/tool-policy-control.d.ts +11 -10
- package/dist/customize/connectors/tools/tool-policy-control.js +15 -16
- package/dist/customize/connectors/tools/tool-policy-labels.d.ts +6 -5
- package/dist/customize/connectors/tools/tool-policy-labels.js +17 -16
- package/dist/customize/connectors/tools/tool-policy.d.ts +50 -4
- package/dist/customize/connectors/tools/tool-policy.js +74 -8
- package/dist/customize/connectors/use-agent-access.d.ts +85 -0
- package/dist/customize/connectors/use-agent-access.js +72 -0
- package/dist/customize/migrate-to-v2/index.d.ts +1 -2
- package/dist/customize/migrate-to-v2/index.js +1 -2
- package/dist/customize/migrate-to-v2/migration-prompt.d.ts +12 -24
- package/dist/customize/migrate-to-v2/migration-prompt.js +34 -235
- package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +1 -1
- package/dist/customize/migrate-to-v2/upgrade-defs.js +7 -6
- package/dist/customize/migrate-to-v2/upgrade-view.js +7 -7
- package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +3 -3
- package/dist/customize/providers/provider-accordion.js +17 -2
- package/dist/customize/sections/component/channel-access-panel.d.ts +16 -0
- package/dist/customize/sections/component/channel-access-panel.js +146 -0
- package/dist/customize/sections/component/channel-connect-hero.d.ts +3 -2
- package/dist/customize/sections/component/channel-connect-hero.js +3 -2
- package/dist/customize/sections/component/channel-hero-frame.d.ts +31 -0
- package/dist/customize/sections/component/channel-hero-frame.js +40 -0
- package/dist/customize/sections/component/channel-mocks.d.ts +6 -0
- package/dist/customize/sections/component/channel-mocks.js +46 -0
- package/dist/customize/sections/component/channel-row.d.ts +13 -3
- package/dist/customize/sections/component/channel-row.js +10 -4
- package/dist/customize/sections/component/email-connect-form.d.ts +27 -0
- package/dist/customize/sections/component/email-connect-form.js +183 -0
- package/dist/customize/sections/component/slack-connect-card.d.ts +7 -0
- package/dist/customize/sections/component/slack-connect-card.js +2 -3
- package/dist/customize/sections/component/teams-connect-card.d.ts +7 -0
- package/dist/customize/sections/component/teams-connect-card.js +2 -3
- package/dist/customize/sections/component/telegram-channel-row.js +16 -25
- package/dist/customize/sections/connectors-view.d.ts +1 -15
- package/dist/customize/sections/connectors-view.js +81 -314
- package/dist/customize/sections/view/agent-editor-catalog.js +5 -0
- package/dist/customize/sections/view/channels-view.d.ts +5 -1
- package/dist/customize/sections/view/channels-view.js +63 -81
- package/dist/customize/sections/view/gateway/gateway-overview.js +10 -2
- package/dist/customize/settings/tabs/experimental-tab.js +35 -16
- package/dist/customize/shared/catalog/catalog-empty-state.d.ts +1 -12
- package/dist/customize/shared/catalog/catalog-empty-state.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +18 -0
- package/dist/customize/shared/channels-switch-dialog.js +30 -0
- package/dist/customize/shared/feature-gate-screen.js +27 -9
- package/dist/customize/shared/new-entity-menu.js +4 -1
- package/dist/customize/shared/use-customize-prefetch.d.ts +2 -3
- package/dist/customize/shared/use-customize-prefetch.js +9 -27
- package/dist/customize/skills/skills-page.js +4 -5
- package/dist/customize/triggers/schedule/post-to-field.d.ts +18 -0
- package/dist/customize/triggers/schedule/post-to-field.js +49 -0
- package/dist/customize/triggers/schedule/schedule-copy.d.ts +10 -6
- package/dist/customize/triggers/schedule/schedule-copy.js +42 -11
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +2 -1
- package/dist/customize/triggers/schedule/then-fields.js +1 -5
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +22 -0
- package/dist/customize/triggers/schedule/trigger-composer-logic.js +25 -0
- package/dist/customize/triggers/schedule/trigger-composer.d.ts +5 -0
- package/dist/customize/triggers/schedule/trigger-composer.js +23 -14
- package/dist/customize/triggers/schedule/trigger-edit-logic.js +3 -0
- package/dist/customize/triggers/schedule/trigger-filter.js +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +2 -2
- 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-view.js +9 -4
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +1 -0
- package/dist/files/project/change-request-recovery.d.ts +1 -26
- package/dist/files/project/change-request-recovery.js +1 -59
- package/dist/files/project/components/change-request-detail-dialog.js +13 -3
- package/dist/files/project/components/drive-explorer.js +15 -15
- package/dist/files/project/components/drive-toolbar.d.ts +16 -2
- package/dist/files/project/components/drive-toolbar.js +14 -5
- package/dist/files/project/hooks/use-change-request-recovery.js +3 -19
- package/dist/files/project/hooks/use-change-requests.d.ts +1 -0
- package/dist/files/project/hooks/use-change-requests.js +11 -2
- package/dist/files/renderers/image-frame.d.ts +46 -0
- package/dist/files/renderers/image-frame.js +59 -0
- package/dist/files/renderers/image-renderer.d.ts +11 -1
- package/dist/files/renderers/image-renderer.js +13 -3
- package/dist/files/renderers/pdf/pdf-clipboard.d.ts +2 -0
- package/dist/files/renderers/pdf/pdf-clipboard.js +21 -0
- package/dist/files/renderers/pdf/pdf-viewer.js +4 -2
- package/dist/files/renderers/show-content-renderer.d.ts +9 -1
- package/dist/files/renderers/show-content-renderer.js +56 -14
- package/dist/files/runtime/file-source.js +2 -0
- package/dist/files/runtime/hooks/use-binary-blob.d.ts +10 -1
- package/dist/files/runtime/hooks/use-binary-blob.js +10 -4
- package/dist/files/runtime/hooks/use-shared-image.d.ts +41 -0
- package/dist/files/runtime/hooks/use-shared-image.js +177 -0
- package/dist/files/viewer/file-content-renderer.d.ts +22 -1
- package/dist/files/viewer/file-content-renderer.js +50 -7
- package/dist/files/viewer/file-header.d.ts +7 -3
- package/dist/files/viewer/file-header.js +20 -11
- package/dist/files/viewer/file-preview-modal.d.ts +1 -1
- package/dist/files/viewer/file-preview-modal.js +10 -22
- package/dist/files/viewer/file-source.d.ts +13 -0
- package/dist/files/viewer/use-file-content-state.d.ts +2 -0
- package/dist/files/viewer/use-file-content-state.js +28 -10
- package/dist/files/viewer/viewer-actions.d.ts +3 -1
- package/dist/files/viewer/viewer-actions.js +2 -2
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-mobile.d.ts +5 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/i18n/en.d.ts +906 -70
- package/dist/i18n/en.js +924 -88
- package/dist/i18n/ui-catalog/localize-ui-catalog.js +4 -0
- package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +15 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/internal/account-hub/account-settings-sidebar.js +1 -1
- package/dist/internal/account-hub/hub-sheet.d.ts +9 -1
- package/dist/internal/account-hub/hub-sheet.js +21 -5
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/account-hub/sections.js +2 -1
- package/dist/internal/auth/auth-card-shell.js +3 -3
- package/dist/internal/components/agent-mark.d.ts +38 -0
- package/dist/internal/components/agent-mark.js +41 -0
- package/dist/internal/connector-logo/connector-logo-source.d.ts +63 -0
- package/dist/internal/connector-logo/connector-logo-source.js +48 -0
- package/dist/internal/connector-logo/connector-logo.d.ts +39 -0
- package/dist/internal/connector-logo/connector-logo.js +56 -0
- package/dist/internal/connector-logo/connector-mark-files.d.ts +11 -0
- package/dist/internal/connector-logo/connector-mark-files.js +35 -0
- package/dist/internal/files/file-read-retry.d.ts +13 -0
- package/dist/internal/files/file-read-retry.js +23 -3
- package/dist/internal/files/session-drive-files.d.ts +5 -1
- package/dist/internal/files/session-drive-files.js +7 -2
- package/dist/internal/hooks/channels/use-channels-installations.d.ts +32 -5
- package/dist/internal/hooks/channels/use-channels-installations.js +55 -7
- package/dist/internal/hooks/channels/use-email-inboxes.d.ts +19 -0
- package/dist/internal/hooks/channels/use-email-inboxes.js +48 -0
- package/dist/internal/hooks/connectors/use-add-account.js +1 -1
- package/dist/internal/hooks/index.d.ts +1 -1
- package/dist/internal/hooks/index.js +1 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +9 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +28 -12
- package/dist/internal/hooks/use-auto-scroll.d.ts +8 -1
- package/dist/internal/hooks/use-auto-scroll.js +4 -4
- package/dist/internal/icons/telegram.d.ts +5 -0
- package/dist/internal/icons/telegram.js +6 -1
- package/dist/internal/layout/nav-hover-card.d.ts +35 -0
- package/dist/internal/layout/nav-hover-card.js +84 -0
- package/dist/internal/layout/project-nav-row.d.ts +3 -1
- package/dist/internal/layout/project-nav-row.js +3 -2
- package/dist/internal/layout/project-page-header.d.ts +4 -2
- package/dist/internal/layout/project-page-header.js +4 -3
- package/dist/internal/layout/project-settings-nav.js +59 -2
- package/dist/internal/lib/browser-error-noise.d.ts +1 -1
- package/dist/internal/lib/browser-error-noise.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +7 -0
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +15 -0
- package/dist/internal/lib/manifest-version.d.ts +1 -1
- package/dist/internal/lib/manifest-version.js +2 -2
- package/dist/internal/lib/memory-href.d.ts +16 -0
- package/dist/internal/lib/memory-href.js +46 -0
- package/dist/internal/lib/pixel-mark.d.ts +33 -0
- package/dist/internal/lib/pixel-mark.js +152 -0
- package/dist/internal/lib/use-project-feature-flags.js +11 -11
- package/dist/internal/lib/utils/heic-convert.d.ts +1 -1
- package/dist/internal/lib/utils/heic-convert.js +3 -4
- package/dist/internal/lib/web-notifications.d.ts +20 -0
- package/dist/internal/lib/web-notifications.js +48 -4
- package/dist/internal/notifications/notification-bell.d.ts +4 -1
- package/dist/internal/notifications/notification-bell.js +2 -2
- package/dist/internal/selection/selection-bar.d.ts +2 -1
- package/dist/internal/selection/selection-bar.js +1 -1
- package/dist/internal/stores/file-preview-store.d.ts +29 -2
- package/dist/internal/stores/file-preview-store.js +19 -1
- package/dist/internal/stores/kortix-computer-store.js +3 -0
- package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
- package/dist/internal/stores/sidebar-nav-store.js +3 -1
- package/dist/lib/routes.d.ts +13 -1
- package/dist/lib/routes.js +13 -0
- package/dist/markdown/genui/components/inline.d.ts +1 -1
- package/dist/markdown/index.d.ts +2 -1
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/setup-links/approval-decision.d.ts +1 -0
- package/dist/markdown/setup-links/approval-decision.js +6 -2
- package/dist/markdown/setup-links/connector-handshake.d.ts +3 -1
- package/dist/markdown/setup-links/connector-handshake.js +12 -10
- package/dist/markdown/setup-links/show-connect-hero.d.ts +28 -0
- package/dist/markdown/setup-links/show-connect-hero.js +91 -0
- package/dist/markdown/unified-markdown.js +5 -5
- package/dist/primitives/badge.d.ts +1 -1
- package/dist/primitives/badge.js +2 -0
- package/dist/primitives/disclosure.js +14 -2
- package/dist/primitives/empty-art.d.ts +12 -0
- package/dist/primitives/empty-art.js +11 -0
- package/dist/primitives/entity-avatar.d.ts +4 -1
- package/dist/primitives/entity-avatar.js +4 -2
- package/dist/primitives/mermaid-renderer.d.ts +2 -0
- package/dist/primitives/mermaid-renderer.js +21 -15
- package/dist/primitives/resizable.js +6 -1
- package/dist/primitives/resize-seam.d.ts +11 -0
- package/dist/primitives/resize-seam.js +12 -0
- package/dist/primitives/sidebar-panel.js +4 -7
- package/dist/primitives/tabs.d.ts +14 -1
- package/dist/primitives/tabs.js +1 -1
- package/dist/primitives/user-avatar.d.ts +3 -1
- package/dist/primitives/user-avatar.js +4 -2
- package/dist/providers/ui-provider.d.ts +10 -1
- package/dist/session/composer/ComposerAboveCard.d.ts +1 -1
- package/dist/session/composer/ComposerAboveCard.js +2 -2
- package/dist/session/composer/ComposerCard.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +3 -3
- package/dist/session/composer/agent-selector.d.ts +19 -1
- package/dist/session/composer/agent-selector.js +42 -12
- package/dist/session/composer/composer-agent-access.d.ts +15 -0
- package/dist/session/composer/composer-agent-access.js +27 -0
- package/dist/session/composer/composer-chat-input.d.ts +8 -2
- package/dist/session/composer/composer-chat-input.js +8 -6
- package/dist/session/composer/composer-logic.d.ts +16 -0
- package/dist/session/composer/composer-logic.js +12 -0
- package/dist/session/composer/composer-underbar.d.ts +3 -1
- package/dist/session/composer/composer-underbar.js +4 -3
- package/dist/session/composer/composer.d.ts +15 -1
- package/dist/session/composer/composer.js +19 -1
- package/dist/session/composer/context-usage.d.ts +5 -0
- package/dist/session/composer/context-usage.js +6 -1
- package/dist/session/composer/draft/composer-draft.d.ts +6 -2
- package/dist/session/composer/draft/composer-draft.js +5 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/composer/token-progress.js +4 -4
- package/dist/session/header/export-transcript-modal.d.ts +3 -2
- package/dist/session/header/export-transcript-modal.js +6 -3
- package/dist/session/models/chatgpt-connection-button.d.ts +11 -0
- package/dist/session/models/chatgpt-connection-button.js +54 -0
- package/dist/session/models/model-selector.d.ts +3 -1
- package/dist/session/models/model-selector.js +7 -3
- package/dist/session/models/use-model-connection-gate.d.ts +5 -5
- package/dist/session/models/use-model-connection-gate.js +5 -5
- package/dist/session/outcomes/jump-to-outcome.d.ts +10 -0
- package/dist/session/outcomes/jump-to-outcome.js +11 -0
- package/dist/session/outcomes/session-outcomes-bridge.d.ts +14 -0
- package/dist/session/outcomes/session-outcomes-bridge.js +12 -0
- package/dist/session/outcomes/session-outcomes-provider.d.ts +3 -1
- package/dist/session/outcomes/session-outcomes-provider.js +33 -3
- package/dist/session/panel/easy/app-preview.d.ts +10 -0
- package/dist/session/panel/easy/app-preview.js +31 -12
- package/dist/session/panel/easy/change-requests-card.d.ts +7 -0
- package/dist/session/panel/easy/change-requests-card.js +17 -0
- package/dist/session/panel/easy/easy-panel-logic.js +7 -1
- package/dist/session/panel/easy/easy-panel.js +5 -2
- package/dist/session/panel/easy/file-preview.js +1 -1
- package/dist/session/panel/easy/outputs-card.d.ts +2 -1
- package/dist/session/panel/easy/outputs-card.js +3 -2
- package/dist/session/panel/easy/plan-card.d.ts +2 -0
- package/dist/session/panel/easy/plan-card.js +2 -0
- package/dist/session/panel/mobile-tool-drawer.js +7 -1
- package/dist/session/panel/session-audit-panel.js +9 -2
- package/dist/session/panel/session-detail-panel.js +9 -3
- package/dist/session/panel/session-files-explorer.d.ts +9 -0
- package/dist/session/panel/session-files-explorer.js +12 -3
- package/dist/session/panel/session-panel-provider.d.ts +15 -1
- package/dist/session/panel/session-panel-provider.js +32 -7
- package/dist/session/panel/shared/derive-panels.d.ts +8 -1
- package/dist/session/panel/shared/derive-panels.js +12 -2
- package/dist/session/panel/shared/output-priority.js +2 -0
- package/dist/session/participants/session-participants.d.ts +5 -1
- package/dist/session/participants/session-participants.js +9 -2
- package/dist/session/prompts/approval-request.d.ts +5 -0
- package/dist/session/prompts/approval-request.js +7 -1
- package/dist/session/prompts/session-approval-review.d.ts +9 -0
- package/dist/session/prompts/session-approval-review.js +18 -0
- package/dist/session/status/session-error-banner.js +2 -49
- package/dist/session/status/session-starting-loader.d.ts +14 -2
- package/dist/session/status/session-starting-loader.js +16 -4
- package/dist/session/thread/after-first-prompt.d.ts +7 -0
- package/dist/session/thread/after-first-prompt.js +8 -0
- package/dist/session/thread/detect-command.d.ts +12 -0
- package/dist/session/thread/detect-command.js +20 -0
- package/dist/session/thread/plan-surface.d.ts +1 -0
- package/dist/session/thread/plan-surface.js +1 -0
- package/dist/session/thread/session-chat.d.ts +3 -1
- package/dist/session/thread/session-chat.js +377 -252
- package/dist/session/thread/session-context-metrics.d.ts +15 -0
- package/dist/session/thread/session-context-metrics.js +10 -1
- package/dist/session/thread/session-context-modal.d.ts +4 -2
- package/dist/session/thread/session-context-modal.js +16 -9
- package/dist/session/thread/session-thread.d.ts +3 -1
- package/dist/session/thread/session-thread.js +9 -2
- package/dist/session/thread/thread-boot-rows.d.ts +36 -0
- package/dist/session/thread/thread-boot-rows.js +89 -0
- package/dist/session/thread/transcript-rows.d.ts +31 -0
- package/dist/session/thread/transcript-rows.js +3 -0
- package/dist/session/thread/transcript.d.ts +4 -9
- package/dist/session/thread/transcript.js +119 -21
- package/dist/session/thread/turn-share.d.ts +16 -0
- package/dist/session/thread/turn-share.js +162 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +28 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +31 -3
- package/dist/session/tool/tool-part-renderer.d.ts +5 -4
- package/dist/session/tool/tool-part-renderer.js +8 -3
- package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -0
- package/dist/session/tool/tools/apply-patch-tool.js +1 -0
- package/dist/session/tool/tools/bash-tool.js +7 -6
- package/dist/session/tool/tools/channel-send-card.d.ts +1 -2
- package/dist/session/tool/tools/channel-send.d.ts +2 -1
- package/dist/session/tool/tools/codemode-tool.js +1 -1
- package/dist/session/tool/tools/connector-tools.js +1 -1
- package/dist/session/tool/tools/image-gen-tool.d.ts +1 -1
- package/dist/session/tool/tools/image-gen-tool.js +240 -53
- package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-kill-tool.js +1 -0
- package/dist/session/tool/tools/pty-read-tool.d.ts +2 -0
- package/dist/session/tool/tools/pty-read-tool.js +2 -0
- package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -0
- package/dist/session/tool/tools/pty-write-tool.d.ts +1 -0
- package/dist/session/tool/tools/pty-write-tool.js +1 -0
- package/dist/session/tool/tools/show-tool.js +19 -8
- package/dist/session/tool/tools/todo-write-tool.d.ts +1 -0
- package/dist/session/tool/tools/todo-write-tool.js +1 -0
- package/dist/session/turn/channel-brand.d.ts +8 -3
- package/dist/session/turn/channel-brand.js +20 -4
- package/dist/session/turn/message-author-label.js +6 -2
- package/dist/session/turn/message-author.d.ts +8 -0
- package/dist/session/turn/message-author.js +24 -0
- package/dist/session/turn/message-row.d.ts +52 -0
- package/dist/session/turn/message-row.js +44 -0
- package/dist/session/turn/plan-anchor.d.ts +4 -1
- package/dist/session/turn/plan-anchor.js +4 -1
- package/dist/session/turn/plan-card.d.ts +7 -0
- package/dist/session/turn/plan-card.js +7 -0
- package/dist/session/turn/user-message.d.ts +7 -1
- package/dist/session/turn/user-message.js +21 -7
- package/dist/styles.css +1 -1
- package/dist/terminal/session-terminal-connect-bar.js +2 -1
- package/dist/workspace/home/access-requests-bell.d.ts +9 -2
- package/dist/workspace/home/access-requests-bell.js +20 -6
- package/dist/workspace/home/first-chat.d.ts +8 -21
- package/dist/workspace/home/first-chat.js +22 -72
- package/dist/workspace/index.d.ts +6 -0
- package/dist/workspace/index.js +6 -0
- package/dist/workspace/layout/project-home.d.ts +14 -2
- package/dist/workspace/layout/project-home.js +60 -21
- package/dist/workspace/layout/use-project-home-send.d.ts +9 -1
- package/dist/workspace/layout/use-project-home-send.js +82 -3
- package/dist/workspace/memory/body-doc.d.ts +17 -0
- package/dist/workspace/memory/body-doc.js +208 -0
- package/dist/workspace/memory/body-extensions.d.ts +38 -0
- package/dist/workspace/memory/body-extensions.js +103 -0
- package/dist/workspace/memory/company-memory-page.d.ts +8 -0
- package/dist/workspace/memory/company-memory-page.js +16 -0
- package/dist/workspace/memory/memory-all.d.ts +20 -0
- package/dist/workspace/memory/memory-all.js +27 -0
- package/dist/workspace/memory/memory-body.d.ts +19 -0
- package/dist/workspace/memory/memory-body.js +139 -0
- package/dist/workspace/memory/memory-empty.d.ts +13 -0
- package/dist/workspace/memory/memory-empty.js +28 -0
- package/dist/workspace/memory/memory-history.d.ts +27 -0
- package/dist/workspace/memory/memory-history.js +108 -0
- package/dist/workspace/memory/memory-labels.d.ts +16 -0
- package/dist/workspace/memory/memory-labels.js +47 -0
- package/dist/workspace/memory/memory-page-list.d.ts +34 -0
- package/dist/workspace/memory/memory-page-list.js +156 -0
- package/dist/workspace/memory/memory-reader.d.ts +58 -0
- package/dist/workspace/memory/memory-reader.js +123 -0
- package/dist/workspace/memory/memory-view.d.ts +21 -0
- package/dist/workspace/memory/memory-view.js +124 -0
- package/dist/workspace/memory/remember-popover.d.ts +19 -0
- package/dist/workspace/memory/remember-popover.js +61 -0
- package/dist/workspace/memory/remember-this.d.ts +12 -0
- package/dist/workspace/memory/remember-this.js +89 -0
- package/dist/workspace/memory/source-mark.d.ts +18 -0
- package/dist/workspace/memory/source-mark.js +79 -0
- package/dist/workspace/memory/used-memory-chip.d.ts +14 -0
- package/dist/workspace/memory/used-memory-chip.js +61 -0
- package/dist/workspace/new/advanced-fields.d.ts +2 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/source-param.d.ts +1 -1
- package/dist/workspace/new/source-param.js +3 -1
- package/dist/workspace/new/use-create-workspace.d.ts +8 -10
- package/dist/workspace/new/use-create-workspace.js +3 -3
- package/dist/workspace/projects/onboarding/app-logo.d.ts +7 -2
- package/dist/workspace/projects/onboarding/app-logo.js +6 -13
- package/dist/workspace/projects/policies-panel.js +5 -3
- package/dist/workspace/review/review-actions.d.ts +4 -2
- package/dist/workspace/review/review-actions.js +8 -2
- package/dist/workspace/review/review-center.js +11 -7
- package/dist/workspace/review/review-detail.d.ts +10 -0
- package/dist/workspace/review/review-detail.js +101 -13
- package/dist/workspace/saved-session-skeleton.d.ts +2 -2
- package/dist/workspace/saved-session-skeleton.js +3 -3
- package/dist/workspace/session-workspace.js +15 -13
- package/dist/workspace/sessions/project-sessions-view.js +3 -2
- package/dist/workspace/sessions/sessions-toolbar.d.ts +3 -1
- package/dist/workspace/sessions/sessions-toolbar.js +2 -2
- package/dist/workspace/sidebar/footer/project-apps-nav.d.ts +5 -0
- package/dist/workspace/sidebar/footer/project-apps-nav.js +41 -2
- package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -0
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +22 -0
- package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +13 -13
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +7 -0
- package/dist/workspace/sidebar/footer/project-memory-nav.js +19 -0
- package/dist/workspace/sidebar/nav-row-meta.js +14 -2
- package/dist/workspace/sidebar/project-nav-items.js +3 -0
- package/dist/workspace/sidebar/project-session-list.js +68 -56
- package/dist/workspace/sidebar/project-sidebar.js +9 -2
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +8 -0
- package/dist/workspace/sidebar/project-spaces-nav.js +69 -0
- package/dist/workspace/sidebar/session-brief-hover-card.js +28 -1
- package/dist/workspace/sidebar/session-group-order.d.ts +9 -0
- package/dist/workspace/sidebar/session-group-order.js +25 -0
- package/dist/workspace/sidebar/session-group-sections.d.ts +62 -0
- package/dist/workspace/sidebar/session-group-sections.js +267 -0
- package/dist/workspace/sidebar/session-list-chrome.d.ts +28 -0
- package/dist/workspace/sidebar/session-list-chrome.js +50 -0
- package/dist/workspace/spaces/channel-glyph.d.ts +5 -0
- package/dist/workspace/spaces/channel-glyph.js +6 -0
- package/dist/workspace/spaces/channel-setup.d.ts +16 -0
- package/dist/workspace/spaces/channel-setup.js +105 -0
- package/dist/workspace/spaces/channels-onboarding.d.ts +13 -0
- package/dist/workspace/spaces/channels-onboarding.js +37 -0
- package/dist/workspace/spaces/create-channel-dialog.d.ts +16 -0
- package/dist/workspace/spaces/create-channel-dialog.js +158 -0
- package/dist/workspace/spaces/private-channels-not-in.d.ts +9 -0
- package/dist/workspace/spaces/private-channels-not-in.js +69 -0
- package/dist/workspace/spaces/space-agents.d.ts +10 -0
- package/dist/workspace/spaces/space-agents.js +10 -0
- package/dist/workspace/spaces/space-details-dialog.d.ts +20 -0
- package/dist/workspace/spaces/space-details-dialog.js +176 -0
- package/dist/workspace/spaces/space-link-label.d.ts +49 -0
- package/dist/workspace/spaces/space-link-label.js +73 -0
- package/dist/workspace/spaces/space-links.d.ts +19 -0
- package/dist/workspace/spaces/space-links.js +230 -0
- package/dist/workspace/spaces/space-members.d.ts +46 -0
- package/dist/workspace/spaces/space-members.js +182 -0
- package/dist/workspace/spaces/space-roster.d.ts +15 -0
- package/dist/workspace/spaces/space-roster.js +44 -0
- package/dist/workspace/spaces/space-threads-tab.d.ts +56 -0
- package/dist/workspace/spaces/space-threads-tab.js +156 -0
- package/dist/workspace/spaces/space-timeline-view.d.ts +254 -0
- package/dist/workspace/spaces/space-timeline-view.js +235 -0
- package/dist/workspace/spaces/space-timeline.d.ts +106 -0
- package/dist/workspace/spaces/space-timeline.js +183 -0
- package/dist/workspace/spaces/space-triggers.d.ts +13 -0
- package/dist/workspace/spaces/space-triggers.js +78 -0
- package/dist/workspace/spaces/space-view.d.ts +37 -0
- package/dist/workspace/spaces/space-view.js +436 -0
- package/package.json +31 -32
- package/skills/kortix-ui/SKILL.md +3 -3
- package/skills/kortix-ui/references/custom-dashboard.md +3 -3
- package/skills/kortix-ui/references/modules.md +28 -4
- package/skills/kortix-ui/references/theming.md +1 -1
- package/dist/customize/agents/agent-nav.prototype.d.ts +0 -35
- package/dist/customize/agents/agent-nav.prototype.js +0 -95
- package/dist/customize/connectors/catalog/merge-search.d.ts +0 -10
- package/dist/customize/connectors/catalog/merge-search.js +0 -26
- package/dist/customize/connectors/detail/find-easy-connect-app.d.ts +0 -29
- package/dist/customize/connectors/detail/find-easy-connect-app.js +0 -22
- package/dist/customize/migrate-to-v2/use-migrate-to-v2.d.ts +0 -9
- package/dist/customize/migrate-to-v2/use-migrate-to-v2.js +0 -24
- package/dist/customize/sections/connector-connection-header.d.ts +0 -36
- package/dist/customize/sections/connector-connection-header.js +0 -33
- package/dist/customize/sections/connector-connection-modal.d.ts +0 -34
- package/dist/customize/sections/connector-connection-modal.js +0 -72
- package/dist/customize/sections/discover-catalogue-card.d.ts +0 -19
- package/dist/customize/sections/discover-catalogue-card.js +0 -26
- package/dist/customize/sections/discover-catalogue-detail.d.ts +0 -15
- package/dist/customize/sections/discover-catalogue-detail.js +0 -24
- package/dist/customize/sections/discover-catalogue.d.ts +0 -17
- package/dist/customize/sections/discover-catalogue.js +0 -132
- package/dist/customize/sections/llm-provider/provider-access-menu.d.ts +0 -10
- package/dist/customize/sections/llm-provider/provider-access-menu.js +0 -23
- package/dist/files/project/components/drive-empty-art.d.ts +0 -2
- package/dist/files/project/components/drive-empty-art.js +0 -5
- package/dist/internal/hooks/use-media-query.d.ts +0 -2
- package/dist/internal/share/public-share-link-button.d.ts +0 -14
- package/dist/internal/share/public-share-link-button.js +0 -17
- /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
|
@@ -20,6 +20,7 @@ const PATCH_ICON = {
|
|
|
20
20
|
delete: FileMinusIcon,
|
|
21
21
|
edit: PencilSimpleIcon,
|
|
22
22
|
};
|
|
23
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
23
24
|
export function ApplyPatchTool({ call, defaultOpen, forceOpen, locked }) {
|
|
24
25
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
25
26
|
const patchTypeStyle = useLocalizedUiCatalog(PATCH_TYPE_STYLE);
|
|
@@ -140,7 +140,7 @@ export function dedentCommand(raw) {
|
|
|
140
140
|
* The exit-code strip keeps its shorter 8px vertical inset: it is metadata
|
|
141
141
|
* about the card, not a third pane of content.
|
|
142
142
|
*/
|
|
143
|
-
function CommandBlock({ command, output, richOutput, exitCode,
|
|
143
|
+
function CommandBlock({ command, output, richOutput, exitCode, settled, }) {
|
|
144
144
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
145
145
|
const hasOutput = Boolean(richOutput || output);
|
|
146
146
|
const failed = typeof exitCode === 'number' && exitCode !== 0;
|
|
@@ -159,9 +159,10 @@ function CommandBlock({ command, output, richOutput, exitCode, recovered = false
|
|
|
159
159
|
// `overflow-hidden` clips the command pane's tint to the rounded frame;
|
|
160
160
|
// without it the wash pokes square corners past `rounded-md`.
|
|
161
161
|
_jsxs("div", { className: cn('relative overflow-hidden', frame), children: [_jsx("div", { "data-scrollable": true, className: cn('max-h-64 overflow-auto', frame && 'bg-muted/40'), children: _jsx("pre", { className: cn('text-foreground font-mono text-xs leading-relaxed wrap-break-word whitespace-pre-wrap [&_code]:border-none [&_code]:bg-transparent [&_code]:p-0 [&_code]:text-xs [&_code]:leading-relaxed [&_code]:whitespace-pre-wrap [&_pre]:whitespace-pre-wrap [&_span]:border-none [&_span]:outline-none', paneInset, 'pr-11'), children: _jsx(HighlightedCode, { code: command, language: "bash", children: command }) }) }), _jsx("div", { className: "absolute top-2 right-2", children: _jsx(CopyButton, { code: command, className: "text-muted-foreground hover:text-foreground" }) }), (hasOutput || settled) && (_jsx("div", { className: "border-border/60 border-t", children: richOutput ? (richOutput) : output ? (_jsxs("div", { className: "relative", children: [_jsx("div", { "data-scrollable": true, className: "max-h-80 overflow-auto", children: _jsx("div", { className: cn('text-muted-foreground font-mono text-xs leading-relaxed wrap-break-word whitespace-pre-wrap', paneInset, 'pr-11'), children: output }) }), _jsx("div", { className: "absolute top-2 right-2", children: _jsx(CopyButton, { code: output, className: "text-muted-foreground hover:text-foreground" }) })] })) : (_jsx("p", { className: cn('text-muted-foreground', paneInset, 'text-xs leading-relaxed'), children: tI18nComplete.raw('textf7e31759b202') })) })), failed && (_jsxs("div", { className: cn(
|
|
162
|
-
//
|
|
163
|
-
// is
|
|
164
|
-
|
|
162
|
+
// Muted ink, like the trigger's "Command failed": a failed command
|
|
163
|
+
// is ordinary agent work (it reads the error and tries again), so
|
|
164
|
+
// the words carry the verdict and no color raises an alarm.
|
|
165
|
+
'border-border/60 border-t py-2 font-mono text-xs tabular-nums text-muted-foreground',
|
|
165
166
|
// Metadata about the card, not a third pane: it keeps the shorter
|
|
166
167
|
// 8px vertical inset, and only the horizontal one is the surface's
|
|
167
168
|
// to supply.
|
|
@@ -198,7 +199,7 @@ function BashTrigger({ title, failed, command, commandPreview, extraLines, live,
|
|
|
198
199
|
}
|
|
199
200
|
return (_jsx("div", { className: "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden", children: _jsxs("span", { className: "flex min-w-0 shrink-0 items-center gap-2 text-xs",
|
|
200
201
|
// Redundant once the card spells the command out below.
|
|
201
|
-
title: open ? undefined : command, children: [_jsx("span", { className:
|
|
202
|
+
title: open ? undefined : command, children: [_jsx("span", { className: "min-w-0 truncate text-foreground", children: title }), !open && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground min-w-0 truncate font-mono", children: commandPreview }), extraLines > 0 && (_jsxs("span", { className: "text-muted-foreground shrink-0 tabular-nums", children: ["+", extraLines] }))] }))] }) }));
|
|
202
203
|
}
|
|
203
204
|
export function BashTool({ call, defaultOpen, forceOpen, locked }) {
|
|
204
205
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -278,6 +279,6 @@ export function BashTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
278
279
|
// `CommandBlock` is a bordered card like the shared three, so it takes
|
|
279
280
|
// the same gate: the seam belongs to the inline row it hangs under, not
|
|
280
281
|
// to the panel body that already supplies `px-3 py-3`.
|
|
281
|
-
_jsx("div", { className: cn(indent && 'mt-1.5', indent), children: _jsx(CommandBlock, { command: command, output: plainOutput, richOutput: richOutput, exitCode: exitCode,
|
|
282
|
+
_jsx("div", { className: cn(indent && 'mt-1.5', indent), children: _jsx(CommandBlock, { command: command, output: plainOutput, richOutput: richOutput, exitCode: exitCode, settled: status === 'completed' || status === 'error' }) }))] }));
|
|
282
283
|
}
|
|
283
284
|
ToolRegistry.register('bash', BashTool);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { type ChannelPlatform } from '../../turn/channel-message.js';
|
|
2
1
|
import { useTranslations } from '../../../i18n/index.js';
|
|
3
2
|
import { type ChannelSend } from './channel-send.js';
|
|
4
3
|
/** "Replied in Microsoft Teams" — the row title for a channel send. */
|
|
5
|
-
export declare function channelSendTitle(platform:
|
|
4
|
+
export declare function channelSendTitle(platform: ChannelSend['platform'], tI18nComplete: ReturnType<typeof useTranslations>): string;
|
|
6
5
|
/**
|
|
7
6
|
* The reply as the person in the channel saw it: a left-anchored card with the
|
|
8
7
|
* platform badge, the text as the channel shows it, and the attachment name
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { ChannelPlatform } from '../../turn/channel-message.js';
|
|
15
15
|
export interface ChannelSend {
|
|
16
|
-
|
|
16
|
+
/** A sandbox channel CLI: there is none for email. */
|
|
17
|
+
platform: Exclude<ChannelPlatform, 'Email'>;
|
|
17
18
|
/** The message text, or null for a bare file send. */
|
|
18
19
|
text: string | null;
|
|
19
20
|
/** Basename of a `--file` attachment, when one was sent. */
|
|
@@ -68,7 +68,7 @@ function CallMark({ status }) {
|
|
|
68
68
|
if (status === 'ok')
|
|
69
69
|
return _jsx(CheckIcon, { className: "text-kortix-green size-3 shrink-0" });
|
|
70
70
|
if (status === 'error')
|
|
71
|
-
return _jsx(WarningIcon, { weight: "fill", className: "text-
|
|
71
|
+
return _jsx(WarningIcon, { weight: "fill", className: "text-muted-foreground size-3 shrink-0" });
|
|
72
72
|
if (status === 'refused')
|
|
73
73
|
return _jsx(ProhibitIcon, { weight: "fill", className: "text-kortix-orange size-3 shrink-0" });
|
|
74
74
|
return _jsx(MinusIcon, { className: "text-muted-foreground size-3 shrink-0" });
|
|
@@ -122,7 +122,7 @@ export function ConnectorCallTool({ call, defaultOpen, forceOpen, locked }) {
|
|
|
122
122
|
...(parsed?.risk ? [String(parsed.risk)] : []),
|
|
123
123
|
...(outcome ? [outcome.label] : []),
|
|
124
124
|
].filter(Boolean),
|
|
125
|
-
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: _jsxs(_Fragment, { children: [_jsxs(ToolResultCard, { bodyClassName: "space-y-2.5 p-2", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs", children: [_jsx("span", { className: "text-foreground font-mono", children: ref }), _jsx(ConnectorRiskBadge, { risk: parsed?.risk }), outcome && (_jsx("span", { className: cn('ml-auto text-[10px] font-semibold uppercase', outcome.tint), children: outcome.label }))] }), Object.keys(args).length > 0 && (_jsx(FoldedSection, { label: tI18nComplete.raw('text59f03d642b41'), children: _jsx(ConnectorJson, { value: args }) })), !outputIsError && parsed ? (_jsx(ToolSection, { label: tI18nComplete.raw('text9061383b8e22'), children: parsed.reason && !ok ? (_jsx("p", { className: "text-
|
|
125
|
+
}, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked, children: _jsxs(_Fragment, { children: [_jsxs(ToolResultCard, { bodyClassName: "space-y-2.5 p-2", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs", children: [_jsx("span", { className: "text-foreground font-mono", children: ref }), _jsx(ConnectorRiskBadge, { risk: parsed?.risk }), outcome && (_jsx("span", { className: cn('ml-auto text-[10px] font-semibold uppercase', outcome.tint), children: outcome.label }))] }), Object.keys(args).length > 0 && (_jsx(FoldedSection, { label: tI18nComplete.raw('text59f03d642b41'), children: _jsx(ConnectorJson, { value: args }) })), !outputIsError && parsed ? (_jsx(ToolSection, { label: tI18nComplete.raw('text9061383b8e22'), children: parsed.reason && !ok ? (_jsx("p", { className: "text-muted-foreground font-mono text-xs", children: String(parsed.reason) })) : (_jsx(ConnectorJson, { value: 'data' in parsed ? parsed.data : parsed })) })) : output ? null : (_jsx(ToolEmptyState, { message: isStreaming
|
|
126
126
|
? tI18nComplete.raw('text46c541363b02')
|
|
127
127
|
: tI18nComplete.raw('text752edcfbfb98') }))] }), (outputIsError || (!parsed && output)) && (_jsx(ToolOutputFallback, { output: output, isStreaming: isStreaming, toolName: "call" }))] }) }));
|
|
128
128
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
-
export declare function ImageGenTool({ call
|
|
2
|
+
export declare function ImageGenTool({ call }: ToolProps): import("react").JSX.Element;
|
|
@@ -1,61 +1,248 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { SessionDotMatrix } from '../../../primitives/dot-matrix/session-dot-matrix.js';
|
|
3
4
|
import { TextShimmer } from '../../../primitives/text-shimmer.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useSharedImage } from '../../../files/runtime/hooks/use-shared-image.js';
|
|
6
|
+
import { useFilePreviewStore } from '../../../internal/stores/file-preview-store.js';
|
|
7
|
+
import { ImageFrame, ImageUnavailable } from '../../../files/renderers/image-frame.js';
|
|
8
|
+
import { Button } from '../../../primitives/button.js';
|
|
9
|
+
import { ChatGptConnectionSlot } from '../../models/chatgpt-connection-button.js';
|
|
10
|
+
import { useModelConnectionGate } from '../../models/use-model-connection-gate.js';
|
|
11
|
+
import { sessionPersonalUser } from '../../overrides/provider-pool-draft.js';
|
|
12
|
+
import { useSessionIds } from '../../../providers/session-ids.js';
|
|
13
|
+
import { useUiViewerId } from '../../../providers/ui-provider.js';
|
|
14
|
+
import { ImageGenRunsContext, InTranscriptTurnContext, isLocalSandboxFilePath, ReadOnlySessionContext, TurnLiveContext, useToolNavigation, } from '../shared/infrastructure.js';
|
|
7
15
|
import { ToolRegistry } from '../shared/registry.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const tHardcodedUi = useTranslations('hardcodedUi');
|
|
21
|
-
const input = partInput(call);
|
|
22
|
-
const output = partOutput(call);
|
|
23
|
-
const prompt = input.prompt;
|
|
24
|
-
const action = input.action;
|
|
25
|
-
const { imagePath, directUrl } = useMemo(() => parseImageOutput(output), [output]);
|
|
26
|
-
const isLocalPath = imagePath ? isLocalSandboxFilePath(imagePath) : false;
|
|
27
|
-
const fileContentPath = useMemo(() => {
|
|
28
|
-
if (!isLocalPath || !imagePath || directUrl)
|
|
29
|
-
return null;
|
|
30
|
-
return imagePath.replace(/^\/workspace\//, '');
|
|
31
|
-
}, [isLocalPath, imagePath, directUrl]);
|
|
32
|
-
const { data: fileContentData, isLoading: isQueryLoading, error: fileContentError, } = useFileContent(fileContentPath, {
|
|
33
|
-
enabled: !!fileContentPath,
|
|
34
|
-
});
|
|
35
|
-
// A readiness 503 (parked/booting sandbox) counts as loading: useFileContent
|
|
36
|
-
// keeps polling while it lasts, so the image resolves once the box is up.
|
|
37
|
-
const isImageLoading = isQueryLoading || isSandboxNotReadyError(fileContentError);
|
|
38
|
-
const [imageUrl, setImageUrl] = useState(null);
|
|
16
|
+
import { useKortixComputerStore } from '../../../internal/stores/kortix-computer-store.js';
|
|
17
|
+
import { cn } from '../../../lib/utils.js';
|
|
18
|
+
import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
19
|
+
import { formatImageGenElapsed, imageGenGrid, imageGenRetryDelay, imageGenView, sessionLogOpenCall, } from '@kortix/sdk';
|
|
20
|
+
import { useProjectSession } from '@kortix/sdk/react';
|
|
21
|
+
import { ArrowsOutSimpleIcon } from '@phosphor-icons/react';
|
|
22
|
+
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
23
|
+
/** The one busy signal over the flat frame. Elapsed time counts from the call's start, so a reload keeps it. */
|
|
24
|
+
function BusyLabel({ seed, label, startedAt }) {
|
|
25
|
+
const [mountedAt] = useState(() => Date.now());
|
|
26
|
+
const [now, setNow] = useState(() => Date.now());
|
|
27
|
+
const timed = startedAt !== undefined;
|
|
39
28
|
useEffect(() => {
|
|
40
|
-
if (!
|
|
41
|
-
setImageUrl(null);
|
|
29
|
+
if (!timed)
|
|
42
30
|
return;
|
|
31
|
+
const id = setInterval(() => setNow(Date.now()), 1000);
|
|
32
|
+
return () => clearInterval(id);
|
|
33
|
+
}, [timed]);
|
|
34
|
+
return (_jsxs("span", { className: "text-muted-foreground flex flex-wrap items-center justify-center gap-2 text-xs", children: [_jsx(SessionDotMatrix, { sessionId: seed, size: 14, className: "shrink-0" }), _jsx(TextShimmer, { duration: 1, spread: 2, className: "text-xs", children: label }), timed ? _jsx("span", { className: "tabular-nums", children: formatImageGenElapsed(now - (startedAt ?? mountedAt)) }) : null] }));
|
|
35
|
+
}
|
|
36
|
+
/** "Try again in 2 hours." in the viewer's language. */
|
|
37
|
+
function useRetryLine(seconds) {
|
|
38
|
+
const t = useTranslations('imageGen');
|
|
39
|
+
const locale = useLocale();
|
|
40
|
+
if (seconds === undefined)
|
|
41
|
+
return null;
|
|
42
|
+
const { value, unit } = imageGenRetryDelay(seconds);
|
|
43
|
+
// The Serbian catalog is Latin; Intl's `sr` is Cyrillic.
|
|
44
|
+
const when = new Intl.RelativeTimeFormat(locale === 'sr' ? 'sr-Latn' : locale, { numeric: 'always' }).format(value, unit);
|
|
45
|
+
return t('retry', { when });
|
|
46
|
+
}
|
|
47
|
+
/** Stable empty list, as `ModelConnectionBar` passes: the card needs only the routing. */
|
|
48
|
+
const NO_MODELS = [];
|
|
49
|
+
/**
|
|
50
|
+
* Opens the project's model settings on Providers: the model picker's connect
|
|
51
|
+
* action (`useModelConnectionGate`). Shown only to a viewer who can change the
|
|
52
|
+
* project's models (`project.model.write`), in a session private to them;
|
|
53
|
+
* hidden outside a project or without the host's provider modal.
|
|
54
|
+
*/
|
|
55
|
+
function ConnectModelAction() {
|
|
56
|
+
const t = useTranslations('sessionUi.modelGate');
|
|
57
|
+
const { canConnectProvider, canWriteProviders, openConnectProvider, modal } = useModelConnectionGate(NO_MODELS);
|
|
58
|
+
const { projectId, sessionId } = useSessionIds();
|
|
59
|
+
const viewerId = useUiViewerId();
|
|
60
|
+
const session = useProjectSession(projectId ?? '', sessionId ?? '', { enabled: !!projectId && !!sessionId });
|
|
61
|
+
const ownSession = !!viewerId && sessionPersonalUser(session.data) === viewerId;
|
|
62
|
+
if (!canConnectProvider || !canWriteProviders || !ownSession)
|
|
63
|
+
return null;
|
|
64
|
+
return (_jsxs(_Fragment, { children: [modal, _jsx(Button, { size: "sm", className: "mt-1 active:scale-[0.96]", onClick: () => openConnectProvider('providers'), children: t('connectModel') })] }));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The fix for a failure a connection can repair, as the session error banner
|
|
68
|
+
* routes it: the member's own ChatGPT login (`ChatGptConnectionSlot`, which
|
|
69
|
+
* applies `chatGptActionApplies`) when ChatGPT (`openai-codex`) is the provider
|
|
70
|
+
* that failed with `provider_not_connected` or `provider_reauth_required`; the
|
|
71
|
+
* project's model settings for any other provider and for
|
|
72
|
+
* `image_model_unavailable` (R37). None in a read-only view.
|
|
73
|
+
*/
|
|
74
|
+
function ConnectAction({ code, provider }) {
|
|
75
|
+
const readOnly = useContext(ReadOnlySessionContext);
|
|
76
|
+
if (readOnly)
|
|
77
|
+
return null;
|
|
78
|
+
if (provider === 'openai-codex' && code === 'provider_not_connected')
|
|
79
|
+
return _jsx(ChatGptConnectionSlot, { action: "connect", className: "mt-1" });
|
|
80
|
+
if (provider === 'openai-codex' && code === 'provider_reauth_required')
|
|
81
|
+
return _jsx(ChatGptConnectionSlot, { action: "reconnect", className: "mt-1" });
|
|
82
|
+
return _jsx(ConnectModelAction, {});
|
|
83
|
+
}
|
|
84
|
+
/** A failure in a quiet plate: the message, the suggestion, the retry wait and `action`. No error reads "Stopped". */
|
|
85
|
+
function FailureNote({ error, action, fill = false }) {
|
|
86
|
+
const t = useTranslations('imageGen');
|
|
87
|
+
const retryLine = useRetryLine(error?.retryAfterSeconds);
|
|
88
|
+
return (_jsx("div", { className: cn('bg-muted flex flex-col items-start gap-1 rounded-md px-3 py-2.5 text-xs',
|
|
89
|
+
// In a tile: the slot's box, scrolling a long message inside it.
|
|
90
|
+
fill && 'h-full overflow-y-auto'), children: error ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-foreground", children: error.message || t('failed') }), error.suggestion ? _jsx("span", { className: "text-muted-foreground", children: error.suggestion }) : null, retryLine ? _jsx("span", { className: "text-muted-foreground", children: retryLine }) : null, action] })) : (_jsx("span", { className: "text-muted-foreground", children: t('stopped') })) }));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* One image, from its generating frame to the file. `busy` is what the frame
|
|
94
|
+
* shows while it generates (the busy line, or the glyph alone in a tile); a
|
|
95
|
+
* frame whose file is still on the way says "Loading image". `fill`: a tile
|
|
96
|
+
* of the bento, which fills its slot and crops the image (`object-cover`).
|
|
97
|
+
* The frame shows no prompt and no toolbar: the whole frame opens the image
|
|
98
|
+
* full screen, uncropped, with its prompt and `model` under it.
|
|
99
|
+
*/
|
|
100
|
+
function ImageGenFrame({ image, seed, busy, model, fill, }) {
|
|
101
|
+
const t = useTranslations('imageGen');
|
|
102
|
+
const { enabled: navigationEnabled } = useToolNavigation();
|
|
103
|
+
const filePath = image.imagePath && isLocalSandboxFilePath(image.imagePath) ? image.imagePath : null;
|
|
104
|
+
// The page's shared image store: the viewer and a `show` of the same bytes draw this URL too (R38).
|
|
105
|
+
// A sandbox still starting (a waking 503, a runtime URL not pinned yet) is a
|
|
106
|
+
// wait, not a failure: the store reports it as loading and the read keeps
|
|
107
|
+
// polling, so the image lands once the box is up.
|
|
108
|
+
const { url: blobUrl, error: blobError, retry, naturalRatio, onNaturalSize } = useSharedImage(filePath, image.sha256);
|
|
109
|
+
if (image.phase === 'failed' || image.phase === 'stopped')
|
|
110
|
+
return _jsx(FailureNote, { error: image.error, fill: fill });
|
|
111
|
+
if (image.imagePath && !filePath && !image.directUrl) {
|
|
112
|
+
// A path the file API cannot read: name it, as the old card did, instead of loading forever.
|
|
113
|
+
return (_jsx("div", { className: cn('bg-muted text-muted-foreground rounded-md px-3 py-2.5 font-mono text-xs break-all', fill && 'h-full overflow-y-auto'), children: image.imagePath }));
|
|
114
|
+
}
|
|
115
|
+
const generating = image.phase === 'generating';
|
|
116
|
+
const src = generating ? null : (image.directUrl ?? blobUrl);
|
|
117
|
+
const caption = image.prompt
|
|
118
|
+
? { text: image.prompt, model, ...(image.sha256 && { sha256: image.sha256 }) }
|
|
119
|
+
: undefined;
|
|
120
|
+
const openFullScreen = filePath && navigationEnabled
|
|
121
|
+
? () => {
|
|
122
|
+
useFilePreviewStore.getState().openPreview(filePath, undefined, caption);
|
|
123
|
+
// Expand after the open, as the file actions' Full screen does: the
|
|
124
|
+
// detail's own open resets the split, and `isExpanded` outranks it.
|
|
125
|
+
useKortixComputerStore.getState().setIsExpanded(true);
|
|
43
126
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
127
|
+
: undefined;
|
|
128
|
+
return (_jsxs("div", { className: cn('group relative', fill && 'h-full'), children: [_jsx(ImageFrame, { aspectRatio: image.aspectRatio, fill: fill, maxHeight: fill ? undefined : IMAGE_MAX_HEIGHT, openLabel: image.prompt ? t('openFullScreenPrompt', { prompt: image.prompt }) : t('openFullScreen'), src: src, alt: image.prompt || t('generating'), pending: generating || (!src && !blobError), label: generating ? (busy) : blobError ? (_jsx(ImageUnavailable, { onRetry: retry })) : !src ? (_jsx(BusyLabel, { seed: seed, label: t('loading') })) : null, onOpen: openFullScreen, naturalRatio: naturalRatio, onNaturalSize: onNaturalSize }), src && openFullScreen ? (
|
|
129
|
+
// The one hint that the image opens full screen, on hover only; the whole frame is the button.
|
|
130
|
+
_jsx("span", { "data-image-gen-expand": "", "aria-hidden": "true", className: "bg-popover text-foreground pointer-events-none absolute top-1.5 right-1.5 flex size-6 items-center justify-center rounded-md opacity-0 shadow-xs transition-opacity duration-fast group-focus-within:opacity-100 group-hover:opacity-100", children: _jsx(ArrowsOutSimpleIcon, { className: "size-3.5" }) })) : null] }));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The tallest a lone image or the bento may be (R33). The box narrows to
|
|
134
|
+
* keep its ratio, so it never crops more and never letterboxes.
|
|
135
|
+
*/
|
|
136
|
+
const IMAGE_MAX_HEIGHT = '60vh';
|
|
137
|
+
/** `'3 / 2'` → `1.5`; anything unreadable → `1`. */
|
|
138
|
+
function ratioValue(ratio) {
|
|
139
|
+
const [w, h] = ratio.split('/').map((part) => Number(part.trim()));
|
|
140
|
+
return w && h ? w / h : 1;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* The bento: several images fill one rectangle, the width of the message up
|
|
144
|
+
* to `IMAGE_MAX_HEIGHT` tall, its ratio fixed from the requested one, so
|
|
145
|
+
* nothing moves when they land.
|
|
146
|
+
* Tile i keeps slot i. Every tile has the requested ratio `r`:
|
|
147
|
+
* - 2: side by side, one row → the rectangle is `2r`;
|
|
148
|
+
* - 3: tile 0 takes 2/3 of the width and both rows, tiles 1 and 2 stack on
|
|
149
|
+
* the right third → `1.5r`;
|
|
150
|
+
* - 4: 2×2 → `r`.
|
|
151
|
+
*/
|
|
152
|
+
const BENTO = {
|
|
153
|
+
// Explicit rows: each is minmax(0, 1fr), so a loaded image never stretches one.
|
|
154
|
+
2: { grid: 'grid-cols-2 grid-rows-1', scale: 2 },
|
|
155
|
+
3: { grid: 'grid-cols-3 grid-rows-2', scale: 1.5, first: 'col-span-2 row-span-2' },
|
|
156
|
+
4: { grid: 'grid-cols-2 grid-rows-2', scale: 1 },
|
|
157
|
+
};
|
|
158
|
+
/** `min(100%, …)`: the widest a rectangle of ratio `rect` may be under the height cap. */
|
|
159
|
+
const cappedWidth = (rect) => `min(100%, calc(${IMAGE_MAX_HEIGHT} * ${rect}))`;
|
|
160
|
+
/**
|
|
161
|
+
* Five or more images (R38): ONE grid of six columns whose rows are the
|
|
162
|
+
* bento patterns (`imageGenGrid().rows`: 5 = 3+2, 8 = 4+4, …). Every tile sits
|
|
163
|
+
* in the same grid, placed by line numbers, so a tile is never re-parented.
|
|
164
|
+
*
|
|
165
|
+
* The grid is as wide as its tallest row allows under the cap (`width`), and
|
|
166
|
+
* each row is exactly `width / rects[k]` tall (`rects[k]` = its tile ratio ×
|
|
167
|
+
* the pattern's scale), so no row passes `IMAGE_MAX_HEIGHT`. Track heights are
|
|
168
|
+
* lengths, read from the figure's inline size (`cqw`): the grid is the sum of
|
|
169
|
+
* its rows and the gaps between them, with no aspect ratio of its own. (Flex
|
|
170
|
+
* rows under an aspect ratio left an empty band whenever their `fr` factors
|
|
171
|
+
* summed below 1, e.g. 16:9 tiles.) A two-track row subtracts the gap between
|
|
172
|
+
* its tracks, so a large tile spanning both is the row's height.
|
|
173
|
+
*/
|
|
174
|
+
function gridPlacement(rows, rects) {
|
|
175
|
+
const width = `min(100cqw, ${IMAGE_MAX_HEIGHT} * ${Math.min(...rects)})`;
|
|
176
|
+
const tracks = [];
|
|
177
|
+
const places = [];
|
|
178
|
+
rows.forEach((count, row) => {
|
|
179
|
+
const track = tracks.length + 1;
|
|
180
|
+
const height = `${width} / ${rects[row]}`;
|
|
181
|
+
if (count === 2)
|
|
182
|
+
tracks.push(`calc(${height})`);
|
|
183
|
+
else
|
|
184
|
+
tracks.push(`calc((${height} - var(--spacing)) / 2)`, `calc((${height} - var(--spacing)) / 2)`);
|
|
185
|
+
for (let i = 0; i < count; i++) {
|
|
186
|
+
if (count === 2)
|
|
187
|
+
places.push({ gridColumn: `${1 + 3 * i} / span 3`, gridRow: `${track}` });
|
|
188
|
+
else if (count === 4)
|
|
189
|
+
places.push({ gridColumn: `${1 + 3 * (i % 2)} / span 3`, gridRow: `${track + Math.floor(i / 2)}` });
|
|
190
|
+
else if (i === 0)
|
|
191
|
+
places.push({ gridColumn: '1 / span 4', gridRow: `${track} / span 2` });
|
|
192
|
+
else
|
|
193
|
+
places.push({ gridColumn: '5 / span 2', gridRow: `${track + i - 1}` });
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
return { style: { gridTemplateRows: tracks.join(' '), width }, places };
|
|
197
|
+
}
|
|
198
|
+
export function ImageGenTool({ call }) {
|
|
199
|
+
const t = useTranslations('imageGen');
|
|
200
|
+
// In a transcript turn, the turn says whether an open call still runs.
|
|
201
|
+
const live = useContext(TurnLiveContext);
|
|
202
|
+
const inTurn = useContext(InTranscriptTurnContext);
|
|
203
|
+
// Consecutive image_gen calls of a turn draw as one grid, here, at the first (R38).
|
|
204
|
+
const run = useContext(ImageGenRunsContext).get(call.id);
|
|
205
|
+
const views = useMemo(() => (run ? run.map(sessionLogOpenCall) : [call]).map((one) => imageGenView(one, inTurn ? live : undefined)), [run, call, inTurn, live]);
|
|
206
|
+
const grid = useMemo(() => imageGenGrid(views), [views]);
|
|
207
|
+
const view = views[0];
|
|
208
|
+
const solo = views.length === 1 && view.images.length === 1;
|
|
209
|
+
// One fix per card, even when several frames failed for the same reason.
|
|
210
|
+
const repairable = views.find((one) => one.error?.connectModel)?.error ??
|
|
211
|
+
views.flatMap((one) => one.images).find((image) => image.error?.connectModel)?.error;
|
|
212
|
+
const action = repairable ? _jsx(ConnectAction, { code: repairable.code, provider: repairable.provider }) : null;
|
|
213
|
+
// The card carries no prompt and no model (R29): the frames are the content,
|
|
214
|
+
// their status (busy, loading, an error) the only text.
|
|
215
|
+
if (views.length === 1 && !view.images.length) {
|
|
216
|
+
// The whole call failed or stopped.
|
|
217
|
+
return (_jsx("div", { className: "w-full max-w-md", children: _jsx(FailureNote, { error: view.error, action: action }) }));
|
|
218
|
+
}
|
|
219
|
+
const callIds = (run ?? [call]).map((one) => one.call_id);
|
|
220
|
+
const frame = ({ image, call: at, first }) => {
|
|
221
|
+
const callView = views[at];
|
|
222
|
+
const edit = callView.action === 'edit';
|
|
223
|
+
const seed = callIds[at];
|
|
224
|
+
const several = callView.images.length > 1;
|
|
225
|
+
return (_jsx(ImageGenFrame, { image: image, seed: seed, model: callView.model, fill: !solo,
|
|
226
|
+
// Each call's first frame carries its busy line, the one status region
|
|
227
|
+
// per call; the others show its glyph alone, hidden from assistive tech.
|
|
228
|
+
busy: first ? (_jsx(BusyLabel, { seed: seed, label: several ? t(edit ? 'editingCount' : 'generatingCount', { count: callView.images.length }) : t(edit ? 'editing' : 'generating'), startedAt: callView.startedAt })) : (_jsx("span", { "aria-hidden": "true", className: "text-muted-foreground", children: _jsx(SessionDotMatrix, { sessionId: seed, size: 14 }) })) }));
|
|
229
|
+
};
|
|
230
|
+
// A tile is keyed by its call and place in it: it keeps its frame (and its
|
|
231
|
+
// loaded image) while the run grows.
|
|
232
|
+
// A call's tiles are contiguous, so its place is the distance to its first tile.
|
|
233
|
+
const tileKey = (tile, i) => `${callIds[tile.call]}:${i - grid.tiles.findIndex((other) => other.call === tile.call)}`;
|
|
234
|
+
if (solo) {
|
|
235
|
+
return (_jsxs("figure", { className: "flex w-full flex-col gap-2", children: [frame(grid.tiles[0]), action ? _jsx("div", { className: "flex flex-col items-start", children: action }) : null] }));
|
|
236
|
+
}
|
|
237
|
+
const count = grid.tiles.length;
|
|
238
|
+
const bento = grid.rows.length === 1 ? BENTO[count] : null;
|
|
239
|
+
const rowRects = grid.rows.map((size, row) => {
|
|
240
|
+
const firstTile = grid.tiles[grid.rows.slice(0, row).reduce((sum, n) => sum + n, 0)];
|
|
241
|
+
return ratioValue(views[firstTile.call].aspectRatio) * BENTO[size].scale;
|
|
242
|
+
});
|
|
243
|
+
const placed = bento ? null : gridPlacement(grid.rows, rowRects);
|
|
244
|
+
return (
|
|
245
|
+
// An inline-size container: the merged grid sizes its rows from its width (`cqw`).
|
|
246
|
+
_jsxs("figure", { className: cn('flex w-full flex-col gap-2', !bento && '@container'), children: [_jsx("div", { ...(bento ? { 'data-image-gen-bento': count } : { 'data-image-gen-grid': grid.rows.join('+') }), className: cn('grid min-h-0 w-full gap-1', bento ? bento.grid : 'grid-cols-6'), style: placed ? placed.style : { aspectRatio: rowRects[0], width: cappedWidth(rowRects[0]) }, children: grid.tiles.map((tile, i) => (_jsx("div", { "data-image-gen-tile": i, className: cn('min-h-0 min-w-0', bento && i === 0 && bento.first), style: placed?.places[i], children: frame(tile) }, tileKey(tile, i)))) }), action ? _jsx("div", { className: "flex flex-col items-start", children: action }) : null] }));
|
|
60
247
|
}
|
|
61
248
|
ToolRegistry.register('image-gen', ImageGenTool);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
2
3
|
export declare function PtyKillTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -7,6 +7,7 @@ import { stripMarkupForToolOutput } from '../../../_vendor/kortix-shared.js';
|
|
|
7
7
|
import { TerminalWindowIcon as Terminal } from '@phosphor-icons/react';
|
|
8
8
|
import { useTranslations } from '../../../i18n/index.js';
|
|
9
9
|
import { useMemo } from 'react';
|
|
10
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
10
11
|
export function PtyKillTool({ call, defaultOpen, forceOpen, locked }) {
|
|
11
12
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
12
13
|
const input = partInput(call);
|
|
@@ -12,10 +12,12 @@ import type { ToolProps } from '../shared/types.js';
|
|
|
12
12
|
* actually appears, while re-creating inline the nested-scroll wheel trap the
|
|
13
13
|
* comment further down records. Folding works on both surfaces: the tail stays
|
|
14
14
|
* visible, the history is one click away, and no second scroller is created.
|
|
15
|
+
* @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
|
|
15
16
|
*/
|
|
16
17
|
export declare function splitTerminalBuffer(content: string): {
|
|
17
18
|
earlier: string;
|
|
18
19
|
tail: string;
|
|
19
20
|
earlierCount: number;
|
|
20
21
|
};
|
|
22
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
21
23
|
export declare function PtyReadTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -32,6 +32,7 @@ const VISIBLE_TAIL_LINES = 24;
|
|
|
32
32
|
* actually appears, while re-creating inline the nested-scroll wheel trap the
|
|
33
33
|
* comment further down records. Folding works on both surfaces: the tail stays
|
|
34
34
|
* visible, the history is one click away, and no second scroller is created.
|
|
35
|
+
* @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode.
|
|
35
36
|
*/
|
|
36
37
|
export function splitTerminalBuffer(content) {
|
|
37
38
|
const lines = content ? content.split('\n') : [];
|
|
@@ -44,6 +45,7 @@ export function splitTerminalBuffer(content) {
|
|
|
44
45
|
earlierCount: cut,
|
|
45
46
|
};
|
|
46
47
|
}
|
|
48
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
47
49
|
export function PtyReadTool({ call, defaultOpen, forceOpen, locked }) {
|
|
48
50
|
const tHardcodedUi = useTranslations('hardcodedUi');
|
|
49
51
|
const input = partInput(call);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
2
3
|
export declare function PtySpawnTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -10,6 +10,7 @@ import { ptySpawnedBody } from '../../../_vendor/kortix-shared.js';
|
|
|
10
10
|
import { TerminalWindowIcon as Terminal } from '@phosphor-icons/react';
|
|
11
11
|
import { useTranslations } from '../../../i18n/index.js';
|
|
12
12
|
import { useMemo } from 'react';
|
|
13
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
13
14
|
export function PtySpawnTool({ call, defaultOpen, forceOpen, locked }) {
|
|
14
15
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
15
16
|
const input = partInput(call);
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
2
3
|
export declare function PtyWriteTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -5,6 +5,7 @@ import { ToolRegistry } from '../shared/registry.js';
|
|
|
5
5
|
import { ToolResultCard } from '../shared/result-card.js';
|
|
6
6
|
import { TerminalWindowIcon as Terminal } from '@phosphor-icons/react';
|
|
7
7
|
import { useTranslations } from '../../../i18n/index.js';
|
|
8
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
8
9
|
export function PtyWriteTool({ call, defaultOpen, forceOpen, locked }) {
|
|
9
10
|
const tHardcodedUi = useTranslations('hardcodedUi');
|
|
10
11
|
const input = partInput(call);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { parseArtifactUrl } from '../../../artifacts/frame-policy.js';
|
|
3
4
|
import { Button } from '../../../primitives/button.js';
|
|
4
5
|
import Hint from '../../../primitives/hint.js';
|
|
5
6
|
import Loading from '../../../primitives/loading.js';
|
|
6
7
|
import { SessionDotMatrix } from '../../../primitives/dot-matrix/session-dot-matrix.js';
|
|
7
8
|
import { TextShimmer } from '../../../primitives/text-shimmer.js';
|
|
8
9
|
import { isShowContentUnavailable, isShowPayloadEmpty, } from '@kortix/sdk';
|
|
9
|
-
import { BoundActivateContext, InlineServicePreview, partInput, ServicePreviewActions, ToolRunningContext, ToolSurfaceContext, useToolNavigation, } from '../shared/infrastructure.js';
|
|
10
|
+
import { BoundActivateContext, ImageGenDigestsContext, ImageGenPathsContext, InlineServicePreview, partInput, ServicePreviewActions, ToolRunningContext, ToolSurfaceContext, useToolNavigation, } from '../shared/infrastructure.js';
|
|
10
11
|
import { ToolRegistry } from '../shared/registry.js';
|
|
11
12
|
import { buildHtmlStaticUrl, isShowHtmlFile, ServicePreviewViewport, ShowCarousel, ShowCarouselTabs, ShowContentRenderer, showDomain, ShowFileActions, showFileTypeIcon, ShowHoverCard, showHoverDetails, useServicePreview, } from '../shared/show-helpers.js';
|
|
13
|
+
import { showDrawnByImageGen, showItemDigest, withoutImageGenDuplicates } from '@kortix/sdk';
|
|
12
14
|
import { useTranslations } from '../../../i18n/index.js';
|
|
13
15
|
import { cn } from '../../../lib/utils.js';
|
|
14
16
|
import { isAppRouteUrl, parseLocalhostUrl } from '@kortix/sdk';
|
|
@@ -44,18 +46,25 @@ export function ShowTool({ call, sessionId }) {
|
|
|
44
46
|
// Present only on a card served from saved history: the server's copy of
|
|
45
47
|
// `path`, so the card renders while the sandbox is off.
|
|
46
48
|
const attachment = input.attachment || '';
|
|
49
|
+
// Images an `image_gen` card of this turn already drew are not drawn twice:
|
|
50
|
+
// the same path (D5), or the same bytes at another path, by sha256 (R38).
|
|
51
|
+
const drawnByImageGen = useContext(ImageGenPathsContext);
|
|
52
|
+
const drawnDigests = useContext(ImageGenDigestsContext);
|
|
47
53
|
const items = useMemo(() => {
|
|
48
54
|
const raw = input.items;
|
|
49
55
|
if (!raw)
|
|
50
56
|
return null;
|
|
51
57
|
try {
|
|
52
58
|
const parsed = typeof raw === 'string' ? JSON.parse(raw) : raw;
|
|
53
|
-
if (Array.isArray(parsed) && parsed.length > 0)
|
|
54
|
-
|
|
59
|
+
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
60
|
+
const withDigests = parsed.map((item) => ({ ...item, sha256: item.sha256 ?? showItemDigest(call, item.path) }));
|
|
61
|
+
const rest = withoutImageGenDuplicates(withDigests, drawnByImageGen, drawnDigests);
|
|
62
|
+
return rest.length > 0 ? rest : null;
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
catch { }
|
|
57
66
|
return null;
|
|
58
|
-
}, [input.items]);
|
|
67
|
+
}, [input.items, call, drawnByImageGen, drawnDigests]);
|
|
59
68
|
const isCarousel = !!items && items.length > 0;
|
|
60
69
|
const [carouselIndex, setCarouselIndex] = useState(0);
|
|
61
70
|
// Clamped: a grouped carousel can lose an item (a call that settled empty).
|
|
@@ -107,9 +116,11 @@ export function ShowTool({ call, sessionId }) {
|
|
|
107
116
|
const activeItemLabel = currentItem
|
|
108
117
|
? currentItem.title || currentItem.path?.split('/').pop()
|
|
109
118
|
: '';
|
|
119
|
+
// A Kortix artifact's app link is the artifact, not a website: its name and a document icon.
|
|
120
|
+
const isArtifactLink = !!activeUrl && !!parseArtifactUrl(activeUrl);
|
|
110
121
|
const displayTitle = isCarousel
|
|
111
122
|
? activeItemLabel || title || `${items.length} items`
|
|
112
|
-
: title || (type === 'error' ? 'Error' : type === 'url' ? subtitleDomain || 'Link' : 'Output');
|
|
123
|
+
: title || (isArtifactLink ? 'Artifact' : type === 'error' ? 'Error' : type === 'url' ? subtitleDomain || 'Link' : 'Output');
|
|
113
124
|
const hoverTarget = {
|
|
114
125
|
path: activePath,
|
|
115
126
|
url: activeUrl,
|
|
@@ -122,7 +133,7 @@ export function ShowTool({ call, sessionId }) {
|
|
|
122
133
|
// While the card's preview loads, every port tab shows its own glyph,
|
|
123
134
|
// seeded by that tab's title or URL.
|
|
124
135
|
const portTabIcon = (item) => parseLocalhostUrl(item.url || '') ? (_jsx(SessionDotMatrix, { sessionId: item.title || item.url, size: 14, className: "shrink-0" })) : null;
|
|
125
|
-
const headerIcon = isCarousel ? currentItem?.type || 'image' : isWebsitePreview ? 'url' : type;
|
|
136
|
+
const headerIcon = isCarousel ? currentItem?.type || 'image' : isArtifactLink ? 'markdown' : isWebsitePreview ? 'url' : type;
|
|
126
137
|
// Inline card header owns the toolbar. Panel keeps the actions inside the
|
|
127
138
|
// renderer / website header as before.
|
|
128
139
|
const inlineToolbar = isWebsitePreview ? (_jsx(ServicePreviewActions, { preview: preview, compact: inlineTabs })) : (fileActions || contentActions);
|
|
@@ -143,7 +154,7 @@ export function ShowTool({ call, sessionId }) {
|
|
|
143
154
|
// arguments has an empty input because the input has not arrived yet, and its
|
|
144
155
|
// header carries the spinner that says so.
|
|
145
156
|
const hasNothingToShow = useMemo(() => isShowPayloadEmpty({ items, path, url, content }), [items, path, url, content]);
|
|
146
|
-
if (!running && hasNothingToShow)
|
|
157
|
+
if (!running && (hasNothingToShow || showDrawnByImageGen(call, drawnByImageGen, drawnDigests)))
|
|
147
158
|
return null;
|
|
148
159
|
const unavailable = isShowContentUnavailable({
|
|
149
160
|
running,
|
|
@@ -172,7 +183,7 @@ export function ShowTool({ call, sessionId }) {
|
|
|
172
183
|
body = _jsx(ShowUnavailableNote, { isWebsitePreview: true, href: null, fill: fill });
|
|
173
184
|
}
|
|
174
185
|
else {
|
|
175
|
-
body = (_jsxs("div", { className: cn('overflow-hidden', fill ? 'flex h-full flex-col' : 'min-h-0 flex-1'), children: [isWebsitePreview && fill && (_jsxs("div", { className: "border-border flex shrink-0 items-center justify-between gap-3 border-b px-4 py-1", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground size-3.5 shrink-0" }), _jsx("span", { className: "text-foreground truncate text-xs font-medium", children: preview.displayLabel })] }), _jsx(ServicePreviewActions, { preview: preview })] })), _jsx("div", { className: cn(fill && 'flex min-h-0 flex-1 flex-col'), children: isCarousel ? (_jsx(ActiveServicePreviewContext.Provider, { value: isWebsitePreview ? preview : null, children: _jsx(ShowCarousel, { items: items, LocalhostPreview: CarouselServicePreview, onIndexChange: setCarouselIndex, activeIndex: activeIndex, hideNav: inlineTabs, fill: fill, toolbarActions: fill ? fileActions : undefined }) })) : isWebsitePreview ? (_jsx(ServicePreviewViewport, { preview: preview })) : (_jsxs(_Fragment, { children: [fileUnavailable && (_jsx(ShowUnavailableNote, { isWebsitePreview: false, href: safeHttpUrl(activeUrl), fill: fill })), _jsx("div", { className: cn(fill && 'min-h-0 flex-1 overflow-hidden', fileUnavailable && 'hidden'), children: _jsx(ShowContentRenderer, { type: type, title: title, description: description, path: path, url: url, content: content, language: language, aspectRatio: aspectRatio, attachment: attachment, LocalhostPreview: InlineServicePreview, fill: fill, onStatusChange: setContentStatus, toolbarActions: fill ? fileActions : undefined }) }), description && !title && !fileUnavailable && (_jsx("div", { className: "border-border/15 shrink-0 border-t px-5 py-3", children: _jsx("p", { className: "text-muted-foreground text-xs", children: description }) }))] })) })] }));
|
|
186
|
+
body = (_jsxs("div", { className: cn('overflow-hidden', fill ? 'flex h-full flex-col' : 'min-h-0 flex-1'), children: [isWebsitePreview && fill && (_jsxs("div", { className: "border-border flex shrink-0 items-center justify-between gap-3 border-b px-4 py-1", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground size-3.5 shrink-0" }), _jsx("span", { className: "text-foreground truncate text-xs font-medium", children: preview.displayLabel })] }), _jsx(ServicePreviewActions, { preview: preview })] })), _jsx("div", { className: cn(fill && 'flex min-h-0 flex-1 flex-col'), children: isCarousel ? (_jsx(ActiveServicePreviewContext.Provider, { value: isWebsitePreview ? preview : null, children: _jsx(ShowCarousel, { items: items, LocalhostPreview: CarouselServicePreview, onIndexChange: setCarouselIndex, activeIndex: activeIndex, hideNav: inlineTabs, fill: fill, toolbarActions: fill ? fileActions : undefined }) })) : isWebsitePreview ? (_jsx(ServicePreviewViewport, { preview: preview })) : (_jsxs(_Fragment, { children: [fileUnavailable && (_jsx(ShowUnavailableNote, { isWebsitePreview: false, href: safeHttpUrl(activeUrl), fill: fill })), _jsx("div", { className: cn(fill && 'min-h-0 flex-1 overflow-hidden', fileUnavailable && 'hidden'), children: _jsx(ShowContentRenderer, { type: type, title: title, description: description, path: path, url: url, content: content, language: language, aspectRatio: aspectRatio, attachment: attachment, sha256: showItemDigest(call, path), LocalhostPreview: InlineServicePreview, fill: fill, onStatusChange: setContentStatus, toolbarActions: fill ? fileActions : undefined }) }), description && !title && !fileUnavailable && (_jsx("div", { className: "border-border/15 shrink-0 border-t px-5 py-3", children: _jsx("p", { className: "text-muted-foreground text-xs", children: description }) }))] })) })] }));
|
|
176
187
|
}
|
|
177
188
|
// Panel surface: `fillsPanel` (tool-part-renderer.tsx) special-cases show/
|
|
178
189
|
// show-user because the preview IS the payload — keep it exactly as before,
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolProps } from '../shared/types.js';
|
|
2
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
2
3
|
export declare function TodoWriteTool({ call, defaultOpen, forceOpen, locked }: ToolProps): import("react").JSX.Element;
|
|
@@ -9,6 +9,7 @@ import { cn } from '../../../lib/utils.js';
|
|
|
9
9
|
import { ListChecksIcon as ListTodo } from '@phosphor-icons/react';
|
|
10
10
|
import { useTranslations } from '../../../i18n/index.js';
|
|
11
11
|
import { useMemo } from 'react';
|
|
12
|
+
/** @deprecated Renders an OpenCode-only tool or todo list in an OpenCode session (pi has none). OpenCode is sunset (2026-10-23): no new code; delete with OpenCode. */
|
|
12
13
|
export function TodoWriteTool({ call, defaultOpen, forceOpen, locked }) {
|
|
13
14
|
const tI18nHardcoded = useTranslations('hardcodedUi');
|
|
14
15
|
const input = partInput(call);
|