@agent-native/dispatch 0.0.0-beta-20260819155526
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 +146 -0
- package/dist/actions/apply-dream-proposal.d.ts +29 -0
- package/dist/actions/apply-dream-proposal.d.ts.map +1 -0
- package/dist/actions/apply-dream-proposal.js +11 -0
- package/dist/actions/apply-dream-proposal.js.map +1 -0
- package/dist/actions/approve-dispatch-change.d.ts +22 -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 +20 -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/archive-workspace-app.d.ts +7 -0
- package/dist/actions/archive-workspace-app.d.ts.map +1 -0
- package/dist/actions/archive-workspace-app.js +15 -0
- package/dist/actions/archive-workspace-app.js.map +1 -0
- package/dist/actions/ask_app.d.ts +29 -0
- package/dist/actions/ask_app.d.ts.map +1 -0
- package/dist/actions/ask_app.js +23 -0
- package/dist/actions/ask_app.js.map +1 -0
- package/dist/actions/ask_app_status.d.ts +27 -0
- package/dist/actions/ask_app_status.d.ts.map +1 -0
- package/dist/actions/ask_app_status.js +14 -0
- package/dist/actions/ask_app_status.js.map +1 -0
- package/dist/actions/connect-external-agent.d.ts +18 -0
- package/dist/actions/connect-external-agent.d.ts.map +1 -0
- package/dist/actions/connect-external-agent.js +68 -0
- package/dist/actions/connect-external-agent.js.map +1 -0
- package/dist/actions/create-browser-chat-session.d.ts +15 -0
- package/dist/actions/create-browser-chat-session.d.ts.map +1 -0
- package/dist/actions/create-browser-chat-session.js +75 -0
- package/dist/actions/create-browser-chat-session.js.map +1 -0
- package/dist/actions/create-dream-report.d.ts +59 -0
- package/dist/actions/create-dream-report.d.ts.map +1 -0
- package/dist/actions/create-dream-report.js +67 -0
- package/dist/actions/create-dream-report.js.map +1 -0
- package/dist/actions/create-link-token.d.ts +10 -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-pylon-ticket.d.ts +17 -0
- package/dist/actions/create-pylon-ticket.d.ts.map +1 -0
- package/dist/actions/create-pylon-ticket.js +95 -0
- package/dist/actions/create-pylon-ticket.js.map +1 -0
- package/dist/actions/create-vault-grant.d.ts +17 -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 +21 -0
- package/dist/actions/create-vault-secret.d.ts.map +1 -0
- package/dist/actions/create-vault-secret.js +26 -0
- package/dist/actions/create-vault-secret.js.map +1 -0
- package/dist/actions/create-workspace-resource-grant.d.ts +16 -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 +40 -0
- package/dist/actions/create-workspace-resource.d.ts.map +1 -0
- package/dist/actions/create-workspace-resource.js +29 -0
- package/dist/actions/create-workspace-resource.js.map +1 -0
- package/dist/actions/create_embed_session.d.ts +13 -0
- package/dist/actions/create_embed_session.d.ts.map +1 -0
- package/dist/actions/create_embed_session.js +28 -0
- package/dist/actions/create_embed_session.js.map +1 -0
- package/dist/actions/create_workspace_app_embed_session.d.ts +19 -0
- package/dist/actions/create_workspace_app_embed_session.d.ts.map +1 -0
- package/dist/actions/create_workspace_app_embed_session.js +89 -0
- package/dist/actions/create_workspace_app_embed_session.js.map +1 -0
- package/dist/actions/delete-destination.d.ts +34 -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-staged-dataset.d.ts +10 -0
- package/dist/actions/delete-staged-dataset.d.ts.map +1 -0
- package/dist/actions/delete-staged-dataset.js +8 -0
- package/dist/actions/delete-staged-dataset.js.map +1 -0
- package/dist/actions/delete-vault-secret.d.ts +17 -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 +35 -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 +19 -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/ensure-dream-job.d.ts +33 -0
- package/dist/actions/ensure-dream-job.d.ts.map +1 -0
- package/dist/actions/ensure-dream-job.js +73 -0
- package/dist/actions/ensure-dream-job.js.map +1 -0
- package/dist/actions/get-agent-thread-debug.d.ts +72 -0
- package/dist/actions/get-agent-thread-debug.d.ts.map +1 -0
- package/dist/actions/get-agent-thread-debug.js +37 -0
- package/dist/actions/get-agent-thread-debug.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-dream-settings.d.ts +3 -0
- package/dist/actions/get-dream-settings.d.ts.map +1 -0
- package/dist/actions/get-dream-settings.js +11 -0
- package/dist/actions/get-dream-settings.js.map +1 -0
- package/dist/actions/get-dream.d.ts +48 -0
- package/dist/actions/get-dream.d.ts.map +1 -0
- package/dist/actions/get-dream.js +13 -0
- package/dist/actions/get-dream.js.map +1 -0
- package/dist/actions/get-vault-access-settings.d.ts +3 -0
- package/dist/actions/get-vault-access-settings.d.ts.map +1 -0
- package/dist/actions/get-vault-access-settings.js +10 -0
- package/dist/actions/get-vault-access-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/get-workspace-resource-effective-context.d.ts +8 -0
- package/dist/actions/get-workspace-resource-effective-context.d.ts.map +1 -0
- package/dist/actions/get-workspace-resource-effective-context.js +27 -0
- package/dist/actions/get-workspace-resource-effective-context.js.map +1 -0
- package/dist/actions/grant-vault-secrets-to-app.d.ts +27 -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/grant-workspace-resources-to-app.d.ts +17 -0
- package/dist/actions/grant-workspace-resources-to-app.d.ts.map +1 -0
- package/dist/actions/grant-workspace-resources-to-app.js +15 -0
- package/dist/actions/grant-workspace-resources-to-app.js.map +1 -0
- package/dist/actions/import-agent-pack.d.ts +96 -0
- package/dist/actions/import-agent-pack.d.ts.map +1 -0
- package/dist/actions/import-agent-pack.js +116 -0
- package/dist/actions/import-agent-pack.js.map +1 -0
- package/dist/actions/import-agent.d.ts +60 -0
- package/dist/actions/import-agent.d.ts.map +1 -0
- package/dist/actions/import-agent.js +82 -0
- package/dist/actions/import-agent.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 +207 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/list-agent-pack.d.ts +36 -0
- package/dist/actions/list-agent-pack.d.ts.map +1 -0
- package/dist/actions/list-agent-pack.js +32 -0
- package/dist/actions/list-agent-pack.js.map +1 -0
- package/dist/actions/list-agent-run-failures.d.ts +65 -0
- package/dist/actions/list-agent-run-failures.d.ts.map +1 -0
- package/dist/actions/list-agent-run-failures.js +42 -0
- package/dist/actions/list-agent-run-failures.js.map +1 -0
- package/dist/actions/list-agent-thread-sources.d.ts +9 -0
- package/dist/actions/list-agent-thread-sources.d.ts.map +1 -0
- package/dist/actions/list-agent-thread-sources.js +11 -0
- package/dist/actions/list-agent-thread-sources.js.map +1 -0
- package/dist/actions/list-available-workspace-templates.d.ts +3 -0
- package/dist/actions/list-available-workspace-templates.d.ts.map +1 -0
- package/dist/actions/list-available-workspace-templates.js +10 -0
- package/dist/actions/list-available-workspace-templates.js.map +1 -0
- package/dist/actions/list-connected-agents.d.ts +14 -0
- package/dist/actions/list-connected-agents.d.ts.map +1 -0
- package/dist/actions/list-connected-agents.js +87 -0
- package/dist/actions/list-connected-agents.js.map +1 -0
- package/dist/actions/list-curated-workspace-templates.d.ts +3 -0
- package/dist/actions/list-curated-workspace-templates.d.ts.map +1 -0
- package/dist/actions/list-curated-workspace-templates.js +10 -0
- package/dist/actions/list-curated-workspace-templates.js.map +1 -0
- package/dist/actions/list-destinations.d.ts +15 -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 +20 -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 +16 -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 +61 -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-dispatch-usage-metrics.d.ts +7 -0
- package/dist/actions/list-dispatch-usage-metrics.d.ts.map +1 -0
- package/dist/actions/list-dispatch-usage-metrics.js +28 -0
- package/dist/actions/list-dispatch-usage-metrics.js.map +1 -0
- package/dist/actions/list-dream-candidates.d.ts +24 -0
- package/dist/actions/list-dream-candidates.d.ts.map +1 -0
- package/dist/actions/list-dream-candidates.js +68 -0
- package/dist/actions/list-dream-candidates.js.map +1 -0
- package/dist/actions/list-dreams.d.ts +29 -0
- package/dist/actions/list-dreams.d.ts.map +1 -0
- package/dist/actions/list-dreams.js +17 -0
- package/dist/actions/list-dreams.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 +29 -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-mcp-app-access.d.ts +14 -0
- package/dist/actions/list-mcp-app-access.d.ts.map +1 -0
- package/dist/actions/list-mcp-app-access.js +25 -0
- package/dist/actions/list-mcp-app-access.js.map +1 -0
- package/dist/actions/list-staged-datasets.d.ts +13 -0
- package/dist/actions/list-staged-datasets.d.ts.map +1 -0
- package/dist/actions/list-staged-datasets.js +8 -0
- package/dist/actions/list-staged-datasets.js.map +1 -0
- package/dist/actions/list-vault-audit.d.ts +16 -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 +17 -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 +18 -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 +9 -0
- package/dist/actions/list-vault-secret-options.d.ts.map +1 -0
- package/dist/actions/list-vault-secret-options.js +12 -0
- package/dist/actions/list-vault-secret-options.js.map +1 -0
- package/dist/actions/list-vault-secrets.d.ts +13 -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 +7 -0
- package/dist/actions/list-workspace-apps.d.ts.map +1 -0
- package/dist/actions/list-workspace-apps.js +31 -0
- package/dist/actions/list-workspace-apps.js.map +1 -0
- package/dist/actions/list-workspace-resource-grants.d.ts +16 -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-resource-options.d.ts +5 -0
- package/dist/actions/list-workspace-resource-options.d.ts.map +1 -0
- package/dist/actions/list-workspace-resource-options.js +22 -0
- package/dist/actions/list-workspace-resource-options.js.map +1 -0
- package/dist/actions/list-workspace-resources-for-app.d.ts +15 -0
- package/dist/actions/list-workspace-resources-for-app.d.ts.map +1 -0
- package/dist/actions/list-workspace-resources-for-app.js +12 -0
- package/dist/actions/list-workspace-resources-for-app.js.map +1 -0
- package/dist/actions/list-workspace-resources.d.ts +18 -0
- package/dist/actions/list-workspace-resources.d.ts.map +1 -0
- package/dist/actions/list-workspace-resources.js +22 -0
- package/dist/actions/list-workspace-resources.js.map +1 -0
- package/dist/actions/list_apps.d.ts +15 -0
- package/dist/actions/list_apps.d.ts.map +1 -0
- package/dist/actions/list_apps.js +34 -0
- package/dist/actions/list_apps.js.map +1 -0
- package/dist/actions/navigate.d.ts +23 -0
- package/dist/actions/navigate.d.ts.map +1 -0
- package/dist/actions/navigate.js +53 -0
- package/dist/actions/navigate.js.map +1 -0
- package/dist/actions/open_app.d.ts +20 -0
- package/dist/actions/open_app.d.ts.map +1 -0
- package/dist/actions/open_app.js +123 -0
- package/dist/actions/open_app.js.map +1 -0
- package/dist/actions/preview-dream-proposal.d.ts +43 -0
- package/dist/actions/preview-dream-proposal.d.ts.map +1 -0
- package/dist/actions/preview-dream-proposal.js +13 -0
- package/dist/actions/preview-dream-proposal.js.map +1 -0
- package/dist/actions/preview-workspace-resource-change.d.ts +8 -0
- package/dist/actions/preview-workspace-resource-change.d.ts.map +1 -0
- package/dist/actions/preview-workspace-resource-change.js +24 -0
- package/dist/actions/preview-workspace-resource-change.js.map +1 -0
- package/dist/actions/provider-api-catalog.d.ts +28 -0
- package/dist/actions/provider-api-catalog.d.ts.map +1 -0
- package/dist/actions/provider-api-catalog.js +8 -0
- package/dist/actions/provider-api-catalog.js.map +1 -0
- package/dist/actions/provider-api-docs.d.ts +41 -0
- package/dist/actions/provider-api-docs.d.ts.map +1 -0
- package/dist/actions/provider-api-docs.js +12 -0
- package/dist/actions/provider-api-docs.js.map +1 -0
- package/dist/actions/provider-api-register.d.ts +109 -0
- package/dist/actions/provider-api-register.d.ts.map +1 -0
- package/dist/actions/provider-api-register.js +33 -0
- package/dist/actions/provider-api-register.js.map +1 -0
- package/dist/actions/provider-api-request.d.ts +67 -0
- package/dist/actions/provider-api-request.d.ts.map +1 -0
- package/dist/actions/provider-api-request.js +13 -0
- package/dist/actions/provider-api-request.js.map +1 -0
- package/dist/actions/query-staged-dataset.d.ts +45 -0
- package/dist/actions/query-staged-dataset.d.ts.map +1 -0
- package/dist/actions/query-staged-dataset.js +8 -0
- package/dist/actions/query-staged-dataset.js.map +1 -0
- package/dist/actions/read-slack-thread-context.d.ts +29 -0
- package/dist/actions/read-slack-thread-context.d.ts.map +1 -0
- package/dist/actions/read-slack-thread-context.js +138 -0
- package/dist/actions/read-slack-thread-context.js.map +1 -0
- package/dist/actions/reject-dispatch-change.d.ts +23 -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/reject-dream-proposal.d.ts +27 -0
- package/dist/actions/reject-dream-proposal.d.ts.map +1 -0
- package/dist/actions/reject-dream-proposal.js +12 -0
- package/dist/actions/reject-dream-proposal.js.map +1 -0
- package/dist/actions/remix-workspace-template.d.ts +48 -0
- package/dist/actions/remix-workspace-template.d.ts.map +1 -0
- package/dist/actions/remix-workspace-template.js +79 -0
- package/dist/actions/remix-workspace-template.js.map +1 -0
- package/dist/actions/remove-pending-workspace-app.d.ts +7 -0
- package/dist/actions/remove-pending-workspace-app.d.ts.map +1 -0
- package/dist/actions/remove-pending-workspace-app.js +15 -0
- package/dist/actions/remove-pending-workspace-app.js.map +1 -0
- package/dist/actions/request-vault-secret.d.ts +20 -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/resolve-integration-source-context.d.ts +5 -0
- package/dist/actions/resolve-integration-source-context.d.ts.map +1 -0
- package/dist/actions/resolve-integration-source-context.js +30 -0
- package/dist/actions/resolve-integration-source-context.js.map +1 -0
- package/dist/actions/restore-starter-workspace-resources.d.ts +9 -0
- package/dist/actions/restore-starter-workspace-resources.d.ts.map +1 -0
- package/dist/actions/restore-starter-workspace-resources.js +14 -0
- package/dist/actions/restore-starter-workspace-resources.js.map +1 -0
- package/dist/actions/revoke-vault-grant.d.ts +16 -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 +15 -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/scaffold-workspace-app.d.ts +10 -0
- package/dist/actions/scaffold-workspace-app.d.ts.map +1 -0
- package/dist/actions/scaffold-workspace-app.js +41 -0
- package/dist/actions/scaffold-workspace-app.js.map +1 -0
- package/dist/actions/search-agent-threads.d.ts +32 -0
- package/dist/actions/search-agent-threads.d.ts.map +1 -0
- package/dist/actions/search-agent-threads.js +25 -0
- package/dist/actions/search-agent-threads.js.map +1 -0
- package/dist/actions/send-code-agent-remote-command.d.ts +34 -0
- package/dist/actions/send-code-agent-remote-command.d.ts.map +1 -0
- package/dist/actions/send-code-agent-remote-command.js +53 -0
- package/dist/actions/send-code-agent-remote-command.js.map +1 -0
- package/dist/actions/send-platform-message.d.ts +15 -0
- package/dist/actions/send-platform-message.d.ts.map +1 -0
- package/dist/actions/send-platform-message.js +96 -0
- package/dist/actions/send-platform-message.js.map +1 -0
- package/dist/actions/set-app-creation-settings.d.ts +5 -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 +23 -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/set-dream-settings.d.ts +17 -0
- package/dist/actions/set-dream-settings.d.ts.map +1 -0
- package/dist/actions/set-dream-settings.js +41 -0
- package/dist/actions/set-dream-settings.js.map +1 -0
- package/dist/actions/set-mcp-app-access.d.ts +17 -0
- package/dist/actions/set-mcp-app-access.d.ts.map +1 -0
- package/dist/actions/set-mcp-app-access.js +43 -0
- package/dist/actions/set-mcp-app-access.js.map +1 -0
- package/dist/actions/set-vault-access-settings.d.ts +5 -0
- package/dist/actions/set-vault-access-settings.d.ts.map +1 -0
- package/dist/actions/set-vault-access-settings.js +13 -0
- package/dist/actions/set-vault-access-settings.js.map +1 -0
- package/dist/actions/start-workspace-app-creation.d.ts +10 -0
- package/dist/actions/start-workspace-app-creation.d.ts.map +1 -0
- package/dist/actions/start-workspace-app-creation.js +43 -0
- package/dist/actions/start-workspace-app-creation.js.map +1 -0
- package/dist/actions/sync-vault-to-app.d.ts +32 -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/unarchive-workspace-app.d.ts +7 -0
- package/dist/actions/unarchive-workspace-app.d.ts.map +1 -0
- package/dist/actions/unarchive-workspace-app.js +15 -0
- package/dist/actions/unarchive-workspace-app.js.map +1 -0
- package/dist/actions/update-vault-secret.d.ts +22 -0
- package/dist/actions/update-vault-secret.d.ts.map +1 -0
- package/dist/actions/update-vault-secret.js +43 -0
- package/dist/actions/update-vault-secret.js.map +1 -0
- package/dist/actions/update-workspace-app-metadata.d.ts +7 -0
- package/dist/actions/update-workspace-app-metadata.d.ts.map +1 -0
- package/dist/actions/update-workspace-app-metadata.js +30 -0
- package/dist/actions/update-workspace-app-metadata.js.map +1 -0
- package/dist/actions/update-workspace-resource.d.ts +39 -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 +39 -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 +332 -0
- package/dist/actions/view-screen.js.map +1 -0
- package/dist/client/transactional-emails.d.ts +57 -0
- package/dist/client/transactional-emails.d.ts.map +1 -0
- package/dist/client/transactional-emails.js +116 -0
- package/dist/client/transactional-emails.js.map +1 -0
- package/dist/components/action-query-error.d.ts +8 -0
- package/dist/components/action-query-error.d.ts.map +1 -0
- package/dist/components/action-query-error.js +10 -0
- package/dist/components/action-query-error.js.map +1 -0
- package/dist/components/admin-navigation.d.ts +16 -0
- package/dist/components/admin-navigation.d.ts.map +1 -0
- package/dist/components/admin-navigation.js +193 -0
- package/dist/components/admin-navigation.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 +133 -0
- package/dist/components/agents-panel.js.map +1 -0
- package/dist/components/app-icon.d.ts +10 -0
- package/dist/components/app-icon.d.ts.map +1 -0
- package/dist/components/app-icon.js +107 -0
- package/dist/components/app-icon.js.map +1 -0
- package/dist/components/app-keys-popover.d.ts +15 -0
- package/dist/components/app-keys-popover.d.ts.map +1 -0
- package/dist/components/app-keys-popover.js +115 -0
- package/dist/components/app-keys-popover.js.map +1 -0
- package/dist/components/app-list-row.d.ts +12 -0
- package/dist/components/app-list-row.d.ts.map +1 -0
- package/dist/components/app-list-row.js +11 -0
- package/dist/components/app-list-row.js.map +1 -0
- package/dist/components/app-open-actions.d.ts +2 -0
- package/dist/components/app-open-actions.d.ts.map +1 -0
- package/dist/components/app-open-actions.js +2 -0
- package/dist/components/app-open-actions.js.map +1 -0
- package/dist/components/app-row-settings.d.ts +6 -0
- package/dist/components/app-row-settings.d.ts.map +1 -0
- package/dist/components/app-row-settings.js +11 -0
- package/dist/components/app-row-settings.js.map +1 -0
- package/dist/components/approval-value-block.d.ts +7 -0
- package/dist/components/approval-value-block.d.ts.map +1 -0
- package/dist/components/approval-value-block.js +22 -0
- package/dist/components/approval-value-block.js.map +1 -0
- package/dist/components/automation-run-history-dialog.d.ts +9 -0
- package/dist/components/automation-run-history-dialog.d.ts.map +1 -0
- package/dist/components/automation-run-history-dialog.js +63 -0
- package/dist/components/automation-run-history-dialog.js.map +1 -0
- package/dist/components/connected-app-card.d.ts +6 -0
- package/dist/components/connected-app-card.d.ts.map +1 -0
- package/dist/components/connected-app-card.js +13 -0
- package/dist/components/connected-app-card.js.map +1 -0
- package/dist/components/create-app-popover.d.ts +29 -0
- package/dist/components/create-app-popover.d.ts.map +1 -0
- package/dist/components/create-app-popover.js +262 -0
- package/dist/components/create-app-popover.js.map +1 -0
- package/dist/components/dispatch-control-plane.d.ts +2 -0
- package/dist/components/dispatch-control-plane.d.ts.map +1 -0
- package/dist/components/dispatch-control-plane.js +114 -0
- package/dist/components/dispatch-control-plane.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 +21 -0
- package/dist/components/dispatch-shell.js.map +1 -0
- package/dist/components/docs-link.d.ts +16 -0
- package/dist/components/docs-link.d.ts.map +1 -0
- package/dist/components/docs-link.js +34 -0
- package/dist/components/docs-link.js.map +1 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +16 -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 +61 -0
- package/dist/components/layout/Header.js.map +1 -0
- package/dist/components/layout/HeaderActions.d.ts +2 -0
- package/dist/components/layout/HeaderActions.d.ts.map +1 -0
- package/dist/components/layout/HeaderActions.js +2 -0
- package/dist/components/layout/HeaderActions.js.map +1 -0
- package/dist/components/layout/Layout.d.ts +60 -0
- package/dist/components/layout/Layout.d.ts.map +1 -0
- package/dist/components/layout/Layout.js +1302 -0
- package/dist/components/layout/Layout.js.map +1 -0
- package/dist/components/layout/workspace-apps-rail.d.ts +5 -0
- package/dist/components/layout/workspace-apps-rail.d.ts.map +1 -0
- package/dist/components/layout/workspace-apps-rail.js +56 -0
- package/dist/components/layout/workspace-apps-rail.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 +414 -0
- package/dist/components/messaging-setup-panel.js.map +1 -0
- package/dist/components/other-apps-section.d.ts +33 -0
- package/dist/components/other-apps-section.d.ts.map +1 -0
- package/dist/components/other-apps-section.js +66 -0
- package/dist/components/other-apps-section.js.map +1 -0
- package/dist/components/simple-agents-panel.d.ts +12 -0
- package/dist/components/simple-agents-panel.d.ts.map +1 -0
- package/dist/components/simple-agents-panel.js +438 -0
- package/dist/components/simple-agents-panel.js.map +1 -0
- package/dist/components/task-queue-health.d.ts +2 -0
- package/dist/components/task-queue-health.d.ts.map +1 -0
- package/dist/components/task-queue-health.js +58 -0
- package/dist/components/task-queue-health.js.map +1 -0
- package/dist/components/transactional-email-activity.d.ts +24 -0
- package/dist/components/transactional-email-activity.d.ts.map +1 -0
- package/dist/components/transactional-email-activity.js +31 -0
- package/dist/components/transactional-email-activity.js.map +1 -0
- package/dist/components/transactional-email-metrics.d.ts +40 -0
- package/dist/components/transactional-email-metrics.d.ts.map +1 -0
- package/dist/components/transactional-email-metrics.js +44 -0
- package/dist/components/transactional-email-metrics.js.map +1 -0
- package/dist/components/transactional-email-preview.d.ts +7 -0
- package/dist/components/transactional-email-preview.d.ts.map +1 -0
- package/dist/components/transactional-email-preview.js +41 -0
- package/dist/components/transactional-email-preview.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 +2 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +2 -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 +2 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +2 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/form.d.ts +26 -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 +8 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +11 -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 +2 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +2 -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/components/usage-alerts-panel.d.ts +11 -0
- package/dist/components/usage-alerts-panel.d.ts.map +1 -0
- package/dist/components/usage-alerts-panel.js +125 -0
- package/dist/components/usage-alerts-panel.js.map +1 -0
- package/dist/components/workspace-app-card.d.ts +8 -0
- package/dist/components/workspace-app-card.d.ts.map +1 -0
- package/dist/components/workspace-app-card.js +198 -0
- package/dist/components/workspace-app-card.js.map +1 -0
- package/dist/components/workspace-app-host.d.ts +50 -0
- package/dist/components/workspace-app-host.d.ts.map +1 -0
- package/dist/components/workspace-app-host.js +386 -0
- package/dist/components/workspace-app-host.js.map +1 -0
- package/dist/components/workspace-app-search.d.ts +10 -0
- package/dist/components/workspace-app-search.d.ts.map +1 -0
- package/dist/components/workspace-app-search.js +27 -0
- package/dist/components/workspace-app-search.js.map +1 -0
- package/dist/components/workspace-resource-effective-stack.d.ts +11 -0
- package/dist/components/workspace-resource-effective-stack.d.ts.map +1 -0
- package/dist/components/workspace-resource-effective-stack.js +65 -0
- package/dist/components/workspace-resource-effective-stack.js.map +1 -0
- package/dist/components/workspace-resource-impact-preview.d.ts +9 -0
- package/dist/components/workspace-resource-impact-preview.d.ts.map +1 -0
- package/dist/components/workspace-resource-impact-preview.js +44 -0
- package/dist/components/workspace-resource-impact-preview.js.map +1 -0
- package/dist/components/workspace-template-card.d.ts +58 -0
- package/dist/components/workspace-template-card.d.ts.map +1 -0
- package/dist/components/workspace-template-card.js +113 -0
- package/dist/components/workspace-template-card.js.map +1 -0
- package/dist/config.d.ts +40 -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 +35 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +3 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +250 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/schema.d.ts +3059 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +194 -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 +2 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-navigation-state.d.ts +25 -0
- package/dist/hooks/use-navigation-state.d.ts.map +1 -0
- package/dist/hooks/use-navigation-state.js +353 -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/agent-pack.d.ts +31 -0
- package/dist/lib/agent-pack.d.ts.map +1 -0
- package/dist/lib/agent-pack.js +149 -0
- package/dist/lib/agent-pack.js.map +1 -0
- package/dist/lib/automation-display.d.ts +22 -0
- package/dist/lib/automation-display.d.ts.map +1 -0
- package/dist/lib/automation-display.js +88 -0
- package/dist/lib/automation-display.js.map +1 -0
- package/dist/lib/automations.d.ts +32 -0
- package/dist/lib/automations.d.ts.map +1 -0
- package/dist/lib/automations.js +28 -0
- package/dist/lib/automations.js.map +1 -0
- package/dist/lib/browser-chat-bridge.d.ts +8 -0
- package/dist/lib/browser-chat-bridge.d.ts.map +1 -0
- package/dist/lib/browser-chat-bridge.js +48 -0
- package/dist/lib/browser-chat-bridge.js.map +1 -0
- package/dist/lib/browser-chat-protocol.d.ts +33 -0
- package/dist/lib/browser-chat-protocol.d.ts.map +1 -0
- package/dist/lib/browser-chat-protocol.js +82 -0
- package/dist/lib/browser-chat-protocol.js.map +1 -0
- package/dist/lib/catch-all-target.d.ts +17 -0
- package/dist/lib/catch-all-target.d.ts.map +1 -0
- package/dist/lib/catch-all-target.js +103 -0
- package/dist/lib/catch-all-target.js.map +1 -0
- package/dist/lib/embed-session-recovery.d.ts +3 -0
- package/dist/lib/embed-session-recovery.d.ts.map +1 -0
- package/dist/lib/embed-session-recovery.js +18 -0
- package/dist/lib/embed-session-recovery.js.map +1 -0
- package/dist/lib/other-apps.d.ts +16 -0
- package/dist/lib/other-apps.d.ts.map +1 -0
- package/dist/lib/other-apps.js +36 -0
- package/dist/lib/other-apps.js.map +1 -0
- package/dist/lib/overview-chat.d.ts +9 -0
- package/dist/lib/overview-chat.d.ts.map +1 -0
- package/dist/lib/overview-chat.js +16 -0
- package/dist/lib/overview-chat.js.map +1 -0
- package/dist/lib/simple-agent-profile.d.ts +36 -0
- package/dist/lib/simple-agent-profile.d.ts.map +1 -0
- package/dist/lib/simple-agent-profile.js +183 -0
- package/dist/lib/simple-agent-profile.js.map +1 -0
- package/dist/lib/task-queue.d.ts +19 -0
- package/dist/lib/task-queue.d.ts.map +1 -0
- package/dist/lib/task-queue.js +54 -0
- package/dist/lib/task-queue.js.map +1 -0
- package/dist/lib/thread-link-preview.d.ts +23 -0
- package/dist/lib/thread-link-preview.d.ts.map +1 -0
- package/dist/lib/thread-link-preview.js +150 -0
- package/dist/lib/thread-link-preview.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/workspace-app-layout.d.ts +19 -0
- package/dist/lib/workspace-app-layout.d.ts.map +1 -0
- package/dist/lib/workspace-app-layout.js +75 -0
- package/dist/lib/workspace-app-layout.js.map +1 -0
- package/dist/lib/workspace-apps.d.ts +72 -0
- package/dist/lib/workspace-apps.d.ts.map +1 -0
- package/dist/lib/workspace-apps.js +228 -0
- package/dist/lib/workspace-apps.js.map +1 -0
- package/dist/lib/workspace-apps.test.d.ts +2 -0
- package/dist/lib/workspace-apps.test.d.ts.map +1 -0
- package/dist/lib/workspace-apps.test.js +105 -0
- package/dist/lib/workspace-apps.test.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 +89 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/pages/$appId.d.ts +8 -0
- package/dist/routes/pages/$appId.d.ts.map +1 -0
- package/dist/routes/pages/$appId.js +126 -0
- package/dist/routes/pages/$appId.js.map +1 -0
- package/dist/routes/pages/_index.d.ts +22 -0
- package/dist/routes/pages/_index.d.ts.map +1 -0
- package/dist/routes/pages/_index.js +53 -0
- package/dist/routes/pages/_index.js.map +1 -0
- package/dist/routes/pages/_index.test.d.ts +2 -0
- package/dist/routes/pages/_index.test.d.ts.map +1 -0
- package/dist/routes/pages/_index.test.js +29 -0
- package/dist/routes/pages/_index.test.js.map +1 -0
- package/dist/routes/pages/admin._index.d.ts +5 -0
- package/dist/routes/pages/admin._index.d.ts.map +1 -0
- package/dist/routes/pages/admin._index.js +44 -0
- package/dist/routes/pages/admin._index.js.map +1 -0
- package/dist/routes/pages/admin.d.ts +5 -0
- package/dist/routes/pages/admin.d.ts.map +1 -0
- package/dist/routes/pages/admin.js +10 -0
- package/dist/routes/pages/admin.js.map +1 -0
- package/dist/routes/pages/agent-integrations.d.ts +5 -0
- package/dist/routes/pages/agent-integrations.d.ts.map +1 -0
- package/dist/routes/pages/agent-integrations.js +15 -0
- package/dist/routes/pages/agent-integrations.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 +96 -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 +58 -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 +55 -0
- package/dist/routes/pages/approvals.js.map +1 -0
- package/dist/routes/pages/apps.$appId.d.ts +6 -0
- package/dist/routes/pages/apps.$appId.d.ts.map +1 -0
- package/dist/routes/pages/apps.$appId.js +15 -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 +113 -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 +14 -0
- package/dist/routes/pages/audit.js.map +1 -0
- package/dist/routes/pages/automations.d.ts +5 -0
- package/dist/routes/pages/automations.d.ts.map +1 -0
- package/dist/routes/pages/automations.js +124 -0
- package/dist/routes/pages/automations.js.map +1 -0
- package/dist/routes/pages/browser-chat.d.ts +5 -0
- package/dist/routes/pages/browser-chat.d.ts.map +1 -0
- package/dist/routes/pages/browser-chat.js +43 -0
- package/dist/routes/pages/browser-chat.js.map +1 -0
- package/dist/routes/pages/browser-connect.d.ts +5 -0
- package/dist/routes/pages/browser-connect.d.ts.map +1 -0
- package/dist/routes/pages/browser-connect.js +72 -0
- package/dist/routes/pages/browser-connect.js.map +1 -0
- package/dist/routes/pages/chat.d.ts +5 -0
- package/dist/routes/pages/chat.d.ts.map +1 -0
- package/dist/routes/pages/chat.js +192 -0
- package/dist/routes/pages/chat.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 +96 -0
- package/dist/routes/pages/destinations.js.map +1 -0
- package/dist/routes/pages/dream-settings.d.ts +34 -0
- package/dist/routes/pages/dream-settings.d.ts.map +1 -0
- package/dist/routes/pages/dream-settings.js +68 -0
- package/dist/routes/pages/dream-settings.js.map +1 -0
- package/dist/routes/pages/dreams.d.ts +5 -0
- package/dist/routes/pages/dreams.d.ts.map +1 -0
- package/dist/routes/pages/dreams.js +455 -0
- package/dist/routes/pages/dreams.js.map +1 -0
- package/dist/routes/pages/extensions.$id.d.ts +5 -0
- package/dist/routes/pages/extensions.$id.d.ts.map +1 -0
- package/dist/routes/pages/extensions.$id.js +9 -0
- package/dist/routes/pages/extensions.$id.js.map +1 -0
- package/dist/routes/pages/extensions._index.d.ts +5 -0
- package/dist/routes/pages/extensions._index.d.ts.map +1 -0
- package/dist/routes/pages/extensions._index.js +9 -0
- package/dist/routes/pages/extensions._index.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 +20 -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 +196 -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/metrics.d.ts +5 -0
- package/dist/routes/pages/metrics.d.ts.map +1 -0
- package/dist/routes/pages/metrics.js +305 -0
- package/dist/routes/pages/metrics.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 +12 -0
- package/dist/routes/pages/new-app.js.map +1 -0
- package/dist/routes/pages/operations.d.ts +5 -0
- package/dist/routes/pages/operations.d.ts.map +1 -0
- package/dist/routes/pages/operations.js +53 -0
- package/dist/routes/pages/operations.js.map +1 -0
- package/dist/routes/pages/overview.d.ts +18 -0
- package/dist/routes/pages/overview.d.ts.map +1 -0
- package/dist/routes/pages/overview.js +19 -0
- package/dist/routes/pages/overview.js.map +1 -0
- package/dist/routes/pages/settings.d.ts +5 -0
- package/dist/routes/pages/settings.d.ts.map +1 -0
- package/dist/routes/pages/settings.js +57 -0
- package/dist/routes/pages/settings.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 +9 -0
- package/dist/routes/pages/team.js.map +1 -0
- package/dist/routes/pages/thread-debug.d.ts +5 -0
- package/dist/routes/pages/thread-debug.d.ts.map +1 -0
- package/dist/routes/pages/thread-debug.js +563 -0
- package/dist/routes/pages/thread-debug.js.map +1 -0
- package/dist/routes/pages/tools.$id.d.ts +5 -0
- package/dist/routes/pages/tools.$id.d.ts.map +1 -0
- package/dist/routes/pages/tools.$id.js +9 -0
- package/dist/routes/pages/tools.$id.js.map +1 -0
- package/dist/routes/pages/tools._index.d.ts +5 -0
- package/dist/routes/pages/tools._index.d.ts.map +1 -0
- package/dist/routes/pages/tools._index.js +9 -0
- package/dist/routes/pages/tools._index.js.map +1 -0
- package/dist/routes/pages/transactional-email.$appId.$id.d.ts +5 -0
- package/dist/routes/pages/transactional-email.$appId.$id.d.ts.map +1 -0
- package/dist/routes/pages/transactional-email.$appId.$id.js +147 -0
- package/dist/routes/pages/transactional-email.$appId.$id.js.map +1 -0
- package/dist/routes/pages/transactional-email.d.ts +5 -0
- package/dist/routes/pages/transactional-email.d.ts.map +1 -0
- package/dist/routes/pages/transactional-email.js +143 -0
- package/dist/routes/pages/transactional-email.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 +214 -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 +336 -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 +71 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/lib/agent-pack-store.d.ts +24 -0
- package/dist/server/lib/agent-pack-store.d.ts.map +1 -0
- package/dist/server/lib/agent-pack-store.js +22 -0
- package/dist/server/lib/agent-pack-store.js.map +1 -0
- package/dist/server/lib/app-creation-store.d.ts +164 -0
- package/dist/server/lib/app-creation-store.d.ts.map +1 -0
- package/dist/server/lib/app-creation-store.js +1975 -0
- package/dist/server/lib/app-creation-store.js.map +1 -0
- package/dist/server/lib/browser-extension-allowlist.d.ts +9 -0
- package/dist/server/lib/browser-extension-allowlist.d.ts.map +1 -0
- package/dist/server/lib/browser-extension-allowlist.js +39 -0
- package/dist/server/lib/browser-extension-allowlist.js.map +1 -0
- package/dist/server/lib/curated-workspace-templates.d.ts +22 -0
- package/dist/server/lib/curated-workspace-templates.d.ts.map +1 -0
- package/dist/server/lib/curated-workspace-templates.js +137 -0
- package/dist/server/lib/curated-workspace-templates.js.map +1 -0
- package/dist/server/lib/dispatch-integrations.d.ts +16 -0
- package/dist/server/lib/dispatch-integrations.d.ts.map +1 -0
- package/dist/server/lib/dispatch-integrations.js +411 -0
- package/dist/server/lib/dispatch-integrations.js.map +1 -0
- package/dist/server/lib/dispatch-remote-commands.d.ts +83 -0
- package/dist/server/lib/dispatch-remote-commands.d.ts.map +1 -0
- package/dist/server/lib/dispatch-remote-commands.js +256 -0
- package/dist/server/lib/dispatch-remote-commands.js.map +1 -0
- package/dist/server/lib/dispatch-routing.d.ts +6 -0
- package/dist/server/lib/dispatch-routing.d.ts.map +1 -0
- package/dist/server/lib/dispatch-routing.js +30 -0
- package/dist/server/lib/dispatch-routing.js.map +1 -0
- package/dist/server/lib/dispatch-store.d.ts +342 -0
- package/dist/server/lib/dispatch-store.d.ts.map +1 -0
- package/dist/server/lib/dispatch-store.js +725 -0
- package/dist/server/lib/dispatch-store.js.map +1 -0
- package/dist/server/lib/dreams-store.d.ts +398 -0
- package/dist/server/lib/dreams-store.d.ts.map +1 -0
- package/dist/server/lib/dreams-store.js +2330 -0
- package/dist/server/lib/dreams-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 +98 -0
- package/dist/server/lib/env-config.js.map +1 -0
- package/dist/server/lib/mcp-access-store.d.ts +16 -0
- package/dist/server/lib/mcp-access-store.d.ts.map +1 -0
- package/dist/server/lib/mcp-access-store.js +92 -0
- package/dist/server/lib/mcp-access-store.js.map +1 -0
- package/dist/server/lib/mcp-gateway.d.ts +90 -0
- package/dist/server/lib/mcp-gateway.d.ts.map +1 -0
- package/dist/server/lib/mcp-gateway.js +1036 -0
- package/dist/server/lib/mcp-gateway.js.map +1 -0
- package/dist/server/lib/onboarding-steps.d.ts +12 -0
- package/dist/server/lib/onboarding-steps.d.ts.map +1 -0
- package/dist/server/lib/onboarding-steps.js +72 -0
- package/dist/server/lib/onboarding-steps.js.map +1 -0
- package/dist/server/lib/provider-api.d.ts +29 -0
- package/dist/server/lib/provider-api.d.ts.map +1 -0
- package/dist/server/lib/provider-api.js +49 -0
- package/dist/server/lib/provider-api.js.map +1 -0
- package/dist/server/lib/thread-debug-store.d.ts +194 -0
- package/dist/server/lib/thread-debug-store.d.ts.map +1 -0
- package/dist/server/lib/thread-debug-store.js +849 -0
- package/dist/server/lib/thread-debug-store.js.map +1 -0
- package/dist/server/lib/thread-link-preview.d.ts +3 -0
- package/dist/server/lib/thread-link-preview.d.ts.map +1 -0
- package/dist/server/lib/thread-link-preview.js +28 -0
- package/dist/server/lib/thread-link-preview.js.map +1 -0
- package/dist/server/lib/usage-metrics-store.d.ts +113 -0
- package/dist/server/lib/usage-metrics-store.d.ts.map +1 -0
- package/dist/server/lib/usage-metrics-store.js +580 -0
- package/dist/server/lib/usage-metrics-store.js.map +1 -0
- package/dist/server/lib/vault-boot-resync.d.ts +23 -0
- package/dist/server/lib/vault-boot-resync.d.ts.map +1 -0
- package/dist/server/lib/vault-boot-resync.js +44 -0
- package/dist/server/lib/vault-boot-resync.js.map +1 -0
- package/dist/server/lib/vault-store.d.ts +381 -0
- package/dist/server/lib/vault-store.d.ts.map +1 -0
- package/dist/server/lib/vault-store.js +1106 -0
- package/dist/server/lib/vault-store.js.map +1 -0
- package/dist/server/lib/workspace-app-action-auth.d.ts +9 -0
- package/dist/server/lib/workspace-app-action-auth.d.ts.map +1 -0
- package/dist/server/lib/workspace-app-action-auth.js +102 -0
- package/dist/server/lib/workspace-app-action-auth.js.map +1 -0
- package/dist/server/lib/workspace-app-chat-proxy.d.ts +52 -0
- package/dist/server/lib/workspace-app-chat-proxy.d.ts.map +1 -0
- package/dist/server/lib/workspace-app-chat-proxy.js +306 -0
- package/dist/server/lib/workspace-app-chat-proxy.js.map +1 -0
- package/dist/server/lib/workspace-resources-store.d.ts +372 -0
- package/dist/server/lib/workspace-resources-store.d.ts.map +1 -0
- package/dist/server/lib/workspace-resources-store.js +1000 -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 +94 -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 +31 -0
- package/dist/server/plugins/auth.js.map +1 -0
- package/dist/server/plugins/core-routes.d.ts +4 -0
- package/dist/server/plugins/core-routes.d.ts.map +1 -0
- package/dist/server/plugins/core-routes.js +18 -0
- package/dist/server/plugins/core-routes.js.map +1 -0
- package/dist/server/plugins/db.d.ts +11 -0
- package/dist/server/plugins/db.d.ts.map +1 -0
- package/dist/server/plugins/db.js +18 -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 +72 -0
- package/dist/server/plugins/integrations.js.map +1 -0
- package/dist/shared/app-roles.d.ts +9 -0
- package/dist/shared/app-roles.d.ts.map +1 -0
- package/dist/shared/app-roles.js +7 -0
- package/dist/shared/app-roles.js.map +1 -0
- package/dist/shared/chat-first-pane.d.ts +8 -0
- package/dist/shared/chat-first-pane.d.ts.map +1 -0
- package/dist/shared/chat-first-pane.js +8 -0
- package/dist/shared/chat-first-pane.js.map +1 -0
- package/dist/shared/feature-flags.d.ts +8 -0
- package/dist/shared/feature-flags.d.ts.map +1 -0
- package/dist/shared/feature-flags.js +17 -0
- package/dist/shared/feature-flags.js.map +1 -0
- package/dist/shared/workspace-app-chat.d.ts +23 -0
- package/dist/shared/workspace-app-chat.d.ts.map +1 -0
- package/dist/shared/workspace-app-chat.js +45 -0
- package/dist/shared/workspace-app-chat.js.map +1 -0
- package/dist/shared/workspace-sso.d.ts +48 -0
- package/dist/shared/workspace-sso.d.ts.map +1 -0
- package/dist/shared/workspace-sso.js +142 -0
- package/dist/shared/workspace-sso.js.map +1 -0
- package/package.json +118 -0
- package/src/actions/apply-dream-proposal.ts +13 -0
- package/src/actions/approve-dispatch-change.ts +12 -0
- package/src/actions/approve-vault-request.ts +24 -0
- package/src/actions/archive-workspace-app.ts +17 -0
- package/src/actions/ask_app.ts +26 -0
- package/src/actions/ask_app_status.ts +16 -0
- package/src/actions/connect-external-agent.ts +92 -0
- package/src/actions/create-browser-chat-session.spec.ts +122 -0
- package/src/actions/create-browser-chat-session.ts +99 -0
- package/src/actions/create-dream-report.ts +77 -0
- package/src/actions/create-link-token.ts +13 -0
- package/src/actions/create-pylon-ticket.ts +111 -0
- package/src/actions/create-vault-grant.ts +16 -0
- package/src/actions/create-vault-secret.ts +28 -0
- package/src/actions/create-workspace-resource-grant.ts +16 -0
- package/src/actions/create-workspace-resource.ts +37 -0
- package/src/actions/create_embed_session.ts +30 -0
- package/src/actions/create_workspace_app_embed_session.spec.ts +122 -0
- package/src/actions/create_workspace_app_embed_session.ts +102 -0
- package/src/actions/delete-destination.ts +12 -0
- package/src/actions/delete-staged-dataset.ts +10 -0
- package/src/actions/delete-vault-secret.ts +13 -0
- package/src/actions/delete-workspace-resource.ts +13 -0
- package/src/actions/deny-vault-request.ts +13 -0
- package/src/actions/ensure-dream-job.ts +77 -0
- package/src/actions/get-agent-thread-debug.ts +41 -0
- package/src/actions/get-app-creation-settings.ts +12 -0
- package/src/actions/get-dispatch-settings.ts +11 -0
- package/src/actions/get-dream-settings.ts +13 -0
- package/src/actions/get-dream.ts +15 -0
- package/src/actions/get-vault-access-settings.ts +12 -0
- package/src/actions/get-workspace-info.ts +12 -0
- package/src/actions/get-workspace-resource-effective-context.ts +35 -0
- package/src/actions/grant-vault-secrets-to-app.ts +21 -0
- package/src/actions/grant-workspace-resources-to-app.ts +17 -0
- package/src/actions/import-agent-pack.ts +146 -0
- package/src/actions/import-agent.ts +102 -0
- package/src/actions/index.spec.ts +59 -0
- package/src/actions/index.ts +210 -0
- package/src/actions/list-agent-pack.ts +43 -0
- package/src/actions/list-agent-run-failures.ts +50 -0
- package/src/actions/list-agent-thread-sources.ts +13 -0
- package/src/actions/list-available-workspace-templates.ts +12 -0
- package/src/actions/list-connected-agents.spec.ts +73 -0
- package/src/actions/list-connected-agents.ts +112 -0
- package/src/actions/list-curated-workspace-templates.spec.ts +36 -0
- package/src/actions/list-curated-workspace-templates.ts +12 -0
- package/src/actions/list-destinations.ts +11 -0
- package/src/actions/list-dispatch-approvals.ts +11 -0
- package/src/actions/list-dispatch-audit.ts +13 -0
- package/src/actions/list-dispatch-overview.ts +19 -0
- package/src/actions/list-dispatch-usage-metrics.ts +30 -0
- package/src/actions/list-dream-candidates.ts +78 -0
- package/src/actions/list-dreams.ts +18 -0
- package/src/actions/list-integrations-catalog.ts +12 -0
- package/src/actions/list-linked-identities.ts +11 -0
- package/src/actions/list-mcp-app-access.ts +27 -0
- package/src/actions/list-staged-datasets.ts +10 -0
- package/src/actions/list-vault-audit.ts +17 -0
- package/src/actions/list-vault-grants.ts +15 -0
- package/src/actions/list-vault-requests.ts +17 -0
- package/src/actions/list-vault-secret-options.ts +14 -0
- package/src/actions/list-vault-secrets.ts +27 -0
- package/src/actions/list-workspace-apps.ts +33 -0
- package/src/actions/list-workspace-resource-grants.ts +15 -0
- package/src/actions/list-workspace-resource-options.ts +24 -0
- package/src/actions/list-workspace-resources-for-app.ts +14 -0
- package/src/actions/list-workspace-resources.ts +24 -0
- package/src/actions/list_apps.spec.ts +52 -0
- package/src/actions/list_apps.ts +36 -0
- package/src/actions/navigate.ts +53 -0
- package/src/actions/open_app.spec.ts +106 -0
- package/src/actions/open_app.ts +152 -0
- package/src/actions/preview-dream-proposal.ts +15 -0
- package/src/actions/preview-workspace-resource-change.ts +26 -0
- package/src/actions/provider-api-audit.spec.ts +51 -0
- package/src/actions/provider-api-catalog.ts +14 -0
- package/src/actions/provider-api-docs.ts +24 -0
- package/src/actions/provider-api-register.spec.ts +193 -0
- package/src/actions/provider-api-register.ts +35 -0
- package/src/actions/provider-api-request.ts +28 -0
- package/src/actions/query-staged-dataset.ts +10 -0
- package/src/actions/read-slack-thread-context.spec.ts +134 -0
- package/src/actions/read-slack-thread-context.ts +171 -0
- package/src/actions/reject-dispatch-change.ts +13 -0
- package/src/actions/reject-dream-proposal.ts +13 -0
- package/src/actions/remix-workspace-template.spec.ts +145 -0
- package/src/actions/remix-workspace-template.ts +106 -0
- package/src/actions/remove-pending-workspace-app.ts +17 -0
- package/src/actions/request-vault-secret.ts +17 -0
- package/src/actions/resolve-integration-source-context.spec.ts +78 -0
- package/src/actions/resolve-integration-source-context.ts +37 -0
- package/src/actions/restore-starter-workspace-resources.ts +18 -0
- package/src/actions/revoke-vault-grant.ts +12 -0
- package/src/actions/revoke-workspace-resource-grant.ts +16 -0
- package/src/actions/scaffold-workspace-app.spec.ts +33 -0
- package/src/actions/scaffold-workspace-app.ts +57 -0
- package/src/actions/search-agent-threads.ts +31 -0
- package/src/actions/send-code-agent-remote-command.ts +60 -0
- package/src/actions/send-platform-message.spec.ts +129 -0
- package/src/actions/send-platform-message.ts +150 -0
- package/src/actions/set-app-creation-settings.ts +22 -0
- package/src/actions/set-dispatch-approval-policy.ts +25 -0
- package/src/actions/set-dream-settings.spec.ts +81 -0
- package/src/actions/set-dream-settings.ts +45 -0
- package/src/actions/set-mcp-app-access.spec.ts +73 -0
- package/src/actions/set-mcp-app-access.ts +56 -0
- package/src/actions/set-vault-access-settings.ts +17 -0
- package/src/actions/start-workspace-app-creation.ts +55 -0
- package/src/actions/sync-vault-to-app.ts +15 -0
- package/src/actions/unarchive-workspace-app.ts +17 -0
- package/src/actions/update-vault-secret.ts +49 -0
- package/src/actions/update-workspace-app-metadata.ts +33 -0
- package/src/actions/update-workspace-resource.ts +20 -0
- package/src/actions/upsert-destination.ts +30 -0
- package/src/actions/view-screen.spec.ts +212 -0
- package/src/actions/view-screen.ts +398 -0
- package/src/client/transactional-emails.spec.ts +91 -0
- package/src/client/transactional-emails.ts +201 -0
- package/src/components/action-query-error.spec.tsx +56 -0
- package/src/components/action-query-error.tsx +32 -0
- package/src/components/admin-navigation.tsx +329 -0
- package/src/components/agents-panel.tsx +383 -0
- package/src/components/app-icon.spec.tsx +44 -0
- package/src/components/app-icon.tsx +177 -0
- package/src/components/app-keys-popover.spec.tsx +146 -0
- package/src/components/app-keys-popover.tsx +300 -0
- package/src/components/app-list-row.tsx +40 -0
- package/src/components/app-open-actions.tsx +5 -0
- package/src/components/app-row-settings.tsx +54 -0
- package/src/components/approval-value-block.spec.tsx +60 -0
- package/src/components/approval-value-block.tsx +33 -0
- package/src/components/automation-run-history-dialog.tsx +247 -0
- package/src/components/connected-app-card.tsx +39 -0
- package/src/components/create-app-popover.spec.tsx +376 -0
- package/src/components/create-app-popover.tsx +677 -0
- package/src/components/dispatch-control-plane.spec.tsx +344 -0
- package/src/components/dispatch-control-plane.tsx +416 -0
- package/src/components/dispatch-shell.tsx +59 -0
- package/src/components/docs-link.tsx +52 -0
- package/src/components/index.ts +21 -0
- package/src/components/layout/Header.tsx +100 -0
- package/src/components/layout/HeaderActions.tsx +1 -0
- package/src/components/layout/Layout.app-chat.spec.ts +31 -0
- package/src/components/layout/Layout.spec.tsx +549 -0
- package/src/components/layout/Layout.tsx +2532 -0
- package/src/components/layout/workspace-apps-rail.tsx +132 -0
- package/src/components/messaging-setup-panel.spec.tsx +261 -0
- package/src/components/messaging-setup-panel.tsx +1131 -0
- package/src/components/other-apps-section.tsx +223 -0
- package/src/components/simple-agents-panel.spec.tsx +153 -0
- package/src/components/simple-agents-panel.tsx +1311 -0
- package/src/components/task-queue-health.tsx +175 -0
- package/src/components/transactional-email-activity.tsx +102 -0
- package/src/components/transactional-email-metrics.tsx +127 -0
- package/src/components/transactional-email-preview.tsx +88 -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 +56 -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 +1 -0
- package/src/components/ui/drawer.tsx +128 -0
- package/src/components/ui/dropdown-menu.tsx +1 -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 +31 -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 +1 -0
- package/src/components/ui/separator.tsx +29 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +777 -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/components/usage-alerts-panel.tsx +445 -0
- package/src/components/workspace-app-card.spec.tsx +408 -0
- package/src/components/workspace-app-card.tsx +711 -0
- package/src/components/workspace-app-chat-rail.spec.tsx +182 -0
- package/src/components/workspace-app-host.spec.tsx +688 -0
- package/src/components/workspace-app-host.tsx +756 -0
- package/src/components/workspace-app-search.tsx +96 -0
- package/src/components/workspace-resource-effective-stack.spec.tsx +126 -0
- package/src/components/workspace-resource-effective-stack.tsx +159 -0
- package/src/components/workspace-resource-impact-preview.spec.tsx +148 -0
- package/src/components/workspace-resource-impact-preview.tsx +128 -0
- package/src/components/workspace-template-card.spec.tsx +228 -0
- package/src/components/workspace-template-card.tsx +363 -0
- package/src/config.ts +42 -0
- package/src/db/index.ts +40 -0
- package/src/db/migrations.spec.ts +84 -0
- package/src/db/migrations.ts +251 -0
- package/src/db/schema.ts +209 -0
- package/src/hooks/use-mobile.tsx +1 -0
- package/src/hooks/use-navigation-state.spec.ts +166 -0
- package/src/hooks/use-navigation-state.ts +400 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +19 -0
- package/src/lib/agent-pack.spec.ts +47 -0
- package/src/lib/agent-pack.ts +226 -0
- package/src/lib/automation-display.spec.ts +149 -0
- package/src/lib/automation-display.ts +108 -0
- package/src/lib/automations.spec.ts +64 -0
- package/src/lib/automations.ts +66 -0
- package/src/lib/browser-chat-bridge.spec.ts +151 -0
- package/src/lib/browser-chat-bridge.ts +79 -0
- package/src/lib/browser-chat-protocol.spec.ts +113 -0
- package/src/lib/browser-chat-protocol.ts +124 -0
- package/src/lib/catch-all-target.spec.ts +156 -0
- package/src/lib/catch-all-target.ts +125 -0
- package/src/lib/embed-session-recovery.spec.ts +63 -0
- package/src/lib/embed-session-recovery.ts +26 -0
- package/src/lib/other-apps.spec.ts +133 -0
- package/src/lib/other-apps.ts +57 -0
- package/src/lib/overview-chat.spec.ts +51 -0
- package/src/lib/overview-chat.ts +29 -0
- package/src/lib/simple-agent-profile.spec.ts +77 -0
- package/src/lib/simple-agent-profile.ts +247 -0
- package/src/lib/task-queue.spec.ts +57 -0
- package/src/lib/task-queue.ts +72 -0
- package/src/lib/thread-link-preview.ts +160 -0
- package/src/lib/utils.ts +6 -0
- package/src/lib/workspace-app-layout.spec.ts +47 -0
- package/src/lib/workspace-app-layout.ts +121 -0
- package/src/lib/workspace-apps.spec.ts +175 -0
- package/src/lib/workspace-apps.test.ts +151 -0
- package/src/lib/workspace-apps.ts +306 -0
- package/src/routes/index.spec.ts +39 -0
- package/src/routes/index.ts +95 -0
- package/src/routes/pages/$appId.spec.tsx +115 -0
- package/src/routes/pages/$appId.tsx +240 -0
- package/src/routes/pages/_index.test.ts +34 -0
- package/src/routes/pages/_index.tsx +65 -0
- package/src/routes/pages/admin._index.tsx +107 -0
- package/src/routes/pages/admin.tsx +15 -0
- package/src/routes/pages/agent-integrations.tsx +24 -0
- package/src/routes/pages/agents.tsx +251 -0
- package/src/routes/pages/approval.tsx +301 -0
- package/src/routes/pages/approvals.tsx +198 -0
- package/src/routes/pages/apps.$appId.spec.tsx +66 -0
- package/src/routes/pages/apps.$appId.tsx +22 -0
- package/src/routes/pages/apps.tsx +431 -0
- package/src/routes/pages/audit.tsx +71 -0
- package/src/routes/pages/automations.tsx +363 -0
- package/src/routes/pages/browser-chat.spec.tsx +121 -0
- package/src/routes/pages/browser-chat.tsx +89 -0
- package/src/routes/pages/browser-connect.spec.tsx +137 -0
- package/src/routes/pages/browser-connect.tsx +143 -0
- package/src/routes/pages/chat.spec.tsx +183 -0
- package/src/routes/pages/chat.tsx +335 -0
- package/src/routes/pages/destinations.tsx +309 -0
- package/src/routes/pages/dream-settings.spec.ts +131 -0
- package/src/routes/pages/dream-settings.ts +103 -0
- package/src/routes/pages/dreams.tsx +1812 -0
- package/src/routes/pages/extensions.$id.tsx +9 -0
- package/src/routes/pages/extensions._index.tsx +9 -0
- package/src/routes/pages/identities.tsx +106 -0
- package/src/routes/pages/integrations.tsx +541 -0
- package/src/routes/pages/messaging.tsx +17 -0
- package/src/routes/pages/metrics.tsx +1135 -0
- package/src/routes/pages/new-app.tsx +20 -0
- package/src/routes/pages/operations.tsx +132 -0
- package/src/routes/pages/overview.tsx +22 -0
- package/src/routes/pages/settings.tsx +196 -0
- package/src/routes/pages/team.tsx +9 -0
- package/src/routes/pages/thread-debug.spec.tsx +370 -0
- package/src/routes/pages/thread-debug.tsx +1923 -0
- package/src/routes/pages/tools.$id.tsx +9 -0
- package/src/routes/pages/tools._index.tsx +9 -0
- package/src/routes/pages/transactional-email.$appId.$id.tsx +369 -0
- package/src/routes/pages/transactional-email.tsx +575 -0
- package/src/routes/pages/vault.tsx +978 -0
- package/src/routes/pages/workspace.tsx +1213 -0
- package/src/server/index.ts +86 -0
- package/src/server/lib/agent-pack-store.ts +35 -0
- package/src/server/lib/app-creation-store.spec.ts +1018 -0
- package/src/server/lib/app-creation-store.ts +2567 -0
- package/src/server/lib/approval-fencing.spec.ts +489 -0
- package/src/server/lib/browser-extension-allowlist.spec.ts +76 -0
- package/src/server/lib/browser-extension-allowlist.ts +58 -0
- package/src/server/lib/curated-workspace-templates.spec.ts +56 -0
- package/src/server/lib/curated-workspace-templates.ts +187 -0
- package/src/server/lib/dispatch-integrations.spec.ts +428 -0
- package/src/server/lib/dispatch-integrations.ts +528 -0
- package/src/server/lib/dispatch-remote-commands.spec.ts +168 -0
- package/src/server/lib/dispatch-remote-commands.ts +375 -0
- package/src/server/lib/dispatch-routing.spec.ts +44 -0
- package/src/server/lib/dispatch-routing.ts +42 -0
- package/src/server/lib/dispatch-store.ts +1008 -0
- package/src/server/lib/dreams-store.spec.ts +1492 -0
- package/src/server/lib/dreams-store.ts +3187 -0
- package/src/server/lib/env-config.ts +99 -0
- package/src/server/lib/mcp-access-store.spec.ts +171 -0
- package/src/server/lib/mcp-access-store.ts +138 -0
- package/src/server/lib/mcp-gateway.spec.ts +1583 -0
- package/src/server/lib/mcp-gateway.ts +1388 -0
- package/src/server/lib/onboarding-steps.ts +82 -0
- package/src/server/lib/provider-api.ts +69 -0
- package/src/server/lib/thread-debug-store.spec.ts +439 -0
- package/src/server/lib/thread-debug-store.ts +1170 -0
- package/src/server/lib/thread-link-preview.spec.ts +127 -0
- package/src/server/lib/thread-link-preview.ts +32 -0
- package/src/server/lib/usage-metrics-store.spec.ts +240 -0
- package/src/server/lib/usage-metrics-store.ts +879 -0
- package/src/server/lib/vault-boot-resync.spec.ts +68 -0
- package/src/server/lib/vault-boot-resync.ts +50 -0
- package/src/server/lib/vault-store.spec.ts +541 -0
- package/src/server/lib/vault-store.ts +1540 -0
- package/src/server/lib/workspace-app-action-auth.spec.ts +212 -0
- package/src/server/lib/workspace-app-action-auth.ts +122 -0
- package/src/server/lib/workspace-app-chat-proxy.spec.ts +322 -0
- package/src/server/lib/workspace-app-chat-proxy.ts +389 -0
- package/src/server/lib/workspace-resource-approval-lifecycle.spec.ts +227 -0
- package/src/server/lib/workspace-resources-store.spec.ts +1108 -0
- package/src/server/lib/workspace-resources-store.ts +1403 -0
- package/src/server/plugins/agent-chat.spec.ts +43 -0
- package/src/server/plugins/agent-chat.ts +99 -0
- package/src/server/plugins/auth.spec.ts +45 -0
- package/src/server/plugins/auth.ts +36 -0
- package/src/server/plugins/core-routes.ts +29 -0
- package/src/server/plugins/db.ts +20 -0
- package/src/server/plugins/integrations.ts +82 -0
- package/src/shared/app-roles.ts +8 -0
- package/src/shared/chat-first-pane.ts +7 -0
- package/src/shared/feature-flags.ts +20 -0
- package/src/shared/workspace-app-chat.ts +45 -0
- package/src/shared/workspace-sso.ts +173 -0
- package/src/styles/dispatch-css.spec.ts +87 -0
- package/src/styles/dispatch.css +146 -0
|
@@ -0,0 +1,1106 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import { getDbExec } from "@agent-native/core/db";
|
|
3
|
+
import { and, desc, eq, isNull, or, sql } from "@agent-native/core/db/schema";
|
|
4
|
+
import { ssrfSafeFetch } from "@agent-native/core/extensions/url-safety";
|
|
5
|
+
import { deleteAppSecret, listAppSecretsForScope, writeAppSecret, } from "@agent-native/core/secrets";
|
|
6
|
+
import { discoverAgents } from "@agent-native/core/server/agent-discovery";
|
|
7
|
+
import { getOrgSetting, getUserSetting, putOrgSetting, putUserSetting, } from "@agent-native/core/settings";
|
|
8
|
+
import { getDb, schema } from "../../db/index.js";
|
|
9
|
+
import { currentOwnerEmail, currentOrgId, recordAudit, } from "./dispatch-store.js";
|
|
10
|
+
const VAULT_ACCESS_SETTINGS_KEY = "dispatch-vault-access-settings";
|
|
11
|
+
const VAULT_SYNC_DESCRIPTION_PREFIX = "Synced from Dispatch vault:";
|
|
12
|
+
/**
|
|
13
|
+
* Build a VaultCtx from the current request. Throws if the request is
|
|
14
|
+
* unauthenticated — the previous behavior of falling back to "local@localhost"
|
|
15
|
+
* leaked rows across tenants when a misconfigured environment skipped auth.
|
|
16
|
+
*/
|
|
17
|
+
export function requireVaultCtx() {
|
|
18
|
+
const ownerEmail = currentOwnerEmail();
|
|
19
|
+
if (!ownerEmail) {
|
|
20
|
+
throw new Error("Vault operation requires an authenticated user");
|
|
21
|
+
}
|
|
22
|
+
return { ownerEmail, orgId: currentOrgId() };
|
|
23
|
+
}
|
|
24
|
+
/** WHERE clause that limits a vault row to the caller's ownership scope. */
|
|
25
|
+
function ctxScope(table, ctx) {
|
|
26
|
+
if (!ctx.orgId) {
|
|
27
|
+
return and(eq(table.ownerEmail, ctx.ownerEmail), isNull(table.orgId));
|
|
28
|
+
}
|
|
29
|
+
return or(eq(table.ownerEmail, ctx.ownerEmail), eq(table.orgId, ctx.orgId));
|
|
30
|
+
}
|
|
31
|
+
/** Scope an approval operation to the active tenant, never just the owner email. */
|
|
32
|
+
function tenantScope(table, ctx) {
|
|
33
|
+
if (ctx.orgId)
|
|
34
|
+
return eq(table.orgId, ctx.orgId);
|
|
35
|
+
return and(eq(table.ownerEmail, ctx.ownerEmail), isNull(table.orgId));
|
|
36
|
+
}
|
|
37
|
+
/** Build a ctx that scopes to a specific row's owner/org (used when a
|
|
38
|
+
* request approver acts on behalf of the original requester so the
|
|
39
|
+
* created secret lands in the request's org). */
|
|
40
|
+
function ctxForRow(row) {
|
|
41
|
+
return { ownerEmail: row.ownerEmail, orgId: row.orgId };
|
|
42
|
+
}
|
|
43
|
+
function ctxForSecretRow(row, fallback) {
|
|
44
|
+
return row.ownerEmail ? ctxForRow(row) : fallback;
|
|
45
|
+
}
|
|
46
|
+
function id() {
|
|
47
|
+
return crypto.randomUUID();
|
|
48
|
+
}
|
|
49
|
+
function now() {
|
|
50
|
+
return Date.now();
|
|
51
|
+
}
|
|
52
|
+
function safeJson(value) {
|
|
53
|
+
return JSON.stringify(value ?? null);
|
|
54
|
+
}
|
|
55
|
+
function workspaceBaseOrigins() {
|
|
56
|
+
const out = new Set();
|
|
57
|
+
for (const value of [
|
|
58
|
+
process.env.WORKSPACE_GATEWAY_URL,
|
|
59
|
+
process.env.APP_URL,
|
|
60
|
+
process.env.URL,
|
|
61
|
+
process.env.DEPLOY_URL,
|
|
62
|
+
process.env.BETTER_AUTH_URL,
|
|
63
|
+
]) {
|
|
64
|
+
if (!value)
|
|
65
|
+
continue;
|
|
66
|
+
try {
|
|
67
|
+
out.add(new URL(value).origin);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Ignore malformed deploy metadata.
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
export function isTrustedEnvVarSyncAgentUrl(agentUrl) {
|
|
76
|
+
let parsed;
|
|
77
|
+
try {
|
|
78
|
+
parsed = new URL(agentUrl);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
const hostname = parsed.hostname.toLowerCase();
|
|
84
|
+
if (hostname === "localhost" ||
|
|
85
|
+
hostname === "127.0.0.1" ||
|
|
86
|
+
hostname === "::1" ||
|
|
87
|
+
hostname.endsWith(".localhost")) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
return workspaceBaseOrigins().has(parsed.origin);
|
|
91
|
+
}
|
|
92
|
+
function scopedFilter(table) {
|
|
93
|
+
return ctxScope(table, requireVaultCtx());
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Shared vault values and grants are organization administration data. Keep
|
|
97
|
+
* the member path available for request creation and safe key metadata, but
|
|
98
|
+
* fail closed before a member can read or mutate a raw secret.
|
|
99
|
+
*/
|
|
100
|
+
export async function assertCanManageVault() {
|
|
101
|
+
const orgId = currentOrgId();
|
|
102
|
+
if (!orgId)
|
|
103
|
+
return;
|
|
104
|
+
const email = currentOwnerEmail().trim().toLowerCase();
|
|
105
|
+
let role = null;
|
|
106
|
+
try {
|
|
107
|
+
const result = await getDbExec().execute({
|
|
108
|
+
sql: "SELECT role FROM org_members WHERE org_id = ? AND LOWER(email) = ? LIMIT 1",
|
|
109
|
+
args: [orgId, email],
|
|
110
|
+
});
|
|
111
|
+
role = result.rows[0]?.role;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// coercion-ok: unknown membership is treated as unauthorized below.
|
|
115
|
+
// A failed membership check must not become an authorization bypass.
|
|
116
|
+
}
|
|
117
|
+
if (role !== "owner" && role !== "admin") {
|
|
118
|
+
throw Object.assign(new Error("Only organization owners and admins can manage the workspace vault."), { statusCode: 403 });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export async function canManageVault() {
|
|
122
|
+
try {
|
|
123
|
+
await assertCanManageVault();
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
// coercion-ok: the UI must treat an authorization lookup failure as no access.
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function normalizeCredentialKey(value) {
|
|
132
|
+
return value.trim();
|
|
133
|
+
}
|
|
134
|
+
function vaultAccessScope() {
|
|
135
|
+
const orgId = currentOrgId();
|
|
136
|
+
if (orgId)
|
|
137
|
+
return { scope: "org", scopeId: orgId };
|
|
138
|
+
return { scope: "user", scopeId: currentOwnerEmail() };
|
|
139
|
+
}
|
|
140
|
+
function parseVaultAccessMode(value) {
|
|
141
|
+
return value === "manual" ? "manual" : "all-apps";
|
|
142
|
+
}
|
|
143
|
+
export async function getVaultAccessSettings() {
|
|
144
|
+
const scope = vaultAccessScope();
|
|
145
|
+
const raw = scope.scope === "org"
|
|
146
|
+
? await getOrgSetting(scope.scopeId, VAULT_ACCESS_SETTINGS_KEY)
|
|
147
|
+
: await getUserSetting(scope.scopeId, VAULT_ACCESS_SETTINGS_KEY);
|
|
148
|
+
return {
|
|
149
|
+
...scope,
|
|
150
|
+
mode: parseVaultAccessMode(raw?.mode),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
export async function setVaultAccessSettings(input) {
|
|
154
|
+
await assertCanManageVault();
|
|
155
|
+
const scope = vaultAccessScope();
|
|
156
|
+
const next = { mode: parseVaultAccessMode(input.mode) };
|
|
157
|
+
if (scope.scope === "org") {
|
|
158
|
+
await putOrgSetting(scope.scopeId, VAULT_ACCESS_SETTINGS_KEY, next);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
await putUserSetting(scope.scopeId, VAULT_ACCESS_SETTINGS_KEY, next);
|
|
162
|
+
}
|
|
163
|
+
await recordAudit({
|
|
164
|
+
action: "vault.access-settings.updated",
|
|
165
|
+
targetType: "vault-settings",
|
|
166
|
+
targetId: VAULT_ACCESS_SETTINGS_KEY,
|
|
167
|
+
summary: next.mode === "all-apps"
|
|
168
|
+
? "Set vault access to all workspace apps"
|
|
169
|
+
: "Set vault access to manual per-app grants",
|
|
170
|
+
metadata: next,
|
|
171
|
+
});
|
|
172
|
+
return getVaultAccessSettings();
|
|
173
|
+
}
|
|
174
|
+
// ─── Vault Audit ──────────────────────────────────────────────────
|
|
175
|
+
export async function recordVaultAudit(input) {
|
|
176
|
+
const db = getDb();
|
|
177
|
+
await db.insert(schema.vaultAuditLog).values({
|
|
178
|
+
id: id(),
|
|
179
|
+
ownerEmail: currentOwnerEmail(),
|
|
180
|
+
orgId: currentOrgId(),
|
|
181
|
+
secretId: input.secretId || null,
|
|
182
|
+
appId: input.appId || null,
|
|
183
|
+
action: input.action,
|
|
184
|
+
actor: input.actor || currentOwnerEmail(),
|
|
185
|
+
summary: input.summary,
|
|
186
|
+
metadata: input.metadata ? safeJson(input.metadata) : null,
|
|
187
|
+
createdAt: now(),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
export async function listVaultAudit(limit = 50) {
|
|
191
|
+
await assertCanManageVault();
|
|
192
|
+
const db = getDb();
|
|
193
|
+
return db
|
|
194
|
+
.select()
|
|
195
|
+
.from(schema.vaultAuditLog)
|
|
196
|
+
.where(scopedFilter(schema.vaultAuditLog))
|
|
197
|
+
.orderBy(desc(schema.vaultAuditLog.createdAt))
|
|
198
|
+
.limit(limit);
|
|
199
|
+
}
|
|
200
|
+
// ─── Secrets ──────────────────────────────────────────────────────
|
|
201
|
+
export async function listSecrets() {
|
|
202
|
+
await assertCanManageVault();
|
|
203
|
+
const db = getDb();
|
|
204
|
+
return db
|
|
205
|
+
.select()
|
|
206
|
+
.from(schema.vaultSecrets)
|
|
207
|
+
.where(scopedFilter(schema.vaultSecrets))
|
|
208
|
+
.orderBy(desc(schema.vaultSecrets.updatedAt));
|
|
209
|
+
}
|
|
210
|
+
/** Safe metadata for app creation and integration readiness checks. */
|
|
211
|
+
export async function listSecretOptions() {
|
|
212
|
+
const db = getDb();
|
|
213
|
+
return db
|
|
214
|
+
.select({
|
|
215
|
+
id: schema.vaultSecrets.id,
|
|
216
|
+
name: schema.vaultSecrets.name,
|
|
217
|
+
credentialKey: schema.vaultSecrets.credentialKey,
|
|
218
|
+
provider: schema.vaultSecrets.provider,
|
|
219
|
+
description: schema.vaultSecrets.description,
|
|
220
|
+
})
|
|
221
|
+
.from(schema.vaultSecrets)
|
|
222
|
+
.where(scopedFilter(schema.vaultSecrets))
|
|
223
|
+
.orderBy(desc(schema.vaultSecrets.updatedAt));
|
|
224
|
+
}
|
|
225
|
+
export async function getSecret(secretId, ctx) {
|
|
226
|
+
await assertCanManageVault();
|
|
227
|
+
const db = getDb();
|
|
228
|
+
const [row] = await db
|
|
229
|
+
.select()
|
|
230
|
+
.from(schema.vaultSecrets)
|
|
231
|
+
.where(and(eq(schema.vaultSecrets.id, secretId), ctxScope(schema.vaultSecrets, ctx)))
|
|
232
|
+
.limit(1);
|
|
233
|
+
return row ?? null;
|
|
234
|
+
}
|
|
235
|
+
export async function createSecret(input, ctx = requireVaultCtx()) {
|
|
236
|
+
await assertCanManageVault();
|
|
237
|
+
const db = getDb();
|
|
238
|
+
const timestamp = now();
|
|
239
|
+
const credentialKey = normalizeCredentialKey(input.credentialKey);
|
|
240
|
+
if (!credentialKey)
|
|
241
|
+
throw new Error("Credential key is required");
|
|
242
|
+
const existing = await db
|
|
243
|
+
.select()
|
|
244
|
+
.from(schema.vaultSecrets)
|
|
245
|
+
.where(and(eq(schema.vaultSecrets.credentialKey, credentialKey), ctxScope(schema.vaultSecrets, ctx)))
|
|
246
|
+
.orderBy(desc(schema.vaultSecrets.updatedAt))
|
|
247
|
+
.limit(1);
|
|
248
|
+
if (existing[0]) {
|
|
249
|
+
await db
|
|
250
|
+
.update(schema.vaultSecrets)
|
|
251
|
+
.set({
|
|
252
|
+
name: input.name,
|
|
253
|
+
credentialKey,
|
|
254
|
+
value: input.value,
|
|
255
|
+
provider: input.provider || null,
|
|
256
|
+
description: input.description || null,
|
|
257
|
+
updatedAt: timestamp,
|
|
258
|
+
})
|
|
259
|
+
.where(and(eq(schema.vaultSecrets.id, existing[0].id), ctxScope(schema.vaultSecrets, ctx)));
|
|
260
|
+
await recordVaultAudit({
|
|
261
|
+
action: "secret.updated",
|
|
262
|
+
secretId: existing[0].id,
|
|
263
|
+
summary: `Updated secret "${input.name}" (${credentialKey})`,
|
|
264
|
+
metadata: { credentialKey, provider: input.provider },
|
|
265
|
+
});
|
|
266
|
+
await recordAudit({
|
|
267
|
+
action: "vault.secret.updated",
|
|
268
|
+
targetType: "vault-secret",
|
|
269
|
+
targetId: existing[0].id,
|
|
270
|
+
summary: `Updated vault secret "${input.name}" (${credentialKey})`,
|
|
271
|
+
});
|
|
272
|
+
const updated = await getSecret(existing[0].id, ctx);
|
|
273
|
+
if (updated) {
|
|
274
|
+
await syncSecretsToCredentialStore([updated], ctxForSecretRow(updated, ctx));
|
|
275
|
+
}
|
|
276
|
+
return updated;
|
|
277
|
+
}
|
|
278
|
+
const secretId = id();
|
|
279
|
+
const actor = ctx.ownerEmail;
|
|
280
|
+
await db.insert(schema.vaultSecrets).values({
|
|
281
|
+
id: secretId,
|
|
282
|
+
ownerEmail: actor,
|
|
283
|
+
orgId: ctx.orgId,
|
|
284
|
+
name: input.name,
|
|
285
|
+
credentialKey,
|
|
286
|
+
value: input.value,
|
|
287
|
+
provider: input.provider || null,
|
|
288
|
+
description: input.description || null,
|
|
289
|
+
createdBy: actor,
|
|
290
|
+
createdAt: timestamp,
|
|
291
|
+
updatedAt: timestamp,
|
|
292
|
+
});
|
|
293
|
+
await recordVaultAudit({
|
|
294
|
+
action: "secret.created",
|
|
295
|
+
secretId,
|
|
296
|
+
summary: `Created secret "${input.name}" (${credentialKey})`,
|
|
297
|
+
metadata: { credentialKey, provider: input.provider },
|
|
298
|
+
});
|
|
299
|
+
await recordAudit({
|
|
300
|
+
action: "vault.secret.created",
|
|
301
|
+
targetType: "vault-secret",
|
|
302
|
+
targetId: secretId,
|
|
303
|
+
summary: `Created vault secret "${input.name}" (${credentialKey})`,
|
|
304
|
+
});
|
|
305
|
+
const created = await getSecret(secretId, ctx);
|
|
306
|
+
if (created) {
|
|
307
|
+
await syncSecretsToCredentialStore([created], ctxForSecretRow(created, ctx));
|
|
308
|
+
}
|
|
309
|
+
return created;
|
|
310
|
+
}
|
|
311
|
+
export async function updateSecret(secretId, input, ctx = requireVaultCtx()) {
|
|
312
|
+
await assertCanManageVault();
|
|
313
|
+
const db = getDb();
|
|
314
|
+
const existing = await getSecret(secretId, ctx);
|
|
315
|
+
if (!existing)
|
|
316
|
+
throw new Error("Secret not found");
|
|
317
|
+
const patch = typeof input === "string" ? { value: input } : input;
|
|
318
|
+
const credentialKey = patch.credentialKey !== undefined
|
|
319
|
+
? normalizeCredentialKey(patch.credentialKey)
|
|
320
|
+
: existing.credentialKey;
|
|
321
|
+
if (!credentialKey)
|
|
322
|
+
throw new Error("Credential key is required");
|
|
323
|
+
const name = patch.name !== undefined ? patch.name.trim() : existing.name;
|
|
324
|
+
if (!name)
|
|
325
|
+
throw new Error("Secret name is required");
|
|
326
|
+
const value = patch.value !== undefined ? patch.value : existing.value;
|
|
327
|
+
if (!value)
|
|
328
|
+
throw new Error("Secret value is required");
|
|
329
|
+
const provider = patch.provider !== undefined ? patch.provider || null : existing.provider;
|
|
330
|
+
const description = patch.description !== undefined
|
|
331
|
+
? patch.description || null
|
|
332
|
+
: existing.description;
|
|
333
|
+
if (credentialKey !== existing.credentialKey) {
|
|
334
|
+
const conflict = await db
|
|
335
|
+
.select({ id: schema.vaultSecrets.id })
|
|
336
|
+
.from(schema.vaultSecrets)
|
|
337
|
+
.where(and(eq(schema.vaultSecrets.credentialKey, credentialKey), ctxScope(schema.vaultSecrets, ctx)))
|
|
338
|
+
.limit(1);
|
|
339
|
+
if (conflict[0] && conflict[0].id !== secretId) {
|
|
340
|
+
throw new Error(`Credential key "${credentialKey}" is already in use`);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
await db
|
|
344
|
+
.update(schema.vaultSecrets)
|
|
345
|
+
.set({
|
|
346
|
+
name,
|
|
347
|
+
credentialKey,
|
|
348
|
+
value,
|
|
349
|
+
provider,
|
|
350
|
+
description,
|
|
351
|
+
updatedAt: now(),
|
|
352
|
+
})
|
|
353
|
+
.where(and(eq(schema.vaultSecrets.id, secretId), ctxScope(schema.vaultSecrets, ctx)));
|
|
354
|
+
const auditMetadata = {
|
|
355
|
+
name,
|
|
356
|
+
previousName: name !== existing.name ? existing.name : undefined,
|
|
357
|
+
credentialKey,
|
|
358
|
+
previousCredentialKey: credentialKey !== existing.credentialKey
|
|
359
|
+
? existing.credentialKey
|
|
360
|
+
: undefined,
|
|
361
|
+
provider,
|
|
362
|
+
previousProvider: provider !== existing.provider ? existing.provider : undefined,
|
|
363
|
+
description,
|
|
364
|
+
previousDescription: description !== existing.description ? existing.description : undefined,
|
|
365
|
+
valueChanged: value !== existing.value ? true : undefined,
|
|
366
|
+
};
|
|
367
|
+
await recordVaultAudit({
|
|
368
|
+
action: "secret.updated",
|
|
369
|
+
secretId,
|
|
370
|
+
summary: `Updated secret "${name}" (${credentialKey})`,
|
|
371
|
+
metadata: auditMetadata,
|
|
372
|
+
});
|
|
373
|
+
await recordAudit({
|
|
374
|
+
action: "vault.secret.updated",
|
|
375
|
+
targetType: "vault-secret",
|
|
376
|
+
targetId: secretId,
|
|
377
|
+
summary: `Updated vault secret "${name}" (${credentialKey})`,
|
|
378
|
+
metadata: auditMetadata,
|
|
379
|
+
});
|
|
380
|
+
const updated = await getSecret(secretId, ctx);
|
|
381
|
+
if (updated) {
|
|
382
|
+
await syncSecretsToCredentialStore([updated], ctxForSecretRow(updated, ctx));
|
|
383
|
+
}
|
|
384
|
+
if (updated && credentialKey !== existing.credentialKey) {
|
|
385
|
+
await cleanupSyncedCredentialKeysIfUnused(ctxForRow(existing), [
|
|
386
|
+
existing.credentialKey,
|
|
387
|
+
]);
|
|
388
|
+
}
|
|
389
|
+
else if (updated && patch.credentialKey !== undefined) {
|
|
390
|
+
await cleanupSyncedCredentialKeysIfUnused(ctxForSecretRow(updated, ctx));
|
|
391
|
+
}
|
|
392
|
+
return updated;
|
|
393
|
+
}
|
|
394
|
+
export async function deleteSecret(secretId, ctx = requireVaultCtx()) {
|
|
395
|
+
await assertCanManageVault();
|
|
396
|
+
const db = getDb();
|
|
397
|
+
const existing = await getSecret(secretId, ctx);
|
|
398
|
+
if (!existing)
|
|
399
|
+
throw new Error("Secret not found");
|
|
400
|
+
// Revoke all active grants first
|
|
401
|
+
const grants = await listGrants({ secretId });
|
|
402
|
+
for (const grant of grants) {
|
|
403
|
+
if (grant.status === "active") {
|
|
404
|
+
await revokeGrant(grant.id, ctx);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
await db
|
|
408
|
+
.delete(schema.vaultSecrets)
|
|
409
|
+
.where(and(eq(schema.vaultSecrets.id, secretId), ctxScope(schema.vaultSecrets, ctx)));
|
|
410
|
+
await cleanupSyncedCredentialKeysIfUnused(ctxForRow(existing), [
|
|
411
|
+
existing.credentialKey,
|
|
412
|
+
]);
|
|
413
|
+
await recordVaultAudit({
|
|
414
|
+
action: "secret.deleted",
|
|
415
|
+
secretId,
|
|
416
|
+
summary: `Deleted secret "${existing.name}" (${existing.credentialKey})`,
|
|
417
|
+
});
|
|
418
|
+
await recordAudit({
|
|
419
|
+
action: "vault.secret.deleted",
|
|
420
|
+
targetType: "vault-secret",
|
|
421
|
+
targetId: secretId,
|
|
422
|
+
summary: `Deleted vault secret "${existing.name}" (${existing.credentialKey})`,
|
|
423
|
+
});
|
|
424
|
+
return existing;
|
|
425
|
+
}
|
|
426
|
+
// ─── Grants ──────────────────────────────────────────────────────
|
|
427
|
+
export async function listGrants(filter) {
|
|
428
|
+
await assertCanManageVault();
|
|
429
|
+
const db = getDb();
|
|
430
|
+
const conditions = [scopedFilter(schema.vaultGrants)];
|
|
431
|
+
if (filter?.secretId) {
|
|
432
|
+
conditions.push(eq(schema.vaultGrants.secretId, filter.secretId));
|
|
433
|
+
}
|
|
434
|
+
if (filter?.appId) {
|
|
435
|
+
conditions.push(eq(schema.vaultGrants.appId, filter.appId));
|
|
436
|
+
}
|
|
437
|
+
return db
|
|
438
|
+
.select()
|
|
439
|
+
.from(schema.vaultGrants)
|
|
440
|
+
.where(and(...conditions))
|
|
441
|
+
.orderBy(desc(schema.vaultGrants.updatedAt));
|
|
442
|
+
}
|
|
443
|
+
export async function getGrant(grantId, ctx = requireVaultCtx()) {
|
|
444
|
+
await assertCanManageVault();
|
|
445
|
+
const db = getDb();
|
|
446
|
+
const [row] = await db
|
|
447
|
+
.select()
|
|
448
|
+
.from(schema.vaultGrants)
|
|
449
|
+
.where(and(eq(schema.vaultGrants.id, grantId), ctxScope(schema.vaultGrants, ctx)))
|
|
450
|
+
.limit(1);
|
|
451
|
+
return row ?? null;
|
|
452
|
+
}
|
|
453
|
+
export async function createGrant(secretId, appId, ctx = requireVaultCtx()) {
|
|
454
|
+
await assertCanManageVault();
|
|
455
|
+
const db = getDb();
|
|
456
|
+
const secret = await getSecret(secretId, ctx);
|
|
457
|
+
if (!secret)
|
|
458
|
+
throw new Error("Secret not found");
|
|
459
|
+
const timestamp = now();
|
|
460
|
+
const actor = ctx.ownerEmail;
|
|
461
|
+
const [existing] = await db
|
|
462
|
+
.select()
|
|
463
|
+
.from(schema.vaultGrants)
|
|
464
|
+
.where(and(eq(schema.vaultGrants.secretId, secretId), eq(schema.vaultGrants.appId, appId), ctxScope(schema.vaultGrants, ctx)))
|
|
465
|
+
.orderBy(desc(schema.vaultGrants.updatedAt))
|
|
466
|
+
.limit(1);
|
|
467
|
+
if (existing?.status === "active") {
|
|
468
|
+
return existing;
|
|
469
|
+
}
|
|
470
|
+
if (existing) {
|
|
471
|
+
await db
|
|
472
|
+
.update(schema.vaultGrants)
|
|
473
|
+
.set({
|
|
474
|
+
grantedBy: actor,
|
|
475
|
+
status: "active",
|
|
476
|
+
syncedAt: null,
|
|
477
|
+
updatedAt: timestamp,
|
|
478
|
+
})
|
|
479
|
+
.where(and(eq(schema.vaultGrants.id, existing.id), ctxScope(schema.vaultGrants, ctx)));
|
|
480
|
+
await recordVaultAudit({
|
|
481
|
+
action: "grant.reinstated",
|
|
482
|
+
secretId,
|
|
483
|
+
appId,
|
|
484
|
+
summary: `Reinstated "${secret.name}" (${secret.credentialKey}) for ${appId}`,
|
|
485
|
+
metadata: { grantId: existing.id },
|
|
486
|
+
});
|
|
487
|
+
await recordAudit({
|
|
488
|
+
action: "vault.grant.reinstated",
|
|
489
|
+
targetType: "vault-grant",
|
|
490
|
+
targetId: existing.id,
|
|
491
|
+
summary: `Reinstated vault secret "${secret.name}" for ${appId}`,
|
|
492
|
+
});
|
|
493
|
+
return getGrant(existing.id, ctx);
|
|
494
|
+
}
|
|
495
|
+
const grantId = id();
|
|
496
|
+
await db.insert(schema.vaultGrants).values({
|
|
497
|
+
id: grantId,
|
|
498
|
+
ownerEmail: actor,
|
|
499
|
+
orgId: ctx.orgId,
|
|
500
|
+
secretId,
|
|
501
|
+
appId,
|
|
502
|
+
grantedBy: actor,
|
|
503
|
+
status: "active",
|
|
504
|
+
syncedAt: null,
|
|
505
|
+
createdAt: timestamp,
|
|
506
|
+
updatedAt: timestamp,
|
|
507
|
+
});
|
|
508
|
+
await recordVaultAudit({
|
|
509
|
+
action: "grant.created",
|
|
510
|
+
secretId,
|
|
511
|
+
appId,
|
|
512
|
+
summary: `Granted "${secret.name}" (${secret.credentialKey}) to ${appId}`,
|
|
513
|
+
metadata: { grantId },
|
|
514
|
+
});
|
|
515
|
+
await recordAudit({
|
|
516
|
+
action: "vault.grant.created",
|
|
517
|
+
targetType: "vault-grant",
|
|
518
|
+
targetId: grantId,
|
|
519
|
+
summary: `Granted vault secret "${secret.name}" to ${appId}`,
|
|
520
|
+
});
|
|
521
|
+
return getGrant(grantId);
|
|
522
|
+
}
|
|
523
|
+
export async function grantSecretsToApp(secretIds, appId, ctx = requireVaultCtx()) {
|
|
524
|
+
await assertCanManageVault();
|
|
525
|
+
const access = await getVaultAccessSettings();
|
|
526
|
+
const uniqueSecretIds = Array.from(new Set(secretIds));
|
|
527
|
+
if (access.mode === "all-apps") {
|
|
528
|
+
return {
|
|
529
|
+
appId,
|
|
530
|
+
accessMode: access.mode,
|
|
531
|
+
created: [],
|
|
532
|
+
skipped: uniqueSecretIds,
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
const existingActive = (await listGrants({ appId })).filter((grant) => grant.status === "active");
|
|
536
|
+
const existingSecretIds = new Set(existingActive.map((grant) => grant.secretId));
|
|
537
|
+
const created = [];
|
|
538
|
+
const skipped = [];
|
|
539
|
+
for (const secretId of uniqueSecretIds) {
|
|
540
|
+
if (existingSecretIds.has(secretId)) {
|
|
541
|
+
skipped.push(secretId);
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
const grant = await createGrant(secretId, appId, ctx);
|
|
545
|
+
if (grant) {
|
|
546
|
+
created.push(grant);
|
|
547
|
+
existingSecretIds.add(secretId);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return { appId, accessMode: access.mode, created, skipped };
|
|
551
|
+
}
|
|
552
|
+
export async function revokeGrant(grantId, ctx = requireVaultCtx()) {
|
|
553
|
+
await assertCanManageVault();
|
|
554
|
+
const db = getDb();
|
|
555
|
+
const grant = await getGrant(grantId, ctx);
|
|
556
|
+
if (!grant)
|
|
557
|
+
throw new Error("Grant not found");
|
|
558
|
+
const secret = await getSecret(grant.secretId, ctx);
|
|
559
|
+
await db
|
|
560
|
+
.update(schema.vaultGrants)
|
|
561
|
+
.set({ status: "revoked", updatedAt: now() })
|
|
562
|
+
.where(and(eq(schema.vaultGrants.id, grantId), ctxScope(schema.vaultGrants, ctx)));
|
|
563
|
+
await recordVaultAudit({
|
|
564
|
+
action: "grant.revoked",
|
|
565
|
+
secretId: grant.secretId,
|
|
566
|
+
appId: grant.appId,
|
|
567
|
+
summary: `Revoked ${secret?.credentialKey || grant.secretId} from ${grant.appId}`,
|
|
568
|
+
metadata: { grantId },
|
|
569
|
+
});
|
|
570
|
+
await recordAudit({
|
|
571
|
+
action: "vault.grant.revoked",
|
|
572
|
+
targetType: "vault-grant",
|
|
573
|
+
targetId: grantId,
|
|
574
|
+
summary: `Revoked vault secret "${secret?.name || grant.secretId}" from ${grant.appId}`,
|
|
575
|
+
});
|
|
576
|
+
return getGrant(grantId, ctx);
|
|
577
|
+
}
|
|
578
|
+
export function credentialStoreScopeForVaultCtx(ctx) {
|
|
579
|
+
if (ctx.orgId)
|
|
580
|
+
return { scope: "org", scopeId: ctx.orgId };
|
|
581
|
+
return { scope: "workspace", scopeId: `solo:${ctx.ownerEmail}` };
|
|
582
|
+
}
|
|
583
|
+
export async function syncSecretsToCredentialStore(secrets, ctx) {
|
|
584
|
+
const target = credentialStoreScopeForVaultCtx(ctx);
|
|
585
|
+
const syncedKeys = [];
|
|
586
|
+
for (const secret of secrets) {
|
|
587
|
+
if (!secret.credentialKey || !secret.value)
|
|
588
|
+
continue;
|
|
589
|
+
await writeAppSecret({
|
|
590
|
+
key: secret.credentialKey,
|
|
591
|
+
value: secret.value,
|
|
592
|
+
scope: target.scope,
|
|
593
|
+
scopeId: target.scopeId,
|
|
594
|
+
description: `${VAULT_SYNC_DESCRIPTION_PREFIX} ${secret.name}`,
|
|
595
|
+
});
|
|
596
|
+
syncedKeys.push(secret.credentialKey);
|
|
597
|
+
}
|
|
598
|
+
return { ...target, keys: syncedKeys };
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Group secrets by the tenant their credential-store rows must land in.
|
|
602
|
+
*
|
|
603
|
+
* Every sync path must write a secret under the org that *owns the row*, not
|
|
604
|
+
* under whoever happens to be syncing: `writeAppSecret` upserts, so syncing
|
|
605
|
+
* with the caller's ctx copies credential material into the caller's org
|
|
606
|
+
* instead of moving it, and it accumulates there permanently.
|
|
607
|
+
*/
|
|
608
|
+
function groupSecretsByTenant(rows, resolveCtx) {
|
|
609
|
+
const groups = new Map();
|
|
610
|
+
for (const row of rows) {
|
|
611
|
+
if (!row.credentialKey || !row.value)
|
|
612
|
+
continue;
|
|
613
|
+
const ctx = resolveCtx(row);
|
|
614
|
+
const groupKey = `${ctx.orgId ?? ""}\u0000${ctx.ownerEmail}`;
|
|
615
|
+
const group = groups.get(groupKey);
|
|
616
|
+
if (group) {
|
|
617
|
+
group.rows.push(row);
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
groups.set(groupKey, { ctx, rows: [row] });
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
return [...groups.values()];
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Re-sync every vault secret across every tenant into the shared credential
|
|
627
|
+
* store, regardless of which request/ctx is currently active.
|
|
628
|
+
*
|
|
629
|
+
* `syncSecretsToCredentialStore` normally only runs on `createSecret` /
|
|
630
|
+
* `updateSecret`, so it only re-encrypts the rows a user happens to touch.
|
|
631
|
+
* When the shared `app_secrets` encryption format changes underneath it
|
|
632
|
+
* (e.g. a new dual-write format, or a change to how key material is
|
|
633
|
+
* derived), existing rows are stuck on the old format until someone
|
|
634
|
+
* manually re-saves each vault secret. This walks every `vault_secrets`
|
|
635
|
+
* row directly — bypassing the ctx-scoped `listSecrets()` — groups them by
|
|
636
|
+
* their (orgId, ownerEmail) tenant, and re-runs the sync per group so every
|
|
637
|
+
* row regains fresh ciphertext.
|
|
638
|
+
*
|
|
639
|
+
* A failure syncing one tenant's group is caught and logged (key NAMES
|
|
640
|
+
* only, never values) so it can't block the rest of the resync.
|
|
641
|
+
*/
|
|
642
|
+
export async function resyncAllVaultSecretsToCredentialStore() {
|
|
643
|
+
const db = getDb();
|
|
644
|
+
const rows = await db.select().from(schema.vaultSecrets);
|
|
645
|
+
const groups = groupSecretsByTenant(rows, ctxForRow);
|
|
646
|
+
let failedGroups = 0;
|
|
647
|
+
let syncedKeys = 0;
|
|
648
|
+
for (const { ctx, rows: groupRows } of groups) {
|
|
649
|
+
try {
|
|
650
|
+
const result = await syncSecretsToCredentialStore(groupRows, ctx);
|
|
651
|
+
syncedKeys += result.keys.length;
|
|
652
|
+
}
|
|
653
|
+
catch (error) {
|
|
654
|
+
failedGroups++;
|
|
655
|
+
const keyNames = groupRows.map((row) => row.credentialKey).join(", ");
|
|
656
|
+
console.warn(`[dispatch] vault boot resync failed for org=${ctx.orgId ?? "(solo)"} owner=${ctx.ownerEmail}; affected keys: ${keyNames}`, error instanceof Error ? error.message : error);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
return { groups: groups.length, failedGroups, syncedKeys };
|
|
660
|
+
}
|
|
661
|
+
export async function cleanupSyncedCredentialKeysIfUnused(ctx, candidateKeys) {
|
|
662
|
+
const db = getDb();
|
|
663
|
+
const target = credentialStoreScopeForVaultCtx(ctx);
|
|
664
|
+
const keys = candidateKeys
|
|
665
|
+
? candidateKeys
|
|
666
|
+
: (await listAppSecretsForScope(target.scope, target.scopeId))
|
|
667
|
+
.filter((secret) => secret.description?.startsWith(VAULT_SYNC_DESCRIPTION_PREFIX))
|
|
668
|
+
.map((secret) => secret.key);
|
|
669
|
+
for (const key of new Set(keys.filter(Boolean))) {
|
|
670
|
+
const stillUsesKey = await db
|
|
671
|
+
.select({ id: schema.vaultSecrets.id })
|
|
672
|
+
.from(schema.vaultSecrets)
|
|
673
|
+
.where(and(eq(schema.vaultSecrets.credentialKey, key), ctxScope(schema.vaultSecrets, ctx)))
|
|
674
|
+
.limit(1);
|
|
675
|
+
if (!stillUsesKey[0]) {
|
|
676
|
+
await deleteAppSecret({
|
|
677
|
+
key,
|
|
678
|
+
scope: target.scope,
|
|
679
|
+
scopeId: target.scopeId,
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
// ─── Sync ──────────────────────────────────────────────────────
|
|
685
|
+
export async function syncGrantsToApp(appId, ctx = requireVaultCtx()) {
|
|
686
|
+
await assertCanManageVault();
|
|
687
|
+
const db = getDb();
|
|
688
|
+
const access = await getVaultAccessSettings();
|
|
689
|
+
const agents = await discoverAgents("dispatch");
|
|
690
|
+
const agent = agents.find((a) => a.id === appId);
|
|
691
|
+
if (!agent)
|
|
692
|
+
throw new Error(`App "${appId}" not found in agent registry`);
|
|
693
|
+
const secretsToSync = [];
|
|
694
|
+
const activeGrants = access.mode === "manual"
|
|
695
|
+
? (await listGrants({ appId })).filter((g) => g.status === "active")
|
|
696
|
+
: [];
|
|
697
|
+
if (access.mode === "all-apps") {
|
|
698
|
+
const secrets = await listSecrets();
|
|
699
|
+
for (const secret of secrets) {
|
|
700
|
+
secretsToSync.push(secret);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
for (const grant of activeGrants) {
|
|
705
|
+
const secret = await getSecret(grant.secretId, ctx);
|
|
706
|
+
if (secret) {
|
|
707
|
+
secretsToSync.push(secret);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
if (secretsToSync.length === 0) {
|
|
712
|
+
return {
|
|
713
|
+
appId,
|
|
714
|
+
accessMode: access.mode,
|
|
715
|
+
synced: 0,
|
|
716
|
+
keys: [],
|
|
717
|
+
credentialStores: [],
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
// `all-apps` mode lists secrets across every org the caller can see, so each
|
|
721
|
+
// row must be written back under its own org. Syncing them all under `ctx`
|
|
722
|
+
// upserts copies of other orgs' credentials into the caller's org.
|
|
723
|
+
const credentialStoreGroups = groupSecretsByTenant(secretsToSync, (row) => ctxForSecretRow(row, ctx));
|
|
724
|
+
const credentialStores = [];
|
|
725
|
+
const credentialStoreKeys = [];
|
|
726
|
+
for (const group of credentialStoreGroups) {
|
|
727
|
+
const result = await syncSecretsToCredentialStore(group.rows, group.ctx);
|
|
728
|
+
credentialStores.push({
|
|
729
|
+
scope: result.scope,
|
|
730
|
+
scopeId: result.scopeId,
|
|
731
|
+
synced: result.keys.length,
|
|
732
|
+
});
|
|
733
|
+
credentialStoreKeys.push(...result.keys);
|
|
734
|
+
}
|
|
735
|
+
const vars = secretsToSync.map((secret) => ({
|
|
736
|
+
key: secret.credentialKey,
|
|
737
|
+
value: secret.value,
|
|
738
|
+
}));
|
|
739
|
+
let envVarSync;
|
|
740
|
+
// Best-effort push to the app's env-vars endpoint for local/dev apps that
|
|
741
|
+
// still read process.env directly. Production/shared-DB apps intentionally
|
|
742
|
+
// reject env writes; the encrypted app_secrets sync above is the canonical
|
|
743
|
+
// path for request-scoped credentials.
|
|
744
|
+
if (!isTrustedEnvVarSyncAgentUrl(agent.url)) {
|
|
745
|
+
envVarSync = {
|
|
746
|
+
status: "skipped",
|
|
747
|
+
reason: "env-var sync is limited to localhost or workspace-owned apps",
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
try {
|
|
752
|
+
const res = await ssrfSafeFetch(`${agent.url}/_agent-native/env-vars`, {
|
|
753
|
+
method: "POST",
|
|
754
|
+
headers: { "Content-Type": "application/json" },
|
|
755
|
+
body: JSON.stringify({ vars }),
|
|
756
|
+
signal: AbortSignal.timeout(10_000),
|
|
757
|
+
}, { maxRedirects: 3 });
|
|
758
|
+
if (res.ok) {
|
|
759
|
+
const result = await res.json();
|
|
760
|
+
envVarSync = { status: "synced", keys: result.saved || [] };
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
const err = await res.text().catch(() => "Unknown error");
|
|
764
|
+
envVarSync = { status: "skipped", reason: err };
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
catch (err) {
|
|
768
|
+
envVarSync = {
|
|
769
|
+
status: "failed",
|
|
770
|
+
reason: err instanceof Error ? err.message : String(err),
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
const syncedKeys = credentialStoreKeys;
|
|
775
|
+
const timestamp = now();
|
|
776
|
+
// Update syncedAt on grants that were successfully pushed to the shared
|
|
777
|
+
// credential store. All-apps mode has no explicit grant rows to update.
|
|
778
|
+
for (const grant of activeGrants) {
|
|
779
|
+
const secret = await getSecret(grant.secretId, ctx);
|
|
780
|
+
if (secret && syncedKeys.includes(secret.credentialKey)) {
|
|
781
|
+
await db
|
|
782
|
+
.update(schema.vaultGrants)
|
|
783
|
+
.set({ syncedAt: timestamp, updatedAt: timestamp })
|
|
784
|
+
.where(eq(schema.vaultGrants.id, grant.id));
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
await recordVaultAudit({
|
|
788
|
+
action: "secret.synced",
|
|
789
|
+
appId,
|
|
790
|
+
summary: `Synced ${syncedKeys.length} secret(s) to ${appId}: ${syncedKeys.join(", ")}`,
|
|
791
|
+
metadata: {
|
|
792
|
+
syncedKeys,
|
|
793
|
+
accessMode: access.mode,
|
|
794
|
+
credentialStores,
|
|
795
|
+
envVars: envVarSync,
|
|
796
|
+
},
|
|
797
|
+
});
|
|
798
|
+
return {
|
|
799
|
+
appId,
|
|
800
|
+
accessMode: access.mode,
|
|
801
|
+
synced: syncedKeys.length,
|
|
802
|
+
keys: syncedKeys,
|
|
803
|
+
credentialStores,
|
|
804
|
+
envVars: envVarSync,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
// ─── Requests ──────────────────────────────────────────────────────
|
|
808
|
+
export async function listRequests(filter) {
|
|
809
|
+
const db = getDb();
|
|
810
|
+
const ctx = requireVaultCtx();
|
|
811
|
+
const isAdmin = await canManageVault();
|
|
812
|
+
const conditions = [
|
|
813
|
+
isAdmin
|
|
814
|
+
? ctxScope(schema.vaultRequests, ctx)
|
|
815
|
+
: eq(schema.vaultRequests.ownerEmail, ctx.ownerEmail),
|
|
816
|
+
];
|
|
817
|
+
if (filter?.status) {
|
|
818
|
+
conditions.push(eq(schema.vaultRequests.status, filter.status));
|
|
819
|
+
}
|
|
820
|
+
return db
|
|
821
|
+
.select()
|
|
822
|
+
.from(schema.vaultRequests)
|
|
823
|
+
.where(and(...conditions))
|
|
824
|
+
.orderBy(desc(schema.vaultRequests.updatedAt));
|
|
825
|
+
}
|
|
826
|
+
export async function getRequest(requestId, ctx = requireVaultCtx()) {
|
|
827
|
+
const db = getDb();
|
|
828
|
+
const [row] = await db
|
|
829
|
+
.select()
|
|
830
|
+
.from(schema.vaultRequests)
|
|
831
|
+
.where(and(eq(schema.vaultRequests.id, requestId), ctxScope(schema.vaultRequests, ctx)))
|
|
832
|
+
.limit(1);
|
|
833
|
+
return row ?? null;
|
|
834
|
+
}
|
|
835
|
+
async function getRequestForTenant(requestId, ctx) {
|
|
836
|
+
const db = getDb();
|
|
837
|
+
const [row] = await db
|
|
838
|
+
.select()
|
|
839
|
+
.from(schema.vaultRequests)
|
|
840
|
+
.where(and(eq(schema.vaultRequests.id, requestId), tenantScope(schema.vaultRequests, ctx)))
|
|
841
|
+
.limit(1);
|
|
842
|
+
return row ?? null;
|
|
843
|
+
}
|
|
844
|
+
export async function createRequest(input) {
|
|
845
|
+
const db = getDb();
|
|
846
|
+
const timestamp = now();
|
|
847
|
+
const requestId = id();
|
|
848
|
+
const actor = currentOwnerEmail();
|
|
849
|
+
await db.insert(schema.vaultRequests).values({
|
|
850
|
+
id: requestId,
|
|
851
|
+
ownerEmail: actor,
|
|
852
|
+
orgId: currentOrgId(),
|
|
853
|
+
credentialKey: input.credentialKey,
|
|
854
|
+
appId: input.appId,
|
|
855
|
+
reason: input.reason || null,
|
|
856
|
+
requestedBy: actor,
|
|
857
|
+
status: "pending",
|
|
858
|
+
reviewedBy: null,
|
|
859
|
+
reviewedAt: null,
|
|
860
|
+
createdAt: timestamp,
|
|
861
|
+
updatedAt: timestamp,
|
|
862
|
+
});
|
|
863
|
+
await recordVaultAudit({
|
|
864
|
+
action: "request.created",
|
|
865
|
+
appId: input.appId,
|
|
866
|
+
summary: `${actor} requested ${input.credentialKey} for ${input.appId}`,
|
|
867
|
+
metadata: { requestId, reason: input.reason },
|
|
868
|
+
});
|
|
869
|
+
await notifyAdminsOfRequest(requestId, input);
|
|
870
|
+
return getRequest(requestId);
|
|
871
|
+
}
|
|
872
|
+
export async function approveRequest(requestId, secretValue, secretName, ctx = requireVaultCtx()) {
|
|
873
|
+
await assertCanManageVault();
|
|
874
|
+
const db = getDb();
|
|
875
|
+
const request = await getRequestForTenant(requestId, ctx);
|
|
876
|
+
if (!request)
|
|
877
|
+
throw new Error("Request not found");
|
|
878
|
+
const timestamp = now();
|
|
879
|
+
const reviewer = ctx.ownerEmail;
|
|
880
|
+
const staleApplyingBefore = timestamp - 5 * 60 * 1000;
|
|
881
|
+
// Fence the transition on the current status — scoped to caller's tenant —
|
|
882
|
+
// so a concurrent approve can't both win: only the caller that flips
|
|
883
|
+
// pending -> applying proceeds to create the secret/grant. A crashed worker
|
|
884
|
+
// leaves an applying row behind, so a later reviewer may reclaim a lease
|
|
885
|
+
// that has been idle for five minutes. See
|
|
886
|
+
// claimAgentTeamRun in packages/core/src/server/agent-teams-run-queue.ts
|
|
887
|
+
// for the same pattern.
|
|
888
|
+
const claimed = await db
|
|
889
|
+
.update(schema.vaultRequests)
|
|
890
|
+
.set({
|
|
891
|
+
status: "applying",
|
|
892
|
+
updatedAt: timestamp,
|
|
893
|
+
})
|
|
894
|
+
.where(and(eq(schema.vaultRequests.id, requestId), tenantScope(schema.vaultRequests, ctx), or(eq(schema.vaultRequests.status, "pending"), and(eq(schema.vaultRequests.status, "applying"), sql `${schema.vaultRequests.updatedAt} < ${staleApplyingBefore}`))))
|
|
895
|
+
.returning();
|
|
896
|
+
if (claimed.length === 0) {
|
|
897
|
+
const current = await getRequestForTenant(requestId, ctx);
|
|
898
|
+
if (current?.status === "applying") {
|
|
899
|
+
throw new Error("Vault request is already being applied");
|
|
900
|
+
}
|
|
901
|
+
return current;
|
|
902
|
+
}
|
|
903
|
+
const claimedRequest = claimed[0];
|
|
904
|
+
// Secret + grant must land in the REQUEST's tenant, not the approver's
|
|
905
|
+
// (the approver may be acting on behalf of another user in the same org).
|
|
906
|
+
const requestCtx = ctxForRow(claimedRequest);
|
|
907
|
+
try {
|
|
908
|
+
// Check if secret already exists in the request's tenant for this key.
|
|
909
|
+
const existingSecrets = await db
|
|
910
|
+
.select()
|
|
911
|
+
.from(schema.vaultSecrets)
|
|
912
|
+
.where(and(eq(schema.vaultSecrets.credentialKey, claimedRequest.credentialKey), ctxScope(schema.vaultSecrets, requestCtx)));
|
|
913
|
+
let secret = existingSecrets[0] ?? null;
|
|
914
|
+
if (!secret) {
|
|
915
|
+
secret = await createSecret({
|
|
916
|
+
credentialKey: claimedRequest.credentialKey,
|
|
917
|
+
value: secretValue,
|
|
918
|
+
name: secretName || claimedRequest.credentialKey,
|
|
919
|
+
}, requestCtx);
|
|
920
|
+
}
|
|
921
|
+
if (secret) {
|
|
922
|
+
// Create the grant in the request's tenant as well.
|
|
923
|
+
await createGrant(secret.id, claimedRequest.appId, requestCtx);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
catch (error) {
|
|
927
|
+
await db
|
|
928
|
+
.update(schema.vaultRequests)
|
|
929
|
+
.set({ status: "pending", updatedAt: now() })
|
|
930
|
+
.where(and(eq(schema.vaultRequests.id, requestId), tenantScope(schema.vaultRequests, ctx), eq(schema.vaultRequests.status, "applying")));
|
|
931
|
+
throw error;
|
|
932
|
+
}
|
|
933
|
+
await db
|
|
934
|
+
.update(schema.vaultRequests)
|
|
935
|
+
.set({
|
|
936
|
+
status: "approved",
|
|
937
|
+
reviewedBy: reviewer,
|
|
938
|
+
reviewedAt: timestamp,
|
|
939
|
+
updatedAt: now(),
|
|
940
|
+
})
|
|
941
|
+
.where(and(eq(schema.vaultRequests.id, requestId), tenantScope(schema.vaultRequests, ctx), eq(schema.vaultRequests.status, "applying")));
|
|
942
|
+
await recordVaultAudit({
|
|
943
|
+
action: "request.approved",
|
|
944
|
+
appId: claimedRequest.appId,
|
|
945
|
+
summary: `Approved ${claimedRequest.credentialKey} for ${claimedRequest.appId} (requested by ${claimedRequest.requestedBy})`,
|
|
946
|
+
metadata: { requestId, reviewer },
|
|
947
|
+
});
|
|
948
|
+
return getRequestForTenant(requestId, ctx);
|
|
949
|
+
}
|
|
950
|
+
export async function denyRequest(requestId, reason, ctx = requireVaultCtx()) {
|
|
951
|
+
await assertCanManageVault();
|
|
952
|
+
const db = getDb();
|
|
953
|
+
const request = await getRequestForTenant(requestId, ctx);
|
|
954
|
+
if (!request)
|
|
955
|
+
throw new Error("Request not found");
|
|
956
|
+
const timestamp = now();
|
|
957
|
+
const reviewer = ctx.ownerEmail;
|
|
958
|
+
const claimed = await db
|
|
959
|
+
.update(schema.vaultRequests)
|
|
960
|
+
.set({
|
|
961
|
+
status: "denied",
|
|
962
|
+
reviewedBy: reviewer,
|
|
963
|
+
reviewedAt: timestamp,
|
|
964
|
+
updatedAt: timestamp,
|
|
965
|
+
})
|
|
966
|
+
.where(and(eq(schema.vaultRequests.id, requestId), tenantScope(schema.vaultRequests, ctx), eq(schema.vaultRequests.status, "pending")))
|
|
967
|
+
.returning();
|
|
968
|
+
if (claimed.length === 0) {
|
|
969
|
+
return getRequestForTenant(requestId, ctx);
|
|
970
|
+
}
|
|
971
|
+
const claimedRequest = claimed[0];
|
|
972
|
+
await recordVaultAudit({
|
|
973
|
+
action: "request.denied",
|
|
974
|
+
appId: claimedRequest.appId,
|
|
975
|
+
summary: `Denied ${claimedRequest.credentialKey} for ${claimedRequest.appId} (requested by ${claimedRequest.requestedBy})`,
|
|
976
|
+
metadata: { requestId, reviewer, reason },
|
|
977
|
+
});
|
|
978
|
+
return getRequestForTenant(requestId, ctx);
|
|
979
|
+
}
|
|
980
|
+
export async function listIntegrationsCatalog() {
|
|
981
|
+
const access = await getVaultAccessSettings();
|
|
982
|
+
const agents = await discoverAgents("dispatch");
|
|
983
|
+
const grants = (await canManageVault()) ? await listGrants() : [];
|
|
984
|
+
const secrets = await listSecretOptions();
|
|
985
|
+
const secretByKey = new Map(secrets.map((s) => [s.credentialKey, s]));
|
|
986
|
+
const results = [];
|
|
987
|
+
for (const agent of agents) {
|
|
988
|
+
try {
|
|
989
|
+
const res = await ssrfSafeFetch(`${agent.url}/_agent-native/env-status`, {
|
|
990
|
+
signal: AbortSignal.timeout(3000),
|
|
991
|
+
}, { maxRedirects: 3 });
|
|
992
|
+
if (!res.ok) {
|
|
993
|
+
results.push({
|
|
994
|
+
appId: agent.id,
|
|
995
|
+
appName: agent.name,
|
|
996
|
+
url: agent.url,
|
|
997
|
+
color: agent.color,
|
|
998
|
+
integrations: [],
|
|
999
|
+
vaultAccessMode: access.mode,
|
|
1000
|
+
reachable: false,
|
|
1001
|
+
});
|
|
1002
|
+
continue;
|
|
1003
|
+
}
|
|
1004
|
+
const envStatus = await res.json();
|
|
1005
|
+
const appGrants = grants.filter((g) => g.appId === agent.id && g.status === "active");
|
|
1006
|
+
const grantedSecretIds = new Set(appGrants.map((g) => g.secretId));
|
|
1007
|
+
const integrations = envStatus.map((env) => {
|
|
1008
|
+
const matchingSecret = secretByKey.get(env.key);
|
|
1009
|
+
return {
|
|
1010
|
+
key: env.key,
|
|
1011
|
+
label: env.label,
|
|
1012
|
+
required: env.required,
|
|
1013
|
+
configured: env.configured,
|
|
1014
|
+
vaultGranted: !!matchingSecret &&
|
|
1015
|
+
(access.mode === "all-apps" ||
|
|
1016
|
+
grantedSecretIds.has(matchingSecret.id)),
|
|
1017
|
+
vaultSecretId: matchingSecret?.id,
|
|
1018
|
+
};
|
|
1019
|
+
});
|
|
1020
|
+
results.push({
|
|
1021
|
+
appId: agent.id,
|
|
1022
|
+
appName: agent.name,
|
|
1023
|
+
url: agent.url,
|
|
1024
|
+
color: agent.color,
|
|
1025
|
+
integrations,
|
|
1026
|
+
vaultAccessMode: access.mode,
|
|
1027
|
+
reachable: true,
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
catch {
|
|
1031
|
+
results.push({
|
|
1032
|
+
appId: agent.id,
|
|
1033
|
+
appName: agent.name,
|
|
1034
|
+
url: agent.url,
|
|
1035
|
+
color: agent.color,
|
|
1036
|
+
integrations: [],
|
|
1037
|
+
vaultAccessMode: access.mode,
|
|
1038
|
+
reachable: false,
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return results;
|
|
1043
|
+
}
|
|
1044
|
+
// ─── Vault Overview (for dashboard) ──────────────────────────────
|
|
1045
|
+
export async function listVaultOverview() {
|
|
1046
|
+
const isAdmin = await canManageVault();
|
|
1047
|
+
const [secrets, grants, requests, access] = await Promise.all([
|
|
1048
|
+
listSecretOptions(),
|
|
1049
|
+
isAdmin ? listGrants() : Promise.resolve([]),
|
|
1050
|
+
listRequests(),
|
|
1051
|
+
getVaultAccessSettings(),
|
|
1052
|
+
]);
|
|
1053
|
+
const manualGrantCount = grants.filter((g) => g.status === "active").length;
|
|
1054
|
+
return {
|
|
1055
|
+
accessMode: access.mode,
|
|
1056
|
+
secretCount: secrets.length,
|
|
1057
|
+
activeGrantCount: access.mode === "all-apps"
|
|
1058
|
+
? secrets.length
|
|
1059
|
+
: isAdmin
|
|
1060
|
+
? manualGrantCount
|
|
1061
|
+
: 0,
|
|
1062
|
+
manualGrantCount: isAdmin ? manualGrantCount : 0,
|
|
1063
|
+
pendingRequestCount: requests.filter((r) => r.status === "pending").length,
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
// ─── SendGrid Notifications ──────────────────────────────────────
|
|
1067
|
+
async function notifyAdminsOfRequest(requestId, input) {
|
|
1068
|
+
const apiKey = process.env.SENDGRID_API_KEY;
|
|
1069
|
+
const from = process.env.SENDGRID_FROM_EMAIL;
|
|
1070
|
+
const appUrl = process.env.APP_URL;
|
|
1071
|
+
if (!apiKey || !from || !appUrl)
|
|
1072
|
+
return;
|
|
1073
|
+
// Use approval policy approver emails as admin notification targets
|
|
1074
|
+
const { getApprovalPolicy } = await import("./dispatch-store.js");
|
|
1075
|
+
const policy = await getApprovalPolicy();
|
|
1076
|
+
if (policy.approverEmails.length === 0)
|
|
1077
|
+
return;
|
|
1078
|
+
const body = [
|
|
1079
|
+
`Secret request: ${input.credentialKey} for ${input.appId}`,
|
|
1080
|
+
input.reason ? `Reason: ${input.reason}` : "",
|
|
1081
|
+
`Requested by: ${currentOwnerEmail()}`,
|
|
1082
|
+
"",
|
|
1083
|
+
`Review it here: ${appUrl}/vault`,
|
|
1084
|
+
]
|
|
1085
|
+
.filter(Boolean)
|
|
1086
|
+
.join("\n");
|
|
1087
|
+
await fetch("https://api.sendgrid.com/v3/mail/send", {
|
|
1088
|
+
method: "POST",
|
|
1089
|
+
headers: {
|
|
1090
|
+
Authorization: `Bearer ${apiKey}`,
|
|
1091
|
+
"Content-Type": "application/json",
|
|
1092
|
+
},
|
|
1093
|
+
body: JSON.stringify({
|
|
1094
|
+
personalizations: [
|
|
1095
|
+
{
|
|
1096
|
+
to: policy.approverEmails.map((email) => ({ email })),
|
|
1097
|
+
subject: `Vault request: ${input.credentialKey} for ${input.appId}`,
|
|
1098
|
+
},
|
|
1099
|
+
],
|
|
1100
|
+
from: { email: from },
|
|
1101
|
+
content: [{ type: "text/plain", value: body }],
|
|
1102
|
+
custom_args: { requestId },
|
|
1103
|
+
}),
|
|
1104
|
+
}).catch(() => { });
|
|
1105
|
+
}
|
|
1106
|
+
//# sourceMappingURL=vault-store.js.map
|