@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,310 @@
|
|
|
1
|
+
import type { AwilixContainer } from 'awilix'
|
|
2
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
3
|
+
import type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'
|
|
4
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
5
|
+
import { AgentGuardrailCheck, AgentProposal, AgentSpan } from '../../data/entities'
|
|
6
|
+
import type { AutoDispositionBlock, ProposalOption } from '../../data/validators'
|
|
7
|
+
import { normalizeProposalEnvelope, rankProposalOptions } from '../../data/proposalEnvelope'
|
|
8
|
+
import type {
|
|
9
|
+
DisposeProposalCommandInput,
|
|
10
|
+
DisposeProposalCommandResult,
|
|
11
|
+
} from '../../commands/dispose'
|
|
12
|
+
import { invalidateAgentProposalCache } from '../crudCache'
|
|
13
|
+
import { resolveTenantAutoApprovalPolicy } from './tenantAutoApprovalPolicy'
|
|
14
|
+
import {
|
|
15
|
+
autoApprovable,
|
|
16
|
+
evaluateAutoApproval,
|
|
17
|
+
type AutoApprovalDecision,
|
|
18
|
+
type DispositionOnResult,
|
|
19
|
+
type TenantAutoApprovalPolicy,
|
|
20
|
+
} from './autoApprovalPolicy'
|
|
21
|
+
|
|
22
|
+
const logger = createLogger('agent_orchestrator').child({ component: 'disposition-service' })
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Disposition config carried verbatim from the INVOKE_AGENT node's `onResult`.
|
|
26
|
+
*
|
|
27
|
+
* `autoApproveMargin` is optional here (not just defaulted in the zod schema)
|
|
28
|
+
* because a queue job enqueued before the field existed carries no value —
|
|
29
|
+
* absent means `0`, which is exactly the historic rule.
|
|
30
|
+
*
|
|
31
|
+
* Re-exported from the policy layer, which owns the decision this feeds.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The Invoke Agent node's Review section (spec §7.5), already resolved by the
|
|
37
|
+
* workflows engine against the run context. Re-exported from the workflows
|
|
38
|
+
* module so the two sides cannot drift; `workflows` is an OPTIONAL peer, so the
|
|
39
|
+
* import is type-only and erased at run time.
|
|
40
|
+
*/
|
|
41
|
+
export type AgentDispositionReview =
|
|
42
|
+
import('@open-mercato/core/modules/workflows/lib/agent-disposition-task').AgentDispositionReview
|
|
43
|
+
|
|
44
|
+
export type DispositionCtx = {
|
|
45
|
+
tenantId: string
|
|
46
|
+
organizationId: string
|
|
47
|
+
userId?: string
|
|
48
|
+
workflowInstanceId: string
|
|
49
|
+
stepId: string
|
|
50
|
+
/**
|
|
51
|
+
* Who reviews this proposal and by when, authored on the agent node. Absent
|
|
52
|
+
* means the unassigned task this service raised before §7.5 — which under the
|
|
53
|
+
* workflows §6.4 visibility model is a task nobody can act on.
|
|
54
|
+
*/
|
|
55
|
+
review?: AgentDispositionReview
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type DispositionOutcome =
|
|
59
|
+
| { kind: 'auto_approved'; proposalId: string; selectedOptionId: string }
|
|
60
|
+
| { kind: 'user_task'; userTaskId: string; proposalId: string }
|
|
61
|
+
/** The agent proposed nothing; there is no decision to raise and none to auto-approve. */
|
|
62
|
+
| { kind: 'none_proposed'; proposalId: string }
|
|
63
|
+
|
|
64
|
+
export interface DispositionService {
|
|
65
|
+
dispose(
|
|
66
|
+
proposal: AgentProposal,
|
|
67
|
+
onResult: DispositionOnResult,
|
|
68
|
+
ctx: DispositionCtx,
|
|
69
|
+
): Promise<DispositionOutcome>
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type { AutoApprovalDecision, DispositionOnResult }
|
|
73
|
+
export { autoApprovable, evaluateAutoApproval }
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* MVP DispositionService — a thin DI service called INLINE by the area-02
|
|
77
|
+
* `INVOKE_AGENT` executor right after `agentRuntime.run`. It does NOT subscribe
|
|
78
|
+
* to `proposal.created` (an event-driven seam would lose the activity's
|
|
79
|
+
* transaction scope and race `WAIT_FOR_SIGNAL`).
|
|
80
|
+
*
|
|
81
|
+
* - Auto-approve (confidence ≥ threshold, not `alwaysAsk`): dispose through the
|
|
82
|
+
* audited `agent_orchestrator.proposals.dispose` Command with the internal
|
|
83
|
+
* `auto_approved` verdict (`dispositionBy = 'rule:threshold'`, `skipResume`),
|
|
84
|
+
* then return `{ kind:'auto_approved' }`. The Command emits
|
|
85
|
+
* `proposal.disposed`. NO `proposal.ready` is emitted and the executor
|
|
86
|
+
* proceeds without parking (avoids a park-before-signal race).
|
|
87
|
+
* - Ask-a-human (below threshold / `alwaysAsk` / null confidence): raise a
|
|
88
|
+
* workflows `USER_TASK` surfacing the proposal payload, routed to whoever the
|
|
89
|
+
* agent node's Review section names (spec §7.5); the instance stays parked at
|
|
90
|
+
* `WAIT_FOR_SIGNAL`. Return `{ kind:'user_task' }`. The operator's dispose
|
|
91
|
+
* endpoint later emits `proposal.ready` to resume. Building that row belongs
|
|
92
|
+
* to the workflows module — it owns the entity, the audit log and the
|
|
93
|
+
* assignment event — so this service passes the Review descriptor to
|
|
94
|
+
* `createAgentDispositionTask` rather than assembling the row itself.
|
|
95
|
+
*
|
|
96
|
+
* `workflows` is an optional peer: the USER_TASK creation is guarded so the
|
|
97
|
+
* service degrades gracefully when the module is absent (it still returns a
|
|
98
|
+
* `user_task` outcome with a synthetic id).
|
|
99
|
+
*/
|
|
100
|
+
export class DispositionServiceImpl implements DispositionService {
|
|
101
|
+
constructor(private readonly container: AwilixContainer) {}
|
|
102
|
+
|
|
103
|
+
async dispose(
|
|
104
|
+
proposal: AgentProposal,
|
|
105
|
+
onResult: DispositionOnResult,
|
|
106
|
+
ctx: DispositionCtx,
|
|
107
|
+
): Promise<DispositionOutcome> {
|
|
108
|
+
const { options } = normalizeProposalEnvelope(proposal.payload, proposal.agentId)
|
|
109
|
+
// Nothing proposed: terminal at creation, so there is neither a decision to raise
|
|
110
|
+
// nor a plan to approve. Routed onto the researcher outcome handle downstream.
|
|
111
|
+
if (options.length === 0) {
|
|
112
|
+
return { kind: 'none_proposed', proposalId: proposal.id }
|
|
113
|
+
}
|
|
114
|
+
const decision = evaluateAutoApproval({
|
|
115
|
+
options,
|
|
116
|
+
onResult,
|
|
117
|
+
...(await this.resolvePolicyEvidence(proposal)),
|
|
118
|
+
})
|
|
119
|
+
if (decision.kind === 'approve') {
|
|
120
|
+
return this.autoApprove(proposal, decision.option)
|
|
121
|
+
}
|
|
122
|
+
return this.raiseUserTask(proposal, ctx, decision.block)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* The run-level evidence the policy weighs beside the model's own confidence.
|
|
127
|
+
*
|
|
128
|
+
* Every read here is best-effort and fails CLOSED in the direction that matters:
|
|
129
|
+
* a guardrail table we cannot read reports `guardrailsPassed: false` (an
|
|
130
|
+
* unreadable safety check is not a passed one), while an unreadable tenant
|
|
131
|
+
* policy falls back to the conservative default rather than to "allow
|
|
132
|
+
* everything".
|
|
133
|
+
*/
|
|
134
|
+
private async resolvePolicyEvidence(proposal: AgentProposal): Promise<{
|
|
135
|
+
guardrailsPassed: boolean
|
|
136
|
+
traceComplete: boolean
|
|
137
|
+
tenantPolicy: TenantAutoApprovalPolicy
|
|
138
|
+
}> {
|
|
139
|
+
const em = (this.container.resolve('em') as EntityManager).fork()
|
|
140
|
+
const scope = { tenantId: proposal.tenantId, organizationId: proposal.organizationId }
|
|
141
|
+
|
|
142
|
+
let guardrailsPassed = false
|
|
143
|
+
let traceComplete = false
|
|
144
|
+
try {
|
|
145
|
+
const [blocked, spanCount] = await Promise.all([
|
|
146
|
+
em.count(AgentGuardrailCheck, { ...scope, agentRunId: proposal.runId, result: 'block' }),
|
|
147
|
+
em.count(AgentSpan, { ...scope, agentRunId: proposal.runId }),
|
|
148
|
+
])
|
|
149
|
+
guardrailsPassed = blocked === 0
|
|
150
|
+
// A run that left no trace at all cannot be audited after the fact, and an
|
|
151
|
+
// unauditable mutation is exactly what auto-approval must not produce.
|
|
152
|
+
traceComplete = spanCount > 0
|
|
153
|
+
} catch (error) {
|
|
154
|
+
logger.warn('auto-approval evidence unavailable; holding the proposal for a human', {
|
|
155
|
+
proposalId: proposal.id,
|
|
156
|
+
error: error instanceof Error ? error.message : String(error),
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
guardrailsPassed,
|
|
162
|
+
traceComplete,
|
|
163
|
+
tenantPolicy: await resolveTenantAutoApprovalPolicy(this.container, proposal.tenantId),
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
private async autoApprove(
|
|
168
|
+
proposal: AgentProposal,
|
|
169
|
+
option: ProposalOption,
|
|
170
|
+
): Promise<DispositionOutcome> {
|
|
171
|
+
const commandBus = this.container.resolve('commandBus') as CommandBus
|
|
172
|
+
const commandCtx: CommandRuntimeContext = {
|
|
173
|
+
container: this.container,
|
|
174
|
+
auth: null,
|
|
175
|
+
organizationScope: null,
|
|
176
|
+
selectedOrganizationId: proposal.organizationId,
|
|
177
|
+
organizationIds: [proposal.organizationId],
|
|
178
|
+
systemActor: true,
|
|
179
|
+
}
|
|
180
|
+
await commandBus.execute<DisposeProposalCommandInput, DisposeProposalCommandResult>(
|
|
181
|
+
'agent_orchestrator.proposals.dispose',
|
|
182
|
+
{
|
|
183
|
+
input: {
|
|
184
|
+
proposalId: proposal.id,
|
|
185
|
+
tenantId: proposal.tenantId,
|
|
186
|
+
organizationId: proposal.organizationId,
|
|
187
|
+
disposition: 'auto_approved',
|
|
188
|
+
dispositionBy: 'rule:threshold',
|
|
189
|
+
selectedOptionId: option.id,
|
|
190
|
+
skipResume: true,
|
|
191
|
+
},
|
|
192
|
+
ctx: commandCtx,
|
|
193
|
+
},
|
|
194
|
+
)
|
|
195
|
+
return { kind: 'auto_approved', proposalId: proposal.id, selectedOptionId: option.id }
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
private async raiseUserTask(
|
|
199
|
+
proposal: AgentProposal,
|
|
200
|
+
ctx: DispositionCtx,
|
|
201
|
+
block: AutoDispositionBlock | null,
|
|
202
|
+
): Promise<DispositionOutcome> {
|
|
203
|
+
if (block) await this.recordAutoDispositionBlock(proposal, block)
|
|
204
|
+
const userTaskId = await this.createUserTask(proposal, ctx)
|
|
205
|
+
return { kind: 'user_task', userTaskId, proposalId: proposal.id }
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* A blocked auto-approval is not a failure — it is a proposal that cleared its
|
|
210
|
+
* threshold and was held anyway, and silence would read as the threshold simply not
|
|
211
|
+
* being met. Written with a targeted `nativeUpdate` for the same reason
|
|
212
|
+
* `recordUserTaskId` is: `updated_at` is the proposal's optimistic-lock token and
|
|
213
|
+
* bumping it here would turn the annotation into a spurious 409 for the operator.
|
|
214
|
+
*/
|
|
215
|
+
private async recordAutoDispositionBlock(
|
|
216
|
+
proposal: AgentProposal,
|
|
217
|
+
block: AutoDispositionBlock,
|
|
218
|
+
): Promise<void> {
|
|
219
|
+
try {
|
|
220
|
+
const em = (this.container.resolve('em') as EntityManager).fork()
|
|
221
|
+
await em.nativeUpdate(
|
|
222
|
+
AgentProposal,
|
|
223
|
+
{ id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
|
|
224
|
+
{ autoDispositionBlock: block },
|
|
225
|
+
)
|
|
226
|
+
proposal.autoDispositionBlock = block
|
|
227
|
+
await invalidateAgentProposalCache(
|
|
228
|
+
this.container as Parameters<typeof invalidateAgentProposalCache>[0],
|
|
229
|
+
{ id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
|
|
230
|
+
'agent_orchestrator.proposals.auto_block',
|
|
231
|
+
)
|
|
232
|
+
} catch (error) {
|
|
233
|
+
logger.warn('auto-disposition block not recorded', {
|
|
234
|
+
proposalId: proposal.id,
|
|
235
|
+
block,
|
|
236
|
+
error: error instanceof Error ? error.message : String(error),
|
|
237
|
+
})
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
private async createUserTask(
|
|
242
|
+
proposal: AgentProposal,
|
|
243
|
+
ctx: DispositionCtx,
|
|
244
|
+
): Promise<string> {
|
|
245
|
+
try {
|
|
246
|
+
const dispositionTask = (await import(
|
|
247
|
+
'@open-mercato/core/modules/workflows/lib/agent-disposition-task'
|
|
248
|
+
)) as typeof import('@open-mercato/core/modules/workflows/lib/agent-disposition-task')
|
|
249
|
+
const em = (this.container.resolve('em') as EntityManager).fork()
|
|
250
|
+
|
|
251
|
+
const created = await dispositionTask.createAgentDispositionTask(em, this.container, {
|
|
252
|
+
workflowInstanceId: ctx.workflowInstanceId,
|
|
253
|
+
stepId: ctx.stepId,
|
|
254
|
+
proposalId: proposal.id,
|
|
255
|
+
agentId: proposal.agentId,
|
|
256
|
+
proposalPayload: proposal.payload,
|
|
257
|
+
confidence: proposal.confidence ?? null,
|
|
258
|
+
taskName: `Dispose agent proposal (${proposal.agentId})`,
|
|
259
|
+
description: 'Review and approve, edit, or reject the agent proposal.',
|
|
260
|
+
review: ctx.review ?? null,
|
|
261
|
+
tenantId: ctx.tenantId,
|
|
262
|
+
organizationId: ctx.organizationId,
|
|
263
|
+
userId: ctx.userId,
|
|
264
|
+
})
|
|
265
|
+
await this.recordUserTaskId(proposal, created.userTaskId)
|
|
266
|
+
return created.userTaskId
|
|
267
|
+
} catch (error) {
|
|
268
|
+
logger.warn('USER_TASK not created (workflows peer absent?)', {
|
|
269
|
+
proposalId: proposal.id,
|
|
270
|
+
workflowInstanceId: ctx.workflowInstanceId,
|
|
271
|
+
error: error instanceof Error ? error.message : String(error),
|
|
272
|
+
})
|
|
273
|
+
return `pending:${proposal.id}`
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Link the proposal to the review task raised for it, so `commands/dispose.ts`
|
|
279
|
+
* can close that task once a verdict lands (A7).
|
|
280
|
+
*
|
|
281
|
+
* A targeted `nativeUpdate` rather than a managed write: it must NOT touch
|
|
282
|
+
* `updated_at`, which is the proposal's optimistic-lock token — bumping it
|
|
283
|
+
* here would invalidate a caseload modal that had already loaded the row and
|
|
284
|
+
* turn the link into a spurious 409 for the operator.
|
|
285
|
+
*/
|
|
286
|
+
private async recordUserTaskId(proposal: AgentProposal, userTaskId: string): Promise<void> {
|
|
287
|
+
try {
|
|
288
|
+
const em = (this.container.resolve('em') as EntityManager).fork()
|
|
289
|
+
await em.nativeUpdate(
|
|
290
|
+
AgentProposal,
|
|
291
|
+
{ id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
|
|
292
|
+
{ userTaskId },
|
|
293
|
+
)
|
|
294
|
+
proposal.userTaskId = userTaskId
|
|
295
|
+
await invalidateAgentProposalCache(
|
|
296
|
+
this.container as Parameters<typeof invalidateAgentProposalCache>[0],
|
|
297
|
+
{ id: proposal.id, tenantId: proposal.tenantId, organizationId: proposal.organizationId },
|
|
298
|
+
'agent_orchestrator.proposals.review_task',
|
|
299
|
+
)
|
|
300
|
+
} catch (error) {
|
|
301
|
+
// The task exists and the proposal is pending; losing the link costs the
|
|
302
|
+
// automatic close, never the review itself.
|
|
303
|
+
logger.warn('proposal not linked to its review task', {
|
|
304
|
+
proposalId: proposal.id,
|
|
305
|
+
userTaskId,
|
|
306
|
+
error: error instanceof Error ? error.message : String(error),
|
|
307
|
+
})
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { AwilixContainer } from 'awilix'
|
|
2
|
+
import type { EntityManager } from '@mikro-orm/postgresql'
|
|
3
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
4
|
+
import { emitAgentOrchestratorEvent } from '../../events'
|
|
5
|
+
import type { AgentProposalDisposition } from '../../data/entities'
|
|
6
|
+
|
|
7
|
+
const logger = createLogger('agent_orchestrator').child({ component: 'disposition-resume' })
|
|
8
|
+
|
|
9
|
+
export type ResumeWorkflowForProposalInput = {
|
|
10
|
+
proposalId: string
|
|
11
|
+
workflowInstanceId: string
|
|
12
|
+
stepId: string | null
|
|
13
|
+
disposition: AgentProposalDisposition
|
|
14
|
+
proposalPayload?: unknown
|
|
15
|
+
tenantId: string
|
|
16
|
+
organizationId: string
|
|
17
|
+
userId?: string | null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Human-path resume seam (area 03 → area 02).
|
|
22
|
+
*
|
|
23
|
+
* Emits the `agent_orchestrator.proposal.ready { workflowInstanceId, stepId, proposalId }`
|
|
24
|
+
* audit/broadcast event, then delivers the resume signal to the parked workflow
|
|
25
|
+
* instance via the workflows module's `sendSignal`. Area 02's `WAIT_FOR_SIGNAL`
|
|
26
|
+
* keys on `signalName = 'agent_orchestrator.proposal.ready'` and matches the
|
|
27
|
+
* parked instance by `workflowInstanceId`; the merged `disposition`/`payload` lands in
|
|
28
|
+
* `WorkflowInstance.context` so the downstream effector reads the approved
|
|
29
|
+
* (possibly edited) payload. A `rejected` proposal resumes too — the workflow
|
|
30
|
+
* definition's effector transition condition (`disposition ∈ {auto_approved,
|
|
31
|
+
* approved, edited}`) skips the effector.
|
|
32
|
+
*
|
|
33
|
+
* The auto-approve path NEVER reaches here (the executor proceeded inline and
|
|
34
|
+
* never parked). `proposal.ready` is therefore the human-path resume signal only.
|
|
35
|
+
*
|
|
36
|
+
* `workflows` is an optional peer: the resume is best-effort and degrades
|
|
37
|
+
* gracefully (logs) when the module is absent, so the disposition itself is
|
|
38
|
+
* already committed and audited regardless of signal delivery.
|
|
39
|
+
*/
|
|
40
|
+
export async function resumeWorkflowForProposal(
|
|
41
|
+
container: AwilixContainer,
|
|
42
|
+
em: EntityManager,
|
|
43
|
+
input: ResumeWorkflowForProposalInput,
|
|
44
|
+
): Promise<void> {
|
|
45
|
+
await emitAgentOrchestratorEvent(
|
|
46
|
+
'agent_orchestrator.proposal.ready',
|
|
47
|
+
{
|
|
48
|
+
workflowInstanceId: input.workflowInstanceId,
|
|
49
|
+
stepId: input.stepId,
|
|
50
|
+
proposalId: input.proposalId,
|
|
51
|
+
tenantId: input.tenantId,
|
|
52
|
+
organizationId: input.organizationId,
|
|
53
|
+
},
|
|
54
|
+
{ persistent: true },
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
const signalHandler = (await import(
|
|
59
|
+
'@open-mercato/core/modules/workflows/lib/signal-handler'
|
|
60
|
+
)) as typeof import('@open-mercato/core/modules/workflows/lib/signal-handler')
|
|
61
|
+
await signalHandler.sendSignal(em, container, {
|
|
62
|
+
instanceId: input.workflowInstanceId,
|
|
63
|
+
signalName: 'agent_orchestrator.proposal.ready',
|
|
64
|
+
payload: {
|
|
65
|
+
proposalId: input.proposalId,
|
|
66
|
+
stepId: input.stepId,
|
|
67
|
+
disposition: input.disposition,
|
|
68
|
+
proposalPayload: input.proposalPayload,
|
|
69
|
+
},
|
|
70
|
+
userId: input.userId ?? undefined,
|
|
71
|
+
tenantId: input.tenantId,
|
|
72
|
+
organizationId: input.organizationId,
|
|
73
|
+
})
|
|
74
|
+
} catch (error) {
|
|
75
|
+
logger.warn('proposal.ready resume signal not delivered', {
|
|
76
|
+
workflowInstanceId: input.workflowInstanceId,
|
|
77
|
+
proposalId: input.proposalId,
|
|
78
|
+
error: error instanceof Error ? error.message : String(error),
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { AwilixContainer } from 'awilix'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
4
|
+
import {
|
|
5
|
+
ACTION_RISK_TIERS,
|
|
6
|
+
DEFAULT_TENANT_AUTO_APPROVAL_POLICY,
|
|
7
|
+
type TenantAutoApprovalPolicy,
|
|
8
|
+
} from './autoApprovalPolicy'
|
|
9
|
+
|
|
10
|
+
const logger = createLogger('agent_orchestrator').child({ component: 'tenant-auto-approval-policy' })
|
|
11
|
+
|
|
12
|
+
export const AUTO_APPROVAL_CONFIG_MODULE = 'agent_orchestrator'
|
|
13
|
+
export const AUTO_APPROVAL_CONFIG_NAME = 'auto_approval_policy'
|
|
14
|
+
|
|
15
|
+
export const tenantAutoApprovalPolicySchema = z.object({
|
|
16
|
+
enabled: z.boolean(),
|
|
17
|
+
maxAutoApproveRisk: z.enum(ACTION_RISK_TIERS),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
type ModuleConfigServiceLike = {
|
|
21
|
+
getRecord(
|
|
22
|
+
moduleId: string,
|
|
23
|
+
name: string,
|
|
24
|
+
scope?: { tenantId?: string | null },
|
|
25
|
+
): Promise<{ value: unknown } | null>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function resolveModuleConfig(container: AwilixContainer): ModuleConfigServiceLike | null {
|
|
29
|
+
try {
|
|
30
|
+
return container.resolve('moduleConfigService') as ModuleConfigServiceLike
|
|
31
|
+
} catch {
|
|
32
|
+
return null
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The tenant's standing decision about what may happen without a human.
|
|
38
|
+
*
|
|
39
|
+
* A tenant that has configured nothing gets
|
|
40
|
+
* `DEFAULT_TENANT_AUTO_APPROVAL_POLICY` — enabled, ceiling `medium` — which is
|
|
41
|
+
* the historic behaviour for every action nobody has declared risky, and refuses
|
|
42
|
+
* unattended `high`-risk actions. Reading an unset policy as "allow everything"
|
|
43
|
+
* would make the ceiling opt-in, i.e. absent exactly where it matters.
|
|
44
|
+
*
|
|
45
|
+
* A malformed or unreadable record falls back to that default rather than
|
|
46
|
+
* failing the disposition: losing per-tenant tuning is recoverable, losing the
|
|
47
|
+
* ability to dispose a proposal is not. It is never read as a LOOSER policy than
|
|
48
|
+
* the default — the schema only accepts a complete object, so a partially
|
|
49
|
+
* corrupted record cannot raise the ceiling by omission.
|
|
50
|
+
*/
|
|
51
|
+
export async function resolveTenantAutoApprovalPolicy(
|
|
52
|
+
container: AwilixContainer,
|
|
53
|
+
tenantId: string | null,
|
|
54
|
+
): Promise<TenantAutoApprovalPolicy> {
|
|
55
|
+
return (await readTenantAutoApprovalPolicy(container, tenantId)).policy
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Where the effective policy came from — `'tenant'` when this tenant actually
|
|
60
|
+
* saved one, `'default'` when it is inheriting.
|
|
61
|
+
*
|
|
62
|
+
* The disposition path does not care (a policy is a policy), but the settings
|
|
63
|
+
* screen does: an admin looking at `enabled: true / medium` has to be able to
|
|
64
|
+
* tell "we decided this" from "nobody has decided anything yet", and every
|
|
65
|
+
* fallback arm below — no store, no record, a malformed record, an unreadable
|
|
66
|
+
* one — is honestly `'default'`.
|
|
67
|
+
*/
|
|
68
|
+
export type TenantAutoApprovalPolicySource = 'tenant' | 'default'
|
|
69
|
+
|
|
70
|
+
export async function readTenantAutoApprovalPolicy(
|
|
71
|
+
container: AwilixContainer,
|
|
72
|
+
tenantId: string | null,
|
|
73
|
+
): Promise<{ policy: TenantAutoApprovalPolicy; source: TenantAutoApprovalPolicySource }> {
|
|
74
|
+
const fallback = {
|
|
75
|
+
policy: DEFAULT_TENANT_AUTO_APPROVAL_POLICY,
|
|
76
|
+
source: 'default' as const,
|
|
77
|
+
}
|
|
78
|
+
const service = resolveModuleConfig(container)
|
|
79
|
+
if (!service) return fallback
|
|
80
|
+
try {
|
|
81
|
+
const record = await service.getRecord(AUTO_APPROVAL_CONFIG_MODULE, AUTO_APPROVAL_CONFIG_NAME, {
|
|
82
|
+
tenantId,
|
|
83
|
+
})
|
|
84
|
+
if (!record) return fallback
|
|
85
|
+
const parsed = tenantAutoApprovalPolicySchema.safeParse(record.value)
|
|
86
|
+
if (!parsed.success) {
|
|
87
|
+
logger.warn('stored auto-approval policy is malformed; using the conservative default', {
|
|
88
|
+
tenantId,
|
|
89
|
+
})
|
|
90
|
+
return fallback
|
|
91
|
+
}
|
|
92
|
+
return { policy: parsed.data, source: 'tenant' }
|
|
93
|
+
} catch (error) {
|
|
94
|
+
logger.warn('auto-approval policy unreadable; using the conservative default', {
|
|
95
|
+
tenantId,
|
|
96
|
+
error: error instanceof Error ? error.message : String(error),
|
|
97
|
+
})
|
|
98
|
+
return fallback
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { AgentEvalAssertion } from '../../data/entities'
|
|
2
|
+
import { evalCaseAssertionRefSchema } from '../../data/validators'
|
|
3
|
+
import { parseScorerConfig, resolveScorerKey } from './registry'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Per-case override of a suite-level assertion. References are by `assertionId`,
|
|
7
|
+
* NOT by key: `agent_eval_assertions_key_uq` is unique per (org, appliesTo, key),
|
|
8
|
+
* so a `'*'` row and an agent-specific row routinely share a slug and a key-based
|
|
9
|
+
* reference would be ambiguous.
|
|
10
|
+
*/
|
|
11
|
+
export type EvalCaseAssertionRef = {
|
|
12
|
+
assertionId: string
|
|
13
|
+
/** Shallow-merged over the stored config, then RE-VALIDATED against the scorer. */
|
|
14
|
+
configOverride?: Record<string, unknown> | null
|
|
15
|
+
/** Opt out of an inherited assertion for this case only. */
|
|
16
|
+
disabled?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type ResolvedAssertion = {
|
|
20
|
+
assertion: AgentEvalAssertion
|
|
21
|
+
scorerKey: string
|
|
22
|
+
/** Stored config with any case-level override merged in. */
|
|
23
|
+
config: unknown
|
|
24
|
+
/** Set when the merged config failed validation — the caller records a skip. */
|
|
25
|
+
configError?: string[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Parses the stored `AgentEvalCase.assertions` column through the SAME zod schema
|
|
30
|
+
* the write path uses, so there is one definition of the shape rather than two
|
|
31
|
+
* that can drift. Malformed entries are dropped rather than failing the case: the
|
|
32
|
+
* column predates validation, so a legacy row must still be replayable.
|
|
33
|
+
*/
|
|
34
|
+
export function parseCaseAssertionRefs(raw: unknown): EvalCaseAssertionRef[] {
|
|
35
|
+
if (!Array.isArray(raw)) return []
|
|
36
|
+
return raw.flatMap((entry) => {
|
|
37
|
+
const parsed = evalCaseAssertionRefSchema.safeParse(entry)
|
|
38
|
+
if (!parsed.success) return []
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
assertionId: parsed.data.assertionId,
|
|
42
|
+
configOverride: parsed.data.configOverride ?? null,
|
|
43
|
+
disabled: parsed.data.disabled === true,
|
|
44
|
+
},
|
|
45
|
+
]
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Effective assertion set for one case.
|
|
51
|
+
*
|
|
52
|
+
* Precedence: an agent-specific assertion SHADOWS a `'*'` assertion sharing the
|
|
53
|
+
* same `key` slug — a tenant tightening one agent's rule should not end up running
|
|
54
|
+
* both the general and the specific version. Case-level refs then apply on top:
|
|
55
|
+
* `disabled` removes, `configOverride` merges.
|
|
56
|
+
*
|
|
57
|
+
* The merged config is re-validated. Without that, a case-level override would
|
|
58
|
+
* reintroduce exactly the malformed-config-silently-tolerated failure the typed
|
|
59
|
+
* registry exists to eliminate.
|
|
60
|
+
*/
|
|
61
|
+
export function resolveEffectiveAssertions(
|
|
62
|
+
assertions: ReadonlyArray<AgentEvalAssertion>,
|
|
63
|
+
refs: ReadonlyArray<EvalCaseAssertionRef>,
|
|
64
|
+
): ResolvedAssertion[] {
|
|
65
|
+
const bySlug = new Map<string, AgentEvalAssertion>()
|
|
66
|
+
for (const assertion of assertions) {
|
|
67
|
+
const current = bySlug.get(assertion.key)
|
|
68
|
+
if (!current) {
|
|
69
|
+
bySlug.set(assertion.key, assertion)
|
|
70
|
+
continue
|
|
71
|
+
}
|
|
72
|
+
// Agent-specific wins over the '*' wildcard — EXCEPT it may not weaken the
|
|
73
|
+
// gate tier. A tenant-wide `gate` assertion being silently replaced by an
|
|
74
|
+
// agent-scoped `warn` one sharing its slug would drop a gate with no error,
|
|
75
|
+
// and the seeded defaults ship exactly such a `'*'` gate (`output_present`).
|
|
76
|
+
const incomingIsSpecific = assertion.appliesTo !== '*'
|
|
77
|
+
const currentIsSpecific = current.appliesTo !== '*'
|
|
78
|
+
const wouldWeakenGate = current.severity === 'gate' && assertion.severity !== 'gate'
|
|
79
|
+
if (incomingIsSpecific && !currentIsSpecific && !wouldWeakenGate) bySlug.set(assertion.key, assertion)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const refsById = new Map(refs.map((ref) => [ref.assertionId, ref]))
|
|
83
|
+
const resolved: ResolvedAssertion[] = []
|
|
84
|
+
|
|
85
|
+
for (const assertion of bySlug.values()) {
|
|
86
|
+
const ref = refsById.get(assertion.id)
|
|
87
|
+
if (ref?.disabled) continue
|
|
88
|
+
|
|
89
|
+
const scorerKey = resolveScorerKey(assertion)
|
|
90
|
+
const stored = (assertion.config as Record<string, unknown> | null) ?? {}
|
|
91
|
+
const config = ref?.configOverride ? { ...stored, ...ref.configOverride } : stored
|
|
92
|
+
|
|
93
|
+
if (ref?.configOverride) {
|
|
94
|
+
const parsed = parseScorerConfig(scorerKey, config)
|
|
95
|
+
if (!parsed.ok) {
|
|
96
|
+
resolved.push({ assertion, scorerKey, config, configError: parsed.issues })
|
|
97
|
+
continue
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
resolved.push({ assertion, scorerKey, config })
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return resolved
|
|
105
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Recursively canonicalizes a JSON-ish value so that two structurally-equal
|
|
5
|
+
* inputs serialize identically regardless of object key order. Arrays keep their
|
|
6
|
+
* order (order is semantically meaningful); object keys are sorted; primitives
|
|
7
|
+
* pass through. Non-finite numbers / undefined collapse to null (matching
|
|
8
|
+
* JSON.stringify semantics) so the result is always a stable string.
|
|
9
|
+
*/
|
|
10
|
+
function canonicalize(value: unknown): unknown {
|
|
11
|
+
if (value === null || typeof value !== 'object') return value
|
|
12
|
+
if (Array.isArray(value)) return value.map(canonicalize)
|
|
13
|
+
const record = value as Record<string, unknown>
|
|
14
|
+
const sorted: Record<string, unknown> = {}
|
|
15
|
+
for (const key of Object.keys(record).sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))) {
|
|
16
|
+
const canonicalChild = canonicalize(record[key])
|
|
17
|
+
if (canonicalChild !== undefined) sorted[key] = canonicalChild
|
|
18
|
+
}
|
|
19
|
+
return sorted
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Deterministic content hash of an agent run input, stable across object key
|
|
24
|
+
* order. Used to match a live/playground run's input to an approved golden eval
|
|
25
|
+
* case (`agent_eval_cases.input_key`). Computed over the DECRYPTED plaintext
|
|
26
|
+
* input at write time; the resulting hex digest is stored plaintext and is
|
|
27
|
+
* SQL-queryable. 64-char SHA-256 hex → fits `varchar(64)`.
|
|
28
|
+
*/
|
|
29
|
+
export function canonicalInputKey(input: unknown): string {
|
|
30
|
+
const canonical = JSON.stringify(canonicalize(input) ?? null)
|
|
31
|
+
return createHash('sha256').update(canonical).digest('hex')
|
|
32
|
+
}
|