agentworkshop 0.11.3 → 0.12.0
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/.AgentWorkShop/prompts/host-tools.json +4 -4
- package/.output/.AgentWorkShop/prompts/host-tools.json +4 -4
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{DXXBGPAc.js → CsdezMu9.js} +4 -4
- package/.output/public/_nuxt/WL1R8lPA.js +1 -0
- package/.output/public/_nuxt/_id_.Czwkl50w.css +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/577f464e-672a-4c4e-a3c8-dc8c1b38930d.json +1 -0
- package/.output/server/chunks/_/access.mjs +1 -1
- package/.output/server/chunks/_/candidate-store.mjs +1 -1
- package/.output/server/chunks/_/catalog-view.mjs +1 -1
- package/.output/server/chunks/_/character-asset.repo.mjs +1 -1
- package/.output/server/chunks/_/data-export.mjs +6 -6
- package/.output/server/chunks/_/data-query.mjs +3 -3
- package/.output/server/chunks/_/eda-run.repo.mjs +2 -2
- package/.output/server/chunks/_/entity.mjs +1 -1
- package/.output/server/chunks/_/features.mjs +5 -5
- package/.output/server/chunks/_/golden.mjs +3 -3
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/index.mjs +1 -1
- package/.output/server/chunks/_/line-scope.mjs +1 -1
- package/.output/server/chunks/_/mes-console.mjs +1 -1
- package/.output/server/chunks/_/mes-secrets.repo.mjs +1 -1
- package/.output/server/chunks/_/mes-templates.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +4070 -2343
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/ocap.mjs +1 -1
- package/.output/server/chunks/_/orchestrator.mjs +1 -1
- package/.output/server/chunks/_/promote.mjs +1 -1
- package/.output/server/chunks/_/rest-auth.mjs +1 -1
- package/.output/server/chunks/_/runtime.mjs +8 -8
- package/.output/server/chunks/_/scene-layout.repo.mjs +1 -1
- package/.output/server/chunks/_/spc.mjs +1 -1
- package/.output/server/chunks/_/validator.mjs +1 -1
- package/.output/server/chunks/build/TownView-DD1zY8xq.mjs +1 -1
- package/.output/server/chunks/build/{_id_-C0vNEbts.mjs → _id_-B9zi8WEg.mjs} +23 -12
- package/.output/server/chunks/build/_id_-B9zi8WEg.mjs.map +1 -0
- package/.output/server/chunks/build/_wsId_-LDv5SEW_.mjs +1 -1
- package/.output/server/chunks/build/daq-B5zlUIlb.mjs +1 -1
- package/.output/server/chunks/build/dcw-B-eoU7sq.mjs +1 -1
- package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
- package/.output/server/chunks/build/useDaqAddNode-Dr5CfMpU.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailNode-DDq5osE-.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailParams-DdOcUvHG.mjs +1 -1
- package/.output/server/chunks/build/useDaqFilters-Y_NRhP6i.mjs +1 -1
- package/.output/server/chunks/build/useDaqStream-phwM5tIN.mjs +1 -1
- package/.output/server/chunks/build/useDaqTemplates-lKw2b01d.mjs +1 -1
- package/.output/server/chunks/build/useDcwAddNode-CT-oOFom.mjs +1 -1
- package/.output/server/chunks/build/useDcwStream-CNtMGcR0.mjs +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
- package/.output/server/chunks/routes/api/system/backup/run.post.mjs +2 -2
- package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -2
- package/.output/server/chunks/routes/api/system/shutdown.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +7 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id/preview.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/datasets/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/env/recheck.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/env/uv.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/env/venv.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/cancel.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/logs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id/retry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/jobs/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/predict.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/models/_id/promote.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/models/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/models/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id/train.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/training-plans/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/training-plans/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/aml/twin/providers.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/analysis/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/analysis/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/analysis/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/execution-mode.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/harness-profiles/promote.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/improvement-proposals/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index11.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index2.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index5.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index7.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/line.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/join.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId/promote.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/merge.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/products.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/products.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/tool-usage.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/tools/reset.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/twin-profile.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels.post.mjs +7 -7
- package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/bindings.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/storage/retention.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/storage/rollup.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/storage.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/bindings.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index5.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/index8.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/lines/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/mes-artifacts/file.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/mes-hook-test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/mes-test-read.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id/read.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id/write.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/params/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/revert.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/dcw/recipes/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/commonality.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index6.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/vm/predict.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/exp/confirmations/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/exp/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index12.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index13.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index14.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index6.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/bridge.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/experiments.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/activate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/approvals/_aid/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/archive.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/channels/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/complete.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/continue.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/_did/waive.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/deliverables/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index6.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/index8.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/kernel/tick.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/ledger.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/members/_userId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/observability/activity.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/observability/route.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/observability/work-items/_wid_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/observability.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/pause.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/plan/request-approval.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/proposals/_decisionId/apply.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/reconcile.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/report.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/request-acceptance.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/review.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/submit.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/results/_rid/supersede.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/resume.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/sessions.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/snapshot.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/terminate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/trace/_traceId_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/cancel.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/dispatch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/_wid/retry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id/work-items/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/projects/instantiate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/recovery-disposition.post.mjs +44 -0
- package/.output/server/chunks/routes/api/workshop/tasks/_id/recovery-disposition.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/tasks/recovery-holds.get.mjs +38 -0
- package/.output/server/chunks/routes/api/workshop/tasks/recovery-holds.get.mjs.map +1 -0
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/ws/ticket.post.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +2 -2
- package/.output/server/chunks/virtual/entry.mjs +6 -2
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/README-zh.md +7 -7
- package/README.md +7 -7
- package/app/components/dcw/DcwNodesTable.vue +24 -0
- package/docs/mcp.en.md +30 -27
- package/docs/mcp.md +7 -3
- package/docs/plugins.en.md +4 -2
- package/docs/plugins.md +4 -2
- package/i18n/dicts/dcwDetail.json +221 -219
- package/i18n/locales/en.ts +2 -0
- package/i18n/locales/zh-CN.ts +2 -0
- package/package.json +2 -1
- package/scripts/check-docs-sync.mjs +20 -9
- package/scripts/onboarding/forge-channel.mjs +2 -1
- package/scripts/onboarding/lib.mjs +159 -3
- package/scripts/onboarding/onboard.mjs +2 -0
- package/scripts/onboarding/preflight.mjs +233 -231
- package/scripts/onboarding/provision-line.mjs +12 -2
- package/scripts/onboarding/sim-attest.mjs +103 -0
- package/scripts/onboarding/sim-twin.mjs +88 -4
- package/scripts/onboarding/test-connection.mjs +2 -1
- package/scripts/onboarding/v6-protected-api.mjs +41 -0
- package/scripts/onboarding/v6-protected-fixture.mjs +54 -0
- package/scripts/onboarding/verify-line.mjs +179 -136
- package/scripts/onboarding/verify-mirror.mjs +149 -145
- package/server/api/workshop/agent-tools/list.get.ts +10 -1
- package/server/api/workshop/tasks/[id]/recovery-disposition.post.ts +32 -0
- package/server/api/workshop/tasks/recovery-holds.get.ts +22 -0
- package/server/plugins-builtin/rag-bridge/index.mjs +20 -2
- package/server/services/workshop/agents/agent-interface.ts +3 -0
- package/server/services/workshop/agents/base-agent.ts +100 -4
- package/server/services/workshop/agents/execution-scope.ts +26 -0
- package/server/services/workshop/agents/hitl-capabilities.ts +3 -3
- package/server/services/workshop/agents/host-tool-bridge/dispatch.ts +42 -2
- package/server/services/workshop/agents/host-tool-bridge/tools/progress.ts +4 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/tasks.ts +11 -28
- package/server/services/workshop/agents/host-tool-bridge/tools/team-delegation.ts +83 -129
- package/server/services/workshop/agents/industrial/dcw-tools.ts +27 -5
- package/server/services/workshop/agents/industrial/line-tools.ts +15 -4
- package/server/services/workshop/agents/industrial/ops-tools.ts +32 -6
- package/server/services/workshop/agents/industrial/optimization-tools.ts +16 -3
- package/server/services/workshop/agents/industrial/recipe-propose-tools.ts +26 -3
- package/server/services/workshop/agents/omp-agent/client.ts +2 -4
- package/server/services/workshop/agents/omp-agent/core.ts +3 -0
- package/server/services/workshop/agents/omp-agent/lifecycle.ts +70 -4
- package/server/services/workshop/agents/omp-agent/supervision-decision.ts +3 -1
- package/server/services/workshop/agents/omp-agent/tools-steer.ts +113 -32
- package/server/services/workshop/agents/tool-approvals.ts +113 -29
- package/server/services/workshop/agents/tool-classes.ts +72 -56
- package/server/services/workshop/db/database/open.ts +5 -2
- package/server/services/workshop/db/database/schema.ts +1 -0
- package/server/services/workshop/db/database/seed.ts +2 -2
- package/server/services/workshop/db/message.repo.ts +134 -26
- package/server/services/workshop/db/project-kernel.repo.ts +3 -3
- package/server/services/workshop/db/schema.sql +3 -1
- package/server/services/workshop/db/task.repo.ts +101 -0
- package/server/services/workshop/dcw/dcw-controller/actuation.ts +120 -9
- package/server/services/workshop/dcw/dcw-controller/contracts.ts +18 -16
- package/server/services/workshop/dcw/dcw-controller/crud.ts +23 -0
- package/server/services/workshop/dcw/dcw-controller/lines.ts +34 -2
- package/server/services/workshop/dcw/dcw-controller/recipes.ts +80 -6
- package/server/services/workshop/dcw/dcw-controller/state.ts +89 -88
- package/server/services/workshop/dcw/dcw-controller/types.ts +5 -0
- package/server/services/workshop/dcw/dcw-controller/write.ts +9 -6
- package/server/services/workshop/dcw/dcw-line.repo.ts +2 -0
- package/server/services/workshop/dcw/dcw-node.repo.ts +3 -1
- package/server/services/workshop/dcw/dcw-node.ts +346 -307
- package/server/services/workshop/dcw/dcw-runtime.ts +8 -4
- package/server/services/workshop/projects/effects.ts +47 -29
- package/server/services/workshop/projects/kernel.ts +8 -1
- package/server/services/workshop/projects/legacy-recovery.ts +36 -0
- package/server/services/workshop/projects/service.ts +15 -0
- package/server/services/workshop/runtime/agent-runtime/contracts.ts +1 -1
- package/server/services/workshop/runtime/agent-runtime/lifecycle.ts +7 -2
- package/server/services/workshop/runtime/agent-runtime/message-watchdog.ts +40 -0
- package/server/services/workshop/runtime/agent-runtime/message.ts +151 -21
- package/server/services/workshop/runtime/agent-runtime/state.ts +69 -13
- package/server/services/workshop/runtime/agent-runtime/supervise.ts +219 -42
- package/server/services/workshop/runtime/agent-runtime/types.ts +6 -0
- package/server/services/workshop/runtime/mailbox.ts +112 -21
- package/server/services/workshop/runtime/manager/admin-channel.ts +34 -22
- package/server/services/workshop/runtime/manager/host-tools.ts +18 -5
- package/server/services/workshop/runtime/manager/runtime-wiring.ts +101 -41
- package/server/services/workshop/runtime/manager/schedules.ts +3 -1
- package/server/services/workshop/runtime/manager/tasks.ts +41 -0
- package/server/services/workshop/runtime/memory/recall.ts +11 -4
- package/server/services/workshop/runtime/memory/types.ts +2 -0
- package/server/services/workshop/runtime/scheduler-loop/contracts.ts +29 -29
- package/server/services/workshop/runtime/scheduler-loop/execute.ts +7 -0
- package/server/services/workshop/runtime/scheduler-loop/rules.ts +3 -0
- package/server/services/workshop/runtime/scheduler-loop/snapshot.ts +10 -2
- package/server/services/workshop/runtime/scheduler-loop/state.ts +12 -0
- package/server/services/workshop/runtime/scheduler-loop/tick.ts +54 -5
- package/server/services/workshop/runtime/task-engine/create.ts +16 -0
- package/server/services/workshop/runtime/task-engine/helpers.ts +5 -0
- package/server/services/workshop/runtime/task-engine/legacy-recovery.ts +149 -0
- package/server/services/workshop/runtime/task-engine/lifecycle.ts +38 -1
- package/server/services/workshop/runtime/task-engine/transition.ts +4 -0
- package/server/services/workshop/runtime/task-engine/update.ts +6 -0
- package/server/services/workshop/runtime/task-engine/views.ts +61 -0
- package/shared/dcw-protocol/line.ts +4 -0
- package/.output/public/_nuxt/C8QlHux5.js +0 -1
- package/.output/public/_nuxt/_id_.0EnzA0aA.css +0 -1
- package/.output/public/_nuxt/builds/meta/846b9c03-1442-4fcb-b3fc-1d9484eaa41b.json +0 -1
- package/.output/server/chunks/build/_id_-C0vNEbts.mjs.map +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Trusted server-side scope for one turn. Task lease fields are present only
|
|
5
|
+
* when a validated assignment or supervision root supplies them.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExecutionScope {
|
|
8
|
+
readonly taskId?: string
|
|
9
|
+
readonly agentId: string
|
|
10
|
+
readonly channelId: string
|
|
11
|
+
readonly assignmentGeneration?: number
|
|
12
|
+
readonly executionLeaseId?: string
|
|
13
|
+
readonly signal: AbortSignal
|
|
14
|
+
readonly assertActive: () => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const storage = new AsyncLocalStorage<ExecutionScope | undefined>()
|
|
18
|
+
|
|
19
|
+
export function currentExecutionScope(): ExecutionScope | undefined {
|
|
20
|
+
return storage.getStore()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function runWithExecutionScope<T>(scope: ExecutionScope | undefined, fn: () => T): T {
|
|
24
|
+
// An unscoped call must not inherit the caller's ambient authority.
|
|
25
|
+
return storage.run(scope, fn)
|
|
26
|
+
}
|
|
@@ -169,9 +169,9 @@ export const DECLARATIONS: Record<string, HitlDeclaration> = {
|
|
|
169
169
|
providerKind: 'dcw-approval',
|
|
170
170
|
facets: { approval: true, question: false, multiQuestion: false, structuredResponse: false, cancel: true },
|
|
171
171
|
evidence: [
|
|
172
|
-
'server/services/workshop/agents/tool-approvals.ts:
|
|
173
|
-
'server/services/workshop/agents/tool-approvals.ts:
|
|
174
|
-
'server/services/workshop/agents/tool-approvals.ts:
|
|
172
|
+
'server/services/workshop/agents/tool-approvals.ts:156 getHitlRegistry',
|
|
173
|
+
'server/services/workshop/agents/tool-approvals.ts:301 decide',
|
|
174
|
+
'server/services/workshop/agents/tool-approvals.ts:359 cancelPendingFor',
|
|
175
175
|
],
|
|
176
176
|
unsupportedReason: '数控下发审批只有批准/拒绝二值,无提问通道(question=false)',
|
|
177
177
|
},
|
|
@@ -42,6 +42,33 @@ import { PROJECT_GATED_WRITE_TOOL_NAMES, PROJECT_TOOL_NAMES } from '../../projec
|
|
|
42
42
|
import { dispatchProjectTool } from '../../projects/tools'
|
|
43
43
|
import { getProjectService } from '../../projects/service'
|
|
44
44
|
import { projectExecutionGate } from '../../projects/execution-gate'
|
|
45
|
+
import { currentExecutionScope, runWithExecutionScope, type ExecutionScope } from '../execution-scope'
|
|
46
|
+
|
|
47
|
+
/** A peer turn has no task lease, so its writes must honor the channel hold. */
|
|
48
|
+
export function peerWriteScope(scope: ExecutionScope, identity: HostToolBridgeContext['identity']): ExecutionScope {
|
|
49
|
+
const assertActive = () => {
|
|
50
|
+
scope.assertActive()
|
|
51
|
+
if (!identity.channelId || scope.channelId !== identity.channelId || scope.agentId !== identity.agentId) {
|
|
52
|
+
throw new Error('LEGACY_EXECUTION_RECOVERY_STATUS_UNAVAILABLE: agent turn identity does not match channel')
|
|
53
|
+
}
|
|
54
|
+
let held: unknown
|
|
55
|
+
try {
|
|
56
|
+
// getTaskEngine is protected in TypeScript, but is the manager's shared runtime engine.
|
|
57
|
+
const manager = globalThis.__workshopManager as unknown as { getTaskEngine?: () => { hasLegacyRecoveryHold?: (channelId: string) => boolean } } | undefined
|
|
58
|
+
const engine = manager?.getTaskEngine?.()
|
|
59
|
+
if (typeof engine?.hasLegacyRecoveryHold !== 'function') throw new Error('recovery status unavailable')
|
|
60
|
+
held = engine.hasLegacyRecoveryHold(identity.channelId)
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
throw new Error('LEGACY_EXECUTION_RECOVERY_STATUS_UNAVAILABLE: cannot verify channel recovery status')
|
|
64
|
+
}
|
|
65
|
+
if (held !== false) {
|
|
66
|
+
if (held === true) throw new Error('LEGACY_EXECUTION_RECOVERY_REQUIRED: channel requires operator investigation before agent writes')
|
|
67
|
+
throw new Error('LEGACY_EXECUTION_RECOVERY_STATUS_UNAVAILABLE: invalid channel recovery status')
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return Object.freeze({ ...scope, assertActive })
|
|
71
|
+
}
|
|
45
72
|
|
|
46
73
|
/**
|
|
47
74
|
* 分发一次 host tool 调用(全引擎唯一入口):
|
|
@@ -72,8 +99,21 @@ export async function dispatchHostTool(ctx: HostToolBridgeContext, req: HostTool
|
|
|
72
99
|
// 活性打点先于一切校验:被拒的工具调用同样证明 agent 在推进(不是死锁)
|
|
73
100
|
noteToolActivity(ctx.identity.agentId)
|
|
74
101
|
try {
|
|
75
|
-
return await withGovernanceHarnessToolAudit(ctx, req, activeRootTaskId, async () =>
|
|
76
|
-
|
|
102
|
+
return await withGovernanceHarnessToolAudit(ctx, req, activeRootTaskId, async () => {
|
|
103
|
+
const scope = currentExecutionScope()
|
|
104
|
+
if (scope && !scope.taskId && OBSERVE_BLOCKED_TOOL_NAMES.has(req.toolName)) {
|
|
105
|
+
const guarded = peerWriteScope(scope, ctx.identity)
|
|
106
|
+
try {
|
|
107
|
+
guarded.assertActive()
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return { text: error instanceof Error ? error.message : String(error), isError: true }
|
|
111
|
+
}
|
|
112
|
+
return runWithExecutionScope(guarded, async () =>
|
|
113
|
+
truncateToolResult(await dispatchHostToolInner(ctx, req, activeRootTaskId), req.toolName))
|
|
114
|
+
}
|
|
115
|
+
return truncateToolResult(await dispatchHostToolInner(ctx, req, activeRootTaskId), req.toolName)
|
|
116
|
+
})
|
|
77
117
|
}
|
|
78
118
|
catch (error) {
|
|
79
119
|
if (!(error instanceof GovernanceHarnessAuditError)) throw error
|
|
@@ -7,6 +7,7 @@ import type { AgentWorkspace } from '../../agent-interface'
|
|
|
7
7
|
import type { A2AArtifact } from '../../../types/a2a'
|
|
8
8
|
import type { GoalCompletionVerifier } from '../../../verify/goal-completion'
|
|
9
9
|
import type { HostToolResult, HostToolSessionState } from '../types'
|
|
10
|
+
import { currentExecutionScope } from '../../execution-scope'
|
|
10
11
|
|
|
11
12
|
export async function handleReportProgress(
|
|
12
13
|
args: Record<string, unknown>,
|
|
@@ -34,6 +35,7 @@ export async function handleReportProgress(
|
|
|
34
35
|
isError: true,
|
|
35
36
|
}
|
|
36
37
|
}
|
|
38
|
+
currentExecutionScope()?.assertActive()
|
|
37
39
|
await ws.reportTask({ taskId, progress, message })
|
|
38
40
|
return { text: `进度已上报: ${progress}%${message ? ` (${message})` : ''}` }
|
|
39
41
|
}
|
|
@@ -120,6 +122,7 @@ export async function handleCompleteTask(
|
|
|
120
122
|
parts: [{ text: deliverable ?? summary }],
|
|
121
123
|
})
|
|
122
124
|
}
|
|
125
|
+
currentExecutionScope()?.assertActive()
|
|
123
126
|
await ws.completeTask(taskId, artifacts)
|
|
124
127
|
state.currentTaskId = null
|
|
125
128
|
// 完成即衔接:报告队列余量与下一项(状态同步 + 驱动继续处理)
|
|
@@ -150,6 +153,7 @@ export async function handleSupersedeTask(
|
|
|
150
153
|
if (!taskId || !replacementTaskId) {
|
|
151
154
|
return { text: '参数缺失:需要 task_id(失败/取消的分支任务)与 replacement_task_id(覆盖其工作的替代任务)', isError: true }
|
|
152
155
|
}
|
|
156
|
+
currentExecutionScope()?.assertActive()
|
|
153
157
|
const superseded = await ws.supersedeTask(taskId, replacementTaskId, reason)
|
|
154
158
|
return {
|
|
155
159
|
text: `分支「${superseded.title}」(${superseded.state})已标记为被 ${replacementTaskId.slice(0, 8)} 替代,不再阻塞父任务收口。失败事实保留在任务记录中;现在可对父任务检查交付并 complete_task。`,
|
|
@@ -7,6 +7,7 @@ import type { AgentWorkspace } from '../../agent-interface'
|
|
|
7
7
|
import type { WorkspaceTask } from '../../../types/task'
|
|
8
8
|
import { TERMINAL_TASK_STATES } from '../../../types/task'
|
|
9
9
|
import { extractTaskMode } from '../../../runtime/execution-mode'
|
|
10
|
+
import { currentExecutionScope } from '../../execution-scope'
|
|
10
11
|
import type { HostToolBridgeContext, HostToolResult, HostToolSessionState } from '../types'
|
|
11
12
|
|
|
12
13
|
export async function handleSubmitTask(args: Record<string, unknown>, state: HostToolSessionState, ws: AgentWorkspace): Promise<HostToolResult> {
|
|
@@ -52,11 +53,15 @@ export async function handleDispatchTask(args: Record<string, unknown>, ws: Agen
|
|
|
52
53
|
}
|
|
53
54
|
parentTaskId = activeRootTaskId
|
|
54
55
|
}
|
|
56
|
+
const rawGrant = args.grant_node_ids ?? args.grantNodeIds
|
|
57
|
+
if (rawGrant != null) {
|
|
58
|
+
return {
|
|
59
|
+
text: '未派发:随任务授权暂不可用,因为授权与任务派发无法原子提交。请先单独确认并授予节点权限,再不带 grant_node_ids 派发任务。',
|
|
60
|
+
isError: true,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
// 重复派发守卫(真实场景实测:lead 模型可能对同一目标重复派发,引发协调风暴):
|
|
56
64
|
// 同父任务下已存在同标题非终态子任务 → 不再创建,直接指路既有任务。
|
|
57
|
-
// 2026-10-30 前移到授权之前:原顺序先落库 grant_node_ids 再判重,判重命中时授权
|
|
58
|
-
// (grant_mode=auto 还会摘除逐次人工审批)已生效却无任务上下文 —— 悬空授权面,
|
|
59
|
-
// 且 lead 每次重复派发尝试都会重放授权,把偶发幻觉放大成常态越权面。
|
|
60
65
|
const dup = await ws.listTasks()
|
|
61
66
|
const existing = dup.find(t =>
|
|
62
67
|
t.parentId === parentTaskId
|
|
@@ -67,36 +72,14 @@ export async function handleDispatchTask(args: Record<string, unknown>, ws: Agen
|
|
|
67
72
|
text: `未创建:同父任务下已存在同标题进行中子任务 ${existing.id}("${existing.title}",state=${existing.state},assignee=${existing.assigneeId})。请勿重复派发;若需跟进请对该任务 notify 或 reassign。`,
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
|
-
// 派发时随任务授予节点权限(lead 专属;grant_node_ids ⊆ lead 自身绑定面,fail-closed):
|
|
71
|
-
// 任一节点不满足则整单拒绝,任务不创建 —— 避免 worker 拿到任务却没有节点权限的半途态。
|
|
72
|
-
let grantNote = ''
|
|
73
|
-
let grantedNodeIds: string[] = []
|
|
74
|
-
const rawGrant = args.grant_node_ids ?? args.grantNodeIds
|
|
75
|
-
if (rawGrant != null && identity) {
|
|
76
|
-
const { grantNodesForDispatch } = await import('./team-delegation')
|
|
77
|
-
const grantNodeIds = (Array.isArray(rawGrant) ? rawGrant : String(rawGrant).split(',')).map(x => String(x ?? '').trim()).filter(Boolean)
|
|
78
|
-
if (!grantNodeIds.length) return { text: 'grant_node_ids 为空:要么不传,要么给出至少一个节点 id。', isError: true }
|
|
79
|
-
const grantMode = args.grant_mode === 'manual' || args.grant_mode === 'auto' ? (args.grant_mode as 'auto' | 'manual') : undefined
|
|
80
|
-
const grant = await grantNodesForDispatch(identity, assigneeId, grantNodeIds, grantMode, ws, args.grant_confirm)
|
|
81
|
-
if (!grant.ok) return { text: `未派发:${grant.text}\n请先用 team_grant_nodes 确认你持有这些节点,或修正 node id 后重试。`, isError: true }
|
|
82
|
-
grantedNodeIds = grantNodeIds
|
|
83
|
-
grantNote = `\n${grant.text}`
|
|
84
|
-
}
|
|
85
75
|
try {
|
|
76
|
+
currentExecutionScope()?.assertActive()
|
|
86
77
|
const task = await ws.dispatchTask({ assigneeId, title, description, parentTaskId, routeReason })
|
|
87
|
-
return { text: `子任务 ${task.id} 已创建并指派 → ${assigneeId}(父任务 ${parentTaskId ?? '无'},标题: ${title}${routeReason ? `,路由理由: ${routeReason}` : ''})
|
|
78
|
+
return { text: `子任务 ${task.id} 已创建并指派 → ${assigneeId}(父任务 ${parentTaskId ?? '无'},标题: ${title}${routeReason ? `,路由理由: ${routeReason}` : ''})` }
|
|
88
79
|
}
|
|
89
80
|
catch (err) {
|
|
90
|
-
// 2026-10-30 修复(授权-任务绑定不变量):manager 侧判重 409/父任务终态/harness
|
|
91
|
-
// 不可用/预算超限等拒绝发生在授权落库之后 —— 任务没创建,节点授权已生效。
|
|
92
|
-
// 失败即回滚本轮授权再如实回报,杜绝「派发失败留下无任务授权」。
|
|
93
|
-
if (grantedNodeIds.length && identity) {
|
|
94
|
-
const { revokeNodesForDispatchRollback } = await import('./team-delegation')
|
|
95
|
-
const revoked = await revokeNodesForDispatchRollback(identity, assigneeId, grantedNodeIds, ws)
|
|
96
|
-
grantNote = revoked > 0 ? `\n(派发失败,已回滚本轮 ${revoked} 条随单授权)` : '\n(派发失败;随单授权回滚未完成,请用 team_revoke_nodes 手工核销)'
|
|
97
|
-
}
|
|
98
81
|
const msg = err instanceof Error ? err.message : String(err)
|
|
99
|
-
return { text: `未派发:${msg}
|
|
82
|
+
return { text: `未派发:${msg}`, isError: true }
|
|
100
83
|
}
|
|
101
84
|
}
|
|
102
85
|
|
|
@@ -1,129 +1,83 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 团队节点权限委派工具(lead 专属):team_grant_nodes / team_revoke_nodes。
|
|
3
|
-
*
|
|
4
|
-
* lead 把**自己已绑定**的 DAQ/DCW 节点授权给同频道 worker(派发前、执行中均可),
|
|
5
|
-
* 授权面不可超越 lead 本人的绑定面(planDelegation fail-closed 校验)。
|
|
6
|
-
* 校验核心在 agents/node-delegation.ts;本文件只做工具面参数解析与结果文本。
|
|
7
|
-
*/
|
|
8
|
-
import { AppError } from '../../../../../utils/errors'
|
|
9
|
-
import { applyDelegation, planDelegation, revokeDelegation, type DelegationMember } from '../../node-delegation'
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* 派发时随任务授予节点(dispatch_task 的 grant_node_ids;lead 专属)。
|
|
88
|
-
* fail-closed:任一节点不在 lead 绑定面 → 整单失败,任务不创建。
|
|
89
|
-
*/
|
|
90
|
-
export async function grantNodesForDispatch(identity: HostToolBridgeContext['identity'], assigneeId: string, nodeIds: string[], mode: 'auto' | 'manual' | undefined, ws: MembersView, confirm?: unknown): Promise<DispatchGrantResult> {
|
|
91
|
-
try {
|
|
92
|
-
const plan = planDelegation({
|
|
93
|
-
leaderAgentId: identity.agentId,
|
|
94
|
-
channelId: identity.channelId,
|
|
95
|
-
targetAgentId: assigneeId,
|
|
96
|
-
nodeIds,
|
|
97
|
-
members: await membersOf(ws),
|
|
98
|
-
mode,
|
|
99
|
-
// B-P1-3:随任务授予同样不得绕过 auto 的显式确认(dispatch_task.grant_confirm)
|
|
100
|
-
confirm,
|
|
101
|
-
})
|
|
102
|
-
const bindings = applyDelegation(plan, identity.agentId)
|
|
103
|
-
return { ok: true, text: `随任务授予 ${bindings.length} 条节点授权 → ${assigneeId}${summaryText(bindings)}` }
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
106
|
-
const msg = err instanceof AppError ? err.message : `随任务授予节点失败: ${err instanceof Error ? err.message : String(err)}`
|
|
107
|
-
return { ok: false, text: msg }
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* 2026-10-30 新增:dispatch 失败回滚 —— 尽力撤销 grantNodesForDispatch 刚落库的授权。
|
|
113
|
-
* 授权-任务绑定不变量:任务没创建,授权不得残留(尤其 grant_mode=auto 摘过人工审批的)。
|
|
114
|
-
* 返回实际撤销条数;任何异常按 0 处理(调用方如实标注"请手工核销")。
|
|
115
|
-
*/
|
|
116
|
-
export async function revokeNodesForDispatchRollback(identity: HostToolBridgeContext['identity'], assigneeId: string, nodeIds: string[], ws: MembersView): Promise<number> {
|
|
117
|
-
try {
|
|
118
|
-
const results = revokeDelegation({
|
|
119
|
-
leaderAgentId: identity.agentId,
|
|
120
|
-
targetAgentId: assigneeId,
|
|
121
|
-
nodeIds,
|
|
122
|
-
members: await membersOf(ws),
|
|
123
|
-
})
|
|
124
|
-
return results.filter(r => r.revoked).length
|
|
125
|
-
}
|
|
126
|
-
catch {
|
|
127
|
-
return 0
|
|
128
|
-
}
|
|
129
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 团队节点权限委派工具(lead 专属):team_grant_nodes / team_revoke_nodes。
|
|
3
|
+
*
|
|
4
|
+
* lead 把**自己已绑定**的 DAQ/DCW 节点授权给同频道 worker(派发前、执行中均可),
|
|
5
|
+
* 授权面不可超越 lead 本人的绑定面(planDelegation fail-closed 校验)。
|
|
6
|
+
* 校验核心在 agents/node-delegation.ts;本文件只做工具面参数解析与结果文本。
|
|
7
|
+
*/
|
|
8
|
+
import { AppError } from '../../../../../utils/errors'
|
|
9
|
+
import { applyDelegation, planDelegation, revokeDelegation, type DelegationMember } from '../../node-delegation'
|
|
10
|
+
import { currentExecutionScope } from '../../execution-scope'
|
|
11
|
+
import type { HostToolBridgeContext, HostToolResult } from '../types'
|
|
12
|
+
|
|
13
|
+
/** workspace 成员视图(listAgents 与本工具面的最小接口;便于单测桩替换) */
|
|
14
|
+
interface MembersView {
|
|
15
|
+
listAgents(): Promise<Array<{ id: string, role: 'lead' | 'worker', enabled?: number }>>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function membersOf(ws: MembersView): Promise<DelegationMember[]> {
|
|
19
|
+
return ws.listAgents() as Promise<DelegationMember[]>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function summaryText(bindings: Array<{ nodeId: string, kind: string, mode: string }>): string {
|
|
23
|
+
const kindLabel: Record<string, string> = { 'daq': '数采', 'dcw': '写控', 'line-recipe': '产线配方管理' }
|
|
24
|
+
const lines = bindings.map(b => ` - ${kindLabel[b.kind] ?? b.kind} ${b.nodeId}(mode=${b.mode})`)
|
|
25
|
+
return `\n${lines.join('\n')}`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function parseNodeIds(args: Record<string, unknown>): string[] {
|
|
29
|
+
const raw = args.node_ids ?? args.nodeIds
|
|
30
|
+
const list = Array.isArray(raw) ? raw : String(raw ?? '').split(',')
|
|
31
|
+
return list.map(x => String(x ?? '').trim()).filter(Boolean)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** lead → worker 授予节点(自己绑定面内的节点;fail-closed 全成全败) */
|
|
35
|
+
export async function handleGrantNodes(identity: HostToolBridgeContext['identity'], args: Record<string, unknown>, ws: MembersView): Promise<HostToolResult> {
|
|
36
|
+
const targetAgentId = String(args.agent_id ?? args.assignee_id ?? '').trim()
|
|
37
|
+
const nodeIds = parseNodeIds(args)
|
|
38
|
+
const mode = args.mode === 'manual' || args.mode === 'auto' ? (args.mode as 'auto' | 'manual') : undefined
|
|
39
|
+
try {
|
|
40
|
+
const plan = planDelegation({
|
|
41
|
+
leaderAgentId: identity.agentId,
|
|
42
|
+
channelId: identity.channelId,
|
|
43
|
+
targetAgentId,
|
|
44
|
+
nodeIds,
|
|
45
|
+
members: await membersOf(ws),
|
|
46
|
+
mode,
|
|
47
|
+
// B-P1-3:mode=auto 摘除逐次人工审批,须显式风险确认(与 REST 同语义)
|
|
48
|
+
confirm: args.confirm,
|
|
49
|
+
})
|
|
50
|
+
currentExecutionScope()?.assertActive()
|
|
51
|
+
const bindings = applyDelegation(plan, identity.agentId)
|
|
52
|
+
return {
|
|
53
|
+
text: `已把 ${bindings.length} 条节点授权授予 ${targetAgentId}:${summaryText(bindings)}\n来源:lead 绑定面内的节点;worker 现在可用 my_industrial_nodes 查看自己的授权。`,
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
return { text: err instanceof AppError ? err.message : `节点授权失败: ${err instanceof Error ? err.message : String(err)}`, isError: true }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** lead 收回授予给 worker 的节点授权 */
|
|
62
|
+
export async function handleRevokeNodes(identity: HostToolBridgeContext['identity'], args: Record<string, unknown>, ws: MembersView): Promise<HostToolResult> {
|
|
63
|
+
const targetAgentId = String(args.agent_id ?? args.assignee_id ?? '').trim()
|
|
64
|
+
const nodeIds = parseNodeIds(args)
|
|
65
|
+
try {
|
|
66
|
+
const members = await membersOf(ws)
|
|
67
|
+
currentExecutionScope()?.assertActive()
|
|
68
|
+
const results = revokeDelegation({
|
|
69
|
+
leaderAgentId: identity.agentId,
|
|
70
|
+
targetAgentId,
|
|
71
|
+
nodeIds,
|
|
72
|
+
members,
|
|
73
|
+
})
|
|
74
|
+
const okList = results.filter(r => r.revoked)
|
|
75
|
+
const missList = results.filter(r => !r.revoked)
|
|
76
|
+
const parts = [`已收回 ${okList.length} 条授权`, ...okList.map(r => ` - ${r.kind} ${r.nodeId}`)]
|
|
77
|
+
if (missList.length) parts.push(`未收回(不在其绑定面或非你授予):${missList.map(r => `${r.kind}:${r.nodeId}`).join('、')}`)
|
|
78
|
+
return { text: parts.join('\n') }
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
return { text: err instanceof AppError ? err.message : `收回授权失败: ${err instanceof Error ? err.message : String(err)}`, isError: true }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -17,6 +17,7 @@ import { nodeSemanticCards, recipeOperationFace } from '../industrial-context'
|
|
|
17
17
|
import { requestManualApproval } from './manual-approval'
|
|
18
18
|
import { guardTwinWrite } from '../../aml/twin/write-guard'
|
|
19
19
|
import { executionModeOfChannel, observeWriteRejectedText } from '../execution-mode'
|
|
20
|
+
import { currentExecutionScope } from '../execution-scope'
|
|
20
21
|
|
|
21
22
|
export async function toolMyIndustrialNodes(agentId: string): Promise<{ text: string }> {
|
|
22
23
|
const repo = getAgentNodeBindingRepo()
|
|
@@ -116,14 +117,18 @@ export async function toolDcwControl(agentId: string, args: { node_id?: string,
|
|
|
116
117
|
* 仍允许**平台内部治理工具**复用:optimization_explore(工艺优化 Channel 的闭环探索,
|
|
117
118
|
* profile 门控)的写入委托它执行 —— Agent 可调用面依然收敛在配方面,此处非 Agent 入口。
|
|
118
119
|
*/
|
|
119
|
-
export async function dcwControlGovernedInternal(agentId: string, args: { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string }, channelId?: string): Promise<{ text: string, isError?: boolean }> {
|
|
120
|
-
|
|
120
|
+
export async function dcwControlGovernedInternal(agentId: string, args: { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string }, channelId?: string): Promise<{ text: string, isError?: boolean, dispatch: 'not_dispatched' | 'indeterminate' | 'accepted' }> {
|
|
121
|
+
let driverStarted = false
|
|
122
|
+
const result = await dcwControlGovernedLegacy(agentId, args, channelId, () => {
|
|
123
|
+
driverStarted = true
|
|
124
|
+
})
|
|
125
|
+
return { ...result, dispatch: result.isError ? (driverStarted ? 'indeterminate' : 'not_dispatched') : 'accepted' }
|
|
121
126
|
}
|
|
122
127
|
|
|
123
128
|
/** v2 前的直写实现(治理链完整:四层限界/HITL/60s 联锁/journal/open 记录)。
|
|
124
129
|
* 非任何 Agent 工具入口 —— 仅由 dcwControlGovernedInternal 承载平台内部治理写
|
|
125
130
|
* (optimization_explore 闭环探索的写入委托),Agent 可调用面依然收敛在配方面。 */
|
|
126
|
-
async function dcwControlGovernedLegacy(agentId: string, args: { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string }, channelId?: string): Promise<{ text: string, isError?: boolean }> {
|
|
131
|
+
async function dcwControlGovernedLegacy(agentId: string, args: { node_id?: string, value?: number | string, hypothesis?: string, task_id?: string }, channelId?: string, onDriverStart?: () => void): Promise<{ text: string, isError?: boolean }> {
|
|
127
132
|
const twinGuard = guardTwinWrite(agentId, channelId)
|
|
128
133
|
if (!twinGuard.allowed) return { text: `${twinGuard.code}: ${twinGuard.message}`, isError: true }
|
|
129
134
|
// 频道执行模式(2026-10-28 三模式计划 M2/M3):observe 兜底拒写(分发守卫之外的第二道
|
|
@@ -240,13 +245,16 @@ async function dcwControlGovernedLegacy(agentId: string, args: { node_id?: strin
|
|
|
240
245
|
}
|
|
241
246
|
}
|
|
242
247
|
|
|
248
|
+
let driverStarted = false
|
|
249
|
+
const executionScope = currentExecutionScope()
|
|
243
250
|
try {
|
|
251
|
+
executionScope?.assertActive()
|
|
244
252
|
const meta = {
|
|
245
253
|
source: 'agent' as const,
|
|
246
254
|
actor: agentId,
|
|
247
255
|
// 人话操作者:「Channel名/成员名」——/logs 来源=Agent 与用户/系统操作可区分追溯
|
|
248
256
|
actorName: agentBadgeLabel(agentId),
|
|
249
|
-
taskId:
|
|
257
|
+
taskId: executionScope?.taskId,
|
|
250
258
|
hypothesis: args.hypothesis ? String(args.hypothesis) : '',
|
|
251
259
|
approvalId: approvalId || undefined,
|
|
252
260
|
// v34 干预台账归因:写入发生时所在 Channel(台账 path/channel 维度)
|
|
@@ -254,7 +262,11 @@ async function dcwControlGovernedLegacy(agentId: string, args: { node_id?: strin
|
|
|
254
262
|
// 台账口径(三模式):该次写入发生时的频道生效执行模式(事后审计"这条写入当时是什么模式")
|
|
255
263
|
executionMode: execMode,
|
|
256
264
|
}
|
|
257
|
-
const outcome = await getDcwController().write(nodeId, value, null, meta)
|
|
265
|
+
const outcome = await getDcwController().write(nodeId, value, null, meta, executionScope, () => {
|
|
266
|
+
driverStarted = true
|
|
267
|
+
onDriverStart?.()
|
|
268
|
+
})
|
|
269
|
+
executionScope?.assertActive()
|
|
258
270
|
const run = node.lineId ? getActiveLineRun(node.lineId) : null
|
|
259
271
|
const winTxt = run
|
|
260
272
|
? `当前活动配方「${run.recipeName}」`
|
|
@@ -293,6 +305,16 @@ async function dcwControlGovernedLegacy(agentId: string, args: { node_id?: strin
|
|
|
293
305
|
}
|
|
294
306
|
catch (err) {
|
|
295
307
|
const msg = err instanceof Error ? err.message : String(err)
|
|
308
|
+
let inactive = false
|
|
309
|
+
try {
|
|
310
|
+
executionScope?.assertActive()
|
|
311
|
+
}
|
|
312
|
+
catch {
|
|
313
|
+
inactive = true
|
|
314
|
+
}
|
|
315
|
+
if (driverStarted) {
|
|
316
|
+
return { text: `${inactive ? '执行租约失效' : '写入过程异常'}:写入已进入驱动,设备状态不确定,请立即核实后再决定是否重试。${msg}`, isError: true }
|
|
317
|
+
}
|
|
296
318
|
const retryHint = /忙|busy/i.test(msg) ? '链路忙属瞬时状态,可稍后重试' : '设定值必须落在安全量程与活动配方工艺窗口内'
|
|
297
319
|
return { text: `下发被拒绝:${msg}(节点 ${node.name},物理量 ${tpl?.ch ?? node.templateKey};${retryHint})`, isError: true }
|
|
298
320
|
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { getToolApprovals } from '../tool-approvals'
|
|
12
12
|
import { agentBadgeLabel } from '../agent-badge'
|
|
13
13
|
import { currentToolInvocation } from '../governance-harness-audit'
|
|
14
|
+
import { currentExecutionScope } from '../execution-scope'
|
|
14
15
|
import { getDcwController } from '../../dcw/dcw-controller'
|
|
15
16
|
import { getDcwLineRepo } from '../../dcw/dcw-line.repo'
|
|
16
17
|
import { recordOps } from '../../ops/ops'
|
|
@@ -22,6 +23,8 @@ export interface LineStatusInput { line_id?: string }
|
|
|
22
23
|
|
|
23
24
|
/** 懒加载 manager:静态 import plugins/workshop 会拖入 Nitro #imports,使本模块无法被单测/脚本直接加载 */
|
|
24
25
|
async function workshopManager() {
|
|
26
|
+
const manager = globalThis.__workshopManager
|
|
27
|
+
if (manager) return manager
|
|
25
28
|
const { getWorkshopManager } = await import('@/server/plugins/workshop')
|
|
26
29
|
return getWorkshopManager()
|
|
27
30
|
}
|
|
@@ -116,6 +119,7 @@ export async function toolLineStart(agentId: string, args: LineStartInput, chann
|
|
|
116
119
|
try {
|
|
117
120
|
// 归因:line_start 的逐参数写入必须携带频道/任务锚点,否则干预台账 channel 为空,
|
|
118
121
|
// C1 独立回读的任务终态补扫(按 channel 取 pending)永远看不到这批写入。
|
|
122
|
+
currentExecutionScope()?.assertActive()
|
|
119
123
|
const invocation = currentToolInvocation()
|
|
120
124
|
const run = await ctrl.lineStart(lineId, recipeId, {
|
|
121
125
|
source: 'recipe',
|
|
@@ -123,10 +127,16 @@ export async function toolLineStart(agentId: string, args: LineStartInput, chann
|
|
|
123
127
|
actorName: agentBadgeLabel(agentId),
|
|
124
128
|
channelId: channelId ?? '',
|
|
125
129
|
...(invocation?.taskId ? { taskId: invocation.taskId } : {}),
|
|
126
|
-
})
|
|
130
|
+
}, currentExecutionScope())
|
|
131
|
+
try {
|
|
132
|
+
currentExecutionScope()?.assertActive()
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return { text: `开线批次 ${run.id} 执行后租约失效,设备可能已变化;请立即核实产线与设备状态。${run.results.map(r => `${r.nodeId ?? r.templateRef}:${r.message}`).join(';')}`, isError: true }
|
|
136
|
+
}
|
|
127
137
|
const results = run.results ?? []
|
|
128
|
-
const failed = results.filter(r => !r.ok)
|
|
129
|
-
const unverified = results.filter(r => r.ok && r.verify?.verdict !== 'verified' && r.ack !== 'readback-verified')
|
|
138
|
+
const failed = results.filter(r => !r.ok && r.verify?.verdict !== 'unverified')
|
|
139
|
+
const unverified = results.filter(r => r.verify?.verdict === 'unverified' || (r.ok && r.verify?.verdict !== 'verified' && r.ack !== 'readback-verified'))
|
|
130
140
|
const detailOf = (r: typeof results[number]): string => {
|
|
131
141
|
const node = r.nodeId ? ctrl.byId(r.nodeId) : undefined
|
|
132
142
|
return `${node?.name ?? r.templateRef ?? r.nodeId ?? '?'}: ${String(r.message).slice(0, 100)}`
|
|
@@ -207,7 +217,7 @@ export async function toolLineStart(agentId: string, args: LineStartInput, chann
|
|
|
207
217
|
const parts = [
|
|
208
218
|
`产线「${lineName}」已开跑(批次 ${run.id.slice(0, 8)},配方「${recipe.name}」),但参数下发未全部证实${acks ? `(证实 ${acks.verified}/${acks.total},未证实 ${acks.unverified},失败 ${acks.failed})` : ''}:`,
|
|
209
219
|
...(failed.length > 0 ? [`失败参数:`, ...failed.map(r => ` - ${detailOf(r)}`)] : []),
|
|
210
|
-
...(unverified.length > 0 ? [`未证实参数(
|
|
220
|
+
...(unverified.length > 0 ? [`未证实参数(可能已下发,设备状态须核实):`, ...unverified.map(r => ` - ${detailOf(r)}`)] : []),
|
|
211
221
|
'请先用 daq_query 复测实际工况;未生效参数需人工处置或 line_stop 后重试,禁止把本次开线当作全量生效。',
|
|
212
222
|
]
|
|
213
223
|
return { text: parts.join('\n'), isError: true }
|
|
@@ -268,6 +278,7 @@ export async function toolLineStop(agentId: string, args: LineStopInput, channel
|
|
|
268
278
|
}
|
|
269
279
|
}
|
|
270
280
|
try {
|
|
281
|
+
currentExecutionScope()?.assertActive()
|
|
271
282
|
const run = ctrl.lineStop(lineId)
|
|
272
283
|
try {
|
|
273
284
|
recordOps({
|