@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
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fragmented-MP4 helpers for the Media Source Extensions player path.
|
|
3
|
+
*
|
|
4
|
+
* The desktop custom recording pipeline live-streams captures as fragmented
|
|
5
|
+
* MP4 (an `ftyp`+`moov` init segment followed by ~1s `moof`/`mdat` fragments,
|
|
6
|
+
* brands `isom iso5 hlsf`). Those files declare no up-front duration
|
|
7
|
+
* (`mvhd duration=0`, no `mehd`), so Chrome's progressive `<video src>`
|
|
8
|
+
* pipeline scans the whole file over the network before firing
|
|
9
|
+
* `loadedmetadata`. We instead drive playback through MSE and supply the
|
|
10
|
+
* duration ourselves. These pure helpers detect that file shape and parse the
|
|
11
|
+
* bits of the init segment MSE needs.
|
|
12
|
+
*
|
|
13
|
+
* Everything here operates on raw bytes so it can be unit-tested without a
|
|
14
|
+
* browser.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Read a 4-char ASCII box type at `offset`. */
|
|
18
|
+
function readType(bytes: Uint8Array, offset: number): string {
|
|
19
|
+
return String.fromCharCode(
|
|
20
|
+
bytes[offset],
|
|
21
|
+
bytes[offset + 1],
|
|
22
|
+
bytes[offset + 2],
|
|
23
|
+
bytes[offset + 3],
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Read a big-endian uint32 at `offset`. */
|
|
28
|
+
function readU32(bytes: Uint8Array, offset: number): number {
|
|
29
|
+
return (
|
|
30
|
+
((bytes[offset] << 24) |
|
|
31
|
+
(bytes[offset + 1] << 16) |
|
|
32
|
+
(bytes[offset + 2] << 8) |
|
|
33
|
+
bytes[offset + 3]) >>>
|
|
34
|
+
0
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Find the first index of an ASCII marker at or after `from`, or -1. */
|
|
39
|
+
export function indexOfAscii(
|
|
40
|
+
bytes: Uint8Array,
|
|
41
|
+
marker: string,
|
|
42
|
+
from = 0,
|
|
43
|
+
): number {
|
|
44
|
+
const len = marker.length;
|
|
45
|
+
const last = bytes.byteLength - len;
|
|
46
|
+
for (let i = Math.max(0, from); i <= last; i++) {
|
|
47
|
+
let match = true;
|
|
48
|
+
for (let j = 0; j < len; j++) {
|
|
49
|
+
if (bytes[i + j] !== marker.charCodeAt(j)) {
|
|
50
|
+
match = false;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (match) return i;
|
|
55
|
+
}
|
|
56
|
+
return -1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface TopLevelBox {
|
|
60
|
+
type: string;
|
|
61
|
+
/** Absolute offset of the box (its size field). */
|
|
62
|
+
start: number;
|
|
63
|
+
/** Total box size in bytes, or 0 when the box runs to the end of input. */
|
|
64
|
+
size: number;
|
|
65
|
+
/** Bytes from `start` to the first byte of box payload. */
|
|
66
|
+
headerSize: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Walk the top-level MP4 boxes contained in `bytes`. Stops when a box header
|
|
71
|
+
* would run past the buffer (i.e. the buffer is a truncated head), returning
|
|
72
|
+
* whatever complete boxes were found.
|
|
73
|
+
*/
|
|
74
|
+
export function readTopLevelBoxes(bytes: Uint8Array): TopLevelBox[] {
|
|
75
|
+
const boxes: TopLevelBox[] = [];
|
|
76
|
+
let offset = 0;
|
|
77
|
+
const total = bytes.byteLength;
|
|
78
|
+
|
|
79
|
+
while (offset + 8 <= total) {
|
|
80
|
+
let size = readU32(bytes, offset);
|
|
81
|
+
let headerSize = 8;
|
|
82
|
+
const type = readType(bytes, offset + 4);
|
|
83
|
+
|
|
84
|
+
if (size === 1) {
|
|
85
|
+
// 64-bit largesize. We only need the low 32 bits in practice (recordings
|
|
86
|
+
// never exceed 4GB), and JS bitwise math is 32-bit, so read the low word.
|
|
87
|
+
if (offset + 16 > total) break;
|
|
88
|
+
headerSize = 16;
|
|
89
|
+
size = readU32(bytes, offset + 12);
|
|
90
|
+
} else if (size === 0) {
|
|
91
|
+
// Box extends to end of file.
|
|
92
|
+
boxes.push({ type, start: offset, size: 0, headerSize });
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (size < headerSize) break;
|
|
97
|
+
boxes.push({ type, start: offset, size, headerSize });
|
|
98
|
+
offset += size;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return boxes;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface ParsedInitSegment {
|
|
105
|
+
/** Length in bytes of the init segment (end of the `moov` box). */
|
|
106
|
+
initLength: number;
|
|
107
|
+
/** `codecs` string for `video/mp4; codecs="..."`. */
|
|
108
|
+
codecs: string;
|
|
109
|
+
hasVideo: boolean;
|
|
110
|
+
hasAudio: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Parse the init segment from the head of a fragmented MP4. `bytes` must
|
|
115
|
+
* contain the whole `ftyp`+`moov` prefix (a few hundred KB is always enough —
|
|
116
|
+
* the init segment carries no per-fragment data). Returns null when `moov` is
|
|
117
|
+
* incomplete or no usable video codec was found.
|
|
118
|
+
*/
|
|
119
|
+
export function parseInitSegment(bytes: Uint8Array): ParsedInitSegment | null {
|
|
120
|
+
const boxes = readTopLevelBoxes(bytes);
|
|
121
|
+
const moov = boxes.find((b) => b.type === "moov");
|
|
122
|
+
if (!moov || moov.size === 0) return null;
|
|
123
|
+
const moovEnd = moov.start + moov.size;
|
|
124
|
+
if (moovEnd > bytes.byteLength) return null; // moov not fully present yet
|
|
125
|
+
|
|
126
|
+
const moovRegion = bytes.subarray(moov.start, moovEnd);
|
|
127
|
+
const videoCodec = parseAvcCodec(moovRegion);
|
|
128
|
+
const hasAudio = indexOfAscii(moovRegion, "mp4a") !== -1;
|
|
129
|
+
const hasVideo = Boolean(videoCodec);
|
|
130
|
+
|
|
131
|
+
if (!hasVideo && !hasAudio) return null;
|
|
132
|
+
|
|
133
|
+
const codecParts: string[] = [];
|
|
134
|
+
if (videoCodec) codecParts.push(videoCodec);
|
|
135
|
+
// Clips fMP4 audio is always AAC-LC 48kHz stereo → mp4a.40.2.
|
|
136
|
+
if (hasAudio) codecParts.push("mp4a.40.2");
|
|
137
|
+
|
|
138
|
+
return {
|
|
139
|
+
initLength: moovEnd,
|
|
140
|
+
codecs: codecParts.join(","),
|
|
141
|
+
hasVideo,
|
|
142
|
+
hasAudio,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function hex2(value: number): string {
|
|
147
|
+
return value.toString(16).padStart(2, "0");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Build the `avc1.PPCCLL` codec string from the `avcC` configuration box within
|
|
152
|
+
* `moovRegion` (PP=profile, CC=profile-compatibility, LL=level). Returns null
|
|
153
|
+
* when no `avcC` box is present.
|
|
154
|
+
*/
|
|
155
|
+
export function parseAvcCodec(moovRegion: Uint8Array): string | null {
|
|
156
|
+
const marker = indexOfAscii(moovRegion, "avcC");
|
|
157
|
+
if (marker === -1) return null;
|
|
158
|
+
// avcC payload: [0] configurationVersion, [1] AVCProfileIndication,
|
|
159
|
+
// [2] profile_compatibility, [3] AVCLevelIndication.
|
|
160
|
+
const config = marker + 4;
|
|
161
|
+
if (config + 4 > moovRegion.byteLength) return null;
|
|
162
|
+
const profile = moovRegion[config + 1];
|
|
163
|
+
const compat = moovRegion[config + 2];
|
|
164
|
+
const level = moovRegion[config + 3];
|
|
165
|
+
return `avc1.${hex2(profile)}${hex2(compat)}${hex2(level)}`;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Find the byte offset (relative to `bytes`) of the first `moof` box start — the
|
|
170
|
+
* fragment boundary MSE must begin an append at. `bytes` is a chunk fetched at
|
|
171
|
+
* an arbitrary byte position, so this scans for the `moof` type marker and
|
|
172
|
+
* backs up 4 bytes to the box size field. Returns -1 when none is found.
|
|
173
|
+
*/
|
|
174
|
+
export function findMoofOffset(bytes: Uint8Array): number {
|
|
175
|
+
let from = 0;
|
|
176
|
+
for (;;) {
|
|
177
|
+
const marker = indexOfAscii(bytes, "moof", from);
|
|
178
|
+
if (marker === -1) return -1;
|
|
179
|
+
const boxStart = marker - 4;
|
|
180
|
+
from = marker + 4;
|
|
181
|
+
if (boxStart < 0) continue;
|
|
182
|
+
|
|
183
|
+
const size = readU32(bytes, boxStart);
|
|
184
|
+
// A moof box is small; a bogus size means we hit the ASCII "moof" inside
|
|
185
|
+
// mdat payload rather than a real box header.
|
|
186
|
+
if (size < 16 || size > 16 * 1024 * 1024) continue;
|
|
187
|
+
|
|
188
|
+
// A real moof always begins with an `mfhd` child box (payload starts at
|
|
189
|
+
// boxStart+8, whose first child type sits at boxStart+12).
|
|
190
|
+
if (boxStart + 16 > bytes.byteLength) continue;
|
|
191
|
+
if (readType(bytes, boxStart + 12) !== "mfhd") continue;
|
|
192
|
+
|
|
193
|
+
// ...and is immediately followed by its `mdat`. Require this when the
|
|
194
|
+
// follower is within the buffer; near the tail we accept the validated moof.
|
|
195
|
+
const nextBox = boxStart + size;
|
|
196
|
+
if (
|
|
197
|
+
nextBox + 8 <= bytes.byteLength &&
|
|
198
|
+
readType(bytes, nextBox + 4) !== "mdat"
|
|
199
|
+
) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return boxStart;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* True when the head of an MP4 shows the fragmented shape: the `hlsf` brand in
|
|
209
|
+
* `ftyp`, or an `mvex` box inside `moov` (present only in fragmented files).
|
|
210
|
+
* `headBytes` should be the first few KB of the file.
|
|
211
|
+
*/
|
|
212
|
+
export function isFragmentedMp4Head(headBytes: Uint8Array): boolean {
|
|
213
|
+
if (headBytes.byteLength < 8) return false;
|
|
214
|
+
// Must look like an MP4 at all.
|
|
215
|
+
if (indexOfAscii(headBytes, "ftyp") !== 4) return false;
|
|
216
|
+
if (indexOfAscii(headBytes, "hlsf") !== -1) return true;
|
|
217
|
+
if (indexOfAscii(headBytes, "mvex") !== -1) return true;
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Cache detection by URL identity so we sniff each asset only once. */
|
|
222
|
+
const detectionCache = new Map<string, Promise<boolean>>();
|
|
223
|
+
|
|
224
|
+
function detectionKey(url: string): string {
|
|
225
|
+
try {
|
|
226
|
+
const base =
|
|
227
|
+
typeof window === "undefined"
|
|
228
|
+
? "http://clips.local"
|
|
229
|
+
: window.location.href;
|
|
230
|
+
const parsed = new URL(url, base);
|
|
231
|
+
// Strip volatile auth/cache-bust params so the same asset shares one entry.
|
|
232
|
+
return `${parsed.origin}${parsed.pathname}`;
|
|
233
|
+
} catch {
|
|
234
|
+
return url;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const SNIFF_BYTES = 4096;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Range-fetch the first few KB of an asset and report whether it is a raw
|
|
242
|
+
* fragmented MP4 that needs the MSE path. Cached per asset; resolves false on
|
|
243
|
+
* any network/parse error so callers fall back to the native `<video src>`.
|
|
244
|
+
*/
|
|
245
|
+
export async function sniffFragmentedMp4(url: string): Promise<boolean> {
|
|
246
|
+
const key = detectionKey(url);
|
|
247
|
+
const cached = detectionCache.get(key);
|
|
248
|
+
if (cached) return cached;
|
|
249
|
+
|
|
250
|
+
const promise = (async () => {
|
|
251
|
+
try {
|
|
252
|
+
const res = await fetch(url, {
|
|
253
|
+
headers: { Range: `bytes=0-${SNIFF_BYTES - 1}` },
|
|
254
|
+
});
|
|
255
|
+
if (!res.ok) return false;
|
|
256
|
+
const head = new Uint8Array(await res.arrayBuffer());
|
|
257
|
+
return isFragmentedMp4Head(head);
|
|
258
|
+
} catch {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
})();
|
|
262
|
+
|
|
263
|
+
detectionCache.set(key, promise);
|
|
264
|
+
// Don't cache a rejected/false-by-error result forever if it was a transient
|
|
265
|
+
// network blip: drop the entry when it resolves false so a later retry can
|
|
266
|
+
// re-sniff, but keep positive detections cached.
|
|
267
|
+
void promise.then((isFrag) => {
|
|
268
|
+
if (!isFrag) detectionCache.delete(key);
|
|
269
|
+
});
|
|
270
|
+
return promise;
|
|
271
|
+
}
|