@agent-native/core 0.100.2 → 0.101.3
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 +83 -0
- package/corpus/core/docs/content/locales/ar-SA/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/ar-SA/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/de-DE/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/de-DE/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/es-ES/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/es-ES/template-plan.mdx +14 -0
- package/corpus/core/docs/content/locales/fr-FR/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/fr-FR/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/hi-IN/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/hi-IN/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/ja-JP/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/ja-JP/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/ko-KR/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/ko-KR/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/pt-BR/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/pt-BR/template-plan.mdx +14 -0
- package/corpus/core/docs/content/locales/zh-CN/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/zh-CN/template-plan.mdx +7 -0
- package/corpus/core/docs/content/locales/zh-TW/pr-visual-recap.mdx +48 -30
- package/corpus/core/docs/content/locales/zh-TW/template-plan.mdx +7 -0
- package/corpus/core/docs/content/pr-visual-recap.mdx +50 -32
- package/corpus/core/docs/content/template-plan.mdx +14 -0
- package/corpus/core/docs/content/toolkit-comments-review.mdx +16 -2
- package/corpus/core/package.json +4 -1
- package/corpus/core/src/a2a/index.ts +2 -1
- package/corpus/core/src/a2a/server.ts +34 -9
- package/corpus/core/src/agent/production-agent.ts +56 -10
- package/corpus/core/src/cli/create.ts +47 -19
- package/corpus/core/src/cli/pr-visual-recap-workflow.ts +2 -3
- package/corpus/core/src/cli/recap.ts +3 -4932
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +6 -4
- package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +7 -1
- package/corpus/core/src/client/AgentPanel.tsx +19 -17
- package/corpus/core/src/client/analytics.ts +8 -1
- package/corpus/core/src/client/chat/markdown-renderer.tsx +54 -8
- package/corpus/core/src/client/chat/message-components.tsx +8 -2
- package/corpus/core/src/client/clipboard.ts +28 -1
- package/corpus/core/src/client/guided-questions.tsx +4 -0
- package/corpus/core/src/client/i18n.tsx +2 -1
- package/corpus/core/src/client/index.ts +4 -0
- package/corpus/core/src/client/review/ReviewCommentComposer.tsx +108 -0
- package/corpus/core/src/client/review/ReviewThreadPanel.tsx +482 -150
- package/corpus/core/src/client/review/index.ts +8 -0
- package/corpus/core/src/client/review/use-review.ts +35 -1
- package/corpus/core/src/client/use-agent-chat-context.ts +3 -2
- package/corpus/core/src/credentials/index.ts +41 -8
- package/corpus/core/src/extensions/fetch-tool.ts +33 -3
- package/corpus/core/src/notifications/channels.ts +20 -6
- package/corpus/core/src/review/actions/create-review-comment.ts +2 -1
- package/corpus/core/src/review/actions/get-review-feedback.ts +6 -11
- package/corpus/core/src/review/actions/list-review-comments.ts +38 -4
- package/corpus/core/src/review/actions/reply-review-comment.ts +33 -22
- package/corpus/core/src/review/actions/resolve-review-thread.ts +29 -2
- package/corpus/core/src/review/actions/send-review-thread-to-agent.ts +62 -0
- package/corpus/core/src/review/identity.ts +101 -0
- package/corpus/core/src/review/index.ts +14 -0
- package/corpus/core/src/review/store.ts +315 -8
- package/corpus/core/src/review/types.ts +4 -0
- package/corpus/core/src/secrets/crypto.ts +26 -10
- package/corpus/core/src/secrets/storage.ts +16 -3
- package/corpus/core/src/server/action-discovery.ts +4 -0
- package/corpus/core/src/server/action-routes.ts +125 -4
- package/corpus/core/src/server/agent-chat/plugin-options.ts +16 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +61 -7
- package/corpus/core/src/server/derived-secret.ts +5 -1
- package/corpus/core/src/server/index.ts +8 -0
- package/corpus/core/src/vite/action-types-plugin.ts +4 -0
- package/corpus/templates/analytics/changelog/2026-07-14-daily-dashboard-email-captures-authenticate-with-a-sessi.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-14-long-running-cross-app-analyses-now-continue-reliably-in-the.md +6 -0
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +156 -3
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +8 -4
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +402 -142
- package/corpus/templates/assets/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/assets/app/i18n-data.ts +1 -0
- package/corpus/templates/assets/app/routes/library.tsx +187 -48
- package/corpus/templates/assets/changelog/2026-07-13-merged-the-candidates-panel-into-the-library-as-a-drafts-tab.md +6 -0
- package/corpus/templates/chat/app/lib/agent-page.tsx +40 -0
- package/corpus/templates/chat/app/routes/agent.tsx +5 -3
- package/corpus/templates/chat/changelog/2026-07-14-fixed-chat-template-startup-with-older-core-versions.md +6 -0
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +5 -0
- package/corpus/templates/clips/AGENTS.md +4 -0
- package/corpus/templates/clips/actions/get-feature-flags.ts +30 -0
- package/corpus/templates/clips/actions/lib/transcript-preview.ts +48 -0
- package/corpus/templates/clips/actions/request-transcript.ts +41 -1
- package/corpus/templates/clips/actions/view-screen.ts +5 -9
- package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +44 -81
- package/corpus/templates/clips/app/components/player/video-player.tsx +39 -1
- package/corpus/templates/clips/app/hooks/use-desktop-promo.ts +6 -12
- package/corpus/templates/clips/app/hooks/use-mse-video-source.ts +146 -0
- package/corpus/templates/clips/app/i18n/ar-SA.ts +0 -8
- package/corpus/templates/clips/app/i18n/de-DE.ts +0 -9
- package/corpus/templates/clips/app/i18n/en-US.ts +0 -8
- package/corpus/templates/clips/app/i18n/es-ES.ts +0 -9
- package/corpus/templates/clips/app/i18n/fr-FR.ts +0 -9
- package/corpus/templates/clips/app/i18n/hi-IN.ts +0 -8
- package/corpus/templates/clips/app/i18n/ja-JP.ts +0 -9
- package/corpus/templates/clips/app/i18n/ko-KR.ts +0 -9
- package/corpus/templates/clips/app/i18n/pt-BR.ts +0 -9
- package/corpus/templates/clips/app/i18n/zh-CN.ts +0 -7
- package/corpus/templates/clips/app/i18n/zh-TW.ts +0 -7
- package/corpus/templates/clips/app/lib/capture-install-options.ts +21 -0
- package/corpus/templates/clips/app/lib/fmp4.ts +271 -0
- package/corpus/templates/clips/app/lib/mse-video-loader.ts +585 -0
- package/corpus/templates/clips/app/routes/_app.dictate.tsx +0 -4
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +5 -13
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +2 -37
- package/corpus/templates/clips/app/routes/download.tsx +3 -2
- package/corpus/templates/clips/changelog/2026-07-10-shared-clips-now-start-playing-instantly-instead-of-showing-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-14-clips-now-distinguishes-transcript-previews-from-incomplete-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-14-desktop-app-prompts-stay-hidden-after-you-download-the-insta.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-14-share-dialogs-show-separate-links-for-people-and-agents.md +6 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +5 -0
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +10 -0
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +2518 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen/live_upload.rs +353 -0
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +558 -67
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +11 -1
- package/corpus/templates/clips/desktop/src-tauri/src/remote_flags.rs +188 -0
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +1 -1
- package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +1 -0
- package/corpus/templates/clips/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +5 -1
- package/corpus/templates/clips/shared/feature-flags.ts +41 -0
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +3 -0
- package/corpus/templates/design/.agents/skills/design-review-feedback/SKILL.md +42 -0
- package/corpus/templates/design/AGENTS.md +6 -0
- package/corpus/templates/design/README.md +1 -0
- package/corpus/templates/design/actions/navigate.ts +4 -4
- package/corpus/templates/design/actions/view-screen.ts +116 -2
- package/corpus/templates/design/agent-native.app-skill.json +5 -0
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +52 -59
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +13 -9
- package/corpus/templates/design/app/components/design/EditPanel.tsx +79 -11
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +78 -65
- package/corpus/templates/design/app/components/design/ReviewCommentsPanel.tsx +161 -0
- package/corpus/templates/design/app/components/design/ReviewStatusControl.tsx +96 -0
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +166 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +1077 -0
- package/corpus/templates/design/app/components/visual-editor/index.ts +1 -0
- package/corpus/templates/design/app/components/visual-editor/review-canvas-state.ts +42 -0
- package/corpus/templates/design/app/hooks/use-design-systems.ts +2 -2
- package/corpus/templates/design/app/hooks/use-navigation-state.ts +9 -6
- package/corpus/templates/design/app/hooks/use-question-flow.ts +7 -1
- package/corpus/templates/design/app/i18n/ar-SA.ts +56 -1
- package/corpus/templates/design/app/i18n/de-DE.ts +57 -1
- package/corpus/templates/design/app/i18n/en-US.ts +56 -1
- package/corpus/templates/design/app/i18n/es-ES.ts +56 -1
- package/corpus/templates/design/app/i18n/fr-FR.ts +57 -1
- package/corpus/templates/design/app/i18n/hi-IN.ts +56 -1
- package/corpus/templates/design/app/i18n/ja-JP.ts +56 -1
- package/corpus/templates/design/app/i18n/ko-KR.ts +56 -1
- package/corpus/templates/design/app/i18n/pt-BR.ts +57 -1
- package/corpus/templates/design/app/i18n/zh-CN.ts +56 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +51 -0
- package/corpus/templates/design/app/pages/Present.tsx +172 -14
- package/corpus/templates/design/app/pages/design-editor/overview-camera.ts +23 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +10 -0
- package/corpus/templates/design/app/pages/present-review-state.ts +18 -0
- package/corpus/templates/design/app/public-routes.ts +8 -0
- package/corpus/templates/design/app/root.tsx +7 -6
- package/corpus/templates/design/changelog/2026-07-13-dragged-design-assets-now-appear-at-the-visible-drop-locatio.md +6 -0
- package/corpus/templates/design/changelog/2026-07-13-reviewers-can-pin-comments-on-shared-designs-and-apply-verif.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +10 -0
- package/corpus/templates/design/server/plugins/auth.ts +7 -5
- package/corpus/templates/design/server/plugins/review.ts +9 -0
- package/corpus/templates/design/shared/review-anchor.ts +83 -0
- package/corpus/templates/design/shared/review-summary.ts +25 -0
- package/corpus/templates/dispatch/changelog/2026-07-14-dispatch-now-distinguishes-connected-agents-from-locally-mou.md +6 -0
- package/corpus/templates/forms/.agents/skills/form-publishing/SKILL.md +2 -0
- package/corpus/templates/forms/AGENTS.md +4 -0
- package/corpus/templates/forms/actions/create-form.ts +2 -1
- package/corpus/templates/forms/actions/update-form.ts +5 -2
- package/corpus/templates/forms/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/forms/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/forms/app/i18n/en-US.ts +3 -0
- package/corpus/templates/forms/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/forms/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/forms/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/forms/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/forms/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/forms/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/forms/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/forms/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +19 -0
- package/corpus/templates/forms/changelog/2026-07-14-fixed-the-ask-forms-loading-input-appearing-above-the-welcom.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-14-form-social-previews-now-show-the-form-title-description-and.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-14-forms-can-email-the-form-owner-when-new-responses-arrive.md +6 -0
- package/corpus/templates/forms/server/handlers/submissions.ts +17 -0
- package/corpus/templates/forms/server/lib/form-og-image.ts +64 -6
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +6 -2
- package/corpus/templates/forms/server/lib/response-email.ts +65 -0
- package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/forms/server/routes/api/forms/og/[...slug]/og.png.get.ts +184 -0
- package/corpus/templates/forms/shared/types.ts +2 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +6 -4
- package/corpus/templates/plan/.agents/skills/visual-recap/SKILL.md +7 -1
- package/dist/a2a/index.d.ts +2 -1
- package/dist/a2a/index.d.ts.map +1 -1
- package/dist/a2a/index.js +1 -1
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/server.d.ts +25 -0
- package/dist/a2a/server.d.ts.map +1 -1
- package/dist/a2a/server.js +30 -6
- package/dist/a2a/server.js.map +1 -1
- package/dist/agent/production-agent.d.ts +2 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +37 -12
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/create.d.ts +5 -3
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +44 -19
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.d.ts +2 -2
- package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
- package/dist/cli/pr-visual-recap-workflow.js +2 -2
- package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
- package/dist/cli/recap.d.ts +3 -562
- package/dist/cli/recap.d.ts.map +1 -1
- package/dist/cli/recap.js +3 -3875
- package/dist/cli/recap.js.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js +6 -4
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
- package/dist/cli/skills-content/visual-recap-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-recap-skill.js +7 -1
- package/dist/cli/skills-content/visual-recap-skill.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +3 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/analytics.d.ts +5 -0
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +3 -1
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/chat/markdown-renderer.d.ts +1 -0
- package/dist/client/chat/markdown-renderer.d.ts.map +1 -1
- package/dist/client/chat/markdown-renderer.js +36 -1
- package/dist/client/chat/markdown-renderer.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +5 -2
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/clipboard.d.ts +3 -1
- package/dist/client/clipboard.d.ts.map +1 -1
- package/dist/client/clipboard.js +24 -1
- package/dist/client/clipboard.js.map +1 -1
- package/dist/client/guided-questions.d.ts +3 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +2 -1
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/i18n.d.ts.map +1 -1
- package/dist/client/i18n.js +3 -1
- package/dist/client/i18n.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/review/ReviewCommentComposer.d.ts +18 -0
- package/dist/client/review/ReviewCommentComposer.d.ts.map +1 -0
- package/dist/client/review/ReviewCommentComposer.js +30 -0
- package/dist/client/review/ReviewCommentComposer.js.map +1 -0
- package/dist/client/review/ReviewThreadPanel.d.ts +28 -1
- package/dist/client/review/ReviewThreadPanel.d.ts.map +1 -1
- package/dist/client/review/ReviewThreadPanel.js +151 -39
- package/dist/client/review/ReviewThreadPanel.js.map +1 -1
- package/dist/client/review/index.d.ts +3 -2
- package/dist/client/review/index.d.ts.map +1 -1
- package/dist/client/review/index.js +2 -1
- package/dist/client/review/index.js.map +1 -1
- package/dist/client/review/use-review.d.ts +23 -0
- package/dist/client/review/use-review.d.ts.map +1 -1
- package/dist/client/review/use-review.js +3 -0
- package/dist/client/review/use-review.js.map +1 -1
- package/dist/client/use-agent-chat-context.d.ts +1 -1
- package/dist/client/use-agent-chat-context.d.ts.map +1 -1
- package/dist/client/use-agent-chat-context.js +4 -2
- package/dist/client/use-agent-chat-context.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 +12 -7
- package/dist/credentials/index.d.ts.map +1 -1
- package/dist/credentials/index.js +33 -8
- package/dist/credentials/index.js.map +1 -1
- package/dist/extensions/fetch-tool.d.ts +13 -1
- package/dist/extensions/fetch-tool.d.ts.map +1 -1
- package/dist/extensions/fetch-tool.js +9 -2
- package/dist/extensions/fetch-tool.js.map +1 -1
- package/dist/notifications/channels.js +20 -4
- package/dist/notifications/channels.js.map +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/review/actions/create-review-comment.js +2 -1
- package/dist/review/actions/create-review-comment.js.map +1 -1
- package/dist/review/actions/get-review-feedback.js +6 -11
- package/dist/review/actions/get-review-feedback.js.map +1 -1
- package/dist/review/actions/list-review-comments.d.ts +1 -0
- package/dist/review/actions/list-review-comments.js +25 -4
- package/dist/review/actions/list-review-comments.js.map +1 -1
- package/dist/review/actions/reply-review-comment.js +12 -5
- package/dist/review/actions/reply-review-comment.js.map +1 -1
- package/dist/review/actions/resolve-review-thread.d.ts +3 -0
- package/dist/review/actions/resolve-review-thread.js +20 -3
- package/dist/review/actions/resolve-review-thread.js.map +1 -1
- package/dist/review/actions/send-review-thread-to-agent.d.ts +17 -0
- package/dist/review/actions/send-review-thread-to-agent.d.ts.map +1 -0
- package/dist/review/actions/send-review-thread-to-agent.js +49 -0
- package/dist/review/actions/send-review-thread-to-agent.js.map +1 -0
- package/dist/review/identity.d.ts +6 -0
- package/dist/review/identity.d.ts.map +1 -0
- package/dist/review/identity.js +68 -0
- package/dist/review/identity.js.map +1 -0
- package/dist/review/index.d.ts +3 -1
- package/dist/review/index.d.ts.map +1 -1
- package/dist/review/index.js +2 -1
- package/dist/review/index.js.map +1 -1
- package/dist/review/store.d.ts +36 -0
- package/dist/review/store.d.ts.map +1 -1
- package/dist/review/store.js +223 -8
- package/dist/review/store.js.map +1 -1
- package/dist/review/types.d.ts +4 -0
- package/dist/review/types.d.ts.map +1 -1
- package/dist/review/types.js.map +1 -1
- package/dist/secrets/crypto.d.ts +15 -7
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +23 -10
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +16 -3
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/action-routes.d.ts +45 -0
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +71 -5
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat/plugin-options.d.ts +16 -0
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -1
- package/dist/server/agent-chat/plugin-options.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +20 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +39 -4
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/derived-secret.d.ts +1 -1
- package/dist/server/derived-secret.d.ts.map +1 -1
- package/dist/server/derived-secret.js.map +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -1
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +4 -0
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/content/locales/ar-SA/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/ar-SA/template-plan.mdx +7 -0
- package/docs/content/locales/de-DE/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/de-DE/template-plan.mdx +7 -0
- package/docs/content/locales/es-ES/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/es-ES/template-plan.mdx +14 -0
- package/docs/content/locales/fr-FR/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/fr-FR/template-plan.mdx +7 -0
- package/docs/content/locales/hi-IN/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/hi-IN/template-plan.mdx +7 -0
- package/docs/content/locales/ja-JP/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/ja-JP/template-plan.mdx +7 -0
- package/docs/content/locales/ko-KR/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/ko-KR/template-plan.mdx +7 -0
- package/docs/content/locales/pt-BR/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/pt-BR/template-plan.mdx +14 -0
- package/docs/content/locales/zh-CN/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/zh-CN/template-plan.mdx +7 -0
- package/docs/content/locales/zh-TW/pr-visual-recap.mdx +48 -30
- package/docs/content/locales/zh-TW/template-plan.mdx +7 -0
- package/docs/content/pr-visual-recap.mdx +50 -32
- package/docs/content/template-plan.mdx +14 -0
- package/docs/content/toolkit-comments-review.mdx +16 -2
- package/package.json +4 -1
- package/corpus/templates/clips/app/components/sharing/slack-share-hint.tsx +0 -68
- package/corpus/templates/forms/server/routes/api/forms/og/[slug]/og.png.get.ts +0 -45
|
@@ -201,10 +201,12 @@ forward only the code-research and plan-composition guidance here.
|
|
|
201
201
|
|
|
202
202
|
## Self-Review Before Handoff
|
|
203
203
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
This adversarial self-review pass is opt-in, not default: run it only for
|
|
205
|
+
high-stakes plans — irreversible migrations, security-sensitive work, or when
|
|
206
|
+
the user explicitly asks for extra rigor — and skip it otherwise. It roughly
|
|
207
|
+
doubles the cost of plan generation, so the default for small, UI-only,
|
|
208
|
+
single-decision, or ordinary plans is to skip it, not to run it. Keep the pass
|
|
209
|
+
cheap and non-blocking when it does run:
|
|
208
210
|
|
|
209
211
|
- **Surface the plan first, review concurrently.** Post the link and let the user
|
|
210
212
|
start reading, then run the review in parallel — never make the user wait on it.
|
|
@@ -133,6 +133,10 @@ Budgets that keep the recap reviewable:
|
|
|
133
133
|
tab; summarize or link the rest of a long file instead of dumping it.
|
|
134
134
|
- Title at most ~70 characters; brief 1-3 sentences.
|
|
135
135
|
|
|
136
|
+
These budgets are also the cost ceiling: do not exceed them in the name of
|
|
137
|
+
thoroughness, and do not re-read the full diff after the initial sequential
|
|
138
|
+
pass — work from the notes taken during that pass.
|
|
139
|
+
|
|
136
140
|
**GOOD.** A 25-file auth change: Before/After wireframes of the login surface,
|
|
137
141
|
a two-paragraph narrative, a diff-aware \`data-model\` of the sessions table, an
|
|
138
142
|
\`api-endpoint\` for the new refresh route, a \`file-tree\` with change flags, and
|
|
@@ -213,7 +217,9 @@ sketchy rough overlay.
|
|
|
213
217
|
When a browser tool is available, render a UI-impact recap in the Plan viewer
|
|
214
218
|
and visually inspect it at the current theme before sharing. If any label,
|
|
215
219
|
annotation, toolbar, or wireframe content overlaps another element, fix the MDX
|
|
216
|
-
and re-import before reporting the link.
|
|
220
|
+
and re-import before reporting the link. Limit this to one render-and-inspect
|
|
221
|
+
pass plus at most one fix-and-re-render; do not keep iterating beyond that
|
|
222
|
+
unless the user explicitly asks. A text-match screenshot is not enough;
|
|
217
223
|
visually inspect the captured image. When no browser is available (for example
|
|
218
224
|
a headless CI agent), state that in the recap handoff instead.
|
|
219
225
|
|
|
@@ -350,28 +350,30 @@ function ChatLoadingSkeleton({
|
|
|
350
350
|
</div>
|
|
351
351
|
</div>
|
|
352
352
|
{composerSlot}
|
|
353
|
-
<div
|
|
354
|
-
className={cn(
|
|
355
|
-
"agent-composer-area shrink-0 px-3 py-2",
|
|
356
|
-
composerLayoutVariant !== "default" &&
|
|
357
|
-
`agent-composer-area--${composerLayoutVariant}`,
|
|
358
|
-
composerAreaClassName,
|
|
359
|
-
)}
|
|
360
|
-
>
|
|
353
|
+
<div className="agent-composer-stack">
|
|
361
354
|
<div
|
|
362
355
|
className={cn(
|
|
363
|
-
"agent-composer-
|
|
356
|
+
"agent-composer-area shrink-0 px-3 py-2",
|
|
364
357
|
composerLayoutVariant !== "default" &&
|
|
365
|
-
`agent-composer-
|
|
358
|
+
`agent-composer-area--${composerLayoutVariant}`,
|
|
359
|
+
composerAreaClassName,
|
|
366
360
|
)}
|
|
367
361
|
>
|
|
368
|
-
<div
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
362
|
+
<div
|
|
363
|
+
className={cn(
|
|
364
|
+
"agent-composer-root flex flex-col rounded-lg border border-input bg-muted/45 transition-colors",
|
|
365
|
+
composerLayoutVariant !== "default" &&
|
|
366
|
+
`agent-composer-root--${composerLayoutVariant}`,
|
|
367
|
+
)}
|
|
368
|
+
>
|
|
369
|
+
<div className="px-3 pt-3">
|
|
370
|
+
<div className="h-5 w-3/5 rounded bg-muted animate-pulse motion-reduce:animate-none" />
|
|
371
|
+
</div>
|
|
372
|
+
<div className="mt-auto flex items-center gap-2 px-3 py-2">
|
|
373
|
+
<div className="h-5 w-5 rounded bg-muted animate-pulse motion-reduce:animate-none" />
|
|
374
|
+
<div className="ml-auto h-4 w-28 rounded bg-muted animate-pulse motion-reduce:animate-none" />
|
|
375
|
+
<div className="h-7 w-7 rounded-md bg-muted animate-pulse motion-reduce:animate-none" />
|
|
376
|
+
</div>
|
|
375
377
|
</div>
|
|
376
378
|
</div>
|
|
377
379
|
</div>
|
|
@@ -96,6 +96,11 @@ export type ConfigureTrackingOptions = {
|
|
|
96
96
|
contentCapture?: boolean;
|
|
97
97
|
/** Resolve content capture synchronously for each browser pathname. */
|
|
98
98
|
contentCaptureForPath?: (pathname: string) => boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Whether tracking may read the authenticated agent-engine status endpoint.
|
|
101
|
+
* Disable this on anonymous/public routes to avoid an expected 401 request.
|
|
102
|
+
*/
|
|
103
|
+
llmConnectionStatus?: boolean;
|
|
99
104
|
sessionReplay?: boolean | SessionReplayOptions;
|
|
100
105
|
/**
|
|
101
106
|
* First-party, Sentry-style error capture. Auto-captures uncaught errors
|
|
@@ -1042,7 +1047,9 @@ export function configureTracking(options: ConfigureTrackingOptions): void {
|
|
|
1042
1047
|
ensureSentry();
|
|
1043
1048
|
ensureAmplitude();
|
|
1044
1049
|
captureFirstTouchAttribution();
|
|
1045
|
-
|
|
1050
|
+
if (options.llmConnectionStatus !== false) {
|
|
1051
|
+
installLlmConnectionRefresh();
|
|
1052
|
+
}
|
|
1046
1053
|
installTrackingAuthSessionRefresh();
|
|
1047
1054
|
installPageviewTracking();
|
|
1048
1055
|
maybeInstallSessionReplay(
|
|
@@ -47,20 +47,30 @@ type ReactMarkdownModule = {
|
|
|
47
47
|
defaultUrlTransform: typeof DefaultUrlTransformType;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
+
type RenderToStaticMarkupFn = (node: React.ReactElement) => string;
|
|
51
|
+
|
|
50
52
|
export let markdownModule: ReactMarkdownModule | null = null;
|
|
51
53
|
export let remarkGfmFn: typeof remarkGfmType | null = null;
|
|
54
|
+
let renderToStaticMarkupFn: RenderToStaticMarkupFn | null = null;
|
|
52
55
|
const markdownListeners = new Set<() => void>();
|
|
53
56
|
|
|
54
57
|
export function loadMarkdown(): void {
|
|
55
58
|
if (markdownModule !== null) return; // already loaded
|
|
56
|
-
Promise.all([
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
Promise.all([
|
|
60
|
+
import("react-markdown"),
|
|
61
|
+
import("remark-gfm"),
|
|
62
|
+
// react-dom/server powers the synchronous markdown→HTML string used for
|
|
63
|
+
// rich clipboard copy; loaded alongside so readiness stays a single gate.
|
|
64
|
+
import("react-dom/server"),
|
|
65
|
+
]).then(([md, gfm, server]) => {
|
|
66
|
+
markdownModule = md as ReactMarkdownModule;
|
|
67
|
+
remarkGfmFn = gfm.default;
|
|
68
|
+
renderToStaticMarkupFn = (
|
|
69
|
+
server as { renderToStaticMarkup: RenderToStaticMarkupFn }
|
|
70
|
+
).renderToStaticMarkup;
|
|
71
|
+
markdownListeners.forEach((fn) => fn());
|
|
72
|
+
markdownListeners.clear();
|
|
73
|
+
});
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
export function onMarkdownReady(fn: () => void): () => void {
|
|
@@ -286,6 +296,42 @@ export const markdownComponents = {
|
|
|
286
296
|
},
|
|
287
297
|
};
|
|
288
298
|
|
|
299
|
+
// ─── Clipboard HTML rendering ─────────────────────────────────────────────────
|
|
300
|
+
// A stripped component set for the `text/html` clipboard flavor: plain <a> and
|
|
301
|
+
// <pre>/<code> with no in-app buttons, iframes, or syntax-highlight markup, so
|
|
302
|
+
// pasted output is portable structure (bold, lists, links, code) rather than
|
|
303
|
+
// app-specific chrome that receiving apps (Slack, Notion) discard anyway.
|
|
304
|
+
|
|
305
|
+
const clipboardMarkdownComponents = {
|
|
306
|
+
a(props: React.AnchorHTMLAttributes<HTMLAnchorElement>) {
|
|
307
|
+
const { href, children } = props;
|
|
308
|
+
if (href === NEW_CHAT_ACTION_HREF || !href) return <span>{children}</span>;
|
|
309
|
+
return <a href={href}>{children}</a>;
|
|
310
|
+
},
|
|
311
|
+
pre(props: React.HTMLAttributes<HTMLPreElement>) {
|
|
312
|
+
return <pre>{props.children}</pre>;
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// Renders joined message markdown to an HTML string for rich clipboard copy.
|
|
317
|
+
// Returns null when the lazy markdown/react-dom-server modules haven't landed
|
|
318
|
+
// yet; callers fall back to plain-text copy in that case.
|
|
319
|
+
export function renderMarkdownToClipboardHtml(markdown: string): string | null {
|
|
320
|
+
const ReactMarkdown = markdownModule?.default;
|
|
321
|
+
const gfm = remarkGfmFn;
|
|
322
|
+
const renderToStaticMarkup = renderToStaticMarkupFn;
|
|
323
|
+
if (!ReactMarkdown || !gfm || !renderToStaticMarkup) return null;
|
|
324
|
+
return renderToStaticMarkup(
|
|
325
|
+
<ReactMarkdown
|
|
326
|
+
remarkPlugins={[gfm]}
|
|
327
|
+
components={clipboardMarkdownComponents}
|
|
328
|
+
urlTransform={markdownUrlTransform}
|
|
329
|
+
>
|
|
330
|
+
{markdown}
|
|
331
|
+
</ReactMarkdown>,
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
289
335
|
// ─── Smooth streaming ─────────────────────────────────────────────────────────
|
|
290
336
|
|
|
291
337
|
function usePrefersReducedMotion(): boolean {
|
|
@@ -64,7 +64,10 @@ import { PastedTextChip } from "../composer/PastedTextChip.js";
|
|
|
64
64
|
import { ThumbsFeedback } from "../observability/ThumbsFeedback.js";
|
|
65
65
|
import type { ContentPart } from "../sse-event-processor.js";
|
|
66
66
|
import { cn } from "../utils.js";
|
|
67
|
-
import {
|
|
67
|
+
import {
|
|
68
|
+
MarkdownText,
|
|
69
|
+
renderMarkdownToClipboardHtml,
|
|
70
|
+
} from "./markdown-renderer.js";
|
|
68
71
|
import {
|
|
69
72
|
ToolCallFallback,
|
|
70
73
|
FilesChangedSummary,
|
|
@@ -526,7 +529,10 @@ export function MessageActionsMenu({
|
|
|
526
529
|
.filter((p) => p.type === "text")
|
|
527
530
|
.map((p) => (p as { text: string }).text)
|
|
528
531
|
.join("\n");
|
|
529
|
-
|
|
532
|
+
// Rich flavor keeps formatting in targets that read text/html (e.g. Slack);
|
|
533
|
+
// null when the markdown renderer isn't ready yet, so we copy plain markdown.
|
|
534
|
+
const html = renderMarkdownToClipboardHtml(text);
|
|
535
|
+
void writeClipboardText(text, html ? { html } : undefined).then((ok) => {
|
|
530
536
|
if (!ok) return;
|
|
531
537
|
setCopied("message");
|
|
532
538
|
setTimeout(() => {
|
|
@@ -39,7 +39,15 @@ function writeWithExecCommand(text: string): boolean {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export async function writeClipboardText(
|
|
42
|
+
export async function writeClipboardText(
|
|
43
|
+
text: string,
|
|
44
|
+
// Optional rich flavor. When provided and the browser supports ClipboardItem,
|
|
45
|
+
// both text/plain (this text) and text/html are written so pasted output keeps
|
|
46
|
+
// formatting in rich targets (Slack) while staying markdown in editors
|
|
47
|
+
// (Notion). The desktop bridge and execCommand fallbacks are plain-text only,
|
|
48
|
+
// so html is ignored there.
|
|
49
|
+
options?: { html?: string },
|
|
50
|
+
): Promise<boolean> {
|
|
43
51
|
for (const desktopClipboard of getDesktopClipboards()) {
|
|
44
52
|
try {
|
|
45
53
|
const result = await desktopClipboard.writeText?.(text);
|
|
@@ -50,6 +58,25 @@ export async function writeClipboardText(text: string): Promise<boolean> {
|
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
|
|
61
|
+
const html = options?.html;
|
|
62
|
+
if (
|
|
63
|
+
html !== undefined &&
|
|
64
|
+
typeof ClipboardItem !== "undefined" &&
|
|
65
|
+
navigator.clipboard.write
|
|
66
|
+
) {
|
|
67
|
+
try {
|
|
68
|
+
await navigator.clipboard.write([
|
|
69
|
+
new ClipboardItem({
|
|
70
|
+
"text/plain": new Blob([text], { type: "text/plain" }),
|
|
71
|
+
"text/html": new Blob([html], { type: "text/html" }),
|
|
72
|
+
}),
|
|
73
|
+
]);
|
|
74
|
+
return true;
|
|
75
|
+
} catch {
|
|
76
|
+
// Fall through to the plain-text paths below.
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
53
80
|
try {
|
|
54
81
|
await navigator.clipboard.writeText(text);
|
|
55
82
|
return true;
|
|
@@ -959,6 +959,8 @@ function normalizeBrowserTabId(browserTabId?: string): string | undefined {
|
|
|
959
959
|
}
|
|
960
960
|
|
|
961
961
|
export interface UseGuidedQuestionFlowOptions {
|
|
962
|
+
/** Disable application-state reads for signed-out or otherwise inactive surfaces. */
|
|
963
|
+
enabled?: boolean;
|
|
962
964
|
stateKey?: string;
|
|
963
965
|
/**
|
|
964
966
|
* The current browser tab id. Agent actions that write the guided-questions
|
|
@@ -980,6 +982,7 @@ export interface UseGuidedQuestionFlowOptions {
|
|
|
980
982
|
}
|
|
981
983
|
|
|
982
984
|
export function useGuidedQuestionFlow({
|
|
985
|
+
enabled = true,
|
|
983
986
|
stateKey = "show-questions",
|
|
984
987
|
browserTabId,
|
|
985
988
|
queryKey = ["show-questions"],
|
|
@@ -1030,6 +1033,7 @@ export function useGuidedQuestionFlow({
|
|
|
1030
1033
|
|
|
1031
1034
|
const { data } = useQuery({
|
|
1032
1035
|
queryKey: resolvedQueryKey,
|
|
1036
|
+
enabled,
|
|
1033
1037
|
queryFn: async () => {
|
|
1034
1038
|
const read = async (key: string) => {
|
|
1035
1039
|
const res = await fetch(endpointFor(key));
|
|
@@ -413,6 +413,7 @@ export function AgentNativeI18nProvider({
|
|
|
413
413
|
}, []);
|
|
414
414
|
|
|
415
415
|
useEffect(() => {
|
|
416
|
+
if (!persistPreference) return;
|
|
416
417
|
void setClientAppState(
|
|
417
418
|
"localization",
|
|
418
419
|
{
|
|
@@ -424,7 +425,7 @@ export function AgentNativeI18nProvider({
|
|
|
424
425
|
).catch(() => {
|
|
425
426
|
// Public/anonymous pages cannot write app-state; localization still works.
|
|
426
427
|
});
|
|
427
|
-
}, [locale, preference]);
|
|
428
|
+
}, [locale, persistPreference, preference]);
|
|
428
429
|
|
|
429
430
|
const setPreference = useCallback(
|
|
430
431
|
async (next: LocalePreference) => {
|
|
@@ -864,6 +864,7 @@ export {
|
|
|
864
864
|
type VersionHistoryPanelProps,
|
|
865
865
|
} from "./history/index.js";
|
|
866
866
|
export {
|
|
867
|
+
ReviewCommentComposer,
|
|
867
868
|
ReviewStatusBadge,
|
|
868
869
|
ReviewThreadPanel,
|
|
869
870
|
buildReviewThreads,
|
|
@@ -874,6 +875,7 @@ export {
|
|
|
874
875
|
useResolveReviewThread,
|
|
875
876
|
useReviewComments,
|
|
876
877
|
useReviewFeedback,
|
|
878
|
+
useSendReviewThreadToAgent,
|
|
877
879
|
useSetReviewStatus,
|
|
878
880
|
type ConsumeReviewFeedbackInput,
|
|
879
881
|
type CreateReviewCommentInput,
|
|
@@ -885,9 +887,11 @@ export {
|
|
|
885
887
|
type ReplyReviewCommentInput,
|
|
886
888
|
type ResolveReviewThreadInput,
|
|
887
889
|
type ReviewStatusBadgeProps,
|
|
890
|
+
type ReviewCommentComposerProps,
|
|
888
891
|
type ReviewThread,
|
|
889
892
|
type ReviewThreadPanelProps,
|
|
890
893
|
type SetReviewStatusInput,
|
|
894
|
+
type SendReviewThreadToAgentInput,
|
|
891
895
|
} from "./review/index.js";
|
|
892
896
|
export type {
|
|
893
897
|
AppToFrameMessage,
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Button } from "@agent-native/toolkit/ui/button";
|
|
2
|
+
import { Spinner } from "@agent-native/toolkit/ui/spinner";
|
|
3
|
+
import { Textarea } from "@agent-native/toolkit/ui/textarea";
|
|
4
|
+
import { IconMessageCircle, IconSend } from "@tabler/icons-react";
|
|
5
|
+
|
|
6
|
+
import type { ReviewResolutionTarget } from "../../review/types.js";
|
|
7
|
+
import { cn } from "../utils.js";
|
|
8
|
+
|
|
9
|
+
export interface ReviewCommentComposerProps {
|
|
10
|
+
value: string;
|
|
11
|
+
onChange: (value: string) => void;
|
|
12
|
+
onSubmit: (resolutionTarget: ReviewResolutionTarget) => void;
|
|
13
|
+
submittingTarget?: ReviewResolutionTarget | null;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
showAgentAction?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
commentLabel?: string;
|
|
18
|
+
agentLabel?: string;
|
|
19
|
+
autoFocus?: boolean;
|
|
20
|
+
submitOnEnter?: boolean;
|
|
21
|
+
onEscape?: () => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function ReviewCommentComposer({
|
|
26
|
+
value,
|
|
27
|
+
onChange,
|
|
28
|
+
onSubmit,
|
|
29
|
+
submittingTarget = null,
|
|
30
|
+
disabled = false,
|
|
31
|
+
showAgentAction = false,
|
|
32
|
+
placeholder = "Add a comment...",
|
|
33
|
+
commentLabel = "Comment",
|
|
34
|
+
agentLabel = "Send to agent",
|
|
35
|
+
autoFocus = false,
|
|
36
|
+
submitOnEnter = false,
|
|
37
|
+
onEscape,
|
|
38
|
+
className,
|
|
39
|
+
}: ReviewCommentComposerProps) {
|
|
40
|
+
const canSubmit = Boolean(value.trim()) && !disabled;
|
|
41
|
+
const submit = (resolutionTarget: ReviewResolutionTarget) => {
|
|
42
|
+
if (!canSubmit) return;
|
|
43
|
+
onSubmit(resolutionTarget);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<form
|
|
48
|
+
className={cn("@container/review", className)}
|
|
49
|
+
onSubmit={(event) => {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
submit("human");
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
<Textarea
|
|
55
|
+
autoFocus={autoFocus}
|
|
56
|
+
value={value}
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
onChange={(event) => onChange(event.currentTarget.value)}
|
|
59
|
+
placeholder={placeholder}
|
|
60
|
+
className="min-h-16 resize-none text-sm"
|
|
61
|
+
onKeyDown={(event) => {
|
|
62
|
+
if (event.key === "Escape" && onEscape) {
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
event.preventDefault();
|
|
65
|
+
onEscape();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (submitOnEnter && event.key === "Enter" && !event.shiftKey) {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
submit("human");
|
|
71
|
+
}
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
<div className="mt-2 flex flex-col items-stretch justify-end gap-2 @2xs/review:flex-row @2xs/review:items-center">
|
|
75
|
+
<Button
|
|
76
|
+
type="submit"
|
|
77
|
+
size="sm"
|
|
78
|
+
disabled={!canSubmit}
|
|
79
|
+
className="h-8 w-full min-w-0 gap-1.5 @2xs/review:w-auto"
|
|
80
|
+
>
|
|
81
|
+
{submittingTarget === "human" ? (
|
|
82
|
+
<Spinner className="size-3.5" />
|
|
83
|
+
) : (
|
|
84
|
+
<IconMessageCircle className="size-3.5" />
|
|
85
|
+
)}
|
|
86
|
+
<span className="truncate">{commentLabel}</span>
|
|
87
|
+
</Button>
|
|
88
|
+
{showAgentAction ? (
|
|
89
|
+
<Button
|
|
90
|
+
type="button"
|
|
91
|
+
size="sm"
|
|
92
|
+
variant="outline"
|
|
93
|
+
disabled={!canSubmit}
|
|
94
|
+
className="h-8 w-full min-w-0 gap-1.5 @2xs/review:w-auto"
|
|
95
|
+
onClick={() => submit("agent")}
|
|
96
|
+
>
|
|
97
|
+
{submittingTarget === "agent" ? (
|
|
98
|
+
<Spinner className="size-3.5" />
|
|
99
|
+
) : (
|
|
100
|
+
<IconSend className="size-3.5" />
|
|
101
|
+
)}
|
|
102
|
+
<span className="truncate">{agentLabel}</span>
|
|
103
|
+
</Button>
|
|
104
|
+
) : null}
|
|
105
|
+
</div>
|
|
106
|
+
</form>
|
|
107
|
+
);
|
|
108
|
+
}
|