@rudderhq/server 0.4.6-canary.8 → 0.5.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/dist/agent-runtimes/http/execute.d.ts.map +1 -1
- package/dist/agent-runtimes/http/execute.js +8 -2
- package/dist/agent-runtimes/http/execute.js.map +1 -1
- package/dist/agent-runtimes/process/execute.d.ts.map +1 -1
- package/dist/agent-runtimes/process/execute.js +3 -1
- package/dist/agent-runtimes/process/execute.js.map +1 -1
- package/dist/agent-runtimes/utils.d.ts +6 -1
- package/dist/agent-runtimes/utils.d.ts.map +1 -1
- package/dist/agent-runtimes/utils.js +1 -1
- package/dist/agent-runtimes/utils.js.map +1 -1
- package/dist/app.d.ts +3 -3
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +17 -8
- package/dist/app.js.map +1 -1
- package/dist/bootstrap/create-http-app.d.ts +6 -1
- package/dist/bootstrap/create-http-app.d.ts.map +1 -1
- package/dist/bootstrap/create-http-app.js +122 -46
- package/dist/bootstrap/create-http-app.js.map +1 -1
- package/dist/bootstrap/plugin-host-runtime.d.ts.map +1 -1
- package/dist/bootstrap/plugin-host-runtime.js +89 -31
- package/dist/bootstrap/plugin-host-runtime.js.map +1 -1
- package/dist/bootstrap/register-api-routes.d.ts +3 -1
- package/dist/bootstrap/register-api-routes.d.ts.map +1 -1
- package/dist/bootstrap/register-api-routes.js +3 -3
- package/dist/bootstrap/register-api-routes.js.map +1 -1
- package/dist/bootstrap/types.d.ts +1 -0
- package/dist/bootstrap/types.d.ts.map +1 -1
- package/dist/bundled-plugins/plugin-linear/dist/worker.js +351 -174
- package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +3 -3
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -1
- package/dist/home-paths.d.ts.map +1 -1
- package/dist/home-paths.js +79 -7
- package/dist/home-paths.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +112 -119
- package/dist/index.js.map +1 -1
- package/dist/realtime/live-events-ws.d.ts +4 -20
- package/dist/realtime/live-events-ws.d.ts.map +1 -1
- package/dist/realtime/live-events-ws.js +68 -8
- package/dist/realtime/live-events-ws.js.map +1 -1
- package/dist/routes/access-onboarding.helpers.js +3 -3
- package/dist/routes/access-onboarding.helpers.js.map +1 -1
- package/dist/routes/access.helpers.d.ts.map +1 -1
- package/dist/routes/access.helpers.js +3 -2
- package/dist/routes/access.helpers.js.map +1 -1
- package/dist/routes/access.js +1 -1
- package/dist/routes/access.js.map +1 -1
- package/dist/routes/activity.d.ts.map +1 -1
- package/dist/routes/activity.js +5 -1
- package/dist/routes/activity.js.map +1 -1
- package/dist/routes/agents.management-routes.d.ts.map +1 -1
- package/dist/routes/agents.management-routes.js +15 -15
- package/dist/routes/agents.management-routes.js.map +1 -1
- package/dist/routes/assets.d.ts.map +1 -1
- package/dist/routes/assets.js +9 -2
- package/dist/routes/assets.js.map +1 -1
- package/dist/routes/chat-background-runtime.d.ts +19 -0
- package/dist/routes/chat-background-runtime.d.ts.map +1 -0
- package/dist/routes/chat-background-runtime.js +129 -0
- package/dist/routes/chat-background-runtime.js.map +1 -0
- package/dist/routes/chats.d.ts +2 -1
- package/dist/routes/chats.d.ts.map +1 -1
- package/dist/routes/chats.js +944 -24
- package/dist/routes/chats.js.map +1 -1
- package/dist/routes/chats.stream-routes.d.ts.map +1 -1
- package/dist/routes/chats.stream-routes.js +552 -76
- package/dist/routes/chats.stream-routes.js.map +1 -1
- package/dist/routes/issues.comments-attachments.d.ts.map +1 -1
- package/dist/routes/issues.comments-attachments.js +14 -31
- package/dist/routes/issues.comments-attachments.js.map +1 -1
- package/dist/routes/onboarding.js +1 -1
- package/dist/routes/onboarding.js.map +1 -1
- package/dist/routes/orgs.d.ts +2 -1
- package/dist/routes/orgs.d.ts.map +1 -1
- package/dist/routes/orgs.js +32 -3
- package/dist/routes/orgs.js.map +1 -1
- package/dist/routes/run-intelligence.d.ts.map +1 -1
- package/dist/routes/run-intelligence.js +109 -25
- package/dist/routes/run-intelligence.js.map +1 -1
- package/dist/runtime/runtime-supervisor.d.ts +21 -0
- package/dist/runtime/runtime-supervisor.d.ts.map +1 -0
- package/dist/runtime/runtime-supervisor.js +66 -0
- package/dist/runtime/runtime-supervisor.js.map +1 -0
- package/dist/services/activity-log.d.ts +4 -1
- package/dist/services/activity-log.d.ts.map +1 -1
- package/dist/services/activity-log.js +12 -4
- package/dist/services/activity-log.js.map +1 -1
- package/dist/services/activity.d.ts +11 -394
- package/dist/services/activity.d.ts.map +1 -1
- package/dist/services/activity.js +24 -18
- package/dist/services/activity.js.map +1 -1
- package/dist/services/agents.d.ts +799 -137
- package/dist/services/agents.d.ts.map +1 -1
- package/dist/services/approvals.d.ts +3 -3
- package/dist/services/automation-chat-output.d.ts.map +1 -1
- package/dist/services/automation-chat-output.js +115 -94
- package/dist/services/automation-chat-output.js.map +1 -1
- package/dist/services/budgets.d.ts.map +1 -1
- package/dist/services/budgets.js +38 -36
- package/dist/services/budgets.js.map +1 -1
- package/dist/services/chat-agent-runs.d.ts +3 -1
- package/dist/services/chat-agent-runs.d.ts.map +1 -1
- package/dist/services/chat-agent-runs.js +97 -34
- package/dist/services/chat-agent-runs.js.map +1 -1
- package/dist/services/chat-assistant.d.ts.map +1 -1
- package/dist/services/chat-assistant.helpers.d.ts +27 -4
- package/dist/services/chat-assistant.helpers.d.ts.map +1 -1
- package/dist/services/chat-assistant.helpers.js +66 -2
- package/dist/services/chat-assistant.helpers.js.map +1 -1
- package/dist/services/chat-assistant.inline-visuals.test.d.ts +2 -0
- package/dist/services/chat-assistant.inline-visuals.test.d.ts.map +1 -0
- package/dist/services/chat-assistant.inline-visuals.test.js +86 -0
- package/dist/services/chat-assistant.inline-visuals.test.js.map +1 -0
- package/dist/services/chat-assistant.js +115 -22
- package/dist/services/chat-assistant.js.map +1 -1
- package/dist/services/chat-generation-locks.d.ts +85 -0
- package/dist/services/chat-generation-locks.d.ts.map +1 -1
- package/dist/services/chat-generation-locks.js +371 -9
- package/dist/services/chat-generation-locks.js.map +1 -1
- package/dist/services/chat-generation-locks.test.d.ts +2 -0
- package/dist/services/chat-generation-locks.test.d.ts.map +1 -0
- package/dist/services/chat-generation-locks.test.js +324 -0
- package/dist/services/chat-generation-locks.test.js.map +1 -0
- package/dist/services/chat-generation-protocol.d.ts +674 -0
- package/dist/services/chat-generation-protocol.d.ts.map +1 -0
- package/dist/services/chat-generation-protocol.js +1571 -0
- package/dist/services/chat-generation-protocol.js.map +1 -0
- package/dist/services/chat-generation-protocol.test.d.ts +2 -0
- package/dist/services/chat-generation-protocol.test.d.ts.map +1 -0
- package/dist/services/chat-generation-protocol.test.js +1156 -0
- package/dist/services/chat-generation-protocol.test.js.map +1 -0
- package/dist/services/chat-title-generation.d.ts +0 -3
- package/dist/services/chat-title-generation.d.ts.map +1 -1
- package/dist/services/chat-title-generation.js +2 -32
- package/dist/services/chat-title-generation.js.map +1 -1
- package/dist/services/chat-work-manifest.d.ts.map +1 -1
- package/dist/services/chat-work-manifest.js +5 -1
- package/dist/services/chat-work-manifest.js.map +1 -1
- package/dist/services/chats.d.ts +1451 -272
- package/dist/services/chats.d.ts.map +1 -1
- package/dist/services/chats.js +1372 -35
- package/dist/services/chats.js.map +1 -1
- package/dist/services/costs.d.ts +34 -7
- package/dist/services/costs.d.ts.map +1 -1
- package/dist/services/costs.js +129 -61
- package/dist/services/costs.js.map +1 -1
- package/dist/services/finance.d.ts +3 -3
- package/dist/services/goals.d.ts +2 -2
- package/dist/services/heartbeat-run-summary.d.ts.map +1 -1
- package/dist/services/heartbeat-run-summary.js +16 -1
- package/dist/services/heartbeat-run-summary.js.map +1 -1
- package/dist/services/heartbeat.d.ts +1 -1
- package/dist/services/heartbeat.d.ts.map +1 -1
- package/dist/services/heartbeat.js +1 -1
- package/dist/services/heartbeat.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/integrations/agent-integrations.d.ts +1 -1
- package/dist/services/integrations/custom-integrations.d.ts +1 -1
- package/dist/services/integrations/feishu/runtime.d.ts.map +1 -1
- package/dist/services/integrations/feishu/runtime.js +16 -0
- package/dist/services/integrations/feishu/runtime.js.map +1 -1
- package/dist/services/issues.comments-attachments.d.ts +111 -0
- package/dist/services/issues.comments-attachments.d.ts.map +1 -1
- package/dist/services/issues.comments-attachments.js +138 -66
- package/dist/services/issues.comments-attachments.js.map +1 -1
- package/dist/services/issues.d.ts +56 -0
- package/dist/services/issues.d.ts.map +1 -1
- package/dist/services/issues.helpers.d.ts.map +1 -1
- package/dist/services/issues.helpers.js +2 -2
- package/dist/services/issues.helpers.js.map +1 -1
- package/dist/services/issues.js +5 -2
- package/dist/services/issues.js.map +1 -1
- package/dist/services/knowledge-portability/organization-skills.catalog.d.ts.map +1 -1
- package/dist/services/knowledge-portability/organization-skills.catalog.js +7 -1
- package/dist/services/knowledge-portability/organization-skills.catalog.js.map +1 -1
- package/dist/services/messenger.d.ts.map +1 -1
- package/dist/services/messenger.js +11 -9
- package/dist/services/messenger.js.map +1 -1
- package/dist/services/organization-workspace-browser.d.ts +1 -1
- package/dist/services/organization-workspace-browser.d.ts.map +1 -1
- package/dist/services/organization-workspace-browser.js +49 -5
- package/dist/services/organization-workspace-browser.js.map +1 -1
- package/dist/services/orgs.d.ts.map +1 -1
- package/dist/services/orgs.js +36 -12
- package/dist/services/orgs.js.map +1 -1
- package/dist/services/plugin-dev-watcher.d.ts +19 -2
- package/dist/services/plugin-dev-watcher.d.ts.map +1 -1
- package/dist/services/plugin-dev-watcher.js +45 -11
- package/dist/services/plugin-dev-watcher.js.map +1 -1
- package/dist/services/plugin-registry.d.ts +28 -28
- package/dist/services/projects.d.ts +1 -1
- package/dist/services/run-events.d.ts +20 -0
- package/dist/services/run-events.d.ts.map +1 -0
- package/dist/services/run-events.js +34 -0
- package/dist/services/run-events.js.map +1 -0
- package/dist/services/run-intelligence.d.ts +66 -4
- package/dist/services/run-intelligence.d.ts.map +1 -1
- package/dist/services/run-intelligence.js +391 -42
- package/dist/services/run-intelligence.js.map +1 -1
- package/dist/services/run-log-store.d.ts.map +1 -1
- package/dist/services/run-log-store.js +26 -3
- package/dist/services/run-log-store.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.core.d.ts +24 -1
- package/dist/services/runtime-kernel/heartbeat.core.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.core.js +2 -1
- package/dist/services/runtime-kernel/heartbeat.core.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.d.ts +98 -37
- package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.execute.d.ts +3 -1
- package/dist/services/runtime-kernel/heartbeat.execute.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.execute.js +394 -219
- package/dist/services/runtime-kernel/heartbeat.execute.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.js +603 -205
- package/dist/services/runtime-kernel/heartbeat.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.misc.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.misc.js +34 -24
- package/dist/services/runtime-kernel/heartbeat.misc.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.recovery.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.recovery.js +56 -6
- package/dist/services/runtime-kernel/heartbeat.recovery.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.release.d.ts +3 -1
- package/dist/services/runtime-kernel/heartbeat.release.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.release.js +276 -44
- package/dist/services/runtime-kernel/heartbeat.release.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.sessions.d.ts +42 -1
- package/dist/services/runtime-kernel/heartbeat.sessions.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.sessions.js +110 -8
- package/dist/services/runtime-kernel/heartbeat.sessions.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.terminal.d.ts +575 -0
- package/dist/services/runtime-kernel/heartbeat.terminal.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.terminal.js +589 -0
- package/dist/services/runtime-kernel/heartbeat.terminal.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.wakeup.js +238 -92
- package/dist/services/runtime-kernel/heartbeat.wakeup.js.map +1 -1
- package/dist/services/runtime-kernel/model-fallback.d.ts.map +1 -1
- package/dist/services/runtime-kernel/model-fallback.js +11 -0
- package/dist/services/runtime-kernel/model-fallback.js.map +1 -1
- package/dist/services/side-chats.d.ts +212 -0
- package/dist/services/side-chats.d.ts.map +1 -0
- package/dist/services/side-chats.js +379 -0
- package/dist/services/side-chats.js.map +1 -0
- package/dist/services/workspace-runtime.services.d.ts +1 -1
- package/dist/services/workspace-web-preview.d.ts +36 -0
- package/dist/services/workspace-web-preview.d.ts.map +1 -0
- package/dist/services/workspace-web-preview.js +566 -0
- package/dist/services/workspace-web-preview.js.map +1 -0
- package/package.json +13 -13
- package/resources/bundled-skills/rudder-docs/SKILL.md +161 -0
- package/resources/bundled-skills/rudder-docs/evals/trigger-evals.json +82 -0
- package/{skills/rudder → resources/bundled-skills/rudder-docs}/references/api-reference.md +17 -1
- package/{skills/rudder → resources/bundled-skills/rudder-docs}/references/cli-reference.md +52 -97
- package/resources/bundled-skills/rudder-docs/references/control-plane-practices.md +231 -0
- package/{skills/rudder → resources/bundled-skills/rudder-docs}/references/organization-skills.md +15 -1
- package/resources/bundled-skills/rudder-docs/references/source-map.md +138 -0
- package/resources/bundled-skills/visualize/SKILL.md +132 -0
- package/resources/bundled-skills/visualize/agents/openai.yaml +7 -0
- package/resources/bundled-skills/visualize/assets/example-chart.html +89 -0
- package/resources/bundled-skills/visualize/references/runtime-contract.md +114 -0
- package/skills/rudder-docs/SKILL.md +161 -0
- package/skills/rudder-docs/evals/trigger-evals.json +82 -0
- package/{resources/bundled-skills/rudder → skills/rudder-docs}/references/api-reference.md +17 -1
- package/{resources/bundled-skills/rudder → skills/rudder-docs}/references/cli-reference.md +52 -97
- package/skills/rudder-docs/references/control-plane-practices.md +231 -0
- package/{resources/bundled-skills/rudder → skills/rudder-docs}/references/organization-skills.md +15 -1
- package/skills/rudder-docs/references/source-map.md +138 -0
- package/skills/visualize/SKILL.md +132 -0
- package/skills/visualize/agents/openai.yaml +7 -0
- package/skills/visualize/assets/example-chart.html +89 -0
- package/skills/visualize/references/runtime-contract.md +114 -0
- package/ui-dist/assets/{abnfDiagram-VRR7QNED-C4e_AuJm.js → abnfDiagram-VRR7QNED-Dpnx79fp.js} +1 -1
- package/ui-dist/assets/{arc-3OG5_qjR.js → arc-Cpvh_rCf.js} +1 -1
- package/ui-dist/assets/{architectureDiagram-ZJ3FMSHR-CJz3inSs.js → architectureDiagram-ZJ3FMSHR-sDD_mBAI.js} +1 -1
- package/ui-dist/assets/{blockDiagram-677ZJIJ3-CpBIok39.js → blockDiagram-677ZJIJ3-4O4wWti1.js} +1 -1
- package/ui-dist/assets/{c4Diagram-LMCZKHZV-BbQrD6Fx.js → c4Diagram-LMCZKHZV-BkGODE4P.js} +1 -1
- package/ui-dist/assets/channel-CM4Myg_6.js +1 -0
- package/ui-dist/assets/{chunk-2Q5K7J3B-BkoT6fZL.js → chunk-2Q5K7J3B-DsDQQpID.js} +1 -1
- package/ui-dist/assets/{chunk-32BRIVSS-DecBtqTH.js → chunk-32BRIVSS-Bzx_VnIw.js} +1 -1
- package/ui-dist/assets/{chunk-5VM5RSS4-SFFAgh5q.js → chunk-5VM5RSS4-D4LoPCni.js} +1 -1
- package/ui-dist/assets/{chunk-EX3LRPZG-CxUndf0S.js → chunk-EX3LRPZG-BO0R-mS4.js} +3 -3
- package/ui-dist/assets/{chunk-JWPE2WC7-BbEXuDLm.js → chunk-JWPE2WC7-B4Nr8KRL.js} +1 -1
- package/ui-dist/assets/{chunk-MOJQB5TN-MOCGQpRH.js → chunk-MOJQB5TN--uaDDrYM.js} +1 -1
- package/ui-dist/assets/{chunk-RYQCIY6F-CUuwDB4L.js → chunk-RYQCIY6F-CyBY2w_j.js} +1 -1
- package/ui-dist/assets/{chunk-V7JOEXUC-D5H80ZpL.js → chunk-V7JOEXUC-BMid_x8S.js} +3 -3
- package/ui-dist/assets/{chunk-VR4S4FIN-Cg5d82yb.js → chunk-VR4S4FIN-DVqdPKuG.js} +1 -1
- package/ui-dist/assets/{chunk-XXDRQBXY-Bu7DXS_3.js → chunk-XXDRQBXY-vy03lLSS.js} +1 -1
- package/ui-dist/assets/classDiagram-OUVF2IWQ-CtlIEzTt.js +1 -0
- package/ui-dist/assets/classDiagram-v2-EOCWNBFH-CtlIEzTt.js +1 -0
- package/ui-dist/assets/{cose-bilkent-JH36ORCC-LCobsJkA.js → cose-bilkent-JH36ORCC-jQDZmrG3.js} +1 -1
- package/ui-dist/assets/{cynefin-VYW2F7L2-CxDfvhGJ.js → cynefin-VYW2F7L2-BxBj6aea.js} +1 -1
- package/ui-dist/assets/{cynefinDiagram-TSTJHNR4-BbebJ96a.js → cynefinDiagram-TSTJHNR4-BuUubF5I.js} +1 -1
- package/ui-dist/assets/{dagre-VKFMJZFB-BNQ0fvpl.js → dagre-VKFMJZFB-B8HipJ3a.js} +1 -1
- package/ui-dist/assets/{diagram-FQU43EPY-B9vCEyLD.js → diagram-FQU43EPY-r7gkbKSt.js} +2 -2
- package/ui-dist/assets/{diagram-G47NLZAW-Z7Hg_sXF.js → diagram-G47NLZAW-CxClRsxD.js} +1 -1
- package/ui-dist/assets/{diagram-NH7WQ7WH-B_TZ5-gD.js → diagram-NH7WQ7WH-C8HYTLlq.js} +1 -1
- package/ui-dist/assets/{diagram-OA4YK3LP-qe-twEnv.js → diagram-OA4YK3LP-CjwqqLKz.js} +1 -1
- package/ui-dist/assets/{diagram-WEI45ONY-D8ufoJVE.js → diagram-WEI45ONY-2IWfCqZb.js} +1 -1
- package/ui-dist/assets/{ebnfDiagram-CCIWWBDH-BXXAFqU6.js → ebnfDiagram-CCIWWBDH-DVGZkgjy.js} +1 -1
- package/ui-dist/assets/{erDiagram-Q63AITRT-uXmIG2c_.js → erDiagram-Q63AITRT-C_-u3Gmw.js} +1 -1
- package/ui-dist/assets/{flowDiagram-23GEKE2U-3eiT6gWx.js → flowDiagram-23GEKE2U-BvGg0NCq.js} +4 -4
- package/ui-dist/assets/{ganttDiagram-NO4QXBWP-CiVmqV02.js → ganttDiagram-NO4QXBWP-U3CZUUUR.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-IHSO6WYX-DmIrlFHc.js → gitGraphDiagram-IHSO6WYX-CIWuEBIo.js} +1 -1
- package/ui-dist/assets/{graph-BpS6eOIF.js → graph-D3P5q-7m.js} +1 -1
- package/ui-dist/assets/index-B1rLBtZ1.js +1875 -0
- package/ui-dist/assets/{index-Dlx6uy7_.js → index-BAMXpiI5.js} +1 -1
- package/ui-dist/assets/{index-CUHGsSRd.js → index-BAgtKYR1.js} +1 -1
- package/ui-dist/assets/{index--YRaLrzl.js → index-CBOr9F6w.js} +1 -1
- package/ui-dist/assets/{index-cHC60zXl.js → index-CbHqnWUe.js} +1 -1
- package/ui-dist/assets/{index-DeWKDYpk.js → index-CjztBLJi.js} +1 -1
- package/ui-dist/assets/{index-T2PpfhXU.js → index-Cu1iMhjl.js} +1 -1
- package/ui-dist/assets/{index-Dgj1-Gzi.js → index-D7ycf1qU.js} +1 -1
- package/ui-dist/assets/{index-Dpvu2aoc.js → index-DAYlwxsg.js} +1 -1
- package/ui-dist/assets/{index-BAU4CU-l.js → index-DCFf9dps.js} +4 -4
- package/ui-dist/assets/{index-CWaZ_rS8.js → index-DOPIV8vd.js} +1 -1
- package/ui-dist/assets/{index-C-TZf854.js → index-DRxLJD40.js} +1 -1
- package/ui-dist/assets/{index-CUI9Uyvz.js → index-DYMtCDKT.js} +1 -1
- package/ui-dist/assets/index-DekHKOsL.css +1 -0
- package/ui-dist/assets/{index-BncN7e-4.js → index-DidCCw78.js} +1 -1
- package/ui-dist/assets/{index-Cl27pPic.js → index-Ds_qma4-.js} +1 -1
- package/ui-dist/assets/{index-CF3Fjm4r.js → index-HkQRx1D6.js} +1 -1
- package/ui-dist/assets/{index-Cp12taja.js → index-ikpL--zj.js} +1 -1
- package/ui-dist/assets/{index-BzDB5XYN.js → index-mnl55Stn.js} +1 -1
- package/ui-dist/assets/{infoDiagram-FWYZ7A6U-B_e34a6A.js → infoDiagram-FWYZ7A6U-Cx8Fa-I4.js} +1 -1
- package/ui-dist/assets/{ishikawaDiagram-FXEZZL3T-C_h8nqRS.js → ishikawaDiagram-FXEZZL3T-Cmuz1QUN.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-5HDEW3XC-CrxAvEMf.js → journeyDiagram-5HDEW3XC-CJgkiVXG.js} +1 -1
- package/ui-dist/assets/{kanban-definition-HUTT4EX6-Zp6LAKss.js → kanban-definition-HUTT4EX6-RAWpefOB.js} +1 -1
- package/ui-dist/assets/layout-DyWQv0Rr.js +1 -0
- package/ui-dist/assets/{linear-_N4Odhfh.js → linear-D5pdgIf9.js} +1 -1
- package/ui-dist/assets/{map-CYGuJtD3.js → map-bVSzNLl2.js} +1 -1
- package/ui-dist/assets/mermaid.core-CeaXGD6B.js +312 -0
- package/ui-dist/assets/{mindmap-definition-LN4V7U3C-C-J9N_o_.js → mindmap-definition-LN4V7U3C-B8B8AX5C.js} +1 -1
- package/ui-dist/assets/{pegDiagram-2B236MQR-B9Mlsk91.js → pegDiagram-2B236MQR-C4Sv-ua6.js} +1 -1
- package/ui-dist/assets/{pieDiagram-ENE6RG2P-BY7DU2f8.js → pieDiagram-ENE6RG2P-CLARlOHx.js} +1 -1
- package/ui-dist/assets/{quadrantDiagram-ABIIQ3AL-CdCl_yc0.js → quadrantDiagram-ABIIQ3AL-DPCXQmeT.js} +1 -1
- package/ui-dist/assets/{railroadDiagram-RFXS5EU6-C5w2LKAD.js → railroadDiagram-RFXS5EU6-BpqRuKUQ.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-TGXJPOKE-fRb_n-yH.js → requirementDiagram-TGXJPOKE-Dd-h62HZ.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-HTMAVEWB-CYjb1HUH.js → sankeyDiagram-HTMAVEWB-DylT_pqq.js} +1 -1
- package/ui-dist/assets/{sequenceDiagram-DBY2YBRQ-CS95ySsI.js → sequenceDiagram-DBY2YBRQ-RiCF1REj.js} +1 -1
- package/ui-dist/assets/{sizeCapture-X5ZJPWSS-DPXTC0TI.js → sizeCapture-X5ZJPWSS-DXW4JQz2.js} +1 -1
- package/ui-dist/assets/{stateDiagram-2N3HPSRC-C4VFIMBR.js → stateDiagram-2N3HPSRC-6U3ESIGT.js} +1 -1
- package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-KQTrcZvp.js +1 -0
- package/ui-dist/assets/{swimlanes-5IMT3BWC-UvxkQ8RD.js → swimlanes-5IMT3BWC-CeNHVNCi.js} +2 -2
- package/ui-dist/assets/swimlanesDiagram-G3AALYLV-CcxS1c6r.js +8 -0
- package/ui-dist/assets/{timeline-definition-FHXFAJF6-BKotSwXW.js → timeline-definition-FHXFAJF6-Vlwoe_1b.js} +1 -1
- package/ui-dist/assets/{vennDiagram-L72KCM5P-TmXc-aFs.js → vennDiagram-L72KCM5P-DBP7D3HE.js} +6 -6
- package/ui-dist/assets/{wardleyDiagram-EHGQE667-aTINQKt9.js → wardleyDiagram-EHGQE667-DG-wzqpy.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-FW5EYKEG-CZ86hWNQ.js → xychartDiagram-FW5EYKEG-BAq3mbha.js} +1 -1
- package/ui-dist/index.html +2 -2
- package/resources/bundled-skills/rudder/SKILL.md +0 -314
- package/skills/rudder/SKILL.md +0 -314
- package/ui-dist/assets/channel-roHkdL27.js +0 -1
- package/ui-dist/assets/classDiagram-OUVF2IWQ-CKZLREY1.js +0 -1
- package/ui-dist/assets/classDiagram-v2-EOCWNBFH-CKZLREY1.js +0 -1
- package/ui-dist/assets/index-BTW19O7e.js +0 -1808
- package/ui-dist/assets/index-DOlmbVZk.css +0 -1
- package/ui-dist/assets/layout-DlHAdVX4.js +0 -1
- package/ui-dist/assets/mermaid.core-B8dXcSSK.js +0 -314
- package/ui-dist/assets/stateDiagram-v2-6OUMAXLB-CF5IY4p0.js +0 -1
- package/ui-dist/assets/swimlanesDiagram-G3AALYLV-BVLEg2fG.js +0 -8
package/dist/services/chats.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { Db } from "@rudderhq/db";
|
|
2
|
-
import { approvals, chatConversations, chatGenerations } from "@rudderhq/db";
|
|
3
|
-
import { type ChatQueuedMessagePayload, type ChatStreamTranscriptEntry } from "@rudderhq/shared";
|
|
2
|
+
import { approvals, chatControlActions, chatConversations, chatGenerationEvents, chatGenerations, chatQueuedMessages } from "@rudderhq/db";
|
|
3
|
+
import { type ChatControlDisposition, type ChatProviderControlDisposition, type ChatQueuedMessage, type ChatQueuedMessagePayload, type ChatQueuedMessageStatus, type ChatQueueRequestActor, type ChatStreamTranscriptEntry } from "@rudderhq/shared";
|
|
4
|
+
type ChatQueuedMessageRow = typeof chatQueuedMessages.$inferSelect;
|
|
4
5
|
type ChatGenerationRow = typeof chatGenerations.$inferSelect;
|
|
6
|
+
type ChatControlActionRow = typeof chatControlActions.$inferSelect;
|
|
7
|
+
export type ChatServerQueueClaim = {
|
|
8
|
+
item: ChatQueuedMessage;
|
|
9
|
+
generationId: string;
|
|
10
|
+
userMessageId: string;
|
|
11
|
+
leaseToken: string;
|
|
12
|
+
leaseEpoch: number;
|
|
13
|
+
};
|
|
5
14
|
type ConversationSummaryCursor = {
|
|
6
15
|
activityAt: Date;
|
|
7
16
|
title: string;
|
|
@@ -16,10 +25,916 @@ type ConversationSourceMetadata = {
|
|
|
16
25
|
};
|
|
17
26
|
type ApprovalRow = typeof approvals.$inferSelect;
|
|
18
27
|
export declare function chatService(db: Db): {
|
|
28
|
+
generationProtocol: {
|
|
29
|
+
getLatestVisibleCheckpoint: (input: {
|
|
30
|
+
orgId: string;
|
|
31
|
+
conversationId: string;
|
|
32
|
+
generationId: string;
|
|
33
|
+
}) => Promise<{
|
|
34
|
+
generation: {
|
|
35
|
+
id: string;
|
|
36
|
+
orgId: string;
|
|
37
|
+
conversationId: string;
|
|
38
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
39
|
+
terminalReason: string | null;
|
|
40
|
+
attemptEpoch: number;
|
|
41
|
+
controlVersion: number;
|
|
42
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
43
|
+
controlRuntimeType: string | null;
|
|
44
|
+
controlOwnerToken: string | null;
|
|
45
|
+
controlLeaseExpiresAt: Date | null;
|
|
46
|
+
providerThreadId: string | null;
|
|
47
|
+
providerTurnId: string | null;
|
|
48
|
+
acceptedThroughSeq: number | null;
|
|
49
|
+
lastClientCheckpointSeq: number | null;
|
|
50
|
+
lastClientCheckpointHash: string | null;
|
|
51
|
+
frozenBodyHash: string | null;
|
|
52
|
+
stopRequestedAt: Date | null;
|
|
53
|
+
runtimeTerminalAt: Date | null;
|
|
54
|
+
lateEventsDropped: number;
|
|
55
|
+
lateBytes: number;
|
|
56
|
+
startedAt: Date;
|
|
57
|
+
completedAt: Date | null;
|
|
58
|
+
createdAt: Date;
|
|
59
|
+
updatedAt: Date;
|
|
60
|
+
};
|
|
61
|
+
generationSeq: number;
|
|
62
|
+
bodyHash: string;
|
|
63
|
+
}>;
|
|
64
|
+
appendGenerationEvent: (input: {
|
|
65
|
+
orgId: string;
|
|
66
|
+
generationId: string;
|
|
67
|
+
attemptEpoch: number;
|
|
68
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
69
|
+
payload?: Record<string, unknown>;
|
|
70
|
+
bodyOffset?: number | null;
|
|
71
|
+
bodyLength?: number | null;
|
|
72
|
+
assistantMessageId?: string | null;
|
|
73
|
+
runId?: string | null;
|
|
74
|
+
controlActionId?: string | null;
|
|
75
|
+
queueItemId?: string | null;
|
|
76
|
+
emittedAt?: Date | null;
|
|
77
|
+
} & {
|
|
78
|
+
conversationId?: string;
|
|
79
|
+
expectedOwnerToken?: string | null;
|
|
80
|
+
admission: "visible" | "control" | "diagnostic";
|
|
81
|
+
bodyHash?: string;
|
|
82
|
+
lateBytes?: number;
|
|
83
|
+
}) => Promise<{
|
|
84
|
+
event: {
|
|
85
|
+
assistantMessageId: string | null;
|
|
86
|
+
id: string;
|
|
87
|
+
orgId: string;
|
|
88
|
+
runId: string | null;
|
|
89
|
+
payload: Record<string, unknown>;
|
|
90
|
+
controlActionId: string | null;
|
|
91
|
+
generationId: string;
|
|
92
|
+
attemptEpoch: number;
|
|
93
|
+
generationSeq: number;
|
|
94
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
95
|
+
bodyOffset: number | null;
|
|
96
|
+
bodyLength: number | null;
|
|
97
|
+
queueItemId: string | null;
|
|
98
|
+
recordedAt: Date;
|
|
99
|
+
emittedAt: Date | null;
|
|
100
|
+
};
|
|
101
|
+
generation: {
|
|
102
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
103
|
+
conversationId: string;
|
|
104
|
+
id: string;
|
|
105
|
+
orgId: string;
|
|
106
|
+
createdAt: Date;
|
|
107
|
+
updatedAt: Date;
|
|
108
|
+
attemptEpoch: number;
|
|
109
|
+
startedAt: Date;
|
|
110
|
+
completedAt: Date | null;
|
|
111
|
+
terminalReason: string | null;
|
|
112
|
+
controlVersion: number;
|
|
113
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
114
|
+
controlRuntimeType: string | null;
|
|
115
|
+
controlOwnerToken: string | null;
|
|
116
|
+
controlLeaseExpiresAt: Date | null;
|
|
117
|
+
providerThreadId: string | null;
|
|
118
|
+
providerTurnId: string | null;
|
|
119
|
+
acceptedThroughSeq: number | null;
|
|
120
|
+
lastClientCheckpointSeq: number | null;
|
|
121
|
+
lastClientCheckpointHash: string | null;
|
|
122
|
+
frozenBodyHash: string | null;
|
|
123
|
+
stopRequestedAt: Date | null;
|
|
124
|
+
runtimeTerminalAt: Date | null;
|
|
125
|
+
lateEventsDropped: number;
|
|
126
|
+
lateBytes: number;
|
|
127
|
+
};
|
|
128
|
+
}>;
|
|
129
|
+
appendVisibleEventAndProject: (input: Omit<{
|
|
130
|
+
orgId: string;
|
|
131
|
+
generationId: string;
|
|
132
|
+
attemptEpoch: number;
|
|
133
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
134
|
+
payload?: Record<string, unknown>;
|
|
135
|
+
bodyOffset?: number | null;
|
|
136
|
+
bodyLength?: number | null;
|
|
137
|
+
assistantMessageId?: string | null;
|
|
138
|
+
runId?: string | null;
|
|
139
|
+
controlActionId?: string | null;
|
|
140
|
+
queueItemId?: string | null;
|
|
141
|
+
emittedAt?: Date | null;
|
|
142
|
+
}, "attemptEpoch" | "assistantMessageId"> & {
|
|
143
|
+
orgId: string;
|
|
144
|
+
conversationId: string;
|
|
145
|
+
generationId: string;
|
|
146
|
+
expectedAttemptEpoch: number;
|
|
147
|
+
expectedOwnerToken?: string | null;
|
|
148
|
+
bodyHash: string;
|
|
149
|
+
messageId?: string | null;
|
|
150
|
+
body: string;
|
|
151
|
+
transcript: ChatStreamTranscriptEntry[];
|
|
152
|
+
replyingAgentId?: string | null;
|
|
153
|
+
chatTurnId: string;
|
|
154
|
+
turnVariant: number;
|
|
155
|
+
}) => Promise<{
|
|
156
|
+
generation: {
|
|
157
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
158
|
+
conversationId: string;
|
|
159
|
+
id: string;
|
|
160
|
+
orgId: string;
|
|
161
|
+
createdAt: Date;
|
|
162
|
+
updatedAt: Date;
|
|
163
|
+
attemptEpoch: number;
|
|
164
|
+
startedAt: Date;
|
|
165
|
+
completedAt: Date | null;
|
|
166
|
+
terminalReason: string | null;
|
|
167
|
+
controlVersion: number;
|
|
168
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
169
|
+
controlRuntimeType: string | null;
|
|
170
|
+
controlOwnerToken: string | null;
|
|
171
|
+
controlLeaseExpiresAt: Date | null;
|
|
172
|
+
providerThreadId: string | null;
|
|
173
|
+
providerTurnId: string | null;
|
|
174
|
+
acceptedThroughSeq: number | null;
|
|
175
|
+
lastClientCheckpointSeq: number | null;
|
|
176
|
+
lastClientCheckpointHash: string | null;
|
|
177
|
+
frozenBodyHash: string | null;
|
|
178
|
+
stopRequestedAt: Date | null;
|
|
179
|
+
runtimeTerminalAt: Date | null;
|
|
180
|
+
lateEventsDropped: number;
|
|
181
|
+
lateBytes: number;
|
|
182
|
+
};
|
|
183
|
+
message: {
|
|
184
|
+
status: string;
|
|
185
|
+
conversationId: string;
|
|
186
|
+
id: string;
|
|
187
|
+
orgId: string;
|
|
188
|
+
kind: string;
|
|
189
|
+
createdAt: Date;
|
|
190
|
+
updatedAt: Date;
|
|
191
|
+
runId: string | null;
|
|
192
|
+
body: string;
|
|
193
|
+
role: string;
|
|
194
|
+
approvalId: string | null;
|
|
195
|
+
structuredPayload: Record<string, unknown> | null;
|
|
196
|
+
replyingAgentId: string | null;
|
|
197
|
+
chatTurnId: string | null;
|
|
198
|
+
turnVariant: number;
|
|
199
|
+
supersededAt: Date | null;
|
|
200
|
+
};
|
|
201
|
+
event: {
|
|
202
|
+
assistantMessageId: string | null;
|
|
203
|
+
id: string;
|
|
204
|
+
orgId: string;
|
|
205
|
+
runId: string | null;
|
|
206
|
+
payload: Record<string, unknown>;
|
|
207
|
+
controlActionId: string | null;
|
|
208
|
+
generationId: string;
|
|
209
|
+
attemptEpoch: number;
|
|
210
|
+
generationSeq: number;
|
|
211
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
212
|
+
bodyOffset: number | null;
|
|
213
|
+
bodyLength: number | null;
|
|
214
|
+
queueItemId: string | null;
|
|
215
|
+
recordedAt: Date;
|
|
216
|
+
emittedAt: Date | null;
|
|
217
|
+
};
|
|
218
|
+
}>;
|
|
219
|
+
getFrozenVisibleProjection: (input: {
|
|
220
|
+
orgId: string;
|
|
221
|
+
conversationId: string;
|
|
222
|
+
generationId: string;
|
|
223
|
+
}) => Promise<{
|
|
224
|
+
generation: {
|
|
225
|
+
id: string;
|
|
226
|
+
orgId: string;
|
|
227
|
+
conversationId: string;
|
|
228
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
229
|
+
terminalReason: string | null;
|
|
230
|
+
attemptEpoch: number;
|
|
231
|
+
controlVersion: number;
|
|
232
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
233
|
+
controlRuntimeType: string | null;
|
|
234
|
+
controlOwnerToken: string | null;
|
|
235
|
+
controlLeaseExpiresAt: Date | null;
|
|
236
|
+
providerThreadId: string | null;
|
|
237
|
+
providerTurnId: string | null;
|
|
238
|
+
acceptedThroughSeq: number | null;
|
|
239
|
+
lastClientCheckpointSeq: number | null;
|
|
240
|
+
lastClientCheckpointHash: string | null;
|
|
241
|
+
frozenBodyHash: string | null;
|
|
242
|
+
stopRequestedAt: Date | null;
|
|
243
|
+
runtimeTerminalAt: Date | null;
|
|
244
|
+
lateEventsDropped: number;
|
|
245
|
+
lateBytes: number;
|
|
246
|
+
startedAt: Date;
|
|
247
|
+
completedAt: Date | null;
|
|
248
|
+
createdAt: Date;
|
|
249
|
+
updatedAt: Date;
|
|
250
|
+
};
|
|
251
|
+
checkpoint: {
|
|
252
|
+
generationSeq: number;
|
|
253
|
+
bodyHash: string;
|
|
254
|
+
};
|
|
255
|
+
projection: {
|
|
256
|
+
body: string;
|
|
257
|
+
transcript: ChatStreamTranscriptEntry[];
|
|
258
|
+
assistantMessageId: string | null;
|
|
259
|
+
runId: string | null;
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
262
|
+
recordClientCheckpoint: (input: {
|
|
263
|
+
orgId: string;
|
|
264
|
+
conversationId: string;
|
|
265
|
+
generationId: string;
|
|
266
|
+
expectedAttemptEpoch: number;
|
|
267
|
+
expectedOwnerToken?: string | null;
|
|
268
|
+
generationSeq: number;
|
|
269
|
+
renderedBodyHash: string;
|
|
270
|
+
now?: Date;
|
|
271
|
+
}) => Promise<{
|
|
272
|
+
generation: {
|
|
273
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
274
|
+
conversationId: string;
|
|
275
|
+
id: string;
|
|
276
|
+
orgId: string;
|
|
277
|
+
createdAt: Date;
|
|
278
|
+
updatedAt: Date;
|
|
279
|
+
attemptEpoch: number;
|
|
280
|
+
startedAt: Date;
|
|
281
|
+
completedAt: Date | null;
|
|
282
|
+
terminalReason: string | null;
|
|
283
|
+
controlVersion: number;
|
|
284
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
285
|
+
controlRuntimeType: string | null;
|
|
286
|
+
controlOwnerToken: string | null;
|
|
287
|
+
controlLeaseExpiresAt: Date | null;
|
|
288
|
+
providerThreadId: string | null;
|
|
289
|
+
providerTurnId: string | null;
|
|
290
|
+
acceptedThroughSeq: number | null;
|
|
291
|
+
lastClientCheckpointSeq: number | null;
|
|
292
|
+
lastClientCheckpointHash: string | null;
|
|
293
|
+
frozenBodyHash: string | null;
|
|
294
|
+
stopRequestedAt: Date | null;
|
|
295
|
+
runtimeTerminalAt: Date | null;
|
|
296
|
+
lateEventsDropped: number;
|
|
297
|
+
lateBytes: number;
|
|
298
|
+
};
|
|
299
|
+
event: null;
|
|
300
|
+
advanced: boolean;
|
|
301
|
+
} | {
|
|
302
|
+
generation: {
|
|
303
|
+
id: string;
|
|
304
|
+
orgId: string;
|
|
305
|
+
conversationId: string;
|
|
306
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
307
|
+
terminalReason: string | null;
|
|
308
|
+
attemptEpoch: number;
|
|
309
|
+
controlVersion: number;
|
|
310
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
311
|
+
controlRuntimeType: string | null;
|
|
312
|
+
controlOwnerToken: string | null;
|
|
313
|
+
controlLeaseExpiresAt: Date | null;
|
|
314
|
+
providerThreadId: string | null;
|
|
315
|
+
providerTurnId: string | null;
|
|
316
|
+
acceptedThroughSeq: number | null;
|
|
317
|
+
lastClientCheckpointSeq: number | null;
|
|
318
|
+
lastClientCheckpointHash: string | null;
|
|
319
|
+
frozenBodyHash: string | null;
|
|
320
|
+
stopRequestedAt: Date | null;
|
|
321
|
+
runtimeTerminalAt: Date | null;
|
|
322
|
+
lateEventsDropped: number;
|
|
323
|
+
lateBytes: number;
|
|
324
|
+
startedAt: Date;
|
|
325
|
+
completedAt: Date | null;
|
|
326
|
+
createdAt: Date;
|
|
327
|
+
updatedAt: Date;
|
|
328
|
+
};
|
|
329
|
+
event: {
|
|
330
|
+
assistantMessageId: string | null;
|
|
331
|
+
id: string;
|
|
332
|
+
orgId: string;
|
|
333
|
+
runId: string | null;
|
|
334
|
+
payload: Record<string, unknown>;
|
|
335
|
+
controlActionId: string | null;
|
|
336
|
+
generationId: string;
|
|
337
|
+
attemptEpoch: number;
|
|
338
|
+
generationSeq: number;
|
|
339
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
340
|
+
bodyOffset: number | null;
|
|
341
|
+
bodyLength: number | null;
|
|
342
|
+
queueItemId: string | null;
|
|
343
|
+
recordedAt: Date;
|
|
344
|
+
emittedAt: Date | null;
|
|
345
|
+
};
|
|
346
|
+
advanced: boolean;
|
|
347
|
+
}>;
|
|
348
|
+
beginStopAction: (input: {
|
|
349
|
+
orgId: string;
|
|
350
|
+
conversationId: string;
|
|
351
|
+
controlActionId: string;
|
|
352
|
+
expectedGenerationId: string;
|
|
353
|
+
expectedAttemptEpoch: number;
|
|
354
|
+
expectedControlVersion: number;
|
|
355
|
+
requestedRenderSeq: number;
|
|
356
|
+
requestedBodyHash: string;
|
|
357
|
+
now?: Date;
|
|
358
|
+
}) => Promise<{
|
|
359
|
+
action: {
|
|
360
|
+
id: string;
|
|
361
|
+
orgId: string;
|
|
362
|
+
createdAt: Date;
|
|
363
|
+
updatedAt: Date;
|
|
364
|
+
resolvedAt: Date | null;
|
|
365
|
+
expectedGenerationId: string | null;
|
|
366
|
+
expectedAttemptEpoch: number | null;
|
|
367
|
+
expectedControlVersion: number | null;
|
|
368
|
+
lastError: string | null;
|
|
369
|
+
requestedAt: Date;
|
|
370
|
+
controlOwnerToken: string | null;
|
|
371
|
+
providerThreadId: string | null;
|
|
372
|
+
providerTurnId: string | null;
|
|
373
|
+
acceptedThroughSeq: number | null;
|
|
374
|
+
frozenBodyHash: string | null;
|
|
375
|
+
appliedControlVersion: number | null;
|
|
376
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
377
|
+
localDisposition: ChatControlDisposition;
|
|
378
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
379
|
+
providerClientMessageId: string | null;
|
|
380
|
+
providerEvidence: Record<string, unknown> | null;
|
|
381
|
+
requestedRenderSeq: number | null;
|
|
382
|
+
requestedBodyHash: string | null;
|
|
383
|
+
providerSentAt: Date | null;
|
|
384
|
+
providerAcknowledgedAt: Date | null;
|
|
385
|
+
};
|
|
386
|
+
generation: {
|
|
387
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
388
|
+
conversationId: string;
|
|
389
|
+
id: string;
|
|
390
|
+
orgId: string;
|
|
391
|
+
createdAt: Date;
|
|
392
|
+
updatedAt: Date;
|
|
393
|
+
attemptEpoch: number;
|
|
394
|
+
startedAt: Date;
|
|
395
|
+
completedAt: Date | null;
|
|
396
|
+
terminalReason: string | null;
|
|
397
|
+
controlVersion: number;
|
|
398
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
399
|
+
controlRuntimeType: string | null;
|
|
400
|
+
controlOwnerToken: string | null;
|
|
401
|
+
controlLeaseExpiresAt: Date | null;
|
|
402
|
+
providerThreadId: string | null;
|
|
403
|
+
providerTurnId: string | null;
|
|
404
|
+
acceptedThroughSeq: number | null;
|
|
405
|
+
lastClientCheckpointSeq: number | null;
|
|
406
|
+
lastClientCheckpointHash: string | null;
|
|
407
|
+
frozenBodyHash: string | null;
|
|
408
|
+
stopRequestedAt: Date | null;
|
|
409
|
+
runtimeTerminalAt: Date | null;
|
|
410
|
+
lateEventsDropped: number;
|
|
411
|
+
lateBytes: number;
|
|
412
|
+
};
|
|
413
|
+
stopRequestedEvent: {
|
|
414
|
+
assistantMessageId: string | null;
|
|
415
|
+
id: string;
|
|
416
|
+
orgId: string;
|
|
417
|
+
runId: string | null;
|
|
418
|
+
payload: Record<string, unknown>;
|
|
419
|
+
controlActionId: string | null;
|
|
420
|
+
generationId: string;
|
|
421
|
+
attemptEpoch: number;
|
|
422
|
+
generationSeq: number;
|
|
423
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
424
|
+
bodyOffset: number | null;
|
|
425
|
+
bodyLength: number | null;
|
|
426
|
+
queueItemId: string | null;
|
|
427
|
+
recordedAt: Date;
|
|
428
|
+
emittedAt: Date | null;
|
|
429
|
+
} | null;
|
|
430
|
+
outputCutoffEvent: {
|
|
431
|
+
assistantMessageId: string | null;
|
|
432
|
+
id: string;
|
|
433
|
+
orgId: string;
|
|
434
|
+
runId: string | null;
|
|
435
|
+
payload: Record<string, unknown>;
|
|
436
|
+
controlActionId: string | null;
|
|
437
|
+
generationId: string;
|
|
438
|
+
attemptEpoch: number;
|
|
439
|
+
generationSeq: number;
|
|
440
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
441
|
+
bodyOffset: number | null;
|
|
442
|
+
bodyLength: number | null;
|
|
443
|
+
queueItemId: string | null;
|
|
444
|
+
recordedAt: Date;
|
|
445
|
+
emittedAt: Date | null;
|
|
446
|
+
} | null;
|
|
447
|
+
outcome: "stop_applied" | "completion_committed";
|
|
448
|
+
idempotent: boolean;
|
|
449
|
+
}>;
|
|
450
|
+
beginSteerFallbackCutoff: (input: {
|
|
451
|
+
orgId: string;
|
|
452
|
+
conversationId: string;
|
|
453
|
+
generationId: string;
|
|
454
|
+
expectedAttemptEpoch: number;
|
|
455
|
+
controlActionId: string;
|
|
456
|
+
queueItemId: string;
|
|
457
|
+
requestedRenderSeq?: number;
|
|
458
|
+
requestedBodyHash?: string;
|
|
459
|
+
now?: Date;
|
|
460
|
+
}) => Promise<{
|
|
461
|
+
action: {
|
|
462
|
+
id: string;
|
|
463
|
+
orgId: string;
|
|
464
|
+
createdAt: Date;
|
|
465
|
+
updatedAt: Date;
|
|
466
|
+
resolvedAt: Date | null;
|
|
467
|
+
expectedGenerationId: string | null;
|
|
468
|
+
expectedAttemptEpoch: number | null;
|
|
469
|
+
expectedControlVersion: number | null;
|
|
470
|
+
lastError: string | null;
|
|
471
|
+
requestedAt: Date;
|
|
472
|
+
controlOwnerToken: string | null;
|
|
473
|
+
providerThreadId: string | null;
|
|
474
|
+
providerTurnId: string | null;
|
|
475
|
+
acceptedThroughSeq: number | null;
|
|
476
|
+
frozenBodyHash: string | null;
|
|
477
|
+
appliedControlVersion: number | null;
|
|
478
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
479
|
+
localDisposition: ChatControlDisposition;
|
|
480
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
481
|
+
providerClientMessageId: string | null;
|
|
482
|
+
providerEvidence: Record<string, unknown> | null;
|
|
483
|
+
requestedRenderSeq: number | null;
|
|
484
|
+
requestedBodyHash: string | null;
|
|
485
|
+
providerSentAt: Date | null;
|
|
486
|
+
providerAcknowledgedAt: Date | null;
|
|
487
|
+
};
|
|
488
|
+
generation: {
|
|
489
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
490
|
+
conversationId: string;
|
|
491
|
+
id: string;
|
|
492
|
+
orgId: string;
|
|
493
|
+
createdAt: Date;
|
|
494
|
+
updatedAt: Date;
|
|
495
|
+
attemptEpoch: number;
|
|
496
|
+
startedAt: Date;
|
|
497
|
+
completedAt: Date | null;
|
|
498
|
+
terminalReason: string | null;
|
|
499
|
+
controlVersion: number;
|
|
500
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
501
|
+
controlRuntimeType: string | null;
|
|
502
|
+
controlOwnerToken: string | null;
|
|
503
|
+
controlLeaseExpiresAt: Date | null;
|
|
504
|
+
providerThreadId: string | null;
|
|
505
|
+
providerTurnId: string | null;
|
|
506
|
+
acceptedThroughSeq: number | null;
|
|
507
|
+
lastClientCheckpointSeq: number | null;
|
|
508
|
+
lastClientCheckpointHash: string | null;
|
|
509
|
+
frozenBodyHash: string | null;
|
|
510
|
+
stopRequestedAt: Date | null;
|
|
511
|
+
runtimeTerminalAt: Date | null;
|
|
512
|
+
lateEventsDropped: number;
|
|
513
|
+
lateBytes: number;
|
|
514
|
+
};
|
|
515
|
+
item: typeof chatQueuedMessages.$inferSelect;
|
|
516
|
+
outputCutoffEvent: {
|
|
517
|
+
assistantMessageId: string | null;
|
|
518
|
+
id: string;
|
|
519
|
+
orgId: string;
|
|
520
|
+
runId: string | null;
|
|
521
|
+
payload: Record<string, unknown>;
|
|
522
|
+
controlActionId: string | null;
|
|
523
|
+
generationId: string;
|
|
524
|
+
attemptEpoch: number;
|
|
525
|
+
generationSeq: number;
|
|
526
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
527
|
+
bodyOffset: number | null;
|
|
528
|
+
bodyLength: number | null;
|
|
529
|
+
queueItemId: string | null;
|
|
530
|
+
recordedAt: Date;
|
|
531
|
+
emittedAt: Date | null;
|
|
532
|
+
} | null;
|
|
533
|
+
continuationEvent: {
|
|
534
|
+
assistantMessageId: string | null;
|
|
535
|
+
id: string;
|
|
536
|
+
orgId: string;
|
|
537
|
+
runId: string | null;
|
|
538
|
+
payload: Record<string, unknown>;
|
|
539
|
+
controlActionId: string | null;
|
|
540
|
+
generationId: string;
|
|
541
|
+
attemptEpoch: number;
|
|
542
|
+
generationSeq: number;
|
|
543
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
544
|
+
bodyOffset: number | null;
|
|
545
|
+
bodyLength: number | null;
|
|
546
|
+
queueItemId: string | null;
|
|
547
|
+
recordedAt: Date;
|
|
548
|
+
emittedAt: Date | null;
|
|
549
|
+
} | null;
|
|
550
|
+
outcome: "cutoff_applied" | "completion_committed";
|
|
551
|
+
idempotent: boolean;
|
|
552
|
+
}>;
|
|
553
|
+
recordRuntimeTerminal: (input: {
|
|
554
|
+
orgId: string;
|
|
555
|
+
conversationId: string;
|
|
556
|
+
generationId: string;
|
|
557
|
+
expectedAttemptEpoch: number;
|
|
558
|
+
expectedOwnerToken?: string | null;
|
|
559
|
+
finalStatus: Extract<import("@rudderhq/shared").ChatGenerationStatus, "completed" | "failed" | "stopped" | "aborted" | "interrupted_unverified">;
|
|
560
|
+
terminalReason: string;
|
|
561
|
+
controlActionId?: string | null;
|
|
562
|
+
payload?: Record<string, unknown>;
|
|
563
|
+
now?: Date;
|
|
564
|
+
}) => Promise<{
|
|
565
|
+
generation: {
|
|
566
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
567
|
+
conversationId: string;
|
|
568
|
+
id: string;
|
|
569
|
+
orgId: string;
|
|
570
|
+
createdAt: Date;
|
|
571
|
+
updatedAt: Date;
|
|
572
|
+
attemptEpoch: number;
|
|
573
|
+
startedAt: Date;
|
|
574
|
+
completedAt: Date | null;
|
|
575
|
+
terminalReason: string | null;
|
|
576
|
+
controlVersion: number;
|
|
577
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
578
|
+
controlRuntimeType: string | null;
|
|
579
|
+
controlOwnerToken: string | null;
|
|
580
|
+
controlLeaseExpiresAt: Date | null;
|
|
581
|
+
providerThreadId: string | null;
|
|
582
|
+
providerTurnId: string | null;
|
|
583
|
+
acceptedThroughSeq: number | null;
|
|
584
|
+
lastClientCheckpointSeq: number | null;
|
|
585
|
+
lastClientCheckpointHash: string | null;
|
|
586
|
+
frozenBodyHash: string | null;
|
|
587
|
+
stopRequestedAt: Date | null;
|
|
588
|
+
runtimeTerminalAt: Date | null;
|
|
589
|
+
lateEventsDropped: number;
|
|
590
|
+
lateBytes: number;
|
|
591
|
+
};
|
|
592
|
+
event: null;
|
|
593
|
+
outbox: {
|
|
594
|
+
id: string;
|
|
595
|
+
orgId: string;
|
|
596
|
+
generationId: string;
|
|
597
|
+
sourceEventId: string;
|
|
598
|
+
projectionVersion: number;
|
|
599
|
+
projectorVersion: number;
|
|
600
|
+
expectedControlVersion: number;
|
|
601
|
+
status: import("@rudderhq/shared").ChatTerminalOutboxStatus;
|
|
602
|
+
payload: Record<string, unknown>;
|
|
603
|
+
claimToken: string | null;
|
|
604
|
+
claimEpoch: number;
|
|
605
|
+
claimOwner: string | null;
|
|
606
|
+
leaseExpiresAt: Date | null;
|
|
607
|
+
attemptCount: number;
|
|
608
|
+
replayCount: number;
|
|
609
|
+
availableAt: Date;
|
|
610
|
+
lastAttemptAt: Date | null;
|
|
611
|
+
lastError: string | null;
|
|
612
|
+
projectedAt: Date | null;
|
|
613
|
+
createdAt: Date;
|
|
614
|
+
updatedAt: Date;
|
|
615
|
+
};
|
|
616
|
+
idempotent: boolean;
|
|
617
|
+
} | {
|
|
618
|
+
generation: {
|
|
619
|
+
id: string;
|
|
620
|
+
orgId: string;
|
|
621
|
+
conversationId: string;
|
|
622
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
623
|
+
terminalReason: string | null;
|
|
624
|
+
attemptEpoch: number;
|
|
625
|
+
controlVersion: number;
|
|
626
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
627
|
+
controlRuntimeType: string | null;
|
|
628
|
+
controlOwnerToken: string | null;
|
|
629
|
+
controlLeaseExpiresAt: Date | null;
|
|
630
|
+
providerThreadId: string | null;
|
|
631
|
+
providerTurnId: string | null;
|
|
632
|
+
acceptedThroughSeq: number | null;
|
|
633
|
+
lastClientCheckpointSeq: number | null;
|
|
634
|
+
lastClientCheckpointHash: string | null;
|
|
635
|
+
frozenBodyHash: string | null;
|
|
636
|
+
stopRequestedAt: Date | null;
|
|
637
|
+
runtimeTerminalAt: Date | null;
|
|
638
|
+
lateEventsDropped: number;
|
|
639
|
+
lateBytes: number;
|
|
640
|
+
startedAt: Date;
|
|
641
|
+
completedAt: Date | null;
|
|
642
|
+
createdAt: Date;
|
|
643
|
+
updatedAt: Date;
|
|
644
|
+
};
|
|
645
|
+
event: {
|
|
646
|
+
assistantMessageId: string | null;
|
|
647
|
+
id: string;
|
|
648
|
+
orgId: string;
|
|
649
|
+
runId: string | null;
|
|
650
|
+
payload: Record<string, unknown>;
|
|
651
|
+
controlActionId: string | null;
|
|
652
|
+
generationId: string;
|
|
653
|
+
attemptEpoch: number;
|
|
654
|
+
generationSeq: number;
|
|
655
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
656
|
+
bodyOffset: number | null;
|
|
657
|
+
bodyLength: number | null;
|
|
658
|
+
queueItemId: string | null;
|
|
659
|
+
recordedAt: Date;
|
|
660
|
+
emittedAt: Date | null;
|
|
661
|
+
};
|
|
662
|
+
outbox: {
|
|
663
|
+
status: import("@rudderhq/shared").ChatTerminalOutboxStatus;
|
|
664
|
+
id: string;
|
|
665
|
+
orgId: string;
|
|
666
|
+
createdAt: Date;
|
|
667
|
+
updatedAt: Date;
|
|
668
|
+
payload: Record<string, unknown>;
|
|
669
|
+
expectedControlVersion: number;
|
|
670
|
+
generationId: string;
|
|
671
|
+
lastError: string | null;
|
|
672
|
+
lastAttemptAt: Date | null;
|
|
673
|
+
sourceEventId: string;
|
|
674
|
+
projectionVersion: number;
|
|
675
|
+
projectorVersion: number;
|
|
676
|
+
claimToken: string | null;
|
|
677
|
+
claimEpoch: number;
|
|
678
|
+
claimOwner: string | null;
|
|
679
|
+
leaseExpiresAt: Date | null;
|
|
680
|
+
attemptCount: number;
|
|
681
|
+
replayCount: number;
|
|
682
|
+
availableAt: Date;
|
|
683
|
+
projectedAt: Date | null;
|
|
684
|
+
};
|
|
685
|
+
idempotent: boolean;
|
|
686
|
+
}>;
|
|
687
|
+
claimTerminalProjection: (input: {
|
|
688
|
+
workerId: string;
|
|
689
|
+
leaseMs: number;
|
|
690
|
+
orgId?: string;
|
|
691
|
+
now?: Date;
|
|
692
|
+
}) => Promise<import("./chat-generation-protocol.js").ChatTerminalProjectionClaim | null>;
|
|
693
|
+
getNextTerminalProjectionWakeAt: (input?: {
|
|
694
|
+
orgId?: string;
|
|
695
|
+
}) => Promise<Date | null>;
|
|
696
|
+
completeTerminalProjection: (input: {
|
|
697
|
+
outboxId: string;
|
|
698
|
+
claimToken: string;
|
|
699
|
+
claimEpoch: number;
|
|
700
|
+
finalStatus?: Extract<import("@rudderhq/shared").ChatGenerationStatus, "completed" | "failed" | "stopped" | "aborted" | "interrupted_unverified" | "control_lost">;
|
|
701
|
+
terminalReason?: string;
|
|
702
|
+
controlDisposition?: ChatControlDisposition;
|
|
703
|
+
now?: Date;
|
|
704
|
+
project?: (tx: import("./chat-generation-protocol.js").ChatGenerationProtocolTransaction, claim: import("./chat-generation-protocol.js").ChatTerminalProjectionClaim) => Promise<void>;
|
|
705
|
+
}) => Promise<{
|
|
706
|
+
outbox: {
|
|
707
|
+
id: string;
|
|
708
|
+
orgId: string;
|
|
709
|
+
generationId: string;
|
|
710
|
+
sourceEventId: string;
|
|
711
|
+
projectionVersion: number;
|
|
712
|
+
projectorVersion: number;
|
|
713
|
+
expectedControlVersion: number;
|
|
714
|
+
status: import("@rudderhq/shared").ChatTerminalOutboxStatus;
|
|
715
|
+
payload: Record<string, unknown>;
|
|
716
|
+
claimToken: string | null;
|
|
717
|
+
claimEpoch: number;
|
|
718
|
+
claimOwner: string | null;
|
|
719
|
+
leaseExpiresAt: Date | null;
|
|
720
|
+
attemptCount: number;
|
|
721
|
+
replayCount: number;
|
|
722
|
+
availableAt: Date;
|
|
723
|
+
lastAttemptAt: Date | null;
|
|
724
|
+
lastError: string | null;
|
|
725
|
+
projectedAt: Date | null;
|
|
726
|
+
createdAt: Date;
|
|
727
|
+
updatedAt: Date;
|
|
728
|
+
};
|
|
729
|
+
generation: {
|
|
730
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
731
|
+
conversationId: string;
|
|
732
|
+
id: string;
|
|
733
|
+
orgId: string;
|
|
734
|
+
createdAt: Date;
|
|
735
|
+
updatedAt: Date;
|
|
736
|
+
attemptEpoch: number;
|
|
737
|
+
startedAt: Date;
|
|
738
|
+
completedAt: Date | null;
|
|
739
|
+
terminalReason: string | null;
|
|
740
|
+
controlVersion: number;
|
|
741
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
742
|
+
controlRuntimeType: string | null;
|
|
743
|
+
controlOwnerToken: string | null;
|
|
744
|
+
controlLeaseExpiresAt: Date | null;
|
|
745
|
+
providerThreadId: string | null;
|
|
746
|
+
providerTurnId: string | null;
|
|
747
|
+
acceptedThroughSeq: number | null;
|
|
748
|
+
lastClientCheckpointSeq: number | null;
|
|
749
|
+
lastClientCheckpointHash: string | null;
|
|
750
|
+
frozenBodyHash: string | null;
|
|
751
|
+
stopRequestedAt: Date | null;
|
|
752
|
+
runtimeTerminalAt: Date | null;
|
|
753
|
+
lateEventsDropped: number;
|
|
754
|
+
lateBytes: number;
|
|
755
|
+
};
|
|
756
|
+
event: null;
|
|
757
|
+
superseded: true;
|
|
758
|
+
} | {
|
|
759
|
+
outbox: {
|
|
760
|
+
id: string;
|
|
761
|
+
orgId: string;
|
|
762
|
+
generationId: string;
|
|
763
|
+
sourceEventId: string;
|
|
764
|
+
projectionVersion: number;
|
|
765
|
+
projectorVersion: number;
|
|
766
|
+
expectedControlVersion: number;
|
|
767
|
+
status: import("@rudderhq/shared").ChatTerminalOutboxStatus;
|
|
768
|
+
payload: Record<string, unknown>;
|
|
769
|
+
claimToken: string | null;
|
|
770
|
+
claimEpoch: number;
|
|
771
|
+
claimOwner: string | null;
|
|
772
|
+
leaseExpiresAt: Date | null;
|
|
773
|
+
attemptCount: number;
|
|
774
|
+
replayCount: number;
|
|
775
|
+
availableAt: Date;
|
|
776
|
+
lastAttemptAt: Date | null;
|
|
777
|
+
lastError: string | null;
|
|
778
|
+
projectedAt: Date | null;
|
|
779
|
+
createdAt: Date;
|
|
780
|
+
updatedAt: Date;
|
|
781
|
+
};
|
|
782
|
+
generation: {
|
|
783
|
+
id: string;
|
|
784
|
+
orgId: string;
|
|
785
|
+
conversationId: string;
|
|
786
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
787
|
+
terminalReason: string | null;
|
|
788
|
+
attemptEpoch: number;
|
|
789
|
+
controlVersion: number;
|
|
790
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
791
|
+
controlRuntimeType: string | null;
|
|
792
|
+
controlOwnerToken: string | null;
|
|
793
|
+
controlLeaseExpiresAt: Date | null;
|
|
794
|
+
providerThreadId: string | null;
|
|
795
|
+
providerTurnId: string | null;
|
|
796
|
+
acceptedThroughSeq: number | null;
|
|
797
|
+
lastClientCheckpointSeq: number | null;
|
|
798
|
+
lastClientCheckpointHash: string | null;
|
|
799
|
+
frozenBodyHash: string | null;
|
|
800
|
+
stopRequestedAt: Date | null;
|
|
801
|
+
runtimeTerminalAt: Date | null;
|
|
802
|
+
lateEventsDropped: number;
|
|
803
|
+
lateBytes: number;
|
|
804
|
+
startedAt: Date;
|
|
805
|
+
completedAt: Date | null;
|
|
806
|
+
createdAt: Date;
|
|
807
|
+
updatedAt: Date;
|
|
808
|
+
};
|
|
809
|
+
event: {
|
|
810
|
+
assistantMessageId: string | null;
|
|
811
|
+
id: string;
|
|
812
|
+
orgId: string;
|
|
813
|
+
runId: string | null;
|
|
814
|
+
payload: Record<string, unknown>;
|
|
815
|
+
controlActionId: string | null;
|
|
816
|
+
generationId: string;
|
|
817
|
+
attemptEpoch: number;
|
|
818
|
+
generationSeq: number;
|
|
819
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
820
|
+
bodyOffset: number | null;
|
|
821
|
+
bodyLength: number | null;
|
|
822
|
+
queueItemId: string | null;
|
|
823
|
+
recordedAt: Date;
|
|
824
|
+
emittedAt: Date | null;
|
|
825
|
+
};
|
|
826
|
+
superseded?: undefined;
|
|
827
|
+
} | null>;
|
|
828
|
+
retryTerminalProjection: (input: {
|
|
829
|
+
outboxId: string;
|
|
830
|
+
claimToken: string;
|
|
831
|
+
claimEpoch: number;
|
|
832
|
+
error: string;
|
|
833
|
+
retryAt: Date;
|
|
834
|
+
maxAttempts: number;
|
|
835
|
+
now?: Date;
|
|
836
|
+
}) => Promise<{
|
|
837
|
+
id: string;
|
|
838
|
+
orgId: string;
|
|
839
|
+
generationId: string;
|
|
840
|
+
sourceEventId: string;
|
|
841
|
+
projectionVersion: number;
|
|
842
|
+
projectorVersion: number;
|
|
843
|
+
expectedControlVersion: number;
|
|
844
|
+
status: import("@rudderhq/shared").ChatTerminalOutboxStatus;
|
|
845
|
+
payload: Record<string, unknown>;
|
|
846
|
+
claimToken: string | null;
|
|
847
|
+
claimEpoch: number;
|
|
848
|
+
claimOwner: string | null;
|
|
849
|
+
leaseExpiresAt: Date | null;
|
|
850
|
+
attemptCount: number;
|
|
851
|
+
replayCount: number;
|
|
852
|
+
availableAt: Date;
|
|
853
|
+
lastAttemptAt: Date | null;
|
|
854
|
+
lastError: string | null;
|
|
855
|
+
projectedAt: Date | null;
|
|
856
|
+
createdAt: Date;
|
|
857
|
+
updatedAt: Date;
|
|
858
|
+
} | null>;
|
|
859
|
+
recoverStaleControlOwners: (input: {
|
|
860
|
+
now?: Date;
|
|
861
|
+
limit?: number;
|
|
862
|
+
assumeAllOwnersStale?: boolean;
|
|
863
|
+
}) => Promise<{
|
|
864
|
+
generation: {
|
|
865
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
866
|
+
conversationId: string;
|
|
867
|
+
id: string;
|
|
868
|
+
orgId: string;
|
|
869
|
+
createdAt: Date;
|
|
870
|
+
updatedAt: Date;
|
|
871
|
+
attemptEpoch: number;
|
|
872
|
+
startedAt: Date;
|
|
873
|
+
completedAt: Date | null;
|
|
874
|
+
terminalReason: string | null;
|
|
875
|
+
controlVersion: number;
|
|
876
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
877
|
+
controlRuntimeType: string | null;
|
|
878
|
+
controlOwnerToken: string | null;
|
|
879
|
+
controlLeaseExpiresAt: Date | null;
|
|
880
|
+
providerThreadId: string | null;
|
|
881
|
+
providerTurnId: string | null;
|
|
882
|
+
acceptedThroughSeq: number | null;
|
|
883
|
+
lastClientCheckpointSeq: number | null;
|
|
884
|
+
lastClientCheckpointHash: string | null;
|
|
885
|
+
frozenBodyHash: string | null;
|
|
886
|
+
stopRequestedAt: Date | null;
|
|
887
|
+
runtimeTerminalAt: Date | null;
|
|
888
|
+
lateEventsDropped: number;
|
|
889
|
+
lateBytes: number;
|
|
890
|
+
};
|
|
891
|
+
event: {
|
|
892
|
+
assistantMessageId: string | null;
|
|
893
|
+
id: string;
|
|
894
|
+
orgId: string;
|
|
895
|
+
runId: string | null;
|
|
896
|
+
payload: Record<string, unknown>;
|
|
897
|
+
controlActionId: string | null;
|
|
898
|
+
generationId: string;
|
|
899
|
+
attemptEpoch: number;
|
|
900
|
+
generationSeq: number;
|
|
901
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
902
|
+
bodyOffset: number | null;
|
|
903
|
+
bodyLength: number | null;
|
|
904
|
+
queueItemId: string | null;
|
|
905
|
+
recordedAt: Date;
|
|
906
|
+
emittedAt: Date | null;
|
|
907
|
+
};
|
|
908
|
+
outbox: {
|
|
909
|
+
status: import("@rudderhq/shared").ChatTerminalOutboxStatus;
|
|
910
|
+
id: string;
|
|
911
|
+
orgId: string;
|
|
912
|
+
createdAt: Date;
|
|
913
|
+
updatedAt: Date;
|
|
914
|
+
payload: Record<string, unknown>;
|
|
915
|
+
expectedControlVersion: number;
|
|
916
|
+
generationId: string;
|
|
917
|
+
lastError: string | null;
|
|
918
|
+
lastAttemptAt: Date | null;
|
|
919
|
+
sourceEventId: string;
|
|
920
|
+
projectionVersion: number;
|
|
921
|
+
projectorVersion: number;
|
|
922
|
+
claimToken: string | null;
|
|
923
|
+
claimEpoch: number;
|
|
924
|
+
claimOwner: string | null;
|
|
925
|
+
leaseExpiresAt: Date | null;
|
|
926
|
+
attemptCount: number;
|
|
927
|
+
replayCount: number;
|
|
928
|
+
availableAt: Date;
|
|
929
|
+
projectedAt: Date | null;
|
|
930
|
+
};
|
|
931
|
+
}[]>;
|
|
932
|
+
};
|
|
19
933
|
list: (orgId: string, options?: {
|
|
20
934
|
status?: "active" | "resolved" | "archived" | "all";
|
|
21
935
|
q?: string;
|
|
22
936
|
limit?: number;
|
|
937
|
+
projectId?: string;
|
|
23
938
|
}, userId?: string | null) => Promise<{
|
|
24
939
|
primaryIssue: {
|
|
25
940
|
id: string;
|
|
@@ -59,13 +974,12 @@ export declare function chatService(db: Db): {
|
|
|
59
974
|
unreadCount: number;
|
|
60
975
|
isUnread: boolean;
|
|
61
976
|
needsAttention: boolean;
|
|
62
|
-
title: string;
|
|
63
977
|
status: string;
|
|
978
|
+
title: string;
|
|
64
979
|
id: string;
|
|
65
980
|
orgId: string;
|
|
66
981
|
createdAt: Date;
|
|
67
982
|
updatedAt: Date;
|
|
68
|
-
createdByUserId: string | null;
|
|
69
983
|
summary: string | null;
|
|
70
984
|
preferredAgentId: string | null;
|
|
71
985
|
issueCreationMode: string;
|
|
@@ -73,6 +987,14 @@ export declare function chatService(db: Db): {
|
|
|
73
987
|
routedAgentId: string | null;
|
|
74
988
|
primaryIssueId: string | null;
|
|
75
989
|
resolvedAt: Date | null;
|
|
990
|
+
createdByUserId: string | null;
|
|
991
|
+
conversationKind: string;
|
|
992
|
+
messengerVisible: boolean;
|
|
993
|
+
sideChatState: string | null;
|
|
994
|
+
sideChatExpiresAt: Date | null;
|
|
995
|
+
sideChatCompletedAt: Date | null;
|
|
996
|
+
sideChatKeptAt: Date | null;
|
|
997
|
+
sideChatClientMutationId: string | null;
|
|
76
998
|
forkedFromConversationId: string | null;
|
|
77
999
|
forkedFromMessageId: string | null;
|
|
78
1000
|
forkRootConversationId: string | null;
|
|
@@ -94,13 +1016,12 @@ export declare function chatService(db: Db): {
|
|
|
94
1016
|
unreadCount: number;
|
|
95
1017
|
isUnread: boolean;
|
|
96
1018
|
needsAttention: boolean;
|
|
97
|
-
title: string;
|
|
98
1019
|
status: string;
|
|
1020
|
+
title: string;
|
|
99
1021
|
id: string;
|
|
100
1022
|
orgId: string;
|
|
101
1023
|
createdAt: Date;
|
|
102
1024
|
updatedAt: Date;
|
|
103
|
-
createdByUserId: string | null;
|
|
104
1025
|
summary: string | null;
|
|
105
1026
|
preferredAgentId: string | null;
|
|
106
1027
|
issueCreationMode: string;
|
|
@@ -108,6 +1029,14 @@ export declare function chatService(db: Db): {
|
|
|
108
1029
|
routedAgentId: string | null;
|
|
109
1030
|
primaryIssueId: string | null;
|
|
110
1031
|
resolvedAt: Date | null;
|
|
1032
|
+
createdByUserId: string | null;
|
|
1033
|
+
conversationKind: string;
|
|
1034
|
+
messengerVisible: boolean;
|
|
1035
|
+
sideChatState: string | null;
|
|
1036
|
+
sideChatExpiresAt: Date | null;
|
|
1037
|
+
sideChatCompletedAt: Date | null;
|
|
1038
|
+
sideChatKeptAt: Date | null;
|
|
1039
|
+
sideChatClientMutationId: string | null;
|
|
111
1040
|
forkedFromConversationId: string | null;
|
|
112
1041
|
forkedFromMessageId: string | null;
|
|
113
1042
|
forkRootConversationId: string | null;
|
|
@@ -124,13 +1053,12 @@ export declare function chatService(db: Db): {
|
|
|
124
1053
|
unreadCount: number;
|
|
125
1054
|
isUnread: boolean;
|
|
126
1055
|
needsAttention: boolean;
|
|
127
|
-
title: string;
|
|
128
1056
|
status: string;
|
|
1057
|
+
title: string;
|
|
129
1058
|
id: string;
|
|
130
1059
|
orgId: string;
|
|
131
1060
|
createdAt: Date;
|
|
132
1061
|
updatedAt: Date;
|
|
133
|
-
createdByUserId: string | null;
|
|
134
1062
|
summary: string | null;
|
|
135
1063
|
preferredAgentId: string | null;
|
|
136
1064
|
issueCreationMode: string;
|
|
@@ -138,6 +1066,14 @@ export declare function chatService(db: Db): {
|
|
|
138
1066
|
routedAgentId: string | null;
|
|
139
1067
|
primaryIssueId: string | null;
|
|
140
1068
|
resolvedAt: Date | null;
|
|
1069
|
+
createdByUserId: string | null;
|
|
1070
|
+
conversationKind: string;
|
|
1071
|
+
messengerVisible: boolean;
|
|
1072
|
+
sideChatState: string | null;
|
|
1073
|
+
sideChatExpiresAt: Date | null;
|
|
1074
|
+
sideChatCompletedAt: Date | null;
|
|
1075
|
+
sideChatKeptAt: Date | null;
|
|
1076
|
+
sideChatClientMutationId: string | null;
|
|
141
1077
|
forkedFromConversationId: string | null;
|
|
142
1078
|
forkedFromMessageId: string | null;
|
|
143
1079
|
forkRootConversationId: string | null;
|
|
@@ -154,13 +1090,12 @@ export declare function chatService(db: Db): {
|
|
|
154
1090
|
unreadCount: number;
|
|
155
1091
|
isUnread: boolean;
|
|
156
1092
|
needsAttention: boolean;
|
|
157
|
-
title: string;
|
|
158
1093
|
status: string;
|
|
1094
|
+
title: string;
|
|
159
1095
|
id: string;
|
|
160
1096
|
orgId: string;
|
|
161
1097
|
createdAt: Date;
|
|
162
1098
|
updatedAt: Date;
|
|
163
|
-
createdByUserId: string | null;
|
|
164
1099
|
summary: string | null;
|
|
165
1100
|
preferredAgentId: string | null;
|
|
166
1101
|
issueCreationMode: string;
|
|
@@ -168,6 +1103,14 @@ export declare function chatService(db: Db): {
|
|
|
168
1103
|
routedAgentId: string | null;
|
|
169
1104
|
primaryIssueId: string | null;
|
|
170
1105
|
resolvedAt: Date | null;
|
|
1106
|
+
createdByUserId: string | null;
|
|
1107
|
+
conversationKind: string;
|
|
1108
|
+
messengerVisible: boolean;
|
|
1109
|
+
sideChatState: string | null;
|
|
1110
|
+
sideChatExpiresAt: Date | null;
|
|
1111
|
+
sideChatCompletedAt: Date | null;
|
|
1112
|
+
sideChatKeptAt: Date | null;
|
|
1113
|
+
sideChatClientMutationId: string | null;
|
|
171
1114
|
forkedFromConversationId: string | null;
|
|
172
1115
|
forkedFromMessageId: string | null;
|
|
173
1116
|
forkRootConversationId: string | null;
|
|
@@ -212,13 +1155,12 @@ export declare function chatService(db: Db): {
|
|
|
212
1155
|
unreadCount: number;
|
|
213
1156
|
isUnread: boolean;
|
|
214
1157
|
needsAttention: boolean;
|
|
215
|
-
title: string;
|
|
216
1158
|
status: string;
|
|
1159
|
+
title: string;
|
|
217
1160
|
id: string;
|
|
218
1161
|
orgId: string;
|
|
219
1162
|
createdAt: Date;
|
|
220
1163
|
updatedAt: Date;
|
|
221
|
-
createdByUserId: string | null;
|
|
222
1164
|
summary: string | null;
|
|
223
1165
|
preferredAgentId: string | null;
|
|
224
1166
|
issueCreationMode: string;
|
|
@@ -226,6 +1168,14 @@ export declare function chatService(db: Db): {
|
|
|
226
1168
|
routedAgentId: string | null;
|
|
227
1169
|
primaryIssueId: string | null;
|
|
228
1170
|
resolvedAt: Date | null;
|
|
1171
|
+
createdByUserId: string | null;
|
|
1172
|
+
conversationKind: string;
|
|
1173
|
+
messengerVisible: boolean;
|
|
1174
|
+
sideChatState: string | null;
|
|
1175
|
+
sideChatExpiresAt: Date | null;
|
|
1176
|
+
sideChatCompletedAt: Date | null;
|
|
1177
|
+
sideChatKeptAt: Date | null;
|
|
1178
|
+
sideChatClientMutationId: string | null;
|
|
229
1179
|
forkedFromConversationId: string | null;
|
|
230
1180
|
forkedFromMessageId: string | null;
|
|
231
1181
|
forkRootConversationId: string | null;
|
|
@@ -282,13 +1232,12 @@ export declare function chatService(db: Db): {
|
|
|
282
1232
|
unreadCount: number;
|
|
283
1233
|
isUnread: boolean;
|
|
284
1234
|
needsAttention: boolean;
|
|
285
|
-
title: string;
|
|
286
1235
|
status: string;
|
|
1236
|
+
title: string;
|
|
287
1237
|
id: string;
|
|
288
1238
|
orgId: string;
|
|
289
1239
|
createdAt: Date;
|
|
290
1240
|
updatedAt: Date;
|
|
291
|
-
createdByUserId: string | null;
|
|
292
1241
|
summary: string | null;
|
|
293
1242
|
preferredAgentId: string | null;
|
|
294
1243
|
issueCreationMode: string;
|
|
@@ -296,6 +1245,14 @@ export declare function chatService(db: Db): {
|
|
|
296
1245
|
routedAgentId: string | null;
|
|
297
1246
|
primaryIssueId: string | null;
|
|
298
1247
|
resolvedAt: Date | null;
|
|
1248
|
+
createdByUserId: string | null;
|
|
1249
|
+
conversationKind: string;
|
|
1250
|
+
messengerVisible: boolean;
|
|
1251
|
+
sideChatState: string | null;
|
|
1252
|
+
sideChatExpiresAt: Date | null;
|
|
1253
|
+
sideChatCompletedAt: Date | null;
|
|
1254
|
+
sideChatKeptAt: Date | null;
|
|
1255
|
+
sideChatClientMutationId: string | null;
|
|
299
1256
|
forkedFromConversationId: string | null;
|
|
300
1257
|
forkedFromMessageId: string | null;
|
|
301
1258
|
forkRootConversationId: string | null;
|
|
@@ -340,13 +1297,12 @@ export declare function chatService(db: Db): {
|
|
|
340
1297
|
unreadCount: number;
|
|
341
1298
|
isUnread: boolean;
|
|
342
1299
|
needsAttention: boolean;
|
|
343
|
-
title: string;
|
|
344
1300
|
status: string;
|
|
1301
|
+
title: string;
|
|
345
1302
|
id: string;
|
|
346
1303
|
orgId: string;
|
|
347
1304
|
createdAt: Date;
|
|
348
1305
|
updatedAt: Date;
|
|
349
|
-
createdByUserId: string | null;
|
|
350
1306
|
summary: string | null;
|
|
351
1307
|
preferredAgentId: string | null;
|
|
352
1308
|
issueCreationMode: string;
|
|
@@ -354,6 +1310,14 @@ export declare function chatService(db: Db): {
|
|
|
354
1310
|
routedAgentId: string | null;
|
|
355
1311
|
primaryIssueId: string | null;
|
|
356
1312
|
resolvedAt: Date | null;
|
|
1313
|
+
createdByUserId: string | null;
|
|
1314
|
+
conversationKind: string;
|
|
1315
|
+
messengerVisible: boolean;
|
|
1316
|
+
sideChatState: string | null;
|
|
1317
|
+
sideChatExpiresAt: Date | null;
|
|
1318
|
+
sideChatCompletedAt: Date | null;
|
|
1319
|
+
sideChatKeptAt: Date | null;
|
|
1320
|
+
sideChatClientMutationId: string | null;
|
|
357
1321
|
forkedFromConversationId: string | null;
|
|
358
1322
|
forkedFromMessageId: string | null;
|
|
359
1323
|
forkRootConversationId: string | null;
|
|
@@ -398,13 +1362,12 @@ export declare function chatService(db: Db): {
|
|
|
398
1362
|
unreadCount: number;
|
|
399
1363
|
isUnread: boolean;
|
|
400
1364
|
needsAttention: boolean;
|
|
401
|
-
title: string;
|
|
402
1365
|
status: string;
|
|
1366
|
+
title: string;
|
|
403
1367
|
id: string;
|
|
404
1368
|
orgId: string;
|
|
405
1369
|
createdAt: Date;
|
|
406
1370
|
updatedAt: Date;
|
|
407
|
-
createdByUserId: string | null;
|
|
408
1371
|
summary: string | null;
|
|
409
1372
|
preferredAgentId: string | null;
|
|
410
1373
|
issueCreationMode: string;
|
|
@@ -412,6 +1375,14 @@ export declare function chatService(db: Db): {
|
|
|
412
1375
|
routedAgentId: string | null;
|
|
413
1376
|
primaryIssueId: string | null;
|
|
414
1377
|
resolvedAt: Date | null;
|
|
1378
|
+
createdByUserId: string | null;
|
|
1379
|
+
conversationKind: string;
|
|
1380
|
+
messengerVisible: boolean;
|
|
1381
|
+
sideChatState: string | null;
|
|
1382
|
+
sideChatExpiresAt: Date | null;
|
|
1383
|
+
sideChatCompletedAt: Date | null;
|
|
1384
|
+
sideChatKeptAt: Date | null;
|
|
1385
|
+
sideChatClientMutationId: string | null;
|
|
415
1386
|
forkedFromConversationId: string | null;
|
|
416
1387
|
forkedFromMessageId: string | null;
|
|
417
1388
|
forkRootConversationId: string | null;
|
|
@@ -456,13 +1427,12 @@ export declare function chatService(db: Db): {
|
|
|
456
1427
|
unreadCount: number;
|
|
457
1428
|
isUnread: boolean;
|
|
458
1429
|
needsAttention: boolean;
|
|
459
|
-
title: string;
|
|
460
1430
|
status: string;
|
|
1431
|
+
title: string;
|
|
461
1432
|
id: string;
|
|
462
1433
|
orgId: string;
|
|
463
1434
|
createdAt: Date;
|
|
464
1435
|
updatedAt: Date;
|
|
465
|
-
createdByUserId: string | null;
|
|
466
1436
|
summary: string | null;
|
|
467
1437
|
preferredAgentId: string | null;
|
|
468
1438
|
issueCreationMode: string;
|
|
@@ -470,6 +1440,14 @@ export declare function chatService(db: Db): {
|
|
|
470
1440
|
routedAgentId: string | null;
|
|
471
1441
|
primaryIssueId: string | null;
|
|
472
1442
|
resolvedAt: Date | null;
|
|
1443
|
+
createdByUserId: string | null;
|
|
1444
|
+
conversationKind: string;
|
|
1445
|
+
messengerVisible: boolean;
|
|
1446
|
+
sideChatState: string | null;
|
|
1447
|
+
sideChatExpiresAt: Date | null;
|
|
1448
|
+
sideChatCompletedAt: Date | null;
|
|
1449
|
+
sideChatKeptAt: Date | null;
|
|
1450
|
+
sideChatClientMutationId: string | null;
|
|
473
1451
|
forkedFromConversationId: string | null;
|
|
474
1452
|
forkedFromMessageId: string | null;
|
|
475
1453
|
forkRootConversationId: string | null;
|
|
@@ -481,14 +1459,14 @@ export declare function chatService(db: Db): {
|
|
|
481
1459
|
assetId: string;
|
|
482
1460
|
objectKey: string;
|
|
483
1461
|
}[]>;
|
|
1462
|
+
assetHasAttachments: (assetId: string) => Promise<boolean>;
|
|
484
1463
|
remove: (id: string) => Promise<{
|
|
485
|
-
title: string;
|
|
486
1464
|
status: string;
|
|
1465
|
+
title: string;
|
|
487
1466
|
id: string;
|
|
488
1467
|
orgId: string;
|
|
489
1468
|
createdAt: Date;
|
|
490
1469
|
updatedAt: Date;
|
|
491
|
-
createdByUserId: string | null;
|
|
492
1470
|
summary: string | null;
|
|
493
1471
|
preferredAgentId: string | null;
|
|
494
1472
|
issueCreationMode: string;
|
|
@@ -496,6 +1474,14 @@ export declare function chatService(db: Db): {
|
|
|
496
1474
|
routedAgentId: string | null;
|
|
497
1475
|
primaryIssueId: string | null;
|
|
498
1476
|
resolvedAt: Date | null;
|
|
1477
|
+
createdByUserId: string | null;
|
|
1478
|
+
conversationKind: string;
|
|
1479
|
+
messengerVisible: boolean;
|
|
1480
|
+
sideChatState: string | null;
|
|
1481
|
+
sideChatExpiresAt: Date | null;
|
|
1482
|
+
sideChatCompletedAt: Date | null;
|
|
1483
|
+
sideChatKeptAt: Date | null;
|
|
1484
|
+
sideChatClientMutationId: string | null;
|
|
499
1485
|
forkedFromConversationId: string | null;
|
|
500
1486
|
forkedFromMessageId: string | null;
|
|
501
1487
|
forkRootConversationId: string | null;
|
|
@@ -547,13 +1533,12 @@ export declare function chatService(db: Db): {
|
|
|
547
1533
|
unreadCount: number;
|
|
548
1534
|
isUnread: boolean;
|
|
549
1535
|
needsAttention: boolean;
|
|
550
|
-
title: string;
|
|
551
1536
|
status: string;
|
|
1537
|
+
title: string;
|
|
552
1538
|
id: string;
|
|
553
1539
|
orgId: string;
|
|
554
1540
|
createdAt: Date;
|
|
555
1541
|
updatedAt: Date;
|
|
556
|
-
createdByUserId: string | null;
|
|
557
1542
|
summary: string | null;
|
|
558
1543
|
preferredAgentId: string | null;
|
|
559
1544
|
issueCreationMode: string;
|
|
@@ -561,6 +1546,14 @@ export declare function chatService(db: Db): {
|
|
|
561
1546
|
routedAgentId: string | null;
|
|
562
1547
|
primaryIssueId: string | null;
|
|
563
1548
|
resolvedAt: Date | null;
|
|
1549
|
+
createdByUserId: string | null;
|
|
1550
|
+
conversationKind: string;
|
|
1551
|
+
messengerVisible: boolean;
|
|
1552
|
+
sideChatState: string | null;
|
|
1553
|
+
sideChatExpiresAt: Date | null;
|
|
1554
|
+
sideChatCompletedAt: Date | null;
|
|
1555
|
+
sideChatKeptAt: Date | null;
|
|
1556
|
+
sideChatClientMutationId: string | null;
|
|
564
1557
|
forkedFromConversationId: string | null;
|
|
565
1558
|
forkedFromMessageId: string | null;
|
|
566
1559
|
forkRootConversationId: string | null;
|
|
@@ -605,13 +1598,12 @@ export declare function chatService(db: Db): {
|
|
|
605
1598
|
unreadCount: number;
|
|
606
1599
|
isUnread: boolean;
|
|
607
1600
|
needsAttention: boolean;
|
|
608
|
-
title: string;
|
|
609
1601
|
status: string;
|
|
1602
|
+
title: string;
|
|
610
1603
|
id: string;
|
|
611
1604
|
orgId: string;
|
|
612
1605
|
createdAt: Date;
|
|
613
1606
|
updatedAt: Date;
|
|
614
|
-
createdByUserId: string | null;
|
|
615
1607
|
summary: string | null;
|
|
616
1608
|
preferredAgentId: string | null;
|
|
617
1609
|
issueCreationMode: string;
|
|
@@ -619,6 +1611,14 @@ export declare function chatService(db: Db): {
|
|
|
619
1611
|
routedAgentId: string | null;
|
|
620
1612
|
primaryIssueId: string | null;
|
|
621
1613
|
resolvedAt: Date | null;
|
|
1614
|
+
createdByUserId: string | null;
|
|
1615
|
+
conversationKind: string;
|
|
1616
|
+
messengerVisible: boolean;
|
|
1617
|
+
sideChatState: string | null;
|
|
1618
|
+
sideChatExpiresAt: Date | null;
|
|
1619
|
+
sideChatCompletedAt: Date | null;
|
|
1620
|
+
sideChatKeptAt: Date | null;
|
|
1621
|
+
sideChatClientMutationId: string | null;
|
|
622
1622
|
forkedFromConversationId: string | null;
|
|
623
1623
|
forkedFromMessageId: string | null;
|
|
624
1624
|
forkRootConversationId: string | null;
|
|
@@ -655,12 +1655,159 @@ export declare function chatService(db: Db): {
|
|
|
655
1655
|
pinnedAt: Date | null;
|
|
656
1656
|
}>;
|
|
657
1657
|
createGeneration: (orgId: string, conversationId: string) => Promise<ChatGenerationRow>;
|
|
1658
|
+
beginGenerationControlAttempt: (input: {
|
|
1659
|
+
orgId: string;
|
|
1660
|
+
conversationId: string;
|
|
1661
|
+
generationId: string;
|
|
1662
|
+
attemptEpoch: number;
|
|
1663
|
+
ownerToken: string;
|
|
1664
|
+
runtimeType: string;
|
|
1665
|
+
}) => Promise<{
|
|
1666
|
+
id: string;
|
|
1667
|
+
orgId: string;
|
|
1668
|
+
conversationId: string;
|
|
1669
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
1670
|
+
terminalReason: string | null;
|
|
1671
|
+
attemptEpoch: number;
|
|
1672
|
+
controlVersion: number;
|
|
1673
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
1674
|
+
controlRuntimeType: string | null;
|
|
1675
|
+
controlOwnerToken: string | null;
|
|
1676
|
+
controlLeaseExpiresAt: Date | null;
|
|
1677
|
+
providerThreadId: string | null;
|
|
1678
|
+
providerTurnId: string | null;
|
|
1679
|
+
acceptedThroughSeq: number | null;
|
|
1680
|
+
lastClientCheckpointSeq: number | null;
|
|
1681
|
+
lastClientCheckpointHash: string | null;
|
|
1682
|
+
frozenBodyHash: string | null;
|
|
1683
|
+
stopRequestedAt: Date | null;
|
|
1684
|
+
runtimeTerminalAt: Date | null;
|
|
1685
|
+
lateEventsDropped: number;
|
|
1686
|
+
lateBytes: number;
|
|
1687
|
+
startedAt: Date;
|
|
1688
|
+
completedAt: Date | null;
|
|
1689
|
+
createdAt: Date;
|
|
1690
|
+
updatedAt: Date;
|
|
1691
|
+
}>;
|
|
1692
|
+
markGenerationControlReady: (input: {
|
|
1693
|
+
generationId: string;
|
|
1694
|
+
attemptEpoch: number;
|
|
1695
|
+
ownerToken: string;
|
|
1696
|
+
runtimeType: string;
|
|
1697
|
+
providerThreadId?: string | null;
|
|
1698
|
+
providerTurnId?: string | null;
|
|
1699
|
+
}) => Promise<{
|
|
1700
|
+
id: string;
|
|
1701
|
+
orgId: string;
|
|
1702
|
+
conversationId: string;
|
|
1703
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
1704
|
+
terminalReason: string | null;
|
|
1705
|
+
attemptEpoch: number;
|
|
1706
|
+
controlVersion: number;
|
|
1707
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
1708
|
+
controlRuntimeType: string | null;
|
|
1709
|
+
controlOwnerToken: string | null;
|
|
1710
|
+
controlLeaseExpiresAt: Date | null;
|
|
1711
|
+
providerThreadId: string | null;
|
|
1712
|
+
providerTurnId: string | null;
|
|
1713
|
+
acceptedThroughSeq: number | null;
|
|
1714
|
+
lastClientCheckpointSeq: number | null;
|
|
1715
|
+
lastClientCheckpointHash: string | null;
|
|
1716
|
+
frozenBodyHash: string | null;
|
|
1717
|
+
stopRequestedAt: Date | null;
|
|
1718
|
+
runtimeTerminalAt: Date | null;
|
|
1719
|
+
lateEventsDropped: number;
|
|
1720
|
+
lateBytes: number;
|
|
1721
|
+
startedAt: Date;
|
|
1722
|
+
completedAt: Date | null;
|
|
1723
|
+
createdAt: Date;
|
|
1724
|
+
updatedAt: Date;
|
|
1725
|
+
}>;
|
|
1726
|
+
renewGenerationControlLease: (input: {
|
|
1727
|
+
generationId: string;
|
|
1728
|
+
attemptEpoch: number;
|
|
1729
|
+
ownerToken: string;
|
|
1730
|
+
now?: Date;
|
|
1731
|
+
}) => Promise<boolean>;
|
|
1732
|
+
markGenerationControlAttemptCompleted: (input: {
|
|
1733
|
+
generationId: string;
|
|
1734
|
+
attemptEpoch: number;
|
|
1735
|
+
ownerToken: string;
|
|
1736
|
+
}) => Promise<{
|
|
1737
|
+
id: string;
|
|
1738
|
+
orgId: string;
|
|
1739
|
+
conversationId: string;
|
|
1740
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
1741
|
+
terminalReason: string | null;
|
|
1742
|
+
attemptEpoch: number;
|
|
1743
|
+
controlVersion: number;
|
|
1744
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
1745
|
+
controlRuntimeType: string | null;
|
|
1746
|
+
controlOwnerToken: string | null;
|
|
1747
|
+
controlLeaseExpiresAt: Date | null;
|
|
1748
|
+
providerThreadId: string | null;
|
|
1749
|
+
providerTurnId: string | null;
|
|
1750
|
+
acceptedThroughSeq: number | null;
|
|
1751
|
+
lastClientCheckpointSeq: number | null;
|
|
1752
|
+
lastClientCheckpointHash: string | null;
|
|
1753
|
+
frozenBodyHash: string | null;
|
|
1754
|
+
stopRequestedAt: Date | null;
|
|
1755
|
+
runtimeTerminalAt: Date | null;
|
|
1756
|
+
lateEventsDropped: number;
|
|
1757
|
+
lateBytes: number;
|
|
1758
|
+
startedAt: Date;
|
|
1759
|
+
completedAt: Date | null;
|
|
1760
|
+
createdAt: Date;
|
|
1761
|
+
updatedAt: Date;
|
|
1762
|
+
} | null>;
|
|
1763
|
+
appendGenerationEvent: (input: {
|
|
1764
|
+
orgId: string;
|
|
1765
|
+
generationId: string;
|
|
1766
|
+
attemptEpoch: number;
|
|
1767
|
+
eventKind: typeof chatGenerationEvents.$inferInsert.eventKind;
|
|
1768
|
+
payload?: Record<string, unknown>;
|
|
1769
|
+
controlActionId?: string | null;
|
|
1770
|
+
queueItemId?: string | null;
|
|
1771
|
+
emittedAt?: Date | null;
|
|
1772
|
+
}) => Promise<{
|
|
1773
|
+
assistantMessageId: string | null;
|
|
1774
|
+
id: string;
|
|
1775
|
+
orgId: string;
|
|
1776
|
+
runId: string | null;
|
|
1777
|
+
payload: Record<string, unknown>;
|
|
1778
|
+
controlActionId: string | null;
|
|
1779
|
+
generationId: string;
|
|
1780
|
+
attemptEpoch: number;
|
|
1781
|
+
generationSeq: number;
|
|
1782
|
+
eventKind: import("@rudderhq/shared").ChatGenerationEventKind;
|
|
1783
|
+
bodyOffset: number | null;
|
|
1784
|
+
bodyLength: number | null;
|
|
1785
|
+
queueItemId: string | null;
|
|
1786
|
+
recordedAt: Date;
|
|
1787
|
+
emittedAt: Date | null;
|
|
1788
|
+
}>;
|
|
658
1789
|
markGenerationTerminal: (generationId: string | null | undefined, status: "completed" | "failed" | "stopped" | "aborted") => Promise<{
|
|
659
1790
|
id: string;
|
|
660
1791
|
orgId: string;
|
|
661
1792
|
conversationId: string;
|
|
662
|
-
status:
|
|
1793
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
663
1794
|
terminalReason: string | null;
|
|
1795
|
+
attemptEpoch: number;
|
|
1796
|
+
controlVersion: number;
|
|
1797
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
1798
|
+
controlRuntimeType: string | null;
|
|
1799
|
+
controlOwnerToken: string | null;
|
|
1800
|
+
controlLeaseExpiresAt: Date | null;
|
|
1801
|
+
providerThreadId: string | null;
|
|
1802
|
+
providerTurnId: string | null;
|
|
1803
|
+
acceptedThroughSeq: number | null;
|
|
1804
|
+
lastClientCheckpointSeq: number | null;
|
|
1805
|
+
lastClientCheckpointHash: string | null;
|
|
1806
|
+
frozenBodyHash: string | null;
|
|
1807
|
+
stopRequestedAt: Date | null;
|
|
1808
|
+
runtimeTerminalAt: Date | null;
|
|
1809
|
+
lateEventsDropped: number;
|
|
1810
|
+
lateBytes: number;
|
|
664
1811
|
startedAt: Date;
|
|
665
1812
|
completedAt: Date | null;
|
|
666
1813
|
createdAt: Date;
|
|
@@ -670,8 +1817,24 @@ export declare function chatService(db: Db): {
|
|
|
670
1817
|
id: string;
|
|
671
1818
|
orgId: string;
|
|
672
1819
|
conversationId: string;
|
|
673
|
-
status:
|
|
1820
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
674
1821
|
terminalReason: string | null;
|
|
1822
|
+
attemptEpoch: number;
|
|
1823
|
+
controlVersion: number;
|
|
1824
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
1825
|
+
controlRuntimeType: string | null;
|
|
1826
|
+
controlOwnerToken: string | null;
|
|
1827
|
+
controlLeaseExpiresAt: Date | null;
|
|
1828
|
+
providerThreadId: string | null;
|
|
1829
|
+
providerTurnId: string | null;
|
|
1830
|
+
acceptedThroughSeq: number | null;
|
|
1831
|
+
lastClientCheckpointSeq: number | null;
|
|
1832
|
+
lastClientCheckpointHash: string | null;
|
|
1833
|
+
frozenBodyHash: string | null;
|
|
1834
|
+
stopRequestedAt: Date | null;
|
|
1835
|
+
runtimeTerminalAt: Date | null;
|
|
1836
|
+
lateEventsDropped: number;
|
|
1837
|
+
lateBytes: number;
|
|
675
1838
|
startedAt: Date;
|
|
676
1839
|
completedAt: Date | null;
|
|
677
1840
|
createdAt: Date;
|
|
@@ -681,8 +1844,24 @@ export declare function chatService(db: Db): {
|
|
|
681
1844
|
id: string;
|
|
682
1845
|
orgId: string;
|
|
683
1846
|
conversationId: string;
|
|
684
|
-
status:
|
|
1847
|
+
status: import("@rudderhq/shared").ChatGenerationStatus;
|
|
685
1848
|
terminalReason: string | null;
|
|
1849
|
+
attemptEpoch: number;
|
|
1850
|
+
controlVersion: number;
|
|
1851
|
+
controlState: import("@rudderhq/shared").ChatGenerationControlState;
|
|
1852
|
+
controlRuntimeType: string | null;
|
|
1853
|
+
controlOwnerToken: string | null;
|
|
1854
|
+
controlLeaseExpiresAt: Date | null;
|
|
1855
|
+
providerThreadId: string | null;
|
|
1856
|
+
providerTurnId: string | null;
|
|
1857
|
+
acceptedThroughSeq: number | null;
|
|
1858
|
+
lastClientCheckpointSeq: number | null;
|
|
1859
|
+
lastClientCheckpointHash: string | null;
|
|
1860
|
+
frozenBodyHash: string | null;
|
|
1861
|
+
stopRequestedAt: Date | null;
|
|
1862
|
+
runtimeTerminalAt: Date | null;
|
|
1863
|
+
lateEventsDropped: number;
|
|
1864
|
+
lateBytes: number;
|
|
686
1865
|
startedAt: Date;
|
|
687
1866
|
completedAt: Date | null;
|
|
688
1867
|
createdAt: Date;
|
|
@@ -690,285 +1869,278 @@ export declare function chatService(db: Db): {
|
|
|
690
1869
|
}>;
|
|
691
1870
|
getQueueSnapshot: (conversationId: string, activeGenerationId?: string | null) => Promise<{
|
|
692
1871
|
activeGenerationId: string | null;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
id: string;
|
|
698
|
-
orgId: string;
|
|
699
|
-
createdAt: Date;
|
|
700
|
-
updatedAt: Date;
|
|
701
|
-
cancelledAt: Date | null;
|
|
702
|
-
sourceMessageId: string | null;
|
|
703
|
-
clientMutationId: string;
|
|
704
|
-
expectedGenerationId: string | null;
|
|
705
|
-
version: number;
|
|
706
|
-
position: number;
|
|
707
|
-
activeGenerationId: string | null;
|
|
708
|
-
deliveryAttempts: number;
|
|
709
|
-
lastAttemptAt: Date | null;
|
|
710
|
-
lastDeliveryReason: string | null;
|
|
711
|
-
deliveredMessageId: string | null;
|
|
712
|
-
steeredAt: Date | null;
|
|
713
|
-
dequeuedAt: Date | null;
|
|
714
|
-
}[];
|
|
1872
|
+
activeAttemptEpoch: number | null;
|
|
1873
|
+
activeControlVersion: number | null;
|
|
1874
|
+
activeGenerationStatus: import("@rudderhq/shared").ChatGenerationStatus | null;
|
|
1875
|
+
items: ChatQueuedMessage[];
|
|
715
1876
|
}>;
|
|
716
|
-
listQueuedMessages: (conversationId: string) => Promise<
|
|
717
|
-
payload: ChatQueuedMessagePayload;
|
|
718
|
-
status: string;
|
|
719
|
-
conversationId: string;
|
|
720
|
-
id: string;
|
|
721
|
-
orgId: string;
|
|
722
|
-
createdAt: Date;
|
|
723
|
-
updatedAt: Date;
|
|
724
|
-
cancelledAt: Date | null;
|
|
725
|
-
sourceMessageId: string | null;
|
|
726
|
-
clientMutationId: string;
|
|
727
|
-
expectedGenerationId: string | null;
|
|
728
|
-
version: number;
|
|
729
|
-
position: number;
|
|
730
|
-
activeGenerationId: string | null;
|
|
731
|
-
deliveryAttempts: number;
|
|
732
|
-
lastAttemptAt: Date | null;
|
|
733
|
-
lastDeliveryReason: string | null;
|
|
734
|
-
deliveredMessageId: string | null;
|
|
735
|
-
steeredAt: Date | null;
|
|
736
|
-
dequeuedAt: Date | null;
|
|
737
|
-
}[]>;
|
|
1877
|
+
listQueuedMessages: (conversationId: string) => Promise<ChatQueuedMessage[]>;
|
|
738
1878
|
createQueuedMessage: (input: {
|
|
739
1879
|
orgId: string;
|
|
740
1880
|
conversationId: string;
|
|
741
1881
|
clientMutationId: string;
|
|
742
1882
|
payload: ChatQueuedMessagePayload;
|
|
743
1883
|
expectedGenerationId?: string | null;
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
status: string;
|
|
747
|
-
conversationId: string;
|
|
748
|
-
id: string;
|
|
749
|
-
orgId: string;
|
|
750
|
-
createdAt: Date;
|
|
751
|
-
updatedAt: Date;
|
|
752
|
-
cancelledAt: Date | null;
|
|
753
|
-
sourceMessageId: string | null;
|
|
754
|
-
clientMutationId: string;
|
|
755
|
-
expectedGenerationId: string | null;
|
|
756
|
-
version: number;
|
|
757
|
-
position: number;
|
|
758
|
-
activeGenerationId: string | null;
|
|
759
|
-
deliveryAttempts: number;
|
|
760
|
-
lastAttemptAt: Date | null;
|
|
761
|
-
lastDeliveryReason: string | null;
|
|
762
|
-
deliveredMessageId: string | null;
|
|
763
|
-
steeredAt: Date | null;
|
|
764
|
-
dequeuedAt: Date | null;
|
|
765
|
-
}>;
|
|
1884
|
+
requestActor?: ChatQueueRequestActor | null;
|
|
1885
|
+
}) => Promise<ChatQueuedMessage>;
|
|
766
1886
|
updateQueuedMessage: (input: {
|
|
767
1887
|
conversationId: string;
|
|
768
1888
|
itemId: string;
|
|
769
1889
|
version: number;
|
|
770
1890
|
payload: ChatQueuedMessagePayload;
|
|
771
|
-
}) => Promise<
|
|
772
|
-
payload: ChatQueuedMessagePayload;
|
|
773
|
-
status: string;
|
|
774
|
-
conversationId: string;
|
|
775
|
-
id: string;
|
|
776
|
-
orgId: string;
|
|
777
|
-
createdAt: Date;
|
|
778
|
-
updatedAt: Date;
|
|
779
|
-
cancelledAt: Date | null;
|
|
780
|
-
sourceMessageId: string | null;
|
|
781
|
-
clientMutationId: string;
|
|
782
|
-
expectedGenerationId: string | null;
|
|
783
|
-
version: number;
|
|
784
|
-
position: number;
|
|
785
|
-
activeGenerationId: string | null;
|
|
786
|
-
deliveryAttempts: number;
|
|
787
|
-
lastAttemptAt: Date | null;
|
|
788
|
-
lastDeliveryReason: string | null;
|
|
789
|
-
deliveredMessageId: string | null;
|
|
790
|
-
steeredAt: Date | null;
|
|
791
|
-
dequeuedAt: Date | null;
|
|
792
|
-
}>;
|
|
1891
|
+
}) => Promise<ChatQueuedMessage>;
|
|
793
1892
|
cancelQueuedMessage: (input: {
|
|
794
1893
|
conversationId: string;
|
|
795
1894
|
itemId: string;
|
|
796
1895
|
version?: number | null;
|
|
797
|
-
}) => Promise<
|
|
798
|
-
|
|
799
|
-
status: string;
|
|
800
|
-
conversationId: string;
|
|
801
|
-
id: string;
|
|
1896
|
+
}) => Promise<ChatQueuedMessage>;
|
|
1897
|
+
scheduleSteerContinuation: (input: {
|
|
802
1898
|
orgId: string;
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
1899
|
+
conversationId: string;
|
|
1900
|
+
itemId: string;
|
|
1901
|
+
controlActionId: string;
|
|
1902
|
+
requestActor?: ChatQueueRequestActor | null;
|
|
1903
|
+
}) => Promise<{
|
|
1904
|
+
action: {
|
|
1905
|
+
id: string;
|
|
1906
|
+
orgId: string;
|
|
1907
|
+
expectedGenerationId: string | null;
|
|
1908
|
+
expectedAttemptEpoch: number | null;
|
|
1909
|
+
expectedControlVersion: number | null;
|
|
1910
|
+
appliedControlVersion: number | null;
|
|
1911
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
1912
|
+
localDisposition: ChatControlDisposition;
|
|
1913
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
1914
|
+
controlOwnerToken: string | null;
|
|
1915
|
+
providerClientMessageId: string | null;
|
|
1916
|
+
providerThreadId: string | null;
|
|
1917
|
+
providerTurnId: string | null;
|
|
1918
|
+
providerEvidence: Record<string, unknown> | null;
|
|
1919
|
+
requestedRenderSeq: number | null;
|
|
1920
|
+
requestedBodyHash: string | null;
|
|
1921
|
+
acceptedThroughSeq: number | null;
|
|
1922
|
+
frozenBodyHash: string | null;
|
|
1923
|
+
lastError: string | null;
|
|
1924
|
+
requestedAt: Date;
|
|
1925
|
+
providerSentAt: Date | null;
|
|
1926
|
+
providerAcknowledgedAt: Date | null;
|
|
1927
|
+
resolvedAt: Date | null;
|
|
1928
|
+
createdAt: Date;
|
|
1929
|
+
updatedAt: Date;
|
|
1930
|
+
};
|
|
1931
|
+
item: ChatQueuedMessage;
|
|
1932
|
+
idempotent: boolean;
|
|
818
1933
|
}>;
|
|
819
1934
|
markQueuedMessageSteerFallback: (input: {
|
|
820
1935
|
conversationId: string;
|
|
821
1936
|
itemId: string;
|
|
822
1937
|
reason: "unsupported" | "stale_generation" | "closing";
|
|
823
1938
|
activeGenerationId?: string | null;
|
|
824
|
-
}) => Promise<
|
|
825
|
-
|
|
826
|
-
|
|
1939
|
+
}) => Promise<ChatQueuedMessage>;
|
|
1940
|
+
beginSteerControlAction: (input: {
|
|
1941
|
+
orgId: string;
|
|
827
1942
|
conversationId: string;
|
|
1943
|
+
itemId: string;
|
|
1944
|
+
controlActionId: string;
|
|
1945
|
+
expectedGenerationId: string;
|
|
1946
|
+
expectedAttemptEpoch: number;
|
|
1947
|
+
expectedControlVersion: number;
|
|
1948
|
+
requestActor?: ChatQueueRequestActor | null;
|
|
1949
|
+
}) => Promise<{
|
|
1950
|
+
action: ChatControlActionRow;
|
|
1951
|
+
item: ReturnType<(row: ChatQueuedMessageRow) => ChatQueuedMessage>;
|
|
1952
|
+
generation: ChatGenerationRow | null;
|
|
1953
|
+
idempotent: boolean;
|
|
1954
|
+
}>;
|
|
1955
|
+
claimSteerProviderSend: (input: {
|
|
1956
|
+
orgId: string;
|
|
1957
|
+
controlActionId: string;
|
|
1958
|
+
}) => Promise<{
|
|
828
1959
|
id: string;
|
|
829
1960
|
orgId: string;
|
|
1961
|
+
expectedGenerationId: string | null;
|
|
1962
|
+
expectedAttemptEpoch: number | null;
|
|
1963
|
+
expectedControlVersion: number | null;
|
|
1964
|
+
appliedControlVersion: number | null;
|
|
1965
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
1966
|
+
localDisposition: ChatControlDisposition;
|
|
1967
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
1968
|
+
controlOwnerToken: string | null;
|
|
1969
|
+
providerClientMessageId: string | null;
|
|
1970
|
+
providerThreadId: string | null;
|
|
1971
|
+
providerTurnId: string | null;
|
|
1972
|
+
providerEvidence: Record<string, unknown> | null;
|
|
1973
|
+
requestedRenderSeq: number | null;
|
|
1974
|
+
requestedBodyHash: string | null;
|
|
1975
|
+
acceptedThroughSeq: number | null;
|
|
1976
|
+
frozenBodyHash: string | null;
|
|
1977
|
+
lastError: string | null;
|
|
1978
|
+
requestedAt: Date;
|
|
1979
|
+
providerSentAt: Date | null;
|
|
1980
|
+
providerAcknowledgedAt: Date | null;
|
|
1981
|
+
resolvedAt: Date | null;
|
|
830
1982
|
createdAt: Date;
|
|
831
1983
|
updatedAt: Date;
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
1984
|
+
} | {
|
|
1985
|
+
sendDenied: true;
|
|
1986
|
+
reason: string;
|
|
1987
|
+
action: {
|
|
1988
|
+
id: string;
|
|
1989
|
+
orgId: string;
|
|
1990
|
+
expectedGenerationId: string | null;
|
|
1991
|
+
expectedAttemptEpoch: number | null;
|
|
1992
|
+
expectedControlVersion: number | null;
|
|
1993
|
+
appliedControlVersion: number | null;
|
|
1994
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
1995
|
+
localDisposition: ChatControlDisposition;
|
|
1996
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
1997
|
+
controlOwnerToken: string | null;
|
|
1998
|
+
providerClientMessageId: string | null;
|
|
1999
|
+
providerThreadId: string | null;
|
|
2000
|
+
providerTurnId: string | null;
|
|
2001
|
+
providerEvidence: Record<string, unknown> | null;
|
|
2002
|
+
requestedRenderSeq: number | null;
|
|
2003
|
+
requestedBodyHash: string | null;
|
|
2004
|
+
acceptedThroughSeq: number | null;
|
|
2005
|
+
frozenBodyHash: string | null;
|
|
2006
|
+
lastError: string | null;
|
|
2007
|
+
requestedAt: Date;
|
|
2008
|
+
providerSentAt: Date | null;
|
|
2009
|
+
providerAcknowledgedAt: Date | null;
|
|
2010
|
+
resolvedAt: Date | null;
|
|
2011
|
+
createdAt: Date;
|
|
2012
|
+
updatedAt: Date;
|
|
2013
|
+
};
|
|
2014
|
+
item: ChatQueuedMessage;
|
|
2015
|
+
} | null>;
|
|
2016
|
+
releaseSteerProviderSendClaim: (input: {
|
|
2017
|
+
orgId: string;
|
|
2018
|
+
controlActionId: string;
|
|
2019
|
+
reason: string;
|
|
2020
|
+
}) => Promise<{
|
|
850
2021
|
id: string;
|
|
851
2022
|
orgId: string;
|
|
2023
|
+
expectedGenerationId: string | null;
|
|
2024
|
+
expectedAttemptEpoch: number | null;
|
|
2025
|
+
expectedControlVersion: number | null;
|
|
2026
|
+
appliedControlVersion: number | null;
|
|
2027
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
2028
|
+
localDisposition: ChatControlDisposition;
|
|
2029
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
2030
|
+
controlOwnerToken: string | null;
|
|
2031
|
+
providerClientMessageId: string | null;
|
|
2032
|
+
providerThreadId: string | null;
|
|
2033
|
+
providerTurnId: string | null;
|
|
2034
|
+
providerEvidence: Record<string, unknown> | null;
|
|
2035
|
+
requestedRenderSeq: number | null;
|
|
2036
|
+
requestedBodyHash: string | null;
|
|
2037
|
+
acceptedThroughSeq: number | null;
|
|
2038
|
+
frozenBodyHash: string | null;
|
|
2039
|
+
lastError: string | null;
|
|
2040
|
+
requestedAt: Date;
|
|
2041
|
+
providerSentAt: Date | null;
|
|
2042
|
+
providerAcknowledgedAt: Date | null;
|
|
2043
|
+
resolvedAt: Date | null;
|
|
852
2044
|
createdAt: Date;
|
|
853
2045
|
updatedAt: Date;
|
|
854
|
-
cancelledAt: Date | null;
|
|
855
|
-
sourceMessageId: string | null;
|
|
856
|
-
clientMutationId: string;
|
|
857
|
-
expectedGenerationId: string | null;
|
|
858
|
-
version: number;
|
|
859
|
-
position: number;
|
|
860
|
-
activeGenerationId: string | null;
|
|
861
|
-
deliveryAttempts: number;
|
|
862
|
-
lastAttemptAt: Date | null;
|
|
863
|
-
lastDeliveryReason: string | null;
|
|
864
|
-
deliveredMessageId: string | null;
|
|
865
|
-
steeredAt: Date | null;
|
|
866
|
-
dequeuedAt: Date | null;
|
|
867
2046
|
} | null>;
|
|
868
|
-
|
|
2047
|
+
resolveSteerControlAction: (input: {
|
|
2048
|
+
orgId: string;
|
|
869
2049
|
conversationId: string;
|
|
870
2050
|
itemId: string;
|
|
871
|
-
|
|
2051
|
+
controlActionId: string;
|
|
2052
|
+
status: Extract<ChatQueuedMessageStatus, "steer_pending" | "accepted_current" | "acceptance_unknown" | "continuation_pending" | "failed_actionable">;
|
|
2053
|
+
disposition: Extract<ChatControlDisposition, "pending" | "accepted_current" | "acceptance_unknown" | "continuation_pending" | "failed_actionable">;
|
|
2054
|
+
providerDisposition: ChatProviderControlDisposition;
|
|
2055
|
+
providerThreadId?: string | null;
|
|
2056
|
+
providerTurnId?: string | null;
|
|
2057
|
+
providerEvidence?: Record<string, unknown> | null;
|
|
2058
|
+
reason?: string | null;
|
|
872
2059
|
}) => Promise<{
|
|
873
|
-
|
|
874
|
-
|
|
2060
|
+
action: {
|
|
2061
|
+
id: string;
|
|
2062
|
+
orgId: string;
|
|
2063
|
+
expectedGenerationId: string | null;
|
|
2064
|
+
expectedAttemptEpoch: number | null;
|
|
2065
|
+
expectedControlVersion: number | null;
|
|
2066
|
+
appliedControlVersion: number | null;
|
|
2067
|
+
actionKind: import("@rudderhq/shared").ChatControlActionKind;
|
|
2068
|
+
localDisposition: ChatControlDisposition;
|
|
2069
|
+
providerDisposition: ChatProviderControlDisposition | null;
|
|
2070
|
+
controlOwnerToken: string | null;
|
|
2071
|
+
providerClientMessageId: string | null;
|
|
2072
|
+
providerThreadId: string | null;
|
|
2073
|
+
providerTurnId: string | null;
|
|
2074
|
+
providerEvidence: Record<string, unknown> | null;
|
|
2075
|
+
requestedRenderSeq: number | null;
|
|
2076
|
+
requestedBodyHash: string | null;
|
|
2077
|
+
acceptedThroughSeq: number | null;
|
|
2078
|
+
frozenBodyHash: string | null;
|
|
2079
|
+
lastError: string | null;
|
|
2080
|
+
requestedAt: Date;
|
|
2081
|
+
providerSentAt: Date | null;
|
|
2082
|
+
providerAcknowledgedAt: Date | null;
|
|
2083
|
+
resolvedAt: Date | null;
|
|
2084
|
+
createdAt: Date;
|
|
2085
|
+
updatedAt: Date;
|
|
2086
|
+
};
|
|
2087
|
+
item: ChatQueuedMessage;
|
|
2088
|
+
applied: boolean;
|
|
2089
|
+
}>;
|
|
2090
|
+
claimNextServerQueuedMessage: (input: {
|
|
2091
|
+
workerId: string;
|
|
2092
|
+
leaseMs: number;
|
|
2093
|
+
now?: Date;
|
|
2094
|
+
}) => Promise<ChatServerQueueClaim | null>;
|
|
2095
|
+
renewServerQueuedMessageClaim: (input: {
|
|
2096
|
+
itemId: string;
|
|
2097
|
+
generationId: string;
|
|
2098
|
+
leaseToken: string;
|
|
2099
|
+
leaseEpoch: number;
|
|
2100
|
+
leaseMs: number;
|
|
2101
|
+
now?: Date;
|
|
2102
|
+
}) => Promise<boolean>;
|
|
2103
|
+
completeServerQueuedMessageDelivery: (input: {
|
|
2104
|
+
itemId: string;
|
|
2105
|
+
generationId: string;
|
|
2106
|
+
leaseToken: string;
|
|
2107
|
+
leaseEpoch: number;
|
|
2108
|
+
status: "completed" | "failed" | "stopped" | "aborted";
|
|
2109
|
+
reason?: string | null;
|
|
2110
|
+
}) => Promise<ChatQueuedMessage | null>;
|
|
2111
|
+
releaseServerQueuedMessageClaim: (input: {
|
|
2112
|
+
itemId: string;
|
|
2113
|
+
generationId: string;
|
|
2114
|
+
leaseToken: string;
|
|
2115
|
+
leaseEpoch: number;
|
|
2116
|
+
reason: string;
|
|
2117
|
+
}) => Promise<ChatQueuedMessage | null>;
|
|
2118
|
+
recoverExpiredServerQueueClaims: (now?: Date) => Promise<{
|
|
2119
|
+
inspected: number;
|
|
2120
|
+
requeued: number;
|
|
2121
|
+
ambiguous: number;
|
|
2122
|
+
}>;
|
|
2123
|
+
claimNextQueuedMessage: (conversationId: string) => Promise<ChatQueuedMessage | null>;
|
|
2124
|
+
releaseQueuedMessageClaim: (input: {
|
|
875
2125
|
conversationId: string;
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
updatedAt: Date;
|
|
880
|
-
cancelledAt: Date | null;
|
|
881
|
-
sourceMessageId: string | null;
|
|
882
|
-
clientMutationId: string;
|
|
883
|
-
expectedGenerationId: string | null;
|
|
884
|
-
version: number;
|
|
885
|
-
position: number;
|
|
886
|
-
activeGenerationId: string | null;
|
|
887
|
-
deliveryAttempts: number;
|
|
888
|
-
lastAttemptAt: Date | null;
|
|
889
|
-
lastDeliveryReason: string | null;
|
|
890
|
-
deliveredMessageId: string | null;
|
|
891
|
-
steeredAt: Date | null;
|
|
892
|
-
dequeuedAt: Date | null;
|
|
893
|
-
} | null>;
|
|
2126
|
+
itemId: string;
|
|
2127
|
+
reason: "delivery_failed" | "delivery_aborted" | "claim_expired";
|
|
2128
|
+
}) => Promise<ChatQueuedMessage | null>;
|
|
894
2129
|
assertQueuedMessageClaimedForDelivery: (input: {
|
|
895
2130
|
conversationId: string;
|
|
896
2131
|
itemId: string;
|
|
897
2132
|
body: string;
|
|
898
|
-
}) => Promise<
|
|
899
|
-
payload: ChatQueuedMessagePayload;
|
|
900
|
-
status: string;
|
|
901
|
-
conversationId: string;
|
|
902
|
-
id: string;
|
|
903
|
-
orgId: string;
|
|
904
|
-
createdAt: Date;
|
|
905
|
-
updatedAt: Date;
|
|
906
|
-
cancelledAt: Date | null;
|
|
907
|
-
sourceMessageId: string | null;
|
|
908
|
-
clientMutationId: string;
|
|
909
|
-
expectedGenerationId: string | null;
|
|
910
|
-
version: number;
|
|
911
|
-
position: number;
|
|
912
|
-
activeGenerationId: string | null;
|
|
913
|
-
deliveryAttempts: number;
|
|
914
|
-
lastAttemptAt: Date | null;
|
|
915
|
-
lastDeliveryReason: string | null;
|
|
916
|
-
deliveredMessageId: string | null;
|
|
917
|
-
steeredAt: Date | null;
|
|
918
|
-
dequeuedAt: Date | null;
|
|
919
|
-
}>;
|
|
2133
|
+
}) => Promise<ChatQueuedMessage>;
|
|
920
2134
|
markQueuedMessageRunning: (input: {
|
|
921
2135
|
conversationId: string;
|
|
922
2136
|
itemId: string;
|
|
923
2137
|
sourceMessageId: string;
|
|
924
|
-
}) => Promise<
|
|
925
|
-
payload: ChatQueuedMessagePayload;
|
|
926
|
-
status: string;
|
|
927
|
-
conversationId: string;
|
|
928
|
-
id: string;
|
|
929
|
-
orgId: string;
|
|
930
|
-
createdAt: Date;
|
|
931
|
-
updatedAt: Date;
|
|
932
|
-
cancelledAt: Date | null;
|
|
933
|
-
sourceMessageId: string | null;
|
|
934
|
-
clientMutationId: string;
|
|
935
|
-
expectedGenerationId: string | null;
|
|
936
|
-
version: number;
|
|
937
|
-
position: number;
|
|
938
|
-
activeGenerationId: string | null;
|
|
939
|
-
deliveryAttempts: number;
|
|
940
|
-
lastAttemptAt: Date | null;
|
|
941
|
-
lastDeliveryReason: string | null;
|
|
942
|
-
deliveredMessageId: string | null;
|
|
943
|
-
steeredAt: Date | null;
|
|
944
|
-
dequeuedAt: Date | null;
|
|
945
|
-
}>;
|
|
2138
|
+
}) => Promise<ChatQueuedMessage>;
|
|
946
2139
|
markQueuedMessageDeliveryTerminal: (input: {
|
|
947
2140
|
conversationId: string;
|
|
948
2141
|
itemId: string;
|
|
949
2142
|
status: "completed" | "failed" | "stopped" | "aborted";
|
|
950
|
-
}) => Promise<
|
|
951
|
-
payload: ChatQueuedMessagePayload;
|
|
952
|
-
status: string;
|
|
953
|
-
conversationId: string;
|
|
954
|
-
id: string;
|
|
955
|
-
orgId: string;
|
|
956
|
-
createdAt: Date;
|
|
957
|
-
updatedAt: Date;
|
|
958
|
-
cancelledAt: Date | null;
|
|
959
|
-
sourceMessageId: string | null;
|
|
960
|
-
clientMutationId: string;
|
|
961
|
-
expectedGenerationId: string | null;
|
|
962
|
-
version: number;
|
|
963
|
-
position: number;
|
|
964
|
-
activeGenerationId: string | null;
|
|
965
|
-
deliveryAttempts: number;
|
|
966
|
-
lastAttemptAt: Date | null;
|
|
967
|
-
lastDeliveryReason: string | null;
|
|
968
|
-
deliveredMessageId: string | null;
|
|
969
|
-
steeredAt: Date | null;
|
|
970
|
-
dequeuedAt: Date | null;
|
|
971
|
-
} | null>;
|
|
2143
|
+
}) => Promise<ChatQueuedMessage | null>;
|
|
972
2144
|
listMessages: (conversationId: string, options?: {
|
|
973
2145
|
includeTranscript?: boolean;
|
|
974
2146
|
}) => Promise<{
|
|
@@ -982,8 +2154,8 @@ export declare function chatService(db: Db): {
|
|
|
982
2154
|
createdAt: Date;
|
|
983
2155
|
updatedAt: Date;
|
|
984
2156
|
type: string;
|
|
985
|
-
decisionNote: string | null;
|
|
986
2157
|
payload: Record<string, unknown>;
|
|
2158
|
+
decisionNote: string | null;
|
|
987
2159
|
requestedByAgentId: string | null;
|
|
988
2160
|
decidedByUserId: string | null;
|
|
989
2161
|
requestedByUserId: string | null;
|
|
@@ -1034,8 +2206,8 @@ export declare function chatService(db: Db): {
|
|
|
1034
2206
|
createdAt: Date;
|
|
1035
2207
|
updatedAt: Date;
|
|
1036
2208
|
type: string;
|
|
1037
|
-
decisionNote: string | null;
|
|
1038
2209
|
payload: Record<string, unknown>;
|
|
2210
|
+
decisionNote: string | null;
|
|
1039
2211
|
requestedByAgentId: string | null;
|
|
1040
2212
|
decidedByUserId: string | null;
|
|
1041
2213
|
requestedByUserId: string | null;
|
|
@@ -1078,8 +2250,8 @@ export declare function chatService(db: Db): {
|
|
|
1078
2250
|
createdAt: Date;
|
|
1079
2251
|
updatedAt: Date;
|
|
1080
2252
|
type: string;
|
|
1081
|
-
decisionNote: string | null;
|
|
1082
2253
|
payload: Record<string, unknown>;
|
|
2254
|
+
decisionNote: string | null;
|
|
1083
2255
|
requestedByAgentId: string | null;
|
|
1084
2256
|
decidedByUserId: string | null;
|
|
1085
2257
|
requestedByUserId: string | null;
|
|
@@ -1113,8 +2285,8 @@ export declare function chatService(db: Db): {
|
|
|
1113
2285
|
createdAt: Date;
|
|
1114
2286
|
updatedAt: Date;
|
|
1115
2287
|
type: string;
|
|
1116
|
-
decisionNote: string | null;
|
|
1117
2288
|
payload: Record<string, unknown>;
|
|
2289
|
+
decisionNote: string | null;
|
|
1118
2290
|
requestedByAgentId: string | null;
|
|
1119
2291
|
decidedByUserId: string | null;
|
|
1120
2292
|
requestedByUserId: string | null;
|
|
@@ -1150,8 +2322,8 @@ export declare function chatService(db: Db): {
|
|
|
1150
2322
|
createdAt: Date;
|
|
1151
2323
|
updatedAt: Date;
|
|
1152
2324
|
type: string;
|
|
1153
|
-
decisionNote: string | null;
|
|
1154
2325
|
payload: Record<string, unknown>;
|
|
2326
|
+
decisionNote: string | null;
|
|
1155
2327
|
requestedByAgentId: string | null;
|
|
1156
2328
|
decidedByUserId: string | null;
|
|
1157
2329
|
requestedByUserId: string | null;
|
|
@@ -1238,13 +2410,12 @@ export declare function chatService(db: Db): {
|
|
|
1238
2410
|
unreadCount: number;
|
|
1239
2411
|
isUnread: boolean;
|
|
1240
2412
|
needsAttention: boolean;
|
|
1241
|
-
title: string;
|
|
1242
2413
|
status: string;
|
|
2414
|
+
title: string;
|
|
1243
2415
|
id: string;
|
|
1244
2416
|
orgId: string;
|
|
1245
2417
|
createdAt: Date;
|
|
1246
2418
|
updatedAt: Date;
|
|
1247
|
-
createdByUserId: string | null;
|
|
1248
2419
|
summary: string | null;
|
|
1249
2420
|
preferredAgentId: string | null;
|
|
1250
2421
|
issueCreationMode: string;
|
|
@@ -1252,6 +2423,14 @@ export declare function chatService(db: Db): {
|
|
|
1252
2423
|
routedAgentId: string | null;
|
|
1253
2424
|
primaryIssueId: string | null;
|
|
1254
2425
|
resolvedAt: Date | null;
|
|
2426
|
+
createdByUserId: string | null;
|
|
2427
|
+
conversationKind: string;
|
|
2428
|
+
messengerVisible: boolean;
|
|
2429
|
+
sideChatState: string | null;
|
|
2430
|
+
sideChatExpiresAt: Date | null;
|
|
2431
|
+
sideChatCompletedAt: Date | null;
|
|
2432
|
+
sideChatKeptAt: Date | null;
|
|
2433
|
+
sideChatClientMutationId: string | null;
|
|
1255
2434
|
forkedFromConversationId: string | null;
|
|
1256
2435
|
forkedFromMessageId: string | null;
|
|
1257
2436
|
forkRootConversationId: string | null;
|
|
@@ -1304,8 +2483,8 @@ export declare function chatService(db: Db): {
|
|
|
1304
2483
|
createdAt: Date;
|
|
1305
2484
|
updatedAt: Date;
|
|
1306
2485
|
type: string;
|
|
1307
|
-
decisionNote: string | null;
|
|
1308
2486
|
payload: Record<string, unknown>;
|
|
2487
|
+
decisionNote: string | null;
|
|
1309
2488
|
requestedByAgentId: string | null;
|
|
1310
2489
|
decidedByUserId: string | null;
|
|
1311
2490
|
requestedByUserId: string | null;
|
|
@@ -1330,16 +2509,16 @@ export declare function chatService(db: Db): {
|
|
|
1330
2509
|
} | null>;
|
|
1331
2510
|
applyApprovedApproval: (approval: ApprovalRow, actorUserId: string | null) => Promise<Omit<{
|
|
1332
2511
|
permissions: import("./agent-permissions.js").NormalizedAgentPermissions;
|
|
2512
|
+
status: string;
|
|
1333
2513
|
icon: string | null;
|
|
1334
2514
|
title: string | null;
|
|
1335
|
-
status: string;
|
|
1336
2515
|
id: string;
|
|
1337
2516
|
orgId: string;
|
|
1338
2517
|
createdAt: Date;
|
|
1339
2518
|
updatedAt: Date;
|
|
1340
2519
|
name: string;
|
|
1341
|
-
agentRuntimeType: string;
|
|
1342
2520
|
metadata: Record<string, unknown> | null;
|
|
2521
|
+
agentRuntimeType: string;
|
|
1343
2522
|
agentRuntimeConfig: Record<string, unknown>;
|
|
1344
2523
|
budgetMonthlyCents: number;
|
|
1345
2524
|
spentMonthlyCents: number;
|
|
@@ -1391,8 +2570,8 @@ export declare function chatService(db: Db): {
|
|
|
1391
2570
|
createdAt: Date;
|
|
1392
2571
|
updatedAt: Date;
|
|
1393
2572
|
type: string;
|
|
1394
|
-
decisionNote: string | null;
|
|
1395
2573
|
payload: Record<string, unknown>;
|
|
2574
|
+
decisionNote: string | null;
|
|
1396
2575
|
requestedByAgentId: string | null;
|
|
1397
2576
|
decidedByUserId: string | null;
|
|
1398
2577
|
requestedByUserId: string | null;
|
|
@@ -1414,8 +2593,8 @@ export declare function chatService(db: Db): {
|
|
|
1414
2593
|
createdAt: Date;
|
|
1415
2594
|
updatedAt: Date;
|
|
1416
2595
|
type: string;
|
|
1417
|
-
decisionNote: string | null;
|
|
1418
2596
|
payload: Record<string, unknown>;
|
|
2597
|
+
decisionNote: string | null;
|
|
1419
2598
|
requestedByAgentId: string | null;
|
|
1420
2599
|
decidedByUserId: string | null;
|
|
1421
2600
|
requestedByUserId: string | null;
|
|
@@ -1449,8 +2628,8 @@ export declare function chatService(db: Db): {
|
|
|
1449
2628
|
createdAt: Date;
|
|
1450
2629
|
updatedAt: Date;
|
|
1451
2630
|
type: string;
|
|
1452
|
-
decisionNote: string | null;
|
|
1453
2631
|
payload: Record<string, unknown>;
|
|
2632
|
+
decisionNote: string | null;
|
|
1454
2633
|
requestedByAgentId: string | null;
|
|
1455
2634
|
decidedByUserId: string | null;
|
|
1456
2635
|
requestedByUserId: string | null;
|