@agent-native/core 0.114.16 → 0.115.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-native.eject.json +2 -0
- package/corpus/README.md +3 -3
- package/corpus/core/CHANGELOG.md +41 -0
- package/corpus/core/agent-native.eject.json +2 -0
- package/corpus/core/docs/content/agent-native-toolkit.mdx +16 -0
- package/corpus/core/docs/content/recurring-jobs.mdx +35 -6
- package/corpus/core/export-snapshot.json +4 -0
- package/corpus/core/package.json +5 -1
- package/corpus/core/src/action.ts +22 -1
- package/corpus/core/src/agent/production-agent.ts +122 -3
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +19 -2
- package/corpus/core/src/cli/templates-meta.ts +12 -0
- package/corpus/core/src/client/AssistantChat.tsx +53 -26
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +19 -0
- package/corpus/core/src/client/agent-page/use-jobs.ts +1 -0
- package/corpus/core/src/client/blocks/library/wireframe.tsx +3 -1
- package/corpus/core/src/client/chat/message-components.tsx +35 -1
- package/corpus/core/src/client/chat/tool-call-display.tsx +38 -3
- package/corpus/core/src/connections/catalog.ts +20 -1
- package/corpus/core/src/connections/reader.ts +65 -0
- package/corpus/core/src/dashboard-storage/index.ts +27 -0
- package/corpus/core/src/dashboard-storage/panel-source.ts +168 -0
- package/corpus/core/src/dashboard-storage/schema.ts +62 -0
- package/corpus/core/src/dashboard-storage/store.ts +333 -0
- package/corpus/core/src/deploy/build.ts +95 -16
- package/corpus/core/src/eject/provider-api-definitions.ts +1 -0
- package/corpus/core/src/eject/workspace-connections.ts +1 -0
- package/corpus/core/src/extensions/actions.ts +199 -73
- package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +2 -0
- package/corpus/core/src/jobs/scheduler.ts +71 -4
- package/corpus/core/src/jobs/tools.ts +31 -1
- package/corpus/core/src/localization/default-messages.ts +1 -0
- package/corpus/core/src/mcp-client/index.ts +6 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +1 -1
- package/corpus/core/src/provider-api/index.ts +190 -5
- package/corpus/core/src/secrets/register-framework-secrets.ts +8 -0
- package/corpus/core/src/server/agent-chat/context-tools.ts +9 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +2 -2
- package/corpus/core/src/server/agent-chat-plugin.ts +22 -2
- package/corpus/core/src/server/core-routes-plugin.ts +1 -0
- package/corpus/core/src/server/credential-provider.ts +9 -3
- package/corpus/core/src/server/workspace-provider-oauth.ts +181 -4
- package/corpus/core/src/styles/agent-native.css +45 -2
- package/corpus/core/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/core/src/templates/default/.agents/skills/app-branding/SKILL.md +159 -0
- package/corpus/core/src/templates/default/.agents/skills/app-permissions/SKILL.md +155 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +31 -18
- package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +15 -0
- package/corpus/core/src/triggers/actions.ts +11 -2
- package/corpus/core/src/triggers/dispatcher.ts +20 -1
- package/corpus/core/src/triggers/types.ts +5 -0
- package/corpus/core/src/vite/action-types-plugin.ts +9 -1
- package/corpus/templates/analytics/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/analytics/AGENTS.md +11 -11
- package/corpus/templates/analytics/_gitignore +39 -0
- package/corpus/templates/analytics/actions/query-dashboard-panel.ts +30 -0
- package/corpus/templates/analytics/actions/update-dashboard.ts +2 -1
- package/corpus/templates/analytics/app/lib/sql-query.ts +11 -25
- package/corpus/templates/analytics/changelog/2026-07-21-fixed-extension-updates-failing-before-changes-could-be-appl.md +6 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +1 -0
- package/corpus/templates/analytics/server/lib/dashboard-panel-source-resolver.ts +51 -0
- package/corpus/templates/analytics/server/lib/prometheus.ts +1 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/assets/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/brain/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/calendar/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/calendar/_gitignore +39 -0
- package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/templates/chat/AGENTS.md +1 -1
- package/corpus/templates/clips/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/clips/AGENTS.md +7 -0
- package/corpus/templates/clips/actions/prepare-crm-call-evidence.ts +58 -0
- package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +88 -11
- package/corpus/templates/clips/changelog/2026-07-21-crm-call-evidence-handoff.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-21-recording-retries-and-restarts-keep-their-upload-session-so-.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/background.ts +20 -5
- package/corpus/templates/clips/chrome-extension/src/native-recording-state.ts +19 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +8 -0
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +9 -0
- package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +54 -28
- package/corpus/templates/clips/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/content/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/content/_gitignore +39 -0
- package/corpus/templates/content/learnings.defaults.md +5 -0
- package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +133 -0
- package/corpus/templates/crm/.agents/skills/crm/SKILL.md +128 -0
- package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +145 -0
- package/corpus/templates/crm/.agents/skills/feature-flags/SKILL.md +169 -0
- package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +100 -0
- package/corpus/templates/crm/.env.example +5 -0
- package/corpus/templates/crm/AGENTS.md +120 -0
- package/corpus/templates/crm/CHANGELOG.md +1 -0
- package/corpus/templates/crm/DEVELOPING.md +66 -0
- package/corpus/templates/crm/README.md +106 -0
- package/corpus/templates/crm/_gitignore +12 -0
- package/corpus/templates/crm/actions/_crm-action-utils.ts +87 -0
- package/corpus/templates/crm/actions/_crm-dashboard.ts +69 -0
- package/corpus/templates/crm/actions/_crm-signal-utils.ts +79 -0
- package/corpus/templates/crm/actions/apply-crm-proposals.ts +203 -0
- package/corpus/templates/crm/actions/attach-call-evidence.ts +170 -0
- package/corpus/templates/crm/actions/configure-crm-connection.ts +126 -0
- package/corpus/templates/crm/actions/configure-native-crm.ts +44 -0
- package/corpus/templates/crm/actions/create-crm-record.ts +148 -0
- package/corpus/templates/crm/actions/create-crm-signal-tracker.ts +58 -0
- package/corpus/templates/crm/actions/delete-staged-dataset.ts +14 -0
- package/corpus/templates/crm/actions/get-crm-automation-recipe.ts +36 -0
- package/corpus/templates/crm/actions/get-crm-dashboard-panel.ts +33 -0
- package/corpus/templates/crm/actions/get-crm-dashboard.ts +14 -0
- package/corpus/templates/crm/actions/get-crm-overview.ts +13 -0
- package/corpus/templates/crm/actions/get-crm-pipeline-data.ts +61 -0
- package/corpus/templates/crm/actions/get-crm-record.ts +75 -0
- package/corpus/templates/crm/actions/install-crm-pipeline-dashboard.ts +81 -0
- package/corpus/templates/crm/actions/list-crm-dashboard-revisions.ts +15 -0
- package/corpus/templates/crm/actions/list-crm-dashboards.ts +15 -0
- package/corpus/templates/crm/actions/list-crm-proposals.ts +31 -0
- package/corpus/templates/crm/actions/list-crm-records.ts +79 -0
- package/corpus/templates/crm/actions/list-crm-saved-views.ts +15 -0
- package/corpus/templates/crm/actions/list-crm-signal-hits.ts +43 -0
- package/corpus/templates/crm/actions/list-crm-signal-trackers.ts +32 -0
- package/corpus/templates/crm/actions/list-crm-tasks.ts +22 -0
- package/corpus/templates/crm/actions/list-staged-datasets.ts +14 -0
- package/corpus/templates/crm/actions/list-workspace-connections.ts +47 -0
- package/corpus/templates/crm/actions/manage-crm-signal-tracker.ts +87 -0
- package/corpus/templates/crm/actions/manage-crm-task.ts +132 -0
- package/corpus/templates/crm/actions/navigate.ts +63 -0
- package/corpus/templates/crm/actions/provider-api-catalog.ts +22 -0
- package/corpus/templates/crm/actions/provider-api-docs.ts +54 -0
- package/corpus/templates/crm/actions/provider-api-request.ts +92 -0
- package/corpus/templates/crm/actions/query-staged-dataset.ts +44 -0
- package/corpus/templates/crm/actions/record-crm-call-insight.ts +160 -0
- package/corpus/templates/crm/actions/record-crm-smart-signal.ts +150 -0
- package/corpus/templates/crm/actions/restore-crm-dashboard-revision.ts +23 -0
- package/corpus/templates/crm/actions/review-crm-signal.ts +31 -0
- package/corpus/templates/crm/actions/run-crm-saved-view-program.ts +103 -0
- package/corpus/templates/crm/actions/run-crm-signal-trackers.ts +275 -0
- package/corpus/templates/crm/actions/run.ts +11 -0
- package/corpus/templates/crm/actions/save-crm-dashboard.ts +51 -0
- package/corpus/templates/crm/actions/save-crm-saved-view.ts +119 -0
- package/corpus/templates/crm/actions/sync-crm.ts +146 -0
- package/corpus/templates/crm/actions/update-crm-record.ts +508 -0
- package/corpus/templates/crm/actions/view-screen.ts +218 -0
- package/corpus/templates/crm/agent-native.app-skill.json +58 -0
- package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +158 -0
- package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +83 -0
- package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +225 -0
- package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +413 -0
- package/corpus/templates/crm/app/components/crm/RecordActions.tsx +510 -0
- package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +134 -0
- package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +367 -0
- package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +92 -0
- package/corpus/templates/crm/app/components/crm/Surface.tsx +96 -0
- package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +180 -0
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +106 -0
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +84 -0
- package/corpus/templates/crm/app/entry.client.tsx +16 -0
- package/corpus/templates/crm/app/entry.server.tsx +10 -0
- package/corpus/templates/crm/app/global.css +167 -0
- package/corpus/templates/crm/app/hooks/use-navigation-state.ts +60 -0
- package/corpus/templates/crm/app/i18n/en-US.ts +89 -0
- package/corpus/templates/crm/app/i18n/index.ts +34 -0
- package/corpus/templates/crm/app/lib/dashboard.ts +13 -0
- package/corpus/templates/crm/app/lib/navigation.ts +54 -0
- package/corpus/templates/crm/app/lib/tab-id.ts +1 -0
- package/corpus/templates/crm/app/lib/types.ts +172 -0
- package/corpus/templates/crm/app/lib/utils.ts +1 -0
- package/corpus/templates/crm/app/root.tsx +88 -0
- package/corpus/templates/crm/app/routes/_index.tsx +26 -0
- package/corpus/templates/crm/app/routes/accounts.tsx +41 -0
- package/corpus/templates/crm/app/routes/agent.tsx +5 -0
- package/corpus/templates/crm/app/routes/ask.tsx +53 -0
- package/corpus/templates/crm/app/routes/dashboard.tsx +118 -0
- package/corpus/templates/crm/app/routes/opportunities.tsx +41 -0
- package/corpus/templates/crm/app/routes/people.tsx +41 -0
- package/corpus/templates/crm/app/routes/proposals.tsx +266 -0
- package/corpus/templates/crm/app/routes/records.$recordId.tsx +35 -0
- package/corpus/templates/crm/app/routes/settings.tsx +63 -0
- package/corpus/templates/crm/app/routes/setup.tsx +308 -0
- package/corpus/templates/crm/app/routes/tasks.tsx +252 -0
- package/corpus/templates/crm/app/routes/views.tsx +333 -0
- package/corpus/templates/crm/app/routes.ts +17 -0
- package/corpus/templates/crm/app/vite-env.d.ts +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-agent-native-crm.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-clips-call-evidence-review-recipe.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-find-and-review-evidence-grounded-call-signals-w.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-manage-keyword-and-smart-call-signal-trackers-fr.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-delegated-local-crm-automation.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-native-sql.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboard.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboards-now-install-correctly-from-the-crm-actio.md +6 -0
- package/corpus/templates/crm/changelog/2026-07-21-salesforce-connection.md +6 -0
- package/corpus/templates/crm/components.json +20 -0
- package/corpus/templates/crm/docs/architecture/crm-contract.md +180 -0
- package/corpus/templates/crm/learnings.defaults.md +5 -0
- package/corpus/templates/crm/package.json +59 -0
- package/corpus/templates/crm/public/favicon.svg +1 -0
- package/corpus/templates/crm/public/icon-180.svg +1 -0
- package/corpus/templates/crm/public/manifest.json +11 -0
- package/corpus/templates/crm/react-router.config.ts +7 -0
- package/corpus/templates/crm/server/crm/adapter.ts +32 -0
- package/corpus/templates/crm/server/crm/crm-field-firewall.ts +64 -0
- package/corpus/templates/crm/server/crm/crm-mirror.ts +711 -0
- package/corpus/templates/crm/server/crm/hubspot-adapter.ts +1143 -0
- package/corpus/templates/crm/server/crm/native-adapter.ts +1715 -0
- package/corpus/templates/crm/server/crm/read-through.ts +207 -0
- package/corpus/templates/crm/server/crm/salesforce-adapter.ts +1255 -0
- package/corpus/templates/crm/server/db/crm-store.ts +1170 -0
- package/corpus/templates/crm/server/db/index.ts +169 -0
- package/corpus/templates/crm/server/db/schema.ts +441 -0
- package/corpus/templates/crm/server/lib/intelligence/default-detectors.ts +65 -0
- package/corpus/templates/crm/server/lib/intelligence/evidence.ts +105 -0
- package/corpus/templates/crm/server/lib/intelligence/keyword-detector.ts +100 -0
- package/corpus/templates/crm/server/lib/intelligence/smart-detector.ts +144 -0
- package/corpus/templates/crm/server/lib/intelligence/summary.ts +141 -0
- package/corpus/templates/crm/server/lib/provider-api.ts +64 -0
- package/corpus/templates/crm/server/middleware/auth.ts +4 -0
- package/corpus/templates/crm/server/plugins/agent-chat.ts +68 -0
- package/corpus/templates/crm/server/plugins/auth.ts +14 -0
- package/corpus/templates/crm/server/plugins/core-routes.ts +17 -0
- package/corpus/templates/crm/server/plugins/db.ts +454 -0
- package/corpus/templates/crm/server/routes/[...page].get.ts +5 -0
- package/corpus/templates/crm/shared/crm-automation-recipes.ts +132 -0
- package/corpus/templates/crm/shared/crm-contract.ts +254 -0
- package/corpus/templates/crm/shared/crm-sales-config.ts +63 -0
- package/corpus/templates/crm/ssr-entry.ts +11 -0
- package/corpus/templates/crm/tsconfig.json +24 -0
- package/corpus/templates/crm/vite.config.ts +15 -0
- package/corpus/templates/crm/vitest.config.ts +5 -0
- package/corpus/templates/design/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/dispatch/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/forms/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/forms/_gitignore +39 -0
- package/corpus/templates/forms/learnings.defaults.md +5 -0
- package/corpus/templates/macros/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/macros/_gitignore +39 -0
- package/corpus/templates/macros/learnings.defaults.md +5 -0
- package/corpus/templates/mail/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/mail/_gitignore +39 -0
- package/corpus/templates/plan/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +19 -2
- package/corpus/templates/plan/AGENTS.md +10 -0
- package/corpus/templates/plan/actions/create-prototype-plan.ts +27 -3
- package/corpus/templates/plan/actions/get-plan-blocks.ts +1 -1
- package/corpus/templates/plan/actions/update-visual-plan.ts +3 -2
- package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +18 -4
- package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +10 -3
- package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +3 -1
- package/corpus/templates/plan/app/i18n/en-US.ts +6 -0
- package/corpus/templates/plan/app/lib/create-plan-routing.ts +39 -0
- package/corpus/templates/plan/app/pages/PlansPage.tsx +31 -107
- package/corpus/templates/plan/changelog/2026-07-22-high-fidelity-mockup-requests-now-preserve-branded-css-use-d.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +110 -2
- package/corpus/templates/slides/.agents/skills/agent-native-docs/SKILL.md +115 -0
- package/corpus/templates/slides/_gitignore +39 -0
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/corpus/templates/tasks/_gitignore +39 -0
- package/corpus/toolkit/CHANGELOG.md +12 -0
- package/corpus/toolkit/README.md +30 -0
- package/corpus/toolkit/agent-native.eject.json +33 -0
- package/corpus/toolkit/package.json +15 -1
- package/corpus/toolkit/src/dashboard/DataTable.tsx +273 -0
- package/corpus/toolkit/src/dashboard/DateRangePicker.tsx +57 -0
- package/corpus/toolkit/src/dashboard/GenericChartPanel.tsx +461 -0
- package/corpus/toolkit/src/dashboard/MetricCard.tsx +54 -0
- package/corpus/toolkit/src/dashboard/StatsCard.tsx +49 -0
- package/corpus/toolkit/src/dashboard/dashboard-layout.ts +329 -0
- package/corpus/toolkit/src/dashboard/index.ts +6 -0
- package/corpus/toolkit/src/index.ts +1 -0
- package/corpus/toolkit/src/ui/calendar.tsx +8 -8
- package/corpus/toolkit/src/ui/date-picker.tsx +4 -1
- package/dist/action.d.ts +14 -1
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts +3 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +97 -3
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
- package/dist/cli/skills-content/visual-plan-skill.js +19 -2
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +12 -0
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +4 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +30 -17
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -1
- package/dist/client/agent-page/AgentJobsTab.js +3 -1
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -1
- package/dist/client/agent-page/use-jobs.d.ts +1 -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/blocks/library/wireframe.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe.js +3 -2
- package/dist/client/blocks/library/wireframe.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +5 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +17 -1
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +3 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +17 -7
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/connections/catalog.d.ts +17 -3
- package/dist/connections/catalog.d.ts.map +1 -1
- package/dist/connections/catalog.js +16 -1
- package/dist/connections/catalog.js.map +1 -1
- package/dist/connections/reader.d.ts +18 -0
- package/dist/connections/reader.d.ts.map +1 -1
- package/dist/connections/reader.js +41 -0
- package/dist/connections/reader.js.map +1 -1
- package/dist/dashboard-storage/index.d.ts +4 -0
- package/dist/dashboard-storage/index.d.ts.map +1 -0
- package/dist/dashboard-storage/index.js +4 -0
- package/dist/dashboard-storage/index.js.map +1 -0
- package/dist/dashboard-storage/panel-source.d.ts +68 -0
- package/dist/dashboard-storage/panel-source.d.ts.map +1 -0
- package/dist/dashboard-storage/panel-source.js +76 -0
- package/dist/dashboard-storage/panel-source.js.map +1 -0
- package/dist/dashboard-storage/schema.d.ts +562 -0
- package/dist/dashboard-storage/schema.d.ts.map +1 -0
- package/dist/dashboard-storage/schema.js +32 -0
- package/dist/dashboard-storage/schema.js.map +1 -0
- package/dist/dashboard-storage/store.d.ts +62 -0
- package/dist/dashboard-storage/store.d.ts.map +1 -0
- package/dist/dashboard-storage/store.js +227 -0
- package/dist/dashboard-storage/store.js.map +1 -0
- package/dist/deploy/build.d.ts +7 -0
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +78 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/eject/provider-api-definitions.d.ts +2 -1
- package/dist/eject/provider-api-definitions.d.ts.map +1 -1
- package/dist/eject/provider-api-definitions.js +1 -0
- package/dist/eject/provider-api-definitions.js.map +1 -1
- package/dist/eject/workspace-connections.d.ts.map +1 -1
- package/dist/eject/workspace-connections.js +1 -0
- package/dist/eject/workspace-connections.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +165 -67
- package/dist/extensions/actions.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/actions/list-recurring-jobs.d.ts +1 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -1
- package/dist/jobs/actions/list-recurring-jobs.js +1 -0
- package/dist/jobs/actions/list-recurring-jobs.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +17 -2
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +51 -2
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +32 -2
- package/dist/jobs/tools.js.map +1 -1
- package/dist/localization/default-messages.d.ts +1 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +1 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/index.d.ts +2 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +5 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +8 -6
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
- package/dist/provider-api/actions/provider-api.js +1 -1
- package/dist/provider-api/actions/provider-api.js.map +1 -1
- package/dist/provider-api/index.d.ts +11 -7
- package/dist/provider-api/index.d.ts.map +1 -1
- package/dist/provider-api/index.js +143 -5
- package/dist/provider-api/index.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/register-framework-secrets.d.ts.map +1 -1
- package/dist/secrets/register-framework-secrets.js +7 -0
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/context-tools.js +9 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -1
- package/dist/server/agent-chat/framework-prompts.js +2 -2
- package/dist/server/agent-chat/framework-prompts.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +18 -2
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +1 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/credential-provider.d.ts +4 -3
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +9 -3
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/workspace-provider-oauth.d.ts +6 -1
- package/dist/server/workspace-provider-oauth.d.ts.map +1 -1
- package/dist/server/workspace-provider-oauth.js +141 -4
- package/dist/server/workspace-provider-oauth.js.map +1 -1
- package/dist/styles/agent-native.css +45 -2
- package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/chat/AGENTS.md +1 -1
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/default/.agents/skills/app-branding/SKILL.md +159 -0
- package/dist/templates/default/.agents/skills/app-permissions/SKILL.md +155 -0
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +31 -18
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +15 -0
- package/dist/triggers/actions.d.ts.map +1 -1
- package/dist/triggers/actions.js +10 -2
- package/dist/triggers/actions.js.map +1 -1
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +15 -0
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/triggers/types.d.ts +5 -0
- package/dist/triggers/types.d.ts.map +1 -1
- package/dist/triggers/types.js.map +1 -1
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +4 -1
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +16 -0
- package/docs/content/recurring-jobs.mdx +35 -6
- package/package.json +7 -3
- package/src/action.ts +22 -1
- package/src/agent/production-agent.ts +122 -3
- package/src/cli/skills-content/visual-plan-skill.ts +19 -2
- package/src/cli/templates-meta.ts +12 -0
- package/src/client/AssistantChat.tsx +53 -26
- package/src/client/agent-page/AgentJobsTab.tsx +19 -0
- package/src/client/agent-page/use-jobs.ts +1 -0
- package/src/client/blocks/library/wireframe.tsx +3 -1
- package/src/client/chat/message-components.tsx +35 -1
- package/src/client/chat/tool-call-display.tsx +38 -3
- package/src/connections/catalog.ts +20 -1
- package/src/connections/reader.ts +65 -0
- package/src/dashboard-storage/index.ts +27 -0
- package/src/dashboard-storage/panel-source.ts +168 -0
- package/src/dashboard-storage/schema.ts +62 -0
- package/src/dashboard-storage/store.ts +333 -0
- package/src/deploy/build.ts +95 -16
- package/src/eject/provider-api-definitions.ts +1 -0
- package/src/eject/workspace-connections.ts +1 -0
- package/src/extensions/actions.ts +199 -73
- package/src/jobs/actions/list-recurring-jobs.ts +2 -0
- package/src/jobs/scheduler.ts +71 -4
- package/src/jobs/tools.ts +31 -1
- package/src/localization/default-messages.ts +1 -0
- package/src/mcp-client/index.ts +6 -0
- package/src/provider-api/actions/provider-api.ts +1 -1
- package/src/provider-api/index.ts +190 -5
- package/src/secrets/register-framework-secrets.ts +8 -0
- package/src/server/agent-chat/context-tools.ts +9 -0
- package/src/server/agent-chat/framework-prompts.ts +2 -2
- package/src/server/agent-chat-plugin.ts +22 -2
- package/src/server/core-routes-plugin.ts +1 -0
- package/src/server/credential-provider.ts +9 -3
- package/src/server/workspace-provider-oauth.ts +181 -4
- package/src/styles/agent-native.css +45 -2
- package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/chat/AGENTS.md +1 -1
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/default/.agents/skills/app-branding/SKILL.md +159 -0
- package/src/templates/default/.agents/skills/app-permissions/SKILL.md +155 -0
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +27 -0
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +31 -18
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +15 -0
- package/src/triggers/actions.ts +11 -2
- package/src/triggers/dispatcher.ts +20 -1
- package/src/triggers/types.ts +5 -0
- package/src/vite/action-types-plugin.ts +9 -1
- package/corpus/templates/analytics/server/handlers/sql-query.ts +0 -36
- package/corpus/templates/analytics/server/routes/api/sql-query.post.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentJobsTab.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/AgentJobsTab.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAOpD,wBAAgB,YAAY,CAAC,EAAE,YAAoB,EAAE,EAAE,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"AgentJobsTab.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/AgentJobsTab.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAOpD,wBAAgB,YAAY,CAAC,EAAE,YAAoB,EAAE,EAAE,iBAAiB,+BAuavE"}
|
|
@@ -125,6 +125,8 @@ export function AgentJobsTab({ canManageOrg = false }) {
|
|
|
125
125
|
}, children: _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: detailsTarget?.name.replace(/-/g, " ") ??
|
|
126
126
|
t("jobs.recurringDetails", {
|
|
127
127
|
defaultValue: "Recurring job details",
|
|
128
|
-
}) }), _jsx(DialogDescription, { children: detailsTarget?.scheduleDescription || detailsTarget?.schedule })] }), detailsTarget ? (_jsxs("div", { children: [_jsx("p", { className: "text-xs font-medium text-foreground", children: t("jobs.instructions", { defaultValue: "Instructions" }) }), _jsx("p", { className: "mt-1 whitespace-pre-wrap text-sm text-muted-foreground", children: detailsTarget.instructions })
|
|
128
|
+
}) }), _jsx(DialogDescription, { children: detailsTarget?.scheduleDescription || detailsTarget?.schedule })] }), detailsTarget ? (_jsxs("div", { children: [_jsx("p", { className: "text-xs font-medium text-foreground", children: t("jobs.instructions", { defaultValue: "Instructions" }) }), _jsx("p", { className: "mt-1 whitespace-pre-wrap text-sm text-muted-foreground", children: detailsTarget.instructions }), detailsTarget.mcpTools.length > 0 ? (_jsxs("div", { className: "mt-4", children: [_jsx("p", { className: "text-xs font-medium text-foreground", children: t("jobs.mcpTools", {
|
|
129
|
+
defaultValue: "Connected MCP tools",
|
|
130
|
+
}) }), _jsx("div", { className: "mt-1 flex flex-wrap gap-1.5", children: detailsTarget.mcpTools.map((toolName) => (_jsx("code", { className: "rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground", children: toolName }, toolName))) })] })) : null] })) : null] }) })] }));
|
|
129
131
|
}
|
|
130
132
|
//# sourceMappingURL=AgentJobsTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentJobsTab.js","sourceRoot":"","sources":["../../../src/client/agent-page/AgentJobsTab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,WAAW,EACX,eAAe,EACf,cAAc,EACd,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,yBAAyB,EACzB,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,eAAe,CAAC;AAEvB,MAAM,UAAU,YAAY,CAAC,EAAE,YAAY,GAAG,KAAK,EAAqB;IACtE,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;I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,SAAS,EAAE,QAAQ;4CACnB,IAAI,EAAE,YAAY,CAAC,IAAI;4CACvB,KAAK,EAAE,YAAY,CAAC,KAAK;yCAC1B,EACD,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAC3C,CAAC;oCACJ,CAAC,aAEA,eAAe,CAAC,CAAC,CAAC,CACjB,KAAC,WAAW,IAAC,SAAS,EAAC,qBAAqB,GAAG,CAChD,CAAC,CAAC,CAAC,IAAI,EACP,CAAC,CAAC,aAAa,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,IACtC,IACI,IACD,GACT,EAET,KAAC,MAAM,IACL,IAAI,EAAE,aAAa,KAAK,IAAI,EAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;oBACrB,IAAI,CAAC,IAAI;wBAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBACpC,CAAC,YAED,MAAC,aAAa,IAAC,SAAS,EAAC,WAAW,aAClC,MAAC,YAAY,eACX,KAAC,WAAW,cACT,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;wCACrC,CAAC,CAAC,uBAAuB,EAAE;4CACzB,YAAY,EAAE,uBAAuB;yCACtC,CAAC,GACQ,EACd,KAAC,iBAAiB,cACf,aAAa,EAAE,mBAAmB,IAAI,aAAa,EAAE,QAAQ,GAC5C,IACP,EACd,aAAa,CAAC,CAAC,CAAC,CACf,0BACE,YAAG,SAAS,EAAC,qCAAqC,YAC/C,CAAC,CAAC,mBAAmB,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC,GACvD,EACJ,YAAG,SAAS,EAAC,wDAAwD,YAClE,aAAa,CAAC,YAAY,GACzB,IACA,CACP,CAAC,CAAC,CAAC,IAAI,IACM,GACT,IACK,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { Button } from \"@agent-native/toolkit/ui/button\";\nimport {\n IconBolt,\n IconCalendarEvent,\n IconClock,\n IconEye,\n IconLoader2,\n IconPlayerPause,\n IconPlayerPlay,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\n\nimport { AgentAskPopover } from \"../AgentAskPopover.js\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../components/ui/dialog.js\";\nimport { useFormatters, useT } from \"../i18n.js\";\nimport {\n automationCreationContext,\n AutomationsList,\n} from \"../settings/AutomationsSection.js\";\nimport { AgentEmptyState } from \"./AgentEmptyState.js\";\nimport { AgentTabFrame } from \"./AgentTabFrame.js\";\nimport type { AgentPageTabProps } from \"./types.js\";\nimport {\n useManageRecurringJob,\n useRecurringJobs,\n type RecurringJob,\n} from \"./use-jobs.js\";\n\nexport function AgentJobsTab({ canManageOrg = false }: AgentPageTabProps) {\n const t = useT();\n const { formatDate } = useFormatters();\n const personalQuery = useRecurringJobs(\"user\");\n const organizationQuery = useRecurringJobs(\"org\");\n const personalMutation = useManageRecurringJob(\"user\");\n const organizationMutation = useManageRecurringJob(\"org\");\n const [deleteTarget, setDeleteTarget] = useState<RecurringJob | null>(null);\n const [detailsTarget, setDetailsTarget] = useState<RecurringJob | null>(null);\n\n const formatDateTime = (value: string | null) => {\n if (!value || Number.isNaN(new Date(value).getTime())) return null;\n return formatDate(value, {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n };\n\n const renderRecurringSection = (\n title: string,\n scope: \"user\" | \"org\",\n query: ReturnType<typeof useRecurringJobs>,\n mutation: ReturnType<typeof useManageRecurringJob>,\n ) => {\n const jobs = query.data ?? [];\n return (\n <section className=\"space-y-4\">\n <div className=\"flex flex-wrap items-end justify-between gap-3\">\n <div className=\"min-w-0\">\n <h2 className=\"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground/70\">\n {title}\n </h2>\n <p className=\"mt-2 max-w-2xl text-sm text-muted-foreground\">\n {scope === \"org\"\n ? t(\"jobs.organizationRecurringDescription\", {\n defaultValue:\n \"Jobs shared with this organization. Members can view them; creators and admins can manage them.\",\n })\n : t(\"jobs.recurringDescription\", {\n defaultValue:\n \"Scheduled prompts that ask the agent to do work automatically.\",\n })}\n </p>\n </div>\n {scope === \"org\" && !canManageOrg ? (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"jobs.organizationMemberNote\", {\n defaultValue: \"You can manage jobs you created.\",\n })}\n </span>\n ) : null}\n </div>\n\n {query.isLoading ? (\n <div\n className=\"flex items-center gap-2 text-sm text-muted-foreground\"\n aria-busy=\"true\"\n >\n <IconLoader2 className=\"size-4 animate-spin\" />\n {t(\"jobs.loading\", { defaultValue: \"Loading…\" })}\n </div>\n ) : query.error ? (\n <p className=\"text-sm text-destructive\">\n {t(\"jobs.recurringLoadError\", {\n defaultValue: \"Could not load recurring jobs.\",\n })}\n </p>\n ) : jobs.length === 0 ? (\n <AgentEmptyState\n icon={IconCalendarEvent}\n title={\n scope === \"org\"\n ? t(\"jobs.organizationEmptyTitle\", {\n defaultValue: \"No organization jobs yet\",\n })\n : t(\"jobs.recurringEmptyTitle\", {\n defaultValue: \"No recurring jobs yet\",\n })\n }\n description={\n scope === \"org\"\n ? t(\"jobs.organizationEmptyDescription\", {\n defaultValue:\n \"Describe a shared job for this organization.\",\n })\n : t(\"jobs.recurringEmptyDescription\", {\n defaultValue: \"Describe what should run and when.\",\n })\n }\n action={\n <AgentAskPopover\n context={\n scope === \"org\"\n ? \"The user wants to create an organization recurring job. Create it in the organization jobs resource with the schedule and instructions from their prompt.\"\n : \"The user wants to create a personal recurring job. Create it in the personal jobs resource with the schedule and instructions from their prompt.\"\n }\n prompt={\n scope === \"org\"\n ? t(\"jobs.organizationPrompt\", {\n defaultValue:\n \"Create a shared organization job that runs on a schedule and does this: \",\n })\n : t(\"jobs.recurringPrompt\", {\n defaultValue:\n \"Create a recurring job that runs on a schedule and does this: every morning, summarize my inbox.\",\n })\n }\n title={\n scope === \"org\"\n ? t(\"jobs.organizationCreateTitle\", {\n defaultValue: \"Create an organization job\",\n })\n : t(\"jobs.recurringCreateTitle\", {\n defaultValue: \"Create a recurring job\",\n })\n }\n />\n }\n />\n ) : (\n <div className=\"divide-y divide-border/60 border-y border-border/60\">\n {jobs.map((job) => {\n const lastRun = formatDateTime(job.lastRun);\n const nextRun = formatDateTime(job.nextRun);\n return (\n <article key={job.id} className=\"py-4 first:pt-5 last:pb-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"mt-0.5 text-muted-foreground\">\n <IconClock className=\"size-4\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"truncate text-sm font-medium\">\n {job.name.replace(/-/g, \" \")}\n </h3>\n <span\n className={\n job.enabled\n ? \"rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-medium text-emerald-600 dark:text-emerald-400\"\n : \"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\"\n }\n >\n {job.enabled\n ? t(\"jobs.enabled\", { defaultValue: \"Enabled\" })\n : t(\"jobs.paused\", { defaultValue: \"Paused\" })}\n </span>\n {job.lastStatus ? (\n <span className=\"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\">\n {job.lastStatus}\n </span>\n ) : null}\n </div>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {job.scheduleDescription || job.schedule}\n </p>\n <p className=\"mt-1 line-clamp-2 text-xs text-muted-foreground/80\">\n {job.instructions}\n </p>\n {lastRun || nextRun ? (\n <div className=\"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground\">\n {nextRun ? (\n <span>\n {t(\"jobs.nextRun\", { defaultValue: \"Next run\" })}:{\" \"}\n {nextRun}\n </span>\n ) : null}\n {lastRun ? (\n <span>\n {t(\"jobs.lastRun\", { defaultValue: \"Last run\" })}:{\" \"}\n {lastRun}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-pointer px-2 text-xs\"\n onClick={() => setDetailsTarget(job)}\n >\n <IconEye className=\"size-3.5\" />\n {t(\"jobs.details\", { defaultValue: \"Details\" })}\n </Button>\n {job.canUpdate ? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-pointer px-2 text-xs\"\n disabled={mutation.isPending}\n onClick={() =>\n mutation.mutate({\n operation: \"update\",\n name: job.name,\n scope: job.scope,\n enabled: !job.enabled,\n })\n }\n >\n {job.enabled ? (\n <IconPlayerPause className=\"size-3.5\" />\n ) : (\n <IconPlayerPlay className=\"size-3.5\" />\n )}\n {job.enabled\n ? t(\"jobs.pause\", { defaultValue: \"Pause\" })\n : t(\"jobs.resume\", { defaultValue: \"Resume\" })}\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 cursor-pointer text-muted-foreground hover:text-destructive\"\n aria-label={t(\"jobs.delete\", {\n defaultValue: \"Delete\",\n })}\n onClick={() => setDeleteTarget(job)}\n >\n <IconTrash className=\"size-3.5\" />\n </Button>\n </>\n ) : null}\n </div>\n </div>\n </article>\n );\n })}\n </div>\n )}\n {mutation.error ? (\n <p className=\"text-sm text-destructive\">\n {mutation.error.message ||\n t(\"jobs.recurringUpdateError\", {\n defaultValue: \"Could not update recurring job.\",\n })}\n </p>\n ) : null}\n </section>\n );\n };\n\n const mutationPending =\n personalMutation.isPending || organizationMutation.isPending;\n const deleteMutation =\n deleteTarget?.scope === \"organization\"\n ? organizationMutation\n : personalMutation;\n\n return (\n <AgentTabFrame\n title={t(\"jobs.pageTitle\", { defaultValue: \"Jobs\" })}\n description={t(\"jobs.pageDescription\", {\n defaultValue:\n \"See recurring jobs and automations that run work for you.\",\n })}\n >\n <div className=\"space-y-7\">\n {renderRecurringSection(\n \"Personal\",\n \"user\",\n personalQuery,\n personalMutation,\n )}\n {renderRecurringSection(\n \"Organization\",\n \"org\",\n organizationQuery,\n organizationMutation,\n )}\n\n <section className=\"space-y-4 border-t border-border/70 pt-6\">\n <div>\n <h2 className=\"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground/70\">\n {t(\"jobs.automationsTitle\", { defaultValue: \"Automations\" })}\n </h2>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {t(\"jobs.automationsDescription\", {\n defaultValue:\n \"Event-triggered and scheduled agent tasks managed from one place.\",\n })}\n </p>\n </div>\n <AutomationsList\n scope=\"user\"\n emptyState={\n <AgentEmptyState\n icon={IconBolt}\n title={t(\"jobs.automationsEmptyTitle\", {\n defaultValue: \"No automations yet\",\n })}\n description={t(\"jobs.automationsEmptyDescription\", {\n defaultValue: \"Describe what should happen and when.\",\n })}\n action={\n <AgentAskPopover\n context={automationCreationContext()}\n prompt={t(\"jobs.automationPrompt\", {\n defaultValue: \"Create an automation that does this: \",\n })}\n title={t(\"jobs.automationsCreateTitle\", {\n defaultValue: \"Create an automation\",\n })}\n />\n }\n />\n }\n />\n </section>\n </div>\n\n <Dialog\n open={deleteTarget !== null}\n onOpenChange={(open) => {\n if (!open && !mutationPending) setDeleteTarget(null);\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>\n {t(\"jobs.deleteRecurringTitle\", {\n defaultValue: \"Delete recurring job?\",\n })}\n </DialogTitle>\n <DialogDescription>\n {t(\"jobs.deleteRecurringDescription\", {\n defaultValue:\n \"This permanently removes the job and cannot be undone.\",\n })}\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"cursor-pointer\"\n disabled={mutationPending}\n onClick={() => setDeleteTarget(null)}\n >\n {t(\"jobs.cancel\", { defaultValue: \"Cancel\" })}\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n className=\"cursor-pointer\"\n disabled={mutationPending}\n onClick={() => {\n if (!deleteTarget) return;\n deleteMutation.mutate(\n {\n operation: \"delete\",\n name: deleteTarget.name,\n scope: deleteTarget.scope,\n },\n { onSuccess: () => setDeleteTarget(null) },\n );\n }}\n >\n {mutationPending ? (\n <IconLoader2 className=\"size-4 animate-spin\" />\n ) : null}\n {t(\"jobs.delete\", { defaultValue: \"Delete\" })}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n <Dialog\n open={detailsTarget !== null}\n onOpenChange={(open) => {\n if (!open) setDetailsTarget(null);\n }}\n >\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>\n {detailsTarget?.name.replace(/-/g, \" \") ??\n t(\"jobs.recurringDetails\", {\n defaultValue: \"Recurring job details\",\n })}\n </DialogTitle>\n <DialogDescription>\n {detailsTarget?.scheduleDescription || detailsTarget?.schedule}\n </DialogDescription>\n </DialogHeader>\n {detailsTarget ? (\n <div>\n <p className=\"text-xs font-medium text-foreground\">\n {t(\"jobs.instructions\", { defaultValue: \"Instructions\" })}\n </p>\n <p className=\"mt-1 whitespace-pre-wrap text-sm text-muted-foreground\">\n {detailsTarget.instructions}\n </p>\n </div>\n ) : null}\n </DialogContent>\n </Dialog>\n </AgentTabFrame>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AgentJobsTab.js","sourceRoot":"","sources":["../../../src/client/agent-page/AgentJobsTab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EACL,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,WAAW,EACX,eAAe,EACf,cAAc,EACd,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,IA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5C,IACP,EACd,aAAa,CAAC,CAAC,CAAC,CACf,0BACE,YAAG,SAAS,EAAC,qCAAqC,YAC/C,CAAC,CAAC,mBAAmB,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC,GACvD,EACJ,YAAG,SAAS,EAAC,wDAAwD,YAClE,aAAa,CAAC,YAAY,GACzB,EACH,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACnC,eAAK,SAAS,EAAC,MAAM,aACnB,YAAG,SAAS,EAAC,qCAAqC,YAC/C,CAAC,CAAC,eAAe,EAAE;gDAClB,YAAY,EAAE,qBAAqB;6CACpC,CAAC,GACA,EACJ,cAAK,SAAS,EAAC,6BAA6B,YACzC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CACxC,eAEE,SAAS,EAAC,kEAAkE,YAE3E,QAAQ,IAHJ,QAAQ,CAIR,CACR,CAAC,GACE,IACF,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACM,GACT,IACK,CACjB,CAAC;AACJ,CAAC","sourcesContent":["import { Button } from \"@agent-native/toolkit/ui/button\";\nimport {\n IconBolt,\n IconCalendarEvent,\n IconClock,\n IconEye,\n IconLoader2,\n IconPlayerPause,\n IconPlayerPlay,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\n\nimport { AgentAskPopover } from \"../AgentAskPopover.js\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../components/ui/dialog.js\";\nimport { useFormatters, useT } from \"../i18n.js\";\nimport {\n automationCreationContext,\n AutomationsList,\n} from \"../settings/AutomationsSection.js\";\nimport { AgentEmptyState } from \"./AgentEmptyState.js\";\nimport { AgentTabFrame } from \"./AgentTabFrame.js\";\nimport type { AgentPageTabProps } from \"./types.js\";\nimport {\n useManageRecurringJob,\n useRecurringJobs,\n type RecurringJob,\n} from \"./use-jobs.js\";\n\nexport function AgentJobsTab({ canManageOrg = false }: AgentPageTabProps) {\n const t = useT();\n const { formatDate } = useFormatters();\n const personalQuery = useRecurringJobs(\"user\");\n const organizationQuery = useRecurringJobs(\"org\");\n const personalMutation = useManageRecurringJob(\"user\");\n const organizationMutation = useManageRecurringJob(\"org\");\n const [deleteTarget, setDeleteTarget] = useState<RecurringJob | null>(null);\n const [detailsTarget, setDetailsTarget] = useState<RecurringJob | null>(null);\n\n const formatDateTime = (value: string | null) => {\n if (!value || Number.isNaN(new Date(value).getTime())) return null;\n return formatDate(value, {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n };\n\n const renderRecurringSection = (\n title: string,\n scope: \"user\" | \"org\",\n query: ReturnType<typeof useRecurringJobs>,\n mutation: ReturnType<typeof useManageRecurringJob>,\n ) => {\n const jobs = query.data ?? [];\n return (\n <section className=\"space-y-4\">\n <div className=\"flex flex-wrap items-end justify-between gap-3\">\n <div className=\"min-w-0\">\n <h2 className=\"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground/70\">\n {title}\n </h2>\n <p className=\"mt-2 max-w-2xl text-sm text-muted-foreground\">\n {scope === \"org\"\n ? t(\"jobs.organizationRecurringDescription\", {\n defaultValue:\n \"Jobs shared with this organization. Members can view them; creators and admins can manage them.\",\n })\n : t(\"jobs.recurringDescription\", {\n defaultValue:\n \"Scheduled prompts that ask the agent to do work automatically.\",\n })}\n </p>\n </div>\n {scope === \"org\" && !canManageOrg ? (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"jobs.organizationMemberNote\", {\n defaultValue: \"You can manage jobs you created.\",\n })}\n </span>\n ) : null}\n </div>\n\n {query.isLoading ? (\n <div\n className=\"flex items-center gap-2 text-sm text-muted-foreground\"\n aria-busy=\"true\"\n >\n <IconLoader2 className=\"size-4 animate-spin\" />\n {t(\"jobs.loading\", { defaultValue: \"Loading…\" })}\n </div>\n ) : query.error ? (\n <p className=\"text-sm text-destructive\">\n {t(\"jobs.recurringLoadError\", {\n defaultValue: \"Could not load recurring jobs.\",\n })}\n </p>\n ) : jobs.length === 0 ? (\n <AgentEmptyState\n icon={IconCalendarEvent}\n title={\n scope === \"org\"\n ? t(\"jobs.organizationEmptyTitle\", {\n defaultValue: \"No organization jobs yet\",\n })\n : t(\"jobs.recurringEmptyTitle\", {\n defaultValue: \"No recurring jobs yet\",\n })\n }\n description={\n scope === \"org\"\n ? t(\"jobs.organizationEmptyDescription\", {\n defaultValue:\n \"Describe a shared job for this organization.\",\n })\n : t(\"jobs.recurringEmptyDescription\", {\n defaultValue: \"Describe what should run and when.\",\n })\n }\n action={\n <AgentAskPopover\n context={\n scope === \"org\"\n ? \"The user wants to create an organization recurring job. Create it in the organization jobs resource with the schedule and instructions from their prompt.\"\n : \"The user wants to create a personal recurring job. Create it in the personal jobs resource with the schedule and instructions from their prompt.\"\n }\n prompt={\n scope === \"org\"\n ? t(\"jobs.organizationPrompt\", {\n defaultValue:\n \"Create a shared organization job that runs on a schedule and does this: \",\n })\n : t(\"jobs.recurringPrompt\", {\n defaultValue:\n \"Create a recurring job that runs on a schedule and does this: every morning, summarize my inbox.\",\n })\n }\n title={\n scope === \"org\"\n ? t(\"jobs.organizationCreateTitle\", {\n defaultValue: \"Create an organization job\",\n })\n : t(\"jobs.recurringCreateTitle\", {\n defaultValue: \"Create a recurring job\",\n })\n }\n />\n }\n />\n ) : (\n <div className=\"divide-y divide-border/60 border-y border-border/60\">\n {jobs.map((job) => {\n const lastRun = formatDateTime(job.lastRun);\n const nextRun = formatDateTime(job.nextRun);\n return (\n <article key={job.id} className=\"py-4 first:pt-5 last:pb-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"mt-0.5 text-muted-foreground\">\n <IconClock className=\"size-4\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"truncate text-sm font-medium\">\n {job.name.replace(/-/g, \" \")}\n </h3>\n <span\n className={\n job.enabled\n ? \"rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-medium text-emerald-600 dark:text-emerald-400\"\n : \"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\"\n }\n >\n {job.enabled\n ? t(\"jobs.enabled\", { defaultValue: \"Enabled\" })\n : t(\"jobs.paused\", { defaultValue: \"Paused\" })}\n </span>\n {job.lastStatus ? (\n <span className=\"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\">\n {job.lastStatus}\n </span>\n ) : null}\n </div>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {job.scheduleDescription || job.schedule}\n </p>\n <p className=\"mt-1 line-clamp-2 text-xs text-muted-foreground/80\">\n {job.instructions}\n </p>\n {lastRun || nextRun ? (\n <div className=\"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground\">\n {nextRun ? (\n <span>\n {t(\"jobs.nextRun\", { defaultValue: \"Next run\" })}:{\" \"}\n {nextRun}\n </span>\n ) : null}\n {lastRun ? (\n <span>\n {t(\"jobs.lastRun\", { defaultValue: \"Last run\" })}:{\" \"}\n {lastRun}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-pointer px-2 text-xs\"\n onClick={() => setDetailsTarget(job)}\n >\n <IconEye className=\"size-3.5\" />\n {t(\"jobs.details\", { defaultValue: \"Details\" })}\n </Button>\n {job.canUpdate ? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-pointer px-2 text-xs\"\n disabled={mutation.isPending}\n onClick={() =>\n mutation.mutate({\n operation: \"update\",\n name: job.name,\n scope: job.scope,\n enabled: !job.enabled,\n })\n }\n >\n {job.enabled ? (\n <IconPlayerPause className=\"size-3.5\" />\n ) : (\n <IconPlayerPlay className=\"size-3.5\" />\n )}\n {job.enabled\n ? t(\"jobs.pause\", { defaultValue: \"Pause\" })\n : t(\"jobs.resume\", { defaultValue: \"Resume\" })}\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 cursor-pointer text-muted-foreground hover:text-destructive\"\n aria-label={t(\"jobs.delete\", {\n defaultValue: \"Delete\",\n })}\n onClick={() => setDeleteTarget(job)}\n >\n <IconTrash className=\"size-3.5\" />\n </Button>\n </>\n ) : null}\n </div>\n </div>\n </article>\n );\n })}\n </div>\n )}\n {mutation.error ? (\n <p className=\"text-sm text-destructive\">\n {mutation.error.message ||\n t(\"jobs.recurringUpdateError\", {\n defaultValue: \"Could not update recurring job.\",\n })}\n </p>\n ) : null}\n </section>\n );\n };\n\n const mutationPending =\n personalMutation.isPending || organizationMutation.isPending;\n const deleteMutation =\n deleteTarget?.scope === \"organization\"\n ? organizationMutation\n : personalMutation;\n\n return (\n <AgentTabFrame\n title={t(\"jobs.pageTitle\", { defaultValue: \"Jobs\" })}\n description={t(\"jobs.pageDescription\", {\n defaultValue:\n \"See recurring jobs and automations that run work for you.\",\n })}\n >\n <div className=\"space-y-7\">\n {renderRecurringSection(\n \"Personal\",\n \"user\",\n personalQuery,\n personalMutation,\n )}\n {renderRecurringSection(\n \"Organization\",\n \"org\",\n organizationQuery,\n organizationMutation,\n )}\n\n <section className=\"space-y-4 border-t border-border/70 pt-6\">\n <div>\n <h2 className=\"text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground/70\">\n {t(\"jobs.automationsTitle\", { defaultValue: \"Automations\" })}\n </h2>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {t(\"jobs.automationsDescription\", {\n defaultValue:\n \"Event-triggered and scheduled agent tasks managed from one place.\",\n })}\n </p>\n </div>\n <AutomationsList\n scope=\"user\"\n emptyState={\n <AgentEmptyState\n icon={IconBolt}\n title={t(\"jobs.automationsEmptyTitle\", {\n defaultValue: \"No automations yet\",\n })}\n description={t(\"jobs.automationsEmptyDescription\", {\n defaultValue: \"Describe what should happen and when.\",\n })}\n action={\n <AgentAskPopover\n context={automationCreationContext()}\n prompt={t(\"jobs.automationPrompt\", {\n defaultValue: \"Create an automation that does this: \",\n })}\n title={t(\"jobs.automationsCreateTitle\", {\n defaultValue: \"Create an automation\",\n })}\n />\n }\n />\n }\n />\n </section>\n </div>\n\n <Dialog\n open={deleteTarget !== null}\n onOpenChange={(open) => {\n if (!open && !mutationPending) setDeleteTarget(null);\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>\n {t(\"jobs.deleteRecurringTitle\", {\n defaultValue: \"Delete recurring job?\",\n })}\n </DialogTitle>\n <DialogDescription>\n {t(\"jobs.deleteRecurringDescription\", {\n defaultValue:\n \"This permanently removes the job and cannot be undone.\",\n })}\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"cursor-pointer\"\n disabled={mutationPending}\n onClick={() => setDeleteTarget(null)}\n >\n {t(\"jobs.cancel\", { defaultValue: \"Cancel\" })}\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n className=\"cursor-pointer\"\n disabled={mutationPending}\n onClick={() => {\n if (!deleteTarget) return;\n deleteMutation.mutate(\n {\n operation: \"delete\",\n name: deleteTarget.name,\n scope: deleteTarget.scope,\n },\n { onSuccess: () => setDeleteTarget(null) },\n );\n }}\n >\n {mutationPending ? (\n <IconLoader2 className=\"size-4 animate-spin\" />\n ) : null}\n {t(\"jobs.delete\", { defaultValue: \"Delete\" })}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n <Dialog\n open={detailsTarget !== null}\n onOpenChange={(open) => {\n if (!open) setDetailsTarget(null);\n }}\n >\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>\n {detailsTarget?.name.replace(/-/g, \" \") ??\n t(\"jobs.recurringDetails\", {\n defaultValue: \"Recurring job details\",\n })}\n </DialogTitle>\n <DialogDescription>\n {detailsTarget?.scheduleDescription || detailsTarget?.schedule}\n </DialogDescription>\n </DialogHeader>\n {detailsTarget ? (\n <div>\n <p className=\"text-xs font-medium text-foreground\">\n {t(\"jobs.instructions\", { defaultValue: \"Instructions\" })}\n </p>\n <p className=\"mt-1 whitespace-pre-wrap text-sm text-muted-foreground\">\n {detailsTarget.instructions}\n </p>\n {detailsTarget.mcpTools.length > 0 ? (\n <div className=\"mt-4\">\n <p className=\"text-xs font-medium text-foreground\">\n {t(\"jobs.mcpTools\", {\n defaultValue: \"Connected MCP tools\",\n })}\n </p>\n <div className=\"mt-1 flex flex-wrap gap-1.5\">\n {detailsTarget.mcpTools.map((toolName) => (\n <code\n key={toolName}\n className=\"rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground\"\n >\n {toolName}\n </code>\n ))}\n </div>\n </div>\n ) : null}\n </div>\n ) : null}\n </DialogContent>\n </Dialog>\n </AgentTabFrame>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-jobs.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/use-jobs.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAA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iB,CAGtB,mBAAmB,EAAE;QACrB,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE;YAC5B,MAAM,WAAW,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAe,QAAQ,CAAC,CAAC;YAClE,WAAW,CAAC,YAAY,CAAe,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;gBAC3D,IAAI,CAAC,OAAO;oBAAE,OAAO,OAAO,CAAC;gBAC7B,IAAI,SAAS,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;oBACrC,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CACnD,CAAC;gBACJ,CAAC;gBACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAChC,UAAU,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,OAAO,KAAK,SAAS;oBACnE,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE;oBAC/C,CAAC,CAAC,UAAU,CACf,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;YACvC,MAAM,QAAQ,GAAG,OAAkD,CAAC;YACpE,IAAI,QAAQ,IAAI,UAAU,IAAI,QAAQ,EAAE,CAAC;gBACvC,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { useQueryClient } from \"@tanstack/react-query\";\n\nimport { useActionMutation, useActionQuery } from \"../use-action.js\";\n\nexport type JobsScope = \"user\" | \"org\";\n\nexport interface RecurringJob {\n id: string;\n name: string;\n path: string;\n scope: \"personal\" | \"organization\";\n schedule: string;\n scheduleDescription: string;\n instructions: string;\n enabled: boolean;\n lastRun: string | null;\n lastStatus: string | null;\n lastError: string | null;\n nextRun: string | null;\n createdBy: string | null;\n mcpTools: string[];\n canUpdate: boolean;\n}\n\nexport interface Automation {\n id: string;\n name: string;\n path: string;\n scope: \"personal\" | \"organization\";\n triggerType: \"event\" | \"schedule\";\n event: string | null;\n schedule: string | null;\n scheduleDescription: string | null;\n condition: string | null;\n body: string;\n enabled: boolean;\n lastRun: string | null;\n lastStatus: string | null;\n lastError: string | null;\n nextRun: string | null;\n createdBy: string | null;\n canUpdate: boolean;\n}\n\nexport type ManageJobInput = {\n operation: \"update\" | \"delete\";\n name: string;\n scope: \"personal\" | \"organization\";\n enabled?: boolean;\n};\n\nexport type ManageAutomationInput = {\n operation: \"update\" | \"delete\";\n name: string;\n scope: \"personal\" | \"organization\";\n enabled?: boolean;\n};\n\nfunction recurringParams(scope: JobsScope) {\n return { scope: scope === \"org\" ? \"organization\" : \"personal\" } as const;\n}\n\nfunction automationParams(scope: JobsScope) {\n return { scope: scope === \"org\" ? \"organization\" : \"personal\" } as const;\n}\n\nexport function useRecurringJobs(scope: JobsScope) {\n return useActionQuery<RecurringJob[]>(\n \"list-recurring-jobs\",\n recurringParams(scope),\n { staleTime: 5_000 },\n );\n}\n\nexport function useAutomations(scope: JobsScope) {\n return useActionQuery<Automation[]>(\n \"list-automations\",\n automationParams(scope),\n { staleTime: 5_000 },\n );\n}\n\nexport function useManageRecurringJob(scope: JobsScope) {\n const queryClient = useQueryClient();\n const params = recurringParams(scope);\n const queryKey = [\"action\", \"list-recurring-jobs\", params] as const;\n\n return useActionMutation<\n { deleted?: boolean; name: string; enabled?: boolean },\n ManageJobInput\n >(\"manage-recurring-job\", {\n onMutate: async (variables) => {\n await queryClient.cancelQueries({ queryKey });\n const previous = queryClient.getQueryData<RecurringJob[]>(queryKey);\n queryClient.setQueryData<RecurringJob[]>(queryKey, (current) => {\n if (!current) return current;\n if (variables.operation === \"delete\") {\n return current.filter((job) => job.name !== variables.name);\n }\n return current.map((job) =>\n job.name === variables.name && variables.enabled !== undefined\n ? { ...job, enabled: variables.enabled }\n : job,\n );\n });\n return { previous };\n },\n onError: (_error, _variables, context) => {\n const rollback = context as { previous?: RecurringJob[] } | undefined;\n if (rollback && \"previous\" in rollback) {\n queryClient.setQueryData(queryKey, rollback.previous);\n }\n },\n });\n}\n\nexport function useManageAutomation(scope: JobsScope) {\n const queryClient = useQueryClient();\n const params = automationParams(scope);\n const queryKey = [\"action\", \"list-automations\", params] as const;\n\n return useActionMutation<\n { deleted?: boolean; name: string; enabled?: boolean },\n ManageAutomationInput\n >(\"manage-automation\", {\n onMutate: async (variables) => {\n await queryClient.cancelQueries({ queryKey });\n const previous = queryClient.getQueryData<Automation[]>(queryKey);\n queryClient.setQueryData<Automation[]>(queryKey, (current) => {\n if (!current) return current;\n if (variables.operation === \"delete\") {\n return current.filter(\n (automation) => automation.name !== variables.name,\n );\n }\n return current.map((automation) =>\n automation.name === variables.name && variables.enabled !== undefined\n ? { ...automation, enabled: variables.enabled }\n : automation,\n );\n });\n return { previous };\n },\n onError: (_error, _variables, context) => {\n const rollback = context as { previous?: Automation[] } | undefined;\n if (rollback && \"previous\" in rollback) {\n queryClient.setQueryData(queryKey, rollback.previous);\n }\n },\n });\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireframe.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEf,MAAM,aAAa,CAAC;AAkBrB,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"wireframe.d.ts","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EAEf,MAAM,aAAa,CAAC;AAkBrB,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,uBAAuB,CAAC;AAic/B,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,GAAG,EACH,cAAc,GACf,EAAE,cAAc,CAAC,aAAa,CAAC,+BAY/B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,cAAc,CAAC,aAAa,CAAC,+BAE3E;AAED,oFAAoF;AACpF,eAAO,MAAM,cAAc,gDAczB,CAAC"}
|
|
@@ -31,7 +31,7 @@ function ArtboardFrame({ surface, compact, canvasSize, canvasWidth, skeleton, re
|
|
|
31
31
|
const fitRef = useRef(null);
|
|
32
32
|
const isDark = useIsDark();
|
|
33
33
|
const theme = isDark ? "dark" : "light";
|
|
34
|
-
const
|
|
34
|
+
const preferredStyle = useWireframeStyle();
|
|
35
35
|
const preset = SURFACE_PRESETS[surface] ?? SURFACE_PRESETS.desktop;
|
|
36
36
|
const width = canvasWidth ?? preset.width;
|
|
37
37
|
// AUTO-HEIGHT: with no explicit `canvasSize` the artboard height is driven by
|
|
@@ -51,6 +51,7 @@ function ArtboardFrame({ surface, compact, canvasSize, canvasWidth, skeleton, re
|
|
|
51
51
|
// with auto-height we measure it.
|
|
52
52
|
const [measuredHeight, setMeasuredHeight] = useState(fixedHeight ?? null);
|
|
53
53
|
const designMode = renderMode === "design";
|
|
54
|
+
const style = designMode ? "clean" : preferredStyle;
|
|
54
55
|
const sketchy = !designMode && style === "sketchy" && !skeleton;
|
|
55
56
|
const roughEnabled = sketchy && roughOverlay;
|
|
56
57
|
const frameBorder = skeleton
|
|
@@ -164,7 +165,7 @@ function HtmlArtboard({ data, ctx: _ctx, showFrame, compact, }) {
|
|
|
164
165
|
/* Kit artboard — declarative kit tree. */
|
|
165
166
|
/* -------------------------------------------------------------------------- */
|
|
166
167
|
function KitArtboard({ data, showFrame, compact, }) {
|
|
167
|
-
return (_jsx(ArtboardFrame, { surface: data.surface, compact: compact, skeleton: data.skeleton, showFrame: showFrame, selector: "[data-rough]", caption: data.caption, render: ({ theme, style }) => (_jsx(KitConfigContext.Provider, { value: {
|
|
168
|
+
return (_jsx(ArtboardFrame, { surface: data.surface, compact: compact, skeleton: data.skeleton, renderMode: data.renderMode, showFrame: showFrame, selector: "[data-rough]", caption: data.caption, render: ({ theme, style }) => (_jsx(KitConfigContext.Provider, { value: {
|
|
168
169
|
skeleton: data.skeleton,
|
|
169
170
|
flushFrame: !showFrame,
|
|
170
171
|
theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wireframe.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,YAAY,GAGb,MAAM,uBAAuB,CAAC;AA+C/B,MAAM,eAAe,GAA4C;IAC/D,6EAA6E;IAC7E,MAAM,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useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport { ltrCodeBlockProps } from \"../code-block-direction.js\";\nimport { defineBlock } from \"../types.js\";\nimport type {\n BlockReadProps,\n BlockEditProps,\n BlockRenderContext,\n} from \"../types.js\";\nimport { useBlockCopy } from \"./block-copy.js\";\nimport {\n sanitizeWireframeCss,\n sanitizeWireframeHtml,\n scopeDesignCss,\n} from \"./sanitize-html.js\";\nimport { renderWireframeIconHtml } from \"./wireframe-icons.js\";\nimport {\n HTML_ROUGH_SELECTOR,\n KitConfigContext,\n RoughOverlay,\n Screen,\n renderNodes,\n toggleWireframeStyle,\n useIsDark,\n useWireframeStyle,\n} from \"./wireframe-kit.js\";\nimport {\n wireframeSchema,\n wireframeMdx,\n type WireframeData,\n type WireframeSurface,\n} from \"./wireframe.config.js\";\n\n/**\n * Shared `wireframe` block — a hand-drawn low-fi mockup of one screen, rendered\n * from either a declarative kit tree (`data.screen`) or a self-contained HTML\n * mockup (`data.html`), inside a surface-locked frame (desktop/mobile/popover/\n * panel/browser) with a rough.js sketch overlay. Lives in core so any app can\n * register it (it originated in the plan template).\n *\n * DECOUPLING from the plan original:\n * - Theme: `useIsDark()` reads `document.documentElement.classList` instead of\n * `next-themes` (the MermaidBlock precedent), so core stays dependency-light.\n * - HTML sanitize: the HTML path runs `data.html`/`data.css` through the\n * app-injected `ctx.sanitizeHtml`. If no sanitizer is wired the HTML path is\n * skipped (kit tree or an empty frame renders) — core never injects unsanitized\n * author HTML.\n * - The plan-only prototype runtime, design-element selection, and legacy region\n * fallback are intentionally NOT ported; those are plan-canvas features, not\n * part of the document-block render. The kit element vocabulary, the `--wf-*`\n * token contract, and the `.plan-wf` / `.wf-*` / `[data-rough]` classes the\n * overlay measures are preserved exactly.\n *\n * The section carries the app-neutral `an-block` class plus the legacy\n * `plan-block` class so plan renders byte-identically while any other app gets\n * the theme-token treatment from core's `blocks.css`.\n *\n * The wireframe is canvas / agent-patch edited (node-addressable content patches\n * applied server-side), NOT schema-form edited in the browser — so `Edit` reuses\n * the same static render as `Read`, mirroring the plan `WireframeEditor`.\n */\n\ntype SurfacePreset = {\n width: number;\n /**\n * Floor height for the surface. The frame is AUTO-HEIGHT (content-driven): it\n * grows past this when content is tall and shrinks toward its content height\n * when content is short, but never collapses below this floor — so an empty or\n * near-empty frame still reads as that surface instead of a thin sliver. This\n * is a `min-height`, not a fixed `height`: it is the lower bound the old fixed\n * preset height used to also be the UPPER bound, which is what left a big empty\n * vertical band below short content (e.g. a header + one dropdown padded to a\n * tall fixed aspect).\n */\n minHeight: number;\n radius: number;\n};\n\nconst SURFACE_PRESETS: Record<WireframeSurface, SurfacePreset> = {\n // mobile keeps a tall floor: a phone frame reads as a phone even when short.\n mobile: { width: 300, minHeight: 360, radius: 30 },\n desktop: { width: 840, minHeight: 200, radius: 14 },\n browser: { width: 900, minHeight: 200, radius: 14 },\n popover: { width: 360, minHeight: 120, radius: 16 },\n panel: { width: 420, minHeight: 200, radius: 16 },\n};\n\nfunction isHtmlData(data: WireframeData): boolean {\n return typeof data.html === \"string\" && data.html.trim().length > 0;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Shared frame shell: surface-locked WIDTH + auto (content-driven) height + */\n/* theme + rough overlay. The frame keeps each surface's footprint and chrome */\n/* but fits its content height instead of padding to a fixed aspect, so short */\n/* content yields a short frame and tall content grows. Pass `canvasSize` to */\n/* opt a fixed-aspect canvas artboard back into a hard pixel height. */\n/* -------------------------------------------------------------------------- */\n\nfunction ArtboardFrame({\n surface,\n compact,\n canvasSize,\n canvasWidth,\n skeleton,\n renderMode,\n roughOverlay = true,\n showFrame = true,\n selector,\n caption,\n render,\n}: {\n surface: WireframeSurface;\n compact?: boolean;\n /**\n * Force a FIXED pixel height instead of the auto-height (content-driven)\n * default. Reserved for fixed-aspect canvas artboards (pan/zoom). Document-flow\n * wireframes — what recaps render — leave this unset so the frame fits content.\n */\n canvasSize?: number;\n canvasWidth?: number;\n skeleton?: boolean;\n renderMode?: \"wireframe\" | \"design\";\n roughOverlay?: boolean;\n showFrame?: boolean;\n selector: string;\n caption?: string;\n render: (ctx: {\n theme: \"light\" | \"dark\";\n style: \"sketchy\" | \"clean\";\n }) => ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const fitRef = useRef<HTMLDivElement>(null);\n const isDark = useIsDark();\n const theme: \"light\" | \"dark\" = isDark ? \"dark\" : \"light\";\n const style = useWireframeStyle();\n const preset = SURFACE_PRESETS[surface] ?? SURFACE_PRESETS.desktop;\n const width = canvasWidth ?? preset.width;\n // AUTO-HEIGHT: with no explicit `canvasSize` the artboard height is driven by\n // its content (`height: auto`), floored at the surface's `minHeight` so a short\n // screen produces a short frame and a tall screen grows — instead of every\n // surface being padded to a fixed preset height that left a big empty band\n // below short content. A `canvasSize` (fixed-aspect canvas artboard) overrides\n // this with a hard pixel height.\n const fixedHeight = canvasSize;\n const minHeight = fixedHeight ?? preset.minHeight;\n const baseScale = compact ? Math.min(1, 320 / preset.width) : 1;\n const maxFrameWidth = compact ? preset.width * baseScale : width;\n const [fitScale, setFitScale] = useState(baseScale);\n // The scaled artboard is `transform: scale()`-ed, which does not change its\n // layout box, so the wrapper that reserves vertical space must track the\n // artboard's ACTUAL rendered height. With a fixed height that's known up front;\n // with auto-height we measure it.\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(\n fixedHeight ?? null,\n );\n const designMode = renderMode === \"design\";\n const sketchy = !designMode && style === \"sketchy\" && !skeleton;\n const roughEnabled = sketchy && roughOverlay;\n const frameBorder = skeleton\n ? \"var(--plan-placeholder-line, var(--plan-line, hsl(var(--border))))\"\n : \"var(--plan-line, hsl(var(--border)))\";\n\n useEffect(() => {\n const element = fitRef.current;\n if (!element) return;\n const measure = () => {\n const availableWidth = element.clientWidth;\n const nextScale =\n availableWidth > 0\n ? Math.min(baseScale, availableWidth / width)\n : baseScale;\n setFitScale((current) =>\n Math.abs(current - nextScale) < 0.001 ? current : nextScale,\n );\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [baseScale, width]);\n\n // Track the auto-height artboard's rendered height so the (un-transformed)\n // wrapper reserves exactly the scaled space the frame occupies. Skipped when a\n // fixed height is supplied — there's nothing to measure.\n useEffect(() => {\n if (fixedHeight != null) return;\n const element = ref.current;\n if (!element) return;\n const measure = () => {\n const next = element.offsetHeight;\n setMeasuredHeight((current) =>\n current != null && Math.abs(current - next) < 0.5 ? current : next,\n );\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [fixedHeight]);\n\n // Height the wrapper reserves: the measured (or fixed) artboard height scaled\n // by the fit factor. Falls back to the surface floor before the first measure\n // so SSR / first paint reserves a sensible box rather than collapsing.\n const reservedHeight = (measuredHeight ?? minHeight) * fitScale;\n const reserveScaledHeight = fixedHeight != null || fitScale !== 1;\n\n return (\n <div\n ref={fitRef}\n className=\"plan-kit-wireframe\"\n style={{\n width: \"100%\",\n maxWidth: maxFrameWidth,\n }}\n >\n <div\n className=\"group/wireframe-artboard relative\"\n style={{\n width: \"100%\",\n maxWidth: maxFrameWidth,\n ...(reserveScaledHeight ? { height: reservedHeight } : {}),\n marginInline: \"auto\",\n }}\n >\n <div\n ref={ref}\n className=\"plan-kit-artboard relative\"\n data-rough-scope=\"wireframe\"\n data-frame={showFrame ? \"show\" : \"hide\"}\n style={{\n width,\n // Auto-height by default (content-driven, floored at `minHeight`);\n // a fixed `canvasSize` locks the height for canvas artboards.\n ...(fixedHeight != null ? { height: fixedHeight } : { minHeight }),\n borderRadius: preset.radius,\n ...(fitScale !== 1\n ? {\n transform: `scale(${fitScale})`,\n transformOrigin: \"top left\",\n }\n : {}),\n }}\n >\n {/* Content drives the artboard height in flow when auto-height; for a\n fixed height it's pinned to the box. Rounded corners clip overflow\n either way. */}\n <div\n className=\"overflow-hidden\"\n style={{\n borderRadius: preset.radius,\n ...(fixedHeight != null\n ? { position: \"absolute\", inset: 0 }\n : { minHeight }),\n }}\n >\n {render({ theme, style })}\n </div>\n {!roughEnabled && showFrame && (\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{\n borderRadius: preset.radius,\n border: `1.5px solid ${frameBorder}`,\n }}\n />\n )}\n <RoughOverlay\n scopeRef={ref}\n enabled={roughEnabled}\n drawFrame={showFrame}\n frameRadius={preset.radius}\n selector={selector}\n />\n </div>\n {!designMode && !skeleton && <WireframeStyleToggleButton />}\n </div>\n {caption && (\n <p className=\"mt-2 text-center text-xs text-plan-muted\">{caption}</p>\n )}\n </div>\n );\n}\n\nfunction WireframeStyleToggleButton() {\n const style = useWireframeStyle();\n const copy = useBlockCopy();\n const nextStyle = style === \"sketchy\" ? \"clean\" : \"sketchy\";\n const label = nextStyle === \"clean\" ? copy.clean : copy.sketchy;\n const description = copy.switchVisualStyle.replace(\n \"{{style}}\",\n label.toLocaleLowerCase(),\n );\n\n return (\n <button\n type=\"button\"\n data-plan-interactive\n data-rough=\"none\"\n data-wireframe-style-toggle\n aria-label={description}\n title={description}\n onClick={(event) => {\n event.stopPropagation();\n toggleWireframeStyle();\n }}\n className=\"absolute right-2 top-2 z-30 inline-flex h-7 items-center gap-1 rounded-md border border-border/60 bg-background px-2 text-xs font-medium text-muted-foreground opacity-0 shadow-sm transition-[color,opacity] hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring group-hover/wireframe-artboard:opacity-100\"\n >\n <IconPencil className=\"size-3.5\" aria-hidden=\"true\" />\n <span>{label}</span>\n </button>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* HTML artboard — author HTML, themed + roughened by the renderer. */\n/* -------------------------------------------------------------------------- */\n\nfunction HtmlArtboard({\n data,\n ctx: _ctx,\n showFrame,\n compact,\n}: {\n data: WireframeData;\n ctx: BlockRenderContext;\n showFrame: boolean;\n compact?: boolean;\n}) {\n const renderMode = data.renderMode ?? \"wireframe\";\n const designMode = renderMode === \"design\";\n // Sanitize author HTML/CSS at the render point (defense-in-depth against stored\n // XSS). Self-contained in core via the shared block sanitizer (DOM-based in the\n // browser, regex fallback on the server) so the HTML mockup path renders in any\n // app without the host wiring a sanitizer hook.\n const safeHtml = useMemo(\n () =>\n renderWireframeIconHtml(\n sanitizeWireframeHtml(data.html, {\n preserveThemeClasses: designMode,\n }),\n ),\n [data.html, designMode],\n );\n const scopeId = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const scopedCss = useMemo(() => {\n const safeCss = sanitizeWireframeCss(data.css);\n // Scope every author selector under this instance's artboard so global\n // selectors (body, *, .app-shell, :root) can't restyle/hide the host app.\n return safeCss\n ? scopeDesignCss(safeCss, `[data-plan-design-scope=\"${scopeId}\"]`)\n : \"\";\n }, [data.css, scopeId]);\n\n return (\n <ArtboardFrame\n surface={data.surface}\n compact={compact}\n skeleton={data.skeleton}\n renderMode={renderMode}\n showFrame={showFrame}\n selector={HTML_ROUGH_SELECTOR}\n caption={data.caption}\n render={({ theme, style }) => (\n <div\n className=\"plan-html-frame\"\n data-theme={theme}\n data-style={style}\n data-frame={showFrame ? \"show\" : \"hide\"}\n data-render-mode={renderMode}\n data-plan-design-scope={scopeId}\n data-skeleton={data.skeleton ? \"true\" : undefined}\n >\n {scopedCss && <style>{scopedCss}</style>}\n <div\n className=\"plan-html-frame-content\"\n dangerouslySetInnerHTML={{ __html: safeHtml }}\n />\n </div>\n )}\n />\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Kit artboard — declarative kit tree. */\n/* -------------------------------------------------------------------------- */\n\nfunction KitArtboard({\n data,\n showFrame,\n compact,\n}: {\n data: WireframeData;\n showFrame: boolean;\n compact?: boolean;\n}) {\n return (\n <ArtboardFrame\n surface={data.surface}\n compact={compact}\n skeleton={data.skeleton}\n showFrame={showFrame}\n selector=\"[data-rough]\"\n caption={data.caption}\n render={({ theme, style }) => (\n <KitConfigContext.Provider\n value={{\n skeleton: data.skeleton,\n flushFrame: !showFrame,\n theme,\n style,\n }}\n >\n {renderKitScreen(data.screen ?? [])}\n </KitConfigContext.Provider>\n )}\n />\n );\n}\n\nfunction renderKitScreen(\n nodes: NonNullable<WireframeData[\"screen\"]>,\n): ReactNode {\n if (nodes.length === 1 && nodes[0]?.el === \"screen\") {\n return renderNodes(nodes);\n }\n // `minHeight` (not `height`) so the screen fills the auto-height artboard floor\n // but grows past it when content is tall, instead of locking to a fixed box.\n return (\n <Screen pad=\"calc(var(--pad) * 1.35)\" style={{ minHeight: \"100%\" }}>\n {renderNodes(nodes)}\n </Screen>\n );\n}\n\n/**\n * The bare wireframe surface (no block section / title). Routes to the HTML\n * mockup when `data.html` is present and a sanitizer is wired; otherwise renders\n * the kit tree.\n */\nfunction WireframeSurfaceView({\n data,\n ctx,\n compact,\n}: {\n data: WireframeData;\n ctx: BlockRenderContext;\n compact?: boolean;\n}) {\n const showFrame = resolveVisualFrame(data.frame, ctx);\n if (isHtmlData(data)) {\n return (\n <HtmlArtboard\n data={data}\n ctx={ctx}\n showFrame={showFrame}\n compact={compact}\n />\n );\n }\n return <KitArtboard data={data} showFrame={showFrame} compact={compact} />;\n}\n\nfunction resolveVisualFrame(\n frame: WireframeData[\"frame\"],\n ctx: BlockRenderContext,\n): boolean {\n const resolved =\n frame && frame !== \"auto\" ? frame : (ctx.visualFrame ?? \"show\");\n return resolved !== \"hide\";\n}\n\n/* -------------------------------------------------------------------------- */\n/* Block Read / Edit */\n/* -------------------------------------------------------------------------- */\n\n/** Read-only renderer for a `wireframe` block. */\nexport function WireframeBlock({\n data,\n blockId,\n title,\n summary,\n ctx,\n compactVisuals,\n}: BlockReadProps<WireframeData>) {\n return (\n <section\n {...ltrCodeBlockProps}\n className=\"an-block plan-block an-wireframe\"\n data-block-id={blockId}\n >\n {title && <div className=\"an-block-label plan-block-label\">{title}</div>}\n <WireframeSurfaceView data={data} ctx={ctx} compact={compactVisuals} />\n {summary && <p className=\"mt-5 text-plan-muted\">{summary}</p>}\n </section>\n );\n}\n\n/**\n * Editor for the `wireframe` block. The wireframe is canvas / agent-patch edited\n * (it never calls `onChange`), so edit mode reuses the read surface — mirroring\n * the plan `WireframeEditor`. The host document editor already wraps the registry\n * edit path in a titled section, so this renders only the surface to avoid\n * double-nesting.\n */\nexport function WireframeEditor({ data, ctx }: BlockEditProps<WireframeData>) {\n return <WireframeSurfaceView data={data} ctx={ctx} />;\n}\n\n/** Full client spec for the shared `wireframe` block (schema + MDX + Read/Edit). */\nexport const wireframeBlock = defineBlock<WireframeData>({\n type: \"wireframe\",\n schema: wireframeSchema,\n mdx: wireframeMdx,\n Read: WireframeBlock,\n Edit: WireframeEditor,\n placement: [\"block\"],\n editSurface: \"inline\",\n label: \"Wireframe\",\n description:\n \"A sketch wireframe of one screen built from kit primitives (or an HTML mockup), rendered in a chosen surface frame (desktop/mobile/popover/panel/browser).\",\n // `surface` is the only required field; `screen` defaults to []. Start on the\n // desktop surface with an empty screen so the canvas/agent can fill it in.\n empty: () => ({ surface: \"desktop\", screen: [] }),\n});\n"]}
|
|
1
|
+
{"version":3,"file":"wireframe.js","sourceRoot":"","sources":["../../../../src/client/blocks/library/wireframe.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,iBAAiB,GA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AAW,EAAE,QAAQ;IACrB,KAAK,EAAE,WAAW;IAClB,WAAW,EACT,4JAA4J;IAC9J,8EAA8E;IAC9E,2EAA2E;IAC3E,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;CAClD,CAAC,CAAC","sourcesContent":["import { IconPencil } from \"@tabler/icons-react\";\nimport {\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\n\nimport { ltrCodeBlockProps } from \"../code-block-direction.js\";\nimport { defineBlock } from \"../types.js\";\nimport type {\n BlockReadProps,\n BlockEditProps,\n BlockRenderContext,\n} from \"../types.js\";\nimport { useBlockCopy } from \"./block-copy.js\";\nimport {\n sanitizeWireframeCss,\n sanitizeWireframeHtml,\n scopeDesignCss,\n} from \"./sanitize-html.js\";\nimport { renderWireframeIconHtml } from \"./wireframe-icons.js\";\nimport {\n HTML_ROUGH_SELECTOR,\n KitConfigContext,\n RoughOverlay,\n Screen,\n renderNodes,\n toggleWireframeStyle,\n useIsDark,\n useWireframeStyle,\n} from \"./wireframe-kit.js\";\nimport {\n wireframeSchema,\n wireframeMdx,\n type WireframeData,\n type WireframeSurface,\n} from \"./wireframe.config.js\";\n\n/**\n * Shared `wireframe` block — a hand-drawn low-fi mockup of one screen, rendered\n * from either a declarative kit tree (`data.screen`) or a self-contained HTML\n * mockup (`data.html`), inside a surface-locked frame (desktop/mobile/popover/\n * panel/browser) with a rough.js sketch overlay. Lives in core so any app can\n * register it (it originated in the plan template).\n *\n * DECOUPLING from the plan original:\n * - Theme: `useIsDark()` reads `document.documentElement.classList` instead of\n * `next-themes` (the MermaidBlock precedent), so core stays dependency-light.\n * - HTML sanitize: the HTML path runs `data.html`/`data.css` through the\n * app-injected `ctx.sanitizeHtml`. If no sanitizer is wired the HTML path is\n * skipped (kit tree or an empty frame renders) — core never injects unsanitized\n * author HTML.\n * - The plan-only prototype runtime, design-element selection, and legacy region\n * fallback are intentionally NOT ported; those are plan-canvas features, not\n * part of the document-block render. The kit element vocabulary, the `--wf-*`\n * token contract, and the `.plan-wf` / `.wf-*` / `[data-rough]` classes the\n * overlay measures are preserved exactly.\n *\n * The section carries the app-neutral `an-block` class plus the legacy\n * `plan-block` class so plan renders byte-identically while any other app gets\n * the theme-token treatment from core's `blocks.css`.\n *\n * The wireframe is canvas / agent-patch edited (node-addressable content patches\n * applied server-side), NOT schema-form edited in the browser — so `Edit` reuses\n * the same static render as `Read`, mirroring the plan `WireframeEditor`.\n */\n\ntype SurfacePreset = {\n width: number;\n /**\n * Floor height for the surface. The frame is AUTO-HEIGHT (content-driven): it\n * grows past this when content is tall and shrinks toward its content height\n * when content is short, but never collapses below this floor — so an empty or\n * near-empty frame still reads as that surface instead of a thin sliver. This\n * is a `min-height`, not a fixed `height`: it is the lower bound the old fixed\n * preset height used to also be the UPPER bound, which is what left a big empty\n * vertical band below short content (e.g. a header + one dropdown padded to a\n * tall fixed aspect).\n */\n minHeight: number;\n radius: number;\n};\n\nconst SURFACE_PRESETS: Record<WireframeSurface, SurfacePreset> = {\n // mobile keeps a tall floor: a phone frame reads as a phone even when short.\n mobile: { width: 300, minHeight: 360, radius: 30 },\n desktop: { width: 840, minHeight: 200, radius: 14 },\n browser: { width: 900, minHeight: 200, radius: 14 },\n popover: { width: 360, minHeight: 120, radius: 16 },\n panel: { width: 420, minHeight: 200, radius: 16 },\n};\n\nfunction isHtmlData(data: WireframeData): boolean {\n return typeof data.html === \"string\" && data.html.trim().length > 0;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Shared frame shell: surface-locked WIDTH + auto (content-driven) height + */\n/* theme + rough overlay. The frame keeps each surface's footprint and chrome */\n/* but fits its content height instead of padding to a fixed aspect, so short */\n/* content yields a short frame and tall content grows. Pass `canvasSize` to */\n/* opt a fixed-aspect canvas artboard back into a hard pixel height. */\n/* -------------------------------------------------------------------------- */\n\nfunction ArtboardFrame({\n surface,\n compact,\n canvasSize,\n canvasWidth,\n skeleton,\n renderMode,\n roughOverlay = true,\n showFrame = true,\n selector,\n caption,\n render,\n}: {\n surface: WireframeSurface;\n compact?: boolean;\n /**\n * Force a FIXED pixel height instead of the auto-height (content-driven)\n * default. Reserved for fixed-aspect canvas artboards (pan/zoom). Document-flow\n * wireframes — what recaps render — leave this unset so the frame fits content.\n */\n canvasSize?: number;\n canvasWidth?: number;\n skeleton?: boolean;\n renderMode?: \"wireframe\" | \"design\";\n roughOverlay?: boolean;\n showFrame?: boolean;\n selector: string;\n caption?: string;\n render: (ctx: {\n theme: \"light\" | \"dark\";\n style: \"sketchy\" | \"clean\";\n }) => ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const fitRef = useRef<HTMLDivElement>(null);\n const isDark = useIsDark();\n const theme: \"light\" | \"dark\" = isDark ? \"dark\" : \"light\";\n const preferredStyle = useWireframeStyle();\n const preset = SURFACE_PRESETS[surface] ?? SURFACE_PRESETS.desktop;\n const width = canvasWidth ?? preset.width;\n // AUTO-HEIGHT: with no explicit `canvasSize` the artboard height is driven by\n // its content (`height: auto`), floored at the surface's `minHeight` so a short\n // screen produces a short frame and a tall screen grows — instead of every\n // surface being padded to a fixed preset height that left a big empty band\n // below short content. A `canvasSize` (fixed-aspect canvas artboard) overrides\n // this with a hard pixel height.\n const fixedHeight = canvasSize;\n const minHeight = fixedHeight ?? preset.minHeight;\n const baseScale = compact ? Math.min(1, 320 / preset.width) : 1;\n const maxFrameWidth = compact ? preset.width * baseScale : width;\n const [fitScale, setFitScale] = useState(baseScale);\n // The scaled artboard is `transform: scale()`-ed, which does not change its\n // layout box, so the wrapper that reserves vertical space must track the\n // artboard's ACTUAL rendered height. With a fixed height that's known up front;\n // with auto-height we measure it.\n const [measuredHeight, setMeasuredHeight] = useState<number | null>(\n fixedHeight ?? null,\n );\n const designMode = renderMode === \"design\";\n const style = designMode ? \"clean\" : preferredStyle;\n const sketchy = !designMode && style === \"sketchy\" && !skeleton;\n const roughEnabled = sketchy && roughOverlay;\n const frameBorder = skeleton\n ? \"var(--plan-placeholder-line, var(--plan-line, hsl(var(--border))))\"\n : \"var(--plan-line, hsl(var(--border)))\";\n\n useEffect(() => {\n const element = fitRef.current;\n if (!element) return;\n const measure = () => {\n const availableWidth = element.clientWidth;\n const nextScale =\n availableWidth > 0\n ? Math.min(baseScale, availableWidth / width)\n : baseScale;\n setFitScale((current) =>\n Math.abs(current - nextScale) < 0.001 ? current : nextScale,\n );\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [baseScale, width]);\n\n // Track the auto-height artboard's rendered height so the (un-transformed)\n // wrapper reserves exactly the scaled space the frame occupies. Skipped when a\n // fixed height is supplied — there's nothing to measure.\n useEffect(() => {\n if (fixedHeight != null) return;\n const element = ref.current;\n if (!element) return;\n const measure = () => {\n const next = element.offsetHeight;\n setMeasuredHeight((current) =>\n current != null && Math.abs(current - next) < 0.5 ? current : next,\n );\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(element);\n return () => observer.disconnect();\n }, [fixedHeight]);\n\n // Height the wrapper reserves: the measured (or fixed) artboard height scaled\n // by the fit factor. Falls back to the surface floor before the first measure\n // so SSR / first paint reserves a sensible box rather than collapsing.\n const reservedHeight = (measuredHeight ?? minHeight) * fitScale;\n const reserveScaledHeight = fixedHeight != null || fitScale !== 1;\n\n return (\n <div\n ref={fitRef}\n className=\"plan-kit-wireframe\"\n style={{\n width: \"100%\",\n maxWidth: maxFrameWidth,\n }}\n >\n <div\n className=\"group/wireframe-artboard relative\"\n style={{\n width: \"100%\",\n maxWidth: maxFrameWidth,\n ...(reserveScaledHeight ? { height: reservedHeight } : {}),\n marginInline: \"auto\",\n }}\n >\n <div\n ref={ref}\n className=\"plan-kit-artboard relative\"\n data-rough-scope=\"wireframe\"\n data-frame={showFrame ? \"show\" : \"hide\"}\n style={{\n width,\n // Auto-height by default (content-driven, floored at `minHeight`);\n // a fixed `canvasSize` locks the height for canvas artboards.\n ...(fixedHeight != null ? { height: fixedHeight } : { minHeight }),\n borderRadius: preset.radius,\n ...(fitScale !== 1\n ? {\n transform: `scale(${fitScale})`,\n transformOrigin: \"top left\",\n }\n : {}),\n }}\n >\n {/* Content drives the artboard height in flow when auto-height; for a\n fixed height it's pinned to the box. Rounded corners clip overflow\n either way. */}\n <div\n className=\"overflow-hidden\"\n style={{\n borderRadius: preset.radius,\n ...(fixedHeight != null\n ? { position: \"absolute\", inset: 0 }\n : { minHeight }),\n }}\n >\n {render({ theme, style })}\n </div>\n {!roughEnabled && showFrame && (\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{\n borderRadius: preset.radius,\n border: `1.5px solid ${frameBorder}`,\n }}\n />\n )}\n <RoughOverlay\n scopeRef={ref}\n enabled={roughEnabled}\n drawFrame={showFrame}\n frameRadius={preset.radius}\n selector={selector}\n />\n </div>\n {!designMode && !skeleton && <WireframeStyleToggleButton />}\n </div>\n {caption && (\n <p className=\"mt-2 text-center text-xs text-plan-muted\">{caption}</p>\n )}\n </div>\n );\n}\n\nfunction WireframeStyleToggleButton() {\n const style = useWireframeStyle();\n const copy = useBlockCopy();\n const nextStyle = style === \"sketchy\" ? \"clean\" : \"sketchy\";\n const label = nextStyle === \"clean\" ? copy.clean : copy.sketchy;\n const description = copy.switchVisualStyle.replace(\n \"{{style}}\",\n label.toLocaleLowerCase(),\n );\n\n return (\n <button\n type=\"button\"\n data-plan-interactive\n data-rough=\"none\"\n data-wireframe-style-toggle\n aria-label={description}\n title={description}\n onClick={(event) => {\n event.stopPropagation();\n toggleWireframeStyle();\n }}\n className=\"absolute right-2 top-2 z-30 inline-flex h-7 items-center gap-1 rounded-md border border-border/60 bg-background px-2 text-xs font-medium text-muted-foreground opacity-0 shadow-sm transition-[color,opacity] hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring group-hover/wireframe-artboard:opacity-100\"\n >\n <IconPencil className=\"size-3.5\" aria-hidden=\"true\" />\n <span>{label}</span>\n </button>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* HTML artboard — author HTML, themed + roughened by the renderer. */\n/* -------------------------------------------------------------------------- */\n\nfunction HtmlArtboard({\n data,\n ctx: _ctx,\n showFrame,\n compact,\n}: {\n data: WireframeData;\n ctx: BlockRenderContext;\n showFrame: boolean;\n compact?: boolean;\n}) {\n const renderMode = data.renderMode ?? \"wireframe\";\n const designMode = renderMode === \"design\";\n // Sanitize author HTML/CSS at the render point (defense-in-depth against stored\n // XSS). Self-contained in core via the shared block sanitizer (DOM-based in the\n // browser, regex fallback on the server) so the HTML mockup path renders in any\n // app without the host wiring a sanitizer hook.\n const safeHtml = useMemo(\n () =>\n renderWireframeIconHtml(\n sanitizeWireframeHtml(data.html, {\n preserveThemeClasses: designMode,\n }),\n ),\n [data.html, designMode],\n );\n const scopeId = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const scopedCss = useMemo(() => {\n const safeCss = sanitizeWireframeCss(data.css);\n // Scope every author selector under this instance's artboard so global\n // selectors (body, *, .app-shell, :root) can't restyle/hide the host app.\n return safeCss\n ? scopeDesignCss(safeCss, `[data-plan-design-scope=\"${scopeId}\"]`)\n : \"\";\n }, [data.css, scopeId]);\n\n return (\n <ArtboardFrame\n surface={data.surface}\n compact={compact}\n skeleton={data.skeleton}\n renderMode={renderMode}\n showFrame={showFrame}\n selector={HTML_ROUGH_SELECTOR}\n caption={data.caption}\n render={({ theme, style }) => (\n <div\n className=\"plan-html-frame\"\n data-theme={theme}\n data-style={style}\n data-frame={showFrame ? \"show\" : \"hide\"}\n data-render-mode={renderMode}\n data-plan-design-scope={scopeId}\n data-skeleton={data.skeleton ? \"true\" : undefined}\n >\n {scopedCss && <style>{scopedCss}</style>}\n <div\n className=\"plan-html-frame-content\"\n dangerouslySetInnerHTML={{ __html: safeHtml }}\n />\n </div>\n )}\n />\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Kit artboard — declarative kit tree. */\n/* -------------------------------------------------------------------------- */\n\nfunction KitArtboard({\n data,\n showFrame,\n compact,\n}: {\n data: WireframeData;\n showFrame: boolean;\n compact?: boolean;\n}) {\n return (\n <ArtboardFrame\n surface={data.surface}\n compact={compact}\n skeleton={data.skeleton}\n renderMode={data.renderMode}\n showFrame={showFrame}\n selector=\"[data-rough]\"\n caption={data.caption}\n render={({ theme, style }) => (\n <KitConfigContext.Provider\n value={{\n skeleton: data.skeleton,\n flushFrame: !showFrame,\n theme,\n style,\n }}\n >\n {renderKitScreen(data.screen ?? [])}\n </KitConfigContext.Provider>\n )}\n />\n );\n}\n\nfunction renderKitScreen(\n nodes: NonNullable<WireframeData[\"screen\"]>,\n): ReactNode {\n if (nodes.length === 1 && nodes[0]?.el === \"screen\") {\n return renderNodes(nodes);\n }\n // `minHeight` (not `height`) so the screen fills the auto-height artboard floor\n // but grows past it when content is tall, instead of locking to a fixed box.\n return (\n <Screen pad=\"calc(var(--pad) * 1.35)\" style={{ minHeight: \"100%\" }}>\n {renderNodes(nodes)}\n </Screen>\n );\n}\n\n/**\n * The bare wireframe surface (no block section / title). Routes to the HTML\n * mockup when `data.html` is present and a sanitizer is wired; otherwise renders\n * the kit tree.\n */\nfunction WireframeSurfaceView({\n data,\n ctx,\n compact,\n}: {\n data: WireframeData;\n ctx: BlockRenderContext;\n compact?: boolean;\n}) {\n const showFrame = resolveVisualFrame(data.frame, ctx);\n if (isHtmlData(data)) {\n return (\n <HtmlArtboard\n data={data}\n ctx={ctx}\n showFrame={showFrame}\n compact={compact}\n />\n );\n }\n return <KitArtboard data={data} showFrame={showFrame} compact={compact} />;\n}\n\nfunction resolveVisualFrame(\n frame: WireframeData[\"frame\"],\n ctx: BlockRenderContext,\n): boolean {\n const resolved =\n frame && frame !== \"auto\" ? frame : (ctx.visualFrame ?? \"show\");\n return resolved !== \"hide\";\n}\n\n/* -------------------------------------------------------------------------- */\n/* Block Read / Edit */\n/* -------------------------------------------------------------------------- */\n\n/** Read-only renderer for a `wireframe` block. */\nexport function WireframeBlock({\n data,\n blockId,\n title,\n summary,\n ctx,\n compactVisuals,\n}: BlockReadProps<WireframeData>) {\n return (\n <section\n {...ltrCodeBlockProps}\n className=\"an-block plan-block an-wireframe\"\n data-block-id={blockId}\n >\n {title && <div className=\"an-block-label plan-block-label\">{title}</div>}\n <WireframeSurfaceView data={data} ctx={ctx} compact={compactVisuals} />\n {summary && <p className=\"mt-5 text-plan-muted\">{summary}</p>}\n </section>\n );\n}\n\n/**\n * Editor for the `wireframe` block. The wireframe is canvas / agent-patch edited\n * (it never calls `onChange`), so edit mode reuses the read surface — mirroring\n * the plan `WireframeEditor`. The host document editor already wraps the registry\n * edit path in a titled section, so this renders only the surface to avoid\n * double-nesting.\n */\nexport function WireframeEditor({ data, ctx }: BlockEditProps<WireframeData>) {\n return <WireframeSurfaceView data={data} ctx={ctx} />;\n}\n\n/** Full client spec for the shared `wireframe` block (schema + MDX + Read/Edit). */\nexport const wireframeBlock = defineBlock<WireframeData>({\n type: \"wireframe\",\n schema: wireframeSchema,\n mdx: wireframeMdx,\n Read: WireframeBlock,\n Edit: WireframeEditor,\n placement: [\"block\"],\n editSurface: \"inline\",\n label: \"Wireframe\",\n description:\n \"A sketch wireframe of one screen built from kit primitives (or an HTML mockup), rendered in a chosen surface frame (desktop/mobile/popover/panel/browser).\",\n // `surface` is the only required field; `screen` defaults to []. Start on the\n // desktop surface with an empty screen so the canvas/agent can fill it in.\n empty: () => ({ surface: \"desktop\", screen: [] }),\n});\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { ContentPart } from "../sse-event-processor.js";
|
|
2
3
|
export declare function displayableUserMessageText(text: string): string;
|
|
3
4
|
export declare function isHiddenUserMessage(message: unknown): boolean;
|
|
4
5
|
interface FormattedMessageTimestamp {
|
|
@@ -27,6 +28,10 @@ export declare function MessageActionsMenu({ showRevert, onRevert, }?: {
|
|
|
27
28
|
export declare function UserMessage(): React.JSX.Element | null;
|
|
28
29
|
export declare function messageTextFromContent(content: unknown): string;
|
|
29
30
|
export declare function assistantMessageHasUnresolvedTool(content: unknown): boolean;
|
|
31
|
+
export declare function computeLatestRunningToolCallId(content: ContentPart[] | undefined, { chatRunning, isLast }: {
|
|
32
|
+
chatRunning: boolean;
|
|
33
|
+
isLast: boolean;
|
|
34
|
+
}): string | null;
|
|
30
35
|
export declare function shouldShowAssistantMessageFooter({ isLast, chatRunning, hasRenderableContent, statusIsTerminal, hasUnresolvedTool, }: {
|
|
31
36
|
isLast: boolean;
|
|
32
37
|
chatRunning: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-components.d.ts","sourceRoot":"","sources":["../../../src/client/chat/message-components.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAmD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"message-components.d.ts","sourceRoot":"","sources":["../../../src/client/chat/message-components.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAqBxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAuB7D,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAc7D;AAID,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAqBD,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,GACb,yBAAyB,GAAG,IAAI,CAyClC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,SAAS,GACV,EAAE;IACD,SAAS,EAAE,yBAAyB,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,qBAYA;AAID,wBAAgB,qBAAqB,6BAgEpC;AAID,eAAO,MAAM,iBAAiB;YACpB,MAAM;aACL,OAAO;eACL,MAAM;SACJ,CAAC;AAEhB,eAAO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I,EAAE;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAMV;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,GACrD;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAoBjD;AAiDD,wBAAgB,gBAAgB,6BA+R/B;AAID,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,qBAMjE;AAED,wBAAgB,iBAAiB,CAAC,EAChC,KAAkB,GACnB,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,qBAWzB"}
|
|
@@ -433,6 +433,18 @@ export function assistantMessageHasUnresolvedTool(content) {
|
|
|
433
433
|
return record.type === "tool-call" && record.result === undefined;
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
|
+
// Only the last assistant message may shimmer as "the currently running
|
|
437
|
+
// tool" — an older message's dangling unresolved tool-call must never
|
|
438
|
+
// shimmer once a later run is active.
|
|
439
|
+
export function computeLatestRunningToolCallId(content, { chatRunning, isLast }) {
|
|
440
|
+
if (!isLast)
|
|
441
|
+
return null;
|
|
442
|
+
return (content?.reduce((latestToolCallId, part) => part.type === "tool-call" &&
|
|
443
|
+
part.result === undefined &&
|
|
444
|
+
(chatRunning || part.activity === true)
|
|
445
|
+
? part.toolCallId
|
|
446
|
+
: latestToolCallId, null) ?? null);
|
|
447
|
+
}
|
|
436
448
|
export function shouldShowAssistantMessageFooter({ isLast, chatRunning, hasRenderableContent, statusIsTerminal, hasUnresolvedTool, }) {
|
|
437
449
|
if (!hasRenderableContent)
|
|
438
450
|
return false;
|
|
@@ -641,6 +653,10 @@ export function AssistantMessage() {
|
|
|
641
653
|
const hasCollapsibleWork = Array.isArray(msgContent) &&
|
|
642
654
|
msgContent.some((p) => (p.type !== "tool-call" || p.activity !== true) &&
|
|
643
655
|
isCollapsibleAssistantWorkPart(p));
|
|
656
|
+
const latestRunningToolCallId = computeLatestRunningToolCallId(msgContent, {
|
|
657
|
+
chatRunning,
|
|
658
|
+
isLast,
|
|
659
|
+
});
|
|
644
660
|
if (!hasRenderableContent)
|
|
645
661
|
return null;
|
|
646
662
|
return (_jsxs("div", { className: "group relative", style: { contentVisibility: isComplete ? "auto" : "visible" }, children: [_jsxs("div", { className: "w-full max-w-[95%] text-sm leading-relaxed text-foreground", children: [_jsx(MessagePrimitive.GroupedParts, { groupBy: groupAssistantWorkParts, children: ({ part, children }) => {
|
|
@@ -665,7 +681,7 @@ export function AssistantMessage() {
|
|
|
665
681
|
case "reasoning":
|
|
666
682
|
return _jsx(ReasoningMessagePart, {});
|
|
667
683
|
case "tool-call":
|
|
668
|
-
return part.toolUI ?? _jsx(ToolCallFallback, { ...part });
|
|
684
|
+
return (part.toolUI ?? (_jsx(ToolCallFallback, { ...part, isLatestRunning: part.toolCallId === latestRunningToolCallId })));
|
|
669
685
|
default:
|
|
670
686
|
return null;
|
|
671
687
|
}
|