agentworkshop 0.8.8 → 0.9.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 +68 -0
- package/.output/.AgentWorkShop/prompts/host-tools.json +68 -0
- package/.output/.AgentWorkShop/schema.json +2 -0
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Cdi9qfTr.js → CDO7Zey1.js} +2 -2
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/f507c33b-4ecc-4e32-af88-2e3736b443e9.json +1 -0
- package/.output/server/chunks/_/access.mjs +1 -1
- package/.output/server/chunks/_/data-export.mjs +5 -5
- package/.output/server/chunks/_/data-query.mjs +2 -2
- package/.output/server/chunks/_/eda-run.repo.mjs +3 -3
- package/.output/server/chunks/_/features.mjs +5 -5
- package/.output/server/chunks/_/golden.mjs +2 -2
- package/.output/server/chunks/_/host-bindings.mjs +1 -1
- package/.output/server/chunks/_/index.mjs +2 -2
- package/.output/server/chunks/_/mes-secrets.repo.mjs +1 -1
- package/.output/server/chunks/_/nitro.mjs +2556 -1314
- package/.output/server/chunks/_/nitro.mjs.map +1 -1
- package/.output/server/chunks/_/spc.mjs +2 -2
- package/.output/server/chunks/build/_id_-CsCtnbwe.mjs +1 -1
- package/.output/server/chunks/build/_id_-P1W47Gqq.mjs +1 -1
- package/.output/server/chunks/build/_wsId_-DpOErFj6.mjs +1 -1
- package/.output/server/chunks/build/agents-D7CdEUTv.mjs +1 -1
- package/.output/server/chunks/build/aml-DRAFRcGU.mjs +1 -1
- package/.output/server/chunks/build/analysis-J9axLuRt.mjs +1 -1
- package/.output/server/chunks/build/api-B4Om0mEc.mjs +1 -1
- package/.output/server/chunks/build/api-BEW_ebY_.mjs +1 -1
- package/.output/server/chunks/build/api-BsAgXWxi.mjs +1 -1
- package/.output/server/chunks/build/board-CJUc032b.mjs +1 -1
- package/.output/server/chunks/build/channel-templates-ggsBacZF.mjs +1 -1
- package/.output/server/chunks/build/constants-HPHJvjne.mjs +1 -1
- package/.output/server/chunks/build/daq-B_dRMDw4.mjs +1 -1
- package/.output/server/chunks/build/data-D8uX1dnm.mjs +1 -1
- package/.output/server/chunks/build/dcw-D_HD_H_2.mjs +1 -1
- package/.output/server/chunks/build/default-CNWS6NUw.mjs +1 -1
- package/.output/server/chunks/build/es-Bxu10NJ2.mjs +1 -1
- package/.output/server/chunks/build/logs-BnYSMRXM.mjs +1 -1
- package/.output/server/chunks/build/monitor-Cq6hRFeQ.mjs +1 -1
- package/.output/server/chunks/build/ontology-ohICfVVb.mjs +1 -1
- package/.output/server/chunks/build/operations-4zOVhW7o.mjs +1 -1
- package/.output/server/chunks/build/optimizer-BlWTsM-W.mjs +1 -1
- package/.output/server/chunks/build/pages-DEv4ProW.mjs +1 -1
- package/.output/server/chunks/build/permissions-DgXQZSyx.mjs +1 -1
- package/.output/server/chunks/build/pipeline-CkavMBhk.mjs +1 -1
- package/.output/server/chunks/build/plugins-LRjaSEZy.mjs +1 -1
- package/.output/server/chunks/build/schedules-Hz2DJUE2.mjs +1 -1
- package/.output/server/chunks/build/settings-DXLJPq7d.mjs +1 -1
- package/.output/server/chunks/build/studio-hSqH9TYS.mjs +1 -1
- package/.output/server/chunks/build/teams-BbwYJyzv.mjs +1 -1
- package/.output/server/chunks/build/tokens-GYaGJ35Z.mjs +1 -1
- package/.output/server/chunks/build/tools-CnYi9cou.mjs +1 -1
- package/.output/server/chunks/build/town-BV-hbwb5.mjs +1 -1
- package/.output/server/chunks/build/town-CcoQKjMj.mjs +1 -1
- package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
- package/.output/server/chunks/build/types-DWqIeMRP.mjs +1 -1
- package/.output/server/chunks/build/useAgentHarnessOptions-Dq0l0Z6d.mjs +1 -1
- package/.output/server/chunks/build/useAgentTemplateActions-BFOHb5-L.mjs +1 -1
- package/.output/server/chunks/build/useAgentTemplateDialogState-CZzpu5og.mjs +1 -1
- package/.output/server/chunks/build/useAgentTemplateForm-CuJPOPcK.mjs +1 -1
- package/.output/server/chunks/build/useAgentTemplatesCatalog-B2bIhZLA.mjs +1 -1
- package/.output/server/chunks/build/useAmlDatasets-DeoE1idn.mjs +1 -1
- package/.output/server/chunks/build/useAmlEntities-BJhvdqHJ.mjs +1 -1
- package/.output/server/chunks/build/useAmlEnv-CDIZ6xTe.mjs +1 -1
- package/.output/server/chunks/build/useAmlExperiments-Dloi834i.mjs +1 -1
- package/.output/server/chunks/build/useAmlFormat-C2sl3MGB.mjs +1 -1
- package/.output/server/chunks/build/useAmlJobs-BF9LpwXz.mjs +1 -1
- package/.output/server/chunks/build/useAmlModels-_bweOr3R.mjs +1 -1
- package/.output/server/chunks/build/useAmlNotes-DQj980iX.mjs +1 -1
- package/.output/server/chunks/build/useAmlPredict-DHNgDSJn.mjs +1 -1
- package/.output/server/chunks/build/useAnalysisFeed-BrEGV_9x.mjs +1 -1
- package/.output/server/chunks/build/useDaqAddNode-D_Rkju0f.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailBinding-DCWaLKXT.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailFrames-BOIcOJRB.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailHistory-D6WulPVs.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailNode-BGMRUIXN.mjs +1 -1
- package/.output/server/chunks/build/useDaqDetailParams-Cm9a9r5G.mjs +1 -1
- package/.output/server/chunks/build/useDaqFilters-zAAVlzJQ.mjs +1 -1
- package/.output/server/chunks/build/useDaqNodeWindow-1DWj2H5G.mjs +1 -1
- package/.output/server/chunks/build/useDaqOptimizations-BE_9Z2s_.mjs +1 -1
- package/.output/server/chunks/build/useDaqTemplates-CK37sMfi.mjs +1 -1
- package/.output/server/chunks/build/useDashboardCharts-D45083s_.mjs +1 -1
- package/.output/server/chunks/build/useDashboardData-Cw8lrPo5.mjs +1 -1
- package/.output/server/chunks/build/useDcwAddNode-KnocMk1m.mjs +1 -1
- package/.output/server/chunks/build/useDcwCards-C53IiOcg.mjs +1 -1
- package/.output/server/chunks/build/useDcwDetailScope-D6qXrfZu.mjs +1 -1
- package/.output/server/chunks/build/useDcwDetailTemplates-DPOXu1o_.mjs +1 -1
- package/.output/server/chunks/build/useDcwFilter-DNQ6Ivwd.mjs +1 -1
- package/.output/server/chunks/build/useDcwLedger-BhbUBCbi.mjs +1 -1
- package/.output/server/chunks/build/useDcwLineMutations-KA7VnggO.mjs +1 -1
- package/.output/server/chunks/build/useDcwLineRun-3zx_UCxi.mjs +1 -1
- package/.output/server/chunks/build/useDcwParamApprovals-DzyY6Tmi.mjs +1 -1
- package/.output/server/chunks/build/useDcwProducts-B05ymt3k.mjs +1 -1
- package/.output/server/chunks/build/useDcwQuery-vWpgpSmJ.mjs +1 -1
- package/.output/server/chunks/build/useDcwQuickActions-DUkLy34S.mjs +1 -1
- package/.output/server/chunks/build/useDcwRecipes-BAb4Yg3d.mjs +1 -1
- package/.output/server/chunks/build/useDcwTemplates-D2aoejps.mjs +1 -1
- package/.output/server/chunks/build/useDcwWrites-7w8txksD.mjs +1 -1
- package/.output/server/chunks/build/useExpConfirmations-BM626N4p.mjs +1 -1
- package/.output/server/chunks/build/useLogsFormat-B-o4MHy7.mjs +1 -1
- package/.output/server/chunks/build/useLogsManual-D0dvgCsP.mjs +1 -1
- package/.output/server/chunks/build/useLogsQuery-D7hrJ3yn.mjs +1 -1
- package/.output/server/chunks/build/useLogsScope-DEUyq-My.mjs +1 -1
- package/.output/server/chunks/build/useMonitorColumns-vVnt3r5Q.mjs +1 -1
- package/.output/server/chunks/build/useMonitorData-DIkiLr_h.mjs +1 -1
- package/.output/server/chunks/build/useMonitorFormat-CyURtH8N.mjs +1 -1
- package/.output/server/chunks/build/useMonitorTerminal-Dj4QwRNW.mjs +1 -1
- package/.output/server/chunks/build/useOperationsFeed-Ci4mZAn_.mjs +1 -1
- package/.output/server/chunks/build/useRecipeDispatchApprovals-BYtiqfeb.mjs +1 -1
- package/.output/server/chunks/build/useTeamActions-BDjU06LP.mjs +1 -1
- package/.output/server/chunks/build/useTeamAddMemberDialog-J3oFn3FI.mjs +1 -1
- package/.output/server/chunks/build/useTeamCreateDialog-fbn4ixYu.mjs +1 -1
- package/.output/server/chunks/build/useTeamDeployDialog-BNezMD2k.mjs +1 -1
- package/.output/server/chunks/build/useTeamDialogState-CFRUQxAf.mjs +1 -1
- package/.output/server/chunks/build/useTeamPluginDialog-BZznrOVe.mjs +1 -1
- package/.output/server/chunks/build/useTeamsCatalog-DuZFP3oG.mjs +1 -1
- package/.output/server/chunks/build/useTokenClipboard-CwQpoFeP.mjs +1 -1
- package/.output/server/chunks/build/useTokenCreate-Ctl0YGhL.mjs +1 -1
- package/.output/server/chunks/build/useTokenRename-Cm3ypSfN.mjs +1 -1
- package/.output/server/chunks/build/useTokenReveal-CeoWL5Mt.mjs +1 -1
- package/.output/server/chunks/build/useTokensList-CNIzON3u.mjs +1 -1
- package/.output/server/chunks/build/useWorkbenchAuth-CY-bVFMu.mjs +1 -1
- package/.output/server/chunks/build/useWorkbenchWorkspaces-DhZQFss9.mjs +1 -1
- package/.output/server/chunks/build/useWorkspaceAuth-Dlvj9csD.mjs +1 -1
- package/.output/server/chunks/build/useWorkspaceChannels-CPFepxTN.mjs +1 -1
- package/.output/server/chunks/build/useWorkspacePanels-CTwREmq0.mjs +1 -1
- package/.output/server/chunks/build/useWorkspaceShell-BCypjjjE.mjs +1 -1
- package/.output/server/chunks/build/users-DjiVC_tS.mjs +1 -1
- package/.output/server/chunks/build/workshop-1gKeDASV.mjs +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
- package/.output/server/chunks/routes/api/metrics.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/i18n.get.mjs +1 -1
- package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/backup/list.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/backup/run.post.mjs +3 -3
- package/.output/server/chunks/routes/api/system/config-groups/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/system/config-groups/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/system/config.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/index.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/system/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/system/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/settings/events.get.mjs +1 -1
- package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +1 -1
- package/.output/server/chunks/routes/api/system/timezone.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/users/change-password.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/login.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/logout.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/register.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/setup-status.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/_...path_.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/grant.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/revoke.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +2 -2
- package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.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/entities/prune.post.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.get.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/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/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/approvals/_id/decide.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.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.get.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.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/audit.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/caller.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_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.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/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/rotate-token.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.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.get.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/chat/messages/_messageId/read.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/chat/permissions.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.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/index.get.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/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/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/index6.get.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/line.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId/approve.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/members/_userId_.delete.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/members/leave.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.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/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.get.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/alarms.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/export/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/export-file.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/index.post.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/infra.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/daq/query.get.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/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/_id_.patch.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/versions.get.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/charts/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/charts/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/charts/_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/dashboards/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/dashboards/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/features/jobs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/features/run.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/golden/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/golden/deviation.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/golden/single.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index2.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index2.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index3.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index3.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index4.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index5.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index5.post.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/index7.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index7.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index8.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/index8.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/ocap/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/ocap/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/runs/_id/labels.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/runs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/spc/_id/recompute.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/spc/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/spc/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/eda/templates/_id_.patch.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.get.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/index10.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index10.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index11.get.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/index15.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index16.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.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index4.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index5.get.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.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/index9.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/datasets.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/index.put.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/points.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/preview.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/mes/secrets/_ref_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/notifications/read.post.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/bindings/_id_.delete.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/plugins/index.get.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 +305 -20
- package/.output/server/chunks/routes/api/workshop/process-model/experiments.mjs.map +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/runtime.get.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/scene/layouts.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/schedules/_id/run.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/schedules/_id/runs.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/schedules/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/reassign.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/reopen.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/supersede.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id/update.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id/index.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/teams/_id/members/_agentId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tools/_name_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/users/register.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/workspaces/_id/channels/_channelId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -1
- package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +2 -2
- package/.output/server/chunks/virtual/entry.mjs +5 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/README-zh.md +3 -3
- package/README.md +3 -3
- package/config.yml +1 -1
- package/docs/aml.md +112 -112
- package/docs/cli.en.md +4 -4
- package/docs/cli.md +3 -3
- package/docs/plugins.en.md +1 -1
- package/docs/plugins.md +1 -1
- package/docs/sdk.en.md +1 -1
- package/docs/sdk.md +1 -1
- package/i18n/locales/en.ts +2 -0
- package/i18n/locales/zh-CN.ts +2 -0
- package/package.json +1 -1
- package/scripts/_audit/demo-shot-studio.mjs +37 -0
- package/scripts/_audit/demo-shots.mjs +38 -0
- package/scripts/_audit/gen-demo-report.py +69 -0
- package/scripts/_audit/mqtt-pub.mjs +13 -0
- package/scripts/_audit/mqtt-topic-probe.mjs +15 -0
- package/scripts/_audit/proto-b3-device-4021.mjs +90 -0
- package/scripts/_audit/proto-doc-device-4120.mjs +53 -0
- package/scripts/acceptance-scientific-loop.ts +224 -0
- package/scripts/generate-identifiability-fixtures.ts +98 -0
- package/server/api/workshop/process-model/experiments.ts +28 -2
- package/server/plugins-builtin/diag-bridge/host/plugin.mjs +759 -753
- package/server/plugins-builtin/rag-bridge/index.mjs +490 -484
- package/server/repositories/user.repository.ts +24 -1
- package/server/services/user.service.ts +8 -6
- package/server/services/workshop/agents/host-tool-bridge/catalog.ts +2 -0
- package/server/services/workshop/agents/host-tool-bridge/tools/industrial.ts +4 -1
- package/server/services/workshop/agents/host-tool-bridge/tools/messaging.ts +5 -1
- package/server/services/workshop/agents/industrial/aml-dataset-tools.ts +3 -0
- package/server/services/workshop/agents/industrial/bench-approval-only.ts +335 -58
- package/server/services/workshop/agents/industrial/dcw-tools.ts +7 -1
- package/server/services/workshop/agents/industrial/identifiability-tools.ts +247 -0
- package/server/services/workshop/agents/industrial/index.ts +1 -0
- package/server/services/workshop/agents/industrial/manual-approval.ts +3 -1
- package/server/services/workshop/agents/industrial/ops-tools.ts +58 -15
- package/server/services/workshop/agents/industrial/optimization-tools.ts +33 -19
- package/server/services/workshop/agents/plugin-governance.ts +22 -2
- package/server/services/workshop/aml/action-coverage.ts +253 -0
- package/server/services/workshop/aml/causal-claim.ts +68 -0
- package/server/services/workshop/aml/dataset-builder.ts +19 -0
- package/server/services/workshop/aml/gates.ts +45 -1
- package/server/services/workshop/aml/identifiability.ts +335 -0
- package/server/services/workshop/aml/intervention-ledger.ts +281 -0
- package/server/services/workshop/aml/ontology-learning.ts +143 -0
- package/server/services/workshop/aml/twin/cross-check.ts +176 -0
- package/server/services/workshop/daq/daq-controller/contracts.ts +3 -0
- package/server/services/workshop/daq/daq-controller/crud.ts +12 -2
- package/server/services/workshop/daq/daq-controller/push.ts +22 -0
- package/server/services/workshop/daq/drivers/mqtt.ts +28 -0
- package/server/services/workshop/daq/drivers/shared.ts +6 -0
- package/server/services/workshop/db/database/open.ts +2 -0
- package/server/services/workshop/db/database/rows.ts +4 -1
- package/server/services/workshop/db/database/schema.ts +38 -2
- package/server/services/workshop/db/message.repo.ts +10 -3
- package/server/services/workshop/dcw/dcw-controller/write-audit.ts +21 -1
- package/server/services/workshop/process-model/experiment-runner.ts +393 -0
- package/server/services/workshop/process-model/experiment.ts +25 -10
- package/server/services/workshop/runtime/agent-runtime/lifecycle.ts +34 -11
- package/server/services/workshop/runtime/agent-runtime/state.ts +6 -1
- package/server/services/workshop/settings.ts +4 -1
- package/server/services/workshop/types/a2a.ts +16 -1
- package/shared/config/schema.json +2 -0
- package/shared/dcw-protocol/closed-loop.ts +2 -0
- package/.output/public/_nuxt/builds/meta/1231252d-2864-43c0-83b2-4e70d3b86dea.json +0 -1
|
@@ -1,484 +1,490 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rag-bridge —— rag-knowledge 知识库桥接插件。
|
|
3
|
-
*
|
|
4
|
-
* 把本地 rag-knowledge 服务(FastAPI 后端 + Nuxt web)集成为 AgentWorkShop 的
|
|
5
|
-
* 团队知识库:启动即确保「aw-industrial」知识库存在,并向 agent 注入三个工具——
|
|
6
|
-
* kb_agent(知识库 Agent 对话)——检索/入库/经验全部由知识库内部 Agent 处理。
|
|
7
|
-
* 另开放 /health、/search、/experience 三个插件 API 便于运维探查。
|
|
8
|
-
* 服务不可达时工具返回 isError 文本(含原因与修复建议),绝不抛异常拖垮宿主。
|
|
9
|
-
*/
|
|
10
|
-
const KB_NAME = 'aw-industrial'
|
|
11
|
-
const DEFAULT_BASE = 'http://127.0.0.1:8770' // FastAPI 后端
|
|
12
|
-
const DEFAULT_WEB = 'http://127.0.0.1:6789' // Nuxt web(文档写盘)
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
name: 'rag-bridge',
|
|
16
|
-
version: '2.
|
|
17
|
-
description: 'rag-knowledge 知识库桥接 v2.1:kb_agent 对话工具(功能解耦,sync/async 双模式)+ kb_agent_status 异步结果查询',
|
|
18
|
-
auth: 'user', // 平台转发层按此声明统一校验(缺省 'none' 开放)
|
|
19
|
-
client: './client.mjs', // 前端面板(插件页注入;i18n 见 i18n.json)
|
|
20
|
-
// 插件配置分组:插件调用平台 API 增加自己的设置分区(设置页独立成区、可折叠)。
|
|
21
|
-
// id 由宿主收敛进 plugin-rag-bridge* 命名空间,不会与其它插件/平台分组撞车;
|
|
22
|
-
// 插件卸载或停用时这两个分区随之消失,不残留空区块。
|
|
23
|
-
configGroups: [
|
|
24
|
-
{ id: 'default', labelKey: 'plugin.rag-bridge.group.conn', label: 'rag-knowledge 连接', description: '后端与 Web 地址(保存即热生效)', order: 400 },
|
|
25
|
-
{ id: 'auth', labelKey: 'plugin.rag-bridge.group.auth', label: 'rag-knowledge 鉴权', description: '服务端开启鉴权时所需 Token', order: 410, collapsed: true },
|
|
26
|
-
],
|
|
27
|
-
// 插件设置声明:key 强制编址 plugins.rag-bridge.<key>,进 SystemConfigService 后
|
|
28
|
-
// 前端设置页自动渲染(labelKey 解析 i18n.json 的 plugin.rag-bridge.settings.*);
|
|
29
|
-
// group 指向上面声明的分区 → 字段按分区隔离展示
|
|
30
|
-
settings: [
|
|
31
|
-
{ key: 'base_url', type: 'string', default: DEFAULT_BASE, group: 'default', labelKey: 'plugin.rag-bridge.settings.base_url', label: 'rag-knowledge 后端地址', description: 'FastAPI 后端(http/https,host 限 127.0.0.1/localhost);保存即热生效' },
|
|
32
|
-
{ key: 'web_url', type: 'string', default: DEFAULT_WEB, group: 'default', labelKey: 'plugin.rag-bridge.settings.web_url', label: 'rag-knowledge Web 地址', description: 'Nuxt Web(文档写盘/目录);保存即热生效' },
|
|
33
|
-
{ key: 'token', type: 'string', default: '', group: 'auth', labelKey: 'plugin.rag-bridge.settings.token', label: 'rag-knowledge API Token', description: '服务端开启鉴权时的 MCP/API Token(Authorization: Bearer);空=匿名;保存即热生效' },
|
|
34
|
-
],
|
|
35
|
-
async setup(ctx) {
|
|
36
|
-
// ---- 运行态 ----
|
|
37
|
-
const state = { outbound: true } // base_url 非法时禁用全部出站调用
|
|
38
|
-
const base = () => trimSlash(String(ctx.config?.get?.('plugins.rag-bridge.base_url') || ctx.kv.get('kb.base_url') || DEFAULT_BASE))
|
|
39
|
-
const web = () => trimSlash(String(ctx.config?.get?.('plugins.rag-bridge.web_url') || ctx.kv.get('kb.web_url') || DEFAULT_WEB))
|
|
40
|
-
const kbId = () => String(ctx.kv.get('kb.id') || '')
|
|
41
|
-
// 鉴权 token(系统配置优先,kv 兜底):rag-knowledge 开启 server.auth 时所有 /api/*
|
|
42
|
-
// 要求 Bearer;backend 与 web 都认 Authorization: Bearer / X-KB-Token 两种头
|
|
43
|
-
const kbToken = () => String(ctx.config?.get?.('plugins.rag-bridge.token') || ctx.kv.get('kb.token') || '').trim()
|
|
44
|
-
const authHeaders = () => {
|
|
45
|
-
const t = kbToken()
|
|
46
|
-
return t ? { 'authorization': `Bearer ${t}`, 'x-kb-token': t } : {}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// ---- kv 默认值(幂等) ----
|
|
50
|
-
if (ctx.kv.get('kb.base_url') == null) ctx.kv.set('kb.base_url', DEFAULT_BASE)
|
|
51
|
-
if (ctx.kv.get('kb.web_url') == null) ctx.kv.set('kb.web_url', DEFAULT_WEB)
|
|
52
|
-
ctx.kv.set('kb.name', KB_NAME)
|
|
53
|
-
|
|
54
|
-
// base_url 守卫:仅 http/https 且 host 必须是 127.0.0.1/localhost(不合法则禁用出站)。
|
|
55
|
-
// 每次配置变更都重算 —— 否则改错地址后旧判定会一直沿用,「独立配置即时生效」不成立。
|
|
56
|
-
const applyOutboundGuard = () => {
|
|
57
|
-
try {
|
|
58
|
-
const u = new URL(base())
|
|
59
|
-
if ((u.protocol !== 'http:' && u.protocol !== 'https:') || !['127.0.0.1', 'localhost'].includes(u.hostname)) {
|
|
60
|
-
throw new Error(`base_url 必须是 http(s)://127.0.0.1|localhost,实际 ${base()}`)
|
|
61
|
-
}
|
|
62
|
-
state.outbound = true
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
state.outbound = false
|
|
66
|
-
ctx.logger.error(`出站调用已禁用:${err?.message ?? err}(修正 rag-bridge 的「后端地址」后即恢复)`)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
applyOutboundGuard()
|
|
70
|
-
// 配置热更新(runtime-settings 变更)→ 立即重算出站开关与下次探活
|
|
71
|
-
ctx.config.onChange(() => applyOutboundGuard())
|
|
72
|
-
|
|
73
|
-
// ---- ensureKB:幂等初始化(失败仅告警,不阻塞装载) ----
|
|
74
|
-
try {
|
|
75
|
-
await ensureKB()
|
|
76
|
-
ctx.logger.info(`rag-bridge 就绪:kb=${KB_NAME}(${kbId() || '待建'}),出站=${state.outbound ? '启用' : '禁用'}`)
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
ctx.logger.warn(`ensureKB 未完成(不影响装载,工具会在服务可用后按需重试):${err?.message ?? err}`)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// ================= 出站 HTTP(重试 + 超时 + success 断言) =================
|
|
83
|
-
|
|
84
|
-
function sleep(ms) {
|
|
85
|
-
return new Promise(resolve => ctx.timer.setTimeout(resolve, ms))
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** 单次 JSON 请求;429/网络错误按 1s*重试次数退避,最多重试 2 次;检索类调用方传 timeoutMs:30000 */
|
|
89
|
-
async function callJson(method, url, body, { timeoutMs = 15000, retries = 2, headers = {} } = {}) {
|
|
90
|
-
let lastErr = ''
|
|
91
|
-
const h = { ...authHeaders(), ...headers }
|
|
92
|
-
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
93
|
-
if (attempt > 0) await sleep(1000 * attempt) // 退避 1s*n
|
|
94
|
-
try {
|
|
95
|
-
const res = method === 'GET'
|
|
96
|
-
? await ctx.http.get(url, { timeoutMs, headers: h })
|
|
97
|
-
: await ctx.http.post(url, body ?? {}, { timeoutMs, headers: h })
|
|
98
|
-
if (res.status === 429) {
|
|
99
|
-
lastErr = `HTTP 429(限流)`
|
|
100
|
-
continue
|
|
101
|
-
}
|
|
102
|
-
if (!res.ok) return { ok: false, status: res.status, error: `HTTP ${res.status}` }
|
|
103
|
-
const json = await res.json().catch(() => null)
|
|
104
|
-
if (json == null) return { ok: false, status: res.status, error: '响应不是合法 JSON' }
|
|
105
|
-
return { ok: true, status: res.status, body: json }
|
|
106
|
-
}
|
|
107
|
-
catch (err) {
|
|
108
|
-
lastErr = err?.message ?? String(err) // 网络错误/超时(AbortSignal.timeout)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return { ok: false, error: lastErr || '未知错误' }
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** rag 业务调用:铁律——HTTP 200 但 body.success !== true 一律视为失败 */
|
|
115
|
-
async function ragCall(method, url, body, opts = {}) {
|
|
116
|
-
const r = await callJson(method, url, body, opts)
|
|
117
|
-
if (!r.ok) return r
|
|
118
|
-
if (r.body?.success !== true) {
|
|
119
|
-
return { ok: false, error: `服务返回 success!=true:${JSON.stringify(r.body).slice(0, 200)}` }
|
|
120
|
-
}
|
|
121
|
-
return r
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const outboundOff = () => ({ ok: false, error: '出站调用已禁用:kv["kb.base_url"] 非法(仅允许 http/https 且 host 为 127.0.0.1/localhost)' })
|
|
125
|
-
|
|
126
|
-
// ================= 异步任务生命周期(提交 → 跟踪 → 进度/结果 → 回执) =================
|
|
127
|
-
// rag-knowledge web 的任务登记表是进程内 Map(TTL 2h / 200 条),进程重启即丢失;
|
|
128
|
-
// 这里把 task_id 与发起者归因落到插件 kv,15s 轮询终态并主动投递平台通告 ——
|
|
129
|
-
// 否则 Agent 提交 async 入库后不主动轮询就永远不知道结果。
|
|
130
|
-
const KB_TASK_PREFIX = 'kbtask:'
|
|
131
|
-
const KB_TASK_TTL_MS = 3 * 60 * 60 * 1000
|
|
132
|
-
let kbPolling = false
|
|
133
|
-
|
|
134
|
-
const kbTaskKey = id => KB_TASK_PREFIX + id
|
|
135
|
-
|
|
136
|
-
async function kbNotify() {
|
|
137
|
-
try {
|
|
138
|
-
return await ctx.services.get('notify')
|
|
139
|
-
}
|
|
140
|
-
catch {
|
|
141
|
-
return null
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async function queryKbTask(taskId) {
|
|
146
|
-
const r = await callJson('GET', web() + '/api/kb/agent/tasks/' + encodeURIComponent(taskId), null, { timeoutMs: 15000, retries: 0 })
|
|
147
|
-
if (!r.ok) return { ok: false, error: String(r.error ?? ''), status: r.status }
|
|
148
|
-
const body = r.body || {}
|
|
149
|
-
return {
|
|
150
|
-
ok: true,
|
|
151
|
-
status: String(body.status ?? 'unknown'),
|
|
152
|
-
reply: String(body.result?.reply ?? body.result?.partial_text ?? '').trim(),
|
|
153
|
-
error: String(body.result?.error ?? '').slice(0, 600),
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
async function deliverKbTask(task, ok, summary) {
|
|
158
|
-
// 无发起者归因(手动调用/旧任务)→ 无收件人,跳过平台回执
|
|
159
|
-
if (!task.agentId) return false
|
|
160
|
-
const notify = await kbNotify()
|
|
161
|
-
if (!notify) {
|
|
162
|
-
ctx.logger.warn(`知识库任务 ${task.taskId} 已结束,但平台通告面不可用(可用 kb_agent_status 查询)`)
|
|
163
|
-
return false
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
const delivered = await notify.deliver({
|
|
167
|
-
kind: 'tool-result',
|
|
168
|
-
tool: 'kb_agent',
|
|
169
|
-
jobId: task.taskId,
|
|
170
|
-
agentId: task.agentId,
|
|
171
|
-
...(task.channelId ? { channelId: task.channelId } : {}),
|
|
172
|
-
ok,
|
|
173
|
-
title: `知识库任务${ok ? '完成' : '失败'}`,
|
|
174
|
-
summary: String(summary || (ok ? '(知识库 Agent 返回空结果)' : '任务失败')).slice(0, 900),
|
|
175
|
-
})
|
|
176
|
-
return delivered !== false
|
|
177
|
-
}
|
|
178
|
-
catch (err) {
|
|
179
|
-
ctx.logger.warn(`知识库任务 ${task.taskId} 回执投递失败:${err?.message ?? err}`)
|
|
180
|
-
return false
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
async function pollKbTasks() {
|
|
185
|
-
if (kbPolling || !state.outbound) return
|
|
186
|
-
kbPolling = true
|
|
187
|
-
try {
|
|
188
|
-
const entries = Object.entries(ctx.kv.all())
|
|
189
|
-
.filter(([k, v]) => k.startsWith(KB_TASK_PREFIX) && v && typeof v === 'object' && !v.deliveredAt)
|
|
190
|
-
for (const [key, task] of entries) {
|
|
191
|
-
if (!task.taskId) continue
|
|
192
|
-
if (Date.now() - Number(task.createdAt || 0) > KB_TASK_TTL_MS) {
|
|
193
|
-
await deliverKbTask(task, false, '任务超过 3 小时仍未结束,已停止跟踪;可稍后用 kb_agent_status 再查一次。')
|
|
194
|
-
ctx.kv.set(key, { ...task, status: 'expired', error: '超过 3 小时未完成', deliveredAt: Date.now() })
|
|
195
|
-
continue
|
|
196
|
-
}
|
|
197
|
-
const q = await queryKbTask(task.taskId)
|
|
198
|
-
if (!q.ok) {
|
|
199
|
-
const attempts = Number(task.pollErrors || 0) + 1
|
|
200
|
-
// 404 = web 重启/任务被淘汰;连续 3 轮仍查不到 → 收敛为 failed 并回执
|
|
201
|
-
if (/HTTP 404/.test(q.error) && attempts >= 3) {
|
|
202
|
-
await deliverKbTask(task, false, `任务已无法查询(HTTP 404,可能因 web 重启或超过 2h 淘汰):${q.error}`)
|
|
203
|
-
ctx.kv.set(key, { ...task, status: 'failed', error: q.error, pollErrors: attempts, deliveredAt: Date.now() })
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
ctx.kv.set(key, { ...task, pollErrors: attempts, lastPollError: q.error })
|
|
207
|
-
}
|
|
208
|
-
continue
|
|
209
|
-
}
|
|
210
|
-
if (q.status === 'running' || q.status === 'queued') {
|
|
211
|
-
ctx.kv.set(key, { ...task, status: q.status, pollErrors: 0 })
|
|
212
|
-
continue
|
|
213
|
-
}
|
|
214
|
-
const okStatus = q.status === 'completed'
|
|
215
|
-
await deliverKbTask(task, okStatus, okStatus ? q.reply : `任务以 ${q.status} 结束:${q.error || '(无错误详情)'}`)
|
|
216
|
-
ctx.kv.set(key, {
|
|
217
|
-
...task,
|
|
218
|
-
status: q.status,
|
|
219
|
-
reply: q.reply.slice(0, 2000),
|
|
220
|
-
error: q.error,
|
|
221
|
-
deliveredAt: Date.now(),
|
|
222
|
-
deliverPending: false,
|
|
223
|
-
})
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
catch (err) {
|
|
227
|
-
ctx.logger.warn(`知识库任务轮询异常(下轮继续):${err?.message ?? err}`)
|
|
228
|
-
}
|
|
229
|
-
finally {
|
|
230
|
-
kbPolling = false
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// ================= ensureKB(catalog 查找 → 建库 → experience init) =================
|
|
235
|
-
|
|
236
|
-
async function ensureKB() {
|
|
237
|
-
// ① catalog 查找同名库(响应 {success,count,knowledgeBases:[{kbId,name,...}]})
|
|
238
|
-
const cat = state.outbound
|
|
239
|
-
? await callJson('GET', `${web()}/api/kb/catalog`, null, { timeoutMs: 10000 })
|
|
240
|
-
: { ok: false, error: '出站已禁用' }
|
|
241
|
-
if (cat.ok) {
|
|
242
|
-
const list = Array.isArray(cat.body?.knowledgeBases) ? cat.body.knowledgeBases : []
|
|
243
|
-
const hit = list.find(kb => kb?.name === KB_NAME)
|
|
244
|
-
if (hit?.kbId) ctx.kv.set('kb.id', hit.kbId)
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
ctx.logger.warn(`catalog 不可达(${cat.error}),跳过查找直接尝试建库`)
|
|
248
|
-
}
|
|
249
|
-
// ② 无则建库(响应 {success,knowledgeBase:{id,name,path,...}})
|
|
250
|
-
if (!kbId()) {
|
|
251
|
-
const created = state.outbound
|
|
252
|
-
? await ragCall('POST', `${web()}/api/kb/create`, { name: KB_NAME, description: 'AgentWorkShop 工业知识库(诊断报告/经验教训/操作规范)' }, { timeoutMs: 15000 })
|
|
253
|
-
: { ok: false, error: '出站已禁用' }
|
|
254
|
-
if (!created.ok) throw new Error(`创建知识库 ${KB_NAME} 失败:${created.error}`)
|
|
255
|
-
const id = created.body?.knowledgeBase?.id
|
|
256
|
-
if (!id) throw new Error(`建库响应缺少 knowledgeBase.id:${JSON.stringify(created.body).slice(0, 200)}`)
|
|
257
|
-
ctx.kv.set('kb.id', id)
|
|
258
|
-
}
|
|
259
|
-
// ③ 经验文件夹初始化(容忍已初始化/失败:仅告警)
|
|
260
|
-
const init = state.outbound
|
|
261
|
-
? await ragCall('POST', `${base()}/api/v1/experience/${kbId()}/init`, {}, { timeoutMs: 15000 })
|
|
262
|
-
: { ok: false, error: '出站已禁用' }
|
|
263
|
-
if (!init.ok) ctx.logger.warn(`experience init 未成功(可忽略或稍后手动重试):${init.error}`)
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/** 工具侧兜底:kv 无 kb.id 时按需重跑 ensureKB */
|
|
267
|
-
async function requireKbId() {
|
|
268
|
-
if (kbId()) return kbId()
|
|
269
|
-
await ensureKB()
|
|
270
|
-
if (kbId()) return kbId()
|
|
271
|
-
return null
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// ================= 工具 ×1(kb_agent —— 功能解耦的唯一入口) =================
|
|
275
|
-
// 外部系统不再拼装检索/入库步骤:一个对话工具把任务原话交给 rag-knowledge
|
|
276
|
-
// 的原生 Agent(claude SDK + QDCVR skill + kb-mcp),检索/入库/经验/图谱全部
|
|
277
|
-
// 由知识库内部 Agent 自主完成,直接返回最终结果。
|
|
278
|
-
|
|
279
|
-
ctx.omp.registerTool({
|
|
280
|
-
name: 'kb_agent',
|
|
281
|
-
label: '知识库Agent',
|
|
282
|
-
description: '与 rag-knowledge 知识库的原生 Agent 对话(知识库操作唯一入口,功能解耦)。把任务原话交给它:检索问答(知识库侧自动走 QDCVR 全流程,返回带引用的可信答案)、文档入库(给出标题与完整 markdown 正文,action=ingest)、经验沉淀(action=ingest)、图谱关联等,全部由知识库内部 Agent 自主处理并返回最终结果。入库类动作会进入平台审批(HITL),批准后才提交。',
|
|
283
|
-
parameters: {
|
|
284
|
-
type: 'object',
|
|
285
|
-
properties: {
|
|
286
|
-
prompt: { type: 'string', description: '给知识库 Agent 的完整任务原话。检索:要查的问题;入库:目标知识库名(缺省 aw-industrial)+文档标题+完整 markdown 正文;经验:标题/类别/问题/解决方案' },
|
|
287
|
-
mode: { type: 'string', enum: ['sync', 'async'], description: '执行方式(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
//
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
return { text: '
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
//
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
await
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
//
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
if (!
|
|
457
|
-
return { success:
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* rag-bridge —— rag-knowledge 知识库桥接插件。
|
|
3
|
+
*
|
|
4
|
+
* 把本地 rag-knowledge 服务(FastAPI 后端 + Nuxt web)集成为 AgentWorkShop 的
|
|
5
|
+
* 团队知识库:启动即确保「aw-industrial」知识库存在,并向 agent 注入三个工具——
|
|
6
|
+
* kb_agent(知识库 Agent 对话)——检索/入库/经验全部由知识库内部 Agent 处理。
|
|
7
|
+
* 另开放 /health、/search、/experience 三个插件 API 便于运维探查。
|
|
8
|
+
* 服务不可达时工具返回 isError 文本(含原因与修复建议),绝不抛异常拖垮宿主。
|
|
9
|
+
*/
|
|
10
|
+
const KB_NAME = 'aw-industrial'
|
|
11
|
+
const DEFAULT_BASE = 'http://127.0.0.1:8770' // FastAPI 后端
|
|
12
|
+
const DEFAULT_WEB = 'http://127.0.0.1:6789' // Nuxt web(文档写盘)
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'rag-bridge',
|
|
16
|
+
version: '2.2.0',
|
|
17
|
+
description: 'rag-knowledge 知识库桥接 v2.1:kb_agent 对话工具(功能解耦,sync/async 双模式)+ kb_agent_status 异步结果查询',
|
|
18
|
+
auth: 'user', // 平台转发层按此声明统一校验(缺省 'none' 开放)
|
|
19
|
+
client: './client.mjs', // 前端面板(插件页注入;i18n 见 i18n.json)
|
|
20
|
+
// 插件配置分组:插件调用平台 API 增加自己的设置分区(设置页独立成区、可折叠)。
|
|
21
|
+
// id 由宿主收敛进 plugin-rag-bridge* 命名空间,不会与其它插件/平台分组撞车;
|
|
22
|
+
// 插件卸载或停用时这两个分区随之消失,不残留空区块。
|
|
23
|
+
configGroups: [
|
|
24
|
+
{ id: 'default', labelKey: 'plugin.rag-bridge.group.conn', label: 'rag-knowledge 连接', description: '后端与 Web 地址(保存即热生效)', order: 400 },
|
|
25
|
+
{ id: 'auth', labelKey: 'plugin.rag-bridge.group.auth', label: 'rag-knowledge 鉴权', description: '服务端开启鉴权时所需 Token', order: 410, collapsed: true },
|
|
26
|
+
],
|
|
27
|
+
// 插件设置声明:key 强制编址 plugins.rag-bridge.<key>,进 SystemConfigService 后
|
|
28
|
+
// 前端设置页自动渲染(labelKey 解析 i18n.json 的 plugin.rag-bridge.settings.*);
|
|
29
|
+
// group 指向上面声明的分区 → 字段按分区隔离展示
|
|
30
|
+
settings: [
|
|
31
|
+
{ key: 'base_url', type: 'string', default: DEFAULT_BASE, group: 'default', labelKey: 'plugin.rag-bridge.settings.base_url', label: 'rag-knowledge 后端地址', description: 'FastAPI 后端(http/https,host 限 127.0.0.1/localhost);保存即热生效' },
|
|
32
|
+
{ key: 'web_url', type: 'string', default: DEFAULT_WEB, group: 'default', labelKey: 'plugin.rag-bridge.settings.web_url', label: 'rag-knowledge Web 地址', description: 'Nuxt Web(文档写盘/目录);保存即热生效' },
|
|
33
|
+
{ key: 'token', type: 'string', default: '', group: 'auth', labelKey: 'plugin.rag-bridge.settings.token', label: 'rag-knowledge API Token', description: '服务端开启鉴权时的 MCP/API Token(Authorization: Bearer);空=匿名;保存即热生效' },
|
|
34
|
+
],
|
|
35
|
+
async setup(ctx) {
|
|
36
|
+
// ---- 运行态 ----
|
|
37
|
+
const state = { outbound: true } // base_url 非法时禁用全部出站调用
|
|
38
|
+
const base = () => trimSlash(String(ctx.config?.get?.('plugins.rag-bridge.base_url') || ctx.kv.get('kb.base_url') || DEFAULT_BASE))
|
|
39
|
+
const web = () => trimSlash(String(ctx.config?.get?.('plugins.rag-bridge.web_url') || ctx.kv.get('kb.web_url') || DEFAULT_WEB))
|
|
40
|
+
const kbId = () => String(ctx.kv.get('kb.id') || '')
|
|
41
|
+
// 鉴权 token(系统配置优先,kv 兜底):rag-knowledge 开启 server.auth 时所有 /api/*
|
|
42
|
+
// 要求 Bearer;backend 与 web 都认 Authorization: Bearer / X-KB-Token 两种头
|
|
43
|
+
const kbToken = () => String(ctx.config?.get?.('plugins.rag-bridge.token') || ctx.kv.get('kb.token') || '').trim()
|
|
44
|
+
const authHeaders = () => {
|
|
45
|
+
const t = kbToken()
|
|
46
|
+
return t ? { 'authorization': `Bearer ${t}`, 'x-kb-token': t } : {}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ---- kv 默认值(幂等) ----
|
|
50
|
+
if (ctx.kv.get('kb.base_url') == null) ctx.kv.set('kb.base_url', DEFAULT_BASE)
|
|
51
|
+
if (ctx.kv.get('kb.web_url') == null) ctx.kv.set('kb.web_url', DEFAULT_WEB)
|
|
52
|
+
ctx.kv.set('kb.name', KB_NAME)
|
|
53
|
+
|
|
54
|
+
// base_url 守卫:仅 http/https 且 host 必须是 127.0.0.1/localhost(不合法则禁用出站)。
|
|
55
|
+
// 每次配置变更都重算 —— 否则改错地址后旧判定会一直沿用,「独立配置即时生效」不成立。
|
|
56
|
+
const applyOutboundGuard = () => {
|
|
57
|
+
try {
|
|
58
|
+
const u = new URL(base())
|
|
59
|
+
if ((u.protocol !== 'http:' && u.protocol !== 'https:') || !['127.0.0.1', 'localhost'].includes(u.hostname)) {
|
|
60
|
+
throw new Error(`base_url 必须是 http(s)://127.0.0.1|localhost,实际 ${base()}`)
|
|
61
|
+
}
|
|
62
|
+
state.outbound = true
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
state.outbound = false
|
|
66
|
+
ctx.logger.error(`出站调用已禁用:${err?.message ?? err}(修正 rag-bridge 的「后端地址」后即恢复)`)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
applyOutboundGuard()
|
|
70
|
+
// 配置热更新(runtime-settings 变更)→ 立即重算出站开关与下次探活
|
|
71
|
+
ctx.config.onChange(() => applyOutboundGuard())
|
|
72
|
+
|
|
73
|
+
// ---- ensureKB:幂等初始化(失败仅告警,不阻塞装载) ----
|
|
74
|
+
try {
|
|
75
|
+
await ensureKB()
|
|
76
|
+
ctx.logger.info(`rag-bridge 就绪:kb=${KB_NAME}(${kbId() || '待建'}),出站=${state.outbound ? '启用' : '禁用'}`)
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
ctx.logger.warn(`ensureKB 未完成(不影响装载,工具会在服务可用后按需重试):${err?.message ?? err}`)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ================= 出站 HTTP(重试 + 超时 + success 断言) =================
|
|
83
|
+
|
|
84
|
+
function sleep(ms) {
|
|
85
|
+
return new Promise(resolve => ctx.timer.setTimeout(resolve, ms))
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** 单次 JSON 请求;429/网络错误按 1s*重试次数退避,最多重试 2 次;检索类调用方传 timeoutMs:30000 */
|
|
89
|
+
async function callJson(method, url, body, { timeoutMs = 15000, retries = 2, headers = {} } = {}) {
|
|
90
|
+
let lastErr = ''
|
|
91
|
+
const h = { ...authHeaders(), ...headers }
|
|
92
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
93
|
+
if (attempt > 0) await sleep(1000 * attempt) // 退避 1s*n
|
|
94
|
+
try {
|
|
95
|
+
const res = method === 'GET'
|
|
96
|
+
? await ctx.http.get(url, { timeoutMs, headers: h })
|
|
97
|
+
: await ctx.http.post(url, body ?? {}, { timeoutMs, headers: h })
|
|
98
|
+
if (res.status === 429) {
|
|
99
|
+
lastErr = `HTTP 429(限流)`
|
|
100
|
+
continue
|
|
101
|
+
}
|
|
102
|
+
if (!res.ok) return { ok: false, status: res.status, error: `HTTP ${res.status}` }
|
|
103
|
+
const json = await res.json().catch(() => null)
|
|
104
|
+
if (json == null) return { ok: false, status: res.status, error: '响应不是合法 JSON' }
|
|
105
|
+
return { ok: true, status: res.status, body: json }
|
|
106
|
+
}
|
|
107
|
+
catch (err) {
|
|
108
|
+
lastErr = err?.message ?? String(err) // 网络错误/超时(AbortSignal.timeout)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { ok: false, error: lastErr || '未知错误' }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** rag 业务调用:铁律——HTTP 200 但 body.success !== true 一律视为失败 */
|
|
115
|
+
async function ragCall(method, url, body, opts = {}) {
|
|
116
|
+
const r = await callJson(method, url, body, opts)
|
|
117
|
+
if (!r.ok) return r
|
|
118
|
+
if (r.body?.success !== true) {
|
|
119
|
+
return { ok: false, error: `服务返回 success!=true:${JSON.stringify(r.body).slice(0, 200)}` }
|
|
120
|
+
}
|
|
121
|
+
return r
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const outboundOff = () => ({ ok: false, error: '出站调用已禁用:kv["kb.base_url"] 非法(仅允许 http/https 且 host 为 127.0.0.1/localhost)' })
|
|
125
|
+
|
|
126
|
+
// ================= 异步任务生命周期(提交 → 跟踪 → 进度/结果 → 回执) =================
|
|
127
|
+
// rag-knowledge web 的任务登记表是进程内 Map(TTL 2h / 200 条),进程重启即丢失;
|
|
128
|
+
// 这里把 task_id 与发起者归因落到插件 kv,15s 轮询终态并主动投递平台通告 ——
|
|
129
|
+
// 否则 Agent 提交 async 入库后不主动轮询就永远不知道结果。
|
|
130
|
+
const KB_TASK_PREFIX = 'kbtask:'
|
|
131
|
+
const KB_TASK_TTL_MS = 3 * 60 * 60 * 1000
|
|
132
|
+
let kbPolling = false
|
|
133
|
+
|
|
134
|
+
const kbTaskKey = id => KB_TASK_PREFIX + id
|
|
135
|
+
|
|
136
|
+
async function kbNotify() {
|
|
137
|
+
try {
|
|
138
|
+
return await ctx.services.get('notify')
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
return null
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function queryKbTask(taskId) {
|
|
146
|
+
const r = await callJson('GET', web() + '/api/kb/agent/tasks/' + encodeURIComponent(taskId), null, { timeoutMs: 15000, retries: 0 })
|
|
147
|
+
if (!r.ok) return { ok: false, error: String(r.error ?? ''), status: r.status }
|
|
148
|
+
const body = r.body || {}
|
|
149
|
+
return {
|
|
150
|
+
ok: true,
|
|
151
|
+
status: String(body.status ?? 'unknown'),
|
|
152
|
+
reply: String(body.result?.reply ?? body.result?.partial_text ?? '').trim(),
|
|
153
|
+
error: String(body.result?.error ?? '').slice(0, 600),
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
async function deliverKbTask(task, ok, summary) {
|
|
158
|
+
// 无发起者归因(手动调用/旧任务)→ 无收件人,跳过平台回执
|
|
159
|
+
if (!task.agentId) return false
|
|
160
|
+
const notify = await kbNotify()
|
|
161
|
+
if (!notify) {
|
|
162
|
+
ctx.logger.warn(`知识库任务 ${task.taskId} 已结束,但平台通告面不可用(可用 kb_agent_status 查询)`)
|
|
163
|
+
return false
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const delivered = await notify.deliver({
|
|
167
|
+
kind: 'tool-result',
|
|
168
|
+
tool: 'kb_agent',
|
|
169
|
+
jobId: task.taskId,
|
|
170
|
+
agentId: task.agentId,
|
|
171
|
+
...(task.channelId ? { channelId: task.channelId } : {}),
|
|
172
|
+
ok,
|
|
173
|
+
title: `知识库任务${ok ? '完成' : '失败'}`,
|
|
174
|
+
summary: String(summary || (ok ? '(知识库 Agent 返回空结果)' : '任务失败')).slice(0, 900),
|
|
175
|
+
})
|
|
176
|
+
return delivered !== false
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
ctx.logger.warn(`知识库任务 ${task.taskId} 回执投递失败:${err?.message ?? err}`)
|
|
180
|
+
return false
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
async function pollKbTasks() {
|
|
185
|
+
if (kbPolling || !state.outbound) return
|
|
186
|
+
kbPolling = true
|
|
187
|
+
try {
|
|
188
|
+
const entries = Object.entries(ctx.kv.all())
|
|
189
|
+
.filter(([k, v]) => k.startsWith(KB_TASK_PREFIX) && v && typeof v === 'object' && !v.deliveredAt)
|
|
190
|
+
for (const [key, task] of entries) {
|
|
191
|
+
if (!task.taskId) continue
|
|
192
|
+
if (Date.now() - Number(task.createdAt || 0) > KB_TASK_TTL_MS) {
|
|
193
|
+
await deliverKbTask(task, false, '任务超过 3 小时仍未结束,已停止跟踪;可稍后用 kb_agent_status 再查一次。')
|
|
194
|
+
ctx.kv.set(key, { ...task, status: 'expired', error: '超过 3 小时未完成', deliveredAt: Date.now() })
|
|
195
|
+
continue
|
|
196
|
+
}
|
|
197
|
+
const q = await queryKbTask(task.taskId)
|
|
198
|
+
if (!q.ok) {
|
|
199
|
+
const attempts = Number(task.pollErrors || 0) + 1
|
|
200
|
+
// 404 = web 重启/任务被淘汰;连续 3 轮仍查不到 → 收敛为 failed 并回执
|
|
201
|
+
if (/HTTP 404/.test(q.error) && attempts >= 3) {
|
|
202
|
+
await deliverKbTask(task, false, `任务已无法查询(HTTP 404,可能因 web 重启或超过 2h 淘汰):${q.error}`)
|
|
203
|
+
ctx.kv.set(key, { ...task, status: 'failed', error: q.error, pollErrors: attempts, deliveredAt: Date.now() })
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
ctx.kv.set(key, { ...task, pollErrors: attempts, lastPollError: q.error })
|
|
207
|
+
}
|
|
208
|
+
continue
|
|
209
|
+
}
|
|
210
|
+
if (q.status === 'running' || q.status === 'queued') {
|
|
211
|
+
ctx.kv.set(key, { ...task, status: q.status, pollErrors: 0 })
|
|
212
|
+
continue
|
|
213
|
+
}
|
|
214
|
+
const okStatus = q.status === 'completed'
|
|
215
|
+
await deliverKbTask(task, okStatus, okStatus ? q.reply : `任务以 ${q.status} 结束:${q.error || '(无错误详情)'}`)
|
|
216
|
+
ctx.kv.set(key, {
|
|
217
|
+
...task,
|
|
218
|
+
status: q.status,
|
|
219
|
+
reply: q.reply.slice(0, 2000),
|
|
220
|
+
error: q.error,
|
|
221
|
+
deliveredAt: Date.now(),
|
|
222
|
+
deliverPending: false,
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch (err) {
|
|
227
|
+
ctx.logger.warn(`知识库任务轮询异常(下轮继续):${err?.message ?? err}`)
|
|
228
|
+
}
|
|
229
|
+
finally {
|
|
230
|
+
kbPolling = false
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// ================= ensureKB(catalog 查找 → 建库 → experience init) =================
|
|
235
|
+
|
|
236
|
+
async function ensureKB() {
|
|
237
|
+
// ① catalog 查找同名库(响应 {success,count,knowledgeBases:[{kbId,name,...}]})
|
|
238
|
+
const cat = state.outbound
|
|
239
|
+
? await callJson('GET', `${web()}/api/kb/catalog`, null, { timeoutMs: 10000 })
|
|
240
|
+
: { ok: false, error: '出站已禁用' }
|
|
241
|
+
if (cat.ok) {
|
|
242
|
+
const list = Array.isArray(cat.body?.knowledgeBases) ? cat.body.knowledgeBases : []
|
|
243
|
+
const hit = list.find(kb => kb?.name === KB_NAME)
|
|
244
|
+
if (hit?.kbId) ctx.kv.set('kb.id', hit.kbId)
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
ctx.logger.warn(`catalog 不可达(${cat.error}),跳过查找直接尝试建库`)
|
|
248
|
+
}
|
|
249
|
+
// ② 无则建库(响应 {success,knowledgeBase:{id,name,path,...}})
|
|
250
|
+
if (!kbId()) {
|
|
251
|
+
const created = state.outbound
|
|
252
|
+
? await ragCall('POST', `${web()}/api/kb/create`, { name: KB_NAME, description: 'AgentWorkShop 工业知识库(诊断报告/经验教训/操作规范)' }, { timeoutMs: 15000 })
|
|
253
|
+
: { ok: false, error: '出站已禁用' }
|
|
254
|
+
if (!created.ok) throw new Error(`创建知识库 ${KB_NAME} 失败:${created.error}`)
|
|
255
|
+
const id = created.body?.knowledgeBase?.id
|
|
256
|
+
if (!id) throw new Error(`建库响应缺少 knowledgeBase.id:${JSON.stringify(created.body).slice(0, 200)}`)
|
|
257
|
+
ctx.kv.set('kb.id', id)
|
|
258
|
+
}
|
|
259
|
+
// ③ 经验文件夹初始化(容忍已初始化/失败:仅告警)
|
|
260
|
+
const init = state.outbound
|
|
261
|
+
? await ragCall('POST', `${base()}/api/v1/experience/${kbId()}/init`, {}, { timeoutMs: 15000 })
|
|
262
|
+
: { ok: false, error: '出站已禁用' }
|
|
263
|
+
if (!init.ok) ctx.logger.warn(`experience init 未成功(可忽略或稍后手动重试):${init.error}`)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** 工具侧兜底:kv 无 kb.id 时按需重跑 ensureKB */
|
|
267
|
+
async function requireKbId() {
|
|
268
|
+
if (kbId()) return kbId()
|
|
269
|
+
await ensureKB()
|
|
270
|
+
if (kbId()) return kbId()
|
|
271
|
+
return null
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// ================= 工具 ×1(kb_agent —— 功能解耦的唯一入口) =================
|
|
275
|
+
// 外部系统不再拼装检索/入库步骤:一个对话工具把任务原话交给 rag-knowledge
|
|
276
|
+
// 的原生 Agent(claude SDK + QDCVR skill + kb-mcp),检索/入库/经验/图谱全部
|
|
277
|
+
// 由知识库内部 Agent 自主完成,直接返回最终结果。
|
|
278
|
+
|
|
279
|
+
ctx.omp.registerTool({
|
|
280
|
+
name: 'kb_agent',
|
|
281
|
+
label: '知识库Agent',
|
|
282
|
+
description: '与 rag-knowledge 知识库的原生 Agent 对话(知识库操作唯一入口,功能解耦)。把任务原话交给它:检索问答(知识库侧自动走 QDCVR 全流程,返回带引用的可信答案)、文档入库(给出标题与完整 markdown 正文,action=ingest)、经验沉淀(action=ingest)、图谱关联等,全部由知识库内部 Agent 自主处理并返回最终结果。入库类动作会进入平台审批(HITL),批准后才提交。',
|
|
283
|
+
parameters: {
|
|
284
|
+
type: 'object',
|
|
285
|
+
properties: {
|
|
286
|
+
prompt: { type: 'string', description: '给知识库 Agent 的完整任务原话。检索:要查的问题;入库:目标知识库名(缺省 aw-industrial)+文档标题+完整 markdown 正文;经验:标题/类别/问题/解决方案' },
|
|
287
|
+
mode: { type: 'string', enum: ['sync', 'async'], description: '执行方式(旧口径,建议改用 wait/wait_seconds):sync 同步等待;async 立即返回 task_id 后台跑' },
|
|
288
|
+
wait: { type: 'boolean', description: '是否等待结果(推荐口径):true=本次调用挂起直到知识库任务终态——成功/失败都返回完整结果,任务未完不返回;false/缺省=提交即返 task_id 后台跑(结果存后台任务台账,kb_agent_status(task_id) 随时可查)' },
|
|
289
|
+
wait_seconds: { type: 'number', description: 'wait=true 的等待上限秒(缺省 600,上限 1800);窗口内未完则如实返回 running 态与 task_id,任务后台继续并仍会自动回执' },
|
|
290
|
+
action: { type: 'string', enum: ['query', 'ingest'], description: '动作类别:query=只读检索问答(缺省);ingest=写知识库(文档入库/经验沉淀),平台会挂 HITL 审批单,批准前不提交后端。入库务必显式声明 action=ingest。' },
|
|
291
|
+
},
|
|
292
|
+
required: ['prompt'],
|
|
293
|
+
},
|
|
294
|
+
roles: ['lead', 'worker'],
|
|
295
|
+
riskClass: 'write',
|
|
296
|
+
noRefs: true,
|
|
297
|
+
handler: async (args, agent) => {
|
|
298
|
+
if (!state.outbound) {
|
|
299
|
+
return { text: '知识库 Agent 不可用:' + outboundOff().error + '。修复后重启服务。', isError: true }
|
|
300
|
+
}
|
|
301
|
+
const prompt = String(args.prompt ?? '').trim()
|
|
302
|
+
if (!prompt) return { text: 'prompt 必填(把要做的任务完整描述给知识库 Agent)。', isError: true }
|
|
303
|
+
// 等待语义:wait=true 显式挂起到终态(成功/失败都给完整结果);wait=false/缺省=提交即返。
|
|
304
|
+
// 挂起期间 Agent 的回合被本工具调用占住——结构上保证"任务未完不能标记完成"。
|
|
305
|
+
const legacyAsync = args.wait === undefined && String(args.mode ?? '').trim().toLowerCase() === 'async'
|
|
306
|
+
const mode = (args.wait === false || legacyAsync) ? 'async' : 'sync'
|
|
307
|
+
const waitSec = Math.min(Math.max(Math.round(Number(args.wait_seconds ?? 600) || 600), 10), 1800)
|
|
308
|
+
// 权限档由服务端固定(不再接受调用方透传):历史参数 permission/harness 一律忽略。
|
|
309
|
+
// 缺省 'default' 标准审批档;此前缺省传递 bypassPermissions 允许 Agent 自行提权。
|
|
310
|
+
const body = { prompt, timeout_ms: mode === 'sync' ? waitSec * 1000 : 540000, mode, permission: 'default' }
|
|
311
|
+
|
|
312
|
+
if (mode === 'async') {
|
|
313
|
+
// 异步:立即返回 task_id,知识库后台完成;结果稍后用 kb_agent_status 查询
|
|
314
|
+
const sub = await ragCall('POST', web() + '/api/kb/agent/chat', body, { timeoutMs: 30000, retries: 0 })
|
|
315
|
+
if (!sub.ok) {
|
|
316
|
+
return { text: '知识库异步任务提交失败:' + String(sub.error ?? '').slice(0, 200) + '。请确认 rag-knowledge web(' + web() + ') 已启动后重试。', isError: true }
|
|
317
|
+
}
|
|
318
|
+
const taskId = String(sub.body?.task_id ?? '')
|
|
319
|
+
if (!taskId) return { text: '知识库异步任务提交异常:响应缺少 task_id。', isError: true }
|
|
320
|
+
// 落 kv:异步任务与发起者归因,供后台轮询主动回执;进程重启后仍可继续跟踪
|
|
321
|
+
ctx.kv.set(kbTaskKey(taskId), {
|
|
322
|
+
taskId,
|
|
323
|
+
createdAt: Date.now(),
|
|
324
|
+
status: 'running',
|
|
325
|
+
agentId: agent?.agentId ?? '',
|
|
326
|
+
channelId: agent?.channelId ?? '',
|
|
327
|
+
prompt: prompt.slice(0, 160),
|
|
328
|
+
})
|
|
329
|
+
return { text: '已提交知识库异步任务(后台执行中,无需等待):\ntask_id=' + taskId + '\n完成后平台会自动回执到你的信箱并唤醒你;空闲时也可调用 kb_agent_status(task_id, wait_seconds=120) 等待并获取结果。' }
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// 同步请求禁止网络重试:POST 可能已在知识库侧启动回合,重试会重复入库/重复生成
|
|
333
|
+
const r = await ragCall('POST', web() + '/api/kb/agent/chat', body, { timeoutMs: waitSec * 1000 + 30000, retries: 0 })
|
|
334
|
+
if (!r.ok) {
|
|
335
|
+
return { text: '知识库 Agent 调用失败(本次调用即终态,失败结果已如实返回):' + String(r.error ?? '').slice(0, 300) + '。请确认 rag-knowledge web(' + web() + ') 已启动后重试。', isError: true }
|
|
336
|
+
}
|
|
337
|
+
const reply = String(r.body?.reply ?? '').trim()
|
|
338
|
+
return { text: '✅ 知识库任务完成(等待到终态)。\n\n' + (reply || '(知识库 Agent 返回空回复)') }
|
|
339
|
+
},
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
ctx.omp.registerTool({
|
|
343
|
+
name: 'kb_agent_status',
|
|
344
|
+
label: '知识库任务状态',
|
|
345
|
+
description: '查询知识库异步任务的执行状态与结果(kb_agent 以 mode=async 提交后,用返回的 task_id 查询;任务完成后返回知识库 Agent 的完整结果)。可传 wait_seconds 最长等 120s:任务在窗口内完成则直接返回结果,免反复轮询。',
|
|
346
|
+
parameters: {
|
|
347
|
+
type: 'object',
|
|
348
|
+
properties: {
|
|
349
|
+
task_id: { type: 'string', description: 'kb_agent 异步提交时返回的 task_id' },
|
|
350
|
+
wait_seconds: { type: 'number', description: '长轮询等待秒数(0=立即返回,默认 0,上限 1800);任务在窗口内完成则直接返回结果' },
|
|
351
|
+
},
|
|
352
|
+
required: ['task_id'],
|
|
353
|
+
},
|
|
354
|
+
roles: ['lead', 'worker'],
|
|
355
|
+
handler: async (args) => {
|
|
356
|
+
if (!state.outbound) {
|
|
357
|
+
return { text: '知识库 Agent 不可用:' + outboundOff().error + '。修复后重启服务。', isError: true }
|
|
358
|
+
}
|
|
359
|
+
const taskId = String(args.task_id ?? '').trim()
|
|
360
|
+
if (!taskId) return { text: 'task_id 必填(kb_agent 异步提交时返回的 id)。', isError: true }
|
|
361
|
+
const waitSec = Math.min(Math.max(Math.round(Number(args.wait_seconds ?? 0) || 0), 0), 1800)
|
|
362
|
+
const finish = async (reply, ok) => {
|
|
363
|
+
// 终态由轮询面亲自看到 → 认领回执所有权,取消后台补送(先到先得)
|
|
364
|
+
try {
|
|
365
|
+
const notify = await kbNotify()
|
|
366
|
+
notify?.claim?.('kb_agent', taskId)
|
|
367
|
+
}
|
|
368
|
+
catch { /* 未接线时忽略 */ }
|
|
369
|
+
const known = ctx.kv.get(kbTaskKey(taskId))
|
|
370
|
+
if (known) ctx.kv.set(kbTaskKey(taskId), { ...known, deliveredAt: Date.now(), deliveredBy: 'kb_agent_status', ...(ok != null ? { status: ok ? 'completed' : 'failed' } : {}) })
|
|
371
|
+
return reply
|
|
372
|
+
}
|
|
373
|
+
const queryOnce = async () => {
|
|
374
|
+
const q = await queryKbTask(taskId)
|
|
375
|
+
if (!q.ok) {
|
|
376
|
+
return { text: '任务查询失败:' + q.error + '(不存在/已过期 2h/服务重启过,或任务从未提交)。', isError: true }
|
|
377
|
+
}
|
|
378
|
+
if (q.status === 'running' || q.status === 'queued') return null
|
|
379
|
+
if (q.status === 'completed') {
|
|
380
|
+
return { text: await finish('任务 ' + taskId + ' 已完成。知识库 Agent 结果:\n\n' + (q.reply || '(知识库 Agent 返回空结果)'), true) }
|
|
381
|
+
}
|
|
382
|
+
return { text: await finish('任务 ' + taskId + ' 状态:' + q.status + '\n' + (q.error || '(无错误详情)'), false) }
|
|
383
|
+
}
|
|
384
|
+
// 长轮询:5s 步进,窗口内完成即返回结果
|
|
385
|
+
const deadline = Date.now() + waitSec * 1000
|
|
386
|
+
for (;;) {
|
|
387
|
+
const got = await queryOnce()
|
|
388
|
+
if (got) return got
|
|
389
|
+
if (Date.now() >= deadline) {
|
|
390
|
+
return { text: '任务 ' + taskId + ' 仍在后台执行中(running,已等待 ' + waitSec + 's)。稍后再次查询;完成后平台也会自动回执。' }
|
|
391
|
+
}
|
|
392
|
+
await sleep(5000)
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
})
|
|
396
|
+
|
|
397
|
+
// 后台轮询:15s 一次,终态主动回执(与 diag-bridge sweep 同构)
|
|
398
|
+
ctx.timer.setInterval(() => {
|
|
399
|
+
pollKbTasks().catch(err => ctx.logger.warn(`知识库任务轮询异常(继续):${err?.message ?? err}`))
|
|
400
|
+
}, 15000)
|
|
401
|
+
pollKbTasks().catch(() => {})
|
|
402
|
+
|
|
403
|
+
// ================= 插件 API ×3(/api/plugins/rag-bridge/**) =================
|
|
404
|
+
|
|
405
|
+
/** 从 h3 event 取查询参数(转发层只预挂 awBody;query 在 event.path 上) */
|
|
406
|
+
function queryOf(event) {
|
|
407
|
+
const raw = String(event?.path ?? event?.node?.req?.url ?? '')
|
|
408
|
+
const q = {}
|
|
409
|
+
try {
|
|
410
|
+
const u = new URL(raw, 'http://local')
|
|
411
|
+
for (const [k, v] of u.searchParams.entries()) q[k] = v
|
|
412
|
+
}
|
|
413
|
+
catch { /* 忽略,返回空 */ }
|
|
414
|
+
return q
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// 健康:后端 + web 存活、kb.id(缺失时按需自愈 ensureKB,token 后配的场景)、出站开关
|
|
418
|
+
ctx.route('GET', '/health', async () => {
|
|
419
|
+
const backend = state.outbound
|
|
420
|
+
? await callJson('GET', `${base()}/api/v1/health`, null, { timeoutMs: 5000, retries: 0 })
|
|
421
|
+
: { ok: false, error: '出站已禁用' }
|
|
422
|
+
const webR = state.outbound
|
|
423
|
+
? await callJson('GET', `${web()}/api/kb/catalog`, null, { timeoutMs: 5000, retries: 0 })
|
|
424
|
+
: { ok: false, error: '出站已禁用' }
|
|
425
|
+
if (!kbId() && state.outbound && backend.ok && webR.ok) {
|
|
426
|
+
await ensureKB().catch(() => {}) // 装载期 401/不可达导致 kb.id 缺失 → 探活时自愈
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
plugin: 'rag-bridge',
|
|
430
|
+
outbound: state.outbound,
|
|
431
|
+
auth: kbToken() ? 'bearer' : 'anonymous',
|
|
432
|
+
// token 配置与「实测是否被接受」分开呈现:401/403 = 明确被拒(运维一眼看出 token 配错),
|
|
433
|
+
// 网络不通/超时为 null(未知),2xx 或非鉴权类失败为 true(未被拒)。
|
|
434
|
+
// 实测打受保护 GET /api/v1/auth/me —— rag 后端 GET 只读端点公开(/health 匿名可过,
|
|
435
|
+
// 测不出 token 对错),/auth/me 无 token/错 token 均 401。
|
|
436
|
+
token: {
|
|
437
|
+
configured: Boolean(kbToken()),
|
|
438
|
+
accepted: await (async () => {
|
|
439
|
+
if (!state.outbound) return null
|
|
440
|
+
if (!kbToken()) return backend.ok ? true : null
|
|
441
|
+
const me = await callJson('GET', `${base()}/api/v1/auth/me`, null, { timeoutMs: 5000, retries: 0 })
|
|
442
|
+
return me.ok ? true : (me.status === 401 || me.status === 403 ? false : null)
|
|
443
|
+
})(),
|
|
444
|
+
},
|
|
445
|
+
kb: { name: KB_NAME, id: kbId() || null },
|
|
446
|
+
backend: { url: base(), ok: backend.ok, ...(backend.ok ? { status: backend.body?.status ?? null } : { status: backend.status ?? null, error: backend.error }) },
|
|
447
|
+
web: { url: web(), ok: webR.ok, ...(webR.ok ? { knowledgeBases: webR.body?.count ?? null } : { error: webR.error }) },
|
|
448
|
+
counters: { store: ctx.kv.get('store.count') ?? 0, index: ctx.kv.get('index.count') ?? 0 },
|
|
449
|
+
}
|
|
450
|
+
})
|
|
451
|
+
|
|
452
|
+
// 检索:复用 two-stage(?q=&kb_id=&top_k=)
|
|
453
|
+
ctx.route('GET', '/search', async (event) => {
|
|
454
|
+
const q = queryOf(event)
|
|
455
|
+
const query = String(q.q ?? '').trim()
|
|
456
|
+
if (!query) return { success: false, error: '缺少参数 q(检索词)' }
|
|
457
|
+
if (!state.outbound) return { success: false, error: outboundOff().error }
|
|
458
|
+
const kb = String(q.kb_id ?? '').trim() || kbId() || undefined
|
|
459
|
+
const topK = Math.min(Math.max(Math.round(Number(q.top_k) || 5), 1), 20)
|
|
460
|
+
const r = await ragCall('POST', `${base()}/api/v1/search/two-stage`,
|
|
461
|
+
{ query, kb_id: kb, stage2_top_k: topK }, { timeoutMs: 30000 })
|
|
462
|
+
if (!r.ok) return { success: false, error: r.error }
|
|
463
|
+
return { success: true, query, total_results: r.body?.total_results ?? null, results: r.body?.stage2?.results ?? [] }
|
|
464
|
+
})
|
|
465
|
+
|
|
466
|
+
// 经验列表:GET {base}/api/v1/experience/{kb_id} → {success,count,experiences:[...]}(?limit= 截取)
|
|
467
|
+
ctx.route('GET', '/experience', async (event) => {
|
|
468
|
+
const q = queryOf(event)
|
|
469
|
+
if (!state.outbound) return { success: false, error: outboundOff().error }
|
|
470
|
+
const kb = await requireKbId()
|
|
471
|
+
if (!kb) return { success: false, error: `知识库 ${KB_NAME} 不存在且自动建库失败(检查 web ${web()})` }
|
|
472
|
+
const limit = Math.min(Math.max(Math.round(Number(q.limit) || 20), 1), 100)
|
|
473
|
+
const r = await ragCall('GET', `${base()}/api/v1/experience/${kb}`, null, { timeoutMs: 15000 })
|
|
474
|
+
if (!r.ok) return { success: false, error: `经验列表不可用:${r.error}` }
|
|
475
|
+
const all = Array.isArray(r.body?.experiences) ? r.body.experiences : []
|
|
476
|
+
return {
|
|
477
|
+
success: true,
|
|
478
|
+
kb: { name: KB_NAME, id: kb },
|
|
479
|
+
count: all.length,
|
|
480
|
+
experiences: all.slice(0, limit),
|
|
481
|
+
}
|
|
482
|
+
})
|
|
483
|
+
},
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// ================= 纯函数小工具 =================
|
|
487
|
+
|
|
488
|
+
function trimSlash(s) {
|
|
489
|
+
return s.replace(/\/+$/, '')
|
|
490
|
+
}
|