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
|
@@ -31,14 +31,15 @@
|
|
|
31
31
|
* 输出(末行 JSON):{simBase, shadowDir, devices:[{id,protocol,port,signals}],
|
|
32
32
|
* driverSource:"sim-export", next:"对每设备 GET /api/nodes/:id/export 取 driverConfig 喂给 provision-line/onboard"}
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* 注意:平台查询可能触发全局控制循环;模拟器进程及端点归属也必须证明。
|
|
35
35
|
* 孪生协议归一:mes-rest/http/opcua 族节点映射到 modbus-tcp 孪生设备(语义/量程保留;
|
|
36
36
|
* 协议真实性由 onboard 期的 export driverConfig 保证——模拟器 export 什么,平台就接什么)。
|
|
37
37
|
*/
|
|
38
38
|
import { spawnSync } from 'node:child_process'
|
|
39
|
-
import { existsSync, readFileSync } from 'node:fs'
|
|
39
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs'
|
|
40
40
|
import { dirname, join, resolve } from 'node:path'
|
|
41
41
|
import { fileURLToPath } from 'node:url'
|
|
42
|
+
import { assertOnboardingOwnership, newAttestationNonce } from './lib.mjs'
|
|
42
43
|
|
|
43
44
|
const REPO = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..')
|
|
44
45
|
const args = process.argv.slice(2)
|
|
@@ -49,11 +50,56 @@ const argOf = (k, d = '') => {
|
|
|
49
50
|
const SIM_PORT = Number(argOf('--sim-port', '4034'))
|
|
50
51
|
const SIM = `http://127.0.0.1:${SIM_PORT}`
|
|
51
52
|
const SIM_DIR = resolve(argOf('--shadow', join(REPO, '..', `plc-node-simulator-twin-${SIM_PORT}`)))
|
|
53
|
+
const ATTEST_BUNDLE = resolve(argOf('--bundle', join(SIM_DIR, 'attestation.json')))
|
|
52
54
|
const AW_BASE = process.env.AW_BASE ?? 'http://127.0.0.1:3001'
|
|
53
55
|
process.env.NO_PROXY = '127.0.0.1,localhost'
|
|
54
56
|
process.env.HTTP_PROXY = ''
|
|
55
57
|
process.env.HTTPS_PROXY = ''
|
|
56
58
|
|
|
59
|
+
/* ── 自证归属(--spawn):本轮拉起才可证明 ──
|
|
60
|
+
* 生成一次性 nonce → 注入新拉起的模拟器进程 → /api/attestation 复核 → 写 bundle。
|
|
61
|
+
* 非 spawn 模式:复用既有实例,必须出示本轮归属证明(AW_ONBOARD_ATTESTATION),
|
|
62
|
+
* 且证明在 ensureSim 之后再次复核(防「检查后实例死了又换人」竞态)。 */
|
|
63
|
+
const ATTEST_NONCE = newAttestationNonce()
|
|
64
|
+
function writeAttestationBundle(endpoints) {
|
|
65
|
+
const brokerPort = 18830 + (SIM_PORT - 4010) * 1000
|
|
66
|
+
const bundle = {
|
|
67
|
+
version: 1,
|
|
68
|
+
nonce: ATTEST_NONCE,
|
|
69
|
+
simBase: SIM,
|
|
70
|
+
simPort: SIM_PORT,
|
|
71
|
+
brokerPort,
|
|
72
|
+
pid: ATTEST_PID,
|
|
73
|
+
shadowDir: SIM_DIR,
|
|
74
|
+
endpoints,
|
|
75
|
+
createdAt: new Date().toISOString(),
|
|
76
|
+
}
|
|
77
|
+
writeFileSync(ATTEST_BUNDLE, JSON.stringify(bundle, null, 2))
|
|
78
|
+
process.env.AW_ONBOARD_ATTESTATION = ATTEST_BUNDLE
|
|
79
|
+
return bundle
|
|
80
|
+
}
|
|
81
|
+
let ATTEST_PID = null
|
|
82
|
+
async function selfAttest() {
|
|
83
|
+
process.env.AW_SIM_ATTEST_NONCE = ATTEST_NONCE
|
|
84
|
+
await ensureSim()
|
|
85
|
+
let att = null
|
|
86
|
+
for (let i = 0; i < 10 && !att; i++) {
|
|
87
|
+
try {
|
|
88
|
+
const r = await fetch(`${SIM}/api/attestation`, { signal: AbortSignal.timeout(4000) })
|
|
89
|
+
const j = await r.json().catch(() => null)
|
|
90
|
+
if (j?.code === 0 && j.data) att = j.data
|
|
91
|
+
}
|
|
92
|
+
catch { /* 模拟器未就绪,重试 */ }
|
|
93
|
+
if (!att) await sleep(1500)
|
|
94
|
+
}
|
|
95
|
+
if (!att || att.nonce !== ATTEST_NONCE) {
|
|
96
|
+
throw new Error('归属证明失败:端口上的进程无法出示本轮注入的随机 nonce;拒绝接入(未证明前不发起任何平台请求)')
|
|
97
|
+
}
|
|
98
|
+
ATTEST_PID = att.pid
|
|
99
|
+
writeAttestationBundle([{ kind: 'api', port: SIM_PORT }, { kind: 'mqtt-broker', port: 18830 + (SIM_PORT - 4010) * 1000 }])
|
|
100
|
+
console.log(`[sim-twin] 归属证明成立:sim=${SIM} pid=${att.pid} bundle=${ATTEST_BUNDLE}`)
|
|
101
|
+
}
|
|
102
|
+
|
|
57
103
|
let pass = 0
|
|
58
104
|
const fails = []
|
|
59
105
|
const ok = (name, cond, detail = '') => {
|
|
@@ -226,7 +272,9 @@ async function materialize(devices, mqttPort) {
|
|
|
226
272
|
const protocol = dev.family
|
|
227
273
|
const config = { ...(dev.config ?? {}) }
|
|
228
274
|
if (protocol === 'modbus-tcp' || protocol === 'modbus-rtu') {
|
|
229
|
-
|
|
275
|
+
// 接入链路平台侧只拨环回(归属证明的端点绑定也只接受 127.0.0.1);
|
|
276
|
+
// 影子实例的监听面本来就是 source transform 强制的 127.0.0.1。
|
|
277
|
+
config.host = '127.0.0.1'
|
|
230
278
|
config.port = dev.port ?? (port += 2)
|
|
231
279
|
config.unitId = dev.unitId ?? 1
|
|
232
280
|
config.registerMaps = dev.signals.map((s, i) => ({ address: 40001 + i * 2, area: 'holding', signalId: s.id, dataType: 'float32', byteOrder: 'big' }))
|
|
@@ -309,7 +357,17 @@ async function livenessCheck(createdIds) {
|
|
|
309
357
|
|
|
310
358
|
/* ── 主流程 ── */
|
|
311
359
|
console.log(`[sim-twin] 模拟器 :${SIM_PORT} 影子树 ${SIM_DIR}`)
|
|
312
|
-
|
|
360
|
+
if (args.includes('--spawn')) {
|
|
361
|
+
// --spawn:本轮拉起 + nonce 注入 + 复核 + bundle 落盘(唯一所有权来源)
|
|
362
|
+
await selfAttest()
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
// 复用模式:必须先出示本轮归属证明(任何拉起/平台请求都不允许发生在证明之前),
|
|
366
|
+
// ensureSim 之后再次复核 —— 防「检查后实例死了又被换人占用端口」竞态。
|
|
367
|
+
await assertOnboardingOwnership()
|
|
368
|
+
await ensureSim()
|
|
369
|
+
await assertOnboardingOwnership()
|
|
370
|
+
}
|
|
313
371
|
let created, liveness
|
|
314
372
|
if (args.includes('--from-platform')) {
|
|
315
373
|
const lineId = argOf('--line')
|
|
@@ -336,6 +394,31 @@ else {
|
|
|
336
394
|
process.exit(1)
|
|
337
395
|
}
|
|
338
396
|
liveness = await livenessCheck(created.map(c => c.id))
|
|
397
|
+
let attested = null
|
|
398
|
+
{
|
|
399
|
+
// 设备已物化:按实际端点计划刷新归属证明(协议端口随设备新增;两种模式都要刷新,
|
|
400
|
+
// 否则后续 provision/verify 的端点绑定会拒绝新出现的协议端口)。
|
|
401
|
+
try {
|
|
402
|
+
const { simulatorEndpointPlan } = await import('../../bench/lib/sim.mjs')
|
|
403
|
+
const nodes = (await simApi('GET', '/api/nodes')).data
|
|
404
|
+
if (args.includes('--spawn')) {
|
|
405
|
+
attested = writeAttestationBundle(simulatorEndpointPlan(nodes, SIM_PORT))
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
// 复用模式:保留既有 bundle 的 nonce/pid(已由 assertOnboardingOwnership 复核过),仅刷新端点计划
|
|
409
|
+
const existing = JSON.parse(readFileSync(process.env.AW_ONBOARD_ATTESTATION ?? ATTEST_BUNDLE, 'utf8'))
|
|
410
|
+
if (existing.version !== 1 || !existing.nonce) throw new Error('既有 bundle 形态无效,拒绝刷新')
|
|
411
|
+
existing.endpoints = simulatorEndpointPlan(nodes, SIM_PORT)
|
|
412
|
+
writeFileSync(process.env.AW_ONBOARD_ATTESTATION ?? ATTEST_BUNDLE, JSON.stringify(existing, null, 2))
|
|
413
|
+
attested = existing
|
|
414
|
+
}
|
|
415
|
+
console.log(`[sim-twin] 归属证明端点已刷新:${attested.endpoints.map(e => `${e.kind}:${e.port}`).join(', ')}`)
|
|
416
|
+
console.log(`[sim-twin] 后续脚本必须带:AW_ONBOARD_ATTESTATION=${process.env.AW_ONBOARD_ATTESTATION ?? ATTEST_BUNDLE}`)
|
|
417
|
+
}
|
|
418
|
+
catch (e) {
|
|
419
|
+
ok('归属证明端点刷新', false, e.message)
|
|
420
|
+
}
|
|
421
|
+
}
|
|
339
422
|
console.log('')
|
|
340
423
|
console.log('════════════════════════════════════════')
|
|
341
424
|
console.log(` sim-twin:${pass} PASS / ${fails.length} FAIL`)
|
|
@@ -343,6 +426,7 @@ for (const f of fails) console.log(` ✖ ${f}`)
|
|
|
343
426
|
const summary = {
|
|
344
427
|
simBase: SIM, shadowDir: SIM_DIR, devices: created, totalSignals: liveness.signals,
|
|
345
428
|
driverSource: 'sim-export',
|
|
429
|
+
...(attested ? { bundlePath: process.env.AW_ONBOARD_ATTESTATION ?? ATTEST_BUNDLE, endpoints: attested.endpoints } : {}),
|
|
346
430
|
next: `对每设备 GET ${SIM}/api/nodes/<id>/export 取 items[].driverConfig,喂给 provision-line/onboard(driverConfig 替换为模拟器 export,量程/stepLimit 保留)`,
|
|
347
431
|
}
|
|
348
432
|
console.log(JSON.stringify(summary))
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
* 全部 ok 才退出 0——任一失败即停(skill 规定:连通性未全绿不得进入供给阶段)。
|
|
12
12
|
* 用法:node scripts/onboarding/test-connection.mjs <config.json|-> (默认读 stdin)
|
|
13
13
|
*/
|
|
14
|
-
import { api, login, ok, summary, readConfig } from './lib.mjs'
|
|
14
|
+
import { api, login, ok, summary, readConfig, assertOnboardingOwnership } from './lib.mjs'
|
|
15
15
|
|
|
16
16
|
const cfg = await readConfig()
|
|
17
|
+
await assertOnboardingOwnership(cfg)
|
|
17
18
|
const tok = await login()
|
|
18
19
|
// 兼容 onboard 统一配置:顶层 tests 或 connectivity.tests;空测试集必须显式失败,
|
|
19
20
|
// 不得以 0 通过/0 失败“静默全绿”放行(2026-10-20 实测踩坑)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// The shared api helper returns JSON without checking the HTTP status.
|
|
2
|
+
export async function checkedGet({ base, token, path, fetchImpl = fetch }) {
|
|
3
|
+
const response = await fetchImpl(base + path, {
|
|
4
|
+
method: 'GET',
|
|
5
|
+
headers: { 'content-type': 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}) },
|
|
6
|
+
})
|
|
7
|
+
if (!response.ok) {
|
|
8
|
+
await response.body?.cancel()
|
|
9
|
+
throw new Error(`HTTP ${response.status} for ${path}`)
|
|
10
|
+
}
|
|
11
|
+
const envelope = await response.json()
|
|
12
|
+
if (!envelope || typeof envelope !== 'object' || Array.isArray(envelope) || envelope.code !== 0
|
|
13
|
+
|| !envelope.data || typeof envelope.data !== 'object' || Array.isArray(envelope.data)) {
|
|
14
|
+
throw new Error(`invalid or unsuccessful API envelope for ${path}`)
|
|
15
|
+
}
|
|
16
|
+
return envelope.data
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function readProtectedSnapshot({ base, token, lineId, limit, fetchImpl = fetch }) {
|
|
20
|
+
async function get(path, field) {
|
|
21
|
+
const data = await checkedGet({ base, token, path, fetchImpl })
|
|
22
|
+
if (!Array.isArray(data[field])) throw new Error(`missing ${field} array for ${path}`)
|
|
23
|
+
// This API currently exposes no pagination; never accept a sign of truncation.
|
|
24
|
+
if ((data.hasMore !== undefined && data.hasMore !== false) || data.nextCursor != null
|
|
25
|
+
|| (data.incomplete !== undefined && data.incomplete !== false)
|
|
26
|
+
|| (data.truncated !== undefined && data.truncated !== false)
|
|
27
|
+
|| (data.total !== undefined && (!Number.isSafeInteger(data.total) || data.total !== data[field].length))) {
|
|
28
|
+
throw new Error(`incomplete ${field} snapshot`)
|
|
29
|
+
}
|
|
30
|
+
return data[field]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
const lines = await get('/api/workshop/dcw/lines', 'lines')
|
|
35
|
+
const anchors = await get(`/api/workshop/dcw/journal?lineId=${encodeURIComponent(lineId)}&limit=${limit}`, 'anchors')
|
|
36
|
+
return { lines, anchors }
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return { error: error instanceof Error ? error.message : String(error) }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Pure V6 decision logic. Snapshots contain checked lines and journal reads, or an error.
|
|
2
|
+
const canonical = (value) => {
|
|
3
|
+
if (Array.isArray(value)) return value.map(canonical)
|
|
4
|
+
if (value && typeof value === 'object') {
|
|
5
|
+
return Object.fromEntries(Object.keys(value).sort().map(key => [key, canonical(value[key])]))
|
|
6
|
+
}
|
|
7
|
+
return value
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function evaluateProtectedFixture({ before, after, lineId, limit }) {
|
|
11
|
+
const fail = reason => ({ status: 'FAIL', reason })
|
|
12
|
+
if (typeof lineId !== 'string' || !lineId || !Number.isInteger(limit) || limit <= 0) return fail('invalid evaluator configuration')
|
|
13
|
+
|
|
14
|
+
function validate(snapshot, phase) {
|
|
15
|
+
if (!snapshot || snapshot.error) return { error: `${phase} read failed: ${snapshot?.error ?? 'missing snapshot'}` }
|
|
16
|
+
if (!Array.isArray(snapshot.lines) || !Array.isArray(snapshot.anchors)) return { error: `${phase} snapshot is incomplete` }
|
|
17
|
+
if (snapshot.lines.some(line => !line || typeof line.id !== 'string' || !line.id)) return { error: `${phase} line list is malformed` }
|
|
18
|
+
if (snapshot.anchors.length >= limit || snapshot.incomplete) return { error: `${phase} journal snapshot is capped or incomplete` }
|
|
19
|
+
const lines = snapshot.lines.filter(line => line.id === lineId)
|
|
20
|
+
if (lines.length > 1) return { error: `${phase} line list has duplicate protected IDs` }
|
|
21
|
+
const anchors = new Map()
|
|
22
|
+
for (const anchor of snapshot.anchors) {
|
|
23
|
+
if (!anchor || typeof anchor !== 'object' || Array.isArray(anchor)
|
|
24
|
+
|| typeof anchor.id !== 'string' || !anchor.id || anchor.lineId !== lineId
|
|
25
|
+
|| typeof anchor.nodeId !== 'string' || !anchor.nodeId
|
|
26
|
+
|| typeof anchor.at !== 'string' || !anchor.at
|
|
27
|
+
|| typeof anchor.source !== 'string' || !anchor.source || typeof anchor.actor !== 'string' || !anchor.actor
|
|
28
|
+
|| !Number.isFinite(anchor.newValue) || (anchor.prevValue !== null && !Number.isFinite(anchor.prevValue))) {
|
|
29
|
+
return { error: `${phase} journal contains malformed or unrelated anchors` }
|
|
30
|
+
}
|
|
31
|
+
if (anchors.has(anchor.id)) return { error: `${phase} journal has duplicate anchor IDs` }
|
|
32
|
+
anchors.set(anchor.id, JSON.stringify(canonical(anchor)))
|
|
33
|
+
}
|
|
34
|
+
if (!lines.length && anchors.size) return { error: `${phase} journal contains anchors for an absent line` }
|
|
35
|
+
return { exists: lines.length === 1, anchors }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const pre = validate(before, 'before')
|
|
39
|
+
if (pre.error) return fail(pre.error)
|
|
40
|
+
const post = validate(after, 'after')
|
|
41
|
+
if (post.error) return fail(post.error)
|
|
42
|
+
if (!pre.exists && !post.exists) return { status: 'SKIP', reason: 'protected fixture absent before and after' }
|
|
43
|
+
if (!pre.exists) return fail('protected line created during verification')
|
|
44
|
+
if (!pre.anchors.size) return fail('protected journal baseline is empty')
|
|
45
|
+
if (!post.exists) return fail('protected line deleted during verification')
|
|
46
|
+
for (const [id, content] of pre.anchors) {
|
|
47
|
+
if (!post.anchors.has(id)) return fail(`baseline anchor removed: ${id}`)
|
|
48
|
+
if (post.anchors.get(id) !== content) return fail(`baseline anchor changed: ${id}`)
|
|
49
|
+
}
|
|
50
|
+
for (const id of post.anchors.keys()) {
|
|
51
|
+
if (!pre.anchors.has(id)) return fail(`new protected anchor: ${id}`)
|
|
52
|
+
}
|
|
53
|
+
return { status: 'PASS', reason: `protected journal unchanged (${pre.anchors.size} anchors)` }
|
|
54
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* 节点观测物理量跟随到目标值(设备侧生效由观测面证实,而非虚报回读)。
|
|
10
10
|
* V4 配方在册:recipeId 在 /dcw 聚合可见且参数节点映射正确
|
|
11
11
|
* V5 频道绑定:频道 lineId 正确、成员≥2、插件开启生效
|
|
12
|
-
* V6
|
|
12
|
+
* V6 受保护线保留 journal 前后不变(不能证明零扰动)
|
|
13
13
|
* 输入 JSON:
|
|
14
14
|
* {
|
|
15
15
|
* "lineId":"ln-..","recipeId":"rc-..","channelId":"<uuid>",
|
|
@@ -20,152 +20,195 @@
|
|
|
20
20
|
* }
|
|
21
21
|
* 用法:node scripts/onboarding/verify-line.mjs <config.json|->
|
|
22
22
|
*/
|
|
23
|
-
import { api, login, ok, summary, readConfig, pollUntil } from './lib.mjs'
|
|
23
|
+
import { api, BASE, login, ok, summary, readConfig, pollUntil, PROTECTED, assertNotProtected, assertOnboardingOwnership, assertDriverEndpointsAttested } from './lib.mjs'
|
|
24
|
+
import { checkedGet, readProtectedSnapshot } from './v6-protected-api.mjs'
|
|
25
|
+
import { evaluateProtectedFixture } from './v6-protected-fixture.mjs'
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
+
async function main() {
|
|
28
|
+
const cfg = await readConfig()
|
|
29
|
+
await assertOnboardingOwnership(cfg)
|
|
30
|
+
if (typeof cfg.lineId !== 'string' || !cfg.lineId.trim()) throw new Error('目标产线 ID 缺失')
|
|
31
|
+
assertNotProtected(cfg.lineId, '目标产线')
|
|
32
|
+
if (cfg.dcw !== undefined && !Array.isArray(cfg.dcw)) throw new Error('dcw 必须是数组')
|
|
33
|
+
const tok = await login()
|
|
27
34
|
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// 多形态节点(向量/图像)数据在 daq_frames 不在 daq_samples:标量面 60s 内无点时回查帧面。
|
|
39
|
-
for (const id of cfg.daq ?? []) {
|
|
40
|
-
try {
|
|
41
|
-
await pollUntil(async () => {
|
|
42
|
-
const now = Date.now()
|
|
43
|
-
const j = await api('GET', `/api/workshop/daq/${id}/samples?from=${now - 90000}&to=${now}&bucketMs=30000`, undefined, tok)
|
|
44
|
-
if ((j.data?.points ?? []).length > 0) return true
|
|
45
|
-
const f = await api('GET', `/api/workshop/daq/${id}/frames?from=${now - 120000}&to=${now}&limit=1`, undefined, tok).catch(() => null)
|
|
46
|
-
return (f?.data?.frames ?? f?.data ?? []).length > 0
|
|
47
|
-
}, { timeoutMs: 120000, label: `采样[${id}]` })
|
|
48
|
-
ok(`V1 数采落库[${id}]`, true)
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
ok(`V1 数采落库[${id}]`, false, String(e).slice(0, 80))
|
|
35
|
+
// Capture and validate the protected journal before any acceptance writes.
|
|
36
|
+
const PROTECTED_LINE = PROTECTED[0]
|
|
37
|
+
const JOURNAL_LIMIT = 500
|
|
38
|
+
const snapshotOptions = { base: BASE, token: tok, lineId: PROTECTED_LINE, limit: JOURNAL_LIMIT }
|
|
39
|
+
const protectedBefore = await readProtectedSnapshot(snapshotOptions)
|
|
40
|
+
const preflightV6 = evaluateProtectedFixture({ before: protectedBefore, after: protectedBefore, lineId: PROTECTED_LINE, limit: JOURNAL_LIMIT })
|
|
41
|
+
if (preflightV6.status === 'FAIL') {
|
|
42
|
+
console.error(`V6 受保护线保留 journal 完整性 — FAIL: ${preflightV6.reason}`)
|
|
43
|
+
process.exitCode = 1
|
|
44
|
+
return
|
|
52
45
|
}
|
|
53
|
-
}
|
|
54
46
|
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|| (/RANGE|LIMIT|越界|量程|上限|下限|VALIDATION/i.test(badMsg) && !/超时|timeout|ECONN|网络/i.test(badMsg))
|
|
63
|
-
ok(`V2 越界拒[${n.name}]`, rejected, `value=${n.max + span} → ${String(bad.message ?? bad.code).slice(0, 60)}`)
|
|
64
|
-
// V3 探针必须在写前实时取值:开批次后引擎/配方会驱动 SP,配置期探针会过期。
|
|
65
|
-
// 只写命令点(如 mqtt commandTopic)read 返 null → 回退用最近一次写锚点值当现值。
|
|
66
|
-
let probe = n.probeValue
|
|
67
|
-
const rd = await api('POST', `/api/workshop/dcw/${n.id}/read`, {}, tok).catch(() => null)
|
|
68
|
-
let cur = rd?.data?.read?.value
|
|
69
|
-
if (typeof cur !== 'number') {
|
|
70
|
-
const jr = await api('GET', '/api/workshop/dcw/journal?limit=30', undefined, tok)
|
|
71
|
-
const lastAnchor = (jr.data?.anchors ?? []).filter(a => a.nodeId === n.id)
|
|
72
|
-
.sort((a, b) => Date.parse(b.at ?? 0) - Date.parse(a.at ?? 0))[0]
|
|
73
|
-
if (lastAnchor && typeof lastAnchor.newValue === 'number') cur = lastAnchor.newValue
|
|
74
|
-
}
|
|
75
|
-
// 探针必须同时落在「节点量程 ∩ 活动配方窗口」内,且尽量朝窗口内侧走:
|
|
76
|
-
// 当前值可能已被冒烟步推到窗口上沿,cur+step 会越配方窗口(实测 47+2>48 被拒)。
|
|
77
|
-
const rp = (cfg.recipeParams ?? []).find(p => p.nodeId === n.id)
|
|
78
|
-
const upper = Math.min(n.max, rp?.max ?? n.max)
|
|
79
|
-
const lower = Math.max(n.min, rp?.min ?? n.min)
|
|
80
|
-
const step = Math.max(0.1, Number(n.stepLimit) || 1)
|
|
81
|
-
if (typeof cur === 'number') {
|
|
82
|
-
const up = Math.round((cur + step) * 10) / 10
|
|
83
|
-
const down = Math.round((cur - step) * 10) / 10
|
|
84
|
-
probe = up < upper && up >= lower ? up : (down >= lower && down < upper ? down : Math.min(upper, Math.max(lower, cur)))
|
|
47
|
+
// Neither a line label nor loopback proves that the endpoint belongs to a simulator.
|
|
48
|
+
// Even built-in driver names can be overridden by plugins at runtime.
|
|
49
|
+
if (cfg.dcw?.length) {
|
|
50
|
+
const targets = protectedBefore.lines.filter(line => line.id === cfg.lineId)
|
|
51
|
+
if (targets.length !== 1 || targets[0].simulated !== true) {
|
|
52
|
+
throw new Error(`V2/V3 写入拒绝:目标产线 ${cfg.lineId} 必须唯一且 simulated=true`)
|
|
53
|
+
}
|
|
85
54
|
}
|
|
86
|
-
|
|
87
|
-
|
|
55
|
+
|
|
56
|
+
// Resolve every target before any V2/V3 write, including nodes not present in the journal.
|
|
57
|
+
for (const n of cfg.dcw ?? []) {
|
|
58
|
+
if (!n || typeof n.id !== 'string' || !/^[A-Za-z0-9_-]+$/.test(n.id)) throw new Error('无效的写控节点 ID')
|
|
59
|
+
const { node } = await checkedGet({ base: BASE, token: tok, path: `/api/workshop/dcw/${encodeURIComponent(n.id)}` })
|
|
60
|
+
if (!node || typeof node !== 'object' || Array.isArray(node) || node.id !== n.id
|
|
61
|
+
|| typeof node.lineId !== 'string' || node.lineId !== cfg.lineId) {
|
|
62
|
+
throw new Error(`写控节点 ${n.id} 不属于目标产线 ${cfg.lineId}`)
|
|
63
|
+
}
|
|
64
|
+
assertNotProtected(node.lineId, '写控节点产线')
|
|
65
|
+
if (typeof node.driver !== 'string' || !node.driver || !node.driverConfig
|
|
66
|
+
|| typeof node.driverConfig !== 'object' || Array.isArray(node.driverConfig)) {
|
|
67
|
+
throw new Error(`V2/V3 写入拒绝:节点 ${n.id} 缺少驱动或端点配置`)
|
|
68
|
+
}
|
|
69
|
+
// 实时节点 driverConfig 的端点绑定复核(配置可能被改指他处;以实时面为准):
|
|
70
|
+
// host 必须环回,端口必须落在本次归属证明的端口集内,缺端口不可证明。
|
|
71
|
+
assertDriverEndpointsAttested(node.driverConfig, `节点 ${n.id}`)
|
|
88
72
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
|
|
74
|
+
// V1 数采落库(滑动窗口:每次轮询重算 now,避免 to=启动时刻冻结导致新样本落窗外)。
|
|
75
|
+
// 多形态节点(向量/图像)数据在 daq_frames 不在 daq_samples:标量面 60s 内无点时回查帧面。
|
|
76
|
+
for (const id of cfg.daq ?? []) {
|
|
77
|
+
try {
|
|
78
|
+
await pollUntil(async () => {
|
|
79
|
+
const now = Date.now()
|
|
80
|
+
const j = await api('GET', `/api/workshop/daq/${id}/samples?from=${now - 90000}&to=${now}&bucketMs=30000`, undefined, tok)
|
|
81
|
+
if ((j.data?.points ?? []).length > 0) return true
|
|
82
|
+
const f = await api('GET', `/api/workshop/daq/${id}/frames?from=${now - 120000}&to=${now}&limit=1`, undefined, tok).catch(() => null)
|
|
83
|
+
return (f?.data?.frames ?? f?.data ?? []).length > 0
|
|
84
|
+
}, { timeoutMs: 120000, label: `采样[${id}]` })
|
|
85
|
+
ok(`V1 数采落库[${id}]`, true)
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
ok(`V1 数采落库[${id}]`, false, String(e).slice(0, 80))
|
|
89
|
+
}
|
|
94
90
|
}
|
|
95
|
-
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
91
|
+
|
|
92
|
+
// V2/V3 量程联锁 + 合法回环
|
|
93
|
+
for (const n of cfg.dcw ?? []) {
|
|
94
|
+
const span = Math.max(1, (n.max - n.min) / 10)
|
|
95
|
+
const bad = await api('POST', `/api/workshop/dcw/${n.id}/write`, { value: n.max + span }, tok)
|
|
96
|
+
const badMsg = String(bad.message ?? '') + String(bad.code ?? '')
|
|
97
|
+
// 必须命中量程/限界拒绝语义;超时/网络失败不是“量程联锁通过”
|
|
98
|
+
const rejected = bad.code === 'NODE_RANGE_EXCEEDED'
|
|
99
|
+
|| (/RANGE|LIMIT|越界|量程|上限|下限|VALIDATION/i.test(badMsg) && !/超时|timeout|ECONN|网络/i.test(badMsg))
|
|
100
|
+
ok(`V2 越界拒[${n.name}]`, rejected, `value=${n.max + span} → ${String(bad.message ?? bad.code).slice(0, 60)}`)
|
|
101
|
+
// V3 探针必须在写前实时取值:开批次后引擎/配方会驱动 SP,配置期探针会过期。
|
|
102
|
+
// 只写命令点(如 mqtt commandTopic)read 返 null → 回退用最近一次写锚点值当现值。
|
|
103
|
+
let probe = n.probeValue
|
|
104
|
+
const rd = await api('POST', `/api/workshop/dcw/${n.id}/read`, {}, tok).catch(() => null)
|
|
105
|
+
let cur = rd?.data?.read?.value
|
|
106
|
+
if (typeof cur !== 'number') {
|
|
107
|
+
const jr = await api('GET', '/api/workshop/dcw/journal?limit=30', undefined, tok)
|
|
108
|
+
const lastAnchor = (jr.data?.anchors ?? []).filter(a => a.nodeId === n.id)
|
|
109
|
+
.sort((a, b) => Date.parse(b.at ?? 0) - Date.parse(a.at ?? 0))[0]
|
|
110
|
+
if (lastAnchor && typeof lastAnchor.newValue === 'number') cur = lastAnchor.newValue
|
|
111
|
+
}
|
|
112
|
+
// 探针必须同时落在「节点量程 ∩ 活动配方窗口」内,且尽量朝窗口内侧走:
|
|
113
|
+
// 当前值可能已被冒烟步推到窗口上沿,cur+step 会越配方窗口(实测 47+2>48 被拒)。
|
|
114
|
+
const rp = (cfg.recipeParams ?? []).find(p => p.nodeId === n.id)
|
|
115
|
+
const upper = Math.min(n.max, rp?.max ?? n.max)
|
|
116
|
+
const lower = Math.max(n.min, rp?.min ?? n.min)
|
|
117
|
+
const step = Math.max(0.1, Number(n.stepLimit) || 1)
|
|
118
|
+
if (typeof cur === 'number') {
|
|
119
|
+
const up = Math.round((cur + step) * 10) / 10
|
|
120
|
+
const down = Math.round((cur - step) * 10) / 10
|
|
121
|
+
probe = up < upper && up >= lower ? up : (down >= lower && down < upper ? down : Math.min(upper, Math.max(lower, cur)))
|
|
122
|
+
}
|
|
123
|
+
else if (probe < lower || probe > upper) {
|
|
124
|
+
probe = Math.min(upper, Math.max(lower, probe))
|
|
125
|
+
}
|
|
126
|
+
// V3 可能撞 60s 写间隔/保持窗(上一轮验收/冒烟刚写过)——最多等待 3 次,每次 65s
|
|
127
|
+
let good = await api('POST', `/api/workshop/dcw/${n.id}/write`, { value: probe }, tok)
|
|
128
|
+
for (let i = 0; i < 3 && good.code !== 0 && /间隔|60s|WRITE_INTERVAL|保持窗口|写入频繁/i.test(String(good.message ?? '')); i++) {
|
|
129
|
+
await new Promise(r => setTimeout(r, 65000))
|
|
130
|
+
good = await api('POST', `/api/workshop/dcw/${n.id}/write`, { value: probe }, tok)
|
|
131
|
+
}
|
|
132
|
+
// transport-ack 协议(MQTT commandTopic 等无读通道):按平台 ACK 口径断言 broker 受理,
|
|
133
|
+
// 再用独立 DAQ 观测节点证实物理量真的跟随。不允许把“链路受理”当“设备证实”。
|
|
134
|
+
if (n.ackMode === 'transport-ack') {
|
|
135
|
+
const ack = good.data?.outcome?.ack
|
|
136
|
+
const writeOk = (good.code === 0 || !!good.data?.outcome) && ack === 'transport-ack'
|
|
137
|
+
let followed = null
|
|
138
|
+
if (writeOk && n.observeDaqId) {
|
|
139
|
+
const tol = Number(n.observeTolerance ?? Math.max(0.5, Math.abs(probe) * 0.02))
|
|
140
|
+
try {
|
|
141
|
+
followed = await pollUntil(async () => {
|
|
142
|
+
const now = Date.now()
|
|
143
|
+
const j = await api('GET', `/api/workshop/daq/${n.observeDaqId}/samples?from=${now - 90000}&to=${now}&bucketMs=5000`, undefined, tok)
|
|
144
|
+
const pts = j.data?.points ?? []
|
|
145
|
+
const last = pts[pts.length - 1]
|
|
146
|
+
return last && Number.isFinite(last.avg) && Math.abs(last.avg - probe) <= tol ? last.avg : null
|
|
147
|
+
}, { timeoutMs: Number(n.observeTimeoutMs ?? 45000), stepMs: 3000, label: `观测[${n.name}]` })
|
|
148
|
+
}
|
|
149
|
+
catch { followed = null }
|
|
111
150
|
}
|
|
112
|
-
|
|
151
|
+
const okd = writeOk && (n.observeDaqId ? followed != null : true)
|
|
152
|
+
ok(`V3 合法写生效(transport-ack)[${n.name}]`, okd,
|
|
153
|
+
`cur=${cur ?? '?'} probe=${probe} ack=${ack ?? '缺失'} DAQ观测=${followed ?? '未跟随'} ${okd ? '' : String(good.message ?? good.code).slice(0, 80)}`)
|
|
154
|
+
continue
|
|
113
155
|
}
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
156
|
+
const rb = good.data?.outcome?.readback
|
|
157
|
+
const rbOk = typeof rb === 'number' && Number.isFinite(rb) && Math.abs(rb - probe) <= Math.max(0.5, Math.abs(probe) * 0.002)
|
|
158
|
+
const goodOk = (good.code === 0 || !!good.data?.outcome) && rbOk
|
|
159
|
+
ok(`V3 合法写回环[${n.name}]`, goodOk,
|
|
160
|
+
`cur=${cur ?? '?'} probe=${probe} readback=${rb ?? '缺失'} ${goodOk ? '一致' : String(good.message ?? good.code).slice(0, 80)}`)
|
|
118
161
|
}
|
|
119
|
-
const rb = good.data?.outcome?.readback
|
|
120
|
-
const rbOk = typeof rb === 'number' && Number.isFinite(rb) && Math.abs(rb - probe) <= Math.max(0.5, Math.abs(probe) * 0.002)
|
|
121
|
-
const goodOk = (good.code === 0 || !!good.data?.outcome) && rbOk
|
|
122
|
-
ok(`V3 合法写回环[${n.name}]`, goodOk,
|
|
123
|
-
`cur=${cur ?? '?'} probe=${probe} readback=${rb ?? '缺失'} ${goodOk ? '一致' : String(good.message ?? good.code).slice(0, 80)}`)
|
|
124
|
-
}
|
|
125
162
|
|
|
126
|
-
// V4 配方在册 + 参数逐项映射(不能只看 id 存在)
|
|
127
|
-
const agg = await api('GET', '/api/workshop/dcw', undefined, tok)
|
|
128
|
-
const rec = (agg.data?.recipes ?? []).find(r => r.id === cfg.recipeId)
|
|
129
|
-
const expectedParams = cfg.recipeParams ?? []
|
|
130
|
-
const recParams = rec?.params ?? []
|
|
131
|
-
const paramMismatch = expectedParams.filter((e) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
})
|
|
139
|
-
ok('V4 配方在册', !!rec, rec ? `${rec.name} v${rec.version} params=${recParams.length}` : (cfg.recipeId ?? '未提供'))
|
|
140
|
-
if (expectedParams.length > 0) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
163
|
+
// V4 配方在册 + 参数逐项映射(不能只看 id 存在)
|
|
164
|
+
const agg = await api('GET', '/api/workshop/dcw', undefined, tok)
|
|
165
|
+
const rec = (agg.data?.recipes ?? []).find(r => r.id === cfg.recipeId)
|
|
166
|
+
const expectedParams = cfg.recipeParams ?? []
|
|
167
|
+
const recParams = rec?.params ?? []
|
|
168
|
+
const paramMismatch = expectedParams.filter((e) => {
|
|
169
|
+
const p = recParams.find(x => x.nodeId === e.nodeId)
|
|
170
|
+
if (!p) return true
|
|
171
|
+
return (e.value !== undefined && p.value !== e.value)
|
|
172
|
+
|| (e.min !== undefined && p.min !== e.min)
|
|
173
|
+
|| (e.max !== undefined && p.max !== e.max)
|
|
174
|
+
|| (e.stepLimit !== undefined && p.stepLimit !== e.stepLimit)
|
|
175
|
+
})
|
|
176
|
+
ok('V4 配方在册', !!rec, rec ? `${rec.name} v${rec.version} params=${recParams.length}` : (cfg.recipeId ?? '未提供'))
|
|
177
|
+
if (expectedParams.length > 0) {
|
|
178
|
+
ok('V4 配方参数映射正确', paramMismatch.length === 0,
|
|
179
|
+
paramMismatch.length === 0 ? `${expectedParams.length} 项逐项一致` : `不匹配:${paramMismatch.map(p => p.nodeId).join(',')}`)
|
|
180
|
+
}
|
|
144
181
|
|
|
145
|
-
// V5 频道绑定与插件(plugins 显式数组:[] 表示期望零插件启用,同样要断言隔离)
|
|
146
|
-
const ch = await api('GET', `/api/workshop/channels/${cfg.channelId}`, undefined, tok)
|
|
147
|
-
const c = ch.data?.channel ?? ch.data
|
|
148
|
-
ok('V5 频道绑线', c?.lineId === cfg.lineId, `${c?.lineId} vs ${cfg.lineId}`)
|
|
149
|
-
const members = await api('GET', `/api/workshop/channels/${cfg.channelId}/agents`, undefined, tok)
|
|
150
|
-
ok('V5 频道成员≥2', (members.data ?? []).length >= 2, `members=${(members.data ?? []).length}`)
|
|
151
|
-
if (Array.isArray(cfg.plugins)) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
182
|
+
// V5 频道绑定与插件(plugins 显式数组:[] 表示期望零插件启用,同样要断言隔离)
|
|
183
|
+
const ch = await api('GET', `/api/workshop/channels/${cfg.channelId}`, undefined, tok)
|
|
184
|
+
const c = ch.data?.channel ?? ch.data
|
|
185
|
+
ok('V5 频道绑线', c?.lineId === cfg.lineId, `${c?.lineId} vs ${cfg.lineId}`)
|
|
186
|
+
const members = await api('GET', `/api/workshop/channels/${cfg.channelId}/agents`, undefined, tok)
|
|
187
|
+
ok('V5 频道成员≥2', (members.data ?? []).length >= 2, `members=${(members.data ?? []).length}`)
|
|
188
|
+
if (Array.isArray(cfg.plugins)) {
|
|
189
|
+
const pj = await api('GET', `/api/workshop/channels/${cfg.channelId}/plugins`, undefined, tok)
|
|
190
|
+
const enabled = new Set((pj.data?.plugins ?? []).filter(p => p.enabled).map(p => p.name))
|
|
191
|
+
for (const name of cfg.plugins) ok(`V5 插件[${name}]`, enabled.has(name), enabled.has(name) ? 'enabled' : `实际=${[...enabled].join(',')}`)
|
|
192
|
+
const unexpected = [...enabled].filter(n => !cfg.plugins.includes(n))
|
|
193
|
+
ok('V5 插件隔离(未配置插件不得被默认启用)', unexpected.length === 0,
|
|
194
|
+
unexpected.length ? `意外启用:${unexpected.join(',')}` : `仅配置项启用(enabled=${enabled.size}, expected=${cfg.plugins.length})`)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// V6 only skips when both checked snapshots prove the fixture is absent.
|
|
198
|
+
const protectedAfter = await readProtectedSnapshot(snapshotOptions)
|
|
199
|
+
const v6 = evaluateProtectedFixture({ before: protectedBefore, after: protectedAfter, lineId: PROTECTED_LINE, limit: JOURNAL_LIMIT })
|
|
200
|
+
if (v6.status === 'SKIP') {
|
|
201
|
+
console.log(`⚠ V6 受保护线保留 journal 完整性 — SKIP: ${v6.reason}; 正式验收需在隔离测试环境预置受保护线和非空 journal 基线`)
|
|
202
|
+
console.log('(V6 SKIP=1:该项不计入通过/失败)')
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
ok(`V6 受保护线保留 journal 完整性 — ${v6.status}`, v6.status === 'PASS', v6.reason)
|
|
206
|
+
}
|
|
159
207
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const mine = new Set([...(cfg.dcw ?? []).map(n => n.id)])
|
|
163
|
-
const touched = (journal.data?.anchors ?? []).filter(a => mine.has(a.nodeId))
|
|
164
|
-
const protectedAfter = await api('GET', `/api/workshop/dcw/journal?lineId=${PROTECTED_LINE}&limit=500`, undefined, tok)
|
|
165
|
-
const protectedNew = (protectedAfter.data?.anchors ?? []).filter(a => !protectedBeforeKeys.has(anchorKey(a)))
|
|
166
|
-
const linesAfter = await api('GET', '/api/workshop/dcw/lines', undefined, tok)
|
|
167
|
-
const protectedExistsAfter = (linesAfter.data?.lines ?? []).some(l => l.id === PROTECTED_LINE)
|
|
168
|
-
ok('V6 受保护线零扰动(受保护线 journal 无新增锚点)', protectedExists && protectedExistsAfter && protectedBeforeKeys.size > 0 && protectedNew.length === 0,
|
|
169
|
-
`受保护线存在=${protectedExists}->${protectedExistsAfter} 本线锚点=${touched.length} 受保护线新增=${protectedNew.length} 基线=${protectedBeforeKeys.size}`)
|
|
208
|
+
summary('接入验收', { graceful: true })
|
|
209
|
+
}
|
|
170
210
|
|
|
171
|
-
|
|
211
|
+
main().catch((error) => {
|
|
212
|
+
console.error(error instanceof Error ? error.message : String(error))
|
|
213
|
+
process.exitCode = 1
|
|
214
|
+
})
|