@agent-native/core 0.132.1 → 0.133.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 +2 -2
- package/corpus/core/CHANGELOG.md +198 -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 +33 -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 +30 -3
- package/corpus/core/src/agent/thread-data-builder.ts +36 -4
- package/corpus/core/src/chat-threads/store.ts +42 -0
- 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/client/use-chat-threads.ts +76 -16
- 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 +46 -10
- 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-30-meeting-microphone-transcription-works-reliably-from-the-fir.md +6 -0
- 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/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +13 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +2 -0
- package/corpus/templates/clips/desktop/src-tauri/src/system_audio.rs +25 -132
- 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/.generated/bridge/editor-chrome.generated.ts +5 -0
- 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/design/KeyboardShortcutsPanel.tsx +5 -3
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +23 -0
- package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +3 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +21 -4
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +11 -7
- 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-30-fixed-the-keyboard-shortcuts-panel-not-opening-with-ctrl-shi.md +6 -0
- 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 +27 -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 +20 -3
- 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/chat-threads/store.d.ts +13 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +35 -0
- package/dist/chat-threads/store.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/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +66 -16
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.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/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/notifications/routes.d.ts +6 -6
- package/dist/observability/routes.d.ts +3 -3
- 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/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 +38 -9
- 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/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/server/transcribe-voice.d.ts +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 +33 -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 +30 -3
- package/src/agent/thread-data-builder.ts +36 -4
- package/src/chat-threads/store.ts +42 -0
- 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/client/use-chat-threads.ts +76 -16
- 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 +46 -10
- 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,388 @@
|
|
|
1
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
2
|
+
import {
|
|
3
|
+
IconArrowRight,
|
|
4
|
+
IconMessagePlus,
|
|
5
|
+
IconPlus,
|
|
6
|
+
IconTrash,
|
|
7
|
+
} from "@tabler/icons-react";
|
|
8
|
+
import { useMemo, useState } from "react";
|
|
9
|
+
|
|
10
|
+
import { Button } from "@/components/ui/button";
|
|
11
|
+
import { Input } from "@/components/ui/input";
|
|
12
|
+
import { Label } from "@/components/ui/label";
|
|
13
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
FactoryCanvasEdge,
|
|
17
|
+
FactoryCanvasGraph,
|
|
18
|
+
FactoryCanvasNode,
|
|
19
|
+
} from "./FactoryCanvas";
|
|
20
|
+
|
|
21
|
+
export type FactoryComment = {
|
|
22
|
+
id: string;
|
|
23
|
+
targetType: string;
|
|
24
|
+
targetId?: string | null;
|
|
25
|
+
body: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
ownerEmail: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
interface FactoryInspectorProps {
|
|
31
|
+
graph: FactoryCanvasGraph;
|
|
32
|
+
selectedNode?: FactoryCanvasNode;
|
|
33
|
+
selectedEdge?: FactoryCanvasEdge;
|
|
34
|
+
comments: FactoryComment[];
|
|
35
|
+
dirty: boolean;
|
|
36
|
+
saving: boolean;
|
|
37
|
+
onGraphChange: (graph: FactoryCanvasGraph) => void;
|
|
38
|
+
onSave: () => void;
|
|
39
|
+
onAddComment: (
|
|
40
|
+
targetType: "canvas" | "node" | "edge",
|
|
41
|
+
targetId?: string,
|
|
42
|
+
body?: string,
|
|
43
|
+
) => void;
|
|
44
|
+
onAddNode: () => void;
|
|
45
|
+
onDeleteNode: (nodeId: string) => void;
|
|
46
|
+
onConnect: (sourceId: string, targetId: string) => void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function FactoryInspector({
|
|
50
|
+
graph,
|
|
51
|
+
selectedNode,
|
|
52
|
+
selectedEdge,
|
|
53
|
+
comments,
|
|
54
|
+
dirty,
|
|
55
|
+
saving,
|
|
56
|
+
onGraphChange,
|
|
57
|
+
onSave,
|
|
58
|
+
onAddComment,
|
|
59
|
+
onAddNode,
|
|
60
|
+
onDeleteNode,
|
|
61
|
+
onConnect,
|
|
62
|
+
}: FactoryInspectorProps) {
|
|
63
|
+
const t = useT();
|
|
64
|
+
const [commentDraft, setCommentDraft] = useState("");
|
|
65
|
+
const [connectTarget, setConnectTarget] = useState("");
|
|
66
|
+
const targetType = selectedNode ? "node" : selectedEdge ? "edge" : "canvas";
|
|
67
|
+
const targetId = selectedNode?.id ?? selectedEdge?.id;
|
|
68
|
+
const targetComments = useMemo(
|
|
69
|
+
() =>
|
|
70
|
+
comments.filter(
|
|
71
|
+
(comment) =>
|
|
72
|
+
comment.targetType === targetType &&
|
|
73
|
+
(targetType === "canvas" || comment.targetId === targetId),
|
|
74
|
+
),
|
|
75
|
+
[comments, targetId, targetType],
|
|
76
|
+
);
|
|
77
|
+
const outgoingTargets = graph.nodes.filter(
|
|
78
|
+
(node) => node.id !== selectedNode?.id,
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
function updateNode(patch: Partial<FactoryCanvasNode>) {
|
|
82
|
+
if (!selectedNode) return;
|
|
83
|
+
onGraphChange({
|
|
84
|
+
...graph,
|
|
85
|
+
nodes: graph.nodes.map((node) =>
|
|
86
|
+
node.id === selectedNode.id ? { ...node, ...patch } : node,
|
|
87
|
+
),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function updateEdge(patch: Partial<FactoryCanvasEdge>) {
|
|
92
|
+
if (!selectedEdge) return;
|
|
93
|
+
onGraphChange({
|
|
94
|
+
...graph,
|
|
95
|
+
edges: graph.edges.map((edge) =>
|
|
96
|
+
edge.id === selectedEdge.id ? { ...edge, ...patch } : edge,
|
|
97
|
+
),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function submitComment() {
|
|
102
|
+
const body = commentDraft.trim();
|
|
103
|
+
if (!body) return;
|
|
104
|
+
onAddComment(targetType, targetId, body);
|
|
105
|
+
setCommentDraft("");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<aside className="flex min-h-0 flex-col border-l bg-background">
|
|
110
|
+
<div className="flex items-start justify-between gap-3 border-b px-4 py-4">
|
|
111
|
+
<div className="min-w-0">
|
|
112
|
+
<p className="text-[11px] font-medium uppercase tracking-[0.16em] text-muted-foreground">
|
|
113
|
+
{t("factoryInspector.title")}
|
|
114
|
+
</p>
|
|
115
|
+
<h2 className="mt-1 truncate text-base font-semibold">
|
|
116
|
+
{selectedNode?.label ?? selectedEdge?.label ?? graph.name}
|
|
117
|
+
</h2>
|
|
118
|
+
<p className="mt-1 text-xs leading-5 text-muted-foreground">
|
|
119
|
+
{selectedNode?.description ??
|
|
120
|
+
selectedEdge?.condition ??
|
|
121
|
+
graph.description}
|
|
122
|
+
</p>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
|
|
126
|
+
<div className="min-h-0 flex-1 space-y-5 overflow-y-auto p-4">
|
|
127
|
+
{!selectedNode && !selectedEdge ? (
|
|
128
|
+
<CanvasInspector
|
|
129
|
+
graph={graph}
|
|
130
|
+
onGraphChange={onGraphChange}
|
|
131
|
+
onAddNode={onAddNode}
|
|
132
|
+
/>
|
|
133
|
+
) : selectedNode ? (
|
|
134
|
+
<>
|
|
135
|
+
<div className="grid gap-1.5">
|
|
136
|
+
<Label htmlFor="factory-node-label">
|
|
137
|
+
{t("factoryInspector.stepName")}
|
|
138
|
+
</Label>
|
|
139
|
+
<Input
|
|
140
|
+
id="factory-node-label"
|
|
141
|
+
value={selectedNode.label}
|
|
142
|
+
onChange={(event) => updateNode({ label: event.target.value })}
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
<div className="grid gap-1.5">
|
|
146
|
+
<Label htmlFor="factory-node-description">
|
|
147
|
+
{t("factoryInspector.stepDescription")}
|
|
148
|
+
</Label>
|
|
149
|
+
<Textarea
|
|
150
|
+
id="factory-node-description"
|
|
151
|
+
value={selectedNode.description}
|
|
152
|
+
onChange={(event) =>
|
|
153
|
+
updateNode({ description: event.target.value })
|
|
154
|
+
}
|
|
155
|
+
rows={3}
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
<div className="grid gap-1.5">
|
|
159
|
+
<Label htmlFor="factory-node-provider">Provider</Label>
|
|
160
|
+
<select
|
|
161
|
+
id="factory-node-provider"
|
|
162
|
+
value={selectedNode.provider ?? "factory"}
|
|
163
|
+
onChange={(event) =>
|
|
164
|
+
updateNode({
|
|
165
|
+
provider: event.target
|
|
166
|
+
.value as FactoryCanvasNode["provider"],
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
className="h-9 rounded-md border bg-background px-3 text-sm"
|
|
170
|
+
>
|
|
171
|
+
<option value="factory">Factory</option>
|
|
172
|
+
<option value="slack">Slack</option>
|
|
173
|
+
<option value="github">GitHub</option>
|
|
174
|
+
<option value="builder">Builder</option>
|
|
175
|
+
<option value="claude">Claude</option>
|
|
176
|
+
<option value="codex">Codex</option>
|
|
177
|
+
<option value="human">Human</option>
|
|
178
|
+
</select>
|
|
179
|
+
</div>
|
|
180
|
+
<div className="grid gap-1.5">
|
|
181
|
+
<Label htmlFor="factory-node-agent">
|
|
182
|
+
{t("factoryInspector.agentOwner")}
|
|
183
|
+
</Label>
|
|
184
|
+
<Input
|
|
185
|
+
id="factory-node-agent"
|
|
186
|
+
value={selectedNode.agent ?? ""}
|
|
187
|
+
onChange={(event) => updateNode({ agent: event.target.value })}
|
|
188
|
+
placeholder={t("factoryInspector.optional")}
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
<div className="rounded-lg border bg-muted/25 p-3">
|
|
192
|
+
<p className="text-xs font-medium">
|
|
193
|
+
{t("factoryInspector.connectStep")}
|
|
194
|
+
</p>
|
|
195
|
+
<p className="mt-1 text-xs leading-5 text-muted-foreground">
|
|
196
|
+
{t("factoryInspector.connectDescription")}
|
|
197
|
+
</p>
|
|
198
|
+
<div className="mt-3 flex gap-2">
|
|
199
|
+
<select
|
|
200
|
+
aria-label={t("factoryInspector.targetStep")}
|
|
201
|
+
value={connectTarget}
|
|
202
|
+
onChange={(event) => setConnectTarget(event.target.value)}
|
|
203
|
+
className="h-9 min-w-0 flex-1 rounded-md border bg-background px-3 text-sm"
|
|
204
|
+
>
|
|
205
|
+
<option value="">{t("factoryInspector.chooseTarget")}</option>
|
|
206
|
+
{outgoingTargets.map((node) => (
|
|
207
|
+
<option key={node.id} value={node.id}>
|
|
208
|
+
{node.label}
|
|
209
|
+
</option>
|
|
210
|
+
))}
|
|
211
|
+
</select>
|
|
212
|
+
<Button
|
|
213
|
+
type="button"
|
|
214
|
+
variant="outline"
|
|
215
|
+
size="icon"
|
|
216
|
+
aria-label={t("factoryInspector.connectSteps")}
|
|
217
|
+
disabled={!connectTarget}
|
|
218
|
+
onClick={() => {
|
|
219
|
+
onConnect(selectedNode.id, connectTarget);
|
|
220
|
+
setConnectTarget("");
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
223
|
+
<IconArrowRight className="size-4" />
|
|
224
|
+
</Button>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
<Button
|
|
228
|
+
type="button"
|
|
229
|
+
variant="outline"
|
|
230
|
+
className="w-full text-destructive hover:text-destructive"
|
|
231
|
+
onClick={() => onDeleteNode(selectedNode.id)}
|
|
232
|
+
>
|
|
233
|
+
<IconTrash className="size-4" />
|
|
234
|
+
{t("factoryInspector.removeStep")}
|
|
235
|
+
</Button>
|
|
236
|
+
</>
|
|
237
|
+
) : (
|
|
238
|
+
<>
|
|
239
|
+
<div className="grid gap-1.5">
|
|
240
|
+
<Label htmlFor="factory-edge-label">
|
|
241
|
+
{t("factoryInspector.routeLabel")}
|
|
242
|
+
</Label>
|
|
243
|
+
<Input
|
|
244
|
+
id="factory-edge-label"
|
|
245
|
+
value={selectedEdge?.label ?? ""}
|
|
246
|
+
onChange={(event) => updateEdge({ label: event.target.value })}
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
<div className="grid gap-1.5">
|
|
250
|
+
<Label htmlFor="factory-edge-condition">
|
|
251
|
+
{t("factoryInspector.routeCondition")}
|
|
252
|
+
</Label>
|
|
253
|
+
<Textarea
|
|
254
|
+
id="factory-edge-condition"
|
|
255
|
+
value={selectedEdge?.condition ?? ""}
|
|
256
|
+
onChange={(event) =>
|
|
257
|
+
updateEdge({ condition: event.target.value })
|
|
258
|
+
}
|
|
259
|
+
rows={4}
|
|
260
|
+
placeholder={t("factoryInspector.routePlaceholder")}
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
</>
|
|
264
|
+
)}
|
|
265
|
+
|
|
266
|
+
<div className="border-t pt-4">
|
|
267
|
+
<div className="flex items-center justify-between gap-3">
|
|
268
|
+
<p className="text-xs font-medium">
|
|
269
|
+
{targetType === "canvas"
|
|
270
|
+
? t("factoryInspector.factoryComments")
|
|
271
|
+
: t("factoryInspector.selectionComments")}
|
|
272
|
+
</p>
|
|
273
|
+
<span className="text-xs text-muted-foreground">
|
|
274
|
+
v{graph.version}
|
|
275
|
+
</span>
|
|
276
|
+
</div>
|
|
277
|
+
<div className="mt-3 space-y-3">
|
|
278
|
+
{targetComments.length === 0 ? (
|
|
279
|
+
<p className="text-xs leading-5 text-muted-foreground">
|
|
280
|
+
{t("factoryInspector.commentEmpty")}
|
|
281
|
+
</p>
|
|
282
|
+
) : (
|
|
283
|
+
targetComments.map((comment) => (
|
|
284
|
+
<div key={comment.id} className="rounded-lg border p-3">
|
|
285
|
+
<p className="text-sm leading-5">{comment.body}</p>
|
|
286
|
+
<p className="mt-2 text-[11px] text-muted-foreground">
|
|
287
|
+
{comment.ownerEmail} ·{" "}
|
|
288
|
+
{formatCommentDate(comment.createdAt)}
|
|
289
|
+
</p>
|
|
290
|
+
</div>
|
|
291
|
+
))
|
|
292
|
+
)}
|
|
293
|
+
<Textarea
|
|
294
|
+
value={commentDraft}
|
|
295
|
+
onChange={(event) => setCommentDraft(event.target.value)}
|
|
296
|
+
placeholder={t("factoryInspector.leaveComment")}
|
|
297
|
+
rows={3}
|
|
298
|
+
/>
|
|
299
|
+
<Button
|
|
300
|
+
type="button"
|
|
301
|
+
variant="outline"
|
|
302
|
+
className="w-full"
|
|
303
|
+
disabled={!commentDraft.trim()}
|
|
304
|
+
onClick={submitComment}
|
|
305
|
+
>
|
|
306
|
+
<IconMessagePlus className="size-4" />
|
|
307
|
+
{t("factoryInspector.addComment")}
|
|
308
|
+
</Button>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<div className="border-t bg-muted/15 p-4">
|
|
314
|
+
<Button
|
|
315
|
+
type="button"
|
|
316
|
+
className="w-full"
|
|
317
|
+
disabled={!dirty || saving}
|
|
318
|
+
onClick={onSave}
|
|
319
|
+
>
|
|
320
|
+
{saving
|
|
321
|
+
? t("factoryInspector.savingGraph")
|
|
322
|
+
: dirty
|
|
323
|
+
? t("factoryInspector.saveGraph")
|
|
324
|
+
: t("factoryInspector.savedGraph")}
|
|
325
|
+
</Button>
|
|
326
|
+
<p className="mt-2 text-center text-[11px] text-muted-foreground">
|
|
327
|
+
{t("factoryInspector.saveNote")}
|
|
328
|
+
</p>
|
|
329
|
+
</div>
|
|
330
|
+
</aside>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function CanvasInspector({
|
|
335
|
+
graph,
|
|
336
|
+
onGraphChange,
|
|
337
|
+
onAddNode,
|
|
338
|
+
}: {
|
|
339
|
+
graph: FactoryCanvasGraph;
|
|
340
|
+
onGraphChange: (graph: FactoryCanvasGraph) => void;
|
|
341
|
+
onAddNode: () => void;
|
|
342
|
+
}) {
|
|
343
|
+
const t = useT();
|
|
344
|
+
return (
|
|
345
|
+
<>
|
|
346
|
+
<div className="grid gap-1.5">
|
|
347
|
+
<Label htmlFor="factory-name">
|
|
348
|
+
{t("factoryInspector.factoryName")}
|
|
349
|
+
</Label>
|
|
350
|
+
<Input
|
|
351
|
+
id="factory-name"
|
|
352
|
+
value={graph.name}
|
|
353
|
+
onChange={(event) =>
|
|
354
|
+
onGraphChange({ ...graph, name: event.target.value })
|
|
355
|
+
}
|
|
356
|
+
/>
|
|
357
|
+
</div>
|
|
358
|
+
<div className="grid gap-1.5">
|
|
359
|
+
<Label htmlFor="factory-description">
|
|
360
|
+
{t("factoryInspector.factoryDescription")}
|
|
361
|
+
</Label>
|
|
362
|
+
<Textarea
|
|
363
|
+
id="factory-description"
|
|
364
|
+
value={graph.description}
|
|
365
|
+
onChange={(event) =>
|
|
366
|
+
onGraphChange({ ...graph, description: event.target.value })
|
|
367
|
+
}
|
|
368
|
+
rows={4}
|
|
369
|
+
/>
|
|
370
|
+
</div>
|
|
371
|
+
<Button
|
|
372
|
+
type="button"
|
|
373
|
+
variant="outline"
|
|
374
|
+
className="w-full"
|
|
375
|
+
onClick={onAddNode}
|
|
376
|
+
>
|
|
377
|
+
<IconPlus className="size-4" />
|
|
378
|
+
{t("factoryInspector.addStep")}
|
|
379
|
+
</Button>
|
|
380
|
+
</>
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
function formatCommentDate(value: string) {
|
|
385
|
+
const date = new Date(value);
|
|
386
|
+
if (Number.isNaN(date.getTime())) return value;
|
|
387
|
+
return date.toLocaleString([], { month: "short", day: "numeric" });
|
|
388
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AgentToggleButton } from "@agent-native/core/client/agent-chat";
|
|
2
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
3
|
+
import {
|
|
4
|
+
useHeaderTitle,
|
|
5
|
+
useHeaderActions,
|
|
6
|
+
} from "@agent-native/toolkit/app-shell";
|
|
7
|
+
import { IconMenu2 } from "@tabler/icons-react";
|
|
8
|
+
import { useLocation } from "react-router";
|
|
9
|
+
|
|
10
|
+
import { APP_TITLE } from "@/lib/app-config";
|
|
11
|
+
|
|
12
|
+
const pageTitleKeys: Record<string, string> = {
|
|
13
|
+
"/": "navigation.chat",
|
|
14
|
+
"/observability": "navigation.observability",
|
|
15
|
+
"/agent": "settings.agentTitle",
|
|
16
|
+
"/settings": "navigation.settings",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function resolveTitle(pathname: string, t: (key: string) => string): string {
|
|
20
|
+
if (pageTitleKeys[pathname]) return t(pageTitleKeys[pathname]);
|
|
21
|
+
if (pathname.startsWith("/extensions")) return t("navigation.extensions");
|
|
22
|
+
return APP_TITLE;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface HeaderProps {
|
|
26
|
+
onOpenMobileSidebar?: () => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function Header({ onOpenMobileSidebar }: HeaderProps) {
|
|
30
|
+
const location = useLocation();
|
|
31
|
+
const t = useT();
|
|
32
|
+
const title = useHeaderTitle();
|
|
33
|
+
const actions = useHeaderActions();
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<header className="flex h-12 items-center gap-3 border-b border-border bg-background px-4 lg:px-6 shrink-0">
|
|
37
|
+
{onOpenMobileSidebar && (
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
onClick={onOpenMobileSidebar}
|
|
41
|
+
aria-label={t("navigation.openNavigation")}
|
|
42
|
+
className="flex h-9 w-9 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-accent md:hidden"
|
|
43
|
+
>
|
|
44
|
+
<IconMenu2 className="h-4 w-4" />
|
|
45
|
+
</button>
|
|
46
|
+
)}
|
|
47
|
+
<div className="flex items-center gap-3 flex-1 min-w-0">
|
|
48
|
+
{title ?? (
|
|
49
|
+
<h1 className="text-lg font-semibold tracking-tight truncate">
|
|
50
|
+
{resolveTitle(location.pathname, t)}
|
|
51
|
+
</h1>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
<div className="flex items-center gap-2 shrink-0">
|
|
55
|
+
{actions}
|
|
56
|
+
<AgentToggleButton />
|
|
57
|
+
</div>
|
|
58
|
+
</header>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AgentSidebar,
|
|
3
|
+
focusAgentChat,
|
|
4
|
+
isAgentChatHomeHandoffActive,
|
|
5
|
+
navigateWithAgentChatViewTransition,
|
|
6
|
+
useAgentChatHomeHandoff,
|
|
7
|
+
useAgentChatHomeHandoffLinks,
|
|
8
|
+
} from "@agent-native/core/client/agent-chat";
|
|
9
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
10
|
+
import { HeaderActionsProvider } from "@agent-native/toolkit/app-shell";
|
|
11
|
+
import { IconMenu2 } from "@tabler/icons-react";
|
|
12
|
+
import { useState, useEffect } from "react";
|
|
13
|
+
import { useLocation, useNavigate } from "react-router";
|
|
14
|
+
|
|
15
|
+
import { Button } from "@/components/ui/button";
|
|
16
|
+
import {
|
|
17
|
+
Sheet,
|
|
18
|
+
SheetContent,
|
|
19
|
+
SheetDescription,
|
|
20
|
+
SheetTitle,
|
|
21
|
+
} from "@/components/ui/sheet";
|
|
22
|
+
import { APP_TITLE } from "@/lib/app-config";
|
|
23
|
+
import { TAB_ID } from "@/lib/tab-id";
|
|
24
|
+
|
|
25
|
+
import { Header } from "./Header";
|
|
26
|
+
import { Sidebar } from "./Sidebar";
|
|
27
|
+
|
|
28
|
+
interface LayoutProps {
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const SIDEBAR_COLLAPSE_KEY = "chat.sidebar.collapsed";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Routes whose page renders its own toolbar. Layout still wraps these with the
|
|
36
|
+
* left Sidebar and agent surfaces but skips the global Header so they don't
|
|
37
|
+
* double-stack chrome.
|
|
38
|
+
*/
|
|
39
|
+
function routeOwnsToolbar(pathname: string): boolean {
|
|
40
|
+
return (
|
|
41
|
+
pathname === "/" ||
|
|
42
|
+
pathname.startsWith("/chat/") ||
|
|
43
|
+
pathname === "/database" ||
|
|
44
|
+
pathname.startsWith("/extensions")
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function Layout({ children }: LayoutProps) {
|
|
49
|
+
const location = useLocation();
|
|
50
|
+
const navigate = useNavigate();
|
|
51
|
+
const t = useT();
|
|
52
|
+
const [mobileSidebarOpen, setMobileSidebarOpen] = useState(false);
|
|
53
|
+
const [sidebarCollapsed, setSidebarCollapsed] = useState(true);
|
|
54
|
+
const isChatRoute =
|
|
55
|
+
location.pathname === "/" || location.pathname.startsWith("/chat/");
|
|
56
|
+
const chatHomeHandoffActive = useAgentChatHomeHandoff({
|
|
57
|
+
storageKey: "chat",
|
|
58
|
+
activePath: location.pathname,
|
|
59
|
+
enabled: !isChatRoute,
|
|
60
|
+
});
|
|
61
|
+
const chatHomeHandoffPending = isAgentChatHomeHandoffActive("chat");
|
|
62
|
+
useAgentChatHomeHandoffLinks({
|
|
63
|
+
storageKey: "chat",
|
|
64
|
+
isChatPath: (pathname) => pathname === "/" || pathname.startsWith("/chat/"),
|
|
65
|
+
requireActiveHandoff: true,
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
setMobileSidebarOpen(false);
|
|
70
|
+
}, [location.pathname]);
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const closeMobileSidebar = () => setMobileSidebarOpen(false);
|
|
74
|
+
window.addEventListener("agent-chat:open-thread", closeMobileSidebar);
|
|
75
|
+
return () => {
|
|
76
|
+
window.removeEventListener("agent-chat:open-thread", closeMobileSidebar);
|
|
77
|
+
};
|
|
78
|
+
}, []);
|
|
79
|
+
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
try {
|
|
82
|
+
const stored = window.localStorage.getItem(SIDEBAR_COLLAPSE_KEY);
|
|
83
|
+
if (stored !== null) setSidebarCollapsed(stored === "1");
|
|
84
|
+
// coercion-ok: browser storage may be unavailable; the default collapsed state remains usable.
|
|
85
|
+
} catch {
|
|
86
|
+
// Ignore storage access errors; the default collapsed state still works.
|
|
87
|
+
}
|
|
88
|
+
}, []);
|
|
89
|
+
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
try {
|
|
92
|
+
window.localStorage.setItem(
|
|
93
|
+
SIDEBAR_COLLAPSE_KEY,
|
|
94
|
+
sidebarCollapsed ? "1" : "0",
|
|
95
|
+
);
|
|
96
|
+
// coercion-ok: persistence is best effort; the visible sidebar state remains authoritative.
|
|
97
|
+
} catch {
|
|
98
|
+
// Ignore storage access errors.
|
|
99
|
+
}
|
|
100
|
+
}, [sidebarCollapsed]);
|
|
101
|
+
|
|
102
|
+
const ownsToolbar = routeOwnsToolbar(location.pathname);
|
|
103
|
+
function openAskAgentFullscreen() {
|
|
104
|
+
focusAgentChat();
|
|
105
|
+
navigateWithAgentChatViewTransition(navigate, "/");
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const contentFrame = (
|
|
109
|
+
<div className="flex h-full min-w-0 flex-1 flex-col overflow-hidden">
|
|
110
|
+
{isChatRoute ? (
|
|
111
|
+
<div className="flex h-12 shrink-0 items-center gap-3 border-b border-border bg-card px-3 md:hidden">
|
|
112
|
+
<Button
|
|
113
|
+
type="button"
|
|
114
|
+
variant="ghost"
|
|
115
|
+
size="icon"
|
|
116
|
+
onClick={() => setMobileSidebarOpen(true)}
|
|
117
|
+
aria-label={t("navigation.openNavigation")}
|
|
118
|
+
>
|
|
119
|
+
<IconMenu2 className="size-4" />
|
|
120
|
+
</Button>
|
|
121
|
+
<span className="truncate text-sm font-semibold">{APP_TITLE}</span>
|
|
122
|
+
</div>
|
|
123
|
+
) : ownsToolbar ? (
|
|
124
|
+
<div className="flex h-12 shrink-0 items-center border-b border-border px-4 md:hidden">
|
|
125
|
+
<button
|
|
126
|
+
type="button"
|
|
127
|
+
onClick={() => setMobileSidebarOpen(true)}
|
|
128
|
+
aria-label={t("navigation.openNavigation")}
|
|
129
|
+
className="flex h-9 w-9 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground"
|
|
130
|
+
>
|
|
131
|
+
<IconMenu2 className="h-4 w-4" />
|
|
132
|
+
</button>
|
|
133
|
+
</div>
|
|
134
|
+
) : (
|
|
135
|
+
<Header onOpenMobileSidebar={() => setMobileSidebarOpen(true)} />
|
|
136
|
+
)}
|
|
137
|
+
<main className="agent-native-app-main min-w-0 flex-1 overflow-y-auto overscroll-contain">
|
|
138
|
+
{children}
|
|
139
|
+
</main>
|
|
140
|
+
</div>
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<HeaderActionsProvider>
|
|
145
|
+
<div className="agent-layout-shell flex h-screen w-full overflow-hidden bg-background text-foreground">
|
|
146
|
+
<div className="agent-layout-left-drawer hidden md:block">
|
|
147
|
+
<Sidebar
|
|
148
|
+
collapsed={sidebarCollapsed}
|
|
149
|
+
onCollapsedChange={setSidebarCollapsed}
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
<Sheet open={mobileSidebarOpen} onOpenChange={setMobileSidebarOpen}>
|
|
153
|
+
<SheetContent side="left" className="p-0 w-[260px]">
|
|
154
|
+
<SheetTitle className="sr-only">
|
|
155
|
+
{t("navigation.navigation")}
|
|
156
|
+
</SheetTitle>
|
|
157
|
+
<SheetDescription className="sr-only">
|
|
158
|
+
{t("navigation.navigationDescription")}
|
|
159
|
+
</SheetDescription>
|
|
160
|
+
<Sidebar collapsed={false} collapsible={false} />
|
|
161
|
+
</SheetContent>
|
|
162
|
+
</Sheet>
|
|
163
|
+
{isChatRoute ? (
|
|
164
|
+
<div className="agent-layout-main-surface flex min-w-0 flex-1 overflow-hidden">
|
|
165
|
+
{contentFrame}
|
|
166
|
+
</div>
|
|
167
|
+
) : (
|
|
168
|
+
<AgentSidebar
|
|
169
|
+
position="right"
|
|
170
|
+
chatViewTransition
|
|
171
|
+
chatViewTransitionHandoff={chatHomeHandoffPending}
|
|
172
|
+
storageKey="chat"
|
|
173
|
+
browserTabId={TAB_ID}
|
|
174
|
+
openOnChatRunning={chatHomeHandoffActive}
|
|
175
|
+
onFullscreenRequest={openAskAgentFullscreen}
|
|
176
|
+
emptyStateText={t("chat.inspectEmptyState")}
|
|
177
|
+
agentPageHref="/agent"
|
|
178
|
+
suggestions={[
|
|
179
|
+
t("chat.inspectSuggestionCapabilities"),
|
|
180
|
+
t("chat.inspectSuggestionHello"),
|
|
181
|
+
t("chat.inspectSuggestionAction"),
|
|
182
|
+
]}
|
|
183
|
+
>
|
|
184
|
+
{contentFrame}
|
|
185
|
+
</AgentSidebar>
|
|
186
|
+
)}
|
|
187
|
+
</div>
|
|
188
|
+
</HeaderActionsProvider>
|
|
189
|
+
);
|
|
190
|
+
}
|