@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,1162 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { Router } from "express";
|
|
3
|
+
import multer from "multer";
|
|
4
|
+
import { addChatMessageSchema, updateChatConversationUserStateSchema, convertChatToIssueSchema, createChatAttachmentMetadataSchema, createChatContextLinkSchema, createChatConversationSchema, resolveChatOperationProposalSchema, updateChatConversationSchema, } from "@rudderhq/shared";
|
|
5
|
+
import { isAllowedContentType, MAX_ATTACHMENT_BYTES } from "../attachment-types.js";
|
|
6
|
+
import { HttpError } from "../errors.js";
|
|
7
|
+
import { observeExecutionEvent, updateExecutionObservation, updateExecutionTraceIO, withExecutionObservation, } from "../langfuse.js";
|
|
8
|
+
import { emitExecutionTranscriptTree } from "../langfuse-transcript.js";
|
|
9
|
+
import { validate } from "../middleware/validate.js";
|
|
10
|
+
import { logger } from "../middleware/logger.js";
|
|
11
|
+
import { ChatAssistantStreamError, chatAssistantService, } from "../services/chat-assistant.js";
|
|
12
|
+
import { claimChatGeneration } from "../services/chat-generation-locks.js";
|
|
13
|
+
import { agentService, chatService, operatorProfileService, organizationService, goalService, issueService, logActivity, projectService, } from "../services/index.js";
|
|
14
|
+
import { summarizeRuntimeSkillsForTrace } from "../services/runtime-trace-metadata.js";
|
|
15
|
+
import { assertBoard, assertCompanyAccess, getActorInfo } from "./authz.js";
|
|
16
|
+
export function chatRoutes(db, storage) {
|
|
17
|
+
const router = Router();
|
|
18
|
+
const svc = chatService(db);
|
|
19
|
+
const organizationsSvc = organizationService(db);
|
|
20
|
+
const issuesSvc = issueService(db);
|
|
21
|
+
const projectsSvc = projectService(db);
|
|
22
|
+
const agentsSvc = agentService(db);
|
|
23
|
+
const goalsSvc = goalService(db);
|
|
24
|
+
const assistantSvc = chatAssistantService(db);
|
|
25
|
+
const operatorProfiles = operatorProfileService(db);
|
|
26
|
+
const upload = multer({
|
|
27
|
+
storage: multer.memoryStorage(),
|
|
28
|
+
limits: { fileSize: MAX_ATTACHMENT_BYTES, files: 1 },
|
|
29
|
+
});
|
|
30
|
+
async function runSingleFileUpload(req, res) {
|
|
31
|
+
await new Promise((resolve, reject) => {
|
|
32
|
+
upload.single("file")(req, res, (err) => {
|
|
33
|
+
if (err)
|
|
34
|
+
reject(err);
|
|
35
|
+
else
|
|
36
|
+
resolve();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async function assertConversationAccess(req, conversationId) {
|
|
41
|
+
const conversation = await svc.getById(conversationId);
|
|
42
|
+
if (!conversation)
|
|
43
|
+
return null;
|
|
44
|
+
assertCompanyAccess(req, conversation.orgId);
|
|
45
|
+
return conversation;
|
|
46
|
+
}
|
|
47
|
+
function boardUserId(req) {
|
|
48
|
+
assertBoard(req);
|
|
49
|
+
return req.actor.userId ?? "local-board";
|
|
50
|
+
}
|
|
51
|
+
function buildChatObservabilityContext(conversation, input) {
|
|
52
|
+
return {
|
|
53
|
+
surface: input.surface ?? "chat_action",
|
|
54
|
+
rootExecutionId: input.rootExecutionId,
|
|
55
|
+
orgId: conversation.orgId,
|
|
56
|
+
agentId: conversation.preferredAgentId ?? null,
|
|
57
|
+
issueId: input.issueId ?? conversation.primaryIssueId ?? null,
|
|
58
|
+
sessionKey: conversation.id,
|
|
59
|
+
runtime: input.runtime ?? null,
|
|
60
|
+
trigger: input.trigger,
|
|
61
|
+
status: input.status ?? null,
|
|
62
|
+
metadata: {
|
|
63
|
+
conversationId: conversation.id,
|
|
64
|
+
...(input.metadata ?? {}),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async function withChatObservation(context, input, fn) {
|
|
69
|
+
let executionError = null;
|
|
70
|
+
try {
|
|
71
|
+
return await withExecutionObservation(context, input, async (observation) => {
|
|
72
|
+
try {
|
|
73
|
+
return await fn(observation);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
executionError = error;
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (executionError && error === executionError) {
|
|
83
|
+
throw error;
|
|
84
|
+
}
|
|
85
|
+
logger.warn({
|
|
86
|
+
rootExecutionId: context.rootExecutionId,
|
|
87
|
+
trigger: context.trigger,
|
|
88
|
+
err: error instanceof Error ? error.message : String(error),
|
|
89
|
+
}, "Failed to emit Langfuse chat observation");
|
|
90
|
+
return fn(null);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async function emitChatObservationEvent(context, input) {
|
|
94
|
+
try {
|
|
95
|
+
await observeExecutionEvent(context, input);
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
logger.warn({
|
|
99
|
+
rootExecutionId: context.rootExecutionId,
|
|
100
|
+
eventName: input.name,
|
|
101
|
+
err: error instanceof Error ? error.message : String(error),
|
|
102
|
+
}, "Failed to emit Langfuse chat event");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function summarizeChatObservationMessages(messages) {
|
|
106
|
+
const proposalMessage = messages.find((message) => message.kind === "issue_proposal" || message.kind === "operation_proposal");
|
|
107
|
+
const systemEventMessage = messages.find((message) => message.kind === "system_event");
|
|
108
|
+
const systemPayload = systemEventMessage?.structuredPayload && typeof systemEventMessage.structuredPayload === "object"
|
|
109
|
+
? systemEventMessage.structuredPayload
|
|
110
|
+
: null;
|
|
111
|
+
return {
|
|
112
|
+
createdMessageIds: messages.map((message) => message.id),
|
|
113
|
+
assistantKind: proposalMessage?.kind ?? messages.find((message) => message.role === "assistant")?.kind ?? null,
|
|
114
|
+
approvalId: proposalMessage?.approvalId ?? null,
|
|
115
|
+
issueId: typeof systemPayload?.issueId === "string" ? systemPayload.issueId : null,
|
|
116
|
+
issueIdentifier: typeof systemPayload?.issueIdentifier === "string" ? systemPayload.issueIdentifier : null,
|
|
117
|
+
eventType: typeof systemPayload?.eventType === "string" ? systemPayload.eventType : null,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function buildChatTraceInput(input, invocationMeta) {
|
|
121
|
+
return {
|
|
122
|
+
conversationId: input.conversationId,
|
|
123
|
+
body: input.body,
|
|
124
|
+
userMessageId: input.userMessageId,
|
|
125
|
+
instruction: typeof invocationMeta?.prompt === "string" && invocationMeta.prompt.trim().length > 0
|
|
126
|
+
? invocationMeta.prompt
|
|
127
|
+
: null,
|
|
128
|
+
promptMetrics: invocationMeta?.promptMetrics ?? null,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function mergeChatInvocationTraceMetadata(context, invocationMeta) {
|
|
132
|
+
context.metadata = {
|
|
133
|
+
...(context.metadata ?? {}),
|
|
134
|
+
runtimeAgentType: invocationMeta.agentRuntimeType,
|
|
135
|
+
runtimeCommand: invocationMeta.command,
|
|
136
|
+
runtimeCwd: invocationMeta.cwd ?? null,
|
|
137
|
+
runtimeCommandNotes: invocationMeta.commandNotes ?? [],
|
|
138
|
+
runtimePromptMetrics: invocationMeta.promptMetrics ?? null,
|
|
139
|
+
runtimePromptCaptured: typeof invocationMeta.prompt === "string" && invocationMeta.prompt.length > 0,
|
|
140
|
+
...(Array.isArray(invocationMeta.loadedSkills)
|
|
141
|
+
? summarizeRuntimeSkillsForTrace(invocationMeta.loadedSkills)
|
|
142
|
+
: {}),
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
async function logChatMessagesAdded(conversation, messages, actor) {
|
|
146
|
+
await Promise.all(messages.map((message) => logActivity(db, {
|
|
147
|
+
orgId: conversation.orgId,
|
|
148
|
+
actorType: actor.actorType,
|
|
149
|
+
actorId: actor.actorId,
|
|
150
|
+
agentId: actor.agentId ?? null,
|
|
151
|
+
runId: actor.runId ?? null,
|
|
152
|
+
action: "chat.message_added",
|
|
153
|
+
entityType: "chat",
|
|
154
|
+
entityId: conversation.id,
|
|
155
|
+
details: {
|
|
156
|
+
messageId: message.id,
|
|
157
|
+
role: message.role,
|
|
158
|
+
kind: message.kind,
|
|
159
|
+
status: message.status,
|
|
160
|
+
preview: message.body.slice(0, 280),
|
|
161
|
+
},
|
|
162
|
+
})));
|
|
163
|
+
}
|
|
164
|
+
async function assertContextLinksBelongToCompany(orgId, contextLinks) {
|
|
165
|
+
for (const link of contextLinks) {
|
|
166
|
+
if (link.entityType === "issue") {
|
|
167
|
+
const issue = await issuesSvc.getById(link.entityId);
|
|
168
|
+
if (!issue || issue.orgId !== orgId) {
|
|
169
|
+
throw new HttpError(422, "Issue context must belong to the same organization");
|
|
170
|
+
}
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (link.entityType === "project") {
|
|
174
|
+
const project = await projectsSvc.getById(link.entityId);
|
|
175
|
+
if (!project || project.orgId !== orgId) {
|
|
176
|
+
throw new HttpError(422, "Project context must belong to the same organization");
|
|
177
|
+
}
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const agent = await agentsSvc.getById(link.entityId);
|
|
181
|
+
if (!agent || agent.orgId !== orgId) {
|
|
182
|
+
throw new HttpError(422, "Agent context must belong to the same organization");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function turnContextFromUserMessage(userMessage) {
|
|
187
|
+
if (!userMessage.chatTurnId) {
|
|
188
|
+
throw new Error("User message missing chat turn id");
|
|
189
|
+
}
|
|
190
|
+
return { chatTurnId: userMessage.chatTurnId, turnVariant: userMessage.turnVariant };
|
|
191
|
+
}
|
|
192
|
+
async function addUserMessage(conversation, body, actor, editUserMessageId) {
|
|
193
|
+
const userMessage = await svc.addUserChatMessage(conversation.id, conversation.orgId, body, editUserMessageId ?? null);
|
|
194
|
+
await logActivity(db, {
|
|
195
|
+
orgId: conversation.orgId,
|
|
196
|
+
actorType: actor.actorType,
|
|
197
|
+
actorId: actor.actorId,
|
|
198
|
+
agentId: actor.agentId,
|
|
199
|
+
runId: actor.runId,
|
|
200
|
+
action: "chat.message_added",
|
|
201
|
+
entityType: "chat",
|
|
202
|
+
entityId: conversation.id,
|
|
203
|
+
details: {
|
|
204
|
+
messageId: userMessage.id,
|
|
205
|
+
role: "user",
|
|
206
|
+
kind: "message",
|
|
207
|
+
editUserMessageId: editUserMessageId ?? null,
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
return userMessage;
|
|
211
|
+
}
|
|
212
|
+
async function loadAssistantInput(conversation, actor) {
|
|
213
|
+
const freshConversation = await svc.getById(conversation.id);
|
|
214
|
+
const hydratedConversation = await assistantSvc.enrichConversation((freshConversation ?? conversation));
|
|
215
|
+
const rawMessages = await svc.listMessages(conversation.id);
|
|
216
|
+
const freshMessages = rawMessages.filter((m) => !m.supersededAt);
|
|
217
|
+
const operatorProfile = actor.actorType === "user"
|
|
218
|
+
? await operatorProfiles.get(actor.actorId)
|
|
219
|
+
: null;
|
|
220
|
+
return {
|
|
221
|
+
conversation: hydratedConversation,
|
|
222
|
+
messages: freshMessages,
|
|
223
|
+
contextLinks: (hydratedConversation.contextLinks ?? conversation.contextLinks),
|
|
224
|
+
operatorProfile,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function chatReplyingAgentId(conversation) {
|
|
228
|
+
return conversation?.chatRuntime?.runtimeAgentId ?? conversation?.preferredAgentId ?? null;
|
|
229
|
+
}
|
|
230
|
+
async function persistAssistantReply(conversation, actor, assistantReply, turnContext, transcript = [], replyingAgentId = assistantReply.replyingAgentId ?? chatReplyingAgentId(conversation)) {
|
|
231
|
+
const createdMessages = [];
|
|
232
|
+
const { chatTurnId, turnVariant } = turnContext;
|
|
233
|
+
if (assistantReply.kind === "issue_proposal") {
|
|
234
|
+
const shouldAutoCreateIssue = conversation.planMode || conversation.issueCreationMode === "auto_create";
|
|
235
|
+
if (shouldAutoCreateIssue) {
|
|
236
|
+
const proposalMessage = await svc.addMessage(conversation.id, {
|
|
237
|
+
orgId: conversation.orgId,
|
|
238
|
+
role: "assistant",
|
|
239
|
+
kind: "issue_proposal",
|
|
240
|
+
body: assistantReply.body,
|
|
241
|
+
structuredPayload: assistantReply.structuredPayload,
|
|
242
|
+
transcript,
|
|
243
|
+
replyingAgentId,
|
|
244
|
+
chatTurnId,
|
|
245
|
+
turnVariant,
|
|
246
|
+
});
|
|
247
|
+
createdMessages.push(proposalMessage);
|
|
248
|
+
const issue = await svc.convertToIssue(conversation.id, {
|
|
249
|
+
actorUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
250
|
+
messageId: proposalMessage.id,
|
|
251
|
+
});
|
|
252
|
+
const systemMessage = await svc.addMessage(conversation.id, {
|
|
253
|
+
orgId: conversation.orgId,
|
|
254
|
+
role: "system",
|
|
255
|
+
kind: "system_event",
|
|
256
|
+
body: `Created issue ${issue.identifier ?? issue.id} from this chat conversation.`,
|
|
257
|
+
structuredPayload: {
|
|
258
|
+
eventType: "issue_created",
|
|
259
|
+
issueId: issue.id,
|
|
260
|
+
issueIdentifier: issue.identifier,
|
|
261
|
+
},
|
|
262
|
+
chatTurnId,
|
|
263
|
+
turnVariant,
|
|
264
|
+
});
|
|
265
|
+
createdMessages.push(systemMessage);
|
|
266
|
+
await logActivity(db, {
|
|
267
|
+
orgId: conversation.orgId,
|
|
268
|
+
actorType: "system",
|
|
269
|
+
actorId: "chat-assistant",
|
|
270
|
+
action: "chat.issue_converted",
|
|
271
|
+
entityType: "chat",
|
|
272
|
+
entityId: conversation.id,
|
|
273
|
+
details: {
|
|
274
|
+
issueId: issue.id,
|
|
275
|
+
issueIdentifier: issue.identifier,
|
|
276
|
+
source: conversation.planMode ? "plan_mode" : "auto_create",
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
return createdMessages;
|
|
280
|
+
}
|
|
281
|
+
const approval = await svc.createProposalApproval(conversation.orgId, {
|
|
282
|
+
type: "chat_issue_creation",
|
|
283
|
+
requestedByUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
284
|
+
payload: {
|
|
285
|
+
chatConversationId: conversation.id,
|
|
286
|
+
proposedIssue: assistantReply.structuredPayload &&
|
|
287
|
+
typeof assistantReply.structuredPayload.issueProposal === "object" &&
|
|
288
|
+
assistantReply.structuredPayload.issueProposal !== null
|
|
289
|
+
? assistantReply.structuredPayload.issueProposal
|
|
290
|
+
: assistantReply.structuredPayload,
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
const proposalMessage = await svc.addMessage(conversation.id, {
|
|
294
|
+
orgId: conversation.orgId,
|
|
295
|
+
role: "assistant",
|
|
296
|
+
kind: "issue_proposal",
|
|
297
|
+
body: assistantReply.body,
|
|
298
|
+
structuredPayload: assistantReply.structuredPayload,
|
|
299
|
+
transcript,
|
|
300
|
+
approvalId: approval.id,
|
|
301
|
+
replyingAgentId,
|
|
302
|
+
chatTurnId,
|
|
303
|
+
turnVariant,
|
|
304
|
+
});
|
|
305
|
+
createdMessages.push(proposalMessage);
|
|
306
|
+
return createdMessages;
|
|
307
|
+
}
|
|
308
|
+
if (assistantReply.kind === "operation_proposal") {
|
|
309
|
+
const approval = await svc.createProposalApproval(conversation.orgId, {
|
|
310
|
+
type: "chat_operation",
|
|
311
|
+
requestedByUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
312
|
+
payload: {
|
|
313
|
+
chatConversationId: conversation.id,
|
|
314
|
+
operationProposal: assistantReply.structuredPayload &&
|
|
315
|
+
typeof assistantReply.structuredPayload.operationProposal === "object" &&
|
|
316
|
+
assistantReply.structuredPayload.operationProposal !== null
|
|
317
|
+
? assistantReply.structuredPayload.operationProposal
|
|
318
|
+
: assistantReply.structuredPayload,
|
|
319
|
+
},
|
|
320
|
+
});
|
|
321
|
+
const proposalMessage = await svc.addMessage(conversation.id, {
|
|
322
|
+
orgId: conversation.orgId,
|
|
323
|
+
role: "assistant",
|
|
324
|
+
kind: "operation_proposal",
|
|
325
|
+
body: assistantReply.body,
|
|
326
|
+
structuredPayload: {
|
|
327
|
+
...(assistantReply.structuredPayload ?? {}),
|
|
328
|
+
operationProposalState: {
|
|
329
|
+
status: "pending",
|
|
330
|
+
decisionNote: null,
|
|
331
|
+
decidedByUserId: null,
|
|
332
|
+
decidedAt: null,
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
transcript,
|
|
336
|
+
approvalId: approval.id,
|
|
337
|
+
replyingAgentId,
|
|
338
|
+
chatTurnId,
|
|
339
|
+
turnVariant,
|
|
340
|
+
});
|
|
341
|
+
createdMessages.push(proposalMessage);
|
|
342
|
+
return createdMessages;
|
|
343
|
+
}
|
|
344
|
+
const assistantMessage = await svc.addMessage(conversation.id, {
|
|
345
|
+
orgId: conversation.orgId,
|
|
346
|
+
role: "assistant",
|
|
347
|
+
kind: assistantReply.kind === "routing_suggestion" ? "routing_suggestion" : "message",
|
|
348
|
+
body: assistantReply.body,
|
|
349
|
+
structuredPayload: assistantReply.structuredPayload,
|
|
350
|
+
transcript,
|
|
351
|
+
replyingAgentId,
|
|
352
|
+
chatTurnId,
|
|
353
|
+
turnVariant,
|
|
354
|
+
});
|
|
355
|
+
createdMessages.push(assistantMessage);
|
|
356
|
+
return createdMessages;
|
|
357
|
+
}
|
|
358
|
+
async function persistPartialAssistantMessage(conversation, body, status, turnContext, transcript = [], replyingAgentId = chatReplyingAgentId(conversation)) {
|
|
359
|
+
const trimmed = body.trim();
|
|
360
|
+
if (!trimmed)
|
|
361
|
+
return null;
|
|
362
|
+
const chatTurnId = turnContext?.chatTurnId ?? randomUUID();
|
|
363
|
+
const turnVariant = turnContext?.turnVariant ?? 0;
|
|
364
|
+
const message = await svc.addMessage(conversation.id, {
|
|
365
|
+
orgId: conversation.orgId,
|
|
366
|
+
role: "assistant",
|
|
367
|
+
kind: "message",
|
|
368
|
+
status,
|
|
369
|
+
body: trimmed,
|
|
370
|
+
transcript,
|
|
371
|
+
replyingAgentId,
|
|
372
|
+
chatTurnId,
|
|
373
|
+
turnVariant,
|
|
374
|
+
});
|
|
375
|
+
return message;
|
|
376
|
+
}
|
|
377
|
+
function writeStreamEvent(res, event) {
|
|
378
|
+
if (res.writableEnded || res.destroyed)
|
|
379
|
+
return false;
|
|
380
|
+
res.write(`${JSON.stringify(event)}\n`);
|
|
381
|
+
return true;
|
|
382
|
+
}
|
|
383
|
+
router.get("/orgs/:orgId/chats", async (req, res) => {
|
|
384
|
+
const orgId = req.params.orgId;
|
|
385
|
+
assertCompanyAccess(req, orgId);
|
|
386
|
+
const statusParam = typeof req.query.status === "string" ? req.query.status : "active";
|
|
387
|
+
const status = statusParam === "resolved" || statusParam === "archived" || statusParam === "all"
|
|
388
|
+
? statusParam
|
|
389
|
+
: "active";
|
|
390
|
+
const userId = req.actor.type === "board" ? (req.actor.userId ?? "local-board") : null;
|
|
391
|
+
const conversations = await svc.list(orgId, { status }, userId);
|
|
392
|
+
res.json(await assistantSvc.enrichConversations(conversations));
|
|
393
|
+
});
|
|
394
|
+
router.post("/orgs/:orgId/chats", validate(createChatConversationSchema), async (req, res) => {
|
|
395
|
+
const orgId = req.params.orgId;
|
|
396
|
+
assertCompanyAccess(req, orgId);
|
|
397
|
+
const organization = await organizationsSvc.getById(orgId);
|
|
398
|
+
if (!organization) {
|
|
399
|
+
res.status(404).json({ error: "Organization not found" });
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const contextLinks = req.body.contextLinks ?? [];
|
|
403
|
+
await assertContextLinksBelongToCompany(orgId, contextLinks);
|
|
404
|
+
const actor = getActorInfo(req);
|
|
405
|
+
const conversation = await svc.create(orgId, {
|
|
406
|
+
title: req.body.title,
|
|
407
|
+
summary: req.body.summary ?? null,
|
|
408
|
+
preferredAgentId: req.body.preferredAgentId ?? null,
|
|
409
|
+
issueCreationMode: req.body.issueCreationMode ?? organization.defaultChatIssueCreationMode,
|
|
410
|
+
planMode: req.body.planMode ?? false,
|
|
411
|
+
createdByUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
412
|
+
contextLinks,
|
|
413
|
+
});
|
|
414
|
+
await logActivity(db, {
|
|
415
|
+
orgId,
|
|
416
|
+
actorType: actor.actorType,
|
|
417
|
+
actorId: actor.actorId,
|
|
418
|
+
agentId: actor.agentId,
|
|
419
|
+
runId: actor.runId,
|
|
420
|
+
action: "chat.created",
|
|
421
|
+
entityType: "chat",
|
|
422
|
+
entityId: conversation?.id ?? "unknown",
|
|
423
|
+
details: {
|
|
424
|
+
title: conversation?.title ?? "New chat",
|
|
425
|
+
contextLinkCount: contextLinks.length,
|
|
426
|
+
contextLinks: contextLinks.map((link) => ({
|
|
427
|
+
entityType: link.entityType,
|
|
428
|
+
entityId: link.entityId,
|
|
429
|
+
})),
|
|
430
|
+
},
|
|
431
|
+
});
|
|
432
|
+
res.status(201).json(await assistantSvc.enrichConversation(conversation));
|
|
433
|
+
});
|
|
434
|
+
router.get("/chats/:id", async (req, res) => {
|
|
435
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
436
|
+
if (!conversation) {
|
|
437
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
const userId = req.actor.type === "board" ? (req.actor.userId ?? "local-board") : null;
|
|
441
|
+
const refreshed = await svc.getById(conversation.id, userId);
|
|
442
|
+
res.json(await assistantSvc.enrichConversation(refreshed));
|
|
443
|
+
});
|
|
444
|
+
router.patch("/chats/:id", validate(updateChatConversationSchema), async (req, res) => {
|
|
445
|
+
const existing = await assertConversationAccess(req, req.params.id);
|
|
446
|
+
if (!existing) {
|
|
447
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
if (req.body.primaryIssueId) {
|
|
451
|
+
const issue = await issuesSvc.getById(req.body.primaryIssueId);
|
|
452
|
+
if (!issue || issue.orgId !== existing.orgId) {
|
|
453
|
+
res.status(422).json({ error: "Primary issue must belong to the same organization" });
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (req.body.preferredAgentId) {
|
|
458
|
+
const agent = await agentsSvc.getById(req.body.preferredAgentId);
|
|
459
|
+
if (!agent || agent.orgId !== existing.orgId) {
|
|
460
|
+
res.status(422).json({ error: "Preferred agent must belong to the same organization" });
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
if (req.body.routedAgentId) {
|
|
465
|
+
const agent = await agentsSvc.getById(req.body.routedAgentId);
|
|
466
|
+
if (!agent || agent.orgId !== existing.orgId) {
|
|
467
|
+
res.status(422).json({ error: "Routed agent must belong to the same organization" });
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
const updated = await svc.update(existing.id, {
|
|
472
|
+
...req.body,
|
|
473
|
+
resolvedAt: req.body.resolvedAt ? new Date(req.body.resolvedAt) : req.body.resolvedAt,
|
|
474
|
+
});
|
|
475
|
+
const actor = getActorInfo(req);
|
|
476
|
+
await logActivity(db, {
|
|
477
|
+
orgId: existing.orgId,
|
|
478
|
+
actorType: actor.actorType,
|
|
479
|
+
actorId: actor.actorId,
|
|
480
|
+
agentId: actor.agentId,
|
|
481
|
+
runId: actor.runId,
|
|
482
|
+
action: "chat.updated",
|
|
483
|
+
entityType: "chat",
|
|
484
|
+
entityId: existing.id,
|
|
485
|
+
details: req.body,
|
|
486
|
+
});
|
|
487
|
+
res.json(updated ? await assistantSvc.enrichConversation(updated) : null);
|
|
488
|
+
});
|
|
489
|
+
router.get("/chats/:id/messages", async (req, res) => {
|
|
490
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
491
|
+
if (!conversation) {
|
|
492
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
const messages = await svc.listMessages(conversation.id);
|
|
496
|
+
res.json(messages);
|
|
497
|
+
});
|
|
498
|
+
router.post("/chats/:id/messages", validate(addChatMessageSchema), async (req, res) => {
|
|
499
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
500
|
+
if (!conversation) {
|
|
501
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
const assistantAvailability = await assistantSvc.getChatAssistantAvailability(conversation);
|
|
505
|
+
if (!assistantAvailability.available) {
|
|
506
|
+
res.status(503).json({ error: assistantAvailability.error });
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
const releaseGeneration = claimChatGeneration(conversation.id);
|
|
510
|
+
if (!releaseGeneration) {
|
|
511
|
+
res.status(409).json({ error: "A chat reply is already being generated for this conversation" });
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
const actor = getActorInfo(req);
|
|
515
|
+
let chatObservation = null;
|
|
516
|
+
try {
|
|
517
|
+
const userMessage = await addUserMessage(conversation, req.body.body, actor, req.body.editUserMessageId ?? null);
|
|
518
|
+
const turnContext = turnContextFromUserMessage(userMessage);
|
|
519
|
+
chatObservation = buildChatObservabilityContext(conversation, {
|
|
520
|
+
surface: "chat_turn",
|
|
521
|
+
rootExecutionId: turnContext.chatTurnId,
|
|
522
|
+
trigger: "assistant_reply",
|
|
523
|
+
runtime: assistantAvailability.agentRuntimeType ?? null,
|
|
524
|
+
metadata: {
|
|
525
|
+
stream: false,
|
|
526
|
+
userMessageId: userMessage.id,
|
|
527
|
+
editUserMessageId: req.body.editUserMessageId ?? null,
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
const traceInputBase = {
|
|
531
|
+
conversationId: conversation.id,
|
|
532
|
+
body: req.body.body,
|
|
533
|
+
userMessageId: userMessage.id,
|
|
534
|
+
};
|
|
535
|
+
let currentChatTraceInput = buildChatTraceInput(traceInputBase);
|
|
536
|
+
const persistedAssistantMessages = await withChatObservation(chatObservation, {
|
|
537
|
+
name: "chat_turn",
|
|
538
|
+
asType: "agent",
|
|
539
|
+
input: currentChatTraceInput,
|
|
540
|
+
}, async (observation) => {
|
|
541
|
+
const assistantInput = await loadAssistantInput(conversation, actor);
|
|
542
|
+
const transcript = [];
|
|
543
|
+
const observedTranscript = [];
|
|
544
|
+
let fallbackOutput = null;
|
|
545
|
+
let finalChatOutput = null;
|
|
546
|
+
let finalChatStatus = "completed";
|
|
547
|
+
try {
|
|
548
|
+
const streamed = await assistantSvc.streamChatAssistantReply({
|
|
549
|
+
...assistantInput,
|
|
550
|
+
onInvocationMeta: async (meta) => {
|
|
551
|
+
currentChatTraceInput = buildChatTraceInput(traceInputBase, meta);
|
|
552
|
+
mergeChatInvocationTraceMetadata(chatObservation, meta);
|
|
553
|
+
updateExecutionObservation(observation, chatObservation, {
|
|
554
|
+
input: currentChatTraceInput,
|
|
555
|
+
});
|
|
556
|
+
updateExecutionTraceIO(observation, { input: currentChatTraceInput });
|
|
557
|
+
},
|
|
558
|
+
onTranscriptEntry: async (entry) => {
|
|
559
|
+
transcript.push(entry);
|
|
560
|
+
},
|
|
561
|
+
onObservedTranscriptEntry: async (entry) => {
|
|
562
|
+
observedTranscript.push(entry);
|
|
563
|
+
},
|
|
564
|
+
});
|
|
565
|
+
fallbackOutput = streamed.partialBody;
|
|
566
|
+
if (streamed.outcome !== "completed") {
|
|
567
|
+
finalChatStatus = "failed";
|
|
568
|
+
throw new Error("Chat assistant reply was stopped before completion");
|
|
569
|
+
}
|
|
570
|
+
const created = await persistAssistantReply(assistantInput.conversation, actor, streamed.reply, turnContext, transcript, streamed.replyingAgentId);
|
|
571
|
+
finalChatOutput = streamed.reply.body;
|
|
572
|
+
await logChatMessagesAdded(assistantInput.conversation, created, {
|
|
573
|
+
actorType: "system",
|
|
574
|
+
actorId: "chat-assistant",
|
|
575
|
+
agentId: streamed.replyingAgentId,
|
|
576
|
+
});
|
|
577
|
+
const summary = summarizeChatObservationMessages(created);
|
|
578
|
+
await emitChatObservationEvent(chatObservation, {
|
|
579
|
+
name: "chat.reply.persisted",
|
|
580
|
+
metadata: {
|
|
581
|
+
transcriptEntries: transcript.length,
|
|
582
|
+
observedTranscriptEntries: observedTranscript.length,
|
|
583
|
+
...summary,
|
|
584
|
+
},
|
|
585
|
+
});
|
|
586
|
+
return created;
|
|
587
|
+
}
|
|
588
|
+
catch (error) {
|
|
589
|
+
if (error instanceof ChatAssistantStreamError) {
|
|
590
|
+
fallbackOutput = error.partialBody;
|
|
591
|
+
}
|
|
592
|
+
finalChatStatus = "failed";
|
|
593
|
+
throw error;
|
|
594
|
+
}
|
|
595
|
+
finally {
|
|
596
|
+
try {
|
|
597
|
+
const transcriptStats = emitExecutionTranscriptTree({
|
|
598
|
+
context: chatObservation,
|
|
599
|
+
parentObservation: observation,
|
|
600
|
+
transcript: observedTranscript,
|
|
601
|
+
fallbackResult: fallbackOutput
|
|
602
|
+
? {
|
|
603
|
+
output: fallbackOutput,
|
|
604
|
+
}
|
|
605
|
+
: null,
|
|
606
|
+
});
|
|
607
|
+
finalChatOutput = finalChatOutput ?? transcriptStats.finalOutput ?? fallbackOutput ?? null;
|
|
608
|
+
}
|
|
609
|
+
catch (error) {
|
|
610
|
+
logger.warn({
|
|
611
|
+
rootExecutionId: chatObservation.rootExecutionId,
|
|
612
|
+
err: error instanceof Error ? error.message : String(error),
|
|
613
|
+
}, "Failed to export chat transcript tree to Langfuse");
|
|
614
|
+
}
|
|
615
|
+
updateExecutionObservation(observation, {
|
|
616
|
+
...chatObservation,
|
|
617
|
+
status: finalChatStatus,
|
|
618
|
+
}, {
|
|
619
|
+
input: currentChatTraceInput,
|
|
620
|
+
output: finalChatOutput,
|
|
621
|
+
level: finalChatStatus === "failed" ? "ERROR" : "DEFAULT",
|
|
622
|
+
statusMessage: finalChatStatus,
|
|
623
|
+
});
|
|
624
|
+
updateExecutionTraceIO(observation, {
|
|
625
|
+
input: currentChatTraceInput,
|
|
626
|
+
output: finalChatOutput,
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
const createdMessages = [userMessage, ...persistedAssistantMessages];
|
|
631
|
+
res.status(201).json({ messages: createdMessages });
|
|
632
|
+
}
|
|
633
|
+
catch (err) {
|
|
634
|
+
if (chatObservation) {
|
|
635
|
+
await emitChatObservationEvent(chatObservation, {
|
|
636
|
+
name: "chat.reply.failed",
|
|
637
|
+
level: "ERROR",
|
|
638
|
+
metadata: {
|
|
639
|
+
error: err instanceof Error ? err.message : String(err),
|
|
640
|
+
},
|
|
641
|
+
statusMessage: err instanceof Error ? err.message : "chat_reply_failed",
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
logger.warn({ err, conversationId: conversation.id }, "chat assistant reply failed");
|
|
645
|
+
res.status(502).json({
|
|
646
|
+
error: err instanceof Error ? err.message : "Chat assistant failed to respond",
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
finally {
|
|
650
|
+
releaseGeneration();
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
router.post("/chats/:id/messages/stream", validate(addChatMessageSchema), async (req, res) => {
|
|
654
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
655
|
+
if (!conversation) {
|
|
656
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
const assistantAvailability = await assistantSvc.getChatAssistantAvailability(conversation);
|
|
660
|
+
if (!assistantAvailability.available) {
|
|
661
|
+
res.status(503).json({ error: assistantAvailability.error });
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
const releaseGeneration = claimChatGeneration(conversation.id);
|
|
665
|
+
if (!releaseGeneration) {
|
|
666
|
+
res.status(409).json({ error: "A chat reply is already being generated for this conversation" });
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
const actor = getActorInfo(req);
|
|
670
|
+
let assistantConversationForPartial = null;
|
|
671
|
+
let turnContextForPartial = null;
|
|
672
|
+
let chatObservation = null;
|
|
673
|
+
const transcript = [];
|
|
674
|
+
const observedTranscript = [];
|
|
675
|
+
let requestClosed = false;
|
|
676
|
+
const abortController = new AbortController();
|
|
677
|
+
const handleClosed = () => {
|
|
678
|
+
if (requestClosed || res.writableEnded)
|
|
679
|
+
return;
|
|
680
|
+
requestClosed = true;
|
|
681
|
+
abortController.abort();
|
|
682
|
+
};
|
|
683
|
+
req.on("aborted", handleClosed);
|
|
684
|
+
res.on("close", handleClosed);
|
|
685
|
+
res.status(201);
|
|
686
|
+
res.setHeader("Content-Type", "application/x-ndjson; charset=utf-8");
|
|
687
|
+
res.setHeader("Cache-Control", "no-cache, no-transform");
|
|
688
|
+
res.setHeader("X-Accel-Buffering", "no");
|
|
689
|
+
res.flushHeaders();
|
|
690
|
+
try {
|
|
691
|
+
const userMessage = await addUserMessage(conversation, req.body.body, actor, req.body.editUserMessageId ?? null);
|
|
692
|
+
turnContextForPartial = turnContextFromUserMessage(userMessage);
|
|
693
|
+
chatObservation = buildChatObservabilityContext(conversation, {
|
|
694
|
+
surface: "chat_turn",
|
|
695
|
+
rootExecutionId: turnContextForPartial.chatTurnId,
|
|
696
|
+
trigger: "assistant_reply_stream",
|
|
697
|
+
runtime: assistantAvailability.agentRuntimeType ?? null,
|
|
698
|
+
metadata: {
|
|
699
|
+
stream: true,
|
|
700
|
+
userMessageId: userMessage.id,
|
|
701
|
+
editUserMessageId: req.body.editUserMessageId ?? null,
|
|
702
|
+
},
|
|
703
|
+
});
|
|
704
|
+
const traceInputBase = {
|
|
705
|
+
conversationId: conversation.id,
|
|
706
|
+
body: req.body.body,
|
|
707
|
+
userMessageId: userMessage.id,
|
|
708
|
+
};
|
|
709
|
+
let currentChatTraceInput = buildChatTraceInput(traceInputBase);
|
|
710
|
+
writeStreamEvent(res, {
|
|
711
|
+
type: "ack",
|
|
712
|
+
userMessage,
|
|
713
|
+
});
|
|
714
|
+
await withChatObservation(chatObservation, {
|
|
715
|
+
name: "chat_turn",
|
|
716
|
+
asType: "agent",
|
|
717
|
+
input: currentChatTraceInput,
|
|
718
|
+
}, async (observation) => {
|
|
719
|
+
const assistantInput = await loadAssistantInput(conversation, actor);
|
|
720
|
+
assistantConversationForPartial = assistantInput.conversation;
|
|
721
|
+
let finalChatOutput = null;
|
|
722
|
+
let finalChatStatus = "completed";
|
|
723
|
+
try {
|
|
724
|
+
const streamed = await assistantSvc.streamChatAssistantReply({
|
|
725
|
+
...assistantInput,
|
|
726
|
+
abortSignal: abortController.signal,
|
|
727
|
+
onInvocationMeta: async (meta) => {
|
|
728
|
+
currentChatTraceInput = buildChatTraceInput(traceInputBase, meta);
|
|
729
|
+
mergeChatInvocationTraceMetadata(chatObservation, meta);
|
|
730
|
+
updateExecutionObservation(observation, chatObservation, {
|
|
731
|
+
input: currentChatTraceInput,
|
|
732
|
+
});
|
|
733
|
+
updateExecutionTraceIO(observation, { input: currentChatTraceInput });
|
|
734
|
+
},
|
|
735
|
+
onAssistantDelta: async (delta) => {
|
|
736
|
+
writeStreamEvent(res, {
|
|
737
|
+
type: "assistant_delta",
|
|
738
|
+
delta,
|
|
739
|
+
});
|
|
740
|
+
},
|
|
741
|
+
onAssistantState: async (state) => {
|
|
742
|
+
if (requestClosed)
|
|
743
|
+
return;
|
|
744
|
+
writeStreamEvent(res, {
|
|
745
|
+
type: "assistant_state",
|
|
746
|
+
state,
|
|
747
|
+
});
|
|
748
|
+
},
|
|
749
|
+
onTranscriptEntry: async (entry) => {
|
|
750
|
+
transcript.push(entry);
|
|
751
|
+
if (requestClosed)
|
|
752
|
+
return;
|
|
753
|
+
writeStreamEvent(res, {
|
|
754
|
+
type: "transcript_entry",
|
|
755
|
+
entry,
|
|
756
|
+
});
|
|
757
|
+
},
|
|
758
|
+
onObservedTranscriptEntry: async (entry) => {
|
|
759
|
+
observedTranscript.push(entry);
|
|
760
|
+
},
|
|
761
|
+
});
|
|
762
|
+
if (streamed.outcome === "stopped") {
|
|
763
|
+
finalChatStatus = "stopped";
|
|
764
|
+
finalChatOutput = streamed.partialBody;
|
|
765
|
+
const stoppedMessage = await persistPartialAssistantMessage(assistantInput.conversation, streamed.partialBody, "stopped", turnContextForPartial, transcript, streamed.replyingAgentId);
|
|
766
|
+
if (stoppedMessage) {
|
|
767
|
+
await logChatMessagesAdded(assistantInput.conversation, [stoppedMessage], {
|
|
768
|
+
actorType: "system",
|
|
769
|
+
actorId: "chat-assistant",
|
|
770
|
+
agentId: streamed.replyingAgentId,
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
await emitChatObservationEvent(chatObservation, {
|
|
774
|
+
name: "chat.reply.stopped",
|
|
775
|
+
level: "WARNING",
|
|
776
|
+
metadata: {
|
|
777
|
+
stoppedMessageId: stoppedMessage?.id ?? null,
|
|
778
|
+
transcriptEntries: transcript.length,
|
|
779
|
+
observedTranscriptEntries: observedTranscript.length,
|
|
780
|
+
},
|
|
781
|
+
});
|
|
782
|
+
if (!requestClosed) {
|
|
783
|
+
writeStreamEvent(res, {
|
|
784
|
+
type: "final",
|
|
785
|
+
messages: stoppedMessage ? [stoppedMessage] : [],
|
|
786
|
+
});
|
|
787
|
+
res.end();
|
|
788
|
+
}
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
const createdMessages = await persistAssistantReply(assistantInput.conversation, actor, streamed.reply, turnContextForPartial, transcript, streamed.replyingAgentId);
|
|
792
|
+
finalChatOutput = streamed.reply.body;
|
|
793
|
+
await logChatMessagesAdded(assistantInput.conversation, createdMessages, {
|
|
794
|
+
actorType: "system",
|
|
795
|
+
actorId: "chat-assistant",
|
|
796
|
+
agentId: streamed.replyingAgentId,
|
|
797
|
+
});
|
|
798
|
+
await emitChatObservationEvent(chatObservation, {
|
|
799
|
+
name: "chat.reply.persisted",
|
|
800
|
+
metadata: {
|
|
801
|
+
transcriptEntries: transcript.length,
|
|
802
|
+
observedTranscriptEntries: observedTranscript.length,
|
|
803
|
+
...summarizeChatObservationMessages(createdMessages),
|
|
804
|
+
},
|
|
805
|
+
});
|
|
806
|
+
writeStreamEvent(res, {
|
|
807
|
+
type: "final",
|
|
808
|
+
messages: createdMessages,
|
|
809
|
+
});
|
|
810
|
+
res.end();
|
|
811
|
+
}
|
|
812
|
+
catch (error) {
|
|
813
|
+
finalChatStatus = "failed";
|
|
814
|
+
if (error instanceof ChatAssistantStreamError) {
|
|
815
|
+
finalChatOutput = error.partialBody;
|
|
816
|
+
}
|
|
817
|
+
throw error;
|
|
818
|
+
}
|
|
819
|
+
finally {
|
|
820
|
+
try {
|
|
821
|
+
const transcriptStats = emitExecutionTranscriptTree({
|
|
822
|
+
context: chatObservation,
|
|
823
|
+
parentObservation: observation,
|
|
824
|
+
transcript: observedTranscript,
|
|
825
|
+
});
|
|
826
|
+
finalChatOutput = finalChatOutput ?? transcriptStats.finalOutput ?? null;
|
|
827
|
+
}
|
|
828
|
+
catch (error) {
|
|
829
|
+
logger.warn({
|
|
830
|
+
rootExecutionId: chatObservation.rootExecutionId,
|
|
831
|
+
err: error instanceof Error ? error.message : String(error),
|
|
832
|
+
}, "Failed to export chat transcript tree to Langfuse");
|
|
833
|
+
}
|
|
834
|
+
updateExecutionObservation(observation, {
|
|
835
|
+
...chatObservation,
|
|
836
|
+
status: finalChatStatus,
|
|
837
|
+
}, {
|
|
838
|
+
input: currentChatTraceInput,
|
|
839
|
+
output: finalChatOutput,
|
|
840
|
+
level: finalChatStatus === "failed" ? "ERROR" : "DEFAULT",
|
|
841
|
+
statusMessage: finalChatStatus,
|
|
842
|
+
});
|
|
843
|
+
updateExecutionTraceIO(observation, {
|
|
844
|
+
input: currentChatTraceInput,
|
|
845
|
+
output: finalChatOutput,
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
catch (err) {
|
|
851
|
+
const partialBody = err instanceof ChatAssistantStreamError ? err.partialBody : "";
|
|
852
|
+
const failedReplyingAgentId = chatReplyingAgentId(assistantConversationForPartial);
|
|
853
|
+
const failedMessage = await persistPartialAssistantMessage(assistantConversationForPartial ?? conversation, partialBody, "failed", turnContextForPartial, transcript, failedReplyingAgentId).catch(() => null);
|
|
854
|
+
if (failedMessage && assistantConversationForPartial) {
|
|
855
|
+
await logChatMessagesAdded(assistantConversationForPartial, [failedMessage], {
|
|
856
|
+
actorType: "system",
|
|
857
|
+
actorId: "chat-assistant",
|
|
858
|
+
agentId: failedReplyingAgentId,
|
|
859
|
+
}).catch(() => { });
|
|
860
|
+
}
|
|
861
|
+
if (chatObservation) {
|
|
862
|
+
await emitChatObservationEvent(chatObservation, {
|
|
863
|
+
name: "chat.reply.failed",
|
|
864
|
+
level: "ERROR",
|
|
865
|
+
metadata: {
|
|
866
|
+
failedMessageId: failedMessage?.id ?? null,
|
|
867
|
+
transcriptEntries: transcript.length,
|
|
868
|
+
observedTranscriptEntries: observedTranscript.length,
|
|
869
|
+
error: err instanceof Error ? err.message : String(err),
|
|
870
|
+
},
|
|
871
|
+
statusMessage: err instanceof Error ? err.message : "chat_reply_failed",
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
logger.warn({ err, conversationId: conversation.id }, "chat assistant stream failed");
|
|
875
|
+
if (!requestClosed) {
|
|
876
|
+
writeStreamEvent(res, {
|
|
877
|
+
type: "error",
|
|
878
|
+
error: err instanceof Error ? err.message : "Chat assistant failed to respond",
|
|
879
|
+
messageId: failedMessage?.id ?? null,
|
|
880
|
+
});
|
|
881
|
+
res.end();
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
finally {
|
|
885
|
+
req.off("aborted", handleClosed);
|
|
886
|
+
res.off("close", handleClosed);
|
|
887
|
+
releaseGeneration();
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
router.post("/orgs/:orgId/chats/:chatId/attachments", async (req, res) => {
|
|
891
|
+
const orgId = req.params.orgId;
|
|
892
|
+
const chatId = req.params.chatId;
|
|
893
|
+
assertCompanyAccess(req, orgId);
|
|
894
|
+
const conversation = await svc.getById(chatId);
|
|
895
|
+
if (!conversation) {
|
|
896
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
if (conversation.orgId !== orgId) {
|
|
900
|
+
res.status(422).json({ error: "Chat conversation does not belong to organization" });
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
try {
|
|
904
|
+
await runSingleFileUpload(req, res);
|
|
905
|
+
}
|
|
906
|
+
catch (err) {
|
|
907
|
+
if (err instanceof multer.MulterError) {
|
|
908
|
+
if (err.code === "LIMIT_FILE_SIZE") {
|
|
909
|
+
res.status(422).json({ error: `Attachment exceeds ${MAX_ATTACHMENT_BYTES} bytes` });
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
res.status(400).json({ error: err.message });
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
throw err;
|
|
916
|
+
}
|
|
917
|
+
const file = req.file;
|
|
918
|
+
if (!file) {
|
|
919
|
+
res.status(400).json({ error: "Missing file field 'file'" });
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
const contentType = (file.mimetype || "").toLowerCase();
|
|
923
|
+
if (!isAllowedContentType(contentType)) {
|
|
924
|
+
res.status(422).json({ error: `Unsupported attachment type: ${contentType || "unknown"}` });
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
if (file.buffer.length <= 0) {
|
|
928
|
+
res.status(422).json({ error: "Attachment is empty" });
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
const parsedMeta = createChatAttachmentMetadataSchema.safeParse(req.body ?? {});
|
|
932
|
+
if (!parsedMeta.success) {
|
|
933
|
+
res.status(400).json({ error: "Invalid attachment metadata", details: parsedMeta.error.issues });
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
const actor = getActorInfo(req);
|
|
937
|
+
const stored = await storage.putFile({
|
|
938
|
+
orgId,
|
|
939
|
+
namespace: `chats/${chatId}`,
|
|
940
|
+
originalFilename: file.originalname || null,
|
|
941
|
+
contentType,
|
|
942
|
+
body: file.buffer,
|
|
943
|
+
});
|
|
944
|
+
const attachment = await svc.createAttachment({
|
|
945
|
+
orgId,
|
|
946
|
+
conversationId: chatId,
|
|
947
|
+
messageId: parsedMeta.data.messageId,
|
|
948
|
+
provider: stored.provider,
|
|
949
|
+
objectKey: stored.objectKey,
|
|
950
|
+
contentType: stored.contentType,
|
|
951
|
+
byteSize: stored.byteSize,
|
|
952
|
+
sha256: stored.sha256,
|
|
953
|
+
originalFilename: stored.originalFilename,
|
|
954
|
+
createdByAgentId: actor.agentId,
|
|
955
|
+
createdByUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
956
|
+
});
|
|
957
|
+
await logActivity(db, {
|
|
958
|
+
orgId,
|
|
959
|
+
actorType: actor.actorType,
|
|
960
|
+
actorId: actor.actorId,
|
|
961
|
+
agentId: actor.agentId,
|
|
962
|
+
runId: actor.runId,
|
|
963
|
+
action: "chat.attachment_added",
|
|
964
|
+
entityType: "chat",
|
|
965
|
+
entityId: chatId,
|
|
966
|
+
details: {
|
|
967
|
+
attachmentId: attachment.id,
|
|
968
|
+
messageId: attachment.messageId,
|
|
969
|
+
originalFilename: attachment.originalFilename,
|
|
970
|
+
contentType: attachment.contentType,
|
|
971
|
+
},
|
|
972
|
+
});
|
|
973
|
+
res.status(201).json(attachment);
|
|
974
|
+
});
|
|
975
|
+
router.post("/chats/:id/context-links", validate(createChatContextLinkSchema), async (req, res) => {
|
|
976
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
977
|
+
if (!conversation) {
|
|
978
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
await assertContextLinksBelongToCompany(conversation.orgId, [req.body]);
|
|
982
|
+
const linked = await svc.addContextLink(conversation.id, conversation.orgId, req.body);
|
|
983
|
+
const actor = getActorInfo(req);
|
|
984
|
+
await logActivity(db, {
|
|
985
|
+
orgId: conversation.orgId,
|
|
986
|
+
actorType: actor.actorType,
|
|
987
|
+
actorId: actor.actorId,
|
|
988
|
+
agentId: actor.agentId,
|
|
989
|
+
runId: actor.runId,
|
|
990
|
+
action: "chat.context_linked",
|
|
991
|
+
entityType: "chat",
|
|
992
|
+
entityId: conversation.id,
|
|
993
|
+
details: req.body,
|
|
994
|
+
});
|
|
995
|
+
res.status(201).json(linked);
|
|
996
|
+
});
|
|
997
|
+
router.post("/chats/:id/convert-to-issue", validate(convertChatToIssueSchema), async (req, res) => {
|
|
998
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
999
|
+
if (!conversation) {
|
|
1000
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
1001
|
+
return;
|
|
1002
|
+
}
|
|
1003
|
+
const actor = getActorInfo(req);
|
|
1004
|
+
if (req.body.proposal?.goalId) {
|
|
1005
|
+
const goal = await goalsSvc.getById(req.body.proposal.goalId);
|
|
1006
|
+
if (!goal || goal.orgId !== conversation.orgId) {
|
|
1007
|
+
res.status(422).json({ error: "Goal must belong to the same organization" });
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
const chatObservation = buildChatObservabilityContext(conversation, {
|
|
1012
|
+
rootExecutionId: req.body.messageId ?? `chat-convert:${conversation.id}`,
|
|
1013
|
+
trigger: "convert_to_issue",
|
|
1014
|
+
metadata: {
|
|
1015
|
+
source: "chat_route",
|
|
1016
|
+
messageId: req.body.messageId ?? null,
|
|
1017
|
+
},
|
|
1018
|
+
});
|
|
1019
|
+
const result = await withChatObservation(chatObservation, {
|
|
1020
|
+
name: "chat:convert_to_issue",
|
|
1021
|
+
asType: "tool",
|
|
1022
|
+
input: {
|
|
1023
|
+
conversationId: conversation.id,
|
|
1024
|
+
messageId: req.body.messageId ?? null,
|
|
1025
|
+
proposal: req.body.proposal ?? null,
|
|
1026
|
+
},
|
|
1027
|
+
}, async () => {
|
|
1028
|
+
const issue = await svc.convertToIssue(conversation.id, {
|
|
1029
|
+
actorUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
1030
|
+
messageId: req.body.messageId ?? null,
|
|
1031
|
+
proposal: req.body.proposal ?? null,
|
|
1032
|
+
});
|
|
1033
|
+
const systemMessage = await svc.addMessage(conversation.id, {
|
|
1034
|
+
orgId: conversation.orgId,
|
|
1035
|
+
role: "system",
|
|
1036
|
+
kind: "system_event",
|
|
1037
|
+
body: `Created issue ${issue.identifier ?? issue.id} from this chat conversation.`,
|
|
1038
|
+
structuredPayload: {
|
|
1039
|
+
eventType: "issue_created",
|
|
1040
|
+
issueId: issue.id,
|
|
1041
|
+
issueIdentifier: issue.identifier,
|
|
1042
|
+
},
|
|
1043
|
+
});
|
|
1044
|
+
await logActivity(db, {
|
|
1045
|
+
orgId: conversation.orgId,
|
|
1046
|
+
actorType: actor.actorType,
|
|
1047
|
+
actorId: actor.actorId,
|
|
1048
|
+
agentId: actor.agentId,
|
|
1049
|
+
runId: actor.runId,
|
|
1050
|
+
action: "chat.issue_converted",
|
|
1051
|
+
entityType: "chat",
|
|
1052
|
+
entityId: conversation.id,
|
|
1053
|
+
details: {
|
|
1054
|
+
issueId: issue.id,
|
|
1055
|
+
issueIdentifier: issue.identifier,
|
|
1056
|
+
messageId: req.body.messageId ?? null,
|
|
1057
|
+
systemMessageId: systemMessage.id,
|
|
1058
|
+
},
|
|
1059
|
+
});
|
|
1060
|
+
await emitChatObservationEvent(chatObservation, {
|
|
1061
|
+
name: "chat.issue.created",
|
|
1062
|
+
metadata: {
|
|
1063
|
+
issueId: issue.id,
|
|
1064
|
+
issueIdentifier: issue.identifier,
|
|
1065
|
+
systemMessageId: systemMessage.id,
|
|
1066
|
+
},
|
|
1067
|
+
});
|
|
1068
|
+
return { issue, systemMessage };
|
|
1069
|
+
});
|
|
1070
|
+
res.status(201).json(result);
|
|
1071
|
+
});
|
|
1072
|
+
router.post("/chats/:id/messages/:messageId/operation-proposal/resolve", validate(resolveChatOperationProposalSchema), async (req, res) => {
|
|
1073
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
1074
|
+
if (!conversation) {
|
|
1075
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
const actor = getActorInfo(req);
|
|
1079
|
+
const messageId = req.params.messageId;
|
|
1080
|
+
const chatObservation = buildChatObservabilityContext(conversation, {
|
|
1081
|
+
rootExecutionId: messageId,
|
|
1082
|
+
trigger: "resolve_operation_proposal",
|
|
1083
|
+
metadata: {
|
|
1084
|
+
action: req.body.action,
|
|
1085
|
+
decisionNote: req.body.decisionNote ?? null,
|
|
1086
|
+
},
|
|
1087
|
+
});
|
|
1088
|
+
const result = await withChatObservation(chatObservation, {
|
|
1089
|
+
name: "chat:resolve_operation_proposal",
|
|
1090
|
+
asType: "tool",
|
|
1091
|
+
input: {
|
|
1092
|
+
conversationId: conversation.id,
|
|
1093
|
+
messageId,
|
|
1094
|
+
action: req.body.action,
|
|
1095
|
+
},
|
|
1096
|
+
}, async () => {
|
|
1097
|
+
const resolved = await svc.resolveOperationProposal(conversation.id, messageId, {
|
|
1098
|
+
action: req.body.action,
|
|
1099
|
+
actorUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
1100
|
+
decisionNote: req.body.decisionNote ?? null,
|
|
1101
|
+
});
|
|
1102
|
+
await emitChatObservationEvent(chatObservation, {
|
|
1103
|
+
name: "chat.operation_proposal.resolved",
|
|
1104
|
+
metadata: {
|
|
1105
|
+
action: req.body.action,
|
|
1106
|
+
messageId: resolved.message.id,
|
|
1107
|
+
systemMessageId: resolved.systemMessage.id,
|
|
1108
|
+
},
|
|
1109
|
+
});
|
|
1110
|
+
return resolved;
|
|
1111
|
+
});
|
|
1112
|
+
res.status(201).json(result);
|
|
1113
|
+
});
|
|
1114
|
+
router.post("/chats/:id/resolve", async (req, res) => {
|
|
1115
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
1116
|
+
if (!conversation) {
|
|
1117
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
const resolved = await svc.resolve(conversation.id);
|
|
1121
|
+
const actor = getActorInfo(req);
|
|
1122
|
+
await logActivity(db, {
|
|
1123
|
+
orgId: conversation.orgId,
|
|
1124
|
+
actorType: actor.actorType,
|
|
1125
|
+
actorId: actor.actorId,
|
|
1126
|
+
agentId: actor.agentId,
|
|
1127
|
+
runId: actor.runId,
|
|
1128
|
+
action: "chat.resolved",
|
|
1129
|
+
entityType: "chat",
|
|
1130
|
+
entityId: conversation.id,
|
|
1131
|
+
});
|
|
1132
|
+
res.json(resolved ? await assistantSvc.enrichConversation(resolved) : null);
|
|
1133
|
+
});
|
|
1134
|
+
router.post("/chats/:id/read", async (req, res) => {
|
|
1135
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
1136
|
+
if (!conversation) {
|
|
1137
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
const userId = boardUserId(req);
|
|
1141
|
+
const state = await svc.markRead(conversation.id, conversation.orgId, userId);
|
|
1142
|
+
res.status(201).json({
|
|
1143
|
+
conversationId: conversation.id,
|
|
1144
|
+
lastReadAt: state.lastReadAt,
|
|
1145
|
+
});
|
|
1146
|
+
});
|
|
1147
|
+
router.post("/chats/:id/user-state", validate(updateChatConversationUserStateSchema), async (req, res) => {
|
|
1148
|
+
const conversation = await assertConversationAccess(req, req.params.id);
|
|
1149
|
+
if (!conversation) {
|
|
1150
|
+
res.status(404).json({ error: "Chat conversation not found" });
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
const userId = boardUserId(req);
|
|
1154
|
+
if (typeof req.body.pinned === "boolean") {
|
|
1155
|
+
await svc.setPinned(conversation.id, conversation.orgId, userId, req.body.pinned);
|
|
1156
|
+
}
|
|
1157
|
+
const refreshed = await svc.getById(conversation.id, userId);
|
|
1158
|
+
res.json(await assistantSvc.enrichConversation(refreshed));
|
|
1159
|
+
});
|
|
1160
|
+
return router;
|
|
1161
|
+
}
|
|
1162
|
+
//# sourceMappingURL=chats.js.map
|