@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
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconChartTreemap,
|
|
3
|
+
IconChevronDown,
|
|
4
|
+
IconChevronRight,
|
|
5
|
+
IconLock,
|
|
6
|
+
IconListDetails,
|
|
7
|
+
} from "@tabler/icons-react";
|
|
8
|
+
import { useMemo, useState } from "react";
|
|
9
|
+
|
|
10
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
11
|
+
import { cn } from "../utils.js";
|
|
12
|
+
import { ContextSegmentRowView } from "./ContextSegmentRow.js";
|
|
13
|
+
import { ContextTreemapView } from "./ContextTreemap.js";
|
|
14
|
+
import { contextGroupColor, formatContextTokens } from "./format.js";
|
|
15
|
+
import type {
|
|
16
|
+
ContextManifestViewData,
|
|
17
|
+
ContextSegmentStatus,
|
|
18
|
+
ContextSegmentViewData,
|
|
19
|
+
ContextSystemSectionViewData,
|
|
20
|
+
} from "./types.js";
|
|
21
|
+
|
|
22
|
+
interface Group {
|
|
23
|
+
name: string;
|
|
24
|
+
tokens: number;
|
|
25
|
+
segments: ContextSegmentViewData[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function applyOptimisticStatus(
|
|
29
|
+
segments: ContextSegmentViewData[],
|
|
30
|
+
optimistic: Map<string, ContextSegmentStatus>,
|
|
31
|
+
) {
|
|
32
|
+
if (optimistic.size === 0) return segments;
|
|
33
|
+
return segments.map((segment) =>
|
|
34
|
+
optimistic.has(segment.segmentId)
|
|
35
|
+
? { ...segment, status: optimistic.get(segment.segmentId)! }
|
|
36
|
+
: segment,
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function groupedSegments(segments: ContextSegmentViewData[]): Group[] {
|
|
41
|
+
const map = new Map<string, Group>();
|
|
42
|
+
for (const segment of segments) {
|
|
43
|
+
const name =
|
|
44
|
+
segment.status === "pinned"
|
|
45
|
+
? "Pinned"
|
|
46
|
+
: segment.status === "evicted"
|
|
47
|
+
? "Evicted"
|
|
48
|
+
: segment.group;
|
|
49
|
+
const group = map.get(name) ?? { name, tokens: 0, segments: [] };
|
|
50
|
+
group.tokens += segment.tokenCount;
|
|
51
|
+
group.segments.push(segment);
|
|
52
|
+
map.set(name, group);
|
|
53
|
+
}
|
|
54
|
+
const order = [
|
|
55
|
+
"Pinned",
|
|
56
|
+
"Tool results",
|
|
57
|
+
"Files read",
|
|
58
|
+
"Conversation",
|
|
59
|
+
"Thinking",
|
|
60
|
+
"Evicted",
|
|
61
|
+
];
|
|
62
|
+
return [...map.values()].sort((a, b) => {
|
|
63
|
+
const ai = order.indexOf(a.name);
|
|
64
|
+
const bi = order.indexOf(b.name);
|
|
65
|
+
return ai >= 0 || bi >= 0
|
|
66
|
+
? (ai < 0 ? 99 : ai) - (bi < 0 ? 99 : bi)
|
|
67
|
+
: b.tokens - a.tokens;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function sourceLabel(section: ContextSystemSectionViewData) {
|
|
72
|
+
return (
|
|
73
|
+
section.sourceRef?.path ??
|
|
74
|
+
section.sourceRef?.resourceId ??
|
|
75
|
+
section.sourceRef?.scope ??
|
|
76
|
+
"framework"
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function SystemSectionRow({
|
|
81
|
+
section,
|
|
82
|
+
totalTokens,
|
|
83
|
+
}: {
|
|
84
|
+
section: ContextSystemSectionViewData;
|
|
85
|
+
totalTokens: number;
|
|
86
|
+
}) {
|
|
87
|
+
const share =
|
|
88
|
+
totalTokens > 0 ? Math.round((section.tokenCount / totalTokens) * 100) : 0;
|
|
89
|
+
return (
|
|
90
|
+
<div className="flex min-h-12 items-start gap-2 rounded-sm px-2 py-1.5">
|
|
91
|
+
<span className="mt-1 flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground">
|
|
92
|
+
<IconLock className="h-3.5 w-3.5" />
|
|
93
|
+
</span>
|
|
94
|
+
<div className="min-w-0 flex-1">
|
|
95
|
+
<div className="truncate text-[13px] font-medium leading-5 text-foreground">
|
|
96
|
+
{section.label}
|
|
97
|
+
</div>
|
|
98
|
+
<div className="truncate text-[11px] text-muted-foreground">
|
|
99
|
+
{sourceLabel(section)} · {formatContextTokens(section.tokenCount)}{" "}
|
|
100
|
+
tokens · {share}%
|
|
101
|
+
{section.tokenMethod === "estimate" ? " · estimated" : ""}
|
|
102
|
+
</div>
|
|
103
|
+
{section.preview ? (
|
|
104
|
+
<div className="mt-0.5 line-clamp-2 text-[11px] text-muted-foreground/80">
|
|
105
|
+
{section.preview}
|
|
106
|
+
</div>
|
|
107
|
+
) : null}
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function ContextXRayPanelView({
|
|
114
|
+
manifest,
|
|
115
|
+
contextWindow,
|
|
116
|
+
optimistic,
|
|
117
|
+
onPin,
|
|
118
|
+
onEvict,
|
|
119
|
+
onRestore,
|
|
120
|
+
governanceLabels = {},
|
|
121
|
+
systemOrderedLabel = "System · ordered, not evictable",
|
|
122
|
+
titleLabel = "Context X-Ray",
|
|
123
|
+
}: {
|
|
124
|
+
manifest: ContextManifestViewData;
|
|
125
|
+
contextWindow: number;
|
|
126
|
+
optimistic: Map<string, ContextSegmentStatus>;
|
|
127
|
+
onPin: (segmentId: string) => void;
|
|
128
|
+
onEvict: (segmentId: string) => void;
|
|
129
|
+
onRestore: (segmentId: string) => void;
|
|
130
|
+
governanceLabels?: Partial<Record<"required" | "inherited" | "user", string>>;
|
|
131
|
+
systemOrderedLabel?: string;
|
|
132
|
+
titleLabel?: string;
|
|
133
|
+
}) {
|
|
134
|
+
const [mode, setMode] = useState<"list" | "map">("list");
|
|
135
|
+
const [collapsed, setCollapsed] = useState<Set<string>>(new Set());
|
|
136
|
+
const segments = useMemo(
|
|
137
|
+
() => applyOptimisticStatus(manifest.segments, optimistic),
|
|
138
|
+
[manifest.segments, optimistic],
|
|
139
|
+
);
|
|
140
|
+
const groups = useMemo(() => groupedSegments(segments), [segments]);
|
|
141
|
+
const sections = manifest.systemSections ?? [];
|
|
142
|
+
const systemGroups = useMemo(
|
|
143
|
+
() =>
|
|
144
|
+
(["required", "inherited", "user"] as const).flatMap((governance) => {
|
|
145
|
+
const items = sections.filter(
|
|
146
|
+
(section) => section.governance === governance,
|
|
147
|
+
);
|
|
148
|
+
return items.length
|
|
149
|
+
? [
|
|
150
|
+
{
|
|
151
|
+
governance,
|
|
152
|
+
sections: items,
|
|
153
|
+
tokens: items.reduce(
|
|
154
|
+
(sum, section) => sum + section.tokenCount,
|
|
155
|
+
0,
|
|
156
|
+
),
|
|
157
|
+
},
|
|
158
|
+
]
|
|
159
|
+
: [];
|
|
160
|
+
}),
|
|
161
|
+
[sections],
|
|
162
|
+
);
|
|
163
|
+
const pct = Math.min(
|
|
164
|
+
100,
|
|
165
|
+
Math.round((manifest.totalTokens / contextWindow) * 100),
|
|
166
|
+
);
|
|
167
|
+
const headroom = Math.max(0, contextWindow - manifest.totalTokens);
|
|
168
|
+
const { conversationTokens: conversation, systemTokens: system } = manifest;
|
|
169
|
+
const pinned = segments.filter(
|
|
170
|
+
(segment) => segment.status === "pinned",
|
|
171
|
+
).length;
|
|
172
|
+
const evicted = segments.filter(
|
|
173
|
+
(segment) => segment.status === "evicted",
|
|
174
|
+
).length;
|
|
175
|
+
const details = [
|
|
176
|
+
`${formatContextTokens(headroom)} free`,
|
|
177
|
+
system > 0 ? `${formatContextTokens(system)} system` : null,
|
|
178
|
+
`${formatContextTokens(conversation)} conversation`,
|
|
179
|
+
pinned > 0 ? `${pinned} pinned` : null,
|
|
180
|
+
evicted > 0 ? `${evicted} evicted` : null,
|
|
181
|
+
manifest.tokenCountMethod === "estimate" ? "estimated" : null,
|
|
182
|
+
!manifest.enforceable ? "advisory" : null,
|
|
183
|
+
].filter((item): item is string => Boolean(item));
|
|
184
|
+
const toggle = (key: string) =>
|
|
185
|
+
setCollapsed((current) => {
|
|
186
|
+
const next = new Set(current);
|
|
187
|
+
if (next.has(key)) next.delete(key);
|
|
188
|
+
else next.add(key);
|
|
189
|
+
return next;
|
|
190
|
+
});
|
|
191
|
+
return (
|
|
192
|
+
<div className="flex max-h-[min(72vh,520px)] flex-col">
|
|
193
|
+
<div className="border-b border-border/60 px-3 py-2.5">
|
|
194
|
+
<div className="flex items-center justify-between gap-3">
|
|
195
|
+
<h2 className="min-w-0 truncate text-sm font-medium text-foreground">
|
|
196
|
+
{titleLabel}
|
|
197
|
+
</h2>
|
|
198
|
+
<div className="shrink-0 text-xs tabular-nums text-muted-foreground">
|
|
199
|
+
{formatContextTokens(manifest.totalTokens)} · {pct}%
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
<div className="mt-2 h-1 overflow-hidden rounded-full bg-muted/70">
|
|
203
|
+
<div
|
|
204
|
+
className="h-full w-full origin-left rounded-full bg-foreground transition-transform duration-200"
|
|
205
|
+
style={{ transform: `scaleX(${Math.min(1, pct / 100)})` }}
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
<div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground">
|
|
209
|
+
{details.map((detail) => (
|
|
210
|
+
<span key={detail}>{detail}</span>
|
|
211
|
+
))}
|
|
212
|
+
{manifest.reclaimedTokens > 0 ? (
|
|
213
|
+
<span className="font-medium text-emerald-600 dark:text-emerald-400">
|
|
214
|
+
-{formatContextTokens(manifest.reclaimedTokens)}
|
|
215
|
+
</span>
|
|
216
|
+
) : null}
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
<div className="overflow-y-auto px-2 py-2">
|
|
220
|
+
<div className="mb-1 flex items-center justify-end">
|
|
221
|
+
<div className="inline-flex rounded-md bg-muted/40 p-0.5">
|
|
222
|
+
<Tooltip>
|
|
223
|
+
<TooltipTrigger asChild>
|
|
224
|
+
<button
|
|
225
|
+
type="button"
|
|
226
|
+
onClick={() => setMode("list")}
|
|
227
|
+
aria-label="Show context list"
|
|
228
|
+
className={cn(
|
|
229
|
+
"flex size-7 cursor-pointer items-center justify-center rounded text-muted-foreground",
|
|
230
|
+
mode === "list"
|
|
231
|
+
? "bg-background text-foreground shadow-sm"
|
|
232
|
+
: "hover:text-foreground",
|
|
233
|
+
)}
|
|
234
|
+
>
|
|
235
|
+
<IconListDetails className="h-3.5 w-3.5" />
|
|
236
|
+
</button>
|
|
237
|
+
</TooltipTrigger>
|
|
238
|
+
<TooltipContent>List</TooltipContent>
|
|
239
|
+
</Tooltip>
|
|
240
|
+
<Tooltip>
|
|
241
|
+
<TooltipTrigger asChild>
|
|
242
|
+
<button
|
|
243
|
+
type="button"
|
|
244
|
+
onClick={() => setMode("map")}
|
|
245
|
+
aria-label="Show context map"
|
|
246
|
+
className={cn(
|
|
247
|
+
"flex size-7 cursor-pointer items-center justify-center rounded text-muted-foreground",
|
|
248
|
+
mode === "map"
|
|
249
|
+
? "bg-background text-foreground shadow-sm"
|
|
250
|
+
: "hover:text-foreground",
|
|
251
|
+
)}
|
|
252
|
+
>
|
|
253
|
+
<IconChartTreemap className="h-3.5 w-3.5" />
|
|
254
|
+
</button>
|
|
255
|
+
</TooltipTrigger>
|
|
256
|
+
<TooltipContent>Map</TooltipContent>
|
|
257
|
+
</Tooltip>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
{mode === "map" ? (
|
|
261
|
+
<ContextTreemapView
|
|
262
|
+
segments={segments}
|
|
263
|
+
systemSections={sections}
|
|
264
|
+
onSelect={(id) => {
|
|
265
|
+
if (segments.some((segment) => segment.segmentId === id))
|
|
266
|
+
setCollapsed(new Set());
|
|
267
|
+
}}
|
|
268
|
+
/>
|
|
269
|
+
) : (
|
|
270
|
+
<div className="divide-y divide-border/60">
|
|
271
|
+
{systemGroups.length ? (
|
|
272
|
+
<div>
|
|
273
|
+
<div className="px-1.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground">
|
|
274
|
+
{systemOrderedLabel}
|
|
275
|
+
</div>
|
|
276
|
+
{systemGroups.map((group) => {
|
|
277
|
+
const key = `system:${group.governance}`;
|
|
278
|
+
const isCollapsed = collapsed.has(key);
|
|
279
|
+
return (
|
|
280
|
+
<div key={key}>
|
|
281
|
+
<button
|
|
282
|
+
type="button"
|
|
283
|
+
onClick={() => toggle(key)}
|
|
284
|
+
className="flex w-full cursor-pointer items-center gap-2 rounded-sm px-1.5 py-2 text-left hover:bg-accent/35"
|
|
285
|
+
>
|
|
286
|
+
{isCollapsed ? (
|
|
287
|
+
<IconChevronRight className="h-3.5 w-3.5 text-muted-foreground" />
|
|
288
|
+
) : (
|
|
289
|
+
<IconChevronDown className="h-3.5 w-3.5 text-muted-foreground" />
|
|
290
|
+
)}
|
|
291
|
+
<IconLock className="h-3 w-3 text-muted-foreground" />
|
|
292
|
+
<span className="min-w-0 flex-1 truncate text-xs font-medium">
|
|
293
|
+
{governanceLabels[group.governance] ??
|
|
294
|
+
group.governance}
|
|
295
|
+
</span>
|
|
296
|
+
<span className="text-[11px] text-muted-foreground">
|
|
297
|
+
{formatContextTokens(group.tokens)} ·{" "}
|
|
298
|
+
{manifest.totalTokens > 0
|
|
299
|
+
? Math.round(
|
|
300
|
+
(group.tokens / manifest.totalTokens) * 100,
|
|
301
|
+
)
|
|
302
|
+
: 0}
|
|
303
|
+
%
|
|
304
|
+
</span>
|
|
305
|
+
</button>
|
|
306
|
+
{!isCollapsed ? (
|
|
307
|
+
<div className="pb-1">
|
|
308
|
+
{group.sections
|
|
309
|
+
.slice()
|
|
310
|
+
.sort((a, b) => b.tokenCount - a.tokenCount)
|
|
311
|
+
.map((section) => (
|
|
312
|
+
<SystemSectionRow
|
|
313
|
+
key={section.segmentId}
|
|
314
|
+
section={section}
|
|
315
|
+
totalTokens={manifest.totalTokens}
|
|
316
|
+
/>
|
|
317
|
+
))}
|
|
318
|
+
</div>
|
|
319
|
+
) : null}
|
|
320
|
+
</div>
|
|
321
|
+
);
|
|
322
|
+
})}
|
|
323
|
+
</div>
|
|
324
|
+
) : null}
|
|
325
|
+
{groups.map((group) => {
|
|
326
|
+
const isCollapsed = collapsed.has(group.name);
|
|
327
|
+
return (
|
|
328
|
+
<div key={group.name}>
|
|
329
|
+
<button
|
|
330
|
+
type="button"
|
|
331
|
+
onClick={() => toggle(group.name)}
|
|
332
|
+
className="flex w-full cursor-pointer items-center gap-2 rounded-sm px-1.5 py-2 text-left hover:bg-accent/35"
|
|
333
|
+
>
|
|
334
|
+
{isCollapsed ? (
|
|
335
|
+
<IconChevronRight className="h-3.5 w-3.5 text-muted-foreground" />
|
|
336
|
+
) : (
|
|
337
|
+
<IconChevronDown className="h-3.5 w-3.5 text-muted-foreground" />
|
|
338
|
+
)}
|
|
339
|
+
<span
|
|
340
|
+
className={cn(
|
|
341
|
+
"h-2 w-2 rounded-full",
|
|
342
|
+
contextGroupColor(group.name),
|
|
343
|
+
)}
|
|
344
|
+
/>
|
|
345
|
+
<span className="min-w-0 flex-1 truncate text-xs font-medium">
|
|
346
|
+
{group.name}
|
|
347
|
+
</span>
|
|
348
|
+
<span className="text-[11px] text-muted-foreground">
|
|
349
|
+
{formatContextTokens(group.tokens)}
|
|
350
|
+
</span>
|
|
351
|
+
</button>
|
|
352
|
+
{!isCollapsed ? (
|
|
353
|
+
<div className="pb-1">
|
|
354
|
+
{group.segments
|
|
355
|
+
.slice()
|
|
356
|
+
.sort((a, b) => b.tokenCount - a.tokenCount)
|
|
357
|
+
.map((segment) => (
|
|
358
|
+
<ContextSegmentRowView
|
|
359
|
+
key={segment.segmentId}
|
|
360
|
+
segment={segment}
|
|
361
|
+
advisory={!manifest.enforceable}
|
|
362
|
+
onPin={() => onPin(segment.segmentId)}
|
|
363
|
+
onEvict={() => onEvict(segment.segmentId)}
|
|
364
|
+
onRestore={() => onRestore(segment.segmentId)}
|
|
365
|
+
/>
|
|
366
|
+
))}
|
|
367
|
+
</div>
|
|
368
|
+
) : null}
|
|
369
|
+
</div>
|
|
370
|
+
);
|
|
371
|
+
})}
|
|
372
|
+
</div>
|
|
373
|
+
)}
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
);
|
|
377
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ContextSegmentViewData } from "./types.js";
|
|
2
|
+
|
|
3
|
+
export function formatContextTokens(tokens: number | undefined): string {
|
|
4
|
+
const value = Math.max(0, Math.round(tokens ?? 0));
|
|
5
|
+
if (value >= 1000) {
|
|
6
|
+
const compact = value / 1000;
|
|
7
|
+
return `${compact >= 100 ? compact.toFixed(0) : compact.toFixed(1)}k`;
|
|
8
|
+
}
|
|
9
|
+
return String(value);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function contextStatusLabel(segment: ContextSegmentViewData): string {
|
|
13
|
+
if (segment.protected) return "Protected";
|
|
14
|
+
if (segment.status === "pinned") return "Pinned";
|
|
15
|
+
if (segment.status === "evicted") return "Evicted";
|
|
16
|
+
if (segment.status === "summarized") return "Summarized";
|
|
17
|
+
return "Active";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function contextGroupColor(group: string): string {
|
|
21
|
+
if (group === "Pinned") return "bg-emerald-500";
|
|
22
|
+
if (group === "Tool results") return "bg-amber-500";
|
|
23
|
+
if (group === "Files read") return "bg-sky-500";
|
|
24
|
+
if (group === "Thinking") return "bg-violet-500";
|
|
25
|
+
if (group === "Task & instructions") return "bg-rose-500";
|
|
26
|
+
if (group === "System · required") return "bg-slate-700";
|
|
27
|
+
if (group === "System · inherited") return "bg-indigo-500";
|
|
28
|
+
if (group === "System · user") return "bg-teal-500";
|
|
29
|
+
return "bg-slate-400";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function contextGroupFill(group: string): string {
|
|
33
|
+
if (group === "Pinned") return "#10b981";
|
|
34
|
+
if (group === "Tool results") return "#f59e0b";
|
|
35
|
+
if (group === "Files read") return "#0ea5e9";
|
|
36
|
+
if (group === "Thinking") return "#8b5cf6";
|
|
37
|
+
if (group === "Task & instructions") return "#f43f5e";
|
|
38
|
+
if (group === "System · required") return "#334155";
|
|
39
|
+
if (group === "System · inherited") return "#6366f1";
|
|
40
|
+
if (group === "System · user") return "#14b8a6";
|
|
41
|
+
return "#94a3b8";
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { ContextMeterView } from "./ContextMeter.js";
|
|
2
|
+
export {
|
|
3
|
+
ContextSegmentRowView,
|
|
4
|
+
SegmentProvenancePopoverView,
|
|
5
|
+
} from "./ContextSegmentRow.js";
|
|
6
|
+
export { ContextTreemapView } from "./ContextTreemap.js";
|
|
7
|
+
export { ContextXRayPanelView } from "./ContextXRayPanel.js";
|
|
8
|
+
export { formatContextTokens } from "./format.js";
|
|
9
|
+
export type {
|
|
10
|
+
ContextManifestViewData,
|
|
11
|
+
ContextSegmentStatus,
|
|
12
|
+
ContextSegmentViewData,
|
|
13
|
+
ContextSystemSectionViewData,
|
|
14
|
+
ContextTokenMethod,
|
|
15
|
+
} from "./types.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type ContextSegmentStatus =
|
|
2
|
+
| "active"
|
|
3
|
+
| "pinned"
|
|
4
|
+
| "evicted"
|
|
5
|
+
| "summarized";
|
|
6
|
+
|
|
7
|
+
export type ContextTokenMethod = "exact" | "estimate";
|
|
8
|
+
|
|
9
|
+
export type ContextGovernance = "required" | "inherited" | "user";
|
|
10
|
+
|
|
11
|
+
export interface ContextSegmentViewData {
|
|
12
|
+
segmentId: string;
|
|
13
|
+
group: string;
|
|
14
|
+
label: string;
|
|
15
|
+
tokenCount: number;
|
|
16
|
+
tokenMethod: ContextTokenMethod;
|
|
17
|
+
status: ContextSegmentStatus;
|
|
18
|
+
protected?: boolean;
|
|
19
|
+
msgIndex?: number;
|
|
20
|
+
partIndex?: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ContextSystemSectionViewData {
|
|
24
|
+
segmentId: string;
|
|
25
|
+
label: string;
|
|
26
|
+
governance: ContextGovernance;
|
|
27
|
+
tokenCount: number;
|
|
28
|
+
tokenMethod: ContextTokenMethod;
|
|
29
|
+
sourceRef?: { resourceId?: string; path?: string; scope?: string };
|
|
30
|
+
preview?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ContextManifestViewData {
|
|
34
|
+
totalTokens: number;
|
|
35
|
+
rawTokens: number;
|
|
36
|
+
reclaimedTokens: number;
|
|
37
|
+
tokenCountMethod: ContextTokenMethod;
|
|
38
|
+
enforceable: boolean;
|
|
39
|
+
segments: ContextSegmentViewData[];
|
|
40
|
+
systemSections?: ContextSystemSectionViewData[];
|
|
41
|
+
systemTokens: number;
|
|
42
|
+
conversationTokens: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./visual-style-controls.js";
|