@agent-native/core 0.130.2 → 0.131.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +51 -0
- package/corpus/core/docs/content/agent-surfaces.mdx +4 -4
- package/corpus/core/docs/content/automations.mdx +61 -12
- package/corpus/core/docs/content/deployment.mdx +11 -4
- package/corpus/core/docs/content/extensions.mdx +39 -33
- package/corpus/core/docs/content/recurring-jobs.mdx +41 -19
- package/corpus/core/docs/content/template-dispatch-operations.mdx +19 -7
- package/corpus/core/package.json +3 -1
- package/corpus/core/src/action.ts +55 -0
- package/corpus/core/src/agent/engine/builder-engine.ts +8 -4
- package/corpus/core/src/agent/production-agent.ts +175 -100
- package/corpus/core/src/agent/tool-search.ts +36 -0
- package/corpus/core/src/automations/service.ts +506 -0
- package/corpus/core/src/browser-context/index.ts +392 -0
- package/corpus/core/src/client/AgentPanel.tsx +2 -1
- package/corpus/core/src/client/FeedbackButton.tsx +37 -4
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +21 -0
- package/corpus/core/src/client/agent-chat.ts +31 -3
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +438 -310
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +4 -4
- package/corpus/core/src/client/agent-page/use-jobs.ts +7 -0
- package/corpus/core/src/client/analytics-session.ts +13 -0
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +67 -0
- package/corpus/core/src/client/settings/AutomationsSection.tsx +27 -499
- package/corpus/core/src/client/settings/SettingsPanel.tsx +32 -11
- package/corpus/core/src/client/settings/index.ts +2 -0
- package/corpus/core/src/client/use-agent-chat.ts +35 -3
- package/corpus/core/src/client/use-chat-threads.ts +8 -25
- package/corpus/core/src/deploy/build.ts +2 -0
- package/corpus/core/src/deploy/workspace-deploy.ts +2 -0
- package/corpus/core/src/extensions/actions.ts +115 -3
- package/corpus/core/src/extensions/fetch-tool.ts +11 -0
- package/corpus/core/src/extensions/routes.ts +16 -1
- package/corpus/core/src/extensions/web-content.ts +96 -1
- package/corpus/core/src/integrations/computer-supervision.ts +33 -1
- package/corpus/core/src/integrations/index.ts +6 -0
- package/corpus/core/src/integrations/integration-durable-dispatch-config.ts +10 -0
- package/corpus/core/src/integrations/integration-durable-dispatch.ts +4 -0
- package/corpus/core/src/integrations/plugin.ts +94 -41
- package/corpus/core/src/integrations/remote-browser-actions.ts +621 -0
- package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +5 -7
- package/corpus/core/src/jobs/actions/manage-recurring-job.ts +3 -7
- package/corpus/core/src/jobs/background-automation-runner.ts +437 -0
- package/corpus/core/src/jobs/frontmatter.ts +308 -0
- package/corpus/core/src/jobs/scheduler.ts +89 -598
- package/corpus/core/src/jobs/tools.ts +22 -3
- package/corpus/core/src/localization/default-messages.ts +45 -45
- package/corpus/core/src/mcp-client/index.ts +6 -0
- package/corpus/core/src/notifications/actions.ts +5 -0
- package/corpus/core/src/progress/actions.ts +5 -0
- package/corpus/core/src/provider-api/actions/github-repo-files.ts +11 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +13 -0
- package/corpus/core/src/server/action-discovery.ts +7 -0
- package/corpus/core/src/server/agent-chat/browser-team-tools.ts +126 -3
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +7 -11
- package/corpus/core/src/server/agent-chat/plugin-options.ts +3 -3
- package/corpus/core/src/server/agent-chat/script-entries.ts +52 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +25 -5
- package/corpus/core/src/server/attribution.ts +22 -0
- package/corpus/core/src/server/auth.ts +20 -6
- package/corpus/core/src/server/better-auth-instance.ts +10 -2
- package/corpus/core/src/server/core-routes-plugin.ts +10 -1
- package/corpus/core/src/server/csrf.ts +25 -0
- package/corpus/core/src/server/google-oauth.ts +21 -1
- package/corpus/core/src/server/onboarding-html.ts +18 -0
- package/corpus/core/src/server/prompts/framework-core-compact.ts +3 -3
- package/corpus/core/src/server/prompts/framework-core.ts +3 -3
- package/corpus/core/src/server/prompts/shared-rules.ts +3 -3
- package/corpus/core/src/settings/index.ts +1 -0
- package/corpus/core/src/shared/analytics-anonymous-id.ts +35 -0
- package/corpus/core/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +26 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +28 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +28 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +28 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +25 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +27 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +24 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +24 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
- package/corpus/core/src/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
- package/corpus/core/src/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
- package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
- package/corpus/core/src/tracking/providers.ts +1 -0
- package/corpus/core/src/tracking/registry.ts +2 -1
- package/corpus/core/src/tracking/types.ts +1 -0
- package/corpus/core/src/triggers/actions/list-automations.ts +43 -44
- package/corpus/core/src/triggers/actions/manage-automation.ts +17 -48
- package/corpus/core/src/triggers/actions.ts +218 -127
- package/corpus/core/src/triggers/dispatcher.ts +181 -367
- package/corpus/core/src/triggers/routes.ts +84 -27
- package/corpus/core/src/triggers/types.ts +9 -23
- package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +13 -4
- package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -3
- package/corpus/templates/analytics/actions/restore-dashboard-revision.ts +8 -3
- package/corpus/templates/analytics/actions/update-dashboard.ts +22 -5
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +7 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +1 -82
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +4 -4
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +23 -13
- package/corpus/templates/analytics/app/global.css +21 -0
- package/corpus/templates/analytics/app/i18n-data.ts +165 -101
- package/corpus/templates/analytics/app/lib/custom-block-promotion.ts +62 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +17 -2
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +3 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +77 -12
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/dashboard-save-queue.ts +34 -0
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +42 -26
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/types.ts +15 -0
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +1 -1
- package/corpus/templates/analytics/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-the-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-custom-dashboard-blocks-now-identify-one-off-agent-patches-a.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-dashboard-chart-deletions-now-save-in-order-so-removed-rows-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-dashboard-chart-loaders-are-easier-to-see-and-animate-more-s.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-plan-mode-can-now-query-connected-analytics-sources-while-ke.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-plan-mode-can-use-clips-as-read-only-prompt-context.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-29-signup-entry-pages-now-show-the-first-page-viewed-before-eac.md +6 -0
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +26 -1
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -33
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +13 -3
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +9 -1
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +44 -1
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +96 -16
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +18 -27
- package/corpus/templates/analytics/server/plugins/core-routes.ts +1 -0
- package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +4 -8
- package/corpus/templates/assets/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-the-workspace.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +3 -7
- package/corpus/templates/brain/app/root.tsx +0 -3
- package/corpus/templates/brain/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-ask-brain.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-29-extensions-are-no-longer-shown-as-a-default-command-menu-des.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +25 -5
- package/corpus/templates/calendar/AGENTS.md +5 -0
- package/corpus/templates/calendar/actions/create-event.ts +43 -13
- package/corpus/templates/calendar/actions/event-action-helpers.ts +131 -1
- package/corpus/templates/calendar/actions/manage-event-draft.ts +65 -2
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +437 -258
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +19 -3
- package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +24 -0
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +15 -2
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +1 -5
- package/corpus/templates/calendar/app/hooks/use-events.ts +44 -5
- package/corpus/templates/calendar/app/i18n-data.ts +50 -0
- package/corpus/templates/calendar/app/lib/all-day-layout.ts +9 -2
- package/corpus/templates/calendar/app/lib/event-form-initialization.ts +4 -8
- package/corpus/templates/calendar/app/lib/event-form-utils.ts +30 -8
- package/corpus/templates/calendar/app/lib/location-suggestions.ts +36 -0
- package/corpus/templates/calendar/app/lib/out-of-office.ts +87 -1
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +68 -13
- package/corpus/templates/calendar/changelog/2026-07-26-out-of-office-events-now-default-to-full-days-with-a-ready.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-29-recent-calendar-locations-now-appear-as-address-suggestions-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/calendar/server/lib/find-time.ts +29 -5
- package/corpus/templates/calendar/shared/api.ts +2 -0
- package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +1 -5
- package/corpus/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -5
- package/corpus/templates/clips/changelog/2026-07-29-fixed-system-audio-recordings-picking-up-your-microphone-in-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-29-the-desktop-camera-preview-now-closes-after-a-recording-fin.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +14 -15
- package/corpus/templates/clips/desktop/src/lib/bubble-session.ts +11 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +9 -4
- package/corpus/templates/clips/desktop/src/lib/transcription-capture.ts +11 -0
- package/corpus/templates/clips/server/jobs/transactional-emails.ts +47 -23
- package/corpus/templates/clips/server/lib/transactional-email-store.ts +16 -6
- package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/content/.agents/skills/content-product-development/SKILL.md +103 -0
- package/corpus/templates/content/.agents/skills/content-product-development/references/verification.md +57 -0
- package/corpus/templates/content/AGENTS.md +2 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -6
- package/corpus/templates/content/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/content/docs/product/README.md +115 -0
- package/corpus/templates/content/docs/product/architecture.md +98 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.page-database.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.row-private.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.safe-aggregate.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.access.visibility-closure.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.action.button.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.action-parity.md +73 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.audience-safe.md +91 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.automation.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.expression-authoring.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.presence.md +103 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.resource-consent.md +90 -0
- package/corpus/templates/content/docs/product/capabilities/content.agent.skill-catalog.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.api.cms.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.code.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.document-editor.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.footnotes.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.math.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.media.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.author.mermaid.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.automation.scheduled.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.capture.enrich.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.command.fabric.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.comment.page-owned.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.diff.ai-assist.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.diff.filtered-review.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.diff.in-place.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.discussion.page.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.embed.host-grant.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.embed.mcp-app.md +69 -0
- package/corpus/templates/content/docs/product/capabilities/content.embed.surface.md +74 -0
- package/corpus/templates/content/docs/product/capabilities/content.event.committed.md +85 -0
- package/corpus/templates/content/docs/product/capabilities/content.expression.cached-result.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.expression.catalog.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.expression.language.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.feedback.signal.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.form.shared-engine.md +72 -0
- package/corpus/templates/content/docs/product/capabilities/content.history.queryable.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.home.global.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.job.durable.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.knowledge.graph.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.knowledge.links.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.knowledge.search.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.layout.responsive.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.navigation.sidebar.md +86 -0
- package/corpus/templates/content/docs/product/capabilities/content.notification.source.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.block.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.blocks-field.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.database.md +92 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.multi-membership.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.page.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.reference.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.object.transclusion.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.organization.teams.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.pdf-export.md +78 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.roundtrip.md +154 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.source-representation.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.portability.vault-export.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.presentation.mode.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.preset.catalog.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.actor.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.catalog.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.constraints.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.guarded-change.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.location.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.property.typed.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.publish.public.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.publish.reading.md +74 -0
- package/corpus/templates/content/docs/product/capabilities/content.query.object.md +114 -0
- package/corpus/templates/content/docs/product/capabilities/content.reader.documents.md +69 -0
- package/corpus/templates/content/docs/product/capabilities/content.reader.surface.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.relationship.edge.md +183 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.artifact-block.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.custom-block.md +81 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.graph.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.renderer.typed.md +92 -0
- package/corpus/templates/content/docs/product/capabilities/content.research.annotation.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.research.citation.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.review.code.md +67 -0
- package/corpus/templates/content/docs/product/capabilities/content.revision.suggestions.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.rule.deterministic.md +79 -0
- package/corpus/templates/content/docs/product/capabilities/content.schedule.constraints.md +81 -0
- package/corpus/templates/content/docs/product/capabilities/content.security.private-vault.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.share.views.md +140 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.adapters.md +154 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.builder-codec.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.catalog.md +149 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.file-folder.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.local-bridge.md +156 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.local-project.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.page-link.md +70 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.row-union.md +69 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.spaces-files.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.source.sync-policy.md +161 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.dependencies.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.my-tasks.md +75 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.project-status.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.research-workspace.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.system.task-project.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.governance.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.graph.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.item-body.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.template.update.md +71 -0
- package/corpus/templates/content/docs/product/capabilities/content.time.types.md +85 -0
- package/corpus/templates/content/docs/product/capabilities/content.version.branching.md +151 -0
- package/corpus/templates/content/docs/product/capabilities/content.version.field-history.md +103 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.canvas.md +94 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.chart.md +91 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.dynamic-create.md +137 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.fast-capture.md +82 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.graph.md +95 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.grouping-aggregation.md +83 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.map.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.personal-state.md +99 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.pivot.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.query.md +106 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.renderer-conformance.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.scale.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.source-query.md +159 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.timeline.md +86 -0
- package/corpus/templates/content/docs/product/capabilities/content.view.tree.md +77 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.multi-scope.md +80 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.session-restore.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.view-instance.md +76 -0
- package/corpus/templates/content/docs/product/capabilities/content.workspace.working-set.md +77 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.capture-research.md +20 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.connected-sources.md +20 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.consensus.md +19 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.durable-home.md +21 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.publishing-portability.md +21 -0
- package/corpus/templates/content/docs/product/chapters/content.chapter.working-systems.md +27 -0
- package/corpus/templates/content/docs/product/encyclopedia.md +559 -0
- package/corpus/templates/content/docs/product/features/content.feature.bring-your-local-work.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.build-living-dashboards.md +34 -0
- package/corpus/templates/content/docs/product/features/content.feature.build-new-surfaces.md +33 -0
- package/corpus/templates/content/docs/product/features/content.feature.capture-into-action.md +34 -0
- package/corpus/templates/content/docs/product/features/content.feature.cite-what-you-found.md +34 -0
- package/corpus/templates/content/docs/product/features/content.feature.collaborate-in-context.md +59 -0
- package/corpus/templates/content/docs/product/features/content.feature.collect-structured-input.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.connect-your-sources.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.data-that-keeps-itself-right.md +45 -0
- package/corpus/templates/content/docs/product/features/content.feature.durable-foundations.md +48 -0
- package/corpus/templates/content/docs/product/features/content.feature.evolve-systems-safely.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.explore-alternatives-safely.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.find-your-place-again.md +40 -0
- package/corpus/templates/content/docs/product/features/content.feature.keep-your-private-vault-private.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.living-references.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.make-the-workspace-yours.md +40 -0
- package/corpus/templates/content/docs/product/features/content.feature.move-without-starting-over.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.plan-work-across-time.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.publish-with-confidence.md +43 -0
- package/corpus/templates/content/docs/product/features/content.feature.put-your-organizations-know-how-to-work.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.read-and-annotate-anything.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.review-changes-in-place.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.run-projects-your-way.md +44 -0
- package/corpus/templates/content/docs/product/features/content.feature.see-your-information-your-way.md +44 -0
- package/corpus/templates/content/docs/product/features/content.feature.share-how-your-organization-works.md +38 -0
- package/corpus/templates/content/docs/product/features/content.feature.sketch-connections-keep-whats-true.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.take-the-whole-vault-with-you.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.trust-your-connected-sources.md +40 -0
- package/corpus/templates/content/docs/product/features/content.feature.understand-what-your-data-says.md +39 -0
- package/corpus/templates/content/docs/product/features/content.feature.when-this-happens-that-follows.md +43 -0
- package/corpus/templates/content/docs/product/features/content.feature.work-across-every-workspace.md +37 -0
- package/corpus/templates/content/docs/product/features/content.feature.work-on-content-inside-another-application.md +37 -0
- package/corpus/templates/content/docs/product/roadmap.md +878 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +1 -7
- package/corpus/templates/crm/app/i18n/en-US.ts +4 -0
- package/corpus/templates/crm/app/routes/settings.tsx +33 -8
- package/corpus/templates/crm/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +133 -63
- package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +19 -2
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +51 -14
- package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +41 -26
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +22 -4
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +216 -116
- package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +21 -2
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +5 -1
- package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbenchLoader.tsx +10 -2
- package/corpus/templates/design/app/components/design/code-workbench/code-workbench-shell.ts +2 -0
- package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +60 -55
- package/corpus/templates/design/app/components/design/design-canvas/content-size-report.ts +88 -2
- package/corpus/templates/design/app/components/design/multi-screen/board-surface-html.ts +3 -2
- package/corpus/templates/design/app/components/design/types.ts +4 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -5
- package/corpus/templates/design/app/pages/design-editor/clipboard-layer-source.ts +28 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +117 -0
- package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +3 -1
- package/corpus/templates/design/app/pages/design-editor/pending-edits.ts +120 -74
- package/corpus/templates/design/app/pages/design-editor/pending-structure-verification.ts +11 -0
- package/corpus/templates/design/app/pages/design-editor/react-semantic-handoff.ts +2 -0
- package/corpus/templates/design/app/pages/design-editor/source-location.ts +1 -1
- package/corpus/templates/design/changelog/2026-07-29-copy-rendered-ui-between-live-local-apps-and-design-files-wh.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-design-boards-stay-dark-and-viewport-height-content-keeps-it.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-design-frames-no-longer-grow-continuously-when-their-content.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-the-code-panel-and-apply-design-update-control-now-use-clear.md +6 -0
- package/corpus/templates/design/changelog/2026-07-29-the-tools-panel-now-keeps-extension-creation-and-discovery-h.md +6 -0
- package/corpus/templates/design/shared/source-mode.ts +7 -1
- package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +171 -0
- package/corpus/templates/dispatch/app/routes/browser-chat.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/browser-connect.tsx +4 -0
- package/corpus/templates/dispatch/changelog/2026-07-29-browser-chat-can-securely-connect-the-agent-native-chrome-ex.md +6 -0
- package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +1 -6
- package/corpus/templates/forms/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -5
- package/corpus/templates/macros/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +1 -9
- package/corpus/templates/mail/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +3 -7
- package/corpus/templates/plan/app/pages/PlansPage.tsx +2 -2
- package/corpus/templates/plan/changelog/2026-07-29-chat-history-now-closes-smoothly-and-stays-ready-when-you-re.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-29-chat-history-stays-visible-when-you-return-to-ask-plan.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-29-fixed-plan-pages-crashing-when-recent-activity-is-unavailabl.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +60 -4
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +20 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +30 -1
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +3 -1
- package/corpus/templates/slides/AGENTS.md +22 -24
- package/corpus/templates/slides/actions/check-image-gen.ts +8 -2
- package/corpus/templates/slides/actions/create-deck.ts +4 -12
- package/corpus/templates/slides/actions/export-pptx.ts +25 -3
- package/corpus/templates/slides/actions/generate-image-api.ts +4 -2
- package/corpus/templates/slides/actions/generate-slides-ai.ts +1 -1
- package/corpus/templates/slides/actions/get-deck-reference-context.ts +136 -0
- package/corpus/templates/slides/actions/get-workspace-defaults.ts +55 -0
- package/corpus/templates/slides/actions/image-gen-status.ts +10 -1
- package/corpus/templates/slides/actions/import-file.ts +53 -38
- package/corpus/templates/slides/actions/list-decks.ts +2 -0
- package/corpus/templates/slides/actions/patch-deck.ts +2 -0
- package/corpus/templates/slides/actions/set-workspace-defaults.ts +50 -0
- package/corpus/templates/slides/actions/view-screen.ts +6 -0
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +67 -3
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +40 -8
- package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +33 -8
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -2
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +114 -128
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +2 -1
- package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1193 -267
- package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +302 -102
- package/corpus/templates/slides/app/components/editor/rich-text-selection.ts +270 -0
- package/corpus/templates/slides/app/components/editor/slide-escape-arbiter.ts +34 -0
- package/corpus/templates/slides/app/components/editor/slide-object-interactions.ts +368 -0
- package/corpus/templates/slides/app/components/editor/slide-presence.ts +13 -0
- package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +23 -3
- package/corpus/templates/slides/app/components/layout/Layout.tsx +39 -6
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +1 -6
- package/corpus/templates/slides/app/components/layout/layout-route-policy.ts +23 -0
- package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +0 -2
- package/corpus/templates/slides/app/context/DeckContext.tsx +2 -0
- package/corpus/templates/slides/app/global.css +60 -0
- package/corpus/templates/slides/app/hooks/use-agent-generating.ts +76 -5
- package/corpus/templates/slides/app/hooks/use-workspace-defaults.ts +26 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +38 -3
- package/corpus/templates/slides/app/lib/generation-state.ts +13 -3
- package/corpus/templates/slides/app/lib/slide-image-replacement.ts +27 -6
- package/corpus/templates/slides/app/lib/text-tool-shortcut.ts +62 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +197 -83
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +95 -0
- package/corpus/templates/slides/app/pages/Index.tsx +348 -53
- package/corpus/templates/slides/changelog/2026-07-28-pick-an-existing-deck-as-a-style-reference-when-creating-a-n.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-ai-editing-status-is-now-quieter-and-only-shows-slide-presen.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-design-systems-and-reference-decks-are-easier-to-choose-toge.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-generated-decks-now-receive-a-concise-relevant-title-before-.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-new-deck-prompts-reuse-empty-chats.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-new-deck-setup-now-stays-in-the-editor-with-closable-style-a.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-selected-words-and-text-runs-can-now-be-styled-independently.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slide-annotation-tools-are-clearer-and-escape-now-exits-anno.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slide-editing-now-opens-with-the-app-navigation-collapsed-fo.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slide-editing-stays-visually-clean-on-hover-without-a-canvas.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-slides-now-appear-one-by-one-while-ai-builds-a-deck-with-ste.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-text-boxes-now-select-move-duplicate-resize-and-style-like-a.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-29-untitled-decks-now-use-a-clearer-this-deck-label-in-the-agen.md +6 -0
- package/corpus/templates/slides/server/handlers/image-providers/builder.ts +305 -0
- package/corpus/templates/slides/server/handlers/image-providers/index.ts +6 -3
- package/corpus/templates/slides/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/slides/server/workspace-defaults.ts +169 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +31 -8
- package/corpus/templates/tasks/app/i18n/en-US.ts +7 -0
- package/corpus/templates/tasks/app/routes/settings.tsx +25 -2
- package/corpus/templates/tasks/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +15 -0
- package/corpus/toolkit/README.md +2 -2
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/app-shell/sidebar-footer-actions.tsx +0 -3
- package/corpus/toolkit/src/chat-history.css +1 -0
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +35 -14
- package/corpus/toolkit/src/composer/PromptComposer.tsx +6 -0
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +11 -3
- package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +64 -11
- package/dist/action.d.ts +44 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +9 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.js +6 -4
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/production-agent.d.ts +11 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +131 -90
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/tool-search.d.ts +4 -0
- package/dist/agent/tool-search.d.ts.map +1 -1
- package/dist/agent/tool-search.js +30 -0
- package/dist/agent/tool-search.js.map +1 -1
- package/dist/automations/service.d.ts +85 -0
- package/dist/automations/service.d.ts.map +1 -0
- package/dist/automations/service.js +332 -0
- package/dist/automations/service.js.map +1 -0
- package/dist/browser-context/index.d.ts +579 -0
- package/dist/browser-context/index.d.ts.map +1 -0
- package/dist/browser-context/index.js +331 -0
- package/dist/browser-context/index.js.map +1 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +1 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/FeedbackButton.d.ts +6 -2
- package/dist/client/FeedbackButton.d.ts.map +1 -1
- package/dist/client/FeedbackButton.js +20 -3
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +19 -2
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts +15 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js +13 -3
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.d.ts +1 -0
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.js +186 -98
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +4 -4
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/agent-page/use-jobs.d.ts +7 -0
- package/dist/client/agent-page/use-jobs.d.ts.map +1 -1
- package/dist/client/agent-page/use-jobs.js.map +1 -1
- package/dist/client/analytics-session.d.ts.map +1 -1
- package/dist/client/analytics-session.js +13 -0
- package/dist/client/analytics-session.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +29 -6
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/settings/AutomationsSection.d.ts +0 -9
- package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
- package/dist/client/settings/AutomationsSection.js +9 -168
- package/dist/client/settings/AutomationsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +9 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +19 -11
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/index.d.ts +1 -1
- package/dist/client/settings/index.d.ts.map +1 -1
- package/dist/client/settings/index.js +1 -1
- package/dist/client/settings/index.js.map +1 -1
- package/dist/client/use-agent-chat.d.ts.map +1 -1
- package/dist/client/use-agent-chat.js +20 -3
- package/dist/client/use-agent-chat.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +4 -17
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +2 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/deploy/workspace-deploy.d.ts.map +1 -1
- package/dist/deploy/workspace-deploy.js +2 -1
- package/dist/deploy/workspace-deploy.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +82 -6
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/fetch-tool.d.ts.map +1 -1
- package/dist/extensions/fetch-tool.js +11 -0
- package/dist/extensions/fetch-tool.js.map +1 -1
- package/dist/extensions/routes.d.ts +5 -1
- package/dist/extensions/routes.d.ts.map +1 -1
- package/dist/extensions/routes.js +7 -1
- package/dist/extensions/routes.js.map +1 -1
- package/dist/extensions/web-content.d.ts +1 -0
- package/dist/extensions/web-content.d.ts.map +1 -1
- package/dist/extensions/web-content.js +82 -1
- package/dist/extensions/web-content.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/integrations/computer-supervision.d.ts.map +1 -1
- package/dist/integrations/computer-supervision.js +22 -1
- package/dist/integrations/computer-supervision.js.map +1 -1
- package/dist/integrations/index.d.ts +3 -2
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +3 -2
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/integration-durable-dispatch-config.d.ts +2 -0
- package/dist/integrations/integration-durable-dispatch-config.d.ts.map +1 -1
- package/dist/integrations/integration-durable-dispatch-config.js +4 -0
- package/dist/integrations/integration-durable-dispatch-config.js.map +1 -1
- package/dist/integrations/integration-durable-dispatch.d.ts +2 -2
- package/dist/integrations/integration-durable-dispatch.d.ts.map +1 -1
- package/dist/integrations/integration-durable-dispatch.js +2 -2
- package/dist/integrations/integration-durable-dispatch.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +84 -39
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/remote-browser-actions.d.ts +7 -0
- package/dist/integrations/remote-browser-actions.d.ts.map +1 -0
- package/dist/integrations/remote-browser-actions.js +482 -0
- package/dist/integrations/remote-browser-actions.js.map +1 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -1
- package/dist/jobs/actions/list-recurring-jobs.js +4 -6
- package/dist/jobs/actions/list-recurring-jobs.js.map +1 -1
- package/dist/jobs/actions/manage-recurring-job.js +3 -6
- package/dist/jobs/actions/manage-recurring-job.js.map +1 -1
- package/dist/jobs/background-automation-runner.d.ts +76 -0
- package/dist/jobs/background-automation-runner.d.ts.map +1 -0
- package/dist/jobs/background-automation-runner.js +288 -0
- package/dist/jobs/background-automation-runner.js.map +1 -0
- package/dist/jobs/frontmatter.d.ts +63 -0
- package/dist/jobs/frontmatter.d.ts.map +1 -0
- package/dist/jobs/frontmatter.js +216 -0
- package/dist/jobs/frontmatter.js.map +1 -0
- package/dist/jobs/scheduler.d.ts +6 -60
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +67 -484
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +24 -3
- package/dist/jobs/tools.js.map +1 -1
- package/dist/localization/default-messages.d.ts +28 -33
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +34 -39
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +4 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/notifications/actions.d.ts.map +1 -1
- package/dist/notifications/actions.js +5 -0
- package/dist/notifications/actions.js.map +1 -1
- package/dist/notifications/routes.d.ts +6 -6
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/actions.d.ts.map +1 -1
- package/dist/progress/actions.js +5 -0
- package/dist/progress/actions.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/github-repo-files.d.ts.map +1 -1
- package/dist/provider-api/actions/github-repo-files.js +9 -0
- package/dist/provider-api/actions/github-repo-files.js.map +1 -1
- package/dist/provider-api/actions/provider-api.d.ts +16 -16
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
- package/dist/provider-api/actions/provider-api.js +14 -0
- package/dist/provider-api/actions/provider-api.js.map +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +5 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/browser-team-tools.js +90 -3
- package/dist/server/agent-chat/browser-team-tools.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +7 -11
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat/plugin-options.d.ts +3 -3
- package/dist/server/agent-chat/plugin-options.js.map +1 -1
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
- package/dist/server/agent-chat/script-entries.js +43 -1
- package/dist/server/agent-chat/script-entries.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +24 -5
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/attribution.d.ts +6 -0
- package/dist/server/attribution.d.ts.map +1 -1
- package/dist/server/attribution.js +14 -14
- package/dist/server/attribution.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +5 -2
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +2 -1
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +6 -3
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +7 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +3 -1
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/csrf.d.ts.map +1 -1
- package/dist/server/csrf.js +25 -0
- package/dist/server/csrf.js.map +1 -1
- package/dist/server/google-oauth.d.ts +3 -0
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +12 -1
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +18 -0
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/prompts/framework-core-compact.js +3 -3
- package/dist/server/prompts/framework-core-compact.js.map +1 -1
- package/dist/server/prompts/framework-core.js +3 -3
- package/dist/server/prompts/framework-core.js.map +1 -1
- package/dist/server/prompts/shared-rules.js +3 -3
- package/dist/server/prompts/shared-rules.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.d.ts.map +1 -1
- package/dist/settings/index.js +1 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/shared/analytics-anonymous-id.d.ts +12 -0
- package/dist/shared/analytics-anonymous-id.d.ts.map +1 -0
- package/dist/shared/analytics-anonymous-id.js +29 -0
- package/dist/shared/analytics-anonymous-id.js.map +1 -0
- package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +1 -5
- package/dist/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/default/app/i18n/ar-SA.ts +26 -0
- package/dist/templates/default/app/i18n/de-DE.ts +28 -0
- package/dist/templates/default/app/i18n/en-US.ts +27 -0
- package/dist/templates/default/app/i18n/es-ES.ts +28 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +28 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +25 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +27 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +27 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +27 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +24 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +24 -0
- package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
- package/dist/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
- package/dist/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
- package/dist/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
- package/dist/tracking/providers.d.ts.map +1 -1
- package/dist/tracking/providers.js +1 -0
- package/dist/tracking/providers.js.map +1 -1
- package/dist/tracking/registry.d.ts +1 -0
- package/dist/tracking/registry.d.ts.map +1 -1
- package/dist/tracking/registry.js +1 -0
- package/dist/tracking/registry.js.map +1 -1
- package/dist/tracking/types.d.ts +1 -0
- package/dist/tracking/types.d.ts.map +1 -1
- package/dist/tracking/types.js.map +1 -1
- package/dist/triggers/actions/list-automations.d.ts +7 -0
- package/dist/triggers/actions/list-automations.d.ts.map +1 -1
- package/dist/triggers/actions/list-automations.js +29 -41
- package/dist/triggers/actions/list-automations.js.map +1 -1
- package/dist/triggers/actions/manage-automation.js +15 -33
- package/dist/triggers/actions/manage-automation.js.map +1 -1
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +184 -95
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/dispatcher.d.ts +3 -9
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +134 -304
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/routes.d.ts.map +1 -1
- package/dist/triggers/routes.js +76 -17
- package/dist/triggers/routes.js.map +1 -1
- package/dist/triggers/types.d.ts +4 -23
- package/dist/triggers/types.d.ts.map +1 -1
- package/dist/triggers/types.js.map +1 -1
- package/docs/content/agent-surfaces.mdx +4 -4
- package/docs/content/automations.mdx +61 -12
- package/docs/content/deployment.mdx +11 -4
- package/docs/content/extensions.mdx +39 -33
- package/docs/content/recurring-jobs.mdx +41 -19
- package/docs/content/template-dispatch-operations.mdx +19 -7
- package/package.json +4 -2
- package/src/action.ts +55 -0
- package/src/agent/engine/builder-engine.ts +8 -4
- package/src/agent/production-agent.ts +175 -100
- package/src/agent/tool-search.ts +36 -0
- package/src/automations/service.ts +506 -0
- package/src/browser-context/index.ts +392 -0
- package/src/client/AgentPanel.tsx +2 -1
- package/src/client/FeedbackButton.tsx +37 -4
- package/src/client/MultiTabAssistantChat.tsx +21 -0
- package/src/client/agent-chat.ts +31 -3
- package/src/client/agent-page/AgentJobsTab.tsx +438 -310
- package/src/client/agent-page/AgentTabsPage.tsx +4 -4
- package/src/client/agent-page/use-jobs.ts +7 -0
- package/src/client/analytics-session.ts +13 -0
- package/src/client/extensions/ExtensionViewer.tsx +67 -0
- package/src/client/settings/AutomationsSection.tsx +27 -499
- package/src/client/settings/SettingsPanel.tsx +32 -11
- package/src/client/settings/index.ts +2 -0
- package/src/client/use-agent-chat.ts +35 -3
- package/src/client/use-chat-threads.ts +8 -25
- package/src/deploy/build.ts +2 -0
- package/src/deploy/workspace-deploy.ts +2 -0
- package/src/extensions/actions.ts +115 -3
- package/src/extensions/fetch-tool.ts +11 -0
- package/src/extensions/routes.ts +16 -1
- package/src/extensions/web-content.ts +96 -1
- package/src/integrations/computer-supervision.ts +33 -1
- package/src/integrations/index.ts +6 -0
- package/src/integrations/integration-durable-dispatch-config.ts +10 -0
- package/src/integrations/integration-durable-dispatch.ts +4 -0
- package/src/integrations/plugin.ts +94 -41
- package/src/integrations/remote-browser-actions.ts +621 -0
- package/src/jobs/actions/list-recurring-jobs.ts +5 -7
- package/src/jobs/actions/manage-recurring-job.ts +3 -7
- package/src/jobs/background-automation-runner.ts +437 -0
- package/src/jobs/frontmatter.ts +308 -0
- package/src/jobs/scheduler.ts +89 -598
- package/src/jobs/tools.ts +22 -3
- package/src/localization/default-messages.ts +45 -45
- package/src/mcp-client/index.ts +6 -0
- package/src/notifications/actions.ts +5 -0
- package/src/progress/actions.ts +5 -0
- package/src/provider-api/actions/github-repo-files.ts +11 -0
- package/src/provider-api/actions/provider-api.ts +13 -0
- package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +4 -4
- package/src/server/action-discovery.ts +7 -0
- package/src/server/agent-chat/browser-team-tools.ts +126 -3
- package/src/server/agent-chat/framework-prompts.ts +7 -11
- package/src/server/agent-chat/plugin-options.ts +3 -3
- package/src/server/agent-chat/script-entries.ts +52 -1
- package/src/server/agent-chat-plugin.ts +25 -5
- package/src/server/attribution.ts +22 -0
- package/src/server/auth.ts +20 -6
- package/src/server/better-auth-instance.ts +10 -2
- package/src/server/core-routes-plugin.ts +10 -1
- package/src/server/csrf.ts +25 -0
- package/src/server/google-oauth.ts +21 -1
- package/src/server/onboarding-html.ts +18 -0
- package/src/server/prompts/framework-core-compact.ts +3 -3
- package/src/server/prompts/framework-core.ts +3 -3
- package/src/server/prompts/shared-rules.ts +3 -3
- package/src/settings/index.ts +1 -0
- package/src/shared/analytics-anonymous-id.ts +35 -0
- package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/chat/app/components/layout/Sidebar.tsx +1 -5
- package/src/templates/chat/changelog/2026-07-29-sidebar-footers-now-keep-feedback-search-and-collapse-togeth.md +6 -0
- package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/default/app/i18n/ar-SA.ts +26 -0
- package/src/templates/default/app/i18n/de-DE.ts +28 -0
- package/src/templates/default/app/i18n/en-US.ts +27 -0
- package/src/templates/default/app/i18n/es-ES.ts +28 -0
- package/src/templates/default/app/i18n/fr-FR.ts +28 -0
- package/src/templates/default/app/i18n/hi-IN.ts +25 -0
- package/src/templates/default/app/i18n/ja-JP.ts +27 -0
- package/src/templates/default/app/i18n/ko-KR.ts +27 -0
- package/src/templates/default/app/i18n/pt-BR.ts +27 -0
- package/src/templates/default/app/i18n/zh-CN.ts +24 -0
- package/src/templates/default/app/i18n/zh-TW.ts +24 -0
- package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +10 -7
- package/src/templates/workspace-core/.agents/skills/automations/SKILL.md +53 -8
- package/src/templates/workspace-core/.agents/skills/browser-sessions/SKILL.md +131 -0
- package/src/templates/workspace-core/.agents/skills/extension-points/SKILL.md +13 -4
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +23 -15
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +33 -18
- package/src/tracking/providers.ts +1 -0
- package/src/tracking/registry.ts +2 -1
- package/src/tracking/types.ts +1 -0
- package/src/triggers/actions/list-automations.ts +43 -44
- package/src/triggers/actions/manage-automation.ts +17 -48
- package/src/triggers/actions.ts +218 -127
- package/src/triggers/dispatcher.ts +181 -367
- package/src/triggers/routes.ts +84 -27
- package/src/triggers/types.ts +9 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,GAGpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAM3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,mCAAmC,EACnC,gCAAgC,EAChC,wBAAwB,GAGzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,8BAA8B,GAE/B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GAGpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,cAAc,GAGf,MAAM,cAAc,CAAC;AACtB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B,CAC/B,OAAyB,EACzB,IAAa,EACb,WAAmB;IAEnB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAE,MAAc,EAAE,QAAQ,CAAC;YACvD,CAAC,CAAG,MAAc,CAAC,QAAsB;YACzC,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,8BAA8B,CAAC,OAAO,CAAC,CAAC;YACzD,IACE,QAAQ,EAAE,GAAG,KAAK,WAAW;gBAC7B,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EACnC,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CACV,gDAAgD,WAAW,KAAK,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,CACtF,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * MCP client module — symmetric counterpart to `@agent-native/core/mcp`\n * (the MCP server). Connects to local MCP servers configured in\n * `mcp.config.json` or the `MCP_SERVERS` env var and exposes their tools\n * to the agent-chat tool-use loop.\n */\n\nexport {\n loadMcpConfig,\n autoDetectMcpConfig,\n type McpConfig,\n type McpServerConfig,\n} from \"./config.js\";\n\nexport {\n McpClientManager,\n buildMcpToolName,\n parseMcpToolName,\n MCP_TOOL_PREFIX,\n type McpTool,\n type McpClientManagerOptions,\n} from \"./manager.js\";\n\nexport {\n listRemoteServers,\n addRemoteServer,\n addOAuthRemoteServer,\n addFirstPartyRemoteServer,\n isFirstPartyRemoteEndpointTrusted,\n removeRemoteServer,\n validateRemoteUrl,\n normalizeServerName,\n mergedConfigKey,\n parseMergedKey,\n hashEmail,\n toHttpServerConfig,\n toHttpServerConfigAsync,\n materializeHeaders,\n type RemoteMcpScope,\n type StoredRemoteMcpServer,\n} from \"./remote-store.js\";\n\nexport {\n finishMcpOAuthAuthorization,\n getMcpOAuthAccessToken,\n readMcpOAuthCredentials,\n saveMcpOAuthCredentials,\n startMcpOAuthAuthorization,\n type McpOAuthCallbackResult,\n type McpOAuthCredentialBundle,\n type McpOAuthDiscoveryState,\n type McpOAuthProviderOptions,\n type McpOAuthStartResult,\n} from \"./oauth-client.js\";\n\nexport {\n areBuiltinMcpCapabilitiesSupported,\n BUILTIN_MCP_CAPABILITIES,\n getBuiltinMcpCapability,\n isBuiltinMcpCapabilityAvailable,\n listSupportedBuiltinMcpCapabilities,\n normalizeBuiltinMcpCapabilityIds,\n toBuiltinMcpServerConfig,\n type BuiltinMcpCapability,\n type BuiltinMcpCapabilityId,\n} from \"./builtin-capabilities.js\";\n\nexport {\n builtinMcpCapabilitiesSettingsKey,\n listEnabledBuiltinMcpCapabilities,\n setEnabledBuiltinMcpCapabilities,\n setBuiltinMcpCapabilityEnabled,\n type StoredBuiltinMcpCapabilities,\n} from \"./builtin-store.js\";\n\nexport {\n mountMcpServersRoutes,\n buildMergedConfig,\n builtinMergedConfigKey,\n startMcpConfigRefresh,\n type ClientBuiltinCapability,\n} from \"./routes.js\";\n\nexport {\n mountMcpHubRoutes,\n listHubServers,\n getHubStatus,\n isHubServeEnabled,\n isHubConsumeEnabled,\n type HubServerRecord,\n type HubServersResponse,\n} from \"./hub-routes.js\";\n\nexport { fetchHubServers } from \"./hub-client.js\";\n\nexport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n callMcpTool,\n listVisibleMcpTools,\n McpAppApiError,\n type AppMcpTool,\n type ListVisibleMcpToolsOptions,\n} from \"./app-api.js\";\nimport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n classifyMcpToolCall,\n evaluateMcpToolCallPolicy,\n type McpToolCallClassification,\n type McpToolEffect,\n type McpToolFamily,\n type McpToolInvocationPolicy,\n type McpToolPolicyDecision,\n} from \"./tool-policy.js\";\nexport {\n configureScreenMemory,\n queryScreenMemoryForAgent,\n queryScreenMemoryContext,\n readScreenMemoryStatus,\n type ScreenMemoryConfig,\n type ScreenMemoryAgentQueryResult,\n type ScreenMemoryContextItem,\n type ScreenMemoryCoverageGap,\n type ScreenMemoryEvidenceItem,\n type ScreenMemoryEvidenceSourceType,\n type ScreenMemoryQueryResult,\n type ScreenMemoryRetrievalCoverage,\n type ScreenMemorySegmentReference,\n type ScreenMemoryStatus,\n type ScreenMemoryTimeRange,\n type ScreenMemoryTruncation,\n} from \"./screen-memory-local.js\";\nexport {\n MCP_ACTION_RESULT_MARKER,\n isMcpActionResult,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport {\n getToolUiResourceUri,\n isToolVisibilityAppOnly,\n isToolVisibilityModelOnly,\n} from \"@modelcontextprotocol/ext-apps/app-bridge\";\n\nimport { MCP_APP_MIME_TYPE } from \"../action.js\";\nimport type { EngineToolResultImagePart } from \"../agent/engine/types.js\";\n/**\n * Convert MCP tools into `ActionEntry` values suitable for registration in\n * the agent's action registry. Each tool is marked `http: false` so it's\n * never auto-mounted as an HTTP endpoint — MCP tools are agent-only.\n */\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { normalizeToolResultImages } from \"../agent/tool-result-images.js\";\nimport {\n MCP_ACTION_RESULT_MARKER,\n toolForMcpAppPayload,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport type { McpClientManager, McpTool } from \"./manager.js\";\nimport {\n evaluateMcpToolCallPolicy,\n type McpToolInvocationPolicy,\n} from \"./tool-policy.js\";\n\nexport interface McpActionEntryOptions {\n invocationPolicy?: McpToolInvocationPolicy;\n /** Restrict the generated entries to an explicit background capability set. */\n toolNames?: readonly string[];\n}\n\nexport function mcpToolsToActionEntries(\n manager: McpClientManager,\n options: McpActionEntryOptions = {},\n): Record<string, ActionEntry> {\n const entries: Record<string, ActionEntry> = {};\n const selectedToolNames = options.toolNames\n ? new Set(options.toolNames)\n : undefined;\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n if (selectedToolNames && !selectedToolNames.has(tool.name)) continue;\n entries[tool.name] = mcpToolToActionEntry(manager, tool, options);\n }\n return entries;\n}\n\n/**\n * Mutate a target action dict in place so it matches the current MCP tool set:\n * - adds new `mcp__*` keys that aren't in target,\n * - removes `mcp__*` keys that no longer exist in the manager,\n * - leaves non-MCP keys untouched.\n *\n * Used by the agent-chat plugin to keep its `prodActions` / `devActions`\n * registries in sync after `McpClientManager.reconfigure()` runs.\n */\nexport function syncMcpActionEntries(\n manager: McpClientManager,\n target: Record<string, ActionEntry>,\n): void {\n const current = new Set<string>();\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n current.add(tool.name);\n target[tool.name] = mcpToolToActionEntry(manager, tool);\n }\n for (const key of Object.keys(target)) {\n if (key.startsWith(\"mcp__\") && !current.has(key)) {\n delete target[key];\n }\n }\n}\n\nfunction mcpToolToActionEntry(\n manager: McpClientManager,\n tool: McpTool,\n options: McpActionEntryOptions = {},\n): ActionEntry {\n return {\n tool: {\n description: tool.description,\n parameters: tool.inputSchema as any,\n },\n http: false,\n ...(tool.annotations?.readOnlyHint === true ? { readOnly: true } : {}),\n run: async (args: Record<string, unknown>) => {\n // Defense-in-depth: even if a cross-scope MCP tool somehow makes it\n // into the LLM's visible tool list, reject invocation here so we never\n // execute a user's credentials on behalf of another user.\n if (!isMcpToolAllowedForRequest(tool.name)) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is not available in the current request scope.`,\n );\n }\n if (options.invocationPolicy) {\n const decision = evaluateMcpToolCallPolicy(\n options.invocationPolicy,\n tool,\n args,\n );\n if (!decision.allowed) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is unavailable in read-only mode: ${decision.reason}.`,\n );\n }\n }\n try {\n const result = await manager.callTool(tool.name, args);\n return await buildMcpActionResult(manager, tool, args, result);\n } catch (err: any) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error calling MCP tool ${tool.name}: ${err?.message ?? err}`,\n );\n }\n },\n };\n}\n\nfunction isVisibleToModel(tool: McpTool): boolean {\n try {\n return !isToolVisibilityAppOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function isVisibleToMcpApp(tool: McpTool): boolean {\n try {\n return !isToolVisibilityModelOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function flattenMcpToolResult(result: unknown): string {\n if (\n result &&\n typeof result === \"object\" &&\n Array.isArray((result as any).content)\n ) {\n const parts = (result as any).content as Array<Record<string, any>>;\n const text = parts.map(formatMcpContentPart).join(\"\\n\");\n const fallback =\n text ||\n (hasStructuredContent(result)\n ? JSON.stringify((result as any).structuredContent, null, 2)\n : \"(no output)\");\n if ((result as any).isError) return `Error: ${fallback}`;\n return fallback;\n }\n return typeof result === \"string\" ? result : JSON.stringify(result);\n}\n\nfunction formatMcpContentPart(part: Record<string, any>): string {\n if (part?.type === \"text\" && typeof part.text === \"string\") {\n return part.text;\n }\n if (part?.type === \"image\") {\n return `[image: ${part?.mimeType ?? \"unknown\"}]`;\n }\n if (part?.type === \"resource\") {\n const resource = part.resource ?? {};\n const uri = typeof resource.uri === \"string\" ? ` ${resource.uri}` : \"\";\n return `[resource: ${resource.mimeType ?? \"unknown\"}${uri}]`;\n }\n if (part?.type === \"resource_link\") {\n const uri = typeof part.uri === \"string\" ? ` ${part.uri}` : \"\";\n return `[resource: ${part.mimeType ?? \"unknown\"}${uri}]`;\n }\n return JSON.stringify(part);\n}\n\nfunction hasStructuredContent(result: unknown): boolean {\n return (\n !!result &&\n typeof result === \"object\" &&\n Object.prototype.hasOwnProperty.call(result, \"structuredContent\")\n );\n}\n\n/**\n * Extract vision images from a raw MCP tool result so the model can SEE\n * screenshots/previews returned by external MCP tools instead of only the\n * `[image: <mime>]` placeholder that `flattenMcpToolResult` leaves in the\n * text. Shares the per-result caps with `_agentImages` (max count, max base64\n * size); over-cap or unsupported images stay placeholder-only. Never throws.\n */\nexport function extractMcpToolResultImages(\n result: unknown,\n): EngineToolResultImagePart[] {\n if (\n !result ||\n typeof result !== \"object\" ||\n !Array.isArray((result as any).content) ||\n (result as any).isError\n ) {\n return [];\n }\n const candidates = ((result as any).content as Array<Record<string, any>>)\n .filter((part) => part?.type === \"image\" && typeof part.data === \"string\")\n .map((part) => ({\n data: part.data as string,\n mediaType: typeof part.mimeType === \"string\" ? part.mimeType : undefined,\n }));\n return normalizeToolResultImages(candidates).images;\n}\n\nasync function buildMcpActionResult(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<McpActionResult> {\n const text = flattenMcpToolResult(raw);\n const mcpApp = await extractMcpAppPayload(manager, tool, input, raw);\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw,\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n ...(mcpApp ? { mcpApp } : {}),\n };\n}\n\nfunction buildMcpErrorActionResult(\n tool: McpTool,\n input: Record<string, unknown>,\n text: string,\n): McpActionResult {\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw: {\n isError: true,\n content: [{ type: \"text\", text }],\n },\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n };\n}\n\nasync function extractMcpAppPayload(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<AgentMcpAppPayload | undefined> {\n const inlineResource = findInlineMcpAppResource(raw);\n const resourceUri =\n inlineResource?.uri ??\n resourceUriFromTool(tool) ??\n resourceUriFromResult(raw);\n if (!resourceUri) return undefined;\n\n const resource =\n inlineResource ?? (await readMcpAppResource(manager, tool, resourceUri));\n\n return {\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n resourceUri,\n toolInput: input,\n toolResult:\n raw && typeof raw === \"object\"\n ? ({ ...(raw as Record<string, unknown>) } as Record<string, unknown>)\n : { content: [{ type: \"text\", text: String(raw ?? \"\") }] },\n tool: toolForMcpAppPayload(tool),\n ...(resource ? { resource } : {}),\n };\n}\n\nfunction resourceUriFromTool(tool: McpTool): string | undefined {\n try {\n return getToolUiResourceUri(tool.raw as any);\n } catch {\n return undefined;\n }\n}\n\nfunction resourceUriFromResult(raw: unknown): string | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const meta = (raw as any)._meta;\n const nested = meta?.ui?.resourceUri;\n if (typeof nested === \"string\" && nested.startsWith(\"ui://\")) return nested;\n const flat = meta?.[\"ui/resourceUri\"] ?? meta?.[\"ui.resourceUri\"];\n if (typeof flat === \"string\" && flat.startsWith(\"ui://\")) return flat;\n return findInlineMcpAppResource(raw)?.uri;\n}\n\nfunction findInlineMcpAppResource(\n raw: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const content = Array.isArray((raw as any).content)\n ? ((raw as any).content as unknown[])\n : [];\n for (const part of content) {\n const resource = normalizeMcpAppResourceContent(part);\n if (resource) return resource;\n }\n return undefined;\n}\n\nfunction normalizeMcpAppResourceContent(\n part: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!part || typeof part !== \"object\") return undefined;\n const candidate =\n (part as any).type === \"resource\"\n ? (part as any).resource\n : ((part as any).resource ?? part);\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const uri = (candidate as any).uri;\n if (typeof uri !== \"string\" || !uri.startsWith(\"ui://\")) return undefined;\n const mimeType =\n typeof (candidate as any).mimeType === \"string\"\n ? (candidate as any).mimeType\n : undefined;\n if (mimeType && !mimeType.includes(MCP_APP_MIME_TYPE)) return undefined;\n const text =\n typeof (candidate as any).text === \"string\"\n ? (candidate as any).text\n : undefined;\n const blob =\n typeof (candidate as any).blob === \"string\"\n ? (candidate as any).blob\n : undefined;\n const meta =\n (candidate as any)._meta && typeof (candidate as any)._meta === \"object\"\n ? ((candidate as any)._meta as Record<string, unknown>)\n : (part as any)._meta && typeof (part as any)._meta === \"object\"\n ? ((part as any)._meta as Record<string, unknown>)\n : undefined;\n return {\n uri,\n ...(mimeType ? { mimeType } : {}),\n ...(text ? { text } : {}),\n ...(blob ? { blob } : {}),\n ...(meta ? { _meta: meta } : {}),\n };\n}\n\nasync function readMcpAppResource(\n manager: McpClientManager,\n tool: McpTool,\n resourceUri: string,\n): Promise<AgentMcpAppResourceContent | undefined> {\n try {\n const result = await manager.readResourceForTool(tool.name, resourceUri);\n const contents = Array.isArray((result as any)?.contents)\n ? ((result as any).contents as unknown[])\n : [];\n for (const content of contents) {\n const resource = normalizeMcpAppResourceContent(content);\n if (\n resource?.uri === resourceUri ||\n (resource && contents.length === 1)\n ) {\n return resource;\n }\n }\n } catch (err: any) {\n console.warn(\n `[mcp-client] Failed to read MCP App resource ${resourceUri}: ${err?.message ?? err}`,\n );\n }\n return undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-client/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,GAGpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EACzB,iCAAiC,EACjC,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAM3B,MAAM,mBAAmB,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,EAAE,GAAG,KAAK,WAAW;gBAC7B,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EACnC,CAAC;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CACV,gDAAgD,WAAW,KAAK,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,CACtF,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/**\n * MCP client module — symmetric counterpart to `@agent-native/core/mcp`\n * (the MCP server). Connects to local MCP servers configured in\n * `mcp.config.json` or the `MCP_SERVERS` env var and exposes their tools\n * to the agent-chat tool-use loop.\n */\n\nexport {\n loadMcpConfig,\n autoDetectMcpConfig,\n type McpConfig,\n type McpServerConfig,\n} from \"./config.js\";\n\nexport {\n McpClientManager,\n buildMcpToolName,\n parseMcpToolName,\n MCP_TOOL_PREFIX,\n type McpTool,\n type McpClientManagerOptions,\n} from \"./manager.js\";\n\nexport {\n listRemoteServers,\n addRemoteServer,\n addOAuthRemoteServer,\n addFirstPartyRemoteServer,\n isFirstPartyRemoteEndpointTrusted,\n removeRemoteServer,\n validateRemoteUrl,\n normalizeServerName,\n mergedConfigKey,\n parseMergedKey,\n hashEmail,\n toHttpServerConfig,\n toHttpServerConfigAsync,\n materializeHeaders,\n type RemoteMcpScope,\n type StoredRemoteMcpServer,\n} from \"./remote-store.js\";\n\nexport {\n finishMcpOAuthAuthorization,\n getMcpOAuthAccessToken,\n readMcpOAuthCredentials,\n saveMcpOAuthCredentials,\n startMcpOAuthAuthorization,\n type McpOAuthCallbackResult,\n type McpOAuthCredentialBundle,\n type McpOAuthDiscoveryState,\n type McpOAuthProviderOptions,\n type McpOAuthStartResult,\n} from \"./oauth-client.js\";\n\nexport {\n areBuiltinMcpCapabilitiesSupported,\n BUILTIN_MCP_CAPABILITIES,\n getBuiltinMcpCapability,\n isBuiltinMcpCapabilityAvailable,\n listSupportedBuiltinMcpCapabilities,\n normalizeBuiltinMcpCapabilityIds,\n toBuiltinMcpServerConfig,\n type BuiltinMcpCapability,\n type BuiltinMcpCapabilityId,\n} from \"./builtin-capabilities.js\";\n\nexport {\n builtinMcpCapabilitiesSettingsKey,\n listEnabledBuiltinMcpCapabilities,\n setEnabledBuiltinMcpCapabilities,\n setBuiltinMcpCapabilityEnabled,\n type StoredBuiltinMcpCapabilities,\n} from \"./builtin-store.js\";\n\nexport {\n mountMcpServersRoutes,\n buildMergedConfig,\n builtinMergedConfigKey,\n startMcpConfigRefresh,\n type ClientBuiltinCapability,\n} from \"./routes.js\";\n\nexport {\n mountMcpHubRoutes,\n listHubServers,\n getHubStatus,\n isHubServeEnabled,\n isHubConsumeEnabled,\n type HubServerRecord,\n type HubServersResponse,\n} from \"./hub-routes.js\";\n\nexport { fetchHubServers } from \"./hub-client.js\";\n\nexport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n callMcpTool,\n listVisibleMcpTools,\n McpAppApiError,\n type AppMcpTool,\n type ListVisibleMcpToolsOptions,\n} from \"./app-api.js\";\nimport { isMcpToolAllowedForRequest } from \"./visibility.js\";\nexport {\n classifyMcpToolCall,\n evaluateMcpToolCallPolicy,\n type McpToolCallClassification,\n type McpToolEffect,\n type McpToolFamily,\n type McpToolInvocationPolicy,\n type McpToolPolicyDecision,\n} from \"./tool-policy.js\";\nexport {\n configureScreenMemory,\n queryScreenMemoryForAgent,\n queryScreenMemoryContext,\n readScreenMemoryStatus,\n type ScreenMemoryConfig,\n type ScreenMemoryAgentQueryResult,\n type ScreenMemoryContextItem,\n type ScreenMemoryCoverageGap,\n type ScreenMemoryEvidenceItem,\n type ScreenMemoryEvidenceSourceType,\n type ScreenMemoryQueryResult,\n type ScreenMemoryRetrievalCoverage,\n type ScreenMemorySegmentReference,\n type ScreenMemoryStatus,\n type ScreenMemoryTimeRange,\n type ScreenMemoryTruncation,\n} from \"./screen-memory-local.js\";\nexport {\n MCP_ACTION_RESULT_MARKER,\n isMcpActionResult,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport {\n getToolUiResourceUri,\n isToolVisibilityAppOnly,\n isToolVisibilityModelOnly,\n} from \"@modelcontextprotocol/ext-apps/app-bridge\";\n\nimport { MCP_APP_MIME_TYPE } from \"../action.js\";\nimport type { EngineToolResultImagePart } from \"../agent/engine/types.js\";\n/**\n * Convert MCP tools into `ActionEntry` values suitable for registration in\n * the agent's action registry. Each tool is marked `http: false` so it's\n * never auto-mounted as an HTTP endpoint — MCP tools are agent-only.\n */\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { normalizeToolResultImages } from \"../agent/tool-result-images.js\";\nimport {\n MCP_ACTION_RESULT_MARKER,\n toolForMcpAppPayload,\n type AgentMcpAppPayload,\n type AgentMcpAppResourceContent,\n type McpActionResult,\n} from \"./app-result.js\";\nimport type { McpClientManager, McpTool } from \"./manager.js\";\nimport {\n evaluateMcpToolCallPolicy,\n type McpToolInvocationPolicy,\n} from \"./tool-policy.js\";\n\nexport interface McpActionEntryOptions {\n invocationPolicy?: McpToolInvocationPolicy;\n /** Restrict the generated entries to an explicit background capability set. */\n toolNames?: readonly string[];\n}\n\nexport function mcpToolsToActionEntries(\n manager: McpClientManager,\n options: McpActionEntryOptions = {},\n): Record<string, ActionEntry> {\n const entries: Record<string, ActionEntry> = {};\n const selectedToolNames = options.toolNames\n ? new Set(options.toolNames)\n : undefined;\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n if (selectedToolNames && !selectedToolNames.has(tool.name)) continue;\n entries[tool.name] = mcpToolToActionEntry(manager, tool, options);\n }\n return entries;\n}\n\n/**\n * Mutate a target action dict in place so it matches the current MCP tool set:\n * - adds new `mcp__*` keys that aren't in target,\n * - removes `mcp__*` keys that no longer exist in the manager,\n * - leaves non-MCP keys untouched.\n *\n * Used by the agent-chat plugin to keep its `prodActions` / `devActions`\n * registries in sync after `McpClientManager.reconfigure()` runs.\n */\nexport function syncMcpActionEntries(\n manager: McpClientManager,\n target: Record<string, ActionEntry>,\n): void {\n const current = new Set<string>();\n for (const tool of manager.getTools().filter(isVisibleToModel)) {\n current.add(tool.name);\n target[tool.name] = mcpToolToActionEntry(manager, tool);\n }\n for (const key of Object.keys(target)) {\n if (key.startsWith(\"mcp__\") && !current.has(key)) {\n delete target[key];\n }\n }\n}\n\nfunction mcpToolToActionEntry(\n manager: McpClientManager,\n tool: McpTool,\n options: McpActionEntryOptions = {},\n): ActionEntry {\n return {\n tool: {\n description: tool.description,\n parameters: tool.inputSchema as any,\n },\n http: false,\n planMode: {\n effect: (args) =>\n evaluateMcpToolCallPolicy({ mode: \"read-only\" }, tool, args).effect,\n description:\n \"Plan mode allows MCP calls classified as read-only from annotations, operation names, and runtime arguments.\",\n },\n ...(tool.annotations?.readOnlyHint === true ? { readOnly: true } : {}),\n run: async (args: Record<string, unknown>) => {\n // Defense-in-depth: even if a cross-scope MCP tool somehow makes it\n // into the LLM's visible tool list, reject invocation here so we never\n // execute a user's credentials on behalf of another user.\n if (!isMcpToolAllowedForRequest(tool.name)) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is not available in the current request scope.`,\n );\n }\n if (options.invocationPolicy) {\n const decision = evaluateMcpToolCallPolicy(\n options.invocationPolicy,\n tool,\n args,\n );\n if (!decision.allowed) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error: MCP tool ${tool.name} is unavailable in read-only mode: ${decision.reason}.`,\n );\n }\n }\n try {\n const result = await manager.callTool(tool.name, args);\n return await buildMcpActionResult(manager, tool, args, result);\n } catch (err: any) {\n return buildMcpErrorActionResult(\n tool,\n args,\n `Error calling MCP tool ${tool.name}: ${err?.message ?? err}`,\n );\n }\n },\n };\n}\n\nfunction isVisibleToModel(tool: McpTool): boolean {\n try {\n return !isToolVisibilityAppOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function isVisibleToMcpApp(tool: McpTool): boolean {\n try {\n return !isToolVisibilityModelOnly(tool.raw as any);\n } catch {\n return true;\n }\n}\n\nexport function flattenMcpToolResult(result: unknown): string {\n if (\n result &&\n typeof result === \"object\" &&\n Array.isArray((result as any).content)\n ) {\n const parts = (result as any).content as Array<Record<string, any>>;\n const text = parts.map(formatMcpContentPart).join(\"\\n\");\n const fallback =\n text ||\n (hasStructuredContent(result)\n ? JSON.stringify((result as any).structuredContent, null, 2)\n : \"(no output)\");\n if ((result as any).isError) return `Error: ${fallback}`;\n return fallback;\n }\n return typeof result === \"string\" ? result : JSON.stringify(result);\n}\n\nfunction formatMcpContentPart(part: Record<string, any>): string {\n if (part?.type === \"text\" && typeof part.text === \"string\") {\n return part.text;\n }\n if (part?.type === \"image\") {\n return `[image: ${part?.mimeType ?? \"unknown\"}]`;\n }\n if (part?.type === \"resource\") {\n const resource = part.resource ?? {};\n const uri = typeof resource.uri === \"string\" ? ` ${resource.uri}` : \"\";\n return `[resource: ${resource.mimeType ?? \"unknown\"}${uri}]`;\n }\n if (part?.type === \"resource_link\") {\n const uri = typeof part.uri === \"string\" ? ` ${part.uri}` : \"\";\n return `[resource: ${part.mimeType ?? \"unknown\"}${uri}]`;\n }\n return JSON.stringify(part);\n}\n\nfunction hasStructuredContent(result: unknown): boolean {\n return (\n !!result &&\n typeof result === \"object\" &&\n Object.prototype.hasOwnProperty.call(result, \"structuredContent\")\n );\n}\n\n/**\n * Extract vision images from a raw MCP tool result so the model can SEE\n * screenshots/previews returned by external MCP tools instead of only the\n * `[image: <mime>]` placeholder that `flattenMcpToolResult` leaves in the\n * text. Shares the per-result caps with `_agentImages` (max count, max base64\n * size); over-cap or unsupported images stay placeholder-only. Never throws.\n */\nexport function extractMcpToolResultImages(\n result: unknown,\n): EngineToolResultImagePart[] {\n if (\n !result ||\n typeof result !== \"object\" ||\n !Array.isArray((result as any).content) ||\n (result as any).isError\n ) {\n return [];\n }\n const candidates = ((result as any).content as Array<Record<string, any>>)\n .filter((part) => part?.type === \"image\" && typeof part.data === \"string\")\n .map((part) => ({\n data: part.data as string,\n mediaType: typeof part.mimeType === \"string\" ? part.mimeType : undefined,\n }));\n return normalizeToolResultImages(candidates).images;\n}\n\nasync function buildMcpActionResult(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<McpActionResult> {\n const text = flattenMcpToolResult(raw);\n const mcpApp = await extractMcpAppPayload(manager, tool, input, raw);\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw,\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n ...(mcpApp ? { mcpApp } : {}),\n };\n}\n\nfunction buildMcpErrorActionResult(\n tool: McpTool,\n input: Record<string, unknown>,\n text: string,\n): McpActionResult {\n return {\n [MCP_ACTION_RESULT_MARKER]: true,\n text,\n raw: {\n isError: true,\n content: [{ type: \"text\", text }],\n },\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n input,\n };\n}\n\nasync function extractMcpAppPayload(\n manager: McpClientManager,\n tool: McpTool,\n input: Record<string, unknown>,\n raw: unknown,\n): Promise<AgentMcpAppPayload | undefined> {\n const inlineResource = findInlineMcpAppResource(raw);\n const resourceUri =\n inlineResource?.uri ??\n resourceUriFromTool(tool) ??\n resourceUriFromResult(raw);\n if (!resourceUri) return undefined;\n\n const resource =\n inlineResource ?? (await readMcpAppResource(manager, tool, resourceUri));\n\n return {\n serverId: tool.source,\n toolName: tool.name,\n originalToolName: tool.originalName,\n resourceUri,\n toolInput: input,\n toolResult:\n raw && typeof raw === \"object\"\n ? ({ ...(raw as Record<string, unknown>) } as Record<string, unknown>)\n : { content: [{ type: \"text\", text: String(raw ?? \"\") }] },\n tool: toolForMcpAppPayload(tool),\n ...(resource ? { resource } : {}),\n };\n}\n\nfunction resourceUriFromTool(tool: McpTool): string | undefined {\n try {\n return getToolUiResourceUri(tool.raw as any);\n } catch {\n return undefined;\n }\n}\n\nfunction resourceUriFromResult(raw: unknown): string | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const meta = (raw as any)._meta;\n const nested = meta?.ui?.resourceUri;\n if (typeof nested === \"string\" && nested.startsWith(\"ui://\")) return nested;\n const flat = meta?.[\"ui/resourceUri\"] ?? meta?.[\"ui.resourceUri\"];\n if (typeof flat === \"string\" && flat.startsWith(\"ui://\")) return flat;\n return findInlineMcpAppResource(raw)?.uri;\n}\n\nfunction findInlineMcpAppResource(\n raw: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!raw || typeof raw !== \"object\") return undefined;\n const content = Array.isArray((raw as any).content)\n ? ((raw as any).content as unknown[])\n : [];\n for (const part of content) {\n const resource = normalizeMcpAppResourceContent(part);\n if (resource) return resource;\n }\n return undefined;\n}\n\nfunction normalizeMcpAppResourceContent(\n part: unknown,\n): AgentMcpAppResourceContent | undefined {\n if (!part || typeof part !== \"object\") return undefined;\n const candidate =\n (part as any).type === \"resource\"\n ? (part as any).resource\n : ((part as any).resource ?? part);\n if (!candidate || typeof candidate !== \"object\") return undefined;\n const uri = (candidate as any).uri;\n if (typeof uri !== \"string\" || !uri.startsWith(\"ui://\")) return undefined;\n const mimeType =\n typeof (candidate as any).mimeType === \"string\"\n ? (candidate as any).mimeType\n : undefined;\n if (mimeType && !mimeType.includes(MCP_APP_MIME_TYPE)) return undefined;\n const text =\n typeof (candidate as any).text === \"string\"\n ? (candidate as any).text\n : undefined;\n const blob =\n typeof (candidate as any).blob === \"string\"\n ? (candidate as any).blob\n : undefined;\n const meta =\n (candidate as any)._meta && typeof (candidate as any)._meta === \"object\"\n ? ((candidate as any)._meta as Record<string, unknown>)\n : (part as any)._meta && typeof (part as any)._meta === \"object\"\n ? ((part as any)._meta as Record<string, unknown>)\n : undefined;\n return {\n uri,\n ...(mimeType ? { mimeType } : {}),\n ...(text ? { text } : {}),\n ...(blob ? { blob } : {}),\n ...(meta ? { _meta: meta } : {}),\n };\n}\n\nasync function readMcpAppResource(\n manager: McpClientManager,\n tool: McpTool,\n resourceUri: string,\n): Promise<AgentMcpAppResourceContent | undefined> {\n try {\n const result = await manager.readResourceForTool(tool.name, resourceUri);\n const contents = Array.isArray((result as any)?.contents)\n ? ((result as any).contents as unknown[])\n : [];\n for (const content of contents) {\n const resource = normalizeMcpAppResourceContent(content);\n if (\n resource?.uri === resourceUri ||\n (resource && contents.length === 1)\n ) {\n return resource;\n }\n }\n } catch (err: any) {\n console.warn(\n `[mcp-client] Failed to read MCP App resource ${resourceUri}: ${err?.message ?? err}`,\n );\n }\n return undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAUhE,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAUhE,wBAAgB,6BAA6B,CAC3C,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAuI7B"}
|
|
@@ -66,6 +66,11 @@ export function createNotificationToolEntries(getCurrentUser) {
|
|
|
66
66
|
required: ["action"],
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
|
+
planMode: {
|
|
70
|
+
effect: (args) => (args.action === "list" ? "read" : "write"),
|
|
71
|
+
allowedValues: { action: ["list"] },
|
|
72
|
+
description: "Plan mode allows listing notifications.",
|
|
73
|
+
},
|
|
69
74
|
run: async (args) => {
|
|
70
75
|
const owner = getCurrentUser();
|
|
71
76
|
const action = args.action;
|
|
@@ -1 +1 @@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C,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CACzG,CAAC;wBACF,OAAO,GAAG,WAAW,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxD,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;gBAC5E,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent actions for the notifications primitive.\n *\n * Registered as native tools (not template actions) so they're available in\n * every template. Consolidated into a single `manage-notifications` tool with\n * an `action` parameter that dispatches to the correct implementation.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { notify, listNotifications, countUnread } from \"./registry.js\";\nimport type { NotificationSeverity } from \"./types.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createNotificationToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-notifications\": {\n tool: {\n description: [\n \"Manage user notifications. Available actions:\",\n \"\",\n '• action=\"send\" — Send a notification to the user. Persisted to the in-app inbox so the bell + toast surface shows it. Registered channels (webhook, Slack, etc.) also run.',\n \" Required: severity, title. Optional: body, metadataJson, channels.\",\n \"\",\n '• action=\"list\" — List recent notifications for the current user. Useful when the user asks about prior alerts.',\n \" Optional: unreadOnly (boolean), limit (number, default 20, max 200).\",\n ].join(\"\\n\"),\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"send\", \"list\"],\n description: \"The notification action to perform.\",\n },\n severity: {\n type: \"string\",\n enum: [\"info\", \"warning\", \"critical\"],\n description:\n '(send) Severity level — drives styling and per-severity channel routing. Use \"info\" for FYI, \"warning\" for things the user should look at, \"critical\" for things that need immediate attention.',\n },\n title: {\n type: \"string\",\n description:\n \"(send) Short, human-readable headline (≤100 chars).\",\n },\n body: {\n type: \"string\",\n description: \"(send) Optional longer description.\",\n },\n metadataJson: {\n type: \"string\",\n description:\n '(send) Optional JSON metadata (URLs, entity ids, etc.). Example: \\'{\"threadId\":\"abc\",\"link\":\"/inbox/abc\"}\\'.',\n },\n channels: {\n type: \"string\",\n description:\n '(send) Optional comma-separated channel allowlist (e.g. \"inbox,webhook\"). Omit to run all registered channels.',\n },\n unreadOnly: {\n type: \"boolean\",\n description:\n \"(list) When true, only include unread notifications.\",\n },\n limit: {\n type: \"number\",\n description: \"(list) Max rows to return (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = args.action as string;\n\n switch (action) {\n case \"send\": {\n if (!args.severity || !args.title) {\n return \"Error: severity and title are required for action=send.\";\n }\n const severity = args.severity as NotificationSeverity;\n if (![\"info\", \"warning\", \"critical\"].includes(severity)) {\n return `Error: severity must be info, warning, or critical (got \"${severity}\").`;\n }\n\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(args.metadataJson as string);\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n\n const channels =\n typeof args.channels === \"string\"\n ? args.channels\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean)\n : undefined;\n\n const stored = await notify(\n {\n severity,\n title: args.title as string,\n body: (args.body as string) || undefined,\n metadata,\n channels,\n },\n { owner },\n );\n return stored\n ? `Notification sent (id: ${stored.id})`\n : \"Notification dispatched to channels (not persisted).\";\n }\n\n case \"list\": {\n const rows = await listNotifications(owner, {\n unreadOnly:\n args.unreadOnly === true || args.unreadOnly === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.unreadOnly\n ? \"No unread notifications.\"\n : \"No notifications.\";\n }\n const unreadCount = await countUnread(owner);\n const lines = rows.map(\n (n) =>\n `[${n.readAt ? \" \" : \"•\"}] (${n.severity}) ${n.title}${n.body ? ` — ${n.body}` : \"\"} · ${n.createdAt}`,\n );\n return `${unreadCount} unread\\n\\n${lines.join(\"\\n\")}`;\n }\n\n default:\n return `Error: unknown action \"${action}\". Must be one of: send, list.`;\n }\n },\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/notifications/actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGvE,SAAS,UAAU,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,cAA4B;IAE5B,OAAO;QACL,sBAAsB,EAAE;YACtB,IAAI,EAAE;gBACJ,WAAW,EAAE;oBACX,+CAA+C;oBAC/C,EAAE;oBACF,6KAA6K;oBAC7K,sEAAsE;oBACtE,EAAE;oBACF,iHAAiH;oBACjH,wEAAwE;iBACzE,CAAC,IAAI,CAAC,IAAI,CAAC;gBACZ,UAAU,EAAE;oBACV,IAAI,EAAE,QAAiB;oBACvB,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;4BACtB,WAAW,EAAE,qCAAqC;yBACnD;wBACD,QAAQ,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;4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AAM,KAAK,CAAC,EAAE,CAAC;4BACtB,OAAO,IAAI,CAAC,UAAU;gCACpB,CAAC,CAAC,0BAA0B;gCAC5B,CAAC,CAAC,mBAAmB,CAAC;wBAC1B,CAAC;wBACD,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC;wBAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CACpB,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CACzG,CAAC;wBACF,OAAO,GAAG,WAAW,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBACxD,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;gBAC5E,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent actions for the notifications primitive.\n *\n * Registered as native tools (not template actions) so they're available in\n * every template. Consolidated into a single `manage-notifications` tool with\n * an `action` parameter that dispatches to the correct implementation.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport { notify, listNotifications, countUnread } from \"./registry.js\";\nimport type { NotificationSeverity } from \"./types.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createNotificationToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-notifications\": {\n tool: {\n description: [\n \"Manage user notifications. Available actions:\",\n \"\",\n '• action=\"send\" — Send a notification to the user. Persisted to the in-app inbox so the bell + toast surface shows it. Registered channels (webhook, Slack, etc.) also run.',\n \" Required: severity, title. Optional: body, metadataJson, channels.\",\n \"\",\n '• action=\"list\" — List recent notifications for the current user. Useful when the user asks about prior alerts.',\n \" Optional: unreadOnly (boolean), limit (number, default 20, max 200).\",\n ].join(\"\\n\"),\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"send\", \"list\"],\n description: \"The notification action to perform.\",\n },\n severity: {\n type: \"string\",\n enum: [\"info\", \"warning\", \"critical\"],\n description:\n '(send) Severity level — drives styling and per-severity channel routing. Use \"info\" for FYI, \"warning\" for things the user should look at, \"critical\" for things that need immediate attention.',\n },\n title: {\n type: \"string\",\n description:\n \"(send) Short, human-readable headline (≤100 chars).\",\n },\n body: {\n type: \"string\",\n description: \"(send) Optional longer description.\",\n },\n metadataJson: {\n type: \"string\",\n description:\n '(send) Optional JSON metadata (URLs, entity ids, etc.). Example: \\'{\"threadId\":\"abc\",\"link\":\"/inbox/abc\"}\\'.',\n },\n channels: {\n type: \"string\",\n description:\n '(send) Optional comma-separated channel allowlist (e.g. \"inbox,webhook\"). Omit to run all registered channels.',\n },\n unreadOnly: {\n type: \"boolean\",\n description:\n \"(list) When true, only include unread notifications.\",\n },\n limit: {\n type: \"number\",\n description: \"(list) Max rows to return (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n planMode: {\n effect: (args) => (args.action === \"list\" ? \"read\" : \"write\"),\n allowedValues: { action: [\"list\"] },\n description: \"Plan mode allows listing notifications.\",\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = args.action as string;\n\n switch (action) {\n case \"send\": {\n if (!args.severity || !args.title) {\n return \"Error: severity and title are required for action=send.\";\n }\n const severity = args.severity as NotificationSeverity;\n if (![\"info\", \"warning\", \"critical\"].includes(severity)) {\n return `Error: severity must be info, warning, or critical (got \"${severity}\").`;\n }\n\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(args.metadataJson as string);\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n\n const channels =\n typeof args.channels === \"string\"\n ? args.channels\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean)\n : undefined;\n\n const stored = await notify(\n {\n severity,\n title: args.title as string,\n body: (args.body as string) || undefined,\n metadata,\n channels,\n },\n { owner },\n );\n return stored\n ? `Notification sent (id: ${stored.id})`\n : \"Notification dispatched to channels (not persisted).\";\n }\n\n case \"list\": {\n const rows = await listNotifications(owner, {\n unreadOnly:\n args.unreadOnly === true || args.unreadOnly === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.unreadOnly\n ? \"No unread notifications.\"\n : \"No notifications.\";\n }\n const unreadCount = await countUnread(owner);\n const lines = rows.map(\n (n) =>\n `[${n.readAt ? \" \" : \"•\"}] (${n.severity}) ${n.title}${n.body ? ` — ${n.body}` : \"\"} · ${n.createdAt}`,\n );\n return `${unreadCount} unread\\n\\n${lines.join(\"\\n\")}`;\n }\n\n default:\n return `Error: unknown action \"${action}\". Must be one of: send, list.`;\n }\n },\n },\n };\n}\n"]}
|
|
@@ -11,24 +11,24 @@
|
|
|
11
11
|
* DELETE /_agent-native/notifications/:id — delete
|
|
12
12
|
*/
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
|
-
error?: undefined;
|
|
15
14
|
count: number;
|
|
16
15
|
updated?: undefined;
|
|
17
16
|
ok?: undefined;
|
|
18
|
-
} | {
|
|
19
17
|
error?: undefined;
|
|
20
|
-
|
|
18
|
+
} | {
|
|
21
19
|
updated: number;
|
|
22
20
|
ok?: undefined;
|
|
23
|
-
|
|
21
|
+
error?: undefined;
|
|
24
22
|
count?: undefined;
|
|
23
|
+
} | {
|
|
25
24
|
updated?: undefined;
|
|
26
25
|
error: string;
|
|
27
26
|
ok?: undefined;
|
|
28
|
-
} | {
|
|
29
|
-
error?: undefined;
|
|
30
27
|
count?: undefined;
|
|
28
|
+
} | {
|
|
31
29
|
updated?: undefined;
|
|
32
30
|
ok: boolean;
|
|
31
|
+
error?: undefined;
|
|
32
|
+
count?: undefined;
|
|
33
33
|
}>>;
|
|
34
34
|
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -41,16 +41,16 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
+
error?: undefined;
|
|
44
45
|
summary: import("./types.js").TraceSummary;
|
|
45
46
|
spans: import("./types.js").TraceSpan[];
|
|
46
47
|
id?: undefined;
|
|
47
|
-
error?: undefined;
|
|
48
48
|
ok?: undefined;
|
|
49
49
|
} | {
|
|
50
|
+
error?: undefined;
|
|
50
51
|
summary?: undefined;
|
|
51
52
|
spans?: undefined;
|
|
52
53
|
id: string;
|
|
53
|
-
error?: undefined;
|
|
54
54
|
ok?: undefined;
|
|
55
55
|
} | {
|
|
56
56
|
summary?: undefined;
|
|
@@ -59,10 +59,10 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
59
59
|
error: any;
|
|
60
60
|
ok?: undefined;
|
|
61
61
|
} | {
|
|
62
|
+
error?: undefined;
|
|
62
63
|
summary?: undefined;
|
|
63
64
|
spans?: undefined;
|
|
64
65
|
id?: undefined;
|
|
65
|
-
error?: undefined;
|
|
66
66
|
ok: boolean;
|
|
67
67
|
}>>;
|
|
68
68
|
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAchE,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAchE,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,MAAM,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA8J7B"}
|
package/dist/progress/actions.js
CHANGED
|
@@ -78,6 +78,11 @@ Actions:
|
|
|
78
78
|
required: ["action"],
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
|
+
planMode: {
|
|
82
|
+
effect: (args) => (args.action === "list" ? "read" : "write"),
|
|
83
|
+
allowedValues: { action: ["list"] },
|
|
84
|
+
description: "Plan mode allows listing recent progress runs.",
|
|
85
|
+
},
|
|
81
86
|
run: async (args) => {
|
|
82
87
|
const owner = getCurrentUser();
|
|
83
88
|
const action = String(args.action ?? "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,SAAS,UAAU,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,cAA4B;IAE5B,OAAO;QACL,iBAAiB,EAAE;YACjB,IAA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C9B,CAAC,CAAC;wBACH,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;4BACtB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,UAAU,CAAC;wBACtD,CAAC;wBACD,OAAO,IAAI;6BACR,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CAC3H;6BACA,IAAI,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,+CAA+C,CAAC;gBAC3F,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent tools for the progress primitive. Registered as\n * native tools so every template exposes them. Use from long agent loops\n * to communicate status to the user while work is still in-flight.\n *\n * All operations are consolidated into a single `manage-progress` tool\n * with an `action` discriminator.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport {\n startRun,\n updateRunProgress,\n completeRun,\n listRuns,\n} from \"./registry.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createProgressToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-progress\": {\n tool: {\n description: `Track multi-step task progress visible to the user in the runs tray.\n\nUse for non-trivial work with multiple real steps (not single-action lookups). Do NOT create single-step plans. Skip for trivial tasks that finish in one tool call.\n\n**Discipline:**\n- Exactly one task in progress at a time; never batch-complete steps after the fact — update as you go.\n- Always transition pending → in_progress before completing a step.\n- If the task pivots (scope change, unexpected blocker), update the current step to reflect it before continuing.\n- Only include fields for the selected action; do not send empty placeholder fields.\n- End every run with \"complete\" (succeeded / failed / cancelled). Never leave a run open indefinitely.\n\nActions:\n• \"start\" — Begin tracking. Returns a runId for subsequent calls. Params: title (required, short human description e.g. \"Triage 42 emails\"), step (optional initial step), metadataJson (optional JSON with link/thread/artifact info).\n• \"update\" — Report progress. Call after each meaningful milestone. Params: runId (required), percent (optional 0–100 when a bound is known), step (optional current step text). Omitted fields stay unchanged.\n• \"complete\" — Mark finished. Params: runId (required), status (required: \"succeeded\" | \"failed\" | \"cancelled\"), step (optional final step text). Pair with \\`notify\\` when the user should be alerted.\n• \"list\" — List recent runs. Use when the user asks \"what is still running\" or \"what did you do earlier\". Params: active (optional boolean, filter to in-progress only), limit (optional number, default 20, max 200).`,\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"start\", \"update\", \"complete\", \"list\"],\n description:\n 'The operation to perform: \"start\" a new run, \"update\" progress, \"complete\" a run, or \"list\" recent runs.',\n },\n title: {\n type: \"string\",\n description:\n '[start] Short human-readable title, e.g. \"Triage 128 unread emails\".',\n },\n step: {\n type: \"string\",\n description:\n '[start/update/complete] Step description, e.g. \"Fetching inbox\" or \"Drafting reply 23/100\".',\n },\n metadataJson: {\n type: \"string\",\n description:\n \"[start] Optional JSON metadata: link, thread id, artifact path, etc.\",\n },\n runId: {\n type: \"string\",\n description:\n '[update/complete] The id returned by a \"start\" action.',\n },\n percent: {\n type: \"number\",\n description:\n \"[update] Progress 0–100. Omit if the task has no known upper bound.\",\n },\n status: {\n type: \"string\",\n enum: [\"\", \"succeeded\", \"failed\", \"cancelled\"],\n description:\n '[complete] Terminal status for the run. Omit it for \"start\" and \"update\".',\n },\n active: {\n type: \"boolean\",\n description:\n \"[list] When true, only return runs still in progress.\",\n },\n limit: {\n type: \"number\",\n description: \"[list] Max rows (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = String(args.action ?? \"\");\n\n switch (action) {\n case \"start\": {\n const title = args.title ? String(args.title) : \"\";\n if (!title) return \"Error: title is required for the start action.\";\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(String(args.metadataJson));\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n const run = await startRun({\n owner,\n title,\n step: args.step ? String(args.step) : undefined,\n metadata,\n });\n return `Run started. runId=${run.id}`;\n }\n\n case \"update\": {\n const runId = String(args.runId ?? \"\");\n if (!runId)\n return \"Error: runId is required for the update action.\";\n const percent =\n args.percent == null ? undefined : Number(args.percent);\n const run = await updateRunProgress(runId, owner, {\n percent,\n step: args.step ? String(args.step) : undefined,\n });\n if (!run) return `Error: run ${runId} not found.`;\n return `Run updated (percent=${run.percent ?? \"?\"}, step=${run.step ?? \"\"}).`;\n }\n\n case \"complete\": {\n const runId = String(args.runId ?? \"\");\n const status = String(args.status ?? \"\");\n if (!runId || !status) {\n return \"Error: runId and status are required for the complete action.\";\n }\n if (![\"succeeded\", \"failed\", \"cancelled\"].includes(status)) {\n return 'Error: status must be \"succeeded\", \"failed\", or \"cancelled\".';\n }\n const run = await completeRun(\n runId,\n owner,\n status as \"succeeded\" | \"failed\" | \"cancelled\",\n args.step ? { step: String(args.step) } : undefined,\n );\n if (!run) return `Error: run ${runId} not found.`;\n return `Run ${run.id} completed with status=${run.status}.`;\n }\n\n case \"list\": {\n const rows = await listRuns(owner, {\n activeOnly: args.active === true || args.active === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.active ? \"No active runs.\" : \"No runs.\";\n }\n return rows\n .map(\n (r) =>\n `[${r.status}] ${r.title}${r.percent != null ? ` · ${r.percent}%` : \"\"}${r.step ? ` — ${r.step}` : \"\"} · ${r.startedAt}`,\n )\n .join(\"\\n\");\n }\n\n default:\n return `Error: unknown action \"${action}\". Use one of: start, update, complete, list.`;\n }\n },\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/progress/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,WAAW,EACX,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,SAAS,UAAU,CAAC,KAAc,EAAE,QAAQ,GAAG,EAAE;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,cAA4B;IAE5B,OAAO;QACL,iBAAiB,EAAE;YACjB,IAAI,EAAE;gBACJ,WAAW,EAAE;;;;;;;;;;;;;;;uNAekM;gBAC/M,UAAU,EAAE;oBACV,IAAI,EAAE,QAAiB;oBACvB,UAAU,EAAE;wBACV,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC;4BAC7C,WAAW,EACT,0GAA0G;yBAC7G;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,sEAAsE;yBACzE;wBACD,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,6FAA6F;yBAChG;wBACD,YAAY,EAAE;4BACZ,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,sEAAsE;yBACzE;wBACD,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,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C,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,SAAS,EAAE,CAC3H;6BACA,IAAI,CAAC,IAAI,CAAC,CAAC;oBAChB,CAAC;oBAED;wBACE,OAAO,0BAA0B,MAAM,+CAA+C,CAAC;gBAC3F,CAAC;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Framework-level agent tools for the progress primitive. Registered as\n * native tools so every template exposes them. Use from long agent loops\n * to communicate status to the user while work is still in-flight.\n *\n * All operations are consolidated into a single `manage-progress` tool\n * with an `action` discriminator.\n */\n\nimport type { ActionEntry } from \"../agent/production-agent.js\";\nimport {\n startRun,\n updateRunProgress,\n completeRun,\n listRuns,\n} from \"./registry.js\";\n\nfunction parseLimit(value: unknown, fallback = 20): number {\n const n = Number(value ?? fallback);\n if (!Number.isFinite(n) || n <= 0) return fallback;\n return Math.min(Math.floor(n), 200);\n}\n\nexport function createProgressToolEntries(\n getCurrentUser: () => string,\n): Record<string, ActionEntry> {\n return {\n \"manage-progress\": {\n tool: {\n description: `Track multi-step task progress visible to the user in the runs tray.\n\nUse for non-trivial work with multiple real steps (not single-action lookups). Do NOT create single-step plans. Skip for trivial tasks that finish in one tool call.\n\n**Discipline:**\n- Exactly one task in progress at a time; never batch-complete steps after the fact — update as you go.\n- Always transition pending → in_progress before completing a step.\n- If the task pivots (scope change, unexpected blocker), update the current step to reflect it before continuing.\n- Only include fields for the selected action; do not send empty placeholder fields.\n- End every run with \"complete\" (succeeded / failed / cancelled). Never leave a run open indefinitely.\n\nActions:\n• \"start\" — Begin tracking. Returns a runId for subsequent calls. Params: title (required, short human description e.g. \"Triage 42 emails\"), step (optional initial step), metadataJson (optional JSON with link/thread/artifact info).\n• \"update\" — Report progress. Call after each meaningful milestone. Params: runId (required), percent (optional 0–100 when a bound is known), step (optional current step text). Omitted fields stay unchanged.\n• \"complete\" — Mark finished. Params: runId (required), status (required: \"succeeded\" | \"failed\" | \"cancelled\"), step (optional final step text). Pair with \\`notify\\` when the user should be alerted.\n• \"list\" — List recent runs. Use when the user asks \"what is still running\" or \"what did you do earlier\". Params: active (optional boolean, filter to in-progress only), limit (optional number, default 20, max 200).`,\n parameters: {\n type: \"object\" as const,\n properties: {\n action: {\n type: \"string\",\n enum: [\"start\", \"update\", \"complete\", \"list\"],\n description:\n 'The operation to perform: \"start\" a new run, \"update\" progress, \"complete\" a run, or \"list\" recent runs.',\n },\n title: {\n type: \"string\",\n description:\n '[start] Short human-readable title, e.g. \"Triage 128 unread emails\".',\n },\n step: {\n type: \"string\",\n description:\n '[start/update/complete] Step description, e.g. \"Fetching inbox\" or \"Drafting reply 23/100\".',\n },\n metadataJson: {\n type: \"string\",\n description:\n \"[start] Optional JSON metadata: link, thread id, artifact path, etc.\",\n },\n runId: {\n type: \"string\",\n description:\n '[update/complete] The id returned by a \"start\" action.',\n },\n percent: {\n type: \"number\",\n description:\n \"[update] Progress 0–100. Omit if the task has no known upper bound.\",\n },\n status: {\n type: \"string\",\n enum: [\"\", \"succeeded\", \"failed\", \"cancelled\"],\n description:\n '[complete] Terminal status for the run. Omit it for \"start\" and \"update\".',\n },\n active: {\n type: \"boolean\",\n description:\n \"[list] When true, only return runs still in progress.\",\n },\n limit: {\n type: \"number\",\n description: \"[list] Max rows (default 20, max 200).\",\n },\n },\n required: [\"action\"],\n },\n },\n planMode: {\n effect: (args) => (args.action === \"list\" ? \"read\" : \"write\"),\n allowedValues: { action: [\"list\"] },\n description: \"Plan mode allows listing recent progress runs.\",\n },\n run: async (args: Record<string, unknown>) => {\n const owner = getCurrentUser();\n const action = String(args.action ?? \"\");\n\n switch (action) {\n case \"start\": {\n const title = args.title ? String(args.title) : \"\";\n if (!title) return \"Error: title is required for the start action.\";\n let metadata: Record<string, unknown> | undefined;\n if (args.metadataJson) {\n try {\n metadata = JSON.parse(String(args.metadataJson));\n } catch {\n return \"Error: metadataJson must be valid JSON.\";\n }\n }\n const run = await startRun({\n owner,\n title,\n step: args.step ? String(args.step) : undefined,\n metadata,\n });\n return `Run started. runId=${run.id}`;\n }\n\n case \"update\": {\n const runId = String(args.runId ?? \"\");\n if (!runId)\n return \"Error: runId is required for the update action.\";\n const percent =\n args.percent == null ? undefined : Number(args.percent);\n const run = await updateRunProgress(runId, owner, {\n percent,\n step: args.step ? String(args.step) : undefined,\n });\n if (!run) return `Error: run ${runId} not found.`;\n return `Run updated (percent=${run.percent ?? \"?\"}, step=${run.step ?? \"\"}).`;\n }\n\n case \"complete\": {\n const runId = String(args.runId ?? \"\");\n const status = String(args.status ?? \"\");\n if (!runId || !status) {\n return \"Error: runId and status are required for the complete action.\";\n }\n if (![\"succeeded\", \"failed\", \"cancelled\"].includes(status)) {\n return 'Error: status must be \"succeeded\", \"failed\", or \"cancelled\".';\n }\n const run = await completeRun(\n runId,\n owner,\n status as \"succeeded\" | \"failed\" | \"cancelled\",\n args.step ? { step: String(args.step) } : undefined,\n );\n if (!run) return `Error: run ${runId} not found.`;\n return `Run ${run.id} completed with status=${run.status}.`;\n }\n\n case \"list\": {\n const rows = await listRuns(owner, {\n activeOnly: args.active === true || args.active === \"true\",\n limit: parseLimit(args.limit),\n });\n if (rows.length === 0) {\n return args.active ? \"No active runs.\" : \"No runs.\";\n }\n return rows\n .map(\n (r) =>\n `[${r.status}] ${r.title}${r.percent != null ? ` · ${r.percent}%` : \"\"}${r.step ? ` — ${r.step}` : \"\"} · ${r.startedAt}`,\n )\n .join(\"\\n\");\n }\n\n default:\n return `Error: unknown action \"${action}\". Use one of: start, update, complete, list.`;\n }\n },\n },\n };\n}\n"]}
|
|
@@ -76,10 +76,7 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
78
|
id?: undefined;
|
|
79
|
-
message?: undefined;
|
|
80
|
-
provider?: undefined;
|
|
81
79
|
deleted?: undefined;
|
|
82
|
-
found?: undefined;
|
|
83
80
|
providers: {
|
|
84
81
|
id: string;
|
|
85
82
|
label: string;
|
|
@@ -90,44 +87,47 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
90
87
|
updatedAt: number;
|
|
91
88
|
}[];
|
|
92
89
|
count: number;
|
|
90
|
+
provider?: undefined;
|
|
91
|
+
found?: undefined;
|
|
93
92
|
registered?: undefined;
|
|
94
93
|
label?: undefined;
|
|
94
|
+
message?: undefined;
|
|
95
95
|
} | {
|
|
96
|
+
count?: undefined;
|
|
96
97
|
id?: undefined;
|
|
97
|
-
message?: undefined;
|
|
98
98
|
deleted?: undefined;
|
|
99
99
|
providers?: undefined;
|
|
100
|
-
count?: undefined;
|
|
101
100
|
found: boolean;
|
|
102
101
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
103
102
|
registered?: undefined;
|
|
104
103
|
label?: undefined;
|
|
105
|
-
} | {
|
|
106
104
|
message?: undefined;
|
|
107
|
-
|
|
105
|
+
} | {
|
|
106
|
+
count?: undefined;
|
|
108
107
|
deleted?: undefined;
|
|
109
108
|
providers?: undefined;
|
|
110
|
-
|
|
109
|
+
provider?: undefined;
|
|
111
110
|
found: boolean;
|
|
112
111
|
id: string;
|
|
113
112
|
registered?: undefined;
|
|
114
113
|
label?: undefined;
|
|
115
|
-
} | {
|
|
116
114
|
message?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
count?: undefined;
|
|
117
|
+
providers?: undefined;
|
|
117
118
|
provider?: undefined;
|
|
118
119
|
found?: undefined;
|
|
119
|
-
providers?: undefined;
|
|
120
|
-
count?: undefined;
|
|
121
120
|
deleted: boolean;
|
|
122
121
|
id: string;
|
|
123
122
|
registered?: undefined;
|
|
124
123
|
label?: undefined;
|
|
124
|
+
message?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
|
|
126
|
+
count?: undefined;
|
|
127
127
|
deleted?: undefined;
|
|
128
|
-
found?: undefined;
|
|
129
128
|
providers?: undefined;
|
|
130
|
-
|
|
129
|
+
provider?: undefined;
|
|
130
|
+
found?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
133
133
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-repo-files.d.ts","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAMV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAQrB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6H/B,CAAC;AAIH,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,IAAI,CACX,kBAAkB,EAChB,2BAA2B,GAC3B,6BAA6B,GAC7B,0BAA0B,GAC1B,2BAA2B,GAC3B,4BAA4B,CAC/B,EACD,OAAO,GAAE,kCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"github-repo-files.d.ts","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAMV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAQrB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6H/B,CAAC;AAIH,MAAM,WAAW,kCAAkC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,IAAI,CACX,kBAAkB,EAChB,2BAA2B,GAC3B,6BAA6B,GAC7B,0BAA0B,GAC1B,2BAA2B,GAC3B,4BAA4B,CAC/B,EACD,OAAO,GAAE,kCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kOAiHjD;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -118,6 +118,15 @@ export function createGitHubRepoFilesAction(runtime, options = {}) {
|
|
|
118
118
|
"List, search, read, create/update, and delete GitHub repository files through the configured GitHub connector or GITHUB_TOKEN. Uses GitHub REST APIs directly; it does not clone repositories or use a filesystem sandbox.",
|
|
119
119
|
schema: GitHubRepoFilesActionSchema,
|
|
120
120
|
http: false,
|
|
121
|
+
planMode: {
|
|
122
|
+
effect: (args) => args.operation === "list" ||
|
|
123
|
+
args.operation === "search" ||
|
|
124
|
+
args.operation === "read"
|
|
125
|
+
? "read"
|
|
126
|
+
: "write",
|
|
127
|
+
allowedValues: { operation: ["list", "search", "read"] },
|
|
128
|
+
description: "Plan mode allows listing, searching, and reading repository files.",
|
|
129
|
+
},
|
|
121
130
|
needsApproval: requireApprovalForWrites
|
|
122
131
|
? (args) => args.operation === "write" || args.operation === "delete"
|
|
123
132
|
: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-repo-files.js","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACzD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,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OAAO,CAAC,yBAAyB,CAAC;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI;gBACjD,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACgB,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport type {\n GitHubRepositoryFileDeleteArgs,\n GitHubRepositoryFileListArgs,\n GitHubRepositoryFileReadArgs,\n GitHubRepositoryFileSearchArgs,\n GitHubRepositoryFileWriteArgs,\n ProviderApiRuntime,\n} from \"../index.js\";\n\nconst GitHubCommitIdentitySchema = z.object({\n name: z.string().min(1).describe(\"Commit identity name.\"),\n email: z.string().email().describe(\"Commit identity email.\"),\n date: z.string().optional().describe(\"Optional ISO timestamp.\"),\n});\n\nconst GitHubRepoFilesActionSchema = z.object({\n operation: z\n .enum([\"list\", \"search\", \"read\", \"write\", \"delete\"])\n .describe(\n \"Operation to perform: list repository file paths, search code/files, read one file, create/update one file, or delete one file.\",\n ),\n owner: z.string().min(1).describe(\"Repository owner or organization.\"),\n repo: z\n .string()\n .min(1)\n .describe(\"Repository name, with or without a trailing .git suffix.\"),\n path: z\n .string()\n .optional()\n .describe(\n \"Repository-relative file or directory path. For search without query, this filters matching paths.\",\n ),\n ref: z\n .string()\n .optional()\n .describe(\n \"Branch, tag, or commit-ish for list/read. Code search uses GitHub's default-branch search.\",\n ),\n recursive: z\n .boolean()\n .optional()\n .describe(\"For list, read the repository tree recursively.\"),\n includeDirectories: z\n .boolean()\n .optional()\n .describe(\"For list, include directory entries along with files.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"For search, a GitHub code-search term. Omit to search/filter file paths from the repository tree.\",\n ),\n filename: z\n .string()\n .optional()\n .describe(\"For search, restrict to an exact filename.\"),\n extension: z\n .string()\n .optional()\n .describe(\"For search, restrict to a file extension such as ts or md.\"),\n language: z\n .string()\n .optional()\n .describe(\"For code search, restrict to a GitHub language qualifier.\"),\n page: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, result page to fetch.\"),\n perPage: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, results per page.\"),\n maxFiles: z.coerce\n .number()\n .int()\n .min(1)\n .max(10_000)\n .optional()\n .describe(\n \"Maximum file entries to return from list or tree-filter search.\",\n ),\n includeTextMatches: z\n .boolean()\n .optional()\n .describe(\"For code search, request GitHub text-match metadata.\"),\n content: z\n .string()\n .optional()\n .describe(\"For write, complete replacement UTF-8 file content.\"),\n message: z.string().optional().describe(\"For write, commit message.\"),\n branch: z\n .string()\n .optional()\n .describe(\n \"For write, branch to create/update on. Defaults to GitHub's default branch.\",\n ),\n sha: z\n .string()\n .optional()\n .describe(\n \"For write updates, the current blob SHA. The action reads it first by default when omitted.\",\n ),\n overwriteExisting: z\n .boolean()\n .optional()\n .describe(\n \"For write, read the current file SHA first when sha is omitted, then update if it exists. Defaults to true.\",\n ),\n committer: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API committer identity.\",\n ),\n author: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API author identity.\",\n ),\n connectionId: z\n .string()\n .trim()\n .min(1)\n .optional()\n .describe(\"Optional workspace GitHub connection id to use.\"),\n timeoutMs: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(120_000)\n .optional()\n .describe(\"Request timeout in milliseconds.\"),\n maxBytes: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(4 * 1024 * 1024)\n .optional()\n .describe(\"Maximum provider response bytes to read.\"),\n});\n\ntype GitHubRepoFilesActionArgs = z.infer<typeof GitHubRepoFilesActionSchema>;\n\nexport interface CreateGitHubRepoFilesActionOptions {\n description?: string;\n requireApprovalForWrites?: boolean;\n}\n\nexport function createGitHubRepoFilesAction(\n runtime: Pick<\n ProviderApiRuntime,\n | \"listGitHubRepositoryFiles\"\n | \"searchGitHubRepositoryFiles\"\n | \"readGitHubRepositoryFile\"\n | \"writeGitHubRepositoryFile\"\n | \"deleteGitHubRepositoryFile\"\n >,\n options: CreateGitHubRepoFilesActionOptions = {},\n) {\n const requireApprovalForWrites = options.requireApprovalForWrites ?? true;\n return defineAction({\n description:\n options.description ??\n \"List, search, read, create/update, and delete GitHub repository files through the configured GitHub connector or GITHUB_TOKEN. Uses GitHub REST APIs directly; it does not clone repositories or use a filesystem sandbox.\",\n schema: GitHubRepoFilesActionSchema,\n http: false,\n needsApproval: requireApprovalForWrites\n ? (args: GitHubRepoFilesActionArgs) =>\n args.operation === \"write\" || args.operation === \"delete\"\n : false,\n run: async (args) => {\n if (args.operation === \"list\") {\n return runtime.listGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n recursive: args.recursive,\n includeDirectories: args.includeDirectories,\n maxFiles: args.maxFiles,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileListArgs);\n }\n\n if (args.operation === \"search\") {\n return runtime.searchGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n query: args.query,\n path: args.path,\n filename: args.filename,\n extension: args.extension,\n language: args.language,\n ref: args.ref,\n perPage: args.perPage,\n page: args.page,\n maxFiles: args.maxFiles,\n includeTextMatches: args.includeTextMatches,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileSearchArgs);\n }\n\n if (args.operation === \"read\") {\n if (!args.path) throw new Error(\"path is required for read.\");\n return runtime.readGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileReadArgs);\n }\n\n if (!args.path) {\n throw new Error(`path is required for ${args.operation}.`);\n }\n if (args.operation === \"delete\") {\n return runtime.deleteGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n message: args.message ?? `Delete ${args.path}`,\n branch: args.branch,\n sha: args.sha,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileDeleteArgs);\n }\n\n if (args.content === undefined) {\n throw new Error(\"content is required for write.\");\n }\n if (!args.message) throw new Error(\"message is required for write.\");\n return runtime.writeGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n content: args.content,\n message: args.message,\n branch: args.branch,\n sha: args.sha,\n overwriteExisting: args.overwriteExisting ?? true,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileWriteArgs);\n },\n });\n}\n\nexport { GitHubRepoFilesActionSchema };\n"]}
|
|
1
|
+
{"version":3,"file":"github-repo-files.js","sourceRoot":"","sources":["../../../src/provider-api/actions/github-repo-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU/C,MAAM,0BAA0B,GAAG,CAAC,CAAC,M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C,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,YAAY,EAAE,IAAI,CAAC,YAAY;oBAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBACiB,CAAC,CAAC;YAC9C,CAAC;YAED,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACpD,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACrE,OAAO,OAAO,CAAC,yBAAyB,CAAC;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,IAAI;gBACjD,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACgB,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nimport { defineAction } from \"../../action.js\";\nimport type {\n GitHubRepositoryFileDeleteArgs,\n GitHubRepositoryFileListArgs,\n GitHubRepositoryFileReadArgs,\n GitHubRepositoryFileSearchArgs,\n GitHubRepositoryFileWriteArgs,\n ProviderApiRuntime,\n} from \"../index.js\";\n\nconst GitHubCommitIdentitySchema = z.object({\n name: z.string().min(1).describe(\"Commit identity name.\"),\n email: z.string().email().describe(\"Commit identity email.\"),\n date: z.string().optional().describe(\"Optional ISO timestamp.\"),\n});\n\nconst GitHubRepoFilesActionSchema = z.object({\n operation: z\n .enum([\"list\", \"search\", \"read\", \"write\", \"delete\"])\n .describe(\n \"Operation to perform: list repository file paths, search code/files, read one file, create/update one file, or delete one file.\",\n ),\n owner: z.string().min(1).describe(\"Repository owner or organization.\"),\n repo: z\n .string()\n .min(1)\n .describe(\"Repository name, with or without a trailing .git suffix.\"),\n path: z\n .string()\n .optional()\n .describe(\n \"Repository-relative file or directory path. For search without query, this filters matching paths.\",\n ),\n ref: z\n .string()\n .optional()\n .describe(\n \"Branch, tag, or commit-ish for list/read. Code search uses GitHub's default-branch search.\",\n ),\n recursive: z\n .boolean()\n .optional()\n .describe(\"For list, read the repository tree recursively.\"),\n includeDirectories: z\n .boolean()\n .optional()\n .describe(\"For list, include directory entries along with files.\"),\n query: z\n .string()\n .optional()\n .describe(\n \"For search, a GitHub code-search term. Omit to search/filter file paths from the repository tree.\",\n ),\n filename: z\n .string()\n .optional()\n .describe(\"For search, restrict to an exact filename.\"),\n extension: z\n .string()\n .optional()\n .describe(\"For search, restrict to a file extension such as ts or md.\"),\n language: z\n .string()\n .optional()\n .describe(\"For code search, restrict to a GitHub language qualifier.\"),\n page: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, result page to fetch.\"),\n perPage: z.coerce\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\"For code search, results per page.\"),\n maxFiles: z.coerce\n .number()\n .int()\n .min(1)\n .max(10_000)\n .optional()\n .describe(\n \"Maximum file entries to return from list or tree-filter search.\",\n ),\n includeTextMatches: z\n .boolean()\n .optional()\n .describe(\"For code search, request GitHub text-match metadata.\"),\n content: z\n .string()\n .optional()\n .describe(\"For write, complete replacement UTF-8 file content.\"),\n message: z.string().optional().describe(\"For write, commit message.\"),\n branch: z\n .string()\n .optional()\n .describe(\n \"For write, branch to create/update on. Defaults to GitHub's default branch.\",\n ),\n sha: z\n .string()\n .optional()\n .describe(\n \"For write updates, the current blob SHA. The action reads it first by default when omitted.\",\n ),\n overwriteExisting: z\n .boolean()\n .optional()\n .describe(\n \"For write, read the current file SHA first when sha is omitted, then update if it exists. Defaults to true.\",\n ),\n committer: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API committer identity.\",\n ),\n author: GitHubCommitIdentitySchema.optional().describe(\n \"Optional GitHub contents API author identity.\",\n ),\n connectionId: z\n .string()\n .trim()\n .min(1)\n .optional()\n .describe(\"Optional workspace GitHub connection id to use.\"),\n timeoutMs: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(120_000)\n .optional()\n .describe(\"Request timeout in milliseconds.\"),\n maxBytes: z.coerce\n .number()\n .int()\n .min(1_000)\n .max(4 * 1024 * 1024)\n .optional()\n .describe(\"Maximum provider response bytes to read.\"),\n});\n\ntype GitHubRepoFilesActionArgs = z.infer<typeof GitHubRepoFilesActionSchema>;\n\nexport interface CreateGitHubRepoFilesActionOptions {\n description?: string;\n requireApprovalForWrites?: boolean;\n}\n\nexport function createGitHubRepoFilesAction(\n runtime: Pick<\n ProviderApiRuntime,\n | \"listGitHubRepositoryFiles\"\n | \"searchGitHubRepositoryFiles\"\n | \"readGitHubRepositoryFile\"\n | \"writeGitHubRepositoryFile\"\n | \"deleteGitHubRepositoryFile\"\n >,\n options: CreateGitHubRepoFilesActionOptions = {},\n) {\n const requireApprovalForWrites = options.requireApprovalForWrites ?? true;\n return defineAction({\n description:\n options.description ??\n \"List, search, read, create/update, and delete GitHub repository files through the configured GitHub connector or GITHUB_TOKEN. Uses GitHub REST APIs directly; it does not clone repositories or use a filesystem sandbox.\",\n schema: GitHubRepoFilesActionSchema,\n http: false,\n planMode: {\n effect: (args) =>\n args.operation === \"list\" ||\n args.operation === \"search\" ||\n args.operation === \"read\"\n ? \"read\"\n : \"write\",\n allowedValues: { operation: [\"list\", \"search\", \"read\"] },\n description:\n \"Plan mode allows listing, searching, and reading repository files.\",\n },\n needsApproval: requireApprovalForWrites\n ? (args: GitHubRepoFilesActionArgs) =>\n args.operation === \"write\" || args.operation === \"delete\"\n : false,\n run: async (args) => {\n if (args.operation === \"list\") {\n return runtime.listGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n recursive: args.recursive,\n includeDirectories: args.includeDirectories,\n maxFiles: args.maxFiles,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileListArgs);\n }\n\n if (args.operation === \"search\") {\n return runtime.searchGitHubRepositoryFiles({\n owner: args.owner,\n repo: args.repo,\n query: args.query,\n path: args.path,\n filename: args.filename,\n extension: args.extension,\n language: args.language,\n ref: args.ref,\n perPage: args.perPage,\n page: args.page,\n maxFiles: args.maxFiles,\n includeTextMatches: args.includeTextMatches,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileSearchArgs);\n }\n\n if (args.operation === \"read\") {\n if (!args.path) throw new Error(\"path is required for read.\");\n return runtime.readGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n ref: args.ref,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileReadArgs);\n }\n\n if (!args.path) {\n throw new Error(`path is required for ${args.operation}.`);\n }\n if (args.operation === \"delete\") {\n return runtime.deleteGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n message: args.message ?? `Delete ${args.path}`,\n branch: args.branch,\n sha: args.sha,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileDeleteArgs);\n }\n\n if (args.content === undefined) {\n throw new Error(\"content is required for write.\");\n }\n if (!args.message) throw new Error(\"message is required for write.\");\n return runtime.writeGitHubRepositoryFile({\n owner: args.owner,\n repo: args.repo,\n path: args.path,\n content: args.content,\n message: args.message,\n branch: args.branch,\n sha: args.sha,\n overwriteExisting: args.overwriteExisting ?? true,\n committer: args.committer,\n author: args.author,\n connectionId: args.connectionId,\n timeoutMs: args.timeoutMs,\n maxBytes: args.maxBytes,\n } satisfies GitHubRepositoryFileWriteArgs);\n },\n });\n}\n\nexport { GitHubRepoFilesActionSchema };\n"]}
|
|
@@ -311,8 +311,10 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
311
311
|
notes?: string | undefined;
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
|
+
message?: undefined;
|
|
314
315
|
id?: undefined;
|
|
315
|
-
|
|
316
|
+
provider?: undefined;
|
|
317
|
+
deleted?: undefined;
|
|
316
318
|
providers: {
|
|
317
319
|
id: string;
|
|
318
320
|
label: string;
|
|
@@ -323,47 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
323
325
|
updatedAt: number;
|
|
324
326
|
}[];
|
|
325
327
|
count: number;
|
|
326
|
-
|
|
327
|
-
deleted?: undefined;
|
|
328
|
+
found?: undefined;
|
|
328
329
|
registered?: undefined;
|
|
329
330
|
label?: undefined;
|
|
330
|
-
message?: undefined;
|
|
331
331
|
} | {
|
|
332
|
-
|
|
332
|
+
message?: undefined;
|
|
333
333
|
id?: undefined;
|
|
334
|
+
deleted?: undefined;
|
|
335
|
+
count?: undefined;
|
|
334
336
|
providers?: undefined;
|
|
335
337
|
found: boolean;
|
|
336
338
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
337
|
-
deleted?: undefined;
|
|
338
339
|
registered?: undefined;
|
|
339
340
|
label?: undefined;
|
|
340
|
-
message?: undefined;
|
|
341
341
|
} | {
|
|
342
|
+
message?: undefined;
|
|
343
|
+
provider?: undefined;
|
|
344
|
+
deleted?: undefined;
|
|
342
345
|
count?: undefined;
|
|
343
346
|
providers?: undefined;
|
|
344
|
-
provider?: undefined;
|
|
345
347
|
found: boolean;
|
|
346
348
|
id: string;
|
|
347
|
-
deleted?: undefined;
|
|
348
349
|
registered?: undefined;
|
|
349
350
|
label?: undefined;
|
|
350
|
-
message?: undefined;
|
|
351
351
|
} | {
|
|
352
|
+
message?: undefined;
|
|
353
|
+
provider?: undefined;
|
|
352
354
|
count?: undefined;
|
|
353
|
-
found?: undefined;
|
|
354
355
|
providers?: undefined;
|
|
355
|
-
|
|
356
|
+
found?: undefined;
|
|
356
357
|
deleted: boolean;
|
|
357
358
|
id: string;
|
|
358
359
|
registered?: undefined;
|
|
359
360
|
label?: undefined;
|
|
360
|
-
message?: undefined;
|
|
361
361
|
} | {
|
|
362
|
-
count?: undefined;
|
|
363
|
-
found?: undefined;
|
|
364
|
-
providers?: undefined;
|
|
365
362
|
provider?: undefined;
|
|
366
363
|
deleted?: undefined;
|
|
364
|
+
count?: undefined;
|
|
365
|
+
providers?: undefined;
|
|
366
|
+
found?: undefined;
|
|
367
367
|
registered: boolean;
|
|
368
368
|
id: string;
|
|
369
369
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-api.d.ts","sourceRoot":"","sources":["../../../src/provider-api/actions/provider-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEzC,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAGV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAEL,KAAK,6CAA6C,EACnD,MAAM,mCAAmC,CAAC;AAqH3C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