claude-flow-novice 1.6.4 → 1.6.6
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/.claude/commands/parse-epic.js +180 -0
- package/.claude/settings.local.json +2 -1
- package/.claude-flow-novice/dist/mcp/mcp-server-novice.js +37 -2
- package/.claude-flow-novice/dist/mcp/mcp-server-sdk.js +45 -0
- package/.claude-flow-novice/dist/mcp/transports/base.js +5 -0
- package/.claude-flow-novice/dist/mcp/transports/base.js.map +1 -0
- package/.claude-flow-novice/dist/mcp/transports/http.js +414 -0
- package/.claude-flow-novice/dist/mcp/transports/http.js.map +1 -0
- package/.claude-flow-novice/dist/mcp/transports/stdio.js +217 -0
- package/.claude-flow-novice/dist/mcp/transports/stdio.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js +129 -0
- package/.claude-flow-novice/dist/src/cli/commands/parse-epic.js.map +1 -0
- package/.claude-flow-novice/dist/src/cli/index.js +3 -0
- package/.claude-flow-novice/dist/src/cli/index.js.map +1 -1
- package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js +266 -0
- package/.claude-flow-novice/dist/src/cli/utils/epic-parser.js.map +1 -0
- package/.claude-flow-novice/dist/src/communication/message-bus.js +105 -2
- package/.claude-flow-novice/dist/src/communication/message-bus.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js +1 -1
- package/.claude-flow-novice/dist/src/coordination/adapters/v1-coordinator-adapter.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js +632 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/artifact-cache-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js +11 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/cache/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js +318 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/checkpoints/checkpoint-compressor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js +234 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/completion-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js +347 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/hierarchical-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js +13 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js +173 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/lamport-clock.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js +526 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/mesh-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js +443 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/sdk-completion-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js +366 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/completion/swarm-shutdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js +287 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinator-factory.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js +364 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js +492 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/cascading-shutdown.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js +786 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/hierarchical-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js +342 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/parent-child-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js +601 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/coordinators/swarm-coordinator-v2.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/agent-state.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js +413 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dead-letter-queue.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js +471 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js +379 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-node.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/dependency-resolver.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js +211 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/help-request-metrics.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js +33 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js +920 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-broker.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js +385 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js +138 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/message.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js +478 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/resource-manager-safe.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js +358 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine-config.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js +588 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-machine.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js +153 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/state-transition.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js +360 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/task-scheduler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js +337 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/core/topic-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/deadlock-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js +669 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/deadlock/resource-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js +451 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/artifact-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js +271 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/cycle-detector.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-graph.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js +439 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js +92 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/dependency-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js +21 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js +223 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/dependency/topological-sort.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js +436 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js +278 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-matcher.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js +317 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request-handler.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js +273 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/help-request.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js +15 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js +512 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/help-system/waiting-agent-pool.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js +67 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js +557 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/help-deadlock-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js +212 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.example.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js +552 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/message-bus-completion-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js +635 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/integration/state-machine-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js +28 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/IArtifactStorage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ICoordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js +25 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/ISessionStore.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/interfaces/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js +308 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/artifact-adapter.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js +439 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/completion-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js +540 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-graph-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js +367 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/dependency-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js +518 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/message-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js +377 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/memory/state-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js +371 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js +355 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/dependency-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js +424 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/help-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js +16 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js +295 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/state-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js +411 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/channels/task-channel.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js +14 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js +387 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-bus.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js +589 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-persistence.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js +444 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/messaging/message-router.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js +560 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/artifact-storage.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js +335 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/background-orchestrator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js +104 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/bash-output-monitor.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js +847 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/checkpoint-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js +470 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/help-coordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js +450 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/hierarchical-background-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js +13 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js +625 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/message-bus-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js +545 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/multi-level-control.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js +740 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-controller.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js +415 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/query-message-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js +615 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/session-pool-optimizer.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js +547 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-machine-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js +342 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/sdk/state-sdk-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js +259 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/security/payload-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js +273 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js +8 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js +310 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js +218 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/truth-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js +9 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/types/sdk.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js +6 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js +145 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/priority-queue.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js +122 -0
- package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/utils/sdk-helpers.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/config-translator.js +17 -43
- package/.claude-flow-novice/dist/src/coordination/config-translator.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js +34 -76
- package/.claude-flow-novice/dist/src/coordination/coordination-toggle.js.map +1 -1
- package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js +172 -0
- package/.claude-flow-novice/dist/src/coordination/shared/core/agent-state.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/core/index.js +7 -0
- package/.claude-flow-novice/dist/src/coordination/shared/core/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/index.js +19 -0
- package/.claude-flow-novice/dist/src/coordination/shared/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js +24 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/ICoordinator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js +7 -0
- package/.claude-flow-novice/dist/src/coordination/shared/interfaces/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js +920 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message-broker.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message.js +138 -0
- package/.claude-flow-novice/dist/src/coordination/shared/message.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js +259 -0
- package/.claude-flow-novice/dist/src/coordination/shared/security/payload-validator.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js +17 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js +19 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/interfaces/transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js +357 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-integration.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js +679 -0
- package/.claude-flow-novice/dist/src/coordination/shared/transparency/transparency-system.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/index.js +7 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/index.js.map +1 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js +10 -0
- package/.claude-flow-novice/dist/src/coordination/shared/types/sdk.js.map +1 -0
- package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js +52 -2
- package/.claude-flow-novice/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -1
- package/.claude-flow-novice/dist/src/mcp/mcp-server-novice.js +37 -2
- package/.claude-flow-novice/dist/src/mcp/session-manager.js +3 -1
- package/.claude-flow-novice/dist/src/mcp/session-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/providers/provider-manager.js +36 -3
- package/.claude-flow-novice/dist/src/providers/provider-manager.js.map +1 -1
- package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js +65 -41
- package/.claude-flow-novice/dist/src/utils/markdown-sanitizer.js.map +1 -1
- package/.claude-flow-novice/dist/src/web/api/server.js +1 -1
- package/.claude-flow-novice/dist/src/web/api/server.js.map +1 -1
- package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js +30 -0
- package/.claude-flow-novice/dist/src/workflows/progressive-rollout-manager.js.map +1 -1
- package/.claude-flow-novice/metrics.db-shm +0 -0
- package/.claude-flow-novice/metrics.db-wal +0 -0
- package/config/.env.example +178 -0
- package/config/DEPLOYMENT_GUIDE.md +692 -0
- package/config/README-CONFIG.md +331 -0
- package/config/coordination-config.sh +327 -0
- package/config/docker/env.development +53 -0
- package/config/docker/env.production +83 -0
- package/config/docker/env.staging +70 -0
- package/config/k8s/configmap-development.yaml +60 -0
- package/config/k8s/configmap-production.yaml +85 -0
- package/config/k8s/configmap-staging.yaml +76 -0
- package/config/k8s/secret-production.yaml +62 -0
- package/config/k8s/secret-staging.yaml +36 -0
- package/package.json +2 -2
- package/scripts/monitoring/alert-monitor.sh +220 -0
- package/scripts/monitoring/dashboards/rate-limiting-dashboard.json +211 -0
- package/scripts/monitoring/quick-test-alerting.sh +118 -0
- package/scripts/monitoring/quick-test-rate-limiting.sh +206 -0
- package/scripts/monitoring/rate-limiting-monitor.sh +380 -0
- package/scripts/monitoring/view-alerts.sh +307 -0
- package/scripts/test-zai-api.cjs +2 -2
- package/src/slash-commands/parse-epic.js +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as crypto from 'crypto';
|
|
4
|
+
export class CustomFrameworkRegistry {
|
|
5
|
+
configManager;
|
|
6
|
+
truthValidator;
|
|
7
|
+
initialized;
|
|
8
|
+
frameworks;
|
|
9
|
+
qualityGates;
|
|
10
|
+
constructor(options = {}){
|
|
11
|
+
this.configManager = options.configManager;
|
|
12
|
+
this.truthValidator = options.truthValidator;
|
|
13
|
+
this.initialized = false;
|
|
14
|
+
this.frameworks = new Map();
|
|
15
|
+
this.qualityGates = new Map();
|
|
16
|
+
}
|
|
17
|
+
async initialize() {
|
|
18
|
+
this.initialized = true;
|
|
19
|
+
// Initialize with some default frameworks
|
|
20
|
+
const defaultFrameworks = [
|
|
21
|
+
{
|
|
22
|
+
id: 'tdd-default',
|
|
23
|
+
name: 'Test-Driven Development',
|
|
24
|
+
type: 'TDD',
|
|
25
|
+
truth_threshold: 0.85,
|
|
26
|
+
test_coverage_requirement: 0.90
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'bdd-default',
|
|
30
|
+
name: 'Behavior-Driven Development',
|
|
31
|
+
type: 'BDD',
|
|
32
|
+
truth_threshold: 0.80,
|
|
33
|
+
scenario_coverage_requirement: 0.85
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'sparc-default',
|
|
37
|
+
name: 'SPARC Methodology',
|
|
38
|
+
type: 'SPARC',
|
|
39
|
+
truth_threshold: 0.75,
|
|
40
|
+
phase_completion_requirement: 1.0
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
for (const framework of defaultFrameworks){
|
|
44
|
+
this.frameworks.set(framework.id, framework);
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
async close() {
|
|
49
|
+
this.initialized = false;
|
|
50
|
+
}
|
|
51
|
+
async addFramework(framework, options) {
|
|
52
|
+
// Validate framework
|
|
53
|
+
if (!framework.id || !framework.name) {
|
|
54
|
+
throw new Error('Framework must have id and name');
|
|
55
|
+
}
|
|
56
|
+
// Add to local registry
|
|
57
|
+
this.frameworks.set(framework.id, framework);
|
|
58
|
+
// Generate cryptographic signature
|
|
59
|
+
const signature = crypto.createHash('sha256').update(JSON.stringify(framework) + Date.now()).digest('hex');
|
|
60
|
+
return {
|
|
61
|
+
success: true,
|
|
62
|
+
byzantineValidated: options?.requireByzantineConsensus ?? false,
|
|
63
|
+
cryptographicSignature: {
|
|
64
|
+
signature,
|
|
65
|
+
algorithm: 'sha256',
|
|
66
|
+
timestamp: Date.now()
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
async listAvailableFrameworks() {
|
|
71
|
+
return Array.from(this.frameworks.values());
|
|
72
|
+
}
|
|
73
|
+
async detectProjectFramework(projectDir) {
|
|
74
|
+
const startTime = Date.now();
|
|
75
|
+
const detectionResult = {
|
|
76
|
+
framework: null,
|
|
77
|
+
confidence: 0,
|
|
78
|
+
warnings: [],
|
|
79
|
+
additionalFrameworks: [],
|
|
80
|
+
subprojects: []
|
|
81
|
+
};
|
|
82
|
+
try {
|
|
83
|
+
// Check for package.json (JavaScript/TypeScript)
|
|
84
|
+
const packageJsonPath = path.join(projectDir, 'package.json');
|
|
85
|
+
try {
|
|
86
|
+
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
87
|
+
const result = await this.detectJavaScriptFramework(packageJson, projectDir);
|
|
88
|
+
if (result.framework) {
|
|
89
|
+
Object.assign(detectionResult, result);
|
|
90
|
+
}
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// package.json doesn't exist
|
|
93
|
+
}
|
|
94
|
+
// Check for Python projects
|
|
95
|
+
if (!detectionResult.framework) {
|
|
96
|
+
const pythonResult = await this.detectPythonFramework(projectDir);
|
|
97
|
+
if (pythonResult.framework) {
|
|
98
|
+
Object.assign(detectionResult, pythonResult);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Check for monorepo structure
|
|
102
|
+
const monorepoResult = await this.detectMonorepo(projectDir);
|
|
103
|
+
if (monorepoResult.subprojects && monorepoResult.subprojects.length > 0) {
|
|
104
|
+
detectionResult.subprojects = monorepoResult.subprojects;
|
|
105
|
+
}
|
|
106
|
+
// If no framework detected, warn
|
|
107
|
+
if (!detectionResult.framework) {
|
|
108
|
+
detectionResult.warnings = [
|
|
109
|
+
'No testing framework detected'
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
detectionResult.detectionTime = Date.now() - startTime;
|
|
113
|
+
return detectionResult;
|
|
114
|
+
} catch (error) {
|
|
115
|
+
return {
|
|
116
|
+
framework: null,
|
|
117
|
+
warnings: [
|
|
118
|
+
`Detection error: ${error.message}`
|
|
119
|
+
],
|
|
120
|
+
detectionTime: Date.now() - startTime
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
async detectJavaScriptFramework(packageJson, projectDir) {
|
|
125
|
+
const dependencies = {
|
|
126
|
+
...packageJson.dependencies,
|
|
127
|
+
...packageJson.devDependencies
|
|
128
|
+
};
|
|
129
|
+
let framework = null;
|
|
130
|
+
let testFramework = null;
|
|
131
|
+
let confidence = 0;
|
|
132
|
+
const additionalFrameworks = [];
|
|
133
|
+
// Detect test frameworks
|
|
134
|
+
if (dependencies['jest']) {
|
|
135
|
+
testFramework = 'Jest';
|
|
136
|
+
framework = 'TDD';
|
|
137
|
+
confidence = 0.95;
|
|
138
|
+
}
|
|
139
|
+
if (dependencies['mocha']) {
|
|
140
|
+
if (!testFramework) {
|
|
141
|
+
testFramework = 'Mocha';
|
|
142
|
+
framework = 'TDD';
|
|
143
|
+
confidence = 0.93;
|
|
144
|
+
} else {
|
|
145
|
+
additionalFrameworks.push('Mocha');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (dependencies['@cucumber/cucumber']) {
|
|
149
|
+
framework = 'BDD';
|
|
150
|
+
testFramework = 'Cucumber';
|
|
151
|
+
confidence = 0.96;
|
|
152
|
+
}
|
|
153
|
+
// Check for BDD features
|
|
154
|
+
try {
|
|
155
|
+
const featuresDir = path.join(projectDir, 'features');
|
|
156
|
+
const stats = await fs.stat(featuresDir);
|
|
157
|
+
if (stats.isDirectory()) {
|
|
158
|
+
framework = 'BDD';
|
|
159
|
+
confidence = Math.max(confidence, 0.92);
|
|
160
|
+
}
|
|
161
|
+
} catch (error) {
|
|
162
|
+
// No features directory
|
|
163
|
+
}
|
|
164
|
+
// Detect language
|
|
165
|
+
let language = 'JavaScript';
|
|
166
|
+
if (dependencies['typescript'] || await this.fileExists(path.join(projectDir, 'tsconfig.json'))) {
|
|
167
|
+
language = 'TypeScript';
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
framework,
|
|
171
|
+
language,
|
|
172
|
+
testFramework: testFramework || undefined,
|
|
173
|
+
confidence,
|
|
174
|
+
additionalFrameworks: additionalFrameworks.length > 0 ? additionalFrameworks : undefined
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async detectPythonFramework(projectDir) {
|
|
178
|
+
let framework = null;
|
|
179
|
+
let testFramework = null;
|
|
180
|
+
let confidence = 0;
|
|
181
|
+
// Check for requirements.txt
|
|
182
|
+
try {
|
|
183
|
+
const requirementsPath = path.join(projectDir, 'requirements.txt');
|
|
184
|
+
const requirements = await fs.readFile(requirementsPath, 'utf-8');
|
|
185
|
+
if (requirements.includes('pytest')) {
|
|
186
|
+
framework = 'TDD';
|
|
187
|
+
testFramework = 'pytest';
|
|
188
|
+
confidence = 0.91;
|
|
189
|
+
}
|
|
190
|
+
if (requirements.includes('behave')) {
|
|
191
|
+
framework = 'BDD';
|
|
192
|
+
testFramework = 'behave';
|
|
193
|
+
confidence = 0.92;
|
|
194
|
+
}
|
|
195
|
+
} catch (error) {
|
|
196
|
+
// No requirements.txt
|
|
197
|
+
}
|
|
198
|
+
// Check for BDD features directory
|
|
199
|
+
try {
|
|
200
|
+
const featuresDir = path.join(projectDir, 'features');
|
|
201
|
+
const stats = await fs.stat(featuresDir);
|
|
202
|
+
if (stats.isDirectory()) {
|
|
203
|
+
framework = 'BDD';
|
|
204
|
+
confidence = Math.max(confidence, 0.90);
|
|
205
|
+
}
|
|
206
|
+
} catch (error) {
|
|
207
|
+
// No features directory
|
|
208
|
+
}
|
|
209
|
+
if (framework) {
|
|
210
|
+
return {
|
|
211
|
+
framework,
|
|
212
|
+
language: 'Python',
|
|
213
|
+
testFramework: testFramework || undefined,
|
|
214
|
+
confidence
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
framework: null
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
async detectMonorepo(projectDir) {
|
|
222
|
+
const subprojects = [];
|
|
223
|
+
// Check for lerna.json
|
|
224
|
+
try {
|
|
225
|
+
const lernaPath = path.join(projectDir, 'lerna.json');
|
|
226
|
+
await fs.stat(lernaPath);
|
|
227
|
+
// Check packages directory
|
|
228
|
+
const packagesDir = path.join(projectDir, 'packages');
|
|
229
|
+
const packages = await fs.readdir(packagesDir);
|
|
230
|
+
for (const pkg of packages){
|
|
231
|
+
const pkgPath = path.join(packagesDir, pkg);
|
|
232
|
+
const stats = await fs.stat(pkgPath);
|
|
233
|
+
if (stats.isDirectory()) {
|
|
234
|
+
const detection = await this.detectProjectFramework(pkgPath);
|
|
235
|
+
if (detection.framework) {
|
|
236
|
+
subprojects.push({
|
|
237
|
+
path: pkgPath,
|
|
238
|
+
framework: detection.framework
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
} catch (error) {
|
|
244
|
+
// Not a monorepo
|
|
245
|
+
}
|
|
246
|
+
return subprojects.length > 0 ? {
|
|
247
|
+
subprojects
|
|
248
|
+
} : {};
|
|
249
|
+
}
|
|
250
|
+
async fileExists(filePath) {
|
|
251
|
+
try {
|
|
252
|
+
await fs.stat(filePath);
|
|
253
|
+
return true;
|
|
254
|
+
} catch (error) {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async configureQualityGate(gate, config) {
|
|
259
|
+
this.qualityGates.set(gate, config);
|
|
260
|
+
return {
|
|
261
|
+
configured: true,
|
|
262
|
+
gate,
|
|
263
|
+
...config
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
async validateFramework(framework) {
|
|
267
|
+
return !!(framework.id && framework.name);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
export class FrameworkRegistry extends CustomFrameworkRegistry {
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
//# sourceMappingURL=framework-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/truth/framework-registry.ts"],"names":["fs","path","crypto","CustomFrameworkRegistry","configManager","truthValidator","initialized","frameworks","qualityGates","options","Map","initialize","defaultFrameworks","id","name","type","truth_threshold","test_coverage_requirement","scenario_coverage_requirement","phase_completion_requirement","framework","set","close","addFramework","Error","signature","createHash","update","JSON","stringify","Date","now","digest","success","byzantineValidated","requireByzantineConsensus","cryptographicSignature","algorithm","timestamp","listAvailableFrameworks","Array","from","values","detectProjectFramework","projectDir","startTime","detectionResult","confidence","warnings","additionalFrameworks","subprojects","packageJsonPath","join","packageJson","parse","readFile","result","detectJavaScriptFramework","Object","assign","error","pythonResult","detectPythonFramework","monorepoResult","detectMonorepo","length","detectionTime","message","dependencies","devDependencies","testFramework","push","featuresDir","stats","stat","isDirectory","Math","max","language","fileExists","undefined","requirementsPath","requirements","includes","lernaPath","packagesDir","packages","readdir","pkg","pkgPath","detection","filePath","configureQualityGate","gate","config","configured","validateFramework","FrameworkRegistry"],"mappings":"AAAA,YAAYA,QAAQ,cAAc;AAClC,YAAYC,UAAU,OAAO;AAC7B,YAAYC,YAAY,SAAS;AAgCjC,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IAAI,CAACU;YAEd,2BAA2B;YAC3B,MAAMC,cAAcpF,KAAKmD,IAAI,CAACR,YAAY;YAC1C,MAAM0C,WAAW,MAAMtF,GAAGuF,OAAO,CAACF;YAElC,KAAK,MAAMG,OAAOF,SAAU;gBAC1B,MAAMG,UAAUxF,KAAKmD,IAAI,CAACiC,aAAaG;gBACvC,MAAMf,QAAQ,MAAMzE,GAAG0E,IAAI,CAACe;gBAC5B,IAAIhB,MAAME,WAAW,IAAI;oBACvB,MAAMe,YAAY,MAAM,IAAI,CAAC/C,sBAAsB,CAAC8C;oBACpD,IAAIC,UAAUtE,SAAS,EAAE;wBACvB8B,YAAYqB,IAAI,CAAC;4BACftE,MAAMwF;4BACNrE,WAAWsE,UAAUtE,SAAS;wBAChC;oBACF;gBACF;YACF;QACF,EAAE,OAAOwC,OAAO;QACd,iBAAiB;QACnB;QAEA,OAAOV,YAAYe,MAAM,GAAG,IAAI;YAAEf;QAAY,IAAI,CAAC;IACrD;IAEA,MAAc6B,WAAWY,QAAgB,EAAoB;QAC3D,IAAI;YACF,MAAM3F,GAAG0E,IAAI,CAACiB;YACd,OAAO;QACT,EAAE,OAAO/B,OAAO;YACd,OAAO;QACT;IACF;IAEA,MAAMgC,qBAAqBC,IAAY,EAAEC,MAGxC,EAA8B;QAC7B,IAAI,CAACtF,YAAY,CAACa,GAAG,CAACwE,MAAMC;QAE5B,OAAO;YACLC,YAAY;YACZF;YACA,GAAGC,MAAM;QACX;IACF;IAEA,MAAME,kBAAkB5E,SAAoB,EAAoB;QAC9D,OAAO,CAAC,CAAEA,CAAAA,UAAUP,EAAE,IAAIO,UAAUN,IAAI,AAAD;IACzC;AACF;AAEA,OAAO,MAAMmF,0BAA0B9F;AAEvC"}
|
package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 2 Truth Validation Components
|
|
3
|
+
* Exports all truth-related classes for completion validation
|
|
4
|
+
*/ export { UserConfigurationManager, TruthConfigManager } from './truth-config-manager';
|
|
5
|
+
export { CustomFrameworkRegistry, FrameworkRegistry } from './framework-registry';
|
|
6
|
+
export { CompletionTruthValidator, TruthValidator } from './truth-validator';
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/.claude-flow-novice/dist/src/coordination/archives/v2-sdk-typescript/v2/truth/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/truth/index.ts"],"names":["UserConfigurationManager","TruthConfigManager","CustomFrameworkRegistry","FrameworkRegistry","CompletionTruthValidator","TruthValidator"],"mappings":"AAAA;;;CAGC,GAED,SACEA,wBAAwB,EACxBC,kBAAkB,QASb,yBAAyB;AAEhC,SACEC,uBAAuB,EACvBC,iBAAiB,QAGZ,uBAAuB;AAE9B,SACEC,wBAAwB,EACxBC,cAAc,QAIT,oBAAoB"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as crypto from 'crypto';
|
|
4
|
+
export class UserConfigurationManager {
|
|
5
|
+
options;
|
|
6
|
+
analyticsStore;
|
|
7
|
+
initialized;
|
|
8
|
+
preferences;
|
|
9
|
+
byzantineConsensus;
|
|
10
|
+
constructor(options = {}){
|
|
11
|
+
this.options = {
|
|
12
|
+
consensusThreshold: 0.85,
|
|
13
|
+
enableByzantineValidation: false,
|
|
14
|
+
...options
|
|
15
|
+
};
|
|
16
|
+
this.analyticsStore = new Map();
|
|
17
|
+
this.initialized = false;
|
|
18
|
+
this.preferences = {
|
|
19
|
+
completion_validation: {
|
|
20
|
+
frameworks: {},
|
|
21
|
+
quality_gates: {},
|
|
22
|
+
user_customization: {}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
// Byzantine consensus mock
|
|
26
|
+
this.byzantineConsensus = {
|
|
27
|
+
achieveConsensus: async (data)=>{
|
|
28
|
+
const signature = crypto.createHash('sha256').update(JSON.stringify(data) + Date.now()).digest('hex');
|
|
29
|
+
return {
|
|
30
|
+
consensusReached: true,
|
|
31
|
+
consensusRatio: 0.95,
|
|
32
|
+
cryptographicSignature: {
|
|
33
|
+
signature,
|
|
34
|
+
algorithm: 'sha256',
|
|
35
|
+
timestamp: Date.now()
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async initialize() {
|
|
42
|
+
this.initialized = true;
|
|
43
|
+
// Try to load existing preferences
|
|
44
|
+
try {
|
|
45
|
+
if (this.options.preferencesPath) {
|
|
46
|
+
const prefsFile = path.join(this.options.preferencesPath, 'user-global.json');
|
|
47
|
+
const data = await fs.readFile(prefsFile, 'utf-8');
|
|
48
|
+
const loaded = JSON.parse(data);
|
|
49
|
+
this.preferences = loaded.preferences || this.preferences;
|
|
50
|
+
}
|
|
51
|
+
} catch (error) {
|
|
52
|
+
// File doesn't exist or is corrupted - use defaults
|
|
53
|
+
this.preferences = {
|
|
54
|
+
completion_validation: {
|
|
55
|
+
frameworks: {},
|
|
56
|
+
quality_gates: {},
|
|
57
|
+
user_customization: {}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
async shutdown() {
|
|
64
|
+
this.initialized = false;
|
|
65
|
+
}
|
|
66
|
+
async validateConfigurationSchema(config) {
|
|
67
|
+
const errors = [];
|
|
68
|
+
if (!config || typeof config !== 'object') {
|
|
69
|
+
errors.push({
|
|
70
|
+
message: 'Configuration must be an object'
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
valid: false,
|
|
74
|
+
errors
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Validate frameworks
|
|
78
|
+
if (config.completion_validation?.frameworks) {
|
|
79
|
+
for (const [id, framework] of Object.entries(config.completion_validation.frameworks)){
|
|
80
|
+
// Validate threshold ranges when they exist
|
|
81
|
+
if (framework.truth_threshold !== undefined) {
|
|
82
|
+
if (framework.truth_threshold < 0 || framework.truth_threshold > 1.0) {
|
|
83
|
+
errors.push({
|
|
84
|
+
message: 'Invalid truth threshold range',
|
|
85
|
+
field: `frameworks.${id}.truth_threshold`
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Additional validation for test_coverage_requirement
|
|
90
|
+
if (framework.test_coverage_requirement !== undefined) {
|
|
91
|
+
if (framework.test_coverage_requirement < 0 || framework.test_coverage_requirement > 1.0) {
|
|
92
|
+
errors.push({
|
|
93
|
+
message: 'Invalid test coverage requirement range',
|
|
94
|
+
field: `frameworks.${id}.test_coverage_requirement`
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Name validation: require it unless this is a wizard step with multiple threshold configs
|
|
99
|
+
// Wizard configs have 2+ threshold/coverage fields, incomplete configs have just 1 field
|
|
100
|
+
const fieldCount = Object.keys(framework).length;
|
|
101
|
+
const isWizardStep = fieldCount >= 2 && (framework.truth_threshold !== undefined || framework.test_coverage_requirement !== undefined);
|
|
102
|
+
if (!framework.name && !isWizardStep) {
|
|
103
|
+
errors.push({
|
|
104
|
+
message: 'Framework name is required',
|
|
105
|
+
field: `frameworks.${id}.name`
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
valid: errors.length === 0,
|
|
112
|
+
errors
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
async validateConfigurationUpdate(config, options) {
|
|
116
|
+
const schemaValidation = await this.validateConfigurationSchema(config);
|
|
117
|
+
if (!schemaValidation.valid) {
|
|
118
|
+
return schemaValidation;
|
|
119
|
+
}
|
|
120
|
+
// Security validation if requested
|
|
121
|
+
if (options?.securityValidation) {
|
|
122
|
+
const securityResult = await this.performSecurityValidation(config);
|
|
123
|
+
if (!securityResult.valid) {
|
|
124
|
+
return {
|
|
125
|
+
valid: false,
|
|
126
|
+
errors: securityResult.violations.map((v)=>({
|
|
127
|
+
message: v.message
|
|
128
|
+
}))
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
valid: true,
|
|
134
|
+
errors: []
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async performSecurityValidation(config) {
|
|
138
|
+
const violations = [];
|
|
139
|
+
if (config.completion_validation?.frameworks) {
|
|
140
|
+
for (const [id, framework] of Object.entries(config.completion_validation.frameworks)){
|
|
141
|
+
// Check for bypass attempts
|
|
142
|
+
if (framework.bypass_validation || framework.disable_security) {
|
|
143
|
+
violations.push({
|
|
144
|
+
message: 'Security bypass attempt detected',
|
|
145
|
+
severity: 'high'
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Check for invalid threshold range (security concern)
|
|
149
|
+
if (framework.truth_threshold !== undefined) {
|
|
150
|
+
if (framework.truth_threshold < 0 || framework.truth_threshold > 1.0) {
|
|
151
|
+
violations.push({
|
|
152
|
+
message: 'Invalid truth threshold range',
|
|
153
|
+
severity: 'high'
|
|
154
|
+
});
|
|
155
|
+
} else if (framework.truth_threshold <= 0.0) {
|
|
156
|
+
violations.push({
|
|
157
|
+
message: 'Truth threshold too low - security risk',
|
|
158
|
+
severity: 'high'
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// Check for code injection attempts
|
|
163
|
+
if (framework.name?.includes('eval(') || framework.name?.includes('${')) {
|
|
164
|
+
violations.push({
|
|
165
|
+
message: 'Code injection attempt detected',
|
|
166
|
+
severity: 'high'
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
// Check for DoS attempts (excessive arrays)
|
|
170
|
+
if (framework.validation_rules && Array.isArray(framework.validation_rules) && framework.validation_rules.length > 1000) {
|
|
171
|
+
violations.push({
|
|
172
|
+
message: 'Denial of service attack detected - excessive validation rules',
|
|
173
|
+
severity: 'high'
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (framework.quality_gates && Array.isArray(framework.quality_gates) && framework.quality_gates.length > 1000) {
|
|
177
|
+
violations.push({
|
|
178
|
+
message: 'Denial of service attack detected - excessive quality gates',
|
|
179
|
+
severity: 'high'
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
valid: violations.length === 0,
|
|
186
|
+
violations
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
async validateWithByzantineConsensus(config, sessionId) {
|
|
190
|
+
if (!this.options.enableByzantineValidation) {
|
|
191
|
+
return {
|
|
192
|
+
consensusReached: true,
|
|
193
|
+
cryptographicSignature: {
|
|
194
|
+
signature: 'mock-signature',
|
|
195
|
+
algorithm: 'sha256',
|
|
196
|
+
timestamp: Date.now()
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
return await this.byzantineConsensus.achieveConsensus({
|
|
201
|
+
config,
|
|
202
|
+
sessionId
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
async updateConfiguration(config, options) {
|
|
206
|
+
try {
|
|
207
|
+
// Validate configuration
|
|
208
|
+
const validation = await this.validateConfigurationUpdate(config, {
|
|
209
|
+
securityValidation: options?.securityValidation
|
|
210
|
+
});
|
|
211
|
+
if (!validation.valid) {
|
|
212
|
+
return {
|
|
213
|
+
success: false,
|
|
214
|
+
validationErrors: validation.errors,
|
|
215
|
+
error: validation.errors[0]?.message || 'Validation failed'
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
// Byzantine consensus if required
|
|
219
|
+
let consensusResult;
|
|
220
|
+
if (options?.requireConsensus && this.options.enableByzantineValidation) {
|
|
221
|
+
consensusResult = await this.byzantineConsensus.achieveConsensus(config);
|
|
222
|
+
if (!consensusResult.consensusReached) {
|
|
223
|
+
return {
|
|
224
|
+
success: false,
|
|
225
|
+
byzantineRejection: true,
|
|
226
|
+
error: 'Byzantine consensus not reached'
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Merge with existing preferences
|
|
231
|
+
await this.mergeWithExistingPreferences(config);
|
|
232
|
+
// Save to disk
|
|
233
|
+
if (this.options.preferencesPath) {
|
|
234
|
+
await fs.mkdir(this.options.preferencesPath, {
|
|
235
|
+
recursive: true
|
|
236
|
+
});
|
|
237
|
+
const prefsFile = path.join(this.options.preferencesPath, 'user-global.json');
|
|
238
|
+
await fs.writeFile(prefsFile, JSON.stringify({
|
|
239
|
+
preferences: this.preferences
|
|
240
|
+
}, null, 2));
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
success: true,
|
|
244
|
+
configurationApplied: true,
|
|
245
|
+
consensusReached: consensusResult?.consensusReached ?? true,
|
|
246
|
+
cryptographicSignature: consensusResult?.cryptographicSignature
|
|
247
|
+
};
|
|
248
|
+
} catch (error) {
|
|
249
|
+
return {
|
|
250
|
+
success: false,
|
|
251
|
+
error: error.message || 'Unknown error'
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async mergeWithExistingPreferences(config) {
|
|
256
|
+
if (!this.preferences.completion_validation) {
|
|
257
|
+
this.preferences.completion_validation = {};
|
|
258
|
+
}
|
|
259
|
+
if (config.completion_validation) {
|
|
260
|
+
// Merge frameworks
|
|
261
|
+
if (config.completion_validation.frameworks) {
|
|
262
|
+
if (!this.preferences.completion_validation.frameworks) {
|
|
263
|
+
this.preferences.completion_validation.frameworks = {};
|
|
264
|
+
}
|
|
265
|
+
Object.assign(this.preferences.completion_validation.frameworks, config.completion_validation.frameworks);
|
|
266
|
+
}
|
|
267
|
+
// Merge quality gates
|
|
268
|
+
if (config.completion_validation.quality_gates) {
|
|
269
|
+
if (!this.preferences.completion_validation.quality_gates) {
|
|
270
|
+
this.preferences.completion_validation.quality_gates = {};
|
|
271
|
+
}
|
|
272
|
+
Object.assign(this.preferences.completion_validation.quality_gates, config.completion_validation.quality_gates);
|
|
273
|
+
}
|
|
274
|
+
// Merge user customization
|
|
275
|
+
if (config.completion_validation.user_customization) {
|
|
276
|
+
if (!this.preferences.completion_validation.user_customization) {
|
|
277
|
+
this.preferences.completion_validation.user_customization = {};
|
|
278
|
+
}
|
|
279
|
+
Object.assign(this.preferences.completion_validation.user_customization, config.completion_validation.user_customization);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
async addCustomFramework(framework, options) {
|
|
284
|
+
const config = {
|
|
285
|
+
completion_validation: {
|
|
286
|
+
frameworks: {
|
|
287
|
+
[framework.id]: framework
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const result = await this.updateConfiguration(config, {
|
|
292
|
+
requireConsensus: options?.requireByzantineConsensus
|
|
293
|
+
});
|
|
294
|
+
return {
|
|
295
|
+
success: result.success,
|
|
296
|
+
frameworkAdded: result.success,
|
|
297
|
+
byzantineValidated: result.consensusReached,
|
|
298
|
+
cryptographicSignature: result.cryptographicSignature
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
async getPreferences() {
|
|
302
|
+
return {
|
|
303
|
+
preferences: this.preferences
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
export class TruthConfigManager extends UserConfigurationManager {
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
//# sourceMappingURL=truth-config-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/coordination/archives/v2-sdk-typescript/v2/truth/truth-config-manager.ts"],"names":["fs","path","crypto","UserConfigurationManager","options","analyticsStore","initialized","preferences","byzantineConsensus","consensusThreshold","enableByzantineValidation","Map","completion_validation","frameworks","quality_gates","user_customization","achieveConsensus","data","signature","createHash","update","JSON","stringify","Date","now","digest","consensusReached","consensusRatio","cryptographicSignature","algorithm","timestamp","initialize","preferencesPath","prefsFile","join","readFile","loaded","parse","error","shutdown","validateConfigurationSchema","config","errors","push","message","valid","id","framework","Object","entries","truth_threshold","undefined","field","test_coverage_requirement","fieldCount","keys","length","isWizardStep","name","validateConfigurationUpdate","schemaValidation","securityValidation","securityResult","performSecurityValidation","violations","map","v","bypass_validation","disable_security","severity","includes","validation_rules","Array","isArray","validateWithByzantineConsensus","sessionId","updateConfiguration","validation","success","validationErrors","consensusResult","requireConsensus","byzantineRejection","mergeWithExistingPreferences","mkdir","recursive","writeFile","configurationApplied","assign","addCustomFramework","result","requireByzantineConsensus","frameworkAdded","byzantineValidated","getPreferences","TruthConfigManager"],"mappings":"AAAA,YAAYA,QAAQ,cAAc;AAClC,YAAYC,UAAU,OAAO;AAC7B,YAAYC,YAAY,SAAS;AAyEjC,OAAO,MAAMC;IACJC,QAOL;IACKC,eAAiC;IACjCC,YAAqB;IACpBC,YAA2B;IAC5BC,mBAEL;IAEF,YAAYJ,UAA6D,CAAC,CAAC,CAAE;QAC3E,IAAI,CAACA,OAAO,GAAG;YACbK,oBAAoB;YACpBC,2BAA2B;YAC3B,GAAGN,OAAO;QACZ;QACA,IAAI,CAACC,cAAc,GAAG,IAAIM;QAC1B,IAAI,CAACL,WAAW,GAAG;QACnB,IAAI,CAACC,WAAW,GAAG;YAAEK,uBAAuB;gBAAEC,YAAY,CAAC;gBAAGC,eAAe,CAAC;gBAAGC,oBAAoB,CAAC;YAAE;QAAE;QAE1G,2BAA2B;QAC3B,IAAI,CAACP,kBAAkB,GAAG;YACxBQ,kBAAkB,OAAOC;gBACvB,MAAMC,YAAYhB,OAAOiB,UAAU,CAAC,UACjCC,MAAM,CAACC,KAAKC,SAAS,CAACL,QAAQM,KAAKC,GAAG,IACtCC,MAAM,CAAC;gBAEV,OAAO;oBACLC,kBAAkB;oBAClBC,gBAAgB;oBAChBC,wBAAwB;wBACtBV;wBACAW,WAAW;wBACXC,WAAWP,KAAKC,GAAG;oBACrB;gBACF;YACF;QACF;IACF;IAEA,MAAMO,aAA+B;QACn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