@agent-native/core 0.146.8 → 0.148.0
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/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/analytics/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/analytics/DEVELOPING.md +50 -3
- package/corpus/templates/analytics/actions/purge-first-party-analytics-postgres.ts +190 -0
- package/corpus/templates/analytics/app/i18n/index.ts +14 -29
- package/corpus/templates/analytics/app/i18n-data.ts +10 -10
- package/corpus/templates/analytics/app/pages/Settings.tsx +5 -21
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +1 -3
- package/corpus/templates/analytics/app/routes/status.$slug.tsx +4 -2
- package/corpus/templates/analytics/scripts/first-party-analytics-bigquery-backfill.ts +253 -24
- package/corpus/templates/analytics/server/db/schema.ts +23 -0
- package/corpus/templates/analytics/server/handlers/first-party-analytics.ts +3 -1
- package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +1 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +113 -13
- package/corpus/templates/analytics/server/lib/first-party-analytics-purge.ts +140 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics-volume.ts +207 -0
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +40 -9
- package/corpus/templates/analytics/server/lib/gcloud.ts +148 -20
- package/corpus/templates/analytics/server/plugins/db.ts +42 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/assets/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/assets/app/i18n/index.ts +14 -29
- package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/brain/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/brain/app/i18n/index.ts +14 -29
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/calendar/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/chat/app/i18n/index.ts +14 -29
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/clips/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +2 -7
- package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +18 -13
- package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +87 -370
- package/corpus/templates/clips/app/components/settings/slack-section.tsx +59 -101
- package/corpus/templates/clips/app/components/settings/video-storage-section.tsx +136 -213
- package/corpus/templates/clips/app/i18n/en-US.ts +11 -8
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +16 -4
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +14 -5
- package/corpus/templates/clips/desktop/src/app.tsx +1 -1
- package/corpus/templates/clips/package.json +1 -0
- package/corpus/templates/clips/react-router.config.ts +7 -0
- package/corpus/templates/clips/server/plugins/auth.ts +6 -1
- package/corpus/templates/clips/shared/prerendered-public-paths.ts +21 -0
- package/corpus/templates/clips/shared/share-meta.ts +8 -3
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/content/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/content/app/i18n/index.ts +14 -29
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/crm/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/crm/app/i18n/index.ts +14 -29
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/design/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/design/actions/analyze-brand-assets.ts +15 -15
- package/corpus/templates/design/actions/import-code.ts +2 -43
- package/corpus/templates/design/app/i18n/index.ts +14 -29
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/dispatch/app/chat-first-pages.ts +747 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +182 -1
- package/corpus/templates/dispatch/app/routes/settings.tsx +62 -1
- package/corpus/templates/dispatch/changelog/2026-08-08-chat-first-navigation-keeps-conversations-central-while-open.md +6 -0
- package/corpus/templates/factory/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/factory/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/factory/AGENTS.md +40 -49
- package/corpus/templates/factory/actions/babysit-agent-native-pull-request.ts +66 -0
- package/corpus/templates/factory/actions/evaluate-triage-item.ts +37 -0
- package/corpus/templates/factory/actions/get-slack-feedback-context.ts +20 -0
- package/corpus/templates/factory/actions/get-triage-item.ts +25 -4
- package/corpus/templates/factory/actions/govern-agent-native-pull-request.ts +55 -0
- package/corpus/templates/factory/actions/ingest-github-observation.ts +21 -0
- package/corpus/templates/factory/actions/list-factory-audit.ts +118 -0
- package/corpus/templates/factory/actions/list-factory-automations.ts +2 -1
- package/corpus/templates/factory/actions/list-triage-items.ts +24 -2
- package/corpus/templates/factory/actions/poll-github-sources.ts +60 -0
- package/corpus/templates/factory/actions/poll-sentry-errors.ts +39 -0
- package/corpus/templates/factory/actions/poll-slack-channel.ts +45 -1
- package/corpus/templates/factory/actions/run-factory-automation.ts +1 -1
- package/corpus/templates/factory/actions/save-factory-automation.ts +2 -2
- package/corpus/templates/factory/actions/start-builder-for-item.ts +51 -0
- package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +685 -0
- package/corpus/templates/factory/app/hooks/use-navigation-state.ts +6 -0
- package/corpus/templates/factory/app/i18n/en-US.ts +25 -0
- package/corpus/templates/factory/app/routes/factory.tsx +203 -118
- package/corpus/templates/factory/changelog/2026-08-08-scheduler-health-moves-to-settings.md +6 -0
- package/corpus/templates/factory/server/db/schema.ts +37 -0
- package/corpus/templates/factory/server/lib/require-factory-automation.ts +5 -1
- package/corpus/templates/factory/server/plugins/factory-migrations.ts +29 -0
- package/corpus/templates/factory/server/triage/audit.ts +79 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/forms/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/forms/app/i18n/index.ts +14 -29
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/macros/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/macros/app/i18n/index.ts +14 -29
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/mail/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/mail/app/i18n/index.ts +14 -29
- package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/plan/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +7 -7
- package/corpus/templates/plan/app/i18n/index.ts +14 -29
- package/corpus/templates/plan/app/lib/plan-document-title.ts +3 -1
- package/corpus/templates/plan/app/root.tsx +1 -0
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/slides/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/slides/actions/analyze-brand-assets.ts +15 -15
- package/corpus/templates/slides/actions/import-code.ts +2 -43
- package/corpus/templates/slides/app/i18n/index.ts +14 -29
- package/corpus/templates/slides/server/routes/api/preview-images.get.ts +4 -1
- package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/corpus/templates/tasks/.agents/skills/frontend-design/SKILL.md +115 -68
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/corpus/templates/tasks/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/corpus/templates/tasks/app/components/layout/HeaderActions.tsx +1 -84
- package/corpus/templates/tasks/app/hooks/use-mobile.tsx +1 -21
- package/corpus/templates/tasks/app/i18n/index.ts +14 -29
- package/dist/agent/engine/ai-sdk-engine.js +2 -1
- package/dist/agent/engine/builder-engine.d.ts +11 -1
- package/dist/agent/engine/builder-engine.js +11 -4
- package/dist/agent/engine/openai-compatible-endpoint.d.ts +2 -0
- package/dist/agent/engine/openai-compatible-endpoint.js +5 -1
- package/dist/agent/engine/provider-endpoint-validation.d.ts +9 -0
- package/dist/agent/engine/provider-endpoint-validation.js +26 -0
- package/dist/agent/engine/provider-env-vars.d.ts +1 -1
- package/dist/agent/engine/provider-env-vars.js +1 -1
- package/dist/agent/engine/registry.d.ts +8 -6
- package/dist/agent/engine/registry.js +37 -24
- package/dist/agent/tool-search.d.ts +1 -0
- package/dist/agent/tool-search.js +17 -1
- package/dist/automations/service.js +4 -10
- package/dist/brand-kit/brand-signals.d.ts +13 -0
- package/dist/brand-kit/brand-signals.js +15 -0
- package/dist/brand-kit/index.d.ts +2 -2
- package/dist/brand-kit/index.js +1 -1
- package/dist/chat-threads/store.d.ts +2 -0
- package/dist/chat-threads/store.js +1 -1
- package/dist/cli/agent-plugin.d.ts +5 -2
- package/dist/cli/agent-plugin.js +17 -9
- package/dist/cli/code-agent-executor.js +25 -5
- package/dist/cli/code-agent-mcp-config.d.ts +21 -0
- package/dist/cli/code-agent-mcp-config.js +103 -0
- package/dist/cli/plan-blocks.d.ts +3 -18
- package/dist/cli/plan-blocks.js +2 -95
- package/dist/cli/plan-publish-store.d.ts +2 -61
- package/dist/cli/plan-publish-store.js +2 -127
- package/dist/cli/skills-content/connection.d.ts +1 -1
- package/dist/cli/skills-content/connection.js +1 -52
- package/dist/cli/skills-content/visual-recap-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-recap-skill.js +1 -553
- package/dist/client/NewWorkspaceAppFlow.js +4 -1
- package/dist/client/agent-chat/index.d.ts +4 -1
- package/dist/client/agent-chat/index.js +4 -1
- package/dist/client/agent-engine-key.d.ts +14 -4
- package/dist/client/agent-engine-key.js +51 -5
- package/dist/client/agent-page/AgentTabsPage.d.ts +1 -0
- package/dist/client/agent-page/AgentTabsPage.js +4 -3
- package/dist/client/agent-provider-catalog.d.ts +20 -0
- package/dist/client/agent-provider-catalog.js +100 -0
- package/dist/client/app-providers.d.ts +3 -1
- package/dist/client/app-providers.js +50 -5
- package/dist/client/blocks/index.d.ts +1 -0
- package/dist/client/blocks/index.js +1 -0
- package/dist/client/chat/run-recovery.js +4 -48
- package/dist/client/chat/runtime.js +63 -0
- package/dist/client/chat-first/agents-pane.d.ts +2 -0
- package/dist/client/chat-first/agents-pane.js +6 -0
- package/dist/client/chat-first/app-pane.d.ts +2 -0
- package/dist/client/chat-first/app-pane.js +6 -0
- package/dist/client/chat-first/apps-rail.d.ts +2 -0
- package/dist/client/chat-first/apps-rail.js +103 -0
- package/dist/client/chat-first/browser-pane.d.ts +2 -0
- package/dist/client/chat-first/browser-pane.js +64 -0
- package/dist/client/chat-first/chat-history.d.ts +12 -0
- package/dist/client/chat-first/chat-history.js +10 -0
- package/dist/client/chat-first/copy.d.ts +2 -0
- package/dist/client/chat-first/copy.js +117 -0
- package/dist/client/chat-first/index.d.ts +13 -0
- package/dist/client/chat-first/index.js +12 -0
- package/dist/client/chat-first/primary-nav.d.ts +8 -0
- package/dist/client/chat-first/primary-nav.js +6 -0
- package/dist/client/chat-first/session-watch-pane.d.ts +2 -0
- package/dist/client/chat-first/session-watch-pane.js +9 -0
- package/dist/client/chat-first/surface-panel.d.ts +9 -0
- package/dist/client/chat-first/surface-panel.js +9 -0
- package/dist/client/chat-first/surface-tabs.d.ts +9 -0
- package/dist/client/chat-first/surface-tabs.js +74 -0
- package/dist/client/chat-first/types.d.ts +74 -0
- package/dist/client/chat-first/types.js +1 -0
- package/dist/client/chat-first-agent-activity.d.ts +11 -0
- package/dist/client/chat-first-agent-activity.js +51 -0
- package/dist/client/chat-first-surface-panel-toggle.d.ts +5 -0
- package/dist/client/chat-first-surface-panel-toggle.js +6 -0
- package/dist/client/chat-first.d.ts +208 -0
- package/dist/client/chat-first.js +817 -0
- package/dist/client/extensions/ExtensionViewer.js +8 -1
- package/dist/client/i18n.d.ts +14 -0
- package/dist/client/i18n.js +18 -0
- package/dist/client/resources/McpIntegrationDialog.js +3 -2
- package/dist/client/resources/McpServerDetail.js +6 -11
- package/dist/client/resources/index.d.ts +1 -0
- package/dist/client/resources/index.js +1 -0
- package/dist/client/resources/use-mcp-servers.d.ts +20 -0
- package/dist/client/resources/use-mcp-servers.js +82 -46
- package/dist/client/settings/ProviderSetupForm.d.ts +21 -0
- package/dist/client/settings/ProviderSetupForm.js +145 -0
- package/dist/client/settings/SettingsPanel.js +52 -49
- package/dist/client/settings/index.d.ts +3 -0
- package/dist/client/settings/index.js +3 -0
- package/dist/coding-tools/run-code.d.ts +5 -0
- package/dist/coding-tools/run-code.js +196 -36
- package/dist/coding-tools/tool-orchestration.d.ts +10 -0
- package/dist/coding-tools/tool-orchestration.js +107 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/jobs/background-automation-runner.js +19 -2
- package/dist/jobs/frontmatter.d.ts +9 -0
- package/dist/jobs/frontmatter.js +16 -0
- package/dist/jobs/scheduler-health.d.ts +20 -0
- package/dist/jobs/scheduler-health.js +86 -1
- package/dist/jobs/scheduler.js +46 -9
- package/dist/jobs/tools.d.ts +1 -1
- package/dist/jobs/tools.js +2 -7
- package/dist/localization/default-messages.d.ts +20 -0
- package/dist/localization/default-messages.js +25 -5
- package/dist/mcp-client/routes.d.ts +3 -0
- package/dist/mcp-client/routes.js +14 -0
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/onboarding/app-profile.js +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +11 -11
- package/dist/scripts/agent-engines/test-agent-engine.js +34 -10
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/agent-chat/run-code-tools.d.ts +1 -1
- package/dist/server/agent-chat/run-code-tools.js +3 -1
- package/dist/server/agent-chat-plugin.js +6 -6
- package/dist/server/agent-engine-api-key-route.js +43 -12
- package/dist/server/agents-bundle.d.ts +2 -0
- package/dist/server/agents-bundle.js +32 -2
- package/dist/server/auth.js +21 -5
- package/dist/server/credential-provider.d.ts +8 -2
- package/dist/server/credential-provider.js +14 -9
- package/dist/server/design-token-utils.d.ts +18 -0
- package/dist/server/design-token-utils.js +31 -0
- package/dist/server/onboarding-html.js +22 -2
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/chat-first-app-creation.d.ts +19 -0
- package/dist/shared/chat-first-app-creation.js +75 -0
- package/dist/shared/document-title.d.ts +7 -0
- package/dist/shared/document-title.js +29 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +2 -0
- package/dist/styles/chat-history-list.css +16 -0
- package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +115 -68
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/chat/app/i18n/index.ts +14 -29
- package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +115 -68
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/default/app/i18n/index.ts +14 -29
- package/dist/templates/default/react-router.config.ts +18 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/dist/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +22 -9
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +115 -68
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -0
- package/dist/triggers/dispatcher.js +1 -8
- package/docs/content/environment-variables.mdx +39 -38
- package/package.json +5 -4
- package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +115 -68
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/chat/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/chat/app/i18n/index.ts +14 -29
- package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +115 -68
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/default/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/default/app/i18n/index.ts +14 -29
- package/src/templates/default/react-router.config.ts +18 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/headless/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +9 -0
- package/src/templates/workspace-core/.agents/skills/address-feedback/SKILL.md +22 -9
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +115 -68
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +18 -6
- package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +8 -1
- package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +7 -0
- package/corpus/templates/plan/app/components/plan/wireframe/sanitize-html.ts +0 -343
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, Skeleton, Tooltip, TooltipContent, TooltipTrigger, } from "@agent-native/toolkit/ui";
|
|
3
|
+
import { IconChevronDown, IconChevronUp, IconPin, IconPlus, } from "@tabler/icons-react";
|
|
4
|
+
import { useMemo, useState } from "react";
|
|
5
|
+
import { orderChatFirstAppIds, readChatFirstAppLayout, writeChatFirstAppLayout, } from "../chat-first.js";
|
|
6
|
+
import { cn } from "../utils.js";
|
|
7
|
+
import { defaultChatFirstCopy } from "./copy.js";
|
|
8
|
+
function AppRows({ apps, activeAppId, layout, onDragStart, onDrop, onDragEnd, onOpenApp, onTogglePinned, onMove, renderIcon, copy, }) {
|
|
9
|
+
const orderedIds = orderChatFirstAppIds(apps.map((app) => app.id), layout);
|
|
10
|
+
const appsById = new Map(apps.map((app) => [app.id, app]));
|
|
11
|
+
const orderedApps = orderedIds
|
|
12
|
+
.map((id) => appsById.get(id))
|
|
13
|
+
.filter((app) => Boolean(app));
|
|
14
|
+
return (_jsx("ul", { className: "space-y-px", children: orderedApps.map((app) => {
|
|
15
|
+
const active = activeAppId === app.id;
|
|
16
|
+
const pinned = layout.pinnedIds.includes(app.id);
|
|
17
|
+
const index = orderedApps.indexOf(app);
|
|
18
|
+
return (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsxs("li", { draggable: true, "data-chat-first-app": true, "data-app-id": app.id, className: cn("group flex h-6 w-full min-w-0 items-center gap-1 rounded-md px-1 text-sm transition-colors", active
|
|
19
|
+
? "bg-sidebar-accent font-medium text-sidebar-accent-foreground"
|
|
20
|
+
: "text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), onDragStart: (event) => {
|
|
21
|
+
event.dataTransfer.effectAllowed = "move";
|
|
22
|
+
onDragStart(app.id);
|
|
23
|
+
}, onDragOver: (event) => event.preventDefault(), onDrop: () => onDrop(app.id), onDragEnd: onDragEnd, children: [_jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-2 px-1 text-start", onClick: () => onOpenApp(app), onKeyDown: (event) => {
|
|
24
|
+
if (!event.altKey)
|
|
25
|
+
return;
|
|
26
|
+
if (event.key === "ArrowUp") {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
onMove(app.id, -1);
|
|
29
|
+
}
|
|
30
|
+
else if (event.key === "ArrowDown") {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
onMove(app.id, 1);
|
|
33
|
+
}
|
|
34
|
+
}, "aria-keyshortcuts": "Alt+ArrowUp Alt+ArrowDown", "aria-label": copy("openApp", { name: app.name }), title: app.name, children: [renderIcon(app), _jsx("span", { className: "truncate", children: app.name })] }), _jsx("button", { type: "button", className: cn("flex size-6 shrink-0 items-center justify-center rounded text-sidebar-foreground/45 opacity-0 transition-opacity hover:bg-sidebar-accent hover:text-sidebar-foreground group-hover:opacity-100 focus-visible:opacity-100", pinned && "text-sidebar-foreground/70 opacity-100"), "aria-label": copy(pinned ? "unpinApp" : "pinApp", {
|
|
35
|
+
name: app.name,
|
|
36
|
+
}), "aria-pressed": pinned, title: pinned ? copy("removePinned") : copy("pinTop"), onClick: () => onTogglePinned(app.id), children: _jsx(IconPin, { size: 13, strokeWidth: pinned ? 2.2 : 1.6, "aria-hidden": "true" }) }), _jsx("span", { className: "sr-only", children: `${index + 1} of ${orderedApps.length}` })] }) }), _jsxs(ContextMenuContent, { children: [_jsxs(ContextMenuItem, { onSelect: () => onTogglePinned(app.id), children: [_jsx(IconPin, { size: 14, "aria-hidden": "true" }), pinned ? copy("removePinned") : copy("pinTop")] }), _jsx(ContextMenuSeparator, {}), _jsxs(ContextMenuItem, { disabled: index === 0, onSelect: () => onMove(app.id, -1), children: [_jsx(IconChevronUp, { size: 14, "aria-hidden": "true" }), copy("moveUp")] }), _jsxs(ContextMenuItem, { disabled: index === orderedApps.length - 1, onSelect: () => onMove(app.id, 1), children: [_jsx(IconChevronDown, { size: 14, "aria-hidden": "true" }), copy("moveDown")] })] })] }, app.id));
|
|
37
|
+
}) }));
|
|
38
|
+
}
|
|
39
|
+
export function ChatFirstAppsRail({ apps, activeAppId, loading = false, error, collapsed = false, layout: controlledLayout, onLayoutChange, onLayoutError, onRetry, onOpenApp, onCreateApp, createAppTrigger, renderIcon, copy = defaultChatFirstCopy, }) {
|
|
40
|
+
const [localLayout, setLocalLayout] = useState(() => readChatFirstAppLayout());
|
|
41
|
+
const layout = controlledLayout ?? localLayout;
|
|
42
|
+
const [draggedAppId, setDraggedAppId] = useState(null);
|
|
43
|
+
const [showAllApps, setShowAllApps] = useState(false);
|
|
44
|
+
const orderedApps = useMemo(() => {
|
|
45
|
+
const orderedIds = orderChatFirstAppIds(apps.map((app) => app.id), layout);
|
|
46
|
+
const appsById = new Map(apps.map((app) => [app.id, app]));
|
|
47
|
+
return orderedIds
|
|
48
|
+
.map((id) => appsById.get(id))
|
|
49
|
+
.filter((app) => Boolean(app));
|
|
50
|
+
}, [apps, layout]);
|
|
51
|
+
const visibleApps = showAllApps ? orderedApps : orderedApps.slice(0, 5);
|
|
52
|
+
const hasMoreApps = orderedApps.length > visibleApps.length;
|
|
53
|
+
const createTrigger = createAppTrigger ??
|
|
54
|
+
(onCreateApp ? (_jsx("button", { type: "button", className: "flex size-6 items-center justify-center rounded text-sidebar-foreground/55 hover:bg-sidebar-accent hover:text-sidebar-foreground", onClick: onCreateApp, "aria-label": copy("createWorkspaceApp"), title: copy("createWorkspaceApp"), children: _jsx(IconPlus, { size: 14, "aria-hidden": "true" }) })) : null);
|
|
55
|
+
function persistLayout(next) {
|
|
56
|
+
setLocalLayout(next);
|
|
57
|
+
onLayoutChange?.(next);
|
|
58
|
+
const result = writeChatFirstAppLayout(next);
|
|
59
|
+
if (!result.ok)
|
|
60
|
+
onLayoutError?.(result.reason);
|
|
61
|
+
}
|
|
62
|
+
function togglePinned(appId) {
|
|
63
|
+
const pinnedIds = layout.pinnedIds.includes(appId)
|
|
64
|
+
? layout.pinnedIds.filter((id) => id !== appId)
|
|
65
|
+
: [appId, ...layout.pinnedIds];
|
|
66
|
+
persistLayout({ ...layout, pinnedIds });
|
|
67
|
+
}
|
|
68
|
+
function reorderApps(targetId) {
|
|
69
|
+
if (!draggedAppId || draggedAppId === targetId)
|
|
70
|
+
return;
|
|
71
|
+
const currentOrder = orderChatFirstAppIds(apps.map((app) => app.id), layout);
|
|
72
|
+
const fromIndex = currentOrder.indexOf(draggedAppId);
|
|
73
|
+
const toIndex = currentOrder.indexOf(targetId);
|
|
74
|
+
if (fromIndex < 0 || toIndex < 0)
|
|
75
|
+
return;
|
|
76
|
+
const nextOrder = [...currentOrder];
|
|
77
|
+
nextOrder.splice(fromIndex, 1);
|
|
78
|
+
nextOrder.splice(toIndex, 0, draggedAppId);
|
|
79
|
+
persistLayout({ ...layout, orderedIds: nextOrder });
|
|
80
|
+
setDraggedAppId(null);
|
|
81
|
+
}
|
|
82
|
+
function moveApp(appId, direction) {
|
|
83
|
+
const currentOrder = orderChatFirstAppIds(apps.map((app) => app.id), layout);
|
|
84
|
+
const index = currentOrder.indexOf(appId);
|
|
85
|
+
const nextIndex = index + direction;
|
|
86
|
+
if (index < 0 || nextIndex < 0 || nextIndex >= currentOrder.length)
|
|
87
|
+
return;
|
|
88
|
+
const nextOrder = [...currentOrder];
|
|
89
|
+
[nextOrder[index], nextOrder[nextIndex]] = [
|
|
90
|
+
nextOrder[nextIndex],
|
|
91
|
+
nextOrder[index],
|
|
92
|
+
];
|
|
93
|
+
persistLayout({ ...layout, orderedIds: nextOrder });
|
|
94
|
+
}
|
|
95
|
+
if (collapsed) {
|
|
96
|
+
return (_jsxs("section", { "data-chat-first-apps-rail": true, className: "flex flex-col items-center gap-1 px-1.5 pt-2", "aria-label": copy("workspaceApps"), children: [createTrigger, loading && apps.length === 0
|
|
97
|
+
? [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "size-9 rounded-md" }, index)))
|
|
98
|
+
: visibleApps.map((app) => (_jsx("button", { type: "button", "data-chat-first-app": true, "data-app-id": app.id, className: cn("flex size-9 items-center justify-center rounded-md transition-colors", activeAppId === app.id
|
|
99
|
+
? "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
100
|
+
: "text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"), onClick: () => onOpenApp(app), "aria-label": copy("openApp", { name: app.name }), title: app.name, children: renderIcon(app) }, app.id))), error ? (_jsx("span", { className: "size-1.5 rounded-full bg-destructive", title: error, "aria-label": error })) : null] }));
|
|
101
|
+
}
|
|
102
|
+
return (_jsxs("section", { "data-chat-first-apps-rail": true, className: "mt-3 px-2 pb-2 pt-2", "aria-label": copy("workspaceApps"), children: [_jsxs("div", { className: "mb-1 flex items-center gap-1.5 px-1 text-[11px] font-medium text-sidebar-foreground/50", children: [_jsx("span", { children: copy("workspaceApps") }), _jsx("span", { className: "ml-auto", children: createTrigger })] }), loading && apps.length === 0 ? (_jsx("div", { className: "space-y-0.5 px-1", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-7 w-full rounded-md" }, index))) })) : apps.length === 0 ? (_jsxs("div", { className: "px-1", children: [_jsx("p", { className: "text-xs text-sidebar-foreground/55", children: copy("noWorkspaceApps") }), createAppTrigger ? (createTrigger) : onCreateApp ? (_jsxs("button", { type: "button", className: "mt-1 inline-flex h-6 items-center gap-1.5 rounded-md border border-sidebar-border px-2 text-xs text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-foreground", onClick: onCreateApp, children: [_jsx(IconPlus, { size: 13, "aria-hidden": "true" }), copy("createApp")] })) : (createTrigger)] })) : (_jsx(AppRows, { apps: visibleApps, activeAppId: activeAppId, layout: layout, onDragStart: setDraggedAppId, onDrop: reorderApps, onDragEnd: () => setDraggedAppId(null), onOpenApp: onOpenApp, onTogglePinned: togglePinned, onMove: moveApp, renderIcon: renderIcon, copy: copy })), hasMoreApps || showAllApps ? (_jsxs("button", { type: "button", className: "mt-0.5 flex h-6 w-full items-center gap-2 rounded-md px-2 text-xs text-sidebar-foreground/50 hover:bg-sidebar-accent hover:text-sidebar-foreground", onClick: () => setShowAllApps((value) => !value), children: [showAllApps ? (_jsx(IconChevronUp, { size: 14, "aria-hidden": "true" })) : (_jsx(IconChevronDown, { size: 14, "aria-hidden": "true" })), showAllApps ? copy("showLess") : copy("showMore")] })) : null, error ? (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "mt-1 flex items-center gap-1 px-1 text-[10px] text-destructive/80", onClick: onRetry, "aria-label": error, children: [_jsx("span", { className: "size-1.5 rounded-full bg-destructive" }), onRetry ? copy("retry") : copy("appsLoadError")] }) }), _jsx(TooltipContent, { side: "right", children: error })] })) : null] }));
|
|
103
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconArrowLeft, IconArrowRight, IconExternalLink, IconRefresh, IconWorld, IconX, } from "@tabler/icons-react";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { resolveChatFirstBrowserTarget } from "../chat-first.js";
|
|
5
|
+
import { defaultChatFirstCopy } from "./copy.js";
|
|
6
|
+
export function ChatFirstBrowserPane({ url, title, status, statusMessage, onClose, renderEmbed, copy = defaultChatFirstCopy, }) {
|
|
7
|
+
const [currentUrl, setCurrentUrl] = useState(url);
|
|
8
|
+
const [draftUrl, setDraftUrl] = useState(url);
|
|
9
|
+
const [reloadKey, setReloadKey] = useState(0);
|
|
10
|
+
const [history, setHistory] = useState([url]);
|
|
11
|
+
const [historyIndex, setHistoryIndex] = useState(0);
|
|
12
|
+
const [navigationError, setNavigationError] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setCurrentUrl(url);
|
|
15
|
+
setDraftUrl(url);
|
|
16
|
+
setHistory([url]);
|
|
17
|
+
setHistoryIndex(0);
|
|
18
|
+
setNavigationError(null);
|
|
19
|
+
}, [url]);
|
|
20
|
+
function navigate(event) {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
const target = resolveChatFirstBrowserTarget({ url: draftUrl });
|
|
23
|
+
if (target.status !== "ready") {
|
|
24
|
+
setNavigationError(copy("browserInvalidUrl"));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const nextUrl = target.target.url;
|
|
28
|
+
setNavigationError(null);
|
|
29
|
+
setCurrentUrl(nextUrl);
|
|
30
|
+
setDraftUrl(nextUrl);
|
|
31
|
+
setHistory((current) => [...current.slice(0, historyIndex + 1), nextUrl]);
|
|
32
|
+
setHistoryIndex((index) => index + 1);
|
|
33
|
+
setReloadKey((key) => key + 1);
|
|
34
|
+
}
|
|
35
|
+
function goBack() {
|
|
36
|
+
if (historyIndex <= 0)
|
|
37
|
+
return;
|
|
38
|
+
const nextIndex = historyIndex - 1;
|
|
39
|
+
const nextUrl = history[nextIndex];
|
|
40
|
+
setHistoryIndex(nextIndex);
|
|
41
|
+
setCurrentUrl(nextUrl);
|
|
42
|
+
setDraftUrl(nextUrl);
|
|
43
|
+
setNavigationError(null);
|
|
44
|
+
setReloadKey((key) => key + 1);
|
|
45
|
+
}
|
|
46
|
+
function goForward() {
|
|
47
|
+
if (historyIndex >= history.length - 1)
|
|
48
|
+
return;
|
|
49
|
+
const nextIndex = historyIndex + 1;
|
|
50
|
+
const nextUrl = history[nextIndex];
|
|
51
|
+
setHistoryIndex(nextIndex);
|
|
52
|
+
setCurrentUrl(nextUrl);
|
|
53
|
+
setDraftUrl(nextUrl);
|
|
54
|
+
setNavigationError(null);
|
|
55
|
+
setReloadKey((key) => key + 1);
|
|
56
|
+
}
|
|
57
|
+
return (_jsxs("section", { "data-chat-first-browser-pane": true, className: "flex h-full min-h-0 w-full flex-col overflow-hidden bg-background", "aria-label": copy("surface.browser.label"), children: [_jsxs("header", { className: "flex h-12 shrink-0 items-center gap-1.5 border-b border-border bg-card px-2", children: [_jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [_jsx("button", { type: "button", disabled: historyIndex <= 0, onClick: goBack, "aria-label": copy("browserBack"), title: copy("browserBack"), className: "flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-35", children: _jsx(IconArrowLeft, { size: 15 }) }), _jsx("button", { type: "button", disabled: historyIndex >= history.length - 1, onClick: goForward, "aria-label": copy("browserForward"), title: copy("browserForward"), className: "flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground disabled:opacity-35", children: _jsx(IconArrowRight, { size: 15 }) }), _jsx("button", { type: "button", onClick: () => setReloadKey((key) => key + 1), "aria-label": copy("browserReload"), title: copy("browserReload"), className: "flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconRefresh, { size: 15 }) })] }), _jsxs("form", { className: "flex min-w-0 flex-1 items-center gap-1.5 rounded-md border border-input bg-background px-2", onSubmit: navigate, children: [_jsx(IconWorld, { size: 13, className: "shrink-0 text-muted-foreground", "aria-hidden": "true" }), _jsx("input", { value: draftUrl, onChange: (event) => setDraftUrl(event.target.value), "aria-label": copy("browserAddress"), spellCheck: false, className: "h-7 min-w-0 flex-1 bg-transparent text-xs text-foreground outline-none placeholder:text-muted-foreground" })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-0.5", children: [title ? (_jsx("span", { className: "hidden max-w-28 truncate px-1 text-xs text-muted-foreground xl:block", title: title, children: title })) : null, _jsx("button", { type: "button", onClick: () => window.open(currentUrl, "_blank", "noopener,noreferrer"), "aria-label": copy("browserOpenExternal"), title: copy("browserOpenExternal"), className: "flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconExternalLink, { size: 15 }) }), _jsx("button", { type: "button", onClick: onClose, "aria-label": copy("browserClose"), title: copy("browserClose"), className: "flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconX, { size: 15 }) })] })] }), navigationError ? (_jsx("p", { className: "border-b border-destructive/30 bg-destructive/10 px-3 py-1.5 text-xs text-destructive", role: "alert", children: navigationError })) : null, _jsx("div", { className: "relative min-h-0 flex-1 overflow-hidden", children: status === "starting" || status === "error" ? (_jsx("div", { className: "flex h-full items-center justify-center px-6 text-center", role: status === "error" ? "alert" : "status", "aria-live": "polite", children: _jsxs("div", { className: "max-w-xs space-y-1", children: [_jsx("p", { className: "text-sm font-medium text-foreground", children: status === "starting"
|
|
58
|
+
? copy("browserPreviewStarting")
|
|
59
|
+
: copy("browserPreviewError") }), statusMessage ? (_jsx("p", { className: "text-xs text-muted-foreground", children: statusMessage })) : null] }) })) : (renderEmbed({
|
|
60
|
+
url: currentUrl,
|
|
61
|
+
title: title || copy("browserPage"),
|
|
62
|
+
key: `${currentUrl}:${reloadKey}`,
|
|
63
|
+
})) })] }));
|
|
64
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ChatHistoryItem, type ChatHistoryListProps } from "../chat/ChatHistoryList.js";
|
|
3
|
+
export interface ChatFirstChatHistoryProps extends Omit<ChatHistoryListProps, "items" | "sections" | "variant"> {
|
|
4
|
+
items: ChatHistoryItem[];
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The single chat-list presentation used by the chat-first rail on every
|
|
9
|
+
* host. Hosts still own thread fetching and actions, but row rhythm and the
|
|
10
|
+
* Chats section treatment stay identical.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ChatFirstChatHistory({ items, label, className, ...props }: ChatFirstChatHistoryProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChatHistoryList, } from "../chat/ChatHistoryList.js";
|
|
3
|
+
/**
|
|
4
|
+
* The single chat-list presentation used by the chat-first rail on every
|
|
5
|
+
* host. Hosts still own thread fetching and actions, but row rhythm and the
|
|
6
|
+
* Chats section treatment stay identical.
|
|
7
|
+
*/
|
|
8
|
+
export function ChatFirstChatHistory({ items, label = "Chats", className, ...props }) {
|
|
9
|
+
return (_jsxs("section", { "data-chat-first-chat-history": true, className: ["min-h-0 min-w-0", className].filter(Boolean).join(" "), children: [_jsx("p", { className: "mb-1 px-2 text-[11px] font-medium text-sidebar-foreground/50", children: label }), _jsx(ChatHistoryList, { ...props, items: items, variant: "rail", className: "min-w-0" })] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
const DEFAULT_COPY = {
|
|
2
|
+
newChat: "New chat",
|
|
3
|
+
search: "Search",
|
|
4
|
+
workspaceApps: "Apps",
|
|
5
|
+
integrations: "Integrations",
|
|
6
|
+
scheduled: "Scheduled",
|
|
7
|
+
createWorkspaceApp: "Create app",
|
|
8
|
+
openApp: "Open {name}",
|
|
9
|
+
appsLoadError: "Apps could not be loaded",
|
|
10
|
+
noWorkspaceApps: "No apps yet",
|
|
11
|
+
createApp: "Create app",
|
|
12
|
+
retry: "Retry",
|
|
13
|
+
dismiss: "Dismiss",
|
|
14
|
+
unpinApp: "Unpin {name}",
|
|
15
|
+
pinApp: "Pin {name}",
|
|
16
|
+
removePinned: "Remove from pinned apps",
|
|
17
|
+
pinTop: "Pin app to the top",
|
|
18
|
+
moveUp: "Move up",
|
|
19
|
+
moveDown: "Move down",
|
|
20
|
+
showMore: "Show more",
|
|
21
|
+
showLess: "Show less",
|
|
22
|
+
appOrderUnavailable: "App order could not be saved on this device.",
|
|
23
|
+
openSideSurfaces: "Open side surfaces",
|
|
24
|
+
sideSurfaces: "Side surfaces",
|
|
25
|
+
resizeSideSurface: "Resize side surface",
|
|
26
|
+
closeTab: "Close {name}",
|
|
27
|
+
close: "Close",
|
|
28
|
+
closeOthers: "Close others",
|
|
29
|
+
closeToRight: "Close to the right",
|
|
30
|
+
closeAll: "Close all",
|
|
31
|
+
deferred: "Deferred",
|
|
32
|
+
openActivity: "Open activity",
|
|
33
|
+
unavailable: "This surface is not available here.",
|
|
34
|
+
browserBack: "Back",
|
|
35
|
+
browserForward: "Forward",
|
|
36
|
+
browserReload: "Reload page",
|
|
37
|
+
browserAddress: "Browser address",
|
|
38
|
+
browserOpenExternal: "Open in external browser",
|
|
39
|
+
browserClose: "Close browser",
|
|
40
|
+
browserPage: "Browser page",
|
|
41
|
+
browserInvalidUrl: "Enter a full http(s) URL to navigate.",
|
|
42
|
+
browserPreviewStarting: "Starting preview…",
|
|
43
|
+
browserPreviewError: "Preview unavailable",
|
|
44
|
+
appUnavailable: "This workspace app is no longer available.",
|
|
45
|
+
appLoading: "Loading app",
|
|
46
|
+
agentActivityEyebrow: "Workspace",
|
|
47
|
+
agentActivityTitle: "Agent activity",
|
|
48
|
+
agentActivityDescription: "Follow runs and open a second session beside this chat.",
|
|
49
|
+
refreshAgentActivity: "Refresh agent activity",
|
|
50
|
+
noAgentSessions: "No agent sessions yet",
|
|
51
|
+
startAgentSession: "Start an agent run and it will appear here.",
|
|
52
|
+
watchSession: "Watch",
|
|
53
|
+
copySessionId: "Copy session ID",
|
|
54
|
+
copySessionIdFor: "Copy session ID for {name}",
|
|
55
|
+
sessionIdCopied: "Session ID copied",
|
|
56
|
+
sessionIdShort: "ID",
|
|
57
|
+
copied: "Copied",
|
|
58
|
+
agentActivityStatusQueued: "Queued",
|
|
59
|
+
agentActivityStatusRunning: "Running",
|
|
60
|
+
agentActivityStatusPaused: "Paused",
|
|
61
|
+
agentActivityStatusNeedsApproval: "Needs approval",
|
|
62
|
+
agentActivityStatusCompleted: "Completed",
|
|
63
|
+
agentActivityStatusErrored: "Needs attention",
|
|
64
|
+
agentActivityStatusRecent: "Recent",
|
|
65
|
+
agentActivityStatusUnknown: "Unknown",
|
|
66
|
+
watchingSession: "Watching {name}",
|
|
67
|
+
session: "session",
|
|
68
|
+
stopWatchingSession: "Stop watching session",
|
|
69
|
+
stopWatching: "Stop watching",
|
|
70
|
+
watchedSession: "Watched session",
|
|
71
|
+
agentsTitle: "Subagents",
|
|
72
|
+
};
|
|
73
|
+
const SURFACE_COPY = {
|
|
74
|
+
app: {
|
|
75
|
+
label: "App",
|
|
76
|
+
reason: "Open a workspace app beside the conversation.",
|
|
77
|
+
},
|
|
78
|
+
browser: {
|
|
79
|
+
label: "Browser",
|
|
80
|
+
reason: "Ask the agent to open a web URL.",
|
|
81
|
+
},
|
|
82
|
+
terminal: {
|
|
83
|
+
label: "Terminal",
|
|
84
|
+
reason: "Deferred: an embedded PTY lifecycle is not connected in this release.",
|
|
85
|
+
},
|
|
86
|
+
files: {
|
|
87
|
+
label: "Files",
|
|
88
|
+
reason: "Deferred: a bounded workspace tree is not connected in this release.",
|
|
89
|
+
},
|
|
90
|
+
diff: {
|
|
91
|
+
label: "Diff",
|
|
92
|
+
reason: "Deferred: changed-file data is not connected in this release.",
|
|
93
|
+
},
|
|
94
|
+
"side-chat": {
|
|
95
|
+
label: "Side chat",
|
|
96
|
+
reason: "Choose Watch and message from any chat row.",
|
|
97
|
+
},
|
|
98
|
+
agents: {
|
|
99
|
+
label: "Agents",
|
|
100
|
+
reason: "Review recent runs or watch one beside this conversation.",
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
function interpolate(value, values) {
|
|
104
|
+
if (!values)
|
|
105
|
+
return value;
|
|
106
|
+
return value.replace(/\{(\w+)\}/g, (_, key) => values[key] ?? "");
|
|
107
|
+
}
|
|
108
|
+
export const defaultChatFirstCopy = (key, values) => {
|
|
109
|
+
if (key.startsWith("surface.")) {
|
|
110
|
+
const [, kind, field] = key.split(".");
|
|
111
|
+
const surface = SURFACE_COPY[kind];
|
|
112
|
+
if (surface && (field === "label" || field === "reason")) {
|
|
113
|
+
return surface[field];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return interpolate(DEFAULT_COPY[key] ?? key, values);
|
|
117
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { ChatFirstAgentsPane } from "./agents-pane.js";
|
|
2
|
+
export { ChatFirstAppPane } from "./app-pane.js";
|
|
3
|
+
export { ChatFirstAppsRail } from "./apps-rail.js";
|
|
4
|
+
export { ChatFirstBrowserPane } from "./browser-pane.js";
|
|
5
|
+
export { defaultChatFirstCopy } from "./copy.js";
|
|
6
|
+
export { ChatFirstChatHistory, type ChatFirstChatHistoryProps, } from "./chat-history.js";
|
|
7
|
+
export { ChatFirstSessionWatchPane } from "./session-watch-pane.js";
|
|
8
|
+
export { ChatFirstSurfacePanel, type ChatFirstSurfacePanelProps, } from "./surface-panel.js";
|
|
9
|
+
export { ChatFirstPrimaryNavigation } from "./primary-nav.js";
|
|
10
|
+
export { emitChatFirstOpenApp, resolveChatFirstAppTarget, CHAT_FIRST_DEFAULT_APP_IDS, type ChatFirstOpenAppDetail, } from "../chat-first.js";
|
|
11
|
+
export { buildChatFirstAppCreationPrompt, titleFromChatFirstAppPrompt, type ChatFirstAppCreationPromptInput, type ChatFirstAppCreationResource, type ChatFirstAppCreationVaultAccessMode, } from "../../shared/chat-first-app-creation.js";
|
|
12
|
+
export { ChatFirstSurfaceContent, ChatFirstSurfaceTabs, } from "./surface-tabs.js";
|
|
13
|
+
export type { ChatFirstAgentActivity, ChatFirstAgentsPaneProps, ChatFirstAppItem, ChatFirstAppPaneProps, ChatFirstAppRailProps, ChatFirstBrowserPaneProps, ChatFirstCopy, ChatFirstEmbedTarget, ChatFirstSessionWatchPaneProps, ChatFirstSurfaceTabsProps, } from "./types.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ChatFirstAgentsPane } from "./agents-pane.js";
|
|
2
|
+
export { ChatFirstAppPane } from "./app-pane.js";
|
|
3
|
+
export { ChatFirstAppsRail } from "./apps-rail.js";
|
|
4
|
+
export { ChatFirstBrowserPane } from "./browser-pane.js";
|
|
5
|
+
export { defaultChatFirstCopy } from "./copy.js";
|
|
6
|
+
export { ChatFirstChatHistory, } from "./chat-history.js";
|
|
7
|
+
export { ChatFirstSessionWatchPane } from "./session-watch-pane.js";
|
|
8
|
+
export { ChatFirstSurfacePanel, } from "./surface-panel.js";
|
|
9
|
+
export { ChatFirstPrimaryNavigation } from "./primary-nav.js";
|
|
10
|
+
export { emitChatFirstOpenApp, resolveChatFirstAppTarget, CHAT_FIRST_DEFAULT_APP_IDS, } from "../chat-first.js";
|
|
11
|
+
export { buildChatFirstAppCreationPrompt, titleFromChatFirstAppPrompt, } from "../../shared/chat-first-app-creation.js";
|
|
12
|
+
export { ChatFirstSurfaceContent, ChatFirstSurfaceTabs, } from "./surface-tabs.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ChatFirstCopy } from "./types.js";
|
|
2
|
+
export declare function ChatFirstPrimaryNavigation({ onNewChat, onOpenIntegrations, onOpenScheduled, onSearch, copy, }: {
|
|
3
|
+
onNewChat?: () => void;
|
|
4
|
+
onOpenIntegrations: () => void;
|
|
5
|
+
onOpenScheduled: () => void;
|
|
6
|
+
onSearch?: () => void;
|
|
7
|
+
copy?: ChatFirstCopy;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconClock, IconPlus, IconPlugConnected, IconSearch, } from "@tabler/icons-react";
|
|
3
|
+
import { defaultChatFirstCopy } from "./copy.js";
|
|
4
|
+
export function ChatFirstPrimaryNavigation({ onNewChat, onOpenIntegrations, onOpenScheduled, onSearch, copy = defaultChatFirstCopy, }) {
|
|
5
|
+
return (_jsxs(_Fragment, { children: [onNewChat ? (_jsxs("button", { type: "button", className: "flex h-8 w-full items-center gap-2 rounded-md px-2 text-[13px] font-medium text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", onClick: onNewChat, children: [_jsx(IconPlus, { size: 15, className: "shrink-0", "aria-hidden": "true" }), _jsx("span", { children: copy("newChat") })] })) : null, _jsxs("button", { type: "button", className: "flex h-8 w-full items-center gap-2 rounded-md px-2 text-[13px] font-medium text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", onClick: onOpenIntegrations, children: [_jsx(IconPlugConnected, { size: 15, className: "shrink-0", "aria-hidden": "true" }), _jsx("span", { children: copy("integrations") })] }), _jsxs("button", { type: "button", className: "flex h-8 w-full items-center gap-2 rounded-md px-2 text-[13px] font-medium text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", onClick: onOpenScheduled, children: [_jsx(IconClock, { size: 15, className: "shrink-0", "aria-hidden": "true" }), _jsx("span", { children: copy("scheduled") })] }), onSearch ? (_jsxs("button", { type: "button", className: "flex h-8 w-full items-center gap-2 rounded-md px-2 text-[13px] font-medium text-sidebar-foreground/80 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", onClick: onSearch, children: [_jsx(IconSearch, { size: 15, className: "shrink-0", "aria-hidden": "true" }), _jsx("span", { children: copy("search") })] })) : null] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconEye, IconX } from "@tabler/icons-react";
|
|
3
|
+
import { defaultChatFirstCopy } from "./copy.js";
|
|
4
|
+
export function ChatFirstSessionWatchPane({ target, onClose, renderChat, copy = defaultChatFirstCopy, }) {
|
|
5
|
+
if (!target)
|
|
6
|
+
return null;
|
|
7
|
+
const sessionName = target.title || copy("session");
|
|
8
|
+
return (_jsxs("section", { "data-chat-first-watch-pane": true, className: "flex h-full min-h-0 w-full flex-col overflow-hidden bg-background", "aria-label": copy("watchedSession"), children: [_jsxs("header", { className: "flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3", children: [_jsx(IconEye, { size: 16, className: "shrink-0 text-primary", "aria-hidden": "true" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("p", { className: "truncate text-xs font-semibold text-foreground", children: copy("watchingSession", { name: sessionName }) }), _jsx("p", { className: "truncate font-mono text-[10px] text-muted-foreground", children: target.sessionId })] }), _jsx("button", { type: "button", className: "flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground", "aria-label": copy("stopWatchingSession"), title: copy("stopWatching"), onClick: onClose, children: _jsx(IconX, { size: 16, "aria-hidden": "true" }) })] }), _jsx("div", { className: "min-h-0 flex-1", children: renderChat(target) })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PointerEvent, ReactNode } from "react";
|
|
2
|
+
import type { ChatFirstCopy } from "./types.js";
|
|
3
|
+
export interface ChatFirstSurfacePanelProps {
|
|
4
|
+
width: number;
|
|
5
|
+
onResizePointerDown: (event: PointerEvent<HTMLDivElement>) => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
copy?: ChatFirstCopy;
|
|
8
|
+
}
|
|
9
|
+
export declare function ChatFirstSurfacePanel({ width, onResizePointerDown, children, copy, }: ChatFirstSurfacePanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clampChatFirstSurfaceWidth } from "../chat-first.js";
|
|
3
|
+
import { defaultChatFirstCopy } from "./copy.js";
|
|
4
|
+
export function ChatFirstSurfacePanel({ width, onResizePointerDown, children, copy = defaultChatFirstCopy, }) {
|
|
5
|
+
const panelWidth = clampChatFirstSurfaceWidth(width);
|
|
6
|
+
return (_jsxs("aside", { "data-chat-first-surface-panel": true, "aria-label": copy("sideSurfaces"), className: "chat-first-surface-panel relative flex h-full w-[var(--chat-first-surface-width)] min-w-0 shrink-0 flex-col overflow-hidden border-s border-border bg-background max-[767px]:absolute max-[767px]:inset-0 max-[767px]:z-10 max-[767px]:w-full max-[767px]:min-w-0", style: {
|
|
7
|
+
"--chat-first-surface-width": `${panelWidth}px`,
|
|
8
|
+
}, children: [_jsx("div", { className: "chat-first-surface-resize-handle absolute inset-y-0 -start-1 z-[3] w-2 cursor-col-resize hover:bg-ring/35 max-[767px]:hidden", role: "separator", "aria-label": copy("resizeSideSurface"), "aria-orientation": "vertical", onPointerDown: onResizePointerDown }), children] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type ChatFirstSurfaceTab } from "../chat-first.js";
|
|
3
|
+
import type { ChatFirstSurfaceTabsProps } from "./types.js";
|
|
4
|
+
export declare function ChatFirstSurfaceTabs({ tabs, activeTabId, onActivate, onClose, onCloseOthers, onCloseToRight, onCloseAll, onOpenSurface, copy, }: ChatFirstSurfaceTabsProps): import("react").JSX.Element;
|
|
5
|
+
export declare function ChatFirstSurfaceContent({ tabs, activeTabId, renderTab, }: {
|
|
6
|
+
tabs: readonly ChatFirstSurfaceTab[];
|
|
7
|
+
activeTabId: string | null;
|
|
8
|
+
renderTab: (tab: ChatFirstSurfaceTab) => ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@agent-native/toolkit/ui";
|
|
3
|
+
import { IconFiles, IconGitCompare, IconMessageCircle, IconTerminal2, IconUsersGroup, IconWorld, IconX, } from "@tabler/icons-react";
|
|
4
|
+
import { CHAT_FIRST_SURFACE_CATALOG, } from "../chat-first.js";
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
import { defaultChatFirstCopy } from "./copy.js";
|
|
7
|
+
const ICONS = {
|
|
8
|
+
app: IconFiles,
|
|
9
|
+
browser: IconWorld,
|
|
10
|
+
terminal: IconTerminal2,
|
|
11
|
+
diff: IconGitCompare,
|
|
12
|
+
files: IconFiles,
|
|
13
|
+
"side-chat": IconMessageCircle,
|
|
14
|
+
agents: IconUsersGroup,
|
|
15
|
+
};
|
|
16
|
+
function SurfaceIcon({ kind }) {
|
|
17
|
+
const Icon = ICONS[kind];
|
|
18
|
+
return _jsx(Icon, { size: 14, "aria-hidden": "true" });
|
|
19
|
+
}
|
|
20
|
+
export function ChatFirstSurfaceTabs({ tabs, activeTabId, onActivate, onClose, onCloseOthers, onCloseToRight, onCloseAll, onOpenSurface, copy = defaultChatFirstCopy, }) {
|
|
21
|
+
return (_jsx(TooltipProvider, { delayDuration: 400, children: _jsx("div", { "data-chat-first-surface-tabs": true, className: "shrink-0 border-b border-border bg-card", children: tabs.length > 0 ? (_jsx("div", { className: "flex min-w-0 items-center gap-1 overflow-x-auto px-2 py-1.5", role: "tablist", "aria-label": copy("openSideSurfaces"), children: tabs.map((tab, index) => (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { asChild: true, children: _jsxs("div", { role: "tab", tabIndex: activeTabId === tab.id ? 0 : -1, "aria-selected": activeTabId === tab.id, "data-surface-tab-id": tab.id, "data-active": activeTabId === tab.id ? "true" : "false", className: cn("group flex h-8 min-w-0 max-w-48 shrink-0 items-center rounded-md text-xs transition-colors", activeTabId === tab.id
|
|
22
|
+
? "bg-accent text-foreground"
|
|
23
|
+
: "text-muted-foreground hover:bg-accent hover:text-foreground"), onKeyDown: (event) => {
|
|
24
|
+
const nextIndex = event.key === "ArrowRight"
|
|
25
|
+
? (index + 1) % tabs.length
|
|
26
|
+
: event.key === "ArrowLeft"
|
|
27
|
+
? (index - 1 + tabs.length) % tabs.length
|
|
28
|
+
: event.key === "Home"
|
|
29
|
+
? 0
|
|
30
|
+
: event.key === "End"
|
|
31
|
+
? tabs.length - 1
|
|
32
|
+
: -1;
|
|
33
|
+
if (nextIndex < 0)
|
|
34
|
+
return;
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
onActivate(tabs[nextIndex]);
|
|
37
|
+
requestAnimationFrame(() => {
|
|
38
|
+
document
|
|
39
|
+
.querySelector(`[data-chat-first-surface-tab-id="${CSS.escape(tabs[nextIndex].id)}"]`)
|
|
40
|
+
?.focus();
|
|
41
|
+
});
|
|
42
|
+
}, "data-chat-first-surface-tab-id": tab.id, onMouseDown: (event) => {
|
|
43
|
+
if (event.button === 1) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
onClose(tab);
|
|
46
|
+
}
|
|
47
|
+
}, title: tab.title, children: [_jsxs("button", { type: "button", className: "flex min-w-0 flex-1 items-center gap-1.5 truncate px-2 text-start", onClick: () => onActivate(tab), tabIndex: -1, children: [_jsx(SurfaceIcon, { kind: tab.kind }), _jsx("span", { className: "truncate", children: tab.title })] }), _jsx("button", { type: "button", className: "mr-1 flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground/65 opacity-0 transition-opacity hover:bg-background/70 hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100", "aria-label": copy("closeTab", { name: tab.title }), title: copy("closeTab", { name: tab.title }), onClick: (event) => {
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
onClose(tab);
|
|
50
|
+
}, children: _jsx(IconX, { size: 12, "aria-hidden": "true" }) })] }) }), _jsxs(ContextMenuContent, { children: [_jsx(ContextMenuItem, { onSelect: () => onClose(tab), children: copy("close") }), _jsx(ContextMenuItem, { disabled: tabs.length < 2, onSelect: () => onCloseOthers(tab), children: copy("closeOthers") }), _jsx(ContextMenuItem, { disabled: tabs[tabs.length - 1]?.id === tab.id, onSelect: () => onCloseToRight(tab), children: copy("closeToRight") }), _jsx(ContextMenuSeparator, {}), _jsx(ContextMenuItem, { onSelect: onCloseAll, children: copy("closeAll") })] })] }, tab.id))) })) : (_jsx("div", { className: "flex flex-col px-2 py-1", "data-surface-empty-state": true, "aria-label": copy("openSideSurfaces"), children: CHAT_FIRST_SURFACE_CATALOG.map((surface) => {
|
|
51
|
+
const label = copy(`surface.${surface.kind}.label`);
|
|
52
|
+
const reason = surface.availability === "deferred"
|
|
53
|
+
? copy(`surface.${surface.kind}.reason`)
|
|
54
|
+
: copy(`surface.${surface.kind}.reason`);
|
|
55
|
+
const isDeferred = surface.availability === "deferred";
|
|
56
|
+
const row = (_jsxs("div", { className: cn("flex h-7 min-w-0 items-center gap-2 rounded px-2 text-xs transition-colors", surface.kind === "agents" && onOpenSurface
|
|
57
|
+
? "text-foreground hover:bg-accent"
|
|
58
|
+
: isDeferred
|
|
59
|
+
? "text-muted-foreground/60"
|
|
60
|
+
: "text-muted-foreground hover:bg-accent hover:text-foreground"), title: !isDeferred ? reason : undefined, "aria-label": `${label}: ${reason}`, children: [_jsx(SurfaceIcon, { kind: surface.kind }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), isDeferred ? (_jsx("span", { "data-surface-availability": "deferred", className: "size-1.5 shrink-0 rounded-full bg-muted-foreground/45", "aria-label": copy("deferred") })) : null] }));
|
|
61
|
+
if (surface.kind === "agents" && onOpenSurface) {
|
|
62
|
+
return (_jsx("button", { type: "button", className: "text-start", title: copy("openActivity"), "aria-label": copy("openActivity"), onClick: () => onOpenSurface(surface.kind), children: row }, surface.kind));
|
|
63
|
+
}
|
|
64
|
+
if (!isDeferred)
|
|
65
|
+
return _jsx("div", { children: row }, surface.kind);
|
|
66
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("div", { className: "text-start", children: row }) }), _jsx(TooltipContent, { side: "left", className: "max-w-72", children: reason })] }, surface.kind));
|
|
67
|
+
}) })) }) }));
|
|
68
|
+
}
|
|
69
|
+
export function ChatFirstSurfaceContent({ tabs, activeTabId, renderTab, }) {
|
|
70
|
+
return (_jsx("div", { className: "min-h-0 flex-1 overflow-hidden", children: tabs.map((tab) => {
|
|
71
|
+
const active = tab.id === activeTabId;
|
|
72
|
+
return (_jsx("div", { "data-chat-first-surface-content": tab.id, "aria-hidden": !active, className: cn("h-full min-h-0", !active && "hidden"), children: renderTab(tab) }, tab.id));
|
|
73
|
+
}) }));
|
|
74
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ChatFirstAgentActivity, ChatFirstAppLayoutPreference, ChatFirstSessionReference, ChatFirstSurfaceKind, ChatFirstSurfaceTab } from "../chat-first.js";
|
|
3
|
+
export type { ChatFirstAgentActivity, ChatFirstSurfaceTab };
|
|
4
|
+
export interface ChatFirstAppItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
export type ChatFirstCopy = (key: string, values?: Record<string, string>) => string;
|
|
11
|
+
export interface ChatFirstEmbedTarget {
|
|
12
|
+
url: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
key?: string | number;
|
|
15
|
+
}
|
|
16
|
+
export interface ChatFirstAppPaneProps {
|
|
17
|
+
app: ChatFirstAppItem | null;
|
|
18
|
+
status: "loading" | "ready" | "unresolved" | "error";
|
|
19
|
+
embedUrl?: string | null;
|
|
20
|
+
errorMessage?: string | null;
|
|
21
|
+
onRetry?: () => void;
|
|
22
|
+
renderEmbed: (target: ChatFirstEmbedTarget) => ReactNode;
|
|
23
|
+
copy?: ChatFirstCopy;
|
|
24
|
+
}
|
|
25
|
+
export interface ChatFirstSurfaceTabsProps {
|
|
26
|
+
tabs: ChatFirstSurfaceTab[];
|
|
27
|
+
activeTabId: string | null;
|
|
28
|
+
onActivate: (tab: ChatFirstSurfaceTab) => void;
|
|
29
|
+
onClose: (tab: ChatFirstSurfaceTab) => void;
|
|
30
|
+
onCloseOthers: (tab: ChatFirstSurfaceTab) => void;
|
|
31
|
+
onCloseToRight: (tab: ChatFirstSurfaceTab) => void;
|
|
32
|
+
onCloseAll: () => void;
|
|
33
|
+
onOpenSurface?: (kind: ChatFirstSurfaceKind) => void;
|
|
34
|
+
copy?: ChatFirstCopy;
|
|
35
|
+
}
|
|
36
|
+
export interface ChatFirstAppRailProps {
|
|
37
|
+
apps: readonly ChatFirstAppItem[];
|
|
38
|
+
activeAppId?: string;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
error?: string | null;
|
|
41
|
+
collapsed?: boolean;
|
|
42
|
+
layout?: ChatFirstAppLayoutPreference;
|
|
43
|
+
onLayoutChange?: (layout: ChatFirstAppLayoutPreference) => void;
|
|
44
|
+
onLayoutError?: (reason: "unavailable" | "write-failed") => void;
|
|
45
|
+
onRetry?: () => void;
|
|
46
|
+
onOpenApp: (app: ChatFirstAppItem) => void;
|
|
47
|
+
onCreateApp?: () => void;
|
|
48
|
+
createAppTrigger?: ReactNode;
|
|
49
|
+
renderIcon: (app: ChatFirstAppItem) => ReactNode;
|
|
50
|
+
copy?: ChatFirstCopy;
|
|
51
|
+
}
|
|
52
|
+
export interface ChatFirstBrowserPaneProps {
|
|
53
|
+
url: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
status?: "starting" | "ready" | "error";
|
|
56
|
+
statusMessage?: string;
|
|
57
|
+
onClose: () => void;
|
|
58
|
+
renderEmbed: (target: ChatFirstEmbedTarget) => ReactNode;
|
|
59
|
+
copy?: ChatFirstCopy;
|
|
60
|
+
}
|
|
61
|
+
export interface ChatFirstSessionWatchPaneProps {
|
|
62
|
+
target: ChatFirstSessionReference | null;
|
|
63
|
+
onClose: () => void;
|
|
64
|
+
renderChat: (target: ChatFirstSessionReference) => ReactNode;
|
|
65
|
+
copy?: ChatFirstCopy;
|
|
66
|
+
}
|
|
67
|
+
export interface ChatFirstAgentsPaneProps {
|
|
68
|
+
activities: readonly ChatFirstAgentActivity[];
|
|
69
|
+
loading?: boolean;
|
|
70
|
+
error?: string | null;
|
|
71
|
+
onRefresh?: () => void;
|
|
72
|
+
onWatch: (activity: ChatFirstAgentActivity) => void;
|
|
73
|
+
copy?: ChatFirstCopy;
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChatFirstAgentActivity } from "./chat-first.js";
|
|
2
|
+
import type { ChatFirstCopy } from "./chat-first/types.js";
|
|
3
|
+
export interface ChatFirstAgentActivityPanelProps {
|
|
4
|
+
activities: readonly ChatFirstAgentActivity[];
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
error?: string | null;
|
|
7
|
+
onRefresh?: () => void;
|
|
8
|
+
onWatch?: (activity: ChatFirstAgentActivity) => void;
|
|
9
|
+
copy?: ChatFirstCopy;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChatFirstAgentActivityPanel({ activities, loading, error, onRefresh, onWatch, copy, }: ChatFirstAgentActivityPanelProps): import("react").JSX.Element;
|