claude-flow 3.32.26 → 3.32.30
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/node_modules/@claude-flow/codex/.agents/skills/memory-management/SKILL.md +45 -0
- package/node_modules/@claude-flow/codex/.agents/skills/security-audit/SKILL.md +46 -0
- package/node_modules/@claude-flow/codex/.agents/skills/sparc-methodology/SKILL.md +46 -0
- package/node_modules/@claude-flow/codex/.agents/skills/swarm-orchestration/SKILL.md +53 -0
- package/node_modules/@claude-flow/codex/README.md +1044 -0
- package/node_modules/@claude-flow/codex/dist/cli.d.ts +9 -0
- package/node_modules/@claude-flow/codex/dist/cli.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/cli.js +686 -0
- package/node_modules/@claude-flow/codex/dist/cli.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts +17 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/cli.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js +278 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/cli.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/index.d.ts +8 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/index.js +7 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts +143 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js +621 -0
- package/node_modules/@claude-flow/codex/dist/dual-mode/orchestrator.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts +12 -0
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.js +730 -0
- package/node_modules/@claude-flow/codex/dist/generators/agents-md.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/config-toml.d.ts +74 -0
- package/node_modules/@claude-flow/codex/dist/generators/config-toml.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/config-toml.js +922 -0
- package/node_modules/@claude-flow/codex/dist/generators/config-toml.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.d.ts +9 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.js +9 -0
- package/node_modules/@claude-flow/codex/dist/generators/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts +20 -0
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.js +951 -0
- package/node_modules/@claude-flow/codex/dist/generators/skill-md.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/build-evidence.d.ts +46 -0
- package/node_modules/@claude-flow/codex/dist/harness/build-evidence.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/build-evidence.js +126 -0
- package/node_modules/@claude-flow/codex/dist/harness/build-evidence.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/contract.d.ts +153 -0
- package/node_modules/@claude-flow/codex/dist/harness/contract.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/contract.js +44 -0
- package/node_modules/@claude-flow/codex/dist/harness/contract.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.d.ts +33 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.js +175 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-fenced-lease-reference.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.d.ts +42 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.js +140 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-inbox-reference.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.d.ts +19 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.js +79 -0
- package/node_modules/@claude-flow/codex/dist/harness/in-memory-run-receipt-reference.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/index.d.ts +9 -0
- package/node_modules/@claude-flow/codex/dist/harness/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/index.js +9 -0
- package/node_modules/@claude-flow/codex/dist/harness/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.d.ts +8 -0
- package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.js +10 -0
- package/node_modules/@claude-flow/codex/dist/harness/portable-case-fold.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/repository-state.d.ts +68 -0
- package/node_modules/@claude-flow/codex/dist/harness/repository-state.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/repository-state.js +403 -0
- package/node_modules/@claude-flow/codex/dist/harness/repository-state.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.d.ts +3 -0
- package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.js +14 -0
- package/node_modules/@claude-flow/codex/dist/harness/unsigned-integer.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/index.d.ts +53 -0
- package/node_modules/@claude-flow/codex/dist/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/index.js +54 -0
- package/node_modules/@claude-flow/codex/dist/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/initializer.d.ts +98 -0
- package/node_modules/@claude-flow/codex/dist/initializer.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/initializer.js +795 -0
- package/node_modules/@claude-flow/codex/dist/initializer.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/loop/cli.d.ts +3 -0
- package/node_modules/@claude-flow/codex/dist/loop/cli.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/loop/cli.js +123 -0
- package/node_modules/@claude-flow/codex/dist/loop/cli.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/loop/index.d.ts +58 -0
- package/node_modules/@claude-flow/codex/dist/loop/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/loop/index.js +230 -0
- package/node_modules/@claude-flow/codex/dist/loop/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/mcp-config.d.ts +28 -0
- package/node_modules/@claude-flow/codex/dist/mcp-config.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/mcp-config.js +121 -0
- package/node_modules/@claude-flow/codex/dist/mcp-config.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/migrations/index.d.ts +114 -0
- package/node_modules/@claude-flow/codex/dist/migrations/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/migrations/index.js +880 -0
- package/node_modules/@claude-flow/codex/dist/migrations/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/templates/index.d.ts +92 -0
- package/node_modules/@claude-flow/codex/dist/templates/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/templates/index.js +284 -0
- package/node_modules/@claude-flow/codex/dist/templates/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/types.d.ts +240 -0
- package/node_modules/@claude-flow/codex/dist/types.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/types.js +8 -0
- package/node_modules/@claude-flow/codex/dist/types.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/validators/index.d.ts +42 -0
- package/node_modules/@claude-flow/codex/dist/validators/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/validators/index.js +929 -0
- package/node_modules/@claude-flow/codex/dist/validators/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.d.ts +37 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.js +137 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/coordinator.js.map +1 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/index.d.ts +2 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/index.js +2 -0
- package/node_modules/@claude-flow/codex/dist/worktrees/index.js.map +1 -0
- package/node_modules/@claude-flow/codex/package.json +122 -0
- package/node_modules/@claude-flow/plugin-agent-federation/README.md +49 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.d.ts +130 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.js +239 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/agent-card.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.d.ts +34 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.js +69 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/consume.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.d.ts +46 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.js +84 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/a2a/well-known.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.d.ts +27 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.js +46 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/claim-checker.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.d.ts +192 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.js +253 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-breaker-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.d.ts +211 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js +501 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/federation-coordinator.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.d.ts +114 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.js +356 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/inbound-dispatcher.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts +41 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js +184 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/policy-engine.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.d.ts +150 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.js +128 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/spend-reporter.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.d.ts +74 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.js +179 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/application/trust-evaluator.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.d.ts +13 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js +189 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/bin.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.d.ts +7 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.js +317 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/cli-commands.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.d.ts +45 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.js +71 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-envelope.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.d.ts +104 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.js +152 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-node.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.d.ts +55 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.js +105 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/federation-session.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.d.ts +17 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.js +35 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/entities/trust-level.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.d.ts +69 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.js +149 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/audit-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.d.ts +68 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.js +161 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/discovery-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.d.ts +58 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.js +122 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/handshake-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.d.ts +65 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.js +208 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/pii-pipeline-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts +51 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js +147 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/routing-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.d.ts +71 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.js +194 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-firewall-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.d.ts +156 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.js +292 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-mesh-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.d.ts +98 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.js +122 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/services/wg-witness-service.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.d.ts +89 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.js +165 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-budget.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.d.ts +92 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.js +100 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/federation-node-state.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.d.ts +70 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.js +104 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/domain/value-objects/wg-config.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/index.d.ts +23 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/index.js +24 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/index.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.d.ts +10 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.js +439 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/mcp-tools.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts +19 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js +515 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/plugin.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.d.ts +72 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.js +269 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/transport/midstream-aware-loader.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/version.d.ts +3 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/version.d.ts.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/version.js +3 -0
- package/node_modules/@claude-flow/plugin-agent-federation/dist/version.js.map +1 -0
- package/node_modules/@claude-flow/plugin-agent-federation/package.json +64 -0
- package/node_modules/@claude-flow/security/README.md +292 -0
- package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.d.ts +97 -0
- package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.js +537 -0
- package/node_modules/@claude-flow/security/dist/CVE-REMEDIATION.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/application/index.d.ts +7 -0
- package/node_modules/@claude-flow/security/dist/application/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/application/index.js +7 -0
- package/node_modules/@claude-flow/security/dist/application/index.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/application/services/security-application-service.d.ts +71 -0
- package/node_modules/@claude-flow/security/dist/application/services/security-application-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/application/services/security-application-service.js +153 -0
- package/node_modules/@claude-flow/security/dist/application/services/security-application-service.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/authorization/propagator.d.ts +148 -0
- package/node_modules/@claude-flow/security/dist/authorization/propagator.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/authorization/propagator.js +182 -0
- package/node_modules/@claude-flow/security/dist/authorization/propagator.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/credential-generator.d.ts +176 -0
- package/node_modules/@claude-flow/security/dist/credential-generator.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/credential-generator.js +272 -0
- package/node_modules/@claude-flow/security/dist/credential-generator.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/domain/entities/security-context.d.ts +68 -0
- package/node_modules/@claude-flow/security/dist/domain/entities/security-context.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/domain/entities/security-context.js +132 -0
- package/node_modules/@claude-flow/security/dist/domain/entities/security-context.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/domain/index.d.ts +8 -0
- package/node_modules/@claude-flow/security/dist/domain/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/domain/index.js +8 -0
- package/node_modules/@claude-flow/security/dist/domain/index.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.d.ts +71 -0
- package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.js +237 -0
- package/node_modules/@claude-flow/security/dist/domain/services/security-domain-service.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/index.d.ts +129 -0
- package/node_modules/@claude-flow/security/dist/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/index.js +176 -0
- package/node_modules/@claude-flow/security/dist/index.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts +306 -0
- package/node_modules/@claude-flow/security/dist/input-validator.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/input-validator.js +393 -0
- package/node_modules/@claude-flow/security/dist/input-validator.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/keychain-adapter.d.ts +48 -0
- package/node_modules/@claude-flow/security/dist/keychain-adapter.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/keychain-adapter.js +0 -0
- package/node_modules/@claude-flow/security/dist/keychain-adapter.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.d.ts +133 -0
- package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.js +254 -0
- package/node_modules/@claude-flow/security/dist/mcp-composition-inspector.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/browser.d.ts +31 -0
- package/node_modules/@claude-flow/security/dist/oauth/browser.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/browser.js +55 -0
- package/node_modules/@claude-flow/security/dist/oauth/browser.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/callback-server.d.ts +37 -0
- package/node_modules/@claude-flow/security/dist/oauth/callback-server.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/callback-server.js +86 -0
- package/node_modules/@claude-flow/security/dist/oauth/callback-server.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/client.d.ts +57 -0
- package/node_modules/@claude-flow/security/dist/oauth/client.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/client.js +120 -0
- package/node_modules/@claude-flow/security/dist/oauth/client.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/pkce.d.ts +25 -0
- package/node_modules/@claude-flow/security/dist/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/oauth/pkce.js +36 -0
- package/node_modules/@claude-flow/security/dist/oauth/pkce.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/password-hasher.d.ts +128 -0
- package/node_modules/@claude-flow/security/dist/password-hasher.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/password-hasher.js +190 -0
- package/node_modules/@claude-flow/security/dist/password-hasher.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/path-validator.d.ts +148 -0
- package/node_modules/@claude-flow/security/dist/path-validator.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/path-validator.js +421 -0
- package/node_modules/@claude-flow/security/dist/path-validator.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts +125 -0
- package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js +186 -0
- package/node_modules/@claude-flow/security/dist/plugins/integrity-verifier.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/canonical.d.ts +5 -0
- package/node_modules/@claude-flow/security/dist/policy/canonical.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/canonical.js +30 -0
- package/node_modules/@claude-flow/security/dist/policy/canonical.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/engine.d.ts +34 -0
- package/node_modules/@claude-flow/security/dist/policy/engine.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/engine.js +285 -0
- package/node_modules/@claude-flow/security/dist/policy/engine.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/envelope.d.ts +9 -0
- package/node_modules/@claude-flow/security/dist/policy/envelope.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/envelope.js +90 -0
- package/node_modules/@claude-flow/security/dist/policy/envelope.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/evaluator.d.ts +4 -0
- package/node_modules/@claude-flow/security/dist/policy/evaluator.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/evaluator.js +119 -0
- package/node_modules/@claude-flow/security/dist/policy/evaluator.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/index.d.ts +7 -0
- package/node_modules/@claude-flow/security/dist/policy/index.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/index.js +7 -0
- package/node_modules/@claude-flow/security/dist/policy/index.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/product-plane.d.ts +238 -0
- package/node_modules/@claude-flow/security/dist/policy/product-plane.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/product-plane.js +1022 -0
- package/node_modules/@claude-flow/security/dist/policy/product-plane.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/types.d.ts +169 -0
- package/node_modules/@claude-flow/security/dist/policy/types.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/policy/types.js +2 -0
- package/node_modules/@claude-flow/security/dist/policy/types.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/safe-executor.d.ts +180 -0
- package/node_modules/@claude-flow/security/dist/safe-executor.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/safe-executor.js +390 -0
- package/node_modules/@claude-flow/security/dist/safe-executor.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/token-generator.d.ts +224 -0
- package/node_modules/@claude-flow/security/dist/token-generator.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/token-generator.js +351 -0
- package/node_modules/@claude-flow/security/dist/token-generator.js.map +1 -0
- package/node_modules/@claude-flow/security/dist/tool-output-guardrail.d.ts +126 -0
- package/node_modules/@claude-flow/security/dist/tool-output-guardrail.d.ts.map +1 -0
- package/node_modules/@claude-flow/security/dist/tool-output-guardrail.js +257 -0
- package/node_modules/@claude-flow/security/dist/tool-output-guardrail.js.map +1 -0
- package/node_modules/@claude-flow/security/package.json +44 -0
- package/package.json +30 -8
- package/v3/@claude-flow/cli/catalog-manifest.json +4 -4
- package/v3/@claude-flow/cli/dist/src/commands/index.d.ts +1 -0
- package/v3/@claude-flow/cli/dist/src/commands/index.js +5 -3
- package/v3/@claude-flow/cli/dist/src/commands/memory.js +49 -5
- package/v3/@claude-flow/cli/dist/src/commands/metaharness.js +25 -5
- package/v3/@claude-flow/cli/dist/src/commands/policy.d.ts +4 -0
- package/v3/@claude-flow/cli/dist/src/commands/policy.js +107 -0
- package/v3/@claude-flow/cli/dist/src/index.js +18 -0
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +53 -2
- package/v3/@claude-flow/cli/dist/src/mcp-client.js +25 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/capability-brain.d.ts +134 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/capability-brain.js +697 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/guidance-tools.d.ts +2 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/guidance-tools.js +369 -37
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.d.ts +4 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/index.js +3 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +26 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/metaharness-tools.js +27 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/policy-tools.d.ts +3 -0
- package/v3/@claude-flow/cli/dist/src/mcp-tools/policy-tools.js +121 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.d.ts +11 -0
- package/v3/@claude-flow/cli/dist/src/memory/memory-bridge.js +100 -21
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.d.ts +22 -1
- package/v3/@claude-flow/cli/dist/src/memory/memory-initializer.js +184 -39
- package/v3/@claude-flow/cli/dist/src/services/bounded-worker-pool.d.ts +28 -0
- package/v3/@claude-flow/cli/dist/src/services/bounded-worker-pool.js +90 -0
- package/v3/@claude-flow/cli/dist/src/services/harness-flywheel-runtime.d.ts +2 -0
- package/v3/@claude-flow/cli/dist/src/services/harness-flywheel-runtime.js +18 -0
- package/v3/@claude-flow/cli/dist/src/services/harness-flywheel.d.ts +4 -1
- package/v3/@claude-flow/cli/dist/src/services/harness-flywheel.js +27 -6
- package/v3/@claude-flow/cli/dist/src/services/policy-runtime.d.ts +38 -0
- package/v3/@claude-flow/cli/dist/src/services/policy-runtime.js +340 -0
- package/v3/@claude-flow/cli/package.json +44 -12
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolOutputGuardrail — semantic screening of content returned by MCP tool
|
|
3
|
+
* calls, memory reads, and external API responses before that content enters
|
|
4
|
+
* agent reasoning. Closes the OWASP ASI01 (Agent Goal Hijacking) gap
|
|
5
|
+
* identified in ruvnet/ruflo#2149 / ADR-131.
|
|
6
|
+
*
|
|
7
|
+
* Threat model
|
|
8
|
+
* ------------
|
|
9
|
+
* Attackers embed malicious instructions in content the agent retrieves
|
|
10
|
+
* autonomously (web page, MCP tool response, memory entry). An LLM cannot
|
|
11
|
+
* reliably distinguish instructions from data once both are in the prompt.
|
|
12
|
+
* System-level per-boundary guardrails are the only category with
|
|
13
|
+
* sub-millisecond latency and no model dependency (arXiv:2601.17548,
|
|
14
|
+
* Jan 2026 systematic review).
|
|
15
|
+
*
|
|
16
|
+
* Scope
|
|
17
|
+
* -----
|
|
18
|
+
* - Detection only — does NOT modify the running prompt; callers decide
|
|
19
|
+
* what action to take (allow, flag, redact, reject) via `scanAndEnforce`.
|
|
20
|
+
* - Synchronous pattern match — designed for <1ms p99 on typical tool
|
|
21
|
+
* responses (≤32KB). Large content is capped at `maxScanBytes` and the
|
|
22
|
+
* truncation itself is reported as a low-severity finding.
|
|
23
|
+
* - Pure-function shape — no I/O, no async, no model calls. Safe to invoke
|
|
24
|
+
* in hot paths (every MCP tool result, every memory read).
|
|
25
|
+
*
|
|
26
|
+
* Non-goals
|
|
27
|
+
* ---------
|
|
28
|
+
* - Not a replacement for input validation at HTTP/CLI boundaries
|
|
29
|
+
* (InputValidator handles that). This is the *content* boundary.
|
|
30
|
+
* - Not a model-based classifier. False-positive rate is bounded by
|
|
31
|
+
* pattern specificity; tune via `customPatterns` and `policy`.
|
|
32
|
+
*
|
|
33
|
+
* Reference: ADR-131, OpenAI Agents SDK ToolGuardrail API (March 2025).
|
|
34
|
+
*/
|
|
35
|
+
const DEFAULT_POLICY = {
|
|
36
|
+
low: 'allow',
|
|
37
|
+
medium: 'flag',
|
|
38
|
+
high: 'redact',
|
|
39
|
+
critical: 'reject',
|
|
40
|
+
};
|
|
41
|
+
const DEFAULT_MAX_SCAN_BYTES = 1024 * 1024;
|
|
42
|
+
/**
|
|
43
|
+
* Built-in pattern library. Ordered by severity (critical first) so the
|
|
44
|
+
* `highest` field reflects the worst category. Patterns are intentionally
|
|
45
|
+
* conservative — they target the explicit instruction-override / role-hijack
|
|
46
|
+
* shapes that show up in published indirect-injection corpora rather than
|
|
47
|
+
* general "suspicious looking" text.
|
|
48
|
+
*/
|
|
49
|
+
const BUILTIN_PATTERNS = [
|
|
50
|
+
// ── critical: instruction override + embedded system frames ──
|
|
51
|
+
{
|
|
52
|
+
label: 'ignore-previous-instructions',
|
|
53
|
+
// Allow optional filler words between the verb and the temporal keyword
|
|
54
|
+
// ("ignore the above", "disregard your earlier", "forget all prior").
|
|
55
|
+
regex: /\b(?:ignore|disregard|forget)\s+(?:all\s+|any\s+|the\s+|my\s+|your\s+|these\s+|those\s+)?(?:previous|prior|above|earlier|preceding|aforementioned)\s+(?:instructions?|prompts?|rules?|directives?)\b/gi,
|
|
56
|
+
severity: 'critical',
|
|
57
|
+
category: 'instruction-override',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'chatml-frame',
|
|
61
|
+
regex: /<\|(?:im_start|im_end|system|assistant|user|endoftext)\|>/gi,
|
|
62
|
+
severity: 'critical',
|
|
63
|
+
category: 'embedded-system',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'llama-inst-frame',
|
|
67
|
+
regex: /\[\/?INST\]/g,
|
|
68
|
+
severity: 'critical',
|
|
69
|
+
category: 'embedded-system',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'exfiltrate-secret',
|
|
73
|
+
regex: /\b(?:exfiltrate|leak|send|post|upload|transmit)\b[^.\n]{0,80}\b(?:secret|token|api[-_\s]?keys?|password|credential|env\s+vars?)\b/gi,
|
|
74
|
+
severity: 'critical',
|
|
75
|
+
category: 'exfiltration',
|
|
76
|
+
},
|
|
77
|
+
// ── high: role hijack + jailbreak + system tags + bidi unicode ──
|
|
78
|
+
{
|
|
79
|
+
label: 'system-tag-injection',
|
|
80
|
+
regex: /<\/?system>/gi,
|
|
81
|
+
severity: 'high',
|
|
82
|
+
category: 'embedded-system',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'role-hijack-you-are-now',
|
|
86
|
+
regex: /\byou\s+are\s+(?:now|actually|secretly)\s+(?:a|an|the)\s+/gi,
|
|
87
|
+
severity: 'high',
|
|
88
|
+
category: 'role-hijack',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'jailbreak-dan',
|
|
92
|
+
regex: /\b(?:DAN(?:\s+mode)?|developer\s+mode|jailbreak\s+mode|do\s+anything\s+now)\b/gi,
|
|
93
|
+
severity: 'high',
|
|
94
|
+
category: 'jailbreak',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: 'new-instructions-directive',
|
|
98
|
+
regex: /\b(?:new|updated|revised|additional)\s+(?:instructions?|task|directives?|objectives?)\s*[:.]/gi,
|
|
99
|
+
severity: 'high',
|
|
100
|
+
category: 'instruction-override',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: 'bidi-override',
|
|
104
|
+
regex: /[--]/g,
|
|
105
|
+
severity: 'high',
|
|
106
|
+
category: 'hidden-unicode',
|
|
107
|
+
},
|
|
108
|
+
// ── medium: softer role manipulation + tool spoofing ──
|
|
109
|
+
{
|
|
110
|
+
label: 'role-hijack-act-as',
|
|
111
|
+
regex: /\b(?:act|behave|pretend|role[-\s]?play)\s+as\s+(?:if\s+)?(?:a|an|the)\s+/gi,
|
|
112
|
+
severity: 'medium',
|
|
113
|
+
category: 'role-hijack',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'tool-call-spoof',
|
|
117
|
+
regex: /\b(?:tool_call|function_call|mcp_tool)\s*[:=]\s*["'{]/gi,
|
|
118
|
+
severity: 'medium',
|
|
119
|
+
category: 'tool-spoofing',
|
|
120
|
+
},
|
|
121
|
+
// ── low: zero-width whitespace (common in copy-paste attacks) ──
|
|
122
|
+
{
|
|
123
|
+
label: 'zero-width-char',
|
|
124
|
+
regex: /[-]/g,
|
|
125
|
+
severity: 'low',
|
|
126
|
+
category: 'hidden-unicode',
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
const SEVERITY_ORDER = {
|
|
130
|
+
none: 0,
|
|
131
|
+
low: 1,
|
|
132
|
+
medium: 2,
|
|
133
|
+
high: 3,
|
|
134
|
+
critical: 4,
|
|
135
|
+
};
|
|
136
|
+
function snippet(text, idx, len) {
|
|
137
|
+
const start = Math.max(0, idx - 24);
|
|
138
|
+
const end = Math.min(text.length, idx + len + 24);
|
|
139
|
+
const head = start > 0 ? '…' : '';
|
|
140
|
+
const tail = end < text.length ? '…' : '';
|
|
141
|
+
return head + text.slice(start, end).replace(/\s+/g, ' ') + tail;
|
|
142
|
+
}
|
|
143
|
+
function maxSeverity(a, b) {
|
|
144
|
+
return SEVERITY_ORDER[a] >= SEVERITY_ORDER[b]
|
|
145
|
+
? (a === 'none' ? b : a)
|
|
146
|
+
: b;
|
|
147
|
+
}
|
|
148
|
+
export class ToolOutputGuardrail {
|
|
149
|
+
patterns;
|
|
150
|
+
policy;
|
|
151
|
+
maxScanBytes;
|
|
152
|
+
constructor(config = {}) {
|
|
153
|
+
this.patterns = [...BUILTIN_PATTERNS, ...(config.customPatterns ?? [])];
|
|
154
|
+
this.policy = { ...DEFAULT_POLICY, ...(config.policy ?? {}) };
|
|
155
|
+
this.maxScanBytes = config.maxScanBytes ?? DEFAULT_MAX_SCAN_BYTES;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Pure scan — no side effects, no content modification. Useful when the
|
|
159
|
+
* caller wants to log findings but cannot drop the content (e.g. read-only
|
|
160
|
+
* audit mode).
|
|
161
|
+
*/
|
|
162
|
+
scan(content) {
|
|
163
|
+
if (typeof content !== 'string') {
|
|
164
|
+
return { safe: true, findings: [], highest: 'none' };
|
|
165
|
+
}
|
|
166
|
+
let scanned = content;
|
|
167
|
+
const findings = [];
|
|
168
|
+
if (this.maxScanBytes > 0 && content.length > this.maxScanBytes) {
|
|
169
|
+
scanned = content.slice(0, this.maxScanBytes);
|
|
170
|
+
findings.push({
|
|
171
|
+
pattern: 'content-truncated',
|
|
172
|
+
severity: 'medium',
|
|
173
|
+
category: 'truncation',
|
|
174
|
+
position: this.maxScanBytes,
|
|
175
|
+
context: `(content truncated at ${this.maxScanBytes} bytes; ${content.length - this.maxScanBytes} bytes unscanned)`,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
for (const { label, regex, severity, category } of this.patterns) {
|
|
179
|
+
// Clone the RegExp so that the global-flag lastIndex state doesn't
|
|
180
|
+
// leak between calls. Built-in patterns are immutable; user-supplied
|
|
181
|
+
// patterns are also defensively cloned.
|
|
182
|
+
const re = new RegExp(regex.source, regex.flags.includes('g') ? regex.flags : regex.flags + 'g');
|
|
183
|
+
let match;
|
|
184
|
+
while ((match = re.exec(scanned)) !== null) {
|
|
185
|
+
findings.push({
|
|
186
|
+
pattern: label,
|
|
187
|
+
severity,
|
|
188
|
+
category,
|
|
189
|
+
position: match.index,
|
|
190
|
+
context: snippet(scanned, match.index, match[0].length),
|
|
191
|
+
});
|
|
192
|
+
// Defensive: zero-length match would loop forever
|
|
193
|
+
if (match[0].length === 0)
|
|
194
|
+
re.lastIndex++;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
let highest = 'none';
|
|
198
|
+
for (const f of findings)
|
|
199
|
+
highest = maxSeverity(highest, f.severity);
|
|
200
|
+
const action = highest === 'none' ? 'allow' : this.policy[highest];
|
|
201
|
+
const safe = action === 'allow' || action === 'flag';
|
|
202
|
+
return { safe, findings, highest };
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Scan + enforce policy. Returns the content to pass forward (possibly
|
|
206
|
+
* redacted or empty) plus the scan result and the action that was taken.
|
|
207
|
+
* Callers should treat `reject` as "drop the tool result and signal an
|
|
208
|
+
* error" — do NOT silently substitute empty content.
|
|
209
|
+
*/
|
|
210
|
+
scanAndEnforce(content) {
|
|
211
|
+
const result = this.scan(content);
|
|
212
|
+
const action = result.highest === 'none' ? 'allow' : this.policy[result.highest];
|
|
213
|
+
let outgoing = content;
|
|
214
|
+
if (action === 'redact') {
|
|
215
|
+
outgoing = this.redact(content, result.findings);
|
|
216
|
+
}
|
|
217
|
+
else if (action === 'reject') {
|
|
218
|
+
outgoing = '';
|
|
219
|
+
}
|
|
220
|
+
return { content: outgoing, result, action };
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Replace each non-truncation finding's matched substring with
|
|
224
|
+
* `[REDACTED:<pattern>]`. Truncation findings have no substring to redact
|
|
225
|
+
* (their `position` is a length, not an offset into the content) and are
|
|
226
|
+
* skipped. Idempotent for already-redacted strings.
|
|
227
|
+
*/
|
|
228
|
+
redact(content, findings) {
|
|
229
|
+
if (findings.length === 0)
|
|
230
|
+
return content;
|
|
231
|
+
// Build a single combined regex per pattern label to avoid replacing
|
|
232
|
+
// overlapping matches multiple times.
|
|
233
|
+
const labels = new Set(findings
|
|
234
|
+
.filter((f) => f.category !== 'truncation')
|
|
235
|
+
.map((f) => f.pattern));
|
|
236
|
+
let out = content;
|
|
237
|
+
for (const { label, regex } of this.patterns) {
|
|
238
|
+
if (!labels.has(label))
|
|
239
|
+
continue;
|
|
240
|
+
const re = new RegExp(regex.source, regex.flags.includes('g') ? regex.flags : regex.flags + 'g');
|
|
241
|
+
out = out.replace(re, `[REDACTED:${label}]`);
|
|
242
|
+
}
|
|
243
|
+
return out;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Convenience factory that returns a guardrail with the default policy. */
|
|
247
|
+
export function createToolOutputGuardrail(config) {
|
|
248
|
+
return new ToolOutputGuardrail(config);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* One-shot helper for callers that just want a yes/no answer without
|
|
252
|
+
* constructing a guardrail. Uses the default policy.
|
|
253
|
+
*/
|
|
254
|
+
export function isToolOutputSafe(content) {
|
|
255
|
+
return createToolOutputGuardrail().scan(content).safe;
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=tool-output-guardrail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-output-guardrail.js","sourceRoot":"","sources":["../src/tool-output-guardrail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAwEH,MAAM,cAAc,GAAqD;IACvE,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,gBAAgB,GAKjB;IACH,gEAAgE;IAChE;QACE,KAAK,EAAE,8BAA8B;QACrC,wEAAwE;QACxE,sEAAsE;QACtE,KAAK,EAAE,wMAAwM;QAC/M,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,sBAAsB;KACjC;IACD;QACE,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,6DAA6D;QACpE,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,iBAAiB;KAC5B;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,cAAc;QACrB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,iBAAiB;KAC5B;IACD;QACE,KAAK,EAAE,mBAAmB;QAC1B,KAAK,EAAE,qIAAqI;QAC5I,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,cAAc;KACzB;IAED,mEAAmE;IACnE;QACE,KAAK,EAAE,sBAAsB;QAC7B,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,iBAAiB;KAC5B;IACD;QACE,KAAK,EAAE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|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Security module - CVE fixes, input validation, path security",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/index.js",
|
|
14
|
+
"./*": "./dist/*.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "vitest run",
|
|
18
|
+
"benchmark:policy": "npm run build && node scripts/benchmark-policy-engine.mjs",
|
|
19
|
+
"benchmark:product-plane": "npm run build && node scripts/benchmark-product-plane.mjs",
|
|
20
|
+
"test:oauth-surface": "vitest run __tests__/oauth-export-surface.test.ts __tests__/oauth-pkce.test.ts __tests__/oauth-browser.test.ts",
|
|
21
|
+
"build": "tsc && node scripts/verify-oauth-exports.mjs",
|
|
22
|
+
"prepublishOnly": "npm run build && npm run test:oauth-surface"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"vitest": "^4.1.0"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"tag": "v3alpha"
|
|
30
|
+
},
|
|
31
|
+
"rufloBundledRuntime": {
|
|
32
|
+
"format": 1,
|
|
33
|
+
"sourceDependencies": {
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@noble/ed25519": "^2.1.0",
|
|
36
|
+
"bcryptjs": "^3.0.3",
|
|
37
|
+
"zod": "^3.22.0"
|
|
38
|
+
},
|
|
39
|
+
"optionalDependencies": {
|
|
40
|
+
"@napi-rs/keyring": "1.3.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-flow",
|
|
3
|
-
"version": "3.32.
|
|
3
|
+
"version": "3.32.30",
|
|
4
|
+
"workspaces": [
|
|
5
|
+
"v3/@claude-flow/codex",
|
|
6
|
+
"v3/@claude-flow/plugin-agent-federation",
|
|
7
|
+
"v3/@claude-flow/security"
|
|
8
|
+
],
|
|
4
9
|
"description": "Ruflo - Enterprise AI agent orchestration for Claude Code. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
|
|
5
10
|
"main": "dist/index.js",
|
|
6
11
|
"type": "module",
|
|
@@ -61,16 +66,28 @@
|
|
|
61
66
|
},
|
|
62
67
|
"dependencies": {
|
|
63
68
|
"@claude-flow/cli-core": "3.7.0-alpha.5",
|
|
69
|
+
"@claude-flow/codex": "3.0.3",
|
|
64
70
|
"@claude-flow/mcp": "3.0.0-alpha.9",
|
|
65
71
|
"@claude-flow/neural": "3.0.0-alpha.9",
|
|
72
|
+
"@claude-flow/plugin-agent-federation": "1.0.0-alpha.18",
|
|
73
|
+
"@claude-flow/security": "3.0.0-alpha.14",
|
|
66
74
|
"@claude-flow/shared": "3.0.0-alpha.8",
|
|
75
|
+
"@iarna/toml": "^2.2.5",
|
|
67
76
|
"@noble/ed25519": "2.3.0",
|
|
68
77
|
"@ruvector/rabitq-wasm": "0.1.0",
|
|
78
|
+
"bcryptjs": "^3.0.3",
|
|
79
|
+
"chalk": "^5.3.0",
|
|
80
|
+
"commander": "^12.0.0",
|
|
81
|
+
"fs-extra": "^11.2.0",
|
|
82
|
+
"inquirer": "^9.2.0",
|
|
69
83
|
"semver": "7.7.3",
|
|
84
|
+
"toml": "^3.0.0",
|
|
85
|
+
"ws": ">=8.21.0",
|
|
86
|
+
"yaml": "^2.8.0",
|
|
70
87
|
"zod": "3.25.76"
|
|
71
88
|
},
|
|
72
89
|
"optionalDependencies": {
|
|
73
|
-
"@
|
|
90
|
+
"@napi-rs/keyring": "1.3.0",
|
|
74
91
|
"@claude-flow/plugin-gastown-bridge": "^0.1.3",
|
|
75
92
|
"@ruvector/attention": "^0.1.3",
|
|
76
93
|
"@ruvector/core": "^0.1.30",
|
|
@@ -142,7 +159,7 @@
|
|
|
142
159
|
},
|
|
143
160
|
"repository": {
|
|
144
161
|
"type": "git",
|
|
145
|
-
"url": "https://github.com/ruvnet/claude-flow.git"
|
|
162
|
+
"url": "git+https://github.com/ruvnet/claude-flow.git"
|
|
146
163
|
},
|
|
147
164
|
"keywords": [
|
|
148
165
|
"ruvflow",
|
|
@@ -179,14 +196,19 @@
|
|
|
179
196
|
"consensus",
|
|
180
197
|
"self-learning"
|
|
181
198
|
],
|
|
182
|
-
"author":
|
|
183
|
-
"name": "RuvNet",
|
|
184
|
-
"email": "ruv@ruv.io",
|
|
185
|
-
"url": "https://ruv.io"
|
|
186
|
-
},
|
|
199
|
+
"author": "RuvNet <ruv@ruv.io> (https://ruv.io)",
|
|
187
200
|
"license": "MIT",
|
|
188
201
|
"publishConfig": {
|
|
189
202
|
"access": "public",
|
|
190
203
|
"tag": "latest"
|
|
204
|
+
},
|
|
205
|
+
"bundleDependencies": [
|
|
206
|
+
"@claude-flow/codex",
|
|
207
|
+
"@claude-flow/plugin-agent-federation",
|
|
208
|
+
"@claude-flow/security"
|
|
209
|
+
],
|
|
210
|
+
"directories": {
|
|
211
|
+
"doc": "docs",
|
|
212
|
+
"test": "tests"
|
|
191
213
|
}
|
|
192
214
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generation":
|
|
4
|
-
"generatedAt": "2026-07-
|
|
5
|
-
"gitSha": "
|
|
3
|
+
"generation": 3,
|
|
4
|
+
"generatedAt": "2026-07-29T05:35:40.000Z",
|
|
5
|
+
"gitSha": "1385e21b",
|
|
6
6
|
"catalog": {
|
|
7
7
|
"agents": 164,
|
|
8
|
-
"tools":
|
|
8
|
+
"tools": 395,
|
|
9
9
|
"skills": 34
|
|
10
10
|
},
|
|
11
11
|
"benchmark": null
|
|
@@ -33,6 +33,7 @@ export declare function getProvidersCommand(): Promise<Command | undefined>;
|
|
|
33
33
|
export declare function getPluginsCommand(): Promise<Command | undefined>;
|
|
34
34
|
export declare function getDeploymentCommand(): Promise<Command | undefined>;
|
|
35
35
|
export declare function getClaimsCommand(): Promise<Command | undefined>;
|
|
36
|
+
export declare function getPolicyCommand(): Promise<Command | undefined>;
|
|
36
37
|
export declare function getEmbeddingsCommand(): Promise<Command | undefined>;
|
|
37
38
|
export declare function getCompletionsCommand(): Promise<Command | undefined>;
|
|
38
39
|
export declare function getAnalyzeCommand(): Promise<Command | undefined>;
|
|
@@ -40,6 +40,7 @@ const commandLoaders = {
|
|
|
40
40
|
plugins: () => import('./plugins.js'),
|
|
41
41
|
deployment: () => import('./deployment.js'),
|
|
42
42
|
claims: () => import('./claims.js'),
|
|
43
|
+
policy: () => import('./policy.js'),
|
|
43
44
|
embeddings: () => import('./embeddings.js'),
|
|
44
45
|
// P0 Commands
|
|
45
46
|
completions: () => import('./completions.js'),
|
|
@@ -175,6 +176,7 @@ export async function getProvidersCommand() { return loadCommand('providers'); }
|
|
|
175
176
|
export async function getPluginsCommand() { return loadCommand('plugins'); }
|
|
176
177
|
export async function getDeploymentCommand() { return loadCommand('deployment'); }
|
|
177
178
|
export async function getClaimsCommand() { return loadCommand('claims'); }
|
|
179
|
+
export async function getPolicyCommand() { return loadCommand('policy'); }
|
|
178
180
|
export async function getEmbeddingsCommand() { return loadCommand('embeddings'); }
|
|
179
181
|
export async function getCompletionsCommand() { return loadCommand('completions'); }
|
|
180
182
|
export async function getAnalyzeCommand() { return loadCommand('analyze'); }
|
|
@@ -230,14 +232,14 @@ export const commandsByCategory = {
|
|
|
230
232
|
* Use this for help display and full command listings.
|
|
231
233
|
*/
|
|
232
234
|
export async function getCommandsByCategory() {
|
|
233
|
-
const [daemonCmd, doctorCmd, embeddingsCmd, neuralCmd, performanceCmd, securityCmd, ruvectorCmd, hiveMindCmd, configCmd, completionsCmd, migrateCmd, workflowCmd, analyzeCmd, routeCmd, progressCmd, providersCmd, pluginsCmd, deploymentCmd, claimsCmd, issuesCmd, updateCmd, processCmd, guidanceCmd, applianceCmd, cleanupCmd, autopilotCmd,] = await Promise.all([
|
|
235
|
+
const [daemonCmd, doctorCmd, embeddingsCmd, neuralCmd, performanceCmd, securityCmd, ruvectorCmd, hiveMindCmd, configCmd, completionsCmd, migrateCmd, workflowCmd, analyzeCmd, routeCmd, progressCmd, providersCmd, pluginsCmd, deploymentCmd, claimsCmd, issuesCmd, updateCmd, processCmd, guidanceCmd, applianceCmd, cleanupCmd, autopilotCmd, policyCmd,] = await Promise.all([
|
|
234
236
|
loadCommand('daemon'), loadCommand('doctor'), loadCommand('embeddings'), loadCommand('neural'),
|
|
235
237
|
loadCommand('performance'), loadCommand('security'), loadCommand('ruvector'), loadCommand('hive-mind'),
|
|
236
238
|
loadCommand('config'), loadCommand('completions'), loadCommand('migrate'), loadCommand('workflow'),
|
|
237
239
|
loadCommand('analyze'), loadCommand('route'), loadCommand('progress'), loadCommand('providers'),
|
|
238
240
|
loadCommand('plugins'), loadCommand('deployment'), loadCommand('claims'), loadCommand('issues'),
|
|
239
241
|
loadCommand('update'), loadCommand('process'), loadCommand('guidance'), loadCommand('appliance'),
|
|
240
|
-
loadCommand('cleanup'), loadCommand('autopilot'),
|
|
242
|
+
loadCommand('cleanup'), loadCommand('autopilot'), loadCommand('policy'),
|
|
241
243
|
]);
|
|
242
244
|
return {
|
|
243
245
|
primary: [
|
|
@@ -246,7 +248,7 @@ export async function getCommandsByCategory() {
|
|
|
246
248
|
mcpCommand, hooksCommand,
|
|
247
249
|
],
|
|
248
250
|
advanced: [
|
|
249
|
-
neuralCmd, securityCmd, performanceCmd, embeddingsCmd,
|
|
251
|
+
neuralCmd, securityCmd, policyCmd, performanceCmd, embeddingsCmd,
|
|
250
252
|
hiveMindCmd, ruvectorCmd, guidanceCmd, autopilotCmd,
|
|
251
253
|
].filter(Boolean),
|
|
252
254
|
utility: [
|
|
@@ -86,12 +86,23 @@ const storeCommand = {
|
|
|
86
86
|
description: 'Scan the value for injection payloads before persisting (dream-cycle #2752 MemPoison gate)',
|
|
87
87
|
type: 'boolean',
|
|
88
88
|
},
|
|
89
|
+
{
|
|
90
|
+
// ADR-323 — typed memory provenance. Distinguishes who/what produced
|
|
91
|
+
// this entry so shared-namespace retrieval can filter by trust level
|
|
92
|
+
// instead of conflating a user's stated claim with an agent's own
|
|
93
|
+
// output or a raw tool/system observation.
|
|
94
|
+
name: 'provenance',
|
|
95
|
+
description: 'Who/what produced this value: user_claim | agent_output | system_observation | tool_result | unknown (default: unknown) — ADR-323',
|
|
96
|
+
type: 'string',
|
|
97
|
+
choices: ['user_claim', 'agent_output', 'system_observation', 'tool_result', 'unknown'],
|
|
98
|
+
},
|
|
89
99
|
DB_PATH_OPTION
|
|
90
100
|
],
|
|
91
101
|
examples: [
|
|
92
102
|
{ command: 'claude-flow memory store -k "api/auth" -v "JWT implementation"', description: 'Store text' },
|
|
93
103
|
{ command: 'claude-flow memory store -k "pattern/singleton" --vector', description: 'Store vector' },
|
|
94
|
-
{ command: 'claude-flow memory store -k "pattern" -v "new" --no-upsert', description: 'Strict insert (fail if key exists)' }
|
|
104
|
+
{ command: 'claude-flow memory store -k "pattern" -v "new" --no-upsert', description: 'Strict insert (fail if key exists)' },
|
|
105
|
+
{ command: 'claude-flow memory store -k "user/goal" -v "ship by Friday" --provenance user_claim', description: 'Store with typed provenance (ADR-323)' }
|
|
95
106
|
],
|
|
96
107
|
action: async (ctx) => {
|
|
97
108
|
const key = ctx.flags.key;
|
|
@@ -114,6 +125,10 @@ const storeCommand = {
|
|
|
114
125
|
// regardless of the parser gap: only an explicit `--no-upsert` (which
|
|
115
126
|
// arrives as `false`) turns it off.
|
|
116
127
|
const upsert = ctx.flags.upsert !== false;
|
|
128
|
+
// ADR-323: leave undefined (not 'unknown') when omitted so storeEntry's
|
|
129
|
+
// own default applies uniformly across the CLI, MCP tool, and direct
|
|
130
|
+
// callers — one place decides the default, not three.
|
|
131
|
+
const provenance = ctx.flags.provenance;
|
|
117
132
|
if (!key) {
|
|
118
133
|
output.printError('Key is required. Use --key or -k');
|
|
119
134
|
return { success: false, exitCode: 1 };
|
|
@@ -174,6 +189,7 @@ const storeCommand = {
|
|
|
174
189
|
tags,
|
|
175
190
|
ttl,
|
|
176
191
|
upsert,
|
|
192
|
+
provenanceType: provenance,
|
|
177
193
|
dbPath
|
|
178
194
|
});
|
|
179
195
|
if (!result.success) {
|
|
@@ -193,12 +209,13 @@ const storeCommand = {
|
|
|
193
209
|
{ property: 'TTL', val: ttl ? `${ttl}s` : 'None' },
|
|
194
210
|
{ property: 'Tags', val: tags.length > 0 ? tags.join(', ') : 'None' },
|
|
195
211
|
{ property: 'Vector', val: result.embedding ? `Yes (${result.embedding.dimensions}-dim)` : 'No' },
|
|
212
|
+
{ property: 'Provenance', val: provenance || 'unknown' },
|
|
196
213
|
{ property: 'ID', val: result.id.substring(0, 20) }
|
|
197
214
|
]
|
|
198
215
|
});
|
|
199
216
|
output.writeln();
|
|
200
217
|
output.printSuccess('Data stored successfully');
|
|
201
|
-
return { success: true, data: { ...storeData, id: result.id, embedding: result.embedding } };
|
|
218
|
+
return { success: true, data: { ...storeData, id: result.id, embedding: result.embedding, provenanceType: provenance || 'unknown' } };
|
|
202
219
|
}
|
|
203
220
|
catch (error) {
|
|
204
221
|
output.printError(`Failed to store: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
@@ -361,6 +378,15 @@ const searchCommand = {
|
|
|
361
378
|
choices: ['auto', 'mixed', 'episodic', 'semantic', 'procedural'],
|
|
362
379
|
default: 'mixed',
|
|
363
380
|
},
|
|
381
|
+
{
|
|
382
|
+
// ADR-323 — restrict results to entries with a matching provenance
|
|
383
|
+
// type (e.g. exclude user_claim when retrieving for fact-checking,
|
|
384
|
+
// per MemSyco-Bench's memory-induced sycophancy finding). Enforced
|
|
385
|
+
// across semantic, keyword, hybrid, and SmartRetrieval paths.
|
|
386
|
+
name: 'provenance-filter',
|
|
387
|
+
description: 'Comma-separated provenance types to restrict results to: user_claim,agent_output,system_observation,tool_result,unknown — ADR-323',
|
|
388
|
+
type: 'string',
|
|
389
|
+
},
|
|
364
390
|
DB_PATH_OPTION
|
|
365
391
|
],
|
|
366
392
|
examples: [
|
|
@@ -369,11 +395,18 @@ const searchCommand = {
|
|
|
369
395
|
{ command: 'claude-flow memory search -q "test" --build-hnsw', description: 'Build HNSW index and search' },
|
|
370
396
|
{ command: 'claude-flow memory search -q "auth patterns" --smart', description: 'SmartRetrieval with RRF + MMR' },
|
|
371
397
|
{ command: 'claude-flow memory search -q "when did we last touch auth" --intent auto', description: 'SCM-routed retrieval (dream-cycle #2760)' },
|
|
398
|
+
{ command: 'claude-flow memory search -q "deploy plan" --provenance-filter agent_output,tool_result', description: 'Only trust agent/tool-sourced entries (ADR-323)' },
|
|
372
399
|
],
|
|
373
400
|
action: async (ctx) => {
|
|
374
401
|
const query = ctx.flags.query || ctx.args[0];
|
|
375
402
|
let namespace = ctx.flags.namespace || 'all';
|
|
376
403
|
const limit = ctx.flags.limit || 10;
|
|
404
|
+
// Matches the --build-hnsw / buildHnsw dual-check convention already used
|
|
405
|
+
// below: the parser doesn't consistently camelCase every hyphenated flag.
|
|
406
|
+
const provenanceFilterRaw = (ctx.flags['provenance-filter'] || ctx.flags.provenanceFilter);
|
|
407
|
+
const provenanceFilter = provenanceFilterRaw
|
|
408
|
+
? provenanceFilterRaw.split(',').map(s => s.trim()).filter(Boolean)
|
|
409
|
+
: undefined;
|
|
377
410
|
// #2790 fix — `||` discards an explicit `--threshold 0` (falsy) and
|
|
378
411
|
// silently uses the fallback; that made `--threshold 0` return
|
|
379
412
|
// FEWER results than `--threshold 0.01` (non-monotonic). Nullish
|
|
@@ -456,8 +489,13 @@ const searchCommand = {
|
|
|
456
489
|
limit: 5000,
|
|
457
490
|
includeContent: true,
|
|
458
491
|
dbPath: dbPathSearch,
|
|
492
|
+
provenanceFilter,
|
|
459
493
|
});
|
|
460
|
-
if (list.success) {
|
|
494
|
+
if (!list.success) {
|
|
495
|
+
output.printError(list.error || 'Keyword search failed');
|
|
496
|
+
return { success: false, exitCode: 1 };
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
461
499
|
const q = query.toLowerCase();
|
|
462
500
|
keywordResults = list.entries
|
|
463
501
|
.filter((e) => {
|
|
@@ -473,6 +511,7 @@ const searchCommand = {
|
|
|
473
511
|
score: inKey ? 1.0 : 0.7,
|
|
474
512
|
namespace: e.namespace,
|
|
475
513
|
preview: c.slice(0, 200),
|
|
514
|
+
provenanceType: e.provenanceType,
|
|
476
515
|
};
|
|
477
516
|
})
|
|
478
517
|
.sort((a, b) => b.score - a.score)
|
|
@@ -526,6 +565,7 @@ const searchCommand = {
|
|
|
526
565
|
limit: req.limit || limit * 3,
|
|
527
566
|
threshold: req.threshold ?? threshold,
|
|
528
567
|
dbPath: dbPathSearch,
|
|
568
|
+
provenanceFilter,
|
|
529
569
|
});
|
|
530
570
|
return {
|
|
531
571
|
results: r.results.map(e => ({
|
|
@@ -534,6 +574,7 @@ const searchCommand = {
|
|
|
534
574
|
content: e.content,
|
|
535
575
|
score: e.score,
|
|
536
576
|
namespace: e.namespace,
|
|
577
|
+
provenanceType: e.provenanceType,
|
|
537
578
|
})),
|
|
538
579
|
};
|
|
539
580
|
};
|
|
@@ -548,6 +589,7 @@ const searchCommand = {
|
|
|
548
589
|
score: r.score,
|
|
549
590
|
namespace: r.namespace,
|
|
550
591
|
preview: r.content,
|
|
592
|
+
provenanceType: r.provenanceType,
|
|
551
593
|
}));
|
|
552
594
|
searchTimeMs = smartResult.stats.durationMs;
|
|
553
595
|
smartStats = smartResult.stats;
|
|
@@ -559,7 +601,8 @@ const searchCommand = {
|
|
|
559
601
|
namespace,
|
|
560
602
|
limit,
|
|
561
603
|
threshold,
|
|
562
|
-
dbPath: dbPathSearch
|
|
604
|
+
dbPath: dbPathSearch,
|
|
605
|
+
provenanceFilter
|
|
563
606
|
});
|
|
564
607
|
if (!searchResult.success) {
|
|
565
608
|
output.printError(searchResult.error || 'Search failed');
|
|
@@ -569,7 +612,8 @@ const searchCommand = {
|
|
|
569
612
|
key: r.key,
|
|
570
613
|
score: r.score,
|
|
571
614
|
namespace: r.namespace,
|
|
572
|
-
preview: r.content
|
|
615
|
+
preview: r.content,
|
|
616
|
+
provenanceType: r.provenanceType,
|
|
573
617
|
}));
|
|
574
618
|
searchTimeMs = searchResult.searchTime;
|
|
575
619
|
}
|