agentworkshop 0.11.3 → 0.13.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/2f96705b-cf57-4bde-87a4-1b818b268f0f.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 +4084 -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 +19 -7
- package/README.md +21 -7
- package/app/components/dcw/DcwNodesTable.vue +24 -0
- package/config.yml +1 -1
- package/docs/cli.en.md +1 -1
- package/docs/cli.md +1 -1
- package/docs/mcp.en.md +30 -27
- package/docs/mcp.md +7 -3
- package/docs/plugin-idd-rag-contract.md +87 -0
- package/docs/plugins.en.md +5 -3
- package/docs/plugins.md +5 -3
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- 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 +3 -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 +115 -19
- 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/diag-bridge/host/deposit.mjs +232 -0
- package/server/plugins-builtin/diag-bridge/host/diagnosis.mjs +121 -38
- package/server/plugins-builtin/diag-bridge/host/external-v1.mjs +213 -0
- package/server/plugins-builtin/diag-bridge/host/helpers.mjs +4 -2
- package/server/plugins-builtin/diag-bridge/host/intents.mjs +65 -62
- package/server/plugins-builtin/diag-bridge/host/plugin.mjs +351 -82
- package/server/plugins-builtin/diag-bridge/host/receipt.mjs +83 -0
- package/server/plugins-builtin/diag-bridge/host/sweep.mjs +70 -91
- package/server/plugins-builtin/diag-bridge/i18n.json +4 -0
- package/server/plugins-builtin/rag-bridge/i18n.json +18 -0
- package/server/plugins-builtin/rag-bridge/index.mjs +570 -64
- 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 +28 -4
- 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/server/services/workshop/tools/policy.ts +16 -1
- 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
|
@@ -13,6 +13,10 @@ import { getDcwRecipeRepo } from '../dcw-recipe.repo'
|
|
|
13
13
|
import { randomUUID } from 'node:crypto'
|
|
14
14
|
import { resolveDcwDriver } from '../drivers'
|
|
15
15
|
import { beginGovernanceDriverCall, endGovernanceDriverCall } from '../../agents/governance-harness-audit'
|
|
16
|
+
import type { ExecutionScope } from '../../agents/execution-scope'
|
|
17
|
+
import type { DcwWriteOutcome } from '../dcw-runtime'
|
|
18
|
+
import { writeTolerance } from '../dcw-runtime'
|
|
19
|
+
import { getTsdb } from '../../daq/storage'
|
|
16
20
|
|
|
17
21
|
/** 驱动未显式上报 ack 时的旧口径归一(ok+回读→设备证实;ok 无回读→链路受理;失败→未证实) */
|
|
18
22
|
function normalizeAck(outcome: { ok: boolean, readback: number | null, ack?: WriteAckLevel }): WriteAckLevel {
|
|
@@ -26,21 +30,45 @@ export abstract class DcwControllerActuation extends DcwControllerState {
|
|
|
26
30
|
* 核心写执行:驱动写(工程量→原始值换算 + 回读校验在驱动内)
|
|
27
31
|
* → ACK 记账(节点状态/写历史)→ WS 直推。真实/模拟驱动同一路径。
|
|
28
32
|
*/
|
|
29
|
-
protected async executeWrite(node: DcwNode, eng: number, tolerance: number, recipeRunId: string | null
|
|
33
|
+
protected async executeWrite(node: DcwNode, eng: number, tolerance: number, recipeRunId: string | null, executionScope?: ExecutionScope, onDriverStart?: () => void): Promise<DcwWriteOutcome> {
|
|
30
34
|
const at = new Date().toISOString()
|
|
31
35
|
// 数据语义标定钩子(encode):物理值 → PLC 设定值。
|
|
32
36
|
// 回读值再经 decoder 换算回物理量做死区校验(容差按标定比例同步缩放)。
|
|
33
37
|
const t = node.transform
|
|
34
38
|
const plcValue = inverseTransform(eng, t)
|
|
35
39
|
const plcTolerance = Math.max(tolerance, 1e-9) / (t?.kind === 'linear' && Math.abs(t.scale ?? 1) > 0 ? Math.abs(t.scale!) : 1)
|
|
40
|
+
executionScope?.assertActive()
|
|
41
|
+
const driver = resolveDcwDriver(node.driver)
|
|
36
42
|
const driverAudit = beginGovernanceDriverCall({
|
|
37
43
|
node_id: node.id, line_id: node.lineId ?? null, driver: node.driver,
|
|
38
44
|
requested_value: eng, plc_value: plcValue, tolerance: plcTolerance,
|
|
39
45
|
recipe_run_id: recipeRunId, driver_config: node.driverConfig,
|
|
40
46
|
})
|
|
41
47
|
let outcome: { ok: boolean, message: string, raw: number | null, readback: number | null, ack?: WriteAckLevel }
|
|
48
|
+
// Do not turn a revoked lease into an ordinary driver failure.
|
|
49
|
+
// 预检段(租约断言/保写锁持久化/onDriverStart)任何一步抛出 = 驱动绝不下发:
|
|
50
|
+
// 治理审计同步收口(driver_start↔end 配对,bugbot P2:503/断言抛错路径此前会
|
|
51
|
+
// 留下无 end 的悬挂 driver_call),503 外抛不得被写 try 吞成失败 outcome。
|
|
52
|
+
try {
|
|
53
|
+
executionScope?.assertActive()
|
|
54
|
+
node.holdBlocked = true
|
|
55
|
+
if (!this.repo.flushNow()) {
|
|
56
|
+
throw new AppError(503, ErrorCodes.CONFLICT, '无法持久化保写安全锁,拒绝驱动下发')
|
|
57
|
+
}
|
|
58
|
+
executionScope?.assertActive()
|
|
59
|
+
onDriverStart?.()
|
|
60
|
+
}
|
|
61
|
+
catch (preFlightError) {
|
|
62
|
+
endGovernanceDriverCall(driverAudit, {
|
|
63
|
+
ok: false,
|
|
64
|
+
message: `保写预检失败,驱动未调用:${preFlightError instanceof Error ? preFlightError.message : String(preFlightError)}`,
|
|
65
|
+
raw: null,
|
|
66
|
+
readback: null,
|
|
67
|
+
})
|
|
68
|
+
throw preFlightError
|
|
69
|
+
}
|
|
42
70
|
try {
|
|
43
|
-
outcome = await
|
|
71
|
+
outcome = await driver.write({
|
|
44
72
|
eng: plcValue,
|
|
45
73
|
tolerance: plcTolerance,
|
|
46
74
|
domain: { min: node.min, max: node.max },
|
|
@@ -54,11 +82,37 @@ export abstract class DcwControllerActuation extends DcwControllerState {
|
|
|
54
82
|
outcome = { ok: false, message: err instanceof Error ? err.message : String(err), raw: null, readback: null }
|
|
55
83
|
}
|
|
56
84
|
outcome.ack = normalizeAck(outcome)
|
|
85
|
+
let reported: DcwWriteOutcome = outcome
|
|
86
|
+
try {
|
|
87
|
+
executionScope?.assertActive()
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
reported = { ...outcome, ok: false, ack: 'unverified', message: `执行租约失效:写入已进入驱动,设备状态不确定,须核实。驱动返回:${outcome.message}`, driverOutcome: { ...outcome } }
|
|
91
|
+
}
|
|
57
92
|
this.writesTotal++
|
|
58
93
|
if (!outcome.ok) this.writesFailed++
|
|
59
94
|
// set 后 hook:节点暴露值 = PLC 回读经 decoder 解码的**真实物理值**(而非指令值);
|
|
60
95
|
// 回读缺失(驱动不支持)才回退指令值。节点对外呈现的始终是处理后的工艺参数。
|
|
61
96
|
node.applyWriteResult(outcome.readback ?? eng, outcome.ok, outcome.message, at)
|
|
97
|
+
// A transport acknowledgement is not evidence that the physical value is safe to hold.
|
|
98
|
+
if (reported.ok && outcome.ok && outcome.ack === 'readback-verified' && outcome.readback != null && Number.isFinite(outcome.readback)
|
|
99
|
+
&& Math.abs(outcome.readback - eng) <= writeTolerance(node)) {
|
|
100
|
+
node.holdBlocked = false
|
|
101
|
+
}
|
|
102
|
+
else if (reported.ok && outcome.ok && outcome.ack === 'transport-ack') {
|
|
103
|
+
// transport-ack = 链路受理,不是设备生效证据。声明了观测通道的节点以独立
|
|
104
|
+
// DAQ 跟随作为生效证据(与 V3 验收 ACK 口径同源)异步证实;证实通过才解除
|
|
105
|
+
// 保写锁。未声明的节点保写保持挂起并显式提示 —— 不再静默禁用心跳。
|
|
106
|
+
if (node.holdObserve?.daqId) {
|
|
107
|
+
this.beginHoldObserve(node, eng, Date.parse(at))
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
node.lastError = `写入已受理(broker ACK);节点未配置观测证实(holdObserve.daqId),保写挂起待设备生效证据`
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (!outcome.ok) {
|
|
114
|
+
node.lastError = `${outcome.message};保写已暂停,需重新下发并由设备回读证实`
|
|
115
|
+
}
|
|
62
116
|
// 写值走防抖落盘:保写心跳按 holdIntervalMs 周期触发本方法,同步全量重写
|
|
63
117
|
// dcws.json 会随节点数放大成周期性 fs 抖动;防抖窗内崩溃丢失的设定值可从 PLC 回读恢复
|
|
64
118
|
this.repo.flushDebounced()
|
|
@@ -73,9 +127,9 @@ export abstract class DcwControllerActuation extends DcwControllerState {
|
|
|
73
127
|
param: findDcwTemplate(node.templateKey)?.ch ?? node.templateKey,
|
|
74
128
|
eng: attemptEng,
|
|
75
129
|
raw: outcome.raw,
|
|
76
|
-
ok:
|
|
77
|
-
ack:
|
|
78
|
-
message:
|
|
130
|
+
ok: reported.ok,
|
|
131
|
+
ack: reported.ack,
|
|
132
|
+
message: reported.message,
|
|
79
133
|
recipeRunId,
|
|
80
134
|
at,
|
|
81
135
|
}
|
|
@@ -86,15 +140,15 @@ export abstract class DcwControllerActuation extends DcwControllerState {
|
|
|
86
140
|
lineId: node.lineId ?? null,
|
|
87
141
|
value: attemptEng,
|
|
88
142
|
raw: outcome.raw,
|
|
89
|
-
ok:
|
|
90
|
-
ack:
|
|
91
|
-
message:
|
|
143
|
+
ok: reported.ok,
|
|
144
|
+
ack: reported.ack,
|
|
145
|
+
message: reported.message,
|
|
92
146
|
recipeRunId,
|
|
93
147
|
at,
|
|
94
148
|
})
|
|
95
149
|
this.emitNodeChanged('updated', node)
|
|
96
150
|
endGovernanceDriverCall(driverAudit, outcome)
|
|
97
|
-
return
|
|
151
|
+
return reported
|
|
98
152
|
}
|
|
99
153
|
|
|
100
154
|
protected emitNodeChanged(op: AepDcwNodeChange['op'], node: DcwNode | null): void {
|
|
@@ -102,6 +156,63 @@ export abstract class DcwControllerActuation extends DcwControllerState {
|
|
|
102
156
|
this.broadcast?.('dcw.node.changed', payload)
|
|
103
157
|
}
|
|
104
158
|
|
|
159
|
+
/**
|
|
160
|
+
* transport-ack 保写观测证实:写被 broker 受理后,轮询独立 DAQ 观测节点,
|
|
161
|
+
* 物理量在超时窗内**跟随到本次写目标**(±容差,点时间不早于写发起)即解除保写
|
|
162
|
+
* 锁;超时保持挂起并把原因写入 lastError。新写会用新目标取代在飞观测
|
|
163
|
+
* (代际号失效旧轮询),已回读证实的写同样使观测自然退出。
|
|
164
|
+
*/
|
|
165
|
+
private readonly holdObserveSeq = new Map<string, number>()
|
|
166
|
+
|
|
167
|
+
private beginHoldObserve(node: DcwNode, target: number, atMs: number): void {
|
|
168
|
+
const observe = node.holdObserve
|
|
169
|
+
if (!observe?.daqId) return
|
|
170
|
+
const seq = (this.holdObserveSeq.get(node.id) ?? 0) + 1
|
|
171
|
+
this.holdObserveSeq.set(node.id, seq)
|
|
172
|
+
const timeoutMs = Math.max(250, observe.timeoutMs ?? 45_000)
|
|
173
|
+
const pollMs = Math.min(3_000, Math.max(250, Math.floor(timeoutMs / 10)))
|
|
174
|
+
const tolerance = Math.max(0, observe.tolerance ?? Math.max(0.5, Math.abs(target) * 0.02))
|
|
175
|
+
const deadline = Date.now() + timeoutMs
|
|
176
|
+
// 滑动窗:从上次已见点之后续读(bugbot P1:固定 fromMs + ASC LIMIT 50 会把
|
|
177
|
+
// latest 钉死在第 50 个最旧点,高采频下永远读不到跟随点 → 健康写被误判超时,
|
|
178
|
+
// 保写心跳被静默挂死)。拍间隔内新增样本数远小于 50,滑动后 latest 即真实最新点。
|
|
179
|
+
let fromMs = atMs - 1_000
|
|
180
|
+
const poll = async (): Promise<void> => {
|
|
181
|
+
// 已被更新一次写取代(seq 变化)或保写锁已被回读证实解除:本次观测退出。
|
|
182
|
+
if (this.holdObserveSeq.get(node.id) !== seq || !node.holdBlocked) return
|
|
183
|
+
try {
|
|
184
|
+
const points = await getTsdb().query(observe.daqId, { fromMs, toMs: Date.now(), limit: 50 })
|
|
185
|
+
const latest = points[points.length - 1]
|
|
186
|
+
if (latest?.at != null && latest.at > fromMs) fromMs = latest.at
|
|
187
|
+
const value = latest?.avg ?? latest?.value
|
|
188
|
+
if (latest && latest.at >= atMs && value != null && Number.isFinite(value) && Math.abs(value - target) <= tolerance) {
|
|
189
|
+
if (this.holdObserveSeq.get(node.id) !== seq || !node.holdBlocked) return
|
|
190
|
+
node.holdBlocked = false
|
|
191
|
+
if (node.lastError?.startsWith('观测证实超时') || node.lastError?.startsWith('写入已受理')) node.lastError = null
|
|
192
|
+
this.repo.flushDebounced()
|
|
193
|
+
this.emitNodeChanged('updated', node)
|
|
194
|
+
console.log(`[dcw] 保写观测证实:${node.name}(${node.id}) DAQ ${observe.daqId} 跟随到 ${value},保写恢复`)
|
|
195
|
+
return
|
|
196
|
+
}
|
|
197
|
+
if (Date.now() >= deadline) {
|
|
198
|
+
if (this.holdObserveSeq.get(node.id) !== seq) return
|
|
199
|
+
node.lastError = `观测证实超时:DAQ ${observe.daqId} ${timeoutMs}ms 内未跟随到 ${target}(±${tolerance});保写保持挂起`
|
|
200
|
+
this.repo.flushDebounced()
|
|
201
|
+
this.emitNodeChanged('updated', node)
|
|
202
|
+
return
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch { /* 单拍查询失败按未证实处理,下一拍重试;进程内观测状态不外抛 */ }
|
|
206
|
+
if (this.holdObserveSeq.get(node.id) === seq && node.holdBlocked && Date.now() < deadline) {
|
|
207
|
+
const timer = setTimeout(() => void poll(), pollMs)
|
|
208
|
+
// unref:观测不得阻止进程自然退出(测试/关机路径不被拖住)
|
|
209
|
+
timer.unref?.()
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const first = setTimeout(() => void poll(), pollMs)
|
|
213
|
+
first.unref?.()
|
|
214
|
+
}
|
|
215
|
+
|
|
105
216
|
/**
|
|
106
217
|
* 核心读执行:驱动读(寄存器解码 + 工程量映射在驱动内)→ 标定 decode(PLC 值 → 物理值)
|
|
107
218
|
* → 读状态记账(节点 readValue/lastReadAt,失败记 lastReadError 不动写状态机)→ WS dcw.read 直推。
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DcwControllerContracts —— **跨层能力契约**。
|
|
3
|
-
*
|
|
4
|
-
* 拆成 10 层后,有 2 个方法只被"更早的层"调用;
|
|
5
|
-
* 与其把层序排成拓扑序打散职责,不如显式声明为抽象签名,由实现它的层提供(编译期校验)。
|
|
6
|
-
*
|
|
7
|
-
* 契约成员:
|
|
8
|
-
* executeRead → 由 actuation.ts 实现
|
|
9
|
-
* executeWrite → 由 actuation.ts 实现
|
|
10
|
-
*/
|
|
11
|
-
import type { DcwNode } from '../dcw-node'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* DcwControllerContracts —— **跨层能力契约**。
|
|
3
|
+
*
|
|
4
|
+
* 拆成 10 层后,有 2 个方法只被"更早的层"调用;
|
|
5
|
+
* 与其把层序排成拓扑序打散职责,不如显式声明为抽象签名,由实现它的层提供(编译期校验)。
|
|
6
|
+
*
|
|
7
|
+
* 契约成员:
|
|
8
|
+
* executeRead → 由 actuation.ts 实现
|
|
9
|
+
* executeWrite → 由 actuation.ts 实现
|
|
10
|
+
*/
|
|
11
|
+
import type { DcwNode } from '../dcw-node'
|
|
12
|
+
import type { ExecutionScope } from '../../agents/execution-scope'
|
|
13
|
+
import type { DcwWriteOutcome } from '../dcw-runtime'
|
|
14
|
+
|
|
15
|
+
export abstract class DcwControllerContracts {
|
|
16
|
+
protected abstract executeRead(node: DcwNode): Promise<{ ok: boolean, value: number | null, raw: number | null, message: string, at: string }>
|
|
17
|
+
protected abstract executeWrite(node: DcwNode, eng: number, tolerance: number, recipeRunId: string | null, executionScope?: ExecutionScope, onDriverStart?: () => void): Promise<DcwWriteOutcome>
|
|
18
|
+
}
|
|
@@ -6,6 +6,7 @@ import { DcwControllerControl } from './control'
|
|
|
6
6
|
import type { DcwCreateInput, DcwPatchInput } from './types'
|
|
7
7
|
import { AppError, ErrorCodes } from '../../../../utils/errors'
|
|
8
8
|
import { DcwNode } from '../dcw-node'
|
|
9
|
+
import type { DcwHoldObserve } from '../dcw-node'
|
|
9
10
|
import { dcwKeyFromRef, normalizeDataTransform } from '../../../../../shared/dcw-protocol'
|
|
10
11
|
import { stripMaskedSecrets } from '../../../../../shared/daq-protocol'
|
|
11
12
|
import { findDcwTemplate } from '../dcw-templates'
|
|
@@ -24,6 +25,24 @@ function normalizeStepLimitInput(value: unknown): number | null | undefined {
|
|
|
24
25
|
return n
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/** 观测证实声明归一:daqId 必填且为合法节点 id 形态;容差/超时收敛为安全区间。 */
|
|
29
|
+
function normalizeHoldObserve(value: DcwHoldObserve | null | undefined): DcwHoldObserve | null {
|
|
30
|
+
if (value == null) return null
|
|
31
|
+
if (typeof value !== 'object' || Array.isArray(value) || typeof value.daqId !== 'string'
|
|
32
|
+
|| !/^[A-Za-z0-9_-]+$/.test(value.daqId)) {
|
|
33
|
+
throw new AppError(400, ErrorCodes.VALIDATION_ERROR, 'holdObserve.daqId 必填:观测证实需指向独立 DAQ 节点')
|
|
34
|
+
}
|
|
35
|
+
const tolerance = value.tolerance == null ? undefined : Number(value.tolerance)
|
|
36
|
+
if (tolerance !== undefined && (!Number.isFinite(tolerance) || tolerance <= 0)) {
|
|
37
|
+
throw new AppError(400, ErrorCodes.VALIDATION_ERROR, 'holdObserve.tolerance 必须为正数')
|
|
38
|
+
}
|
|
39
|
+
const timeoutMs = value.timeoutMs == null ? undefined : Number(value.timeoutMs)
|
|
40
|
+
if (timeoutMs !== undefined && (!Number.isFinite(timeoutMs) || timeoutMs < 250 || timeoutMs > 600_000)) {
|
|
41
|
+
throw new AppError(400, ErrorCodes.VALIDATION_ERROR, 'holdObserve.timeoutMs 需在 [250, 600000] 内')
|
|
42
|
+
}
|
|
43
|
+
return { daqId: value.daqId, tolerance: tolerance ?? undefined, timeoutMs: timeoutMs ?? undefined }
|
|
44
|
+
}
|
|
45
|
+
|
|
27
46
|
export abstract class DcwControllerCrud extends DcwControllerControl {
|
|
28
47
|
create(input: DcwCreateInput): DcwNode {
|
|
29
48
|
this.ensureLoop()
|
|
@@ -44,6 +63,7 @@ export abstract class DcwControllerCrud extends DcwControllerControl {
|
|
|
44
63
|
transform: normalizeDataTransform(input.transform),
|
|
45
64
|
enabled: input.enabled,
|
|
46
65
|
holdIntervalMs: input.holdIntervalMs ?? null,
|
|
66
|
+
holdObserve: normalizeHoldObserve(input.holdObserve),
|
|
47
67
|
readIntervalMs: input.readIntervalMs ?? null,
|
|
48
68
|
unit: input.unit,
|
|
49
69
|
decimals: input.decimals,
|
|
@@ -147,6 +167,9 @@ export abstract class DcwControllerCrud extends DcwControllerControl {
|
|
|
147
167
|
node.holdIntervalMs = patch.holdIntervalMs == null ? null : Math.max(0, Math.min(3_600_000, Math.round(patch.holdIntervalMs)))
|
|
148
168
|
rearm = true
|
|
149
169
|
}
|
|
170
|
+
if (patch.holdObserve !== undefined) {
|
|
171
|
+
node.holdObserve = normalizeHoldObserve(patch.holdObserve)
|
|
172
|
+
}
|
|
150
173
|
if (patch.readIntervalMs !== undefined) {
|
|
151
174
|
node.readIntervalMs = patch.readIntervalMs == null ? null : Math.max(0, Math.min(3_600_000, Math.round(patch.readIntervalMs)))
|
|
152
175
|
rearm = true
|
|
@@ -11,6 +11,8 @@ import { getDcwLineRepo } from '../dcw-line.repo'
|
|
|
11
11
|
import { getDcwProductRepo } from '../dcw-product.repo'
|
|
12
12
|
import { getDcwRecipeRepo } from '../dcw-recipe.repo'
|
|
13
13
|
import { getRecipeRollBackManager } from '../recipe-rollback-manager'
|
|
14
|
+
import type { ExecutionScope } from '../../agents/execution-scope'
|
|
15
|
+
import { summarizeAck } from './write-verify'
|
|
14
16
|
|
|
15
17
|
export abstract class DcwControllerLines extends DcwControllerRecipes {
|
|
16
18
|
listLines(): LineView[] {
|
|
@@ -75,7 +77,8 @@ export abstract class DcwControllerLines extends DcwControllerRecipes {
|
|
|
75
77
|
* 产线开跑:选定产品+配方 → 下发配方参数 → 创建批次并激活**该产线**窗口。
|
|
76
78
|
* 门控:配方必归属本产线的产品且含工艺参数 —— 未设定配方不可开跑数据采集。
|
|
77
79
|
*/
|
|
78
|
-
async lineStart(lineId: string, recipeId: string, writeMeta?: DcwWriteMeta) {
|
|
80
|
+
async lineStart(lineId: string, recipeId: string, writeMeta?: DcwWriteMeta, executionScope?: ExecutionScope) {
|
|
81
|
+
executionScope?.assertActive()
|
|
79
82
|
this.ensureLoop()
|
|
80
83
|
if (!this.running) {
|
|
81
84
|
throw new AppError(409, ErrorCodes.CONFLICT, '控制网关已暂停(暂停全部控制):开跑需下发配方参数,请先「恢复全部控制」')
|
|
@@ -117,9 +120,17 @@ export abstract class DcwControllerLines extends DcwControllerRecipes {
|
|
|
117
120
|
// 配方版本/工况谱系:开跑即开段(C8);落段失败不阻断开跑主链
|
|
118
121
|
try {
|
|
119
122
|
const { openContextSegment } = await import('../../process-model/context')
|
|
123
|
+
executionScope?.assertActive()
|
|
120
124
|
openContextSegment(run)
|
|
121
125
|
}
|
|
122
126
|
catch { /* 谱系不可用只降级 */ }
|
|
127
|
+
try {
|
|
128
|
+
executionScope?.assertActive()
|
|
129
|
+
}
|
|
130
|
+
catch (err) {
|
|
131
|
+
repo.closeRun(run.id)
|
|
132
|
+
throw err
|
|
133
|
+
}
|
|
123
134
|
setActiveLineRun({
|
|
124
135
|
lineId,
|
|
125
136
|
runId: run.id,
|
|
@@ -131,7 +142,28 @@ export abstract class DcwControllerLines extends DcwControllerRecipes {
|
|
|
131
142
|
startedAt: run.startedAt,
|
|
132
143
|
taggedSamples: 0,
|
|
133
144
|
})
|
|
134
|
-
await this.writeRecipeParams(recipe, run, { requireActiveRun: true, ...(writeMeta ? { writeMeta } : {}) })
|
|
145
|
+
await this.writeRecipeParams(recipe, run, { requireActiveRun: true, ...(writeMeta ? { writeMeta } : {}), executionScope })
|
|
146
|
+
try {
|
|
147
|
+
executionScope?.assertActive()
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
const last = run.results[run.results.length - 1]
|
|
151
|
+
if (last?.ok) {
|
|
152
|
+
last.ok = false
|
|
153
|
+
last.ack = 'unverified'
|
|
154
|
+
last.verify = { verdict: 'unverified', attempts: 0 }
|
|
155
|
+
last.message = `${last.message};执行租约失效,批次完成状态不确定,须核实设备`
|
|
156
|
+
run.ackSummary = summarizeAck(run.results)
|
|
157
|
+
repo.updateRun(run)
|
|
158
|
+
}
|
|
159
|
+
if (getActiveLineRun(lineId)?.runId === run.id) {
|
|
160
|
+
// Do not stop a replacement run created while the driver was in flight.
|
|
161
|
+
this.lineStop(lineId)
|
|
162
|
+
}
|
|
163
|
+
else if (!run.endedAt) {
|
|
164
|
+
repo.closeRun(run.id)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
135
167
|
this.broadcast?.('dcw.controller', this.controllerState())
|
|
136
168
|
return run
|
|
137
169
|
}
|
|
@@ -15,6 +15,7 @@ import { writeTolerance } from '../dcw-runtime'
|
|
|
15
15
|
import { notifyLineOperators } from '../../runtime/line-notify'
|
|
16
16
|
import { assertWithinLimits } from '../param-limits'
|
|
17
17
|
import { getActiveLineRun } from '../line-run'
|
|
18
|
+
import type { ExecutionScope } from '../../agents/execution-scope'
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* 试验节拍 env 解析(显式 0 = 关闭;空/非法 = 默认 5 分钟)。
|
|
@@ -113,9 +114,19 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
113
114
|
* 2026-10-08 ACK 鉴定:每参数写后经 verifyRecipeWrite 补验(链路受理→独立回读
|
|
114
115
|
* 证实),结果行携带 ack/verify —— 「ok」不再被当成「设备已生效」。
|
|
115
116
|
*/
|
|
116
|
-
protected async writeRecipeParams(recipe: RecipeView, run: RecipeRunView, opts: { enforceRecipeWindow?: boolean, writeMeta?: DcwWriteMeta, requireActiveRun?: boolean } = {}): Promise<void> {
|
|
117
|
+
protected async writeRecipeParams(recipe: RecipeView, run: RecipeRunView, opts: { enforceRecipeWindow?: boolean, writeMeta?: DcwWriteMeta, requireActiveRun?: boolean, executionScope?: ExecutionScope } = {}): Promise<void> {
|
|
117
118
|
const results: RecipeRunView['results'] = []
|
|
118
|
-
for (const param of recipe.params) {
|
|
119
|
+
for (const [index, param] of recipe.params.entries()) {
|
|
120
|
+
try {
|
|
121
|
+
opts.executionScope?.assertActive()
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
results.push({ templateRef: param.templateRef ?? param.nodeId, nodeId: param.nodeId, ok: false, message: `已中止:执行租约失效,剩余参数未下发(${err instanceof Error ? err.message : String(err)})`, value: param.value })
|
|
125
|
+
for (const rest of recipe.params.slice(index + 1)) {
|
|
126
|
+
results.push({ templateRef: rest.templateRef ?? rest.nodeId, nodeId: rest.nodeId, ok: false, message: '已跳过:执行租约失效,未下发', value: rest.value })
|
|
127
|
+
}
|
|
128
|
+
break
|
|
129
|
+
}
|
|
119
130
|
const active = opts.requireActiveRun === true ? getActiveLineRun(recipe.lineId) : null
|
|
120
131
|
if (opts.requireActiveRun === true && (!active || active.runId !== run.id)) {
|
|
121
132
|
results.push({ templateRef: param.templateRef ?? param.nodeId, nodeId: param.nodeId, ok: false, message: '已中止:产线批次已停止或被替换,剩余参数未下发', value: param.value })
|
|
@@ -154,10 +165,16 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
154
165
|
continue
|
|
155
166
|
}
|
|
156
167
|
}
|
|
168
|
+
let driverStarted = false
|
|
157
169
|
try {
|
|
158
|
-
|
|
170
|
+
opts.executionScope?.assertActive()
|
|
171
|
+
const outcome = await this.write(node.id, param.value, run.id, opts.writeMeta ?? { source: 'recipe', actor: 'recipe' }, opts.executionScope, () => {
|
|
172
|
+
driverStarted = true
|
|
173
|
+
})
|
|
174
|
+
opts.executionScope?.assertActive()
|
|
159
175
|
// ACK 鉴定:命令 ok 但仅链路受理(mqtt/http-no-echo/mock)→ 独立回读补验
|
|
160
176
|
const v: WriteVerifyOutcome = await verifyRecipeWrite(this, node, param.value, outcome, { tolerance: writeTolerance(node) })
|
|
177
|
+
opts.executionScope?.assertActive()
|
|
161
178
|
const ackTag = v.verdict === 'verified' ? '' : v.verdict === 'failed' ? '' : ` · ${v.message}`
|
|
162
179
|
results.push({
|
|
163
180
|
templateRef: node.templateRef,
|
|
@@ -170,7 +187,25 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
170
187
|
})
|
|
171
188
|
}
|
|
172
189
|
catch (err) {
|
|
173
|
-
|
|
190
|
+
let inactive = false
|
|
191
|
+
try {
|
|
192
|
+
opts.executionScope?.assertActive()
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
inactive = true
|
|
196
|
+
}
|
|
197
|
+
if (inactive && driverStarted) {
|
|
198
|
+
results.push({ templateRef: node.templateRef, nodeId: node.id, ok: false, message: '执行租约失效:写入已进入驱动,设备状态不确定,须核实;后续参数未下发', value: param.value, ack: 'unverified', verify: { verdict: 'unverified', attempts: 0 } })
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
results.push({ templateRef: node.templateRef, nodeId: node.id, ok: false, message: inactive ? '执行租约失效:参数未下发' : err instanceof Error ? err.message : String(err), value: param.value })
|
|
202
|
+
}
|
|
203
|
+
if (inactive) {
|
|
204
|
+
for (const rest of recipe.params.slice(index + 1)) {
|
|
205
|
+
results.push({ templateRef: rest.templateRef ?? rest.nodeId, nodeId: rest.nodeId, ok: false, message: '已跳过:执行租约失效,未下发', value: rest.value })
|
|
206
|
+
}
|
|
207
|
+
break
|
|
208
|
+
}
|
|
174
209
|
}
|
|
175
210
|
}
|
|
176
211
|
run.results = results
|
|
@@ -218,9 +253,12 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
218
253
|
agentApprovalId?: string
|
|
219
254
|
/** Agent 下发身份(trial 与正式 apply 共用):写账归因/互斥/回退冷却方向性依赖它。 */
|
|
220
255
|
agentTrialMeta?: Omit<DcwWriteMeta, 'source' | 'approvalId'>
|
|
256
|
+
/** Trusted task fence for agent-controlled writes. */
|
|
257
|
+
executionScope?: ExecutionScope
|
|
221
258
|
/** 应急豁免:仅跳过 recipe 级频控(审批/四层限界/试验节拍照常) */
|
|
222
259
|
emergency?: boolean
|
|
223
260
|
} = {}) {
|
|
261
|
+
opts.executionScope?.assertActive()
|
|
224
262
|
this.ensureLoop()
|
|
225
263
|
const repo = getDcwRecipeRepo()
|
|
226
264
|
const recipe = repo.byId(recipeId)
|
|
@@ -261,10 +299,12 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
261
299
|
agentDispatch?: boolean
|
|
262
300
|
agentApprovalId?: string
|
|
263
301
|
agentTrialMeta?: Omit<DcwWriteMeta, 'source' | 'approvalId'>
|
|
302
|
+
executionScope?: ExecutionScope
|
|
264
303
|
emergency?: boolean
|
|
265
304
|
},
|
|
266
305
|
overrides: Array<{ nodeId: string, value: number }>,
|
|
267
306
|
): Promise<RecipeRunView> {
|
|
307
|
+
opts.executionScope?.assertActive()
|
|
268
308
|
const repo = getDcwRecipeRepo()
|
|
269
309
|
const recipeId = recipe.id
|
|
270
310
|
// 声明式覆盖集:有 overrides 只写声明的节点(未声明参数保持现状,绝不顺带整批);
|
|
@@ -282,19 +322,36 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
282
322
|
const agentMeta: DcwWriteMeta | undefined = opts.agentDispatch && opts.agentTrialMeta
|
|
283
323
|
? { ...opts.agentTrialMeta, source: 'agent', ...(opts.agentApprovalId ? { approvalId: opts.agentApprovalId } : {}) }
|
|
284
324
|
: undefined
|
|
285
|
-
await this.writeRecipeParams({ ...recipe, params: effective }, run, { enforceRecipeWindow: overrides.length > 0, writeMeta: agentMeta })
|
|
325
|
+
await this.writeRecipeParams({ ...recipe, params: effective }, run, { enforceRecipeWindow: overrides.length > 0, writeMeta: agentMeta, ...(opts.executionScope ? { executionScope: opts.executionScope } : {}) })
|
|
326
|
+
let completedUnderLease = true
|
|
327
|
+
try {
|
|
328
|
+
opts.executionScope?.assertActive()
|
|
329
|
+
}
|
|
330
|
+
catch {
|
|
331
|
+
completedUnderLease = false
|
|
332
|
+
}
|
|
333
|
+
const initialAcks = run.ackSummary ?? summarizeAck(run.results)
|
|
334
|
+
if (opts.executionScope && (!completedUnderLease || initialAcks.failed > 0 || initialAcks.unverified > 0)) {
|
|
335
|
+
// An incomplete batch must not replace the active recipe context.
|
|
336
|
+
completedUnderLease = false
|
|
337
|
+
}
|
|
286
338
|
// 运行中应用新配方版本 → 谱系拆段(A13):旧段在 now 闭合,新段记录新版本/内容 hash。
|
|
287
339
|
try {
|
|
340
|
+
if (!completedUnderLease) throw new Error('recipe batch incomplete')
|
|
341
|
+
opts.executionScope?.assertActive()
|
|
288
342
|
const { getActiveLineRun, setActiveLineRun } = await import('../line-run')
|
|
343
|
+
opts.executionScope?.assertActive()
|
|
289
344
|
const active = getActiveLineRun(recipe.lineId)
|
|
290
345
|
if (active) {
|
|
291
346
|
const switchedAt = Date.now()
|
|
292
347
|
const { closeContextSegment, openContextSegment } = await import('../../process-model/context')
|
|
293
|
-
|
|
348
|
+
opts.executionScope?.assertActive()
|
|
294
349
|
// 活动窗口的配方身份同步切换:DAQ 入库打标、配方数采窗口都从活动窗口取值,
|
|
295
350
|
// 只拆段不换身份会让切换后的样本仍带旧 recipeId(段与数据标签互相矛盾)。
|
|
296
351
|
const { getDcwProductRepo } = await import('../dcw-product.repo')
|
|
352
|
+
opts.executionScope?.assertActive()
|
|
297
353
|
const product = getDcwProductRepo().byId(recipe.productId)
|
|
354
|
+
closeContextSegment(active.runId, switchedAt)
|
|
298
355
|
setActiveLineRun({
|
|
299
356
|
...active,
|
|
300
357
|
recipeId: recipe.id,
|
|
@@ -310,6 +367,20 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
310
367
|
}
|
|
311
368
|
}
|
|
312
369
|
catch { /* 谱系不可用只降级,不阻断下发 */ }
|
|
370
|
+
try {
|
|
371
|
+
opts.executionScope?.assertActive()
|
|
372
|
+
}
|
|
373
|
+
catch {
|
|
374
|
+
const last = run.results[run.results.length - 1]
|
|
375
|
+
if (last?.ok) {
|
|
376
|
+
last.ok = false
|
|
377
|
+
last.ack = 'unverified'
|
|
378
|
+
last.verify = { verdict: 'unverified', attempts: 0 }
|
|
379
|
+
last.message = `${last.message};执行租约失效,批次完成状态不确定,须核实设备`
|
|
380
|
+
run.ackSummary = summarizeAck(run.results)
|
|
381
|
+
repo.updateRun(run)
|
|
382
|
+
}
|
|
383
|
+
}
|
|
313
384
|
// ACK 鉴定判定落账(单一咽喉点:REST 手动/Agent 工具/回退/系统路径全覆盖):
|
|
314
385
|
// failed≥1 → error;仅 unverified(链路受理未证实)→ warn;全部设备证实 → info。
|
|
315
386
|
// error/warn 同时向该线 operate 授权用户定向告警(生产化:假成功必须有人看到)。
|
|
@@ -377,8 +448,10 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
377
448
|
description?: string
|
|
378
449
|
agentDispatch?: boolean
|
|
379
450
|
agentApprovalId?: string
|
|
451
|
+
executionScope?: ExecutionScope
|
|
380
452
|
emergency?: boolean
|
|
381
453
|
}): Promise<{ recipe: RecipeView, run: RecipeRunView, definitionNoop?: boolean }> {
|
|
454
|
+
opts.executionScope?.assertActive()
|
|
382
455
|
const versionBefore = getDcwRecipeRepo().byId(recipeId)?.version ?? 1
|
|
383
456
|
const updated = this.revertRecipe(recipeId, {
|
|
384
457
|
version: opts.toLastGood ? undefined : opts.version,
|
|
@@ -394,6 +467,7 @@ export abstract class DcwControllerRecipes extends DcwControllerParams {
|
|
|
394
467
|
const run = await this.applyRecipe(recipeId, {
|
|
395
468
|
agentDispatch: opts.agentDispatch,
|
|
396
469
|
agentApprovalId: opts.agentApprovalId,
|
|
470
|
+
executionScope: opts.executionScope,
|
|
397
471
|
emergency: opts.emergency,
|
|
398
472
|
})
|
|
399
473
|
return { recipe: updated, run, definitionNoop }
|