@agent-native/core 0.132.2 → 0.133.1
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 +2 -2
- package/corpus/core/CHANGELOG.md +181 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/correlation.ts +11 -1
- package/corpus/core/src/a2a/types.ts +11 -3
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +61 -46
- package/corpus/core/src/agent/engine/builder-engine.ts +22 -10
- package/corpus/core/src/agent/engine/error-detail.ts +184 -3
- package/corpus/core/src/agent/engine/failure-taxonomy.ts +123 -0
- package/corpus/core/src/agent/engine/index.ts +8 -0
- package/corpus/core/src/agent/engine/registry.ts +92 -8
- package/corpus/core/src/agent/engine/translate-ai-sdk.ts +17 -2
- package/corpus/core/src/agent/production-agent.ts +13 -33
- package/corpus/core/src/agent/run-loop-with-resume.ts +1 -1
- package/corpus/core/src/agent/run-manager.ts +43 -14
- package/corpus/core/src/agent/run-store.ts +49 -7
- package/corpus/core/src/agent/thread-data-builder.ts +36 -4
- package/corpus/core/src/cli/templates-meta.ts +13 -0
- package/corpus/core/src/cli/workspace-dev.ts +1 -0
- package/corpus/core/src/client/error-format.ts +12 -0
- package/corpus/core/src/credentials/index.ts +51 -12
- package/corpus/core/src/extensions/url-safety.ts +46 -12
- package/corpus/core/src/integrations/adapters/slack.ts +32 -10
- package/corpus/core/src/integrations/google-docs-poller.ts +12 -1
- package/corpus/core/src/integrations/installations-store.ts +30 -0
- package/corpus/core/src/integrations/plugin.ts +5 -5
- package/corpus/core/src/integrations/types.ts +7 -0
- package/corpus/core/src/integrations/webhook-handler.ts +24 -1
- package/corpus/core/src/jobs/background-automation-runner.ts +38 -1
- package/corpus/core/src/provider-api/index.ts +8 -2
- package/corpus/core/src/scripts/call-agent.ts +6 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +30 -9
- package/corpus/core/src/server/agent-discovery.ts +2 -0
- package/corpus/core/src/server/builder-design-systems.ts +21 -0
- package/corpus/core/src/server/credential-provider.ts +51 -12
- package/corpus/core/src/server/index.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +37 -2
- package/corpus/core/src/shared/reasoning-effort.ts +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +11 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +6 -2
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +39 -19
- package/corpus/templates/assets/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +30 -3
- package/corpus/templates/brain/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -1
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +54 -25
- package/corpus/templates/calendar/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +30 -3
- package/corpus/templates/chat/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +37 -21
- package/corpus/templates/clips/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +1 -1
- package/corpus/templates/clips/desktop/src/lib/media-capture-constraints.ts +1 -1
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +34 -17
- package/corpus/templates/content/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +6 -2
- package/corpus/templates/design/actions/create-design-system.ts +1 -0
- package/corpus/templates/design/actions/set-default-design-system.ts +34 -26
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +21 -4
- package/corpus/templates/design/app/i18n-data.ts +39 -0
- package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +229 -12
- package/corpus/templates/design/app/pages/DesignSystems.tsx +10 -4
- package/corpus/templates/design/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/design/changelog/2026-07-31-design-system-indexing-keeps-your-chosen-name-when-you-uploa.md +6 -0
- package/corpus/templates/design/server/lib/builder-design-system-proxy.ts +19 -4
- package/corpus/templates/dispatch/AGENTS.md +4 -0
- package/corpus/templates/factory/.agents/skills/actions/SKILL.md +562 -0
- package/corpus/templates/factory/.agents/skills/adding-a-feature/SKILL.md +198 -0
- package/corpus/templates/factory/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +182 -0
- package/corpus/templates/factory/.agents/skills/capture-learnings/SKILL.md +89 -0
- package/corpus/templates/factory/.agents/skills/create-skill/SKILL.md +221 -0
- package/corpus/templates/factory/.agents/skills/customizing-agent-native/SKILL.md +220 -0
- package/corpus/templates/factory/.agents/skills/delegate-to-agent/SKILL.md +263 -0
- package/corpus/templates/factory/.agents/skills/factory-graphs/SKILL.md +52 -0
- package/corpus/templates/factory/.agents/skills/feature-flags/SKILL.md +169 -0
- package/corpus/templates/factory/.agents/skills/frontend-design/SKILL.md +174 -0
- package/corpus/templates/factory/.agents/skills/real-time-sync/SKILL.md +232 -0
- package/corpus/templates/factory/.agents/skills/security/SKILL.md +324 -0
- package/corpus/templates/factory/.agents/skills/self-modifying-code/SKILL.md +119 -0
- package/corpus/templates/factory/.agents/skills/shadcn-ui/SKILL.md +123 -0
- package/corpus/templates/factory/.agents/skills/sharing/SKILL.md +232 -0
- package/corpus/templates/factory/.agents/skills/storing-data/SKILL.md +178 -0
- package/corpus/templates/factory/.agents/skills/upgrade-agent-native/SKILL.md +122 -0
- package/corpus/templates/factory/.env.example +24 -0
- package/corpus/templates/factory/.ignore +0 -0
- package/corpus/templates/factory/.oxfmtrc.json +8 -0
- package/corpus/templates/factory/AGENTS.md +90 -0
- package/corpus/templates/factory/CHANGELOG.md +10 -0
- package/corpus/templates/factory/DEVELOPING.md +185 -0
- package/corpus/templates/factory/README.md +64 -0
- package/corpus/templates/factory/_gitignore +42 -0
- package/corpus/templates/factory/actions/add-factory-comment.ts +55 -0
- package/corpus/templates/factory/actions/approve-factory-item.ts +214 -0
- package/corpus/templates/factory/actions/babysit-pull-request.ts +126 -0
- package/corpus/templates/factory/actions/evaluate-triage-item.ts +172 -0
- package/corpus/templates/factory/actions/get-factory-graph.ts +62 -0
- package/corpus/templates/factory/actions/get-triage-config.ts +42 -0
- package/corpus/templates/factory/actions/get-triage-item.ts +74 -0
- package/corpus/templates/factory/actions/hello.ts +13 -0
- package/corpus/templates/factory/actions/ingest-github-observation.ts +100 -0
- package/corpus/templates/factory/actions/list-factories.ts +40 -0
- package/corpus/templates/factory/actions/list-factory-comments.ts +40 -0
- package/corpus/templates/factory/actions/list-triage-items.ts +85 -0
- package/corpus/templates/factory/actions/list-triage-rules.ts +44 -0
- package/corpus/templates/factory/actions/navigate.ts +41 -0
- package/corpus/templates/factory/actions/poll-slack-channel.ts +118 -0
- package/corpus/templates/factory/actions/reconcile-triage-run.ts +179 -0
- package/corpus/templates/factory/actions/record-triage-feedback.ts +58 -0
- package/corpus/templates/factory/actions/run.ts +2 -0
- package/corpus/templates/factory/actions/save-factory-graph.ts +129 -0
- package/corpus/templates/factory/actions/save-triage-config.ts +67 -0
- package/corpus/templates/factory/actions/save-triage-rule.ts +89 -0
- package/corpus/templates/factory/actions/suggest-factory-rules.ts +70 -0
- package/corpus/templates/factory/actions/view-screen.ts +73 -0
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +441 -0
- package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +388 -0
- package/corpus/templates/factory/app/components/layout/Header.tsx +60 -0
- package/corpus/templates/factory/app/components/layout/Layout.tsx +190 -0
- package/corpus/templates/factory/app/components/layout/Sidebar.tsx +538 -0
- package/corpus/templates/factory/app/components/triage/triage-status-pill.tsx +28 -0
- package/corpus/templates/factory/app/components/ui/button.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/card.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/dropdown-menu.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/input.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/label.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/sheet.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/textarea.tsx +1 -0
- package/corpus/templates/factory/app/components/ui/toolkit-provider.tsx +17 -0
- package/corpus/templates/factory/app/components/ui/tooltip.tsx +1 -0
- package/corpus/templates/factory/app/design-system.ts +3 -0
- package/corpus/templates/factory/app/entry.client.tsx +22 -0
- package/corpus/templates/factory/app/entry.server.tsx +10 -0
- package/corpus/templates/factory/app/global.css +93 -0
- package/corpus/templates/factory/app/hooks/use-navigation-state.ts +113 -0
- package/corpus/templates/factory/app/i18n/en-US.ts +211 -0
- package/corpus/templates/factory/app/i18n/index.ts +34 -0
- package/corpus/templates/factory/app/i18n-data.ts +556 -0
- package/corpus/templates/factory/app/lib/agent-page.tsx +49 -0
- package/corpus/templates/factory/app/lib/app-config.ts +11 -0
- package/corpus/templates/factory/app/lib/tab-id.ts +1 -0
- package/corpus/templates/factory/app/lib/utils.ts +1 -0
- package/corpus/templates/factory/app/root.tsx +175 -0
- package/corpus/templates/factory/app/routes/_index.tsx +94 -0
- package/corpus/templates/factory/app/routes/agent.tsx +24 -0
- package/corpus/templates/factory/app/routes/chat.$threadId.tsx +1 -0
- package/corpus/templates/factory/app/routes/database.tsx +17 -0
- package/corpus/templates/factory/app/routes/extensions.$id.$slug.tsx +2 -0
- package/corpus/templates/factory/app/routes/extensions.$id.tsx +11 -0
- package/corpus/templates/factory/app/routes/extensions._index.tsx +11 -0
- package/corpus/templates/factory/app/routes/extensions.tsx +5 -0
- package/corpus/templates/factory/app/routes/factory.tsx +1003 -0
- package/corpus/templates/factory/app/routes/observability.tsx +19 -0
- package/corpus/templates/factory/app/routes/settings.tsx +89 -0
- package/corpus/templates/factory/app/routes/team.tsx +11 -0
- package/corpus/templates/factory/app/routes.ts +4 -0
- package/corpus/templates/factory/app/vite-env.d.ts +6 -0
- package/corpus/templates/factory/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
- package/corpus/templates/factory/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
- package/corpus/templates/factory/changelog/2026-07-10-chat-now-makes-ai-connection-setup-clear-without-shifting-th.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-14-chat-opens-reliably-on-hosted-deployments-instead-of-failing.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-14-fixed-chat-template-startup-with-older-core-versions.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-15-chat-navigation-focuses-on-chat-and-agent.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-compact-sidebar-footer.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-manage-agent-navigation-now-uses-the-connected-nodes-icon.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-22-recent-chats-are-easier-to-scan-and-expand.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-23-full-page-chat-is-better-centered-with-quieter-chat-history-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-24-borderless-secondary-surfaces.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-31-added-an-inspectable-observe-only-factory-queue-for-slack-.md +6 -0
- package/corpus/templates/factory/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/factory/components.json +20 -0
- package/corpus/templates/factory/data/sync-config.json +1 -0
- package/corpus/templates/factory/learnings.defaults.md +5 -0
- package/corpus/templates/factory/netlify.toml +10 -0
- package/corpus/templates/factory/package.json +105 -0
- package/corpus/templates/factory/public/agent-native-icon-dark.svg +10 -0
- package/corpus/templates/factory/public/agent-native-icon-light.svg +10 -0
- package/corpus/templates/factory/public/agent-native-logo-dark.svg +21 -0
- package/corpus/templates/factory/public/agent-native-logo-light.svg +21 -0
- package/corpus/templates/factory/public/favicon.svg +1 -0
- package/corpus/templates/factory/public/icon-180.svg +1 -0
- package/corpus/templates/factory/public/icon-192.svg +1 -0
- package/corpus/templates/factory/public/icon-512.svg +1 -0
- package/corpus/templates/factory/public/manifest.json +21 -0
- package/corpus/templates/factory/react-router.config.ts +7 -0
- package/corpus/templates/factory/server/connectors/credentials.ts +129 -0
- package/corpus/templates/factory/server/connectors/slack.ts +129 -0
- package/corpus/templates/factory/server/db/index.ts +6 -0
- package/corpus/templates/factory/server/db/schema.ts +193 -0
- package/corpus/templates/factory/server/factory-graph/contracts.ts +212 -0
- package/corpus/templates/factory/server/factory-graph/store.ts +121 -0
- package/corpus/templates/factory/server/lib/require-workspace-member.ts +55 -0
- package/corpus/templates/factory/server/middleware/auth.ts +15 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +58 -0
- package/corpus/templates/factory/server/plugins/auth.ts +14 -0
- package/corpus/templates/factory/server/plugins/factory-migrations.ts +247 -0
- package/corpus/templates/factory/server/plugins/factory-scheduler-job.ts +116 -0
- package/corpus/templates/factory/server/plugins/integrations.ts +46 -0
- package/corpus/templates/factory/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/factory/server/routes/_agent-native/factory/builder-callback.post.ts +116 -0
- package/corpus/templates/factory/server/triage/ai-services-git.ts +197 -0
- package/corpus/templates/factory/server/triage/builder-executor.ts +118 -0
- package/corpus/templates/factory/server/triage/contracts.ts +164 -0
- package/corpus/templates/factory/server/triage/github-ingestion.ts +35 -0
- package/corpus/templates/factory/server/triage/guards.ts +121 -0
- package/corpus/templates/factory/server/triage/ids.ts +27 -0
- package/corpus/templates/factory/server/triage/pr-babysit.ts +100 -0
- package/corpus/templates/factory/server/triage/pr-monitor.ts +220 -0
- package/corpus/templates/factory/server/triage/slack-client.ts +55 -0
- package/corpus/templates/factory/server/triage/slack-poller.ts +152 -0
- package/corpus/templates/factory/ssr-entry.ts +15 -0
- package/corpus/templates/factory/tsconfig.json +21 -0
- package/corpus/templates/factory/vite.config.ts +19 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +55 -5
- package/corpus/templates/forms/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +6 -2
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +21 -6
- package/corpus/templates/plan/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +12 -0
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +9 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +11 -0
- package/corpus/templates/slides/AGENTS.md +5 -6
- package/corpus/templates/slides/actions/_await-fit-check.ts +20 -10
- package/corpus/templates/slides/actions/add-slide.ts +17 -4
- package/corpus/templates/slides/actions/create-design-system.ts +16 -4
- package/corpus/templates/slides/actions/delete-design-system.ts +18 -2
- package/corpus/templates/slides/actions/get-layout-overflows.ts +88 -0
- package/corpus/templates/slides/actions/import-file.ts +1 -0
- package/corpus/templates/slides/actions/index-design-system-with-builder.ts +8 -0
- package/corpus/templates/slides/actions/patch-deck.ts +48 -16
- package/corpus/templates/slides/actions/set-default-design-system.ts +49 -19
- package/corpus/templates/slides/actions/update-slide.ts +13 -3
- package/corpus/templates/slides/actions/view-screen.ts +87 -10
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +155 -28
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +21 -17
- package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +849 -341
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +102 -2
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +13 -16
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +60 -12
- package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +11 -1
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +66 -19
- package/corpus/templates/slides/app/i18n/en-US.ts +23 -0
- package/corpus/templates/slides/app/lib/normalize-slide-padding.ts +8 -15
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +4 -3
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +4 -3
- package/corpus/templates/slides/app/pages/Index.tsx +1 -1
- package/corpus/templates/slides/changelog/2026-07-31-design-system-details-now-show-their-source-and-indexing-sta.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-design-system-indexing-keeps-your-chosen-name-when-you-uploa.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-design-system-setup-keeps-focus-rings-visible-and-uses-a-sim.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-skip-prompt-is-now-available-in-the-new-deck-prompt-header.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-slides-now-detect-real-text-and-box-overflow-across-the-deck.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-31-the-agent-native-logo-stays-visible-when-the-sidebar-is-coll.md +6 -0
- package/corpus/templates/slides/server/handlers/design-systems.ts +1 -0
- package/corpus/templates/slides/server/handlers/index-design-system-sources.ts +1 -0
- package/corpus/templates/slides/server/lib/builder-design-system-proxy.ts +23 -4
- package/corpus/templates/slides/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/slides/server/plugins/creative-context.ts +16 -3
- package/corpus/templates/slides/server/workspace-defaults.ts +5 -1
- package/corpus/templates/slides/shared/slide-fit.ts +26 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +30 -3
- package/corpus/templates/tasks/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/dist/a2a/correlation.d.ts +4 -1
- package/dist/a2a/correlation.d.ts.map +1 -1
- package/dist/a2a/correlation.js +8 -1
- package/dist/a2a/correlation.js.map +1 -1
- package/dist/a2a/types.d.ts +11 -3
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +51 -41
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +18 -8
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/error-detail.d.ts +61 -0
- package/dist/agent/engine/error-detail.d.ts.map +1 -1
- package/dist/agent/engine/error-detail.js +145 -3
- package/dist/agent/engine/error-detail.js.map +1 -1
- package/dist/agent/engine/failure-taxonomy.d.ts +24 -0
- package/dist/agent/engine/failure-taxonomy.d.ts.map +1 -0
- package/dist/agent/engine/failure-taxonomy.js +88 -0
- package/dist/agent/engine/failure-taxonomy.js.map +1 -0
- package/dist/agent/engine/index.d.ts +2 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +2 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +16 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +71 -6
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.d.ts.map +1 -1
- package/dist/agent/engine/translate-ai-sdk.js +14 -2
- package/dist/agent/engine/translate-ai-sdk.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +13 -24
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.js +1 -1
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +39 -10
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +10 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +38 -6
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +28 -4
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +13 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/cli/workspace-dev.d.ts.map +1 -1
- package/dist/cli/workspace-dev.js +1 -0
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +10 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/credentials/index.d.ts +9 -2
- package/dist/credentials/index.d.ts.map +1 -1
- package/dist/credentials/index.js +50 -8
- package/dist/credentials/index.js.map +1 -1
- package/dist/extensions/url-safety.d.ts.map +1 -1
- package/dist/extensions/url-safety.js +38 -12
- package/dist/extensions/url-safety.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +25 -8
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +13 -1
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/installations-store.d.ts +10 -0
- package/dist/integrations/installations-store.d.ts.map +1 -1
- package/dist/integrations/installations-store.js +24 -0
- package/dist/integrations/installations-store.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +6 -5
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/types.d.ts +7 -0
- package/dist/integrations/types.d.ts.map +1 -1
- package/dist/integrations/types.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +16 -1
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/background-automation-runner.d.ts.map +1 -1
- package/dist/jobs/background-automation-runner.js +35 -2
- package/dist/jobs/background-automation-runner.js.map +1 -1
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp/screen-memory-stdio.d.ts.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/provider-api/index.js +7 -3
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +6 -1
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +25 -7
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-discovery.d.ts +2 -0
- package/dist/server/agent-discovery.d.ts.map +1 -1
- package/dist/server/agent-discovery.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/builder-design-systems.d.ts +4 -1
- package/dist/server/builder-design-systems.d.ts.map +1 -1
- package/dist/server/builder-design-systems.js +11 -1
- package/dist/server/builder-design-systems.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +49 -12
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +37 -2
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/shared/reasoning-effort.d.ts +1 -0
- package/dist/shared/reasoning-effort.d.ts.map +1 -1
- package/dist/shared/reasoning-effort.js +1 -1
- package/dist/shared/reasoning-effort.js.map +1 -1
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +30 -3
- package/dist/templates/chat/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +11 -0
- package/package.json +1 -1
- package/src/a2a/correlation.ts +11 -1
- package/src/a2a/types.ts +11 -3
- package/src/agent/engine/ai-sdk-engine.ts +61 -46
- package/src/agent/engine/builder-engine.ts +22 -10
- package/src/agent/engine/error-detail.ts +184 -3
- package/src/agent/engine/failure-taxonomy.ts +123 -0
- package/src/agent/engine/index.ts +8 -0
- package/src/agent/engine/registry.ts +92 -8
- package/src/agent/engine/translate-ai-sdk.ts +17 -2
- package/src/agent/production-agent.ts +13 -33
- package/src/agent/run-loop-with-resume.ts +1 -1
- package/src/agent/run-manager.ts +43 -14
- package/src/agent/run-store.ts +49 -7
- package/src/agent/thread-data-builder.ts +36 -4
- package/src/cli/templates-meta.ts +13 -0
- package/src/cli/workspace-dev.ts +1 -0
- package/src/client/error-format.ts +12 -0
- package/src/credentials/index.ts +51 -12
- package/src/extensions/url-safety.ts +46 -12
- package/src/integrations/adapters/slack.ts +32 -10
- package/src/integrations/google-docs-poller.ts +12 -1
- package/src/integrations/installations-store.ts +30 -0
- package/src/integrations/plugin.ts +5 -5
- package/src/integrations/types.ts +7 -0
- package/src/integrations/webhook-handler.ts +24 -1
- package/src/jobs/background-automation-runner.ts +38 -1
- package/src/provider-api/index.ts +8 -2
- package/src/scripts/call-agent.ts +6 -0
- package/src/server/agent-chat-plugin.ts +30 -9
- package/src/server/agent-discovery.ts +2 -0
- package/src/server/builder-design-systems.ts +21 -0
- package/src/server/credential-provider.ts +51 -12
- package/src/server/index.ts +1 -0
- package/src/server/onboarding-html.ts +37 -2
- package/src/shared/reasoning-effort.ts +1 -1
- package/src/templates/chat/app/components/layout/Sidebar.tsx +30 -3
- package/src/templates/chat/changelog/2026-07-31-clicking-the-agent-native-logo-now-toggles-the-app-sidebar.md +6 -0
- package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +11 -0
- package/corpus/templates/clips/desktop/src/lib/media-device-selection.ts +0 -157
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
import {
|
|
2
|
+
navigateWithAgentChatViewTransition,
|
|
3
|
+
useChatThreads,
|
|
4
|
+
type ChatThreadSummary,
|
|
5
|
+
} from "@agent-native/core/client/agent-chat";
|
|
6
|
+
import { appPath } from "@agent-native/core/client/api-path";
|
|
7
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
8
|
+
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
9
|
+
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
10
|
+
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
11
|
+
import { SidebarFooterActions } from "@agent-native/toolkit/app-shell";
|
|
12
|
+
import {
|
|
13
|
+
ChatHistoryRail,
|
|
14
|
+
type ChatHistoryItem,
|
|
15
|
+
} from "@agent-native/toolkit/chat-history";
|
|
16
|
+
import {
|
|
17
|
+
IconLayoutSidebarLeftCollapse,
|
|
18
|
+
IconLayoutSidebarLeftExpand,
|
|
19
|
+
IconGitPullRequest,
|
|
20
|
+
IconMessageCircle,
|
|
21
|
+
IconSearch,
|
|
22
|
+
IconSettings,
|
|
23
|
+
} from "@tabler/icons-react";
|
|
24
|
+
import { useEffect, useMemo } from "react";
|
|
25
|
+
import { Link, useLocation, useNavigate } from "react-router";
|
|
26
|
+
import { toast } from "sonner";
|
|
27
|
+
|
|
28
|
+
import {
|
|
29
|
+
Tooltip,
|
|
30
|
+
TooltipContent,
|
|
31
|
+
TooltipTrigger,
|
|
32
|
+
} from "@/components/ui/tooltip";
|
|
33
|
+
import { APP_TITLE } from "@/lib/app-config";
|
|
34
|
+
import { cn } from "@/lib/utils";
|
|
35
|
+
|
|
36
|
+
const navItems = [
|
|
37
|
+
{
|
|
38
|
+
icon: IconMessageCircle,
|
|
39
|
+
labelKey: "navigation.chat",
|
|
40
|
+
href: "/",
|
|
41
|
+
view: "chat",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
icon: IconGitPullRequest,
|
|
45
|
+
labelKey: "navigation.triage",
|
|
46
|
+
href: "/factory",
|
|
47
|
+
view: "factory",
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const bottomNavItems = [
|
|
52
|
+
{
|
|
53
|
+
icon: IconSettings,
|
|
54
|
+
labelKey: "navigation.settings",
|
|
55
|
+
href: "/settings",
|
|
56
|
+
view: "settings",
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
const CHAT_STORAGE_KEY = "chat";
|
|
61
|
+
const CHAT_ACTIVE_THREAD_KEY = `agent-chat-active-thread:${CHAT_STORAGE_KEY}`;
|
|
62
|
+
|
|
63
|
+
interface SidebarProps {
|
|
64
|
+
collapsed?: boolean;
|
|
65
|
+
collapsible?: boolean;
|
|
66
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function formatThreadAge(updatedAt: number) {
|
|
70
|
+
const diffMs = Math.max(0, Date.now() - updatedAt);
|
|
71
|
+
const minutes = Math.floor(diffMs / 60_000);
|
|
72
|
+
if (minutes < 1) return "now";
|
|
73
|
+
if (minutes < 60) return `${minutes}m`;
|
|
74
|
+
const hours = Math.floor(minutes / 60);
|
|
75
|
+
if (hours < 24) return `${hours}h`;
|
|
76
|
+
const days = Math.floor(hours / 24);
|
|
77
|
+
if (days < 7) return `${days}d`;
|
|
78
|
+
return new Date(updatedAt).toLocaleDateString([], {
|
|
79
|
+
month: "short",
|
|
80
|
+
day: "numeric",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function threadTitle(thread: ChatThreadSummary) {
|
|
85
|
+
return thread.title || thread.preview || "Untitled chat";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function threadUpdatedAt(thread: ChatThreadSummary) {
|
|
89
|
+
return Number.isFinite(thread.updatedAt)
|
|
90
|
+
? thread.updatedAt
|
|
91
|
+
: Number.isFinite(thread.createdAt)
|
|
92
|
+
? thread.createdAt
|
|
93
|
+
: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function compareThreads(a: ChatThreadSummary, b: ChatThreadSummary) {
|
|
97
|
+
const aPinned = a.pinnedAt ?? 0;
|
|
98
|
+
const bPinned = b.pinnedAt ?? 0;
|
|
99
|
+
if (aPinned || bPinned) return bPinned - aPinned;
|
|
100
|
+
return threadUpdatedAt(b) - threadUpdatedAt(a);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function persistedActiveThreadId() {
|
|
104
|
+
try {
|
|
105
|
+
return localStorage.getItem(CHAT_ACTIVE_THREAD_KEY);
|
|
106
|
+
// coercion-ok: browser storage may be unavailable; no persisted thread is distinguishable from no saved selection.
|
|
107
|
+
} catch {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function persistActiveThreadId(threadId: string) {
|
|
113
|
+
try {
|
|
114
|
+
localStorage.setItem(CHAT_ACTIVE_THREAD_KEY, threadId);
|
|
115
|
+
// coercion-ok: persistence is best effort; the active thread remains usable for this session.
|
|
116
|
+
} catch {}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function threadIdFromPath(pathname: string) {
|
|
120
|
+
const match = pathname.match(/^\/chat\/([^/]+)/);
|
|
121
|
+
if (!match) return null;
|
|
122
|
+
try {
|
|
123
|
+
const value = decodeURIComponent(match[1]).trim();
|
|
124
|
+
return value || null;
|
|
125
|
+
// coercion-ok: malformed route input has no valid thread id and remains outside thread selection.
|
|
126
|
+
} catch {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function chatThreadPath(threadId: string) {
|
|
132
|
+
return `/chat/${encodeURIComponent(threadId)}`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function ChatThreadsSection({ open }: { open: boolean }) {
|
|
136
|
+
const navigate = useNavigate();
|
|
137
|
+
const location = useLocation();
|
|
138
|
+
const t = useT();
|
|
139
|
+
const {
|
|
140
|
+
threads,
|
|
141
|
+
activeThreadId,
|
|
142
|
+
createThread,
|
|
143
|
+
switchThread,
|
|
144
|
+
pinThread,
|
|
145
|
+
archiveThread,
|
|
146
|
+
renameThread,
|
|
147
|
+
refreshThreads,
|
|
148
|
+
} = useChatThreads(undefined, CHAT_STORAGE_KEY, undefined, {
|
|
149
|
+
autoCreate: false,
|
|
150
|
+
restoreActiveThread: false,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const visibleThreads = useMemo(
|
|
154
|
+
() =>
|
|
155
|
+
threads
|
|
156
|
+
.filter((thread) => thread.messageCount > 0 && !thread.archivedAt)
|
|
157
|
+
.sort(compareThreads)
|
|
158
|
+
.slice(0, 15),
|
|
159
|
+
[threads],
|
|
160
|
+
);
|
|
161
|
+
const displayedActiveThreadId =
|
|
162
|
+
threadIdFromPath(location.pathname) ??
|
|
163
|
+
(location.pathname === "/" ? null : activeThreadId);
|
|
164
|
+
const chatItems = useMemo<ChatHistoryItem[]>(
|
|
165
|
+
() =>
|
|
166
|
+
visibleThreads.map((thread) => ({
|
|
167
|
+
id: thread.id,
|
|
168
|
+
title: threadTitle(thread),
|
|
169
|
+
titleText: threadTitle(thread),
|
|
170
|
+
timestamp:
|
|
171
|
+
thread.id === displayedActiveThreadId
|
|
172
|
+
? undefined
|
|
173
|
+
: formatThreadAge(threadUpdatedAt(thread)),
|
|
174
|
+
pinned: Boolean(thread.pinnedAt),
|
|
175
|
+
})),
|
|
176
|
+
[displayedActiveThreadId, visibleThreads],
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
const refresh = () => refreshThreads();
|
|
181
|
+
const handleRunning = (event: Event) => {
|
|
182
|
+
const detail = (event as CustomEvent).detail as
|
|
183
|
+
| { isRunning?: unknown }
|
|
184
|
+
| undefined;
|
|
185
|
+
if (typeof detail?.isRunning === "boolean") refreshThreads();
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
window.addEventListener("agent-chat:threads-updated", refresh);
|
|
189
|
+
window.addEventListener("agentNative.chatRunning", handleRunning);
|
|
190
|
+
window.addEventListener("focus", refresh);
|
|
191
|
+
return () => {
|
|
192
|
+
window.removeEventListener("agent-chat:threads-updated", refresh);
|
|
193
|
+
window.removeEventListener("agentNative.chatRunning", handleRunning);
|
|
194
|
+
window.removeEventListener("focus", refresh);
|
|
195
|
+
};
|
|
196
|
+
}, [refreshThreads]);
|
|
197
|
+
|
|
198
|
+
function openThread(threadId: string, options?: { isNew?: boolean }) {
|
|
199
|
+
switchThread(threadId);
|
|
200
|
+
persistActiveThreadId(threadId);
|
|
201
|
+
navigateWithAgentChatViewTransition(
|
|
202
|
+
navigate,
|
|
203
|
+
options?.isNew ? "/" : chatThreadPath(threadId),
|
|
204
|
+
);
|
|
205
|
+
window.requestAnimationFrame(() => {
|
|
206
|
+
window.dispatchEvent(
|
|
207
|
+
new CustomEvent("agent-chat:open-thread", {
|
|
208
|
+
detail: { threadId, newThread: options?.isNew === true },
|
|
209
|
+
}),
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async function handleNewChat() {
|
|
215
|
+
const threadId = await createThread();
|
|
216
|
+
if (threadId) openThread(threadId, { isNew: true });
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
async function handleArchiveThread(threadId: string) {
|
|
220
|
+
const wasActive =
|
|
221
|
+
threadId === activeThreadId || threadId === persistedActiveThreadId();
|
|
222
|
+
const archived = await archiveThread(threadId);
|
|
223
|
+
if (!archived) {
|
|
224
|
+
toast.error(t("chat.archiveFailed"));
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (wasActive) {
|
|
228
|
+
await handleNewChat();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function handleRenameThread(threadId: string, title: string) {
|
|
233
|
+
void renameThread(threadId, title).then((renamed) => {
|
|
234
|
+
if (!renamed) toast.error(t("chat.renameFailed"));
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<div
|
|
240
|
+
className="an-chat-history-rail__collapse"
|
|
241
|
+
data-state={open ? "open" : "closed"}
|
|
242
|
+
aria-hidden={!open}
|
|
243
|
+
>
|
|
244
|
+
<div className="ms-4">
|
|
245
|
+
<ChatHistoryRail
|
|
246
|
+
items={chatItems}
|
|
247
|
+
activeId={displayedActiveThreadId}
|
|
248
|
+
onSelect={(threadId) => openThread(threadId)}
|
|
249
|
+
onNewChat={() => void handleNewChat()}
|
|
250
|
+
railLabels={{
|
|
251
|
+
newChat: t("chat.newChat"),
|
|
252
|
+
showMore: t("chat.chats"),
|
|
253
|
+
showLess: t("chat.chats"),
|
|
254
|
+
}}
|
|
255
|
+
renameMaxLength={160}
|
|
256
|
+
onTogglePin={(threadId) => {
|
|
257
|
+
const thread = visibleThreads.find((item) => item.id === threadId);
|
|
258
|
+
if (thread) void pinThread(threadId, !thread.pinnedAt);
|
|
259
|
+
}}
|
|
260
|
+
onRename={handleRenameThread}
|
|
261
|
+
onDelete={(threadId) => void handleArchiveThread(threadId)}
|
|
262
|
+
labels={{
|
|
263
|
+
options: (item) =>
|
|
264
|
+
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
265
|
+
renameInput: (item) =>
|
|
266
|
+
t("chat.renameThread", { title: item.titleText ?? "" }),
|
|
267
|
+
rename: t("chat.renameChat"),
|
|
268
|
+
pin: t("chat.pinChat"),
|
|
269
|
+
unpin: t("chat.unpinChat"),
|
|
270
|
+
delete: t("chat.archiveChat"),
|
|
271
|
+
}}
|
|
272
|
+
className="min-w-0"
|
|
273
|
+
/>
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export function Sidebar({
|
|
280
|
+
collapsed = false,
|
|
281
|
+
collapsible = true,
|
|
282
|
+
onCollapsedChange,
|
|
283
|
+
}: SidebarProps) {
|
|
284
|
+
const location = useLocation();
|
|
285
|
+
const navigate = useNavigate();
|
|
286
|
+
const t = useT();
|
|
287
|
+
const isChatRoute =
|
|
288
|
+
location.pathname === "/" || location.pathname.startsWith("/chat/");
|
|
289
|
+
const ToggleIcon = collapsed
|
|
290
|
+
? IconLayoutSidebarLeftExpand
|
|
291
|
+
: IconLayoutSidebarLeftCollapse;
|
|
292
|
+
const navClass = ({ isActive }: { isActive: boolean }) =>
|
|
293
|
+
cn(
|
|
294
|
+
"flex items-center text-sm transition-colors",
|
|
295
|
+
collapsed
|
|
296
|
+
? "relative h-10 w-full justify-center rounded-none px-0"
|
|
297
|
+
: "h-9 rounded-md gap-3 px-3",
|
|
298
|
+
isActive
|
|
299
|
+
? collapsed
|
|
300
|
+
? "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
301
|
+
: "bg-sidebar-accent text-sidebar-accent-foreground"
|
|
302
|
+
: collapsed
|
|
303
|
+
? "text-sidebar-foreground/70 hover:bg-sidebar-accent/55 hover:text-sidebar-accent-foreground"
|
|
304
|
+
: "text-sidebar-foreground hover:bg-sidebar-accent/65 hover:text-sidebar-accent-foreground",
|
|
305
|
+
);
|
|
306
|
+
const collapseButton = collapsible ? (
|
|
307
|
+
<Tooltip>
|
|
308
|
+
<TooltipTrigger asChild>
|
|
309
|
+
<button
|
|
310
|
+
type="button"
|
|
311
|
+
onClick={() => onCollapsedChange?.(!collapsed)}
|
|
312
|
+
className={cn(
|
|
313
|
+
"flex shrink-0 items-center justify-center rounded-md text-sidebar-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
314
|
+
collapsed ? "size-8" : "size-7",
|
|
315
|
+
)}
|
|
316
|
+
aria-label={
|
|
317
|
+
collapsed
|
|
318
|
+
? t("navigation.expandSidebar")
|
|
319
|
+
: t("navigation.collapseSidebar")
|
|
320
|
+
}
|
|
321
|
+
>
|
|
322
|
+
<ToggleIcon className="size-4" />
|
|
323
|
+
</button>
|
|
324
|
+
</TooltipTrigger>
|
|
325
|
+
<TooltipContent side="right">
|
|
326
|
+
{collapsed
|
|
327
|
+
? t("navigation.expandSidebar")
|
|
328
|
+
: t("navigation.collapseSidebar")}
|
|
329
|
+
</TooltipContent>
|
|
330
|
+
</Tooltip>
|
|
331
|
+
) : null;
|
|
332
|
+
const searchButton = (
|
|
333
|
+
<Tooltip>
|
|
334
|
+
<TooltipTrigger asChild>
|
|
335
|
+
<button
|
|
336
|
+
type="button"
|
|
337
|
+
onClick={openCommandMenu}
|
|
338
|
+
aria-label={t("root.commandSearch")}
|
|
339
|
+
className="flex size-8 items-center justify-center rounded-md text-sidebar-foreground/65 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
340
|
+
>
|
|
341
|
+
<IconSearch className="size-4" />
|
|
342
|
+
</button>
|
|
343
|
+
</TooltipTrigger>
|
|
344
|
+
<TooltipContent side="right">{t("root.commandSearch")}</TooltipContent>
|
|
345
|
+
</Tooltip>
|
|
346
|
+
);
|
|
347
|
+
const feedbackButton = (
|
|
348
|
+
<FeedbackButton
|
|
349
|
+
variant={collapsed ? "icon" : "sidebar"}
|
|
350
|
+
side="right"
|
|
351
|
+
className={collapsed ? "h-8 w-8" : "min-w-0"}
|
|
352
|
+
/>
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
return (
|
|
356
|
+
<aside
|
|
357
|
+
data-collapsed={collapsed ? "true" : "false"}
|
|
358
|
+
className={cn(
|
|
359
|
+
"flex h-full min-w-0 shrink-0 flex-col overflow-hidden border-e border-sidebar-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out",
|
|
360
|
+
collapsed ? "w-12" : "w-60",
|
|
361
|
+
)}
|
|
362
|
+
>
|
|
363
|
+
<div
|
|
364
|
+
className={cn(
|
|
365
|
+
"flex shrink-0 items-center border-b border-sidebar-border",
|
|
366
|
+
collapsed ? "h-12 justify-center px-0" : "h-14 px-3",
|
|
367
|
+
)}
|
|
368
|
+
>
|
|
369
|
+
<Link
|
|
370
|
+
to="/"
|
|
371
|
+
onClick={(event) => {
|
|
372
|
+
if (
|
|
373
|
+
!collapsible ||
|
|
374
|
+
!onCollapsedChange ||
|
|
375
|
+
event.metaKey ||
|
|
376
|
+
event.ctrlKey ||
|
|
377
|
+
event.shiftKey ||
|
|
378
|
+
event.altKey ||
|
|
379
|
+
event.button !== 0
|
|
380
|
+
) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
event.preventDefault();
|
|
384
|
+
onCollapsedChange(!collapsed);
|
|
385
|
+
}}
|
|
386
|
+
className={cn(
|
|
387
|
+
"flex min-w-0 items-center rounded outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
388
|
+
collapsed ? "size-7 justify-center" : "flex-1 gap-3",
|
|
389
|
+
)}
|
|
390
|
+
aria-label={
|
|
391
|
+
collapsible && onCollapsedChange
|
|
392
|
+
? collapsed
|
|
393
|
+
? t("navigation.expandSidebar")
|
|
394
|
+
: t("navigation.collapseSidebar")
|
|
395
|
+
: collapsed
|
|
396
|
+
? APP_TITLE
|
|
397
|
+
: undefined
|
|
398
|
+
}
|
|
399
|
+
>
|
|
400
|
+
<img
|
|
401
|
+
src={appPath("/agent-native-icon-light.svg")}
|
|
402
|
+
alt=""
|
|
403
|
+
aria-hidden="true"
|
|
404
|
+
width={28}
|
|
405
|
+
height={16}
|
|
406
|
+
className="block h-4 w-7 shrink-0 object-contain object-center dark:hidden"
|
|
407
|
+
/>
|
|
408
|
+
<img
|
|
409
|
+
src={appPath("/agent-native-icon-dark.svg")}
|
|
410
|
+
alt=""
|
|
411
|
+
aria-hidden="true"
|
|
412
|
+
width={28}
|
|
413
|
+
height={16}
|
|
414
|
+
className="hidden h-4 w-7 shrink-0 object-contain object-center dark:block"
|
|
415
|
+
/>
|
|
416
|
+
<div className={cn("min-w-0", collapsed && "sr-only")}>
|
|
417
|
+
<p className="truncate text-sm font-semibold text-sidebar-accent-foreground">
|
|
418
|
+
{APP_TITLE}
|
|
419
|
+
</p>
|
|
420
|
+
</div>
|
|
421
|
+
</Link>
|
|
422
|
+
</div>
|
|
423
|
+
|
|
424
|
+
<nav
|
|
425
|
+
className={cn(
|
|
426
|
+
"flex-1 overflow-y-auto",
|
|
427
|
+
collapsed ? "px-0 py-2" : "px-2 py-3",
|
|
428
|
+
)}
|
|
429
|
+
>
|
|
430
|
+
<div className={cn("grid", collapsed ? "gap-0" : "gap-1")}>
|
|
431
|
+
{navItems.map((item) => {
|
|
432
|
+
const Icon = item.icon;
|
|
433
|
+
const isActive =
|
|
434
|
+
item.href === "/"
|
|
435
|
+
? isChatRoute
|
|
436
|
+
: location.pathname.startsWith(item.href);
|
|
437
|
+
const link = (
|
|
438
|
+
<Link
|
|
439
|
+
to={item.href}
|
|
440
|
+
onClick={(event) => {
|
|
441
|
+
if (
|
|
442
|
+
item.href === "/" &&
|
|
443
|
+
!isChatRoute &&
|
|
444
|
+
!event.metaKey &&
|
|
445
|
+
!event.ctrlKey &&
|
|
446
|
+
!event.shiftKey &&
|
|
447
|
+
!event.altKey
|
|
448
|
+
) {
|
|
449
|
+
event.preventDefault();
|
|
450
|
+
navigateWithAgentChatViewTransition(navigate, "/");
|
|
451
|
+
}
|
|
452
|
+
}}
|
|
453
|
+
className={navClass({ isActive })}
|
|
454
|
+
aria-current={isActive ? "page" : undefined}
|
|
455
|
+
aria-label={collapsed ? t(item.labelKey) : undefined}
|
|
456
|
+
>
|
|
457
|
+
<Icon className="size-4 shrink-0" />
|
|
458
|
+
<span className={collapsed ? "sr-only" : "truncate"}>
|
|
459
|
+
{t(item.labelKey)}
|
|
460
|
+
</span>
|
|
461
|
+
</Link>
|
|
462
|
+
);
|
|
463
|
+
return (
|
|
464
|
+
<div key={item.href}>
|
|
465
|
+
{collapsed ? (
|
|
466
|
+
<Tooltip>
|
|
467
|
+
<TooltipTrigger asChild>{link}</TooltipTrigger>
|
|
468
|
+
<TooltipContent side="right">
|
|
469
|
+
{t(item.labelKey)}
|
|
470
|
+
</TooltipContent>
|
|
471
|
+
</Tooltip>
|
|
472
|
+
) : (
|
|
473
|
+
link
|
|
474
|
+
)}
|
|
475
|
+
{!collapsed && item.view === "chat" ? (
|
|
476
|
+
<ChatThreadsSection open={isChatRoute} />
|
|
477
|
+
) : null}
|
|
478
|
+
</div>
|
|
479
|
+
);
|
|
480
|
+
})}
|
|
481
|
+
</div>
|
|
482
|
+
</nav>
|
|
483
|
+
|
|
484
|
+
<div className={cn("mt-auto shrink-0", collapsed && "py-2")}>
|
|
485
|
+
<nav
|
|
486
|
+
className={cn(
|
|
487
|
+
"grid",
|
|
488
|
+
collapsed ? "gap-0 px-1 py-1" : "gap-1 px-2 py-1",
|
|
489
|
+
)}
|
|
490
|
+
>
|
|
491
|
+
{bottomNavItems.map((item) => {
|
|
492
|
+
const Icon = item.icon;
|
|
493
|
+
const isActive = location.pathname.startsWith(item.href);
|
|
494
|
+
const link = (
|
|
495
|
+
<Link
|
|
496
|
+
to={item.href}
|
|
497
|
+
className={navClass({ isActive })}
|
|
498
|
+
aria-current={isActive ? "page" : undefined}
|
|
499
|
+
aria-label={collapsed ? t(item.labelKey) : undefined}
|
|
500
|
+
>
|
|
501
|
+
<Icon className="size-4 shrink-0" />
|
|
502
|
+
<span className={collapsed ? "sr-only" : "truncate"}>
|
|
503
|
+
{t(item.labelKey)}
|
|
504
|
+
</span>
|
|
505
|
+
</Link>
|
|
506
|
+
);
|
|
507
|
+
return collapsed ? (
|
|
508
|
+
<Tooltip key={item.href}>
|
|
509
|
+
<TooltipTrigger asChild>{link}</TooltipTrigger>
|
|
510
|
+
<TooltipContent side="right">{t(item.labelKey)}</TooltipContent>
|
|
511
|
+
</Tooltip>
|
|
512
|
+
) : (
|
|
513
|
+
<div key={item.href}>{link}</div>
|
|
514
|
+
);
|
|
515
|
+
})}
|
|
516
|
+
</nav>
|
|
517
|
+
|
|
518
|
+
<div className={cn(collapsed ? "px-1 py-1" : "px-3 py-2")}>
|
|
519
|
+
<OrgSwitcher
|
|
520
|
+
reserveSpace
|
|
521
|
+
className={
|
|
522
|
+
collapsed
|
|
523
|
+
? "h-8 justify-center px-0 [&>span]:sr-only [&>svg:last-child]:hidden"
|
|
524
|
+
: undefined
|
|
525
|
+
}
|
|
526
|
+
/>
|
|
527
|
+
</div>
|
|
528
|
+
|
|
529
|
+
<SidebarFooterActions
|
|
530
|
+
collapsed={collapsed}
|
|
531
|
+
feedback={feedbackButton}
|
|
532
|
+
search={searchButton}
|
|
533
|
+
collapse={collapseButton}
|
|
534
|
+
/>
|
|
535
|
+
</div>
|
|
536
|
+
</aside>
|
|
537
|
+
);
|
|
538
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
|
|
3
|
+
type TriageStatusPillProps = {
|
|
4
|
+
status?: string | null;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function TriageStatusPill({ status }: TriageStatusPillProps) {
|
|
8
|
+
const normalizedStatus = status?.toLowerCase();
|
|
9
|
+
const tone =
|
|
10
|
+
normalizedStatus === "high" || normalizedStatus === "critical"
|
|
11
|
+
? "bg-destructive/10 text-destructive"
|
|
12
|
+
: normalizedStatus === "reviewed" || normalizedStatus === "resolved"
|
|
13
|
+
? "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400"
|
|
14
|
+
: normalizedStatus === "medium" || normalizedStatus === "pending"
|
|
15
|
+
? "bg-amber-500/15 text-amber-600 dark:text-amber-400"
|
|
16
|
+
: "bg-muted text-muted-foreground";
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<span
|
|
20
|
+
className={cn(
|
|
21
|
+
"inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium",
|
|
22
|
+
tone,
|
|
23
|
+
)}
|
|
24
|
+
>
|
|
25
|
+
{status || "-"}
|
|
26
|
+
</span>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/button";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/card";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/dropdown-menu";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/input";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/label";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/sheet";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/textarea";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ToolkitProvider, type ToolkitComponents } from "@agent-native/toolkit";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import { designSystem } from "@/design-system";
|
|
6
|
+
|
|
7
|
+
const components: ToolkitComponents = {
|
|
8
|
+
Button: Button as ToolkitComponents["Button"],
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function AppToolkitProvider({ children }: { children: ReactNode }) {
|
|
12
|
+
return (
|
|
13
|
+
<ToolkitProvider components={components} designSystem={designSystem}>
|
|
14
|
+
{children}
|
|
15
|
+
</ToolkitProvider>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agent-native/toolkit/ui/tooltip";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Import only the tiny URL-helper module, not the full client barrel.
|
|
2
|
+
// This keeps the ~650-700 KB gzip chat stack off the static import closure
|
|
3
|
+
// of the client entry point so it can't block the first page parse.
|
|
4
|
+
import { appBasePath } from "@agent-native/core/client/api-path";
|
|
5
|
+
import { installRouteChunkRecovery } from "@agent-native/core/client/route-chunk-recovery";
|
|
6
|
+
import { hydrateRoot } from "react-dom/client";
|
|
7
|
+
import { HydratedRouter } from "react-router/dom";
|
|
8
|
+
|
|
9
|
+
installRouteChunkRecovery();
|
|
10
|
+
|
|
11
|
+
const basePath = appBasePath();
|
|
12
|
+
const pathname = window.location.pathname;
|
|
13
|
+
const routerBasePath =
|
|
14
|
+
basePath && (pathname === basePath || pathname.startsWith(`${basePath}/`))
|
|
15
|
+
? basePath
|
|
16
|
+
: "";
|
|
17
|
+
const context = (
|
|
18
|
+
window as Window & { __reactRouterContext?: { basename?: string } }
|
|
19
|
+
).__reactRouterContext;
|
|
20
|
+
if (context) context.basename = routerBasePath;
|
|
21
|
+
|
|
22
|
+
hydrateRoot(document, <HydratedRouter />);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createDocumentRequestHandler,
|
|
3
|
+
streamTimeout,
|
|
4
|
+
} from "@agent-native/core/server/entry-server";
|
|
5
|
+
import { ServerRouter } from "react-router";
|
|
6
|
+
|
|
7
|
+
const handleDocumentRequest = createDocumentRequestHandler(ServerRouter);
|
|
8
|
+
|
|
9
|
+
export { streamTimeout };
|
|
10
|
+
export default handleDocumentRequest;
|