@nocobase/app-plugin-agents 0.1.0-beta.1 → 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 +355 -0
- package/README.md +107 -67
- package/dist/client/api/client.d.ts +25 -17
- package/dist/client/api/client.d.ts.map +1 -1
- package/dist/client/api/client.js +29 -27
- package/dist/client/api/client.js.map +1 -1
- package/dist/client/api/keys.d.ts +1 -1
- package/dist/client/api/keys.d.ts.map +1 -1
- package/dist/client/api/keys.js +1 -1
- package/dist/client/api/keys.js.map +1 -1
- package/dist/client/chat/api.d.ts +2 -7
- package/dist/client/chat/api.d.ts.map +1 -1
- package/dist/client/chat/api.js +0 -7
- package/dist/client/chat/api.js.map +1 -1
- 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/message-model.d.ts +4 -2
- package/dist/client/chat/message-model.d.ts.map +1 -1
- package/dist/client/chat/message-model.js +28 -3
- package/dist/client/chat/message-model.js.map +1 -1
- package/dist/client/chat/use-chat.d.ts +2 -10
- package/dist/client/chat/use-chat.d.ts.map +1 -1
- package/dist/client/chat/use-chat.js +3 -10
- package/dist/client/chat/use-chat.js.map +1 -1
- package/dist/client/chat.d.ts +4 -1
- package/dist/client/chat.d.ts.map +1 -1
- package/dist/client/chat.js +3 -0
- package/dist/client/chat.js.map +1 -1
- package/dist/client/components/agent-picker.d.ts +6 -23
- package/dist/client/components/agent-picker.d.ts.map +1 -1
- package/dist/client/components/agent-picker.js +19 -39
- package/dist/client/components/agent-picker.js.map +1 -1
- package/dist/client/components/variables/variable-dialogs.d.ts +6 -1
- package/dist/client/components/variables/variable-dialogs.d.ts.map +1 -1
- package/dist/client/components/variables/variable-dialogs.js +27 -11
- package/dist/client/components/variables/variable-dialogs.js.map +1 -1
- package/dist/client/components/variables/variables-panel.d.ts.map +1 -1
- package/dist/client/components/variables/variables-panel.js +9 -2
- package/dist/client/components/variables/variables-panel.js.map +1 -1
- package/dist/client/hooks/use-agent-picker-labels.d.ts.map +1 -1
- package/dist/client/hooks/use-agent-picker-labels.js +3 -12
- package/dist/client/hooks/use-agent-picker-labels.js.map +1 -1
- package/dist/client/kit.d.ts +9 -12
- package/dist/client/kit.d.ts.map +1 -1
- package/dist/client/kit.js +12 -14
- package/dist/client/kit.js.map +1 -1
- package/dist/client/lib/agents.d.ts +5 -13
- package/dist/client/lib/agents.d.ts.map +1 -1
- package/dist/client/lib/agents.js +17 -32
- package/dist/client/lib/agents.js.map +1 -1
- package/dist/client/lib/install.js +1 -1
- package/dist/client/locales/chat.en-US.d.ts +9 -22
- package/dist/client/locales/chat.en-US.d.ts.map +1 -1
- package/dist/client/locales/chat.en-US.js +13 -25
- package/dist/client/locales/chat.en-US.js.map +1 -1
- package/dist/client/locales/chat.zh-CN.d.ts.map +1 -1
- package/dist/client/locales/chat.zh-CN.js +10 -22
- package/dist/client/locales/chat.zh-CN.js.map +1 -1
- package/dist/client/locales/en-US.d.ts +100 -219
- package/dist/client/locales/en-US.d.ts.map +1 -1
- package/dist/client/locales/en-US.js +105 -219
- package/dist/client/locales/en-US.js.map +1 -1
- 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 +55 -0
- package/dist/client/locales/runtimes.en-US.d.ts.map +1 -1
- package/dist/client/locales/runtimes.en-US.js +58 -3
- package/dist/client/locales/runtimes.en-US.js.map +1 -1
- package/dist/client/locales/runtimes.zh-CN.d.ts.map +1 -1
- package/dist/client/locales/runtimes.zh-CN.js +58 -3
- package/dist/client/locales/runtimes.zh-CN.js.map +1 -1
- package/dist/client/locales/zh-CN.d.ts.map +1 -1
- package/dist/client/locales/zh-CN.js +107 -221
- package/dist/client/locales/zh-CN.js.map +1 -1
- package/dist/client/online/services.d.ts.map +1 -1
- package/dist/client/online/services.js +5 -6
- package/dist/client/online/services.js.map +1 -1
- 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 +1 -1
- package/dist/client/pages/agents/index.d.ts.map +1 -1
- package/dist/client/pages/agents/index.js +6 -100
- package/dist/client/pages/agents/index.js.map +1 -1
- 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/runtimes/connect.js +1 -1
- package/dist/client/pages/runtimes/connect.js.map +1 -1
- package/dist/client/pages/runtimes/index.d.ts.map +1 -1
- package/dist/client/pages/runtimes/index.js +3 -2
- package/dist/client/pages/runtimes/index.js.map +1 -1
- package/dist/client/pages/runtimes/runner-cells.d.ts +1 -1
- package/dist/client/pages/runtimes/runner-cells.d.ts.map +1 -1
- package/dist/client/pages/runtimes/runner-cells.js +4 -1
- package/dist/client/pages/runtimes/runner-cells.js.map +1 -1
- package/dist/client/pages/runtimes/runner-sheet.d.ts.map +1 -1
- package/dist/client/pages/runtimes/runner-sheet.js +12 -3
- package/dist/client/pages/runtimes/runner-sheet.js.map +1 -1
- 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/usage/index.js +2 -2
- package/dist/client/pages/usage/index.js.map +1 -1
- package/dist/client/profile/default-agent.d.ts.map +1 -1
- package/dist/client/profile/default-agent.js +2 -4
- package/dist/client/profile/default-agent.js.map +1 -1
- package/dist/client/routes.d.ts +1 -1
- package/dist/client/routes.d.ts.map +1 -1
- package/dist/client/routes.js +1 -13
- package/dist/client/routes.js.map +1 -1
- 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/subject-runs.d.ts +5 -0
- package/dist/client/runs/subject-runs.d.ts.map +1 -1
- package/dist/client/runs/subject-runs.js +13 -7
- package/dist/client/runs/subject-runs.js.map +1 -1
- package/dist/client/runs.d.ts +3 -1
- package/dist/client/runs.d.ts.map +1 -1
- package/dist/client/runs.js +3 -1
- package/dist/client/runs.js.map +1 -1
- package/dist/database/migrations/.manifest.json +48 -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/package.json +8 -10
- package/dist/server/cli/run-credential.js +1 -1
- package/dist/server/composition.d.ts +39 -37
- package/dist/server/composition.d.ts.map +1 -1
- package/dist/server/composition.js +53 -65
- package/dist/server/composition.js.map +1 -1
- package/dist/server/core/agents/agent.service.d.ts +51 -43
- package/dist/server/core/agents/agent.service.d.ts.map +1 -1
- package/dist/server/core/agents/agent.service.js +342 -317
- package/dist/server/core/agents/agent.service.js.map +1 -1
- package/dist/server/core/agents/agent.store.d.ts +24 -12
- package/dist/server/core/agents/agent.store.d.ts.map +1 -1
- package/dist/server/core/agents/agent.store.js +65 -64
- package/dist/server/core/agents/agent.store.js.map +1 -1
- 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 +2 -1
- package/dist/server/core/agents/index.d.ts.map +1 -1
- package/dist/server/core/agents/index.js +2 -1
- package/dist/server/core/agents/index.js.map +1 -1
- package/dist/server/core/brief/brief.js +1 -1
- package/dist/server/core/brief/brief.js.map +1 -1
- package/dist/server/core/callers/index.d.ts +1 -1
- package/dist/server/core/conversations/availability.d.ts +11 -10
- package/dist/server/core/conversations/availability.d.ts.map +1 -1
- package/dist/server/core/conversations/availability.js +14 -32
- package/dist/server/core/conversations/availability.js.map +1 -1
- package/dist/server/core/conversations/chat-settings.d.ts.map +1 -1
- package/dist/server/core/conversations/chat-settings.js +5 -3
- package/dist/server/core/conversations/chat-settings.js.map +1 -1
- package/dist/server/core/conversations/conversation.service.d.ts +3 -5
- package/dist/server/core/conversations/conversation.service.d.ts.map +1 -1
- package/dist/server/core/conversations/conversation.service.js +161 -221
- package/dist/server/core/conversations/conversation.service.js.map +1 -1
- package/dist/server/core/conversations/ports.d.ts +3 -17
- package/dist/server/core/conversations/ports.d.ts.map +1 -1
- package/dist/server/core/reports/report.service.d.ts.map +1 -1
- package/dist/server/core/reports/report.service.js +5 -2
- package/dist/server/core/reports/report.service.js.map +1 -1
- package/dist/server/core/runs/availability.d.ts +18 -7
- package/dist/server/core/runs/availability.d.ts.map +1 -1
- package/dist/server/core/runs/availability.js +35 -24
- package/dist/server/core/runs/availability.js.map +1 -1
- package/dist/server/core/runs/claim.d.ts +33 -65
- package/dist/server/core/runs/claim.d.ts.map +1 -1
- package/dist/server/core/runs/claim.js +566 -307
- package/dist/server/core/runs/claim.js.map +1 -1
- 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 +59 -4
- package/dist/server/core/runs/extensions.d.ts.map +1 -1
- package/dist/server/core/runs/extensions.js +45 -9
- package/dist/server/core/runs/extensions.js.map +1 -1
- 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 +9 -5
- package/dist/server/core/runs/index.d.ts.map +1 -1
- package/dist/server/core/runs/index.js +9 -5
- package/dist/server/core/runs/index.js.map +1 -1
- 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 +9 -19
- package/dist/server/core/runs/lifecycle.d.ts.map +1 -1
- package/dist/server/core/runs/lifecycle.js +76 -34
- package/dist/server/core/runs/lifecycle.js.map +1 -1
- package/dist/server/core/runs/policy.d.ts +8 -0
- package/dist/server/core/runs/policy.d.ts.map +1 -1
- package/dist/server/core/runs/policy.js +10 -0
- package/dist/server/core/runs/policy.js.map +1 -1
- package/dist/server/core/runs/ports.d.ts +84 -28
- package/dist/server/core/runs/ports.d.ts.map +1 -1
- package/dist/server/core/runs/ports.js +2 -13
- package/dist/server/core/runs/ports.js.map +1 -1
- package/dist/server/core/runs/preview.d.ts.map +1 -1
- package/dist/server/core/runs/preview.js +3 -3
- package/dist/server/core/runs/preview.js.map +1 -1
- 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.service.d.ts +84 -11
- package/dist/server/core/runs/run.service.d.ts.map +1 -1
- package/dist/server/core/runs/run.service.js +433 -93
- package/dist/server/core/runs/run.service.js.map +1 -1
- package/dist/server/core/runs/run.store.d.ts +20 -3
- package/dist/server/core/runs/run.store.d.ts.map +1 -1
- package/dist/server/core/runs/run.store.js +49 -2
- package/dist/server/core/runs/run.store.js.map +1 -1
- package/dist/server/core/runs/runner-view.d.ts +6 -4
- package/dist/server/core/runs/runner-view.d.ts.map +1 -1
- package/dist/server/core/runs/runner-view.js +13 -11
- package/dist/server/core/runs/runner-view.js.map +1 -1
- 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.map +1 -1
- package/dist/server/core/runs/sweeper.js +54 -10
- package/dist/server/core/runs/sweeper.js.map +1 -1
- package/dist/server/core/runs/transitions.d.ts +1 -1
- package/dist/server/core/runs/transitions.d.ts.map +1 -1
- package/dist/server/core/runs/transitions.js +69 -5
- package/dist/server/core/runs/transitions.js.map +1 -1
- package/dist/server/core/runs/workload.d.ts +3 -3
- package/dist/server/core/runs/workload.d.ts.map +1 -1
- package/dist/server/core/runs/workload.js +154 -45
- package/dist/server/core/runs/workload.js.map +1 -1
- package/dist/server/core/variables/index.d.ts +1 -1
- package/dist/server/core/variables/index.d.ts.map +1 -1
- package/dist/server/core/variables/index.js +1 -1
- package/dist/server/core/variables/index.js.map +1 -1
- package/dist/server/core/variables/variable.service.d.ts +38 -6
- package/dist/server/core/variables/variable.service.d.ts.map +1 -1
- package/dist/server/core/variables/variable.service.js +201 -30
- package/dist/server/core/variables/variable.service.js.map +1 -1
- package/dist/server/distribution/dist.service.d.ts +27 -5
- package/dist/server/distribution/dist.service.d.ts.map +1 -1
- package/dist/server/distribution/dist.service.js +41 -5
- package/dist/server/distribution/dist.service.js.map +1 -1
- package/dist/server/distribution/download-tokens.d.ts +1 -1
- package/dist/server/distribution/download-tokens.d.ts.map +1 -1
- package/dist/server/distribution/download-tokens.js +7 -4
- package/dist/server/distribution/download-tokens.js.map +1 -1
- package/dist/server/distribution/index.d.ts +11 -3
- package/dist/server/distribution/index.d.ts.map +1 -1
- package/dist/server/distribution/index.js +31 -8
- package/dist/server/distribution/index.js.map +1 -1
- package/dist/server/jobs/index.d.ts +1 -1
- package/dist/server/jobs/index.d.ts.map +1 -1
- package/dist/server/jobs/index.js +1 -1
- package/dist/server/jobs/index.js.map +1 -1
- package/dist/server/jobs/job.service.d.ts +3 -1
- package/dist/server/jobs/job.service.d.ts.map +1 -1
- package/dist/server/jobs/job.service.js +11 -3
- package/dist/server/jobs/job.service.js.map +1 -1
- package/dist/server/jobs/spec.d.ts +4 -0
- package/dist/server/jobs/spec.d.ts.map +1 -1
- package/dist/server/jobs/spec.js +6 -0
- package/dist/server/jobs/spec.js.map +1 -1
- package/dist/server/kernel/errors.d.ts +1 -1
- package/dist/server/kernel/errors.d.ts.map +1 -1
- package/dist/server/kernel/errors.js +1 -0
- package/dist/server/kernel/errors.js.map +1 -1
- package/dist/server/kernel/events.d.ts +34 -9
- package/dist/server/kernel/events.d.ts.map +1 -1
- package/dist/server/kernel/events.js.map +1 -1
- package/dist/server/kernel/redaction.d.ts +2 -0
- package/dist/server/kernel/redaction.d.ts.map +1 -1
- package/dist/server/kernel/redaction.js +17 -0
- package/dist/server/kernel/redaction.js.map +1 -1
- package/dist/server/online/index.d.ts +0 -5
- package/dist/server/online/index.d.ts.map +1 -1
- package/dist/server/online/index.js +0 -5
- package/dist/server/online/index.js.map +1 -1
- package/dist/server/online/routes.d.ts.map +1 -1
- package/dist/server/online/routes.js +6 -35
- package/dist/server/online/routes.js.map +1 -1
- package/dist/server/providers/agents.d.ts +4 -25
- package/dist/server/providers/agents.d.ts.map +1 -1
- package/dist/server/providers/agents.js +8 -75
- package/dist/server/providers/agents.js.map +1 -1
- package/dist/server/routes/admin.d.ts.map +1 -1
- package/dist/server/routes/admin.js +140 -201
- package/dist/server/routes/admin.js.map +1 -1
- package/dist/server/routes/chat.d.ts.map +1 -1
- package/dist/server/routes/chat.js +12 -70
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +11 -1
- package/dist/server/routes/index.js.map +1 -1
- package/dist/server/routes/roster.d.ts.map +1 -1
- package/dist/server/routes/roster.js +6 -21
- package/dist/server/routes/roster.js.map +1 -1
- 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/runners/admin.d.ts +9 -1
- package/dist/server/routes/runners/admin.d.ts.map +1 -1
- package/dist/server/routes/runners/admin.js +62 -24
- package/dist/server/routes/runners/admin.js.map +1 -1
- package/dist/server/routes/runners/dist.d.ts +5 -1
- package/dist/server/routes/runners/dist.d.ts.map +1 -1
- package/dist/server/routes/runners/dist.js +36 -9
- package/dist/server/routes/runners/dist.js.map +1 -1
- package/dist/server/routes/runners/install.d.ts.map +1 -1
- package/dist/server/routes/runners/install.js +98 -15
- package/dist/server/routes/runners/install.js.map +1 -1
- package/dist/server/routes/runners/runner.d.ts.map +1 -1
- package/dist/server/routes/runners/runner.js +25 -7
- package/dist/server/routes/runners/runner.js.map +1 -1
- package/dist/server/routes/runners/runs.d.ts +1 -1
- package/dist/server/routes/runners/runs.d.ts.map +1 -1
- package/dist/server/routes/runners/runs.js +23 -3
- package/dist/server/routes/runners/runs.js.map +1 -1
- package/dist/server/routes/schemas.d.ts +37 -8
- package/dist/server/routes/schemas.d.ts.map +1 -1
- package/dist/server/routes/schemas.js +367 -82
- package/dist/server/routes/schemas.js.map +1 -1
- package/dist/server/runners/index.d.ts +1 -0
- package/dist/server/runners/index.d.ts.map +1 -1
- package/dist/server/runners/index.js +1 -0
- package/dist/server/runners/index.js.map +1 -1
- package/dist/server/runners/runner.service.d.ts +22 -8
- package/dist/server/runners/runner.service.d.ts.map +1 -1
- package/dist/server/runners/runner.service.js +112 -14
- package/dist/server/runners/runner.service.js.map +1 -1
- package/dist/server/runners/runner.store.d.ts +10 -1
- package/dist/server/runners/runner.store.d.ts.map +1 -1
- package/dist/server/runners/runner.store.js +117 -4
- package/dist/server/runners/runner.store.js.map +1 -1
- package/dist/server/runners/sweeper.d.ts +5 -0
- package/dist/server/runners/sweeper.d.ts.map +1 -1
- package/dist/server/runners/sweeper.js +4 -2
- package/dist/server/runners/sweeper.js.map +1 -1
- 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/testing.d.ts +0 -2
- package/dist/server/testing.d.ts.map +1 -1
- package/dist/server/testing.js +1 -4
- package/dist/server/testing.js.map +1 -1
- package/dist/server/tokens.d.ts +12 -9
- package/dist/server/tokens.d.ts.map +1 -1
- package/dist/server/tokens.js +6 -2
- package/dist/server/tokens.js.map +1 -1
- package/dist/shared/access.d.ts +2 -6
- package/dist/shared/access.d.ts.map +1 -1
- package/dist/shared/access.js +2 -6
- package/dist/shared/access.js.map +1 -1
- package/dist/shared/agents.d.ts +128 -165
- package/dist/shared/agents.d.ts.map +1 -1
- package/dist/shared/agents.js +46 -97
- package/dist/shared/agents.js.map +1 -1
- package/dist/shared/conversations.d.ts +43 -89
- package/dist/shared/conversations.d.ts.map +1 -1
- package/dist/shared/conversations.js +5 -24
- package/dist/shared/conversations.js.map +1 -1
- 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.js +1 -1
- package/dist/shared/models.js.map +1 -1
- package/dist/shared/runners.d.ts +107 -17
- package/dist/shared/runners.d.ts.map +1 -1
- package/dist/shared/runners.js +49 -7
- package/dist/shared/runners.js.map +1 -1
- package/dist/shared/runs.d.ts +203 -1
- package/dist/shared/runs.d.ts.map +1 -1
- package/dist/shared/runs.js +24 -0
- package/dist/shared/runs.js.map +1 -1
- package/dist/shared/variables.d.ts +22 -0
- package/dist/shared/variables.d.ts.map +1 -1
- package/dist/shared/variables.js +9 -1
- package/dist/shared/variables.js.map +1 -1
- package/package.json +24 -26
- package/skills/nocobase-app-plugin-agents/SKILL.md +8 -7
- package/skills/nocobase-app-plugin-agents/references/agents.md +30 -0
- package/skills/nocobase-app-plugin-agents/references/distribution.md +21 -4
- package/skills/nocobase-app-plugin-agents/references/extension-points.md +30 -20
- package/skills/nocobase-app-plugin-agents/references/model-services.md +17 -0
- package/skills/nocobase-app-plugin-agents/references/runners.md +15 -1
- package/skills/nocobase-app-plugin-agents/references/setup-and-config.md +4 -7
- package/skills/nocobase-app-plugin-agents/references/variables-skills-usage.md +4 -4
- package/skills/nocobase-app-plugin-agents/references/verification-and-troubleshooting.md +33 -32
- package/dist/client/chat/settings-section.d.ts +0 -5
- package/dist/client/chat/settings-section.d.ts.map +0 -1
- package/dist/client/chat/settings-section.js +0 -76
- package/dist/client/chat/settings-section.js.map +0 -1
- package/dist/client/components/agent-fields.d.ts +0 -45
- package/dist/client/components/agent-fields.d.ts.map +0 -1
- package/dist/client/components/agent-fields.js +0 -83
- package/dist/client/components/agent-fields.js.map +0 -1
- package/dist/client/components/agent-type.d.ts +0 -32
- package/dist/client/components/agent-type.d.ts.map +0 -1
- package/dist/client/components/agent-type.js +0 -80
- package/dist/client/components/agent-type.js.map +0 -1
- package/dist/client/components/model-entries.d.ts +0 -35
- package/dist/client/components/model-entries.d.ts.map +0 -1
- package/dist/client/components/model-entries.js +0 -82
- package/dist/client/components/model-entries.js.map +0 -1
- package/dist/client/hooks/use-agent-save.d.ts +0 -9
- package/dist/client/hooks/use-agent-save.d.ts.map +0 -1
- package/dist/client/hooks/use-agent-save.js +0 -40
- package/dist/client/hooks/use-agent-save.js.map +0 -1
- package/dist/client/hooks/use-model-catalog.d.ts +0 -9
- package/dist/client/hooks/use-model-catalog.d.ts.map +0 -1
- package/dist/client/hooks/use-model-catalog.js +0 -27
- package/dist/client/hooks/use-model-catalog.js.map +0 -1
- package/dist/client/lib/tool-policy.d.ts +0 -5
- package/dist/client/lib/tool-policy.d.ts.map +0 -1
- package/dist/client/lib/tool-policy.js +0 -10
- package/dist/client/lib/tool-policy.js.map +0 -1
- package/dist/client/online/default-model.d.ts +0 -5
- package/dist/client/online/default-model.d.ts.map +0 -1
- package/dist/client/online/default-model.js +0 -65
- package/dist/client/online/default-model.js.map +0 -1
- package/dist/client/pages/agents/agent-model.d.ts +0 -73
- package/dist/client/pages/agents/agent-model.d.ts.map +0 -1
- package/dist/client/pages/agents/agent-model.js +0 -172
- package/dist/client/pages/agents/agent-model.js.map +0 -1
- package/dist/client/pages/agents/detail/brief-preview.d.ts +0 -7
- package/dist/client/pages/agents/detail/brief-preview.d.ts.map +0 -1
- package/dist/client/pages/agents/detail/brief-preview.js +0 -43
- package/dist/client/pages/agents/detail/brief-preview.js.map +0 -1
- package/dist/client/pages/agents/detail/history.d.ts +0 -11
- package/dist/client/pages/agents/detail/history.d.ts.map +0 -1
- package/dist/client/pages/agents/detail/history.js +0 -149
- package/dist/client/pages/agents/detail/history.js.map +0 -1
- package/dist/client/pages/agents/detail/index.d.ts +0 -3
- package/dist/client/pages/agents/detail/index.d.ts.map +0 -1
- package/dist/client/pages/agents/detail/index.js +0 -241
- package/dist/client/pages/agents/detail/index.js.map +0 -1
- package/dist/client/pages/agents/detail/sections.d.ts +0 -22
- package/dist/client/pages/agents/detail/sections.d.ts.map +0 -1
- package/dist/client/pages/agents/detail/sections.js +0 -311
- package/dist/client/pages/agents/detail/sections.js.map +0 -1
- package/dist/client/pages/agents/detail/tab-draft.d.ts +0 -43
- package/dist/client/pages/agents/detail/tab-draft.d.ts.map +0 -1
- package/dist/client/pages/agents/detail/tab-draft.js +0 -115
- package/dist/client/pages/agents/detail/tab-draft.js.map +0 -1
- package/dist/client/pages/agents/detail/unsaved-bar.d.ts +0 -13
- package/dist/client/pages/agents/detail/unsaved-bar.d.ts.map +0 -1
- package/dist/client/pages/agents/detail/unsaved-bar.js +0 -21
- package/dist/client/pages/agents/detail/unsaved-bar.js.map +0 -1
- package/dist/client/pages/agents/new.d.ts +0 -3
- package/dist/client/pages/agents/new.d.ts.map +0 -1
- package/dist/client/pages/agents/new.js +0 -149
- package/dist/client/pages/agents/new.js.map +0 -1
- package/dist/client/pages/agents/preset-picker.d.ts +0 -8
- package/dist/client/pages/agents/preset-picker.d.ts.map +0 -1
- package/dist/client/pages/agents/preset-picker.js +0 -41
- package/dist/client/pages/agents/preset-picker.js.map +0 -1
- package/dist/server/core/consultations/consultation.service.d.ts +0 -59
- package/dist/server/core/consultations/consultation.service.d.ts.map +0 -1
- package/dist/server/core/consultations/consultation.service.js +0 -195
- package/dist/server/core/consultations/consultation.service.js.map +0 -1
- package/dist/server/core/consultations/index.d.ts +0 -3
- package/dist/server/core/consultations/index.d.ts.map +0 -1
- package/dist/server/core/consultations/index.js +0 -3
- package/dist/server/core/consultations/index.js.map +0 -1
- package/dist/server/core/consultations/prompt.d.ts +0 -41
- package/dist/server/core/consultations/prompt.d.ts.map +0 -1
- package/dist/server/core/consultations/prompt.js +0 -64
- package/dist/server/core/consultations/prompt.js.map +0 -1
- package/dist/server/core/presets/index.d.ts +0 -19
- package/dist/server/core/presets/index.d.ts.map +0 -1
- package/dist/server/core/presets/index.js +0 -28
- package/dist/server/core/presets/index.js.map +0 -1
- package/dist/server/online/cli-command.d.ts +0 -20
- package/dist/server/online/cli-command.d.ts.map +0 -1
- package/dist/server/online/cli-command.js +0 -345
- package/dist/server/online/cli-command.js.map +0 -1
- package/dist/server/online/consult-tool.d.ts +0 -54
- package/dist/server/online/consult-tool.d.ts.map +0 -1
- package/dist/server/online/consult-tool.js +0 -177
- package/dist/server/online/consult-tool.js.map +0 -1
- package/dist/server/online/executor.d.ts +0 -83
- package/dist/server/online/executor.d.ts.map +0 -1
- package/dist/server/online/executor.js +0 -714
- package/dist/server/online/executor.js.map +0 -1
- package/dist/server/online/sandbox.d.ts +0 -32
- package/dist/server/online/sandbox.d.ts.map +0 -1
- package/dist/server/online/sandbox.js +0 -246
- package/dist/server/online/sandbox.js.map +0 -1
- package/dist/server/online/scripted.d.ts +0 -12
- package/dist/server/online/scripted.d.ts.map +0 -1
- package/dist/server/online/scripted.js +0 -176
- package/dist/server/online/scripted.js.map +0 -1
- package/dist/server/online/tools.d.ts +0 -17
- package/dist/server/online/tools.d.ts.map +0 -1
- package/dist/server/online/tools.js +0 -31
- package/dist/server/online/tools.js.map +0 -1
- package/dist/server/vendor/THIRD_PARTY_LICENSES.txt +0 -782
- package/dist/server/vendor/just-bash.d.ts +0 -83
- package/dist/server/vendor/just-bash.js +0 -2102
- package/dist/shared/presets.d.ts +0 -30
- package/dist/shared/presets.d.ts.map +0 -1
- package/dist/shared/presets.js +0 -2
- package/dist/shared/presets.js.map +0 -1
- package/skills/nocobase-app-plugin-agents/references/online-agents.md +0 -31
|
@@ -29,20 +29,18 @@
|
|
|
29
29
|
import { apiErrorResponse, apiErrorResponses, apiValidator, cliRoute, dataResponse, describeRoute, emptyResponse, listResponse, } from '@nocobase/app-server/router';
|
|
30
30
|
import { bodyLimit } from 'hono/body-limit';
|
|
31
31
|
import { z } from 'zod';
|
|
32
|
-
import { policyAllowsAgent } from '@nocobase/agent-protocol';
|
|
33
32
|
import { reaches, } from '../../shared/access.js';
|
|
34
|
-
import { offersEntry } from '../../shared/models.js';
|
|
35
33
|
import { SKILL_UPLOAD_MAX_BYTES } from '../../shared/skills.js';
|
|
36
34
|
import { CONVERSATION_SUBJECT } from '../../shared/conversations.js';
|
|
37
|
-
import {
|
|
35
|
+
import { AgentPatchSchema, agentViews } from '../core/agents/index.js';
|
|
38
36
|
import { ModelPricesSchema } from '../core/reports/index.js';
|
|
39
|
-
import {
|
|
37
|
+
import { runForViewer } from '../core/runs/index.js';
|
|
40
38
|
import { SkillIdsSchema, SkillImportSchema, SkillInputSchema, SkillSaveSchema, } from '../core/skills/index.js';
|
|
41
39
|
import { forbidden, invalid, notFound } from '../kernel/errors.js';
|
|
42
40
|
import { decodePageToken, domainRouter, encodePageToken, } from '../kernel/http.js';
|
|
43
41
|
import { WORKDIR_TITLE } from '../kernel/scopes.js';
|
|
44
42
|
import { tags } from './openapi.js';
|
|
45
|
-
import { AgentActionOptionSchema, AgentChangeSchema, AgentHistoryQuery,
|
|
43
|
+
import { AgentActionOptionSchema, AgentChangeSchema, AgentHistoryQuery, AgentParams, AgentNameSchema, AgentSchema, AgentViewSchema, BriefPreviewSchema, ModelUsageReportSchema, PageTokenMetaSchema, PricesSchema, RunBriefSchema, RunDetailSchema, RunEventItemSchema, RunSchema, SeqPageMetaSchema, SkillArchiveQuery, SkillAttachmentsSchema, SkillDetailSchema, SkillFileQuery, SkillUploadSchema, SkillSchema, SkillVersionDetailSchema, SkillVersionSchema, SkillViewSchema, UsageReportSchema, UserRefSchema, VariableAuditSchema, VariableSchema, VariableValueSchema, VocabularySchema, AuditListQuery, ModelUsageQuery, PreviewBriefQuery, RunEventsQuery, RunListQuery, RunParams, ScopeParams, SkillParams, SkillRestoreInput, SkillVersionParams, UsageQuerySchema, VariableParams, VariableValueInput, WorkspaceParams, } from './schemas.js';
|
|
46
44
|
/** A multipart body of one file, as `file`. */
|
|
47
45
|
const skillUploadBody = {
|
|
48
46
|
required: true,
|
|
@@ -129,41 +127,6 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
129
127
|
const isPrivate = (run) => services.subjects.get(run.subject.kind)?.private === true;
|
|
130
128
|
const nameOf = async (userId) => (await services.people.names(services.tx.read(), [userId])).get(userId) ??
|
|
131
129
|
userId;
|
|
132
|
-
/** The agents with what the list shows about their runs and runners, and whether the caller may change each. */
|
|
133
|
-
const summarize = async (who, agents) => {
|
|
134
|
-
const conn = services.tx.read();
|
|
135
|
-
const online = await services.runners.online(conn);
|
|
136
|
-
const owners = await services.people.names(conn, agents.map((agent) => agent.ownerUserId));
|
|
137
|
-
const catalog = await services.online.gateway.catalog();
|
|
138
|
-
const result = [];
|
|
139
|
-
for (const agent of agents)
|
|
140
|
-
result.push({
|
|
141
|
-
...agent,
|
|
142
|
-
ownerName: owners.get(agent.ownerUserId) ?? null,
|
|
143
|
-
activeRuns: await countActive(conn, 'agentId', agent.id),
|
|
144
|
-
// An online agent runs here: "online" while the service of its first entry offers its model.
|
|
145
|
-
onlineRunners: agent.type === 'online'
|
|
146
|
-
? Number(offersEntry(catalog, onlineEntryOf(agent, undefined, catalog.defaultModel ?? null)))
|
|
147
|
-
: online.filter((runner) => hasTool(runner, agent) &&
|
|
148
|
-
policyAllowsAgent(runner.policy, agent) &&
|
|
149
|
-
(agent.runnerIds.length === 0 ||
|
|
150
|
-
agent.runnerIds.includes(runner.id))).length,
|
|
151
|
-
canEdit: await mayEdit(who, agent.ownerUserId),
|
|
152
|
-
canCopy: services.agents.mayInvoke(agent, who.userId),
|
|
153
|
-
});
|
|
154
|
-
return result;
|
|
155
|
-
};
|
|
156
|
-
/** Only a caller who may change the agent of the path goes on: 404 when they may not read it, 403 when not change it. */
|
|
157
|
-
const editableAgent = async (context, next) => {
|
|
158
|
-
const who = caller(context);
|
|
159
|
-
const agent = await services.agents.get(context.req.param('agentId') ?? '');
|
|
160
|
-
if (!(await mayEdit(who, agent.ownerUserId))) {
|
|
161
|
-
if (!(await who.can('agents.agents', 'read')))
|
|
162
|
-
throw notFound('Agent');
|
|
163
|
-
throw forbidden('Only its owner (with the related level of agents.agents edit) or a manager of agents may change this agent.');
|
|
164
|
-
}
|
|
165
|
-
await next();
|
|
166
|
-
};
|
|
167
130
|
/** Only a caller who may edit the skill of the path goes on: 404 when they may not read it, 403 when not edit it. */
|
|
168
131
|
const editableSkill = async (context, next) => {
|
|
169
132
|
const who = caller(context);
|
|
@@ -189,8 +152,8 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
189
152
|
throw notFound('Scope');
|
|
190
153
|
const who = caller(context);
|
|
191
154
|
if (scope === 'agent') {
|
|
192
|
-
|
|
193
|
-
const manage = await
|
|
155
|
+
await services.agents.get(scopeId);
|
|
156
|
+
const manage = await who.can('agents.agents', 'manage');
|
|
194
157
|
if (!manage && !(await who.can('agents.agents', 'read')))
|
|
195
158
|
throw notFound('Agent');
|
|
196
159
|
return { scope: 'agent', scopeId, manage };
|
|
@@ -279,6 +242,64 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
279
242
|
const data = await services.people.list(services.tx.read());
|
|
280
243
|
return context.json({ data, meta: { total: data.length } });
|
|
281
244
|
});
|
|
245
|
+
router.put('/discoveryPreferences', scoped, can('agents.agents', 'manage'), describeRoute({
|
|
246
|
+
tags,
|
|
247
|
+
summary: 'Ignore or restore discovery groups',
|
|
248
|
+
operationId: 'agentsSetDiscoveryPreferences',
|
|
249
|
+
...cliRoute({ command: 'agent discovery set', bodyFile: 'input' }),
|
|
250
|
+
description: 'Shared administrator preferences. Only pending groups can be changed. Batches are atomic and checked against each group revision. Reports do not reset preferences.',
|
|
251
|
+
responses: {
|
|
252
|
+
200: listResponse(z.object({
|
|
253
|
+
key: z.string(),
|
|
254
|
+
ignored: z.boolean(),
|
|
255
|
+
revision: z.number().int(),
|
|
256
|
+
})),
|
|
257
|
+
400: apiErrorResponse(400, 'The group contains a non-pending agent.'),
|
|
258
|
+
409: apiErrorResponse(409, 'The discovery group changed.'),
|
|
259
|
+
...apiErrorResponses,
|
|
260
|
+
},
|
|
261
|
+
}), apiValidator('json', z.strictObject({
|
|
262
|
+
groups: z
|
|
263
|
+
.array(z.strictObject({
|
|
264
|
+
key: z
|
|
265
|
+
.string()
|
|
266
|
+
.min(1)
|
|
267
|
+
.max(256)
|
|
268
|
+
.meta({ description: 'The discoveryKey from the agent list.' }),
|
|
269
|
+
expectedRevision: z.number().int().min(0).meta({
|
|
270
|
+
description: 'The discoveryRevision from the agent list.',
|
|
271
|
+
}),
|
|
272
|
+
}))
|
|
273
|
+
.min(1)
|
|
274
|
+
.max(256)
|
|
275
|
+
.refine((groups) => new Set(groups.map((group) => group.key)).size === groups.length, 'Groups must be unique.')
|
|
276
|
+
.meta({
|
|
277
|
+
description: 'Unique pending discovery groups to update atomically.',
|
|
278
|
+
}),
|
|
279
|
+
ignored: z.boolean().meta({
|
|
280
|
+
description: 'True to ignore pending discoveries; false to restore them without enabling.',
|
|
281
|
+
}),
|
|
282
|
+
})), async (context) => {
|
|
283
|
+
const { groups, ignored } = context.req.valid('json');
|
|
284
|
+
const data = await services.agents.setIgnored(groups, ignored);
|
|
285
|
+
return context.json({ data, meta: { total: data.length } });
|
|
286
|
+
});
|
|
287
|
+
// Every agent's name, removed ones and the application's own included, for the runs that name them.
|
|
288
|
+
router.get('/agentNames', guard, describeRoute({
|
|
289
|
+
tags,
|
|
290
|
+
summary: 'List the names of agents',
|
|
291
|
+
operationId: 'agentsListAgentNames',
|
|
292
|
+
// UI-only: the names runs show.
|
|
293
|
+
...cliRoute(false),
|
|
294
|
+
description: 'Every agent there has been, removed ones and the application’s own included, by id and name: what the runs that name them show.',
|
|
295
|
+
responses: {
|
|
296
|
+
200: listResponse(AgentNameSchema),
|
|
297
|
+
...apiErrorResponses,
|
|
298
|
+
},
|
|
299
|
+
}), async (context) => {
|
|
300
|
+
const data = await services.agents.directory(services.tx.read());
|
|
301
|
+
return context.json({ data, meta: { total: data.length } });
|
|
302
|
+
});
|
|
282
303
|
// Variables of an agent, a working directory, or a scope the application registers.
|
|
283
304
|
const scopedRouter = router;
|
|
284
305
|
const variableParam = apiValidator('param', VariableParams);
|
|
@@ -401,12 +422,20 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
401
422
|
contentFile: true,
|
|
402
423
|
description: 'The value; stored encrypted and never shown again. Asked for when left out.',
|
|
403
424
|
},
|
|
425
|
+
teamRunnersOnly: {
|
|
426
|
+
description: 'Only team runners receive it; personal runners leave a run that gets it.',
|
|
427
|
+
},
|
|
428
|
+
fromRunner: {
|
|
429
|
+
description: 'Take it from the runner: no value here; the runner that takes the run provides it (`nocobase-runner env set NAME`).',
|
|
430
|
+
},
|
|
404
431
|
},
|
|
405
432
|
examples: [
|
|
406
433
|
'variable set agent <agent> NPM_TOKEN --value-file token.txt',
|
|
434
|
+
'variable set agent <agent> DEPLOY_KEY --value-file key.txt --team-runners-only',
|
|
435
|
+
'variable set agent <agent> OPENAI_API_KEY --from-runner',
|
|
407
436
|
],
|
|
408
437
|
}),
|
|
409
|
-
description: `Creates or replaces the variable; the value is encrypted at rest and never answered. Needs the right to change the scope. ${scopeAccess}`,
|
|
438
|
+
description: `Creates or replaces the variable; the value is encrypted at rest and never answered. A run's variables go to the runner that takes it, a personal runner of anyone who may use the agent included, unless one is marked \`teamRunnersOnly\`: then only a team runner takes the run. Leave \`value\` out to change only \`teamRunnersOnly\` of an existing variable. With \`fromRunner\` the variable is a name only: the runner that takes the run provides its value from its own configuration (\`nocobase-runner env set NAME\` or \`--pass-env NAME\`), and a runner that does not fails the run before the agent starts. Needs the right to change the scope. ${scopeAccess}`,
|
|
410
439
|
responses: {
|
|
411
440
|
200: dataResponse(VariableSchema.nullable()),
|
|
412
441
|
404: noScope,
|
|
@@ -415,7 +444,15 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
415
444
|
}), variableParam, apiValidator('json', VariableValueInput), async (context) => {
|
|
416
445
|
const target = context.get('target');
|
|
417
446
|
const { variableName } = context.req.valid('param');
|
|
418
|
-
|
|
447
|
+
const body = context.req.valid('json');
|
|
448
|
+
await services.variables.set(target, variableName, body.value, caller(context).userId, {
|
|
449
|
+
...(body.teamRunnersOnly === undefined
|
|
450
|
+
? {}
|
|
451
|
+
: { teamRunnersOnly: body.teamRunnersOnly }),
|
|
452
|
+
...(body.fromRunner === undefined
|
|
453
|
+
? {}
|
|
454
|
+
: { fromRunner: body.fromRunner }),
|
|
455
|
+
});
|
|
419
456
|
const variable = (await services.variables.list(target)).find((item) => item.name === variableName);
|
|
420
457
|
return context.json({ data: variable ?? null });
|
|
421
458
|
});
|
|
@@ -854,6 +891,17 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
854
891
|
const runParam = apiValidator('param', RunParams);
|
|
855
892
|
const noRun = notFoundAs('The run');
|
|
856
893
|
const runVisibility = "The caller sees the runs they started or own, and every run but a private subject's (a conversation) with `agents.agents` read.";
|
|
894
|
+
const machineViewer = async (context) => {
|
|
895
|
+
const who = caller(context);
|
|
896
|
+
const manage = await who.can('agents.runners', 'manage');
|
|
897
|
+
const see = manage ||
|
|
898
|
+
(await who.can('agents.runners', 'read')) ||
|
|
899
|
+
(await who.can('agents.agents', 'read'));
|
|
900
|
+
const uses = see &&
|
|
901
|
+
!manage &&
|
|
902
|
+
(await services.agents.list()).some((agent) => services.agents.mayInvoke(agent, who.userId));
|
|
903
|
+
return { userId: who.userId, seesMachines: manage || uses };
|
|
904
|
+
};
|
|
857
905
|
/** Only a caller who may see the run of the path (or, with `manage`, act on it) goes on. */
|
|
858
906
|
const runAccess = (action) => async (context, next) => {
|
|
859
907
|
await visibleRun(context, action);
|
|
@@ -902,8 +950,11 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
902
950
|
});
|
|
903
951
|
const page = runs.slice(0, query.pageSize);
|
|
904
952
|
const last = page.at(-1);
|
|
953
|
+
const viewer = await machineViewer(context);
|
|
905
954
|
return context.json({
|
|
906
|
-
data: page
|
|
955
|
+
data: page
|
|
956
|
+
.filter((run) => involves(run, who.userId) || !isPrivate(run))
|
|
957
|
+
.map((run) => runForViewer(run, viewer)),
|
|
907
958
|
meta: runs.length > query.pageSize && last
|
|
908
959
|
? {
|
|
909
960
|
nextPageToken: encodePageToken({
|
|
@@ -930,7 +981,7 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
930
981
|
...apiErrorResponses,
|
|
931
982
|
},
|
|
932
983
|
}), runParam, async (context) => context.json({
|
|
933
|
-
data: await services.runs.detail(context.req.valid('param').runId),
|
|
984
|
+
data: runForViewer(await services.runs.detail(context.req.valid('param').runId), await machineViewer(context)),
|
|
934
985
|
}));
|
|
935
986
|
router.get('/runs/:runId/brief', guard, runAccess('read'), describeRoute({
|
|
936
987
|
tags,
|
|
@@ -960,18 +1011,18 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
960
1011
|
flags: { runId: { name: 'run' }, pageSize: { name: 'limit' } },
|
|
961
1012
|
columns: ['seq', 'at', 'type', 'tool'],
|
|
962
1013
|
}),
|
|
963
|
-
description: `The run's transcript as JSON pages, in order: a page holds the events after \`after\` (a \`seq\`), up to \`pageSize\`. Not a stream: to follow a run, ask again with \`after\` set to \`meta.lastSeq\`, when the run's realtime topic announces a change. ${runVisibility}`,
|
|
1014
|
+
description: `The run's transcript as JSON pages, in order: a page holds the events after \`after\` (a \`seq\`), up to \`pageSize\`. Repeat \`type\` to filter raw event types before paging; omit it for all events. Keep the same types while paging. Not a stream: to follow a run, ask again with \`after\` set to \`meta.lastSeq\`, when the run's realtime topic announces a change. ${runVisibility}`,
|
|
964
1015
|
responses: {
|
|
965
1016
|
200: listResponse(RunEventItemSchema, SeqPageMetaSchema),
|
|
966
1017
|
404: noRun,
|
|
967
1018
|
...apiErrorResponses,
|
|
968
1019
|
},
|
|
969
1020
|
}), runParam, apiValidator('query', RunEventsQuery), async (context) => {
|
|
970
|
-
const { after, pageSize, pageToken } = context.req.valid('query');
|
|
1021
|
+
const { after, pageSize, pageToken, type } = context.req.valid('query');
|
|
971
1022
|
const from = pageToken === undefined
|
|
972
1023
|
? (after ?? 0)
|
|
973
1024
|
: decodePageToken(pageToken, z.number().int().min(0));
|
|
974
|
-
const page = await services.runs.events(context.req.valid('param').runId, from, pageSize);
|
|
1025
|
+
const page = await services.runs.events(context.req.valid('param').runId, from, pageSize, type);
|
|
975
1026
|
return context.json({
|
|
976
1027
|
data: page.events,
|
|
977
1028
|
meta: {
|
|
@@ -1000,7 +1051,7 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
1000
1051
|
...apiErrorResponses,
|
|
1001
1052
|
},
|
|
1002
1053
|
}), runParam, async (context) => context.json({
|
|
1003
|
-
data: await services.runs.cancel(context.req.valid('param').runId, caller(context).userId),
|
|
1054
|
+
data: runForViewer(await services.runs.cancel(context.req.valid('param').runId, caller(context).userId), await machineViewer(context)),
|
|
1004
1055
|
}));
|
|
1005
1056
|
router.post('/runs/:runId/retry', guard, runAccess('manage'), describeRoute({
|
|
1006
1057
|
tags,
|
|
@@ -1011,15 +1062,20 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
1011
1062
|
args: ['runId'],
|
|
1012
1063
|
flags: { runId: { name: 'run' } },
|
|
1013
1064
|
}),
|
|
1014
|
-
description: 'Queues a new run with the same input. Whoever started or owns it, or a manager of agents, may.',
|
|
1065
|
+
description: 'Queues a new run with the same input once. Whoever started or owns it, or a manager of agents, may. Repeating a retry returns RUN_ALREADY_RETRIED (FAILED_PRECONDITION) with the replacement run id.',
|
|
1015
1066
|
responses: {
|
|
1016
1067
|
200: dataResponse(RunSchema),
|
|
1017
|
-
400: apiErrorResponse(400, 'The run cannot be retried (`RUN_NOT_RETRYABLE`).'),
|
|
1068
|
+
400: apiErrorResponse(400, 'The run cannot be retried (`RUN_NOT_RETRYABLE`) or has already been retried (`RUN_ALREADY_RETRIED`).'),
|
|
1018
1069
|
404: noRun,
|
|
1019
1070
|
...apiErrorResponses,
|
|
1020
1071
|
},
|
|
1021
1072
|
}), runParam, async (context) => context.json({
|
|
1022
|
-
data: await services.runs.retry(context.req.valid('param').runId, caller(context).userId
|
|
1073
|
+
data: runForViewer(await services.runs.retry(context.req.valid('param').runId, caller(context).userId,
|
|
1074
|
+
// Display attribution trusts the client header. Other HTTP callers,
|
|
1075
|
+
// including API-key scripts, are runRecord; api is for service callers.
|
|
1076
|
+
context.req.header('x-nocobase-client') === 'cli'
|
|
1077
|
+
? 'cli'
|
|
1078
|
+
: 'runRecord'), await machineViewer(context)),
|
|
1023
1079
|
}));
|
|
1024
1080
|
// What runs used and cost, behind the usage page's grant.
|
|
1025
1081
|
const usagePage = async (context, next) => {
|
|
@@ -1145,65 +1201,28 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
1145
1201
|
// Agents, last: `/:agentId` would otherwise shadow the fixed segments above.
|
|
1146
1202
|
const agentParam = apiValidator('param', AgentParams);
|
|
1147
1203
|
const noAgent = notFoundAs('The agent');
|
|
1148
|
-
|
|
1149
|
-
router.get('/', scoped, can('agents.agents', 'read'), describeRoute({
|
|
1204
|
+
router.get('/', guard, describeRoute({
|
|
1150
1205
|
tags,
|
|
1151
1206
|
summary: 'List agents',
|
|
1152
1207
|
operationId: 'agentsListAgents',
|
|
1153
1208
|
...cliRoute({
|
|
1154
1209
|
command: 'agent list-all',
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
'id',
|
|
1158
|
-
'name',
|
|
1159
|
-
'type',
|
|
1160
|
-
'ownerName',
|
|
1161
|
-
'activeRuns',
|
|
1162
|
-
'archivedAt',
|
|
1163
|
-
],
|
|
1164
|
-
examples: ['agent list-all --archived'],
|
|
1210
|
+
columns: ['id', 'name', 'status', 'unusable', 'busy', 'description'],
|
|
1211
|
+
examples: ['agent list-all', 'agent list-all --json'],
|
|
1165
1212
|
}),
|
|
1166
|
-
description: '
|
|
1213
|
+
description: 'Every agent discovered from runners: one for each coding tool and model they report, with whether it is enabled, what it is good at, where it can run now (team and personal runners, the caller’s own among them), why it cannot take the caller’s work, and whether the caller may change it. Anyone signed in may read them; only a manager of agents (`agents.agents` manage) changes them.',
|
|
1167
1214
|
responses: {
|
|
1168
|
-
200: listResponse(
|
|
1215
|
+
200: listResponse(AgentViewSchema),
|
|
1169
1216
|
...apiErrorResponses,
|
|
1170
1217
|
},
|
|
1171
|
-
}),
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
1218
|
+
}), async (context) => {
|
|
1219
|
+
const who = caller(context);
|
|
1220
|
+
const data = await services.views(services.tx.read(), who.userId, {
|
|
1221
|
+
canEdit: await who.can('agents.agents', 'manage'),
|
|
1222
|
+
});
|
|
1175
1223
|
return context.json({ data, meta: { total: data.length } });
|
|
1176
1224
|
});
|
|
1177
|
-
router.
|
|
1178
|
-
tags,
|
|
1179
|
-
summary: 'Create an agent',
|
|
1180
|
-
operationId: 'agentsCreateAgent',
|
|
1181
|
-
...cliRoute({
|
|
1182
|
-
command: 'agent create',
|
|
1183
|
-
bodyFile: 'file',
|
|
1184
|
-
flags: {
|
|
1185
|
-
instructions: { contentFile: true },
|
|
1186
|
-
modelEntries: { name: 'models' },
|
|
1187
|
-
ownerUserId: { name: 'owner' },
|
|
1188
|
-
runnerIds: { name: 'runtimes' },
|
|
1189
|
-
skillIds: { name: 'skills' },
|
|
1190
|
-
userIds: { name: 'users' },
|
|
1191
|
-
},
|
|
1192
|
-
examples: [
|
|
1193
|
-
'agent create --name Coder --models \'[{"tool":"claude"},{"tool":"codex","model":"gpt-5"}]\'',
|
|
1194
|
-
'agent create --name PM --type online --models \'[{"modelService":"openai","model":"gpt-5"}]\'',
|
|
1195
|
-
'agent create --file agent.json',
|
|
1196
|
-
],
|
|
1197
|
-
}),
|
|
1198
|
-
description: '`modelEntries` lists the tools and models it works with, in order (the first is its default): `{ tool, model? }` for a runner agent, `{ modelService, model }` for an online one. Needs `agents.agents` manage.',
|
|
1199
|
-
responses: {
|
|
1200
|
-
201: dataResponse(AgentSchema, 'Created.'),
|
|
1201
|
-
...apiErrorResponses,
|
|
1202
|
-
},
|
|
1203
|
-
}), apiValidator('json', AgentInputSchema), async (context) => context.json({
|
|
1204
|
-
data: await services.agents.create(caller(context).userId, context.req.valid('json')),
|
|
1205
|
-
}, 201));
|
|
1206
|
-
router.get('/:agentId', scoped, can('agents.agents', 'read'), describeRoute({
|
|
1225
|
+
router.get('/:agentId', guard, describeRoute({
|
|
1207
1226
|
tags,
|
|
1208
1227
|
summary: 'Get an agent',
|
|
1209
1228
|
operationId: 'agentsGetAgent',
|
|
@@ -1212,17 +1231,22 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
1212
1231
|
args: ['agentId'],
|
|
1213
1232
|
flags: { agentId: { name: 'agent' } },
|
|
1214
1233
|
}),
|
|
1215
|
-
description: '
|
|
1234
|
+
description: 'An agent as the Agent page shows it. An application’s own agent, such as a project manager, is answered too.',
|
|
1216
1235
|
responses: {
|
|
1217
|
-
200: dataResponse(
|
|
1236
|
+
200: dataResponse(AgentViewSchema),
|
|
1218
1237
|
404: noAgent,
|
|
1219
1238
|
...apiErrorResponses,
|
|
1220
1239
|
},
|
|
1221
1240
|
}), agentParam, async (context) => {
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1224
|
-
])
|
|
1225
|
-
|
|
1241
|
+
const who = caller(context);
|
|
1242
|
+
const agent = await services.agents.get(context.req.valid('param').agentId);
|
|
1243
|
+
const [data] = await agentViews(services.tx.read(), [agent], {
|
|
1244
|
+
availability: services.availability,
|
|
1245
|
+
userId: who.userId,
|
|
1246
|
+
canEdit: await who.can('agents.agents', 'manage'),
|
|
1247
|
+
now: services.clock.now(),
|
|
1248
|
+
});
|
|
1249
|
+
return context.json({ data });
|
|
1226
1250
|
});
|
|
1227
1251
|
router.get('/:agentId/history', guard, can('agents.agents', 'read'), describeRoute({
|
|
1228
1252
|
tags,
|
|
@@ -1268,117 +1292,32 @@ export function createAdminRoutes(services, guard, scoped = guard) {
|
|
|
1268
1292
|
: {},
|
|
1269
1293
|
});
|
|
1270
1294
|
});
|
|
1271
|
-
router.patch('/:agentId', scoped,
|
|
1295
|
+
router.patch('/:agentId', scoped, can('agents.agents', 'manage'), describeRoute({
|
|
1272
1296
|
tags,
|
|
1273
1297
|
summary: 'Update an agent',
|
|
1274
1298
|
operationId: 'agentsUpdateAgent',
|
|
1275
1299
|
...cliRoute({
|
|
1276
1300
|
command: 'agent update',
|
|
1277
1301
|
args: ['agentId'],
|
|
1278
|
-
bodyFile: 'file',
|
|
1279
1302
|
flags: {
|
|
1280
1303
|
agentId: { name: 'agent' },
|
|
1281
|
-
|
|
1282
|
-
modelEntries: { name: 'models' },
|
|
1283
|
-
ownerUserId: { name: 'owner' },
|
|
1284
|
-
runnerIds: { name: 'runtimes' },
|
|
1285
|
-
skillIds: { name: 'skills' },
|
|
1286
|
-
userIds: { name: 'users' },
|
|
1287
|
-
expectedRevision: { name: 'revision' },
|
|
1304
|
+
description: { name: 'good-at', contentFile: true },
|
|
1288
1305
|
},
|
|
1289
1306
|
examples: [
|
|
1290
|
-
'agent update <agent> --
|
|
1291
|
-
'agent update <agent> --
|
|
1307
|
+
'agent update <agent> --good-at "Code review" --enabled --expected-revision 2',
|
|
1308
|
+
'agent update <agent> --no-enabled --expected-revision 3',
|
|
1292
1309
|
],
|
|
1293
1310
|
}),
|
|
1294
|
-
description:
|
|
1295
|
-
responses: {
|
|
1296
|
-
200: dataResponse(AgentSchema),
|
|
1297
|
-
404: noAgent,
|
|
1298
|
-
409: revisionConflict('agent'),
|
|
1299
|
-
...apiErrorResponses,
|
|
1300
|
-
},
|
|
1301
|
-
}), agentParam, apiValidator('json', AgentPatchSchema), async (context) => {
|
|
1302
|
-
const who = caller(context);
|
|
1303
|
-
const agent = await services.agents.get(context.req.valid('param').agentId);
|
|
1304
|
-
const patch = context.req.valid('json');
|
|
1305
|
-
if (!(await who.can('agents.agents', 'manage'))) {
|
|
1306
|
-
// Someone editing as the owner gives the agent only what they may grant themselves.
|
|
1307
|
-
if (patch.ownerUserId !== undefined &&
|
|
1308
|
-
patch.ownerUserId !== agent.ownerUserId)
|
|
1309
|
-
throw forbidden('Only a manager of agents may give an agent to another owner.');
|
|
1310
|
-
if (patch.actions !== undefined) {
|
|
1311
|
-
const held = await services.gate.allowed({
|
|
1312
|
-
kind: 'user',
|
|
1313
|
-
userId: who.userId,
|
|
1314
|
-
displayName: who.userId,
|
|
1315
|
-
});
|
|
1316
|
-
const beyond = patch.actions.filter((action) => !agent.actions.includes(action) && !held.has(action));
|
|
1317
|
-
if (beyond.length > 0)
|
|
1318
|
-
throw forbidden(`You may not give the agent business actions you do not hold yourself: ${beyond.join(', ')}.`);
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
return context.json({
|
|
1322
|
-
data: await services.agents.update(agent.id, who.userId, patch),
|
|
1323
|
-
});
|
|
1324
|
-
});
|
|
1325
|
-
router.delete('/:agentId', scoped, editableAgent, describeRoute({
|
|
1326
|
-
tags,
|
|
1327
|
-
summary: 'Delete an agent',
|
|
1328
|
-
operationId: 'agentsDeleteAgent',
|
|
1329
|
-
...cliRoute({
|
|
1330
|
-
command: 'agent delete',
|
|
1331
|
-
args: ['agentId'],
|
|
1332
|
-
flags: { agentId: { name: 'agent' } },
|
|
1333
|
-
confirm: 'Delete this archived agent with its variables and history?',
|
|
1334
|
-
}),
|
|
1335
|
-
description: `Deletes an archived agent with no open runs, with its variables, skill attachments and history; its past runs stay. ${editAccess}`,
|
|
1336
|
-
responses: {
|
|
1337
|
-
204: emptyResponse(),
|
|
1338
|
-
400: apiErrorResponse(400, 'The agent is not archived, or has open runs (`AGENT_NOT_ARCHIVED`, `AGENT_HAS_ACTIVE_RUNS`).'),
|
|
1339
|
-
404: noAgent,
|
|
1340
|
-
...apiErrorResponses,
|
|
1341
|
-
},
|
|
1342
|
-
}), agentParam, async (context) => {
|
|
1343
|
-
await services.agents.remove(context.req.valid('param').agentId, caller(context).userId);
|
|
1344
|
-
return context.body(null, 204);
|
|
1345
|
-
});
|
|
1346
|
-
router.post('/:agentId/archive', scoped, editableAgent, describeRoute({
|
|
1347
|
-
tags,
|
|
1348
|
-
summary: 'Archive an agent',
|
|
1349
|
-
operationId: 'agentsArchiveAgent',
|
|
1350
|
-
...cliRoute({
|
|
1351
|
-
command: 'agent archive',
|
|
1352
|
-
args: ['agentId'],
|
|
1353
|
-
flags: { agentId: { name: 'agent' } },
|
|
1354
|
-
confirm: 'Archive this agent? Its queued runs are withdrawn.',
|
|
1355
|
-
}),
|
|
1356
|
-
description: `An archived agent is not run: its queued runs are withdrawn. ${editAccess}`,
|
|
1357
|
-
responses: {
|
|
1358
|
-
200: dataResponse(AgentSchema),
|
|
1359
|
-
404: noAgent,
|
|
1360
|
-
...apiErrorResponses,
|
|
1361
|
-
},
|
|
1362
|
-
}), agentParam, async (context) => context.json({
|
|
1363
|
-
data: await services.agents.archive(context.req.valid('param').agentId, caller(context).userId),
|
|
1364
|
-
}));
|
|
1365
|
-
router.post('/:agentId/restore', scoped, editableAgent, describeRoute({
|
|
1366
|
-
tags,
|
|
1367
|
-
summary: 'Restore an archived agent',
|
|
1368
|
-
operationId: 'agentsRestoreAgent',
|
|
1369
|
-
...cliRoute({
|
|
1370
|
-
command: 'agent restore',
|
|
1371
|
-
args: ['agentId'],
|
|
1372
|
-
flags: { agentId: { name: 'agent' } },
|
|
1373
|
-
}),
|
|
1374
|
-
description: editAccess,
|
|
1311
|
+
description: "Writes what an agent discovered from runners is good at, its default reasoning effort, and enables or disables it, against the revision the edit was made from. An agent is enabled only with a description. Disabling withdraws its queued runs. An application's own agent is changed through the application. Needs `agents.agents` manage.",
|
|
1375
1312
|
responses: {
|
|
1376
1313
|
200: dataResponse(AgentSchema),
|
|
1314
|
+
400: apiErrorResponse(400, 'Enabling without a description (`GOOD_AT_REQUIRED`), an effort its tool does not take (`EFFORT_UNSUPPORTED`), or an application’s own agent (`AGENT_MANAGED`).'),
|
|
1377
1315
|
404: noAgent,
|
|
1316
|
+
409: apiErrorResponse(409, 'Someone changed the agent since the revision named (`REVISION_CONFLICT`, `metadata.revision`).'),
|
|
1378
1317
|
...apiErrorResponses,
|
|
1379
1318
|
},
|
|
1380
|
-
}), agentParam, async (context) => context.json({
|
|
1381
|
-
data: await services.agents.
|
|
1319
|
+
}), agentParam, apiValidator('json', AgentPatchSchema), async (context) => context.json({
|
|
1320
|
+
data: await services.agents.update(context.req.valid('param').agentId, caller(context).userId, context.req.valid('json')),
|
|
1382
1321
|
}));
|
|
1383
1322
|
router.get('/:agentId/previewBrief', guard, can('agents.agents', 'read'), describeRoute({
|
|
1384
1323
|
tags,
|