@nocobase/app-plugin-agents 0.0.0-stage → 0.1.0-beta.10
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/CHANGELOG.md +464 -0
- package/README.md +234 -2
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +9 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/runner-token.d.ts +21 -0
- package/dist/cli/runner-token.d.ts.map +1 -0
- package/dist/cli/runner-token.js +52 -0
- package/dist/cli/runner-token.js.map +1 -0
- package/dist/client/api/client.d.ts +139 -0
- package/dist/client/api/client.d.ts.map +1 -0
- package/dist/client/api/client.js +278 -0
- package/dist/client/api/client.js.map +1 -0
- package/dist/client/api/keys.d.ts +31 -0
- package/dist/client/api/keys.d.ts.map +1 -0
- package/dist/client/api/keys.js +40 -0
- package/dist/client/api/keys.js.map +1 -0
- package/dist/client/api/runners.d.ts +24 -0
- package/dist/client/api/runners.d.ts.map +1 -0
- package/dist/client/api/runners.js +58 -0
- package/dist/client/api/runners.js.map +1 -0
- package/dist/client/chat/api.d.ts +37 -0
- package/dist/client/chat/api.d.ts.map +1 -0
- package/dist/client/chat/api.js +118 -0
- package/dist/client/chat/api.js.map +1 -0
- package/dist/client/chat/consultation-identity.d.ts +7 -0
- package/dist/client/chat/consultation-identity.d.ts.map +1 -0
- package/dist/client/chat/consultation-identity.js +39 -0
- package/dist/client/chat/consultation-identity.js.map +1 -0
- package/dist/client/chat/context-model.d.ts +67 -0
- package/dist/client/chat/context-model.d.ts.map +1 -0
- package/dist/client/chat/context-model.js +113 -0
- package/dist/client/chat/context-model.js.map +1 -0
- package/dist/client/chat/extensions.d.ts +41 -0
- package/dist/client/chat/extensions.d.ts.map +1 -0
- package/dist/client/chat/extensions.js +14 -0
- package/dist/client/chat/extensions.js.map +1 -0
- package/dist/client/chat/keys.d.ts +13 -0
- package/dist/client/chat/keys.d.ts.map +1 -0
- package/dist/client/chat/keys.js +12 -0
- package/dist/client/chat/keys.js.map +1 -0
- package/dist/client/chat/message-model.d.ts +113 -0
- package/dist/client/chat/message-model.d.ts.map +1 -0
- package/dist/client/chat/message-model.js +228 -0
- package/dist/client/chat/message-model.js.map +1 -0
- package/dist/client/chat/panel-state.d.ts +43 -0
- package/dist/client/chat/panel-state.d.ts.map +1 -0
- package/dist/client/chat/panel-state.js +113 -0
- package/dist/client/chat/panel-state.js.map +1 -0
- package/dist/client/chat/provider.d.ts +101 -0
- package/dist/client/chat/provider.d.ts.map +1 -0
- package/dist/client/chat/provider.js +399 -0
- package/dist/client/chat/provider.js.map +1 -0
- package/dist/client/chat/redirect.d.ts +8 -0
- package/dist/client/chat/redirect.d.ts.map +1 -0
- package/dist/client/chat/redirect.js +34 -0
- package/dist/client/chat/redirect.js.map +1 -0
- package/dist/client/chat/ui-hooks.d.ts +16 -0
- package/dist/client/chat/ui-hooks.d.ts.map +1 -0
- package/dist/client/chat/ui-hooks.js +35 -0
- package/dist/client/chat/ui-hooks.js.map +1 -0
- package/dist/client/chat/use-chat.d.ts +80 -0
- package/dist/client/chat/use-chat.d.ts.map +1 -0
- package/dist/client/chat/use-chat.js +392 -0
- package/dist/client/chat/use-chat.js.map +1 -0
- package/dist/client/chat.d.ts +44 -0
- package/dist/client/chat.d.ts.map +1 -0
- package/dist/client/chat.js +46 -0
- package/dist/client/chat.js.map +1 -0
- package/dist/client/components/ag-markdown.d.ts +7 -0
- package/dist/client/components/ag-markdown.d.ts.map +1 -0
- package/dist/client/components/ag-markdown.js +29 -0
- package/dist/client/components/ag-markdown.js.map +1 -0
- package/dist/client/components/ag-multi-select.d.ts +26 -0
- package/dist/client/components/ag-multi-select.d.ts.map +1 -0
- package/dist/client/components/ag-multi-select.js +48 -0
- package/dist/client/components/ag-multi-select.js.map +1 -0
- package/dist/client/components/ag-pulse.d.ts +4 -0
- package/dist/client/components/ag-pulse.d.ts.map +1 -0
- package/dist/client/components/ag-pulse.js +6 -0
- package/dist/client/components/ag-pulse.js.map +1 -0
- package/dist/client/components/ag-section.d.ts +11 -0
- package/dist/client/components/ag-section.d.ts.map +1 -0
- package/dist/client/components/ag-section.js +7 -0
- package/dist/client/components/ag-section.js.map +1 -0
- package/dist/client/components/ag-states.d.ts +27 -0
- package/dist/client/components/ag-states.d.ts.map +1 -0
- package/dist/client/components/ag-states.js +33 -0
- package/dist/client/components/ag-states.js.map +1 -0
- package/dist/client/components/ag-tag.d.ts +9 -0
- package/dist/client/components/ag-tag.d.ts.map +1 -0
- package/dist/client/components/ag-tag.js +20 -0
- package/dist/client/components/ag-tag.js.map +1 -0
- package/dist/client/components/agent-avatar.d.ts +16 -0
- package/dist/client/components/agent-avatar.d.ts.map +1 -0
- package/dist/client/components/agent-avatar.js +48 -0
- package/dist/client/components/agent-avatar.js.map +1 -0
- package/dist/client/components/agent-picker.d.ts +111 -0
- package/dist/client/components/agent-picker.d.ts.map +1 -0
- package/dist/client/components/agent-picker.js +130 -0
- package/dist/client/components/agent-picker.js.map +1 -0
- package/dist/client/components/availability-dot.d.ts +8 -0
- package/dist/client/components/availability-dot.d.ts.map +1 -0
- package/dist/client/components/availability-dot.js +15 -0
- package/dist/client/components/availability-dot.js.map +1 -0
- package/dist/client/components/brief-view.d.ts +6 -0
- package/dist/client/components/brief-view.d.ts.map +1 -0
- package/dist/client/components/brief-view.js +34 -0
- package/dist/client/components/brief-view.js.map +1 -0
- package/dist/client/components/command-line.d.ts +6 -0
- package/dist/client/components/command-line.d.ts.map +1 -0
- package/dist/client/components/command-line.js +24 -0
- package/dist/client/components/command-line.js.map +1 -0
- package/dist/client/components/default-skills.d.ts +10 -0
- package/dist/client/components/default-skills.d.ts.map +1 -0
- package/dist/client/components/default-skills.js +47 -0
- package/dist/client/components/default-skills.js.map +1 -0
- package/dist/client/components/diff-block.d.ts +8 -0
- package/dist/client/components/diff-block.d.ts.map +1 -0
- package/dist/client/components/diff-block.js +14 -0
- package/dist/client/components/diff-block.js.map +1 -0
- package/dist/client/components/page-container.d.ts +11 -0
- package/dist/client/components/page-container.d.ts.map +1 -0
- package/dist/client/components/page-container.js +13 -0
- package/dist/client/components/page-container.js.map +1 -0
- package/dist/client/components/page-header.d.ts +14 -0
- package/dist/client/components/page-header.d.ts.map +1 -0
- package/dist/client/components/page-header.js +10 -0
- package/dist/client/components/page-header.js.map +1 -0
- package/dist/client/components/refresh-button.d.ts +6 -0
- package/dist/client/components/refresh-button.d.ts.map +1 -0
- package/dist/client/components/refresh-button.js +26 -0
- package/dist/client/components/refresh-button.js.map +1 -0
- package/dist/client/components/route-child-page.d.ts +24 -0
- package/dist/client/components/route-child-page.d.ts.map +1 -0
- package/dist/client/components/route-child-page.js +46 -0
- package/dist/client/components/route-child-page.js.map +1 -0
- package/dist/client/components/route-dialog.d.ts +6 -0
- package/dist/client/components/route-dialog.d.ts.map +1 -0
- package/dist/client/components/route-dialog.js +7 -0
- package/dist/client/components/route-dialog.js.map +1 -0
- package/dist/client/components/route-overlay.d.ts +21 -0
- package/dist/client/components/route-overlay.d.ts.map +1 -0
- package/dist/client/components/route-overlay.js +87 -0
- package/dist/client/components/route-overlay.js.map +1 -0
- package/dist/client/components/runners-refresh.d.ts +3 -0
- package/dist/client/components/runners-refresh.d.ts.map +1 -0
- package/dist/client/components/runners-refresh.js +13 -0
- package/dist/client/components/runners-refresh.js.map +1 -0
- package/dist/client/components/secret-input.d.ts +7 -0
- package/dist/client/components/secret-input.d.ts.map +1 -0
- package/dist/client/components/secret-input.js +12 -0
- package/dist/client/components/secret-input.js.map +1 -0
- package/dist/client/components/skills-select.d.ts +16 -0
- package/dist/client/components/skills-select.d.ts.map +1 -0
- package/dist/client/components/skills-select.js +39 -0
- package/dist/client/components/skills-select.js.map +1 -0
- package/dist/client/components/ui/alert-dialog.d.ts +19 -0
- package/dist/client/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/client/components/ui/alert-dialog.js +42 -0
- package/dist/client/components/ui/alert-dialog.js.map +1 -0
- package/dist/client/components/ui/alert.d.ts +13 -0
- package/dist/client/components/ui/alert.d.ts.map +1 -0
- package/dist/client/components/ui/alert.js +31 -0
- package/dist/client/components/ui/alert.js.map +1 -0
- package/dist/client/components/ui/avatar.d.ts +12 -0
- package/dist/client/components/ui/avatar.d.ts.map +1 -0
- package/dist/client/components/ui/avatar.js +23 -0
- package/dist/client/components/ui/avatar.js.map +1 -0
- package/dist/client/components/ui/badge.d.ts +11 -0
- package/dist/client/components/ui/badge.d.ts.map +1 -0
- package/dist/client/components/ui/badge.js +37 -0
- package/dist/client/components/ui/badge.js.map +1 -0
- package/dist/client/components/ui/button.d.ts +12 -0
- package/dist/client/components/ui/button.d.ts.map +1 -0
- package/dist/client/components/ui/button.js +38 -0
- package/dist/client/components/ui/button.js.map +1 -0
- package/dist/client/components/ui/calendar.d.ts +11 -0
- package/dist/client/components/ui/calendar.d.ts.map +1 -0
- package/dist/client/components/ui/calendar.js +76 -0
- package/dist/client/components/ui/calendar.js.map +1 -0
- package/dist/client/components/ui/card.d.ts +12 -0
- package/dist/client/components/ui/card.d.ts.map +1 -0
- package/dist/client/components/ui/card.js +25 -0
- package/dist/client/components/ui/card.js.map +1 -0
- package/dist/client/components/ui/chart.d.ts +45 -0
- package/dist/client/components/ui/chart.d.ts.map +1 -0
- package/dist/client/components/ui/chart.js +133 -0
- package/dist/client/components/ui/chart.js.map +1 -0
- package/dist/client/components/ui/checkbox.d.ts +5 -0
- package/dist/client/components/ui/checkbox.d.ts.map +1 -0
- package/dist/client/components/ui/checkbox.js +9 -0
- package/dist/client/components/ui/checkbox.js.map +1 -0
- package/dist/client/components/ui/collapsible.d.ts +7 -0
- package/dist/client/components/ui/collapsible.d.ts.map +1 -0
- package/dist/client/components/ui/collapsible.js +13 -0
- package/dist/client/components/ui/collapsible.js.map +1 -0
- package/dist/client/components/ui/combobox.d.ts +25 -0
- package/dist/client/components/ui/combobox.d.ts.map +1 -0
- package/dist/client/components/ui/combobox.js +58 -0
- package/dist/client/components/ui/combobox.js.map +1 -0
- package/dist/client/components/ui/dialog.d.ts +18 -0
- package/dist/client/components/ui/dialog.d.ts.map +1 -0
- package/dist/client/components/ui/dialog.js +40 -0
- package/dist/client/components/ui/dialog.js.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/client/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/client/components/ui/dropdown-menu.js +51 -0
- package/dist/client/components/ui/dropdown-menu.js.map +1 -0
- package/dist/client/components/ui/empty.d.ts +15 -0
- package/dist/client/components/ui/empty.d.ts.map +1 -0
- package/dist/client/components/ui/empty.js +37 -0
- package/dist/client/components/ui/empty.js.map +1 -0
- package/dist/client/components/ui/field.d.ts +28 -0
- package/dist/client/components/ui/field.d.ts.map +1 -0
- package/dist/client/components/ui/field.js +71 -0
- package/dist/client/components/ui/field.js.map +1 -0
- package/dist/client/components/ui/input-group.d.ts +22 -0
- package/dist/client/components/ui/input-group.d.ts.map +1 -0
- package/dist/client/components/ui/input-group.js +63 -0
- package/dist/client/components/ui/input-group.js.map +1 -0
- package/dist/client/components/ui/input.d.ts +4 -0
- package/dist/client/components/ui/input.d.ts.map +1 -0
- package/dist/client/components/ui/input.js +8 -0
- package/dist/client/components/ui/input.js.map +1 -0
- package/dist/client/components/ui/item.d.ts +25 -0
- package/dist/client/components/ui/item.d.ts.map +1 -0
- package/dist/client/components/ui/item.js +82 -0
- package/dist/client/components/ui/item.js.map +1 -0
- package/dist/client/components/ui/label.d.ts +4 -0
- package/dist/client/components/ui/label.d.ts.map +1 -0
- package/dist/client/components/ui/label.js +7 -0
- package/dist/client/components/ui/label.js.map +1 -0
- package/dist/client/components/ui/popover.d.ts +10 -0
- package/dist/client/components/ui/popover.d.ts.map +1 -0
- package/dist/client/components/ui/popover.js +23 -0
- package/dist/client/components/ui/popover.js.map +1 -0
- package/dist/client/components/ui/radio-group.d.ts +7 -0
- package/dist/client/components/ui/radio-group.d.ts.map +1 -0
- package/dist/client/components/ui/radio-group.js +12 -0
- package/dist/client/components/ui/radio-group.js.map +1 -0
- package/dist/client/components/ui/select.d.ts +16 -0
- package/dist/client/components/ui/select.d.ts.map +1 -0
- package/dist/client/components/ui/select.js +34 -0
- package/dist/client/components/ui/select.js.map +1 -0
- package/dist/client/components/ui/separator.d.ts +5 -0
- package/dist/client/components/ui/separator.d.ts.map +1 -0
- package/dist/client/components/ui/separator.js +8 -0
- package/dist/client/components/ui/separator.js.map +1 -0
- package/dist/client/components/ui/sheet.d.ts +15 -0
- package/dist/client/components/ui/sheet.d.ts.map +1 -0
- package/dist/client/components/ui/sheet.js +39 -0
- package/dist/client/components/ui/sheet.js.map +1 -0
- package/dist/client/components/ui/skeleton.d.ts +4 -0
- package/dist/client/components/ui/skeleton.d.ts.map +1 -0
- package/dist/client/components/ui/skeleton.js +7 -0
- package/dist/client/components/ui/skeleton.js.map +1 -0
- package/dist/client/components/ui/spinner.d.ts +4 -0
- package/dist/client/components/ui/spinner.d.ts.map +1 -0
- package/dist/client/components/ui/spinner.js +11 -0
- package/dist/client/components/ui/spinner.js.map +1 -0
- package/dist/client/components/ui/switch.d.ts +7 -0
- package/dist/client/components/ui/switch.d.ts.map +1 -0
- package/dist/client/components/ui/switch.js +8 -0
- package/dist/client/components/ui/switch.js.map +1 -0
- package/dist/client/components/ui/table.d.ts +11 -0
- package/dist/client/components/ui/table.d.ts.map +1 -0
- package/dist/client/components/ui/table.js +28 -0
- package/dist/client/components/ui/table.js.map +1 -0
- package/dist/client/components/ui/tabs.d.ts +14 -0
- package/dist/client/components/ui/tabs.d.ts.map +1 -0
- package/dist/client/components/ui/tabs.js +32 -0
- package/dist/client/components/ui/tabs.js.map +1 -0
- package/dist/client/components/ui/textarea.d.ts +4 -0
- package/dist/client/components/ui/textarea.d.ts.map +1 -0
- package/dist/client/components/ui/textarea.js +7 -0
- package/dist/client/components/ui/textarea.js.map +1 -0
- package/dist/client/components/ui/tooltip.d.ts +8 -0
- package/dist/client/components/ui/tooltip.d.ts.map +1 -0
- package/dist/client/components/ui/tooltip.js +17 -0
- package/dist/client/components/ui/tooltip.js.map +1 -0
- package/dist/client/components/unsaved-changes.d.ts +8 -0
- package/dist/client/components/unsaved-changes.d.ts.map +1 -0
- package/dist/client/components/unsaved-changes.js +19 -0
- package/dist/client/components/unsaved-changes.js.map +1 -0
- package/dist/client/components/use-route-overlay.d.ts +15 -0
- package/dist/client/components/use-route-overlay.d.ts.map +1 -0
- package/dist/client/components/use-route-overlay.js +15 -0
- package/dist/client/components/use-route-overlay.js.map +1 -0
- package/dist/client/components/variables/access-log.d.ts +17 -0
- package/dist/client/components/variables/access-log.d.ts.map +1 -0
- package/dist/client/components/variables/access-log.js +52 -0
- package/dist/client/components/variables/access-log.js.map +1 -0
- package/dist/client/components/variables/variable-dialogs.d.ts +31 -0
- package/dist/client/components/variables/variable-dialogs.d.ts.map +1 -0
- package/dist/client/components/variables/variable-dialogs.js +116 -0
- package/dist/client/components/variables/variable-dialogs.js.map +1 -0
- package/dist/client/components/variables/variables-panel.d.ts +24 -0
- package/dist/client/components/variables/variables-panel.d.ts.map +1 -0
- package/dist/client/components/variables/variables-panel.js +121 -0
- package/dist/client/components/variables/variables-panel.js.map +1 -0
- package/dist/client/config.d.ts +6 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/config.js +6 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/hooks/use-access.d.ts +6 -0
- package/dist/client/hooks/use-access.d.ts.map +1 -0
- package/dist/client/hooks/use-access.js +8 -0
- package/dist/client/hooks/use-access.js.map +1 -0
- package/dist/client/hooks/use-agent-picker-labels.d.ts +4 -0
- package/dist/client/hooks/use-agent-picker-labels.d.ts.map +1 -0
- package/dist/client/hooks/use-agent-picker-labels.js +30 -0
- package/dist/client/hooks/use-agent-picker-labels.js.map +1 -0
- package/dist/client/hooks/use-agents-api.d.ts +4 -0
- package/dist/client/hooks/use-agents-api.d.ts.map +1 -0
- package/dist/client/hooks/use-agents-api.js +9 -0
- package/dist/client/hooks/use-agents-api.js.map +1 -0
- package/dist/client/hooks/use-media-query.d.ts +3 -0
- package/dist/client/hooks/use-media-query.d.ts.map +1 -0
- package/dist/client/hooks/use-media-query.js +14 -0
- package/dist/client/hooks/use-media-query.js.map +1 -0
- package/dist/client/hooks/use-notify.d.ts +9 -0
- package/dist/client/hooks/use-notify.d.ts.map +1 -0
- package/dist/client/hooks/use-notify.js +27 -0
- package/dist/client/hooks/use-notify.js.map +1 -0
- package/dist/client/hooks/use-realtime-topic.d.ts +6 -0
- package/dist/client/hooks/use-realtime-topic.d.ts.map +1 -0
- package/dist/client/hooks/use-realtime-topic.js +24 -0
- package/dist/client/hooks/use-realtime-topic.js.map +1 -0
- package/dist/client/hooks/use-server-url.d.ts +6 -0
- package/dist/client/hooks/use-server-url.d.ts.map +1 -0
- package/dist/client/hooks/use-server-url.js +10 -0
- package/dist/client/hooks/use-server-url.js.map +1 -0
- package/dist/client/hooks/use-vocabulary.d.ts +38 -0
- package/dist/client/hooks/use-vocabulary.d.ts.map +1 -0
- package/dist/client/hooks/use-vocabulary.js +77 -0
- package/dist/client/hooks/use-vocabulary.js.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/kit.d.ts +62 -0
- package/dist/client/kit.d.ts.map +1 -0
- package/dist/client/kit.js +122 -0
- package/dist/client/kit.js.map +1 -0
- package/dist/client/lib/action-catalog.d.ts +13 -0
- package/dist/client/lib/action-catalog.d.ts.map +1 -0
- package/dist/client/lib/action-catalog.js +45 -0
- package/dist/client/lib/action-catalog.js.map +1 -0
- package/dist/client/lib/agents.d.ts +7 -0
- package/dist/client/lib/agents.d.ts.map +1 -0
- package/dist/client/lib/agents.js +33 -0
- package/dist/client/lib/agents.js.map +1 -0
- package/dist/client/lib/diff.d.ts +8 -0
- package/dist/client/lib/diff.d.ts.map +1 -0
- package/dist/client/lib/diff.js +55 -0
- package/dist/client/lib/diff.js.map +1 -0
- package/dist/client/lib/download.d.ts +5 -0
- package/dist/client/lib/download.d.ts.map +1 -0
- package/dist/client/lib/download.js +17 -0
- package/dist/client/lib/download.js.map +1 -0
- package/dist/client/lib/format.d.ts +15 -0
- package/dist/client/lib/format.d.ts.map +1 -0
- package/dist/client/lib/format.js +76 -0
- package/dist/client/lib/format.js.map +1 -0
- package/dist/client/lib/install.d.ts +23 -0
- package/dist/client/lib/install.d.ts.map +1 -0
- package/dist/client/lib/install.js +54 -0
- package/dist/client/lib/install.js.map +1 -0
- package/dist/client/lib/revision.d.ts +3 -0
- package/dist/client/lib/revision.d.ts.map +1 -0
- package/dist/client/lib/revision.js +10 -0
- package/dist/client/lib/revision.js.map +1 -0
- package/dist/client/lib/runs.d.ts +11 -0
- package/dist/client/lib/runs.d.ts.map +1 -0
- package/dist/client/lib/runs.js +22 -0
- package/dist/client/lib/runs.js.map +1 -0
- package/dist/client/lib/text.d.ts +3 -0
- package/dist/client/lib/text.d.ts.map +1 -0
- package/dist/client/lib/text.js +6 -0
- package/dist/client/lib/text.js.map +1 -0
- package/dist/client/lib/tool-slots.d.ts +16 -0
- package/dist/client/lib/tool-slots.d.ts.map +1 -0
- package/dist/client/lib/tool-slots.js +37 -0
- package/dist/client/lib/tool-slots.js.map +1 -0
- package/dist/client/lib/tool-summary.d.ts +6 -0
- package/dist/client/lib/tool-summary.d.ts.map +1 -0
- package/dist/client/lib/tool-summary.js +44 -0
- package/dist/client/lib/tool-summary.js.map +1 -0
- package/dist/client/locales/chat.en-US.d.ts +70 -0
- package/dist/client/locales/chat.en-US.d.ts.map +1 -0
- package/dist/client/locales/chat.en-US.js +70 -0
- package/dist/client/locales/chat.en-US.js.map +1 -0
- package/dist/client/locales/chat.zh-CN.d.ts +4 -0
- package/dist/client/locales/chat.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/chat.zh-CN.js +64 -0
- package/dist/client/locales/chat.zh-CN.js.map +1 -0
- package/dist/client/locales/en-US.d.ts +491 -0
- package/dist/client/locales/en-US.d.ts.map +1 -0
- package/dist/client/locales/en-US.js +490 -0
- package/dist/client/locales/en-US.js.map +1 -0
- package/dist/client/locales/index.d.ts +4 -0
- package/dist/client/locales/index.d.ts.map +1 -0
- package/dist/client/locales/index.js +7 -0
- package/dist/client/locales/index.js.map +1 -0
- package/dist/client/locales/prices.en-US.d.ts +49 -0
- package/dist/client/locales/prices.en-US.d.ts.map +1 -0
- package/dist/client/locales/prices.en-US.js +48 -0
- package/dist/client/locales/prices.en-US.js.map +1 -0
- package/dist/client/locales/prices.zh-CN.d.ts +5 -0
- package/dist/client/locales/prices.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/prices.zh-CN.js +48 -0
- package/dist/client/locales/prices.zh-CN.js.map +1 -0
- package/dist/client/locales/runWait.en-US.d.ts +38 -0
- package/dist/client/locales/runWait.en-US.d.ts.map +1 -0
- package/dist/client/locales/runWait.en-US.js +37 -0
- package/dist/client/locales/runWait.en-US.js.map +1 -0
- package/dist/client/locales/runWait.zh-CN.d.ts +5 -0
- package/dist/client/locales/runWait.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/runWait.zh-CN.js +32 -0
- package/dist/client/locales/runWait.zh-CN.js.map +1 -0
- package/dist/client/locales/runtimes.en-US.d.ts +227 -0
- package/dist/client/locales/runtimes.en-US.d.ts.map +1 -0
- package/dist/client/locales/runtimes.en-US.js +226 -0
- package/dist/client/locales/runtimes.en-US.js.map +1 -0
- package/dist/client/locales/runtimes.zh-CN.d.ts +4 -0
- package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/runtimes.zh-CN.js +225 -0
- package/dist/client/locales/runtimes.zh-CN.js.map +1 -0
- package/dist/client/locales/services.en-US.d.ts +112 -0
- package/dist/client/locales/services.en-US.d.ts.map +1 -0
- package/dist/client/locales/services.en-US.js +111 -0
- package/dist/client/locales/services.en-US.js.map +1 -0
- package/dist/client/locales/services.zh-CN.d.ts +4 -0
- package/dist/client/locales/services.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/services.zh-CN.js +110 -0
- package/dist/client/locales/services.zh-CN.js.map +1 -0
- package/dist/client/locales/skills.en-US.d.ts +149 -0
- package/dist/client/locales/skills.en-US.d.ts.map +1 -0
- package/dist/client/locales/skills.en-US.js +149 -0
- package/dist/client/locales/skills.en-US.js.map +1 -0
- package/dist/client/locales/skills.zh-CN.d.ts +4 -0
- package/dist/client/locales/skills.zh-CN.d.ts.map +1 -0
- package/dist/client/locales/skills.zh-CN.js +148 -0
- package/dist/client/locales/skills.zh-CN.js.map +1 -0
- package/dist/client/locales/zh-CN.d.ts +4 -0
- package/dist/client/locales/zh-CN.d.ts.map +1 -0
- package/dist/client/locales/zh-CN.js +485 -0
- package/dist/client/locales/zh-CN.js.map +1 -0
- package/dist/client/online/model.d.ts +45 -0
- package/dist/client/online/model.d.ts.map +1 -0
- package/dist/client/online/model.js +128 -0
- package/dist/client/online/model.js.map +1 -0
- package/dist/client/online/service-editor.d.ts +11 -0
- package/dist/client/online/service-editor.d.ts.map +1 -0
- package/dist/client/online/service-editor.js +235 -0
- package/dist/client/online/service-editor.js.map +1 -0
- package/dist/client/online/services.d.ts +3 -0
- package/dist/client/online/services.d.ts.map +1 -0
- package/dist/client/online/services.js +108 -0
- package/dist/client/online/services.js.map +1 -0
- package/dist/client/pages/agents/agent-dialog.d.ts +9 -0
- package/dist/client/pages/agents/agent-dialog.d.ts.map +1 -0
- package/dist/client/pages/agents/agent-dialog.js +106 -0
- package/dist/client/pages/agents/agent-dialog.js.map +1 -0
- package/dist/client/pages/agents/agent-state.d.ts +11 -0
- package/dist/client/pages/agents/agent-state.d.ts.map +1 -0
- package/dist/client/pages/agents/agent-state.js +28 -0
- package/dist/client/pages/agents/agent-state.js.map +1 -0
- package/dist/client/pages/agents/index.d.ts +3 -0
- package/dist/client/pages/agents/index.d.ts.map +1 -0
- package/dist/client/pages/agents/index.js +15 -0
- package/dist/client/pages/agents/index.js.map +1 -0
- package/dist/client/pages/agents/runner-agents.d.ts +3 -0
- package/dist/client/pages/agents/runner-agents.d.ts.map +1 -0
- package/dist/client/pages/agents/runner-agents.js +172 -0
- package/dist/client/pages/agents/runner-agents.js.map +1 -0
- package/dist/client/pages/models/index.d.ts +6 -0
- package/dist/client/pages/models/index.d.ts.map +1 -0
- package/dist/client/pages/models/index.js +6 -0
- package/dist/client/pages/models/index.js.map +1 -0
- package/dist/client/pages/runtimes/connect.d.ts +3 -0
- package/dist/client/pages/runtimes/connect.d.ts.map +1 -0
- package/dist/client/pages/runtimes/connect.js +155 -0
- package/dist/client/pages/runtimes/connect.js.map +1 -0
- package/dist/client/pages/runtimes/index.d.ts +3 -0
- package/dist/client/pages/runtimes/index.d.ts.map +1 -0
- package/dist/client/pages/runtimes/index.js +111 -0
- package/dist/client/pages/runtimes/index.js.map +1 -0
- package/dist/client/pages/runtimes/runner-cells.d.ts +39 -0
- package/dist/client/pages/runtimes/runner-cells.d.ts.map +1 -0
- package/dist/client/pages/runtimes/runner-cells.js +120 -0
- package/dist/client/pages/runtimes/runner-cells.js.map +1 -0
- package/dist/client/pages/runtimes/runner-policy.d.ts +18 -0
- package/dist/client/pages/runtimes/runner-policy.d.ts.map +1 -0
- package/dist/client/pages/runtimes/runner-policy.js +10 -0
- package/dist/client/pages/runtimes/runner-policy.js.map +1 -0
- package/dist/client/pages/runtimes/runner-sheet.d.ts +8 -0
- package/dist/client/pages/runtimes/runner-sheet.d.ts.map +1 -0
- package/dist/client/pages/runtimes/runner-sheet.js +197 -0
- package/dist/client/pages/runtimes/runner-sheet.js.map +1 -0
- package/dist/client/pages/runtimes/tool-slots-fields.d.ts +33 -0
- package/dist/client/pages/runtimes/tool-slots-fields.d.ts.map +1 -0
- package/dist/client/pages/runtimes/tool-slots-fields.js +28 -0
- package/dist/client/pages/runtimes/tool-slots-fields.js.map +1 -0
- package/dist/client/pages/runtimes/workspace-diagnostics.d.ts +9 -0
- package/dist/client/pages/runtimes/workspace-diagnostics.d.ts.map +1 -0
- package/dist/client/pages/runtimes/workspace-diagnostics.js +70 -0
- package/dist/client/pages/runtimes/workspace-diagnostics.js.map +1 -0
- package/dist/client/pages/skills/detail/index.d.ts +3 -0
- package/dist/client/pages/skills/detail/index.d.ts.map +1 -0
- package/dist/client/pages/skills/detail/index.js +115 -0
- package/dist/client/pages/skills/detail/index.js.map +1 -0
- package/dist/client/pages/skills/detail/skill-editor.d.ts +13 -0
- package/dist/client/pages/skills/detail/skill-editor.d.ts.map +1 -0
- package/dist/client/pages/skills/detail/skill-editor.js +80 -0
- package/dist/client/pages/skills/detail/skill-editor.js.map +1 -0
- package/dist/client/pages/skills/detail/skill-versions.d.ts +7 -0
- package/dist/client/pages/skills/detail/skill-versions.d.ts.map +1 -0
- package/dist/client/pages/skills/detail/skill-versions.js +115 -0
- package/dist/client/pages/skills/detail/skill-versions.js.map +1 -0
- package/dist/client/pages/skills/import-button.d.ts +9 -0
- package/dist/client/pages/skills/import-button.d.ts.map +1 -0
- package/dist/client/pages/skills/import-button.js +69 -0
- package/dist/client/pages/skills/import-button.js.map +1 -0
- package/dist/client/pages/skills/index.d.ts +3 -0
- package/dist/client/pages/skills/index.d.ts.map +1 -0
- package/dist/client/pages/skills/index.js +49 -0
- package/dist/client/pages/skills/index.js.map +1 -0
- package/dist/client/pages/skills/new.d.ts +3 -0
- package/dist/client/pages/skills/new.d.ts.map +1 -0
- package/dist/client/pages/skills/new.js +81 -0
- package/dist/client/pages/skills/new.js.map +1 -0
- package/dist/client/pages/skills/workbench/discard-dialog.d.ts +8 -0
- package/dist/client/pages/skills/workbench/discard-dialog.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/discard-dialog.js +9 -0
- package/dist/client/pages/skills/workbench/discard-dialog.js.map +1 -0
- package/dist/client/pages/skills/workbench/entry-dialog.d.ts +23 -0
- package/dist/client/pages/skills/workbench/entry-dialog.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/entry-dialog.js +63 -0
- package/dist/client/pages/skills/workbench/entry-dialog.js.map +1 -0
- package/dist/client/pages/skills/workbench/file-pane.d.ts +27 -0
- package/dist/client/pages/skills/workbench/file-pane.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/file-pane.js +101 -0
- package/dist/client/pages/skills/workbench/file-pane.js.map +1 -0
- package/dist/client/pages/skills/workbench/file-tree.d.ts +23 -0
- package/dist/client/pages/skills/workbench/file-tree.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/file-tree.js +85 -0
- package/dist/client/pages/skills/workbench/file-tree.js.map +1 -0
- package/dist/client/pages/skills/workbench/model.d.ts +72 -0
- package/dist/client/pages/skills/workbench/model.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/model.js +176 -0
- package/dist/client/pages/skills/workbench/model.js.map +1 -0
- package/dist/client/pages/skills/workbench/skill-workbench.d.ts +13 -0
- package/dist/client/pages/skills/workbench/skill-workbench.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/skill-workbench.js +223 -0
- package/dist/client/pages/skills/workbench/skill-workbench.js.map +1 -0
- package/dist/client/pages/skills/workbench/state.d.ts +28 -0
- package/dist/client/pages/skills/workbench/state.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/state.js +62 -0
- package/dist/client/pages/skills/workbench/state.js.map +1 -0
- package/dist/client/pages/skills/workbench/use-element-width.d.ts +6 -0
- package/dist/client/pages/skills/workbench/use-element-width.d.ts.map +1 -0
- package/dist/client/pages/skills/workbench/use-element-width.js +18 -0
- package/dist/client/pages/skills/workbench/use-element-width.js.map +1 -0
- package/dist/client/pages/usage/date-range-picker.d.ts +10 -0
- package/dist/client/pages/usage/date-range-picker.d.ts.map +1 -0
- package/dist/client/pages/usage/date-range-picker.js +45 -0
- package/dist/client/pages/usage/date-range-picker.js.map +1 -0
- package/dist/client/pages/usage/index.d.ts +3 -0
- package/dist/client/pages/usage/index.d.ts.map +1 -0
- package/dist/client/pages/usage/index.js +269 -0
- package/dist/client/pages/usage/index.js.map +1 -0
- package/dist/client/pages/usage/model.d.ts +70 -0
- package/dist/client/pages/usage/model.d.ts.map +1 -0
- package/dist/client/pages/usage/model.js +234 -0
- package/dist/client/pages/usage/model.js.map +1 -0
- package/dist/client/pages/usage/prices/index.d.ts +6 -0
- package/dist/client/pages/usage/prices/index.d.ts.map +1 -0
- package/dist/client/pages/usage/prices/index.js +35 -0
- package/dist/client/pages/usage/prices/index.js.map +1 -0
- package/dist/client/pages/usage/prices/model.d.ts +43 -0
- package/dist/client/pages/usage/prices/model.d.ts.map +1 -0
- package/dist/client/pages/usage/prices/model.js +104 -0
- package/dist/client/pages/usage/prices/model.js.map +1 -0
- package/dist/client/pages/usage/prices/price-cells.d.ts +24 -0
- package/dist/client/pages/usage/prices/price-cells.d.ts.map +1 -0
- package/dist/client/pages/usage/prices/price-cells.js +61 -0
- package/dist/client/pages/usage/prices/price-cells.js.map +1 -0
- package/dist/client/pages/usage/prices/prices-section.d.ts +7 -0
- package/dist/client/pages/usage/prices/prices-section.d.ts.map +1 -0
- package/dist/client/pages/usage/prices/prices-section.js +50 -0
- package/dist/client/pages/usage/prices/prices-section.js.map +1 -0
- package/dist/client/pages/usage/prices/tool-panel.d.ts +9 -0
- package/dist/client/pages/usage/prices/tool-panel.d.ts.map +1 -0
- package/dist/client/pages/usage/prices/tool-panel.js +78 -0
- package/dist/client/pages/usage/prices/tool-panel.js.map +1 -0
- package/dist/client/pages/usage/prices/use-save-prices.d.ts +6 -0
- package/dist/client/pages/usage/prices/use-save-prices.d.ts.map +1 -0
- package/dist/client/pages/usage/prices/use-save-prices.js +14 -0
- package/dist/client/pages/usage/prices/use-save-prices.js.map +1 -0
- package/dist/client/plugin.d.ts +4 -0
- package/dist/client/plugin.d.ts.map +1 -0
- package/dist/client/plugin.js +11 -0
- package/dist/client/plugin.js.map +1 -0
- package/dist/client/profile/default-agent.d.ts +3 -0
- package/dist/client/profile/default-agent.d.ts.map +1 -0
- package/dist/client/profile/default-agent.js +87 -0
- package/dist/client/profile/default-agent.js.map +1 -0
- package/dist/client/profile.d.ts +8 -0
- package/dist/client/profile.d.ts.map +1 -0
- package/dist/client/profile.js +4 -0
- package/dist/client/profile.js.map +1 -0
- package/dist/client/query.d.ts +9 -0
- package/dist/client/query.d.ts.map +1 -0
- package/dist/client/query.js +41 -0
- package/dist/client/query.js.map +1 -0
- package/dist/client/routes.d.ts +25 -0
- package/dist/client/routes.d.ts.map +1 -0
- package/dist/client/routes.js +77 -0
- package/dist/client/routes.js.map +1 -0
- package/dist/client/runs/format-wait.d.ts +21 -0
- package/dist/client/runs/format-wait.d.ts.map +1 -0
- package/dist/client/runs/format-wait.js +90 -0
- package/dist/client/runs/format-wait.js.map +1 -0
- package/dist/client/runs/run-hooks.d.ts +35 -0
- package/dist/client/runs/run-hooks.d.ts.map +1 -0
- package/dist/client/runs/run-hooks.js +92 -0
- package/dist/client/runs/run-hooks.js.map +1 -0
- package/dist/client/runs/subject-runs.d.ts +17 -0
- package/dist/client/runs/subject-runs.d.ts.map +1 -0
- package/dist/client/runs/subject-runs.js +62 -0
- package/dist/client/runs/subject-runs.js.map +1 -0
- package/dist/client/runs/use-run-events.d.ts +24 -0
- package/dist/client/runs/use-run-events.d.ts.map +1 -0
- package/dist/client/runs/use-run-events.js +80 -0
- package/dist/client/runs/use-run-events.js.map +1 -0
- package/dist/client/runs.d.ts +16 -0
- package/dist/client/runs.d.ts.map +1 -0
- package/dist/client/runs.js +15 -0
- package/dist/client/runs.js.map +1 -0
- package/dist/database/migrations/.manifest.json +105 -0
- package/dist/database/migrations/202610020001_ag_create_agents.d.ts +4 -0
- package/dist/database/migrations/202610020001_ag_create_agents.d.ts.map +1 -0
- package/dist/database/migrations/202610020001_ag_create_agents.js +108 -0
- package/dist/database/migrations/202610020001_ag_create_agents.js.map +1 -0
- package/dist/database/migrations/202610020002_ag_create_runners.d.ts +4 -0
- package/dist/database/migrations/202610020002_ag_create_runners.d.ts.map +1 -0
- package/dist/database/migrations/202610020002_ag_create_runners.js +115 -0
- package/dist/database/migrations/202610020002_ag_create_runners.js.map +1 -0
- package/dist/database/migrations/202610020003_ag_create_runs.d.ts +4 -0
- package/dist/database/migrations/202610020003_ag_create_runs.d.ts.map +1 -0
- package/dist/database/migrations/202610020003_ag_create_runs.js +289 -0
- package/dist/database/migrations/202610020003_ag_create_runs.js.map +1 -0
- package/dist/database/migrations/202610020004_ag_create_variables.d.ts +4 -0
- package/dist/database/migrations/202610020004_ag_create_variables.d.ts.map +1 -0
- package/dist/database/migrations/202610020004_ag_create_variables.js +52 -0
- package/dist/database/migrations/202610020004_ag_create_variables.js.map +1 -0
- package/dist/database/migrations/202610020005_ag_create_skills.d.ts +4 -0
- package/dist/database/migrations/202610020005_ag_create_skills.d.ts.map +1 -0
- package/dist/database/migrations/202610020005_ag_create_skills.js +94 -0
- package/dist/database/migrations/202610020005_ag_create_skills.js.map +1 -0
- package/dist/database/migrations/202610020006_ag_create_model_prices.d.ts +4 -0
- package/dist/database/migrations/202610020006_ag_create_model_prices.d.ts.map +1 -0
- package/dist/database/migrations/202610020006_ag_create_model_prices.js +46 -0
- package/dist/database/migrations/202610020006_ag_create_model_prices.js.map +1 -0
- package/dist/database/migrations/202610020008_ag_create_conversations.d.ts +4 -0
- package/dist/database/migrations/202610020008_ag_create_conversations.d.ts.map +1 -0
- package/dist/database/migrations/202610020008_ag_create_conversations.js +113 -0
- package/dist/database/migrations/202610020008_ag_create_conversations.js.map +1 -0
- package/dist/database/migrations/202610020009_ag_create_jobs.d.ts +4 -0
- package/dist/database/migrations/202610020009_ag_create_jobs.d.ts.map +1 -0
- package/dist/database/migrations/202610020009_ag_create_jobs.js +102 -0
- package/dist/database/migrations/202610020009_ag_create_jobs.js.map +1 -0
- package/dist/database/migrations/202610020010_ag_create_model_services.d.ts +4 -0
- package/dist/database/migrations/202610020010_ag_create_model_services.d.ts.map +1 -0
- package/dist/database/migrations/202610020010_ag_create_model_services.js +57 -0
- package/dist/database/migrations/202610020010_ag_create_model_services.js.map +1 -0
- package/dist/database/migrations/202610020011_ag_create_vectors.d.ts +4 -0
- package/dist/database/migrations/202610020011_ag_create_vectors.d.ts.map +1 -0
- package/dist/database/migrations/202610020011_ag_create_vectors.js +68 -0
- package/dist/database/migrations/202610020011_ag_create_vectors.js.map +1 -0
- package/dist/database/migrations/202610060001_ag_add_runner_product.d.ts +8 -0
- package/dist/database/migrations/202610060001_ag_add_runner_product.d.ts.map +1 -0
- package/dist/database/migrations/202610060001_ag_add_runner_product.js +21 -0
- package/dist/database/migrations/202610060001_ag_add_runner_product.js.map +1 -0
- package/dist/database/migrations/202610070001_ag_create_chat_attachments.d.ts +4 -0
- package/dist/database/migrations/202610070001_ag_create_chat_attachments.d.ts.map +1 -0
- package/dist/database/migrations/202610070001_ag_create_chat_attachments.js +35 -0
- package/dist/database/migrations/202610070001_ag_create_chat_attachments.js.map +1 -0
- package/dist/database/migrations/202610080001_ag_add_runner_tool_slots.d.ts +9 -0
- package/dist/database/migrations/202610080001_ag_add_runner_tool_slots.d.ts.map +1 -0
- package/dist/database/migrations/202610080001_ag_add_runner_tool_slots.js +30 -0
- package/dist/database/migrations/202610080001_ag_add_runner_tool_slots.js.map +1 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.d.ts +9 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.d.ts.map +1 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.js +28 -0
- package/dist/database/migrations/202610090001_ag_add_team_runner_variables.js.map +1 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.d.ts +10 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.d.ts.map +1 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.js +105 -0
- package/dist/database/migrations/202610090002_ag_create_run_requests.js.map +1 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.d.ts +4 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.d.ts.map +1 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.js +17 -0
- package/dist/database/migrations/202610090003_ag_add_execution_history.js.map +1 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.d.ts +9 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.d.ts.map +1 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.js +22 -0
- package/dist/database/migrations/202610090004_ag_add_runner_workspace_usage.js.map +1 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.d.ts +10 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.d.ts.map +1 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.js +36 -0
- package/dist/database/migrations/202610090005_ag_add_runner_variables.js.map +1 -0
- package/dist/database/migrations/202610100001_ag_index_run_event_types.d.ts +4 -0
- package/dist/database/migrations/202610100001_ag_index_run_event_types.d.ts.map +1 -0
- package/dist/database/migrations/202610100001_ag_index_run_event_types.js +17 -0
- package/dist/database/migrations/202610100001_ag_index_run_event_types.js.map +1 -0
- package/dist/database/migrations/202610100002_ag_add_run_git_credentials.d.ts +9 -0
- package/dist/database/migrations/202610100002_ag_add_run_git_credentials.d.ts.map +1 -0
- package/dist/database/migrations/202610100002_ag_add_run_git_credentials.js +30 -0
- package/dist/database/migrations/202610100002_ag_add_run_git_credentials.js.map +1 -0
- package/dist/database/migrations/202610110001_ag_add_fresh_sessions.d.ts +4 -0
- package/dist/database/migrations/202610110001_ag_add_fresh_sessions.d.ts.map +1 -0
- package/dist/database/migrations/202610110001_ag_add_fresh_sessions.js +23 -0
- package/dist/database/migrations/202610110001_ag_add_fresh_sessions.js.map +1 -0
- package/dist/database/migrations/202610120001_ag_index_run_retries.d.ts +4 -0
- package/dist/database/migrations/202610120001_ag_index_run_retries.d.ts.map +1 -0
- package/dist/database/migrations/202610120001_ag_index_run_retries.js +17 -0
- package/dist/database/migrations/202610120001_ag_index_run_retries.js.map +1 -0
- package/dist/database/migrations/202610120002_ag_add_queue_entered_at.d.ts +4 -0
- package/dist/database/migrations/202610120002_ag_add_queue_entered_at.d.ts.map +1 -0
- package/dist/database/migrations/202610120002_ag_add_queue_entered_at.js +50 -0
- package/dist/database/migrations/202610120002_ag_add_queue_entered_at.js.map +1 -0
- package/dist/database/migrations/202610240020_ag_runner_agents.d.ts +4 -0
- package/dist/database/migrations/202610240020_ag_runner_agents.d.ts.map +1 -0
- package/dist/database/migrations/202610240020_ag_runner_agents.js +115 -0
- package/dist/database/migrations/202610240020_ag_runner_agents.js.map +1 -0
- package/dist/database/migrations/202610240040_ag_discovery_preferences.d.ts +4 -0
- package/dist/database/migrations/202610240040_ag_discovery_preferences.d.ts.map +1 -0
- package/dist/database/migrations/202610240040_ag_discovery_preferences.js +18 -0
- package/dist/database/migrations/202610240040_ag_discovery_preferences.js.map +1 -0
- package/dist/database/seeds/.manifest.json +9 -0
- package/dist/database/seeds/202610020007_ag_default_model_prices.d.ts +4 -0
- package/dist/database/seeds/202610020007_ag_default_model_prices.d.ts.map +1 -0
- package/dist/database/seeds/202610020007_ag_default_model_prices.js +142 -0
- package/dist/database/seeds/202610020007_ag_default_model_prices.js.map +1 -0
- package/dist/package.d.ts +2 -0
- package/dist/package.d.ts.map +1 -0
- package/dist/package.js +2 -0
- package/dist/package.js.map +1 -0
- package/dist/package.json +310 -0
- package/dist/server/cli/run-credential.d.ts +17 -0
- package/dist/server/cli/run-credential.d.ts.map +1 -0
- package/dist/server/cli/run-credential.js +52 -0
- package/dist/server/cli/run-credential.js.map +1 -0
- package/dist/server/cli/surface.d.ts +20 -0
- package/dist/server/cli/surface.d.ts.map +1 -0
- package/dist/server/cli/surface.js +66 -0
- package/dist/server/cli/surface.js.map +1 -0
- package/dist/server/composition.d.ts +196 -0
- package/dist/server/composition.d.ts.map +1 -0
- package/dist/server/composition.js +353 -0
- package/dist/server/composition.js.map +1 -0
- package/dist/server/core/agents/actions.d.ts +16 -0
- package/dist/server/core/agents/actions.d.ts.map +1 -0
- package/dist/server/core/agents/actions.js +26 -0
- package/dist/server/core/agents/actions.js.map +1 -0
- package/dist/server/core/agents/agent.history.d.ts +32 -0
- package/dist/server/core/agents/agent.history.d.ts.map +1 -0
- package/dist/server/core/agents/agent.history.js +71 -0
- package/dist/server/core/agents/agent.history.js.map +1 -0
- package/dist/server/core/agents/agent.service.d.ts +93 -0
- package/dist/server/core/agents/agent.service.d.ts.map +1 -0
- package/dist/server/core/agents/agent.service.js +452 -0
- package/dist/server/core/agents/agent.service.js.map +1 -0
- package/dist/server/core/agents/agent.store.d.ts +63 -0
- package/dist/server/core/agents/agent.store.d.ts.map +1 -0
- package/dist/server/core/agents/agent.store.js +153 -0
- package/dist/server/core/agents/agent.store.js.map +1 -0
- package/dist/server/core/agents/agent.views.d.ts +29 -0
- package/dist/server/core/agents/agent.views.d.ts.map +1 -0
- package/dist/server/core/agents/agent.views.js +86 -0
- package/dist/server/core/agents/agent.views.js.map +1 -0
- package/dist/server/core/agents/discovery.d.ts +12 -0
- package/dist/server/core/agents/discovery.d.ts.map +1 -0
- package/dist/server/core/agents/discovery.js +39 -0
- package/dist/server/core/agents/discovery.js.map +1 -0
- package/dist/server/core/agents/index.d.ts +5 -0
- package/dist/server/core/agents/index.d.ts.map +1 -0
- package/dist/server/core/agents/index.js +5 -0
- package/dist/server/core/agents/index.js.map +1 -0
- package/dist/server/core/brief/brief.d.ts +114 -0
- package/dist/server/core/brief/brief.d.ts.map +1 -0
- package/dist/server/core/brief/brief.js +216 -0
- package/dist/server/core/brief/brief.js.map +1 -0
- package/dist/server/core/brief/index.d.ts +2 -0
- package/dist/server/core/brief/index.d.ts.map +1 -0
- package/dist/server/core/brief/index.js +2 -0
- package/dist/server/core/brief/index.js.map +1 -0
- package/dist/server/core/callers/index.d.ts +63 -0
- package/dist/server/core/callers/index.d.ts.map +1 -0
- package/dist/server/core/callers/index.js +42 -0
- package/dist/server/core/callers/index.js.map +1 -0
- package/dist/server/core/conversations/attachments.d.ts +159 -0
- package/dist/server/core/conversations/attachments.d.ts.map +1 -0
- package/dist/server/core/conversations/attachments.js +281 -0
- package/dist/server/core/conversations/attachments.js.map +1 -0
- package/dist/server/core/conversations/availability.d.ts +15 -0
- package/dist/server/core/conversations/availability.d.ts.map +1 -0
- package/dist/server/core/conversations/availability.js +24 -0
- package/dist/server/core/conversations/availability.js.map +1 -0
- package/dist/server/core/conversations/chat-settings.d.ts +26 -0
- package/dist/server/core/conversations/chat-settings.d.ts.map +1 -0
- package/dist/server/core/conversations/chat-settings.js +100 -0
- package/dist/server/core/conversations/chat-settings.js.map +1 -0
- package/dist/server/core/conversations/conversation.service.d.ts +29 -0
- package/dist/server/core/conversations/conversation.service.d.ts.map +1 -0
- package/dist/server/core/conversations/conversation.service.js +1098 -0
- package/dist/server/core/conversations/conversation.service.js.map +1 -0
- package/dist/server/core/conversations/conversation.store.d.ts +104 -0
- package/dist/server/core/conversations/conversation.store.d.ts.map +1 -0
- package/dist/server/core/conversations/conversation.store.js +159 -0
- package/dist/server/core/conversations/conversation.store.js.map +1 -0
- package/dist/server/core/conversations/index.d.ts +8 -0
- package/dist/server/core/conversations/index.d.ts.map +1 -0
- package/dist/server/core/conversations/index.js +7 -0
- package/dist/server/core/conversations/index.js.map +1 -0
- package/dist/server/core/conversations/page-context.d.ts +35 -0
- package/dist/server/core/conversations/page-context.d.ts.map +1 -0
- package/dist/server/core/conversations/page-context.js +144 -0
- package/dist/server/core/conversations/page-context.js.map +1 -0
- package/dist/server/core/conversations/ports.d.ts +131 -0
- package/dist/server/core/conversations/ports.d.ts.map +1 -0
- package/dist/server/core/conversations/ports.js +2 -0
- package/dist/server/core/conversations/ports.js.map +1 -0
- package/dist/server/core/conversations/prompt.d.ts +46 -0
- package/dist/server/core/conversations/prompt.d.ts.map +1 -0
- package/dist/server/core/conversations/prompt.js +107 -0
- package/dist/server/core/conversations/prompt.js.map +1 -0
- package/dist/server/core/conversations/titles.d.ts +9 -0
- package/dist/server/core/conversations/titles.d.ts.map +1 -0
- package/dist/server/core/conversations/titles.js +20 -0
- package/dist/server/core/conversations/titles.js.map +1 -0
- package/dist/server/core/reports/index.d.ts +7 -0
- package/dist/server/core/reports/index.d.ts.map +1 -0
- package/dist/server/core/reports/index.js +7 -0
- package/dist/server/core/reports/index.js.map +1 -0
- package/dist/server/core/reports/metrics.d.ts +23 -0
- package/dist/server/core/reports/metrics.d.ts.map +1 -0
- package/dist/server/core/reports/metrics.js +60 -0
- package/dist/server/core/reports/metrics.js.map +1 -0
- package/dist/server/core/reports/model-usage.d.ts +35 -0
- package/dist/server/core/reports/model-usage.d.ts.map +1 -0
- package/dist/server/core/reports/model-usage.js +84 -0
- package/dist/server/core/reports/model-usage.js.map +1 -0
- package/dist/server/core/reports/prices.d.ts +35 -0
- package/dist/server/core/reports/prices.d.ts.map +1 -0
- package/dist/server/core/reports/prices.js +173 -0
- package/dist/server/core/reports/prices.js.map +1 -0
- package/dist/server/core/reports/report.service.d.ts +57 -0
- package/dist/server/core/reports/report.service.d.ts.map +1 -0
- package/dist/server/core/reports/report.service.js +313 -0
- package/dist/server/core/reports/report.service.js.map +1 -0
- package/dist/server/core/reports/usage.d.ts +50 -0
- package/dist/server/core/reports/usage.d.ts.map +1 -0
- package/dist/server/core/reports/usage.js +159 -0
- package/dist/server/core/reports/usage.js.map +1 -0
- package/dist/server/core/runs/availability.d.ts +31 -0
- package/dist/server/core/runs/availability.d.ts.map +1 -0
- package/dist/server/core/runs/availability.js +42 -0
- package/dist/server/core/runs/availability.js.map +1 -0
- package/dist/server/core/runs/claim.d.ts +140 -0
- package/dist/server/core/runs/claim.d.ts.map +1 -0
- package/dist/server/core/runs/claim.js +1009 -0
- package/dist/server/core/runs/claim.js.map +1 -0
- package/dist/server/core/runs/cli-package.d.ts +16 -0
- package/dist/server/core/runs/cli-package.d.ts.map +1 -0
- package/dist/server/core/runs/cli-package.js +18 -0
- package/dist/server/core/runs/cli-package.js.map +1 -0
- package/dist/server/core/runs/eligibility.d.ts +51 -0
- package/dist/server/core/runs/eligibility.d.ts.map +1 -0
- package/dist/server/core/runs/eligibility.js +44 -0
- package/dist/server/core/runs/eligibility.js.map +1 -0
- package/dist/server/core/runs/execution-view.d.ts +10 -0
- package/dist/server/core/runs/execution-view.d.ts.map +1 -0
- package/dist/server/core/runs/execution-view.js +25 -0
- package/dist/server/core/runs/execution-view.js.map +1 -0
- package/dist/server/core/runs/execution.d.ts +13 -0
- package/dist/server/core/runs/execution.d.ts.map +1 -0
- package/dist/server/core/runs/execution.js +85 -0
- package/dist/server/core/runs/execution.js.map +1 -0
- package/dist/server/core/runs/extensions.d.ts +184 -0
- package/dist/server/core/runs/extensions.d.ts.map +1 -0
- package/dist/server/core/runs/extensions.js +220 -0
- package/dist/server/core/runs/extensions.js.map +1 -0
- package/dist/server/core/runs/git-credentials.d.ts +43 -0
- package/dist/server/core/runs/git-credentials.d.ts.map +1 -0
- package/dist/server/core/runs/git-credentials.js +129 -0
- package/dist/server/core/runs/git-credentials.js.map +1 -0
- package/dist/server/core/runs/identity.d.ts +6 -0
- package/dist/server/core/runs/identity.d.ts.map +1 -0
- package/dist/server/core/runs/identity.js +49 -0
- package/dist/server/core/runs/identity.js.map +1 -0
- package/dist/server/core/runs/index.d.ts +20 -0
- package/dist/server/core/runs/index.d.ts.map +1 -0
- package/dist/server/core/runs/index.js +19 -0
- package/dist/server/core/runs/index.js.map +1 -0
- package/dist/server/core/runs/input-gate.d.ts +34 -0
- package/dist/server/core/runs/input-gate.d.ts.map +1 -0
- package/dist/server/core/runs/input-gate.js +54 -0
- package/dist/server/core/runs/input-gate.js.map +1 -0
- package/dist/server/core/runs/lifecycle.d.ts +46 -0
- package/dist/server/core/runs/lifecycle.d.ts.map +1 -0
- package/dist/server/core/runs/lifecycle.js +390 -0
- package/dist/server/core/runs/lifecycle.js.map +1 -0
- package/dist/server/core/runs/policy.d.ts +41 -0
- package/dist/server/core/runs/policy.d.ts.map +1 -0
- package/dist/server/core/runs/policy.js +48 -0
- package/dist/server/core/runs/policy.js.map +1 -0
- package/dist/server/core/runs/ports.d.ts +253 -0
- package/dist/server/core/runs/ports.d.ts.map +1 -0
- package/dist/server/core/runs/ports.js +22 -0
- package/dist/server/core/runs/ports.js.map +1 -0
- package/dist/server/core/runs/preview.d.ts +47 -0
- package/dist/server/core/runs/preview.d.ts.map +1 -0
- package/dist/server/core/runs/preview.js +104 -0
- package/dist/server/core/runs/preview.js.map +1 -0
- package/dist/server/core/runs/run-requests.d.ts +220 -0
- package/dist/server/core/runs/run-requests.d.ts.map +1 -0
- package/dist/server/core/runs/run-requests.js +475 -0
- package/dist/server/core/runs/run-requests.js.map +1 -0
- package/dist/server/core/runs/run-tokens.d.ts +21 -0
- package/dist/server/core/runs/run-tokens.d.ts.map +1 -0
- package/dist/server/core/runs/run-tokens.js +51 -0
- package/dist/server/core/runs/run-tokens.js.map +1 -0
- package/dist/server/core/runs/run.service.d.ts +240 -0
- package/dist/server/core/runs/run.service.d.ts.map +1 -0
- package/dist/server/core/runs/run.service.js +813 -0
- package/dist/server/core/runs/run.service.js.map +1 -0
- package/dist/server/core/runs/run.store.d.ts +203 -0
- package/dist/server/core/runs/run.store.d.ts.map +1 -0
- package/dist/server/core/runs/run.store.js +293 -0
- package/dist/server/core/runs/run.store.js.map +1 -0
- package/dist/server/core/runs/runner-view.d.ts +48 -0
- package/dist/server/core/runs/runner-view.d.ts.map +1 -0
- package/dist/server/core/runs/runner-view.js +121 -0
- package/dist/server/core/runs/runner-view.js.map +1 -0
- package/dist/server/core/runs/selection.d.ts +13 -0
- package/dist/server/core/runs/selection.d.ts.map +1 -0
- package/dist/server/core/runs/selection.js +21 -0
- package/dist/server/core/runs/selection.js.map +1 -0
- package/dist/server/core/runs/sweeper.d.ts +28 -0
- package/dist/server/core/runs/sweeper.d.ts.map +1 -0
- package/dist/server/core/runs/sweeper.js +243 -0
- package/dist/server/core/runs/sweeper.js.map +1 -0
- package/dist/server/core/runs/transitions.d.ts +41 -0
- package/dist/server/core/runs/transitions.d.ts.map +1 -0
- package/dist/server/core/runs/transitions.js +169 -0
- package/dist/server/core/runs/transitions.js.map +1 -0
- package/dist/server/core/runs/workload.d.ts +49 -0
- package/dist/server/core/runs/workload.d.ts.map +1 -0
- package/dist/server/core/runs/workload.js +390 -0
- package/dist/server/core/runs/workload.js.map +1 -0
- package/dist/server/core/runs/workspace.store.d.ts +23 -0
- package/dist/server/core/runs/workspace.store.d.ts.map +1 -0
- package/dist/server/core/runs/workspace.store.js +77 -0
- package/dist/server/core/runs/workspace.store.js.map +1 -0
- package/dist/server/core/skills/blobs.d.ts +65 -0
- package/dist/server/core/skills/blobs.d.ts.map +1 -0
- package/dist/server/core/skills/blobs.js +212 -0
- package/dist/server/core/skills/blobs.js.map +1 -0
- package/dist/server/core/skills/bundle.d.ts +27 -0
- package/dist/server/core/skills/bundle.d.ts.map +1 -0
- package/dist/server/core/skills/bundle.js +71 -0
- package/dist/server/core/skills/bundle.js.map +1 -0
- package/dist/server/core/skills/index.d.ts +6 -0
- package/dist/server/core/skills/index.d.ts.map +1 -0
- package/dist/server/core/skills/index.js +6 -0
- package/dist/server/core/skills/index.js.map +1 -0
- package/dist/server/core/skills/skill.service.d.ts +105 -0
- package/dist/server/core/skills/skill.service.d.ts.map +1 -0
- package/dist/server/core/skills/skill.service.js +625 -0
- package/dist/server/core/skills/skill.service.js.map +1 -0
- package/dist/server/core/skills/skill.store.d.ts +50 -0
- package/dist/server/core/skills/skill.store.d.ts.map +1 -0
- package/dist/server/core/skills/skill.store.js +58 -0
- package/dist/server/core/skills/skill.store.js.map +1 -0
- package/dist/server/core/skills/zip.d.ts +13 -0
- package/dist/server/core/skills/zip.d.ts.map +1 -0
- package/dist/server/core/skills/zip.js +126 -0
- package/dist/server/core/skills/zip.js.map +1 -0
- package/dist/server/core/variables/index.d.ts +2 -0
- package/dist/server/core/variables/index.d.ts.map +1 -0
- package/dist/server/core/variables/index.js +2 -0
- package/dist/server/core/variables/index.js.map +1 -0
- package/dist/server/core/variables/variable.service.d.ts +115 -0
- package/dist/server/core/variables/variable.service.d.ts.map +1 -0
- package/dist/server/core/variables/variable.service.js +370 -0
- package/dist/server/core/variables/variable.service.js.map +1 -0
- package/dist/server/distribution/dist.service.d.ts +72 -0
- package/dist/server/distribution/dist.service.d.ts.map +1 -0
- package/dist/server/distribution/dist.service.js +237 -0
- package/dist/server/distribution/dist.service.js.map +1 -0
- package/dist/server/distribution/download-tokens.d.ts +30 -0
- package/dist/server/distribution/download-tokens.d.ts.map +1 -0
- package/dist/server/distribution/download-tokens.js +85 -0
- package/dist/server/distribution/download-tokens.js.map +1 -0
- package/dist/server/distribution/index.d.ts +22 -0
- package/dist/server/distribution/index.d.ts.map +1 -0
- package/dist/server/distribution/index.js +51 -0
- package/dist/server/distribution/index.js.map +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +4 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/jobs/index.d.ts +5 -0
- package/dist/server/jobs/index.d.ts.map +1 -0
- package/dist/server/jobs/index.js +5 -0
- package/dist/server/jobs/index.js.map +1 -0
- package/dist/server/jobs/job.service.d.ts +154 -0
- package/dist/server/jobs/job.service.d.ts.map +1 -0
- package/dist/server/jobs/job.service.js +721 -0
- package/dist/server/jobs/job.service.js.map +1 -0
- package/dist/server/jobs/job.store.d.ts +74 -0
- package/dist/server/jobs/job.store.d.ts.map +1 -0
- package/dist/server/jobs/job.store.js +110 -0
- package/dist/server/jobs/job.store.js.map +1 -0
- package/dist/server/jobs/job.transitions.d.ts +41 -0
- package/dist/server/jobs/job.transitions.d.ts.map +1 -0
- package/dist/server/jobs/job.transitions.js +112 -0
- package/dist/server/jobs/job.transitions.js.map +1 -0
- package/dist/server/jobs/registry.d.ts +53 -0
- package/dist/server/jobs/registry.d.ts.map +1 -0
- package/dist/server/jobs/registry.js +32 -0
- package/dist/server/jobs/registry.js.map +1 -0
- package/dist/server/jobs/spec.d.ts +49 -0
- package/dist/server/jobs/spec.d.ts.map +1 -0
- package/dist/server/jobs/spec.js +112 -0
- package/dist/server/jobs/spec.js.map +1 -0
- package/dist/server/kernel/clock.d.ts +10 -0
- package/dist/server/kernel/clock.d.ts.map +1 -0
- package/dist/server/kernel/clock.js +10 -0
- package/dist/server/kernel/clock.js.map +1 -0
- package/dist/server/kernel/crypto.d.ts +18 -0
- package/dist/server/kernel/crypto.d.ts.map +1 -0
- package/dist/server/kernel/crypto.js +25 -0
- package/dist/server/kernel/crypto.js.map +1 -0
- package/dist/server/kernel/errors.d.ts +16 -0
- package/dist/server/kernel/errors.d.ts.map +1 -0
- package/dist/server/kernel/errors.js +45 -0
- package/dist/server/kernel/errors.js.map +1 -0
- package/dist/server/kernel/events.d.ts +147 -0
- package/dist/server/kernel/events.d.ts.map +1 -0
- package/dist/server/kernel/events.js +32 -0
- package/dist/server/kernel/events.js.map +1 -0
- package/dist/server/kernel/http.d.ts +23 -0
- package/dist/server/kernel/http.d.ts.map +1 -0
- package/dist/server/kernel/http.js +56 -0
- package/dist/server/kernel/http.js.map +1 -0
- package/dist/server/kernel/ids.d.ts +9 -0
- package/dist/server/kernel/ids.d.ts.map +1 -0
- package/dist/server/kernel/ids.js +5 -0
- package/dist/server/kernel/ids.js.map +1 -0
- package/dist/server/kernel/people.d.ts +28 -0
- package/dist/server/kernel/people.d.ts.map +1 -0
- package/dist/server/kernel/people.js +30 -0
- package/dist/server/kernel/people.js.map +1 -0
- package/dist/server/kernel/redaction.d.ts +27 -0
- package/dist/server/kernel/redaction.d.ts.map +1 -0
- package/dist/server/kernel/redaction.js +56 -0
- package/dist/server/kernel/redaction.js.map +1 -0
- package/dist/server/kernel/scopes.d.ts +34 -0
- package/dist/server/kernel/scopes.d.ts.map +1 -0
- package/dist/server/kernel/scopes.js +47 -0
- package/dist/server/kernel/scopes.js.map +1 -0
- package/dist/server/kernel/secrets.d.ts +12 -0
- package/dist/server/kernel/secrets.d.ts.map +1 -0
- package/dist/server/kernel/secrets.js +20 -0
- package/dist/server/kernel/secrets.js.map +1 -0
- package/dist/server/kernel/tx.d.ts +18 -0
- package/dist/server/kernel/tx.d.ts.map +1 -0
- package/dist/server/kernel/tx.js +15 -0
- package/dist/server/kernel/tx.js.map +1 -0
- package/dist/server/kernel/values.d.ts +19 -0
- package/dist/server/kernel/values.d.ts.map +1 -0
- package/dist/server/kernel/values.js +64 -0
- package/dist/server/kernel/values.js.map +1 -0
- package/dist/server/locales/en-US.d.ts +4 -0
- package/dist/server/locales/en-US.d.ts.map +1 -0
- package/dist/server/locales/en-US.js +6 -0
- package/dist/server/locales/en-US.js.map +1 -0
- package/dist/server/locales/index.d.ts +4 -0
- package/dist/server/locales/index.d.ts.map +1 -0
- package/dist/server/locales/index.js +6 -0
- package/dist/server/locales/index.js.map +1 -0
- package/dist/server/locales/zh-CN.d.ts +4 -0
- package/dist/server/locales/zh-CN.d.ts.map +1 -0
- package/dist/server/locales/zh-CN.js +6 -0
- package/dist/server/locales/zh-CN.js.map +1 -0
- package/dist/server/online/gateway.d.ts +240 -0
- package/dist/server/online/gateway.d.ts.map +1 -0
- package/dist/server/online/gateway.js +552 -0
- package/dist/server/online/gateway.js.map +1 -0
- package/dist/server/online/index.d.ts +5 -0
- package/dist/server/online/index.d.ts.map +1 -0
- package/dist/server/online/index.js +5 -0
- package/dist/server/online/index.js.map +1 -0
- package/dist/server/online/providers.d.ts +58 -0
- package/dist/server/online/providers.d.ts.map +1 -0
- package/dist/server/online/providers.js +370 -0
- package/dist/server/online/providers.js.map +1 -0
- package/dist/server/online/routes.d.ts +9 -0
- package/dist/server/online/routes.d.ts.map +1 -0
- package/dist/server/online/routes.js +168 -0
- package/dist/server/online/routes.js.map +1 -0
- package/dist/server/online/services.d.ts +49 -0
- package/dist/server/online/services.d.ts.map +1 -0
- package/dist/server/online/services.js +444 -0
- package/dist/server/online/services.js.map +1 -0
- package/dist/server/plugin.d.ts +4 -0
- package/dist/server/plugin.d.ts.map +1 -0
- package/dist/server/plugin.js +20 -0
- package/dist/server/plugin.js.map +1 -0
- package/dist/server/providers/agents.d.ts +63 -0
- package/dist/server/providers/agents.d.ts.map +1 -0
- package/dist/server/providers/agents.js +236 -0
- package/dist/server/providers/agents.js.map +1 -0
- package/dist/server/providers/authorization.d.ts +17 -0
- package/dist/server/providers/authorization.d.ts.map +1 -0
- package/dist/server/providers/authorization.js +60 -0
- package/dist/server/providers/authorization.js.map +1 -0
- package/dist/server/providers/index.d.ts +4 -0
- package/dist/server/providers/index.d.ts.map +1 -0
- package/dist/server/providers/index.js +10 -0
- package/dist/server/providers/index.js.map +1 -0
- package/dist/server/providers/runners.d.ts +19 -0
- package/dist/server/providers/runners.d.ts.map +1 -0
- package/dist/server/providers/runners.js +143 -0
- package/dist/server/providers/runners.js.map +1 -0
- package/dist/server/routes/admin.d.ts +27 -0
- package/dist/server/routes/admin.d.ts.map +1 -0
- package/dist/server/routes/admin.js +1363 -0
- package/dist/server/routes/admin.js.map +1 -0
- package/dist/server/routes/chat.d.ts +9 -0
- package/dist/server/routes/chat.d.ts.map +1 -0
- package/dist/server/routes/chat.js +512 -0
- package/dist/server/routes/chat.js.map +1 -0
- package/dist/server/routes/index.d.ts +6 -0
- package/dist/server/routes/index.d.ts.map +1 -0
- package/dist/server/routes/index.js +110 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/openapi.d.ts +30 -0
- package/dist/server/routes/openapi.d.ts.map +1 -0
- package/dist/server/routes/openapi.js +101 -0
- package/dist/server/routes/openapi.js.map +1 -0
- package/dist/server/routes/roster.d.ts +6 -0
- package/dist/server/routes/roster.d.ts.map +1 -0
- package/dist/server/routes/roster.js +37 -0
- package/dist/server/routes/roster.js.map +1 -0
- package/dist/server/routes/run-requests.d.ts +6 -0
- package/dist/server/routes/run-requests.d.ts.map +1 -0
- package/dist/server/routes/run-requests.js +216 -0
- package/dist/server/routes/run-requests.js.map +1 -0
- package/dist/server/routes/run.d.ts +10 -0
- package/dist/server/routes/run.d.ts.map +1 -0
- package/dist/server/routes/run.js +91 -0
- package/dist/server/routes/run.js.map +1 -0
- package/dist/server/routes/runners/admin.d.ts +28 -0
- package/dist/server/routes/runners/admin.d.ts.map +1 -0
- package/dist/server/routes/runners/admin.js +318 -0
- package/dist/server/routes/runners/admin.js.map +1 -0
- package/dist/server/routes/runners/dist.d.ts +24 -0
- package/dist/server/routes/runners/dist.d.ts.map +1 -0
- package/dist/server/routes/runners/dist.js +217 -0
- package/dist/server/routes/runners/dist.js.map +1 -0
- package/dist/server/routes/runners/install.d.ts +23 -0
- package/dist/server/routes/runners/install.d.ts.map +1 -0
- package/dist/server/routes/runners/install.js +435 -0
- package/dist/server/routes/runners/install.js.map +1 -0
- package/dist/server/routes/runners/runner.d.ts +9 -0
- package/dist/server/routes/runners/runner.d.ts.map +1 -0
- package/dist/server/routes/runners/runner.js +321 -0
- package/dist/server/routes/runners/runner.js.map +1 -0
- package/dist/server/routes/runners/runs.d.ts +5 -0
- package/dist/server/routes/runners/runs.d.ts.map +1 -0
- package/dist/server/routes/runners/runs.js +94 -0
- package/dist/server/routes/runners/runs.js.map +1 -0
- package/dist/server/routes/schemas.d.ts +249 -0
- package/dist/server/routes/schemas.d.ts.map +1 -0
- package/dist/server/routes/schemas.js +1325 -0
- package/dist/server/routes/schemas.js.map +1 -0
- package/dist/server/runners/index.d.ts +14 -0
- package/dist/server/runners/index.d.ts.map +1 -0
- package/dist/server/runners/index.js +7 -0
- package/dist/server/runners/index.js.map +1 -0
- package/dist/server/runners/runner.service.d.ts +91 -0
- package/dist/server/runners/runner.service.d.ts.map +1 -0
- package/dist/server/runners/runner.service.js +482 -0
- package/dist/server/runners/runner.service.js.map +1 -0
- package/dist/server/runners/runner.store.d.ts +83 -0
- package/dist/server/runners/runner.store.d.ts.map +1 -0
- package/dist/server/runners/runner.store.js +234 -0
- package/dist/server/runners/runner.store.js.map +1 -0
- package/dist/server/runners/signal.d.ts +13 -0
- package/dist/server/runners/signal.d.ts.map +1 -0
- package/dist/server/runners/signal.js +30 -0
- package/dist/server/runners/signal.js.map +1 -0
- package/dist/server/runners/slots.d.ts +26 -0
- package/dist/server/runners/slots.d.ts.map +1 -0
- package/dist/server/runners/slots.js +27 -0
- package/dist/server/runners/slots.js.map +1 -0
- package/dist/server/runners/sweeper.d.ts +26 -0
- package/dist/server/runners/sweeper.d.ts.map +1 -0
- package/dist/server/runners/sweeper.js +21 -0
- package/dist/server/runners/sweeper.js.map +1 -0
- package/dist/server/runners/workspaces.d.ts +33 -0
- package/dist/server/runners/workspaces.d.ts.map +1 -0
- package/dist/server/runners/workspaces.js +248 -0
- package/dist/server/runners/workspaces.js.map +1 -0
- package/dist/server/secrets-stores.d.ts +8 -0
- package/dist/server/secrets-stores.d.ts.map +1 -0
- package/dist/server/secrets-stores.js +43 -0
- package/dist/server/secrets-stores.js.map +1 -0
- package/dist/server/testing.d.ts +14 -0
- package/dist/server/testing.d.ts.map +1 -0
- package/dist/server/testing.js +21 -0
- package/dist/server/testing.js.map +1 -0
- package/dist/server/tokens.d.ts +42 -0
- package/dist/server/tokens.d.ts.map +1 -0
- package/dist/server/tokens.js +12 -0
- package/dist/server/tokens.js.map +1 -0
- package/dist/server/vectors/index.d.ts +7 -0
- package/dist/server/vectors/index.d.ts.map +1 -0
- package/dist/server/vectors/index.js +6 -0
- package/dist/server/vectors/index.js.map +1 -0
- package/dist/server/vectors/naming.d.ts +6 -0
- package/dist/server/vectors/naming.d.ts.map +1 -0
- package/dist/server/vectors/naming.js +15 -0
- package/dist/server/vectors/naming.js.map +1 -0
- package/dist/server/vectors/pgvector.d.ts +26 -0
- package/dist/server/vectors/pgvector.d.ts.map +1 -0
- package/dist/server/vectors/pgvector.js +346 -0
- package/dist/server/vectors/pgvector.js.map +1 -0
- package/dist/server/vectors/sqlite-vec.d.ts +14 -0
- package/dist/server/vectors/sqlite-vec.d.ts.map +1 -0
- package/dist/server/vectors/sqlite-vec.js +286 -0
- package/dist/server/vectors/sqlite-vec.js.map +1 -0
- package/dist/server/vectors/types.d.ts +256 -0
- package/dist/server/vectors/types.d.ts.map +1 -0
- package/dist/server/vectors/types.js +2 -0
- package/dist/server/vectors/types.js.map +1 -0
- package/dist/server/vectors/vectors.d.ts +34 -0
- package/dist/server/vectors/vectors.d.ts.map +1 -0
- package/dist/server/vectors/vectors.js +866 -0
- package/dist/server/vectors/vectors.js.map +1 -0
- package/dist/shared/access.d.ts +150 -0
- package/dist/shared/access.d.ts.map +1 -0
- package/dist/shared/access.js +162 -0
- package/dist/shared/access.js.map +1 -0
- package/dist/shared/agents.d.ts +247 -0
- package/dist/shared/agents.d.ts.map +1 -0
- package/dist/shared/agents.js +92 -0
- package/dist/shared/agents.js.map +1 -0
- package/dist/shared/briefs.d.ts +46 -0
- package/dist/shared/briefs.d.ts.map +1 -0
- package/dist/shared/briefs.js +10 -0
- package/dist/shared/briefs.js.map +1 -0
- package/dist/shared/conversations.d.ts +577 -0
- package/dist/shared/conversations.d.ts.map +1 -0
- package/dist/shared/conversations.js +163 -0
- package/dist/shared/conversations.js.map +1 -0
- package/dist/shared/i18n.d.ts +10 -0
- package/dist/shared/i18n.d.ts.map +1 -0
- package/dist/shared/i18n.js +2 -0
- package/dist/shared/i18n.js.map +1 -0
- package/dist/shared/jobs.d.ts +73 -0
- package/dist/shared/jobs.d.ts.map +1 -0
- package/dist/shared/jobs.js +3 -0
- package/dist/shared/jobs.js.map +1 -0
- package/dist/shared/locales/access.en-US.d.ts +47 -0
- package/dist/shared/locales/access.en-US.d.ts.map +1 -0
- package/dist/shared/locales/access.en-US.js +51 -0
- package/dist/shared/locales/access.en-US.js.map +1 -0
- package/dist/shared/locales/access.zh-CN.d.ts +4 -0
- package/dist/shared/locales/access.zh-CN.d.ts.map +1 -0
- package/dist/shared/locales/access.zh-CN.js +51 -0
- package/dist/shared/locales/access.zh-CN.js.map +1 -0
- package/dist/shared/model-catalog.d.ts +48 -0
- package/dist/shared/model-catalog.d.ts.map +1 -0
- package/dist/shared/model-catalog.js +148 -0
- package/dist/shared/model-catalog.js.map +1 -0
- package/dist/shared/models.d.ts +196 -0
- package/dist/shared/models.d.ts.map +1 -0
- package/dist/shared/models.js +142 -0
- package/dist/shared/models.js.map +1 -0
- package/dist/shared/realtime.d.ts +27 -0
- package/dist/shared/realtime.d.ts.map +1 -0
- package/dist/shared/realtime.js +7 -0
- package/dist/shared/realtime.js.map +1 -0
- package/dist/shared/reports.d.ts +293 -0
- package/dist/shared/reports.d.ts.map +1 -0
- package/dist/shared/reports.js +135 -0
- package/dist/shared/reports.js.map +1 -0
- package/dist/shared/runners.d.ts +336 -0
- package/dist/shared/runners.d.ts.map +1 -0
- package/dist/shared/runners.js +132 -0
- package/dist/shared/runners.js.map +1 -0
- package/dist/shared/runs.d.ts +407 -0
- package/dist/shared/runs.d.ts.map +1 -0
- package/dist/shared/runs.js +65 -0
- package/dist/shared/runs.js.map +1 -0
- package/dist/shared/skill-markdown.d.ts +45 -0
- package/dist/shared/skill-markdown.d.ts.map +1 -0
- package/dist/shared/skill-markdown.js +131 -0
- package/dist/shared/skill-markdown.js.map +1 -0
- package/dist/shared/skills.d.ts +155 -0
- package/dist/shared/skills.d.ts.map +1 -0
- package/dist/shared/skills.js +61 -0
- package/dist/shared/skills.js.map +1 -0
- package/dist/shared/variables.d.ts +73 -0
- package/dist/shared/variables.d.ts.map +1 -0
- package/dist/shared/variables.js +54 -0
- package/dist/shared/variables.js.map +1 -0
- package/dist/shared/vocabulary.d.ts +44 -0
- package/dist/shared/vocabulary.d.ts.map +1 -0
- package/dist/shared/vocabulary.js +2 -0
- package/dist/shared/vocabulary.js.map +1 -0
- package/package.json +200 -3
- package/skills/nocobase-app-plugin-agents/SKILL.md +35 -0
- package/skills/nocobase-app-plugin-agents/references/agents.md +30 -0
- package/skills/nocobase-app-plugin-agents/references/distribution.md +79 -0
- package/skills/nocobase-app-plugin-agents/references/extension-points.md +43 -0
- package/skills/nocobase-app-plugin-agents/references/model-services.md +17 -0
- package/skills/nocobase-app-plugin-agents/references/runners.md +46 -0
- package/skills/nocobase-app-plugin-agents/references/setup-and-config.md +57 -0
- package/skills/nocobase-app-plugin-agents/references/variables-skills-usage.md +21 -0
- package/skills/nocobase-app-plugin-agents/references/verification-and-troubleshooting.md +47 -0
|
@@ -0,0 +1,1098 @@
|
|
|
1
|
+
import { CONVERSATION_HISTORY_IN_PROMPT, CONVERSATION_PAGE_DEFAULT, CONVERSATION_PAGE_MAX, CONVERSATION_SOURCE_PATTERN, CONVERSATION_SUBJECT, CONVERSATION_TITLE_AGENT_MAX, CONVERSATION_TITLE_AUTO_CHARS, CONVERSATION_TITLE_MAX, MESSAGE_CONTENT_MAX, MESSAGE_PAGE_DEFAULT, MESSAGE_PAGE_MAX, } from '../../../shared/conversations.js';
|
|
2
|
+
import { runnerTakesAgent } from '../../../shared/runners.js';
|
|
3
|
+
import { CONSULT_MAX_DEPTH } from '../../../shared/runs.js';
|
|
4
|
+
import { ACCESS_NAMESPACE } from '../../../shared/access.js';
|
|
5
|
+
import { sampleValue } from '../../../shared/briefs.js';
|
|
6
|
+
import { forbidden, invalid, notFound, ProtocolError, } from '../../kernel/errors.js';
|
|
7
|
+
import { asJson } from '../../kernel/values.js';
|
|
8
|
+
import { findAgent } from '../agents/index.js';
|
|
9
|
+
import { agentNamesOf } from '../agents/agent.store.js';
|
|
10
|
+
import { eventsAfter, hasSession, lastSummary, openRunsOnEach, queuedRun, } from '../runs/index.js';
|
|
11
|
+
import { findRunRecord, toRun } from '../runs/run.store.js';
|
|
12
|
+
import { readAttachmentIds, storedAttachments, } from './attachments.js';
|
|
13
|
+
import { availabilityOf, wakeable } from './availability.js';
|
|
14
|
+
import { appendMessage, conversationsRepo, findConversation, findDraft, metadataOf, rewriteMessage, lockConversation, messagesRepo, toMessage, updateMessageRun, } from './conversation.store.js';
|
|
15
|
+
import { hasContent, renderPageContext, } from './page-context.js';
|
|
16
|
+
import { attachmentLines, conversationContext, conversationKey, conversationSystemLayer, conversationTask, conversationTurn, conversationUrl, } from './prompt.js';
|
|
17
|
+
import { autoTitle, cleanTitle } from './titles.js';
|
|
18
|
+
/** Events read per page while turning a run's events into messages. */
|
|
19
|
+
const SYNC_PAGE = 500;
|
|
20
|
+
function conversationConflict(reason, message) {
|
|
21
|
+
return new ProtocolError('CONVERSATION_CONFLICT', message, { reason });
|
|
22
|
+
}
|
|
23
|
+
function threadScopeOf(record) {
|
|
24
|
+
return `t${Number(record.thread)}`;
|
|
25
|
+
}
|
|
26
|
+
function subjectOf(id) {
|
|
27
|
+
return { kind: CONVERSATION_SUBJECT, id };
|
|
28
|
+
}
|
|
29
|
+
function encodeCursor(at, id) {
|
|
30
|
+
return Buffer.from(JSON.stringify([at, id]), 'utf8').toString('base64url');
|
|
31
|
+
}
|
|
32
|
+
function decodeCursor(cursor) {
|
|
33
|
+
try {
|
|
34
|
+
const value = JSON.parse(Buffer.from(cursor, 'base64url').toString('utf8'));
|
|
35
|
+
if (Array.isArray(value) &&
|
|
36
|
+
typeof value[0] === 'string' &&
|
|
37
|
+
typeof value[1] === 'string')
|
|
38
|
+
return { at: value[0], id: value[1] };
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Falls through to the error below.
|
|
42
|
+
}
|
|
43
|
+
throw invalid('pageToken is not one this API gave.', { field: 'pageToken' });
|
|
44
|
+
}
|
|
45
|
+
function limitOf(value, fallback, max) {
|
|
46
|
+
if (value === undefined)
|
|
47
|
+
return fallback;
|
|
48
|
+
return Math.min(Math.max(Math.trunc(value), 1), max);
|
|
49
|
+
}
|
|
50
|
+
/** The places conversations are started from besides the panel, as the application registers them. */
|
|
51
|
+
function createSources() {
|
|
52
|
+
const sources = new Map();
|
|
53
|
+
return {
|
|
54
|
+
register(source) {
|
|
55
|
+
if (source.key === 'panel' ||
|
|
56
|
+
!CONVERSATION_SOURCE_PATTERN.test(source.key))
|
|
57
|
+
throw new Error(`Not a conversation source: ${source.key}`);
|
|
58
|
+
if (sources.has(source.key))
|
|
59
|
+
throw new Error(`Conversation source already registered: ${source.key}`);
|
|
60
|
+
sources.set(source.key, source);
|
|
61
|
+
return () => {
|
|
62
|
+
if (sources.get(source.key) === source)
|
|
63
|
+
sources.delete(source.key);
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
has: (key) => sources.has(key),
|
|
67
|
+
list: () => [...sources.values()],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** The conversation subject's names for its triggers in the run panel. */
|
|
71
|
+
const CONVERSATION_TRIGGERS = {
|
|
72
|
+
message: { key: 'runs.trigger.message', ns: ACCESS_NAMESPACE },
|
|
73
|
+
};
|
|
74
|
+
/** The English text of a notice; the panel shows its own translation of `notice.code`. */
|
|
75
|
+
function noticeText(notice, names) {
|
|
76
|
+
const name = (id) => names.get(id) ?? 'another agent';
|
|
77
|
+
switch (notice.code) {
|
|
78
|
+
case 'switchedToDefault':
|
|
79
|
+
return `This conversation now uses ${name(notice.agentId)}, the default agent, until you switch back to ${name(notice.fromAgentId)}.`;
|
|
80
|
+
case 'switchedToOnline':
|
|
81
|
+
return `${name(notice.fromAgentId)} has no runner for you now, so ${name(notice.agentId)} answers until you switch back.`;
|
|
82
|
+
case 'onlineFallbackUnavailable':
|
|
83
|
+
return `The online fallback agent cannot answer (${notice.reason}). This conversation stays with ${name(notice.fromAgentId)} while it waits for a runner.`;
|
|
84
|
+
case 'switchedBack':
|
|
85
|
+
return `This conversation is back with ${name(notice.agentId)}.`;
|
|
86
|
+
case 'runFailed':
|
|
87
|
+
return `The agent stopped before answering${notice.reason ? ` (${notice.reason})` : ''}.`;
|
|
88
|
+
case 'runCancelled':
|
|
89
|
+
return 'You stopped the agent.';
|
|
90
|
+
case 'news':
|
|
91
|
+
return notice.title;
|
|
92
|
+
case 'consultation':
|
|
93
|
+
return `Consulted ${notice.agentName}: ${notice.question}`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function refOf(record) {
|
|
97
|
+
return {
|
|
98
|
+
id: record.id,
|
|
99
|
+
userId: record.userId,
|
|
100
|
+
agentId: record.agentId,
|
|
101
|
+
title: record.title,
|
|
102
|
+
source: record.source,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export function createConversationService(deps) {
|
|
106
|
+
const { tx, ids, clock } = deps;
|
|
107
|
+
const now = () => clock.now().toISOString();
|
|
108
|
+
/** A message as the API answers it, its files' URLs under the application's base path. */
|
|
109
|
+
const viewOf = (record) => toMessage(record, deps.basePath?.() ?? '');
|
|
110
|
+
const rules = [];
|
|
111
|
+
const sources = createSources();
|
|
112
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
113
|
+
// Reading
|
|
114
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
115
|
+
/** The conversation if `userId` owns it; 404 otherwise. */
|
|
116
|
+
async function owned(conn, userId, id) {
|
|
117
|
+
const record = await findConversation(conn, id);
|
|
118
|
+
if (!record || record.userId !== userId)
|
|
119
|
+
throw notFound('Conversation');
|
|
120
|
+
return record;
|
|
121
|
+
}
|
|
122
|
+
/** Locks the conversation if `userId` owns it; 404 otherwise. */
|
|
123
|
+
async function lockOwned(unit, userId, id) {
|
|
124
|
+
await owned(unit.conn, userId, id);
|
|
125
|
+
return (await lockConversation(unit.conn, id, now()));
|
|
126
|
+
}
|
|
127
|
+
function agentRef(id, agent) {
|
|
128
|
+
return {
|
|
129
|
+
id,
|
|
130
|
+
name: agent?.name ?? null,
|
|
131
|
+
nameText: agent?.nameText ?? null,
|
|
132
|
+
avatar: agent?.avatar ?? null,
|
|
133
|
+
archived: agent ? agent.status !== 'enabled' : false,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function runRef(runs) {
|
|
137
|
+
const run = runs[runs.length - 1];
|
|
138
|
+
return run
|
|
139
|
+
? { id: run.id, status: run.status, acceptsInput: run.acceptsInput }
|
|
140
|
+
: null;
|
|
141
|
+
}
|
|
142
|
+
async function summaries(conn, records) {
|
|
143
|
+
const agents = new Map();
|
|
144
|
+
for (const record of records)
|
|
145
|
+
for (const id of [record.agentId, record.fallbackFromAgentId])
|
|
146
|
+
if (id && !agents.has(id))
|
|
147
|
+
agents.set(id, await findAgent(conn, id));
|
|
148
|
+
const open = await openRunsOnEach(conn, CONVERSATION_SUBJECT, records.map((record) => record.id));
|
|
149
|
+
return records.map((record) => ({
|
|
150
|
+
id: record.id,
|
|
151
|
+
title: record.title,
|
|
152
|
+
titleSource: record.titleSource,
|
|
153
|
+
category: record.category,
|
|
154
|
+
source: record.source,
|
|
155
|
+
mode: record.mode,
|
|
156
|
+
agent: agentRef(record.agentId, agents.get(record.agentId) ?? null),
|
|
157
|
+
fallbackFrom: record.fallbackFromAgentId
|
|
158
|
+
? agentRef(record.fallbackFromAgentId, agents.get(record.fallbackFromAgentId) ?? null)
|
|
159
|
+
: null,
|
|
160
|
+
read: Boolean(record.read),
|
|
161
|
+
lastMessageAt: record.lastMessageAt,
|
|
162
|
+
archivedAt: record.archivedAt,
|
|
163
|
+
createdAt: record.createdAt,
|
|
164
|
+
updatedAt: record.updatedAt,
|
|
165
|
+
run: runRef(open.filter((run) => run.subject.id === record.id)),
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
async function systemDefault(conn, userId) {
|
|
169
|
+
const { defaultAgentId } = await deps.settings.settings(conn);
|
|
170
|
+
if (!defaultAgentId)
|
|
171
|
+
return null;
|
|
172
|
+
const agent = await findAgent(conn, defaultAgentId);
|
|
173
|
+
return wakeable(agent, userId, deps.agents.mayInvoke) ? agent : null;
|
|
174
|
+
}
|
|
175
|
+
/** Reads the same features and variable restrictions as claim, before any write transaction. */
|
|
176
|
+
async function availabilityFor(conn, agent, userId, runners) {
|
|
177
|
+
if (!wakeable(agent, userId, deps.agents.mayInvoke))
|
|
178
|
+
return availabilityOf(agent, userId, deps.agents.mayInvoke, 0);
|
|
179
|
+
const online = runners ??
|
|
180
|
+
(await deps.runners.list()).filter((runner) => runner.status === 'online');
|
|
181
|
+
const eligible = await deps.eligibility.runnersFor(conn, agent, {
|
|
182
|
+
actorUserId: userId,
|
|
183
|
+
runners: online,
|
|
184
|
+
});
|
|
185
|
+
return availabilityOf(agent, userId, deps.agents.mayInvoke, eligible.length, online.some((runner) => runnerTakesAgent(runner, agent)));
|
|
186
|
+
}
|
|
187
|
+
async function canAnswer(conn, agent, userId) {
|
|
188
|
+
if (!wakeable(agent, userId, deps.agents.mayInvoke))
|
|
189
|
+
return false;
|
|
190
|
+
return deps.eligibility.canClaim(conn, agent, { actorUserId: userId });
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The agent `fallback` switches the conversation to: the system default when it can answer. Null while the
|
|
194
|
+
* conversation already uses another agent in place of its own.
|
|
195
|
+
*/
|
|
196
|
+
async function fallbackTarget(conn, record) {
|
|
197
|
+
if (record.fallbackFromAgentId)
|
|
198
|
+
return null;
|
|
199
|
+
const system = await systemDefault(conn, record.userId);
|
|
200
|
+
if (system &&
|
|
201
|
+
system.id !== record.agentId &&
|
|
202
|
+
(await canAnswer(conn, system, record.userId)))
|
|
203
|
+
return system;
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
async function detailOf(conn, record) {
|
|
207
|
+
const [summary] = await summaries(conn, [record]);
|
|
208
|
+
const agent = await findAgent(conn, record.agentId);
|
|
209
|
+
const fallbackFrom = record.fallbackFromAgentId
|
|
210
|
+
? await findAgent(conn, record.fallbackFromAgentId)
|
|
211
|
+
: null;
|
|
212
|
+
const target = await fallbackTarget(conn, record);
|
|
213
|
+
return {
|
|
214
|
+
...summary,
|
|
215
|
+
availability: await availabilityFor(conn, agent, record.userId),
|
|
216
|
+
canFallback: Boolean(target),
|
|
217
|
+
canRestore: await canAnswer(conn, fallbackFrom, record.userId),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
async function detail(userId, id) {
|
|
221
|
+
const conn = tx.read();
|
|
222
|
+
return detailOf(conn, await owned(conn, userId, id));
|
|
223
|
+
}
|
|
224
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
225
|
+
// Writing
|
|
226
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
227
|
+
function changed(unit, record, lastSeq) {
|
|
228
|
+
unit.emit({
|
|
229
|
+
type: 'conversation.changed',
|
|
230
|
+
conversationId: record.id,
|
|
231
|
+
userId: record.userId,
|
|
232
|
+
...(lastSeq === undefined ? {} : { lastSeq }),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
async function append(unit, record, message) {
|
|
236
|
+
const appended = await appendMessage(unit.conn, ids, record.id, message, now());
|
|
237
|
+
changed(unit, record, Number(appended.seq));
|
|
238
|
+
return appended;
|
|
239
|
+
}
|
|
240
|
+
async function notice(unit, record, value, runId = null) {
|
|
241
|
+
const agentIds = value.code === 'switchedToDefault' ||
|
|
242
|
+
value.code === 'switchedToOnline' ||
|
|
243
|
+
value.code === 'switchedBack'
|
|
244
|
+
? [value.agentId, value.fromAgentId]
|
|
245
|
+
: value.code === 'onlineFallbackUnavailable'
|
|
246
|
+
? [value.fromAgentId]
|
|
247
|
+
: [];
|
|
248
|
+
const names = new Map();
|
|
249
|
+
for (const id of agentIds) {
|
|
250
|
+
const agent = await findAgent(unit.conn, id);
|
|
251
|
+
if (agent)
|
|
252
|
+
names.set(id, agent.name);
|
|
253
|
+
}
|
|
254
|
+
await append(unit, record, {
|
|
255
|
+
role: 'system',
|
|
256
|
+
text: noticeText(value, names),
|
|
257
|
+
metadata: { notice: value },
|
|
258
|
+
runId,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
async function nameOf(conn, userId) {
|
|
262
|
+
return (await deps.people.names(conn, [userId])).get(userId) ?? userId;
|
|
263
|
+
}
|
|
264
|
+
/** The run input a user message becomes: its text, its files, and its page context marked as data. */
|
|
265
|
+
function inputText(message) {
|
|
266
|
+
const view = toMessage(message);
|
|
267
|
+
const context = view.workContext;
|
|
268
|
+
return [
|
|
269
|
+
view.content.content.trim(),
|
|
270
|
+
attachmentLines(storedAttachments(message.attachments)),
|
|
271
|
+
hasContent(context) ? renderPageContext(context) : '',
|
|
272
|
+
]
|
|
273
|
+
.filter((part) => part !== '')
|
|
274
|
+
.join('\n\n');
|
|
275
|
+
}
|
|
276
|
+
/** Hands user messages to the conversation's agent, oldest first. */
|
|
277
|
+
async function wake(unit, record, messages) {
|
|
278
|
+
const agent = await findAgent(unit.conn, record.agentId);
|
|
279
|
+
if (!wakeable(agent, record.userId, deps.agents.mayInvoke))
|
|
280
|
+
return null;
|
|
281
|
+
const name = await nameOf(unit.conn, record.userId);
|
|
282
|
+
let result = null;
|
|
283
|
+
for (const message of messages) {
|
|
284
|
+
const files = storedAttachments(message.attachments);
|
|
285
|
+
const enqueued = queuedRun(await deps.runs.enqueue({
|
|
286
|
+
agentId: agent.id,
|
|
287
|
+
subject: subjectOf(record.id),
|
|
288
|
+
threadScope: threadScopeOf(record),
|
|
289
|
+
actorUserId: record.userId,
|
|
290
|
+
ownerUserId: record.userId,
|
|
291
|
+
input: {
|
|
292
|
+
type: 'comment',
|
|
293
|
+
actor: { kind: 'user', id: record.userId, name },
|
|
294
|
+
text: inputText(message),
|
|
295
|
+
payload: {
|
|
296
|
+
trigger: 'message',
|
|
297
|
+
conversationId: record.id,
|
|
298
|
+
messageId: message.id,
|
|
299
|
+
seq: Number(message.seq),
|
|
300
|
+
...(files.length > 0
|
|
301
|
+
? { attachmentIds: files.map((file) => file.id) }
|
|
302
|
+
: {}),
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
}, unit));
|
|
306
|
+
await updateMessageRun(unit.conn, message, enqueued.runId, { inputId: enqueued.inputId }, now());
|
|
307
|
+
result = { id: enqueued.runId, outcome: enqueued.outcome };
|
|
308
|
+
}
|
|
309
|
+
return result;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Moves the conversation to `agent`: its queued work is withdrawn, the thread moves on (a new session), and the
|
|
313
|
+
* messages nobody answered go to the new agent.
|
|
314
|
+
*/
|
|
315
|
+
async function rebind(unit, record, agent, fallbackFromAgentId, value) {
|
|
316
|
+
const withdrawn = await deps.runs.withdrawQueued({ subject: subjectOf(record.id), byUserId: record.userId }, unit);
|
|
317
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
318
|
+
filter: { id: record.id },
|
|
319
|
+
values: {
|
|
320
|
+
agentId: agent.id,
|
|
321
|
+
mode: 'runner',
|
|
322
|
+
modelService: null,
|
|
323
|
+
model: null,
|
|
324
|
+
fallbackFromAgentId,
|
|
325
|
+
thread: Number(record.thread) + 1,
|
|
326
|
+
updatedAt: now(),
|
|
327
|
+
},
|
|
328
|
+
});
|
|
329
|
+
const moved = (await findConversation(unit.conn, record.id));
|
|
330
|
+
const runIds = withdrawn.map((run) => run.id);
|
|
331
|
+
const unanswered = await messagesRepo(unit.conn).findMany({
|
|
332
|
+
filter: (f) => f.and([
|
|
333
|
+
f.string('conversationId').eq(record.id),
|
|
334
|
+
f.string('role').eq('user'),
|
|
335
|
+
f.or([
|
|
336
|
+
f.string('runId').empty(),
|
|
337
|
+
...runIds.map((id) => f.string('runId').eq(id)),
|
|
338
|
+
]),
|
|
339
|
+
]),
|
|
340
|
+
sort: (sort) => sort.field('seq').asc(),
|
|
341
|
+
});
|
|
342
|
+
await notice(unit, moved, value);
|
|
343
|
+
await wake(unit, moved, unanswered);
|
|
344
|
+
}
|
|
345
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
346
|
+
// Turning run events into messages
|
|
347
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
348
|
+
/** Appends the run's new text events as assistant messages, in the caller's transaction. */
|
|
349
|
+
async function syncIn(unit, run) {
|
|
350
|
+
if (run.subject.kind !== CONVERSATION_SUBJECT)
|
|
351
|
+
return;
|
|
352
|
+
const record = await lockConversation(unit.conn, run.subject.id, now());
|
|
353
|
+
if (!record || record.userId !== run.actorUserId)
|
|
354
|
+
return;
|
|
355
|
+
let after;
|
|
356
|
+
if (record.syncRunId === run.id)
|
|
357
|
+
after = Number(record.syncSeq);
|
|
358
|
+
else {
|
|
359
|
+
const last = await messagesRepo(unit.conn).findOne({
|
|
360
|
+
filter: (f) => f.and([
|
|
361
|
+
f.string('runId').eq(run.id),
|
|
362
|
+
f.number('runEventSeq').notEmpty(),
|
|
363
|
+
]),
|
|
364
|
+
sort: (sort) => sort.field('runEventSeq').desc(),
|
|
365
|
+
});
|
|
366
|
+
after = last ? Number(last.runEventSeq) : 0;
|
|
367
|
+
}
|
|
368
|
+
const start = after;
|
|
369
|
+
for (;;) {
|
|
370
|
+
const events = await eventsAfter(unit.conn, run.id, after, SYNC_PAGE);
|
|
371
|
+
for (const event of events) {
|
|
372
|
+
after = Number(event.seq);
|
|
373
|
+
const text = event.type === 'text' ? (event.content ?? '') : '';
|
|
374
|
+
if (text.trim() === '')
|
|
375
|
+
continue;
|
|
376
|
+
const metadata = {
|
|
377
|
+
agentId: run.agentId,
|
|
378
|
+
runEventSeq: Number(event.seq),
|
|
379
|
+
};
|
|
380
|
+
await append(unit, record, {
|
|
381
|
+
role: 'assistant',
|
|
382
|
+
text,
|
|
383
|
+
runId: run.id,
|
|
384
|
+
runEventSeq: Number(event.seq),
|
|
385
|
+
metadata,
|
|
386
|
+
at: event.at,
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
if (events.length < SYNC_PAGE)
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
if (after !== start || record.syncRunId !== run.id)
|
|
393
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
394
|
+
filter: { id: record.id },
|
|
395
|
+
values: { syncRunId: run.id, syncSeq: after },
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
399
|
+
// The run subject
|
|
400
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
401
|
+
/** A run's assembly in `conversation`, as its owner (`ownerName`) left it: `history` the messages before its inputs. */
|
|
402
|
+
async function conversationAssembly(conn, claim, conversation, ownerName, history, previousSummary) {
|
|
403
|
+
const key = conversationKey(conversation.id);
|
|
404
|
+
const added = await Promise.all(rules.map((source) => source(conn, {
|
|
405
|
+
conversation: {
|
|
406
|
+
id: conversation.id,
|
|
407
|
+
userId: conversation.userId,
|
|
408
|
+
agentId: conversation.agentId,
|
|
409
|
+
title: conversation.title,
|
|
410
|
+
source: conversation.source,
|
|
411
|
+
},
|
|
412
|
+
agent: claim.agent,
|
|
413
|
+
ownerName,
|
|
414
|
+
cli: claim.cli,
|
|
415
|
+
})));
|
|
416
|
+
return {
|
|
417
|
+
subject: {
|
|
418
|
+
key,
|
|
419
|
+
...(conversation.title ? { title: conversation.title } : {}),
|
|
420
|
+
url: conversationUrl(conversation.id),
|
|
421
|
+
noun: 'conversation',
|
|
422
|
+
},
|
|
423
|
+
system: conversationSystemLayer({
|
|
424
|
+
agentName: claim.agent.name,
|
|
425
|
+
ownerName,
|
|
426
|
+
key,
|
|
427
|
+
cli: claim.cli,
|
|
428
|
+
appName: claim.appName,
|
|
429
|
+
rules: added.flatMap((lines) => lines.rules ?? []),
|
|
430
|
+
sections: added.flatMap((lines) => lines.sections ?? []),
|
|
431
|
+
}),
|
|
432
|
+
task: conversationTask({
|
|
433
|
+
key,
|
|
434
|
+
title: conversation.title,
|
|
435
|
+
ownerName,
|
|
436
|
+
}),
|
|
437
|
+
context: conversationContext({
|
|
438
|
+
title: conversation.title,
|
|
439
|
+
startedAt: conversation.createdAt,
|
|
440
|
+
history,
|
|
441
|
+
}),
|
|
442
|
+
turn: {
|
|
443
|
+
prompt: conversationTurn(claim.inputs.length),
|
|
444
|
+
...(previousSummary ? { previousSummary } : {}),
|
|
445
|
+
},
|
|
446
|
+
data: {
|
|
447
|
+
kind: CONVERSATION_SUBJECT,
|
|
448
|
+
conversation: {
|
|
449
|
+
id: conversation.id,
|
|
450
|
+
title: conversation.title,
|
|
451
|
+
ownerUserId: conversation.userId,
|
|
452
|
+
source: conversation.source,
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
dirs: [],
|
|
456
|
+
scopes: [],
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
const binding = {
|
|
460
|
+
kind: CONVERSATION_SUBJECT,
|
|
461
|
+
private: true,
|
|
462
|
+
title: { key: 'subjects.conversation', ns: ACCESS_NAMESPACE },
|
|
463
|
+
triggers: CONVERSATION_TRIGGERS,
|
|
464
|
+
// "Preview full prompt": a new conversation of the previewer's, with one message, both made up.
|
|
465
|
+
preview: {
|
|
466
|
+
inputs: (user, at) => [
|
|
467
|
+
{
|
|
468
|
+
id: 'preview',
|
|
469
|
+
type: 'comment',
|
|
470
|
+
at,
|
|
471
|
+
actor: { kind: 'user', id: user.id, name: user.name },
|
|
472
|
+
text: sampleValue('What is waiting for me this week?'),
|
|
473
|
+
payload: { trigger: 'message' },
|
|
474
|
+
},
|
|
475
|
+
],
|
|
476
|
+
async assemble(conn, claim) {
|
|
477
|
+
return conversationAssembly(conn, claim, {
|
|
478
|
+
id: claim.run.subject.id,
|
|
479
|
+
userId: claim.run.actorUserId ?? '',
|
|
480
|
+
agentId: claim.agent.id,
|
|
481
|
+
title: sampleValue('This week'),
|
|
482
|
+
source: 'panel',
|
|
483
|
+
createdAt: claim.run.createdAt,
|
|
484
|
+
}, await nameOf(conn, claim.run.actorUserId ?? ''), [], null);
|
|
485
|
+
},
|
|
486
|
+
},
|
|
487
|
+
context: {
|
|
488
|
+
async assemble(conn, claim) {
|
|
489
|
+
const record = await findConversation(conn, claim.run.subject.id);
|
|
490
|
+
// Only the owner's runs see a conversation (a preview by anyone else, too, finds nothing).
|
|
491
|
+
if (!record || record.userId !== claim.run.actorUserId)
|
|
492
|
+
throw new Error('The conversation is gone.');
|
|
493
|
+
const ownerName = await nameOf(conn, record.userId);
|
|
494
|
+
const fresh = !claim.runner ||
|
|
495
|
+
!(await hasSession(conn, {
|
|
496
|
+
agentId: claim.agent.id,
|
|
497
|
+
runnerId: claim.runner.id,
|
|
498
|
+
subjectKind: CONVERSATION_SUBJECT,
|
|
499
|
+
subjectId: record.id,
|
|
500
|
+
threadScope: claim.run.threadScope,
|
|
501
|
+
}));
|
|
502
|
+
const pending = new Set(claim.inputs.flatMap((input) => {
|
|
503
|
+
const payload = input.payload;
|
|
504
|
+
return typeof payload?.messageId === 'string'
|
|
505
|
+
? [payload.messageId]
|
|
506
|
+
: [];
|
|
507
|
+
}));
|
|
508
|
+
let history = [];
|
|
509
|
+
if (fresh) {
|
|
510
|
+
const recent = await messagesRepo(conn).findMany({
|
|
511
|
+
filter: { conversationId: record.id },
|
|
512
|
+
sort: (sort) => sort.field('seq').desc(),
|
|
513
|
+
limit: CONVERSATION_HISTORY_IN_PROMPT + pending.size,
|
|
514
|
+
});
|
|
515
|
+
history = recent
|
|
516
|
+
.filter((message) => !pending.has(message.id))
|
|
517
|
+
.slice(0, CONVERSATION_HISTORY_IN_PROMPT)
|
|
518
|
+
.reverse()
|
|
519
|
+
.map((message) => {
|
|
520
|
+
const view = toMessage(message);
|
|
521
|
+
return {
|
|
522
|
+
role: view.role,
|
|
523
|
+
author: view.role === 'user'
|
|
524
|
+
? ownerName
|
|
525
|
+
: view.role === 'assistant'
|
|
526
|
+
? claim.agent.name
|
|
527
|
+
: claim.appName,
|
|
528
|
+
at: view.createdAt,
|
|
529
|
+
text: [
|
|
530
|
+
view.content.content,
|
|
531
|
+
attachmentLines(storedAttachments(message.attachments)),
|
|
532
|
+
]
|
|
533
|
+
.filter((part) => part.trim() !== '')
|
|
534
|
+
.join('\n\n'),
|
|
535
|
+
};
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
const previousSummary = fresh
|
|
539
|
+
? await lastSummary(conn, {
|
|
540
|
+
agentId: claim.agent.id,
|
|
541
|
+
subjectKind: CONVERSATION_SUBJECT,
|
|
542
|
+
subjectId: record.id,
|
|
543
|
+
}, claim.run.id)
|
|
544
|
+
: null;
|
|
545
|
+
return conversationAssembly(conn, claim, { ...refOf(record), createdAt: record.createdAt }, ownerName, history, previousSummary);
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
sink: {
|
|
549
|
+
async onRunFinished(unit, run) {
|
|
550
|
+
await syncIn(unit, run);
|
|
551
|
+
const record = await findConversation(unit.conn, run.subject.id);
|
|
552
|
+
if (!record || record.userId !== run.actorUserId)
|
|
553
|
+
return;
|
|
554
|
+
// A consultation card the run never closed (the instance stopped) ends as failed.
|
|
555
|
+
for (const message of await messagesRepo(unit.conn).findMany({
|
|
556
|
+
filter: { conversationId: record.id, runId: run.id, role: 'system' },
|
|
557
|
+
})) {
|
|
558
|
+
const { streaming, ...kept } = metadataOf(message);
|
|
559
|
+
if (!streaming || kept.notice?.code !== 'consultation')
|
|
560
|
+
continue;
|
|
561
|
+
await rewriteMessage(unit.conn, message, {
|
|
562
|
+
text: toMessage(message).content.content,
|
|
563
|
+
metadata: {
|
|
564
|
+
...kept,
|
|
565
|
+
notice: {
|
|
566
|
+
...kept.notice,
|
|
567
|
+
state: 'failed',
|
|
568
|
+
error: 'The consultation ended with the run that asked it.',
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
}, now());
|
|
572
|
+
changed(unit, record, Number(message.seq));
|
|
573
|
+
}
|
|
574
|
+
// A draft the run never made final keeps what it had written.
|
|
575
|
+
const draft = await findDraft(unit.conn, record.id, run.id);
|
|
576
|
+
if (draft) {
|
|
577
|
+
const { streaming: _streaming, ...kept } = metadataOf(draft);
|
|
578
|
+
await rewriteMessage(unit.conn, draft, {
|
|
579
|
+
text: toMessage(draft).content.content,
|
|
580
|
+
metadata: { ...kept, interrupted: true },
|
|
581
|
+
}, now());
|
|
582
|
+
changed(unit, record, Number(draft.seq));
|
|
583
|
+
}
|
|
584
|
+
if (run.status !== 'failed')
|
|
585
|
+
return;
|
|
586
|
+
await notice(unit, record, { code: 'runFailed', runId: run.id, reason: run.failureReason }, run.id);
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
};
|
|
590
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
591
|
+
// The service
|
|
592
|
+
// -------------------------------------------------------------------------------------------------------------------
|
|
593
|
+
async function pickAgent(conn, userId, requested) {
|
|
594
|
+
if (requested) {
|
|
595
|
+
const agent = await findAgent(conn, requested);
|
|
596
|
+
if (!agent)
|
|
597
|
+
throw invalid('agentId names no agent.', { field: 'agentId' });
|
|
598
|
+
if (!wakeable(agent, userId, deps.agents.mayInvoke))
|
|
599
|
+
throw forbidden('You may not chat with this agent.');
|
|
600
|
+
return agent;
|
|
601
|
+
}
|
|
602
|
+
const { defaultAgentId } = await deps.settings.preferences(userId, conn);
|
|
603
|
+
if (defaultAgentId) {
|
|
604
|
+
const mine = await findAgent(conn, defaultAgentId);
|
|
605
|
+
if (wakeable(mine, userId, deps.agents.mayInvoke))
|
|
606
|
+
return mine;
|
|
607
|
+
}
|
|
608
|
+
const system = await systemDefault(conn, userId);
|
|
609
|
+
if (system)
|
|
610
|
+
return system;
|
|
611
|
+
throw conversationConflict('noChatAgent', 'There is no agent to chat with: pick one, or ask an administrator to set the default chat agent.');
|
|
612
|
+
}
|
|
613
|
+
function titleFor(value, max) {
|
|
614
|
+
const { text, length } = cleanTitle(value);
|
|
615
|
+
if (length === 0 || length > max)
|
|
616
|
+
throw invalid(`title must be 1 to ${max} characters.`);
|
|
617
|
+
return text;
|
|
618
|
+
}
|
|
619
|
+
async function sendMessage(userId, id, request) {
|
|
620
|
+
const content = request.content;
|
|
621
|
+
const attachmentIds = readAttachmentIds(request.attachmentIds);
|
|
622
|
+
if (typeof content !== 'string' ||
|
|
623
|
+
(content.trim() === '' && attachmentIds.length === 0) ||
|
|
624
|
+
[...content].length > MESSAGE_CONTENT_MAX)
|
|
625
|
+
throw invalid(`content must be 1 to ${MESSAGE_CONTENT_MAX} characters, or empty with files.`);
|
|
626
|
+
const links = deps.attachments;
|
|
627
|
+
if (attachmentIds.length > 0 && !links)
|
|
628
|
+
throw invalid('This application takes no files in chat.', {
|
|
629
|
+
field: 'attachmentIds',
|
|
630
|
+
});
|
|
631
|
+
await owned(tx.read(), userId, id);
|
|
632
|
+
// Resolved before the transaction: resolvers read through the services of the plugins that own the kinds.
|
|
633
|
+
const context = request.context
|
|
634
|
+
? await deps.contextKinds.resolve(tx.read(), userId, request.context)
|
|
635
|
+
: null;
|
|
636
|
+
const sent = await tx.run(async (unit) => {
|
|
637
|
+
const record = await lockOwned(unit, userId, id);
|
|
638
|
+
const at = now();
|
|
639
|
+
if (record.archivedAt || (record.titleSource === 'auto' && !record.title))
|
|
640
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
641
|
+
filter: { id },
|
|
642
|
+
values: {
|
|
643
|
+
archivedAt: null,
|
|
644
|
+
...(record.titleSource === 'auto' && !record.title
|
|
645
|
+
? {
|
|
646
|
+
title: autoTitle(content, CONVERSATION_TITLE_AUTO_CHARS) || null,
|
|
647
|
+
}
|
|
648
|
+
: {}),
|
|
649
|
+
updatedAt: at,
|
|
650
|
+
},
|
|
651
|
+
});
|
|
652
|
+
let message = await append(unit, record, {
|
|
653
|
+
role: 'user',
|
|
654
|
+
text: content,
|
|
655
|
+
workContext: context,
|
|
656
|
+
metadata: request.clientId ? { clientId: request.clientId } : {},
|
|
657
|
+
});
|
|
658
|
+
if (links && attachmentIds.length > 0) {
|
|
659
|
+
const files = await links.attach(unit.conn, userId, { conversationId: id, messageId: message.id }, attachmentIds);
|
|
660
|
+
await messagesRepo(unit.conn).updateMany({
|
|
661
|
+
filter: { id: message.id },
|
|
662
|
+
values: { attachments: asJson(files) },
|
|
663
|
+
});
|
|
664
|
+
message = (await messagesRepo(unit.conn).findOne({
|
|
665
|
+
filter: { id: message.id },
|
|
666
|
+
}));
|
|
667
|
+
}
|
|
668
|
+
const run = await wake(unit, record, [message]);
|
|
669
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
670
|
+
filter: { id },
|
|
671
|
+
values: { read: true },
|
|
672
|
+
});
|
|
673
|
+
return {
|
|
674
|
+
run,
|
|
675
|
+
message: (await messagesRepo(unit.conn).findOne({
|
|
676
|
+
filter: { id: message.id },
|
|
677
|
+
})),
|
|
678
|
+
};
|
|
679
|
+
});
|
|
680
|
+
return {
|
|
681
|
+
message: viewOf(sent.message),
|
|
682
|
+
run: sent.run,
|
|
683
|
+
conversation: await detail(userId, id),
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
const service = {
|
|
687
|
+
binding,
|
|
688
|
+
contextKinds: deps.contextKinds,
|
|
689
|
+
sources,
|
|
690
|
+
async list(userId, query) {
|
|
691
|
+
const conn = tx.read();
|
|
692
|
+
const limit = limitOf(query.pageSize, CONVERSATION_PAGE_DEFAULT, CONVERSATION_PAGE_MAX);
|
|
693
|
+
const cursor = query.pageToken ? decodeCursor(query.pageToken) : null;
|
|
694
|
+
const q = query.q?.trim();
|
|
695
|
+
const rows = await conversationsRepo(conn).findMany({
|
|
696
|
+
filter: (f) => f.and([
|
|
697
|
+
f.string('userId').eq(userId),
|
|
698
|
+
...(query.archived === 'all'
|
|
699
|
+
? []
|
|
700
|
+
: [
|
|
701
|
+
query.archived
|
|
702
|
+
? f.date('archivedAt').notEmpty()
|
|
703
|
+
: f.date('archivedAt').empty(),
|
|
704
|
+
]),
|
|
705
|
+
...(query.agentId ? [f.string('agentId').eq(query.agentId)] : []),
|
|
706
|
+
...(query.source ? [f.string('source').eq(query.source)] : []),
|
|
707
|
+
...(q
|
|
708
|
+
? [
|
|
709
|
+
f.or([
|
|
710
|
+
f.string('title').includes(q, { mode: 'insensitive' }),
|
|
711
|
+
f
|
|
712
|
+
.relation('messages')
|
|
713
|
+
.some((message) => message
|
|
714
|
+
.text('searchText')
|
|
715
|
+
.includes(q, { mode: 'insensitive' })),
|
|
716
|
+
]),
|
|
717
|
+
]
|
|
718
|
+
: []),
|
|
719
|
+
...(cursor ? [f.date('lastMessageAt').notAfter(cursor.at)] : []),
|
|
720
|
+
]),
|
|
721
|
+
sort: (sort) => [
|
|
722
|
+
sort.field('lastMessageAt').desc(),
|
|
723
|
+
sort.field('id').desc(),
|
|
724
|
+
],
|
|
725
|
+
// Rows tied with the cursor's time that the previous page showed are skipped below.
|
|
726
|
+
limit: limit + 1 + (cursor ? 50 : 0),
|
|
727
|
+
});
|
|
728
|
+
const after = cursor
|
|
729
|
+
? rows.filter((row) => Date.parse(row.lastMessageAt) < Date.parse(cursor.at) ||
|
|
730
|
+
(Date.parse(row.lastMessageAt) === Date.parse(cursor.at) &&
|
|
731
|
+
row.id < cursor.id))
|
|
732
|
+
: rows;
|
|
733
|
+
const page = after.slice(0, limit);
|
|
734
|
+
const last = page[page.length - 1];
|
|
735
|
+
return {
|
|
736
|
+
items: await summaries(conn, page),
|
|
737
|
+
nextCursor: after.length > limit && last
|
|
738
|
+
? encodeCursor(last.lastMessageAt, last.id)
|
|
739
|
+
: null,
|
|
740
|
+
};
|
|
741
|
+
},
|
|
742
|
+
async create(userId, request) {
|
|
743
|
+
const id = await tx.run(async (unit) => {
|
|
744
|
+
const agent = await pickAgent(unit.conn, userId, request.agentId);
|
|
745
|
+
const title = request.title === undefined
|
|
746
|
+
? null
|
|
747
|
+
: titleFor(request.title, CONVERSATION_TITLE_MAX);
|
|
748
|
+
const at = now();
|
|
749
|
+
const source = request.source ?? 'panel';
|
|
750
|
+
if (source !== 'panel' && !sources.has(source))
|
|
751
|
+
throw invalid(`${source} is not a source conversations start from.`);
|
|
752
|
+
const conversationId = ids.next();
|
|
753
|
+
await conversationsRepo(unit.conn).createOne({
|
|
754
|
+
values: {
|
|
755
|
+
id: conversationId,
|
|
756
|
+
userId,
|
|
757
|
+
agentId: agent.id,
|
|
758
|
+
mode: 'runner',
|
|
759
|
+
fallbackFromAgentId: null,
|
|
760
|
+
modelService: null,
|
|
761
|
+
model: null,
|
|
762
|
+
title,
|
|
763
|
+
titleSource: title ? 'user' : 'auto',
|
|
764
|
+
category: 'chat',
|
|
765
|
+
source,
|
|
766
|
+
read: true,
|
|
767
|
+
thread: 0,
|
|
768
|
+
lastSeq: 0,
|
|
769
|
+
syncRunId: null,
|
|
770
|
+
syncSeq: 0,
|
|
771
|
+
lastMessageAt: at,
|
|
772
|
+
archivedAt: null,
|
|
773
|
+
lockedAt: null,
|
|
774
|
+
createdAt: at,
|
|
775
|
+
updatedAt: at,
|
|
776
|
+
},
|
|
777
|
+
});
|
|
778
|
+
changed(unit, (await findConversation(unit.conn, conversationId)));
|
|
779
|
+
return conversationId;
|
|
780
|
+
});
|
|
781
|
+
return detail(userId, id);
|
|
782
|
+
},
|
|
783
|
+
get: detail,
|
|
784
|
+
async update(userId, id, patch) {
|
|
785
|
+
await tx.run(async (unit) => {
|
|
786
|
+
const record = await lockOwned(unit, userId, id);
|
|
787
|
+
const values = {};
|
|
788
|
+
if (patch.title !== undefined) {
|
|
789
|
+
values.title = titleFor(patch.title, CONVERSATION_TITLE_MAX);
|
|
790
|
+
values.titleSource = 'user';
|
|
791
|
+
}
|
|
792
|
+
if (patch.archived !== undefined)
|
|
793
|
+
values.archivedAt = patch.archived
|
|
794
|
+
? (record.archivedAt ?? now())
|
|
795
|
+
: null;
|
|
796
|
+
if (Object.keys(values).length === 0)
|
|
797
|
+
return;
|
|
798
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
799
|
+
filter: { id },
|
|
800
|
+
values: { ...values, updatedAt: now() },
|
|
801
|
+
});
|
|
802
|
+
changed(unit, record);
|
|
803
|
+
});
|
|
804
|
+
return detail(userId, id);
|
|
805
|
+
},
|
|
806
|
+
async messages(userId, id, query) {
|
|
807
|
+
const conn = tx.read();
|
|
808
|
+
const record = await owned(conn, userId, id);
|
|
809
|
+
const limit = limitOf(query.limit, MESSAGE_PAGE_DEFAULT, MESSAGE_PAGE_MAX);
|
|
810
|
+
const current = (await findConversation(conn, id)) ?? record;
|
|
811
|
+
let rows;
|
|
812
|
+
let hasMore;
|
|
813
|
+
if (query.after !== undefined) {
|
|
814
|
+
rows = await messagesRepo(conn).findMany({
|
|
815
|
+
filter: (f) => f.and([
|
|
816
|
+
f.string('conversationId').eq(id),
|
|
817
|
+
f.number('seq').gt(query.after),
|
|
818
|
+
]),
|
|
819
|
+
sort: (sort) => sort.field('seq').asc(),
|
|
820
|
+
limit,
|
|
821
|
+
});
|
|
822
|
+
const first = rows[0];
|
|
823
|
+
hasMore = first ? Number(first.seq) > 1 : Number(current.lastSeq) > 0;
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
const newest = await messagesRepo(conn).findMany({
|
|
827
|
+
filter: (f) => f.and([
|
|
828
|
+
f.string('conversationId').eq(id),
|
|
829
|
+
...(query.before !== undefined
|
|
830
|
+
? [f.number('seq').lt(query.before)]
|
|
831
|
+
: []),
|
|
832
|
+
]),
|
|
833
|
+
sort: (sort) => sort.field('seq').desc(),
|
|
834
|
+
limit: limit + 1,
|
|
835
|
+
});
|
|
836
|
+
hasMore = newest.length > limit;
|
|
837
|
+
rows = newest.slice(0, limit).reverse();
|
|
838
|
+
}
|
|
839
|
+
const items = rows.map((row) => viewOf(row));
|
|
840
|
+
const consultationRuns = items.flatMap((item) => item.metadata?.notice?.code === 'consultation' &&
|
|
841
|
+
!item.metadata?.notice.agentId &&
|
|
842
|
+
item.metadata?.notice.runId
|
|
843
|
+
? [item.metadata?.notice.runId]
|
|
844
|
+
: []);
|
|
845
|
+
const consultedRuns = consultationRuns.length
|
|
846
|
+
? await conn.query
|
|
847
|
+
.selectFrom('agRuns')
|
|
848
|
+
.select(['id', 'agentId'])
|
|
849
|
+
.where('id', 'in', consultationRuns)
|
|
850
|
+
.execute()
|
|
851
|
+
: [];
|
|
852
|
+
const runAgents = new Map(consultedRuns.map((run) => [String(run.id), String(run.agentId)]));
|
|
853
|
+
const ids = items.flatMap((item) => item.metadata?.notice?.code === 'consultation'
|
|
854
|
+
? [
|
|
855
|
+
item.metadata?.notice.agentId ??
|
|
856
|
+
(item.metadata?.notice.runId
|
|
857
|
+
? runAgents.get(item.metadata?.notice.runId)
|
|
858
|
+
: undefined),
|
|
859
|
+
].filter((id) => Boolean(id))
|
|
860
|
+
: []);
|
|
861
|
+
const names = await agentNamesOf(conn, ids);
|
|
862
|
+
return {
|
|
863
|
+
items: items.map((item) => {
|
|
864
|
+
if (item.metadata?.notice?.code !== 'consultation')
|
|
865
|
+
return item;
|
|
866
|
+
const agentId = item.metadata?.notice.agentId ??
|
|
867
|
+
(item.metadata?.notice.runId
|
|
868
|
+
? (runAgents.get(item.metadata?.notice.runId) ?? null)
|
|
869
|
+
: null);
|
|
870
|
+
const name = agentId ? names.get(agentId) : undefined;
|
|
871
|
+
return {
|
|
872
|
+
...item,
|
|
873
|
+
metadata: {
|
|
874
|
+
...item.metadata,
|
|
875
|
+
notice: {
|
|
876
|
+
...item.metadata.notice,
|
|
877
|
+
agentId,
|
|
878
|
+
agentName: name ?? item.metadata.notice.agentName,
|
|
879
|
+
identitySnapshot: name === undefined,
|
|
880
|
+
},
|
|
881
|
+
},
|
|
882
|
+
};
|
|
883
|
+
}),
|
|
884
|
+
hasMore,
|
|
885
|
+
lastSeq: Number(current.lastSeq),
|
|
886
|
+
};
|
|
887
|
+
},
|
|
888
|
+
send: (userId, id, request) => sendMessage(userId, id, request),
|
|
889
|
+
async start(userId, request) {
|
|
890
|
+
if (!sources.has(request.source))
|
|
891
|
+
throw invalid(`source must be one of ${sources
|
|
892
|
+
.list()
|
|
893
|
+
.map((source) => source.key)
|
|
894
|
+
.join(', ') || '(none registered)'}.`);
|
|
895
|
+
if (typeof request.text !== 'string' || request.text.trim() === '')
|
|
896
|
+
throw invalid('text is required.');
|
|
897
|
+
if ([...request.text].length > MESSAGE_CONTENT_MAX)
|
|
898
|
+
throw invalid(`The text is longer than a message may be (${MESSAGE_CONTENT_MAX} characters).`);
|
|
899
|
+
const conversation = await service.create(userId, {
|
|
900
|
+
...(request.agentId ? { agentId: request.agentId } : {}),
|
|
901
|
+
...(request.title ? { title: request.title } : {}),
|
|
902
|
+
source: request.source,
|
|
903
|
+
});
|
|
904
|
+
return sendMessage(userId, conversation.id, {
|
|
905
|
+
content: request.text,
|
|
906
|
+
...(request.context ? { context: request.context } : {}),
|
|
907
|
+
...(request.clientId ? { clientId: request.clientId } : {}),
|
|
908
|
+
});
|
|
909
|
+
},
|
|
910
|
+
async markRead(userId, id) {
|
|
911
|
+
await tx.run(async (unit) => {
|
|
912
|
+
const record = await lockOwned(unit, userId, id);
|
|
913
|
+
if (record.read)
|
|
914
|
+
return;
|
|
915
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
916
|
+
filter: { id },
|
|
917
|
+
values: { read: true },
|
|
918
|
+
});
|
|
919
|
+
changed(unit, record);
|
|
920
|
+
});
|
|
921
|
+
return detail(userId, id);
|
|
922
|
+
},
|
|
923
|
+
async stop(userId, id) {
|
|
924
|
+
await tx.run(async (unit) => {
|
|
925
|
+
const record = await lockOwned(unit, userId, id);
|
|
926
|
+
const open = await openRunsOnEach(unit.conn, CONVERSATION_SUBJECT, [
|
|
927
|
+
id,
|
|
928
|
+
]);
|
|
929
|
+
for (const run of open) {
|
|
930
|
+
await deps.runs.cancel(run.id, userId, unit);
|
|
931
|
+
await notice(unit, record, { code: 'runCancelled', runId: run.id }, run.id);
|
|
932
|
+
}
|
|
933
|
+
});
|
|
934
|
+
return detail(userId, id);
|
|
935
|
+
},
|
|
936
|
+
async fallback(userId, id) {
|
|
937
|
+
const before = await owned(tx.read(), userId, id);
|
|
938
|
+
const target = await fallbackTarget(tx.read(), before);
|
|
939
|
+
await tx.run(async (unit) => {
|
|
940
|
+
const record = await lockOwned(unit, userId, id);
|
|
941
|
+
const current = target ? await findAgent(unit.conn, target.id) : null;
|
|
942
|
+
if (!target ||
|
|
943
|
+
!wakeable(current, userId, deps.agents.mayInvoke) ||
|
|
944
|
+
current.revision !== target.revision ||
|
|
945
|
+
record.agentId !== before.agentId ||
|
|
946
|
+
record.thread !== before.thread ||
|
|
947
|
+
record.fallbackFromAgentId !== before.fallbackFromAgentId)
|
|
948
|
+
throw conversationConflict('noFallback', 'This conversation cannot switch to another agent.');
|
|
949
|
+
await rebind(unit, record, current, record.agentId, {
|
|
950
|
+
code: 'switchedToDefault',
|
|
951
|
+
agentId: target.id,
|
|
952
|
+
fromAgentId: record.agentId,
|
|
953
|
+
});
|
|
954
|
+
});
|
|
955
|
+
return detail(userId, id);
|
|
956
|
+
},
|
|
957
|
+
async restore(userId, id) {
|
|
958
|
+
const before = await owned(tx.read(), userId, id);
|
|
959
|
+
const own = before.fallbackFromAgentId
|
|
960
|
+
? await findAgent(tx.read(), before.fallbackFromAgentId)
|
|
961
|
+
: null;
|
|
962
|
+
const available = await canAnswer(tx.read(), own, userId);
|
|
963
|
+
await tx.run(async (unit) => {
|
|
964
|
+
const record = await lockOwned(unit, userId, id);
|
|
965
|
+
const current = own ? await findAgent(unit.conn, own.id) : null;
|
|
966
|
+
if (!own ||
|
|
967
|
+
!available ||
|
|
968
|
+
!wakeable(current, userId, deps.agents.mayInvoke) ||
|
|
969
|
+
current.revision !== own.revision ||
|
|
970
|
+
record.agentId !== before.agentId ||
|
|
971
|
+
record.thread !== before.thread ||
|
|
972
|
+
record.fallbackFromAgentId !== own.id)
|
|
973
|
+
throw conversationConflict('noRestore', 'This conversation cannot switch back to its own agent now.');
|
|
974
|
+
await rebind(unit, record, current, null, {
|
|
975
|
+
code: 'switchedBack',
|
|
976
|
+
agentId: own.id,
|
|
977
|
+
fromAgentId: record.agentId,
|
|
978
|
+
});
|
|
979
|
+
});
|
|
980
|
+
return detail(userId, id);
|
|
981
|
+
},
|
|
982
|
+
async setTitleFromRun(run, title) {
|
|
983
|
+
const conversation = await tx.run(async (unit) => {
|
|
984
|
+
if (run.subject.kind !== CONVERSATION_SUBJECT)
|
|
985
|
+
throw notFound('Conversation');
|
|
986
|
+
const record = await lockConversation(unit.conn, run.subject.id, now());
|
|
987
|
+
if (!record || record.userId !== run.actorUserId)
|
|
988
|
+
throw notFound('Conversation');
|
|
989
|
+
if (record.titleSource === 'user')
|
|
990
|
+
throw conversationConflict('titleLocked', 'The person renamed this conversation; keep their title.');
|
|
991
|
+
await conversationsRepo(unit.conn).updateMany({
|
|
992
|
+
filter: { id: record.id },
|
|
993
|
+
values: {
|
|
994
|
+
title: titleFor(title, CONVERSATION_TITLE_AGENT_MAX),
|
|
995
|
+
titleSource: 'agent',
|
|
996
|
+
updatedAt: now(),
|
|
997
|
+
},
|
|
998
|
+
});
|
|
999
|
+
changed(unit, record);
|
|
1000
|
+
return record;
|
|
1001
|
+
});
|
|
1002
|
+
return detail(conversation.userId, conversation.id);
|
|
1003
|
+
},
|
|
1004
|
+
async ofRun(conn, run) {
|
|
1005
|
+
if (run.subject.kind !== CONVERSATION_SUBJECT)
|
|
1006
|
+
return null;
|
|
1007
|
+
const record = await findConversation(conn, run.subject.id);
|
|
1008
|
+
if (!record || record.userId !== run.actorUserId)
|
|
1009
|
+
return null;
|
|
1010
|
+
return refOf(record);
|
|
1011
|
+
},
|
|
1012
|
+
async homeOf(conn, run) {
|
|
1013
|
+
let current = run;
|
|
1014
|
+
// A consultation's chain is short (`CONSULT_MAX_DEPTH`); a broken link ends it.
|
|
1015
|
+
for (let hop = 0; current.parentRunId && hop <= CONSULT_MAX_DEPTH; hop += 1) {
|
|
1016
|
+
const parent = await findRunRecord(conn, current.parentRunId);
|
|
1017
|
+
if (!parent || parent.actorUserId !== run.actorUserId)
|
|
1018
|
+
return null;
|
|
1019
|
+
current = toRun(parent);
|
|
1020
|
+
}
|
|
1021
|
+
if (current.parentRunId || current.subject.kind !== CONVERSATION_SUBJECT)
|
|
1022
|
+
return null;
|
|
1023
|
+
const record = await findConversation(conn, current.subject.id);
|
|
1024
|
+
if (!record || record.userId !== run.actorUserId)
|
|
1025
|
+
return null;
|
|
1026
|
+
return refOf(record);
|
|
1027
|
+
},
|
|
1028
|
+
async deliver(outer, conversationId, news) {
|
|
1029
|
+
const record = await lockConversation(outer.conn, conversationId, now());
|
|
1030
|
+
if (!record)
|
|
1031
|
+
return null;
|
|
1032
|
+
await notice(outer, record, news.notice);
|
|
1033
|
+
if (!news.input)
|
|
1034
|
+
return null;
|
|
1035
|
+
const agent = await findAgent(outer.conn, record.agentId);
|
|
1036
|
+
if (!wakeable(agent, record.userId, deps.agents.mayInvoke))
|
|
1037
|
+
return null;
|
|
1038
|
+
const enqueued = queuedRun(await deps.runs.enqueue({
|
|
1039
|
+
agentId: agent.id,
|
|
1040
|
+
subject: subjectOf(record.id),
|
|
1041
|
+
threadScope: threadScopeOf(record),
|
|
1042
|
+
actorUserId: record.userId,
|
|
1043
|
+
ownerUserId: record.userId,
|
|
1044
|
+
input: news.input,
|
|
1045
|
+
}, outer));
|
|
1046
|
+
return { id: enqueued.runId, outcome: enqueued.outcome };
|
|
1047
|
+
},
|
|
1048
|
+
lock: async (conn, id) => (await lockConversation(conn, id, now())) !== null,
|
|
1049
|
+
rules: {
|
|
1050
|
+
provide(source) {
|
|
1051
|
+
rules.push(source);
|
|
1052
|
+
return () => {
|
|
1053
|
+
const at = rules.indexOf(source);
|
|
1054
|
+
if (at >= 0)
|
|
1055
|
+
rules.splice(at, 1);
|
|
1056
|
+
};
|
|
1057
|
+
},
|
|
1058
|
+
},
|
|
1059
|
+
async syncRun(runId) {
|
|
1060
|
+
const run = await deps.runs.get(runId);
|
|
1061
|
+
if (run.subject.kind !== CONVERSATION_SUBJECT)
|
|
1062
|
+
return;
|
|
1063
|
+
await tx.run((unit) => syncIn(unit, run));
|
|
1064
|
+
},
|
|
1065
|
+
async chatAgents(userId) {
|
|
1066
|
+
const conn = tx.read();
|
|
1067
|
+
const [agents, runners, settings, preferences] = await Promise.all([
|
|
1068
|
+
deps.agents.list(),
|
|
1069
|
+
deps.runners
|
|
1070
|
+
.list()
|
|
1071
|
+
.then((all) => all.filter((runner) => runner.status === 'online')),
|
|
1072
|
+
deps.settings.settings(conn),
|
|
1073
|
+
deps.settings.preferences(userId, conn),
|
|
1074
|
+
]);
|
|
1075
|
+
return Promise.all(agents
|
|
1076
|
+
// People talk to the agents discovered from runners; an application's own agents do work of its own.
|
|
1077
|
+
.filter((agent) => agent.source === 'runner' && deps.agents.mayInvoke(agent, userId))
|
|
1078
|
+
.map(async (agent) => {
|
|
1079
|
+
const fitting = runners.filter((runner) => runnerTakesAgent(runner, agent));
|
|
1080
|
+
return {
|
|
1081
|
+
id: agent.id,
|
|
1082
|
+
name: agent.name,
|
|
1083
|
+
description: agent.description,
|
|
1084
|
+
nameText: agent.nameText,
|
|
1085
|
+
descriptionText: agent.descriptionText,
|
|
1086
|
+
avatar: agent.avatar,
|
|
1087
|
+
isSystemDefault: agent.id === settings.defaultAgentId,
|
|
1088
|
+
isMyDefault: agent.id === preferences.defaultAgentId,
|
|
1089
|
+
availability: await availabilityFor(conn, agent, userId, runners),
|
|
1090
|
+
personalOnly: fitting.length > 0 &&
|
|
1091
|
+
fitting.every((runner) => runner.trust !== 'team'),
|
|
1092
|
+
};
|
|
1093
|
+
}));
|
|
1094
|
+
},
|
|
1095
|
+
};
|
|
1096
|
+
return service;
|
|
1097
|
+
}
|
|
1098
|
+
//# sourceMappingURL=conversation.service.js.map
|