@agent-native/core 0.112.0 → 0.113.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 +4 -2
- package/corpus/core/CHANGELOG.md +22 -0
- package/corpus/core/docs/AGENTS.md +7 -0
- package/corpus/core/docs/content/integrations.mdx +63 -2
- package/corpus/core/docs/design/provider-integration-authority.md +117 -0
- package/corpus/core/package.json +6 -1
- package/corpus/core/scripts/materialize-source-corpus.mjs +9 -2
- package/corpus/core/src/cli/atomic-json-file.ts +324 -0
- package/corpus/core/src/cli/claude-code-participant.ts +515 -0
- package/corpus/core/src/cli/code-agent-executor.ts +18 -10
- package/corpus/core/src/cli/code-agent-runs.concurrent-worker.ts +33 -0
- package/corpus/core/src/cli/code-agent-runs.ts +55 -62
- package/corpus/core/src/cli/codex-cli-participant.ts +496 -0
- package/corpus/core/src/cli/multi-frontier-runs.ts +1246 -135
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +7 -404
- package/corpus/core/src/integrations/index.ts +10 -0
- package/corpus/core/src/integrations/slack-oauth.ts +1 -0
- package/corpus/core/src/integrations/webhook-delivery.ts +55 -0
- package/corpus/core/src/notifications/channels.ts +4 -10
- package/corpus/core/src/provider-api/actions/custom-provider-registration.ts +197 -0
- package/corpus/core/src/provider-api/actions/delete-staged-dataset.ts +3 -42
- package/corpus/core/src/provider-api/actions/list-staged-datasets.ts +3 -45
- package/corpus/core/src/provider-api/actions/provider-api-audit.ts +88 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +460 -0
- package/corpus/core/src/provider-api/actions/query-staged-dataset.ts +3 -140
- package/corpus/core/src/provider-api/actions/staged-datasets.ts +359 -0
- package/corpus/core/src/provider-api/gong.ts +108 -0
- package/corpus/core/src/scripts/docs/source-search.ts +2 -1
- package/corpus/core/src/server/google-oauth-credentials.ts +80 -3
- package/corpus/core/src/server/index.ts +6 -0
- package/corpus/core/src/styles/chat-history-list.css +1 -313
- package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/core/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/corpus/core/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/default/AGENTS.md +25 -18
- package/corpus/core/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/headless/AGENTS.md +7 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/AGENTS.md +4 -0
- package/corpus/core/src/templates/workspace-root/AGENTS.md +4 -0
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/analytics/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/analytics/actions/delete-staged-dataset.ts +3 -23
- package/corpus/templates/analytics/actions/list-staged-datasets.ts +3 -27
- package/corpus/templates/analytics/actions/provider-api-catalog.ts +16 -19
- package/corpus/templates/analytics/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/analytics/actions/provider-api-request.ts +162 -185
- package/corpus/templates/analytics/actions/query-staged-dataset.ts +3 -47
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +52 -161
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/assets/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +63 -160
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/brain/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/brain/actions/_schemas.ts +13 -7
- package/corpus/templates/brain/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/brain/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/brain/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/brain/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/brain/actions/provider-api-request.ts +3 -37
- package/corpus/templates/brain/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/brain/actions/update-source.ts +5 -1
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +48 -154
- package/corpus/templates/brain/app/lib/brain.ts +55 -0
- package/corpus/templates/brain/app/lib/ingest-handoff.ts +35 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-can-now-join-configured-public-channels-befo.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-continue-across-the-configured-number-of.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-start-with-a-safe-four-week-window-and-r.md +6 -0
- package/corpus/templates/brain/server/lib/connectors.ts +53 -2
- package/corpus/templates/brain/server/lib/slack-channel-membership.ts +44 -0
- package/corpus/templates/brain/shared/slack-source-config.ts +60 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/calendar/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/calendar/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/calendar/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/calendar/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/calendar/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/calendar/actions/provider-api-request.ts +3 -37
- package/corpus/templates/calendar/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/calendar/server/handlers/gong.ts +6 -61
- package/corpus/templates/calendar/server/handlers/google-auth.ts +10 -8
- package/corpus/templates/calendar/server/lib/google-calendar.ts +7 -45
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/chat/AGENTS.md +5 -2
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/clips/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/clips/AGENTS.md +11 -0
- package/corpus/templates/clips/actions/export-to-brain.ts +505 -171
- package/corpus/templates/clips/changelog/2026-07-19-ready-clips-transcripts-can-be-backfilled-to-brain-for-a-bou.md +6 -0
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +1 -1
- package/corpus/templates/clips/server/lib/google-calendar-client.ts +12 -22
- package/corpus/templates/clips/server/lib/google-calendar-oauth.ts +9 -6
- package/corpus/templates/clips/server/lib/slack-oauth.ts +12 -47
- package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.get.ts +2 -6
- package/corpus/templates/clips/server/routes/api/auth/google-calendar.get.ts +4 -4
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/content/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/content/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/content/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/content/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/content/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/content/actions/provider-api-request.ts +3 -37
- package/corpus/templates/content/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/design/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/design/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/design/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/design/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/design/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/design/actions/provider-api-request.ts +140 -164
- package/corpus/templates/design/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/dispatch/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/dispatch/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/dispatch/actions/list-staged-datasets.ts +4 -30
- package/corpus/templates/dispatch/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/dispatch/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/dispatch/actions/provider-api-request.ts +138 -163
- package/corpus/templates/dispatch/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/forms/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/forms/server/lib/integrations.ts +23 -22
- package/corpus/templates/macros/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/mail/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/mail/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/mail/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/mail/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/mail/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/mail/actions/provider-api-request.ts +146 -173
- package/corpus/templates/mail/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/mail/server/handlers/gong.ts +6 -61
- package/corpus/templates/mail/server/lib/google-auth.ts +10 -13
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/plan/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +47 -156
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/slides/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/slides/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/slides/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/slides/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/slides/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/slides/actions/provider-api-request.ts +145 -172
- package/corpus/templates/slides/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +11 -36
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/templates/tasks/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +125 -0
- package/corpus/toolkit/README.md +60 -0
- package/corpus/toolkit/export-snapshot.json +35 -0
- package/corpus/toolkit/migration-manifest.json +4 -0
- package/corpus/toolkit/package.json +281 -0
- package/corpus/toolkit/scripts/finalize-build.mjs +55 -0
- package/corpus/toolkit/src/app-shell/header-actions.tsx +84 -0
- package/corpus/toolkit/src/app-shell/index.ts +1 -0
- package/corpus/toolkit/src/chat-history/ChatHistoryList.tsx +469 -0
- package/corpus/toolkit/src/chat-history/index.ts +7 -0
- package/corpus/toolkit/src/chat-history.css +314 -0
- package/corpus/toolkit/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/corpus/toolkit/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/corpus/toolkit/src/collab-ui/PresenceBar.tsx +346 -0
- package/corpus/toolkit/src/collab-ui/RecentEditHighlights.tsx +225 -0
- package/corpus/toolkit/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/corpus/toolkit/src/collab-ui/agent-identity.ts +16 -0
- package/corpus/toolkit/src/collab-ui/index.ts +39 -0
- package/corpus/toolkit/src/collab-ui/lead-client.ts +32 -0
- package/corpus/toolkit/src/collab-ui/types.ts +96 -0
- package/corpus/toolkit/src/composer/AgentComposerFrame.tsx +59 -0
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +983 -0
- package/corpus/toolkit/src/composer/MentionPopover.tsx +412 -0
- package/corpus/toolkit/src/composer/PastedTextChip.tsx +150 -0
- package/corpus/toolkit/src/composer/PromptComposer.tsx +718 -0
- package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +856 -0
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +2936 -0
- package/corpus/toolkit/src/composer/VoiceButton.tsx +255 -0
- package/corpus/toolkit/src/composer/asset-picker-url.ts +80 -0
- package/corpus/toolkit/src/composer/attachment-accept.ts +71 -0
- package/corpus/toolkit/src/composer/draft-key.ts +7 -0
- package/corpus/toolkit/src/composer/extensions/FileReference.tsx +55 -0
- package/corpus/toolkit/src/composer/extensions/MentionReference.tsx +93 -0
- package/corpus/toolkit/src/composer/extensions/SkillReference.tsx +56 -0
- package/corpus/toolkit/src/composer/index.ts +79 -0
- package/corpus/toolkit/src/composer/pasted-text.ts +160 -0
- package/corpus/toolkit/src/composer/prompt-attachments.ts +93 -0
- package/corpus/toolkit/src/composer/realtime-voice-audio-level.ts +64 -0
- package/corpus/toolkit/src/composer/realtime-voice-transcript.ts +134 -0
- package/corpus/toolkit/src/composer/runtime-adapters.tsx +343 -0
- package/corpus/toolkit/src/composer/types.ts +66 -0
- package/corpus/toolkit/src/composer/use-file-search.ts +64 -0
- package/corpus/toolkit/src/composer/use-mention-search.ts +90 -0
- package/corpus/toolkit/src/composer/use-skills.ts +45 -0
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +2117 -0
- package/corpus/toolkit/src/composer/useVoiceDictation.ts +1191 -0
- package/corpus/toolkit/src/context-ui/ContextMeter.tsx +101 -0
- package/corpus/toolkit/src/context-ui/ContextSegmentRow.tsx +184 -0
- package/corpus/toolkit/src/context-ui/ContextTreemap.tsx +125 -0
- package/corpus/toolkit/src/context-ui/ContextXRayPanel.tsx +377 -0
- package/corpus/toolkit/src/context-ui/format.ts +42 -0
- package/corpus/toolkit/src/context-ui/index.ts +15 -0
- package/corpus/toolkit/src/context-ui/types.ts +43 -0
- package/corpus/toolkit/src/design-tweaks/index.ts +1 -0
- package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +1084 -0
- package/corpus/toolkit/src/editor/BubbleToolbar.tsx +253 -0
- package/corpus/toolkit/src/editor/CodeBlockNode.tsx +254 -0
- package/corpus/toolkit/src/editor/DragHandle.ts +1437 -0
- package/corpus/toolkit/src/editor/ImageExtension.ts +306 -0
- package/corpus/toolkit/src/editor/RegistryBlockContext.tsx +107 -0
- package/corpus/toolkit/src/editor/RegistryBlockNode.tsx +652 -0
- package/corpus/toolkit/src/editor/RichMarkdownEditor.tsx +81 -0
- package/corpus/toolkit/src/editor/RunId.ts +61 -0
- package/corpus/toolkit/src/editor/SharedRichEditor.tsx +321 -0
- package/corpus/toolkit/src/editor/SlashCommandMenu.tsx +310 -0
- package/corpus/toolkit/src/editor/extensions.ts +402 -0
- package/corpus/toolkit/src/editor/gfmDoc.ts +92 -0
- package/corpus/toolkit/src/editor/index.ts +93 -0
- package/corpus/toolkit/src/editor/registrySlashCommands.ts +131 -0
- package/corpus/toolkit/src/editor/surgical-apply.ts +192 -0
- package/corpus/toolkit/src/editor/useCollabReconcile.ts +589 -0
- package/corpus/toolkit/src/editor.css +510 -0
- package/corpus/toolkit/src/hooks/index.ts +2 -0
- package/corpus/toolkit/src/hooks/use-mobile.tsx +21 -0
- package/corpus/toolkit/src/hooks/use-toast.ts +188 -0
- package/corpus/toolkit/src/index.ts +8 -0
- package/corpus/toolkit/src/onboarding/index.ts +1 -0
- package/corpus/toolkit/src/provider.tsx +47 -0
- package/corpus/toolkit/src/sharing/VisibilityBadge.tsx +37 -0
- package/corpus/toolkit/src/sharing/index.ts +4 -0
- package/corpus/toolkit/src/styles.css +21 -0
- package/corpus/toolkit/src/ui/accordion.tsx +56 -0
- package/corpus/toolkit/src/ui/alert-dialog.tsx +141 -0
- package/corpus/toolkit/src/ui/alert.tsx +59 -0
- package/corpus/toolkit/src/ui/aspect-ratio.tsx +5 -0
- package/corpus/toolkit/src/ui/avatar.tsx +48 -0
- package/corpus/toolkit/src/ui/badge.tsx +37 -0
- package/corpus/toolkit/src/ui/breadcrumb.tsx +115 -0
- package/corpus/toolkit/src/ui/button.tsx +78 -0
- package/corpus/toolkit/src/ui/calendar.tsx +214 -0
- package/corpus/toolkit/src/ui/card.tsx +86 -0
- package/corpus/toolkit/src/ui/carousel.tsx +260 -0
- package/corpus/toolkit/src/ui/chart.tsx +375 -0
- package/corpus/toolkit/src/ui/checkbox.tsx +28 -0
- package/corpus/toolkit/src/ui/collapsible.tsx +9 -0
- package/corpus/toolkit/src/ui/command.tsx +174 -0
- package/corpus/toolkit/src/ui/context-menu.tsx +202 -0
- package/corpus/toolkit/src/ui/date-picker.tsx +64 -0
- package/corpus/toolkit/src/ui/dialog.tsx +146 -0
- package/corpus/toolkit/src/ui/drawer.tsx +126 -0
- package/corpus/toolkit/src/ui/dropdown-menu.tsx +218 -0
- package/corpus/toolkit/src/ui/form.tsx +177 -0
- package/corpus/toolkit/src/ui/hover-card.tsx +27 -0
- package/corpus/toolkit/src/ui/index.ts +52 -0
- package/corpus/toolkit/src/ui/input-otp.tsx +69 -0
- package/corpus/toolkit/src/ui/input.tsx +22 -0
- package/corpus/toolkit/src/ui/label.tsx +24 -0
- package/corpus/toolkit/src/ui/logo.tsx +36 -0
- package/corpus/toolkit/src/ui/menubar.tsx +235 -0
- package/corpus/toolkit/src/ui/navigation-menu.tsx +128 -0
- package/corpus/toolkit/src/ui/pagination.tsx +121 -0
- package/corpus/toolkit/src/ui/popover.tsx +44 -0
- package/corpus/toolkit/src/ui/progress.tsx +26 -0
- package/corpus/toolkit/src/ui/radio-group.tsx +42 -0
- package/corpus/toolkit/src/ui/resizable.tsx +43 -0
- package/corpus/toolkit/src/ui/scroll-area.tsx +46 -0
- package/corpus/toolkit/src/ui/select.tsx +158 -0
- package/corpus/toolkit/src/ui/separator.tsx +29 -0
- package/corpus/toolkit/src/ui/sheet.tsx +160 -0
- package/corpus/toolkit/src/ui/sidebar.tsx +777 -0
- package/corpus/toolkit/src/ui/skeleton.tsx +18 -0
- package/corpus/toolkit/src/ui/slider.tsx +26 -0
- package/corpus/toolkit/src/ui/sonner.tsx +58 -0
- package/corpus/toolkit/src/ui/spinner.tsx +17 -0
- package/corpus/toolkit/src/ui/switch.tsx +27 -0
- package/corpus/toolkit/src/ui/table.tsx +117 -0
- package/corpus/toolkit/src/ui/tabs.tsx +53 -0
- package/corpus/toolkit/src/ui/textarea.tsx +23 -0
- package/corpus/toolkit/src/ui/toast.tsx +127 -0
- package/corpus/toolkit/src/ui/toaster.tsx +33 -0
- package/corpus/toolkit/src/ui/toggle-group.tsx +59 -0
- package/corpus/toolkit/src/ui/toggle.tsx +43 -0
- package/corpus/toolkit/src/ui/tooltip.tsx +53 -0
- package/corpus/toolkit/src/ui/use-toast.ts +3 -0
- package/corpus/toolkit/src/utils.ts +8 -0
- package/corpus/toolkit/tsconfig.json +23 -0
- package/dist/cli/atomic-json-file.d.ts +30 -0
- package/dist/cli/atomic-json-file.d.ts.map +1 -0
- package/dist/cli/atomic-json-file.js +240 -0
- package/dist/cli/atomic-json-file.js.map +1 -0
- package/dist/cli/claude-code-participant.d.ts +77 -0
- package/dist/cli/claude-code-participant.d.ts.map +1 -0
- package/dist/cli/claude-code-participant.js +355 -0
- package/dist/cli/claude-code-participant.js.map +1 -0
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +18 -10
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.concurrent-worker.d.ts +2 -0
- package/dist/cli/code-agent-runs.concurrent-worker.d.ts.map +1 -0
- package/dist/cli/code-agent-runs.concurrent-worker.js +32 -0
- package/dist/cli/code-agent-runs.concurrent-worker.js.map +1 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +43 -56
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/cli/codex-cli-participant.d.ts +77 -0
- package/dist/cli/codex-cli-participant.d.ts.map +1 -0
- package/dist/cli/codex-cli-participant.js +354 -0
- package/dist/cli/codex-cli-participant.js.map +1 -0
- package/dist/cli/multi-frontier-runs.d.ts +115 -0
- package/dist/cli/multi-frontier-runs.d.ts.map +1 -1
- package/dist/cli/multi-frontier-runs.js +831 -113
- package/dist/cli/multi-frontier-runs.js.map +1 -1
- package/dist/client/chat/ChatHistoryList.d.ts +1 -87
- package/dist/client/chat/ChatHistoryList.d.ts.map +1 -1
- package/dist/client/chat/ChatHistoryList.js +1 -82
- package/dist/client/chat/ChatHistoryList.js.map +1 -1
- package/dist/integrations/index.d.ts +2 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +2 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/slack-manifest.d.ts +1 -1
- package/dist/integrations/slack-oauth.d.ts +1 -1
- package/dist/integrations/slack-oauth.d.ts.map +1 -1
- package/dist/integrations/slack-oauth.js +1 -0
- package/dist/integrations/slack-oauth.js.map +1 -1
- package/dist/integrations/webhook-delivery.d.ts +23 -0
- package/dist/integrations/webhook-delivery.d.ts.map +1 -0
- package/dist/integrations/webhook-delivery.js +32 -0
- package/dist/integrations/webhook-delivery.js.map +1 -0
- package/dist/notifications/channels.d.ts.map +1 -1
- package/dist/notifications/channels.js +4 -9
- package/dist/notifications/channels.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +136 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts.map +1 -0
- package/dist/provider-api/actions/custom-provider-registration.js +154 -0
- package/dist/provider-api/actions/custom-provider-registration.js.map +1 -0
- package/dist/provider-api/actions/delete-staged-dataset.d.ts +1 -1
- package/dist/provider-api/actions/delete-staged-dataset.d.ts.map +1 -1
- package/dist/provider-api/actions/delete-staged-dataset.js +3 -34
- package/dist/provider-api/actions/delete-staged-dataset.js.map +1 -1
- package/dist/provider-api/actions/list-staged-datasets.d.ts +2 -3
- package/dist/provider-api/actions/list-staged-datasets.d.ts.map +1 -1
- package/dist/provider-api/actions/list-staged-datasets.js +3 -40
- package/dist/provider-api/actions/list-staged-datasets.js.map +1 -1
- package/dist/provider-api/actions/provider-api-audit.d.ts +7 -0
- package/dist/provider-api/actions/provider-api-audit.d.ts.map +1 -0
- package/dist/provider-api/actions/provider-api-audit.js +74 -0
- package/dist/provider-api/actions/provider-api-audit.js.map +1 -0
- package/dist/provider-api/actions/provider-api.d.ts +370 -0
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -0
- package/dist/provider-api/actions/provider-api.js +280 -0
- package/dist/provider-api/actions/provider-api.js.map +1 -0
- package/dist/provider-api/actions/query-staged-dataset.d.ts +1 -1
- package/dist/provider-api/actions/query-staged-dataset.d.ts.map +1 -1
- package/dist/provider-api/actions/query-staged-dataset.js +3 -116
- package/dist/provider-api/actions/query-staged-dataset.js.map +1 -1
- package/dist/provider-api/actions/staged-datasets.d.ts +190 -0
- package/dist/provider-api/actions/staged-datasets.d.ts.map +1 -0
- package/dist/provider-api/actions/staged-datasets.js +210 -0
- package/dist/provider-api/actions/staged-datasets.js.map +1 -0
- package/dist/provider-api/gong.d.ts +44 -0
- package/dist/provider-api/gong.d.ts.map +1 -0
- package/dist/provider-api/gong.js +56 -0
- package/dist/provider-api/gong.js.map +1 -0
- package/dist/scripts/docs/source-search.d.ts +2 -1
- package/dist/scripts/docs/source-search.d.ts.map +1 -1
- package/dist/scripts/docs/source-search.js +2 -1
- package/dist/scripts/docs/source-search.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/google-oauth-credentials.d.ts +35 -0
- package/dist/server/google-oauth-credentials.d.ts.map +1 -1
- package/dist/server/google-oauth-credentials.js +48 -2
- package/dist/server/google-oauth-credentials.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 +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/styles/chat-history-list.css +1 -313
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/chat/AGENTS.md +5 -2
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/dist/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/dist/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/dist/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/default/AGENTS.md +25 -18
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/dist/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/headless/AGENTS.md +7 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/workspace-core/AGENTS.md +4 -0
- package/dist/templates/workspace-root/AGENTS.md +4 -0
- package/docs/AGENTS.md +7 -0
- package/docs/content/integrations.mdx +63 -2
- package/docs/design/provider-integration-authority.md +117 -0
- package/package.json +7 -2
- package/src/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/chat/AGENTS.md +5 -2
- package/src/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/default/AGENTS.md +25 -18
- package/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/headless/AGENTS.md +7 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/workspace-core/AGENTS.md +4 -0
- package/src/templates/workspace-root/AGENTS.md +4 -0
|
@@ -1,404 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "@tabler/icons-react";
|
|
9
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
10
|
-
|
|
11
|
-
import { cn } from "../utils.js";
|
|
12
|
-
|
|
13
|
-
/** A single row in a chat history list. Purely data — no fetching, no
|
|
14
|
-
* assistant-ui context. Formatting (relative time, "Active"/"Open" labels,
|
|
15
|
-
* status spinners) is the caller's responsibility; hand in the already
|
|
16
|
-
* rendered node via `timestamp`. */
|
|
17
|
-
export interface ChatHistoryItem {
|
|
18
|
-
id: string;
|
|
19
|
-
title: React.ReactNode;
|
|
20
|
-
/** Plain-text form of `title`, used to seed the inline rename input.
|
|
21
|
-
* Only needed when `onRename` is supplied. */
|
|
22
|
-
titleText?: string;
|
|
23
|
-
/** Secondary line — e.g. a message preview. */
|
|
24
|
-
subtitle?: React.ReactNode;
|
|
25
|
-
/** Tertiary line — e.g. a scope/folder label. */
|
|
26
|
-
detail?: React.ReactNode;
|
|
27
|
-
/** Pre-formatted trailing value: a relative time, "Active"/"Open", or a
|
|
28
|
-
* status node (spinner, unread dot). This component does not format
|
|
29
|
-
* dates or compute status itself. */
|
|
30
|
-
timestamp?: React.ReactNode;
|
|
31
|
-
pinned?: boolean;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface ChatHistorySection {
|
|
36
|
-
id: string;
|
|
37
|
-
label?: React.ReactNode;
|
|
38
|
-
items: ChatHistoryItem[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ChatHistoryListProps {
|
|
42
|
-
/** Flat item list. Ignored when `sections` is provided. */
|
|
43
|
-
items?: ChatHistoryItem[];
|
|
44
|
-
/** Grouped item list (e.g. "This deck" / "All chats", or pinned/recent). */
|
|
45
|
-
sections?: ChatHistorySection[];
|
|
46
|
-
/** Id of the currently active/selected item — highlighted in the list. */
|
|
47
|
-
activeId?: string | null;
|
|
48
|
-
onSelect: (id: string) => void;
|
|
49
|
-
/** Fired on double-click / explicit "open" gesture, distinct from select. */
|
|
50
|
-
onOpen?: (id: string) => void;
|
|
51
|
-
/** Presence enables the pin/unpin row action. */
|
|
52
|
-
onTogglePin?: (id: string) => void;
|
|
53
|
-
/** Presence enables the inline "Rename" row action. */
|
|
54
|
-
onRename?: (id: string, nextTitle: string) => void;
|
|
55
|
-
/** Presence enables the "Delete" row action. */
|
|
56
|
-
onDelete?: (id: string) => void;
|
|
57
|
-
/** Escape hatch: fully custom row action menu content, replacing the
|
|
58
|
-
* built-in rename/pin/delete items. Still gated by the trigger button,
|
|
59
|
-
* which shows whenever this or any of the on* callbacks above is set. */
|
|
60
|
-
renderRowActions?: (item: ChatHistoryItem) => React.ReactNode;
|
|
61
|
-
|
|
62
|
-
/** Controlled search input. Omit `onSearchChange` to hide the search box
|
|
63
|
-
* entirely and let the host render its own (results are always supplied
|
|
64
|
-
* by the caller via `items`/`sections` either way). */
|
|
65
|
-
searchValue?: string;
|
|
66
|
-
onSearchChange?: (value: string) => void;
|
|
67
|
-
searchPlaceholder?: string;
|
|
68
|
-
searchInputRef?: React.Ref<HTMLInputElement>;
|
|
69
|
-
|
|
70
|
-
/** True while results are being fetched — shows `loadingLabel` instead of
|
|
71
|
-
* the list. */
|
|
72
|
-
loading?: boolean;
|
|
73
|
-
loadingLabel?: React.ReactNode;
|
|
74
|
-
/** Shown instead of the list when set (takes priority over `loading`). */
|
|
75
|
-
error?: React.ReactNode;
|
|
76
|
-
emptyLabel?: React.ReactNode;
|
|
77
|
-
/** Shown instead of `emptyLabel` when `searchValue` is non-empty. */
|
|
78
|
-
emptySearchLabel?: React.ReactNode;
|
|
79
|
-
|
|
80
|
-
/** Rendered after the list, inside the scroll container (e.g. a
|
|
81
|
-
* "Load older chats" button). */
|
|
82
|
-
footer?: React.ReactNode;
|
|
83
|
-
|
|
84
|
-
/** "popover" (default) matches core's compact HistoryPopover list.
|
|
85
|
-
* "rail" is a denser variant with a solid active background, closer to
|
|
86
|
-
* a sidebar run rail. */
|
|
87
|
-
variant?: "popover" | "rail";
|
|
88
|
-
className?: string;
|
|
89
|
-
listClassName?: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Presentational chat history list shared by core's `HistoryPopover`
|
|
94
|
-
* (MultiTabAssistantChat.tsx) and Agent-Native Code's run rail
|
|
95
|
-
* (code-agents-ui). Styling is driven by stable `an-chat-history*` class
|
|
96
|
-
* names (see `styles/chat-history-list.css`) rather than Tailwind utilities
|
|
97
|
-
* so the same component renders correctly in a Tailwind host and in
|
|
98
|
-
* code-agents-ui's plain-CSS host.
|
|
99
|
-
*
|
|
100
|
-
* This component owns no data: search filtering, pin/rename persistence,
|
|
101
|
-
* and time formatting all stay with the caller. It only renders whatever
|
|
102
|
-
* `items`/`sections` it is given, plus the optional search box and
|
|
103
|
-
* loading/empty/error states.
|
|
104
|
-
*/
|
|
105
|
-
export function ChatHistoryList({
|
|
106
|
-
items,
|
|
107
|
-
sections,
|
|
108
|
-
activeId = null,
|
|
109
|
-
onSelect,
|
|
110
|
-
onOpen,
|
|
111
|
-
onTogglePin,
|
|
112
|
-
onRename,
|
|
113
|
-
onDelete,
|
|
114
|
-
renderRowActions,
|
|
115
|
-
searchValue,
|
|
116
|
-
onSearchChange,
|
|
117
|
-
searchPlaceholder = "Search chats...",
|
|
118
|
-
searchInputRef,
|
|
119
|
-
loading = false,
|
|
120
|
-
loadingLabel = "Searching...",
|
|
121
|
-
error,
|
|
122
|
-
emptyLabel = "No chats yet",
|
|
123
|
-
emptySearchLabel = "No matching chats",
|
|
124
|
-
footer,
|
|
125
|
-
variant = "popover",
|
|
126
|
-
className,
|
|
127
|
-
listClassName,
|
|
128
|
-
}: ChatHistoryListProps) {
|
|
129
|
-
const resolvedSections: ChatHistorySection[] =
|
|
130
|
-
sections ?? (items ? [{ id: "default", items }] : []);
|
|
131
|
-
const totalCount = resolvedSections.reduce(
|
|
132
|
-
(sum, section) => sum + section.items.length,
|
|
133
|
-
0,
|
|
134
|
-
);
|
|
135
|
-
const hasSearchValue = Boolean(searchValue?.trim());
|
|
136
|
-
|
|
137
|
-
return (
|
|
138
|
-
<div
|
|
139
|
-
className={cn(
|
|
140
|
-
"an-chat-history",
|
|
141
|
-
variant === "rail" && "an-chat-history--rail",
|
|
142
|
-
className,
|
|
143
|
-
)}
|
|
144
|
-
data-agent-native="chat-history-list"
|
|
145
|
-
>
|
|
146
|
-
{onSearchChange && (
|
|
147
|
-
<div className="an-chat-history__search">
|
|
148
|
-
<IconSearch size={13} className="an-chat-history__search-icon" />
|
|
149
|
-
<input
|
|
150
|
-
ref={searchInputRef}
|
|
151
|
-
type="text"
|
|
152
|
-
value={searchValue ?? ""}
|
|
153
|
-
onChange={(event) => onSearchChange(event.target.value)}
|
|
154
|
-
placeholder={searchPlaceholder}
|
|
155
|
-
aria-label={searchPlaceholder}
|
|
156
|
-
className="an-chat-history__search-input"
|
|
157
|
-
/>
|
|
158
|
-
</div>
|
|
159
|
-
)}
|
|
160
|
-
<div className={cn("an-chat-history__list", listClassName)}>
|
|
161
|
-
{error ? (
|
|
162
|
-
<div className="an-chat-history__state an-chat-history__state--error">
|
|
163
|
-
{error}
|
|
164
|
-
</div>
|
|
165
|
-
) : loading ? (
|
|
166
|
-
<div className="an-chat-history__state">{loadingLabel}</div>
|
|
167
|
-
) : totalCount === 0 ? (
|
|
168
|
-
<div className="an-chat-history__state">
|
|
169
|
-
{hasSearchValue ? emptySearchLabel : emptyLabel}
|
|
170
|
-
</div>
|
|
171
|
-
) : (
|
|
172
|
-
resolvedSections.map(
|
|
173
|
-
(section) =>
|
|
174
|
-
section.items.length > 0 && (
|
|
175
|
-
<div key={section.id} className="an-chat-history__section">
|
|
176
|
-
{section.label && (
|
|
177
|
-
<div className="an-chat-history__section-label">
|
|
178
|
-
{section.label}
|
|
179
|
-
</div>
|
|
180
|
-
)}
|
|
181
|
-
{section.items.map((item) => (
|
|
182
|
-
<ChatHistoryRow
|
|
183
|
-
key={item.id}
|
|
184
|
-
item={item}
|
|
185
|
-
active={item.id === activeId}
|
|
186
|
-
onSelect={onSelect}
|
|
187
|
-
onOpen={onOpen}
|
|
188
|
-
onTogglePin={onTogglePin}
|
|
189
|
-
onRename={onRename}
|
|
190
|
-
onDelete={onDelete}
|
|
191
|
-
renderRowActions={renderRowActions}
|
|
192
|
-
/>
|
|
193
|
-
))}
|
|
194
|
-
</div>
|
|
195
|
-
),
|
|
196
|
-
)
|
|
197
|
-
)}
|
|
198
|
-
{footer}
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function ChatHistoryRow({
|
|
205
|
-
item,
|
|
206
|
-
active,
|
|
207
|
-
onSelect,
|
|
208
|
-
onOpen,
|
|
209
|
-
onTogglePin,
|
|
210
|
-
onRename,
|
|
211
|
-
onDelete,
|
|
212
|
-
renderRowActions,
|
|
213
|
-
}: {
|
|
214
|
-
item: ChatHistoryItem;
|
|
215
|
-
active: boolean;
|
|
216
|
-
onSelect: (id: string) => void;
|
|
217
|
-
onOpen?: (id: string) => void;
|
|
218
|
-
onTogglePin?: (id: string) => void;
|
|
219
|
-
onRename?: (id: string, nextTitle: string) => void;
|
|
220
|
-
onDelete?: (id: string) => void;
|
|
221
|
-
renderRowActions?: (item: ChatHistoryItem) => React.ReactNode;
|
|
222
|
-
}) {
|
|
223
|
-
const [isRenaming, setIsRenaming] = useState(false);
|
|
224
|
-
const [draftTitle, setDraftTitle] = useState("");
|
|
225
|
-
const [menuOpen, setMenuOpen] = useState(false);
|
|
226
|
-
const renameInputRef = useRef<HTMLInputElement | null>(null);
|
|
227
|
-
const menuRef = useRef<HTMLDivElement | null>(null);
|
|
228
|
-
|
|
229
|
-
const hasMenu = Boolean(
|
|
230
|
-
onTogglePin || onRename || onDelete || renderRowActions,
|
|
231
|
-
);
|
|
232
|
-
|
|
233
|
-
useEffect(() => {
|
|
234
|
-
if (!menuOpen) return;
|
|
235
|
-
function handlePointerDown(event: PointerEvent) {
|
|
236
|
-
if (menuRef.current && !menuRef.current.contains(event.target as Node)) {
|
|
237
|
-
setMenuOpen(false);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
function handleKeyDown(event: KeyboardEvent) {
|
|
241
|
-
if (event.key === "Escape") setMenuOpen(false);
|
|
242
|
-
}
|
|
243
|
-
document.addEventListener("pointerdown", handlePointerDown);
|
|
244
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
245
|
-
return () => {
|
|
246
|
-
document.removeEventListener("pointerdown", handlePointerDown);
|
|
247
|
-
document.removeEventListener("keydown", handleKeyDown);
|
|
248
|
-
};
|
|
249
|
-
}, [menuOpen]);
|
|
250
|
-
|
|
251
|
-
function startRename() {
|
|
252
|
-
setDraftTitle(item.titleText ?? "");
|
|
253
|
-
setIsRenaming(true);
|
|
254
|
-
setMenuOpen(false);
|
|
255
|
-
window.requestAnimationFrame(() => {
|
|
256
|
-
renameInputRef.current?.select();
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function commitRename() {
|
|
261
|
-
const trimmed = draftTitle.trim();
|
|
262
|
-
setIsRenaming(false);
|
|
263
|
-
if (trimmed && trimmed !== item.titleText) {
|
|
264
|
-
onRename?.(item.id, trimmed);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function handleRenameKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {
|
|
269
|
-
if (event.key === "Enter") {
|
|
270
|
-
event.preventDefault();
|
|
271
|
-
commitRename();
|
|
272
|
-
} else if (event.key === "Escape") {
|
|
273
|
-
event.preventDefault();
|
|
274
|
-
setIsRenaming(false);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return (
|
|
279
|
-
<div
|
|
280
|
-
className={cn(
|
|
281
|
-
"an-chat-history-row",
|
|
282
|
-
active && "an-chat-history-row--active",
|
|
283
|
-
item.pinned && "an-chat-history-row--pinned",
|
|
284
|
-
isRenaming && "an-chat-history-row--renaming",
|
|
285
|
-
item.disabled && "an-chat-history-row--disabled",
|
|
286
|
-
)}
|
|
287
|
-
>
|
|
288
|
-
{isRenaming ? (
|
|
289
|
-
<div className="an-chat-history-row__rename">
|
|
290
|
-
<input
|
|
291
|
-
ref={renameInputRef}
|
|
292
|
-
className="an-chat-history-row__rename-input"
|
|
293
|
-
value={draftTitle}
|
|
294
|
-
onChange={(event) => setDraftTitle(event.target.value)}
|
|
295
|
-
onKeyDown={handleRenameKeyDown}
|
|
296
|
-
onBlur={commitRename}
|
|
297
|
-
autoFocus
|
|
298
|
-
aria-label="Rename chat"
|
|
299
|
-
/>
|
|
300
|
-
</div>
|
|
301
|
-
) : (
|
|
302
|
-
<button
|
|
303
|
-
type="button"
|
|
304
|
-
className="an-chat-history-row__button"
|
|
305
|
-
onClick={() => !item.disabled && onSelect(item.id)}
|
|
306
|
-
onDoubleClick={() => !item.disabled && onOpen?.(item.id)}
|
|
307
|
-
disabled={item.disabled}
|
|
308
|
-
>
|
|
309
|
-
<div className="an-chat-history-row__topline">
|
|
310
|
-
<span className="an-chat-history-row__title">{item.title}</span>
|
|
311
|
-
{item.timestamp != null && (
|
|
312
|
-
<span className="an-chat-history-row__timestamp">
|
|
313
|
-
{item.timestamp}
|
|
314
|
-
</span>
|
|
315
|
-
)}
|
|
316
|
-
</div>
|
|
317
|
-
{item.subtitle != null && (
|
|
318
|
-
<div className="an-chat-history-row__subtitle">{item.subtitle}</div>
|
|
319
|
-
)}
|
|
320
|
-
{item.detail != null && (
|
|
321
|
-
<div className="an-chat-history-row__detail">{item.detail}</div>
|
|
322
|
-
)}
|
|
323
|
-
</button>
|
|
324
|
-
)}
|
|
325
|
-
|
|
326
|
-
{!isRenaming && hasMenu && (
|
|
327
|
-
<div className="an-chat-history-row__menu" ref={menuRef}>
|
|
328
|
-
<button
|
|
329
|
-
type="button"
|
|
330
|
-
className={cn(
|
|
331
|
-
"an-chat-history-row__menu-trigger",
|
|
332
|
-
item.pinned && "an-chat-history-row__menu-trigger--pinned",
|
|
333
|
-
)}
|
|
334
|
-
aria-label="Chat options"
|
|
335
|
-
aria-haspopup="menu"
|
|
336
|
-
aria-expanded={menuOpen}
|
|
337
|
-
onClick={() => setMenuOpen((open) => !open)}
|
|
338
|
-
>
|
|
339
|
-
{item.pinned ? (
|
|
340
|
-
<IconPinned size={13} strokeWidth={1.8} />
|
|
341
|
-
) : (
|
|
342
|
-
<IconDots size={14} strokeWidth={1.8} />
|
|
343
|
-
)}
|
|
344
|
-
</button>
|
|
345
|
-
{menuOpen && (
|
|
346
|
-
<div className="an-chat-history-row__menu-content" role="menu">
|
|
347
|
-
{renderRowActions ? (
|
|
348
|
-
renderRowActions(item)
|
|
349
|
-
) : (
|
|
350
|
-
<>
|
|
351
|
-
{onRename && (
|
|
352
|
-
<button
|
|
353
|
-
type="button"
|
|
354
|
-
role="menuitem"
|
|
355
|
-
className="an-chat-history-row__menu-item"
|
|
356
|
-
onClick={startRename}
|
|
357
|
-
>
|
|
358
|
-
<IconPencil size={13} strokeWidth={1.8} />
|
|
359
|
-
<span>Rename</span>
|
|
360
|
-
</button>
|
|
361
|
-
)}
|
|
362
|
-
{onTogglePin && (
|
|
363
|
-
<button
|
|
364
|
-
type="button"
|
|
365
|
-
role="menuitem"
|
|
366
|
-
className="an-chat-history-row__menu-item"
|
|
367
|
-
onClick={() => {
|
|
368
|
-
setMenuOpen(false);
|
|
369
|
-
onTogglePin(item.id);
|
|
370
|
-
}}
|
|
371
|
-
>
|
|
372
|
-
{item.pinned ? (
|
|
373
|
-
<IconPinnedOff size={13} strokeWidth={1.8} />
|
|
374
|
-
) : (
|
|
375
|
-
<IconPinned size={13} strokeWidth={1.8} />
|
|
376
|
-
)}
|
|
377
|
-
<span>
|
|
378
|
-
{item.pinned ? "Unpin from top" : "Pin to top"}
|
|
379
|
-
</span>
|
|
380
|
-
</button>
|
|
381
|
-
)}
|
|
382
|
-
{onDelete && (
|
|
383
|
-
<button
|
|
384
|
-
type="button"
|
|
385
|
-
role="menuitem"
|
|
386
|
-
className="an-chat-history-row__menu-item an-chat-history-row__menu-item--danger"
|
|
387
|
-
onClick={() => {
|
|
388
|
-
setMenuOpen(false);
|
|
389
|
-
onDelete(item.id);
|
|
390
|
-
}}
|
|
391
|
-
>
|
|
392
|
-
<IconTrash size={13} strokeWidth={1.8} />
|
|
393
|
-
<span>Delete</span>
|
|
394
|
-
</button>
|
|
395
|
-
)}
|
|
396
|
-
</>
|
|
397
|
-
)}
|
|
398
|
-
</div>
|
|
399
|
-
)}
|
|
400
|
-
</div>
|
|
401
|
-
)}
|
|
402
|
-
</div>
|
|
403
|
-
);
|
|
404
|
-
}
|
|
1
|
+
export {
|
|
2
|
+
ChatHistoryList,
|
|
3
|
+
type ChatHistoryItem,
|
|
4
|
+
type ChatHistoryListLabels,
|
|
5
|
+
type ChatHistoryListProps,
|
|
6
|
+
type ChatHistorySection,
|
|
7
|
+
} from "@agent-native/toolkit/chat-history";
|
|
@@ -18,6 +18,13 @@ export type {
|
|
|
18
18
|
PlatformDeliveryReceipt,
|
|
19
19
|
} from "./types.js";
|
|
20
20
|
export { assertPlatformCapability } from "./types.js";
|
|
21
|
+
export {
|
|
22
|
+
deliverJsonWebhook,
|
|
23
|
+
escapeSlackMrkdwn,
|
|
24
|
+
isWebhookUrlAllowed,
|
|
25
|
+
type DeliverJsonWebhookOptions,
|
|
26
|
+
type JsonWebhookDeliveryResult,
|
|
27
|
+
} from "./webhook-delivery.js";
|
|
21
28
|
|
|
22
29
|
export { resolveDefaultIntegrationExecutionContext } from "./identity.js";
|
|
23
30
|
export {
|
|
@@ -150,6 +157,8 @@ export type {
|
|
|
150
157
|
} from "./installations-store.js";
|
|
151
158
|
|
|
152
159
|
export {
|
|
160
|
+
SLACK_AUTHORIZE_URL,
|
|
161
|
+
SLACK_TOKEN_URL,
|
|
153
162
|
assertSlackInstallAccess,
|
|
154
163
|
buildSlackAuthorizeUrl,
|
|
155
164
|
exchangeSlackOAuthCode,
|
|
@@ -157,6 +166,7 @@ export {
|
|
|
157
166
|
slackInstallationKey,
|
|
158
167
|
slackOAuthResponseToInstallation,
|
|
159
168
|
testSlackAuth,
|
|
169
|
+
type SlackOAuthAccessResponse,
|
|
160
170
|
} from "./slack-oauth.js";
|
|
161
171
|
|
|
162
172
|
export {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isBlockedExtensionUrl,
|
|
3
|
+
ssrfSafeFetch,
|
|
4
|
+
} from "../extensions/url-safety.js";
|
|
5
|
+
|
|
6
|
+
export function escapeSlackMrkdwn(value: string): string {
|
|
7
|
+
return value
|
|
8
|
+
.replace(/&/g, "&")
|
|
9
|
+
.replace(/</g, "<")
|
|
10
|
+
.replace(/>/g, ">");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isWebhookUrlAllowed(url: string): boolean {
|
|
14
|
+
return !isBlockedExtensionUrl(url);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface DeliverJsonWebhookOptions {
|
|
18
|
+
url: string;
|
|
19
|
+
payload: unknown;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
maxRedirects?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type JsonWebhookDeliveryResult =
|
|
26
|
+
| { ok: true; status: number }
|
|
27
|
+
| { ok: false; blocked: true }
|
|
28
|
+
| { ok: false; blocked: false; status?: number; error?: unknown };
|
|
29
|
+
|
|
30
|
+
export async function deliverJsonWebhook(
|
|
31
|
+
options: DeliverJsonWebhookOptions,
|
|
32
|
+
): Promise<JsonWebhookDeliveryResult> {
|
|
33
|
+
if (!isWebhookUrlAllowed(options.url)) return { ok: false, blocked: true };
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
const response = await ssrfSafeFetch(
|
|
37
|
+
options.url,
|
|
38
|
+
{
|
|
39
|
+
method: "POST",
|
|
40
|
+
headers: {
|
|
41
|
+
"Content-Type": "application/json",
|
|
42
|
+
...options.headers,
|
|
43
|
+
},
|
|
44
|
+
body: JSON.stringify(options.payload),
|
|
45
|
+
signal: AbortSignal.timeout(options.timeoutMs ?? 10_000),
|
|
46
|
+
},
|
|
47
|
+
{ maxRedirects: options.maxRedirects ?? 3 },
|
|
48
|
+
);
|
|
49
|
+
return response.ok
|
|
50
|
+
? { ok: true, status: response.status }
|
|
51
|
+
: { ok: false, blocked: false, status: response.status };
|
|
52
|
+
} catch (error) {
|
|
53
|
+
return { ok: false, blocked: false, error };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
import { ssrfSafeFetch } from "../extensions/url-safety.js";
|
|
31
|
+
import { escapeSlackMrkdwn } from "../integrations/webhook-delivery.js";
|
|
31
32
|
import {
|
|
32
33
|
getKeyAllowlist,
|
|
33
34
|
getResolvedKeyAllowlist,
|
|
@@ -140,7 +141,7 @@ function createSlackWebhookChannel(
|
|
|
140
141
|
type: "section",
|
|
141
142
|
text: {
|
|
142
143
|
type: "mrkdwn",
|
|
143
|
-
text: `*${
|
|
144
|
+
text: `*${escapeSlackMrkdwn(input.title)}*`,
|
|
144
145
|
},
|
|
145
146
|
},
|
|
146
147
|
...(input.body
|
|
@@ -149,7 +150,7 @@ function createSlackWebhookChannel(
|
|
|
149
150
|
type: "section",
|
|
150
151
|
text: {
|
|
151
152
|
type: "mrkdwn",
|
|
152
|
-
text:
|
|
153
|
+
text: escapeSlackMrkdwn(input.body),
|
|
153
154
|
},
|
|
154
155
|
},
|
|
155
156
|
]
|
|
@@ -159,7 +160,7 @@ function createSlackWebhookChannel(
|
|
|
159
160
|
elements: [
|
|
160
161
|
{
|
|
161
162
|
type: "mrkdwn",
|
|
162
|
-
text: `Severity: \`${input.severity}\` Owner: ${
|
|
163
|
+
text: `Severity: \`${input.severity}\` Owner: ${escapeSlackMrkdwn(meta.owner)}`,
|
|
163
164
|
},
|
|
164
165
|
],
|
|
165
166
|
},
|
|
@@ -375,13 +376,6 @@ function slackText(
|
|
|
375
376
|
return `[${severity}] ${title}${body ? `\n${body}` : ""}`;
|
|
376
377
|
}
|
|
377
378
|
|
|
378
|
-
function escapeSlack(value: string): string {
|
|
379
|
-
return value
|
|
380
|
-
.replace(/&/g, "&")
|
|
381
|
-
.replace(/</g, "<")
|
|
382
|
-
.replace(/>/g, ">");
|
|
383
|
-
}
|
|
384
|
-
|
|
385
379
|
function escapeHtml(value: string): string {
|
|
386
380
|
return value
|
|
387
381
|
.replace(/&/g, "&")
|