claude-flow 3.32.29 → 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 +2 -2
- package/v3/@claude-flow/cli/dist/src/init/claudemd-generator.js +53 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/capability-brain.js +22 -22
- package/v3/@claude-flow/cli/dist/src/mcp-tools/guidance-tools.js +1 -1
- package/v3/@claude-flow/cli/package.json +24 -8
- package/.claude/.proven-config-version +0 -1
- package/.claude/proven-config.json +0 -42
|
@@ -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,yBAAyB;QAChC,KAAK,EAAE,6DAA6D;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"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
|
}
|
|
@@ -19,6 +19,49 @@ function behavioralRules() {
|
|
|
19
19
|
- Keep files under 500 lines
|
|
20
20
|
- Validate input at system boundaries`;
|
|
21
21
|
}
|
|
22
|
+
function policyGovernedWorkflow() {
|
|
23
|
+
return `## Ruflo Capability Brain & Implementation Loop
|
|
24
|
+
|
|
25
|
+
Ruflo is the coordination ledger and policy decision point. Claude Code is the
|
|
26
|
+
executor: after a Ruflo coordination call, continue implementing the task.
|
|
27
|
+
|
|
28
|
+
When it is registered, call
|
|
29
|
+
\`guidance_brain({ mode: "recommend", task: "..." })\` before complex Ruflo
|
|
30
|
+
work. Use its live registry instead of guessing tool names. Treat
|
|
31
|
+
\`registered\`, \`configured\`, \`reachable\`, \`healthy\`, and \`authorized\`
|
|
32
|
+
as separate facts. If the brain is unavailable, continue with the compatible
|
|
33
|
+
\`guidance_recommend\` tool, CLI discovery, and repository instructions.
|
|
34
|
+
|
|
35
|
+
Follow the returned loop:
|
|
36
|
+
|
|
37
|
+
1. Recall memory and ADR constraints.
|
|
38
|
+
2. Inspect source, runtime, dependencies, policy, and health.
|
|
39
|
+
3. Route to the smallest capable topology, agents, skills, and tools.
|
|
40
|
+
4. Plan acceptance criteria, safety envelope, ownership, and validation.
|
|
41
|
+
5. Execute in isolated scopes; the coding agent performs the work.
|
|
42
|
+
6. Test focused, regression, and failure paths.
|
|
43
|
+
7. Validate types, security, policy, compatibility, and artifacts.
|
|
44
|
+
8. Benchmark a source-bound candidate against a source-bound baseline.
|
|
45
|
+
9. Optimize measured bottlenecks without weakening safety.
|
|
46
|
+
10. Bind claims and evidence to exact source/build receipts.
|
|
47
|
+
11. Reconcile concurrent handoffs and disclose limitations.
|
|
48
|
+
12. Publish only through a separately authorized release gate.
|
|
49
|
+
|
|
50
|
+
### Concurrency and authority
|
|
51
|
+
|
|
52
|
+
- Never allow two writers in one worktree; give each writing agent an isolated
|
|
53
|
+
worktree and explicit file ownership.
|
|
54
|
+
- Read-only research may run concurrently and report findings to the owner.
|
|
55
|
+
- Only the integration owner edits shared manifests and lockfiles or reconciles
|
|
56
|
+
overlapping changes.
|
|
57
|
+
- A child may drop capabilities but cannot add tools, network, secrets, spend,
|
|
58
|
+
concurrency, namespaces, or delegation depth.
|
|
59
|
+
- A lease or claim coordinates ownership; it does not authorize a side effect.
|
|
60
|
+
- Darwin, Flywheel, MetaHarness, memory, and neural systems may propose or
|
|
61
|
+
evaluate candidates but cannot self-promote or expand their SafetyEnvelope.
|
|
62
|
+
- Bind tests, benchmarks, policy decisions, and release evidence to an exact
|
|
63
|
+
commit or immutable dirty-worktree snapshot.`;
|
|
64
|
+
}
|
|
22
65
|
function agentComms() {
|
|
23
66
|
return `## Agent Comms (SendMessage-First Coordination)
|
|
24
67
|
|
|
@@ -61,8 +104,10 @@ SendMessage({ to: "researcher", summary: "Start", message: "[task context]" })
|
|
|
61
104
|
- ALWAYS name agents — \`name: "role"\` makes them addressable
|
|
62
105
|
- ALWAYS include comms instructions in prompts — who to message, what to send
|
|
63
106
|
- Spawn ALL agents in ONE message with \`run_in_background: true\`
|
|
64
|
-
- After spawning
|
|
65
|
-
|
|
107
|
+
- After spawning, continue independent local work; wait only when a dependency
|
|
108
|
+
genuinely blocks progress
|
|
109
|
+
- Do not poll repeatedly — agents message back or complete automatically
|
|
110
|
+
- Give every writing agent an isolated worktree and a non-overlapping file scope`;
|
|
66
111
|
}
|
|
67
112
|
function swarmConfig(options) {
|
|
68
113
|
return `## Swarm & Routing
|
|
@@ -283,6 +328,7 @@ CLAUDE_FLOW_MEMORY_PATH=./data/memory
|
|
|
283
328
|
const TEMPLATE_SECTIONS = {
|
|
284
329
|
minimal: [
|
|
285
330
|
behavioralRules,
|
|
331
|
+
(_opts) => policyGovernedWorkflow(),
|
|
286
332
|
(_opts) => agentComms(),
|
|
287
333
|
swarmConfig,
|
|
288
334
|
(_opts) => buildAndTest(),
|
|
@@ -291,6 +337,7 @@ const TEMPLATE_SECTIONS = {
|
|
|
291
337
|
],
|
|
292
338
|
standard: [
|
|
293
339
|
behavioralRules,
|
|
340
|
+
(_opts) => policyGovernedWorkflow(),
|
|
294
341
|
(_opts) => agentComms(),
|
|
295
342
|
swarmConfig,
|
|
296
343
|
(_opts) => memoryAndLearning(),
|
|
@@ -301,6 +348,7 @@ const TEMPLATE_SECTIONS = {
|
|
|
301
348
|
],
|
|
302
349
|
full: [
|
|
303
350
|
behavioralRules,
|
|
351
|
+
(_opts) => policyGovernedWorkflow(),
|
|
304
352
|
(_opts) => agentComms(),
|
|
305
353
|
swarmConfig,
|
|
306
354
|
(_opts) => memoryAndLearning(),
|
|
@@ -315,6 +363,7 @@ const TEMPLATE_SECTIONS = {
|
|
|
315
363
|
],
|
|
316
364
|
security: [
|
|
317
365
|
behavioralRules,
|
|
366
|
+
(_opts) => policyGovernedWorkflow(),
|
|
318
367
|
(_opts) => agentComms(),
|
|
319
368
|
swarmConfig,
|
|
320
369
|
(_opts) => securitySection(),
|
|
@@ -326,6 +375,7 @@ const TEMPLATE_SECTIONS = {
|
|
|
326
375
|
],
|
|
327
376
|
performance: [
|
|
328
377
|
behavioralRules,
|
|
378
|
+
(_opts) => policyGovernedWorkflow(),
|
|
329
379
|
(_opts) => agentComms(),
|
|
330
380
|
swarmConfig,
|
|
331
381
|
(_opts) => performanceSection(),
|
|
@@ -338,6 +388,7 @@ const TEMPLATE_SECTIONS = {
|
|
|
338
388
|
],
|
|
339
389
|
solo: [
|
|
340
390
|
behavioralRules,
|
|
391
|
+
(_opts) => policyGovernedWorkflow(),
|
|
341
392
|
(_opts) => agentComms(),
|
|
342
393
|
(_opts) => memoryAndLearning(),
|
|
343
394
|
(_opts) => buildAndTest(),
|