@open-mercato/enterprise 0.7.1-develop.7193.1.910a5b0a1e → 0.7.1-develop.7194.1.ab4fc81f82
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/.turbo/turbo-build.log +1 -1
- package/README.md +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/modules/agent_orchestrator/acl.js +132 -0
- package/dist/modules/agent_orchestrator/acl.js.map +7 -0
- package/dist/modules/agent_orchestrator/ai-agents.js +57 -0
- package/dist/modules/agent_orchestrator/ai-agents.js.map +7 -0
- package/dist/modules/agent_orchestrator/ai-skills.js +48 -0
- package/dist/modules/agent_orchestrator/ai-skills.js.map +7 -0
- package/dist/modules/agent_orchestrator/ai-tools.js +254 -0
- package/dist/modules/agent_orchestrator/ai-tools.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/files/route.js +69 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/files/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/metrics/route.js +81 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/metrics/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/route.js +154 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/run/route.js +250 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/run/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/settings/route.js +105 -0
- package/dist/modules/agent_orchestrator/api/agents/[id]/settings/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/agents/route.js +114 -0
- package/dist/modules/agent_orchestrator/api/agents/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/artifacts/file/[id]/route.js +64 -0
- package/dist/modules/agent_orchestrator/api/artifacts/file/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/audit/by-instigator/[humanUserId]/route.js +105 -0
- package/dist/modules/agent_orchestrator/api/audit/by-instigator/[humanUserId]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/auto-approval/settings/route.js +110 -0
- package/dist/modules/agent_orchestrator/api/auto-approval/settings/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/context-bundles/route.js +88 -0
- package/dist/modules/agent_orchestrator/api/context-bundles/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/corrections/route.js +101 -0
- package/dist/modules/agent_orchestrator/api/corrections/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-assertions/preview/route.js +98 -0
- package/dist/modules/agent_orchestrator/api/eval-assertions/preview/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-assertions/route.js +196 -0
- package/dist/modules/agent_orchestrator/api/eval-assertions/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/[id]/approve/route.js +86 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/[id]/approve/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/[id]/archive/route.js +85 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/[id]/archive/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/[id]/route.js +67 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/export/route.js +78 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/export/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/route.js +140 -0
- package/dist/modules/agent_orchestrator/api/eval-cases/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/[id]/cancel/route.js +67 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/[id]/cancel/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/[id]/case-runs/[caseRunId]/results/route.js +66 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/[id]/case-runs/[caseRunId]/results/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/[id]/route.js +111 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/route.js +157 -0
- package/dist/modules/agent_orchestrator/api/eval-runs/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/eval-scorers/route.js +34 -0
- package/dist/modules/agent_orchestrator/api/eval-scorers/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/executions/[id]/route.js +72 -0
- package/dist/modules/agent_orchestrator/api/executions/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/executions/route.js +185 -0
- package/dist/modules/agent_orchestrator/api/executions/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/features/route.js +61 -0
- package/dist/modules/agent_orchestrator/api/features/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/guardrail-checks/route.js +85 -0
- package/dist/modules/agent_orchestrator/api/guardrail-checks/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/identity/agent/auth/route.js +95 -0
- package/dist/modules/agent_orchestrator/api/identity/agent/auth/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/identity/grants/[id]/revoke/route.js +109 -0
- package/dist/modules/agent_orchestrator/api/identity/grants/[id]/revoke/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/identity/token/route.js +80 -0
- package/dist/modules/agent_orchestrator/api/identity/token/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/identity/well-known/route.js +44 -0
- package/dist/modules/agent_orchestrator/api/identity/well-known/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/metrics/agents/route.js +122 -0
- package/dist/modules/agent_orchestrator/api/metrics/agents/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/metrics/overview/route.js +165 -0
- package/dist/modules/agent_orchestrator/api/metrics/overview/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/openapi.js +29 -0
- package/dist/modules/agent_orchestrator/api/openapi.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/processes/[id]/executions/route.js +160 -0
- package/dist/modules/agent_orchestrator/api/processes/[id]/executions/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/processes/[id]/route.js +53 -0
- package/dist/modules/agent_orchestrator/api/processes/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/processes/route.js +357 -0
- package/dist/modules/agent_orchestrator/api/processes/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/proposals/[id]/dispose/route.js +111 -0
- package/dist/modules/agent_orchestrator/api/proposals/[id]/dispose/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/proposals/route.js +98 -0
- package/dist/modules/agent_orchestrator/api/proposals/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/artifact/route.js +71 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/artifact/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/artifacts/route.js +66 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/artifacts/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/eval-case/route.js +73 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/eval-case/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/flag/route.js +74 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/flag/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/rerun/route.js +165 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/rerun/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/route.js +86 -0
- package/dist/modules/agent_orchestrator/api/runs/[id]/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/runs/route.js +137 -0
- package/dist/modules/agent_orchestrator/api/runs/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/tokens/estimate/route.js +56 -0
- package/dist/modules/agent_orchestrator/api/tokens/estimate/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/trace/ingest/route.js +80 -0
- package/dist/modules/agent_orchestrator/api/trace/ingest/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/web-search/health/route.js +184 -0
- package/dist/modules/agent_orchestrator/api/web-search/health/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/web-search/preview/route.js +150 -0
- package/dist/modules/agent_orchestrator/api/web-search/preview/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/api/web-search/settings/route.js +213 -0
- package/dist/modules/agent_orchestrator/api/web-search/settings/route.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ActivityTab.js +112 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ActivityTab.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentConfigDrawer.js +58 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentConfigDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentHeaderCard.js +117 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AgentHeaderCard.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AssertionFormDrawer.js +318 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/AssertionFormDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ConfigurationTab.js +126 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/ConfigurationTab.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalCaseDrawer.js +379 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalCaseDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalResultsDrawer.js +159 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvalResultsDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvaluationTab.js +581 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/EvaluationTab.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/FilesTab.js +249 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/FilesTab.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/OverviewTab.js +162 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/OverviewTab.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/RunEvaluationDrawer.js +199 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/RunEvaluationDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/TokenCalculatorTab.js +137 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/TokenCalculatorTab.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/filesShared.js +97 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/filesShared.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspacePrimitives.js +159 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspacePrimitives.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspaceShared.js +132 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/components/workspaceShared.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/page.js +266 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/page.meta.js +18 -0
- package/dist/modules/agent_orchestrator/backend/agents/[id]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/agentListFilters.js +44 -0
- package/dist/modules/agent_orchestrator/backend/agents/agentListFilters.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/page.js +439 -0
- package/dist/modules/agent_orchestrator/backend/agents/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/agents/page.meta.js +28 -0
- package/dist/modules/agent_orchestrator/backend/agents/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.js +80 -0
- package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.meta.js +19 -0
- package/dist/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/audit/page.js +324 -0
- package/dist/modules/agent_orchestrator/backend/audit/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/audit/page.meta.js +27 -0
- package/dist/modules/agent_orchestrator/backend/audit/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.js +239 -0
- package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.meta.js +18 -0
- package/dist/modules/agent_orchestrator/backend/caseload/[proposalId]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/caseload/hooks.js +344 -0
- package/dist/modules/agent_orchestrator/backend/caseload/hooks.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/caseload/page.js +1360 -0
- package/dist/modules/agent_orchestrator/backend/caseload/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/caseload/page.meta.js +25 -0
- package/dist/modules/agent_orchestrator/backend/caseload/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.js +357 -0
- package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.meta.js +18 -0
- package/dist/modules/agent_orchestrator/backend/eval-cases/[id]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.js +595 -0
- package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.meta.js +18 -0
- package/dist/modules/agent_orchestrator/backend/eval-runs/[id]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/overview/page.js +593 -0
- package/dist/modules/agent_orchestrator/backend/overview/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/overview/page.meta.js +27 -0
- package/dist/modules/agent_orchestrator/backend/overview/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/playground/PlaygroundEvalPanel.js +219 -0
- package/dist/modules/agent_orchestrator/backend/playground/PlaygroundEvalPanel.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/playground/page.js +443 -0
- package/dist/modules/agent_orchestrator/backend/playground/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/playground/page.meta.js +24 -0
- package/dist/modules/agent_orchestrator/backend/playground/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/[id]/page.js +611 -0
- package/dist/modules/agent_orchestrator/backend/processes/[id]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/[id]/page.meta.js +18 -0
- package/dist/modules/agent_orchestrator/backend/processes/[id]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/MilestoneEditor.js +219 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/MilestoneEditor.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/TriggerEditor.js +326 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/TriggerEditor.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.js +565 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.meta.js +17 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/[id]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/formHelpers.js +69 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/formHelpers.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/navigation.js +9 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/navigation.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/page.js +735 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/page.meta.js +25 -0
- package/dist/modules/agent_orchestrator/backend/processes/definitions/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/page.js +244 -0
- package/dist/modules/agent_orchestrator/backend/processes/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/processes/page.meta.js +29 -0
- package/dist/modules/agent_orchestrator/backend/processes/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.js +204 -0
- package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.meta.js +30 -0
- package/dist/modules/agent_orchestrator/backend/settings/auto-approval/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/AdapterRow.js +241 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/AdapterRow.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/WebSearchPreview.js +129 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/WebSearchPreview.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/page.js +644 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/page.meta.js +32 -0
- package/dist/modules/agent_orchestrator/backend/settings/web-search/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/traces/[id]/page.js +1015 -0
- package/dist/modules/agent_orchestrator/backend/traces/[id]/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/traces/[id]/page.meta.js +18 -0
- package/dist/modules/agent_orchestrator/backend/traces/[id]/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/traces/page.js +477 -0
- package/dist/modules/agent_orchestrator/backend/traces/page.js.map +7 -0
- package/dist/modules/agent_orchestrator/backend/traces/page.meta.js +24 -0
- package/dist/modules/agent_orchestrator/backend/traces/page.meta.js.map +7 -0
- package/dist/modules/agent_orchestrator/cli.js +592 -0
- package/dist/modules/agent_orchestrator/cli.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/artifacts.js +127 -0
- package/dist/modules/agent_orchestrator/commands/artifacts.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/corrections.js +284 -0
- package/dist/modules/agent_orchestrator/commands/corrections.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/dispose.js +265 -0
- package/dist/modules/agent_orchestrator/commands/dispose.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/evalRuns.js +202 -0
- package/dist/modules/agent_orchestrator/commands/evalRuns.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/grants.js +119 -0
- package/dist/modules/agent_orchestrator/commands/grants.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/index.js +11 -0
- package/dist/modules/agent_orchestrator/commands/index.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/processes.js +130 -0
- package/dist/modules/agent_orchestrator/commands/processes.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/proposals.js +67 -0
- package/dist/modules/agent_orchestrator/commands/proposals.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/runActions.js +42 -0
- package/dist/modules/agent_orchestrator/commands/runActions.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/runs.js +183 -0
- package/dist/modules/agent_orchestrator/commands/runs.js.map +7 -0
- package/dist/modules/agent_orchestrator/commands/trace.js +89 -0
- package/dist/modules/agent_orchestrator/commands/trace.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/AgentIoDrawer.js +45 -0
- package/dist/modules/agent_orchestrator/components/AgentIoDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/AgentTimeline.js +129 -0
- package/dist/modules/agent_orchestrator/components/AgentTimeline.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/DisposeDialog.js +87 -0
- package/dist/modules/agent_orchestrator/components/DisposeDialog.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/EmptyArt.js +50 -0
- package/dist/modules/agent_orchestrator/components/EmptyArt.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/InvokeAgentNodeConfig.js +111 -0
- package/dist/modules/agent_orchestrator/components/InvokeAgentNodeConfig.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/ProcessOutcomeLink.js +42 -0
- package/dist/modules/agent_orchestrator/components/ProcessOutcomeLink.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/ProposalCard.js +431 -0
- package/dist/modules/agent_orchestrator/components/ProposalCard.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/ProposalFacts.js +85 -0
- package/dist/modules/agent_orchestrator/components/ProposalFacts.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/ProposalOptionList.js +190 -0
- package/dist/modules/agent_orchestrator/components/ProposalOptionList.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/ProposeOnlyNotice.js +25 -0
- package/dist/modules/agent_orchestrator/components/ProposeOnlyNotice.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/SkillDrawer.js +48 -0
- package/dist/modules/agent_orchestrator/components/SkillDrawer.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/StartHereGuide.js +183 -0
- package/dist/modules/agent_orchestrator/components/StartHereGuide.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/SystemHealthTile.js +135 -0
- package/dist/modules/agent_orchestrator/components/SystemHealthTile.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/WebSearchActivity.js +87 -0
- package/dist/modules/agent_orchestrator/components/WebSearchActivity.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/agentChips.js +90 -0
- package/dist/modules/agent_orchestrator/components/agentChips.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/cockpitStatus.js +94 -0
- package/dist/modules/agent_orchestrator/components/cockpitStatus.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/evalRunTypes.js +209 -0
- package/dist/modules/agent_orchestrator/components/evalRunTypes.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/health/HealthRow.js +15 -0
- package/dist/modules/agent_orchestrator/components/health/HealthRow.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/health/HealthStateBadge.js +13 -0
- package/dist/modules/agent_orchestrator/components/health/HealthStateBadge.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/health/SystemHealthPanel.js +126 -0
- package/dist/modules/agent_orchestrator/components/health/SystemHealthPanel.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/health/vocabulary.js +40 -0
- package/dist/modules/agent_orchestrator/components/health/vocabulary.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/optionalRequest.js +7 -0
- package/dist/modules/agent_orchestrator/components/optionalRequest.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/playgroundRunError.js +37 -0
- package/dist/modules/agent_orchestrator/components/playgroundRunError.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/playgroundToolCalls.js +12 -0
- package/dist/modules/agent_orchestrator/components/playgroundToolCalls.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/processTypes.js +454 -0
- package/dist/modules/agent_orchestrator/components/processTypes.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/proposalCaseStatus.js +64 -0
- package/dist/modules/agent_orchestrator/components/proposalCaseStatus.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/proposalEdit.js +71 -0
- package/dist/modules/agent_orchestrator/components/proposalEdit.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/proposalFactsData.js +138 -0
- package/dist/modules/agent_orchestrator/components/proposalFactsData.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/serverSort.js +34 -0
- package/dist/modules/agent_orchestrator/components/serverSort.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/subjectRef.js +34 -0
- package/dist/modules/agent_orchestrator/components/subjectRef.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/types.js +462 -0
- package/dist/modules/agent_orchestrator/components/types.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/useAgentIcons.js +31 -0
- package/dist/modules/agent_orchestrator/components/useAgentIcons.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/useAgentLabels.js +35 -0
- package/dist/modules/agent_orchestrator/components/useAgentLabels.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/useAgentTags.js +32 -0
- package/dist/modules/agent_orchestrator/components/useAgentTags.js.map +7 -0
- package/dist/modules/agent_orchestrator/components/useCoalescedReload.js +33 -0
- package/dist/modules/agent_orchestrator/components/useCoalescedReload.js.map +7 -0
- package/dist/modules/agent_orchestrator/data/agentIcons.js +35 -0
- package/dist/modules/agent_orchestrator/data/agentIcons.js.map +7 -0
- package/dist/modules/agent_orchestrator/data/agentTags.js +26 -0
- package/dist/modules/agent_orchestrator/data/agentTags.js.map +7 -0
- package/dist/modules/agent_orchestrator/data/entities.js +1382 -0
- package/dist/modules/agent_orchestrator/data/entities.js.map +7 -0
- package/dist/modules/agent_orchestrator/data/proposalEnvelope.js +168 -0
- package/dist/modules/agent_orchestrator/data/proposalEnvelope.js.map +7 -0
- package/dist/modules/agent_orchestrator/data/validators.js +949 -0
- package/dist/modules/agent_orchestrator/data/validators.js.map +7 -0
- package/dist/modules/agent_orchestrator/di.js +169 -0
- package/dist/modules/agent_orchestrator/di.js.map +7 -0
- package/dist/modules/agent_orchestrator/encryption.js +100 -0
- package/dist/modules/agent_orchestrator/encryption.js.map +7 -0
- package/dist/modules/agent_orchestrator/events.js +87 -0
- package/dist/modules/agent_orchestrator/events.js.map +7 -0
- package/dist/modules/agent_orchestrator/examples/deals-health-check-workflow.json +124 -0
- package/dist/modules/agent_orchestrator/examples/refund-triage-workflow.json +210 -0
- package/dist/modules/agent_orchestrator/generated/file-agents.generated.js +169 -0
- package/dist/modules/agent_orchestrator/generated/file-agents.generated.js.map +7 -0
- package/dist/modules/agent_orchestrator/i18n/de.json +1495 -0
- package/dist/modules/agent_orchestrator/i18n/en.json +1495 -0
- package/dist/modules/agent_orchestrator/i18n/es.json +1495 -0
- package/dist/modules/agent_orchestrator/i18n/ko.json +1495 -0
- package/dist/modules/agent_orchestrator/i18n/pl.json +1495 -0
- package/dist/modules/agent_orchestrator/index.js +151 -0
- package/dist/modules/agent_orchestrator/index.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/automationLinks.js +12 -0
- package/dist/modules/agent_orchestrator/lib/automationLinks.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/contextResolver.js +317 -0
- package/dist/modules/agent_orchestrator/lib/context/contextResolver.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/documentIngest.js +93 -0
- package/dist/modules/agent_orchestrator/lib/context/documentIngest.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/documentOcrProvider.js +90 -0
- package/dist/modules/agent_orchestrator/lib/context/documentOcrProvider.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/documentSource.js +44 -0
- package/dist/modules/agent_orchestrator/lib/context/documentSource.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/index.js +64 -0
- package/dist/modules/agent_orchestrator/lib/context/index.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/packer.js +47 -0
- package/dist/modules/agent_orchestrator/lib/context/packer.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/redactor.js +72 -0
- package/dist/modules/agent_orchestrator/lib/context/redactor.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/registry.js +60 -0
- package/dist/modules/agent_orchestrator/lib/context/registry.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/context/retrievalSource.js +69 -0
- package/dist/modules/agent_orchestrator/lib/context/retrievalSource.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/crudCache.js +24 -0
- package/dist/modules/agent_orchestrator/lib/crudCache.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.js +51 -0
- package/dist/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/disposition/dispositionService.js +190 -0
- package/dist/modules/agent_orchestrator/lib/disposition/dispositionService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/disposition/resume.js +42 -0
- package/dist/modules/agent_orchestrator/lib/disposition/resume.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.js +59 -0
- package/dist/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/assertionResolution.js +53 -0
- package/dist/modules/agent_orchestrator/lib/eval/assertionResolution.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/canonicalInputKey.js +20 -0
- package/dist/modules/agent_orchestrator/lib/eval/canonicalInputKey.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/defaultAssertions.js +78 -0
- package/dist/modules/agent_orchestrator/lib/eval/defaultAssertions.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/evalGate.js +71 -0
- package/dist/modules/agent_orchestrator/lib/eval/evalGate.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/evalReplayService.js +277 -0
- package/dist/modules/agent_orchestrator/lib/eval/evalReplayService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/evalRuntimeService.js +141 -0
- package/dist/modules/agent_orchestrator/lib/eval/evalRuntimeService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/judgeRubric.js +150 -0
- package/dist/modules/agent_orchestrator/lib/eval/judgeRubric.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/llmJudge.js +122 -0
- package/dist/modules/agent_orchestrator/lib/eval/llmJudge.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/projectRunView.js +32 -0
- package/dist/modules/agent_orchestrator/lib/eval/projectRunView.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/agent.js +240 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/agent.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/economics.js +77 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/economics.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/index.js +97 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/index.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/judge.js +66 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/judge.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/shared.js +146 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/shared.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/structured.js +264 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/structured.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/text.js +110 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/text.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/tools.js +232 -0
- package/dist/modules/agent_orchestrator/lib/eval/registry/tools.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/sampling.js +26 -0
- package/dist/modules/agent_orchestrator/lib/eval/sampling.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/scorers.js +46 -0
- package/dist/modules/agent_orchestrator/lib/eval/scorers.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/eval/types.js +16 -0
- package/dist/modules/agent_orchestrator/lib/eval/types.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/featureFlags.js +9 -0
- package/dist/modules/agent_orchestrator/lib/featureFlags.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/grounding.js +90 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/grounding.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/groundingSets.js +35 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/groundingSets.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/guardrailService.js +160 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/guardrailService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/promptInjection.js +94 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/promptInjection.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/publicEndpointRateLimit.js +36 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/publicEndpointRateLimit.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/syncGroundingSets.js +43 -0
- package/dist/modules/agent_orchestrator/lib/guardrails/syncGroundingSets.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentAuthMdService.js +136 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentAuthMdService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentDelegationGrantService.js +55 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentDelegationGrantService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentNoBypassSubscriber.js +50 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentNoBypassSubscriber.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentPrincipalService.js +149 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentPrincipalService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentTokenService.js +138 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentTokenService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentWriteScope.js +22 -0
- package/dist/modules/agent_orchestrator/lib/identity/agentWriteScope.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/metrics/metricRollupService.js +112 -0
- package/dist/modules/agent_orchestrator/lib/metrics/metricRollupService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/processes/executionSearch.js +16 -0
- package/dist/modules/agent_orchestrator/lib/processes/executionSearch.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/processes/materializeAgentWorkflow.js +178 -0
- package/dist/modules/agent_orchestrator/lib/processes/materializeAgentWorkflow.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/processes/processProjection.js +220 -0
- package/dist/modules/agent_orchestrator/lib/processes/processProjection.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/processes/subjectContext.js +14 -0
- package/dist/modules/agent_orchestrator/lib/processes/subjectContext.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/processes/workflowGrant.js +41 -0
- package/dist/modules/agent_orchestrator/lib/processes/workflowGrant.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/queue.js +25 -0
- package/dist/modules/agent_orchestrator/lib/queue.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/actionVocabulary.js +66 -0
- package/dist/modules/agent_orchestrator/lib/runtime/actionVocabulary.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/admission.js +113 -0
- package/dist/modules/agent_orchestrator/lib/runtime/admission.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/agentRunSessionStore.js +92 -0
- package/dist/modules/agent_orchestrator/lib/runtime/agentRunSessionStore.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/agentRuntime.js +67 -0
- package/dist/modules/agent_orchestrator/lib/runtime/agentRuntime.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/agentWorkspaceManager.js +111 -0
- package/dist/modules/agent_orchestrator/lib/runtime/agentWorkspaceManager.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/artifactCollector.js +146 -0
- package/dist/modules/agent_orchestrator/lib/runtime/artifactCollector.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/artifactFileStore.js +85 -0
- package/dist/modules/agent_orchestrator/lib/runtime/artifactFileStore.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/attachmentStager.js +62 -0
- package/dist/modules/agent_orchestrator/lib/runtime/attachmentStager.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/errors.js +38 -0
- package/dist/modules/agent_orchestrator/lib/runtime/errors.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/executeProposal.js +37 -0
- package/dist/modules/agent_orchestrator/lib/runtime/executeProposal.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/fileAgentSkills.js +32 -0
- package/dist/modules/agent_orchestrator/lib/runtime/fileAgentSkills.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/fileInput.js +27 -0
- package/dist/modules/agent_orchestrator/lib/runtime/fileInput.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/invokeAgentForWorkflow.js +115 -0
- package/dist/modules/agent_orchestrator/lib/runtime/invokeAgentForWorkflow.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/modelPricing.js +77 -0
- package/dist/modules/agent_orchestrator/lib/runtime/modelPricing.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/nativeAgentRunner.js +422 -0
- package/dist/modules/agent_orchestrator/lib/runtime/nativeAgentRunner.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/nativeTraceCapture.js +132 -0
- package/dist/modules/agent_orchestrator/lib/runtime/nativeTraceCapture.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/openCodeAgentRunner.js +581 -0
- package/dist/modules/agent_orchestrator/lib/runtime/openCodeAgentRunner.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/persistence.js +110 -0
- package/dist/modules/agent_orchestrator/lib/runtime/persistence.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/providerBudget.js +152 -0
- package/dist/modules/agent_orchestrator/lib/runtime/providerBudget.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/rerunContext.js +13 -0
- package/dist/modules/agent_orchestrator/lib/runtime/rerunContext.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/runContext.js +17 -0
- package/dist/modules/agent_orchestrator/lib/runtime/runContext.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/runtime/sandboxedScript.js +39 -0
- package/dist/modules/agent_orchestrator/lib/runtime/sandboxedScript.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/agentMarkdown.js +91 -0
- package/dist/modules/agent_orchestrator/lib/sdk/agentMarkdown.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/agentOutcomeContract.js +35 -0
- package/dist/modules/agent_orchestrator/lib/sdk/agentOutcomeContract.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/defineAgent.js +214 -0
- package/dist/modules/agent_orchestrator/lib/sdk/defineAgent.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/defineFileAgent.js +417 -0
- package/dist/modules/agent_orchestrator/lib/sdk/defineFileAgent.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/defineSkill.js +40 -0
- package/dist/modules/agent_orchestrator/lib/sdk/defineSkill.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/outcomeSchema.js +129 -0
- package/dist/modules/agent_orchestrator/lib/sdk/outcomeSchema.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/sdk/skillMarkdown.js +78 -0
- package/dist/modules/agent_orchestrator/lib/sdk/skillMarkdown.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/seeds.js +224 -0
- package/dist/modules/agent_orchestrator/lib/seeds.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/settings/agentSettings.js +55 -0
- package/dist/modules/agent_orchestrator/lib/settings/agentSettings.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/systemHealth.js +94 -0
- package/dist/modules/agent_orchestrator/lib/systemHealth.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/eventTriggerMatch.js +81 -0
- package/dist/modules/agent_orchestrator/lib/tasks/eventTriggerMatch.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/milestones.js +96 -0
- package/dist/modules/agent_orchestrator/lib/tasks/milestones.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/outcome.js +44 -0
- package/dist/modules/agent_orchestrator/lib/tasks/outcome.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/outcomeLink.js +45 -0
- package/dist/modules/agent_orchestrator/lib/tasks/outcomeLink.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/schedule.js +63 -0
- package/dist/modules/agent_orchestrator/lib/tasks/schedule.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/scheduleValidation.js +25 -0
- package/dist/modules/agent_orchestrator/lib/tasks/scheduleValidation.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tasks/triggers.js +34 -0
- package/dist/modules/agent_orchestrator/lib/tasks/triggers.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tokens/computeAgentTokenUsage.js +70 -0
- package/dist/modules/agent_orchestrator/lib/tokens/computeAgentTokenUsage.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/tokens/types.js +1 -0
- package/dist/modules/agent_orchestrator/lib/tokens/types.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/trace/artifactStore.js +89 -0
- package/dist/modules/agent_orchestrator/lib/trace/artifactStore.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/trace/correctionService.js +61 -0
- package/dist/modules/agent_orchestrator/lib/trace/correctionService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/trace/ingestAuth.js +39 -0
- package/dist/modules/agent_orchestrator/lib/trace/ingestAuth.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/trace/redactToolSummary.js +44 -0
- package/dist/modules/agent_orchestrator/lib/trace/redactToolSummary.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/trace/spanTimeline.js +96 -0
- package/dist/modules/agent_orchestrator/lib/trace/spanTimeline.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/trace/traceIngestionService.js +168 -0
- package/dist/modules/agent_orchestrator/lib/trace/traceIngestionService.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/guardrails.js +116 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/guardrails.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/healthCache.js +68 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/healthCache.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/healthProbePlan.js +16 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/healthProbePlan.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/policy.js +172 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/policy.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/registry.js +113 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/registry.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/secretStorage.js +87 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/secretStorage.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/steps.js +48 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/steps.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/tools.js +176 -0
- package/dist/modules/agent_orchestrator/lib/webSearch/tools.js.map +7 -0
- package/dist/modules/agent_orchestrator/lib/workInbox/agentDispositionSource.js +151 -0
- package/dist/modules/agent_orchestrator/lib/workInbox/agentDispositionSource.js.map +7 -0
- package/dist/modules/agent_orchestrator/migrations/Migration20260906141535_agent_orchestrator.js +200 -0
- package/dist/modules/agent_orchestrator/migrations/Migration20260906141535_agent_orchestrator.js.map +7 -0
- package/dist/modules/agent_orchestrator/notifications.js +32 -0
- package/dist/modules/agent_orchestrator/notifications.js.map +7 -0
- package/dist/modules/agent_orchestrator/setup.js +147 -0
- package/dist/modules/agent_orchestrator/setup.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-event-trigger.js +140 -0
- package/dist/modules/agent_orchestrator/subscribers/process-event-trigger.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-proposal-created.js +17 -0
- package/dist/modules/agent_orchestrator/subscribers/process-proposal-created.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-proposal-disposed.js +15 -0
- package/dist/modules/agent_orchestrator/subscribers/process-proposal-disposed.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-run-completed.js +17 -0
- package/dist/modules/agent_orchestrator/subscribers/process-run-completed.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-run-ingested.js +17 -0
- package/dist/modules/agent_orchestrator/subscribers/process-run-ingested.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-cancelled.js +20 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-cancelled.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-completed.js +20 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-completed.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-failed.js +21 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-failed.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-milestone.js +30 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-milestone.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-started.js +25 -0
- package/dist/modules/agent_orchestrator/subscribers/process-workflow-started.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/proposal-disposed-notification-clear.js +34 -0
- package/dist/modules/agent_orchestrator/subscribers/proposal-disposed-notification-clear.js.map +7 -0
- package/dist/modules/agent_orchestrator/subscribers/proposal-pending-notification.js +53 -0
- package/dist/modules/agent_orchestrator/subscribers/proposal-pending-notification.js.map +7 -0
- package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.client.js +44 -0
- package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.client.js.map +7 -0
- package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.js +17 -0
- package/dist/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.js.map +7 -0
- package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.client.js +107 -0
- package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.client.js.map +7 -0
- package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.js +17 -0
- package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.js.map +7 -0
- package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-link/widget.js +28 -0
- package/dist/modules/agent_orchestrator/widgets/injection/task-proposal-link/widget.js.map +7 -0
- package/dist/modules/agent_orchestrator/widgets/injection-table.js +33 -0
- package/dist/modules/agent_orchestrator/widgets/injection-table.js.map +7 -0
- package/dist/modules/agent_orchestrator/workers/eval-suite-runner.js +56 -0
- package/dist/modules/agent_orchestrator/workers/eval-suite-runner.js.map +7 -0
- package/dist/modules/agent_orchestrator/workers/llm-judge.js +29 -0
- package/dist/modules/agent_orchestrator/workers/llm-judge.js.map +7 -0
- package/dist/modules/agent_orchestrator/workers/metric-rollup.js +29 -0
- package/dist/modules/agent_orchestrator/workers/metric-rollup.js.map +7 -0
- package/dist/modules/agent_orchestrator/workers/process-execution-starter.js +130 -0
- package/dist/modules/agent_orchestrator/workers/process-execution-starter.js.map +7 -0
- package/dist/modules/record_locks/lib/conflictValues.js +78 -0
- package/dist/modules/record_locks/lib/conflictValues.js.map +7 -0
- package/dist/modules/record_locks/lib/crudMutationGuardService.js +19 -4
- package/dist/modules/record_locks/lib/crudMutationGuardService.js.map +2 -2
- package/dist/modules/record_locks/lib/recordLockService.js +1 -44
- package/dist/modules/record_locks/lib/recordLockService.js.map +2 -2
- package/jest.config.cjs +2 -0
- package/package.json +18 -6
- package/src/index.ts +1 -1
- package/src/modules/agent_orchestrator/.ai/skills/om-create-opencode-agent/SKILL.md +251 -0
- package/src/modules/agent_orchestrator/AGENTS.md +374 -0
- package/src/modules/agent_orchestrator/DEMO.md +175 -0
- package/src/modules/agent_orchestrator/acl.ts +131 -0
- package/src/modules/agent_orchestrator/ai-agents.ts +70 -0
- package/src/modules/agent_orchestrator/ai-skills.ts +59 -0
- package/src/modules/agent_orchestrator/ai-tools.ts +391 -0
- package/src/modules/agent_orchestrator/api/agents/[id]/files/route.ts +77 -0
- package/src/modules/agent_orchestrator/api/agents/[id]/metrics/route.ts +106 -0
- package/src/modules/agent_orchestrator/api/agents/[id]/route.ts +166 -0
- package/src/modules/agent_orchestrator/api/agents/[id]/run/route.ts +339 -0
- package/src/modules/agent_orchestrator/api/agents/[id]/settings/route.ts +119 -0
- package/src/modules/agent_orchestrator/api/agents/route.ts +124 -0
- package/src/modules/agent_orchestrator/api/artifacts/file/[id]/route.ts +80 -0
- package/src/modules/agent_orchestrator/api/audit/by-instigator/[humanUserId]/route.ts +143 -0
- package/src/modules/agent_orchestrator/api/auto-approval/settings/route.ts +143 -0
- package/src/modules/agent_orchestrator/api/context-bundles/route.ts +89 -0
- package/src/modules/agent_orchestrator/api/corrections/route.ts +119 -0
- package/src/modules/agent_orchestrator/api/eval-assertions/preview/route.ts +123 -0
- package/src/modules/agent_orchestrator/api/eval-assertions/route.ts +228 -0
- package/src/modules/agent_orchestrator/api/eval-cases/[id]/approve/route.ts +101 -0
- package/src/modules/agent_orchestrator/api/eval-cases/[id]/archive/route.ts +100 -0
- package/src/modules/agent_orchestrator/api/eval-cases/[id]/route.ts +84 -0
- package/src/modules/agent_orchestrator/api/eval-cases/export/route.ts +92 -0
- package/src/modules/agent_orchestrator/api/eval-cases/route.ts +159 -0
- package/src/modules/agent_orchestrator/api/eval-runs/[id]/cancel/route.ts +78 -0
- package/src/modules/agent_orchestrator/api/eval-runs/[id]/case-runs/[caseRunId]/results/route.ts +82 -0
- package/src/modules/agent_orchestrator/api/eval-runs/[id]/route.ts +133 -0
- package/src/modules/agent_orchestrator/api/eval-runs/route.ts +197 -0
- package/src/modules/agent_orchestrator/api/eval-scorers/route.ts +51 -0
- package/src/modules/agent_orchestrator/api/executions/[id]/route.ts +106 -0
- package/src/modules/agent_orchestrator/api/executions/route.ts +206 -0
- package/src/modules/agent_orchestrator/api/features/route.ts +71 -0
- package/src/modules/agent_orchestrator/api/guardrail-checks/route.ts +86 -0
- package/src/modules/agent_orchestrator/api/identity/agent/auth/route.ts +121 -0
- package/src/modules/agent_orchestrator/api/identity/grants/[id]/revoke/route.ts +133 -0
- package/src/modules/agent_orchestrator/api/identity/token/route.ts +102 -0
- package/src/modules/agent_orchestrator/api/identity/well-known/route.ts +60 -0
- package/src/modules/agent_orchestrator/api/metrics/agents/route.ts +160 -0
- package/src/modules/agent_orchestrator/api/metrics/overview/route.ts +240 -0
- package/src/modules/agent_orchestrator/api/openapi.ts +31 -0
- package/src/modules/agent_orchestrator/api/processes/[id]/executions/route.ts +211 -0
- package/src/modules/agent_orchestrator/api/processes/[id]/route.ts +70 -0
- package/src/modules/agent_orchestrator/api/processes/route.ts +458 -0
- package/src/modules/agent_orchestrator/api/proposals/[id]/dispose/route.ts +131 -0
- package/src/modules/agent_orchestrator/api/proposals/route.ts +113 -0
- package/src/modules/agent_orchestrator/api/runs/[id]/artifact/route.ts +93 -0
- package/src/modules/agent_orchestrator/api/runs/[id]/artifacts/route.ts +83 -0
- package/src/modules/agent_orchestrator/api/runs/[id]/eval-case/route.ts +91 -0
- package/src/modules/agent_orchestrator/api/runs/[id]/flag/route.ts +89 -0
- package/src/modules/agent_orchestrator/api/runs/[id]/rerun/route.ts +195 -0
- package/src/modules/agent_orchestrator/api/runs/[id]/route.ts +102 -0
- package/src/modules/agent_orchestrator/api/runs/route.ts +146 -0
- package/src/modules/agent_orchestrator/api/tokens/estimate/route.ts +61 -0
- package/src/modules/agent_orchestrator/api/trace/ingest/route.ts +98 -0
- package/src/modules/agent_orchestrator/api/web-search/health/route.ts +268 -0
- package/src/modules/agent_orchestrator/api/web-search/preview/route.ts +184 -0
- package/src/modules/agent_orchestrator/api/web-search/settings/route.ts +309 -0
- package/src/modules/agent_orchestrator/auth.md +107 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/ActivityTab.tsx +118 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/AgentConfigDrawer.tsx +96 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/AgentHeaderCard.tsx +174 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/AssertionFormDrawer.tsx +418 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/ConfigurationTab.tsx +185 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/EvalCaseDrawer.tsx +488 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/EvalResultsDrawer.tsx +244 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/EvaluationTab.tsx +715 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/FilesTab.tsx +328 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/OverviewTab.tsx +211 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/RunEvaluationDrawer.tsx +247 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/TokenCalculatorTab.tsx +143 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/filesShared.ts +149 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/workspacePrimitives.tsx +236 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/components/workspaceShared.ts +193 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/page.meta.ts +14 -0
- package/src/modules/agent_orchestrator/backend/agents/[id]/page.tsx +335 -0
- package/src/modules/agent_orchestrator/backend/agents/agentListFilters.ts +95 -0
- package/src/modules/agent_orchestrator/backend/agents/page.meta.ts +26 -0
- package/src/modules/agent_orchestrator/backend/agents/page.tsx +549 -0
- package/src/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.meta.ts +15 -0
- package/src/modules/agent_orchestrator/backend/audit/by-instigator/[humanUserId]/page.tsx +126 -0
- package/src/modules/agent_orchestrator/backend/audit/page.meta.ts +25 -0
- package/src/modules/agent_orchestrator/backend/audit/page.tsx +392 -0
- package/src/modules/agent_orchestrator/backend/caseload/[proposalId]/page.meta.ts +14 -0
- package/src/modules/agent_orchestrator/backend/caseload/[proposalId]/page.tsx +298 -0
- package/src/modules/agent_orchestrator/backend/caseload/hooks.ts +583 -0
- package/src/modules/agent_orchestrator/backend/caseload/page.meta.ts +23 -0
- package/src/modules/agent_orchestrator/backend/caseload/page.tsx +1761 -0
- package/src/modules/agent_orchestrator/backend/eval-cases/[id]/page.meta.ts +14 -0
- package/src/modules/agent_orchestrator/backend/eval-cases/[id]/page.tsx +446 -0
- package/src/modules/agent_orchestrator/backend/eval-runs/[id]/page.meta.ts +14 -0
- package/src/modules/agent_orchestrator/backend/eval-runs/[id]/page.tsx +824 -0
- package/src/modules/agent_orchestrator/backend/overview/page.meta.ts +25 -0
- package/src/modules/agent_orchestrator/backend/overview/page.tsx +755 -0
- package/src/modules/agent_orchestrator/backend/playground/PlaygroundEvalPanel.tsx +292 -0
- package/src/modules/agent_orchestrator/backend/playground/page.meta.ts +22 -0
- package/src/modules/agent_orchestrator/backend/playground/page.tsx +647 -0
- package/src/modules/agent_orchestrator/backend/processes/[id]/page.meta.ts +14 -0
- package/src/modules/agent_orchestrator/backend/processes/[id]/page.tsx +856 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/MilestoneEditor.tsx +285 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/TriggerEditor.tsx +391 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/[id]/page.meta.ts +13 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/[id]/page.tsx +705 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/formHelpers.ts +100 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/navigation.ts +6 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/page.meta.ts +23 -0
- package/src/modules/agent_orchestrator/backend/processes/definitions/page.tsx +904 -0
- package/src/modules/agent_orchestrator/backend/processes/page.meta.ts +27 -0
- package/src/modules/agent_orchestrator/backend/processes/page.tsx +317 -0
- package/src/modules/agent_orchestrator/backend/settings/auto-approval/page.meta.ts +28 -0
- package/src/modules/agent_orchestrator/backend/settings/auto-approval/page.tsx +315 -0
- package/src/modules/agent_orchestrator/backend/settings/web-search/AdapterRow.tsx +351 -0
- package/src/modules/agent_orchestrator/backend/settings/web-search/WebSearchPreview.tsx +203 -0
- package/src/modules/agent_orchestrator/backend/settings/web-search/page.meta.ts +30 -0
- package/src/modules/agent_orchestrator/backend/settings/web-search/page.tsx +913 -0
- package/src/modules/agent_orchestrator/backend/traces/[id]/page.meta.ts +14 -0
- package/src/modules/agent_orchestrator/backend/traces/[id]/page.tsx +1383 -0
- package/src/modules/agent_orchestrator/backend/traces/page.meta.ts +22 -0
- package/src/modules/agent_orchestrator/backend/traces/page.tsx +601 -0
- package/src/modules/agent_orchestrator/cli.ts +719 -0
- package/src/modules/agent_orchestrator/commands/artifacts.ts +171 -0
- package/src/modules/agent_orchestrator/commands/corrections.ts +345 -0
- package/src/modules/agent_orchestrator/commands/dispose.ts +380 -0
- package/src/modules/agent_orchestrator/commands/evalRuns.ts +291 -0
- package/src/modules/agent_orchestrator/commands/grants.ts +149 -0
- package/src/modules/agent_orchestrator/commands/index.ts +10 -0
- package/src/modules/agent_orchestrator/commands/processes.ts +176 -0
- package/src/modules/agent_orchestrator/commands/proposals.ts +82 -0
- package/src/modules/agent_orchestrator/commands/runActions.ts +52 -0
- package/src/modules/agent_orchestrator/commands/runs.ts +212 -0
- package/src/modules/agent_orchestrator/commands/trace.ts +118 -0
- package/src/modules/agent_orchestrator/components/AgentIoDrawer.tsx +87 -0
- package/src/modules/agent_orchestrator/components/AgentTimeline.tsx +175 -0
- package/src/modules/agent_orchestrator/components/DisposeDialog.tsx +112 -0
- package/src/modules/agent_orchestrator/components/EmptyArt.tsx +51 -0
- package/src/modules/agent_orchestrator/components/InvokeAgentNodeConfig.tsx +150 -0
- package/src/modules/agent_orchestrator/components/ProcessOutcomeLink.tsx +50 -0
- package/src/modules/agent_orchestrator/components/ProposalCard.tsx +602 -0
- package/src/modules/agent_orchestrator/components/ProposalFacts.tsx +139 -0
- package/src/modules/agent_orchestrator/components/ProposalOptionList.tsx +273 -0
- package/src/modules/agent_orchestrator/components/ProposeOnlyNotice.tsx +40 -0
- package/src/modules/agent_orchestrator/components/SkillDrawer.tsx +75 -0
- package/src/modules/agent_orchestrator/components/StartHereGuide.tsx +241 -0
- package/src/modules/agent_orchestrator/components/SystemHealthTile.tsx +189 -0
- package/src/modules/agent_orchestrator/components/WebSearchActivity.tsx +180 -0
- package/src/modules/agent_orchestrator/components/agentChips.tsx +123 -0
- package/src/modules/agent_orchestrator/components/cockpitStatus.tsx +154 -0
- package/src/modules/agent_orchestrator/components/evalRunTypes.ts +339 -0
- package/src/modules/agent_orchestrator/components/health/HealthRow.tsx +36 -0
- package/src/modules/agent_orchestrator/components/health/HealthStateBadge.tsx +21 -0
- package/src/modules/agent_orchestrator/components/health/SystemHealthPanel.tsx +206 -0
- package/src/modules/agent_orchestrator/components/health/vocabulary.ts +53 -0
- package/src/modules/agent_orchestrator/components/optionalRequest.ts +18 -0
- package/src/modules/agent_orchestrator/components/playgroundRunError.ts +63 -0
- package/src/modules/agent_orchestrator/components/playgroundToolCalls.ts +32 -0
- package/src/modules/agent_orchestrator/components/processTypes.ts +613 -0
- package/src/modules/agent_orchestrator/components/proposalCaseStatus.ts +100 -0
- package/src/modules/agent_orchestrator/components/proposalEdit.ts +118 -0
- package/src/modules/agent_orchestrator/components/proposalFactsData.ts +222 -0
- package/src/modules/agent_orchestrator/components/serverSort.ts +56 -0
- package/src/modules/agent_orchestrator/components/subjectRef.ts +61 -0
- package/src/modules/agent_orchestrator/components/types.ts +834 -0
- package/src/modules/agent_orchestrator/components/useAgentIcons.ts +42 -0
- package/src/modules/agent_orchestrator/components/useAgentLabels.ts +44 -0
- package/src/modules/agent_orchestrator/components/useAgentTags.ts +38 -0
- package/src/modules/agent_orchestrator/components/useCoalescedReload.ts +43 -0
- package/src/modules/agent_orchestrator/data/agentIcons.ts +52 -0
- package/src/modules/agent_orchestrator/data/agentTags.ts +39 -0
- package/src/modules/agent_orchestrator/data/entities.ts +1904 -0
- package/src/modules/agent_orchestrator/data/proposalEnvelope.ts +263 -0
- package/src/modules/agent_orchestrator/data/validators.ts +1585 -0
- package/src/modules/agent_orchestrator/di.ts +182 -0
- package/src/modules/agent_orchestrator/encryption.ts +98 -0
- package/src/modules/agent_orchestrator/events.ts +97 -0
- package/src/modules/agent_orchestrator/examples/deals-health-check-workflow.json +124 -0
- package/src/modules/agent_orchestrator/examples/refund-triage-workflow.json +210 -0
- package/src/modules/agent_orchestrator/generated/file-agents.generated.ts +207 -0
- package/src/modules/agent_orchestrator/i18n/.hardcoded-allowlist.json +22 -0
- package/src/modules/agent_orchestrator/i18n/de.json +1495 -0
- package/src/modules/agent_orchestrator/i18n/en.json +1495 -0
- package/src/modules/agent_orchestrator/i18n/es.json +1495 -0
- package/src/modules/agent_orchestrator/i18n/ko.json +1495 -0
- package/src/modules/agent_orchestrator/i18n/pl.json +1495 -0
- package/src/modules/agent_orchestrator/index.ts +155 -0
- package/src/modules/agent_orchestrator/lib/automationLinks.ts +20 -0
- package/src/modules/agent_orchestrator/lib/context/contextResolver.ts +528 -0
- package/src/modules/agent_orchestrator/lib/context/documentIngest.ts +187 -0
- package/src/modules/agent_orchestrator/lib/context/documentOcrProvider.ts +189 -0
- package/src/modules/agent_orchestrator/lib/context/documentSource.ts +88 -0
- package/src/modules/agent_orchestrator/lib/context/index.ts +68 -0
- package/src/modules/agent_orchestrator/lib/context/packer.ts +114 -0
- package/src/modules/agent_orchestrator/lib/context/redactor.ts +138 -0
- package/src/modules/agent_orchestrator/lib/context/registry.ts +153 -0
- package/src/modules/agent_orchestrator/lib/context/retrievalSource.ts +146 -0
- package/src/modules/agent_orchestrator/lib/crudCache.ts +62 -0
- package/src/modules/agent_orchestrator/lib/disposition/autoApprovalPolicy.ts +163 -0
- package/src/modules/agent_orchestrator/lib/disposition/dispositionService.ts +310 -0
- package/src/modules/agent_orchestrator/lib/disposition/resume.ts +81 -0
- package/src/modules/agent_orchestrator/lib/disposition/tenantAutoApprovalPolicy.ts +100 -0
- package/src/modules/agent_orchestrator/lib/eval/assertionResolution.ts +105 -0
- package/src/modules/agent_orchestrator/lib/eval/canonicalInputKey.ts +32 -0
- package/src/modules/agent_orchestrator/lib/eval/defaultAssertions.ts +103 -0
- package/src/modules/agent_orchestrator/lib/eval/evalGate.ts +139 -0
- package/src/modules/agent_orchestrator/lib/eval/evalReplayService.ts +517 -0
- package/src/modules/agent_orchestrator/lib/eval/evalRuntimeService.ts +215 -0
- package/src/modules/agent_orchestrator/lib/eval/judgeRubric.ts +212 -0
- package/src/modules/agent_orchestrator/lib/eval/llmJudge.ts +174 -0
- package/src/modules/agent_orchestrator/lib/eval/projectRunView.ts +53 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/agent.ts +334 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/economics.ts +91 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/index.ts +157 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/judge.ts +102 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/shared.ts +208 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/structured.ts +297 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/text.ts +125 -0
- package/src/modules/agent_orchestrator/lib/eval/registry/tools.ts +263 -0
- package/src/modules/agent_orchestrator/lib/eval/sampling.ts +33 -0
- package/src/modules/agent_orchestrator/lib/eval/scorers.ts +90 -0
- package/src/modules/agent_orchestrator/lib/eval/types.ts +189 -0
- package/src/modules/agent_orchestrator/lib/featureFlags.ts +22 -0
- package/src/modules/agent_orchestrator/lib/guardrails/grounding.ts +172 -0
- package/src/modules/agent_orchestrator/lib/guardrails/groundingSets.ts +61 -0
- package/src/modules/agent_orchestrator/lib/guardrails/guardrailService.ts +293 -0
- package/src/modules/agent_orchestrator/lib/guardrails/promptInjection.ts +163 -0
- package/src/modules/agent_orchestrator/lib/guardrails/publicEndpointRateLimit.ts +74 -0
- package/src/modules/agent_orchestrator/lib/guardrails/syncGroundingSets.ts +68 -0
- package/src/modules/agent_orchestrator/lib/identity/agentAuthMdService.ts +247 -0
- package/src/modules/agent_orchestrator/lib/identity/agentDelegationGrantService.ts +85 -0
- package/src/modules/agent_orchestrator/lib/identity/agentNoBypassSubscriber.ts +98 -0
- package/src/modules/agent_orchestrator/lib/identity/agentPrincipalService.ts +230 -0
- package/src/modules/agent_orchestrator/lib/identity/agentTokenService.ts +281 -0
- package/src/modules/agent_orchestrator/lib/identity/agentWriteScope.ts +68 -0
- package/src/modules/agent_orchestrator/lib/metrics/metricRollupService.ts +168 -0
- package/src/modules/agent_orchestrator/lib/processes/executionSearch.ts +35 -0
- package/src/modules/agent_orchestrator/lib/processes/materializeAgentWorkflow.ts +320 -0
- package/src/modules/agent_orchestrator/lib/processes/processProjection.ts +401 -0
- package/src/modules/agent_orchestrator/lib/processes/subjectContext.ts +30 -0
- package/src/modules/agent_orchestrator/lib/processes/workflowGrant.ts +84 -0
- package/src/modules/agent_orchestrator/lib/queue.ts +56 -0
- package/src/modules/agent_orchestrator/lib/runtime/actionVocabulary.ts +127 -0
- package/src/modules/agent_orchestrator/lib/runtime/admission.ts +177 -0
- package/src/modules/agent_orchestrator/lib/runtime/agentRunSessionStore.ts +166 -0
- package/src/modules/agent_orchestrator/lib/runtime/agentRuntime.ts +108 -0
- package/src/modules/agent_orchestrator/lib/runtime/agentWorkspaceManager.ts +187 -0
- package/src/modules/agent_orchestrator/lib/runtime/artifactCollector.ts +188 -0
- package/src/modules/agent_orchestrator/lib/runtime/artifactFileStore.ts +189 -0
- package/src/modules/agent_orchestrator/lib/runtime/attachmentStager.ts +100 -0
- package/src/modules/agent_orchestrator/lib/runtime/errors.ts +63 -0
- package/src/modules/agent_orchestrator/lib/runtime/executeProposal.ts +78 -0
- package/src/modules/agent_orchestrator/lib/runtime/fileAgentSkills.ts +81 -0
- package/src/modules/agent_orchestrator/lib/runtime/fileInput.ts +44 -0
- package/src/modules/agent_orchestrator/lib/runtime/invokeAgentForWorkflow.ts +255 -0
- package/src/modules/agent_orchestrator/lib/runtime/modelPricing.ts +146 -0
- package/src/modules/agent_orchestrator/lib/runtime/nativeAgentRunner.ts +617 -0
- package/src/modules/agent_orchestrator/lib/runtime/nativeTraceCapture.ts +217 -0
- package/src/modules/agent_orchestrator/lib/runtime/openCodeAgentRunner.ts +889 -0
- package/src/modules/agent_orchestrator/lib/runtime/persistence.ts +314 -0
- package/src/modules/agent_orchestrator/lib/runtime/providerBudget.ts +230 -0
- package/src/modules/agent_orchestrator/lib/runtime/rerunContext.ts +26 -0
- package/src/modules/agent_orchestrator/lib/runtime/runContext.ts +47 -0
- package/src/modules/agent_orchestrator/lib/runtime/sandboxedScript.ts +106 -0
- package/src/modules/agent_orchestrator/lib/sdk/agentMarkdown.ts +157 -0
- package/src/modules/agent_orchestrator/lib/sdk/agentOutcomeContract.ts +58 -0
- package/src/modules/agent_orchestrator/lib/sdk/defineAgent.ts +525 -0
- package/src/modules/agent_orchestrator/lib/sdk/defineFileAgent.ts +765 -0
- package/src/modules/agent_orchestrator/lib/sdk/defineSkill.ts +80 -0
- package/src/modules/agent_orchestrator/lib/sdk/outcomeSchema.ts +190 -0
- package/src/modules/agent_orchestrator/lib/sdk/skillMarkdown.ts +139 -0
- package/src/modules/agent_orchestrator/lib/seeds.ts +335 -0
- package/src/modules/agent_orchestrator/lib/settings/agentSettings.ts +92 -0
- package/src/modules/agent_orchestrator/lib/systemHealth.ts +212 -0
- package/src/modules/agent_orchestrator/lib/tasks/eventTriggerMatch.ts +116 -0
- package/src/modules/agent_orchestrator/lib/tasks/milestones.ts +201 -0
- package/src/modules/agent_orchestrator/lib/tasks/outcome.ts +93 -0
- package/src/modules/agent_orchestrator/lib/tasks/outcomeLink.ts +91 -0
- package/src/modules/agent_orchestrator/lib/tasks/schedule.ts +106 -0
- package/src/modules/agent_orchestrator/lib/tasks/scheduleValidation.ts +34 -0
- package/src/modules/agent_orchestrator/lib/tasks/triggers.ts +47 -0
- package/src/modules/agent_orchestrator/lib/tokens/computeAgentTokenUsage.ts +111 -0
- package/src/modules/agent_orchestrator/lib/tokens/types.ts +77 -0
- package/src/modules/agent_orchestrator/lib/trace/artifactStore.ts +198 -0
- package/src/modules/agent_orchestrator/lib/trace/correctionService.ts +117 -0
- package/src/modules/agent_orchestrator/lib/trace/ingestAuth.ts +65 -0
- package/src/modules/agent_orchestrator/lib/trace/redactToolSummary.ts +76 -0
- package/src/modules/agent_orchestrator/lib/trace/spanTimeline.ts +181 -0
- package/src/modules/agent_orchestrator/lib/trace/traceIngestionService.ts +250 -0
- package/src/modules/agent_orchestrator/lib/webSearch/guardrails.ts +199 -0
- package/src/modules/agent_orchestrator/lib/webSearch/healthCache.ts +109 -0
- package/src/modules/agent_orchestrator/lib/webSearch/healthProbePlan.ts +58 -0
- package/src/modules/agent_orchestrator/lib/webSearch/policy.ts +283 -0
- package/src/modules/agent_orchestrator/lib/webSearch/registry.ts +177 -0
- package/src/modules/agent_orchestrator/lib/webSearch/secretStorage.ts +181 -0
- package/src/modules/agent_orchestrator/lib/webSearch/steps.ts +77 -0
- package/src/modules/agent_orchestrator/lib/webSearch/tools.ts +246 -0
- package/src/modules/agent_orchestrator/lib/workInbox/agentDispositionSource.ts +324 -0
- package/src/modules/agent_orchestrator/migrations/.snapshot-open-mercato.json +7083 -0
- package/src/modules/agent_orchestrator/migrations/Migration20260906141535_agent_orchestrator.ts +278 -0
- package/src/modules/agent_orchestrator/migrations/adopt-squash.mjs +232 -0
- package/src/modules/agent_orchestrator/notifications.ts +43 -0
- package/src/modules/agent_orchestrator/setup.ts +190 -0
- package/src/modules/agent_orchestrator/skills/deals.stage_playbook.md +37 -0
- package/src/modules/agent_orchestrator/subscribers/process-event-trigger.ts +198 -0
- package/src/modules/agent_orchestrator/subscribers/process-proposal-created.ts +28 -0
- package/src/modules/agent_orchestrator/subscribers/process-proposal-disposed.ts +20 -0
- package/src/modules/agent_orchestrator/subscribers/process-run-completed.ts +23 -0
- package/src/modules/agent_orchestrator/subscribers/process-run-ingested.ts +22 -0
- package/src/modules/agent_orchestrator/subscribers/process-workflow-cancelled.ts +22 -0
- package/src/modules/agent_orchestrator/subscribers/process-workflow-completed.ts +32 -0
- package/src/modules/agent_orchestrator/subscribers/process-workflow-failed.ts +23 -0
- package/src/modules/agent_orchestrator/subscribers/process-workflow-milestone.ts +47 -0
- package/src/modules/agent_orchestrator/subscribers/process-workflow-started.ts +34 -0
- package/src/modules/agent_orchestrator/subscribers/proposal-disposed-notification-clear.ts +50 -0
- package/src/modules/agent_orchestrator/subscribers/proposal-pending-notification.ts +84 -0
- package/src/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.client.tsx +68 -0
- package/src/modules/agent_orchestrator/widgets/injection/caseload-nav-badge/widget.ts +16 -0
- package/src/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.client.tsx +148 -0
- package/src/modules/agent_orchestrator/widgets/injection/task-proposal-draft/widget.ts +24 -0
- package/src/modules/agent_orchestrator/widgets/injection/task-proposal-link/widget.ts +34 -0
- package/src/modules/agent_orchestrator/widgets/injection-table.ts +42 -0
- package/src/modules/agent_orchestrator/workers/eval-suite-runner.ts +85 -0
- package/src/modules/agent_orchestrator/workers/llm-judge.ts +39 -0
- package/src/modules/agent_orchestrator/workers/metric-rollup.ts +39 -0
- package/src/modules/agent_orchestrator/workers/process-execution-starter.ts +227 -0
- package/src/modules/record_locks/lib/conflictValues.ts +107 -0
- package/src/modules/record_locks/lib/crudMutationGuardService.ts +47 -3
- package/src/modules/record_locks/lib/recordLockService.ts +1 -51
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/modules/agent_orchestrator/api/eval-assertions/preview/route.ts"],
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { findOneWithDecryption, findWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { readJsonSafe } from '@open-mercato/shared/lib/http/readJsonSafe'\nimport { AgentProposal, AgentRun, AgentSpan, AgentToolCall } from '../../../data/entities'\nimport { projectRunView } from '../../../lib/eval/projectRunView'\nimport { getScorerDefinition, parseScorerConfig, runScorer } from '../../../lib/eval/registry'\nimport { createModelJudge } from '../../../lib/eval/llmJudge'\nimport { normalizeJudgeRubric } from '../../../lib/eval/judgeRubric'\nimport type { Json } from '../../../lib/eval/types'\nimport { agentOrchestratorTag } from '../../openapi'\n\n/**\n * Dry-runs an assertion against a REAL historical run, without persisting\n * anything.\n *\n * This is the highest-value authoring affordance in the surveyed field (Langfuse\n * ships the same idea): an author can see what a rubric or threshold actually does\n * to real output BEFORE saving it, instead of discovering it on the next\n * production run. Nothing here writes \u2014 no `AgentEvalResult`, no counters.\n */\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n}\n\nconst previewSchema = z.object({\n scorerKey: z.string().min(1).max(100),\n config: z.unknown().optional(),\n runId: z.string().uuid(),\n /** Stands in for an eval case's expected value when previewing a comparison scorer. */\n expected: z.unknown().optional(),\n})\n\nconst errorSchema = z.object({ error: z.string() })\n\nexport async function POST(req: Request) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n if (!auth.tenantId || !auth.orgId) return NextResponse.json({ error: 'Tenant context required' }, { status: 400 })\n\n const parsed = previewSchema.safeParse(await readJsonSafe<unknown>(req, {}))\n if (!parsed.success) {\n return NextResponse.json({ error: 'Invalid body', issues: parsed.error.issues }, { status: 400 })\n }\n const input = parsed.data\n\n const definition = getScorerDefinition(input.scorerKey)\n if (!definition) {\n return NextResponse.json({ error: '[internal] unknown scorer', scorerKey: input.scorerKey }, { status: 422 })\n }\n\n // Validate with the WRITE schema: the preview should reject exactly what saving\n // would reject, otherwise it would green-light a config the form then refuses.\n const configCheck = parseScorerConfig(input.scorerKey, input.config, 'write')\n if (!configCheck.ok) {\n return NextResponse.json(\n { error: '[internal] invalid assertion configuration', issues: configCheck.issues },\n { status: 422 },\n )\n }\n\n const container = await createRequestContainer()\n const em = (container.resolve('em') as EntityManager).fork()\n const scope = { tenantId: auth.tenantId, organizationId: auth.orgId }\n\n const run = await findOneWithDecryption(em, AgentRun, { id: input.runId, ...scope }, undefined, scope)\n if (!run) return NextResponse.json({ error: 'Not found' }, { status: 404 })\n\n const toolCalls = await findWithDecryption(em, AgentToolCall, { agentRunId: run.id, ...scope }, undefined, scope)\n const spans = await em.find(AgentSpan, { agentRunId: run.id, ...scope })\n const proposal = await em.findOne(AgentProposal, { runId: run.id, ...scope })\n const runView = projectRunView({ run, toolCalls, spans, disposition: proposal?.disposition ?? null })\n\n const expected = (input.expected ?? null) as Json | null\n\n if (definition.kind === 'llm_judge') {\n const rubric = normalizeJudgeRubric(input.config, '')\n if (!rubric) {\n return NextResponse.json({ error: '[internal] rubric is required to preview a judge' }, { status: 422 })\n }\n try {\n const verdict = await createModelJudge(container)({ rubric, runOutput: run.output, expected })\n return NextResponse.json({ ...verdict, scorerKey: input.scorerKey, runId: run.id })\n } catch (error) {\n // No provider configured, or the model refused: a preview failure is\n // informational, never a 500 that looks like a platform fault.\n return NextResponse.json(\n {\n error: '[internal] judge preview unavailable',\n detail: error instanceof Error ? error.message : String(error),\n },\n { status: 422 },\n )\n }\n }\n\n const verdict = runScorer(input.scorerKey, runView, expected, input.config)\n return NextResponse.json({ ...verdict, scorerKey: input.scorerKey, runId: run.id })\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: agentOrchestratorTag,\n summary: 'Preview an assertion against an existing run',\n methods: {\n POST: {\n summary: 'Dry-run a scorer or judge rubric against a real historical run',\n description:\n 'Scores an existing AgentRun with the supplied scorerKey + config and returns the verdict WITHOUT persisting anything. `passed: null` means the assertion would be skipped. Config is validated with the same rules as saving, so a preview cannot green-light a config the form would reject. Judge previews resolve a model and therefore cost a round-trip; they return 422 (not 500) when no provider is configured. Gated by agent_orchestrator.eval.manage.',\n responses: [{ status: 200, description: 'The verdict this assertion would produce' }],\n errors: [\n { status: 400, description: 'Invalid body', schema: errorSchema },\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.manage', schema: errorSchema },\n { status: 404, description: 'Run not found (or cross-tenant)', schema: errorSchema },\n { status: 422, description: 'Unknown scorer, invalid config, or judge unavailable', schema: errorSchema },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAGlB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,uBAAuB,0BAA0B;AAC1D,SAAS,oBAAoB;AAC7B,SAAS,eAAe,UAAU,WAAW,qBAAqB;AAClE,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB,mBAAmB,iBAAiB;AAClE,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AAErC,SAAS,4BAA4B;AAW9B,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AACjF;AAEA,MAAM,gBAAgB,EAAE,OAAO;AAAA,EAC7B,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACpC,QAAQ,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC7B,OAAO,EAAE,OAAO,EAAE,KAAK;AAAA;AAAA,EAEvB,UAAU,EAAE,QAAQ,EAAE,SAAS;AACjC,CAAC;AAED,MAAM,cAAc,EAAE,OAAO,EAAE,OA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AAA,MACJ,SAAS;AAAA,MACT,aACE;AAAA,MACF,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,2CAA2C,CAAC;AAAA,MACpF,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,0CAA0C,QAAQ,YAAY;AAAA,QAC1F,EAAE,QAAQ,KAAK,aAAa,mCAAmC,QAAQ,YAAY;AAAA,QACnF,EAAE,QAAQ,KAAK,aAAa,wDAAwD,QAAQ,YAAY;AAAA,MAC1G;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["verdict"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { makeCrudRoute } from "@open-mercato/shared/lib/crud/factory";
|
|
3
|
+
import { CrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
4
|
+
import { AgentEvalAssertion } from "../../data/entities.js";
|
|
5
|
+
import {
|
|
6
|
+
evalAssertionCreateSchema,
|
|
7
|
+
evalAssertionListQuerySchema,
|
|
8
|
+
evalAssertionUpdateSchema
|
|
9
|
+
} from "../../data/validators.js";
|
|
10
|
+
import { parseScorerConfig } from "../../lib/eval/registry/index.js";
|
|
11
|
+
import {
|
|
12
|
+
createAgentOrchestratorCrudOpenApi,
|
|
13
|
+
createPagedListResponseSchema,
|
|
14
|
+
defaultCreateResponseSchema,
|
|
15
|
+
defaultOkResponseSchema
|
|
16
|
+
} from "../openapi.js";
|
|
17
|
+
const ENTITY_TYPE = "agent_orchestrator:agent_eval_assertion";
|
|
18
|
+
const routeMetadata = {
|
|
19
|
+
GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] },
|
|
20
|
+
POST: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] },
|
|
21
|
+
PUT: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] },
|
|
22
|
+
DELETE: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] }
|
|
23
|
+
};
|
|
24
|
+
const metadata = routeMetadata;
|
|
25
|
+
function resolveScorerForWrite(scorerKey, key, config) {
|
|
26
|
+
const resolved = scorerKey ?? key;
|
|
27
|
+
const parsed = parseScorerConfig(resolved, config, "write");
|
|
28
|
+
if (!parsed.ok) {
|
|
29
|
+
throw new CrudHttpError(422, {
|
|
30
|
+
error: "[internal] invalid assertion configuration",
|
|
31
|
+
scorerKey: resolved,
|
|
32
|
+
issues: parsed.issues
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return resolved;
|
|
36
|
+
}
|
|
37
|
+
const crud = makeCrudRoute({
|
|
38
|
+
metadata: routeMetadata,
|
|
39
|
+
orm: {
|
|
40
|
+
entity: AgentEvalAssertion,
|
|
41
|
+
idField: "id",
|
|
42
|
+
orgField: "organizationId",
|
|
43
|
+
tenantField: "tenantId",
|
|
44
|
+
softDeleteField: "deletedAt"
|
|
45
|
+
},
|
|
46
|
+
indexer: { entityType: ENTITY_TYPE },
|
|
47
|
+
list: {
|
|
48
|
+
schema: evalAssertionListQuerySchema,
|
|
49
|
+
entityId: ENTITY_TYPE,
|
|
50
|
+
fields: [
|
|
51
|
+
"id",
|
|
52
|
+
"key",
|
|
53
|
+
"scorer_key",
|
|
54
|
+
"title",
|
|
55
|
+
"description",
|
|
56
|
+
"applies_to",
|
|
57
|
+
"type",
|
|
58
|
+
"severity",
|
|
59
|
+
"config",
|
|
60
|
+
"version",
|
|
61
|
+
"enabled",
|
|
62
|
+
"organization_id",
|
|
63
|
+
"tenant_id",
|
|
64
|
+
"created_at",
|
|
65
|
+
"updated_at"
|
|
66
|
+
],
|
|
67
|
+
sortFieldMap: {
|
|
68
|
+
key: "key",
|
|
69
|
+
scorerKey: "scorer_key",
|
|
70
|
+
title: "title",
|
|
71
|
+
appliesTo: "applies_to",
|
|
72
|
+
type: "type",
|
|
73
|
+
severity: "severity",
|
|
74
|
+
enabled: "enabled",
|
|
75
|
+
createdAt: "created_at",
|
|
76
|
+
updatedAt: "updated_at"
|
|
77
|
+
},
|
|
78
|
+
buildFilters: async (query) => {
|
|
79
|
+
const filters = {};
|
|
80
|
+
if (query.id) filters.id = { $eq: query.id };
|
|
81
|
+
if (query.appliesTo) filters.applies_to = { $eq: query.appliesTo };
|
|
82
|
+
if (query.scorerKey) filters.scorer_key = { $eq: query.scorerKey };
|
|
83
|
+
if (query.type) filters.type = { $eq: query.type };
|
|
84
|
+
if (query.severity) filters.severity = { $eq: query.severity };
|
|
85
|
+
if (typeof query.enabled === "boolean") filters.enabled = { $eq: query.enabled };
|
|
86
|
+
return filters;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
create: {
|
|
90
|
+
schema: evalAssertionCreateSchema,
|
|
91
|
+
mapToEntity: (input, ctx) => {
|
|
92
|
+
const organizationId = ctx.selectedOrganizationId ?? ctx.auth?.orgId ?? null;
|
|
93
|
+
const tenantId = ctx.auth?.tenantId ?? null;
|
|
94
|
+
if (!organizationId || !tenantId) {
|
|
95
|
+
throw new CrudHttpError(400, { error: "[internal] organization and tenant context required" });
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
tenantId,
|
|
99
|
+
organizationId,
|
|
100
|
+
key: input.key,
|
|
101
|
+
scorerKey: resolveScorerForWrite(input.scorerKey, input.key, input.config),
|
|
102
|
+
title: input.title,
|
|
103
|
+
description: input.description ?? null,
|
|
104
|
+
appliesTo: input.appliesTo,
|
|
105
|
+
type: input.type,
|
|
106
|
+
severity: input.severity,
|
|
107
|
+
config: input.config ?? null,
|
|
108
|
+
enabled: input.enabled ?? true
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
response: (entity) => ({ id: String(entity.id) })
|
|
112
|
+
},
|
|
113
|
+
update: {
|
|
114
|
+
schema: evalAssertionUpdateSchema,
|
|
115
|
+
getId: (input) => input.id,
|
|
116
|
+
applyToEntity: (entity, input) => {
|
|
117
|
+
const row = entity;
|
|
118
|
+
if (input.key !== void 0) row.key = input.key;
|
|
119
|
+
if (input.title !== void 0) row.title = input.title;
|
|
120
|
+
if (input.description !== void 0) row.description = input.description ?? null;
|
|
121
|
+
if (input.appliesTo !== void 0) row.appliesTo = input.appliesTo;
|
|
122
|
+
if (input.type !== void 0) row.type = input.type;
|
|
123
|
+
if (input.severity !== void 0) row.severity = input.severity;
|
|
124
|
+
const scorerChanged = input.scorerKey !== void 0 && input.scorerKey !== row.scorerKey;
|
|
125
|
+
const configChanged = input.config !== void 0 && JSON.stringify(input.config ?? null) !== JSON.stringify(row.config ?? null);
|
|
126
|
+
if (scorerChanged || configChanged) {
|
|
127
|
+
const nextConfig = input.config !== void 0 ? input.config : row.config;
|
|
128
|
+
row.scorerKey = resolveScorerForWrite(input.scorerKey ?? row.scorerKey, input.key ?? row.key, nextConfig);
|
|
129
|
+
}
|
|
130
|
+
if (configChanged) {
|
|
131
|
+
row.config = input.config ?? null;
|
|
132
|
+
row.version = (row.version ?? 1) + 1;
|
|
133
|
+
}
|
|
134
|
+
if (input.enabled !== void 0) row.enabled = input.enabled;
|
|
135
|
+
},
|
|
136
|
+
response: (entity) => {
|
|
137
|
+
const updatedAt = entity.updatedAt;
|
|
138
|
+
return {
|
|
139
|
+
ok: true,
|
|
140
|
+
updatedAt: updatedAt instanceof Date ? updatedAt.toISOString() : null
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
del: { idFrom: "query", softDelete: true }
|
|
145
|
+
});
|
|
146
|
+
const GET = crud.GET;
|
|
147
|
+
const POST = crud.POST;
|
|
148
|
+
const PUT = crud.PUT;
|
|
149
|
+
const DELETE = crud.DELETE;
|
|
150
|
+
const evalAssertionListItemSchema = z.object({
|
|
151
|
+
id: z.string().uuid(),
|
|
152
|
+
key: z.string(),
|
|
153
|
+
scorer_key: z.string(),
|
|
154
|
+
title: z.string(),
|
|
155
|
+
description: z.string().nullable().optional(),
|
|
156
|
+
applies_to: z.string(),
|
|
157
|
+
type: z.string(),
|
|
158
|
+
severity: z.string(),
|
|
159
|
+
config: z.unknown().nullable().optional(),
|
|
160
|
+
version: z.number().int().optional(),
|
|
161
|
+
enabled: z.boolean().optional(),
|
|
162
|
+
organization_id: z.string().uuid().nullable().optional(),
|
|
163
|
+
tenant_id: z.string().uuid().nullable().optional(),
|
|
164
|
+
created_at: z.string().nullable().optional(),
|
|
165
|
+
updated_at: z.string().nullable().optional()
|
|
166
|
+
});
|
|
167
|
+
const openApi = createAgentOrchestratorCrudOpenApi({
|
|
168
|
+
resourceName: "EvalAssertion",
|
|
169
|
+
pluralName: "Eval assertions",
|
|
170
|
+
querySchema: evalAssertionListQuerySchema,
|
|
171
|
+
listResponseSchema: createPagedListResponseSchema(evalAssertionListItemSchema),
|
|
172
|
+
create: {
|
|
173
|
+
schema: evalAssertionCreateSchema,
|
|
174
|
+
responseSchema: defaultCreateResponseSchema,
|
|
175
|
+
description: "Creates an evaluation assertion. `llm_judge` assertions are always stored as `warn` severity (the judge tier never blocks production)."
|
|
176
|
+
},
|
|
177
|
+
update: {
|
|
178
|
+
schema: evalAssertionUpdateSchema,
|
|
179
|
+
responseSchema: defaultOkResponseSchema,
|
|
180
|
+
description: "Updates an evaluation assertion (enable/disable, retarget, or retune its rubric/config)."
|
|
181
|
+
},
|
|
182
|
+
del: {
|
|
183
|
+
schema: z.object({ id: z.string().uuid() }),
|
|
184
|
+
responseSchema: defaultOkResponseSchema,
|
|
185
|
+
description: "Soft-deletes an evaluation assertion by id (provided via query)."
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
export {
|
|
189
|
+
DELETE,
|
|
190
|
+
GET,
|
|
191
|
+
POST,
|
|
192
|
+
PUT,
|
|
193
|
+
metadata,
|
|
194
|
+
openApi
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/api/eval-assertions/route.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\nimport { makeCrudRoute } from '@open-mercato/shared/lib/crud/factory'\nimport type { CrudCtx } from '@open-mercato/shared/lib/crud/factory'\nimport { CrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport { AgentEvalAssertion } from '../../data/entities'\nimport {\n evalAssertionCreateSchema,\n evalAssertionListQuerySchema,\n evalAssertionUpdateSchema,\n type EvalAssertionCreateInput,\n type EvalAssertionUpdateInput,\n} from '../../data/validators'\nimport { parseScorerConfig } from '../../lib/eval/registry'\nimport {\n createAgentOrchestratorCrudOpenApi,\n createPagedListResponseSchema,\n defaultCreateResponseSchema,\n defaultOkResponseSchema,\n} from '../openapi'\n\nconst ENTITY_TYPE = 'agent_orchestrator:agent_eval_assertion'\n\nconst routeMetadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n POST: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n PUT: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n DELETE: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n}\n\nexport const metadata = routeMetadata\n\n/**\n * Resolves which registry scorer this assertion runs and validates its config\n * against that scorer's schema. `scorerKey` is optional on the wire so existing\n * clients that only send `key` keep working \u2014 falling back to `key` reproduces the\n * pre-column resolution rule.\n *\n * A malformed config is a 422 HERE, at the write boundary. At EVALUATION time the\n * same failure yields a skipped result instead, so a bad config stays visible\n * without ever flipping `AgentRun.evalPassed`.\n */\nfunction resolveScorerForWrite(scorerKey: string | undefined, key: string, config: unknown): string {\n const resolved = scorerKey ?? key\n const parsed = parseScorerConfig(resolved, config, 'write')\n if (!parsed.ok) {\n throw new CrudHttpError(422, {\n error: '[internal] invalid assertion configuration',\n scorerKey: resolved,\n issues: parsed.issues,\n })\n }\n return resolved\n}\n\nconst crud = makeCrudRoute<\n EvalAssertionCreateInput,\n EvalAssertionUpdateInput,\n z.infer<typeof evalAssertionListQuerySchema>\n>({\n metadata: routeMetadata,\n orm: {\n entity: AgentEvalAssertion,\n idField: 'id',\n orgField: 'organizationId',\n tenantField: 'tenantId',\n softDeleteField: 'deletedAt',\n },\n indexer: { entityType: ENTITY_TYPE },\n list: {\n schema: evalAssertionListQuerySchema,\n entityId: ENTITY_TYPE,\n fields: [\n 'id',\n 'key',\n 'scorer_key',\n 'title',\n 'description',\n 'applies_to',\n 'type',\n 'severity',\n 'config',\n 'version',\n 'enabled',\n 'organization_id',\n 'tenant_id',\n 'created_at',\n 'updated_at',\n ],\n sortFieldMap: {\n key: 'key',\n scorerKey: 'scorer_key',\n title: 'title',\n appliesTo: 'applies_to',\n type: 'type',\n severity: 'severity',\n enabled: 'enabled',\n createdAt: 'created_at',\n updatedAt: 'updated_at',\n },\n buildFilters: async (query) => {\n const filters: Record<string, unknown> = {}\n if (query.id) filters.id = { $eq: query.id }\n if (query.appliesTo) filters.applies_to = { $eq: query.appliesTo }\n if (query.scorerKey) filters.scorer_key = { $eq: query.scorerKey }\n if (query.type) filters.type = { $eq: query.type }\n if (query.severity) filters.severity = { $eq: query.severity }\n if (typeof query.enabled === 'boolean') filters.enabled = { $eq: query.enabled }\n return filters\n },\n },\n create: {\n schema: evalAssertionCreateSchema,\n mapToEntity: (input, ctx) => {\n const organizationId = ctx.selectedOrganizationId ?? ctx.auth?.orgId ?? null\n const tenantId = ctx.auth?.tenantId ?? null\n if (!organizationId || !tenantId) {\n throw new CrudHttpError(400, { error: '[internal] organization and tenant context required' })\n }\n return {\n tenantId,\n organizationId,\n key: input.key,\n scorerKey: resolveScorerForWrite(input.scorerKey, input.key, input.config),\n title: input.title,\n description: input.description ?? null,\n appliesTo: input.appliesTo,\n type: input.type,\n severity: input.severity,\n config: input.config ?? null,\n enabled: input.enabled ?? true,\n }\n },\n response: (entity) => ({ id: String((entity as { id: string }).id) }),\n },\n update: {\n schema: evalAssertionUpdateSchema,\n getId: (input) => input.id,\n applyToEntity: (entity, input) => {\n const row = entity as AgentEvalAssertion\n if (input.key !== undefined) row.key = input.key\n if (input.title !== undefined) row.title = input.title\n if (input.description !== undefined) row.description = input.description ?? null\n if (input.appliesTo !== undefined) row.appliesTo = input.appliesTo\n if (input.type !== undefined) row.type = input.type\n // Severity is no longer coerced. A judge assertion MAY now be declared\n // `gate`; whether that verdict actually gates is decided per plane by\n // `GatePolicy` at evaluation time \u2014 the manual workbench honours it, CI and\n // online ingest never do. Coercing here would have made the manual policy\n // unreachable.\n if (input.severity !== undefined) row.severity = input.severity\n // Re-validate ONLY when the scorer contract actually changes. Comparing\n // against the stored values (rather than merely checking for presence)\n // matters: clients round-trip the whole row for unrelated edits such as the\n // enable toggle, and a legacy row whose stored config predates validation\n // must not start 422-ing on an untouched field.\n const scorerChanged = input.scorerKey !== undefined && input.scorerKey !== row.scorerKey\n const configChanged =\n input.config !== undefined && JSON.stringify(input.config ?? null) !== JSON.stringify(row.config ?? null)\n if (scorerChanged || configChanged) {\n const nextConfig = input.config !== undefined ? input.config : row.config\n row.scorerKey = resolveScorerForWrite(input.scorerKey ?? row.scorerKey, input.key ?? row.key, nextConfig)\n }\n if (configChanged) {\n row.config = input.config ?? null\n // `version` pins the eval set: bump it whenever the contract actually\n // changes, so a gate run can reference a known assertion revision. It was\n // previously frozen at 1 because nothing ever wrote it. Bumping on every\n // round-trip (including the enable toggle) would make it meaningless.\n row.version = (row.version ?? 1) + 1\n }\n if (input.enabled !== undefined) row.enabled = input.enabled\n },\n response: (entity) => {\n const updatedAt = (entity as AgentEvalAssertion).updatedAt\n return {\n ok: true,\n updatedAt: updatedAt instanceof Date ? updatedAt.toISOString() : null,\n }\n },\n },\n del: { idFrom: 'query', softDelete: true },\n})\n\nexport const GET = crud.GET\nexport const POST = crud.POST\nexport const PUT = crud.PUT\nexport const DELETE = crud.DELETE\n\nconst evalAssertionListItemSchema = z.object({\n id: z.string().uuid(),\n key: z.string(),\n scorer_key: z.string(),\n title: z.string(),\n description: z.string().nullable().optional(),\n applies_to: z.string(),\n type: z.string(),\n severity: z.string(),\n config: z.unknown().nullable().optional(),\n version: z.number().int().optional(),\n enabled: z.boolean().optional(),\n organization_id: z.string().uuid().nullable().optional(),\n tenant_id: z.string().uuid().nullable().optional(),\n created_at: z.string().nullable().optional(),\n updated_at: z.string().nullable().optional(),\n})\n\nexport const openApi = createAgentOrchestratorCrudOpenApi({\n resourceName: 'EvalAssertion',\n pluralName: 'Eval assertions',\n querySchema: evalAssertionListQuerySchema,\n listResponseSchema: createPagedListResponseSchema(evalAssertionListItemSchema),\n create: {\n schema: evalAssertionCreateSchema,\n responseSchema: defaultCreateResponseSchema,\n description:\n 'Creates an evaluation assertion. `llm_judge` assertions are always stored as `warn` severity (the judge tier never blocks production).',\n },\n update: {\n schema: evalAssertionUpdateSchema,\n responseSchema: defaultOkResponseSchema,\n description: 'Updates an evaluation assertion (enable/disable, retarget, or retune its rubric/config).',\n },\n del: {\n schema: z.object({ id: z.string().uuid() }),\n responseSchema: defaultOkResponseSchema,\n description: 'Soft-deletes an evaluation assertion by id (provided via query).',\n },\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAE9B,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,cAAc;AAEpB,MAAM,gBAAgB;AAAA,EACpB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AAAA,EAC9E,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AAAA,EAC/E,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AAAA,EAC9E,QAAQ,EAA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AE,QAAQ,EAAE,SAAS,EAAE,SAAS;AAAA,EACxC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACnC,SAAS,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC9B,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACjD,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC3C,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC7C,CAAC;AAEM,MAAM,UAAU,mCAAmC;AAAA,EACxD,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,oBAAoB,8BAA8B,2BAA2B;AAAA,EAC7E,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,aACE;AAAA,EACJ;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,aAAa;AAAA,EACf;AAAA,EACA,KAAK;AAAA,IACH,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAAA,IAC1C,gBAAgB;AAAA,IAChB,aAAa;AAAA,EACf;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
|
|
4
|
+
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
5
|
+
import { isCrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
6
|
+
const metadata = {
|
|
7
|
+
POST: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] }
|
|
8
|
+
};
|
|
9
|
+
const errorSchema = z.object({ error: z.string() });
|
|
10
|
+
const resultSchema = z.object({
|
|
11
|
+
evalCaseId: z.string().uuid(),
|
|
12
|
+
status: z.string(),
|
|
13
|
+
updatedAt: z.string()
|
|
14
|
+
});
|
|
15
|
+
const optimisticLockConflictSchema = z.object({
|
|
16
|
+
error: z.string(),
|
|
17
|
+
code: z.string(),
|
|
18
|
+
currentUpdatedAt: z.string(),
|
|
19
|
+
expectedUpdatedAt: z.string()
|
|
20
|
+
});
|
|
21
|
+
async function POST(req, ctx) {
|
|
22
|
+
const auth = await getAuthFromRequest(req);
|
|
23
|
+
if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
24
|
+
if (!auth.tenantId || !auth.orgId || !auth.sub) {
|
|
25
|
+
return NextResponse.json({ error: "Tenant context required" }, { status: 400 });
|
|
26
|
+
}
|
|
27
|
+
const { id } = await ctx.params;
|
|
28
|
+
if (!z.string().uuid().safeParse(id).success) {
|
|
29
|
+
return NextResponse.json({ error: "Invalid eval case id" }, { status: 400 });
|
|
30
|
+
}
|
|
31
|
+
const container = await createRequestContainer();
|
|
32
|
+
const commandBus = container.resolve("commandBus");
|
|
33
|
+
const commandCtx = {
|
|
34
|
+
container,
|
|
35
|
+
auth: { sub: auth.sub, tenantId: auth.tenantId, orgId: auth.orgId },
|
|
36
|
+
organizationScope: null,
|
|
37
|
+
selectedOrganizationId: auth.orgId,
|
|
38
|
+
organizationIds: [auth.orgId],
|
|
39
|
+
request: req
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
const { result } = await commandBus.execute(
|
|
43
|
+
"agent_orchestrator.evalCases.approve",
|
|
44
|
+
{
|
|
45
|
+
input: {
|
|
46
|
+
tenantId: auth.tenantId,
|
|
47
|
+
organizationId: auth.orgId,
|
|
48
|
+
evalCaseId: id,
|
|
49
|
+
approvedByUserId: auth.sub
|
|
50
|
+
},
|
|
51
|
+
ctx: commandCtx
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
return NextResponse.json(result);
|
|
55
|
+
} catch (err) {
|
|
56
|
+
if (isCrudHttpError(err)) return NextResponse.json(err.body, { status: err.status });
|
|
57
|
+
throw err;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const openApi = {
|
|
61
|
+
tag: "Agent Orchestrator",
|
|
62
|
+
summary: "Approve an eval case",
|
|
63
|
+
methods: {
|
|
64
|
+
POST: {
|
|
65
|
+
summary: "Approve a drafted eval case so it joins the exported regression set",
|
|
66
|
+
description: "Flips a draft AgentEvalCase to approved. Enforces an optimistic lock on updatedAt (stale write \u2192 409 surfaced via surfaceRecordConflict). Gated by agent_orchestrator.eval.manage.",
|
|
67
|
+
responses: [{ status: 200, description: "The approved eval case", schema: resultSchema }],
|
|
68
|
+
errors: [
|
|
69
|
+
{ status: 401, description: "Unauthorized", schema: errorSchema },
|
|
70
|
+
{ status: 403, description: "Missing agent_orchestrator.eval.manage", schema: errorSchema },
|
|
71
|
+
{ status: 404, description: "Eval case not found (or cross-tenant)", schema: errorSchema },
|
|
72
|
+
{
|
|
73
|
+
status: 409,
|
|
74
|
+
description: "Optimistic-lock conflict (stale updatedAt) or not in draft",
|
|
75
|
+
schema: optimisticLockConflictSchema
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
POST,
|
|
83
|
+
metadata,
|
|
84
|
+
openApi
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/agent_orchestrator/api/eval-cases/%5Bid%5D/approve/route.ts"],
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'\nimport { isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport type {\n ApproveEvalCaseCommandInput,\n ApproveEvalCaseCommandResult,\n} from '../../../../commands/corrections'\n\n/**\n * Engineer approval of a drafted eval case (draft \u2192 approved). Editable target,\n * so the command enforces an optimistic lock on `updatedAt`; a stale write\n * returns a structured 409 the client surfaces via `surfaceRecordConflict`.\n */\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n}\n\nconst errorSchema = z.object({ error: z.string() })\nconst resultSchema = z.object({\n evalCaseId: z.string().uuid(),\n status: z.string(),\n updatedAt: z.string(),\n})\nconst optimisticLockConflictSchema = z.object({\n error: z.string(),\n code: z.string(),\n currentUpdatedAt: z.string(),\n expectedUpdatedAt: z.string(),\n})\n\ntype RouteContext = { params: Promise<{ id: string }> }\n\nexport async function POST(req: Request, ctx: RouteContext) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n if (!auth.tenantId || !auth.orgId || !auth.sub) {\n return NextResponse.json({ error: 'Tenant context required' }, { status: 400 })\n }\n\n const { id } = await ctx.params\n if (!z.string().uuid().safeParse(id).success) {\n return NextResponse.json({ error: 'Invalid eval case id' }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const commandBus = container.resolve('commandBus') as CommandBus\n const commandCtx: CommandRuntimeContext = {\n container,\n auth: { sub: auth.sub, tenantId: auth.tenantId, orgId: auth.orgId } as CommandRuntimeContext['auth'],\n organizationScope: null,\n selectedOrganizationId: auth.orgId,\n organizationIds: [auth.orgId],\n request: req,\n }\n\n try {\n const { result } = await commandBus.execute<ApproveEvalCaseCommandInput, ApproveEvalCaseCommandResult>(\n 'agent_orchestrator.evalCases.approve',\n {\n input: {\n tenantId: auth.tenantId,\n organizationId: auth.orgId,\n evalCaseId: id,\n approvedByUserId: auth.sub,\n },\n ctx: commandCtx,\n },\n )\n return NextResponse.json(result)\n } catch (err) {\n if (isCrudHttpError(err)) return NextResponse.json(err.body, { status: err.status })\n throw err\n }\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'Agent Orchestrator',\n summary: 'Approve an eval case',\n methods: {\n POST: {\n summary: 'Approve a drafted eval case so it joins the exported regression set',\n description:\n 'Flips a draft AgentEvalCase to approved. Enforces an optimistic lock on updatedAt (stale write \u2192 409 surfaced via surfaceRecordConflict). Gated by agent_orchestrator.eval.manage.',\n responses: [{ status: 200, description: 'The approved eval case', schema: resultSchema }],\n errors: [\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.manage', schema: errorSchema },\n { status: 404, description: 'Eval case not found (or cross-tenant)', schema: errorSchema },\n {\n status: 409,\n description: 'Optimistic-lock conflict (stale updatedAt) or not in draft',\n schema: optimisticLockConflictSchema,\n },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAWzB,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AACjF;AAEA,MAAM,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAClD,MAAM,eAAe,EAAE,OAAO;AAAA,EAC5B,YAAY,EAAE,OAAO,EAAE,KAAK;AAAA,EAC5B,QAAQ,EAAE,OAAO;AAAA,EACjB,WAAW,EAAE,OAAO;AACtB,CAAC;AACD,MAAM,+BAA+B,EAAE,OAAO;AAAA,EAC5C,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,kBAAkB,EAAE,OAAO;AAAA,EAC3B,mBAAmB,EAAE,OAAO;AAC9B,CAAC;AAID,eAAsB,KAAK,KAAc,KAAmB;AAC1D,QAAM,OA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AAS;AAAA,EACT,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aACE;AAAA,MACF,WAAW,CAAC,EAAE,QAAQ,KAAK,aAAa,0BAA0B,QAAQ,aAAa,CAAC;AAAA,MACxF,QAAQ;AAAA,QACN,EAAE,QAAQ,KAAK,aAAa,gBAAgB,QAAQ,YAAY;AAAA,QAChE,EAAE,QAAQ,KAAK,aAAa,0CAA0C,QAAQ,YAAY;AAAA,QAC1F,EAAE,QAAQ,KAAK,aAAa,yCAAyC,QAAQ,YAAY;AAAA,QACzF;AAAA,UACE,QAAQ;AAAA,UACR,aAAa;AAAA,UACb,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
|
|
4
|
+
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
5
|
+
import { isCrudHttpError } from "@open-mercato/shared/lib/crud/errors";
|
|
6
|
+
const metadata = {
|
|
7
|
+
POST: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] }
|
|
8
|
+
};
|
|
9
|
+
const errorSchema = z.object({ error: z.string() });
|
|
10
|
+
const resultSchema = z.object({
|
|
11
|
+
evalCaseId: z.string().uuid(),
|
|
12
|
+
status: z.string(),
|
|
13
|
+
updatedAt: z.string()
|
|
14
|
+
});
|
|
15
|
+
const optimisticLockConflictSchema = z.object({
|
|
16
|
+
error: z.string(),
|
|
17
|
+
code: z.string(),
|
|
18
|
+
currentUpdatedAt: z.string(),
|
|
19
|
+
expectedUpdatedAt: z.string()
|
|
20
|
+
});
|
|
21
|
+
async function POST(req, ctx) {
|
|
22
|
+
const auth = await getAuthFromRequest(req);
|
|
23
|
+
if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
24
|
+
if (!auth.tenantId || !auth.orgId || !auth.sub) {
|
|
25
|
+
return NextResponse.json({ error: "Tenant context required" }, { status: 400 });
|
|
26
|
+
}
|
|
27
|
+
const { id } = await ctx.params;
|
|
28
|
+
if (!z.string().uuid().safeParse(id).success) {
|
|
29
|
+
return NextResponse.json({ error: "Invalid eval case id" }, { status: 400 });
|
|
30
|
+
}
|
|
31
|
+
const container = await createRequestContainer();
|
|
32
|
+
const commandBus = container.resolve("commandBus");
|
|
33
|
+
const commandCtx = {
|
|
34
|
+
container,
|
|
35
|
+
auth: { sub: auth.sub, tenantId: auth.tenantId, orgId: auth.orgId },
|
|
36
|
+
organizationScope: null,
|
|
37
|
+
selectedOrganizationId: auth.orgId,
|
|
38
|
+
organizationIds: [auth.orgId],
|
|
39
|
+
request: req
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
const { result } = await commandBus.execute(
|
|
43
|
+
"agent_orchestrator.evalCases.archive",
|
|
44
|
+
{
|
|
45
|
+
input: {
|
|
46
|
+
tenantId: auth.tenantId,
|
|
47
|
+
organizationId: auth.orgId,
|
|
48
|
+
evalCaseId: id
|
|
49
|
+
},
|
|
50
|
+
ctx: commandCtx
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
return NextResponse.json(result);
|
|
54
|
+
} catch (err) {
|
|
55
|
+
if (isCrudHttpError(err)) return NextResponse.json(err.body, { status: err.status });
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const openApi = {
|
|
60
|
+
tag: "Agent Orchestrator",
|
|
61
|
+
summary: "Archive an eval case",
|
|
62
|
+
methods: {
|
|
63
|
+
POST: {
|
|
64
|
+
summary: "Archive a drafted eval case so it joins the exported regression set",
|
|
65
|
+
description: "Flips an eval case to archived, removing it from the replayable set without deleting it. Enforces an optimistic lock on updatedAt (stale write \u2192 409 surfaced via surfaceRecordConflict). Gated by agent_orchestrator.eval.manage.",
|
|
66
|
+
responses: [{ status: 200, description: "The archived eval case", schema: resultSchema }],
|
|
67
|
+
errors: [
|
|
68
|
+
{ status: 401, description: "Unauthorized", schema: errorSchema },
|
|
69
|
+
{ status: 403, description: "Missing agent_orchestrator.eval.manage", schema: errorSchema },
|
|
70
|
+
{ status: 404, description: "Eval case not found (or cross-tenant)", schema: errorSchema },
|
|
71
|
+
{
|
|
72
|
+
status: 409,
|
|
73
|
+
description: "Optimistic-lock conflict (stale updatedAt) or not in draft",
|
|
74
|
+
schema: optimisticLockConflictSchema
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
POST,
|
|
82
|
+
metadata,
|
|
83
|
+
openApi
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/agent_orchestrator/api/eval-cases/%5Bid%5D/archive/route.ts"],
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'\nimport { isCrudHttpError } from '@open-mercato/shared/lib/crud/errors'\nimport type {\n ArchiveEvalCaseCommandInput,\n ArchiveEvalCaseCommandResult,\n} from '../../../../commands/corrections'\n\n/**\n * Engineer approval of a drafted eval case (draft \u2192 archived). Editable target,\n * so the command enforces an optimistic lock on `updatedAt`; a stale write\n * returns a structured 409 the client surfaces via `surfaceRecordConflict`.\n */\nexport const metadata = {\n POST: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n}\n\nconst errorSchema = z.object({ error: z.string() })\nconst resultSchema = z.object({\n evalCaseId: z.string().uuid(),\n status: z.string(),\n updatedAt: z.string(),\n})\nconst optimisticLockConflictSchema = z.object({\n error: z.string(),\n code: z.string(),\n currentUpdatedAt: z.string(),\n expectedUpdatedAt: z.string(),\n})\n\ntype RouteContext = { params: Promise<{ id: string }> }\n\nexport async function POST(req: Request, ctx: RouteContext) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n if (!auth.tenantId || !auth.orgId || !auth.sub) {\n return NextResponse.json({ error: 'Tenant context required' }, { status: 400 })\n }\n\n const { id } = await ctx.params\n if (!z.string().uuid().safeParse(id).success) {\n return NextResponse.json({ error: 'Invalid eval case id' }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const commandBus = container.resolve('commandBus') as CommandBus\n const commandCtx: CommandRuntimeContext = {\n container,\n auth: { sub: auth.sub, tenantId: auth.tenantId, orgId: auth.orgId } as CommandRuntimeContext['auth'],\n organizationScope: null,\n selectedOrganizationId: auth.orgId,\n organizationIds: [auth.orgId],\n request: req,\n }\n\n try {\n const { result } = await commandBus.execute<ArchiveEvalCaseCommandInput, ArchiveEvalCaseCommandResult>(\n 'agent_orchestrator.evalCases.archive',\n {\n input: {\n tenantId: auth.tenantId,\n organizationId: auth.orgId,\n evalCaseId: id,\n },\n ctx: commandCtx,\n },\n )\n return NextResponse.json(result)\n } catch (err) {\n if (isCrudHttpError(err)) return NextResponse.json(err.body, { status: err.status })\n throw err\n }\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: 'Agent Orchestrator',\n summary: 'Archive an eval case',\n methods: {\n POST: {\n summary: 'Archive a drafted eval case so it joins the exported regression set',\n description:\n 'Flips an eval case to archived, removing it from the replayable set without deleting it. Enforces an optimistic lock on updatedAt (stale write \u2192 409 surfaced via surfaceRecordConflict). Gated by agent_orchestrator.eval.manage.',\n responses: [{ status: 200, description: 'The archived eval case', schema: resultSchema }],\n errors: [\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.manage', schema: errorSchema },\n { status: 404, description: 'Eval case not found (or cross-tenant)', schema: errorSchema },\n {\n status: 409,\n description: 'Optimistic-lock conflict (stale updatedAt) or not in draft',\n schema: optimisticLockConflictSchema,\n },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAElB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AAEvC,SAAS,uBAAuB;AAWzB,MAAM,WAAW;AAAA,EACtB,MAAM,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AACjF;AAEA,MAAM,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAClD,MAAM,eAAe,EAAE,OAAO;AAAA,EAC5B,YAAY,EAAE,OAAO,EAAE,KAAK;AAAA,EAC5B,QAAQ,EAAE,OAAO;AAAA,EACjB,WAAW,EAAE,OAAO;AACtB,CAAC;AACD,MAAM,+BAA+B,EAAE,OAAO;AAAA,EAC5C,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,kBAAkB,EAAE,OAAO;AAAA,EAC3B,mBAAmB,EAAE,OAAO;AAC9B,CAAC;AAID,eAAsB,KAAK,KAAc,KAAmB;AAC1D,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,MAAI,CAAC,KAAM,QAAO,aAAa,KAAK,EAAE,OAAO,eAAe,GAAG,EAAE,QAAQ,IAAI,CAAC;AAC9E,MAAI,CAAC,KAAK,YAAY,CAAC,KAAK,SAAS,CAAC,KAAK,KAAK;AAC9C,WAAO,aAAa,KAAK,EAAE,OAAO,0BAA0B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAChF;AAEA,QAAM,EAAE,GAAG,IAAI,MAAM,IAAI;AACzB,MAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,SAAS;AAC5C,WAAO,aA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;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
|
|
4
|
+
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
5
|
+
import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
6
|
+
import { AgentEvalCase } from "../../../data/entities.js";
|
|
7
|
+
import { agentOrchestratorTag } from "../../openapi.js";
|
|
8
|
+
const metadata = {
|
|
9
|
+
GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.manage"] }
|
|
10
|
+
};
|
|
11
|
+
const errorSchema = z.object({ error: z.string() });
|
|
12
|
+
async function GET(req, ctx) {
|
|
13
|
+
const auth = await getAuthFromRequest(req);
|
|
14
|
+
if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
15
|
+
if (!auth.tenantId || !auth.orgId) return NextResponse.json({ error: "Tenant context required" }, { status: 400 });
|
|
16
|
+
const { id } = await ctx.params;
|
|
17
|
+
if (!z.string().uuid().safeParse(id).success) {
|
|
18
|
+
return NextResponse.json({ error: "Invalid eval case id" }, { status: 400 });
|
|
19
|
+
}
|
|
20
|
+
const container = await createRequestContainer();
|
|
21
|
+
const em = container.resolve("em").fork();
|
|
22
|
+
const scope = { tenantId: auth.tenantId, organizationId: auth.orgId };
|
|
23
|
+
const evalCase = await findOneWithDecryption(
|
|
24
|
+
em,
|
|
25
|
+
AgentEvalCase,
|
|
26
|
+
{ id, ...scope, deletedAt: null },
|
|
27
|
+
void 0,
|
|
28
|
+
scope
|
|
29
|
+
);
|
|
30
|
+
if (!evalCase) return NextResponse.json({ error: "Not found" }, { status: 404 });
|
|
31
|
+
return NextResponse.json({
|
|
32
|
+
id: evalCase.id,
|
|
33
|
+
status: evalCase.status,
|
|
34
|
+
source_type: evalCase.sourceType,
|
|
35
|
+
source_id: evalCase.sourceId,
|
|
36
|
+
agent_definition_id: evalCase.agentDefinitionId,
|
|
37
|
+
process_type: evalCase.processType ?? null,
|
|
38
|
+
input: evalCase.input ?? null,
|
|
39
|
+
expected: evalCase.expected ?? null,
|
|
40
|
+
assertions: evalCase.assertions ?? null,
|
|
41
|
+
approved_by_user_id: evalCase.approvedByUserId ?? null,
|
|
42
|
+
created_at: evalCase.createdAt.toISOString(),
|
|
43
|
+
updated_at: evalCase.updatedAt.toISOString()
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const openApi = {
|
|
47
|
+
tag: agentOrchestratorTag,
|
|
48
|
+
summary: "Get an eval case with its payload",
|
|
49
|
+
methods: {
|
|
50
|
+
GET: {
|
|
51
|
+
summary: "Full eval case including the decrypted input and expected value",
|
|
52
|
+
description: "The only endpoint that returns a case payload. `input` and `expected` are encrypted at rest and decrypted per record here; the list route projects metadata only and never exposes them. Returns `updatedAt` for optimistic locking. Cross-tenant ids return 404. Gated by agent_orchestrator.eval.manage.",
|
|
53
|
+
responses: [{ status: 200, description: "The eval case" }],
|
|
54
|
+
errors: [
|
|
55
|
+
{ status: 401, description: "Unauthorized", schema: errorSchema },
|
|
56
|
+
{ status: 403, description: "Missing agent_orchestrator.eval.manage", schema: errorSchema },
|
|
57
|
+
{ status: 404, description: "Eval case not found (or cross-tenant)", schema: errorSchema }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
GET,
|
|
64
|
+
metadata,
|
|
65
|
+
openApi
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/modules/agent_orchestrator/api/eval-cases/%5Bid%5D/route.ts"],
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { z } from 'zod'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport type { OpenApiRouteDoc } from '@open-mercato/shared/lib/openapi'\nimport { getAuthFromRequest } from '@open-mercato/shared/lib/auth/server'\nimport { createRequestContainer } from '@open-mercato/shared/lib/di/container'\nimport { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { AgentEvalCase } from '../../../data/entities'\nimport { agentOrchestratorTag } from '../../openapi'\n\n/**\n * The ONLY route that exposes a case's payload.\n *\n * The list route is a deliberate metadata-only projection so it can never leak\n * `input`/`expected` in bulk; those columns are encrypted at rest and are read\n * here through `findOneWithDecryption`, one record at a time, behind\n * `eval.manage`. Without this route the workbench could not show an author what a\n * case actually contains.\n */\nexport const metadata = {\n GET: { requireAuth: true, requireFeatures: ['agent_orchestrator.eval.manage'] },\n}\n\nconst errorSchema = z.object({ error: z.string() })\n\ntype RouteContext = { params: Promise<{ id: string }> }\n\nexport async function GET(req: Request, ctx: RouteContext) {\n const auth = await getAuthFromRequest(req)\n if (!auth) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })\n if (!auth.tenantId || !auth.orgId) return NextResponse.json({ error: 'Tenant context required' }, { status: 400 })\n\n const { id } = await ctx.params\n if (!z.string().uuid().safeParse(id).success) {\n return NextResponse.json({ error: 'Invalid eval case id' }, { status: 400 })\n }\n\n const container = await createRequestContainer()\n const em = (container.resolve('em') as EntityManager).fork()\n const scope = { tenantId: auth.tenantId, organizationId: auth.orgId }\n\n const evalCase = await findOneWithDecryption(\n em,\n AgentEvalCase,\n { id, ...scope, deletedAt: null },\n undefined,\n scope,\n )\n // Org-scoped 404: a cross-tenant id must not be distinguishable from a missing one.\n if (!evalCase) return NextResponse.json({ error: 'Not found' }, { status: 404 })\n\n return NextResponse.json({\n id: evalCase.id,\n status: evalCase.status,\n source_type: evalCase.sourceType,\n source_id: evalCase.sourceId,\n agent_definition_id: evalCase.agentDefinitionId,\n process_type: evalCase.processType ?? null,\n input: evalCase.input ?? null,\n expected: evalCase.expected ?? null,\n assertions: evalCase.assertions ?? null,\n approved_by_user_id: evalCase.approvedByUserId ?? null,\n created_at: evalCase.createdAt.toISOString(),\n updated_at: evalCase.updatedAt.toISOString(),\n })\n}\n\nexport const openApi: OpenApiRouteDoc = {\n tag: agentOrchestratorTag,\n summary: 'Get an eval case with its payload',\n methods: {\n GET: {\n summary: 'Full eval case including the decrypted input and expected value',\n description:\n 'The only endpoint that returns a case payload. `input` and `expected` are encrypted at rest and decrypted per record here; the list route projects metadata only and never exposes them. Returns `updatedAt` for optimistic locking. Cross-tenant ids return 404. Gated by agent_orchestrator.eval.manage.',\n responses: [{ status: 200, description: 'The eval case' }],\n errors: [\n { status: 401, description: 'Unauthorized', schema: errorSchema },\n { status: 403, description: 'Missing agent_orchestrator.eval.manage', schema: errorSchema },\n { status: 404, description: 'Eval case not found (or cross-tenant)', schema: errorSchema },\n ],\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,SAAS;AAGlB,SAAS,0BAA0B;AACnC,SAAS,8BAA8B;AACvC,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AAW9B,MAAM,WAAW;AAAA,EACtB,KAAK,EAAE,aAAa,MAAM,iBAAiB,CAAC,gCAAgC,EAAE;AAChF;AAEA,MAAM,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAIlD,eAAsB,IAAI,KAAc,KAAmB;AACzD,QAAM,OAAO,MAAM,mBAAmB,GAAG;AACzC,MAAI,CAAC,KAAM,QAAO,aAAa,KAAK,EAAE,OAAO,eAAe,GAAG,EAAE,QAAQ,IAAI,CAAC;AAC9E,MAAI,CAAC,KAAK,YAAY,CAAC,KAAK,MAAO,QAAO,aAAa,KAAK,EAAE,OAAO,0BAA0B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAEjH,QAAM,EAAE,GAAG,IAAI,MAAM,IAAI;AACzB,MAAI,CAAC,EAAE,O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A,QAC1F,EAAE,QAAQ,KAAK,aAAa,yCAAyC,QAAQ,YAAY;AAAA,MAC3F;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getAuthFromRequest } from "@open-mercato/shared/lib/auth/server";
|
|
4
|
+
import { createRequestContainer } from "@open-mercato/shared/lib/di/container";
|
|
5
|
+
import { findWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
6
|
+
import { AgentEvalCase } from "../../../data/entities.js";
|
|
7
|
+
import {
|
|
8
|
+
EVAL_CASE_EXPORT_VERSION,
|
|
9
|
+
evalCaseExportQuerySchema
|
|
10
|
+
} from "../../../data/validators.js";
|
|
11
|
+
const metadata = {
|
|
12
|
+
GET: { requireAuth: true, requireFeatures: ["agent_orchestrator.eval.export"] }
|
|
13
|
+
};
|
|
14
|
+
const errorSchema = z.object({ error: z.string() });
|
|
15
|
+
async function GET(req) {
|
|
16
|
+
const auth = await getAuthFromRequest(req);
|
|
17
|
+
if (!auth) return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
|
18
|
+
if (!auth.tenantId || !auth.orgId) {
|
|
19
|
+
return NextResponse.json({ error: "Tenant context required" }, { status: 400 });
|
|
20
|
+
}
|
|
21
|
+
const url = new URL(req.url);
|
|
22
|
+
const query = evalCaseExportQuerySchema.parse(Object.fromEntries(url.searchParams));
|
|
23
|
+
const container = await createRequestContainer();
|
|
24
|
+
const em = container.resolve("em").fork();
|
|
25
|
+
const where = {
|
|
26
|
+
tenantId: auth.tenantId,
|
|
27
|
+
organizationId: auth.orgId,
|
|
28
|
+
status: "approved",
|
|
29
|
+
deletedAt: null
|
|
30
|
+
};
|
|
31
|
+
if (query.agentDefinitionId) where.agentDefinitionId = query.agentDefinitionId;
|
|
32
|
+
const cases = await findWithDecryption(
|
|
33
|
+
em,
|
|
34
|
+
AgentEvalCase,
|
|
35
|
+
where,
|
|
36
|
+
{ orderBy: { createdAt: "asc" } },
|
|
37
|
+
{ tenantId: auth.tenantId, organizationId: auth.orgId }
|
|
38
|
+
);
|
|
39
|
+
const items = cases.map((evalCase) => ({
|
|
40
|
+
id: evalCase.id,
|
|
41
|
+
sourceType: evalCase.sourceType,
|
|
42
|
+
agentDefinitionId: evalCase.agentDefinitionId,
|
|
43
|
+
processType: evalCase.processType ?? null,
|
|
44
|
+
input: evalCase.input,
|
|
45
|
+
expected: evalCase.expected ?? null,
|
|
46
|
+
assertions: evalCase.assertions ?? null,
|
|
47
|
+
approvedByUserId: evalCase.approvedByUserId ?? null,
|
|
48
|
+
createdAt: evalCase.createdAt.toISOString()
|
|
49
|
+
}));
|
|
50
|
+
const envelope = {
|
|
51
|
+
version: EVAL_CASE_EXPORT_VERSION,
|
|
52
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
53
|
+
count: items.length,
|
|
54
|
+
cases: items
|
|
55
|
+
};
|
|
56
|
+
return NextResponse.json(envelope);
|
|
57
|
+
}
|
|
58
|
+
const openApi = {
|
|
59
|
+
tag: "Agent Orchestrator",
|
|
60
|
+
summary: "Export the agent eval-case set",
|
|
61
|
+
methods: {
|
|
62
|
+
GET: {
|
|
63
|
+
summary: "Export approved eval cases in the versioned agent_orchestrator eval-case format",
|
|
64
|
+
description: "Returns a versioned envelope of APPROVED eval cases (drafts/archived excluded), org-scoped, optionally filtered by agentDefinitionId. Consumed by the lifecycle regression gate. Gated by agent_orchestrator.eval.export.",
|
|
65
|
+
responses: [{ status: 200, description: "The versioned eval-case export envelope" }],
|
|
66
|
+
errors: [
|
|
67
|
+
{ status: 401, description: "Unauthorized", schema: errorSchema },
|
|
68
|
+
{ status: 403, description: "Missing agent_orchestrator.eval.export", schema: errorSchema }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
GET,
|
|
75
|
+
metadata,
|
|
76
|
+
openApi
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=route.js.map
|