@agent-native/dispatch 0.1.1
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/README.md +220 -0
- package/dist/actions/approve-dispatch-change.d.ts +3 -0
- package/dist/actions/approve-dispatch-change.d.ts.map +1 -0
- package/dist/actions/approve-dispatch-change.js +11 -0
- package/dist/actions/approve-dispatch-change.js.map +1 -0
- package/dist/actions/approve-vault-request.d.ts +3 -0
- package/dist/actions/approve-vault-request.d.ts.map +1 -0
- package/dist/actions/approve-vault-request.js +16 -0
- package/dist/actions/approve-vault-request.js.map +1 -0
- package/dist/actions/create-link-token.d.ts +3 -0
- package/dist/actions/create-link-token.d.ts.map +1 -0
- package/dist/actions/create-link-token.js +11 -0
- package/dist/actions/create-link-token.js.map +1 -0
- package/dist/actions/create-vault-grant.d.ts +3 -0
- package/dist/actions/create-vault-grant.d.ts.map +1 -0
- package/dist/actions/create-vault-grant.js +14 -0
- package/dist/actions/create-vault-grant.js.map +1 -0
- package/dist/actions/create-vault-secret.d.ts +3 -0
- package/dist/actions/create-vault-secret.d.ts.map +1 -0
- package/dist/actions/create-vault-secret.js +20 -0
- package/dist/actions/create-vault-secret.js.map +1 -0
- package/dist/actions/create-workspace-resource-grant.d.ts +3 -0
- package/dist/actions/create-workspace-resource-grant.d.ts.map +1 -0
- package/dist/actions/create-workspace-resource-grant.js +14 -0
- package/dist/actions/create-workspace-resource-grant.js.map +1 -0
- package/dist/actions/create-workspace-resource.d.ts +3 -0
- package/dist/actions/create-workspace-resource.d.ts.map +1 -0
- package/dist/actions/create-workspace-resource.js +24 -0
- package/dist/actions/create-workspace-resource.js.map +1 -0
- package/dist/actions/delete-destination.d.ts +3 -0
- package/dist/actions/delete-destination.d.ts.map +1 -0
- package/dist/actions/delete-destination.js +11 -0
- package/dist/actions/delete-destination.js.map +1 -0
- package/dist/actions/delete-vault-secret.d.ts +3 -0
- package/dist/actions/delete-vault-secret.d.ts.map +1 -0
- package/dist/actions/delete-vault-secret.js +11 -0
- package/dist/actions/delete-vault-secret.js.map +1 -0
- package/dist/actions/delete-workspace-resource.d.ts +3 -0
- package/dist/actions/delete-workspace-resource.d.ts.map +1 -0
- package/dist/actions/delete-workspace-resource.js +11 -0
- package/dist/actions/delete-workspace-resource.js.map +1 -0
- package/dist/actions/deny-vault-request.d.ts +3 -0
- package/dist/actions/deny-vault-request.d.ts.map +1 -0
- package/dist/actions/deny-vault-request.js +12 -0
- package/dist/actions/deny-vault-request.js.map +1 -0
- package/dist/actions/get-app-creation-settings.d.ts +3 -0
- package/dist/actions/get-app-creation-settings.d.ts.map +1 -0
- package/dist/actions/get-app-creation-settings.js +10 -0
- package/dist/actions/get-app-creation-settings.js.map +1 -0
- package/dist/actions/get-dispatch-settings.d.ts +3 -0
- package/dist/actions/get-dispatch-settings.d.ts.map +1 -0
- package/dist/actions/get-dispatch-settings.js +10 -0
- package/dist/actions/get-dispatch-settings.js.map +1 -0
- package/dist/actions/get-workspace-info.d.ts +3 -0
- package/dist/actions/get-workspace-info.d.ts.map +1 -0
- package/dist/actions/get-workspace-info.js +10 -0
- package/dist/actions/get-workspace-info.js.map +1 -0
- package/dist/actions/grant-vault-secrets-to-app.d.ts +3 -0
- package/dist/actions/grant-vault-secrets-to-app.d.ts.map +1 -0
- package/dist/actions/grant-vault-secrets-to-app.js +19 -0
- package/dist/actions/grant-vault-secrets-to-app.js.map +1 -0
- package/dist/actions/index.d.ts +9 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +101 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/list-connected-agents.d.ts +3 -0
- package/dist/actions/list-connected-agents.d.ts.map +1 -0
- package/dist/actions/list-connected-agents.js +79 -0
- package/dist/actions/list-connected-agents.js.map +1 -0
- package/dist/actions/list-destinations.d.ts +3 -0
- package/dist/actions/list-destinations.d.ts.map +1 -0
- package/dist/actions/list-destinations.js +10 -0
- package/dist/actions/list-destinations.js.map +1 -0
- package/dist/actions/list-dispatch-approvals.d.ts +3 -0
- package/dist/actions/list-dispatch-approvals.d.ts.map +1 -0
- package/dist/actions/list-dispatch-approvals.js +10 -0
- package/dist/actions/list-dispatch-approvals.js.map +1 -0
- package/dist/actions/list-dispatch-audit.d.ts +3 -0
- package/dist/actions/list-dispatch-audit.d.ts.map +1 -0
- package/dist/actions/list-dispatch-audit.js +12 -0
- package/dist/actions/list-dispatch-audit.js.map +1 -0
- package/dist/actions/list-dispatch-overview.d.ts +3 -0
- package/dist/actions/list-dispatch-overview.d.ts.map +1 -0
- package/dist/actions/list-dispatch-overview.js +17 -0
- package/dist/actions/list-dispatch-overview.js.map +1 -0
- package/dist/actions/list-integrations-catalog.d.ts +3 -0
- package/dist/actions/list-integrations-catalog.d.ts.map +1 -0
- package/dist/actions/list-integrations-catalog.js +10 -0
- package/dist/actions/list-integrations-catalog.js.map +1 -0
- package/dist/actions/list-linked-identities.d.ts +3 -0
- package/dist/actions/list-linked-identities.d.ts.map +1 -0
- package/dist/actions/list-linked-identities.js +10 -0
- package/dist/actions/list-linked-identities.js.map +1 -0
- package/dist/actions/list-vault-audit.d.ts +3 -0
- package/dist/actions/list-vault-audit.d.ts.map +1 -0
- package/dist/actions/list-vault-audit.js +15 -0
- package/dist/actions/list-vault-audit.js.map +1 -0
- package/dist/actions/list-vault-grants.d.ts +3 -0
- package/dist/actions/list-vault-grants.d.ts.map +1 -0
- package/dist/actions/list-vault-grants.js +13 -0
- package/dist/actions/list-vault-grants.js.map +1 -0
- package/dist/actions/list-vault-requests.d.ts +3 -0
- package/dist/actions/list-vault-requests.d.ts.map +1 -0
- package/dist/actions/list-vault-requests.js +15 -0
- package/dist/actions/list-vault-requests.js.map +1 -0
- package/dist/actions/list-vault-secret-options.d.ts +3 -0
- package/dist/actions/list-vault-secret-options.d.ts.map +1 -0
- package/dist/actions/list-vault-secret-options.js +19 -0
- package/dist/actions/list-vault-secret-options.js.map +1 -0
- package/dist/actions/list-vault-secrets.d.ts +3 -0
- package/dist/actions/list-vault-secrets.d.ts.map +1 -0
- package/dist/actions/list-vault-secrets.js +25 -0
- package/dist/actions/list-vault-secrets.js.map +1 -0
- package/dist/actions/list-workspace-apps.d.ts +3 -0
- package/dist/actions/list-workspace-apps.d.ts.map +1 -0
- package/dist/actions/list-workspace-apps.js +24 -0
- package/dist/actions/list-workspace-apps.js.map +1 -0
- package/dist/actions/list-workspace-resource-grants.d.ts +3 -0
- package/dist/actions/list-workspace-resource-grants.d.ts.map +1 -0
- package/dist/actions/list-workspace-resource-grants.js +13 -0
- package/dist/actions/list-workspace-resource-grants.js.map +1 -0
- package/dist/actions/list-workspace-resources.d.ts +3 -0
- package/dist/actions/list-workspace-resources.d.ts.map +1 -0
- package/dist/actions/list-workspace-resources.js +15 -0
- package/dist/actions/list-workspace-resources.js.map +1 -0
- package/dist/actions/navigate.d.ts +16 -0
- package/dist/actions/navigate.d.ts.map +1 -0
- package/dist/actions/navigate.js +55 -0
- package/dist/actions/navigate.js.map +1 -0
- package/dist/actions/reject-dispatch-change.d.ts +3 -0
- package/dist/actions/reject-dispatch-change.d.ts.map +1 -0
- package/dist/actions/reject-dispatch-change.js +12 -0
- package/dist/actions/reject-dispatch-change.js.map +1 -0
- package/dist/actions/request-vault-secret.d.ts +3 -0
- package/dist/actions/request-vault-secret.d.ts.map +1 -0
- package/dist/actions/request-vault-secret.js +15 -0
- package/dist/actions/request-vault-secret.js.map +1 -0
- package/dist/actions/revoke-vault-grant.d.ts +3 -0
- package/dist/actions/revoke-vault-grant.d.ts.map +1 -0
- package/dist/actions/revoke-vault-grant.js +11 -0
- package/dist/actions/revoke-vault-grant.js.map +1 -0
- package/dist/actions/revoke-workspace-resource-grant.d.ts +3 -0
- package/dist/actions/revoke-workspace-resource-grant.d.ts.map +1 -0
- package/dist/actions/revoke-workspace-resource-grant.js +11 -0
- package/dist/actions/revoke-workspace-resource-grant.js.map +1 -0
- package/dist/actions/send-platform-message.d.ts +3 -0
- package/dist/actions/send-platform-message.d.ts.map +1 -0
- package/dist/actions/send-platform-message.js +73 -0
- package/dist/actions/send-platform-message.js.map +1 -0
- package/dist/actions/set-app-creation-settings.d.ts +3 -0
- package/dist/actions/set-app-creation-settings.d.ts.map +1 -0
- package/dist/actions/set-app-creation-settings.js +18 -0
- package/dist/actions/set-app-creation-settings.js.map +1 -0
- package/dist/actions/set-dispatch-approval-policy.d.ts +3 -0
- package/dist/actions/set-dispatch-approval-policy.d.ts.map +1 -0
- package/dist/actions/set-dispatch-approval-policy.js +19 -0
- package/dist/actions/set-dispatch-approval-policy.js.map +1 -0
- package/dist/actions/start-workspace-app-creation.d.ts +3 -0
- package/dist/actions/start-workspace-app-creation.d.ts.map +1 -0
- package/dist/actions/start-workspace-app-creation.js +31 -0
- package/dist/actions/start-workspace-app-creation.js.map +1 -0
- package/dist/actions/sync-vault-to-app.d.ts +3 -0
- package/dist/actions/sync-vault-to-app.d.ts.map +1 -0
- package/dist/actions/sync-vault-to-app.js +13 -0
- package/dist/actions/sync-vault-to-app.js.map +1 -0
- package/dist/actions/sync-workspace-resources-to-all.d.ts +3 -0
- package/dist/actions/sync-workspace-resources-to-all.d.ts.map +1 -0
- package/dist/actions/sync-workspace-resources-to-all.js +9 -0
- package/dist/actions/sync-workspace-resources-to-all.js.map +1 -0
- package/dist/actions/sync-workspace-resources-to-app.d.ts +3 -0
- package/dist/actions/sync-workspace-resources-to-app.d.ts.map +1 -0
- package/dist/actions/sync-workspace-resources-to-app.js +11 -0
- package/dist/actions/sync-workspace-resources-to-app.js.map +1 -0
- package/dist/actions/update-vault-secret.d.ts +3 -0
- package/dist/actions/update-vault-secret.d.ts.map +1 -0
- package/dist/actions/update-vault-secret.js +12 -0
- package/dist/actions/update-vault-secret.js.map +1 -0
- package/dist/actions/update-workspace-resource.d.ts +3 -0
- package/dist/actions/update-workspace-resource.d.ts.map +1 -0
- package/dist/actions/update-workspace-resource.js +18 -0
- package/dist/actions/update-workspace-resource.js.map +1 -0
- package/dist/actions/upsert-destination.d.ts +3 -0
- package/dist/actions/upsert-destination.d.ts.map +1 -0
- package/dist/actions/upsert-destination.js +26 -0
- package/dist/actions/upsert-destination.js.map +1 -0
- package/dist/actions/view-screen.d.ts +11 -0
- package/dist/actions/view-screen.d.ts.map +1 -0
- package/dist/actions/view-screen.js +68 -0
- package/dist/actions/view-screen.js.map +1 -0
- package/dist/components/agents-panel.d.ts +16 -0
- package/dist/components/agents-panel.d.ts.map +1 -0
- package/dist/components/agents-panel.js +64 -0
- package/dist/components/agents-panel.js.map +1 -0
- package/dist/components/app-keys-popover.d.ts +11 -0
- package/dist/components/app-keys-popover.d.ts.map +1 -0
- package/dist/components/app-keys-popover.js +84 -0
- package/dist/components/app-keys-popover.js.map +1 -0
- package/dist/components/create-app-popover.d.ts +24 -0
- package/dist/components/create-app-popover.d.ts.map +1 -0
- package/dist/components/create-app-popover.js +188 -0
- package/dist/components/create-app-popover.js.map +1 -0
- package/dist/components/dispatch-shell.d.ts +13 -0
- package/dist/components/dispatch-shell.d.ts.map +1 -0
- package/dist/components/dispatch-shell.js +15 -0
- package/dist/components/dispatch-shell.js.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +12 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/layout/Header.d.ts +5 -0
- package/dist/components/layout/Header.d.ts.map +1 -0
- package/dist/components/layout/Header.js +34 -0
- package/dist/components/layout/Header.js.map +1 -0
- package/dist/components/layout/HeaderActions.d.ts +18 -0
- package/dist/components/layout/HeaderActions.d.ts.map +1 -0
- package/dist/components/layout/HeaderActions.js +52 -0
- package/dist/components/layout/HeaderActions.js.map +1 -0
- package/dist/components/layout/Layout.d.ts +8 -0
- package/dist/components/layout/Layout.d.ts.map +1 -0
- package/dist/components/layout/Layout.js +70 -0
- package/dist/components/layout/Layout.js.map +1 -0
- package/dist/components/messaging-setup-panel.d.ts +2 -0
- package/dist/components/messaging-setup-panel.d.ts.map +1 -0
- package/dist/components/messaging-setup-panel.js +300 -0
- package/dist/components/messaging-setup-panel.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +14 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +27 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +23 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +4 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +12 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +21 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +24 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +34 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +41 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +17 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +99 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +80 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +131 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +9 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +6 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/command.d.ts +83 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +29 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +34 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +20 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +23 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +23 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +36 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +63 -0
- package/dist/components/ui/form.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +10 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +19 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +9 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +10 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +41 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +25 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +29 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +24 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +10 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +15 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +9 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +12 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +27 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +8 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +26 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +37 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +233 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +7 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +8 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +25 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +7 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +8 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +21 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +13 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +9 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toast.d.ts +16 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +34 -0
- package/dist/components/ui/toast.js.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toaster.js +10 -0
- package/dist/components/ui/toaster.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +21 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +11 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/ui/use-toast.d.ts +3 -0
- package/dist/components/ui/use-toast.d.ts.map +1 -0
- package/dist/components/ui/use-toast.js +3 -0
- package/dist/components/ui/use-toast.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -0
- package/dist/db/index.d.ts +7 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +10 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +5 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +166 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/schema.d.ts +2344 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +148 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-navigation-state.d.ts +6 -0
- package/dist/hooks/use-navigation-state.d.ts.map +1 -0
- package/dist/hooks/use-navigation-state.js +129 -0
- package/dist/hooks/use-navigation-state.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +127 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +2 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/routes/index.d.ts +32 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +51 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/pages/_index.d.ts +15 -0
- package/dist/routes/pages/_index.d.ts.map +1 -0
- package/dist/routes/pages/_index.js +42 -0
- package/dist/routes/pages/_index.js.map +1 -0
- package/dist/routes/pages/agents.d.ts +5 -0
- package/dist/routes/pages/agents.d.ts.map +1 -0
- package/dist/routes/pages/agents.js +12 -0
- package/dist/routes/pages/agents.js.map +1 -0
- package/dist/routes/pages/approval.d.ts +5 -0
- package/dist/routes/pages/approval.d.ts.map +1 -0
- package/dist/routes/pages/approval.js +47 -0
- package/dist/routes/pages/approval.js.map +1 -0
- package/dist/routes/pages/approvals.d.ts +5 -0
- package/dist/routes/pages/approvals.d.ts.map +1 -0
- package/dist/routes/pages/approvals.js +48 -0
- package/dist/routes/pages/approvals.js.map +1 -0
- package/dist/routes/pages/apps.$appId.d.ts +5 -0
- package/dist/routes/pages/apps.$appId.d.ts.map +1 -0
- package/dist/routes/pages/apps.$appId.js +31 -0
- package/dist/routes/pages/apps.$appId.js.map +1 -0
- package/dist/routes/pages/apps.d.ts +5 -0
- package/dist/routes/pages/apps.d.ts.map +1 -0
- package/dist/routes/pages/apps.js +42 -0
- package/dist/routes/pages/apps.js.map +1 -0
- package/dist/routes/pages/audit.d.ts +5 -0
- package/dist/routes/pages/audit.d.ts.map +1 -0
- package/dist/routes/pages/audit.js +11 -0
- package/dist/routes/pages/audit.js.map +1 -0
- package/dist/routes/pages/destinations.d.ts +5 -0
- package/dist/routes/pages/destinations.d.ts.map +1 -0
- package/dist/routes/pages/destinations.js +80 -0
- package/dist/routes/pages/destinations.js.map +1 -0
- package/dist/routes/pages/identities.d.ts +5 -0
- package/dist/routes/pages/identities.d.ts.map +1 -0
- package/dist/routes/pages/identities.js +18 -0
- package/dist/routes/pages/identities.js.map +1 -0
- package/dist/routes/pages/integrations.d.ts +5 -0
- package/dist/routes/pages/integrations.d.ts.map +1 -0
- package/dist/routes/pages/integrations.js +46 -0
- package/dist/routes/pages/integrations.js.map +1 -0
- package/dist/routes/pages/messaging.d.ts +5 -0
- package/dist/routes/pages/messaging.d.ts.map +1 -0
- package/dist/routes/pages/messaging.js +10 -0
- package/dist/routes/pages/messaging.js.map +1 -0
- package/dist/routes/pages/new-app.d.ts +5 -0
- package/dist/routes/pages/new-app.d.ts.map +1 -0
- package/dist/routes/pages/new-app.js +10 -0
- package/dist/routes/pages/new-app.js.map +1 -0
- package/dist/routes/pages/overview.d.ts +5 -0
- package/dist/routes/pages/overview.d.ts.map +1 -0
- package/dist/routes/pages/overview.js +225 -0
- package/dist/routes/pages/overview.js.map +1 -0
- package/dist/routes/pages/team.d.ts +5 -0
- package/dist/routes/pages/team.d.ts.map +1 -0
- package/dist/routes/pages/team.js +10 -0
- package/dist/routes/pages/team.js.map +1 -0
- package/dist/routes/pages/tools.$id.d.ts +2 -0
- package/dist/routes/pages/tools.$id.d.ts.map +1 -0
- package/dist/routes/pages/tools.$id.js +6 -0
- package/dist/routes/pages/tools.$id.js.map +1 -0
- package/dist/routes/pages/tools._index.d.ts +2 -0
- package/dist/routes/pages/tools._index.d.ts.map +1 -0
- package/dist/routes/pages/tools._index.js +6 -0
- package/dist/routes/pages/tools._index.js.map +1 -0
- package/dist/routes/pages/vault.d.ts +5 -0
- package/dist/routes/pages/vault.d.ts.map +1 -0
- package/dist/routes/pages/vault.js +131 -0
- package/dist/routes/pages/vault.js.map +1 -0
- package/dist/routes/pages/workspace.d.ts +5 -0
- package/dist/routes/pages/workspace.d.ts.map +1 -0
- package/dist/routes/pages/workspace.js +149 -0
- package/dist/routes/pages/workspace.js.map +1 -0
- package/dist/server/index.d.ts +44 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +68 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/lib/app-creation-store.d.ts +102 -0
- package/dist/server/lib/app-creation-store.d.ts.map +1 -0
- package/dist/server/lib/app-creation-store.js +780 -0
- package/dist/server/lib/app-creation-store.js.map +1 -0
- package/dist/server/lib/dispatch-integrations.d.ts +10 -0
- package/dist/server/lib/dispatch-integrations.d.ts.map +1 -0
- package/dist/server/lib/dispatch-integrations.js +105 -0
- package/dist/server/lib/dispatch-integrations.js.map +1 -0
- package/dist/server/lib/dispatch-store.d.ts +313 -0
- package/dist/server/lib/dispatch-store.d.ts.map +1 -0
- package/dist/server/lib/dispatch-store.js +669 -0
- package/dist/server/lib/dispatch-store.js.map +1 -0
- package/dist/server/lib/env-config.d.ts +3 -0
- package/dist/server/lib/env-config.d.ts.map +1 -0
- package/dist/server/lib/env-config.js +43 -0
- package/dist/server/lib/env-config.js.map +1 -0
- package/dist/server/lib/pre-auth-routing.d.ts +2 -0
- package/dist/server/lib/pre-auth-routing.d.ts.map +1 -0
- package/dist/server/lib/pre-auth-routing.js +128 -0
- package/dist/server/lib/pre-auth-routing.js.map +1 -0
- package/dist/server/lib/vault-store.d.ts +270 -0
- package/dist/server/lib/vault-store.d.ts.map +1 -0
- package/dist/server/lib/vault-store.js +554 -0
- package/dist/server/lib/vault-store.js.map +1 -0
- package/dist/server/lib/workspace-resources-store.d.ts +165 -0
- package/dist/server/lib/workspace-resources-store.d.ts.map +1 -0
- package/dist/server/lib/workspace-resources-store.js +310 -0
- package/dist/server/lib/workspace-resources-store.js.map +1 -0
- package/dist/server/plugins/agent-chat.d.ts +3 -0
- package/dist/server/plugins/agent-chat.d.ts.map +1 -0
- package/dist/server/plugins/agent-chat.js +36 -0
- package/dist/server/plugins/agent-chat.js.map +1 -0
- package/dist/server/plugins/auth.d.ts +9 -0
- package/dist/server/plugins/auth.d.ts.map +1 -0
- package/dist/server/plugins/auth.js +30 -0
- package/dist/server/plugins/auth.js.map +1 -0
- package/dist/server/plugins/core-routes.d.ts +3 -0
- package/dist/server/plugins/core-routes.d.ts.map +1 -0
- package/dist/server/plugins/core-routes.js +6 -0
- package/dist/server/plugins/core-routes.js.map +1 -0
- package/dist/server/plugins/db.d.ts +3 -0
- package/dist/server/plugins/db.d.ts.map +1 -0
- package/dist/server/plugins/db.js +6 -0
- package/dist/server/plugins/db.js.map +1 -0
- package/dist/server/plugins/integrations.d.ts +8 -0
- package/dist/server/plugins/integrations.d.ts.map +1 -0
- package/dist/server/plugins/integrations.js +51 -0
- package/dist/server/plugins/integrations.js.map +1 -0
- package/package.json +103 -0
- package/src/actions/approve-dispatch-change.ts +11 -0
- package/src/actions/approve-vault-request.ts +23 -0
- package/src/actions/create-link-token.ts +12 -0
- package/src/actions/create-vault-grant.ts +15 -0
- package/src/actions/create-vault-secret.ts +21 -0
- package/src/actions/create-workspace-resource-grant.ts +15 -0
- package/src/actions/create-workspace-resource.ts +29 -0
- package/src/actions/delete-destination.ts +11 -0
- package/src/actions/delete-vault-secret.ts +12 -0
- package/src/actions/delete-workspace-resource.ts +12 -0
- package/src/actions/deny-vault-request.ts +12 -0
- package/src/actions/get-app-creation-settings.ts +11 -0
- package/src/actions/get-dispatch-settings.ts +10 -0
- package/src/actions/get-workspace-info.ts +11 -0
- package/src/actions/grant-vault-secrets-to-app.ts +20 -0
- package/src/actions/index.ts +102 -0
- package/src/actions/list-connected-agents.ts +103 -0
- package/src/actions/list-destinations.ts +10 -0
- package/src/actions/list-dispatch-approvals.ts +10 -0
- package/src/actions/list-dispatch-audit.ts +12 -0
- package/src/actions/list-dispatch-overview.ts +18 -0
- package/src/actions/list-integrations-catalog.ts +11 -0
- package/src/actions/list-linked-identities.ts +10 -0
- package/src/actions/list-vault-audit.ts +16 -0
- package/src/actions/list-vault-grants.ts +14 -0
- package/src/actions/list-vault-requests.ts +16 -0
- package/src/actions/list-vault-secret-options.ts +20 -0
- package/src/actions/list-vault-secrets.ts +26 -0
- package/src/actions/list-workspace-apps.ts +25 -0
- package/src/actions/list-workspace-resource-grants.ts +14 -0
- package/src/actions/list-workspace-resources.ts +16 -0
- package/src/actions/navigate.ts +55 -0
- package/src/actions/reject-dispatch-change.ts +12 -0
- package/src/actions/request-vault-secret.ts +16 -0
- package/src/actions/revoke-vault-grant.ts +11 -0
- package/src/actions/revoke-workspace-resource-grant.ts +15 -0
- package/src/actions/send-platform-message.ts +96 -0
- package/src/actions/set-app-creation-settings.ts +19 -0
- package/src/actions/set-dispatch-approval-policy.ts +24 -0
- package/src/actions/start-workspace-app-creation.ts +33 -0
- package/src/actions/sync-vault-to-app.ts +14 -0
- package/src/actions/sync-workspace-resources-to-all.ts +10 -0
- package/src/actions/sync-workspace-resources-to-app.ts +12 -0
- package/src/actions/update-vault-secret.ts +12 -0
- package/src/actions/update-workspace-resource.ts +19 -0
- package/src/actions/upsert-destination.ts +29 -0
- package/src/actions/view-screen.ts +78 -0
- package/src/components/agents-panel.tsx +262 -0
- package/src/components/app-keys-popover.tsx +231 -0
- package/src/components/create-app-popover.tsx +423 -0
- package/src/components/dispatch-shell.tsx +53 -0
- package/src/components/index.ts +11 -0
- package/src/components/layout/Header.tsx +69 -0
- package/src/components/layout/HeaderActions.tsx +84 -0
- package/src/components/layout/Layout.tsx +243 -0
- package/src/components/messaging-setup-panel.tsx +666 -0
- package/src/components/ui/accordion.tsx +56 -0
- package/src/components/ui/alert-dialog.tsx +139 -0
- package/src/components/ui/alert.tsx +59 -0
- package/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/components/ui/avatar.tsx +48 -0
- package/src/components/ui/badge.tsx +37 -0
- package/src/components/ui/breadcrumb.tsx +115 -0
- package/src/components/ui/button.tsx +57 -0
- package/src/components/ui/calendar.tsx +68 -0
- package/src/components/ui/card.tsx +86 -0
- package/src/components/ui/carousel.tsx +260 -0
- package/src/components/ui/chart.tsx +375 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/command.tsx +154 -0
- package/src/components/ui/context-menu.tsx +198 -0
- package/src/components/ui/dialog.tsx +120 -0
- package/src/components/ui/drawer.tsx +116 -0
- package/src/components/ui/dropdown-menu.tsx +198 -0
- package/src/components/ui/form.tsx +177 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input-otp.tsx +69 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +235 -0
- package/src/components/ui/navigation-menu.tsx +128 -0
- package/src/components/ui/pagination.tsx +121 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +26 -0
- package/src/components/ui/radio-group.tsx +42 -0
- package/src/components/ui/resizable.tsx +43 -0
- package/src/components/ui/scroll-area.tsx +46 -0
- package/src/components/ui/select.tsx +158 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +778 -0
- package/src/components/ui/skeleton.tsx +15 -0
- package/src/components/ui/slider.tsx +26 -0
- package/src/components/ui/sonner.tsx +58 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +23 -0
- package/src/components/ui/toast.tsx +127 -0
- package/src/components/ui/toaster.tsx +33 -0
- package/src/components/ui/toggle-group.tsx +59 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/components/ui/use-toast.ts +3 -0
- package/src/config.ts +35 -0
- package/src/db/index.ts +12 -0
- package/src/db/migrations.ts +165 -0
- package/src/db/schema.ts +160 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-navigation-state.ts +132 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +19 -0
- package/src/lib/utils.ts +1 -0
- package/src/routes/index.ts +51 -0
- package/src/routes/pages/_index.tsx +51 -0
- package/src/routes/pages/agents.tsx +23 -0
- package/src/routes/pages/approval.tsx +243 -0
- package/src/routes/pages/approvals.tsx +157 -0
- package/src/routes/pages/apps.$appId.tsx +134 -0
- package/src/routes/pages/apps.tsx +163 -0
- package/src/routes/pages/audit.tsx +41 -0
- package/src/routes/pages/destinations.tsx +253 -0
- package/src/routes/pages/identities.tsx +91 -0
- package/src/routes/pages/integrations.tsx +278 -0
- package/src/routes/pages/messaging.tsx +17 -0
- package/src/routes/pages/new-app.tsx +17 -0
- package/src/routes/pages/overview.tsx +792 -0
- package/src/routes/pages/team.tsx +23 -0
- package/src/routes/pages/tools.$id.tsx +5 -0
- package/src/routes/pages/tools._index.tsx +5 -0
- package/src/routes/pages/vault.tsx +617 -0
- package/src/routes/pages/workspace.tsx +598 -0
- package/src/server/index.ts +78 -0
- package/src/server/lib/app-creation-store.ts +996 -0
- package/src/server/lib/dispatch-integrations.ts +125 -0
- package/src/server/lib/dispatch-store.ts +889 -0
- package/src/server/lib/env-config.ts +44 -0
- package/src/server/lib/pre-auth-routing.ts +150 -0
- package/src/server/lib/vault-store.ts +811 -0
- package/src/server/lib/workspace-resources-store.ts +445 -0
- package/src/server/plugins/agent-chat.ts +36 -0
- package/src/server/plugins/auth.ts +34 -0
- package/src/server/plugins/core-routes.ts +6 -0
- package/src/server/plugins/db.ts +6 -0
- package/src/server/plugins/integrations.ts +59 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import { and, desc, eq, isNull, or } from "drizzle-orm";
|
|
3
|
+
import { discoverAgents } from "@agent-native/core/server/agent-discovery";
|
|
4
|
+
import { getDb, schema } from "../../db/index.js";
|
|
5
|
+
import {
|
|
6
|
+
currentOwnerEmail,
|
|
7
|
+
currentOrgId,
|
|
8
|
+
recordAudit,
|
|
9
|
+
} from "./dispatch-store.js";
|
|
10
|
+
import { recordVaultAudit } from "./vault-store.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Caller-supplied access context for workspace-resource operations.
|
|
14
|
+
* Same shape and semantics as VaultCtx — looking up a row by id alone is
|
|
15
|
+
* unsafe because UUIDs are not authorization. A row matches the ctx if
|
|
16
|
+
* either the caller owns it or it lives in the caller's active org.
|
|
17
|
+
*/
|
|
18
|
+
export interface WorkspaceResourceCtx {
|
|
19
|
+
ownerEmail: string;
|
|
20
|
+
orgId: string | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function requireWorkspaceResourceCtx(): WorkspaceResourceCtx {
|
|
24
|
+
const ownerEmail = currentOwnerEmail();
|
|
25
|
+
return { ownerEmail, orgId: currentOrgId() };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** WHERE clause that limits a workspace-resource row to the caller's scope. */
|
|
29
|
+
function ctxScope<T extends { ownerEmail: any; orgId: any }>(
|
|
30
|
+
table: T,
|
|
31
|
+
ctx: WorkspaceResourceCtx,
|
|
32
|
+
) {
|
|
33
|
+
if (!ctx.orgId) {
|
|
34
|
+
return and(eq(table.ownerEmail, ctx.ownerEmail), isNull(table.orgId));
|
|
35
|
+
}
|
|
36
|
+
return or(eq(table.ownerEmail, ctx.ownerEmail), eq(table.orgId, ctx.orgId));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function id() {
|
|
40
|
+
return crypto.randomUUID();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function now() {
|
|
44
|
+
return Date.now();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function orgFilter<T extends { ownerEmail: any; orgId: any }>(table: T) {
|
|
48
|
+
const orgId = currentOrgId();
|
|
49
|
+
return and(
|
|
50
|
+
eq(table.ownerEmail, currentOwnerEmail()),
|
|
51
|
+
orgId ? eq(table.orgId, orgId) : isNull(table.orgId),
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ─── Workspace Resources CRUD ──────────────────────────────────
|
|
56
|
+
|
|
57
|
+
export type WorkspaceResourceKind = "skill" | "instruction" | "agent";
|
|
58
|
+
export type WorkspaceResourceScope = "all" | "selected";
|
|
59
|
+
|
|
60
|
+
export interface WorkspaceResourceInput {
|
|
61
|
+
kind: WorkspaceResourceKind;
|
|
62
|
+
name: string;
|
|
63
|
+
description?: string | null;
|
|
64
|
+
path: string;
|
|
65
|
+
content: string;
|
|
66
|
+
scope: WorkspaceResourceScope;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function listWorkspaceResources(filter?: { kind?: string }) {
|
|
70
|
+
const db = getDb();
|
|
71
|
+
const conditions = [orgFilter(schema.workspaceResources)];
|
|
72
|
+
if (filter?.kind) {
|
|
73
|
+
conditions.push(eq(schema.workspaceResources.kind, filter.kind) as any);
|
|
74
|
+
}
|
|
75
|
+
return db
|
|
76
|
+
.select()
|
|
77
|
+
.from(schema.workspaceResources)
|
|
78
|
+
.where(and(...conditions))
|
|
79
|
+
.orderBy(desc(schema.workspaceResources.updatedAt));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export async function getWorkspaceResource(
|
|
83
|
+
resourceId: string,
|
|
84
|
+
ctx: WorkspaceResourceCtx = requireWorkspaceResourceCtx(),
|
|
85
|
+
) {
|
|
86
|
+
const db = getDb();
|
|
87
|
+
const [row] = await db
|
|
88
|
+
.select()
|
|
89
|
+
.from(schema.workspaceResources)
|
|
90
|
+
.where(
|
|
91
|
+
and(
|
|
92
|
+
eq(schema.workspaceResources.id, resourceId),
|
|
93
|
+
ctxScope(schema.workspaceResources, ctx),
|
|
94
|
+
),
|
|
95
|
+
)
|
|
96
|
+
.limit(1);
|
|
97
|
+
return row ?? null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export async function createWorkspaceResource(input: WorkspaceResourceInput) {
|
|
101
|
+
const db = getDb();
|
|
102
|
+
const timestamp = now();
|
|
103
|
+
const resourceId = id();
|
|
104
|
+
const actor = currentOwnerEmail();
|
|
105
|
+
|
|
106
|
+
await db.insert(schema.workspaceResources).values({
|
|
107
|
+
id: resourceId,
|
|
108
|
+
ownerEmail: actor,
|
|
109
|
+
orgId: currentOrgId(),
|
|
110
|
+
kind: input.kind,
|
|
111
|
+
name: input.name,
|
|
112
|
+
description: input.description || null,
|
|
113
|
+
path: input.path,
|
|
114
|
+
content: input.content,
|
|
115
|
+
scope: input.scope,
|
|
116
|
+
createdBy: actor,
|
|
117
|
+
createdAt: timestamp,
|
|
118
|
+
updatedAt: timestamp,
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
await recordAudit({
|
|
122
|
+
action: `workspace.${input.kind}.created`,
|
|
123
|
+
targetType: `workspace-${input.kind}`,
|
|
124
|
+
targetId: resourceId,
|
|
125
|
+
summary: `Created workspace ${input.kind} "${input.name}" (${input.path})`,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return getWorkspaceResource(resourceId);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function updateWorkspaceResource(
|
|
132
|
+
resourceId: string,
|
|
133
|
+
input: Partial<
|
|
134
|
+
Pick<WorkspaceResourceInput, "name" | "description" | "content" | "scope">
|
|
135
|
+
>,
|
|
136
|
+
) {
|
|
137
|
+
const db = getDb();
|
|
138
|
+
const ctx = requireWorkspaceResourceCtx();
|
|
139
|
+
const existing = await getWorkspaceResource(resourceId, ctx);
|
|
140
|
+
if (!existing) throw new Error("Workspace resource not found");
|
|
141
|
+
|
|
142
|
+
const updates: Record<string, unknown> = { updatedAt: now() };
|
|
143
|
+
if (input.name !== undefined) updates.name = input.name;
|
|
144
|
+
if (input.description !== undefined)
|
|
145
|
+
updates.description = input.description || null;
|
|
146
|
+
if (input.content !== undefined) updates.content = input.content;
|
|
147
|
+
if (input.scope !== undefined) updates.scope = input.scope;
|
|
148
|
+
|
|
149
|
+
await db
|
|
150
|
+
.update(schema.workspaceResources)
|
|
151
|
+
.set(updates)
|
|
152
|
+
.where(
|
|
153
|
+
and(
|
|
154
|
+
eq(schema.workspaceResources.id, resourceId),
|
|
155
|
+
ctxScope(schema.workspaceResources, ctx),
|
|
156
|
+
),
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
await recordAudit({
|
|
160
|
+
action: `workspace.${existing.kind}.updated`,
|
|
161
|
+
targetType: `workspace-${existing.kind}`,
|
|
162
|
+
targetId: resourceId,
|
|
163
|
+
summary: `Updated workspace ${existing.kind} "${input.name || existing.name}"`,
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
return getWorkspaceResource(resourceId, ctx);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export async function deleteWorkspaceResource(resourceId: string) {
|
|
170
|
+
const db = getDb();
|
|
171
|
+
const ctx = requireWorkspaceResourceCtx();
|
|
172
|
+
const existing = await getWorkspaceResource(resourceId, ctx);
|
|
173
|
+
if (!existing) throw new Error("Workspace resource not found");
|
|
174
|
+
|
|
175
|
+
// Revoke all grants
|
|
176
|
+
const grants = await listResourceGrants({ resourceId });
|
|
177
|
+
for (const grant of grants) {
|
|
178
|
+
if (grant.status === "active") {
|
|
179
|
+
await revokeResourceGrant(grant.id);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
await db
|
|
184
|
+
.delete(schema.workspaceResources)
|
|
185
|
+
.where(
|
|
186
|
+
and(
|
|
187
|
+
eq(schema.workspaceResources.id, resourceId),
|
|
188
|
+
ctxScope(schema.workspaceResources, ctx),
|
|
189
|
+
),
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
await recordAudit({
|
|
193
|
+
action: `workspace.${existing.kind}.deleted`,
|
|
194
|
+
targetType: `workspace-${existing.kind}`,
|
|
195
|
+
targetId: resourceId,
|
|
196
|
+
summary: `Deleted workspace ${existing.kind} "${existing.name}" (${existing.path})`,
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
return existing;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ─── Grants ──────────────────────────────────────────────────────
|
|
203
|
+
|
|
204
|
+
export async function listResourceGrants(filter?: {
|
|
205
|
+
resourceId?: string;
|
|
206
|
+
appId?: string;
|
|
207
|
+
}) {
|
|
208
|
+
const db = getDb();
|
|
209
|
+
const conditions = [orgFilter(schema.workspaceResourceGrants)];
|
|
210
|
+
if (filter?.resourceId) {
|
|
211
|
+
conditions.push(
|
|
212
|
+
eq(schema.workspaceResourceGrants.resourceId, filter.resourceId) as any,
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
if (filter?.appId) {
|
|
216
|
+
conditions.push(
|
|
217
|
+
eq(schema.workspaceResourceGrants.appId, filter.appId) as any,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return db
|
|
221
|
+
.select()
|
|
222
|
+
.from(schema.workspaceResourceGrants)
|
|
223
|
+
.where(and(...conditions))
|
|
224
|
+
.orderBy(desc(schema.workspaceResourceGrants.updatedAt));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export async function getResourceGrant(
|
|
228
|
+
grantId: string,
|
|
229
|
+
ctx: WorkspaceResourceCtx = requireWorkspaceResourceCtx(),
|
|
230
|
+
) {
|
|
231
|
+
const db = getDb();
|
|
232
|
+
const [row] = await db
|
|
233
|
+
.select()
|
|
234
|
+
.from(schema.workspaceResourceGrants)
|
|
235
|
+
.where(
|
|
236
|
+
and(
|
|
237
|
+
eq(schema.workspaceResourceGrants.id, grantId),
|
|
238
|
+
ctxScope(schema.workspaceResourceGrants, ctx),
|
|
239
|
+
),
|
|
240
|
+
)
|
|
241
|
+
.limit(1);
|
|
242
|
+
return row ?? null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export async function createResourceGrant(resourceId: string, appId: string) {
|
|
246
|
+
const db = getDb();
|
|
247
|
+
const ctx = requireWorkspaceResourceCtx();
|
|
248
|
+
const resource = await getWorkspaceResource(resourceId, ctx);
|
|
249
|
+
if (!resource) throw new Error("Workspace resource not found");
|
|
250
|
+
|
|
251
|
+
const timestamp = now();
|
|
252
|
+
const grantId = id();
|
|
253
|
+
const actor = currentOwnerEmail();
|
|
254
|
+
|
|
255
|
+
await db.insert(schema.workspaceResourceGrants).values({
|
|
256
|
+
id: grantId,
|
|
257
|
+
ownerEmail: actor,
|
|
258
|
+
orgId: currentOrgId(),
|
|
259
|
+
resourceId,
|
|
260
|
+
appId,
|
|
261
|
+
status: "active",
|
|
262
|
+
syncedAt: null,
|
|
263
|
+
createdAt: timestamp,
|
|
264
|
+
updatedAt: timestamp,
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
await recordAudit({
|
|
268
|
+
action: `workspace.${resource.kind}.granted`,
|
|
269
|
+
targetType: `workspace-${resource.kind}-grant`,
|
|
270
|
+
targetId: grantId,
|
|
271
|
+
summary: `Granted workspace ${resource.kind} "${resource.name}" to ${appId}`,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
return getResourceGrant(grantId);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export async function revokeResourceGrant(
|
|
278
|
+
grantId: string,
|
|
279
|
+
ctx: WorkspaceResourceCtx = requireWorkspaceResourceCtx(),
|
|
280
|
+
) {
|
|
281
|
+
const db = getDb();
|
|
282
|
+
const grant = await getResourceGrant(grantId, ctx);
|
|
283
|
+
if (!grant) throw new Error("Grant not found");
|
|
284
|
+
|
|
285
|
+
const resource = await getWorkspaceResource(grant.resourceId);
|
|
286
|
+
|
|
287
|
+
await db
|
|
288
|
+
.update(schema.workspaceResourceGrants)
|
|
289
|
+
.set({ status: "revoked", updatedAt: now() })
|
|
290
|
+
.where(
|
|
291
|
+
and(
|
|
292
|
+
eq(schema.workspaceResourceGrants.id, grantId),
|
|
293
|
+
ctxScope(schema.workspaceResourceGrants, ctx),
|
|
294
|
+
),
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
await recordAudit({
|
|
298
|
+
action: `workspace.${resource?.kind || "resource"}.grant-revoked`,
|
|
299
|
+
targetType: "workspace-resource-grant",
|
|
300
|
+
targetId: grantId,
|
|
301
|
+
summary: `Revoked workspace ${resource?.kind || "resource"} "${resource?.name || grant.resourceId}" from ${grant.appId}`,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
return getResourceGrant(grantId, ctx);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// ─── Sync ──────────────────────────────────────────────────────
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Push workspace resources to an app via its /_agent-native/resources endpoint.
|
|
311
|
+
* Resources with scope="all" are always pushed. Resources with scope="selected"
|
|
312
|
+
* are only pushed if there's an active grant for that app.
|
|
313
|
+
*/
|
|
314
|
+
export async function syncResourcesToApp(appId: string) {
|
|
315
|
+
const agents = await discoverAgents("dispatch");
|
|
316
|
+
const agent = agents.find((a) => a.id === appId);
|
|
317
|
+
if (!agent) throw new Error(`App "${appId}" not found in agent registry`);
|
|
318
|
+
|
|
319
|
+
const allResources = await listWorkspaceResources();
|
|
320
|
+
const grants = await listResourceGrants({ appId });
|
|
321
|
+
const activeGrantResourceIds = new Set(
|
|
322
|
+
grants.filter((g) => g.status === "active").map((g) => g.resourceId),
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
// Determine which resources to push
|
|
326
|
+
const toPush = allResources.filter(
|
|
327
|
+
(r) =>
|
|
328
|
+
r.scope === "all" ||
|
|
329
|
+
(r.scope === "selected" && activeGrantResourceIds.has(r.id)),
|
|
330
|
+
);
|
|
331
|
+
|
|
332
|
+
if (toPush.length === 0) {
|
|
333
|
+
return { appId, synced: 0, resources: [] };
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const syncedPaths: string[] = [];
|
|
337
|
+
const db = getDb();
|
|
338
|
+
const timestamp = now();
|
|
339
|
+
|
|
340
|
+
for (const resource of toPush) {
|
|
341
|
+
try {
|
|
342
|
+
// Push via the resources API — create as shared resource
|
|
343
|
+
const res = await fetch(`${agent.url}/_agent-native/resources`, {
|
|
344
|
+
method: "POST",
|
|
345
|
+
headers: { "Content-Type": "application/json" },
|
|
346
|
+
body: JSON.stringify({
|
|
347
|
+
path: resource.path,
|
|
348
|
+
content: resource.content,
|
|
349
|
+
shared: true,
|
|
350
|
+
mimeType: "text/markdown",
|
|
351
|
+
}),
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
if (res.ok || res.status === 409) {
|
|
355
|
+
// 409 = already exists, try updating
|
|
356
|
+
if (res.status === 409) {
|
|
357
|
+
// Fetch existing to get ID, then update
|
|
358
|
+
const listRes = await fetch(
|
|
359
|
+
`${agent.url}/_agent-native/resources?scope=shared&path=${encodeURIComponent(resource.path)}`,
|
|
360
|
+
);
|
|
361
|
+
if (listRes.ok) {
|
|
362
|
+
const items = await listRes.json();
|
|
363
|
+
const existing = Array.isArray(items)
|
|
364
|
+
? items.find((i: any) => i.path === resource.path)
|
|
365
|
+
: null;
|
|
366
|
+
if (existing) {
|
|
367
|
+
await fetch(
|
|
368
|
+
`${agent.url}/_agent-native/resources/${existing.id}`,
|
|
369
|
+
{
|
|
370
|
+
method: "PUT",
|
|
371
|
+
headers: { "Content-Type": "application/json" },
|
|
372
|
+
body: JSON.stringify({ content: resource.content }),
|
|
373
|
+
},
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
syncedPaths.push(resource.path);
|
|
379
|
+
|
|
380
|
+
// Update grant syncedAt if applicable
|
|
381
|
+
const grant = grants.find(
|
|
382
|
+
(g) => g.resourceId === resource.id && g.status === "active",
|
|
383
|
+
);
|
|
384
|
+
if (grant) {
|
|
385
|
+
await db
|
|
386
|
+
.update(schema.workspaceResourceGrants)
|
|
387
|
+
.set({ syncedAt: timestamp, updatedAt: timestamp })
|
|
388
|
+
.where(eq(schema.workspaceResourceGrants.id, grant.id));
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
} catch {
|
|
392
|
+
// Skip unreachable — don't fail the whole sync
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
await recordAudit({
|
|
397
|
+
action: "workspace.resources.synced",
|
|
398
|
+
targetType: "workspace-resource-sync",
|
|
399
|
+
targetId: appId,
|
|
400
|
+
summary: `Synced ${syncedPaths.length} workspace resource(s) to ${appId}: ${syncedPaths.join(", ")}`,
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
return { appId, synced: syncedPaths.length, resources: syncedPaths };
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Sync all workspace resources to all apps that have grants or scope="all" resources.
|
|
408
|
+
*/
|
|
409
|
+
export async function syncResourcesToAllApps() {
|
|
410
|
+
const agents = await discoverAgents("dispatch");
|
|
411
|
+
const results: Array<{ appId: string; synced: number }> = [];
|
|
412
|
+
|
|
413
|
+
for (const agent of agents) {
|
|
414
|
+
try {
|
|
415
|
+
const result = await syncResourcesToApp(agent.id);
|
|
416
|
+
results.push({ appId: result.appId, synced: result.synced });
|
|
417
|
+
} catch {
|
|
418
|
+
results.push({ appId: agent.id, synced: 0 });
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return results;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// ─── Overview ──────────────────────────────────────────────────────
|
|
426
|
+
|
|
427
|
+
export async function listWorkspaceResourcesOverview() {
|
|
428
|
+
const [resources, grants] = await Promise.all([
|
|
429
|
+
listWorkspaceResources(),
|
|
430
|
+
listResourceGrants(),
|
|
431
|
+
]);
|
|
432
|
+
|
|
433
|
+
const skills = resources.filter((r) => r.kind === "skill");
|
|
434
|
+
const instructions = resources.filter((r) => r.kind === "instruction");
|
|
435
|
+
const agents = resources.filter((r) => r.kind === "agent");
|
|
436
|
+
const activeGrants = grants.filter((g) => g.status === "active");
|
|
437
|
+
|
|
438
|
+
return {
|
|
439
|
+
skillCount: skills.length,
|
|
440
|
+
instructionCount: instructions.length,
|
|
441
|
+
agentCount: agents.length,
|
|
442
|
+
totalResources: resources.length,
|
|
443
|
+
activeGrantCount: activeGrants.length,
|
|
444
|
+
};
|
|
445
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createAgentChatPlugin } from "@agent-native/core/server";
|
|
2
|
+
import { getOrgContext } from "@agent-native/core/org";
|
|
3
|
+
import { dispatchActions } from "../../actions/index.js";
|
|
4
|
+
|
|
5
|
+
export default createAgentChatPlugin({
|
|
6
|
+
appId: "dispatch",
|
|
7
|
+
// Without this, AGENT_ORG_ID is never set on agent action calls and every
|
|
8
|
+
// row written through the frontend (vault secrets, destinations, workspace
|
|
9
|
+
// resources) lands with org_id=NULL — breaking data isolation across orgs.
|
|
10
|
+
resolveOrgId: async (event) => {
|
|
11
|
+
const ctx = await getOrgContext(event);
|
|
12
|
+
return ctx.orgId;
|
|
13
|
+
},
|
|
14
|
+
// Read actions directly from the package's own action map rather than from
|
|
15
|
+
// a build-time-generated `.generated/actions-registry.ts` (the latter is a
|
|
16
|
+
// template-only construct that the Vite plugin emits next to actions/).
|
|
17
|
+
actions: dispatchActions,
|
|
18
|
+
systemPrompt: `You are the central dispatch for this workspace.
|
|
19
|
+
|
|
20
|
+
Default posture:
|
|
21
|
+
- Treat Slack and Telegram as shared entrypoints into the workspace.
|
|
22
|
+
- Heavily delegate domain work to specialized agents through A2A when another app owns the job.
|
|
23
|
+
- Keep durable memory and operating instructions in resources rather than ephemeral chat.
|
|
24
|
+
- Prefer replying in the current external thread unless the user explicitly asks you to send to a saved destination.
|
|
25
|
+
|
|
26
|
+
Use the standard workspace primitives:
|
|
27
|
+
- Read and update resources like AGENTS.md, LEARNINGS.md, jobs/*.md, agents/*.md, and remote-agents/*.json when appropriate.
|
|
28
|
+
- Use recurring jobs for scheduled behavior.
|
|
29
|
+
- Use custom agent profiles in agents/*.md for local spawned work and remote-agents/*.json for remote A2A apps.
|
|
30
|
+
- When answering whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. If you have not requested that probe, absence of agent-card fields means unchecked, not unavailable.
|
|
31
|
+
|
|
32
|
+
When a user asks for something like a digest, reminder, routing rule, or saved behavior:
|
|
33
|
+
- First decide whether it should be a resource, a recurring job, a destination, or a delegated task.
|
|
34
|
+
- Keep responses concise and operational.
|
|
35
|
+
- Avoid inventing integrations or destinations that are not configured yet.`,
|
|
36
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createAuthPlugin } from "@agent-native/core/server";
|
|
2
|
+
import { getDispatchConfig } from "../index.js";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_MARKETING = {
|
|
5
|
+
appName: "Agent-Native Dispatch",
|
|
6
|
+
tagline:
|
|
7
|
+
"Your AI agent manages secrets, orchestrates other agents, and routes messages across your workspace.",
|
|
8
|
+
features: [
|
|
9
|
+
"Centralized vault for secrets with granular per-app grants",
|
|
10
|
+
"Cross-agent orchestration and delegation to specialist apps",
|
|
11
|
+
"Slack and Telegram routing with approval workflows",
|
|
12
|
+
],
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Defer config + plugin construction until the Nitro plugin actually fires.
|
|
17
|
+
* This way `setupDispatch(config)` can run after plugin module-load order
|
|
18
|
+
* (Nitro doesn't guarantee load order across plugin files) and still feed
|
|
19
|
+
* `googleOnly` / `marketing` into `createAuthPlugin`.
|
|
20
|
+
*/
|
|
21
|
+
const dispatchAuthPlugin = async (nitroApp: any) => {
|
|
22
|
+
const { auth: authConfig = {} } = getDispatchConfig();
|
|
23
|
+
const googleOnly = authConfig.googleOnly ?? false;
|
|
24
|
+
const marketing =
|
|
25
|
+
(authConfig.marketing as Record<string, unknown> | undefined) ??
|
|
26
|
+
DEFAULT_MARKETING;
|
|
27
|
+
const plugin = createAuthPlugin({
|
|
28
|
+
googleOnly,
|
|
29
|
+
marketing: marketing as any,
|
|
30
|
+
});
|
|
31
|
+
return plugin(nitroApp);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default dispatchAuthPlugin;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createIntegrationsPlugin } from "@agent-native/core/server";
|
|
2
|
+
import {
|
|
3
|
+
beforeDispatchProcess,
|
|
4
|
+
resolveDispatchOwner,
|
|
5
|
+
} from "../lib/dispatch-integrations.js";
|
|
6
|
+
import { getDispatchConfig } from "../index.js";
|
|
7
|
+
import { dispatchActions } from "../../actions/index.js";
|
|
8
|
+
|
|
9
|
+
const DISPATCH_INTEGRATION_SYSTEM_PROMPT = `You are the central dispatch for this workspace, responding via a messaging platform integration (Slack, Telegram, email, etc.).
|
|
10
|
+
|
|
11
|
+
Default posture:
|
|
12
|
+
- Treat Slack, Telegram, and email as shared entrypoints into the workspace.
|
|
13
|
+
- Heavily delegate domain work to specialized agents through A2A (call-agent) when another app owns the job. Apps you can delegate to include slides (decks/presentations), analytics (data/dashboards), content (docs/articles), videos (Remotion compositions), forms (form builder), clips (screen recordings), and design (visual designs).
|
|
14
|
+
- Use list-connected-agents to see what agents are available before assuming a request must be handled locally.
|
|
15
|
+
- When asked whether workspace apps expose agent cards or A2A endpoints, call list-workspace-apps with includeAgentCards=true. Without that probe, missing agent-card fields mean unchecked, not unavailable.
|
|
16
|
+
- Keep durable memory and operating instructions in resources rather than ephemeral chat.
|
|
17
|
+
- Reply in the originating thread unless the user explicitly asks you to send to a saved destination.
|
|
18
|
+
|
|
19
|
+
When a user asks for something:
|
|
20
|
+
- If it belongs to analytics, content, slides, videos, etc., delegate via call-agent — do not re-implement the domain logic in dispatch.
|
|
21
|
+
- After call-agent returns an answer, RELAY IT DIRECTLY to the user with at most a one-line preface — do not rephrase, summarize, or add commentary. The downstream agent already crafted the answer; your job is delivery, not editing. This minimizes round-trips and keeps the user-visible reply fast.
|
|
22
|
+
- Exception: if the downstream agent reports a missing model/provider credential, do not name exact env vars, Vault keys, tokens, or secrets. Say the target app needs an LLM connection and recommend connecting Builder/managed LLM for that app; keep bring-your-own provider keys as a secondary option only if the user asks.
|
|
23
|
+
- If the user asks to create, build, make, scaffold, or generate a new workspace app or agent, call start-workspace-app-creation with their prompt. In this codebase, "agent" and "app" are synonyms — every agent-native app is an agent, so "build me an agent" and "build me an app" mean the same thing. Route both to start-workspace-app-creation. If the request is too vague to produce an app, ask one concise follow-up. If the action returns mode "builder", reply with the Builder branch URL. If it returns mode "local-agent", tell the user it is ready for the local code agent and include the returned app path/prompt summary. If it returns mode "coming-soon" or "builder-unavailable", explain the missing Builder setup and ask them to connect/configure Builder.
|
|
24
|
+
- For digests, reminders, or saved behavior, prefer recurring jobs, resources, or destinations over chat replies.
|
|
25
|
+
- Keep responses concise and operational — messaging platforms have character limits.
|
|
26
|
+
- Use markdown sparingly (bold and lists are fine, avoid complex formatting).
|
|
27
|
+
- If a task requires many steps, summarize what you did rather than streaming every detail.`;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Defer plugin construction until the Nitro plugin actually fires so the
|
|
31
|
+
* config-aware system prompt resolves AFTER `setupDispatch(config)` has
|
|
32
|
+
* stamped the active config (plugin module load order is not guaranteed).
|
|
33
|
+
*/
|
|
34
|
+
const dispatchIntegrationsPlugin = async (nitroApp: any) => {
|
|
35
|
+
const { integrations = {} } = getDispatchConfig();
|
|
36
|
+
const promptOverride = integrations.systemPrompt;
|
|
37
|
+
const systemPrompt =
|
|
38
|
+
typeof promptOverride === "string"
|
|
39
|
+
? promptOverride
|
|
40
|
+
: typeof promptOverride === "function"
|
|
41
|
+
? promptOverride(DISPATCH_INTEGRATION_SYSTEM_PROMPT)
|
|
42
|
+
: DISPATCH_INTEGRATION_SYSTEM_PROMPT;
|
|
43
|
+
|
|
44
|
+
const plugin = createIntegrationsPlugin({
|
|
45
|
+
appId: "dispatch",
|
|
46
|
+
actions: dispatchActions,
|
|
47
|
+
resolveOwner: resolveDispatchOwner,
|
|
48
|
+
beforeProcess: beforeDispatchProcess,
|
|
49
|
+
systemPrompt,
|
|
50
|
+
// Inherit the framework default (claude-sonnet-4-6 from
|
|
51
|
+
// packages/core/src/integrations/plugin.ts). Haiku was tried for latency
|
|
52
|
+
// but hallucinated URLs/IDs after delegated call-agent results
|
|
53
|
+
// (e.g. inventing `https://slides.workspace.com/deck/builder-io-deck-2024`).
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return plugin(nitroApp);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default dispatchIntegrationsPlugin;
|