@rudderhq/server 0.1.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +14 -0
- package/dist/agent-auth-jwt.d.ts +14 -0
- package/dist/agent-auth-jwt.d.ts.map +1 -0
- package/dist/agent-auth-jwt.js +119 -0
- package/dist/agent-auth-jwt.js.map +1 -0
- package/dist/agent-runtimes/codex-models.d.ts +4 -0
- package/dist/agent-runtimes/codex-models.d.ts.map +1 -0
- package/dist/agent-runtimes/codex-models.js +98 -0
- package/dist/agent-runtimes/codex-models.js.map +1 -0
- package/dist/agent-runtimes/cursor-models.d.ts +13 -0
- package/dist/agent-runtimes/cursor-models.d.ts.map +1 -0
- package/dist/agent-runtimes/cursor-models.js +148 -0
- package/dist/agent-runtimes/cursor-models.js.map +1 -0
- package/dist/agent-runtimes/http/execute.d.ts +3 -0
- package/dist/agent-runtimes/http/execute.d.ts.map +1 -0
- package/dist/agent-runtimes/http/execute.js +39 -0
- package/dist/agent-runtimes/http/execute.js.map +1 -0
- package/dist/agent-runtimes/http/index.d.ts +3 -0
- package/dist/agent-runtimes/http/index.d.ts.map +1 -0
- package/dist/agent-runtimes/http/index.js +20 -0
- package/dist/agent-runtimes/http/index.js.map +1 -0
- package/dist/agent-runtimes/http/test.d.ts +3 -0
- package/dist/agent-runtimes/http/test.d.ts.map +1 -0
- package/dist/agent-runtimes/http/test.js +106 -0
- package/dist/agent-runtimes/http/test.js.map +1 -0
- package/dist/agent-runtimes/index.d.ts +4 -0
- package/dist/agent-runtimes/index.d.ts.map +1 -0
- package/dist/agent-runtimes/index.js +3 -0
- package/dist/agent-runtimes/index.js.map +1 -0
- package/dist/agent-runtimes/process/execute.d.ts +3 -0
- package/dist/agent-runtimes/process/execute.d.ts.map +1 -0
- package/dist/agent-runtimes/process/execute.js +63 -0
- package/dist/agent-runtimes/process/execute.js.map +1 -0
- package/dist/agent-runtimes/process/index.d.ts +3 -0
- package/dist/agent-runtimes/process/index.d.ts.map +1 -0
- package/dist/agent-runtimes/process/index.js +23 -0
- package/dist/agent-runtimes/process/index.js.map +1 -0
- package/dist/agent-runtimes/process/test.d.ts +3 -0
- package/dist/agent-runtimes/process/test.d.ts.map +1 -0
- package/dist/agent-runtimes/process/test.js +77 -0
- package/dist/agent-runtimes/process/test.js.map +1 -0
- package/dist/agent-runtimes/registry.d.ts +9 -0
- package/dist/agent-runtimes/registry.d.ts.map +1 -0
- package/dist/agent-runtimes/registry.js +189 -0
- package/dist/agent-runtimes/registry.js.map +1 -0
- package/dist/agent-runtimes/types.d.ts +2 -0
- package/dist/agent-runtimes/types.d.ts.map +1 -0
- package/dist/agent-runtimes/types.js +2 -0
- package/dist/agent-runtimes/types.js.map +1 -0
- package/dist/agent-runtimes/utils.d.ts +10 -0
- package/dist/agent-runtimes/utils.d.ts.map +1 -0
- package/dist/agent-runtimes/utils.js +14 -0
- package/dist/agent-runtimes/utils.js.map +1 -0
- package/dist/agent-workspace-key.d.ts +17 -0
- package/dist/agent-workspace-key.d.ts.map +1 -0
- package/dist/agent-workspace-key.js +49 -0
- package/dist/agent-workspace-key.js.map +1 -0
- package/dist/app.d.ts +14 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +19 -0
- package/dist/app.js.map +1 -0
- package/dist/attachment-types.d.ts +33 -0
- package/dist/attachment-types.d.ts.map +1 -0
- package/dist/attachment-types.js +67 -0
- package/dist/attachment-types.js.map +1 -0
- package/dist/auth/better-auth.d.ts +24 -0
- package/dist/auth/better-auth.d.ts.map +1 -0
- package/dist/auth/better-auth.js +108 -0
- package/dist/auth/better-auth.js.map +1 -0
- package/dist/board-claim.d.ts +23 -0
- package/dist/board-claim.d.ts.map +1 -0
- package/dist/board-claim.js +115 -0
- package/dist/board-claim.js.map +1 -0
- package/dist/bootstrap/create-http-app.d.ts +6 -0
- package/dist/bootstrap/create-http-app.d.ts.map +1 -0
- package/dist/bootstrap/create-http-app.js +122 -0
- package/dist/bootstrap/create-http-app.js.map +1 -0
- package/dist/bootstrap/plugin-host-runtime.d.ts +116 -0
- package/dist/bootstrap/plugin-host-runtime.d.ts.map +1 -0
- package/dist/bootstrap/plugin-host-runtime.js +121 -0
- package/dist/bootstrap/plugin-host-runtime.js.map +1 -0
- package/dist/bootstrap/register-api-routes.d.ts +5 -0
- package/dist/bootstrap/register-api-routes.d.ts.map +1 -0
- package/dist/bootstrap/register-api-routes.js +65 -0
- package/dist/bootstrap/register-api-routes.js.map +1 -0
- package/dist/bootstrap/types.d.ts +24 -0
- package/dist/bootstrap/types.d.ts.map +1 -0
- package/dist/bootstrap/types.js +2 -0
- package/dist/bootstrap/types.js.map +1 -0
- package/dist/config-file.d.ts +5 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +48 -0
- package/dist/config-file.js.map +1 -0
- package/dist/config.d.ts +45 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +233 -0
- package/dist/config.js.map +1 -0
- package/dist/dev-server-status.d.ts +29 -0
- package/dist/dev-server-status.d.ts.map +1 -0
- package/dist/dev-server-status.js +75 -0
- package/dist/dev-server-status.js.map +1 -0
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -0
- package/dist/home-paths.d.ts +50 -0
- package/dist/home-paths.d.ts.map +1 -0
- package/dist/home-paths.js +183 -0
- package/dist/home-paths.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +827 -0
- package/dist/index.js.map +1 -0
- package/dist/langfuse-transcript.d.ts +32 -0
- package/dist/langfuse-transcript.d.ts.map +1 -0
- package/dist/langfuse-transcript.js +341 -0
- package/dist/langfuse-transcript.js.map +1 -0
- package/dist/langfuse.d.ts +93 -0
- package/dist/langfuse.d.ts.map +1 -0
- package/dist/langfuse.js +412 -0
- package/dist/langfuse.js.map +1 -0
- package/dist/local-runtime.d.ts +67 -0
- package/dist/local-runtime.d.ts.map +1 -0
- package/dist/local-runtime.js +302 -0
- package/dist/local-runtime.js.map +1 -0
- package/dist/log-redaction.d.ts +11 -0
- package/dist/log-redaction.d.ts.map +1 -0
- package/dist/log-redaction.js +118 -0
- package/dist/log-redaction.js.map +1 -0
- package/dist/middleware/auth.d.ts +12 -0
- package/dist/middleware/auth.d.ts.map +1 -0
- package/dist/middleware/auth.js +144 -0
- package/dist/middleware/auth.js.map +1 -0
- package/dist/middleware/board-mutation-guard.d.ts +3 -0
- package/dist/middleware/board-mutation-guard.d.ts.map +1 -0
- package/dist/middleware/board-mutation-guard.js +59 -0
- package/dist/middleware/board-mutation-guard.js.map +1 -0
- package/dist/middleware/error-handler.d.ts +17 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/error-handler.js +37 -0
- package/dist/middleware/error-handler.js.map +1 -0
- package/dist/middleware/index.d.ts +4 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +4 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/logger.d.ts +4 -0
- package/dist/middleware/logger.d.ts.map +1 -0
- package/dist/middleware/logger.js +133 -0
- package/dist/middleware/logger.js.map +1 -0
- package/dist/middleware/private-hostname-guard.d.ts +11 -0
- package/dist/middleware/private-hostname-guard.d.ts.map +1 -0
- package/dist/middleware/private-hostname-guard.js +78 -0
- package/dist/middleware/private-hostname-guard.js.map +1 -0
- package/dist/middleware/validate.d.ts +4 -0
- package/dist/middleware/validate.d.ts.map +1 -0
- package/dist/middleware/validate.js +7 -0
- package/dist/middleware/validate.js.map +1 -0
- package/dist/onboarding-assets/ceo/AGENTS.md +33 -0
- package/dist/onboarding-assets/ceo/HEARTBEAT.md +77 -0
- package/dist/onboarding-assets/ceo/SOUL.md +33 -0
- package/dist/onboarding-assets/ceo/TOOLS.md +3 -0
- package/dist/onboarding-assets/default/AGENTS.md +9 -0
- package/dist/onboarding-assets/default/HEARTBEAT.md +36 -0
- package/dist/onboarding-assets/default/SOUL.md +23 -0
- package/dist/onboarding-assets/default/TOOLS.md +3 -0
- package/dist/paths.d.ts +3 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +31 -0
- package/dist/paths.js.map +1 -0
- package/dist/realtime/live-events-ws.d.ts +28 -0
- package/dist/realtime/live-events-ws.d.ts.map +1 -0
- package/dist/realtime/live-events-ws.js +187 -0
- package/dist/realtime/live-events-ws.js.map +1 -0
- package/dist/redaction.d.ts +4 -0
- package/dist/redaction.d.ts.map +1 -0
- package/dist/redaction.js +63 -0
- package/dist/redaction.js.map +1 -0
- package/dist/routes/access.d.ts +57 -0
- package/dist/routes/access.d.ts.map +1 -0
- package/dist/routes/access.js +2266 -0
- package/dist/routes/access.js.map +1 -0
- package/dist/routes/activity.d.ts +3 -0
- package/dist/routes/activity.d.ts.map +1 -0
- package/dist/routes/activity.js +78 -0
- package/dist/routes/activity.js.map +1 -0
- package/dist/routes/agents.d.ts +3 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/agents.js +1913 -0
- package/dist/routes/agents.js.map +1 -0
- package/dist/routes/approvals.d.ts +3 -0
- package/dist/routes/approvals.d.ts.map +1 -0
- package/dist/routes/approvals.js +365 -0
- package/dist/routes/approvals.js.map +1 -0
- package/dist/routes/assets.d.ts +4 -0
- package/dist/routes/assets.d.ts.map +1 -0
- package/dist/routes/assets.js +309 -0
- package/dist/routes/assets.js.map +1 -0
- package/dist/routes/authz.d.ts +16 -0
- package/dist/routes/authz.d.ts.map +1 -0
- package/dist/routes/authz.js +47 -0
- package/dist/routes/authz.js.map +1 -0
- package/dist/routes/automations.d.ts +3 -0
- package/dist/routes/automations.d.ts.map +1 -0
- package/dist/routes/automations.js +277 -0
- package/dist/routes/automations.js.map +1 -0
- package/dist/routes/chats.d.ts +4 -0
- package/dist/routes/chats.d.ts.map +1 -0
- package/dist/routes/chats.js +1162 -0
- package/dist/routes/chats.js.map +1 -0
- package/dist/routes/costs.d.ts +3 -0
- package/dist/routes/costs.d.ts.map +1 -0
- package/dist/routes/costs.js +268 -0
- package/dist/routes/costs.js.map +1 -0
- package/dist/routes/dashboard.d.ts +3 -0
- package/dist/routes/dashboard.d.ts.map +1 -0
- package/dist/routes/dashboard.js +15 -0
- package/dist/routes/dashboard.js.map +1 -0
- package/dist/routes/execution-workspaces.d.ts +3 -0
- package/dist/routes/execution-workspaces.d.ts.map +1 -0
- package/dist/routes/execution-workspaces.js +165 -0
- package/dist/routes/execution-workspaces.js.map +1 -0
- package/dist/routes/goals.d.ts +3 -0
- package/dist/routes/goals.d.ts.map +1 -0
- package/dist/routes/goals.js +95 -0
- package/dist/routes/goals.js.map +1 -0
- package/dist/routes/health.d.ts +12 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/health.js +85 -0
- package/dist/routes/health.js.map +1 -0
- package/dist/routes/index.d.ts +19 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +19 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/instance-settings.d.ts +6 -0
- package/dist/routes/instance-settings.d.ts.map +1 -0
- package/dist/routes/instance-settings.js +250 -0
- package/dist/routes/instance-settings.js.map +1 -0
- package/dist/routes/issues-checkout-wakeup.d.ts +9 -0
- package/dist/routes/issues-checkout-wakeup.d.ts.map +1 -0
- package/dist/routes/issues-checkout-wakeup.js +12 -0
- package/dist/routes/issues-checkout-wakeup.js.map +1 -0
- package/dist/routes/issues.d.ts +4 -0
- package/dist/routes/issues.d.ts.map +1 -0
- package/dist/routes/issues.js +1615 -0
- package/dist/routes/issues.js.map +1 -0
- package/dist/routes/llms.d.ts +3 -0
- package/dist/routes/llms.d.ts.map +1 -0
- package/dist/routes/llms.js +78 -0
- package/dist/routes/llms.js.map +1 -0
- package/dist/routes/messenger.d.ts +3 -0
- package/dist/routes/messenger.d.ts.map +1 -0
- package/dist/routes/messenger.js +108 -0
- package/dist/routes/messenger.js.map +1 -0
- package/dist/routes/org-chart-logo.d.ts +2 -0
- package/dist/routes/org-chart-logo.d.ts.map +1 -0
- package/dist/routes/org-chart-logo.js +2 -0
- package/dist/routes/org-chart-logo.js.map +1 -0
- package/dist/routes/org-chart-svg.d.ts +25 -0
- package/dist/routes/org-chart-svg.d.ts.map +1 -0
- package/dist/routes/org-chart-svg.js +652 -0
- package/dist/routes/org-chart-svg.js.map +1 -0
- package/dist/routes/organization-skills.d.ts +3 -0
- package/dist/routes/organization-skills.d.ts.map +1 -0
- package/dist/routes/organization-skills.js +253 -0
- package/dist/routes/organization-skills.js.map +1 -0
- package/dist/routes/orgs.d.ts +4 -0
- package/dist/routes/orgs.d.ts.map +1 -0
- package/dist/routes/orgs.js +575 -0
- package/dist/routes/orgs.js.map +1 -0
- package/dist/routes/plugin-ui-static.d.ts +69 -0
- package/dist/routes/plugin-ui-static.d.ts.map +1 -0
- package/dist/routes/plugin-ui-static.js +411 -0
- package/dist/routes/plugin-ui-static.js.map +1 -0
- package/dist/routes/plugins.d.ts +120 -0
- package/dist/routes/plugins.d.ts.map +1 -0
- package/dist/routes/plugins.js +1776 -0
- package/dist/routes/plugins.js.map +1 -0
- package/dist/routes/projects.d.ts +3 -0
- package/dist/routes/projects.d.ts.map +1 -0
- package/dist/routes/projects.js +235 -0
- package/dist/routes/projects.js.map +1 -0
- package/dist/routes/run-intelligence.d.ts +3 -0
- package/dist/routes/run-intelligence.d.ts.map +1 -0
- package/dist/routes/run-intelligence.js +58 -0
- package/dist/routes/run-intelligence.js.map +1 -0
- package/dist/routes/secrets.d.ts +3 -0
- package/dist/routes/secrets.d.ts.map +1 -0
- package/dist/routes/secrets.js +128 -0
- package/dist/routes/secrets.js.map +1 -0
- package/dist/routes/sidebar-badges.d.ts +3 -0
- package/dist/routes/sidebar-badges.d.ts.map +1 -0
- package/dist/routes/sidebar-badges.js +70 -0
- package/dist/routes/sidebar-badges.js.map +1 -0
- package/dist/secrets/external-stub-providers.d.ts +5 -0
- package/dist/secrets/external-stub-providers.d.ts.map +1 -0
- package/dist/secrets/external-stub-providers.js +21 -0
- package/dist/secrets/external-stub-providers.js.map +1 -0
- package/dist/secrets/local-encrypted-provider.d.ts +3 -0
- package/dist/secrets/local-encrypted-provider.d.ts.map +1 -0
- package/dist/secrets/local-encrypted-provider.js +116 -0
- package/dist/secrets/local-encrypted-provider.js.map +1 -0
- package/dist/secrets/provider-registry.d.ts +5 -0
- package/dist/secrets/provider-registry.d.ts.map +1 -0
- package/dist/secrets/provider-registry.js +20 -0
- package/dist/secrets/provider-registry.js.map +1 -0
- package/dist/secrets/types.d.ts +21 -0
- package/dist/secrets/types.d.ts.map +1 -0
- package/dist/secrets/types.js +2 -0
- package/dist/secrets/types.js.map +1 -0
- package/dist/services/access.d.ts +113 -0
- package/dist/services/access.d.ts.map +1 -0
- package/dist/services/access.js +247 -0
- package/dist/services/access.js.map +1 -0
- package/dist/services/activity-log.d.ts +17 -0
- package/dist/services/activity-log.d.ts.map +1 -0
- package/dist/services/activity-log.js +109 -0
- package/dist/services/activity-log.js.map +1 -0
- package/dist/services/activity.d.ts +472 -0
- package/dist/services/activity.d.ts.map +1 -0
- package/dist/services/activity.js +134 -0
- package/dist/services/activity.js.map +1 -0
- package/dist/services/agent-enabled-skills.d.ts +9 -0
- package/dist/services/agent-enabled-skills.d.ts.map +1 -0
- package/dist/services/agent-enabled-skills.js +89 -0
- package/dist/services/agent-enabled-skills.js.map +1 -0
- package/dist/services/agent-instructions.d.ts +98 -0
- package/dist/services/agent-instructions.d.ts.map +1 -0
- package/dist/services/agent-instructions.js +596 -0
- package/dist/services/agent-instructions.js.map +1 -0
- package/dist/services/agent-name-pool.d.ts +10 -0
- package/dist/services/agent-name-pool.d.ts.map +1 -0
- package/dist/services/agent-name-pool.js +230 -0
- package/dist/services/agent-name-pool.js.map +1 -0
- package/dist/services/agent-permissions.d.ts +6 -0
- package/dist/services/agent-permissions.d.ts.map +1 -0
- package/dist/services/agent-permissions.js +18 -0
- package/dist/services/agent-permissions.js.map +1 -0
- package/dist/services/agent-run-context.d.ts +142 -0
- package/dist/services/agent-run-context.d.ts.map +1 -0
- package/dist/services/agent-run-context.js +451 -0
- package/dist/services/agent-run-context.js.map +1 -0
- package/dist/services/agents.d.ts +1713 -0
- package/dist/services/agents.d.ts.map +1 -0
- package/dist/services/agents.js +750 -0
- package/dist/services/agents.js.map +1 -0
- package/dist/services/approvals.d.ts +546 -0
- package/dist/services/approvals.d.ts.map +1 -0
- package/dist/services/approvals.js +212 -0
- package/dist/services/approvals.js.map +1 -0
- package/dist/services/assets.d.ts +33 -0
- package/dist/services/assets.d.ts.map +1 -0
- package/dist/services/assets.js +17 -0
- package/dist/services/assets.js.map +1 -0
- package/dist/services/automations.d.ts +135 -0
- package/dist/services/automations.d.ts.map +1 -0
- package/dist/services/automations.js +1105 -0
- package/dist/services/automations.js.map +1 -0
- package/dist/services/board-auth.d.ts +234 -0
- package/dist/services/board-auth.d.ts.map +1 -0
- package/dist/services/board-auth.js +295 -0
- package/dist/services/board-auth.js.map +1 -0
- package/dist/services/budgets.d.ts +38 -0
- package/dist/services/budgets.d.ts.map +1 -0
- package/dist/services/budgets.js +784 -0
- package/dist/services/budgets.js.map +1 -0
- package/dist/services/chat-assistant.d.ts +62 -0
- package/dist/services/chat-assistant.d.ts.map +1 -0
- package/dist/services/chat-assistant.js +943 -0
- package/dist/services/chat-assistant.js.map +1 -0
- package/dist/services/chat-generation-locks.d.ts +3 -0
- package/dist/services/chat-generation-locks.d.ts.map +1 -0
- package/dist/services/chat-generation-locks.js +16 -0
- package/dist/services/chat-generation-locks.js.map +1 -0
- package/dist/services/chats.d.ts +723 -0
- package/dist/services/chats.d.ts.map +1 -0
- package/dist/services/chats.js +1188 -0
- package/dist/services/chats.js.map +1 -0
- package/dist/services/costs.d.ts +114 -0
- package/dist/services/costs.d.ts.map +1 -0
- package/dist/services/costs.js +326 -0
- package/dist/services/costs.js.map +1 -0
- package/dist/services/cron.d.ts +80 -0
- package/dist/services/cron.d.ts.map +1 -0
- package/dist/services/cron.js +300 -0
- package/dist/services/cron.js.map +1 -0
- package/dist/services/dashboard.d.ts +26 -0
- package/dist/services/dashboard.d.ts.map +1 -0
- package/dist/services/dashboard.js +98 -0
- package/dist/services/dashboard.js.map +1 -0
- package/dist/services/default-agent-instructions.d.ts +9 -0
- package/dist/services/default-agent-instructions.d.ts.map +1 -0
- package/dist/services/default-agent-instructions.js +20 -0
- package/dist/services/default-agent-instructions.js.map +1 -0
- package/dist/services/documents.d.ts +164 -0
- package/dist/services/documents.d.ts.map +1 -0
- package/dist/services/documents.js +382 -0
- package/dist/services/documents.js.map +1 -0
- package/dist/services/execution-workspace-policy.d.ts +20 -0
- package/dist/services/execution-workspace-policy.d.ts.map +1 -0
- package/dist/services/execution-workspace-policy.js +172 -0
- package/dist/services/execution-workspace-policy.js.map +1 -0
- package/dist/services/execution-workspaces.d.ts +19 -0
- package/dist/services/execution-workspaces.d.ts.map +1 -0
- package/dist/services/execution-workspaces.js +87 -0
- package/dist/services/execution-workspaces.js.map +1 -0
- package/dist/services/finance.d.ts +93 -0
- package/dist/services/finance.d.ts.map +1 -0
- package/dist/services/finance.js +120 -0
- package/dist/services/finance.js.map +1 -0
- package/dist/services/goals.d.ts +433 -0
- package/dist/services/goals.d.ts.map +1 -0
- package/dist/services/goals.js +54 -0
- package/dist/services/goals.js.map +1 -0
- package/dist/services/heartbeat-run-summary.d.ts +2 -0
- package/dist/services/heartbeat-run-summary.d.ts.map +1 -0
- package/dist/services/heartbeat-run-summary.js +131 -0
- package/dist/services/heartbeat-run-summary.js.map +1 -0
- package/dist/services/heartbeat.d.ts +2 -0
- package/dist/services/heartbeat.d.ts.map +1 -0
- package/dist/services/heartbeat.js +2 -0
- package/dist/services/heartbeat.js.map +1 -0
- package/dist/services/hire-hook.d.ts +14 -0
- package/dist/services/hire-hook.d.ts.map +1 -0
- package/dist/services/hire-hook.js +85 -0
- package/dist/services/hire-hook.js.map +1 -0
- package/dist/services/index.d.ts +38 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +38 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/instance-settings.d.ts +14 -0
- package/dist/services/instance-settings.d.ts.map +1 -0
- package/dist/services/instance-settings.js +158 -0
- package/dist/services/instance-settings.js.map +1 -0
- package/dist/services/issue-approvals.d.ts +56 -0
- package/dist/services/issue-approvals.d.ts.map +1 -0
- package/dist/services/issue-approvals.js +153 -0
- package/dist/services/issue-approvals.js.map +1 -0
- package/dist/services/issue-assignment-wakeup.d.ts +32 -0
- package/dist/services/issue-assignment-wakeup.d.ts.map +1 -0
- package/dist/services/issue-assignment-wakeup.js +43 -0
- package/dist/services/issue-assignment-wakeup.js.map +1 -0
- package/dist/services/issue-goal-fallback.d.ts +15 -0
- package/dist/services/issue-goal-fallback.d.ts.map +1 -0
- package/dist/services/issue-goal-fallback.js +15 -0
- package/dist/services/issue-goal-fallback.js.map +1 -0
- package/dist/services/issues.d.ts +580 -0
- package/dist/services/issues.d.ts.map +1 -0
- package/dist/services/issues.js +1464 -0
- package/dist/services/issues.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.d.ts +23 -0
- package/dist/services/knowledge-portability/organization-portability.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.js +3795 -0
- package/dist/services/knowledge-portability/organization-portability.js.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.d.ts +105 -0
- package/dist/services/knowledge-portability/organization-skills.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.js +3172 -0
- package/dist/services/knowledge-portability/organization-skills.js.map +1 -0
- package/dist/services/live-events.d.ts +17 -0
- package/dist/services/live-events.d.ts.map +1 -0
- package/dist/services/live-events.js +33 -0
- package/dist/services/live-events.js.map +1 -0
- package/dist/services/messenger.d.ts +111 -0
- package/dist/services/messenger.d.ts.map +1 -0
- package/dist/services/messenger.js +774 -0
- package/dist/services/messenger.js.map +1 -0
- package/dist/services/native-path-picker.d.ts +18 -0
- package/dist/services/native-path-picker.d.ts.map +1 -0
- package/dist/services/native-path-picker.js +119 -0
- package/dist/services/native-path-picker.js.map +1 -0
- package/dist/services/operator-profile.d.ts +7 -0
- package/dist/services/operator-profile.d.ts.map +1 -0
- package/dist/services/operator-profile.js +66 -0
- package/dist/services/operator-profile.js.map +1 -0
- package/dist/services/organization-export-readme.d.ts +17 -0
- package/dist/services/organization-export-readme.d.ts.map +1 -0
- package/dist/services/organization-export-readme.js +148 -0
- package/dist/services/organization-export-readme.js.map +1 -0
- package/dist/services/organization-portability.d.ts +2 -0
- package/dist/services/organization-portability.d.ts.map +1 -0
- package/dist/services/organization-portability.js +2 -0
- package/dist/services/organization-portability.js.map +1 -0
- package/dist/services/organization-skills.d.ts +2 -0
- package/dist/services/organization-skills.d.ts.map +1 -0
- package/dist/services/organization-skills.js +2 -0
- package/dist/services/organization-skills.js.map +1 -0
- package/dist/services/organization-workspace-browser.d.ts +8 -0
- package/dist/services/organization-workspace-browser.d.ts.map +1 -0
- package/dist/services/organization-workspace-browser.js +229 -0
- package/dist/services/organization-workspace-browser.js.map +1 -0
- package/dist/services/organization-workspace.d.ts +5 -0
- package/dist/services/organization-workspace.d.ts.map +1 -0
- package/dist/services/organization-workspace.js +71 -0
- package/dist/services/organization-workspace.js.map +1 -0
- package/dist/services/orgs.d.ts +163 -0
- package/dist/services/orgs.d.ts.map +1 -0
- package/dist/services/orgs.js +327 -0
- package/dist/services/orgs.js.map +1 -0
- package/dist/services/plugin-capability-validator.d.ts +108 -0
- package/dist/services/plugin-capability-validator.d.ts.map +1 -0
- package/dist/services/plugin-capability-validator.js +268 -0
- package/dist/services/plugin-capability-validator.js.map +1 -0
- package/dist/services/plugin-config-validator.d.ts +26 -0
- package/dist/services/plugin-config-validator.d.ts.map +1 -0
- package/dist/services/plugin-config-validator.js +41 -0
- package/dist/services/plugin-config-validator.js.map +1 -0
- package/dist/services/plugin-dev-watcher.d.ts +30 -0
- package/dist/services/plugin-dev-watcher.d.ts.map +1 -0
- package/dist/services/plugin-dev-watcher.js +241 -0
- package/dist/services/plugin-dev-watcher.js.map +1 -0
- package/dist/services/plugin-event-bus.d.ts +149 -0
- package/dist/services/plugin-event-bus.d.ts.map +1 -0
- package/dist/services/plugin-event-bus.js +258 -0
- package/dist/services/plugin-event-bus.js.map +1 -0
- package/dist/services/plugin-host-service-cleanup.d.ts +14 -0
- package/dist/services/plugin-host-service-cleanup.d.ts.map +1 -0
- package/dist/services/plugin-host-service-cleanup.js +37 -0
- package/dist/services/plugin-host-service-cleanup.js.map +1 -0
- package/dist/services/plugin-host-services.d.ts +13 -0
- package/dist/services/plugin-host-services.d.ts.map +1 -0
- package/dist/services/plugin-host-services.js +973 -0
- package/dist/services/plugin-host-services.js.map +1 -0
- package/dist/services/plugin-job-coordinator.d.ts +81 -0
- package/dist/services/plugin-job-coordinator.d.ts.map +1 -0
- package/dist/services/plugin-job-coordinator.js +172 -0
- package/dist/services/plugin-job-coordinator.js.map +1 -0
- package/dist/services/plugin-job-scheduler.d.ts +163 -0
- package/dist/services/plugin-job-scheduler.d.ts.map +1 -0
- package/dist/services/plugin-job-scheduler.js +564 -0
- package/dist/services/plugin-job-scheduler.js.map +1 -0
- package/dist/services/plugin-job-store.d.ts +208 -0
- package/dist/services/plugin-job-store.d.ts.map +1 -0
- package/dist/services/plugin-job-store.js +350 -0
- package/dist/services/plugin-job-store.js.map +1 -0
- package/dist/services/plugin-lifecycle.d.ts +203 -0
- package/dist/services/plugin-lifecycle.d.ts.map +1 -0
- package/dist/services/plugin-lifecycle.js +476 -0
- package/dist/services/plugin-lifecycle.js.map +1 -0
- package/dist/services/plugin-loader.d.ts +441 -0
- package/dist/services/plugin-loader.d.ts.map +1 -0
- package/dist/services/plugin-loader.js +1192 -0
- package/dist/services/plugin-loader.js.map +1 -0
- package/dist/services/plugin-log-retention.d.ts +20 -0
- package/dist/services/plugin-log-retention.d.ts.map +1 -0
- package/dist/services/plugin-log-retention.js +63 -0
- package/dist/services/plugin-log-retention.js.map +1 -0
- package/dist/services/plugin-manifest-validator.d.ts +79 -0
- package/dist/services/plugin-manifest-validator.d.ts.map +1 -0
- package/dist/services/plugin-manifest-validator.js +84 -0
- package/dist/services/plugin-manifest-validator.js.map +1 -0
- package/dist/services/plugin-registry.d.ts +2542 -0
- package/dist/services/plugin-registry.d.ts.map +1 -0
- package/dist/services/plugin-registry.js +539 -0
- package/dist/services/plugin-registry.js.map +1 -0
- package/dist/services/plugin-runtime-sandbox.d.ts +40 -0
- package/dist/services/plugin-runtime-sandbox.d.ts.map +1 -0
- package/dist/services/plugin-runtime-sandbox.js +154 -0
- package/dist/services/plugin-runtime-sandbox.js.map +1 -0
- package/dist/services/plugin-secrets-handler.d.ts +81 -0
- package/dist/services/plugin-secrets-handler.d.ts.map +1 -0
- package/dist/services/plugin-secrets-handler.js +275 -0
- package/dist/services/plugin-secrets-handler.js.map +1 -0
- package/dist/services/plugin-state-store.d.ts +92 -0
- package/dist/services/plugin-state-store.d.ts.map +1 -0
- package/dist/services/plugin-state-store.js +190 -0
- package/dist/services/plugin-state-store.js.map +1 -0
- package/dist/services/plugin-stream-bus.d.ts +29 -0
- package/dist/services/plugin-stream-bus.d.ts.map +1 -0
- package/dist/services/plugin-stream-bus.js +48 -0
- package/dist/services/plugin-stream-bus.js.map +1 -0
- package/dist/services/plugin-tool-dispatcher.d.ts +180 -0
- package/dist/services/plugin-tool-dispatcher.d.ts.map +1 -0
- package/dist/services/plugin-tool-dispatcher.js +224 -0
- package/dist/services/plugin-tool-dispatcher.js.map +1 -0
- package/dist/services/plugin-tool-registry.d.ts +192 -0
- package/dist/services/plugin-tool-registry.d.ts.map +1 -0
- package/dist/services/plugin-tool-registry.js +224 -0
- package/dist/services/plugin-tool-registry.js.map +1 -0
- package/dist/services/plugin-worker-manager.d.ts +260 -0
- package/dist/services/plugin-worker-manager.d.ts.map +1 -0
- package/dist/services/plugin-worker-manager.js +835 -0
- package/dist/services/plugin-worker-manager.js.map +1 -0
- package/dist/services/projects.d.ts +92 -0
- package/dist/services/projects.d.ts.map +1 -0
- package/dist/services/projects.js +705 -0
- package/dist/services/projects.js.map +1 -0
- package/dist/services/quota-windows.d.ts +9 -0
- package/dist/services/quota-windows.d.ts.map +1 -0
- package/dist/services/quota-windows.js +56 -0
- package/dist/services/quota-windows.js.map +1 -0
- package/dist/services/resource-catalog.d.ts +29 -0
- package/dist/services/resource-catalog.d.ts.map +1 -0
- package/dist/services/resource-catalog.js +298 -0
- package/dist/services/resource-catalog.js.map +1 -0
- package/dist/services/run-intelligence.d.ts +31 -0
- package/dist/services/run-intelligence.d.ts.map +1 -0
- package/dist/services/run-intelligence.js +315 -0
- package/dist/services/run-intelligence.js.map +1 -0
- package/dist/services/run-log-store.d.ts +36 -0
- package/dist/services/run-log-store.d.ts.map +1 -0
- package/dist/services/run-log-store.js +114 -0
- package/dist/services/run-log-store.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.d.ts +882 -0
- package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.js +4345 -0
- package/dist/services/runtime-kernel/heartbeat.js.map +1 -0
- package/dist/services/runtime-trace-metadata.d.ts +12 -0
- package/dist/services/runtime-trace-metadata.d.ts.map +1 -0
- package/dist/services/runtime-trace-metadata.js +13 -0
- package/dist/services/runtime-trace-metadata.js.map +1 -0
- package/dist/services/secrets.d.ts +511 -0
- package/dist/services/secrets.d.ts.map +1 -0
- package/dist/services/secrets.js +289 -0
- package/dist/services/secrets.js.map +1 -0
- package/dist/services/sidebar-badges.d.ts +11 -0
- package/dist/services/sidebar-badges.d.ts.map +1 -0
- package/dist/services/sidebar-badges.js +43 -0
- package/dist/services/sidebar-badges.js.map +1 -0
- package/dist/services/work-products.d.ts +14 -0
- package/dist/services/work-products.d.ts.map +1 -0
- package/dist/services/work-products.js +100 -0
- package/dist/services/work-products.js.map +1 -0
- package/dist/services/workspace-operation-log-store.d.ts +35 -0
- package/dist/services/workspace-operation-log-store.d.ts.map +1 -0
- package/dist/services/workspace-operation-log-store.js +115 -0
- package/dist/services/workspace-operation-log-store.js.map +1 -0
- package/dist/services/workspace-operations.d.ts +46 -0
- package/dist/services/workspace-operations.d.ts.map +1 -0
- package/dist/services/workspace-operations.js +237 -0
- package/dist/services/workspace-operations.js.map +1 -0
- package/dist/services/workspace-runtime.d.ts +164 -0
- package/dist/services/workspace-runtime.d.ts.map +1 -0
- package/dist/services/workspace-runtime.js +1235 -0
- package/dist/services/workspace-runtime.js.map +1 -0
- package/dist/startup-banner.d.ts +31 -0
- package/dist/startup-banner.d.ts.map +1 -0
- package/dist/startup-banner.js +121 -0
- package/dist/startup-banner.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +29 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/local-disk-provider.d.ts +3 -0
- package/dist/storage/local-disk-provider.d.ts.map +1 -0
- package/dist/storage/local-disk-provider.js +79 -0
- package/dist/storage/local-disk-provider.js.map +1 -0
- package/dist/storage/provider-registry.d.ts +4 -0
- package/dist/storage/provider-registry.d.ts.map +1 -0
- package/dist/storage/provider-registry.js +15 -0
- package/dist/storage/provider-registry.js.map +1 -0
- package/dist/storage/s3-provider.d.ts +11 -0
- package/dist/storage/s3-provider.d.ts.map +1 -0
- package/dist/storage/s3-provider.js +123 -0
- package/dist/storage/s3-provider.js.map +1 -0
- package/dist/storage/service.d.ts +3 -0
- package/dist/storage/service.d.ts.map +1 -0
- package/dist/storage/service.js +120 -0
- package/dist/storage/service.js.map +1 -0
- package/dist/storage/types.d.ts +55 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +2 -0
- package/dist/storage/types.js.map +1 -0
- package/dist/ui-branding.d.ts +14 -0
- package/dist/ui-branding.d.ts.map +1 -0
- package/dist/ui-branding.js +201 -0
- package/dist/ui-branding.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +101 -0
- package/resources/bundled-skills/para-memory-files/SKILL.md +114 -0
- package/resources/bundled-skills/para-memory-files/references/schemas.md +35 -0
- package/resources/bundled-skills/rudder/SKILL.md +265 -0
- package/resources/bundled-skills/rudder/references/api-reference.md +253 -0
- package/resources/bundled-skills/rudder/references/cli-reference.md +67 -0
- package/resources/bundled-skills/rudder/references/organization-skills.md +155 -0
- package/resources/bundled-skills/rudder-create-agent/SKILL.md +166 -0
- package/resources/bundled-skills/rudder-create-agent/references/api-reference.md +172 -0
- package/resources/bundled-skills/rudder-create-agent/references/cli-reference.md +126 -0
- package/resources/bundled-skills/rudder-create-plugin/SKILL.md +103 -0
- package/resources/community-skills/deep-research/README.md +124 -0
- package/resources/community-skills/deep-research/SKILL.md +107 -0
- package/resources/community-skills/deep-research/reference/continuation.md +169 -0
- package/resources/community-skills/deep-research/reference/html-generation.md +103 -0
- package/resources/community-skills/deep-research/reference/methodology.md +421 -0
- package/resources/community-skills/deep-research/reference/quality-gates.md +197 -0
- package/resources/community-skills/deep-research/reference/report-assembly.md +119 -0
- package/resources/community-skills/deep-research/reference/weasyprint_guidelines.md +324 -0
- package/resources/community-skills/deep-research/requirements.txt +14 -0
- package/resources/community-skills/deep-research/scripts/citation_manager.py +177 -0
- package/resources/community-skills/deep-research/scripts/md_to_html.py +330 -0
- package/resources/community-skills/deep-research/scripts/research_engine.py +582 -0
- package/resources/community-skills/deep-research/scripts/source_evaluator.py +292 -0
- package/resources/community-skills/deep-research/scripts/validate_report.py +403 -0
- package/resources/community-skills/deep-research/scripts/verify_citations.py +426 -0
- package/resources/community-skills/deep-research/scripts/verify_html.py +220 -0
- package/resources/community-skills/deep-research/templates/mckinsey_report_template.html +443 -0
- package/resources/community-skills/deep-research/templates/report_template.md +433 -0
- package/resources/community-skills/skill-creator/SKILL.md +9 -0
- package/resources/community-skills/software-product-advisor/SKILL.md +290 -0
- package/skills/para-memory-files/SKILL.md +114 -0
- package/skills/para-memory-files/references/schemas.md +35 -0
- package/skills/rudder/SKILL.md +265 -0
- package/skills/rudder/references/api-reference.md +253 -0
- package/skills/rudder/references/cli-reference.md +67 -0
- package/skills/rudder/references/organization-skills.md +155 -0
- package/skills/rudder-create-agent/SKILL.md +166 -0
- package/skills/rudder-create-agent/references/api-reference.md +172 -0
- package/skills/rudder-create-agent/references/cli-reference.md +126 -0
- package/skills/rudder-create-plugin/SKILL.md +103 -0
- package/ui-dist/android-chrome-192x192.png +0 -0
- package/ui-dist/android-chrome-512x512.png +0 -0
- package/ui-dist/android-chrome-maskable-512x512.png +0 -0
- package/ui-dist/apple-touch-icon.png +0 -0
- package/ui-dist/assets/_basePickBy-CjUu04_e.js +1 -0
- package/ui-dist/assets/_baseUniq-C9YNlrVG.js +1 -0
- package/ui-dist/assets/apl-B4CMkyY2.js +1 -0
- package/ui-dist/assets/arc-CSSZfktq.js +1 -0
- package/ui-dist/assets/architectureDiagram-2XIMDMQ5-Co78JKUi.js +36 -0
- package/ui-dist/assets/asciiarmor-Df11BRmG.js +1 -0
- package/ui-dist/assets/asn1-EdZsLKOL.js +1 -0
- package/ui-dist/assets/asterisk-B-8jnY81.js +1 -0
- package/ui-dist/assets/blockDiagram-WCTKOSBZ-2KUUIzzz.js +132 -0
- package/ui-dist/assets/brainfuck-C4LP7Hcl.js +1 -0
- package/ui-dist/assets/c4Diagram-IC4MRINW-C6pq8tPP.js +10 -0
- package/ui-dist/assets/channel-BEODbRMk.js +1 -0
- package/ui-dist/assets/chunk-4BX2VUAB-ojCLkixe.js +1 -0
- package/ui-dist/assets/chunk-55IACEB6-MGONqzmz.js +1 -0
- package/ui-dist/assets/chunk-FMBD7UC4-CmGuLv2P.js +15 -0
- package/ui-dist/assets/chunk-JSJVCQXG-BNBefVr6.js +1 -0
- package/ui-dist/assets/chunk-KX2RTZJC-DIGBQLn5.js +1 -0
- package/ui-dist/assets/chunk-NQ4KR5QH-_KEutsaQ.js +220 -0
- package/ui-dist/assets/chunk-QZHKN3VN-B6pzyuwm.js +1 -0
- package/ui-dist/assets/chunk-WL4C6EOR-B8NDzcfm.js +189 -0
- package/ui-dist/assets/classDiagram-VBA2DB6C-CsSqaaRj.js +1 -0
- package/ui-dist/assets/classDiagram-v2-RAHNMMFH-CsSqaaRj.js +1 -0
- package/ui-dist/assets/clike-B9uivgTg.js +1 -0
- package/ui-dist/assets/clojure-BMjYHr_A.js +1 -0
- package/ui-dist/assets/clone-5oWMCI0u.js +1 -0
- package/ui-dist/assets/cmake-BQqOBYOt.js +1 -0
- package/ui-dist/assets/cobol-CWcv1MsR.js +1 -0
- package/ui-dist/assets/coffeescript-S37ZYGWr.js +1 -0
- package/ui-dist/assets/commonlisp-DBKNyK5s.js +1 -0
- package/ui-dist/assets/cose-bilkent-S5V4N54A-B1t6ulcV.js +1 -0
- package/ui-dist/assets/crystal-SjHAIU92.js +1 -0
- package/ui-dist/assets/css-BnMrqG3P.js +1 -0
- package/ui-dist/assets/cypher-C_CwsFkJ.js +1 -0
- package/ui-dist/assets/cytoscape.esm-BQaXIfA_.js +331 -0
- package/ui-dist/assets/d-pRatUO7H.js +1 -0
- package/ui-dist/assets/dagre-KLK3FWXG-DWVC5_HJ.js +4 -0
- package/ui-dist/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/ui-dist/assets/diagram-E7M64L7V-C4ztYLox.js +24 -0
- package/ui-dist/assets/diagram-IFDJBPK2-DtWBGLnA.js +43 -0
- package/ui-dist/assets/diagram-P4PSJMXO-BiqiI4Df.js +24 -0
- package/ui-dist/assets/diff-DbItnlRl.js +1 -0
- package/ui-dist/assets/dockerfile-BKs6k2Af.js +1 -0
- package/ui-dist/assets/dtd-DF_7sFjM.js +1 -0
- package/ui-dist/assets/dylan-DwRh75JA.js +1 -0
- package/ui-dist/assets/ebnf-CDyGwa7X.js +1 -0
- package/ui-dist/assets/ecl-Cabwm37j.js +1 -0
- package/ui-dist/assets/eiffel-CnydiIhH.js +1 -0
- package/ui-dist/assets/elm-vLlmbW-K.js +1 -0
- package/ui-dist/assets/erDiagram-INFDFZHY-CUhr9rIh.js +70 -0
- package/ui-dist/assets/erlang-BNw1qcRV.js +1 -0
- package/ui-dist/assets/factor-kuTfRLto.js +1 -0
- package/ui-dist/assets/fcl-Kvtd6kyn.js +1 -0
- package/ui-dist/assets/flowDiagram-PKNHOUZH-BEqBmNL-.js +162 -0
- package/ui-dist/assets/forth-Ffai-XNe.js +1 -0
- package/ui-dist/assets/fortran-DYz_wnZ1.js +1 -0
- package/ui-dist/assets/ganttDiagram-A5KZAMGK-CdeWhdno.js +292 -0
- package/ui-dist/assets/gas-Bneqetm1.js +1 -0
- package/ui-dist/assets/gherkin-heZmZLOM.js +1 -0
- package/ui-dist/assets/gitGraphDiagram-K3NZZRJ6-CgG66QFg.js +65 -0
- package/ui-dist/assets/graph-rmownl79.js +1 -0
- package/ui-dist/assets/groovy-D9Dt4D0W.js +1 -0
- package/ui-dist/assets/haskell-Cw1EW3IL.js +1 -0
- package/ui-dist/assets/haxe-H-WmDvRZ.js +1 -0
- package/ui-dist/assets/http-DBlCnlav.js +1 -0
- package/ui-dist/assets/idl-BEugSyMb.js +1 -0
- package/ui-dist/assets/index-B1YyDqaG.js +1 -0
- package/ui-dist/assets/index-B7exNxYd.js +1 -0
- package/ui-dist/assets/index-BIuriVDl.js +1 -0
- package/ui-dist/assets/index-BT9rfwYt.js +1 -0
- package/ui-dist/assets/index-BZhmacJG.js +1 -0
- package/ui-dist/assets/index-B_ebS3U_.js +3 -0
- package/ui-dist/assets/index-BnQqZOsc.js +1 -0
- package/ui-dist/assets/index-BwPbAax6.js +1 -0
- package/ui-dist/assets/index-C5i670o5.js +1 -0
- package/ui-dist/assets/index-C9KwE7Yr.js +1 -0
- package/ui-dist/assets/index-CDId_UjP.js +1 -0
- package/ui-dist/assets/index-CI9ydSGM.js +1 -0
- package/ui-dist/assets/index-CKpm3WGI.css +1 -0
- package/ui-dist/assets/index-CMP_bzP3.js +2 -0
- package/ui-dist/assets/index-CRcHIoCW.js +1 -0
- package/ui-dist/assets/index-DZqNY-Lg.js +1 -0
- package/ui-dist/assets/index-DbDKJhW-.js +7 -0
- package/ui-dist/assets/index-Dkg6MwQ_.js +1 -0
- package/ui-dist/assets/index-Dn0iitKg.js +1 -0
- package/ui-dist/assets/index-GvHywIOA.js +1323 -0
- package/ui-dist/assets/index-WtX4Y4Fx.js +13 -0
- package/ui-dist/assets/index-iyC5PHC3.js +6 -0
- package/ui-dist/assets/index-jMlzlqoV.js +1 -0
- package/ui-dist/assets/index-pTIOLGTe.js +1 -0
- package/ui-dist/assets/infoDiagram-LFFYTUFH-CEhdbTYQ.js +2 -0
- package/ui-dist/assets/init-Gi6I4Gst.js +1 -0
- package/ui-dist/assets/ishikawaDiagram-PHBUUO56-g9GiiXI2.js +70 -0
- package/ui-dist/assets/javascript-iXu5QeM3.js +1 -0
- package/ui-dist/assets/journeyDiagram-4ABVD52K-CheeZzlg.js +139 -0
- package/ui-dist/assets/julia-DuME0IfC.js +1 -0
- package/ui-dist/assets/kanban-definition-K7BYSVSG-BTpuAgUJ.js +89 -0
- package/ui-dist/assets/katex-B1X10hvy.js +261 -0
- package/ui-dist/assets/layout-CuBgufef.js +1 -0
- package/ui-dist/assets/linear-CnXO6wXw.js +1 -0
- package/ui-dist/assets/livescript-BwQOo05w.js +1 -0
- package/ui-dist/assets/lua-BgMRiT3U.js +1 -0
- package/ui-dist/assets/mathematica-DTrFuWx2.js +1 -0
- package/ui-dist/assets/mbox-CNhZ1qSd.js +1 -0
- package/ui-dist/assets/mermaid.core-DVaYxfh9.js +255 -0
- package/ui-dist/assets/mindmap-definition-YRQLILUH-00nAuexq.js +68 -0
- package/ui-dist/assets/mirc-CjQqDB4T.js +1 -0
- package/ui-dist/assets/mllike-CXdrOF99.js +1 -0
- package/ui-dist/assets/modelica-Dc1JOy9r.js +1 -0
- package/ui-dist/assets/mscgen-BA5vi2Kp.js +1 -0
- package/ui-dist/assets/mumps-BT43cFF4.js +1 -0
- package/ui-dist/assets/nginx-DdIZxoE0.js +1 -0
- package/ui-dist/assets/nsis-LdVXkNf5.js +1 -0
- package/ui-dist/assets/ntriples-BfvgReVJ.js +1 -0
- package/ui-dist/assets/octave-Ck1zUtKM.js +1 -0
- package/ui-dist/assets/ordinal-Cboi1Yqb.js +1 -0
- package/ui-dist/assets/oz-BzwKVEFT.js +1 -0
- package/ui-dist/assets/pascal--L3eBynH.js +1 -0
- package/ui-dist/assets/perl-CdXCOZ3F.js +1 -0
- package/ui-dist/assets/pieDiagram-SKSYHLDU-NaOgRqIj.js +30 -0
- package/ui-dist/assets/pig-CevX1Tat.js +1 -0
- package/ui-dist/assets/powershell-CFHJl5sT.js +1 -0
- package/ui-dist/assets/properties-C78fOPTZ.js +1 -0
- package/ui-dist/assets/protobuf-ChK-085T.js +1 -0
- package/ui-dist/assets/pug-DeIclll2.js +1 -0
- package/ui-dist/assets/puppet-DMA9R1ak.js +1 -0
- package/ui-dist/assets/python-BuPzkPfP.js +1 -0
- package/ui-dist/assets/q-pXgVlZs6.js +1 -0
- package/ui-dist/assets/quadrantDiagram-337W2JSQ-Bnf9OCW0.js +7 -0
- package/ui-dist/assets/r-B6wPVr8A.js +1 -0
- package/ui-dist/assets/requirementDiagram-Z7DCOOCP-BiacZTTh.js +73 -0
- package/ui-dist/assets/rpm-CTu-6PCP.js +1 -0
- package/ui-dist/assets/ruby-B2Rjki9n.js +1 -0
- package/ui-dist/assets/sankeyDiagram-WA2Y5GQK-DOuD4D2Q.js +10 -0
- package/ui-dist/assets/sas-B4kiWyti.js +1 -0
- package/ui-dist/assets/scheme-C41bIUwD.js +1 -0
- package/ui-dist/assets/sequenceDiagram-2WXFIKYE-oV3M_w-H.js +145 -0
- package/ui-dist/assets/shell-CjFT_Tl9.js +1 -0
- package/ui-dist/assets/sieve-C3Gn_uJK.js +1 -0
- package/ui-dist/assets/simple-mode-GW_nhZxv.js +1 -0
- package/ui-dist/assets/smalltalk-CnHTOXQT.js +1 -0
- package/ui-dist/assets/solr-DehyRSwq.js +1 -0
- package/ui-dist/assets/sparql-DkYu6x3z.js +1 -0
- package/ui-dist/assets/spreadsheet-BCZA_wO0.js +1 -0
- package/ui-dist/assets/sql-D0XecflT.js +1 -0
- package/ui-dist/assets/stateDiagram-RAJIS63D-CdRc2Pqb.js +1 -0
- package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-CIMHFJYg.js +1 -0
- package/ui-dist/assets/stex-C3f8Ysf7.js +1 -0
- package/ui-dist/assets/stylus-B533Al4x.js +1 -0
- package/ui-dist/assets/swift-BzpIVaGY.js +1 -0
- package/ui-dist/assets/tcl-DVfN8rqt.js +1 -0
- package/ui-dist/assets/textile-CnDTJFAw.js +1 -0
- package/ui-dist/assets/tiddlywiki-DO-Gjzrf.js +1 -0
- package/ui-dist/assets/tiki-DGYXhP31.js +1 -0
- package/ui-dist/assets/timeline-definition-YZTLITO2-BCWQDIwt.js +61 -0
- package/ui-dist/assets/toml-Bm5Em-hy.js +1 -0
- package/ui-dist/assets/treemap-KZPCXAKY-BvsIxXAi.js +162 -0
- package/ui-dist/assets/troff-wAsdV37c.js +1 -0
- package/ui-dist/assets/ttcn-CfJYG6tj.js +1 -0
- package/ui-dist/assets/ttcn-cfg-B9xdYoR4.js +1 -0
- package/ui-dist/assets/turtle-B1tBg_DP.js +1 -0
- package/ui-dist/assets/vb-CmGdzxic.js +1 -0
- package/ui-dist/assets/vbscript-BuJXcnF6.js +1 -0
- package/ui-dist/assets/velocity-D8B20fx6.js +1 -0
- package/ui-dist/assets/vennDiagram-LZ73GAT5-BzibHs4r.js +34 -0
- package/ui-dist/assets/verilog-C6RDOZhf.js +1 -0
- package/ui-dist/assets/vhdl-lSbBsy5d.js +1 -0
- package/ui-dist/assets/webidl-ZXfAyPTL.js +1 -0
- package/ui-dist/assets/xquery-DzFWVndE.js +1 -0
- package/ui-dist/assets/xychartDiagram-JWTSCODW-CX_Xt_y-.js +7 -0
- package/ui-dist/assets/yacas-BJ4BC0dw.js +1 -0
- package/ui-dist/assets/z80-Hz9HOZM7.js +1 -0
- package/ui-dist/brands/opencode-logo-dark-square.svg +18 -0
- package/ui-dist/brands/opencode-logo-light-square.svg +18 -0
- package/ui-dist/favicon-16x16.png +0 -0
- package/ui-dist/favicon-32x32.png +0 -0
- package/ui-dist/favicon-dev-16x16.png +0 -0
- package/ui-dist/favicon-dev-32x32.png +0 -0
- package/ui-dist/favicon-dev.ico +0 -0
- package/ui-dist/favicon.ico +0 -0
- package/ui-dist/favicon.svg +1 -0
- package/ui-dist/index.html +61 -0
- package/ui-dist/rudder-logo.png +0 -0
- package/ui-dist/site.webmanifest +30 -0
- package/ui-dist/sw.js +42 -0
- package/ui-dist/worktree-favicon-16x16.png +0 -0
- package/ui-dist/worktree-favicon-32x32.png +0 -0
- package/ui-dist/worktree-favicon.ico +0 -0
- package/ui-dist/worktree-favicon.svg +1 -0
|
@@ -0,0 +1,943 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { findServerAdapter } from "../agent-runtimes/index.js";
|
|
3
|
+
import { agentRunContextService, RUDDER_COPILOT_LABEL } from "./agent-run-context.js";
|
|
4
|
+
import { agentService } from "./agents.js";
|
|
5
|
+
import { organizationService } from "./orgs.js";
|
|
6
|
+
const ORGANIZATION_DEFAULT_CHAT_ADAPTER_TYPES = new Set([
|
|
7
|
+
"claude_local",
|
|
8
|
+
"codex_local",
|
|
9
|
+
"cursor",
|
|
10
|
+
"gemini_local",
|
|
11
|
+
"opencode_local",
|
|
12
|
+
"pi_local",
|
|
13
|
+
"openclaw_gateway",
|
|
14
|
+
]);
|
|
15
|
+
const CHAT_UNSUPPORTED_ADAPTER_TYPES = new Set(["process", "http"]);
|
|
16
|
+
const CHAT_RESULT_SENTINEL_PREFIX = "__RUDDER_RESULT_";
|
|
17
|
+
export class ChatAssistantStreamError extends Error {
|
|
18
|
+
partialBody;
|
|
19
|
+
constructor(message, partialBody) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = "ChatAssistantStreamError";
|
|
22
|
+
this.partialBody = partialBody;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function safeTrim(value) {
|
|
26
|
+
const trimmed = value?.trim();
|
|
27
|
+
return trimmed ? trimmed : null;
|
|
28
|
+
}
|
|
29
|
+
function modelLabel(config) {
|
|
30
|
+
return safeTrim(typeof config?.model === "string" ? config.model : null);
|
|
31
|
+
}
|
|
32
|
+
function unconfiguredDescriptor(error) {
|
|
33
|
+
return {
|
|
34
|
+
sourceType: "unconfigured",
|
|
35
|
+
sourceLabel: "Configure Rudder Copilot",
|
|
36
|
+
runtimeAgentId: null,
|
|
37
|
+
agentRuntimeType: null,
|
|
38
|
+
model: null,
|
|
39
|
+
available: false,
|
|
40
|
+
error,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function unavailableAgentDescriptor(input) {
|
|
44
|
+
return {
|
|
45
|
+
sourceType: "agent",
|
|
46
|
+
sourceLabel: input.sourceLabel,
|
|
47
|
+
runtimeAgentId: input.runtimeAgentId,
|
|
48
|
+
agentRuntimeType: input.agentRuntimeType,
|
|
49
|
+
model: input.model,
|
|
50
|
+
available: false,
|
|
51
|
+
error: input.error,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function buildPrompt(input) {
|
|
55
|
+
const contextSummary = input.contextLinks.map((link) => ({
|
|
56
|
+
entityType: link.entityType,
|
|
57
|
+
entityId: link.entityId,
|
|
58
|
+
label: link.entity?.label ?? null,
|
|
59
|
+
identifier: link.entity?.identifier ?? null,
|
|
60
|
+
status: link.entity?.status ?? null,
|
|
61
|
+
}));
|
|
62
|
+
const history = input.messages.slice(-12).map((message) => ({
|
|
63
|
+
role: message.role,
|
|
64
|
+
kind: message.kind,
|
|
65
|
+
status: message.status,
|
|
66
|
+
body: message.body,
|
|
67
|
+
structuredPayload: message.structuredPayload,
|
|
68
|
+
}));
|
|
69
|
+
return JSON.stringify({
|
|
70
|
+
conversation: {
|
|
71
|
+
id: input.conversation.id,
|
|
72
|
+
title: input.conversation.title,
|
|
73
|
+
status: input.conversation.status,
|
|
74
|
+
summary: input.conversation.summary,
|
|
75
|
+
planMode: input.conversation.planMode,
|
|
76
|
+
issueCreationMode: input.conversation.issueCreationMode,
|
|
77
|
+
preferredAgentId: input.conversation.preferredAgentId,
|
|
78
|
+
routedAgentId: input.conversation.routedAgentId,
|
|
79
|
+
primaryIssueId: input.conversation.primaryIssueId,
|
|
80
|
+
},
|
|
81
|
+
contextLinks: contextSummary,
|
|
82
|
+
recentMessages: history,
|
|
83
|
+
}, null, 2);
|
|
84
|
+
}
|
|
85
|
+
function buildOperatorProfilePromptSection(profile) {
|
|
86
|
+
const nickname = safeTrim(profile?.nickname);
|
|
87
|
+
const moreAboutYou = safeTrim(profile?.moreAboutYou);
|
|
88
|
+
if (!nickname && !moreAboutYou)
|
|
89
|
+
return null;
|
|
90
|
+
return [
|
|
91
|
+
"Current board operator profile:",
|
|
92
|
+
...(nickname ? [`- Preferred form of address: ${nickname}`] : []),
|
|
93
|
+
...(moreAboutYou ? [`- Background about the operator: ${moreAboutYou}`] : []),
|
|
94
|
+
"Use this only as background context when you address the operator or interpret their requests.",
|
|
95
|
+
].join("\n");
|
|
96
|
+
}
|
|
97
|
+
function buildChatSpeakerPromptSection(runtimeSource) {
|
|
98
|
+
const name = runtimeSource.descriptor.sourceLabel;
|
|
99
|
+
if (runtimeSource.descriptor.sourceType === "agent") {
|
|
100
|
+
return [
|
|
101
|
+
`You are ${name}, replying inside Rudder's chat scene.`,
|
|
102
|
+
"Speak as this agent, using the agent's own instructions and enabled skills as your working context.",
|
|
103
|
+
"Do not claim to be Rudder Copilot or a generic assistant.",
|
|
104
|
+
].join("\n");
|
|
105
|
+
}
|
|
106
|
+
return [
|
|
107
|
+
`You are ${name}, the system-managed chat copilot for this Rudder organization.`,
|
|
108
|
+
"Stay inside the chat scene. Clarify, structure, and propose work, but do not hand off or dispatch to another agent on your own.",
|
|
109
|
+
].join("\n");
|
|
110
|
+
}
|
|
111
|
+
function buildBaseSystemPromptSections(runtimeSource, resultSentinel) {
|
|
112
|
+
return [
|
|
113
|
+
buildChatSpeakerPromptSection(runtimeSource),
|
|
114
|
+
"Your job is to clarify work requests for a Rudder AI organization control plane.",
|
|
115
|
+
"This is the dedicated chat scene. Do not use heartbeat issue bootstrap framing.",
|
|
116
|
+
"Always reply in the same language as the user's most recent substantive message unless they explicitly ask for a different language.",
|
|
117
|
+
"Always prefer clarification before proposing issue creation when requirements are incomplete.",
|
|
118
|
+
"Use result kind 'message' for clarification, summaries, and small requests that can stay in chat.",
|
|
119
|
+
"Use result kind 'issue_proposal' for larger work that should become an issue.",
|
|
120
|
+
"Use result kind 'routing_suggestion' only when recommending an agent or role to handle work.",
|
|
121
|
+
"Reply in two phases.",
|
|
122
|
+
"Phase 1: write the user-visible reply in Markdown with no JSON fences.",
|
|
123
|
+
`Phase 2: on a new line, emit exactly ${resultSentinel} followed immediately by one JSON object.`,
|
|
124
|
+
"Do not output anything after that JSON object.",
|
|
125
|
+
];
|
|
126
|
+
}
|
|
127
|
+
function buildPlanModePromptSection() {
|
|
128
|
+
return [
|
|
129
|
+
"Plan mode is active for this conversation.",
|
|
130
|
+
"Stay strictly in read-only investigation and planning mode.",
|
|
131
|
+
"Do not propose or imply file edits, shell mutations, or lightweight control-plane changes.",
|
|
132
|
+
"Converge on an issue-sized implementation plan, and when you are ready to conclude, emit kind 'issue_proposal'.",
|
|
133
|
+
"Include structuredPayload.planDocument.body as markdown for the issue plan document.",
|
|
134
|
+
].join("\n");
|
|
135
|
+
}
|
|
136
|
+
function buildResponseSchemaPromptSection(planMode) {
|
|
137
|
+
return [
|
|
138
|
+
"JSON shape:",
|
|
139
|
+
JSON.stringify({
|
|
140
|
+
kind: "message",
|
|
141
|
+
body: "same visible reply, summarized if needed",
|
|
142
|
+
structuredPayload: {
|
|
143
|
+
summary: "optional short summary",
|
|
144
|
+
issueProposal: {
|
|
145
|
+
title: "required for issue_proposal",
|
|
146
|
+
description: "required for issue_proposal",
|
|
147
|
+
priority: "critical|high|medium|low",
|
|
148
|
+
assigneeAgentId: "optional uuid",
|
|
149
|
+
projectId: "optional uuid",
|
|
150
|
+
goalId: "optional uuid",
|
|
151
|
+
parentId: "optional uuid",
|
|
152
|
+
},
|
|
153
|
+
planDocument: {
|
|
154
|
+
title: "optional plan title",
|
|
155
|
+
body: planMode
|
|
156
|
+
? "required markdown plan for the issue plan document"
|
|
157
|
+
: "optional markdown plan",
|
|
158
|
+
changeSummary: "optional short summary for the issue document revision",
|
|
159
|
+
},
|
|
160
|
+
routingSuggestion: {
|
|
161
|
+
agentId: "optional uuid",
|
|
162
|
+
reason: "short explanation",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
}, null, 2),
|
|
166
|
+
].join("\n");
|
|
167
|
+
}
|
|
168
|
+
function systemPrompt(runtimeSource, conversation, resultSentinel) {
|
|
169
|
+
return [
|
|
170
|
+
...buildBaseSystemPromptSections(runtimeSource, resultSentinel),
|
|
171
|
+
...(conversation.planMode ? [buildPlanModePromptSection()] : []),
|
|
172
|
+
buildResponseSchemaPromptSection(conversation.planMode),
|
|
173
|
+
].join("\n");
|
|
174
|
+
}
|
|
175
|
+
function extractJsonObject(text) {
|
|
176
|
+
const trimmed = text.trim();
|
|
177
|
+
if (!trimmed)
|
|
178
|
+
return null;
|
|
179
|
+
try {
|
|
180
|
+
const parsed = JSON.parse(trimmed);
|
|
181
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
182
|
+
return parsed;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Fall through to brace matching.
|
|
187
|
+
}
|
|
188
|
+
const firstBrace = trimmed.indexOf("{");
|
|
189
|
+
const lastBrace = trimmed.lastIndexOf("}");
|
|
190
|
+
if (firstBrace === -1 || lastBrace === -1 || lastBrace <= firstBrace)
|
|
191
|
+
return null;
|
|
192
|
+
try {
|
|
193
|
+
const parsed = JSON.parse(trimmed.slice(firstBrace, lastBrace + 1));
|
|
194
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
195
|
+
return parsed;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
function validateAssistantResult(payload, options = {}) {
|
|
204
|
+
const kind = typeof payload.kind === "string" ? payload.kind : "message";
|
|
205
|
+
const payloadBody = typeof payload.body === "string" ? payload.body.trim() : "";
|
|
206
|
+
const body = options.bodyOverride?.trim() || payloadBody;
|
|
207
|
+
const structuredPayload = payload.structuredPayload && typeof payload.structuredPayload === "object" && !Array.isArray(payload.structuredPayload)
|
|
208
|
+
? payload.structuredPayload
|
|
209
|
+
: null;
|
|
210
|
+
if (!body) {
|
|
211
|
+
throw new Error("Assistant response body was empty");
|
|
212
|
+
}
|
|
213
|
+
if (kind !== "message" &&
|
|
214
|
+
kind !== "issue_proposal" &&
|
|
215
|
+
kind !== "operation_proposal" &&
|
|
216
|
+
kind !== "routing_suggestion") {
|
|
217
|
+
throw new Error(`Unsupported assistant result kind: ${kind}`);
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
kind,
|
|
221
|
+
body,
|
|
222
|
+
structuredPayload,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function buildConversationPrompt(input, runtimeSource, resultSentinel, orgResourcesPrompt) {
|
|
226
|
+
const operatorProfileSection = buildOperatorProfilePromptSection(input.operatorProfile);
|
|
227
|
+
/**
|
|
228
|
+
* Chat prompt assembly stays compositional on purpose.
|
|
229
|
+
*
|
|
230
|
+
* Reasoning:
|
|
231
|
+
* - Always-loaded sections should hold only invariant chat-scene rules.
|
|
232
|
+
* - Conditional behavior such as plan mode should be injected only when active,
|
|
233
|
+
* so the runtime does not carry dormant "when X, do Y" branches in every chat.
|
|
234
|
+
*
|
|
235
|
+
* Traceability:
|
|
236
|
+
* - doc/plans/2026-04-18-chat-plan-mode.md
|
|
237
|
+
* - doc/DEVELOPING.md
|
|
238
|
+
*/
|
|
239
|
+
return [
|
|
240
|
+
systemPrompt(runtimeSource, input.conversation, resultSentinel),
|
|
241
|
+
...(orgResourcesPrompt ? [orgResourcesPrompt] : []),
|
|
242
|
+
...(operatorProfileSection ? [operatorProfileSection] : []),
|
|
243
|
+
"Conversation input:",
|
|
244
|
+
buildPrompt(input),
|
|
245
|
+
].join("\n\n");
|
|
246
|
+
}
|
|
247
|
+
function resultText(result) {
|
|
248
|
+
if (typeof result.summary === "string" && result.summary.trim().length > 0) {
|
|
249
|
+
return result.summary.trim();
|
|
250
|
+
}
|
|
251
|
+
const raw = result.resultJson && typeof result.resultJson === "object" && !Array.isArray(result.resultJson)
|
|
252
|
+
? result.resultJson
|
|
253
|
+
: null;
|
|
254
|
+
const candidate = typeof raw?.text === "string"
|
|
255
|
+
? raw.text
|
|
256
|
+
: typeof raw?.message === "string"
|
|
257
|
+
? raw.message
|
|
258
|
+
: typeof raw?.content === "string"
|
|
259
|
+
? raw.content
|
|
260
|
+
: null;
|
|
261
|
+
return safeTrim(candidate) ?? "";
|
|
262
|
+
}
|
|
263
|
+
function configArgs(agentRuntimeConfig) {
|
|
264
|
+
const raw = Array.isArray(agentRuntimeConfig.extraArgs)
|
|
265
|
+
? agentRuntimeConfig.extraArgs
|
|
266
|
+
: Array.isArray(agentRuntimeConfig.args)
|
|
267
|
+
? agentRuntimeConfig.args
|
|
268
|
+
: [];
|
|
269
|
+
return raw.filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
270
|
+
}
|
|
271
|
+
function stripCliArgs(args, input) {
|
|
272
|
+
const flagsWithValues = new Set(input.flagsWithValues ?? []);
|
|
273
|
+
const standaloneFlags = new Set(input.standaloneFlags ?? []);
|
|
274
|
+
const prefixedFlags = input.prefixedFlags ?? [];
|
|
275
|
+
const next = [];
|
|
276
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
277
|
+
const arg = args[index];
|
|
278
|
+
if (flagsWithValues.has(arg)) {
|
|
279
|
+
index += 1;
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if (standaloneFlags.has(arg)) {
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
if (prefixedFlags.some((prefix) => arg.startsWith(prefix))) {
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
next.push(arg);
|
|
289
|
+
}
|
|
290
|
+
return next;
|
|
291
|
+
}
|
|
292
|
+
function applyPlanModeRuntimeOverlay(agentRuntimeType, agentRuntimeConfig) {
|
|
293
|
+
const args = configArgs(agentRuntimeConfig);
|
|
294
|
+
if (agentRuntimeType === "codex_local") {
|
|
295
|
+
return {
|
|
296
|
+
...agentRuntimeConfig,
|
|
297
|
+
dangerouslyBypassApprovalsAndSandbox: false,
|
|
298
|
+
dangerouslyBypassSandbox: false,
|
|
299
|
+
extraArgs: [
|
|
300
|
+
"-s",
|
|
301
|
+
"read-only",
|
|
302
|
+
...stripCliArgs(args, {
|
|
303
|
+
flagsWithValues: ["-s", "--sandbox"],
|
|
304
|
+
standaloneFlags: ["--dangerously-bypass-approvals-and-sandbox"],
|
|
305
|
+
prefixedFlags: ["--sandbox="],
|
|
306
|
+
}),
|
|
307
|
+
],
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
if (agentRuntimeType === "claude_local") {
|
|
311
|
+
return {
|
|
312
|
+
...agentRuntimeConfig,
|
|
313
|
+
dangerouslySkipPermissions: false,
|
|
314
|
+
extraArgs: [
|
|
315
|
+
"--permission-mode",
|
|
316
|
+
"plan",
|
|
317
|
+
...stripCliArgs(args, {
|
|
318
|
+
flagsWithValues: ["--permission-mode"],
|
|
319
|
+
standaloneFlags: ["--dangerously-skip-permissions"],
|
|
320
|
+
prefixedFlags: ["--permission-mode="],
|
|
321
|
+
}),
|
|
322
|
+
],
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
if (agentRuntimeType === "cursor") {
|
|
326
|
+
return {
|
|
327
|
+
...agentRuntimeConfig,
|
|
328
|
+
mode: "plan",
|
|
329
|
+
extraArgs: stripCliArgs(args, {
|
|
330
|
+
flagsWithValues: ["--mode"],
|
|
331
|
+
prefixedFlags: ["--mode="],
|
|
332
|
+
}),
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
return agentRuntimeConfig;
|
|
336
|
+
}
|
|
337
|
+
function chatExecutionConfig(conversation, agentRuntimeType, agentRuntimeConfig) {
|
|
338
|
+
const baseConfig = conversation.planMode
|
|
339
|
+
? applyPlanModeRuntimeOverlay(agentRuntimeType, agentRuntimeConfig)
|
|
340
|
+
: agentRuntimeConfig;
|
|
341
|
+
return {
|
|
342
|
+
...baseConfig,
|
|
343
|
+
promptTemplate: "{{context.chatPrompt}}",
|
|
344
|
+
bootstrapPromptTemplate: "",
|
|
345
|
+
maxTurns: 1,
|
|
346
|
+
chrome: false,
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function linkedIssueIdsForChat(conversation, contextLinks) {
|
|
350
|
+
return Array.from(new Set([
|
|
351
|
+
conversation.primaryIssueId,
|
|
352
|
+
...contextLinks
|
|
353
|
+
.filter((link) => link.entityType === "issue")
|
|
354
|
+
.map((link) => link.entityId),
|
|
355
|
+
].filter((value) => typeof value === "string" && value.trim().length > 0)));
|
|
356
|
+
}
|
|
357
|
+
function linkedProjectIdForChat(contextLinks) {
|
|
358
|
+
return contextLinks.find((link) => link.entityType === "project")?.entityId ?? null;
|
|
359
|
+
}
|
|
360
|
+
function stubAgent(input) {
|
|
361
|
+
return {
|
|
362
|
+
id: input.sourceId,
|
|
363
|
+
orgId: input.orgId,
|
|
364
|
+
name: input.sourceLabel,
|
|
365
|
+
agentRuntimeType: input.agentRuntimeType,
|
|
366
|
+
agentRuntimeConfig: input.agentRuntimeConfig,
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
function summarizeRuntimeSkills(entries) {
|
|
370
|
+
return entries.map((entry) => ({
|
|
371
|
+
key: entry.key,
|
|
372
|
+
runtimeName: entry.runtimeName,
|
|
373
|
+
name: entry.name,
|
|
374
|
+
description: entry.description,
|
|
375
|
+
}));
|
|
376
|
+
}
|
|
377
|
+
function longestSentinelPrefixSuffix(value, sentinel) {
|
|
378
|
+
const max = Math.min(value.length, sentinel.length - 1);
|
|
379
|
+
for (let len = max; len > 0; len -= 1) {
|
|
380
|
+
if (value.endsWith(sentinel.slice(0, len))) {
|
|
381
|
+
return len;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return 0;
|
|
385
|
+
}
|
|
386
|
+
function createAssistantTextAccumulator() {
|
|
387
|
+
let fullText = "";
|
|
388
|
+
return {
|
|
389
|
+
get fullText() {
|
|
390
|
+
return fullText;
|
|
391
|
+
},
|
|
392
|
+
push(fragment, isDelta = false) {
|
|
393
|
+
if (!fragment)
|
|
394
|
+
return "";
|
|
395
|
+
if (isDelta) {
|
|
396
|
+
fullText += fragment;
|
|
397
|
+
return fragment;
|
|
398
|
+
}
|
|
399
|
+
if (fragment.startsWith(fullText)) {
|
|
400
|
+
const delta = fragment.slice(fullText.length);
|
|
401
|
+
fullText = fragment;
|
|
402
|
+
return delta;
|
|
403
|
+
}
|
|
404
|
+
if (fullText.endsWith(fragment) || fullText.includes(fragment)) {
|
|
405
|
+
return "";
|
|
406
|
+
}
|
|
407
|
+
fullText += fragment;
|
|
408
|
+
return fragment;
|
|
409
|
+
},
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
function createSentinelStream(resultSentinel) {
|
|
413
|
+
let visibleText = "";
|
|
414
|
+
let resultPayloadText = "";
|
|
415
|
+
let carry = "";
|
|
416
|
+
let seenSentinel = false;
|
|
417
|
+
return {
|
|
418
|
+
get visibleText() {
|
|
419
|
+
return visibleText;
|
|
420
|
+
},
|
|
421
|
+
get resultPayloadText() {
|
|
422
|
+
return resultPayloadText;
|
|
423
|
+
},
|
|
424
|
+
get seenSentinel() {
|
|
425
|
+
return seenSentinel;
|
|
426
|
+
},
|
|
427
|
+
push(text) {
|
|
428
|
+
if (!text)
|
|
429
|
+
return "";
|
|
430
|
+
if (seenSentinel) {
|
|
431
|
+
resultPayloadText += text;
|
|
432
|
+
return "";
|
|
433
|
+
}
|
|
434
|
+
const combined = `${carry}${text}`;
|
|
435
|
+
const sentinelIndex = combined.indexOf(resultSentinel);
|
|
436
|
+
if (sentinelIndex >= 0) {
|
|
437
|
+
const visibleDelta = combined.slice(0, sentinelIndex);
|
|
438
|
+
seenSentinel = true;
|
|
439
|
+
visibleText += visibleDelta;
|
|
440
|
+
resultPayloadText += combined.slice(sentinelIndex + resultSentinel.length);
|
|
441
|
+
carry = "";
|
|
442
|
+
return visibleDelta;
|
|
443
|
+
}
|
|
444
|
+
const holdLength = longestSentinelPrefixSuffix(combined, resultSentinel);
|
|
445
|
+
const visibleDelta = combined.slice(0, combined.length - holdLength);
|
|
446
|
+
carry = combined.slice(combined.length - holdLength);
|
|
447
|
+
visibleText += visibleDelta;
|
|
448
|
+
return visibleDelta;
|
|
449
|
+
},
|
|
450
|
+
finish() {
|
|
451
|
+
if (seenSentinel) {
|
|
452
|
+
if (carry)
|
|
453
|
+
resultPayloadText += carry;
|
|
454
|
+
carry = "";
|
|
455
|
+
return "";
|
|
456
|
+
}
|
|
457
|
+
const visibleDelta = carry;
|
|
458
|
+
carry = "";
|
|
459
|
+
visibleText += visibleDelta;
|
|
460
|
+
return visibleDelta;
|
|
461
|
+
},
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
function parseAssistantEnvelope(rawText, resultSentinel) {
|
|
465
|
+
const sentinelIndex = rawText.indexOf(resultSentinel);
|
|
466
|
+
if (sentinelIndex === -1) {
|
|
467
|
+
return {
|
|
468
|
+
visibleBody: rawText.trim(),
|
|
469
|
+
jsonPayload: null,
|
|
470
|
+
usedSentinel: false,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
const visibleBody = rawText.slice(0, sentinelIndex).trim();
|
|
474
|
+
const jsonPayload = extractJsonObject(rawText.slice(sentinelIndex + resultSentinel.length));
|
|
475
|
+
return {
|
|
476
|
+
visibleBody,
|
|
477
|
+
jsonPayload,
|
|
478
|
+
usedSentinel: true,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
function parseCompletedAssistantReply(rawText, resultSentinel) {
|
|
482
|
+
const enveloped = parseAssistantEnvelope(rawText, resultSentinel);
|
|
483
|
+
if (enveloped.jsonPayload) {
|
|
484
|
+
return validateAssistantResult(enveloped.jsonPayload, {
|
|
485
|
+
bodyOverride: enveloped.usedSentinel ? enveloped.visibleBody : null,
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
const legacyPayload = extractJsonObject(rawText);
|
|
489
|
+
if (legacyPayload) {
|
|
490
|
+
return validateAssistantResult(legacyPayload);
|
|
491
|
+
}
|
|
492
|
+
const body = safeTrim(enveloped.visibleBody);
|
|
493
|
+
if (!body) {
|
|
494
|
+
throw new Error("Chat adapter returned no assistant text");
|
|
495
|
+
}
|
|
496
|
+
return {
|
|
497
|
+
kind: "message",
|
|
498
|
+
body,
|
|
499
|
+
structuredPayload: null,
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function partialBodyFromRawAssistantText(rawText, resultSentinel) {
|
|
503
|
+
return safeTrim(parseAssistantEnvelope(rawText, resultSentinel).visibleBody) ?? "";
|
|
504
|
+
}
|
|
505
|
+
async function maybeEmitAssistantState(callback, state) {
|
|
506
|
+
if (!callback)
|
|
507
|
+
return;
|
|
508
|
+
await callback(state);
|
|
509
|
+
}
|
|
510
|
+
async function maybeEmitAssistantDelta(callback, delta) {
|
|
511
|
+
if (!callback || !delta)
|
|
512
|
+
return;
|
|
513
|
+
await callback(delta);
|
|
514
|
+
}
|
|
515
|
+
async function maybeEmitTranscriptEntry(callback, entry) {
|
|
516
|
+
if (!callback)
|
|
517
|
+
return;
|
|
518
|
+
await callback(entry);
|
|
519
|
+
}
|
|
520
|
+
async function maybeEmitObservedTranscriptEntry(callback, entry) {
|
|
521
|
+
if (!callback)
|
|
522
|
+
return;
|
|
523
|
+
await callback(entry);
|
|
524
|
+
}
|
|
525
|
+
function shouldSuppressChatTranscriptEntry(entry, resultSentinel) {
|
|
526
|
+
if (entry.kind === "result") {
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
if (entry.kind === "stdout" && entry.text.includes(resultSentinel)) {
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
export function chatAssistantService(db) {
|
|
535
|
+
const agentsSvc = agentService(db);
|
|
536
|
+
const organizationsSvc = organizationService(db);
|
|
537
|
+
const runContextSvc = agentRunContextService(db);
|
|
538
|
+
async function resolveChatInvocation(input) {
|
|
539
|
+
const runtimeSource = await resolveConversationRuntime(input.conversation);
|
|
540
|
+
if (!runtimeSource.descriptor.available) {
|
|
541
|
+
return {
|
|
542
|
+
runtimeSource,
|
|
543
|
+
adapter: null,
|
|
544
|
+
config: null,
|
|
545
|
+
linkedIssueIds: [],
|
|
546
|
+
linkedProjectId: null,
|
|
547
|
+
resolvedWorkspace: null,
|
|
548
|
+
sceneContext: null,
|
|
549
|
+
availabilityError: runtimeSource.descriptor.error ?? "Chat assistant is not configured",
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
if (!runtimeSource.agentRuntimeType || !runtimeSource.agentRuntimeConfig || !runtimeSource.runtimeAgent) {
|
|
553
|
+
return {
|
|
554
|
+
runtimeSource,
|
|
555
|
+
adapter: null,
|
|
556
|
+
config: null,
|
|
557
|
+
linkedIssueIds: [],
|
|
558
|
+
linkedProjectId: null,
|
|
559
|
+
resolvedWorkspace: null,
|
|
560
|
+
sceneContext: null,
|
|
561
|
+
availabilityError: runtimeSource.descriptor.error ?? "Chat runtime is not configured",
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
const adapter = findServerAdapter(runtimeSource.agentRuntimeType);
|
|
565
|
+
if (!adapter) {
|
|
566
|
+
return {
|
|
567
|
+
runtimeSource,
|
|
568
|
+
adapter: null,
|
|
569
|
+
config: null,
|
|
570
|
+
linkedIssueIds: [],
|
|
571
|
+
linkedProjectId: null,
|
|
572
|
+
resolvedWorkspace: null,
|
|
573
|
+
sceneContext: null,
|
|
574
|
+
availabilityError: `Unknown chat adapter type: ${runtimeSource.agentRuntimeType}`,
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
const config = chatExecutionConfig(input.conversation, runtimeSource.agentRuntimeType, runtimeSource.agentRuntimeConfig);
|
|
578
|
+
const linkedIssueIds = linkedIssueIdsForChat(input.conversation, input.contextLinks);
|
|
579
|
+
const linkedProjectId = linkedProjectIdForChat(input.contextLinks);
|
|
580
|
+
const resolvedWorkspace = await runContextSvc.resolveWorkspaceForRun(runtimeSource.runtimeAgent, {
|
|
581
|
+
issueId: input.conversation.primaryIssueId ?? linkedIssueIds[0] ?? null,
|
|
582
|
+
projectId: linkedProjectId,
|
|
583
|
+
}, null);
|
|
584
|
+
const sceneContext = await runContextSvc.buildSceneContext({
|
|
585
|
+
scene: "chat",
|
|
586
|
+
agent: runtimeSource.runtimeAgent,
|
|
587
|
+
resolvedWorkspace,
|
|
588
|
+
runtimeConfig: config,
|
|
589
|
+
});
|
|
590
|
+
return {
|
|
591
|
+
runtimeSource,
|
|
592
|
+
adapter,
|
|
593
|
+
config,
|
|
594
|
+
linkedIssueIds,
|
|
595
|
+
linkedProjectId,
|
|
596
|
+
resolvedWorkspace,
|
|
597
|
+
sceneContext,
|
|
598
|
+
availabilityError: null,
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
async function resolveAgentRuntime(orgId, agentId) {
|
|
602
|
+
const agent = await agentsSvc.getById(agentId);
|
|
603
|
+
if (!agent || agent.orgId !== orgId || agent.status === "terminated") {
|
|
604
|
+
return {
|
|
605
|
+
descriptor: unavailableAgentDescriptor({
|
|
606
|
+
sourceLabel: "Selected agent",
|
|
607
|
+
runtimeAgentId: null,
|
|
608
|
+
agentRuntimeType: null,
|
|
609
|
+
model: null,
|
|
610
|
+
error: "The selected chat agent is unavailable. Choose another agent or switch back to Rudder Copilot.",
|
|
611
|
+
}),
|
|
612
|
+
runtimeAgent: null,
|
|
613
|
+
agentRuntimeType: null,
|
|
614
|
+
agentRuntimeConfig: null,
|
|
615
|
+
runtimeSkills: [],
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
const agentAdapterType = agent.agentRuntimeType;
|
|
619
|
+
const agentAdapterConfig = (agent.agentRuntimeConfig ?? {});
|
|
620
|
+
if (CHAT_UNSUPPORTED_ADAPTER_TYPES.has(agentAdapterType)) {
|
|
621
|
+
return {
|
|
622
|
+
descriptor: unavailableAgentDescriptor({
|
|
623
|
+
sourceLabel: agent.name,
|
|
624
|
+
runtimeAgentId: agent.id,
|
|
625
|
+
agentRuntimeType: agentAdapterType,
|
|
626
|
+
model: modelLabel(agentAdapterConfig) ?? null,
|
|
627
|
+
error: `${agent.name} uses ${agentAdapterType}, which does not support chat conversations.`,
|
|
628
|
+
}),
|
|
629
|
+
runtimeAgent: {
|
|
630
|
+
id: agent.id,
|
|
631
|
+
orgId: agent.orgId,
|
|
632
|
+
name: agent.name,
|
|
633
|
+
agentRuntimeType: agentAdapterType,
|
|
634
|
+
agentRuntimeConfig: agentAdapterConfig,
|
|
635
|
+
},
|
|
636
|
+
agentRuntimeType: agentAdapterType,
|
|
637
|
+
agentRuntimeConfig: null,
|
|
638
|
+
runtimeSkills: [],
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
const { runtimeConfig, runtimeSkillEntries } = await runContextSvc.prepareRuntimeConfig({
|
|
642
|
+
scene: "chat",
|
|
643
|
+
agent: {
|
|
644
|
+
id: agent.id,
|
|
645
|
+
orgId: agent.orgId,
|
|
646
|
+
name: agent.name,
|
|
647
|
+
status: agent.status,
|
|
648
|
+
agentRuntimeType: agentAdapterType,
|
|
649
|
+
agentRuntimeConfig: agentAdapterConfig,
|
|
650
|
+
metadata: agent.metadata ?? null,
|
|
651
|
+
},
|
|
652
|
+
});
|
|
653
|
+
return {
|
|
654
|
+
descriptor: {
|
|
655
|
+
sourceType: "agent",
|
|
656
|
+
sourceLabel: agent.name,
|
|
657
|
+
runtimeAgentId: agent.id,
|
|
658
|
+
agentRuntimeType: agentAdapterType,
|
|
659
|
+
model: modelLabel(runtimeConfig) ?? "Default model",
|
|
660
|
+
available: true,
|
|
661
|
+
error: null,
|
|
662
|
+
},
|
|
663
|
+
runtimeAgent: {
|
|
664
|
+
id: agent.id,
|
|
665
|
+
orgId: agent.orgId,
|
|
666
|
+
name: agent.name,
|
|
667
|
+
agentRuntimeType: agentAdapterType,
|
|
668
|
+
agentRuntimeConfig: runtimeConfig,
|
|
669
|
+
},
|
|
670
|
+
agentRuntimeType: agentAdapterType,
|
|
671
|
+
agentRuntimeConfig: runtimeConfig,
|
|
672
|
+
runtimeSkills: summarizeRuntimeSkills(runtimeSkillEntries),
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
async function resolveOrganizationDefaultRuntime(orgId) {
|
|
676
|
+
const organization = await organizationsSvc.getById(orgId);
|
|
677
|
+
if (!organization?.defaultChatAgentRuntimeType) {
|
|
678
|
+
return {
|
|
679
|
+
descriptor: unconfiguredDescriptor("Chat is not configured. Configure Rudder Copilot in Organization Settings, or assign an agent to this conversation."),
|
|
680
|
+
runtimeAgent: null,
|
|
681
|
+
agentRuntimeType: null,
|
|
682
|
+
agentRuntimeConfig: null,
|
|
683
|
+
runtimeSkills: [],
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
const organizationAdapterType = organization.defaultChatAgentRuntimeType;
|
|
687
|
+
if (!ORGANIZATION_DEFAULT_CHAT_ADAPTER_TYPES.has(organizationAdapterType)) {
|
|
688
|
+
return {
|
|
689
|
+
descriptor: unconfiguredDescriptor(`${organizationAdapterType} is not available as a Rudder Copilot runtime.`),
|
|
690
|
+
runtimeAgent: null,
|
|
691
|
+
agentRuntimeType: null,
|
|
692
|
+
agentRuntimeConfig: null,
|
|
693
|
+
runtimeSkills: [],
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
const copilot = await runContextSvc.ensureChatCopilotAgent({
|
|
697
|
+
id: organization.id,
|
|
698
|
+
defaultChatAgentRuntimeType: organization.defaultChatAgentRuntimeType,
|
|
699
|
+
defaultChatAgentRuntimeConfig: (organization.defaultChatAgentRuntimeConfig ?? {}),
|
|
700
|
+
});
|
|
701
|
+
if (!copilot) {
|
|
702
|
+
return {
|
|
703
|
+
descriptor: unconfiguredDescriptor("Chat is not configured. Configure Rudder Copilot in Organization Settings, or assign an agent to this conversation."),
|
|
704
|
+
runtimeAgent: null,
|
|
705
|
+
agentRuntimeType: null,
|
|
706
|
+
agentRuntimeConfig: null,
|
|
707
|
+
runtimeSkills: [],
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
const { runtimeConfig, runtimeSkillEntries } = await runContextSvc.prepareRuntimeConfig({
|
|
711
|
+
scene: "chat",
|
|
712
|
+
agent: {
|
|
713
|
+
id: copilot.id,
|
|
714
|
+
orgId: copilot.orgId,
|
|
715
|
+
name: RUDDER_COPILOT_LABEL,
|
|
716
|
+
status: copilot.status,
|
|
717
|
+
agentRuntimeType: copilot.agentRuntimeType,
|
|
718
|
+
agentRuntimeConfig: copilot.agentRuntimeConfig ?? {},
|
|
719
|
+
metadata: copilot.metadata ?? null,
|
|
720
|
+
},
|
|
721
|
+
});
|
|
722
|
+
return {
|
|
723
|
+
descriptor: {
|
|
724
|
+
sourceType: "copilot",
|
|
725
|
+
sourceLabel: RUDDER_COPILOT_LABEL,
|
|
726
|
+
runtimeAgentId: copilot.id,
|
|
727
|
+
agentRuntimeType: organizationAdapterType,
|
|
728
|
+
model: modelLabel(runtimeConfig) ?? "Default model",
|
|
729
|
+
available: true,
|
|
730
|
+
error: null,
|
|
731
|
+
},
|
|
732
|
+
runtimeAgent: {
|
|
733
|
+
id: copilot.id,
|
|
734
|
+
orgId: copilot.orgId,
|
|
735
|
+
name: RUDDER_COPILOT_LABEL,
|
|
736
|
+
agentRuntimeType: organizationAdapterType,
|
|
737
|
+
agentRuntimeConfig: runtimeConfig,
|
|
738
|
+
},
|
|
739
|
+
agentRuntimeType: organizationAdapterType,
|
|
740
|
+
agentRuntimeConfig: runtimeConfig,
|
|
741
|
+
runtimeSkills: summarizeRuntimeSkills(runtimeSkillEntries),
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
async function resolveConversationRuntime(conversation) {
|
|
745
|
+
if (conversation.preferredAgentId) {
|
|
746
|
+
const agentRuntime = await resolveAgentRuntime(conversation.orgId, conversation.preferredAgentId);
|
|
747
|
+
if (agentRuntime)
|
|
748
|
+
return agentRuntime;
|
|
749
|
+
}
|
|
750
|
+
return resolveOrganizationDefaultRuntime(conversation.orgId);
|
|
751
|
+
}
|
|
752
|
+
async function enrichConversation(conversation) {
|
|
753
|
+
const resolved = await resolveConversationRuntime(conversation);
|
|
754
|
+
return {
|
|
755
|
+
...conversation,
|
|
756
|
+
chatRuntime: resolved.descriptor,
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
async function enrichConversations(conversations) {
|
|
760
|
+
return Promise.all(conversations.map((conversation) => enrichConversation(conversation)));
|
|
761
|
+
}
|
|
762
|
+
async function streamChatAssistantReply(input) {
|
|
763
|
+
const resolvedInvocation = await resolveChatInvocation({
|
|
764
|
+
conversation: input.conversation,
|
|
765
|
+
contextLinks: input.contextLinks,
|
|
766
|
+
});
|
|
767
|
+
if (resolvedInvocation.availabilityError) {
|
|
768
|
+
throw new Error(resolvedInvocation.availabilityError);
|
|
769
|
+
}
|
|
770
|
+
const { runtimeSource, adapter, config, linkedIssueIds, linkedProjectId, sceneContext, } = resolvedInvocation;
|
|
771
|
+
if (!adapter || !config || !sceneContext || !runtimeSource.agentRuntimeType) {
|
|
772
|
+
throw new Error("Chat runtime is not configured");
|
|
773
|
+
}
|
|
774
|
+
const runtimeAgentType = runtimeSource.agentRuntimeType;
|
|
775
|
+
const resultSentinel = `${CHAT_RESULT_SENTINEL_PREFIX}${randomUUID()}__`;
|
|
776
|
+
const runId = `chat-${input.conversation.id}-${randomUUID()}`;
|
|
777
|
+
const assistantTextAccumulator = createAssistantTextAccumulator();
|
|
778
|
+
const sentinelStream = createSentinelStream(resultSentinel);
|
|
779
|
+
const parser = adapter.parseStdoutLine;
|
|
780
|
+
let stdoutLineBuffer = "";
|
|
781
|
+
const { rudderWorkspace, rudderWorkspaces, rudderRuntimeServiceIntents, rudderScene } = sceneContext;
|
|
782
|
+
const prompt = buildConversationPrompt(input, runtimeSource, resultSentinel, typeof rudderWorkspace.orgResourcesPrompt === "string" ? rudderWorkspace.orgResourcesPrompt : "");
|
|
783
|
+
const processTranscriptEntries = async (entries) => {
|
|
784
|
+
for (const entry of entries) {
|
|
785
|
+
if (entry.kind === "assistant") {
|
|
786
|
+
const delta = assistantTextAccumulator.push(entry.text, entry.delta === true);
|
|
787
|
+
if (!delta)
|
|
788
|
+
continue;
|
|
789
|
+
const visibleDelta = sentinelStream.push(delta);
|
|
790
|
+
if (visibleDelta) {
|
|
791
|
+
await maybeEmitObservedTranscriptEntry(input.onObservedTranscriptEntry, {
|
|
792
|
+
kind: "assistant",
|
|
793
|
+
ts: entry.ts,
|
|
794
|
+
text: visibleDelta,
|
|
795
|
+
delta: true,
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
await maybeEmitAssistantDelta(input.onAssistantDelta, visibleDelta);
|
|
799
|
+
continue;
|
|
800
|
+
}
|
|
801
|
+
if (entry.kind === "result") {
|
|
802
|
+
await maybeEmitObservedTranscriptEntry(input.onObservedTranscriptEntry, {
|
|
803
|
+
...entry,
|
|
804
|
+
text: partialBodyFromRawAssistantText(entry.text, resultSentinel),
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
else if (!(entry.kind === "stdout" && entry.text.includes(resultSentinel))) {
|
|
808
|
+
await maybeEmitObservedTranscriptEntry(input.onObservedTranscriptEntry, entry);
|
|
809
|
+
}
|
|
810
|
+
if (shouldSuppressChatTranscriptEntry(entry, resultSentinel)) {
|
|
811
|
+
continue;
|
|
812
|
+
}
|
|
813
|
+
await maybeEmitTranscriptEntry(input.onTranscriptEntry, entry);
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
const processStdoutLine = async (line) => {
|
|
817
|
+
if (!parser || !line.trim())
|
|
818
|
+
return;
|
|
819
|
+
await processTranscriptEntries(parser(line, new Date().toISOString()));
|
|
820
|
+
};
|
|
821
|
+
const flushStdoutChunk = async (chunk, finalize = false) => {
|
|
822
|
+
const combined = `${stdoutLineBuffer}${chunk}`;
|
|
823
|
+
const lines = combined.split(/\r?\n/);
|
|
824
|
+
stdoutLineBuffer = lines.pop() ?? "";
|
|
825
|
+
for (const line of lines) {
|
|
826
|
+
await processStdoutLine(line);
|
|
827
|
+
}
|
|
828
|
+
if (finalize && stdoutLineBuffer.trim()) {
|
|
829
|
+
const trailing = stdoutLineBuffer;
|
|
830
|
+
stdoutLineBuffer = "";
|
|
831
|
+
await processStdoutLine(trailing);
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
await maybeEmitAssistantState(input.onAssistantState, "streaming");
|
|
835
|
+
const result = await adapter.execute({
|
|
836
|
+
runId,
|
|
837
|
+
agent: stubAgent({
|
|
838
|
+
orgId: input.conversation.orgId,
|
|
839
|
+
agentRuntimeType: runtimeAgentType,
|
|
840
|
+
agentRuntimeConfig: config,
|
|
841
|
+
sourceLabel: runtimeSource.descriptor.sourceLabel,
|
|
842
|
+
sourceId: runtimeSource.descriptor.runtimeAgentId ?? `org-chat:${input.conversation.orgId}`,
|
|
843
|
+
}),
|
|
844
|
+
runtime: {
|
|
845
|
+
sessionId: null,
|
|
846
|
+
sessionParams: null,
|
|
847
|
+
sessionDisplayId: null,
|
|
848
|
+
taskKey: null,
|
|
849
|
+
},
|
|
850
|
+
config,
|
|
851
|
+
context: {
|
|
852
|
+
chatPrompt: prompt,
|
|
853
|
+
chatConversationId: input.conversation.id,
|
|
854
|
+
chatMode: true,
|
|
855
|
+
rudderScene,
|
|
856
|
+
rudderWorkspace,
|
|
857
|
+
rudderWorkspaces,
|
|
858
|
+
...(rudderRuntimeServiceIntents ? { rudderRuntimeServiceIntents } : {}),
|
|
859
|
+
...(linkedProjectId ? { projectId: linkedProjectId } : {}),
|
|
860
|
+
...(linkedIssueIds[0] ? { issueId: linkedIssueIds[0] } : {}),
|
|
861
|
+
...(linkedIssueIds.length > 0 ? { issueIds: linkedIssueIds } : {}),
|
|
862
|
+
},
|
|
863
|
+
onMeta: async (meta) => {
|
|
864
|
+
await input.onInvocationMeta?.({
|
|
865
|
+
...meta,
|
|
866
|
+
loadedSkills: runtimeSource.runtimeSkills,
|
|
867
|
+
});
|
|
868
|
+
},
|
|
869
|
+
abortSignal: input.abortSignal,
|
|
870
|
+
onLog: async (stream, chunk) => {
|
|
871
|
+
if (stream === "stdout") {
|
|
872
|
+
await flushStdoutChunk(chunk);
|
|
873
|
+
}
|
|
874
|
+
},
|
|
875
|
+
});
|
|
876
|
+
await flushStdoutChunk("", true);
|
|
877
|
+
await maybeEmitAssistantDelta(input.onAssistantDelta, sentinelStream.finish());
|
|
878
|
+
const partialBody = partialBodyFromRawAssistantText(assistantTextAccumulator.fullText || resultText(result), resultSentinel) ||
|
|
879
|
+
(safeTrim(sentinelStream.visibleText) ?? "");
|
|
880
|
+
if (input.abortSignal?.aborted) {
|
|
881
|
+
await maybeEmitAssistantState(input.onAssistantState, "stopped");
|
|
882
|
+
return {
|
|
883
|
+
outcome: "stopped",
|
|
884
|
+
partialBody,
|
|
885
|
+
replyingAgentId: runtimeSource.descriptor.runtimeAgentId,
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
if (result.timedOut) {
|
|
889
|
+
throw new ChatAssistantStreamError("Chat request timed out", partialBody);
|
|
890
|
+
}
|
|
891
|
+
if ((result.exitCode ?? 0) !== 0 || result.errorMessage) {
|
|
892
|
+
throw new ChatAssistantStreamError(result.errorMessage ?? "Chat adapter execution failed", partialBody);
|
|
893
|
+
}
|
|
894
|
+
await maybeEmitAssistantState(input.onAssistantState, "finalizing");
|
|
895
|
+
const raw = resultText(result) || assistantTextAccumulator.fullText;
|
|
896
|
+
const reply = parseCompletedAssistantReply(raw, resultSentinel);
|
|
897
|
+
const finalBody = reply.body;
|
|
898
|
+
reply.replyingAgentId = runtimeSource.descriptor.runtimeAgentId;
|
|
899
|
+
const streamedBody = safeTrim(sentinelStream.visibleText) ?? "";
|
|
900
|
+
if (finalBody.startsWith(streamedBody)) {
|
|
901
|
+
const delta = finalBody.slice(streamedBody.length);
|
|
902
|
+
await maybeEmitAssistantDelta(input.onAssistantDelta, delta);
|
|
903
|
+
}
|
|
904
|
+
else if (!streamedBody && finalBody) {
|
|
905
|
+
await maybeEmitAssistantDelta(input.onAssistantDelta, finalBody);
|
|
906
|
+
}
|
|
907
|
+
return {
|
|
908
|
+
outcome: "completed",
|
|
909
|
+
reply,
|
|
910
|
+
partialBody: finalBody,
|
|
911
|
+
replyingAgentId: runtimeSource.descriptor.runtimeAgentId,
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
return {
|
|
915
|
+
enrichConversation,
|
|
916
|
+
enrichConversations,
|
|
917
|
+
getChatAssistantAvailability: async (conversation) => {
|
|
918
|
+
const resolved = await resolveChatInvocation({
|
|
919
|
+
conversation,
|
|
920
|
+
contextLinks: Array.isArray(conversation.contextLinks) ? conversation.contextLinks : [],
|
|
921
|
+
});
|
|
922
|
+
return resolved.runtimeSource.descriptor.available && !resolved.availabilityError
|
|
923
|
+
? {
|
|
924
|
+
...resolved.runtimeSource.descriptor,
|
|
925
|
+
available: true,
|
|
926
|
+
}
|
|
927
|
+
: {
|
|
928
|
+
...resolved.runtimeSource.descriptor,
|
|
929
|
+
available: false,
|
|
930
|
+
error: resolved.availabilityError ?? resolved.runtimeSource.descriptor.error,
|
|
931
|
+
};
|
|
932
|
+
},
|
|
933
|
+
generateChatAssistantReply: async (input) => {
|
|
934
|
+
const result = await streamChatAssistantReply(input);
|
|
935
|
+
if (result.outcome !== "completed") {
|
|
936
|
+
throw new Error("Chat assistant reply was stopped before completion");
|
|
937
|
+
}
|
|
938
|
+
return result.reply;
|
|
939
|
+
},
|
|
940
|
+
streamChatAssistantReply,
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
//# sourceMappingURL=chat-assistant.js.map
|