@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,146 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readdir, readFile, stat } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
5
|
+
import { putArtifactBytes } from "./artifactFileStore.js";
|
|
6
|
+
const logger = createLogger("agent_orchestrator").child({ component: "artifact-collector" });
|
|
7
|
+
const DEFAULT_MAX_BYTES = 26214400;
|
|
8
|
+
const DEFAULT_MAX_COUNT = 20;
|
|
9
|
+
function resolveMaxBytes() {
|
|
10
|
+
const raw = Number.parseInt(process.env.OM_AGENT_ARTIFACT_MAX_BYTES ?? "", 10);
|
|
11
|
+
return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_MAX_BYTES;
|
|
12
|
+
}
|
|
13
|
+
function resolveMaxCount() {
|
|
14
|
+
const raw = Number.parseInt(process.env.OM_AGENT_ARTIFACT_MAX_COUNT ?? "", 10);
|
|
15
|
+
return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_MAX_COUNT;
|
|
16
|
+
}
|
|
17
|
+
const MIME_BY_EXT = {
|
|
18
|
+
".pdf": "application/pdf",
|
|
19
|
+
".csv": "text/csv",
|
|
20
|
+
".txt": "text/plain",
|
|
21
|
+
".md": "text/markdown",
|
|
22
|
+
".json": "application/json",
|
|
23
|
+
".xml": "application/xml",
|
|
24
|
+
".html": "text/html",
|
|
25
|
+
".htm": "text/html",
|
|
26
|
+
".png": "image/png",
|
|
27
|
+
".jpg": "image/jpeg",
|
|
28
|
+
".jpeg": "image/jpeg",
|
|
29
|
+
".gif": "image/gif",
|
|
30
|
+
".svg": "image/svg+xml",
|
|
31
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
32
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
33
|
+
".zip": "application/zip"
|
|
34
|
+
};
|
|
35
|
+
function mimeForFile(fileName) {
|
|
36
|
+
return MIME_BY_EXT[path.extname(fileName).toLowerCase()] ?? "application/octet-stream";
|
|
37
|
+
}
|
|
38
|
+
function safeBasename(fileName) {
|
|
39
|
+
return path.basename(fileName).replace(/[^a-zA-Z0-9_.-]+/g, "_").slice(0, 255);
|
|
40
|
+
}
|
|
41
|
+
async function listFiles(outDir) {
|
|
42
|
+
const found = [];
|
|
43
|
+
const walk = async (dir, rel) => {
|
|
44
|
+
let entries;
|
|
45
|
+
try {
|
|
46
|
+
entries = await readdir(dir, { withFileTypes: true });
|
|
47
|
+
} catch {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
const childRel = rel ? `${rel}/${entry.name}` : entry.name;
|
|
52
|
+
if (entry.isDirectory()) {
|
|
53
|
+
await walk(path.join(dir, entry.name), childRel);
|
|
54
|
+
} else if (entry.isFile()) {
|
|
55
|
+
found.push(childRel);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
await walk(outDir, "");
|
|
60
|
+
return found.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
61
|
+
}
|
|
62
|
+
async function collectArtifacts(args) {
|
|
63
|
+
const maxBytes = resolveMaxBytes();
|
|
64
|
+
const maxCount = resolveMaxCount();
|
|
65
|
+
const container = args.commandCtx.container;
|
|
66
|
+
const scope = { tenantId: args.tenantId, organizationId: args.organizationId };
|
|
67
|
+
const captionByPath = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const advisory of args.advisory ?? []) {
|
|
69
|
+
if (advisory.caption) captionByPath.set(advisory.path.replace(/^\.?\/+/, ""), advisory.caption);
|
|
70
|
+
}
|
|
71
|
+
const skipped = [];
|
|
72
|
+
const failed = [];
|
|
73
|
+
const collected = [];
|
|
74
|
+
const relPaths = await listFiles(args.outDir);
|
|
75
|
+
for (const rel of relPaths) {
|
|
76
|
+
if (collected.length >= maxCount) {
|
|
77
|
+
skipped.push(rel);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const abs = path.join(args.outDir, rel);
|
|
81
|
+
let size;
|
|
82
|
+
try {
|
|
83
|
+
size = (await stat(abs)).size;
|
|
84
|
+
} catch {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (size > maxBytes) {
|
|
88
|
+
skipped.push(rel);
|
|
89
|
+
logger.warn("agent artifact exceeds OM_AGENT_ARTIFACT_MAX_BYTES; skipped", { artifact: rel, size });
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
let bytes;
|
|
93
|
+
try {
|
|
94
|
+
bytes = await readFile(abs);
|
|
95
|
+
} catch {
|
|
96
|
+
failed.push(rel);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
100
|
+
const fileName = safeBasename(rel);
|
|
101
|
+
const storageKey = await putArtifactBytes(container, scope, {
|
|
102
|
+
buffer: bytes,
|
|
103
|
+
fileName,
|
|
104
|
+
mimeType: mimeForFile(fileName)
|
|
105
|
+
});
|
|
106
|
+
if (!storageKey) {
|
|
107
|
+
failed.push(rel);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
collected.push({
|
|
111
|
+
fileName,
|
|
112
|
+
mimeType: mimeForFile(fileName),
|
|
113
|
+
fileSize: size,
|
|
114
|
+
sha256,
|
|
115
|
+
storageKey,
|
|
116
|
+
caption: captionByPath.get(rel) ?? null
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (skipped.length > 0) {
|
|
120
|
+
logger.warn("agent artifact capture skipped files over caps", {
|
|
121
|
+
skippedCount: skipped.length,
|
|
122
|
+
runId: args.runId
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
let capturedCount = 0;
|
|
126
|
+
if (collected.length > 0) {
|
|
127
|
+
const result = await args.commandBus.execute(
|
|
128
|
+
"agent_orchestrator.artifact.capture",
|
|
129
|
+
{
|
|
130
|
+
input: {
|
|
131
|
+
tenantId: args.tenantId,
|
|
132
|
+
organizationId: args.organizationId,
|
|
133
|
+
runId: args.runId,
|
|
134
|
+
artifacts: collected
|
|
135
|
+
},
|
|
136
|
+
ctx: args.commandCtx
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
capturedCount = result.result.artifactIds.length;
|
|
140
|
+
}
|
|
141
|
+
return { capturedCount, skipped, failed };
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
collectArtifacts
|
|
145
|
+
};
|
|
146
|
+
//# sourceMappingURL=artifactCollector.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/artifactCollector.ts"],
|
|
4
|
+
"sourcesContent": ["import { createHash } from 'node:crypto'\nimport { readdir, readFile, stat } from 'node:fs/promises'\nimport path from 'node:path'\nimport type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport { putArtifactBytes, type MinimalContainer } from './artifactFileStore'\nimport type { CaptureArtifactsInput } from '../../commands/artifacts'\n\nconst logger = createLogger('agent_orchestrator').child({ component: 'artifact-collector' })\n\n/** Advisory artifact metadata the agent optionally declared via `submit_outcome`. */\nexport type AdvisoryArtifact = { path: string; caption?: string }\n\nexport type CollectArtifactsResult = {\n /** AgentRunArtifact rows created (deduped). */\n capturedCount: number\n /** Relative paths skipped over the size/count caps. */\n skipped: string[]\n /** Relative paths whose bytes could not be stored (fail-closed \u2192 not recorded). */\n failed: string[]\n}\n\nconst DEFAULT_MAX_BYTES = 26214400 // 25 MiB\nconst DEFAULT_MAX_COUNT = 20\n\nfunction resolveMaxBytes(): number {\n const raw = Number.parseInt(process.env.OM_AGENT_ARTIFACT_MAX_BYTES ?? '', 10)\n return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_MAX_BYTES\n}\n\nfunction resolveMaxCount(): number {\n const raw = Number.parseInt(process.env.OM_AGENT_ARTIFACT_MAX_COUNT ?? '', 10)\n return Number.isFinite(raw) && raw > 0 ? raw : DEFAULT_MAX_COUNT\n}\n\nconst MIME_BY_EXT: Record<string, string> = {\n '.pdf': 'application/pdf',\n '.csv': 'text/csv',\n '.txt': 'text/plain',\n '.md': 'text/markdown',\n '.json': 'application/json',\n '.xml': 'application/xml',\n '.html': 'text/html',\n '.htm': 'text/html',\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n '.docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n '.zip': 'application/zip',\n}\n\nfunction mimeForFile(fileName: string): string {\n return MIME_BY_EXT[path.extname(fileName).toLowerCase()] ?? 'application/octet-stream'\n}\n\n/** Sanitized, path-segment-free basename stored on the row (no directory traversal). */\nfunction safeBasename(fileName: string): string {\n return path.basename(fileName).replace(/[^a-zA-Z0-9_.-]+/g, '_').slice(0, 255)\n}\n\n/** Walk `outDir` recursively, returning file paths relative to it (POSIX-style). */\nasync function listFiles(outDir: string): Promise<string[]> {\n const found: string[] = []\n const walk = async (dir: string, rel: string): Promise<void> => {\n let entries\n try {\n entries = await readdir(dir, { withFileTypes: true })\n } catch {\n return\n }\n for (const entry of entries) {\n const childRel = rel ? `${rel}/${entry.name}` : entry.name\n if (entry.isDirectory()) {\n await walk(path.join(dir, entry.name), childRel)\n } else if (entry.isFile()) {\n found.push(childRel)\n }\n }\n }\n await walk(outDir, '')\n return found.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))\n}\n\n/**\n * Scan a completed run's sandbox `out/` dir and capture every new file as an\n * encrypted `AgentRunArtifact`. The FILESYSTEM is authoritative: advisory\n * `submit_outcome.artifacts[]` only contributes captions (matched by relative\n * path) \u2014 it can never invent a file that is not on disk. Fail-closed: a file\n * whose bytes cannot be durably stored is reported in `failed` and NOT recorded.\n * Best-effort overall \u2014 never throws into the run.\n */\nexport async function collectArtifacts(args: {\n commandBus: CommandBus\n commandCtx: CommandRuntimeContext\n outDir: string\n runId: string\n tenantId: string\n organizationId: string\n advisory?: AdvisoryArtifact[]\n}): Promise<CollectArtifactsResult> {\n const maxBytes = resolveMaxBytes()\n const maxCount = resolveMaxCount()\n const container = args.commandCtx.container as unknown as MinimalContainer\n const scope = { tenantId: args.tenantId, organizationId: args.organizationId }\n const captionByPath = new Map<string, string>()\n for (const advisory of args.advisory ?? []) {\n if (advisory.caption) captionByPath.set(advisory.path.replace(/^\\.?\\/+/, ''), advisory.caption)\n }\n\n const skipped: string[] = []\n const failed: string[] = []\n const collected: CaptureArtifactsInput['artifacts'] = []\n\n const relPaths = await listFiles(args.outDir)\n for (const rel of relPaths) {\n if (collected.length >= maxCount) {\n skipped.push(rel)\n continue\n }\n const abs = path.join(args.outDir, rel)\n let size: number\n try {\n size = (await stat(abs)).size\n } catch {\n continue\n }\n if (size > maxBytes) {\n skipped.push(rel)\n logger.warn('agent artifact exceeds OM_AGENT_ARTIFACT_MAX_BYTES; skipped', { artifact: rel, size })\n continue\n }\n let bytes: Buffer\n try {\n bytes = await readFile(abs)\n } catch {\n failed.push(rel)\n continue\n }\n const sha256 = createHash('sha256').update(bytes).digest('hex')\n const fileName = safeBasename(rel)\n const storageKey = await putArtifactBytes(container, scope, {\n buffer: bytes,\n fileName,\n mimeType: mimeForFile(fileName),\n })\n if (!storageKey) {\n failed.push(rel)\n continue\n }\n collected.push({\n fileName,\n mimeType: mimeForFile(fileName),\n fileSize: size,\n sha256,\n storageKey,\n caption: captionByPath.get(rel) ?? null,\n })\n }\n\n if (skipped.length > 0) {\n logger.warn('agent artifact capture skipped files over caps', {\n skippedCount: skipped.length,\n runId: args.runId,\n })\n }\n\n let capturedCount = 0\n if (collected.length > 0) {\n const result = await args.commandBus.execute<CaptureArtifactsInput, { artifactIds: string[] }>(\n 'agent_orchestrator.artifact.capture',\n {\n input: {\n tenantId: args.tenantId,\n organizationId: args.organizationId,\n runId: args.runId,\n artifacts: collected,\n },\n ctx: args.commandCtx,\n },\n )\n capturedCount = result.result.artifactIds.length\n }\n\n return { capturedCount, skipped, failed }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,SAAS,UAAU,YAAY;AACxC,OAAO,UAAU;AAEjB,SAAS,oBAAoB;AAC7B,SAAS,wBAA+C;AAGxD,MAAM,SAAS,aAAa,oBAAoB,EAAE,MAAM,EAAE,WAAW,qBAAqB,CAAC;AAc3F,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAE1B,SAAS,kBAA0B;AACjC,QAAM,MAAM,OAAO,SAAS,QAAQ,IAAI,+BAA+B,IAAI,EAAE;AAC7E,SAAO,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;AACjD;AAEA,SAAS,kBAA0B;AACjC,QAAM,MAAM,OAAO,SAAS,QAAQ,IAAI,+BAA+B,IAAI,EAAE;AAC7E,SAAO,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;AACjD;AAEA,MAAM,cAAsC;AAAA,EAC1C,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACV;AAEA,SAAS,YAAY,UAA0B;AAC7C,SAAO,YAAY,KAAK,QAAQ,QAAQ,EAAE,YAAY,CAAC,KAAK;AAC9D;AAGA,SAAS,aAAa,UAA0B;AAC9C,SAAO,KAAK,SAAS,QAAQ,EAAE,QAAQ,qBAAqB,GAAG,EAAE,MAAM,GAAG,GAAG;AAC/E;AAGA,eAAe,UAAU,QAAmC;AAC1D,QAAM,QAAkB,CAAC;AACzB,QAAM,OAAO,OAAO,KAAa,QAA+B;AAC9D,QAAI;AACJ,QAAI;AACF,gBAAU,MAAM,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;AAAA,IACtD,QAAQ;AACN;AAAA,IACF;AACA,eAAW,SAAS,SAAS;AAC3B,YAAM,WAAW,MAAM,GAAG,GAAG,IAAI,MAAM,IAAI,KAAK,MAAM;AACtD,UAAI,MAAM,YAAY,GAAG;AACvB,cAAM,KAAK,KAAK,KAAK,KAAK,MAAM,IAAI,GAAG,QAAQ;AAAA,MACjD,WAAW,MAAM,OAAO,GAAG;AACzB,cAAM,KAAK,QAAQ;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AACA,QAAM,KAAK,QAAQ,EAAE;AACrB,SAAO,MAAM,KAAK,CAAC,GAAG,MAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAE;AAC1D;AAUA,eAAsB,iBAAiB,MAQH;AAClC,QAAM,WAAW,gBAAgB;AACjC,QAAM,WAAW,gBAAgB;AACjC,QAAM,YAAY,KAAK,WAAW;AAClC,QAAM,QAAQ,EAAE,UAAU,KAAK,UAAU,gBAAgB,KAAK,eAAe;AAC7E,QAAM,gBAAgB,oBAAI,IAAoB;AAC9C,aAAW,YAAY,KAAK,YAAY,CAAC,GAAG;AAC1C,QAAI,SAAS,QAAS,eAAc,IAAI,SAAS,KAAK,QAAQ,WAAW,EAAE,GAAG,SAAS,OAAO;AAAA,EAChG;AAEA,QAAM,UAAoB,CAAC;AAC3B,QAAM,SAAmB,CAAC;AAC1B,QAAM,YAAgD,CAAC;AAEvD,QAAM,WAAW,MAAM,UAAU,KAAK,MAAM;AAC5C,aAAW,OAAO,UAAU;AAC1B,QAAI,UAAU,UAAU,UAAU;AAChC,cAAQ,KAAK,GAAG;AAChB;AAAA,IACF;AACA,UAAM,MAAM,KAAK,KAAK,KAAK,QAAQ,GAAG;AACtC,QAAI;AACJ,QAAI;AACF,cAAQ,MAAM,KAAK,GAAG,GAAG;AAAA,IAC3B,QAAQ;AACN;AAAA,IACF;AACA,QAAI,OAAO,UAAU;AACnB,cAAQ,KAAK,GAAG;AAChB,aAAO,KAAK,+DAA+D,EAAE,UAAU,KAAK,KAAK,CAAC;AAClG;AAAA,IACF;AACA,QAAI;AACJ,QAAI;AACF,cAAQ,MAAM,SAAS,GAAG;AAAA,IAC5B,QAAQ;AACN,aAAO,KAAK,GAAG;AACf;AAAA,IACF;AACA,UAAM,SAAS,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AAC9D,UAAM,WAAW,aAAa,GAAG;AACjC,UAAM,aAAa,MAAM,iBAAiB,WAAW,OAAO;AAAA,MAC1D,QAAQ;AAAA,MACR;AAAA,MACA,UAAU,YAAY,QAAQ;AAAA,IAChC,CAAC;AACD,QAAI,CAAC,YAAY;AACf,aAAO,KAAK,GAAG;AACf;AAAA,IACF;AACA,cAAU,KAAK;AAAA,MACb;AAAA,MACA,UAAU,YAAY,QAAQ;AAAA,MAC9B,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,SAAS,cAAc,IAAI,GAAG,KAAK;AAAA,IACrC,CAAC;AAAA,EACH;AAEA,MAAI,QAAQ,SAAS,GAAG;AACtB,WAAO,KAAK,kDAAkD;AAAA,MAC5D,cAAc,QAAQ;AAAA,MACtB,OAAO,KAAK;AAAA,IACd,CAAC;AAAA,EACH;AAEA,MAAI,gBAAgB;AACpB,MAAI,UAAU,SAAS,GAAG;AACxB,UAAM,SAAS,MAAM,KAAK,WAAW;AAAA,MACnC;AAAA,MACA;AAAA,QACE,OAAO;AAAA,UACL,UAAU,KAAK;AAAA,UACf,gBAAgB,KAAK;AAAA,UACrB,OAAO,KAAK;AAAA,UACZ,WAAW;AAAA,QACb;AAAA,QACA,KAAK,KAAK;AAAA,MACZ;AAAA,IACF;AACA,oBAAgB,OAAO,OAAO,YAAY;AAAA,EAC5C;AAEA,SAAO,EAAE,eAAe,SAAS,OAAO;AAC1C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
2
|
+
const logger = createLogger("agent_orchestrator").child({ component: "artifact-file-store" });
|
|
3
|
+
const AGENT_ARTIFACT_FILE_NAMESPACE = "agent-run-artifacts";
|
|
4
|
+
const ARTIFACT_BYTES_REF = { entityId: "agent_orchestrator:agent_run_artifact", field: "caption" };
|
|
5
|
+
function tryResolve(container, name) {
|
|
6
|
+
const hasRegistration = typeof container.hasRegistration === "function" ? container.hasRegistration.bind(container) : null;
|
|
7
|
+
if (hasRegistration && !hasRegistration(name)) return null;
|
|
8
|
+
try {
|
|
9
|
+
return container.resolve(name);
|
|
10
|
+
} catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async function resolveStorageService(container, scope) {
|
|
15
|
+
const proxy = tryResolve(container, "storageService");
|
|
16
|
+
if (!proxy || typeof proxy._resolveService !== "function") return null;
|
|
17
|
+
try {
|
|
18
|
+
return await proxy._resolveService(scope);
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function encryptWrapper(container, scope, base64) {
|
|
24
|
+
const enc = tryResolve(container, "tenantEncryptionService");
|
|
25
|
+
const payload = { [ARTIFACT_BYTES_REF.field]: base64 };
|
|
26
|
+
if (!enc || typeof enc.encryptEntityPayload !== "function") return payload;
|
|
27
|
+
return enc.encryptEntityPayload(ARTIFACT_BYTES_REF.entityId, payload, scope.tenantId, scope.organizationId);
|
|
28
|
+
}
|
|
29
|
+
async function decryptWrapper(container, scope, wrapper) {
|
|
30
|
+
const enc = tryResolve(container, "tenantEncryptionService");
|
|
31
|
+
if (!enc || typeof enc.decryptEntityPayload !== "function") {
|
|
32
|
+
const raw2 = wrapper[ARTIFACT_BYTES_REF.field];
|
|
33
|
+
return typeof raw2 === "string" ? raw2 : null;
|
|
34
|
+
}
|
|
35
|
+
const decrypted = await enc.decryptEntityPayload(
|
|
36
|
+
ARTIFACT_BYTES_REF.entityId,
|
|
37
|
+
wrapper,
|
|
38
|
+
scope.tenantId,
|
|
39
|
+
scope.organizationId
|
|
40
|
+
);
|
|
41
|
+
const raw = decrypted[ARTIFACT_BYTES_REF.field];
|
|
42
|
+
return typeof raw === "string" ? raw : null;
|
|
43
|
+
}
|
|
44
|
+
async function putArtifactBytes(container, scope, input) {
|
|
45
|
+
try {
|
|
46
|
+
const svc = await resolveStorageService(container, scope);
|
|
47
|
+
if (!svc) return null;
|
|
48
|
+
const wrapper = await encryptWrapper(container, scope, input.buffer.toString("base64"));
|
|
49
|
+
const { key } = await svc.upload({
|
|
50
|
+
namespace: AGENT_ARTIFACT_FILE_NAMESPACE,
|
|
51
|
+
fileName: `${input.fileName.replace(/[^a-zA-Z0-9_.-]+/g, "_")}.enc`,
|
|
52
|
+
buffer: Buffer.from(JSON.stringify(wrapper), "utf8"),
|
|
53
|
+
contentType: "application/octet-stream",
|
|
54
|
+
scope
|
|
55
|
+
});
|
|
56
|
+
return key || null;
|
|
57
|
+
} catch (error) {
|
|
58
|
+
logger.warn("artifact byte upload failed", {
|
|
59
|
+
error: error instanceof Error ? error.message : String(error)
|
|
60
|
+
});
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function getArtifactBytes(container, scope, storageKey) {
|
|
65
|
+
try {
|
|
66
|
+
const svc = await resolveStorageService(container, scope);
|
|
67
|
+
if (!svc) return null;
|
|
68
|
+
const { buffer } = await svc.download({ key: storageKey, scope });
|
|
69
|
+
const wrapper = JSON.parse(buffer.toString("utf8"));
|
|
70
|
+
const base64 = await decryptWrapper(container, scope, wrapper);
|
|
71
|
+
if (base64 == null) return null;
|
|
72
|
+
return Buffer.from(base64, "base64");
|
|
73
|
+
} catch (error) {
|
|
74
|
+
logger.warn("artifact byte fetch failed", {
|
|
75
|
+
error: error instanceof Error ? error.message : String(error)
|
|
76
|
+
});
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
AGENT_ARTIFACT_FILE_NAMESPACE,
|
|
82
|
+
getArtifactBytes,
|
|
83
|
+
putArtifactBytes
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=artifactFileStore.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/artifactFileStore.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Encrypted byte store for agent-produced file artifacts (file plane, #12).\n *\n * Sibling to `lib/trace/artifactStore.ts` (which offloads JSON trace payloads).\n * That store is JSON-payload-oriented; captured FILES are opaque bytes (a\n * generated PDF/CSV/XLSX, \u2264 `OM_AGENT_ARTIFACT_MAX_BYTES`), so this store base64-\n * wraps the buffer and encrypts it at rest through the tenant DEK before uploading\n * to `storage-s3`, then reverses that on read. The `AgentRunArtifact` row keeps the\n * returned `storageKey`, sha256, mime, and size; the bytes never touch the DB.\n *\n * Fail-CLOSED by contract (unlike the trace store's fail-open): a capture is only\n * recorded when the encrypted bytes are durably stored. When `storage-s3` is\n * unconfigured for the tenant or any step throws, `putArtifactBytes` returns\n * `null` and the collector marks the file capture failed rather than recording a\n * row that points at bytes that were never stored.\n */\n\nimport { createLogger } from '@open-mercato/shared/lib/logger'\n\nconst logger = createLogger('agent_orchestrator').child({ component: 'artifact-file-store' })\n\n/** The `storage_s3` namespace all captured file artifacts are written under. */\nexport const AGENT_ARTIFACT_FILE_NAMESPACE = 'agent-run-artifacts'\n\n/**\n * Encryption field reused to wrap the base64 blob. Points at the module's\n * declared `agent_run_artifact.caption` map (`encryption.ts`) so the DEK/algorithm\n * are the same the row's caption uses \u2014 no separate map is required.\n */\nconst ARTIFACT_BYTES_REF = { entityId: 'agent_orchestrator:agent_run_artifact', field: 'caption' } as const\n\nexport type ArtifactFileScope = { tenantId: string; organizationId: string }\n\ntype StorageTenantScope = {\n tenantId: string | null | undefined\n organizationId: string | null | undefined\n}\n\n// Structural types for the DI-resolved collaborators \u2014 the enterprise module\n// stays decoupled from `@open-mercato/storage-s3` and only uses the subset it needs.\ntype StorageServiceLike = {\n upload(input: {\n namespace: string\n fileName: string\n buffer: Buffer\n contentType?: string\n scope: StorageTenantScope\n }): Promise<{ key: string }>\n download(input: { key: string; scope: StorageTenantScope }): Promise<{ buffer: Buffer; contentType?: string }>\n}\n\ntype StorageProxyLike = {\n _resolveService(scope: StorageTenantScope): Promise<StorageServiceLike>\n}\n\ntype TenantEncryptionLike = {\n encryptEntityPayload(\n entityId: string,\n payload: Record<string, unknown>,\n tenantId: string | null | undefined,\n organizationId?: string | null,\n ): Promise<Record<string, unknown>>\n decryptEntityPayload(\n entityId: string,\n payload: Record<string, unknown>,\n tenantId: string | null | undefined,\n organizationId?: string | null,\n ): Promise<Record<string, unknown>>\n}\n\nexport type MinimalContainer = {\n resolve<T = unknown>(name: string): T\n hasRegistration?: (name: string) => boolean\n}\n\nfunction tryResolve<T>(container: MinimalContainer, name: string): T | null {\n const hasRegistration =\n typeof container.hasRegistration === 'function' ? container.hasRegistration.bind(container) : null\n if (hasRegistration && !hasRegistration(name)) return null\n try {\n return container.resolve<T>(name)\n } catch {\n return null\n }\n}\n\n/**\n * Resolve a credentials-bound storage service for the scope, or `null` when the\n * `storage_s3` module is absent or the tenant has no configured credentials\n * (`_resolveService` throws in that case \u2014 treated as \"storage unavailable\").\n */\nasync function resolveStorageService(\n container: MinimalContainer,\n scope: ArtifactFileScope,\n): Promise<StorageServiceLike | null> {\n const proxy = tryResolve<StorageProxyLike>(container, 'storageService')\n if (!proxy || typeof proxy._resolveService !== 'function') return null\n try {\n return await proxy._resolveService(scope)\n } catch {\n return null\n }\n}\n\n/** Wrap `{ caption: base64 }` and encrypt when encryption is available; else pass through. */\nasync function encryptWrapper(\n container: MinimalContainer,\n scope: ArtifactFileScope,\n base64: string,\n): Promise<Record<string, unknown>> {\n const enc = tryResolve<TenantEncryptionLike>(container, 'tenantEncryptionService')\n const payload = { [ARTIFACT_BYTES_REF.field]: base64 }\n if (!enc || typeof enc.encryptEntityPayload !== 'function') return payload\n return enc.encryptEntityPayload(ARTIFACT_BYTES_REF.entityId, payload, scope.tenantId, scope.organizationId)\n}\n\nasync function decryptWrapper(\n container: MinimalContainer,\n scope: ArtifactFileScope,\n wrapper: Record<string, unknown>,\n): Promise<string | null> {\n const enc = tryResolve<TenantEncryptionLike>(container, 'tenantEncryptionService')\n if (!enc || typeof enc.decryptEntityPayload !== 'function') {\n const raw = wrapper[ARTIFACT_BYTES_REF.field]\n return typeof raw === 'string' ? raw : null\n }\n const decrypted = await enc.decryptEntityPayload(\n ARTIFACT_BYTES_REF.entityId,\n wrapper,\n scope.tenantId,\n scope.organizationId,\n )\n const raw = decrypted[ARTIFACT_BYTES_REF.field]\n return typeof raw === 'string' ? raw : null\n}\n\n/**\n * Upload one artifact's bytes encrypted at rest and return its storage key, or\n * `null` when storage is unavailable or the write fails (fail-closed). Never throws.\n */\nexport async function putArtifactBytes(\n container: MinimalContainer,\n scope: ArtifactFileScope,\n input: { buffer: Buffer; fileName: string; mimeType?: string },\n): Promise<string | null> {\n try {\n const svc = await resolveStorageService(container, scope)\n if (!svc) return null\n const wrapper = await encryptWrapper(container, scope, input.buffer.toString('base64'))\n const { key } = await svc.upload({\n namespace: AGENT_ARTIFACT_FILE_NAMESPACE,\n fileName: `${input.fileName.replace(/[^a-zA-Z0-9_.-]+/g, '_')}.enc`,\n buffer: Buffer.from(JSON.stringify(wrapper), 'utf8'),\n contentType: 'application/octet-stream',\n scope,\n })\n return key || null\n } catch (error) {\n logger.warn('artifact byte upload failed', {\n error: error instanceof Error ? error.message : String(error),\n })\n return null\n }\n}\n\n/**\n * Download + decrypt a previously stored artifact's bytes, or `null` when storage\n * is unavailable or the read/decrypt fails. Never throws.\n */\nexport async function getArtifactBytes(\n container: MinimalContainer,\n scope: ArtifactFileScope,\n storageKey: string,\n): Promise<Buffer | null> {\n try {\n const svc = await resolveStorageService(container, scope)\n if (!svc) return null\n const { buffer } = await svc.download({ key: storageKey, scope })\n const wrapper = JSON.parse(buffer.toString('utf8')) as Record<string, unknown>\n const base64 = await decryptWrapper(container, scope, wrapper)\n if (base64 == null) return null\n return Buffer.from(base64, 'base64')\n } catch (error) {\n logger.warn('artifact byte fetch failed', {\n error: error instanceof Error ? error.message : String(error),\n })\n return null\n }\n}\n"],
|
|
5
|
+
"mappings": "AAiBA,SAAS,oBAAoB;AAE7B,MAAM,SAAS,aAAa,oBAAoB,EAAE,MAAM,EAAE,WAAW,sBAAsB,CAAC;AAGrF,MAAM,gCAAgC;AAO7C,MAAM,qBAAqB,EAAE,UAAU,yCAAyC,OAAO,UAAU;AA8CjG,SAAS,WAAc,WAA6B,MAAwB;AAC1E,QAAM,kBACJ,OAAO,UAAU,oBAAoB,aAAa,UAAU,gBAAgB,KAAK,SAAS,IAAI;AAChG,MAAI,mBAAmB,CAAC,gBAAgB,IAAI,EAAG,QAAO;AACtD,MAAI;AACF,WAAO,UAAU,QAAW,IAAI;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOA,eAAe,sBACb,WACA,OACoC;AACpC,QAAM,QAAQ,WAA6B,WAAW,gBAAgB;AACtE,MAAI,CAAC,SAAS,OAAO,MAAM,oBAAoB,WAAY,QAAO;AAClE,MAAI;AACF,WAAO,MAAM,MAAM,gBAAgB,KAAK;AAAA,EAC1C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGA,eAAe,eACb,WACA,OACA,QACkC;AAClC,QAAM,MAAM,WAAiC,WAAW,yBAAyB;AACjF,QAAM,UAAU,EAAE,CAAC,mBAAmB,KAAK,GAAG,OAAO;AACrD,MAAI,CAAC,OAAO,OAAO,IAAI,yBAAyB,WAAY,QAAO;AACnE,SAAO,IAAI,qBAAqB,mBAAmB,UAAU,SAAS,MAAM,UAAU,MAAM,cAAc;AAC5G;AAEA,eAAe,eACb,WACA,OACA,SACwB;AACxB,QAAM,MAAM,WAAiC,WAAW,yBAAyB;AACjF,MAAI,CAAC,OAAO,OAAO,IAAI,yBAAyB,YAAY;AAC1D,UAAMA,OAAM,QAAQ,mBAAmB,KAAK;AAC5C,WAAO,OAAOA,SAAQ,WAAWA,OAAM;AAAA,EACzC;AACA,QAAM,YAAY,MAAM,IAAI;AAAA,IAC1B,mBAAmB;AAAA,IACnB;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACA,QAAM,MAAM,UAAU,mBAAmB,KAAK;AAC9C,SAAO,OAAO,QAAQ,WAAW,MAAM;AACzC;AAMA,eAAsB,iBACpB,WACA,OACA,OACwB;AACxB,MAAI;AACF,UAAM,MAAM,MAAM,sBAAsB,WAAW,KAAK;AACxD,QAAI,CAAC,IAAK,QAAO;AACjB,UAAM,UAAU,MAAM,eAAe,WAAW,OAAO,MAAM,OAAO,SAAS,QAAQ,CAAC;AACtF,UAAM,EAAE,IAAI,IAAI,MAAM,IAAI,OAAO;AAAA,MAC/B,WAAW;AAAA,MACX,UAAU,GAAG,MAAM,SAAS,QAAQ,qBAAqB,GAAG,CAAC;AAAA,MAC7D,QAAQ,OAAO,KAAK,KAAK,UAAU,OAAO,GAAG,MAAM;AAAA,MACnD,aAAa;AAAA,MACb;AAAA,IACF,CAAC;AACD,WAAO,OAAO;AAAA,EAChB,SAAS,OAAO;AACd,WAAO,KAAK,+BAA+B;AAAA,MACzC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,IAC9D,CAAC;AACD,WAAO;AAAA,EACT;AACF;AAMA,eAAsB,iBACpB,WACA,OACA,YACwB;AACxB,MAAI;AACF,UAAM,MAAM,MAAM,sBAAsB,WAAW,KAAK;AACxD,QAAI,CAAC,IAAK,QAAO;AACjB,UAAM,EAAE,OAAO,IAAI,MAAM,IAAI,SAAS,EAAE,KAAK,YAAY,MAAM,CAAC;AAChE,UAAM,UAAU,KAAK,MAAM,OAAO,SAAS,MAAM,CAAC;AAClD,UAAM,SAAS,MAAM,eAAe,WAAW,OAAO,OAAO;AAC7D,QAAI,UAAU,KAAM,QAAO;AAC3B,WAAO,OAAO,KAAK,QAAQ,QAAQ;AAAA,EACrC,SAAS,OAAO;AACd,WAAO,KAAK,8BAA8B;AAAA,MACxC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,IAC9D,CAAC;AACD,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": ["raw"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { findOneWithDecryption } from "@open-mercato/shared/lib/encryption/find";
|
|
4
|
+
import { Attachment } from "@open-mercato/core/modules/attachments/data/entities";
|
|
5
|
+
import { OcrService } from "@open-mercato/core/modules/attachments/lib/ocrService";
|
|
6
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
7
|
+
const logger = createLogger("agent_orchestrator").child({ component: "attachment-stager" });
|
|
8
|
+
function safeName(name) {
|
|
9
|
+
const base = path.basename(name).replace(/[^a-zA-Z0-9_.-]+/g, "_").slice(0, 255);
|
|
10
|
+
return base || "input";
|
|
11
|
+
}
|
|
12
|
+
async function stageAttachments(args) {
|
|
13
|
+
if (args.files.attachments.length === 0) return [];
|
|
14
|
+
const factory = args.container.resolve("storageDriverFactory");
|
|
15
|
+
const scope = { tenantId: args.tenantId, organizationId: args.organizationId };
|
|
16
|
+
const staged = [];
|
|
17
|
+
for (const entry of args.files.attachments) {
|
|
18
|
+
const attachment = await findOneWithDecryption(
|
|
19
|
+
args.em,
|
|
20
|
+
Attachment,
|
|
21
|
+
{ id: entry.attachmentId, tenantId: args.tenantId, organizationId: args.organizationId },
|
|
22
|
+
void 0,
|
|
23
|
+
{ tenantId: args.tenantId, organizationId: args.organizationId }
|
|
24
|
+
);
|
|
25
|
+
if (!attachment) {
|
|
26
|
+
throw new Error(`[internal] attachment ${entry.attachmentId} not found in this tenant/org; cannot stage`);
|
|
27
|
+
}
|
|
28
|
+
const driver = await factory.resolveForPartition(attachment.partitionCode, scope);
|
|
29
|
+
const { buffer } = await driver.read(attachment.partitionCode, attachment.storagePath);
|
|
30
|
+
const fileName = safeName(entry.as ?? attachment.fileName);
|
|
31
|
+
const destPath = path.join(args.inDir, fileName);
|
|
32
|
+
await writeFile(destPath, buffer);
|
|
33
|
+
let hasSidecar = false;
|
|
34
|
+
if (entry.ocrText) {
|
|
35
|
+
let text = attachment.content ?? null;
|
|
36
|
+
if (!text) {
|
|
37
|
+
const ocr = new OcrService();
|
|
38
|
+
if (ocr.available) {
|
|
39
|
+
try {
|
|
40
|
+
const result = await ocr.processFile({ filePath: destPath, mimeType: attachment.mimeType });
|
|
41
|
+
text = result?.content ?? null;
|
|
42
|
+
} catch (err) {
|
|
43
|
+
logger.warn("OCR sidecar failed for attachment", {
|
|
44
|
+
attachmentId: entry.attachmentId,
|
|
45
|
+
error: err instanceof Error ? err.message : String(err)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (text) {
|
|
51
|
+
await writeFile(`${destPath}.txt`, text, "utf8");
|
|
52
|
+
hasSidecar = true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
staged.push({ fileName, hasSidecar });
|
|
56
|
+
}
|
|
57
|
+
return staged;
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
stageAttachments
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=attachmentStager.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/attachmentStager.ts"],
|
|
4
|
+
"sourcesContent": ["import { writeFile } from 'node:fs/promises'\nimport path from 'node:path'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport { findOneWithDecryption } from '@open-mercato/shared/lib/encryption/find'\nimport { Attachment } from '@open-mercato/core/modules/attachments/data/entities'\nimport { OcrService } from '@open-mercato/core/modules/attachments/lib/ocrService'\nimport { createLogger } from '@open-mercato/shared/lib/logger'\nimport type { AgentFileInput } from './fileInput'\n\nconst logger = createLogger('agent_orchestrator').child({ component: 'attachment-stager' })\n\n/**\n * Attachment-in staging (file plane, #12). Resolves the reserved `__files`\n * envelope's attachment ids under STRICT tenant+org scope, reads their bytes\n * through the attachments module's `StorageDriver`, and writes each into the run\n * sandbox `in/` dir (raw file + optional `<name>.txt` OCR sidecar). A staged file\n * is attacker-controllable, so it is treated as untrusted content: the sidecar\n * MUST reuse the existing OcrService only (never a sunsetted converter chain per\n * `.ai/lessons.md`), and any effect on domain state still flows through disposition.\n * A wrong-tenant / missing attachment THROWS \u2014 the run must fail rather than run\n * un-grounded on a file it could not read.\n */\n\ntype StorageDriverLike = {\n read(partitionCode: string, storagePath: string): Promise<{ buffer: Buffer; contentType?: string }>\n}\ntype StorageDriverFactoryLike = {\n resolveForPartition(\n partitionCode: string,\n scope: { tenantId: string; organizationId: string },\n ): Promise<StorageDriverLike>\n}\ntype MinimalContainer = { resolve<T = unknown>(name: string): T }\n\nexport type StagedInput = { fileName: string; hasSidecar: boolean }\n\n/** Path-segment-free basename so a staged file can never escape the sandbox `in/` dir. */\nfunction safeName(name: string): string {\n const base = path.basename(name).replace(/[^a-zA-Z0-9_.-]+/g, '_').slice(0, 255)\n return base || 'input'\n}\n\nexport async function stageAttachments(args: {\n container: MinimalContainer\n em: EntityManager\n files: AgentFileInput\n inDir: string\n tenantId: string\n organizationId: string\n}): Promise<StagedInput[]> {\n if (args.files.attachments.length === 0) return []\n const factory = args.container.resolve<StorageDriverFactoryLike>('storageDriverFactory')\n const scope = { tenantId: args.tenantId, organizationId: args.organizationId }\n const staged: StagedInput[] = []\n\n for (const entry of args.files.attachments) {\n const attachment = await findOneWithDecryption(\n args.em,\n Attachment,\n { id: entry.attachmentId, tenantId: args.tenantId, organizationId: args.organizationId },\n undefined,\n { tenantId: args.tenantId, organizationId: args.organizationId },\n )\n if (!attachment) {\n throw new Error(`[internal] attachment ${entry.attachmentId} not found in this tenant/org; cannot stage`)\n }\n\n const driver = await factory.resolveForPartition(attachment.partitionCode, scope)\n const { buffer } = await driver.read(attachment.partitionCode, attachment.storagePath)\n const fileName = safeName(entry.as ?? attachment.fileName)\n const destPath = path.join(args.inDir, fileName)\n await writeFile(destPath, buffer)\n\n let hasSidecar = false\n if (entry.ocrText) {\n let text: string | null = attachment.content ?? null\n if (!text) {\n const ocr = new OcrService()\n if (ocr.available) {\n try {\n const result = await ocr.processFile({ filePath: destPath, mimeType: attachment.mimeType })\n text = result?.content ?? null\n } catch (err) {\n logger.warn('OCR sidecar failed for attachment', {\n attachmentId: entry.attachmentId,\n error: err instanceof Error ? err.message : String(err),\n })\n }\n }\n }\n if (text) {\n await writeFile(`${destPath}.txt`, text, 'utf8')\n hasSidecar = true\n }\n }\n staged.push({ fileName, hasSidecar })\n }\n\n return staged\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAC1B,OAAO,UAAU;AAEjB,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAG7B,MAAM,SAAS,aAAa,oBAAoB,EAAE,MAAM,EAAE,WAAW,oBAAoB,CAAC;AA4B1F,SAAS,SAAS,MAAsB;AACtC,QAAM,OAAO,KAAK,SAAS,IAAI,EAAE,QAAQ,qBAAqB,GAAG,EAAE,MAAM,GAAG,GAAG;AAC/E,SAAO,QAAQ;AACjB;AAEA,eAAsB,iBAAiB,MAOZ;AACzB,MAAI,KAAK,MAAM,YAAY,WAAW,EAAG,QAAO,CAAC;AACjD,QAAM,UAAU,KAAK,UAAU,QAAkC,sBAAsB;AACvF,QAAM,QAAQ,EAAE,UAAU,KAAK,UAAU,gBAAgB,KAAK,eAAe;AAC7E,QAAM,SAAwB,CAAC;AAE/B,aAAW,SAAS,KAAK,MAAM,aAAa;AAC1C,UAAM,aAAa,MAAM;AAAA,MACvB,KAAK;AAAA,MACL;AAAA,MACA,EAAE,IAAI,MAAM,cAAc,UAAU,KAAK,UAAU,gBAAgB,KAAK,eAAe;AAAA,MACvF;AAAA,MACA,EAAE,UAAU,KAAK,UAAU,gBAAgB,KAAK,eAAe;AAAA,IACjE;AACA,QAAI,CAAC,YAAY;AACf,YAAM,IAAI,MAAM,yBAAyB,MAAM,YAAY,6CAA6C;AAAA,IAC1G;AAEA,UAAM,SAAS,MAAM,QAAQ,oBAAoB,WAAW,eAAe,KAAK;AAChF,UAAM,EAAE,OAAO,IAAI,MAAM,OAAO,KAAK,WAAW,eAAe,WAAW,WAAW;AACrF,UAAM,WAAW,SAAS,MAAM,MAAM,WAAW,QAAQ;AACzD,UAAM,WAAW,KAAK,KAAK,KAAK,OAAO,QAAQ;AAC/C,UAAM,UAAU,UAAU,MAAM;AAEhC,QAAI,aAAa;AACjB,QAAI,MAAM,SAAS;AACjB,UAAI,OAAsB,WAAW,WAAW;AAChD,UAAI,CAAC,MAAM;AACT,cAAM,MAAM,IAAI,WAAW;AAC3B,YAAI,IAAI,WAAW;AACjB,cAAI;AACF,kBAAM,SAAS,MAAM,IAAI,YAAY,EAAE,UAAU,UAAU,UAAU,WAAW,SAAS,CAAC;AAC1F,mBAAO,QAAQ,WAAW;AAAA,UAC5B,SAAS,KAAK;AACZ,mBAAO,KAAK,qCAAqC;AAAA,cAC/C,cAAc,MAAM;AAAA,cACpB,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAAA,YACxD,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AACA,UAAI,MAAM;AACR,cAAM,UAAU,GAAG,QAAQ,QAAQ,MAAM,MAAM;AAC/C,qBAAa;AAAA,MACf;AAAA,IACF;AACA,WAAO,KAAK,EAAE,UAAU,WAAW,CAAC;AAAA,EACtC;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
class AgentNotFoundError extends Error {
|
|
2
|
+
constructor(agentId) {
|
|
3
|
+
super(`[internal] unknown agent id "${agentId}"`);
|
|
4
|
+
this.code = "agent_not_found";
|
|
5
|
+
this.name = "AgentNotFoundError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class AgentRunTimeoutError extends Error {
|
|
9
|
+
constructor(agentId, timeoutMs) {
|
|
10
|
+
super(`[internal] agent "${agentId}" run exceeded the ${timeoutMs}ms wall-clock deadline`);
|
|
11
|
+
this.code = "agent_run_timeout";
|
|
12
|
+
this.name = "AgentRunTimeoutError";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class AgentOutputInvalidError extends Error {
|
|
16
|
+
constructor(agentId, detail) {
|
|
17
|
+
super(`[internal] agent "${agentId}" produced output failing its result schema: ${detail}`);
|
|
18
|
+
this.code = "agent_output_invalid";
|
|
19
|
+
this.name = "AgentOutputInvalidError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class AgentGuardrailBlockedError extends AgentOutputInvalidError {
|
|
23
|
+
constructor(agentId, detail, reason) {
|
|
24
|
+
super(agentId, detail);
|
|
25
|
+
this.code = "agent_guardrail_blocked";
|
|
26
|
+
this.name = "AgentGuardrailBlockedError";
|
|
27
|
+
this.phase = reason.phase;
|
|
28
|
+
this.kind = reason.kind;
|
|
29
|
+
this.guardrailSetVersion = reason.guardrailSetVersion;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
AgentGuardrailBlockedError,
|
|
34
|
+
AgentNotFoundError,
|
|
35
|
+
AgentOutputInvalidError,
|
|
36
|
+
AgentRunTimeoutError
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/errors.ts"],
|
|
4
|
+
"sourcesContent": ["import type { GuardrailKindInput, GuardrailPhaseInput } from '../../data/validators'\n\n/**\n * Typed agent-run error classes, extracted from `agentRuntime.ts` so both the\n * dispatch service and the `NativeAgentRunner` can import them without a\n * circular module edge. `agentRuntime.ts` re-exports every class, so existing\n * `from './agentRuntime'` / package-index imports are unchanged (BC).\n */\n\nexport class AgentNotFoundError extends Error {\n readonly code = 'agent_not_found'\n constructor(agentId: string) {\n super(`[internal] unknown agent id \"${agentId}\"`)\n this.name = 'AgentNotFoundError'\n }\n}\n\n/**\n * The in-process wall-clock deadline (`OM_AGENT_RUN_TIMEOUT_MS`, default 5 min \u2014\n * symmetric with the OpenCode runner's `OM_OPENCODE_RUN_TIMEOUT_MS`) expired\n * before the model finished. The run is already marked failed via `failRun`\n * when this is thrown. Deterministic for a given deadline \u2014 NOT retryable.\n */\nexport class AgentRunTimeoutError extends Error {\n readonly code = 'agent_run_timeout'\n constructor(agentId: string, timeoutMs: number) {\n super(`[internal] agent \"${agentId}\" run exceeded the ${timeoutMs}ms wall-clock deadline`)\n this.name = 'AgentRunTimeoutError'\n }\n}\n\nexport class AgentOutputInvalidError extends Error {\n readonly code: string = 'agent_output_invalid'\n constructor(agentId: string, detail: string) {\n super(`[internal] agent \"${agentId}\" produced output failing its result schema: ${detail}`)\n this.name = 'AgentOutputInvalidError'\n }\n}\n\n/**\n * A runtime guardrail `block` verdict. Carries the typed reason\n * `{ phase, kind, guardrailSetVersion }` so the workflow can route to retry /\n * escalate / USER_TASK. The schema-kind block subclasses AgentOutputInvalidError\n * to preserve the existing fail semantics callers/tests rely on (a schema-invalid\n * output is still an AgentOutputInvalidError).\n */\nexport class AgentGuardrailBlockedError extends AgentOutputInvalidError {\n override readonly code: string = 'agent_guardrail_blocked'\n readonly phase: GuardrailPhaseInput\n readonly kind: GuardrailKindInput\n readonly guardrailSetVersion: string\n constructor(\n agentId: string,\n detail: string,\n reason: { phase: GuardrailPhaseInput; kind: GuardrailKindInput; guardrailSetVersion: string },\n ) {\n super(agentId, detail)\n this.name = 'AgentGuardrailBlockedError'\n this.phase = reason.phase\n this.kind = reason.kind\n this.guardrailSetVersion = reason.guardrailSetVersion\n }\n}\n"],
|
|
5
|
+
"mappings": "AASO,MAAM,2BAA2B,MAAM;AAAA,EAE5C,YAAY,SAAiB;AAC3B,UAAM,gCAAgC,OAAO,GAAG;AAFlD,SAAS,OAAO;AAGd,SAAK,OAAO;AAAA,EACd;AACF;AAQO,MAAM,6BAA6B,MAAM;AAAA,EAE9C,YAAY,SAAiB,WAAmB;AAC9C,UAAM,qBAAqB,OAAO,sBAAsB,SAAS,wBAAwB;AAF3F,SAAS,OAAO;AAGd,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,gCAAgC,MAAM;AAAA,EAEjD,YAAY,SAAiB,QAAgB;AAC3C,UAAM,qBAAqB,OAAO,gDAAgD,MAAM,EAAE;AAF5F,SAAS,OAAe;AAGtB,SAAK,OAAO;AAAA,EACd;AACF;AASO,MAAM,mCAAmC,wBAAwB;AAAA,EAKtE,YACE,SACA,QACA,QACA;AACA,UAAM,SAAS,MAAM;AATvB,SAAkB,OAAe;AAU/B,SAAK,OAAO;AACZ,SAAK,QAAQ,OAAO;AACpB,SAAK,OAAO,OAAO;AACnB,SAAK,sBAAsB,OAAO;AAAA,EACpC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isEffectWithinVocabulary,
|
|
3
|
+
loadActionVocabulary
|
|
4
|
+
} from "./actionVocabulary.js";
|
|
5
|
+
async function executeProposal(actions, ctx) {
|
|
6
|
+
const results = [];
|
|
7
|
+
const vocabulary = ctx.vocabulary ?? await loadActionVocabulary();
|
|
8
|
+
for (const action of actions) {
|
|
9
|
+
const commandId = ctx.actionCommandMap[action.type];
|
|
10
|
+
if (!commandId) {
|
|
11
|
+
results.push({ type: action.type, status: "skipped", reason: `no command mapped for action type "${action.type}"` });
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (!isEffectWithinVocabulary(vocabulary, action.type, commandId, ctx.allowedActions)) {
|
|
15
|
+
results.push({
|
|
16
|
+
type: action.type,
|
|
17
|
+
status: "skipped",
|
|
18
|
+
reason: `action type "${action.type}" is outside the effective action vocabulary`
|
|
19
|
+
});
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const { result } = await ctx.commandBus.execute(commandId, {
|
|
24
|
+
input: action.payload,
|
|
25
|
+
ctx: ctx.commandCtx
|
|
26
|
+
});
|
|
27
|
+
results.push({ type: action.type, status: "ok", result });
|
|
28
|
+
} catch (err) {
|
|
29
|
+
results.push({ type: action.type, status: "error", error: err instanceof Error ? err.message : String(err) });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return results;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
executeProposal
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=executeProposal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/executeProposal.ts"],
|
|
4
|
+
"sourcesContent": ["import type { CommandBus, CommandRuntimeContext } from '@open-mercato/shared/lib/commands'\nimport type { ProposedAction } from '../../data/validators'\nimport {\n isEffectWithinVocabulary,\n loadActionVocabulary,\n type ActionVocabulary,\n} from './actionVocabulary'\n\nexport type ExecuteProposalCtx = {\n commandBus: CommandBus\n commandCtx: CommandRuntimeContext\n /**\n * Maps a proposed action `type` to the OM command id that effects it. Callers\n * (area 03 disposition) supply this so each action runs through the audited\n * command runner (audit/events/index fire). Actions whose type has no mapping\n * are returned as `skipped`.\n */\n actionCommandMap: Record<string, string>\n /**\n * Pre-resolved action vocabulary. Callers running many proposals may load it once;\n * omitted, it is read per call. Never widen it \u2014 it is the catalogue, not a grant.\n */\n vocabulary?: ActionVocabulary\n /**\n * The proposing agent's narrowed vocabulary (`AgentRegistryEntry.allowedActions`).\n * Omitted/null means the agent declared no narrowing and is bounded by the catalogue\n * alone; an EMPTY list denies every action, which is what a declaration whose entries\n * were all dropped at registration must mean.\n */\n allowedActions?: readonly string[] | null\n}\n\nexport type ExecuteProposalActionResult =\n | { type: string; status: 'ok'; result: unknown }\n | { type: string; status: 'skipped'; reason: string }\n | { type: string; status: 'error'; error: string }\n\n/**\n * Optional helper: run a proposal's actions through OM Commands, audited.\n * Callers that gate proposals (area 03) call this only AFTER disposition; the\n * playground never auto-executes. Disposition (area 03) may instead run\n * effectors as workflow activities \u2014 this helper is not mandatory in the MVP.\n */\nexport async function executeProposal(\n actions: ProposedAction[],\n ctx: ExecuteProposalCtx,\n): Promise<ExecuteProposalActionResult[]> {\n const results: ExecuteProposalActionResult[] = []\n // Server-side vocabulary re-check, immediately before the effect. The proposal may\n // have been made under a catalogue the tenant has since narrowed; a stale approval\n // must not carry an effect the platform no longer declares runnable.\n const vocabulary = ctx.vocabulary ?? (await loadActionVocabulary())\n for (const action of actions) {\n const commandId = ctx.actionCommandMap[action.type]\n if (!commandId) {\n results.push({ type: action.type, status: 'skipped', reason: `no command mapped for action type \"${action.type}\"` })\n continue\n }\n if (!isEffectWithinVocabulary(vocabulary, action.type, commandId, ctx.allowedActions)) {\n results.push({\n type: action.type,\n status: 'skipped',\n reason: `action type \"${action.type}\" is outside the effective action vocabulary`,\n })\n continue\n }\n try {\n const { result } = await ctx.commandBus.execute(commandId, {\n input: action.payload,\n ctx: ctx.commandCtx,\n })\n results.push({ type: action.type, status: 'ok', result })\n } catch (err) {\n results.push({ type: action.type, status: 'error', error: err instanceof Error ? err.message : String(err) })\n }\n }\n return results\n}\n"],
|
|
5
|
+
"mappings": "AAEA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AAqCP,eAAsB,gBACpB,SACA,KACwC;AACxC,QAAM,UAAyC,CAAC;AAIhD,QAAM,aAAa,IAAI,cAAe,MAAM,qBAAqB;AACjE,aAAW,UAAU,SAAS;AAC5B,UAAM,YAAY,IAAI,iBAAiB,OAAO,IAAI;AAClD,QAAI,CAAC,WAAW;AACd,cAAQ,KAAK,EAAE,MAAM,OAAO,MAAM,QAAQ,WAAW,QAAQ,sCAAsC,OAAO,IAAI,IAAI,CAAC;AACnH;AAAA,IACF;AACA,QAAI,CAAC,yBAAyB,YAAY,OAAO,MAAM,WAAW,IAAI,cAAc,GAAG;AACrF,cAAQ,KAAK;AAAA,QACX,MAAM,OAAO;AAAA,QACb,QAAQ;AAAA,QACR,QAAQ,gBAAgB,OAAO,IAAI;AAAA,MACrC,CAAC;AACD;AAAA,IACF;AACA,QAAI;AACF,YAAM,EAAE,OAAO,IAAI,MAAM,IAAI,WAAW,QAAQ,WAAW;AAAA,QACzD,OAAO,OAAO;AAAA,QACd,KAAK,IAAI;AAAA,MACX,CAAC;AACD,cAAQ,KAAK,EAAE,MAAM,OAAO,MAAM,QAAQ,MAAM,OAAO,CAAC;AAAA,IAC1D,SAAS,KAAK;AACZ,cAAQ,KAAK,EAAE,MAAM,OAAO,MAAM,QAAQ,SAAS,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAE,CAAC;AAAA,IAC9G;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const byAgent = /* @__PURE__ */ new Map();
|
|
2
|
+
function registerAgentSkills(agentId, skills) {
|
|
3
|
+
if (skills.length === 0) {
|
|
4
|
+
byAgent.delete(agentId);
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const map = /* @__PURE__ */ new Map();
|
|
8
|
+
for (const skill of skills) map.set(skill.id, skill);
|
|
9
|
+
byAgent.set(agentId, map);
|
|
10
|
+
}
|
|
11
|
+
function getAgentSkill(agentId, skillId) {
|
|
12
|
+
return byAgent.get(agentId)?.get(skillId);
|
|
13
|
+
}
|
|
14
|
+
function listAgentSkillIds(agentId) {
|
|
15
|
+
const map = byAgent.get(agentId);
|
|
16
|
+
return map ? [...map.keys()] : [];
|
|
17
|
+
}
|
|
18
|
+
function getAgentSkillScript(agentId, skillId, scriptName) {
|
|
19
|
+
const skill = byAgent.get(agentId)?.get(skillId);
|
|
20
|
+
return skill?.scripts?.find((script) => script.name === scriptName);
|
|
21
|
+
}
|
|
22
|
+
function clearAgentSkills() {
|
|
23
|
+
byAgent.clear();
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
clearAgentSkills,
|
|
27
|
+
getAgentSkill,
|
|
28
|
+
getAgentSkillScript,
|
|
29
|
+
listAgentSkillIds,
|
|
30
|
+
registerAgentSkills
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=fileAgentSkills.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/fileAgentSkills.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * In-process registry of agent-local skill content (Phase 3), keyed by agent id\n * then skill id. The `load_skill` MCP tool reads from this map at runtime to\n * return a skill's instructions/template/examples on demand (progressive\n * disclosure), WITHOUT touching the filesystem \u2014 the content is persisted in the\n * committed manifest (`generated/file-agents.generated.ts`) and registered here by\n * `ensureAgentsLoaded()` at load time.\n *\n * The native OpenCode SKILL.md files are the primary delivery path; this map +\n * `load_skill` is the fallback, and also the only carrier for TEMPLATE.md /\n * examples that native skills may not bundle.\n */\n\n/**\n * One executable script carried as plain data (Phase 5). `name` is the script\n * file's basename without extension (e.g. `scripts/score.ts` \u2192 `score`); `source`\n * is the raw TS/JS source, run server-side in the Code Mode `isolated-vm`\n * sandbox by the `run_skill_script` MCP tool \u2014 NEVER copied to the OpenCode\n * container. The script is a pure function of its `args` (no fs/net/imports).\n */\nexport type SkillScript = {\n name: string\n source: string\n}\n\nexport type SkillContent = {\n id: string\n instructions: string\n template?: string\n examples: string[]\n tools: string[]\n /** Sandboxed helper scripts (`skills/<id>/scripts/*.ts`), Phase 5. */\n scripts?: SkillScript[]\n}\n\nconst byAgent = new Map<string, Map<string, SkillContent>>()\n\n/**\n * Register the skill content for one agent. Idempotent: re-registering an agent\n * replaces its skill set (a re-`ensureAgentsLoaded` should never duplicate).\n */\nexport function registerAgentSkills(agentId: string, skills: SkillContent[]): void {\n if (skills.length === 0) {\n byAgent.delete(agentId)\n return\n }\n const map = new Map<string, SkillContent>()\n for (const skill of skills) map.set(skill.id, skill)\n byAgent.set(agentId, map)\n}\n\n/** Resolve one skill's content for an agent, or undefined when not allowed/known. */\nexport function getAgentSkill(agentId: string, skillId: string): SkillContent | undefined {\n return byAgent.get(agentId)?.get(skillId)\n}\n\n/** List the allowed skill ids for an agent (the set the agent may `load_skill`). */\nexport function listAgentSkillIds(agentId: string): string[] {\n const map = byAgent.get(agentId)\n return map ? [...map.keys()] : []\n}\n\n/**\n * Resolve one named script of one skill for an agent (Phase 5), or undefined when\n * the agent/skill/script is unknown. The active agent + skill set are resolved\n * from the per-run correlation store by the `run_skill_script` tool BEFORE this\n * lookup, so this only confirms the script exists in that allowed skill.\n */\nexport function getAgentSkillScript(\n agentId: string,\n skillId: string,\n scriptName: string,\n): SkillScript | undefined {\n const skill = byAgent.get(agentId)?.get(skillId)\n return skill?.scripts?.find((script) => script.name === scriptName)\n}\n\n/** Test/reset seam: clear all registered skill content. */\nexport function clearAgentSkills(): void {\n byAgent.clear()\n}\n"],
|
|
5
|
+
"mappings": "AAmCA,MAAM,UAAU,oBAAI,IAAuC;AAMpD,SAAS,oBAAoB,SAAiB,QAA8B;AACjF,MAAI,OAAO,WAAW,GAAG;AACvB,YAAQ,OAAO,OAAO;AACtB;AAAA,EACF;AACA,QAAM,MAAM,oBAAI,IAA0B;AAC1C,aAAW,SAAS,OAAQ,KAAI,IAAI,MAAM,IAAI,KAAK;AACnD,UAAQ,IAAI,SAAS,GAAG;AAC1B;AAGO,SAAS,cAAc,SAAiB,SAA2C;AACxF,SAAO,QAAQ,IAAI,OAAO,GAAG,IAAI,OAAO;AAC1C;AAGO,SAAS,kBAAkB,SAA2B;AAC3D,QAAM,MAAM,QAAQ,IAAI,OAAO;AAC/B,SAAO,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC;AAClC;AAQO,SAAS,oBACd,SACA,SACA,YACyB;AACzB,QAAM,QAAQ,QAAQ,IAAI,OAAO,GAAG,IAAI,OAAO;AAC/C,SAAO,OAAO,SAAS,KAAK,CAAC,WAAW,OAAO,SAAS,UAAU;AACpE;AAGO,SAAS,mBAAyB;AACvC,UAAQ,MAAM;AAChB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const agentFileInputSchema = z.object({
|
|
3
|
+
attachments: z.array(
|
|
4
|
+
z.object({
|
|
5
|
+
attachmentId: z.string().uuid(),
|
|
6
|
+
/** Override the staged filename (defaults to the attachment's file name). */
|
|
7
|
+
as: z.string().max(255).optional(),
|
|
8
|
+
/** Also stage a `<name>.txt` OCR/text sidecar next to the raw file. */
|
|
9
|
+
ocrText: z.boolean().optional()
|
|
10
|
+
})
|
|
11
|
+
).max(20)
|
|
12
|
+
}).strict();
|
|
13
|
+
const FILE_INPUT_ENVELOPE_KEY = "__files";
|
|
14
|
+
function extractFileInput(input) {
|
|
15
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) return { input, files: null };
|
|
16
|
+
const record = input;
|
|
17
|
+
if (!(FILE_INPUT_ENVELOPE_KEY in record)) return { input, files: null };
|
|
18
|
+
const { [FILE_INPUT_ENVELOPE_KEY]: rawEnvelope, ...business } = record;
|
|
19
|
+
const parsed = agentFileInputSchema.safeParse(rawEnvelope);
|
|
20
|
+
return { input: business, files: parsed.success ? parsed.data : null };
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
FILE_INPUT_ENVELOPE_KEY,
|
|
24
|
+
agentFileInputSchema,
|
|
25
|
+
extractFileInput
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=fileInput.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/modules/agent_orchestrator/lib/runtime/fileInput.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\n/**\n * Reserved runtime input envelope for staging attachment files INTO a file-agent's\n * sandbox (file plane, #12). Carried on a reserved `__files` key OUTSIDE the agent's\n * business `input` schema, so the agent's typed contract stays clean. The runner\n * extracts and strips it before building the model message \u2014 it is never forwarded\n * as business data. Inputs are attachment OBJECT IDS only (never inline bytes or raw\n * storage keys), so the attachments module's storage routing, RBAC, and OCR apply.\n */\nexport const agentFileInputSchema = z\n .object({\n attachments: z\n .array(\n z.object({\n attachmentId: z.string().uuid(),\n /** Override the staged filename (defaults to the attachment's file name). */\n as: z.string().max(255).optional(),\n /** Also stage a `<name>.txt` OCR/text sidecar next to the raw file. */\n ocrText: z.boolean().optional(),\n }),\n )\n .max(20),\n })\n .strict()\n\nexport type AgentFileInput = z.infer<typeof agentFileInputSchema>\n\n/** Reserved envelope key on a run's input: `input.__files?: AgentFileInput`. */\nexport const FILE_INPUT_ENVELOPE_KEY = '__files' as const\n\n/**\n * Split a run input into its business part (envelope stripped) and the parsed\n * `__files` envelope (or null when absent/invalid). Non-object inputs (e.g. a bare\n * string prompt) pass through unchanged with no envelope.\n */\nexport function extractFileInput(input: unknown): { input: unknown; files: AgentFileInput | null } {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return { input, files: null }\n const record = input as Record<string, unknown>\n if (!(FILE_INPUT_ENVELOPE_KEY in record)) return { input, files: null }\n const { [FILE_INPUT_ENVELOPE_KEY]: rawEnvelope, ...business } = record\n const parsed = agentFileInputSchema.safeParse(rawEnvelope)\n return { input: business, files: parsed.success ? parsed.data : null }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAUX,MAAM,uBAAuB,EACjC,OAAO;AAAA,EACN,aAAa,EACV;AAAA,IACC,EAAE,OAAO;AAAA,MACP,cAAc,EAAE,OAAO,EAAE,KAAK;AAAA;AAAA,MAE9B,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA;AAAA,MAEjC,SAAS,EAAE,QAAQ,EAAE,SAAS;AAAA,IAChC,CAAC;AAAA,EACH,EACC,IAAI,EAAE;AACX,CAAC,EACA,OAAO;AAKH,MAAM,0BAA0B;AAOhC,SAAS,iBAAiB,OAAkE;AACjG,MAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,EAAG,QAAO,EAAE,OAAO,OAAO,KAAK;AAC7F,QAAM,SAAS;AACf,MAAI,EAAE,2BAA2B,QAAS,QAAO,EAAE,OAAO,OAAO,KAAK;AACtE,QAAM,EAAE,CAAC,uBAAuB,GAAG,aAAa,GAAG,SAAS,IAAI;AAChE,QAAM,SAAS,qBAAqB,UAAU,WAAW;AACzD,SAAO,EAAE,OAAO,UAAU,OAAO,OAAO,UAAU,OAAO,OAAO,KAAK;AACvE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|