agentic-qe 2.7.4 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/README.md +67 -2
- package/dist/cli/commands/agent/spawn.d.ts +12 -1
- package/dist/cli/commands/agent/spawn.d.ts.map +1 -1
- package/dist/cli/commands/agent/spawn.js +95 -8
- package/dist/cli/commands/agent/spawn.js.map +1 -1
- package/dist/cli/index.js +91 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/core/memory/HNSWVectorMemory.js +1 -1
- package/dist/edge/adapters/BrowserHNSWAdapter.d.ts +134 -0
- package/dist/edge/adapters/BrowserHNSWAdapter.d.ts.map +1 -0
- package/dist/edge/adapters/BrowserHNSWAdapter.js +484 -0
- package/dist/edge/adapters/BrowserHNSWAdapter.js.map +1 -0
- package/dist/edge/adapters/IndexedDBStorage.d.ts +114 -0
- package/dist/edge/adapters/IndexedDBStorage.d.ts.map +1 -0
- package/dist/edge/adapters/IndexedDBStorage.js +478 -0
- package/dist/edge/adapters/IndexedDBStorage.js.map +1 -0
- package/dist/edge/adapters/index.d.ts +12 -0
- package/dist/edge/adapters/index.d.ts.map +1 -0
- package/dist/edge/adapters/index.js +22 -0
- package/dist/edge/adapters/index.js.map +1 -0
- package/dist/edge/browser/BrowserAgent.d.ts +241 -0
- package/dist/edge/browser/BrowserAgent.d.ts.map +1 -0
- package/dist/edge/browser/BrowserAgent.js +743 -0
- package/dist/edge/browser/BrowserAgent.js.map +1 -0
- package/dist/edge/index.d.ts +34 -0
- package/dist/edge/index.d.ts.map +1 -0
- package/dist/edge/index.js +114 -0
- package/dist/edge/index.js.map +1 -0
- package/dist/edge/p2p/coordination/CoordinationManager.d.ts +181 -0
- package/dist/edge/p2p/coordination/CoordinationManager.d.ts.map +1 -0
- package/dist/edge/p2p/coordination/CoordinationManager.js +851 -0
- package/dist/edge/p2p/coordination/CoordinationManager.js.map +1 -0
- package/dist/edge/p2p/coordination/HealthMonitor.d.ts +143 -0
- package/dist/edge/p2p/coordination/HealthMonitor.d.ts.map +1 -0
- package/dist/edge/p2p/coordination/HealthMonitor.js +432 -0
- package/dist/edge/p2p/coordination/HealthMonitor.js.map +1 -0
- package/dist/edge/p2p/coordination/SyncOrchestrator.d.ts +146 -0
- package/dist/edge/p2p/coordination/SyncOrchestrator.d.ts.map +1 -0
- package/dist/edge/p2p/coordination/SyncOrchestrator.js +783 -0
- package/dist/edge/p2p/coordination/SyncOrchestrator.js.map +1 -0
- package/dist/edge/p2p/coordination/index.d.ts +70 -0
- package/dist/edge/p2p/coordination/index.d.ts.map +1 -0
- package/dist/edge/p2p/coordination/index.js +107 -0
- package/dist/edge/p2p/coordination/index.js.map +1 -0
- package/dist/edge/p2p/coordination/types.d.ts +572 -0
- package/dist/edge/p2p/coordination/types.d.ts.map +1 -0
- package/dist/edge/p2p/coordination/types.js +366 -0
- package/dist/edge/p2p/coordination/types.js.map +1 -0
- package/dist/edge/p2p/crdt/CRDTStore.d.ts +324 -0
- package/dist/edge/p2p/crdt/CRDTStore.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/CRDTStore.js +839 -0
- package/dist/edge/p2p/crdt/CRDTStore.js.map +1 -0
- package/dist/edge/p2p/crdt/GCounter.d.ts +173 -0
- package/dist/edge/p2p/crdt/GCounter.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/GCounter.js +394 -0
- package/dist/edge/p2p/crdt/GCounter.js.map +1 -0
- package/dist/edge/p2p/crdt/LWWRegister.d.ts +200 -0
- package/dist/edge/p2p/crdt/LWWRegister.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/LWWRegister.js +456 -0
- package/dist/edge/p2p/crdt/LWWRegister.js.map +1 -0
- package/dist/edge/p2p/crdt/ORSet.d.ts +232 -0
- package/dist/edge/p2p/crdt/ORSet.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/ORSet.js +723 -0
- package/dist/edge/p2p/crdt/ORSet.js.map +1 -0
- package/dist/edge/p2p/crdt/PatternCRDT.d.ts +366 -0
- package/dist/edge/p2p/crdt/PatternCRDT.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/PatternCRDT.js +838 -0
- package/dist/edge/p2p/crdt/PatternCRDT.js.map +1 -0
- package/dist/edge/p2p/crdt/VectorClock.d.ts +274 -0
- package/dist/edge/p2p/crdt/VectorClock.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/VectorClock.js +499 -0
- package/dist/edge/p2p/crdt/VectorClock.js.map +1 -0
- package/dist/edge/p2p/crdt/index.d.ts +87 -0
- package/dist/edge/p2p/crdt/index.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/index.js +120 -0
- package/dist/edge/p2p/crdt/index.js.map +1 -0
- package/dist/edge/p2p/crdt/types.d.ts +667 -0
- package/dist/edge/p2p/crdt/types.d.ts.map +1 -0
- package/dist/edge/p2p/crdt/types.js +208 -0
- package/dist/edge/p2p/crdt/types.js.map +1 -0
- package/dist/edge/p2p/crypto/Identity.d.ts +139 -0
- package/dist/edge/p2p/crypto/Identity.d.ts.map +1 -0
- package/dist/edge/p2p/crypto/Identity.js +449 -0
- package/dist/edge/p2p/crypto/Identity.js.map +1 -0
- package/dist/edge/p2p/crypto/KeyManager.d.ts +196 -0
- package/dist/edge/p2p/crypto/KeyManager.d.ts.map +1 -0
- package/dist/edge/p2p/crypto/KeyManager.js +576 -0
- package/dist/edge/p2p/crypto/KeyManager.js.map +1 -0
- package/dist/edge/p2p/crypto/Signer.d.ts +164 -0
- package/dist/edge/p2p/crypto/Signer.d.ts.map +1 -0
- package/dist/edge/p2p/crypto/Signer.js +357 -0
- package/dist/edge/p2p/crypto/Signer.js.map +1 -0
- package/dist/edge/p2p/crypto/index.d.ts +90 -0
- package/dist/edge/p2p/crypto/index.d.ts.map +1 -0
- package/dist/edge/p2p/crypto/index.js +158 -0
- package/dist/edge/p2p/crypto/index.js.map +1 -0
- package/dist/edge/p2p/crypto/types.d.ts +217 -0
- package/dist/edge/p2p/crypto/types.d.ts.map +1 -0
- package/dist/edge/p2p/crypto/types.js +42 -0
- package/dist/edge/p2p/crypto/types.js.map +1 -0
- package/dist/edge/p2p/federated/FederatedCoordinator.d.ts +270 -0
- package/dist/edge/p2p/federated/FederatedCoordinator.d.ts.map +1 -0
- package/dist/edge/p2p/federated/FederatedCoordinator.js +824 -0
- package/dist/edge/p2p/federated/FederatedCoordinator.js.map +1 -0
- package/dist/edge/p2p/federated/FederatedRound.d.ts +295 -0
- package/dist/edge/p2p/federated/FederatedRound.d.ts.map +1 -0
- package/dist/edge/p2p/federated/FederatedRound.js +819 -0
- package/dist/edge/p2p/federated/FederatedRound.js.map +1 -0
- package/dist/edge/p2p/federated/GradientAggregator.d.ts +226 -0
- package/dist/edge/p2p/federated/GradientAggregator.d.ts.map +1 -0
- package/dist/edge/p2p/federated/GradientAggregator.js +826 -0
- package/dist/edge/p2p/federated/GradientAggregator.js.map +1 -0
- package/dist/edge/p2p/federated/ModelManager.d.ts +248 -0
- package/dist/edge/p2p/federated/ModelManager.d.ts.map +1 -0
- package/dist/edge/p2p/federated/ModelManager.js +724 -0
- package/dist/edge/p2p/federated/ModelManager.js.map +1 -0
- package/dist/edge/p2p/federated/index.d.ts +65 -0
- package/dist/edge/p2p/federated/index.d.ts.map +1 -0
- package/dist/edge/p2p/federated/index.js +110 -0
- package/dist/edge/p2p/federated/index.js.map +1 -0
- package/dist/edge/p2p/federated/types.d.ts +905 -0
- package/dist/edge/p2p/federated/types.d.ts.map +1 -0
- package/dist/edge/p2p/federated/types.js +339 -0
- package/dist/edge/p2p/federated/types.js.map +1 -0
- package/dist/edge/p2p/index.d.ts +156 -0
- package/dist/edge/p2p/index.d.ts.map +1 -0
- package/dist/edge/p2p/index.js +242 -0
- package/dist/edge/p2p/index.js.map +1 -0
- package/dist/edge/p2p/nat/ConnectivityTester.d.ts +128 -0
- package/dist/edge/p2p/nat/ConnectivityTester.d.ts.map +1 -0
- package/dist/edge/p2p/nat/ConnectivityTester.js +560 -0
- package/dist/edge/p2p/nat/ConnectivityTester.js.map +1 -0
- package/dist/edge/p2p/nat/HolePuncher.d.ts +159 -0
- package/dist/edge/p2p/nat/HolePuncher.d.ts.map +1 -0
- package/dist/edge/p2p/nat/HolePuncher.js +569 -0
- package/dist/edge/p2p/nat/HolePuncher.js.map +1 -0
- package/dist/edge/p2p/nat/NATDetector.d.ts +109 -0
- package/dist/edge/p2p/nat/NATDetector.d.ts.map +1 -0
- package/dist/edge/p2p/nat/NATDetector.js +472 -0
- package/dist/edge/p2p/nat/NATDetector.js.map +1 -0
- package/dist/edge/p2p/nat/TURNManager.d.ts +158 -0
- package/dist/edge/p2p/nat/TURNManager.d.ts.map +1 -0
- package/dist/edge/p2p/nat/TURNManager.js +547 -0
- package/dist/edge/p2p/nat/TURNManager.js.map +1 -0
- package/dist/edge/p2p/nat/index.d.ts +74 -0
- package/dist/edge/p2p/nat/index.d.ts.map +1 -0
- package/dist/edge/p2p/nat/index.js +104 -0
- package/dist/edge/p2p/nat/index.js.map +1 -0
- package/dist/edge/p2p/nat/types.d.ts +583 -0
- package/dist/edge/p2p/nat/types.d.ts.map +1 -0
- package/dist/edge/p2p/nat/types.js +267 -0
- package/dist/edge/p2p/nat/types.js.map +1 -0
- package/dist/edge/p2p/protocol/AgentChannel.d.ts +333 -0
- package/dist/edge/p2p/protocol/AgentChannel.d.ts.map +1 -0
- package/dist/edge/p2p/protocol/AgentChannel.js +914 -0
- package/dist/edge/p2p/protocol/AgentChannel.js.map +1 -0
- package/dist/edge/p2p/protocol/MessageEncoder.d.ts +147 -0
- package/dist/edge/p2p/protocol/MessageEncoder.d.ts.map +1 -0
- package/dist/edge/p2p/protocol/MessageEncoder.js +738 -0
- package/dist/edge/p2p/protocol/MessageEncoder.js.map +1 -0
- package/dist/edge/p2p/protocol/MessageRouter.d.ts +266 -0
- package/dist/edge/p2p/protocol/MessageRouter.d.ts.map +1 -0
- package/dist/edge/p2p/protocol/MessageRouter.js +808 -0
- package/dist/edge/p2p/protocol/MessageRouter.js.map +1 -0
- package/dist/edge/p2p/protocol/ProtocolHandler.d.ts +309 -0
- package/dist/edge/p2p/protocol/ProtocolHandler.d.ts.map +1 -0
- package/dist/edge/p2p/protocol/ProtocolHandler.js +930 -0
- package/dist/edge/p2p/protocol/ProtocolHandler.js.map +1 -0
- package/dist/edge/p2p/protocol/index.d.ts +114 -0
- package/dist/edge/p2p/protocol/index.d.ts.map +1 -0
- package/dist/edge/p2p/protocol/index.js +206 -0
- package/dist/edge/p2p/protocol/index.js.map +1 -0
- package/dist/edge/p2p/protocol/types.d.ts +737 -0
- package/dist/edge/p2p/protocol/types.d.ts.map +1 -0
- package/dist/edge/p2p/protocol/types.js +490 -0
- package/dist/edge/p2p/protocol/types.js.map +1 -0
- package/dist/edge/p2p/sharing/PatternBroadcaster.d.ts +284 -0
- package/dist/edge/p2p/sharing/PatternBroadcaster.d.ts.map +1 -0
- package/dist/edge/p2p/sharing/PatternBroadcaster.js +644 -0
- package/dist/edge/p2p/sharing/PatternBroadcaster.js.map +1 -0
- package/dist/edge/p2p/sharing/PatternIndex.d.ts +168 -0
- package/dist/edge/p2p/sharing/PatternIndex.d.ts.map +1 -0
- package/dist/edge/p2p/sharing/PatternIndex.js +781 -0
- package/dist/edge/p2p/sharing/PatternIndex.js.map +1 -0
- package/dist/edge/p2p/sharing/PatternSerializer.d.ts +163 -0
- package/dist/edge/p2p/sharing/PatternSerializer.d.ts.map +1 -0
- package/dist/edge/p2p/sharing/PatternSerializer.js +696 -0
- package/dist/edge/p2p/sharing/PatternSerializer.js.map +1 -0
- package/dist/edge/p2p/sharing/PatternSyncManager.d.ts +242 -0
- package/dist/edge/p2p/sharing/PatternSyncManager.d.ts.map +1 -0
- package/dist/edge/p2p/sharing/PatternSyncManager.js +859 -0
- package/dist/edge/p2p/sharing/PatternSyncManager.js.map +1 -0
- package/dist/edge/p2p/sharing/index.d.ts +90 -0
- package/dist/edge/p2p/sharing/index.d.ts.map +1 -0
- package/dist/edge/p2p/sharing/index.js +152 -0
- package/dist/edge/p2p/sharing/index.js.map +1 -0
- package/dist/edge/p2p/sharing/types.d.ts +796 -0
- package/dist/edge/p2p/sharing/types.d.ts.map +1 -0
- package/dist/edge/p2p/sharing/types.js +264 -0
- package/dist/edge/p2p/sharing/types.js.map +1 -0
- package/dist/edge/p2p/webrtc/ConnectionPool.d.ts +218 -0
- package/dist/edge/p2p/webrtc/ConnectionPool.d.ts.map +1 -0
- package/dist/edge/p2p/webrtc/ConnectionPool.js +562 -0
- package/dist/edge/p2p/webrtc/ConnectionPool.js.map +1 -0
- package/dist/edge/p2p/webrtc/ICEManager.d.ts +171 -0
- package/dist/edge/p2p/webrtc/ICEManager.d.ts.map +1 -0
- package/dist/edge/p2p/webrtc/ICEManager.js +490 -0
- package/dist/edge/p2p/webrtc/ICEManager.js.map +1 -0
- package/dist/edge/p2p/webrtc/PeerConnectionManager.d.ts +159 -0
- package/dist/edge/p2p/webrtc/PeerConnectionManager.d.ts.map +1 -0
- package/dist/edge/p2p/webrtc/PeerConnectionManager.js +735 -0
- package/dist/edge/p2p/webrtc/PeerConnectionManager.js.map +1 -0
- package/dist/edge/p2p/webrtc/SignalingClient.d.ts +191 -0
- package/dist/edge/p2p/webrtc/SignalingClient.d.ts.map +1 -0
- package/dist/edge/p2p/webrtc/SignalingClient.js +608 -0
- package/dist/edge/p2p/webrtc/SignalingClient.js.map +1 -0
- package/dist/edge/p2p/webrtc/index.d.ts +158 -0
- package/dist/edge/p2p/webrtc/index.d.ts.map +1 -0
- package/dist/edge/p2p/webrtc/index.js +164 -0
- package/dist/edge/p2p/webrtc/index.js.map +1 -0
- package/dist/edge/p2p/webrtc/types.d.ts +665 -0
- package/dist/edge/p2p/webrtc/types.d.ts.map +1 -0
- package/dist/edge/p2p/webrtc/types.js +245 -0
- package/dist/edge/p2p/webrtc/types.js.map +1 -0
- package/dist/edge/server/AgentSpawnAPI.d.ts +98 -0
- package/dist/edge/server/AgentSpawnAPI.d.ts.map +1 -0
- package/dist/edge/server/AgentSpawnAPI.js +264 -0
- package/dist/edge/server/AgentSpawnAPI.js.map +1 -0
- package/dist/edge/server/SignalingServer.d.ts +71 -0
- package/dist/edge/server/SignalingServer.d.ts.map +1 -0
- package/dist/edge/server/SignalingServer.js +429 -0
- package/dist/edge/server/SignalingServer.js.map +1 -0
- package/dist/edge/server/index.d.ts +64 -0
- package/dist/edge/server/index.d.ts.map +1 -0
- package/dist/edge/server/index.js +318 -0
- package/dist/edge/server/index.js.map +1 -0
- package/dist/edge/types/browser-agent.types.d.ts +455 -0
- package/dist/edge/types/browser-agent.types.d.ts.map +1 -0
- package/dist/edge/types/browser-agent.types.js +116 -0
- package/dist/edge/types/browser-agent.types.js.map +1 -0
- package/dist/edge/types/index.d.ts +11 -0
- package/dist/edge/types/index.d.ts.map +1 -0
- package/dist/edge/types/index.js +17 -0
- package/dist/edge/types/index.js.map +1 -0
- package/dist/edge/types/storage.types.d.ts +207 -0
- package/dist/edge/types/storage.types.d.ts.map +1 -0
- package/dist/edge/types/storage.types.js +47 -0
- package/dist/edge/types/storage.types.js.map +1 -0
- package/dist/edge/wasm/shims.d.ts +224 -0
- package/dist/edge/wasm/shims.d.ts.map +1 -0
- package/dist/edge/wasm/shims.js +667 -0
- package/dist/edge/wasm/shims.js.map +1 -0
- package/dist/mcp/handlers/NewDomainToolsHandler.d.ts +33 -0
- package/dist/mcp/handlers/NewDomainToolsHandler.d.ts.map +1 -0
- package/dist/mcp/handlers/NewDomainToolsHandler.js +305 -0
- package/dist/mcp/handlers/NewDomainToolsHandler.js.map +1 -0
- package/dist/mcp/handlers/filtered/index.d.ts +15 -19
- package/dist/mcp/handlers/filtered/index.d.ts.map +1 -1
- package/dist/mcp/handlers/filtered/index.js +16 -27
- package/dist/mcp/handlers/filtered/index.js.map +1 -1
- package/dist/mcp/handlers/integration/index.d.ts +5 -4
- package/dist/mcp/handlers/integration/index.d.ts.map +1 -1
- package/dist/mcp/handlers/integration/index.js +7 -7
- package/dist/mcp/handlers/integration/index.js.map +1 -1
- package/dist/mcp/server-instructions.d.ts +1 -1
- package/dist/mcp/server-instructions.js +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +14 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +8 -0
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +412 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/planning/GOAPPlanner.d.ts +1 -0
- package/dist/planning/GOAPPlanner.d.ts.map +1 -1
- package/dist/planning/GOAPPlanner.js +12 -0
- package/dist/planning/GOAPPlanner.js.map +1 -1
- package/package.json +29 -8
- package/dist/alerting/AlertManager.d.ts +0 -120
- package/dist/alerting/AlertManager.d.ts.map +0 -1
- package/dist/alerting/AlertManager.js +0 -345
- package/dist/alerting/AlertManager.js.map +0 -1
- package/dist/alerting/FeedbackRouter.d.ts +0 -98
- package/dist/alerting/FeedbackRouter.d.ts.map +0 -1
- package/dist/alerting/FeedbackRouter.js +0 -331
- package/dist/alerting/FeedbackRouter.js.map +0 -1
- package/dist/alerting/StrategyApplicator.d.ts +0 -120
- package/dist/alerting/StrategyApplicator.d.ts.map +0 -1
- package/dist/alerting/StrategyApplicator.js +0 -299
- package/dist/alerting/StrategyApplicator.js.map +0 -1
- package/dist/alerting/index.d.ts +0 -68
- package/dist/alerting/index.d.ts.map +0 -1
- package/dist/alerting/index.js +0 -112
- package/dist/alerting/index.js.map +0 -1
- package/dist/alerting/types.d.ts +0 -118
- package/dist/alerting/types.d.ts.map +0 -1
- package/dist/alerting/types.js +0 -11
- package/dist/alerting/types.js.map +0 -1
- package/dist/cli/commands/fleet/backup.d.ts +0 -49
- package/dist/cli/commands/fleet/backup.d.ts.map +0 -1
- package/dist/cli/commands/fleet/backup.js +0 -88
- package/dist/cli/commands/fleet/backup.js.map +0 -1
- package/dist/cli/commands/fleet/health.d.ts +0 -154
- package/dist/cli/commands/fleet/health.d.ts.map +0 -1
- package/dist/cli/commands/fleet/health.js +0 -483
- package/dist/cli/commands/fleet/health.js.map +0 -1
- package/dist/cli/commands/fleet/init.d.ts +0 -11
- package/dist/cli/commands/fleet/init.d.ts.map +0 -1
- package/dist/cli/commands/fleet/init.js +0 -91
- package/dist/cli/commands/fleet/init.js.map +0 -1
- package/dist/cli/commands/fleet/logs.d.ts +0 -21
- package/dist/cli/commands/fleet/logs.d.ts.map +0 -1
- package/dist/cli/commands/fleet/logs.js +0 -267
- package/dist/cli/commands/fleet/logs.js.map +0 -1
- package/dist/cli/commands/fleet/metrics.d.ts +0 -27
- package/dist/cli/commands/fleet/metrics.d.ts.map +0 -1
- package/dist/cli/commands/fleet/metrics.js +0 -369
- package/dist/cli/commands/fleet/metrics.js.map +0 -1
- package/dist/cli/commands/fleet/monitor.d.ts +0 -18
- package/dist/cli/commands/fleet/monitor.d.ts.map +0 -1
- package/dist/cli/commands/fleet/monitor.js +0 -237
- package/dist/cli/commands/fleet/monitor.js.map +0 -1
- package/dist/cli/commands/fleet/optimize.d.ts +0 -42
- package/dist/cli/commands/fleet/optimize.d.ts.map +0 -1
- package/dist/cli/commands/fleet/optimize.js +0 -135
- package/dist/cli/commands/fleet/optimize.js.map +0 -1
- package/dist/cli/commands/fleet/recover.d.ts +0 -22
- package/dist/cli/commands/fleet/recover.d.ts.map +0 -1
- package/dist/cli/commands/fleet/recover.js +0 -99
- package/dist/cli/commands/fleet/recover.js.map +0 -1
- package/dist/cli/commands/fleet/restart.d.ts +0 -18
- package/dist/cli/commands/fleet/restart.d.ts.map +0 -1
- package/dist/cli/commands/fleet/restart.js +0 -290
- package/dist/cli/commands/fleet/restart.js.map +0 -1
- package/dist/cli/commands/fleet/scale.d.ts +0 -9
- package/dist/cli/commands/fleet/scale.d.ts.map +0 -1
- package/dist/cli/commands/fleet/scale.js +0 -77
- package/dist/cli/commands/fleet/scale.js.map +0 -1
- package/dist/cli/commands/fleet/shutdown.d.ts +0 -19
- package/dist/cli/commands/fleet/shutdown.d.ts.map +0 -1
- package/dist/cli/commands/fleet/shutdown.js +0 -307
- package/dist/cli/commands/fleet/shutdown.js.map +0 -1
- package/dist/cli/commands/fleet/status.d.ts +0 -10
- package/dist/cli/commands/fleet/status.d.ts.map +0 -1
- package/dist/cli/commands/fleet/status.js +0 -97
- package/dist/cli/commands/fleet/status.js.map +0 -1
- package/dist/cli/commands/fleet/topology.d.ts +0 -23
- package/dist/cli/commands/fleet/topology.d.ts.map +0 -1
- package/dist/cli/commands/fleet/topology.js +0 -376
- package/dist/cli/commands/fleet/topology.js.map +0 -1
- package/dist/cli/commands/monitor/alerts.d.ts +0 -45
- package/dist/cli/commands/monitor/alerts.d.ts.map +0 -1
- package/dist/cli/commands/monitor/alerts.js +0 -168
- package/dist/cli/commands/monitor/alerts.js.map +0 -1
- package/dist/cli/commands/monitor/analyze.d.ts +0 -49
- package/dist/cli/commands/monitor/analyze.d.ts.map +0 -1
- package/dist/cli/commands/monitor/analyze.js +0 -209
- package/dist/cli/commands/monitor/analyze.js.map +0 -1
- package/dist/cli/commands/monitor/compare.d.ts +0 -38
- package/dist/cli/commands/monitor/compare.d.ts.map +0 -1
- package/dist/cli/commands/monitor/compare.js +0 -177
- package/dist/cli/commands/monitor/compare.js.map +0 -1
- package/dist/cli/commands/monitor/dashboard.d.ts +0 -34
- package/dist/cli/commands/monitor/dashboard.d.ts.map +0 -1
- package/dist/cli/commands/monitor/dashboard.js +0 -157
- package/dist/cli/commands/monitor/dashboard.js.map +0 -1
- package/dist/cli/commands/monitor/export.d.ts +0 -36
- package/dist/cli/commands/monitor/export.d.ts.map +0 -1
- package/dist/cli/commands/monitor/export.js +0 -157
- package/dist/cli/commands/monitor/export.js.map +0 -1
- package/dist/cli/commands/monitor/index.d.ts +0 -11
- package/dist/cli/commands/monitor/index.d.ts.map +0 -1
- package/dist/cli/commands/monitor/index.js +0 -14
- package/dist/cli/commands/monitor/index.js.map +0 -1
- package/dist/cli/commands/quality/baseline.d.ts +0 -27
- package/dist/cli/commands/quality/baseline.d.ts.map +0 -1
- package/dist/cli/commands/quality/baseline.js +0 -124
- package/dist/cli/commands/quality/baseline.js.map +0 -1
- package/dist/cli/commands/quality/compare.d.ts +0 -36
- package/dist/cli/commands/quality/compare.d.ts.map +0 -1
- package/dist/cli/commands/quality/compare.js +0 -136
- package/dist/cli/commands/quality/compare.js.map +0 -1
- package/dist/cli/commands/quality/decision.d.ts +0 -81
- package/dist/cli/commands/quality/decision.d.ts.map +0 -1
- package/dist/cli/commands/quality/decision.js +0 -319
- package/dist/cli/commands/quality/decision.js.map +0 -1
- package/dist/cli/commands/quality/gate.d.ts +0 -47
- package/dist/cli/commands/quality/gate.d.ts.map +0 -1
- package/dist/cli/commands/quality/gate.js +0 -205
- package/dist/cli/commands/quality/gate.js.map +0 -1
- package/dist/cli/commands/quality/index.d.ts +0 -17
- package/dist/cli/commands/quality/index.d.ts.map +0 -1
- package/dist/cli/commands/quality/index.js +0 -41
- package/dist/cli/commands/quality/index.js.map +0 -1
- package/dist/cli/commands/quality/policy.d.ts +0 -57
- package/dist/cli/commands/quality/policy.d.ts.map +0 -1
- package/dist/cli/commands/quality/policy.js +0 -359
- package/dist/cli/commands/quality/policy.js.map +0 -1
- package/dist/cli/commands/quality/risk.d.ts +0 -41
- package/dist/cli/commands/quality/risk.d.ts.map +0 -1
- package/dist/cli/commands/quality/risk.js +0 -255
- package/dist/cli/commands/quality/risk.js.map +0 -1
- package/dist/cli/commands/quality/trends.d.ts +0 -40
- package/dist/cli/commands/quality/trends.d.ts.map +0 -1
- package/dist/cli/commands/quality/trends.js +0 -122
- package/dist/cli/commands/quality/trends.js.map +0 -1
- package/dist/cli/commands/quality/validate.d.ts +0 -44
- package/dist/cli/commands/quality/validate.d.ts.map +0 -1
- package/dist/cli/commands/quality/validate.js +0 -234
- package/dist/cli/commands/quality/validate.js.map +0 -1
- package/dist/cli/commands/test/analyze-failures.d.ts +0 -39
- package/dist/cli/commands/test/analyze-failures.d.ts.map +0 -1
- package/dist/cli/commands/test/analyze-failures.js +0 -113
- package/dist/cli/commands/test/analyze-failures.js.map +0 -1
- package/dist/cli/commands/test/clean.d.ts +0 -3
- package/dist/cli/commands/test/clean.d.ts.map +0 -1
- package/dist/cli/commands/test/clean.js +0 -148
- package/dist/cli/commands/test/clean.js.map +0 -1
- package/dist/cli/commands/test/debug.d.ts +0 -3
- package/dist/cli/commands/test/debug.d.ts.map +0 -1
- package/dist/cli/commands/test/debug.js +0 -167
- package/dist/cli/commands/test/debug.js.map +0 -1
- package/dist/cli/commands/test/diff.d.ts +0 -3
- package/dist/cli/commands/test/diff.d.ts.map +0 -1
- package/dist/cli/commands/test/diff.js +0 -195
- package/dist/cli/commands/test/diff.js.map +0 -1
- package/dist/cli/commands/test/flakiness.d.ts +0 -32
- package/dist/cli/commands/test/flakiness.d.ts.map +0 -1
- package/dist/cli/commands/test/flakiness.js +0 -121
- package/dist/cli/commands/test/flakiness.js.map +0 -1
- package/dist/cli/commands/test/index.d.ts +0 -17
- package/dist/cli/commands/test/index.d.ts.map +0 -1
- package/dist/cli/commands/test/index.js +0 -45
- package/dist/cli/commands/test/index.js.map +0 -1
- package/dist/cli/commands/test/mutate.d.ts +0 -29
- package/dist/cli/commands/test/mutate.d.ts.map +0 -1
- package/dist/cli/commands/test/mutate.js +0 -163
- package/dist/cli/commands/test/mutate.js.map +0 -1
- package/dist/cli/commands/test/parallel.d.ts +0 -3
- package/dist/cli/commands/test/parallel.d.ts.map +0 -1
- package/dist/cli/commands/test/parallel.js +0 -117
- package/dist/cli/commands/test/parallel.js.map +0 -1
- package/dist/cli/commands/test/profile.d.ts +0 -3
- package/dist/cli/commands/test/profile.d.ts.map +0 -1
- package/dist/cli/commands/test/profile.js +0 -156
- package/dist/cli/commands/test/profile.js.map +0 -1
- package/dist/cli/commands/test/queue.d.ts +0 -3
- package/dist/cli/commands/test/queue.d.ts.map +0 -1
- package/dist/cli/commands/test/queue.js +0 -140
- package/dist/cli/commands/test/queue.js.map +0 -1
- package/dist/cli/commands/test/retry.d.ts +0 -3
- package/dist/cli/commands/test/retry.d.ts.map +0 -1
- package/dist/cli/commands/test/retry.js +0 -105
- package/dist/cli/commands/test/retry.js.map +0 -1
- package/dist/cli/commands/test/snapshot.d.ts +0 -3
- package/dist/cli/commands/test/snapshot.d.ts.map +0 -1
- package/dist/cli/commands/test/snapshot.js +0 -176
- package/dist/cli/commands/test/snapshot.js.map +0 -1
- package/dist/cli/commands/test/trace.d.ts +0 -3
- package/dist/cli/commands/test/trace.d.ts.map +0 -1
- package/dist/cli/commands/test/trace.js +0 -137
- package/dist/cli/commands/test/trace.js.map +0 -1
- package/dist/cli/commands/test/watch.d.ts +0 -3
- package/dist/cli/commands/test/watch.d.ts.map +0 -1
- package/dist/cli/commands/test/watch.js +0 -130
- package/dist/cli/commands/test/watch.js.map +0 -1
- package/dist/cli/index-spec.d.ts +0 -3
- package/dist/cli/index-spec.d.ts.map +0 -1
- package/dist/cli/index-spec.js +0 -154
- package/dist/cli/index-spec.js.map +0 -1
- package/dist/cli/index-working.d.ts +0 -7
- package/dist/cli/index-working.d.ts.map +0 -1
- package/dist/cli/index-working.js +0 -617
- package/dist/cli/index-working.js.map +0 -1
- package/dist/mcp/handlers/filtered/coverage-analyzer-filtered.d.ts +0 -83
- package/dist/mcp/handlers/filtered/coverage-analyzer-filtered.d.ts.map +0 -1
- package/dist/mcp/handlers/filtered/coverage-analyzer-filtered.js +0 -130
- package/dist/mcp/handlers/filtered/coverage-analyzer-filtered.js.map +0 -1
- package/dist/mcp/handlers/filtered/flaky-detector-filtered.d.ts +0 -58
- package/dist/mcp/handlers/filtered/flaky-detector-filtered.d.ts.map +0 -1
- package/dist/mcp/handlers/filtered/flaky-detector-filtered.js +0 -84
- package/dist/mcp/handlers/filtered/flaky-detector-filtered.js.map +0 -1
- package/dist/mcp/handlers/filtered/security-scanner-filtered.d.ts +0 -54
- package/dist/mcp/handlers/filtered/security-scanner-filtered.d.ts.map +0 -1
- package/dist/mcp/handlers/filtered/security-scanner-filtered.js +0 -73
- package/dist/mcp/handlers/filtered/security-scanner-filtered.js.map +0 -1
- package/dist/mcp/handlers/integration/contract-validate.d.ts +0 -10
- package/dist/mcp/handlers/integration/contract-validate.d.ts.map +0 -1
- package/dist/mcp/handlers/integration/contract-validate.js +0 -348
- package/dist/mcp/handlers/integration/contract-validate.js.map +0 -1
- package/dist/reporting/ResultAggregator.d.ts +0 -107
- package/dist/reporting/ResultAggregator.d.ts.map +0 -1
- package/dist/reporting/ResultAggregator.js +0 -435
- package/dist/reporting/ResultAggregator.js.map +0 -1
- package/dist/reporting/index.d.ts +0 -48
- package/dist/reporting/index.d.ts.map +0 -1
- package/dist/reporting/index.js +0 -154
- package/dist/reporting/index.js.map +0 -1
- package/dist/reporting/reporters/ControlLoopReporter.d.ts +0 -128
- package/dist/reporting/reporters/ControlLoopReporter.d.ts.map +0 -1
- package/dist/reporting/reporters/ControlLoopReporter.js +0 -417
- package/dist/reporting/reporters/ControlLoopReporter.js.map +0 -1
- package/dist/reporting/reporters/HumanReadableReporter.d.ts +0 -140
- package/dist/reporting/reporters/HumanReadableReporter.d.ts.map +0 -1
- package/dist/reporting/reporters/HumanReadableReporter.js +0 -524
- package/dist/reporting/reporters/HumanReadableReporter.js.map +0 -1
- package/dist/reporting/reporters/JSONReporter.d.ts +0 -251
- package/dist/reporting/reporters/JSONReporter.d.ts.map +0 -1
- package/dist/reporting/reporters/JSONReporter.js +0 -325
- package/dist/reporting/reporters/JSONReporter.js.map +0 -1
- package/dist/reporting/reporters/index.d.ts +0 -14
- package/dist/reporting/reporters/index.d.ts.map +0 -1
- package/dist/reporting/reporters/index.js +0 -19
- package/dist/reporting/reporters/index.js.map +0 -1
- package/dist/reporting/types.d.ts +0 -427
- package/dist/reporting/types.d.ts.map +0 -1
- package/dist/reporting/types.js +0 -12
- package/dist/reporting/types.js.map +0 -1
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* WASM Shims - Browser-Compatible Alternatives for Node.js APIs
|
|
4
|
+
*
|
|
5
|
+
* Provides browser-compatible implementations for Node.js built-in modules:
|
|
6
|
+
* - crypto -> Web Crypto API
|
|
7
|
+
* - events -> Custom EventEmitter
|
|
8
|
+
* - Buffer -> Uint8Array
|
|
9
|
+
*
|
|
10
|
+
* Phase 0: @ruvector/edge integration
|
|
11
|
+
* Target: Chrome 87+, Firefox 89+, Safari 15+
|
|
12
|
+
*
|
|
13
|
+
* @module edge/wasm/shims
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.wasmShims = exports.BrowserLogger = exports.LocalStorageMemoryStore = exports.IndexedDBMemoryStore = exports.BrowserEventEmitterImpl = exports.BrowserCrypto = void 0;
|
|
17
|
+
exports.hrtime = hrtime;
|
|
18
|
+
exports.elapsed = elapsed;
|
|
19
|
+
exports.createBrowserCrypto = createBrowserCrypto;
|
|
20
|
+
exports.createBrowserEventEmitter = createBrowserEventEmitter;
|
|
21
|
+
exports.createBrowserMemoryStore = createBrowserMemoryStore;
|
|
22
|
+
exports.createBrowserLogger = createBrowserLogger;
|
|
23
|
+
// ============================================
|
|
24
|
+
// Crypto Shim (Web Crypto API)
|
|
25
|
+
// ============================================
|
|
26
|
+
/**
|
|
27
|
+
* Browser-compatible crypto implementation using Web Crypto API
|
|
28
|
+
* Provides all SecureRandom functionality without Node.js crypto module
|
|
29
|
+
*/
|
|
30
|
+
class BrowserCrypto {
|
|
31
|
+
/**
|
|
32
|
+
* Generate cryptographically secure random bytes
|
|
33
|
+
* Uses crypto.getRandomValues() which is available in all modern browsers
|
|
34
|
+
*/
|
|
35
|
+
randomBytes(length) {
|
|
36
|
+
const bytes = new Uint8Array(length);
|
|
37
|
+
crypto.getRandomValues(bytes);
|
|
38
|
+
return bytes;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Generate RFC4122 v4 UUID
|
|
42
|
+
* Uses crypto.randomUUID() (Chrome 92+, Firefox 95+, Safari 15.4+)
|
|
43
|
+
* Falls back to manual generation for older browsers
|
|
44
|
+
*/
|
|
45
|
+
randomUUID() {
|
|
46
|
+
// Use native implementation if available
|
|
47
|
+
if (typeof crypto.randomUUID === 'function') {
|
|
48
|
+
return crypto.randomUUID();
|
|
49
|
+
}
|
|
50
|
+
// Fallback for older browsers
|
|
51
|
+
const bytes = this.randomBytes(16);
|
|
52
|
+
// Set version (4) and variant (RFC4122)
|
|
53
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
54
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
55
|
+
const hex = Array.from(bytes)
|
|
56
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
57
|
+
.join('');
|
|
58
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generate cryptographically secure random integer in range [min, max)
|
|
62
|
+
* Uses rejection sampling to avoid modulo bias
|
|
63
|
+
*/
|
|
64
|
+
randomInt(min, max) {
|
|
65
|
+
if (min >= max) {
|
|
66
|
+
throw new Error(`Invalid range: min (${min}) must be less than max (${max})`);
|
|
67
|
+
}
|
|
68
|
+
const range = max - min;
|
|
69
|
+
// Calculate the number of bits needed
|
|
70
|
+
const bitsNeeded = Math.ceil(Math.log2(range));
|
|
71
|
+
const bytesNeeded = Math.ceil(bitsNeeded / 8);
|
|
72
|
+
const maxValid = Math.pow(2, bitsNeeded);
|
|
73
|
+
// Rejection sampling to avoid modulo bias
|
|
74
|
+
let result;
|
|
75
|
+
do {
|
|
76
|
+
const bytes = this.randomBytes(bytesNeeded);
|
|
77
|
+
result = 0;
|
|
78
|
+
for (let i = 0; i < bytesNeeded; i++) {
|
|
79
|
+
result = (result << 8) | bytes[i];
|
|
80
|
+
}
|
|
81
|
+
// Mask to get only the bits we need
|
|
82
|
+
result = result & (maxValid - 1);
|
|
83
|
+
} while (result >= range);
|
|
84
|
+
return min + result;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Generate cryptographically secure random float in range [0, 1)
|
|
88
|
+
*/
|
|
89
|
+
randomFloat() {
|
|
90
|
+
// Use 53 bits for maximum precision (JavaScript number precision)
|
|
91
|
+
const bytes = this.randomBytes(7);
|
|
92
|
+
let value = 0;
|
|
93
|
+
for (let i = 0; i < 7; i++) {
|
|
94
|
+
value = value * 256 + bytes[i];
|
|
95
|
+
}
|
|
96
|
+
// Mask to 53 bits and divide by 2^53
|
|
97
|
+
return (value & 0x1fffffffffffff) / 0x20000000000000;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Hash data with SHA-256 using Web Crypto API
|
|
101
|
+
*/
|
|
102
|
+
async sha256(data) {
|
|
103
|
+
const encoder = new TextEncoder();
|
|
104
|
+
const dataBytes = typeof data === 'string' ? encoder.encode(data) : data;
|
|
105
|
+
// Create a new ArrayBuffer copy to satisfy BufferSource type constraints
|
|
106
|
+
const buffer = new ArrayBuffer(dataBytes.byteLength);
|
|
107
|
+
new Uint8Array(buffer).set(dataBytes);
|
|
108
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
|
|
109
|
+
return new Uint8Array(hashBuffer);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Generate hex-encoded random ID
|
|
113
|
+
*/
|
|
114
|
+
generateId(length = 16) {
|
|
115
|
+
const bytes = this.randomBytes(length);
|
|
116
|
+
return Array.from(bytes)
|
|
117
|
+
.map((b) => b.toString(16).padStart(2, '0'))
|
|
118
|
+
.join('');
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Generate random string with custom alphabet
|
|
122
|
+
*/
|
|
123
|
+
randomString(length, alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789') {
|
|
124
|
+
let result = '';
|
|
125
|
+
for (let i = 0; i < length; i++) {
|
|
126
|
+
result += alphabet[this.randomInt(0, alphabet.length)];
|
|
127
|
+
}
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Generate random boolean with optional bias
|
|
132
|
+
*/
|
|
133
|
+
randomBoolean(trueProbability = 0.5) {
|
|
134
|
+
if (trueProbability < 0 || trueProbability > 1) {
|
|
135
|
+
throw new Error('Probability must be between 0 and 1');
|
|
136
|
+
}
|
|
137
|
+
return this.randomFloat() < trueProbability;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Shuffle array using Fisher-Yates algorithm
|
|
141
|
+
*/
|
|
142
|
+
shuffle(array) {
|
|
143
|
+
const copy = [...array];
|
|
144
|
+
for (let i = copy.length - 1; i > 0; i--) {
|
|
145
|
+
const j = this.randomInt(0, i + 1);
|
|
146
|
+
[copy[i], copy[j]] = [copy[j], copy[i]];
|
|
147
|
+
}
|
|
148
|
+
return copy;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Select random element from array
|
|
152
|
+
*/
|
|
153
|
+
choice(array) {
|
|
154
|
+
if (array.length === 0) {
|
|
155
|
+
throw new Error('Cannot choose from empty array');
|
|
156
|
+
}
|
|
157
|
+
return array[this.randomInt(0, array.length)];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.BrowserCrypto = BrowserCrypto;
|
|
161
|
+
// ============================================
|
|
162
|
+
// EventEmitter Shim
|
|
163
|
+
// ============================================
|
|
164
|
+
/**
|
|
165
|
+
* Browser-compatible EventEmitter implementation
|
|
166
|
+
* Replaces Node.js events module
|
|
167
|
+
*/
|
|
168
|
+
class BrowserEventEmitterImpl {
|
|
169
|
+
constructor() {
|
|
170
|
+
this.handlers = new Map();
|
|
171
|
+
this.onceHandlers = new Map();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Register event handler
|
|
175
|
+
*/
|
|
176
|
+
on(event, handler) {
|
|
177
|
+
if (!this.handlers.has(event)) {
|
|
178
|
+
this.handlers.set(event, new Set());
|
|
179
|
+
}
|
|
180
|
+
this.handlers.get(event).add(handler);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Unregister event handler
|
|
184
|
+
*/
|
|
185
|
+
off(event, handler) {
|
|
186
|
+
this.handlers.get(event)?.delete(handler);
|
|
187
|
+
this.onceHandlers.get(event)?.delete(handler);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Register one-time event handler
|
|
191
|
+
*/
|
|
192
|
+
once(event, handler) {
|
|
193
|
+
if (!this.onceHandlers.has(event)) {
|
|
194
|
+
this.onceHandlers.set(event, new Set());
|
|
195
|
+
}
|
|
196
|
+
this.onceHandlers.get(event).add(handler);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Emit event to all handlers
|
|
200
|
+
*/
|
|
201
|
+
emit(event, data) {
|
|
202
|
+
// Execute regular handlers
|
|
203
|
+
const handlers = this.handlers.get(event);
|
|
204
|
+
if (handlers) {
|
|
205
|
+
handlers.forEach((handler) => {
|
|
206
|
+
try {
|
|
207
|
+
const result = handler(data);
|
|
208
|
+
// Handle async handlers
|
|
209
|
+
if (result instanceof Promise) {
|
|
210
|
+
result.catch((err) => console.error(`Event handler error for ${event}:`, err));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
catch (err) {
|
|
214
|
+
console.error(`Event handler error for ${event}:`, err);
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
// Execute and remove once handlers
|
|
219
|
+
const onceHandlers = this.onceHandlers.get(event);
|
|
220
|
+
if (onceHandlers) {
|
|
221
|
+
onceHandlers.forEach((handler) => {
|
|
222
|
+
try {
|
|
223
|
+
const result = handler(data);
|
|
224
|
+
if (result instanceof Promise) {
|
|
225
|
+
result.catch((err) => console.error(`Once handler error for ${event}:`, err));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
console.error(`Once handler error for ${event}:`, err);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
this.onceHandlers.delete(event);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Remove all listeners for an event (or all events)
|
|
237
|
+
*/
|
|
238
|
+
removeAllListeners(event) {
|
|
239
|
+
if (event) {
|
|
240
|
+
this.handlers.delete(event);
|
|
241
|
+
this.onceHandlers.delete(event);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
this.handlers.clear();
|
|
245
|
+
this.onceHandlers.clear();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Get listener count for an event
|
|
250
|
+
*/
|
|
251
|
+
listenerCount(event) {
|
|
252
|
+
return (this.handlers.get(event)?.size ?? 0) + (this.onceHandlers.get(event)?.size ?? 0);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Get all registered event names
|
|
256
|
+
*/
|
|
257
|
+
eventNames() {
|
|
258
|
+
const names = new Set();
|
|
259
|
+
this.handlers.forEach((_, key) => names.add(key));
|
|
260
|
+
this.onceHandlers.forEach((_, key) => names.add(key));
|
|
261
|
+
return Array.from(names);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.BrowserEventEmitterImpl = BrowserEventEmitterImpl;
|
|
265
|
+
// ============================================
|
|
266
|
+
// Memory Store Shim (IndexedDB)
|
|
267
|
+
// ============================================
|
|
268
|
+
const DEFAULT_DB_NAME = 'agentic-qe-browser';
|
|
269
|
+
const DEFAULT_STORE_NAME = 'memory';
|
|
270
|
+
/**
|
|
271
|
+
* IndexedDB-backed memory store for browser agents
|
|
272
|
+
* Provides persistent storage with TTL support
|
|
273
|
+
*/
|
|
274
|
+
class IndexedDBMemoryStore {
|
|
275
|
+
constructor(dbName = DEFAULT_DB_NAME, storeName = DEFAULT_STORE_NAME) {
|
|
276
|
+
this.db = null;
|
|
277
|
+
this.initPromise = null;
|
|
278
|
+
this.dbName = dbName;
|
|
279
|
+
this.storeName = storeName;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Initialize IndexedDB connection
|
|
283
|
+
*/
|
|
284
|
+
async ensureDB() {
|
|
285
|
+
if (this.db) {
|
|
286
|
+
return this.db;
|
|
287
|
+
}
|
|
288
|
+
if (this.initPromise) {
|
|
289
|
+
await this.initPromise;
|
|
290
|
+
return this.db;
|
|
291
|
+
}
|
|
292
|
+
this.initPromise = new Promise((resolve, reject) => {
|
|
293
|
+
const request = indexedDB.open(this.dbName, 1);
|
|
294
|
+
request.onerror = () => {
|
|
295
|
+
reject(new Error(`Failed to open IndexedDB: ${request.error?.message}`));
|
|
296
|
+
};
|
|
297
|
+
request.onsuccess = () => {
|
|
298
|
+
this.db = request.result;
|
|
299
|
+
resolve();
|
|
300
|
+
};
|
|
301
|
+
request.onupgradeneeded = (event) => {
|
|
302
|
+
const db = event.target.result;
|
|
303
|
+
// Create object store if it doesn't exist
|
|
304
|
+
if (!db.objectStoreNames.contains(this.storeName)) {
|
|
305
|
+
const store = db.createObjectStore(this.storeName, { keyPath: 'key' });
|
|
306
|
+
store.createIndex('namespace', 'namespace', { unique: false });
|
|
307
|
+
store.createIndex('expiresAt', 'expiresAt', { unique: false });
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
});
|
|
311
|
+
await this.initPromise;
|
|
312
|
+
return this.db;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Store a value with optional TTL
|
|
316
|
+
*/
|
|
317
|
+
async store(key, value, ttl) {
|
|
318
|
+
await this.set(key, value, 'default');
|
|
319
|
+
if (ttl) {
|
|
320
|
+
// TTL is stored in the record
|
|
321
|
+
const db = await this.ensureDB();
|
|
322
|
+
const transaction = db.transaction(this.storeName, 'readwrite');
|
|
323
|
+
const store = transaction.objectStore(this.storeName);
|
|
324
|
+
const record = {
|
|
325
|
+
key: `default:${key}`,
|
|
326
|
+
value,
|
|
327
|
+
namespace: 'default',
|
|
328
|
+
timestamp: Date.now(),
|
|
329
|
+
ttl,
|
|
330
|
+
expiresAt: Date.now() + ttl,
|
|
331
|
+
};
|
|
332
|
+
await new Promise((resolve, reject) => {
|
|
333
|
+
const request = store.put(record);
|
|
334
|
+
request.onsuccess = () => resolve();
|
|
335
|
+
request.onerror = () => reject(request.error);
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Retrieve a value by key
|
|
341
|
+
*/
|
|
342
|
+
async retrieve(key) {
|
|
343
|
+
return this.get(key, 'default');
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Set with namespace support
|
|
347
|
+
*/
|
|
348
|
+
async set(key, value, namespace = 'default') {
|
|
349
|
+
const db = await this.ensureDB();
|
|
350
|
+
const transaction = db.transaction(this.storeName, 'readwrite');
|
|
351
|
+
const store = transaction.objectStore(this.storeName);
|
|
352
|
+
const record = {
|
|
353
|
+
key: `${namespace}:${key}`,
|
|
354
|
+
value,
|
|
355
|
+
namespace,
|
|
356
|
+
timestamp: Date.now(),
|
|
357
|
+
};
|
|
358
|
+
await new Promise((resolve, reject) => {
|
|
359
|
+
const request = store.put(record);
|
|
360
|
+
request.onsuccess = () => resolve();
|
|
361
|
+
request.onerror = () => reject(request.error);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Get with namespace support
|
|
366
|
+
*/
|
|
367
|
+
async get(key, namespace = 'default') {
|
|
368
|
+
const db = await this.ensureDB();
|
|
369
|
+
const transaction = db.transaction(this.storeName, 'readonly');
|
|
370
|
+
const store = transaction.objectStore(this.storeName);
|
|
371
|
+
return new Promise((resolve, reject) => {
|
|
372
|
+
const request = store.get(`${namespace}:${key}`);
|
|
373
|
+
request.onsuccess = () => {
|
|
374
|
+
const record = request.result;
|
|
375
|
+
if (!record) {
|
|
376
|
+
resolve(undefined);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
// Check TTL expiration
|
|
380
|
+
if (record.expiresAt && record.expiresAt < Date.now()) {
|
|
381
|
+
// Expired - delete and return undefined
|
|
382
|
+
this.delete(key, namespace).catch(console.error);
|
|
383
|
+
resolve(undefined);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
resolve(record.value);
|
|
387
|
+
};
|
|
388
|
+
request.onerror = () => reject(request.error);
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Delete a key
|
|
393
|
+
*/
|
|
394
|
+
async delete(key, namespace = 'default') {
|
|
395
|
+
const db = await this.ensureDB();
|
|
396
|
+
const transaction = db.transaction(this.storeName, 'readwrite');
|
|
397
|
+
const store = transaction.objectStore(this.storeName);
|
|
398
|
+
return new Promise((resolve, reject) => {
|
|
399
|
+
const request = store.delete(`${namespace}:${key}`);
|
|
400
|
+
request.onsuccess = () => resolve(true);
|
|
401
|
+
request.onerror = () => reject(request.error);
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Clear all data in namespace (or all data if no namespace)
|
|
406
|
+
*/
|
|
407
|
+
async clear(namespace) {
|
|
408
|
+
const db = await this.ensureDB();
|
|
409
|
+
const transaction = db.transaction(this.storeName, 'readwrite');
|
|
410
|
+
const store = transaction.objectStore(this.storeName);
|
|
411
|
+
if (!namespace) {
|
|
412
|
+
// Clear all
|
|
413
|
+
await new Promise((resolve, reject) => {
|
|
414
|
+
const request = store.clear();
|
|
415
|
+
request.onsuccess = () => resolve();
|
|
416
|
+
request.onerror = () => reject(request.error);
|
|
417
|
+
});
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
// Clear by namespace using index
|
|
421
|
+
const index = store.index('namespace');
|
|
422
|
+
const cursorRequest = index.openCursor(IDBKeyRange.only(namespace));
|
|
423
|
+
await new Promise((resolve, reject) => {
|
|
424
|
+
cursorRequest.onsuccess = (event) => {
|
|
425
|
+
const cursor = event.target.result;
|
|
426
|
+
if (cursor) {
|
|
427
|
+
cursor.delete();
|
|
428
|
+
cursor.continue();
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
resolve();
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
cursorRequest.onerror = () => reject(cursorRequest.error);
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Close database connection
|
|
439
|
+
*/
|
|
440
|
+
close() {
|
|
441
|
+
if (this.db) {
|
|
442
|
+
this.db.close();
|
|
443
|
+
this.db = null;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Cleanup expired entries
|
|
448
|
+
*/
|
|
449
|
+
async cleanupExpired() {
|
|
450
|
+
const db = await this.ensureDB();
|
|
451
|
+
const transaction = db.transaction(this.storeName, 'readwrite');
|
|
452
|
+
const store = transaction.objectStore(this.storeName);
|
|
453
|
+
const index = store.index('expiresAt');
|
|
454
|
+
const now = Date.now();
|
|
455
|
+
let deletedCount = 0;
|
|
456
|
+
return new Promise((resolve, reject) => {
|
|
457
|
+
const cursorRequest = index.openCursor(IDBKeyRange.upperBound(now));
|
|
458
|
+
cursorRequest.onsuccess = (event) => {
|
|
459
|
+
const cursor = event.target.result;
|
|
460
|
+
if (cursor) {
|
|
461
|
+
cursor.delete();
|
|
462
|
+
deletedCount++;
|
|
463
|
+
cursor.continue();
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
resolve(deletedCount);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
cursorRequest.onerror = () => reject(cursorRequest.error);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
exports.IndexedDBMemoryStore = IndexedDBMemoryStore;
|
|
474
|
+
// ============================================
|
|
475
|
+
// LocalStorage Fallback Memory Store
|
|
476
|
+
// ============================================
|
|
477
|
+
/**
|
|
478
|
+
* LocalStorage-backed memory store for browsers without IndexedDB
|
|
479
|
+
* Simpler but with 5MB limit
|
|
480
|
+
*/
|
|
481
|
+
class LocalStorageMemoryStore {
|
|
482
|
+
constructor(prefix = 'aqe:') {
|
|
483
|
+
this.prefix = prefix;
|
|
484
|
+
}
|
|
485
|
+
getKey(key, namespace = 'default') {
|
|
486
|
+
return `${this.prefix}${namespace}:${key}`;
|
|
487
|
+
}
|
|
488
|
+
async store(key, value, ttl) {
|
|
489
|
+
const record = {
|
|
490
|
+
value,
|
|
491
|
+
timestamp: Date.now(),
|
|
492
|
+
expiresAt: ttl ? Date.now() + ttl : undefined,
|
|
493
|
+
};
|
|
494
|
+
localStorage.setItem(this.getKey(key), JSON.stringify(record));
|
|
495
|
+
}
|
|
496
|
+
async retrieve(key) {
|
|
497
|
+
return this.get(key);
|
|
498
|
+
}
|
|
499
|
+
async set(key, value, namespace) {
|
|
500
|
+
const record = {
|
|
501
|
+
value,
|
|
502
|
+
timestamp: Date.now(),
|
|
503
|
+
};
|
|
504
|
+
localStorage.setItem(this.getKey(key, namespace), JSON.stringify(record));
|
|
505
|
+
}
|
|
506
|
+
async get(key, namespace) {
|
|
507
|
+
const data = localStorage.getItem(this.getKey(key, namespace));
|
|
508
|
+
if (!data)
|
|
509
|
+
return undefined;
|
|
510
|
+
try {
|
|
511
|
+
const record = JSON.parse(data);
|
|
512
|
+
// Check TTL
|
|
513
|
+
if (record.expiresAt && record.expiresAt < Date.now()) {
|
|
514
|
+
localStorage.removeItem(this.getKey(key, namespace));
|
|
515
|
+
return undefined;
|
|
516
|
+
}
|
|
517
|
+
return record.value;
|
|
518
|
+
}
|
|
519
|
+
catch {
|
|
520
|
+
return undefined;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
async delete(key, namespace) {
|
|
524
|
+
localStorage.removeItem(this.getKey(key, namespace));
|
|
525
|
+
return true;
|
|
526
|
+
}
|
|
527
|
+
async clear(namespace) {
|
|
528
|
+
const prefix = namespace ? `${this.prefix}${namespace}:` : this.prefix;
|
|
529
|
+
const keysToRemove = [];
|
|
530
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
531
|
+
const key = localStorage.key(i);
|
|
532
|
+
if (key?.startsWith(prefix)) {
|
|
533
|
+
keysToRemove.push(key);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
keysToRemove.forEach((key) => localStorage.removeItem(key));
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
exports.LocalStorageMemoryStore = LocalStorageMemoryStore;
|
|
540
|
+
// ============================================
|
|
541
|
+
// Logger Shim
|
|
542
|
+
// ============================================
|
|
543
|
+
/**
|
|
544
|
+
* Browser-compatible logger implementation
|
|
545
|
+
* Replaces Node.js Logger utility
|
|
546
|
+
*/
|
|
547
|
+
class BrowserLogger {
|
|
548
|
+
constructor(prefix = '[AQE]') {
|
|
549
|
+
this.level = 'info';
|
|
550
|
+
this.prefix = prefix;
|
|
551
|
+
}
|
|
552
|
+
static getInstance(prefix) {
|
|
553
|
+
if (!BrowserLogger.instance) {
|
|
554
|
+
BrowserLogger.instance = new BrowserLogger(prefix);
|
|
555
|
+
}
|
|
556
|
+
return BrowserLogger.instance;
|
|
557
|
+
}
|
|
558
|
+
setLevel(level) {
|
|
559
|
+
this.level = level;
|
|
560
|
+
}
|
|
561
|
+
debug(message, ...args) {
|
|
562
|
+
if (this.level === 'debug') {
|
|
563
|
+
console.debug(`${this.prefix} ${message}`, ...args);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
info(message, ...args) {
|
|
567
|
+
if (['debug', 'info'].includes(this.level)) {
|
|
568
|
+
console.info(`${this.prefix} ${message}`, ...args);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
warn(message, ...args) {
|
|
572
|
+
if (['debug', 'info', 'warn'].includes(this.level)) {
|
|
573
|
+
console.warn(`${this.prefix} ${message}`, ...args);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
error(message, ...args) {
|
|
577
|
+
console.error(`${this.prefix} ${message}`, ...args);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
exports.BrowserLogger = BrowserLogger;
|
|
581
|
+
// ============================================
|
|
582
|
+
// Timing Utilities
|
|
583
|
+
// ============================================
|
|
584
|
+
/**
|
|
585
|
+
* High-resolution timing for performance measurement
|
|
586
|
+
* Uses Performance API instead of process.hrtime
|
|
587
|
+
*/
|
|
588
|
+
function hrtime() {
|
|
589
|
+
return performance.now();
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Calculate elapsed time in milliseconds
|
|
593
|
+
*/
|
|
594
|
+
function elapsed(start) {
|
|
595
|
+
return performance.now() - start;
|
|
596
|
+
}
|
|
597
|
+
// ============================================
|
|
598
|
+
// Export Factory Functions
|
|
599
|
+
// ============================================
|
|
600
|
+
/**
|
|
601
|
+
* Create browser crypto instance
|
|
602
|
+
*/
|
|
603
|
+
function createBrowserCrypto() {
|
|
604
|
+
return new BrowserCrypto();
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Create browser event emitter
|
|
608
|
+
*/
|
|
609
|
+
function createBrowserEventEmitter() {
|
|
610
|
+
return new BrowserEventEmitterImpl();
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Create browser memory store (auto-detect best option)
|
|
614
|
+
*/
|
|
615
|
+
function createBrowserMemoryStore(options) {
|
|
616
|
+
// Prefer IndexedDB if available
|
|
617
|
+
if (typeof indexedDB !== 'undefined') {
|
|
618
|
+
return new IndexedDBMemoryStore(options?.dbName);
|
|
619
|
+
}
|
|
620
|
+
// Fallback to localStorage
|
|
621
|
+
if (typeof localStorage !== 'undefined') {
|
|
622
|
+
return new LocalStorageMemoryStore(options?.prefix);
|
|
623
|
+
}
|
|
624
|
+
// In-memory fallback for environments without storage
|
|
625
|
+
const memoryMap = new Map();
|
|
626
|
+
return {
|
|
627
|
+
store: async (key, value) => {
|
|
628
|
+
memoryMap.set(key, value);
|
|
629
|
+
},
|
|
630
|
+
retrieve: async (key) => memoryMap.get(key),
|
|
631
|
+
set: async (key, value, namespace = 'default') => {
|
|
632
|
+
memoryMap.set(`${namespace}:${key}`, value);
|
|
633
|
+
},
|
|
634
|
+
get: async (key, namespace = 'default') => memoryMap.get(`${namespace}:${key}`),
|
|
635
|
+
delete: async (key, namespace = 'default') => memoryMap.delete(`${namespace}:${key}`),
|
|
636
|
+
clear: async () => {
|
|
637
|
+
memoryMap.clear();
|
|
638
|
+
},
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Create browser logger
|
|
643
|
+
*/
|
|
644
|
+
function createBrowserLogger(prefix) {
|
|
645
|
+
return BrowserLogger.getInstance(prefix);
|
|
646
|
+
}
|
|
647
|
+
// ============================================
|
|
648
|
+
// Unified WASM Shims Export
|
|
649
|
+
// ============================================
|
|
650
|
+
/**
|
|
651
|
+
* Collection of all WASM shims for browser compatibility
|
|
652
|
+
*/
|
|
653
|
+
exports.wasmShims = {
|
|
654
|
+
crypto: createBrowserCrypto(),
|
|
655
|
+
createCrypto: createBrowserCrypto,
|
|
656
|
+
createEventEmitter: createBrowserEventEmitter,
|
|
657
|
+
createMemoryStore: createBrowserMemoryStore,
|
|
658
|
+
createLogger: createBrowserLogger,
|
|
659
|
+
hrtime,
|
|
660
|
+
elapsed,
|
|
661
|
+
BrowserCrypto,
|
|
662
|
+
BrowserEventEmitterImpl,
|
|
663
|
+
IndexedDBMemoryStore,
|
|
664
|
+
LocalStorageMemoryStore,
|
|
665
|
+
BrowserLogger,
|
|
666
|
+
};
|
|
667
|
+
//# sourceMappingURL=shims.js.map
|