@agent-native/core 0.91.1 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blueprints/action/crud.md +1 -1
- package/blueprints/channel/discord.md +1 -1
- package/blueprints/provider/stripe.md +1 -1
- package/blueprints/sandbox/docker.md +1 -1
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +31 -0
- package/corpus/core/blueprints/action/crud.md +1 -1
- package/corpus/core/blueprints/channel/discord.md +1 -1
- package/corpus/core/blueprints/provider/stripe.md +1 -1
- package/corpus/core/blueprints/sandbox/docker.md +1 -1
- package/corpus/core/docs/content/faq.mdx +17 -0
- package/corpus/core/docs/content/notifications.mdx +12 -6
- package/corpus/core/package.json +6 -5
- package/corpus/core/src/agent/production-agent.ts +140 -46
- package/corpus/core/src/agent/run-manager.ts +23 -2
- package/corpus/core/src/agent/run-store.ts +2 -2
- package/corpus/core/src/agent/tool-search.ts +71 -4
- package/corpus/core/src/cli/add.ts +1 -1
- package/corpus/core/src/cli/create.ts +8 -3
- package/corpus/core/src/cli/index.ts +25 -4
- package/corpus/core/src/cli/upgrade.ts +798 -0
- package/corpus/core/src/client/AssistantChat.tsx +1 -1
- package/corpus/core/src/client/HighlightedCodeBlock.tsx +20 -3
- package/corpus/core/src/client/agent-chat-adapter.ts +31 -6
- package/corpus/core/src/client/chat/message-components.tsx +85 -8
- package/corpus/core/src/client/chat/tool-call-display.tsx +355 -144
- package/corpus/core/src/client/code-agent-chat-adapter.ts +2 -9
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +7 -0
- package/corpus/core/src/client/settings/SettingsPanel.tsx +533 -389
- package/corpus/core/src/client/settings/SettingsSection.tsx +154 -17
- package/corpus/core/src/client/sse-event-processor.ts +29 -2
- package/corpus/core/src/extensions/actions.ts +113 -5
- package/corpus/core/src/jobs/scheduler.ts +30 -1
- package/corpus/core/src/localization/default-messages.ts +21 -0
- package/corpus/core/src/notifications/channels.ts +88 -25
- package/corpus/core/src/notifications/registry.ts +17 -3
- package/corpus/core/src/notifications/types.ts +4 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +7 -3
- package/corpus/core/src/server/request-context.ts +7 -0
- package/corpus/core/src/styles/agent-conversation.css +1 -1
- package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/core/src/templates/default/AGENTS.md +10 -3
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +21 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +20 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +19 -0
- package/corpus/core/src/templates/default/package.json +4 -3
- package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/core/src/templates/headless/AGENTS.md +9 -3
- package/corpus/core/src/templates/headless/package.json +4 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/core/src/templates/workspace-core/package.json +6 -6
- package/corpus/core/src/templates/workspace-root/AGENTS.md +10 -4
- package/corpus/core/src/templates/workspace-root/package.json +3 -2
- package/corpus/core/src/triggers/dispatcher.ts +30 -2
- package/corpus/core/src/vite/client.ts +96 -1
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +20 -2
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/analytics/AGENTS.md +7 -5
- package/corpus/templates/analytics/actions/save-monitor.ts +14 -0
- package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +41 -6
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +122 -11
- package/corpus/templates/analytics/app/global.css +26 -10
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/analytics/app/i18n-data.ts +25 -0
- package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +8 -2
- package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorFormPage.tsx +151 -32
- package/corpus/templates/analytics/app/pages/monitoring/uptime/i18n.ts +17 -2
- package/corpus/templates/analytics/app/pages/monitoring/uptime/types.ts +4 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +461 -286
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +285 -294
- package/corpus/templates/analytics/changelog/2026-07-08-console-details-expand-inline-under-each-row-and-the-event-t.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-dashboard-tables-keep-their-size-while-loading.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-monitoring-uptime-and-errors-tabs-now-clearly-show-which-view-is-active.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replay-keeps-a-usable-stage-when-dev-tools-is-open-a.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replay-resumes-after-scrubbing-and-expands-console-r.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replay-uses-stock-rrweb-sizing-again-so-recorded.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-session-replays-wait-for-full-load-keep-a-normal-viewport-an.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sidebar-dashboard-menus-now-open-above-the-dashboard-canvas.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-08-uptime-alerting-clarifies-in-app-inbox-vs-email-and-lets-you-paste-slack-or-webhook-urls-per-monitor.md +6 -0
- package/corpus/templates/analytics/docs/uptime-monitoring.md +13 -11
- package/corpus/templates/analytics/package.json +2 -2
- package/corpus/templates/analytics/server/db/schema-monitoring.ts +4 -0
- package/corpus/templates/analytics/server/lib/uptime-monitors.ts +60 -12
- package/corpus/templates/analytics/server/plugins/db.ts +10 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/assets/package.json +2 -2
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/brain/package.json +2 -2
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/calendar/AGENTS.md +10 -0
- package/corpus/templates/calendar/actions/create-event.ts +5 -1
- package/corpus/templates/calendar/actions/event-action-helpers.ts +41 -0
- package/corpus/templates/calendar/actions/get-attendee-timezones.ts +28 -0
- package/corpus/templates/calendar/actions/set-attendee-timezone.ts +68 -0
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +150 -11
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +36 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +32 -0
- package/corpus/templates/calendar/app/hooks/use-attendee-timezones.ts +24 -0
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/app/lib/attendee-local-time.ts +122 -0
- package/corpus/templates/calendar/changelog/2026-07-08-event-details-now-support-extension-widgets-and-you-can-see-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-08-when-you-invite-guests-to-a-new-event-you-now-appear-in.md +6 -0
- package/corpus/templates/calendar/package.json +2 -2
- package/corpus/templates/calendar/server/handlers/events.ts +5 -1
- package/corpus/templates/calendar/shared/api.ts +6 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/chat/package.json +2 -2
- package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +6 -2
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/clips/actions/create-meeting.ts +8 -3
- package/corpus/templates/clips/actions/list-meetings.ts +31 -3
- package/corpus/templates/clips/changelog/2026-07-08-after-finishing-a-desktop-recording-reopening-clips-restor.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-clips-now-pops-up-to-take-notes-when-you-join-an-adhoc-zoom-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-desktop-clip-recordings-are-louder-after-capture-mic-only.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-desktop-meeting-notes-stay-active-from-tray-and-shortcut-controls.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-desktop-meeting-popovers-can-start-notes-and-join-the-meetin.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-meeting-notes-keep-their-recording-state-when-the-desktop.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-meeting-reminder-dropdowns-now-expand-fully-instead-of-being.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-meeting-reminders-now-appear-1-minute-before-start-stay-unti.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-08-the-desktop-meetings-panel-has-room-for-its-drop-shadow-and-.md +6 -0
- package/corpus/templates/clips/chrome-extension/package.json +2 -2
- package/corpus/templates/clips/desktop/package.json +2 -2
- package/corpus/templates/clips/desktop/src/app.tsx +214 -37
- package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +30 -6
- package/corpus/templates/clips/desktop/src/lib/meeting-notification-timing.ts +83 -0
- package/corpus/templates/clips/desktop/src/lib/native-recording-warm.ts +21 -0
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +98 -20
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +197 -50
- package/corpus/templates/clips/desktop/src/styles.css +150 -53
- package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +362 -0
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +41 -7
- package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +9 -2
- package/corpus/templates/clips/desktop/src-tauri/src/meetings_watcher.rs +89 -11
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +71 -17
- package/corpus/templates/clips/desktop/src-tauri/src/native_speech.rs +36 -1
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +62 -10
- package/corpus/templates/clips/desktop/src-tauri/src/shortcuts.rs +3 -3
- package/corpus/templates/clips/desktop/src-tauri/src/silence_detector.rs +1 -25
- package/corpus/templates/clips/desktop/src-tauri/src/state.rs +5 -0
- package/corpus/templates/clips/desktop/src-tauri/src/tray.rs +18 -6
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +36 -1
- package/corpus/templates/clips/package.json +2 -2
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/content/actions/_batch-utils.ts +8 -0
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +7 -5
- package/corpus/templates/content/actions/_content-database-personal-view.ts +80 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +776 -319
- package/corpus/templates/content/actions/_database-utils.ts +6 -1
- package/corpus/templates/content/actions/_property-utils.ts +168 -0
- package/corpus/templates/content/actions/add-content-database-source-field-property.ts +19 -12
- package/corpus/templates/content/actions/bind-content-database-source-field.ts +19 -12
- package/corpus/templates/content/actions/delete-document.ts +9 -13
- package/corpus/templates/content/actions/get-content-database-personal-view.ts +27 -0
- package/corpus/templates/content/actions/refresh-content-database-source.ts +5 -5
- package/corpus/templates/content/actions/update-content-database-personal-view.ts +31 -0
- package/corpus/templates/content/actions/update-content-database-view.ts +3 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +1 -1
- package/corpus/templates/content/app/components/editor/body-hydration.ts +35 -11
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +2631 -551
- package/corpus/templates/content/app/components/editor/database/filter-sort.ts +220 -18
- package/corpus/templates/content/app/hooks/use-content-database.ts +32 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +8 -2
- package/corpus/templates/content/app/i18n/zh-TW.ts +16 -0
- package/corpus/templates/content/app/i18n-data.ts +154 -0
- package/corpus/templates/content/changelog/2026-07-08-builder-source-sync-now-completes-reliably-on-hosted-databases.md +6 -0
- package/corpus/templates/content/changelog/2026-07-08-database-filters-now-support-notion-style-reset-save-for-eve.md +6 -0
- package/corpus/templates/content/changelog/2026-07-08-date-filters-can-now-target-a-between-range.md +6 -0
- package/corpus/templates/content/changelog/2026-07-08-fixed-builder-database-sync-so-large-sources-continue-past-t.md +6 -0
- package/corpus/templates/content/package.json +2 -2
- package/corpus/templates/content/parity/matrix.md +1 -1
- package/corpus/templates/content/parity/matrix.ts +2 -0
- package/corpus/templates/content/server/plugins/db.ts +19 -0
- package/corpus/templates/content/shared/api.ts +24 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/design/package.json +2 -2
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +34 -1
- package/corpus/templates/dispatch/app/i18n-data.ts +387 -10
- package/corpus/templates/dispatch/app/routes/automations.tsx +1 -0
- package/corpus/templates/dispatch/changelog/2026-07-08-added-an-automations-page-to-review-pause-and-create.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-08-destinations-now-shows-outbound-delivery-queue-health.md +6 -0
- package/corpus/templates/dispatch/package.json +2 -2
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/forms/package.json +2 -2
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/macros/package.json +2 -2
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/mail/app/hooks/use-emails.ts +56 -44
- package/corpus/templates/mail/app/lib/gmail-mutation-queue.ts +325 -0
- package/corpus/templates/mail/changelog/2026-07-08-rapid-archive-and-mark-read-now-batch-gmail-updates-so-the-i.md +6 -0
- package/corpus/templates/mail/package.json +2 -2
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/plan/package.json +2 -2
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +46 -29
- package/corpus/templates/slides/app/context/DeckContext.tsx +45 -18
- package/corpus/templates/slides/app/i18n/ar-SA.ts +4 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +4 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +4 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +4 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +4 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +4 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +4 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +4 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +4 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +4 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/slides/app/lib/image-drop-to-agent.ts +115 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +22 -13
- package/corpus/templates/slides/changelog/2026-07-08-dropping-an-image-onto-a-slide-and-sending-it-to-the-agent-w.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-08-undo-works-after-the-agent-edits-a-slide-so-you-can-reverse.md +6 -0
- package/corpus/templates/slides/package.json +2 -2
- package/corpus/templates/videos/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/corpus/templates/voice/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/dist/agent/production-agent.d.ts +5 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +112 -42
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +23 -2
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.js +2 -2
- package/dist/agent/run-store.js.map +1 -1
- package/dist/agent/tool-search.d.ts +2 -0
- package/dist/agent/tool-search.d.ts.map +1 -1
- package/dist/agent/tool-search.js +60 -4
- package/dist/agent/tool-search.js.map +1 -1
- package/dist/catalog.json +2 -2
- package/dist/cli/add.js +1 -1
- package/dist/cli/add.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +8 -3
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +24 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/upgrade.d.ts +100 -0
- package/dist/cli/upgrade.d.ts.map +1 -0
- package/dist/cli/upgrade.js +678 -0
- package/dist/cli/upgrade.js.map +1 -0
- package/dist/client/AssistantChat.js +1 -1
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/HighlightedCodeBlock.d.ts +2 -0
- package/dist/client/HighlightedCodeBlock.d.ts.map +1 -1
- package/dist/client/HighlightedCodeBlock.js +10 -1
- package/dist/client/HighlightedCodeBlock.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +32 -4
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +61 -8
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +12 -0
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +136 -42
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/code-agent-chat-adapter.js +2 -9
- package/dist/client/code-agent-chat-adapter.js.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +6 -0
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +52 -19
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsSection.d.ts +19 -4
- package/dist/client/settings/SettingsSection.d.ts.map +1 -1
- package/dist/client/settings/SettingsSection.js +33 -4
- package/dist/client/settings/SettingsSection.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +9 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +20 -2
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +85 -5
- package/dist/extensions/actions.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/scheduler.js +26 -1
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +19 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +19 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/channels.d.ts +8 -3
- package/dist/notifications/channels.d.ts.map +1 -1
- package/dist/notifications/channels.js +61 -22
- package/dist/notifications/channels.js.map +1 -1
- package/dist/notifications/registry.d.ts.map +1 -1
- package/dist/notifications/registry.js +14 -3
- package/dist/notifications/registry.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/notifications/types.d.ts +4 -1
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/notifications/types.js.map +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/server/agent-chat-plugin.d.ts +5 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +2 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/request-context.d.ts +7 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js.map +1 -1
- package/dist/styles/agent-conversation.css +1 -1
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/dist/templates/default/AGENTS.md +10 -3
- package/dist/templates/default/app/i18n/ar-SA.ts +21 -0
- package/dist/templates/default/app/i18n/de-DE.ts +21 -0
- package/dist/templates/default/app/i18n/en-US.ts +21 -0
- package/dist/templates/default/app/i18n/es-ES.ts +21 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +21 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +20 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +21 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +20 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +21 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +20 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +19 -0
- package/dist/templates/default/package.json +4 -3
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/dist/templates/headless/AGENTS.md +9 -3
- package/dist/templates/headless/package.json +4 -3
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/dist/templates/workspace-core/package.json +6 -6
- package/dist/templates/workspace-root/AGENTS.md +10 -4
- package/dist/templates/workspace-root/package.json +3 -2
- package/dist/triggers/dispatcher.js +27 -2
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +70 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/faq.mdx +17 -0
- package/docs/content/notifications.mdx +12 -6
- package/package.json +7 -6
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/src/templates/default/AGENTS.md +10 -3
- package/src/templates/default/app/i18n/ar-SA.ts +21 -0
- package/src/templates/default/app/i18n/de-DE.ts +21 -0
- package/src/templates/default/app/i18n/en-US.ts +21 -0
- package/src/templates/default/app/i18n/es-ES.ts +21 -0
- package/src/templates/default/app/i18n/fr-FR.ts +21 -0
- package/src/templates/default/app/i18n/hi-IN.ts +20 -0
- package/src/templates/default/app/i18n/ja-JP.ts +21 -0
- package/src/templates/default/app/i18n/ko-KR.ts +20 -0
- package/src/templates/default/app/i18n/pt-BR.ts +21 -0
- package/src/templates/default/app/i18n/zh-CN.ts +20 -0
- package/src/templates/default/app/i18n/zh-TW.ts +19 -0
- package/src/templates/default/package.json +4 -3
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/src/templates/headless/AGENTS.md +9 -3
- package/src/templates/headless/package.json +4 -3
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +20 -2
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
- package/src/templates/workspace-core/package.json +6 -6
- package/src/templates/workspace-root/AGENTS.md +10 -4
- package/src/templates/workspace-root/package.json +3 -2
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
import { IconChevronDown, IconCheck } from "@tabler/icons-react";
|
|
2
|
-
import type
|
|
2
|
+
import { createContext, useContext, type ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a settings section is being rendered.
|
|
8
|
+
*
|
|
9
|
+
* - `sidebar`: the compact agent sidebar panel (dense, small type).
|
|
10
|
+
* - `page`: the full-width settings page, styled as a polished card that
|
|
11
|
+
* matches the shadcn `Card` surface used by app-owned settings tabs.
|
|
12
|
+
*/
|
|
13
|
+
export type SettingsSurface = "sidebar" | "page";
|
|
14
|
+
|
|
15
|
+
const SettingsSurfaceContext = createContext<SettingsSurface>("sidebar");
|
|
16
|
+
|
|
17
|
+
export function SettingsSurfaceProvider({
|
|
18
|
+
surface,
|
|
19
|
+
children,
|
|
20
|
+
}: {
|
|
21
|
+
surface: SettingsSurface;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
<SettingsSurfaceContext.Provider value={surface}>
|
|
26
|
+
{children}
|
|
27
|
+
</SettingsSurfaceContext.Provider>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function useSettingsSurface(): SettingsSurface {
|
|
32
|
+
return useContext(SettingsSurfaceContext);
|
|
33
|
+
}
|
|
3
34
|
|
|
4
35
|
interface SettingsSectionProps {
|
|
5
36
|
id?: string;
|
|
@@ -15,10 +46,126 @@ interface SettingsSectionProps {
|
|
|
15
46
|
}
|
|
16
47
|
|
|
17
48
|
/**
|
|
18
|
-
* Collapsible settings section
|
|
19
|
-
*
|
|
49
|
+
* Collapsible settings section. Renders as a compact row in the agent sidebar
|
|
50
|
+
* and as a polished, shadcn-style card on the full settings page (so the
|
|
51
|
+
* framework tabs match app-owned General/Team cards). The visual surface is
|
|
52
|
+
* read from `SettingsSurfaceContext`.
|
|
20
53
|
*/
|
|
21
|
-
export function SettingsSection({
|
|
54
|
+
export function SettingsSection(props: SettingsSectionProps) {
|
|
55
|
+
const surface = useSettingsSurface();
|
|
56
|
+
return surface === "page" ? (
|
|
57
|
+
<PageSettingsSection {...props} />
|
|
58
|
+
) : (
|
|
59
|
+
<SidebarSettingsSection {...props} />
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function ConnectedDot({ size }: { size: "sm" | "md" }) {
|
|
64
|
+
const dim = size === "sm" ? "h-4 w-4" : "h-5 w-5";
|
|
65
|
+
const stroke = size === "sm" ? 3 : 2.5;
|
|
66
|
+
const glyph = size === "sm" ? 10 : 12;
|
|
67
|
+
return (
|
|
68
|
+
<span
|
|
69
|
+
className={cn(
|
|
70
|
+
"flex shrink-0 items-center justify-center rounded-full bg-green-500/15 text-green-500",
|
|
71
|
+
dim,
|
|
72
|
+
)}
|
|
73
|
+
>
|
|
74
|
+
<IconCheck size={glyph} stroke={stroke} />
|
|
75
|
+
</span>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function StatusBadge({
|
|
80
|
+
label,
|
|
81
|
+
tone,
|
|
82
|
+
size,
|
|
83
|
+
}: {
|
|
84
|
+
label: string;
|
|
85
|
+
tone: "muted" | "required";
|
|
86
|
+
size: "sm" | "md";
|
|
87
|
+
}) {
|
|
88
|
+
return (
|
|
89
|
+
<span
|
|
90
|
+
className={cn(
|
|
91
|
+
"shrink-0 rounded-full font-semibold uppercase tracking-wide",
|
|
92
|
+
size === "sm" ? "px-1.5 py-0.5 text-[9px]" : "px-2 py-0.5 text-[10px]",
|
|
93
|
+
tone === "required"
|
|
94
|
+
? "bg-amber-500/15 text-amber-600 dark:text-amber-400"
|
|
95
|
+
: "bg-muted text-muted-foreground",
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
{label}
|
|
99
|
+
</span>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function PageSettingsSection({
|
|
104
|
+
id,
|
|
105
|
+
icon,
|
|
106
|
+
title,
|
|
107
|
+
subtitle,
|
|
108
|
+
badge,
|
|
109
|
+
required,
|
|
110
|
+
connected,
|
|
111
|
+
open = false,
|
|
112
|
+
onToggle,
|
|
113
|
+
children,
|
|
114
|
+
}: SettingsSectionProps) {
|
|
115
|
+
return (
|
|
116
|
+
<div
|
|
117
|
+
id={id}
|
|
118
|
+
className={cn(
|
|
119
|
+
"scroll-mt-16 overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm transition-colors",
|
|
120
|
+
open ? "border-border" : "border-border/60",
|
|
121
|
+
)}
|
|
122
|
+
>
|
|
123
|
+
<button
|
|
124
|
+
type="button"
|
|
125
|
+
onClick={onToggle}
|
|
126
|
+
aria-expanded={open}
|
|
127
|
+
className="flex w-full items-start justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/40 sm:px-6 sm:py-5"
|
|
128
|
+
>
|
|
129
|
+
<div className="flex min-w-0 items-start gap-3">
|
|
130
|
+
<span className="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground [&>svg]:size-[18px]">
|
|
131
|
+
{icon}
|
|
132
|
+
</span>
|
|
133
|
+
<span className="flex min-w-0 flex-col gap-1.5">
|
|
134
|
+
<span className="flex flex-wrap items-center gap-2">
|
|
135
|
+
<span className="text-base font-semibold leading-none tracking-tight text-foreground">
|
|
136
|
+
{title}
|
|
137
|
+
</span>
|
|
138
|
+
{connected && <ConnectedDot size="md" />}
|
|
139
|
+
{required && !connected && (
|
|
140
|
+
<StatusBadge label="Required" tone="required" size="md" />
|
|
141
|
+
)}
|
|
142
|
+
{badge && <StatusBadge label={badge} tone="muted" size="md" />}
|
|
143
|
+
</span>
|
|
144
|
+
{subtitle && (
|
|
145
|
+
<span className="text-sm leading-snug text-muted-foreground">
|
|
146
|
+
{subtitle}
|
|
147
|
+
</span>
|
|
148
|
+
)}
|
|
149
|
+
</span>
|
|
150
|
+
</div>
|
|
151
|
+
<IconChevronDown
|
|
152
|
+
size={18}
|
|
153
|
+
className={cn(
|
|
154
|
+
"mt-1 shrink-0 text-muted-foreground transition-transform",
|
|
155
|
+
open && "rotate-180",
|
|
156
|
+
)}
|
|
157
|
+
/>
|
|
158
|
+
</button>
|
|
159
|
+
{open && (
|
|
160
|
+
<div className="border-t border-border/60 px-5 pb-5 pt-5 sm:px-6 sm:pb-6">
|
|
161
|
+
{children}
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
</div>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function SidebarSettingsSection({
|
|
22
169
|
id,
|
|
23
170
|
icon,
|
|
24
171
|
title,
|
|
@@ -42,21 +189,11 @@ export function SettingsSection({
|
|
|
42
189
|
<span className="text-[12px] font-medium text-foreground truncate">
|
|
43
190
|
{title}
|
|
44
191
|
</span>
|
|
45
|
-
{connected &&
|
|
46
|
-
<span className="flex items-center justify-center shrink-0 rounded-full bg-green-500/15 text-green-500 w-4 h-4">
|
|
47
|
-
<IconCheck size={10} stroke={3} />
|
|
48
|
-
</span>
|
|
49
|
-
)}
|
|
192
|
+
{connected && <ConnectedDot size="sm" />}
|
|
50
193
|
{required && !connected && (
|
|
51
|
-
<
|
|
52
|
-
Required
|
|
53
|
-
</span>
|
|
54
|
-
)}
|
|
55
|
-
{badge && (
|
|
56
|
-
<span className="shrink-0 rounded-full bg-accent/60 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground">
|
|
57
|
-
{badge}
|
|
58
|
-
</span>
|
|
194
|
+
<StatusBadge label="Required" tone="muted" size="sm" />
|
|
59
195
|
)}
|
|
196
|
+
{badge && <StatusBadge label={badge} tone="muted" size="sm" />}
|
|
60
197
|
</div>
|
|
61
198
|
<IconChevronDown
|
|
62
199
|
size={12}
|
|
@@ -15,6 +15,16 @@ import {
|
|
|
15
15
|
|
|
16
16
|
export type ContentPart =
|
|
17
17
|
| { type: "text"; text: string }
|
|
18
|
+
| {
|
|
19
|
+
/**
|
|
20
|
+
* Model chain-of-thought / extended-thinking prose. Streamed from
|
|
21
|
+
* server `thinking` SSE events (and code-agent thinking transcript
|
|
22
|
+
* items). Rendered as a collapsible plain-English cell — not a tool
|
|
23
|
+
* call.
|
|
24
|
+
*/
|
|
25
|
+
type: "reasoning";
|
|
26
|
+
text: string;
|
|
27
|
+
}
|
|
18
28
|
| {
|
|
19
29
|
type: "tool-call";
|
|
20
30
|
toolCallId: string;
|
|
@@ -669,7 +679,7 @@ function pendingToolNames(content: ContentPart[]): {
|
|
|
669
679
|
|
|
670
680
|
function contentSnapshot(content: ContentPart[]): ContentPart[] {
|
|
671
681
|
return content.map((part) => {
|
|
672
|
-
if (part.type === "text") return { ...part };
|
|
682
|
+
if (part.type === "text" || part.type === "reasoning") return { ...part };
|
|
673
683
|
return {
|
|
674
684
|
...part,
|
|
675
685
|
args: { ...part.args },
|
|
@@ -952,6 +962,23 @@ export function processEvent(
|
|
|
952
962
|
};
|
|
953
963
|
}
|
|
954
964
|
|
|
965
|
+
if (ev.type === "thinking") {
|
|
966
|
+
// Model chain-of-thought. Coalesce consecutive deltas into one reasoning
|
|
967
|
+
// part so the UI can render a single collapsible "Thinking" cell.
|
|
968
|
+
const delta = ev.text ?? "";
|
|
969
|
+
if (!delta) return { action: "continue" };
|
|
970
|
+
const lastPart = content[content.length - 1];
|
|
971
|
+
if (lastPart && lastPart.type === "reasoning") {
|
|
972
|
+
lastPart.text += delta;
|
|
973
|
+
} else {
|
|
974
|
+
content.push({ type: "reasoning", text: delta });
|
|
975
|
+
}
|
|
976
|
+
return {
|
|
977
|
+
action: "yield",
|
|
978
|
+
result: { content: contentSnapshot(content) } as ChatModelRunResult,
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
|
|
955
982
|
if (ev.type === "stream_keepalive") {
|
|
956
983
|
return { action: "continue" };
|
|
957
984
|
}
|
|
@@ -1400,7 +1427,7 @@ function clearAssistantDraftContent(content: ContentPart[]): void {
|
|
|
1400
1427
|
for (let index = content.length - 1; index >= 0; index--) {
|
|
1401
1428
|
const part = content[index];
|
|
1402
1429
|
if (!part) continue;
|
|
1403
|
-
if (part.type === "text") {
|
|
1430
|
+
if (part.type === "text" || part.type === "reasoning") {
|
|
1404
1431
|
content.splice(index, 1);
|
|
1405
1432
|
continue;
|
|
1406
1433
|
}
|
|
@@ -3,6 +3,7 @@ import type { ActionRunContext } from "../action.js";
|
|
|
3
3
|
import type { ActionEntry } from "../agent/production-agent.js";
|
|
4
4
|
import type { AgentChatAttachment } from "../agent/types.js";
|
|
5
5
|
import { writeAppState } from "../application-state/script-helpers.js";
|
|
6
|
+
import { getRequestRunContext } from "../server/request-context.js";
|
|
6
7
|
import { resolveAccess } from "../sharing/access.js";
|
|
7
8
|
import type {
|
|
8
9
|
ExtensionContentEdit,
|
|
@@ -38,6 +39,8 @@ import {
|
|
|
38
39
|
unhideExtension,
|
|
39
40
|
updateExtension,
|
|
40
41
|
updateExtensionContent,
|
|
42
|
+
type ExtensionHistoryDetail,
|
|
43
|
+
type ExtensionHistoryEntry,
|
|
41
44
|
type ExtensionRow,
|
|
42
45
|
} from "./store.js";
|
|
43
46
|
|
|
@@ -126,7 +129,7 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
126
129
|
"get-extension": {
|
|
127
130
|
tool: {
|
|
128
131
|
description:
|
|
129
|
-
"Get one existing extension by id. Use this when <current-screen> or <current-url> contains extensionId for the current extension; do not call list-extensions just to rediscover that id. Defaults to including the full Alpine.js content so you can make a targeted update-extension edit.",
|
|
132
|
+
"Get one existing extension by id. Use this when <current-screen> or <current-url> contains extensionId for the current extension; do not call list-extensions just to rediscover that id. Defaults to including the full Alpine.js content once per run so you can make a targeted update-extension edit; repeated unchanged reads return compact metadata unless forceContent=true.",
|
|
130
133
|
parameters: {
|
|
131
134
|
type: "object",
|
|
132
135
|
properties: {
|
|
@@ -140,6 +143,11 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
140
143
|
description:
|
|
141
144
|
"Include full Alpine.js content. Defaults to true for targeted edits.",
|
|
142
145
|
},
|
|
146
|
+
forceContent: {
|
|
147
|
+
type: "boolean",
|
|
148
|
+
description:
|
|
149
|
+
"Return full content even if this run already read the same unchanged body. Use sparingly; prefer update-extension edits after the first read.",
|
|
150
|
+
},
|
|
143
151
|
},
|
|
144
152
|
required: ["id"],
|
|
145
153
|
},
|
|
@@ -151,14 +159,16 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
151
159
|
args?.includeContent === undefined
|
|
152
160
|
? true
|
|
153
161
|
: coerceBoolean(args.includeContent);
|
|
162
|
+
const forceContent = coerceBoolean(args?.forceContent);
|
|
154
163
|
const localExtension = await getLocalExtension(id);
|
|
155
164
|
if (localExtension) {
|
|
156
165
|
return {
|
|
157
166
|
ok: true,
|
|
158
|
-
extension: await
|
|
167
|
+
extension: await summarizeExtensionForAgentRead(
|
|
159
168
|
localExtension,
|
|
160
169
|
new Set(),
|
|
161
170
|
includeContent,
|
|
171
|
+
forceContent,
|
|
162
172
|
),
|
|
163
173
|
};
|
|
164
174
|
}
|
|
@@ -167,10 +177,11 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
167
177
|
const hiddenIds = await getHiddenExtensionIdsForCurrentUser();
|
|
168
178
|
return {
|
|
169
179
|
ok: true,
|
|
170
|
-
extension: await
|
|
180
|
+
extension: await summarizeExtensionForAgentRead(
|
|
171
181
|
extension,
|
|
172
182
|
hiddenIds,
|
|
173
183
|
includeContent,
|
|
184
|
+
forceContent,
|
|
174
185
|
),
|
|
175
186
|
};
|
|
176
187
|
},
|
|
@@ -223,7 +234,7 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
223
234
|
"get-extension-history-version": {
|
|
224
235
|
tool: {
|
|
225
236
|
description:
|
|
226
|
-
"Get one extension history version with its previous-version diff. Use after list-extension-history when the user wants to inspect exactly what changed.",
|
|
237
|
+
"Get one extension history version with its previous-version diff. Use after list-extension-history when the user wants to inspect exactly what changed. Full HTML bodies are omitted by default; set includeContent=true only when restoring or manually comparing full source.",
|
|
227
238
|
parameters: {
|
|
228
239
|
type: "object",
|
|
229
240
|
properties: {
|
|
@@ -235,6 +246,11 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
235
246
|
type: "number",
|
|
236
247
|
description: "History version number to inspect.",
|
|
237
248
|
},
|
|
249
|
+
includeContent: {
|
|
250
|
+
type: "boolean",
|
|
251
|
+
description:
|
|
252
|
+
"Include full HTML for the current and previous versions. Defaults to false to keep agent context compact.",
|
|
253
|
+
},
|
|
238
254
|
},
|
|
239
255
|
required: ["id", "version"],
|
|
240
256
|
},
|
|
@@ -252,7 +268,13 @@ export function createExtensionActionEntries(): Record<string, ActionEntry> {
|
|
|
252
268
|
if (!detail) {
|
|
253
269
|
return `Error: extension history version not found: ${id}#${version}`;
|
|
254
270
|
}
|
|
255
|
-
return {
|
|
271
|
+
return {
|
|
272
|
+
ok: true,
|
|
273
|
+
...compactExtensionHistoryDetail(
|
|
274
|
+
detail,
|
|
275
|
+
coerceBoolean(args?.includeContent),
|
|
276
|
+
),
|
|
277
|
+
};
|
|
256
278
|
},
|
|
257
279
|
readOnly: true,
|
|
258
280
|
},
|
|
@@ -1059,11 +1081,97 @@ async function summarizeExtension(
|
|
|
1059
1081
|
hiddenBy: row.hiddenBy,
|
|
1060
1082
|
createdAt: row.createdAt,
|
|
1061
1083
|
updatedAt: row.updatedAt,
|
|
1084
|
+
contentLength: row.content.length,
|
|
1085
|
+
contentHash: contentFingerprint(row.content),
|
|
1062
1086
|
...(local ? { source: row.source } : {}),
|
|
1063
1087
|
...(includeContent ? { content: row.content } : {}),
|
|
1064
1088
|
};
|
|
1065
1089
|
}
|
|
1066
1090
|
|
|
1091
|
+
async function summarizeExtensionForAgentRead(
|
|
1092
|
+
row: ExtensionRow | LocalExtensionRow,
|
|
1093
|
+
hiddenIds: Set<string>,
|
|
1094
|
+
includeContent: boolean,
|
|
1095
|
+
forceContent: boolean,
|
|
1096
|
+
) {
|
|
1097
|
+
if (!includeContent) {
|
|
1098
|
+
return summarizeExtension(row, hiddenIds, false);
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
const fingerprint = contentFingerprint(row.content);
|
|
1102
|
+
const runCtx = getRequestRunContext();
|
|
1103
|
+
const reads = runCtx ? (runCtx.extensionContentReads ??= {}) : undefined;
|
|
1104
|
+
const alreadySent = !forceContent && reads?.[row.id] === fingerprint;
|
|
1105
|
+
if (!alreadySent && reads) {
|
|
1106
|
+
reads[row.id] = fingerprint;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
const summary = await summarizeExtension(row, hiddenIds, !alreadySent);
|
|
1110
|
+
if (!alreadySent) return summary;
|
|
1111
|
+
|
|
1112
|
+
return {
|
|
1113
|
+
...summary,
|
|
1114
|
+
contentOmitted: {
|
|
1115
|
+
reason: "unchanged-content-already-returned-this-run",
|
|
1116
|
+
contentHash: fingerprint,
|
|
1117
|
+
contentLength: row.content.length,
|
|
1118
|
+
next: "Use the content already returned earlier in this run and call update-extension with focused edits/patches. Set forceContent=true only if you truly need the full body again.",
|
|
1119
|
+
},
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
function compactExtensionHistoryDetail(
|
|
1124
|
+
detail: ExtensionHistoryDetail,
|
|
1125
|
+
includeContent: boolean,
|
|
1126
|
+
): ExtensionHistoryDetail & {
|
|
1127
|
+
diffOmitted?: { omittedLines: number; maxLines: number };
|
|
1128
|
+
} {
|
|
1129
|
+
const diffMaxLines = 400;
|
|
1130
|
+
const fullDiff = detail.diff ?? [];
|
|
1131
|
+
const diff =
|
|
1132
|
+
fullDiff.length > diffMaxLines
|
|
1133
|
+
? [...fullDiff.slice(0, 200), ...fullDiff.slice(fullDiff.length - 200)]
|
|
1134
|
+
: fullDiff;
|
|
1135
|
+
return {
|
|
1136
|
+
...detail,
|
|
1137
|
+
entry: compactHistoryEntry(detail.entry, includeContent),
|
|
1138
|
+
previous: detail.previous
|
|
1139
|
+
? compactHistoryEntry(detail.previous, includeContent)
|
|
1140
|
+
: null,
|
|
1141
|
+
diff,
|
|
1142
|
+
...(fullDiff.length > diff.length
|
|
1143
|
+
? {
|
|
1144
|
+
diffOmitted: {
|
|
1145
|
+
omittedLines: fullDiff.length - diff.length,
|
|
1146
|
+
maxLines: diffMaxLines,
|
|
1147
|
+
},
|
|
1148
|
+
}
|
|
1149
|
+
: {}),
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
function compactHistoryEntry(
|
|
1154
|
+
entry: ExtensionHistoryEntry,
|
|
1155
|
+
includeContent: boolean,
|
|
1156
|
+
): ExtensionHistoryEntry & { contentHash?: string } {
|
|
1157
|
+
const content = entry.content ?? "";
|
|
1158
|
+
const withHash = {
|
|
1159
|
+
...entry,
|
|
1160
|
+
...(content ? { contentHash: contentFingerprint(content) } : {}),
|
|
1161
|
+
};
|
|
1162
|
+
if (includeContent) return withHash;
|
|
1163
|
+
const { content: _content, ...withoutContent } = withHash;
|
|
1164
|
+
return withoutContent;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
function contentFingerprint(content: string): string {
|
|
1168
|
+
let hash = 5381;
|
|
1169
|
+
for (let i = 0; i < content.length; i++) {
|
|
1170
|
+
hash = (hash * 33) ^ content.charCodeAt(i);
|
|
1171
|
+
}
|
|
1172
|
+
return `${content.length.toString(36)}-${(hash >>> 0).toString(36)}`;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1067
1175
|
async function localExtensionEditMessage(id: string): Promise<string | null> {
|
|
1068
1176
|
const localExtension = await getLocalExtension(id);
|
|
1069
1177
|
if (!localExtension) return null;
|
|
@@ -451,13 +451,16 @@ async function executeJob(
|
|
|
451
451
|
// run completes so finished jobs don't leave a live timer keeping the
|
|
452
452
|
// process/event loop alive for the remainder of the window.
|
|
453
453
|
let hardAbortTimer: ReturnType<typeof setTimeout> | null = null;
|
|
454
|
+
const jobUsageRef: {
|
|
455
|
+
current: Awaited<ReturnType<typeof runAgentLoop>> | null;
|
|
456
|
+
} = { current: null };
|
|
454
457
|
await new Promise<void>((resolve, reject) => {
|
|
455
458
|
const activeRun = startRun(
|
|
456
459
|
runId,
|
|
457
460
|
thread.id,
|
|
458
461
|
async (send, signal) => {
|
|
459
462
|
try {
|
|
460
|
-
await runAgentLoop({
|
|
463
|
+
jobUsageRef.current = await runAgentLoop({
|
|
461
464
|
engine,
|
|
462
465
|
model,
|
|
463
466
|
systemPrompt,
|
|
@@ -512,6 +515,32 @@ async function executeJob(
|
|
|
512
515
|
|
|
513
516
|
if (jobError) throw jobError;
|
|
514
517
|
|
|
518
|
+
const jobUsage = jobUsageRef.current;
|
|
519
|
+
if (
|
|
520
|
+
jobUsage &&
|
|
521
|
+
(jobUsage.inputTokens > 0 ||
|
|
522
|
+
jobUsage.outputTokens > 0 ||
|
|
523
|
+
jobUsage.cacheReadTokens > 0 ||
|
|
524
|
+
jobUsage.cacheWriteTokens > 0)
|
|
525
|
+
) {
|
|
526
|
+
try {
|
|
527
|
+
const { recordUsage } = await import("../usage/store.js");
|
|
528
|
+
await recordUsage({
|
|
529
|
+
ownerEmail: jobUserEmail,
|
|
530
|
+
inputTokens: jobUsage.inputTokens,
|
|
531
|
+
outputTokens: jobUsage.outputTokens,
|
|
532
|
+
cacheReadTokens: jobUsage.cacheReadTokens,
|
|
533
|
+
cacheWriteTokens: jobUsage.cacheWriteTokens,
|
|
534
|
+
model: jobUsage.model,
|
|
535
|
+
label: `recurring-job:${jobName}`,
|
|
536
|
+
app: deps.appId,
|
|
537
|
+
refId: runId,
|
|
538
|
+
});
|
|
539
|
+
} catch {
|
|
540
|
+
// Usage attribution must not break the scheduled task.
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
515
544
|
// Success — update status. Compute the next run from completion time,
|
|
516
545
|
// not the job's start time `now`: a long run could otherwise schedule a
|
|
517
546
|
// nextRun that's already in the past and re-fire immediately next tick.
|
|
@@ -47,6 +47,8 @@ const messages = {
|
|
|
47
47
|
destinations: "Destinations",
|
|
48
48
|
identities: "Identities",
|
|
49
49
|
approvals: "Approvals",
|
|
50
|
+
automations: "Automations",
|
|
51
|
+
delivery: "Delivery",
|
|
50
52
|
audit: "Audit",
|
|
51
53
|
dreams: "Dreams",
|
|
52
54
|
threadDebug: "Thread Debug",
|
|
@@ -161,6 +163,22 @@ const messages = {
|
|
|
161
163
|
activeUsers: "Active users",
|
|
162
164
|
workspaceAppsStat: "Workspace apps",
|
|
163
165
|
chatThreads: "Chat threads",
|
|
166
|
+
also: "Also",
|
|
167
|
+
workspaceShortcutsAria: "Workspace shortcuts",
|
|
168
|
+
deliveryQueue: "Delivery queue",
|
|
169
|
+
failedLastHour: "{{count}} failed in the last hour",
|
|
170
|
+
processingCount: "{{count}} processing",
|
|
171
|
+
queued: "Queued",
|
|
172
|
+
active: "Active",
|
|
173
|
+
done1h: "Done 1h",
|
|
174
|
+
failed1h: "Failed 1h",
|
|
175
|
+
oldestQueued: "Oldest queued: {{age}}",
|
|
176
|
+
queueAgeNone: "none",
|
|
177
|
+
queueFailureHint:
|
|
178
|
+
"Check credentials, destinations, and recent queue errors.",
|
|
179
|
+
unknownPlatform: "unknown",
|
|
180
|
+
attemptsCount: "{{count}} attempts",
|
|
181
|
+
noErrorMessage: "(no error message)",
|
|
164
182
|
},
|
|
165
183
|
},
|
|
166
184
|
agentPanel: {
|
|
@@ -335,6 +353,9 @@ const messages = {
|
|
|
335
353
|
contactSidebarWidget: "Contact sidebar widget",
|
|
336
354
|
contactSidebarDescription:
|
|
337
355
|
"Appears beside the current conversation with contact and thread context.",
|
|
356
|
+
eventDetailWidget: "Event detail widget",
|
|
357
|
+
eventDetailDescription:
|
|
358
|
+
"Appears below the open calendar event with event and attendee context.",
|
|
338
359
|
addWidgetHere: "Add widget here",
|
|
339
360
|
back: "Back",
|
|
340
361
|
editExtension: "Edit Extension",
|