agentic-qe 3.3.4 → 3.4.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/.claude/agents/v3/qe-queen-coordinator.md +332 -166
- package/.claude/helpers/statusline-v3.cjs +85 -42
- package/.claude/skills/qcsd-ideation-swarm/SKILL.md +7 -4
- package/README.md +71 -2
- package/package.json +1 -1
- package/scripts/cloud-db-config.json +10 -5
- package/scripts/merge-v3-to-root.sql +48 -0
- package/v3/CHANGELOG.md +156 -0
- package/v3/README.md +118 -1
- package/v3/assets/agents/v3/qe-queen-coordinator.md +332 -166
- package/v3/assets/skills/qcsd-ideation-swarm/SKILL.md +7 -4
- package/v3/dist/adapters/a2a/agent-cards/generator.d.ts +153 -0
- package/v3/dist/adapters/a2a/agent-cards/generator.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/agent-cards/generator.js +478 -0
- package/v3/dist/adapters/a2a/agent-cards/generator.js.map +1 -0
- package/v3/dist/adapters/a2a/agent-cards/schema.d.ts +274 -0
- package/v3/dist/adapters/a2a/agent-cards/schema.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/agent-cards/schema.js +135 -0
- package/v3/dist/adapters/a2a/agent-cards/schema.js.map +1 -0
- package/v3/dist/adapters/a2a/agent-cards/validator.d.ts +514 -0
- package/v3/dist/adapters/a2a/agent-cards/validator.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/agent-cards/validator.js +555 -0
- package/v3/dist/adapters/a2a/agent-cards/validator.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/index.d.ts +23 -0
- package/v3/dist/adapters/a2a/auth/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/index.js +85 -0
- package/v3/dist/adapters/a2a/auth/index.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/jwt-utils.d.ts +215 -0
- package/v3/dist/adapters/a2a/auth/jwt-utils.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/jwt-utils.js +314 -0
- package/v3/dist/adapters/a2a/auth/jwt-utils.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/middleware.d.ts +173 -0
- package/v3/dist/adapters/a2a/auth/middleware.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/middleware.js +300 -0
- package/v3/dist/adapters/a2a/auth/middleware.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/oauth-provider.d.ts +308 -0
- package/v3/dist/adapters/a2a/auth/oauth-provider.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/oauth-provider.js +573 -0
- package/v3/dist/adapters/a2a/auth/oauth-provider.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/routes.d.ts +244 -0
- package/v3/dist/adapters/a2a/auth/routes.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/routes.js +496 -0
- package/v3/dist/adapters/a2a/auth/routes.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/scopes.d.ts +219 -0
- package/v3/dist/adapters/a2a/auth/scopes.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/scopes.js +292 -0
- package/v3/dist/adapters/a2a/auth/scopes.js.map +1 -0
- package/v3/dist/adapters/a2a/auth/token-store.d.ts +278 -0
- package/v3/dist/adapters/a2a/auth/token-store.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/auth/token-store.js +453 -0
- package/v3/dist/adapters/a2a/auth/token-store.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/agent-health.d.ts +226 -0
- package/v3/dist/adapters/a2a/discovery/agent-health.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/agent-health.js +426 -0
- package/v3/dist/adapters/a2a/discovery/agent-health.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/discovery-service.d.ts +296 -0
- package/v3/dist/adapters/a2a/discovery/discovery-service.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/discovery-service.js +520 -0
- package/v3/dist/adapters/a2a/discovery/discovery-service.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/file-watcher.d.ts +166 -0
- package/v3/dist/adapters/a2a/discovery/file-watcher.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/file-watcher.js +385 -0
- package/v3/dist/adapters/a2a/discovery/file-watcher.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.d.ts +226 -0
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.js +433 -0
- package/v3/dist/adapters/a2a/discovery/hot-reload-service.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/index.d.ts +18 -0
- package/v3/dist/adapters/a2a/discovery/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/index.js +54 -0
- package/v3/dist/adapters/a2a/discovery/index.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/metrics.d.ts +200 -0
- package/v3/dist/adapters/a2a/discovery/metrics.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/metrics.js +371 -0
- package/v3/dist/adapters/a2a/discovery/metrics.js.map +1 -0
- package/v3/dist/adapters/a2a/discovery/routes.d.ts +184 -0
- package/v3/dist/adapters/a2a/discovery/routes.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/discovery/routes.js +453 -0
- package/v3/dist/adapters/a2a/discovery/routes.js.map +1 -0
- package/v3/dist/adapters/a2a/index.d.ts +18 -0
- package/v3/dist/adapters/a2a/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/index.js +139 -0
- package/v3/dist/adapters/a2a/index.js.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/envelope.d.ts +312 -0
- package/v3/dist/adapters/a2a/jsonrpc/envelope.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/envelope.js +554 -0
- package/v3/dist/adapters/a2a/jsonrpc/envelope.js.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/errors.d.ts +244 -0
- package/v3/dist/adapters/a2a/jsonrpc/errors.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/errors.js +365 -0
- package/v3/dist/adapters/a2a/jsonrpc/errors.js.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/index.d.ts +14 -0
- package/v3/dist/adapters/a2a/jsonrpc/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/index.js +59 -0
- package/v3/dist/adapters/a2a/jsonrpc/index.js.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/methods.d.ts +400 -0
- package/v3/dist/adapters/a2a/jsonrpc/methods.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/jsonrpc/methods.js +249 -0
- package/v3/dist/adapters/a2a/jsonrpc/methods.js.map +1 -0
- package/v3/dist/adapters/a2a/notifications/index.d.ts +60 -0
- package/v3/dist/adapters/a2a/notifications/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/notifications/index.js +99 -0
- package/v3/dist/adapters/a2a/notifications/index.js.map +1 -0
- package/v3/dist/adapters/a2a/notifications/retry-queue.d.ts +225 -0
- package/v3/dist/adapters/a2a/notifications/retry-queue.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/notifications/retry-queue.js +449 -0
- package/v3/dist/adapters/a2a/notifications/retry-queue.js.map +1 -0
- package/v3/dist/adapters/a2a/notifications/signature.d.ts +133 -0
- package/v3/dist/adapters/a2a/notifications/signature.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/notifications/signature.js +244 -0
- package/v3/dist/adapters/a2a/notifications/signature.js.map +1 -0
- package/v3/dist/adapters/a2a/notifications/subscription-store.d.ts +243 -0
- package/v3/dist/adapters/a2a/notifications/subscription-store.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/notifications/subscription-store.js +486 -0
- package/v3/dist/adapters/a2a/notifications/subscription-store.js.map +1 -0
- package/v3/dist/adapters/a2a/notifications/webhook-service.d.ts +257 -0
- package/v3/dist/adapters/a2a/notifications/webhook-service.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/notifications/webhook-service.js +542 -0
- package/v3/dist/adapters/a2a/notifications/webhook-service.js.map +1 -0
- package/v3/dist/adapters/a2a/tasks/index.d.ts +16 -0
- package/v3/dist/adapters/a2a/tasks/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/tasks/index.js +33 -0
- package/v3/dist/adapters/a2a/tasks/index.js.map +1 -0
- package/v3/dist/adapters/a2a/tasks/task-manager.d.ts +306 -0
- package/v3/dist/adapters/a2a/tasks/task-manager.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/tasks/task-manager.js +562 -0
- package/v3/dist/adapters/a2a/tasks/task-manager.js.map +1 -0
- package/v3/dist/adapters/a2a/tasks/task-router.d.ts +270 -0
- package/v3/dist/adapters/a2a/tasks/task-router.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/tasks/task-router.js +574 -0
- package/v3/dist/adapters/a2a/tasks/task-router.js.map +1 -0
- package/v3/dist/adapters/a2a/tasks/task-store.d.ts +251 -0
- package/v3/dist/adapters/a2a/tasks/task-store.d.ts.map +1 -0
- package/v3/dist/adapters/a2a/tasks/task-store.js +468 -0
- package/v3/dist/adapters/a2a/tasks/task-store.js.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/aria-attributes.d.ts +294 -0
- package/v3/dist/adapters/a2ui/accessibility/aria-attributes.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/aria-attributes.js +447 -0
- package/v3/dist/adapters/a2ui/accessibility/aria-attributes.js.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/index.d.ts +83 -0
- package/v3/dist/adapters/a2ui/accessibility/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/index.js +155 -0
- package/v3/dist/adapters/a2ui/accessibility/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.d.ts +177 -0
- package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.js +638 -0
- package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.js.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/wcag-validator.d.ts +186 -0
- package/v3/dist/adapters/a2ui/accessibility/wcag-validator.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/accessibility/wcag-validator.js +816 -0
- package/v3/dist/adapters/a2ui/accessibility/wcag-validator.js.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/component-schemas.d.ts +227 -0
- package/v3/dist/adapters/a2ui/catalog/component-schemas.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/component-schemas.js +1090 -0
- package/v3/dist/adapters/a2ui/catalog/component-schemas.js.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/index.d.ts +55 -0
- package/v3/dist/adapters/a2ui/catalog/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/index.js +100 -0
- package/v3/dist/adapters/a2ui/catalog/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/qe-catalog.d.ts +456 -0
- package/v3/dist/adapters/a2ui/catalog/qe-catalog.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/qe-catalog.js +413 -0
- package/v3/dist/adapters/a2ui/catalog/qe-catalog.js.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/standard-catalog.d.ts +581 -0
- package/v3/dist/adapters/a2ui/catalog/standard-catalog.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/catalog/standard-catalog.js +409 -0
- package/v3/dist/adapters/a2ui/catalog/standard-catalog.js.map +1 -0
- package/v3/dist/adapters/a2ui/data/bound-value.d.ts +252 -0
- package/v3/dist/adapters/a2ui/data/bound-value.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/data/bound-value.js +403 -0
- package/v3/dist/adapters/a2ui/data/bound-value.js.map +1 -0
- package/v3/dist/adapters/a2ui/data/index.d.ts +14 -0
- package/v3/dist/adapters/a2ui/data/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/data/index.js +41 -0
- package/v3/dist/adapters/a2ui/data/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/data/json-pointer-resolver.d.ts +187 -0
- package/v3/dist/adapters/a2ui/data/json-pointer-resolver.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/data/json-pointer-resolver.js +425 -0
- package/v3/dist/adapters/a2ui/data/json-pointer-resolver.js.map +1 -0
- package/v3/dist/adapters/a2ui/data/reactive-store.d.ts +241 -0
- package/v3/dist/adapters/a2ui/data/reactive-store.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/data/reactive-store.js +461 -0
- package/v3/dist/adapters/a2ui/data/reactive-store.js.map +1 -0
- package/v3/dist/adapters/a2ui/index.d.ts +17 -0
- package/v3/dist/adapters/a2ui/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/index.js +119 -0
- package/v3/dist/adapters/a2ui/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/integration/agui-sync.d.ts +259 -0
- package/v3/dist/adapters/a2ui/integration/agui-sync.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/integration/agui-sync.js +559 -0
- package/v3/dist/adapters/a2ui/integration/agui-sync.js.map +1 -0
- package/v3/dist/adapters/a2ui/integration/index.d.ts +11 -0
- package/v3/dist/adapters/a2ui/integration/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/integration/index.js +23 -0
- package/v3/dist/adapters/a2ui/integration/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/integration/surface-state-bridge.d.ts +209 -0
- package/v3/dist/adapters/a2ui/integration/surface-state-bridge.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/integration/surface-state-bridge.js +545 -0
- package/v3/dist/adapters/a2ui/integration/surface-state-bridge.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/component-builder.d.ts +227 -0
- package/v3/dist/adapters/a2ui/renderer/component-builder.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/component-builder.js +488 -0
- package/v3/dist/adapters/a2ui/renderer/component-builder.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/index.d.ts +16 -0
- package/v3/dist/adapters/a2ui/renderer/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/index.js +50 -0
- package/v3/dist/adapters/a2ui/renderer/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/message-types.d.ts +299 -0
- package/v3/dist/adapters/a2ui/renderer/message-types.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/message-types.js +187 -0
- package/v3/dist/adapters/a2ui/renderer/message-types.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/surface-generator.d.ts +210 -0
- package/v3/dist/adapters/a2ui/renderer/surface-generator.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/surface-generator.js +586 -0
- package/v3/dist/adapters/a2ui/renderer/surface-generator.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.d.ts +149 -0
- package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.js +414 -0
- package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.d.ts +95 -0
- package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.js +231 -0
- package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/index.d.ts +12 -0
- package/v3/dist/adapters/a2ui/renderer/templates/index.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/index.js +16 -0
- package/v3/dist/adapters/a2ui/renderer/templates/index.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/security-surface.d.ts +121 -0
- package/v3/dist/adapters/a2ui/renderer/templates/security-surface.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/security-surface.js +367 -0
- package/v3/dist/adapters/a2ui/renderer/templates/security-surface.js.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.d.ts +104 -0
- package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.d.ts.map +1 -0
- package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.js +294 -0
- package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.js.map +1 -0
- package/v3/dist/adapters/ag-ui/backpressure-handler.d.ts +201 -0
- package/v3/dist/adapters/ag-ui/backpressure-handler.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/backpressure-handler.js +399 -0
- package/v3/dist/adapters/ag-ui/backpressure-handler.js.map +1 -0
- package/v3/dist/adapters/ag-ui/event-adapter.d.ts +360 -0
- package/v3/dist/adapters/ag-ui/event-adapter.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/event-adapter.js +1083 -0
- package/v3/dist/adapters/ag-ui/event-adapter.js.map +1 -0
- package/v3/dist/adapters/ag-ui/event-batcher.d.ts +242 -0
- package/v3/dist/adapters/ag-ui/event-batcher.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/event-batcher.js +444 -0
- package/v3/dist/adapters/ag-ui/event-batcher.js.map +1 -0
- package/v3/dist/adapters/ag-ui/event-types.d.ts +450 -0
- package/v3/dist/adapters/ag-ui/event-types.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/event-types.js +173 -0
- package/v3/dist/adapters/ag-ui/event-types.js.map +1 -0
- package/v3/dist/adapters/ag-ui/index.d.ts +17 -0
- package/v3/dist/adapters/ag-ui/index.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/index.js +47 -0
- package/v3/dist/adapters/ag-ui/index.js.map +1 -0
- package/v3/dist/adapters/ag-ui/json-patch-utils.d.ts +136 -0
- package/v3/dist/adapters/ag-ui/json-patch-utils.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/json-patch-utils.js +574 -0
- package/v3/dist/adapters/ag-ui/json-patch-utils.js.map +1 -0
- package/v3/dist/adapters/ag-ui/json-patch.d.ts +241 -0
- package/v3/dist/adapters/ag-ui/json-patch.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/json-patch.js +726 -0
- package/v3/dist/adapters/ag-ui/json-patch.js.map +1 -0
- package/v3/dist/adapters/ag-ui/state-delta-cache.d.ts +218 -0
- package/v3/dist/adapters/ag-ui/state-delta-cache.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/state-delta-cache.js +422 -0
- package/v3/dist/adapters/ag-ui/state-delta-cache.js.map +1 -0
- package/v3/dist/adapters/ag-ui/state-manager.d.ts +249 -0
- package/v3/dist/adapters/ag-ui/state-manager.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/state-manager.js +511 -0
- package/v3/dist/adapters/ag-ui/state-manager.js.map +1 -0
- package/v3/dist/adapters/ag-ui/stream-controller.d.ts +195 -0
- package/v3/dist/adapters/ag-ui/stream-controller.d.ts.map +1 -0
- package/v3/dist/adapters/ag-ui/stream-controller.js +481 -0
- package/v3/dist/adapters/ag-ui/stream-controller.js.map +1 -0
- package/v3/dist/adapters/index.d.ts +4 -0
- package/v3/dist/adapters/index.d.ts.map +1 -1
- package/v3/dist/adapters/index.js +89 -0
- package/v3/dist/adapters/index.js.map +1 -1
- package/v3/dist/cli/bundle.js +1507 -425
- package/v3/dist/coordination/consensus/providers/claude-provider.js +1 -1
- package/v3/dist/coordination/consensus/providers/gemini-provider.js +1 -1
- package/v3/dist/coordination/consensus/providers/openai-provider.js +1 -1
- package/v3/dist/init/init-wizard.d.ts.map +1 -1
- package/v3/dist/init/init-wizard.js +19 -4
- package/v3/dist/init/init-wizard.js.map +1 -1
- package/v3/dist/init/migration/config-migrator.d.ts.map +1 -1
- package/v3/dist/init/migration/config-migrator.js +15 -1
- package/v3/dist/init/migration/config-migrator.js.map +1 -1
- package/v3/dist/init/phases/05-learning.js +1 -1
- package/v3/dist/init/phases/05-learning.js.map +1 -1
- package/v3/dist/init/self-configurator.d.ts +7 -0
- package/v3/dist/init/self-configurator.d.ts.map +1 -1
- package/v3/dist/init/self-configurator.js +23 -27
- package/v3/dist/init/self-configurator.js.map +1 -1
- package/v3/dist/integrations/ruvector/interfaces.js +1 -1
- package/v3/dist/integrations/ruvector/interfaces.js.map +1 -1
- package/v3/dist/kernel/index.d.ts +1 -1
- package/v3/dist/kernel/index.d.ts.map +1 -1
- package/v3/dist/kernel/index.js +3 -1
- package/v3/dist/kernel/index.js.map +1 -1
- package/v3/dist/kernel/plugin-loader.d.ts.map +1 -1
- package/v3/dist/kernel/plugin-loader.js +6 -1
- package/v3/dist/kernel/plugin-loader.js.map +1 -1
- package/v3/dist/kernel/unified-memory.d.ts +123 -0
- package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory.js +258 -2
- package/v3/dist/kernel/unified-memory.js.map +1 -1
- package/v3/dist/learning/qe-unified-memory.js +1 -1
- package/v3/dist/learning/qe-unified-memory.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +2 -2
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/sqlite-persistence.d.ts +1 -1
- package/v3/dist/learning/sqlite-persistence.js +1 -1
- package/v3/dist/learning/sqlite-persistence.js.map +1 -1
- package/v3/dist/learning/v2-to-v3-migration.d.ts +2 -2
- package/v3/dist/learning/v2-to-v3-migration.d.ts.map +1 -1
- package/v3/dist/learning/v2-to-v3-migration.js +2 -2
- package/v3/dist/learning/v2-to-v3-migration.js.map +1 -1
- package/v3/dist/mcp/bundle.js +63075 -53304
- package/v3/dist/mcp/entry.d.ts +5 -0
- package/v3/dist/mcp/entry.d.ts.map +1 -1
- package/v3/dist/mcp/entry.js +36 -0
- package/v3/dist/mcp/entry.js.map +1 -1
- package/v3/dist/mcp/http-server.d.ts +95 -0
- package/v3/dist/mcp/http-server.d.ts.map +1 -0
- package/v3/dist/mcp/http-server.js +833 -0
- package/v3/dist/mcp/http-server.js.map +1 -0
- package/v3/dist/mcp/protocol-server.d.ts +6 -0
- package/v3/dist/mcp/protocol-server.d.ts.map +1 -1
- package/v3/dist/mcp/protocol-server.js +40 -0
- package/v3/dist/mcp/protocol-server.js.map +1 -1
- package/v3/dist/mcp/transport/index.d.ts +25 -3
- package/v3/dist/mcp/transport/index.d.ts.map +1 -1
- package/v3/dist/mcp/transport/index.js +22 -4
- package/v3/dist/mcp/transport/index.js.map +1 -1
- package/v3/dist/mcp/transport/sse/connection-manager.d.ts +84 -0
- package/v3/dist/mcp/transport/sse/connection-manager.d.ts.map +1 -0
- package/v3/dist/mcp/transport/sse/connection-manager.js +271 -0
- package/v3/dist/mcp/transport/sse/connection-manager.js.map +1 -0
- package/v3/dist/mcp/transport/sse/index.d.ts +10 -0
- package/v3/dist/mcp/transport/sse/index.d.ts.map +1 -0
- package/v3/dist/mcp/transport/sse/index.js +15 -0
- package/v3/dist/mcp/transport/sse/index.js.map +1 -0
- package/v3/dist/mcp/transport/sse/sse-transport.d.ts +56 -0
- package/v3/dist/mcp/transport/sse/sse-transport.d.ts.map +1 -0
- package/v3/dist/mcp/transport/sse/sse-transport.js +381 -0
- package/v3/dist/mcp/transport/sse/sse-transport.js.map +1 -0
- package/v3/dist/mcp/transport/sse/types.d.ts +237 -0
- package/v3/dist/mcp/transport/sse/types.d.ts.map +1 -0
- package/v3/dist/mcp/transport/sse/types.js +37 -0
- package/v3/dist/mcp/transport/sse/types.js.map +1 -0
- package/v3/dist/mcp/transport/websocket/connection-manager.d.ts +143 -0
- package/v3/dist/mcp/transport/websocket/connection-manager.d.ts.map +1 -0
- package/v3/dist/mcp/transport/websocket/connection-manager.js +522 -0
- package/v3/dist/mcp/transport/websocket/connection-manager.js.map +1 -0
- package/v3/dist/mcp/transport/websocket/index.d.ts +10 -0
- package/v3/dist/mcp/transport/websocket/index.d.ts.map +1 -0
- package/v3/dist/mcp/transport/websocket/index.js +19 -0
- package/v3/dist/mcp/transport/websocket/index.js.map +1 -0
- package/v3/dist/mcp/transport/websocket/types.d.ts +354 -0
- package/v3/dist/mcp/transport/websocket/types.d.ts.map +1 -0
- package/v3/dist/mcp/transport/websocket/types.js +49 -0
- package/v3/dist/mcp/transport/websocket/types.js.map +1 -0
- package/v3/dist/mcp/transport/websocket/websocket-transport.d.ts +77 -0
- package/v3/dist/mcp/transport/websocket/websocket-transport.d.ts.map +1 -0
- package/v3/dist/mcp/transport/websocket/websocket-transport.js +622 -0
- package/v3/dist/mcp/transport/websocket/websocket-transport.js.map +1 -0
- package/v3/dist/memory/crdt/convergence-tracker.d.ts +59 -0
- package/v3/dist/memory/crdt/convergence-tracker.d.ts.map +1 -0
- package/v3/dist/memory/crdt/convergence-tracker.js +325 -0
- package/v3/dist/memory/crdt/convergence-tracker.js.map +1 -0
- package/v3/dist/memory/crdt/crdt-store.d.ts +55 -0
- package/v3/dist/memory/crdt/crdt-store.d.ts.map +1 -0
- package/v3/dist/memory/crdt/crdt-store.js +582 -0
- package/v3/dist/memory/crdt/crdt-store.js.map +1 -0
- package/v3/dist/memory/crdt/g-counter.d.ts +47 -0
- package/v3/dist/memory/crdt/g-counter.d.ts.map +1 -0
- package/v3/dist/memory/crdt/g-counter.js +134 -0
- package/v3/dist/memory/crdt/g-counter.js.map +1 -0
- package/v3/dist/memory/crdt/index.d.ts +52 -0
- package/v3/dist/memory/crdt/index.d.ts.map +1 -0
- package/v3/dist/memory/crdt/index.js +66 -0
- package/v3/dist/memory/crdt/index.js.map +1 -0
- package/v3/dist/memory/crdt/lww-register.d.ts +40 -0
- package/v3/dist/memory/crdt/lww-register.d.ts.map +1 -0
- package/v3/dist/memory/crdt/lww-register.js +133 -0
- package/v3/dist/memory/crdt/lww-register.js.map +1 -0
- package/v3/dist/memory/crdt/or-set.d.ts +62 -0
- package/v3/dist/memory/crdt/or-set.d.ts.map +1 -0
- package/v3/dist/memory/crdt/or-set.js +336 -0
- package/v3/dist/memory/crdt/or-set.js.map +1 -0
- package/v3/dist/memory/crdt/pn-counter.d.ts +53 -0
- package/v3/dist/memory/crdt/pn-counter.d.ts.map +1 -0
- package/v3/dist/memory/crdt/pn-counter.js +147 -0
- package/v3/dist/memory/crdt/pn-counter.js.map +1 -0
- package/v3/dist/memory/crdt/types.d.ts +397 -0
- package/v3/dist/memory/crdt/types.d.ts.map +1 -0
- package/v3/dist/memory/crdt/types.js +12 -0
- package/v3/dist/memory/crdt/types.js.map +1 -0
- package/v3/dist/memory/index.d.ts +5 -2
- package/v3/dist/memory/index.d.ts.map +1 -1
- package/v3/dist/memory/index.js +5 -2
- package/v3/dist/memory/index.js.map +1 -1
- package/v3/dist/performance/benchmarks.d.ts +215 -0
- package/v3/dist/performance/benchmarks.d.ts.map +1 -0
- package/v3/dist/performance/benchmarks.js +516 -0
- package/v3/dist/performance/benchmarks.js.map +1 -0
- package/v3/dist/performance/ci-gates.d.ts +149 -0
- package/v3/dist/performance/ci-gates.d.ts.map +1 -0
- package/v3/dist/performance/ci-gates.js +425 -0
- package/v3/dist/performance/ci-gates.js.map +1 -0
- package/v3/dist/performance/index.d.ts +18 -0
- package/v3/dist/performance/index.d.ts.map +1 -0
- package/v3/dist/performance/index.js +26 -0
- package/v3/dist/performance/index.js.map +1 -0
- package/v3/dist/performance/optimizer.d.ts +323 -0
- package/v3/dist/performance/optimizer.d.ts.map +1 -0
- package/v3/dist/performance/optimizer.js +592 -0
- package/v3/dist/performance/optimizer.js.map +1 -0
- package/v3/dist/performance/profiler.d.ts +195 -0
- package/v3/dist/performance/profiler.d.ts.map +1 -0
- package/v3/dist/performance/profiler.js +369 -0
- package/v3/dist/performance/profiler.js.map +1 -0
- package/v3/dist/performance/run-gates.d.ts +23 -0
- package/v3/dist/performance/run-gates.d.ts.map +1 -0
- package/v3/dist/performance/run-gates.js +122 -0
- package/v3/dist/performance/run-gates.js.map +1 -0
- package/v3/dist/sync/claude-flow-bridge.d.ts +1 -1
- package/v3/dist/sync/claude-flow-bridge.js +1 -1
- package/v3/dist/sync/interfaces.d.ts +6 -0
- package/v3/dist/sync/interfaces.d.ts.map +1 -1
- package/v3/dist/sync/interfaces.js +34 -47
- package/v3/dist/sync/interfaces.js.map +1 -1
- package/v3/dist/sync/readers/sqlite-reader.d.ts +1 -1
- package/v3/dist/sync/readers/sqlite-reader.js +1 -1
- package/v3/dist/testing/index.d.ts +6 -0
- package/v3/dist/testing/index.d.ts.map +1 -0
- package/v3/dist/testing/index.js +7 -0
- package/v3/dist/testing/index.js.map +1 -0
- package/v3/dist/testing/load/agent-load-tester.d.ts +221 -0
- package/v3/dist/testing/load/agent-load-tester.d.ts.map +1 -0
- package/v3/dist/testing/load/agent-load-tester.js +566 -0
- package/v3/dist/testing/load/agent-load-tester.js.map +1 -0
- package/v3/dist/testing/load/bottleneck-analyzer.d.ts +150 -0
- package/v3/dist/testing/load/bottleneck-analyzer.d.ts.map +1 -0
- package/v3/dist/testing/load/bottleneck-analyzer.js +442 -0
- package/v3/dist/testing/load/bottleneck-analyzer.js.map +1 -0
- package/v3/dist/testing/load/index.d.ts +17 -0
- package/v3/dist/testing/load/index.d.ts.map +1 -0
- package/v3/dist/testing/load/index.js +23 -0
- package/v3/dist/testing/load/index.js.map +1 -0
- package/v3/dist/testing/load/metrics-collector.d.ts +275 -0
- package/v3/dist/testing/load/metrics-collector.d.ts.map +1 -0
- package/v3/dist/testing/load/metrics-collector.js +475 -0
- package/v3/dist/testing/load/metrics-collector.js.map +1 -0
- package/v3/package.json +5 -1
package/v3/dist/cli/bundle.js
CHANGED
|
@@ -1384,7 +1384,7 @@ var init_claude_provider = __esm({
|
|
|
1384
1384
|
defaultModel: config.defaultModel || "claude-3-5-sonnet-20241022",
|
|
1385
1385
|
baseUrl: this.baseUrl,
|
|
1386
1386
|
defaultTimeout: config.defaultTimeout || 3e4,
|
|
1387
|
-
maxRetries: config.maxRetries
|
|
1387
|
+
maxRetries: config.maxRetries ?? 3,
|
|
1388
1388
|
retryDelayMs: config.retryDelayMs || 1e3,
|
|
1389
1389
|
enableLogging: config.enableLogging || false
|
|
1390
1390
|
};
|
|
@@ -1697,7 +1697,7 @@ var init_openai_provider = __esm({
|
|
|
1697
1697
|
defaultModel: config.defaultModel || "gpt-4-turbo",
|
|
1698
1698
|
baseUrl: this.baseUrl,
|
|
1699
1699
|
defaultTimeout: config.defaultTimeout || CONSENSUS_CONSTANTS.MODEL_TIMEOUT_MS,
|
|
1700
|
-
maxRetries: config.maxRetries
|
|
1700
|
+
maxRetries: config.maxRetries ?? CONSENSUS_CONSTANTS.DEFAULT_RETRY_ATTEMPTS,
|
|
1701
1701
|
retryDelayMs: config.retryDelayMs || CONSENSUS_CONSTANTS.DEFAULT_RETRY_DELAY_MS,
|
|
1702
1702
|
enableLogging: config.enableLogging || false
|
|
1703
1703
|
};
|
|
@@ -1947,7 +1947,7 @@ var init_gemini_provider = __esm({
|
|
|
1947
1947
|
defaultModel: config.defaultModel || "gemini-1.5-pro-latest",
|
|
1948
1948
|
baseUrl: this.baseUrl,
|
|
1949
1949
|
defaultTimeout: config.defaultTimeout || 3e4,
|
|
1950
|
-
maxRetries: config.maxRetries
|
|
1950
|
+
maxRetries: config.maxRetries ?? 3,
|
|
1951
1951
|
retryDelayMs: config.retryDelayMs || 1e3,
|
|
1952
1952
|
enableLogging: config.enableLogging || false
|
|
1953
1953
|
};
|
|
@@ -2220,7 +2220,7 @@ function createMultiModelProviders(models = getRecommendedSecurityModels(), base
|
|
|
2220
2220
|
})
|
|
2221
2221
|
);
|
|
2222
2222
|
}
|
|
2223
|
-
var MODEL_COSTS,
|
|
2223
|
+
var MODEL_COSTS, DEFAULT_CONFIG4, OpenRouterModelProvider;
|
|
2224
2224
|
var init_openrouter_provider = __esm({
|
|
2225
2225
|
"src/coordination/consensus/providers/openrouter-provider.ts"() {
|
|
2226
2226
|
"use strict";
|
|
@@ -2254,7 +2254,7 @@ var init_openrouter_provider = __esm({
|
|
|
2254
2254
|
// Cohere models
|
|
2255
2255
|
"cohere/command-r-plus": { input: 2.5, output: 10, tier: "standard" }
|
|
2256
2256
|
};
|
|
2257
|
-
|
|
2257
|
+
DEFAULT_CONFIG4 = {
|
|
2258
2258
|
defaultModel: "anthropic/claude-3.5-sonnet",
|
|
2259
2259
|
defaultTimeout: 12e4,
|
|
2260
2260
|
// 2 minutes
|
|
@@ -2281,7 +2281,7 @@ var init_openrouter_provider = __esm({
|
|
|
2281
2281
|
);
|
|
2282
2282
|
}
|
|
2283
2283
|
this.config = {
|
|
2284
|
-
...
|
|
2284
|
+
...DEFAULT_CONFIG4,
|
|
2285
2285
|
...config,
|
|
2286
2286
|
apiKey
|
|
2287
2287
|
};
|
|
@@ -2525,13 +2525,13 @@ async function isOllamaAvailable(baseUrl = "http://localhost:11434") {
|
|
|
2525
2525
|
return false;
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
var
|
|
2528
|
+
var DEFAULT_CONFIG5, OllamaModelProvider;
|
|
2529
2529
|
var init_ollama_provider = __esm({
|
|
2530
2530
|
"src/coordination/consensus/providers/ollama-provider.ts"() {
|
|
2531
2531
|
"use strict";
|
|
2532
2532
|
init_model_provider();
|
|
2533
2533
|
init_constants2();
|
|
2534
|
-
|
|
2534
|
+
DEFAULT_CONFIG5 = {
|
|
2535
2535
|
baseUrl: OLLAMA_CONSTANTS.DEFAULT_BASE_URL,
|
|
2536
2536
|
defaultModel: "llama3.1",
|
|
2537
2537
|
defaultTimeout: CONSENSUS_CONSTANTS.OLLAMA_TIMEOUT_MS,
|
|
@@ -2553,7 +2553,7 @@ var init_ollama_provider = __esm({
|
|
|
2553
2553
|
constructor(config = {}) {
|
|
2554
2554
|
super();
|
|
2555
2555
|
this.config = {
|
|
2556
|
-
...
|
|
2556
|
+
...DEFAULT_CONFIG5,
|
|
2557
2557
|
...config
|
|
2558
2558
|
};
|
|
2559
2559
|
this.id = `ollama-${this.config.defaultModel.replace(/[^a-z0-9]/gi, "-")}`;
|
|
@@ -6359,7 +6359,7 @@ var knowledge_graph_exports = {};
|
|
|
6359
6359
|
__export(knowledge_graph_exports, {
|
|
6360
6360
|
KnowledgeGraphService: () => KnowledgeGraphService
|
|
6361
6361
|
});
|
|
6362
|
-
var
|
|
6362
|
+
var DEFAULT_CONFIG26, KnowledgeGraphService;
|
|
6363
6363
|
var init_knowledge_graph = __esm({
|
|
6364
6364
|
"src/domains/code-intelligence/services/knowledge-graph.ts"() {
|
|
6365
6365
|
"use strict";
|
|
@@ -6367,7 +6367,7 @@ var init_knowledge_graph = __esm({
|
|
|
6367
6367
|
init_parsers();
|
|
6368
6368
|
init_io();
|
|
6369
6369
|
init_embeddings();
|
|
6370
|
-
|
|
6370
|
+
DEFAULT_CONFIG26 = {
|
|
6371
6371
|
maxNodes: 1e5,
|
|
6372
6372
|
maxEdgesPerNode: 500,
|
|
6373
6373
|
namespace: "code-intelligence:kg",
|
|
@@ -6395,7 +6395,7 @@ var init_knowledge_graph = __esm({
|
|
|
6395
6395
|
* @param config - Optional configuration overrides
|
|
6396
6396
|
*/
|
|
6397
6397
|
constructor(dependenciesOrMemory, config = {}) {
|
|
6398
|
-
this.config = { ...
|
|
6398
|
+
this.config = { ...DEFAULT_CONFIG26, ...config };
|
|
6399
6399
|
if (this.isKnowledgeGraphDependencies(dependenciesOrMemory)) {
|
|
6400
6400
|
this.memory = dependenciesOrMemory.memory;
|
|
6401
6401
|
this.llmRouter = dependenciesOrMemory.llmRouter;
|
|
@@ -7438,7 +7438,7 @@ __export(v2_to_v3_migration_exports, {
|
|
|
7438
7438
|
migrateV2ToV3: () => migrateV2ToV3
|
|
7439
7439
|
});
|
|
7440
7440
|
import Database2 from "better-sqlite3";
|
|
7441
|
-
async function migrateV2ToV3(v2DbPath = ".agentic-qe/memory.db", v3PatternsDbPath = ".agentic-qe/
|
|
7441
|
+
async function migrateV2ToV3(v2DbPath = ".agentic-qe/memory.db", v3PatternsDbPath = ".agentic-qe/memory.db", onProgress) {
|
|
7442
7442
|
const migrator = new V2ToV3Migrator({
|
|
7443
7443
|
v2DbPath,
|
|
7444
7444
|
v3PatternsDbPath,
|
|
@@ -8459,7 +8459,13 @@ var DefaultPluginLoader = class {
|
|
|
8459
8459
|
}
|
|
8460
8460
|
const factory = this.factories.get(domain);
|
|
8461
8461
|
if (!factory) {
|
|
8462
|
-
|
|
8462
|
+
const registeredDomains = Array.from(this.factories.keys());
|
|
8463
|
+
throw new Error(
|
|
8464
|
+
`No factory registered for domain: ${domain}
|
|
8465
|
+
This usually means the domain is not enabled in your config.
|
|
8466
|
+
Registered domains: ${registeredDomains.join(", ")}
|
|
8467
|
+
Fix: Add '${domain}' to domains.enabled in .agentic-qe/config.yaml, or run 'aqe init --auto-migrate' to enable all domains.`
|
|
8468
|
+
);
|
|
8463
8469
|
}
|
|
8464
8470
|
const promise = this.loadPlugin(domain, factory);
|
|
8465
8471
|
this.loading.set(domain, promise);
|
|
@@ -8624,15 +8630,896 @@ function isMigrationApplied(db) {
|
|
|
8624
8630
|
|
|
8625
8631
|
// src/kernel/unified-memory.ts
|
|
8626
8632
|
init_constants();
|
|
8633
|
+
|
|
8634
|
+
// src/memory/crdt/lww-register.ts
|
|
8635
|
+
function createLWWRegister(nodeId, initialValue, initialTimestamp) {
|
|
8636
|
+
let state2 = {
|
|
8637
|
+
value: initialValue,
|
|
8638
|
+
timestamp: initialTimestamp ?? (initialValue !== void 0 ? Date.now() : 0),
|
|
8639
|
+
nodeId: initialValue !== void 0 ? nodeId : "",
|
|
8640
|
+
version: initialValue !== void 0 ? 1 : 0,
|
|
8641
|
+
lastUpdated: Date.now()
|
|
8642
|
+
};
|
|
8643
|
+
function compareTimestamps(timestampA, nodeIdA, timestampB, nodeIdB) {
|
|
8644
|
+
if (timestampA !== timestampB) {
|
|
8645
|
+
return timestampA - timestampB;
|
|
8646
|
+
}
|
|
8647
|
+
return nodeIdA.localeCompare(nodeIdB);
|
|
8648
|
+
}
|
|
8649
|
+
return {
|
|
8650
|
+
get() {
|
|
8651
|
+
return state2.value;
|
|
8652
|
+
},
|
|
8653
|
+
set(value, timestamp) {
|
|
8654
|
+
const ts4 = timestamp ?? Date.now();
|
|
8655
|
+
if (state2.timestamp === 0 || compareTimestamps(ts4, nodeId, state2.timestamp, state2.nodeId) > 0) {
|
|
8656
|
+
state2 = {
|
|
8657
|
+
value,
|
|
8658
|
+
timestamp: ts4,
|
|
8659
|
+
nodeId,
|
|
8660
|
+
version: state2.version + 1,
|
|
8661
|
+
lastUpdated: Date.now()
|
|
8662
|
+
};
|
|
8663
|
+
}
|
|
8664
|
+
},
|
|
8665
|
+
merge(other) {
|
|
8666
|
+
const otherState = other.getState();
|
|
8667
|
+
this.applyState(otherState);
|
|
8668
|
+
},
|
|
8669
|
+
getState() {
|
|
8670
|
+
return {
|
|
8671
|
+
value: state2.value,
|
|
8672
|
+
timestamp: state2.timestamp,
|
|
8673
|
+
nodeId: state2.nodeId,
|
|
8674
|
+
version: state2.version,
|
|
8675
|
+
lastUpdated: state2.lastUpdated
|
|
8676
|
+
};
|
|
8677
|
+
},
|
|
8678
|
+
applyState(incoming) {
|
|
8679
|
+
if (state2.timestamp === 0 || compareTimestamps(
|
|
8680
|
+
incoming.timestamp,
|
|
8681
|
+
incoming.nodeId,
|
|
8682
|
+
state2.timestamp,
|
|
8683
|
+
state2.nodeId
|
|
8684
|
+
) > 0) {
|
|
8685
|
+
state2 = {
|
|
8686
|
+
value: incoming.value,
|
|
8687
|
+
timestamp: incoming.timestamp,
|
|
8688
|
+
nodeId: incoming.nodeId,
|
|
8689
|
+
version: Math.max(state2.version, incoming.version) + 1,
|
|
8690
|
+
lastUpdated: Date.now()
|
|
8691
|
+
};
|
|
8692
|
+
}
|
|
8693
|
+
},
|
|
8694
|
+
getNodeId() {
|
|
8695
|
+
return nodeId;
|
|
8696
|
+
},
|
|
8697
|
+
getTimestamp() {
|
|
8698
|
+
return state2.timestamp;
|
|
8699
|
+
}
|
|
8700
|
+
};
|
|
8701
|
+
}
|
|
8702
|
+
function createLWWRegisterFromState(nodeId, existingState) {
|
|
8703
|
+
const register = createLWWRegister(nodeId);
|
|
8704
|
+
register.applyState(existingState);
|
|
8705
|
+
return register;
|
|
8706
|
+
}
|
|
8707
|
+
|
|
8708
|
+
// src/memory/crdt/g-counter.ts
|
|
8709
|
+
function createGCounter(nodeId) {
|
|
8710
|
+
const state2 = {
|
|
8711
|
+
counts: {},
|
|
8712
|
+
version: 0,
|
|
8713
|
+
lastUpdated: Date.now()
|
|
8714
|
+
};
|
|
8715
|
+
state2.counts[nodeId] = 0;
|
|
8716
|
+
return {
|
|
8717
|
+
get() {
|
|
8718
|
+
return Object.values(state2.counts).reduce((sum, count) => sum + count, 0);
|
|
8719
|
+
},
|
|
8720
|
+
increment(n = 1) {
|
|
8721
|
+
if (n < 0) {
|
|
8722
|
+
throw new Error("G-Counter can only increment by positive values");
|
|
8723
|
+
}
|
|
8724
|
+
if (n === 0) {
|
|
8725
|
+
return;
|
|
8726
|
+
}
|
|
8727
|
+
state2.counts[nodeId] = (state2.counts[nodeId] || 0) + n;
|
|
8728
|
+
state2.version++;
|
|
8729
|
+
state2.lastUpdated = Date.now();
|
|
8730
|
+
},
|
|
8731
|
+
merge(other) {
|
|
8732
|
+
const otherState = other.getState();
|
|
8733
|
+
this.applyState(otherState);
|
|
8734
|
+
},
|
|
8735
|
+
getState() {
|
|
8736
|
+
return {
|
|
8737
|
+
counts: { ...state2.counts },
|
|
8738
|
+
version: state2.version,
|
|
8739
|
+
lastUpdated: state2.lastUpdated
|
|
8740
|
+
};
|
|
8741
|
+
},
|
|
8742
|
+
applyState(incoming) {
|
|
8743
|
+
let changed = false;
|
|
8744
|
+
for (const [incomingNodeId, incomingCount] of Object.entries(incoming.counts)) {
|
|
8745
|
+
const currentCount = state2.counts[incomingNodeId] || 0;
|
|
8746
|
+
if (incomingCount > currentCount) {
|
|
8747
|
+
state2.counts[incomingNodeId] = incomingCount;
|
|
8748
|
+
changed = true;
|
|
8749
|
+
}
|
|
8750
|
+
}
|
|
8751
|
+
if (changed) {
|
|
8752
|
+
state2.version = Math.max(state2.version, incoming.version) + 1;
|
|
8753
|
+
state2.lastUpdated = Date.now();
|
|
8754
|
+
}
|
|
8755
|
+
},
|
|
8756
|
+
getNodeId() {
|
|
8757
|
+
return nodeId;
|
|
8758
|
+
},
|
|
8759
|
+
getLocalCount() {
|
|
8760
|
+
return state2.counts[nodeId] || 0;
|
|
8761
|
+
}
|
|
8762
|
+
};
|
|
8763
|
+
}
|
|
8764
|
+
function createGCounterFromState(nodeId, existingState) {
|
|
8765
|
+
const counter = createGCounter(nodeId);
|
|
8766
|
+
counter.applyState(existingState);
|
|
8767
|
+
return counter;
|
|
8768
|
+
}
|
|
8769
|
+
|
|
8770
|
+
// src/memory/crdt/pn-counter.ts
|
|
8771
|
+
function createPNCounter(nodeId) {
|
|
8772
|
+
const positive = createGCounter(nodeId);
|
|
8773
|
+
const negative = createGCounter(nodeId);
|
|
8774
|
+
let version = 0;
|
|
8775
|
+
let lastUpdated = Date.now();
|
|
8776
|
+
return {
|
|
8777
|
+
get() {
|
|
8778
|
+
return positive.get() - negative.get();
|
|
8779
|
+
},
|
|
8780
|
+
increment(n = 1) {
|
|
8781
|
+
if (n < 0) {
|
|
8782
|
+
throw new Error("Use decrement() for negative values");
|
|
8783
|
+
}
|
|
8784
|
+
if (n === 0) {
|
|
8785
|
+
return;
|
|
8786
|
+
}
|
|
8787
|
+
positive.increment(n);
|
|
8788
|
+
version++;
|
|
8789
|
+
lastUpdated = Date.now();
|
|
8790
|
+
},
|
|
8791
|
+
decrement(n = 1) {
|
|
8792
|
+
if (n < 0) {
|
|
8793
|
+
throw new Error("Use increment() for negative values");
|
|
8794
|
+
}
|
|
8795
|
+
if (n === 0) {
|
|
8796
|
+
return;
|
|
8797
|
+
}
|
|
8798
|
+
negative.increment(n);
|
|
8799
|
+
version++;
|
|
8800
|
+
lastUpdated = Date.now();
|
|
8801
|
+
},
|
|
8802
|
+
merge(other) {
|
|
8803
|
+
const otherState = other.getState();
|
|
8804
|
+
this.applyState(otherState);
|
|
8805
|
+
},
|
|
8806
|
+
getState() {
|
|
8807
|
+
return {
|
|
8808
|
+
positive: positive.getState(),
|
|
8809
|
+
negative: negative.getState(),
|
|
8810
|
+
version,
|
|
8811
|
+
lastUpdated
|
|
8812
|
+
};
|
|
8813
|
+
},
|
|
8814
|
+
applyState(incoming) {
|
|
8815
|
+
const oldValue = this.get();
|
|
8816
|
+
positive.applyState(incoming.positive);
|
|
8817
|
+
negative.applyState(incoming.negative);
|
|
8818
|
+
const newValue = this.get();
|
|
8819
|
+
if (oldValue !== newValue) {
|
|
8820
|
+
version = Math.max(version, incoming.version) + 1;
|
|
8821
|
+
lastUpdated = Date.now();
|
|
8822
|
+
}
|
|
8823
|
+
},
|
|
8824
|
+
getNodeId() {
|
|
8825
|
+
return nodeId;
|
|
8826
|
+
}
|
|
8827
|
+
};
|
|
8828
|
+
}
|
|
8829
|
+
function createPNCounterFromState(nodeId, existingState) {
|
|
8830
|
+
const counter = createPNCounter(nodeId);
|
|
8831
|
+
counter.applyState(existingState);
|
|
8832
|
+
return counter;
|
|
8833
|
+
}
|
|
8834
|
+
|
|
8835
|
+
// src/memory/crdt/or-set.ts
|
|
8836
|
+
function generateTag(nodeId, counter) {
|
|
8837
|
+
return `${nodeId}:${Date.now()}:${counter}`;
|
|
8838
|
+
}
|
|
8839
|
+
function serializeElement(element) {
|
|
8840
|
+
if (typeof element === "string") {
|
|
8841
|
+
return `s:${element}`;
|
|
8842
|
+
}
|
|
8843
|
+
if (typeof element === "number") {
|
|
8844
|
+
return `n:${element}`;
|
|
8845
|
+
}
|
|
8846
|
+
if (typeof element === "boolean") {
|
|
8847
|
+
return `b:${element}`;
|
|
8848
|
+
}
|
|
8849
|
+
return `j:${JSON.stringify(element)}`;
|
|
8850
|
+
}
|
|
8851
|
+
function deserializeElement(key) {
|
|
8852
|
+
const type = key.substring(0, 2);
|
|
8853
|
+
const value = key.substring(2);
|
|
8854
|
+
switch (type) {
|
|
8855
|
+
case "s:":
|
|
8856
|
+
return value;
|
|
8857
|
+
case "n:":
|
|
8858
|
+
return Number(value);
|
|
8859
|
+
case "b:":
|
|
8860
|
+
return value === "true";
|
|
8861
|
+
case "j:":
|
|
8862
|
+
return JSON.parse(value);
|
|
8863
|
+
default:
|
|
8864
|
+
throw new Error(`Unknown serialization type: ${type}`);
|
|
8865
|
+
}
|
|
8866
|
+
}
|
|
8867
|
+
function createORSet(nodeId) {
|
|
8868
|
+
const elements = /* @__PURE__ */ new Map();
|
|
8869
|
+
const tombstones = /* @__PURE__ */ new Map();
|
|
8870
|
+
let version = 0;
|
|
8871
|
+
let lastUpdated = Date.now();
|
|
8872
|
+
let tagCounter = 0;
|
|
8873
|
+
function hasActiveTags(serialized) {
|
|
8874
|
+
const tags = elements.get(serialized);
|
|
8875
|
+
if (!tags || tags.size === 0) {
|
|
8876
|
+
return false;
|
|
8877
|
+
}
|
|
8878
|
+
const tombstoneTags = tombstones.get(serialized);
|
|
8879
|
+
if (!tombstoneTags || tombstoneTags.size === 0) {
|
|
8880
|
+
return true;
|
|
8881
|
+
}
|
|
8882
|
+
for (const tag of tags) {
|
|
8883
|
+
if (!tombstoneTags.has(tag)) {
|
|
8884
|
+
return true;
|
|
8885
|
+
}
|
|
8886
|
+
}
|
|
8887
|
+
return false;
|
|
8888
|
+
}
|
|
8889
|
+
function getActiveTags(serialized) {
|
|
8890
|
+
const tags = elements.get(serialized);
|
|
8891
|
+
if (!tags) {
|
|
8892
|
+
return /* @__PURE__ */ new Set();
|
|
8893
|
+
}
|
|
8894
|
+
const tombstoneTags = tombstones.get(serialized) || /* @__PURE__ */ new Set();
|
|
8895
|
+
const active = /* @__PURE__ */ new Set();
|
|
8896
|
+
for (const tag of tags) {
|
|
8897
|
+
if (!tombstoneTags.has(tag)) {
|
|
8898
|
+
active.add(tag);
|
|
8899
|
+
}
|
|
8900
|
+
}
|
|
8901
|
+
return active;
|
|
8902
|
+
}
|
|
8903
|
+
return {
|
|
8904
|
+
has(element) {
|
|
8905
|
+
const serialized = serializeElement(element);
|
|
8906
|
+
return hasActiveTags(serialized);
|
|
8907
|
+
},
|
|
8908
|
+
values() {
|
|
8909
|
+
const result = [];
|
|
8910
|
+
for (const [serialized] of elements) {
|
|
8911
|
+
if (hasActiveTags(serialized)) {
|
|
8912
|
+
result.push(deserializeElement(serialized));
|
|
8913
|
+
}
|
|
8914
|
+
}
|
|
8915
|
+
return result;
|
|
8916
|
+
},
|
|
8917
|
+
size() {
|
|
8918
|
+
let count = 0;
|
|
8919
|
+
for (const [serialized] of elements) {
|
|
8920
|
+
if (hasActiveTags(serialized)) {
|
|
8921
|
+
count++;
|
|
8922
|
+
}
|
|
8923
|
+
}
|
|
8924
|
+
return count;
|
|
8925
|
+
},
|
|
8926
|
+
add(element) {
|
|
8927
|
+
const serialized = serializeElement(element);
|
|
8928
|
+
const tag = generateTag(nodeId, tagCounter++);
|
|
8929
|
+
if (!elements.has(serialized)) {
|
|
8930
|
+
elements.set(serialized, /* @__PURE__ */ new Set());
|
|
8931
|
+
}
|
|
8932
|
+
elements.get(serialized).add(tag);
|
|
8933
|
+
version++;
|
|
8934
|
+
lastUpdated = Date.now();
|
|
8935
|
+
},
|
|
8936
|
+
remove(element) {
|
|
8937
|
+
const serialized = serializeElement(element);
|
|
8938
|
+
const tags = elements.get(serialized);
|
|
8939
|
+
if (!tags || tags.size === 0) {
|
|
8940
|
+
return;
|
|
8941
|
+
}
|
|
8942
|
+
if (!tombstones.has(serialized)) {
|
|
8943
|
+
tombstones.set(serialized, /* @__PURE__ */ new Set());
|
|
8944
|
+
}
|
|
8945
|
+
const tombstoneTags = tombstones.get(serialized);
|
|
8946
|
+
for (const tag of tags) {
|
|
8947
|
+
tombstoneTags.add(tag);
|
|
8948
|
+
}
|
|
8949
|
+
version++;
|
|
8950
|
+
lastUpdated = Date.now();
|
|
8951
|
+
},
|
|
8952
|
+
merge(other) {
|
|
8953
|
+
const otherState = other.getState();
|
|
8954
|
+
this.applyState(otherState);
|
|
8955
|
+
},
|
|
8956
|
+
getState() {
|
|
8957
|
+
const elementsObj = {};
|
|
8958
|
+
for (const [key, tags] of elements) {
|
|
8959
|
+
elementsObj[key] = Array.from(tags);
|
|
8960
|
+
}
|
|
8961
|
+
const tombstonesObj = {};
|
|
8962
|
+
for (const [key, tags] of tombstones) {
|
|
8963
|
+
if (tags.size > 0) {
|
|
8964
|
+
tombstonesObj[key] = Array.from(tags);
|
|
8965
|
+
}
|
|
8966
|
+
}
|
|
8967
|
+
return {
|
|
8968
|
+
elements: elementsObj,
|
|
8969
|
+
tombstones: tombstonesObj,
|
|
8970
|
+
version,
|
|
8971
|
+
lastUpdated
|
|
8972
|
+
};
|
|
8973
|
+
},
|
|
8974
|
+
applyState(incoming) {
|
|
8975
|
+
let changed = false;
|
|
8976
|
+
for (const [serialized, incomingTags] of Object.entries(incoming.elements)) {
|
|
8977
|
+
if (!elements.has(serialized)) {
|
|
8978
|
+
elements.set(serialized, /* @__PURE__ */ new Set());
|
|
8979
|
+
}
|
|
8980
|
+
const localTags = elements.get(serialized);
|
|
8981
|
+
for (const tag of incomingTags) {
|
|
8982
|
+
if (!localTags.has(tag)) {
|
|
8983
|
+
localTags.add(tag);
|
|
8984
|
+
changed = true;
|
|
8985
|
+
}
|
|
8986
|
+
}
|
|
8987
|
+
}
|
|
8988
|
+
for (const [serialized, incomingTombstones] of Object.entries(
|
|
8989
|
+
incoming.tombstones
|
|
8990
|
+
)) {
|
|
8991
|
+
if (!tombstones.has(serialized)) {
|
|
8992
|
+
tombstones.set(serialized, /* @__PURE__ */ new Set());
|
|
8993
|
+
}
|
|
8994
|
+
const localTombstones = tombstones.get(serialized);
|
|
8995
|
+
for (const tag of incomingTombstones) {
|
|
8996
|
+
if (!localTombstones.has(tag)) {
|
|
8997
|
+
localTombstones.add(tag);
|
|
8998
|
+
changed = true;
|
|
8999
|
+
}
|
|
9000
|
+
}
|
|
9001
|
+
}
|
|
9002
|
+
if (changed) {
|
|
9003
|
+
version = Math.max(version, incoming.version) + 1;
|
|
9004
|
+
lastUpdated = Date.now();
|
|
9005
|
+
}
|
|
9006
|
+
},
|
|
9007
|
+
getNodeId() {
|
|
9008
|
+
return nodeId;
|
|
9009
|
+
},
|
|
9010
|
+
clear() {
|
|
9011
|
+
for (const [serialized, tags] of elements) {
|
|
9012
|
+
if (!tombstones.has(serialized)) {
|
|
9013
|
+
tombstones.set(serialized, /* @__PURE__ */ new Set());
|
|
9014
|
+
}
|
|
9015
|
+
const tombstoneTags = tombstones.get(serialized);
|
|
9016
|
+
for (const tag of tags) {
|
|
9017
|
+
tombstoneTags.add(tag);
|
|
9018
|
+
}
|
|
9019
|
+
}
|
|
9020
|
+
version++;
|
|
9021
|
+
lastUpdated = Date.now();
|
|
9022
|
+
}
|
|
9023
|
+
};
|
|
9024
|
+
}
|
|
9025
|
+
function createORSetFromState(nodeId, existingState) {
|
|
9026
|
+
const set = createORSet(nodeId);
|
|
9027
|
+
set.applyState(existingState);
|
|
9028
|
+
return set;
|
|
9029
|
+
}
|
|
9030
|
+
|
|
9031
|
+
// src/memory/crdt/crdt-store.ts
|
|
9032
|
+
var DEFAULT_CONFIG = {
|
|
9033
|
+
nodeId: "default-node",
|
|
9034
|
+
enableDeltaTracking: true,
|
|
9035
|
+
maxDeltaHistory: 100
|
|
9036
|
+
};
|
|
9037
|
+
function createCRDTStore(config) {
|
|
9038
|
+
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
9039
|
+
const { nodeId, enableDeltaTracking, maxDeltaHistory } = cfg;
|
|
9040
|
+
const registers = /* @__PURE__ */ new Map();
|
|
9041
|
+
const gCounters = /* @__PURE__ */ new Map();
|
|
9042
|
+
const pnCounters = /* @__PURE__ */ new Map();
|
|
9043
|
+
const sets = /* @__PURE__ */ new Map();
|
|
9044
|
+
let version = 0;
|
|
9045
|
+
const deltaHistory = [];
|
|
9046
|
+
const changeListeners = /* @__PURE__ */ new Set();
|
|
9047
|
+
const pendingChanges = {
|
|
9048
|
+
registers: /* @__PURE__ */ new Set(),
|
|
9049
|
+
gCounters: /* @__PURE__ */ new Set(),
|
|
9050
|
+
pnCounters: /* @__PURE__ */ new Set(),
|
|
9051
|
+
sets: /* @__PURE__ */ new Set()
|
|
9052
|
+
};
|
|
9053
|
+
function emitChange(key, type, operation) {
|
|
9054
|
+
const event = {
|
|
9055
|
+
key,
|
|
9056
|
+
type,
|
|
9057
|
+
operation,
|
|
9058
|
+
timestamp: Date.now(),
|
|
9059
|
+
nodeId
|
|
9060
|
+
};
|
|
9061
|
+
for (const listener of changeListeners) {
|
|
9062
|
+
try {
|
|
9063
|
+
listener(event);
|
|
9064
|
+
} catch (error) {
|
|
9065
|
+
console.error("[CRDTStore] Error in change listener:", error);
|
|
9066
|
+
}
|
|
9067
|
+
}
|
|
9068
|
+
}
|
|
9069
|
+
function recordChange(type, key) {
|
|
9070
|
+
version++;
|
|
9071
|
+
if (enableDeltaTracking) {
|
|
9072
|
+
pendingChanges[type].add(key);
|
|
9073
|
+
}
|
|
9074
|
+
}
|
|
9075
|
+
function flushDelta() {
|
|
9076
|
+
if (!enableDeltaTracking) return;
|
|
9077
|
+
const hasChanges = pendingChanges.registers.size > 0 || pendingChanges.gCounters.size > 0 || pendingChanges.pnCounters.size > 0 || pendingChanges.sets.size > 0;
|
|
9078
|
+
if (!hasChanges) return;
|
|
9079
|
+
const delta = {
|
|
9080
|
+
fromVersion: deltaHistory.length > 0 ? deltaHistory[deltaHistory.length - 1].toVersion : 0,
|
|
9081
|
+
toVersion: version,
|
|
9082
|
+
timestamp: Date.now(),
|
|
9083
|
+
nodeId
|
|
9084
|
+
};
|
|
9085
|
+
if (pendingChanges.registers.size > 0) {
|
|
9086
|
+
delta.registers = {};
|
|
9087
|
+
for (const key of pendingChanges.registers) {
|
|
9088
|
+
const reg = registers.get(key);
|
|
9089
|
+
if (reg) {
|
|
9090
|
+
delta.registers[key] = reg.getState();
|
|
9091
|
+
}
|
|
9092
|
+
}
|
|
9093
|
+
pendingChanges.registers.clear();
|
|
9094
|
+
}
|
|
9095
|
+
if (pendingChanges.gCounters.size > 0) {
|
|
9096
|
+
delta.gCounters = {};
|
|
9097
|
+
for (const key of pendingChanges.gCounters) {
|
|
9098
|
+
const counter = gCounters.get(key);
|
|
9099
|
+
if (counter) {
|
|
9100
|
+
delta.gCounters[key] = counter.getState();
|
|
9101
|
+
}
|
|
9102
|
+
}
|
|
9103
|
+
pendingChanges.gCounters.clear();
|
|
9104
|
+
}
|
|
9105
|
+
if (pendingChanges.pnCounters.size > 0) {
|
|
9106
|
+
delta.pnCounters = {};
|
|
9107
|
+
for (const key of pendingChanges.pnCounters) {
|
|
9108
|
+
const counter = pnCounters.get(key);
|
|
9109
|
+
if (counter) {
|
|
9110
|
+
delta.pnCounters[key] = counter.getState();
|
|
9111
|
+
}
|
|
9112
|
+
}
|
|
9113
|
+
pendingChanges.pnCounters.clear();
|
|
9114
|
+
}
|
|
9115
|
+
if (pendingChanges.sets.size > 0) {
|
|
9116
|
+
delta.sets = {};
|
|
9117
|
+
for (const key of pendingChanges.sets) {
|
|
9118
|
+
const set = sets.get(key);
|
|
9119
|
+
if (set) {
|
|
9120
|
+
delta.sets[key] = set.getState();
|
|
9121
|
+
}
|
|
9122
|
+
}
|
|
9123
|
+
pendingChanges.sets.clear();
|
|
9124
|
+
}
|
|
9125
|
+
deltaHistory.push(delta);
|
|
9126
|
+
while (deltaHistory.length > maxDeltaHistory) {
|
|
9127
|
+
deltaHistory.shift();
|
|
9128
|
+
}
|
|
9129
|
+
}
|
|
9130
|
+
const store = {
|
|
9131
|
+
// -------------------------------------------------------------------------
|
|
9132
|
+
// Register Management
|
|
9133
|
+
// -------------------------------------------------------------------------
|
|
9134
|
+
getRegister(key) {
|
|
9135
|
+
if (!registers.has(key)) {
|
|
9136
|
+
registers.set(key, createLWWRegister(nodeId));
|
|
9137
|
+
}
|
|
9138
|
+
return registers.get(key);
|
|
9139
|
+
},
|
|
9140
|
+
setRegister(key, value) {
|
|
9141
|
+
const register = store.getRegister(key);
|
|
9142
|
+
register.set(value);
|
|
9143
|
+
recordChange("registers", key);
|
|
9144
|
+
emitChange(key, "lww-register", "set");
|
|
9145
|
+
},
|
|
9146
|
+
hasRegister(key) {
|
|
9147
|
+
return registers.has(key);
|
|
9148
|
+
},
|
|
9149
|
+
deleteRegister(key) {
|
|
9150
|
+
const deleted = registers.delete(key);
|
|
9151
|
+
if (deleted) {
|
|
9152
|
+
recordChange("registers", key);
|
|
9153
|
+
}
|
|
9154
|
+
return deleted;
|
|
9155
|
+
},
|
|
9156
|
+
// -------------------------------------------------------------------------
|
|
9157
|
+
// G-Counter Management
|
|
9158
|
+
// -------------------------------------------------------------------------
|
|
9159
|
+
getGCounter(key) {
|
|
9160
|
+
if (!gCounters.has(key)) {
|
|
9161
|
+
gCounters.set(key, createGCounter(nodeId));
|
|
9162
|
+
}
|
|
9163
|
+
return gCounters.get(key);
|
|
9164
|
+
},
|
|
9165
|
+
incrementGCounter(key, n) {
|
|
9166
|
+
const counter = store.getGCounter(key);
|
|
9167
|
+
counter.increment(n);
|
|
9168
|
+
recordChange("gCounters", key);
|
|
9169
|
+
emitChange(key, "g-counter", "increment");
|
|
9170
|
+
},
|
|
9171
|
+
hasGCounter(key) {
|
|
9172
|
+
return gCounters.has(key);
|
|
9173
|
+
},
|
|
9174
|
+
deleteGCounter(key) {
|
|
9175
|
+
const deleted = gCounters.delete(key);
|
|
9176
|
+
if (deleted) {
|
|
9177
|
+
recordChange("gCounters", key);
|
|
9178
|
+
}
|
|
9179
|
+
return deleted;
|
|
9180
|
+
},
|
|
9181
|
+
// -------------------------------------------------------------------------
|
|
9182
|
+
// PN-Counter Management
|
|
9183
|
+
// -------------------------------------------------------------------------
|
|
9184
|
+
getCounter(key) {
|
|
9185
|
+
if (!pnCounters.has(key)) {
|
|
9186
|
+
pnCounters.set(key, createPNCounter(nodeId));
|
|
9187
|
+
}
|
|
9188
|
+
return pnCounters.get(key);
|
|
9189
|
+
},
|
|
9190
|
+
incrementCounter(key, n) {
|
|
9191
|
+
const counter = store.getCounter(key);
|
|
9192
|
+
counter.increment(n);
|
|
9193
|
+
recordChange("pnCounters", key);
|
|
9194
|
+
emitChange(key, "pn-counter", "increment");
|
|
9195
|
+
},
|
|
9196
|
+
decrementCounter(key, n) {
|
|
9197
|
+
const counter = store.getCounter(key);
|
|
9198
|
+
counter.decrement(n);
|
|
9199
|
+
recordChange("pnCounters", key);
|
|
9200
|
+
emitChange(key, "pn-counter", "decrement");
|
|
9201
|
+
},
|
|
9202
|
+
hasCounter(key) {
|
|
9203
|
+
return pnCounters.has(key);
|
|
9204
|
+
},
|
|
9205
|
+
deleteCounter(key) {
|
|
9206
|
+
const deleted = pnCounters.delete(key);
|
|
9207
|
+
if (deleted) {
|
|
9208
|
+
recordChange("pnCounters", key);
|
|
9209
|
+
}
|
|
9210
|
+
return deleted;
|
|
9211
|
+
},
|
|
9212
|
+
// -------------------------------------------------------------------------
|
|
9213
|
+
// OR-Set Management
|
|
9214
|
+
// -------------------------------------------------------------------------
|
|
9215
|
+
getSet(key) {
|
|
9216
|
+
if (!sets.has(key)) {
|
|
9217
|
+
sets.set(key, createORSet(nodeId));
|
|
9218
|
+
}
|
|
9219
|
+
return sets.get(key);
|
|
9220
|
+
},
|
|
9221
|
+
addToSet(key, element) {
|
|
9222
|
+
const set = store.getSet(key);
|
|
9223
|
+
set.add(element);
|
|
9224
|
+
recordChange("sets", key);
|
|
9225
|
+
emitChange(key, "or-set", "add");
|
|
9226
|
+
},
|
|
9227
|
+
removeFromSet(key, element) {
|
|
9228
|
+
const set = store.getSet(key);
|
|
9229
|
+
set.remove(element);
|
|
9230
|
+
recordChange("sets", key);
|
|
9231
|
+
emitChange(key, "or-set", "remove");
|
|
9232
|
+
},
|
|
9233
|
+
hasSet(key) {
|
|
9234
|
+
return sets.has(key);
|
|
9235
|
+
},
|
|
9236
|
+
deleteSet(key) {
|
|
9237
|
+
const deleted = sets.delete(key);
|
|
9238
|
+
if (deleted) {
|
|
9239
|
+
recordChange("sets", key);
|
|
9240
|
+
}
|
|
9241
|
+
return deleted;
|
|
9242
|
+
},
|
|
9243
|
+
// -------------------------------------------------------------------------
|
|
9244
|
+
// Store Operations
|
|
9245
|
+
// -------------------------------------------------------------------------
|
|
9246
|
+
merge(other) {
|
|
9247
|
+
const otherState = other.getState();
|
|
9248
|
+
store.applyState(otherState);
|
|
9249
|
+
},
|
|
9250
|
+
getState() {
|
|
9251
|
+
flushDelta();
|
|
9252
|
+
const state2 = {
|
|
9253
|
+
version,
|
|
9254
|
+
timestamp: Date.now(),
|
|
9255
|
+
nodeId,
|
|
9256
|
+
registers: {},
|
|
9257
|
+
gCounters: {},
|
|
9258
|
+
pnCounters: {},
|
|
9259
|
+
sets: {}
|
|
9260
|
+
};
|
|
9261
|
+
for (const [key, reg] of registers) {
|
|
9262
|
+
state2.registers[key] = reg.getState();
|
|
9263
|
+
}
|
|
9264
|
+
for (const [key, counter] of gCounters) {
|
|
9265
|
+
state2.gCounters[key] = counter.getState();
|
|
9266
|
+
}
|
|
9267
|
+
for (const [key, counter] of pnCounters) {
|
|
9268
|
+
state2.pnCounters[key] = counter.getState();
|
|
9269
|
+
}
|
|
9270
|
+
for (const [key, set] of sets) {
|
|
9271
|
+
state2.sets[key] = set.getState();
|
|
9272
|
+
}
|
|
9273
|
+
return state2;
|
|
9274
|
+
},
|
|
9275
|
+
applyState(incoming) {
|
|
9276
|
+
for (const [key, state2] of Object.entries(incoming.registers)) {
|
|
9277
|
+
if (!registers.has(key)) {
|
|
9278
|
+
registers.set(
|
|
9279
|
+
key,
|
|
9280
|
+
createLWWRegisterFromState(nodeId, state2)
|
|
9281
|
+
);
|
|
9282
|
+
} else {
|
|
9283
|
+
registers.get(key).applyState(state2);
|
|
9284
|
+
}
|
|
9285
|
+
recordChange("registers", key);
|
|
9286
|
+
emitChange(key, "lww-register", "merge");
|
|
9287
|
+
}
|
|
9288
|
+
for (const [key, state2] of Object.entries(incoming.gCounters)) {
|
|
9289
|
+
if (!gCounters.has(key)) {
|
|
9290
|
+
gCounters.set(key, createGCounterFromState(nodeId, state2));
|
|
9291
|
+
} else {
|
|
9292
|
+
gCounters.get(key).applyState(state2);
|
|
9293
|
+
}
|
|
9294
|
+
recordChange("gCounters", key);
|
|
9295
|
+
emitChange(key, "g-counter", "merge");
|
|
9296
|
+
}
|
|
9297
|
+
for (const [key, state2] of Object.entries(incoming.pnCounters)) {
|
|
9298
|
+
if (!pnCounters.has(key)) {
|
|
9299
|
+
pnCounters.set(key, createPNCounterFromState(nodeId, state2));
|
|
9300
|
+
} else {
|
|
9301
|
+
pnCounters.get(key).applyState(state2);
|
|
9302
|
+
}
|
|
9303
|
+
recordChange("pnCounters", key);
|
|
9304
|
+
emitChange(key, "pn-counter", "merge");
|
|
9305
|
+
}
|
|
9306
|
+
for (const [key, state2] of Object.entries(incoming.sets)) {
|
|
9307
|
+
if (!sets.has(key)) {
|
|
9308
|
+
sets.set(
|
|
9309
|
+
key,
|
|
9310
|
+
createORSetFromState(nodeId, state2)
|
|
9311
|
+
);
|
|
9312
|
+
} else {
|
|
9313
|
+
sets.get(key).applyState(state2);
|
|
9314
|
+
}
|
|
9315
|
+
recordChange("sets", key);
|
|
9316
|
+
emitChange(key, "or-set", "merge");
|
|
9317
|
+
}
|
|
9318
|
+
version = Math.max(version, incoming.version) + 1;
|
|
9319
|
+
},
|
|
9320
|
+
getDelta(sinceVersion) {
|
|
9321
|
+
flushDelta();
|
|
9322
|
+
if (deltaHistory.length === 0) {
|
|
9323
|
+
if (sinceVersion >= version) {
|
|
9324
|
+
return null;
|
|
9325
|
+
}
|
|
9326
|
+
return null;
|
|
9327
|
+
}
|
|
9328
|
+
const relevantDeltas = deltaHistory.filter((d) => d.toVersion > sinceVersion);
|
|
9329
|
+
if (relevantDeltas.length === 0) {
|
|
9330
|
+
return null;
|
|
9331
|
+
return null;
|
|
9332
|
+
}
|
|
9333
|
+
const mergedDelta = {
|
|
9334
|
+
fromVersion: sinceVersion,
|
|
9335
|
+
toVersion: version,
|
|
9336
|
+
timestamp: Date.now(),
|
|
9337
|
+
nodeId,
|
|
9338
|
+
registers: {},
|
|
9339
|
+
gCounters: {},
|
|
9340
|
+
pnCounters: {},
|
|
9341
|
+
sets: {}
|
|
9342
|
+
};
|
|
9343
|
+
for (const delta of relevantDeltas) {
|
|
9344
|
+
if (delta.registers) {
|
|
9345
|
+
Object.assign(mergedDelta.registers, delta.registers);
|
|
9346
|
+
}
|
|
9347
|
+
if (delta.gCounters) {
|
|
9348
|
+
Object.assign(mergedDelta.gCounters, delta.gCounters);
|
|
9349
|
+
}
|
|
9350
|
+
if (delta.pnCounters) {
|
|
9351
|
+
Object.assign(mergedDelta.pnCounters, delta.pnCounters);
|
|
9352
|
+
}
|
|
9353
|
+
if (delta.sets) {
|
|
9354
|
+
Object.assign(mergedDelta.sets, delta.sets);
|
|
9355
|
+
}
|
|
9356
|
+
}
|
|
9357
|
+
if (Object.keys(mergedDelta.registers).length === 0) {
|
|
9358
|
+
delete mergedDelta.registers;
|
|
9359
|
+
}
|
|
9360
|
+
if (Object.keys(mergedDelta.gCounters).length === 0) {
|
|
9361
|
+
delete mergedDelta.gCounters;
|
|
9362
|
+
}
|
|
9363
|
+
if (Object.keys(mergedDelta.pnCounters).length === 0) {
|
|
9364
|
+
delete mergedDelta.pnCounters;
|
|
9365
|
+
}
|
|
9366
|
+
if (Object.keys(mergedDelta.sets).length === 0) {
|
|
9367
|
+
delete mergedDelta.sets;
|
|
9368
|
+
}
|
|
9369
|
+
return mergedDelta;
|
|
9370
|
+
},
|
|
9371
|
+
applyDelta(delta) {
|
|
9372
|
+
if (delta.registers) {
|
|
9373
|
+
for (const [key, state2] of Object.entries(delta.registers)) {
|
|
9374
|
+
if (!registers.has(key)) {
|
|
9375
|
+
registers.set(
|
|
9376
|
+
key,
|
|
9377
|
+
createLWWRegisterFromState(nodeId, state2)
|
|
9378
|
+
);
|
|
9379
|
+
} else {
|
|
9380
|
+
registers.get(key).applyState(state2);
|
|
9381
|
+
}
|
|
9382
|
+
recordChange("registers", key);
|
|
9383
|
+
emitChange(key, "lww-register", "merge");
|
|
9384
|
+
}
|
|
9385
|
+
}
|
|
9386
|
+
if (delta.gCounters) {
|
|
9387
|
+
for (const [key, state2] of Object.entries(delta.gCounters)) {
|
|
9388
|
+
if (!gCounters.has(key)) {
|
|
9389
|
+
gCounters.set(key, createGCounterFromState(nodeId, state2));
|
|
9390
|
+
} else {
|
|
9391
|
+
gCounters.get(key).applyState(state2);
|
|
9392
|
+
}
|
|
9393
|
+
recordChange("gCounters", key);
|
|
9394
|
+
emitChange(key, "g-counter", "merge");
|
|
9395
|
+
}
|
|
9396
|
+
}
|
|
9397
|
+
if (delta.pnCounters) {
|
|
9398
|
+
for (const [key, state2] of Object.entries(delta.pnCounters)) {
|
|
9399
|
+
if (!pnCounters.has(key)) {
|
|
9400
|
+
pnCounters.set(key, createPNCounterFromState(nodeId, state2));
|
|
9401
|
+
} else {
|
|
9402
|
+
pnCounters.get(key).applyState(state2);
|
|
9403
|
+
}
|
|
9404
|
+
recordChange("pnCounters", key);
|
|
9405
|
+
emitChange(key, "pn-counter", "merge");
|
|
9406
|
+
}
|
|
9407
|
+
}
|
|
9408
|
+
if (delta.sets) {
|
|
9409
|
+
for (const [key, state2] of Object.entries(delta.sets)) {
|
|
9410
|
+
if (!sets.has(key)) {
|
|
9411
|
+
sets.set(
|
|
9412
|
+
key,
|
|
9413
|
+
createORSetFromState(nodeId, state2)
|
|
9414
|
+
);
|
|
9415
|
+
} else {
|
|
9416
|
+
sets.get(key).applyState(state2);
|
|
9417
|
+
}
|
|
9418
|
+
recordChange("sets", key);
|
|
9419
|
+
emitChange(key, "or-set", "merge");
|
|
9420
|
+
}
|
|
9421
|
+
}
|
|
9422
|
+
version = Math.max(version, delta.toVersion) + 1;
|
|
9423
|
+
},
|
|
9424
|
+
getVersion() {
|
|
9425
|
+
return version;
|
|
9426
|
+
},
|
|
9427
|
+
getNodeId() {
|
|
9428
|
+
return nodeId;
|
|
9429
|
+
},
|
|
9430
|
+
// -------------------------------------------------------------------------
|
|
9431
|
+
// Events
|
|
9432
|
+
// -------------------------------------------------------------------------
|
|
9433
|
+
on(event, callback) {
|
|
9434
|
+
if (event === "change") {
|
|
9435
|
+
changeListeners.add(callback);
|
|
9436
|
+
return () => {
|
|
9437
|
+
changeListeners.delete(callback);
|
|
9438
|
+
};
|
|
9439
|
+
}
|
|
9440
|
+
throw new Error(`Unknown event type: ${event}`);
|
|
9441
|
+
},
|
|
9442
|
+
removeAllListeners() {
|
|
9443
|
+
changeListeners.clear();
|
|
9444
|
+
},
|
|
9445
|
+
// -------------------------------------------------------------------------
|
|
9446
|
+
// Utilities
|
|
9447
|
+
// -------------------------------------------------------------------------
|
|
9448
|
+
keys(type) {
|
|
9449
|
+
const allKeys = [];
|
|
9450
|
+
if (!type || type === "lww-register") {
|
|
9451
|
+
allKeys.push(...Array.from(registers.keys()));
|
|
9452
|
+
}
|
|
9453
|
+
if (!type || type === "g-counter") {
|
|
9454
|
+
allKeys.push(...Array.from(gCounters.keys()));
|
|
9455
|
+
}
|
|
9456
|
+
if (!type || type === "pn-counter") {
|
|
9457
|
+
allKeys.push(...Array.from(pnCounters.keys()));
|
|
9458
|
+
}
|
|
9459
|
+
if (!type || type === "or-set") {
|
|
9460
|
+
allKeys.push(...Array.from(sets.keys()));
|
|
9461
|
+
}
|
|
9462
|
+
return allKeys;
|
|
9463
|
+
},
|
|
9464
|
+
clear() {
|
|
9465
|
+
registers.clear();
|
|
9466
|
+
gCounters.clear();
|
|
9467
|
+
pnCounters.clear();
|
|
9468
|
+
sets.clear();
|
|
9469
|
+
deltaHistory.length = 0;
|
|
9470
|
+
pendingChanges.registers.clear();
|
|
9471
|
+
pendingChanges.gCounters.clear();
|
|
9472
|
+
pendingChanges.pnCounters.clear();
|
|
9473
|
+
pendingChanges.sets.clear();
|
|
9474
|
+
version = 0;
|
|
9475
|
+
},
|
|
9476
|
+
getStats() {
|
|
9477
|
+
return {
|
|
9478
|
+
total: registers.size + gCounters.size + pnCounters.size + sets.size,
|
|
9479
|
+
registers: registers.size,
|
|
9480
|
+
gCounters: gCounters.size,
|
|
9481
|
+
pnCounters: pnCounters.size,
|
|
9482
|
+
sets: sets.size,
|
|
9483
|
+
version,
|
|
9484
|
+
nodeId,
|
|
9485
|
+
deltaHistorySize: deltaHistory.length
|
|
9486
|
+
};
|
|
9487
|
+
}
|
|
9488
|
+
};
|
|
9489
|
+
return store;
|
|
9490
|
+
}
|
|
9491
|
+
|
|
9492
|
+
// src/kernel/unified-memory.ts
|
|
9493
|
+
function findProjectRoot(startDir = process.cwd()) {
|
|
9494
|
+
let dir = startDir;
|
|
9495
|
+
const root = path.parse(dir).root;
|
|
9496
|
+
while (dir !== root) {
|
|
9497
|
+
if (fs.existsSync(path.join(dir, "package.json")) || fs.existsSync(path.join(dir, ".git"))) {
|
|
9498
|
+
return dir;
|
|
9499
|
+
}
|
|
9500
|
+
dir = path.dirname(dir);
|
|
9501
|
+
}
|
|
9502
|
+
return process.cwd();
|
|
9503
|
+
}
|
|
9504
|
+
function getDefaultDbPath() {
|
|
9505
|
+
const projectRoot = findProjectRoot();
|
|
9506
|
+
return path.join(projectRoot, ".agentic-qe", "memory.db");
|
|
9507
|
+
}
|
|
8627
9508
|
var DEFAULT_UNIFIED_MEMORY_CONFIG = {
|
|
8628
9509
|
dbPath: ".agentic-qe/memory.db",
|
|
8629
|
-
//
|
|
9510
|
+
// Resolved to project root at runtime
|
|
8630
9511
|
walMode: true,
|
|
8631
9512
|
mmapSize: MEMORY_CONSTANTS.MMAP_SIZE_BYTES,
|
|
8632
9513
|
cacheSize: MEMORY_CONSTANTS.CACHE_SIZE_KB,
|
|
8633
9514
|
busyTimeout: MEMORY_CONSTANTS.BUSY_TIMEOUT_MS,
|
|
8634
9515
|
vectorDimensions: MEMORY_CONSTANTS.DEFAULT_VECTOR_DIMENSIONS
|
|
8635
9516
|
};
|
|
9517
|
+
function getResolvedDefaultConfig() {
|
|
9518
|
+
return {
|
|
9519
|
+
...DEFAULT_UNIFIED_MEMORY_CONFIG,
|
|
9520
|
+
dbPath: getDefaultDbPath()
|
|
9521
|
+
};
|
|
9522
|
+
}
|
|
8636
9523
|
var SCHEMA_VERSION = 7;
|
|
8637
9524
|
var SCHEMA_VERSION_TABLE = `
|
|
8638
9525
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
@@ -9160,8 +10047,11 @@ var UnifiedMemoryManager = class _UnifiedMemoryManager {
|
|
|
9160
10047
|
initPromise = null;
|
|
9161
10048
|
preparedStatements = /* @__PURE__ */ new Map();
|
|
9162
10049
|
vectorIndex = new InMemoryHNSWIndex();
|
|
10050
|
+
// CRDT store for distributed state synchronization
|
|
10051
|
+
crdtStore = null;
|
|
9163
10052
|
constructor(config) {
|
|
9164
|
-
|
|
10053
|
+
const resolvedDefaults = getResolvedDefaultConfig();
|
|
10054
|
+
this.config = { ...resolvedDefaults, ...config };
|
|
9165
10055
|
}
|
|
9166
10056
|
/**
|
|
9167
10057
|
* Get or create the singleton instance (synchronous).
|
|
@@ -9514,6 +10404,199 @@ var UnifiedMemoryManager = class _UnifiedMemoryManager {
|
|
|
9514
10404
|
return row.count;
|
|
9515
10405
|
}
|
|
9516
10406
|
// ============================================================================
|
|
10407
|
+
// CRDT Operations (distributed state synchronization)
|
|
10408
|
+
// ============================================================================
|
|
10409
|
+
/**
|
|
10410
|
+
* Initialize CRDT store for distributed state synchronization.
|
|
10411
|
+
* Call this with a unique node ID for each agent/node in the cluster.
|
|
10412
|
+
*
|
|
10413
|
+
* @param nodeId - Unique identifier for this node (e.g., 'agent-001', 'mcp-server-1')
|
|
10414
|
+
*/
|
|
10415
|
+
initializeCRDT(nodeId) {
|
|
10416
|
+
if (this.crdtStore) {
|
|
10417
|
+
console.warn("[UnifiedMemory] CRDT store already initialized");
|
|
10418
|
+
return;
|
|
10419
|
+
}
|
|
10420
|
+
this.crdtStore = createCRDTStore({ nodeId });
|
|
10421
|
+
console.log(`[UnifiedMemory] CRDT store initialized for node: ${nodeId}`);
|
|
10422
|
+
}
|
|
10423
|
+
/**
|
|
10424
|
+
* Get the CRDT store instance.
|
|
10425
|
+
* Returns null if CRDT has not been initialized.
|
|
10426
|
+
*/
|
|
10427
|
+
getCRDTStore() {
|
|
10428
|
+
return this.crdtStore;
|
|
10429
|
+
}
|
|
10430
|
+
/**
|
|
10431
|
+
* Check if CRDT is initialized
|
|
10432
|
+
*/
|
|
10433
|
+
isCRDTInitialized() {
|
|
10434
|
+
return this.crdtStore !== null;
|
|
10435
|
+
}
|
|
10436
|
+
/**
|
|
10437
|
+
* Set a value in both CRDT store and KV store for durability.
|
|
10438
|
+
* The CRDT store provides conflict-free merge semantics,
|
|
10439
|
+
* while the KV store provides persistence.
|
|
10440
|
+
*
|
|
10441
|
+
* @param key - Key to store
|
|
10442
|
+
* @param value - Value to store
|
|
10443
|
+
* @param namespace - Optional namespace (default: 'crdt')
|
|
10444
|
+
*/
|
|
10445
|
+
async crdtSet(key, value, namespace = "crdt") {
|
|
10446
|
+
this.ensureInitialized();
|
|
10447
|
+
if (this.crdtStore) {
|
|
10448
|
+
this.crdtStore.setRegister(key, value);
|
|
10449
|
+
}
|
|
10450
|
+
await this.kvSet(key, value, namespace);
|
|
10451
|
+
}
|
|
10452
|
+
/**
|
|
10453
|
+
* Get a value from CRDT store (or fallback to KV store)
|
|
10454
|
+
*
|
|
10455
|
+
* @param key - Key to retrieve
|
|
10456
|
+
* @param namespace - Optional namespace (default: 'crdt')
|
|
10457
|
+
*/
|
|
10458
|
+
async crdtGet(key, namespace = "crdt") {
|
|
10459
|
+
if (this.crdtStore) {
|
|
10460
|
+
const register = this.crdtStore.getRegister(key);
|
|
10461
|
+
if (register) {
|
|
10462
|
+
return register.get();
|
|
10463
|
+
}
|
|
10464
|
+
}
|
|
10465
|
+
return this.kvGet(key, namespace);
|
|
10466
|
+
}
|
|
10467
|
+
/**
|
|
10468
|
+
* Increment a distributed counter (CRDT G-Counter)
|
|
10469
|
+
*
|
|
10470
|
+
* @param key - Counter key
|
|
10471
|
+
* @param amount - Amount to increment (default: 1)
|
|
10472
|
+
*/
|
|
10473
|
+
crdtIncrement(key, amount = 1) {
|
|
10474
|
+
if (!this.crdtStore) {
|
|
10475
|
+
throw new Error("CRDT store not initialized. Call initializeCRDT first.");
|
|
10476
|
+
}
|
|
10477
|
+
let counter = this.crdtStore.getCounter(key);
|
|
10478
|
+
if (!counter) {
|
|
10479
|
+
this.crdtStore.incrementCounter(key, 0);
|
|
10480
|
+
counter = this.crdtStore.getCounter(key);
|
|
10481
|
+
}
|
|
10482
|
+
for (let i = 0; i < amount; i++) {
|
|
10483
|
+
this.crdtStore.incrementCounter(key);
|
|
10484
|
+
}
|
|
10485
|
+
}
|
|
10486
|
+
/**
|
|
10487
|
+
* Get distributed counter value
|
|
10488
|
+
*
|
|
10489
|
+
* @param key - Counter key
|
|
10490
|
+
*/
|
|
10491
|
+
crdtGetCounter(key) {
|
|
10492
|
+
if (!this.crdtStore) {
|
|
10493
|
+
return 0;
|
|
10494
|
+
}
|
|
10495
|
+
const counter = this.crdtStore.getCounter(key);
|
|
10496
|
+
return counter?.get() ?? 0;
|
|
10497
|
+
}
|
|
10498
|
+
/**
|
|
10499
|
+
* Add item to distributed set (CRDT OR-Set)
|
|
10500
|
+
*
|
|
10501
|
+
* @param key - Set key
|
|
10502
|
+
* @param item - Item to add
|
|
10503
|
+
*/
|
|
10504
|
+
crdtAddToSet(key, item) {
|
|
10505
|
+
if (!this.crdtStore) {
|
|
10506
|
+
throw new Error("CRDT store not initialized. Call initializeCRDT first.");
|
|
10507
|
+
}
|
|
10508
|
+
this.crdtStore.addToSet(key, item);
|
|
10509
|
+
}
|
|
10510
|
+
/**
|
|
10511
|
+
* Remove item from distributed set
|
|
10512
|
+
*
|
|
10513
|
+
* @param key - Set key
|
|
10514
|
+
* @param item - Item to remove
|
|
10515
|
+
*/
|
|
10516
|
+
crdtRemoveFromSet(key, item) {
|
|
10517
|
+
if (!this.crdtStore) {
|
|
10518
|
+
throw new Error("CRDT store not initialized. Call initializeCRDT first.");
|
|
10519
|
+
}
|
|
10520
|
+
this.crdtStore.removeFromSet(key, item);
|
|
10521
|
+
}
|
|
10522
|
+
/**
|
|
10523
|
+
* Get all items from distributed set
|
|
10524
|
+
*
|
|
10525
|
+
* @param key - Set key
|
|
10526
|
+
*/
|
|
10527
|
+
crdtGetSet(key) {
|
|
10528
|
+
if (!this.crdtStore) {
|
|
10529
|
+
return /* @__PURE__ */ new Set();
|
|
10530
|
+
}
|
|
10531
|
+
const orSet = this.crdtStore.getSet(key);
|
|
10532
|
+
return new Set(orSet.values());
|
|
10533
|
+
}
|
|
10534
|
+
/**
|
|
10535
|
+
* Get the current CRDT state for replication
|
|
10536
|
+
*/
|
|
10537
|
+
crdtGetState() {
|
|
10538
|
+
if (!this.crdtStore) {
|
|
10539
|
+
return null;
|
|
10540
|
+
}
|
|
10541
|
+
return this.crdtStore.getState();
|
|
10542
|
+
}
|
|
10543
|
+
/**
|
|
10544
|
+
* Get a delta of changes since a given version
|
|
10545
|
+
*/
|
|
10546
|
+
crdtGetDelta(sinceVersion) {
|
|
10547
|
+
if (!this.crdtStore) {
|
|
10548
|
+
return null;
|
|
10549
|
+
}
|
|
10550
|
+
return this.crdtStore.getDelta(sinceVersion ?? 0);
|
|
10551
|
+
}
|
|
10552
|
+
/**
|
|
10553
|
+
* Merge remote CRDT state into local store.
|
|
10554
|
+
* This operation is commutative, associative, and idempotent.
|
|
10555
|
+
*
|
|
10556
|
+
* @param remoteState - State from another node
|
|
10557
|
+
*/
|
|
10558
|
+
crdtMerge(remoteState) {
|
|
10559
|
+
if (!this.crdtStore) {
|
|
10560
|
+
throw new Error("CRDT store not initialized. Call initializeCRDT first.");
|
|
10561
|
+
}
|
|
10562
|
+
this.crdtStore.applyState(remoteState);
|
|
10563
|
+
}
|
|
10564
|
+
/**
|
|
10565
|
+
* Apply a delta from another node
|
|
10566
|
+
*
|
|
10567
|
+
* @param delta - Delta changes from another node
|
|
10568
|
+
*/
|
|
10569
|
+
crdtApplyDelta(delta) {
|
|
10570
|
+
if (!this.crdtStore) {
|
|
10571
|
+
throw new Error("CRDT store not initialized. Call initializeCRDT first.");
|
|
10572
|
+
}
|
|
10573
|
+
this.crdtStore.applyDelta(delta);
|
|
10574
|
+
}
|
|
10575
|
+
/**
|
|
10576
|
+
* Persist current CRDT state to KV store for recovery
|
|
10577
|
+
*/
|
|
10578
|
+
async crdtPersist() {
|
|
10579
|
+
if (!this.crdtStore) {
|
|
10580
|
+
return;
|
|
10581
|
+
}
|
|
10582
|
+
const state2 = this.crdtStore.getState();
|
|
10583
|
+
await this.kvSet("__crdt_state__", state2, "crdt-internal");
|
|
10584
|
+
}
|
|
10585
|
+
/**
|
|
10586
|
+
* Restore CRDT state from KV store
|
|
10587
|
+
*/
|
|
10588
|
+
async crdtRestore() {
|
|
10589
|
+
if (!this.crdtStore) {
|
|
10590
|
+
return false;
|
|
10591
|
+
}
|
|
10592
|
+
const state2 = await this.kvGet("__crdt_state__", "crdt-internal");
|
|
10593
|
+
if (state2) {
|
|
10594
|
+
this.crdtStore.applyState(state2);
|
|
10595
|
+
return true;
|
|
10596
|
+
}
|
|
10597
|
+
return false;
|
|
10598
|
+
}
|
|
10599
|
+
// ============================================================================
|
|
9517
10600
|
// Raw Database Access (for advanced operations)
|
|
9518
10601
|
// ============================================================================
|
|
9519
10602
|
/**
|
|
@@ -12130,7 +13213,7 @@ var TestDataGeneratorService = class {
|
|
|
12130
13213
|
};
|
|
12131
13214
|
|
|
12132
13215
|
// src/domains/test-generation/services/test-generator.ts
|
|
12133
|
-
var
|
|
13216
|
+
var DEFAULT_CONFIG2 = {
|
|
12134
13217
|
defaultFramework: "vitest",
|
|
12135
13218
|
maxTestsPerFile: 50,
|
|
12136
13219
|
coverageTargetDefault: 80,
|
|
@@ -12150,7 +13233,7 @@ var TestGeneratorService = class {
|
|
|
12150
13233
|
testDataGenerator;
|
|
12151
13234
|
llmRouter;
|
|
12152
13235
|
constructor(dependencies, config = {}) {
|
|
12153
|
-
this.config = { ...
|
|
13236
|
+
this.config = { ...DEFAULT_CONFIG2, ...config };
|
|
12154
13237
|
this.memory = dependencies.memory;
|
|
12155
13238
|
this.generatorFactory = dependencies.generatorFactory || new TestGeneratorFactory();
|
|
12156
13239
|
this.tddGenerator = dependencies.tddGenerator || new TDDGeneratorService();
|
|
@@ -12742,7 +13825,7 @@ import { v4 as uuidv44 } from "uuid";
|
|
|
12742
13825
|
import * as ts2 from "typescript";
|
|
12743
13826
|
import * as fs3 from "fs";
|
|
12744
13827
|
import * as path3 from "path";
|
|
12745
|
-
var
|
|
13828
|
+
var DEFAULT_CONFIG3 = {
|
|
12746
13829
|
maxPatterns: 100,
|
|
12747
13830
|
minMatchScore: 0.5,
|
|
12748
13831
|
enableVectorSearch: true,
|
|
@@ -12752,7 +13835,7 @@ var DEFAULT_CONFIG2 = {
|
|
|
12752
13835
|
var PatternMatcherService = class {
|
|
12753
13836
|
constructor(memory, config = {}) {
|
|
12754
13837
|
this.memory = memory;
|
|
12755
|
-
this.config = { ...
|
|
13838
|
+
this.config = { ...DEFAULT_CONFIG3, ...config };
|
|
12756
13839
|
this.tsParser = new TypeScriptASTParser();
|
|
12757
13840
|
this.embedder = config.embedder ?? new NomicEmbedder({ enableFallback: true });
|
|
12758
13841
|
}
|
|
@@ -17995,7 +19078,7 @@ function createTestGenerationCoherenceGate(coherenceService, embeddingService, c
|
|
|
17995
19078
|
}
|
|
17996
19079
|
|
|
17997
19080
|
// src/domains/test-generation/coordinator.ts
|
|
17998
|
-
var
|
|
19081
|
+
var DEFAULT_CONFIG6 = {
|
|
17999
19082
|
maxConcurrentWorkflows: 5,
|
|
18000
19083
|
defaultTimeout: 6e4,
|
|
18001
19084
|
// 60 seconds
|
|
@@ -18027,7 +19110,7 @@ var TestGenerationCoordinator = class {
|
|
|
18027
19110
|
this.memory = memory;
|
|
18028
19111
|
this.agentCoordinator = agentCoordinator;
|
|
18029
19112
|
this.coherenceService = coherenceService;
|
|
18030
|
-
this.config = { ...
|
|
19113
|
+
this.config = { ...DEFAULT_CONFIG6, ...config };
|
|
18031
19114
|
this.testGenerator = createTestGeneratorService(memory);
|
|
18032
19115
|
this.patternMatcher = new PatternMatcherService(memory);
|
|
18033
19116
|
if (this.config.enableCoherenceGate && coherenceService) {
|
|
@@ -19869,7 +20952,7 @@ var LLM_ANALYSIS_CONSTANTS = {
|
|
|
19869
20952
|
};
|
|
19870
20953
|
|
|
19871
20954
|
// src/domains/test-execution/services/test-executor.ts
|
|
19872
|
-
var
|
|
20955
|
+
var DEFAULT_CONFIG7 = {
|
|
19873
20956
|
simulateForTesting: false,
|
|
19874
20957
|
simulatedTestsPerFile: 5,
|
|
19875
20958
|
simulatedFailureRate: 0.2,
|
|
@@ -19893,7 +20976,7 @@ var TestExecutorService = class {
|
|
|
19893
20976
|
constructor(dependencies, config = {}) {
|
|
19894
20977
|
this.memory = dependencies.memory;
|
|
19895
20978
|
this.llmRouter = dependencies.llmRouter;
|
|
19896
|
-
this.config = { ...
|
|
20979
|
+
this.config = { ...DEFAULT_CONFIG7, ...config };
|
|
19897
20980
|
}
|
|
19898
20981
|
/**
|
|
19899
20982
|
* Execute a test suite sequentially
|
|
@@ -22057,7 +23140,7 @@ function createTestPrioritizationState(testId, metadata) {
|
|
|
22057
23140
|
}
|
|
22058
23141
|
|
|
22059
23142
|
// src/domains/test-execution/services/test-prioritizer.ts
|
|
22060
|
-
var
|
|
23143
|
+
var DEFAULT_CONFIG8 = {
|
|
22061
23144
|
enableDT: true,
|
|
22062
23145
|
minTrajectoriesForDT: 5,
|
|
22063
23146
|
enableHeuristicFallback: true,
|
|
@@ -22070,7 +23153,7 @@ var DEFAULT_CONFIG7 = {
|
|
|
22070
23153
|
var TestPrioritizerService = class {
|
|
22071
23154
|
constructor(memory, config = {}) {
|
|
22072
23155
|
this.memory = memory;
|
|
22073
|
-
this.config = { ...
|
|
23156
|
+
this.config = { ...DEFAULT_CONFIG8, ...config };
|
|
22074
23157
|
this.decisionTransformer = new DecisionTransformerAlgorithm({
|
|
22075
23158
|
contextLength: this.config.contextLength,
|
|
22076
23159
|
embeddingDim: this.config.embeddingDim
|
|
@@ -27334,7 +28417,7 @@ init_types();
|
|
|
27334
28417
|
|
|
27335
28418
|
// src/domains/coverage-analysis/services/coverage-analyzer.ts
|
|
27336
28419
|
init_types();
|
|
27337
|
-
var
|
|
28420
|
+
var DEFAULT_CONFIG9 = {
|
|
27338
28421
|
defaultThreshold: 80,
|
|
27339
28422
|
enableLLMAnalysis: true,
|
|
27340
28423
|
// On by default - opt-out
|
|
@@ -27354,7 +28437,7 @@ var CoverageAnalyzerService = class _CoverageAnalyzerService {
|
|
|
27354
28437
|
* @param config - Optional configuration overrides
|
|
27355
28438
|
*/
|
|
27356
28439
|
constructor(memoryOrDependencies, config = {}) {
|
|
27357
|
-
this.config = { ...
|
|
28440
|
+
this.config = { ...DEFAULT_CONFIG9, ...config };
|
|
27358
28441
|
if (this.isMemoryBackend(memoryOrDependencies)) {
|
|
27359
28442
|
this.memory = memoryOrDependencies;
|
|
27360
28443
|
this.llmRouter = void 0;
|
|
@@ -27866,7 +28949,7 @@ ${truncatedSource}
|
|
|
27866
28949
|
|
|
27867
28950
|
// src/domains/coverage-analysis/services/gap-detector.ts
|
|
27868
28951
|
init_types();
|
|
27869
|
-
var
|
|
28952
|
+
var DEFAULT_CONFIG10 = {
|
|
27870
28953
|
minCoverage: 80,
|
|
27871
28954
|
enableLLMAnalysis: true,
|
|
27872
28955
|
// On by default - opt-out
|
|
@@ -27891,11 +28974,11 @@ var GapDetectorService = class _GapDetectorService {
|
|
|
27891
28974
|
if ("memory" in dependenciesOrMemory) {
|
|
27892
28975
|
this.memory = dependenciesOrMemory.memory;
|
|
27893
28976
|
this.llmRouter = dependenciesOrMemory.llmRouter;
|
|
27894
|
-
this.config = { ...
|
|
28977
|
+
this.config = { ...DEFAULT_CONFIG10, ...config };
|
|
27895
28978
|
} else {
|
|
27896
28979
|
this.memory = dependenciesOrMemory;
|
|
27897
28980
|
this.llmRouter = void 0;
|
|
27898
|
-
this.config = { ...
|
|
28981
|
+
this.config = { ...DEFAULT_CONFIG10 };
|
|
27899
28982
|
}
|
|
27900
28983
|
}
|
|
27901
28984
|
// ============================================================================
|
|
@@ -29608,7 +30691,7 @@ var QLearningAlgorithm = class extends BaseRLAlgorithm {
|
|
|
29608
30691
|
|
|
29609
30692
|
// src/domains/coverage-analysis/coordinator.ts
|
|
29610
30693
|
import { v4 as uuidv411 } from "uuid";
|
|
29611
|
-
var
|
|
30694
|
+
var DEFAULT_CONFIG11 = {
|
|
29612
30695
|
// MinCut integration defaults (ADR-047)
|
|
29613
30696
|
enableMinCutAwareness: true,
|
|
29614
30697
|
topologyHealthThreshold: 0.5,
|
|
@@ -29623,7 +30706,7 @@ var CoverageAnalysisCoordinator = class {
|
|
|
29623
30706
|
constructor(eventBus, memory, config = {}) {
|
|
29624
30707
|
this.eventBus = eventBus;
|
|
29625
30708
|
this.memory = memory;
|
|
29626
|
-
this.config = { ...
|
|
30709
|
+
this.config = { ...DEFAULT_CONFIG11, ...config };
|
|
29627
30710
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
29628
30711
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
29629
30712
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -30647,7 +31730,7 @@ import { v4 as uuidv415 } from "uuid";
|
|
|
30647
31730
|
// src/domains/quality-assessment/services/quality-gate.ts
|
|
30648
31731
|
init_types();
|
|
30649
31732
|
import { v4 as uuidv412 } from "uuid";
|
|
30650
|
-
var
|
|
31733
|
+
var DEFAULT_CONFIG12 = {
|
|
30651
31734
|
strictMode: false,
|
|
30652
31735
|
enableWarnings: true,
|
|
30653
31736
|
defaultSeverities: {
|
|
@@ -30692,7 +31775,7 @@ var DEFAULT_PRESETS = {
|
|
|
30692
31775
|
var QualityGateService = class {
|
|
30693
31776
|
constructor(memory, config = {}) {
|
|
30694
31777
|
this.memory = memory;
|
|
30695
|
-
this.config = { ...
|
|
31778
|
+
this.config = { ...DEFAULT_CONFIG12, ...config };
|
|
30696
31779
|
for (const [name, thresholds] of Object.entries(DEFAULT_PRESETS)) {
|
|
30697
31780
|
this.presets.set(name, thresholds);
|
|
30698
31781
|
}
|
|
@@ -31530,7 +32613,7 @@ function getSystemMetricsCollector() {
|
|
|
31530
32613
|
}
|
|
31531
32614
|
|
|
31532
32615
|
// src/domains/quality-assessment/services/quality-analyzer.ts
|
|
31533
|
-
var
|
|
32616
|
+
var DEFAULT_CONFIG13 = {
|
|
31534
32617
|
enableTrendAnalysis: true,
|
|
31535
32618
|
trendDataPointsMin: 3,
|
|
31536
32619
|
complexityThresholds: {
|
|
@@ -31565,7 +32648,7 @@ var QualityAnalyzerService = class {
|
|
|
31565
32648
|
* 2. New: (dependencies: QualityAnalyzerDependencies, config?: Partial<QualityAnalyzerConfig>)
|
|
31566
32649
|
*/
|
|
31567
32650
|
constructor(memoryOrDependencies, config = {}) {
|
|
31568
|
-
this.config = { ...
|
|
32651
|
+
this.config = { ...DEFAULT_CONFIG13, ...config };
|
|
31569
32652
|
this.metricsAnalyzer = getCodeMetricsAnalyzer();
|
|
31570
32653
|
if ("memory" in memoryOrDependencies) {
|
|
31571
32654
|
this.memory = memoryOrDependencies.memory;
|
|
@@ -32194,7 +33277,7 @@ ${codeContext.slice(0, 2e3)}
|
|
|
32194
33277
|
// src/domains/quality-assessment/services/deployment-advisor.ts
|
|
32195
33278
|
init_types();
|
|
32196
33279
|
import { v4 as uuidv414 } from "uuid";
|
|
32197
|
-
var
|
|
33280
|
+
var DEFAULT_CONFIG14 = {
|
|
32198
33281
|
riskWeights: {
|
|
32199
33282
|
coverage: 0.15,
|
|
32200
33283
|
testsPassing: 0.2,
|
|
@@ -32224,7 +33307,7 @@ var DeploymentAdvisorService = class {
|
|
|
32224
33307
|
memory;
|
|
32225
33308
|
llmRouter;
|
|
32226
33309
|
constructor(dependencies, config = {}) {
|
|
32227
|
-
this.config = { ...
|
|
33310
|
+
this.config = { ...DEFAULT_CONFIG14, ...config };
|
|
32228
33311
|
if ("memory" in dependencies) {
|
|
32229
33312
|
this.memory = dependencies.memory;
|
|
32230
33313
|
this.llmRouter = dependencies.llmRouter;
|
|
@@ -32986,7 +34069,7 @@ var STRICT_VERIFICATION_TYPES = [
|
|
|
32986
34069
|
|
|
32987
34070
|
// src/agents/claim-verifier/verifiers/file-verifier.ts
|
|
32988
34071
|
import { readFile as readFile3, stat as stat2 } from "node:fs/promises";
|
|
32989
|
-
import { join as
|
|
34072
|
+
import { join as join3 } from "node:path";
|
|
32990
34073
|
import fg from "fast-glob";
|
|
32991
34074
|
var FileBasedVerifier = class {
|
|
32992
34075
|
config;
|
|
@@ -33140,7 +34223,7 @@ var FileBasedVerifier = class {
|
|
|
33140
34223
|
const evidence = [];
|
|
33141
34224
|
let passed = 0;
|
|
33142
34225
|
for (const filePath of filePaths) {
|
|
33143
|
-
const fullPath =
|
|
34226
|
+
const fullPath = join3(this.config.rootDir, filePath);
|
|
33144
34227
|
try {
|
|
33145
34228
|
const stats = await stat2(fullPath);
|
|
33146
34229
|
const exists = stats.isFile();
|
|
@@ -33234,7 +34317,7 @@ var FileBasedVerifier = class {
|
|
|
33234
34317
|
for (const ev of existingEvidence) {
|
|
33235
34318
|
if (ev.type === "file-reference" || ev.type === "code-snippet") {
|
|
33236
34319
|
const filePath = ev.location.split(":")[0];
|
|
33237
|
-
const fullPath =
|
|
34320
|
+
const fullPath = join3(this.config.rootDir, filePath);
|
|
33238
34321
|
try {
|
|
33239
34322
|
const stats = await stat2(fullPath);
|
|
33240
34323
|
const exists = stats.isFile();
|
|
@@ -33283,7 +34366,7 @@ var FileBasedVerifier = class {
|
|
|
33283
34366
|
import { exec as exec2 } from "node:child_process";
|
|
33284
34367
|
import { promisify as promisify2 } from "node:util";
|
|
33285
34368
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
33286
|
-
import { join as
|
|
34369
|
+
import { join as join4 } from "node:path";
|
|
33287
34370
|
var execAsync2 = promisify2(exec2);
|
|
33288
34371
|
var TestBasedVerifier = class {
|
|
33289
34372
|
config;
|
|
@@ -33571,7 +34654,7 @@ var TestBasedVerifier = class {
|
|
|
33571
34654
|
* Get coverage data from report.
|
|
33572
34655
|
*/
|
|
33573
34656
|
async getCoverageData() {
|
|
33574
|
-
const reportPath =
|
|
34657
|
+
const reportPath = join4(this.config.rootDir, this.config.coverageReportPath);
|
|
33575
34658
|
const content = await readFile4(reportPath, "utf-8");
|
|
33576
34659
|
const data = JSON.parse(content);
|
|
33577
34660
|
const total = data.total || data;
|
|
@@ -34378,7 +35461,7 @@ function generateContentHash(content) {
|
|
|
34378
35461
|
}
|
|
34379
35462
|
|
|
34380
35463
|
// src/domains/quality-assessment/coordinator.ts
|
|
34381
|
-
var
|
|
35464
|
+
var DEFAULT_CONFIG15 = {
|
|
34382
35465
|
maxConcurrentWorkflows: 5,
|
|
34383
35466
|
defaultTimeout: 6e4,
|
|
34384
35467
|
publishEvents: true,
|
|
@@ -34403,7 +35486,7 @@ var QualityAssessmentCoordinator = class {
|
|
|
34403
35486
|
this.eventBus = eventBus;
|
|
34404
35487
|
this.memory = memory;
|
|
34405
35488
|
this.agentCoordinator = agentCoordinator;
|
|
34406
|
-
this.config = { ...
|
|
35489
|
+
this.config = { ...DEFAULT_CONFIG15, ...config };
|
|
34407
35490
|
this.qualityGate = new QualityGateService(memory);
|
|
34408
35491
|
this.qualityAnalyzer = new QualityAnalyzerService(memory);
|
|
34409
35492
|
this.deploymentAdvisor = new DeploymentAdvisorService(memory);
|
|
@@ -36416,7 +37499,7 @@ import * as path6 from "path";
|
|
|
36416
37499
|
function sanitizeGitArg(arg) {
|
|
36417
37500
|
return arg.replace(/[;&|`$(){}[\]<>\\'"!\n\r]/g, "");
|
|
36418
37501
|
}
|
|
36419
|
-
var
|
|
37502
|
+
var DEFAULT_CONFIG16 = {
|
|
36420
37503
|
repoRoot: process.cwd(),
|
|
36421
37504
|
maxCommits: 100,
|
|
36422
37505
|
bugKeywords: ["fix", "bug", "patch", "issue", "error", "defect", "problem"],
|
|
@@ -36429,7 +37512,7 @@ var GitAnalyzer = class {
|
|
|
36429
37512
|
cache = /* @__PURE__ */ new Map();
|
|
36430
37513
|
isGitRepo = null;
|
|
36431
37514
|
constructor(config = {}) {
|
|
36432
|
-
this.config = { ...
|
|
37515
|
+
this.config = { ...DEFAULT_CONFIG16, ...config };
|
|
36433
37516
|
}
|
|
36434
37517
|
/**
|
|
36435
37518
|
* Check if current directory is a git repository
|
|
@@ -36943,7 +38026,7 @@ var GitAnalyzer = class {
|
|
|
36943
38026
|
// src/domains/defect-intelligence/services/defect-predictor.ts
|
|
36944
38027
|
init_io();
|
|
36945
38028
|
init_parsers();
|
|
36946
|
-
var
|
|
38029
|
+
var DEFAULT_CONFIG17 = {
|
|
36947
38030
|
defaultThreshold: 0.5,
|
|
36948
38031
|
maxPredictionsPerBatch: 100,
|
|
36949
38032
|
enableHistoricalAnalysis: true,
|
|
@@ -36990,7 +38073,7 @@ var DefectPredictorService = class {
|
|
|
36990
38073
|
* Supports both old signature (memory, config, ...) and new signature (dependencies, config)
|
|
36991
38074
|
*/
|
|
36992
38075
|
constructor(memoryOrDeps, config = {}, gitAnalyzer, fileReader, tsParser) {
|
|
36993
|
-
this.config = { ...
|
|
38076
|
+
this.config = { ...DEFAULT_CONFIG17, ...config };
|
|
36994
38077
|
if (this.isDependenciesObject(memoryOrDeps)) {
|
|
36995
38078
|
this.memory = memoryOrDeps.memory;
|
|
36996
38079
|
this.gitAnalyzer = memoryOrDeps.gitAnalyzer ?? new GitAnalyzer({ enableCache: true });
|
|
@@ -37760,7 +38843,7 @@ ${fileResult.value.slice(0, 2e3)}
|
|
|
37760
38843
|
init_types();
|
|
37761
38844
|
init_embeddings();
|
|
37762
38845
|
import { v4 as uuidv417 } from "uuid";
|
|
37763
|
-
var
|
|
38846
|
+
var DEFAULT_CONFIG18 = {
|
|
37764
38847
|
minPatternFrequency: 2,
|
|
37765
38848
|
maxPatterns: 50,
|
|
37766
38849
|
clusterThreshold: 0.7,
|
|
@@ -37807,7 +38890,7 @@ var KNOWN_PATTERNS = {
|
|
|
37807
38890
|
var PatternLearnerService = class {
|
|
37808
38891
|
constructor(memory, config = {}) {
|
|
37809
38892
|
this.memory = memory;
|
|
37810
|
-
this.config = { ...
|
|
38893
|
+
this.config = { ...DEFAULT_CONFIG18, ...config };
|
|
37811
38894
|
this.embedder = config.embedder ?? new NomicEmbedder({ enableFallback: true });
|
|
37812
38895
|
if (this.config.enableFlashAttention) {
|
|
37813
38896
|
this.initializeFlashAttention();
|
|
@@ -38398,7 +39481,7 @@ var PatternLearnerService = class {
|
|
|
38398
39481
|
|
|
38399
39482
|
// src/domains/defect-intelligence/services/root-cause-analyzer.ts
|
|
38400
39483
|
init_types();
|
|
38401
|
-
var
|
|
39484
|
+
var DEFAULT_CONFIG19 = {
|
|
38402
39485
|
maxTimelineEvents: 20,
|
|
38403
39486
|
maxRelatedFiles: 10,
|
|
38404
39487
|
minConfidenceThreshold: 0.3,
|
|
@@ -38541,7 +39624,7 @@ var RootCauseAnalyzerService = class {
|
|
|
38541
39624
|
* Supports both old signature (memory, config) and new signature (dependencies, config)
|
|
38542
39625
|
*/
|
|
38543
39626
|
constructor(memoryOrDeps, config = {}) {
|
|
38544
|
-
this.config = { ...
|
|
39627
|
+
this.config = { ...DEFAULT_CONFIG19, ...config };
|
|
38545
39628
|
if (this.isMemoryBackend(memoryOrDeps)) {
|
|
38546
39629
|
this.memory = memoryOrDeps;
|
|
38547
39630
|
this.llmRouter = void 0;
|
|
@@ -39083,7 +40166,7 @@ ${fix.codeExample}
|
|
|
39083
40166
|
};
|
|
39084
40167
|
|
|
39085
40168
|
// src/domains/defect-intelligence/coordinator.ts
|
|
39086
|
-
var
|
|
40169
|
+
var DEFAULT_CONFIG20 = {
|
|
39087
40170
|
maxConcurrentWorkflows: 5,
|
|
39088
40171
|
defaultTimeout: 6e4,
|
|
39089
40172
|
enablePatternLearning: true,
|
|
@@ -39102,7 +40185,7 @@ var DefectIntelligenceCoordinator = class {
|
|
|
39102
40185
|
this.eventBus = eventBus;
|
|
39103
40186
|
this.memory = memory;
|
|
39104
40187
|
this.agentCoordinator = agentCoordinator;
|
|
39105
|
-
this.config = { ...
|
|
40188
|
+
this.config = { ...DEFAULT_CONFIG20, ...config };
|
|
39106
40189
|
this.predictor = new DefectPredictorService(memory);
|
|
39107
40190
|
this.patternLearner = new PatternLearnerService(memory);
|
|
39108
40191
|
this.rootCauseAnalyzer = new RootCauseAnalyzerService(memory);
|
|
@@ -40107,7 +41190,7 @@ import { v4 as uuidv421 } from "uuid";
|
|
|
40107
41190
|
// src/domains/requirements-validation/services/requirements-validator.ts
|
|
40108
41191
|
init_types();
|
|
40109
41192
|
import { v4 as uuidv419 } from "uuid";
|
|
40110
|
-
var
|
|
41193
|
+
var DEFAULT_CONFIG21 = {
|
|
40111
41194
|
enableAmbiguityDetection: true,
|
|
40112
41195
|
minAcceptanceCriteria: 1,
|
|
40113
41196
|
strictMode: false,
|
|
@@ -40150,7 +41233,7 @@ var RequirementsValidatorService = class {
|
|
|
40150
41233
|
memory;
|
|
40151
41234
|
llmRouter;
|
|
40152
41235
|
constructor(dependencies, config = {}) {
|
|
40153
|
-
this.config = { ...
|
|
41236
|
+
this.config = { ...DEFAULT_CONFIG21, ...config };
|
|
40154
41237
|
if ("memory" in dependencies && typeof dependencies.memory === "object") {
|
|
40155
41238
|
this.memory = dependencies.memory;
|
|
40156
41239
|
this.llmRouter = dependencies.llmRouter;
|
|
@@ -40724,7 +41807,7 @@ Please analyze these requirements for:
|
|
|
40724
41807
|
// src/domains/requirements-validation/services/bdd-scenario-writer.ts
|
|
40725
41808
|
init_types();
|
|
40726
41809
|
import { v4 as uuidv420 } from "uuid";
|
|
40727
|
-
var
|
|
41810
|
+
var DEFAULT_CONFIG22 = {
|
|
40728
41811
|
defaultExampleCount: 3,
|
|
40729
41812
|
includeBackgroundScenarios: true,
|
|
40730
41813
|
generateNegativeScenarios: true,
|
|
@@ -40733,7 +41816,7 @@ var DEFAULT_CONFIG21 = {
|
|
|
40733
41816
|
var BDDScenarioWriterService = class {
|
|
40734
41817
|
constructor(memory, config = {}) {
|
|
40735
41818
|
this.memory = memory;
|
|
40736
|
-
this.config = { ...
|
|
41819
|
+
this.config = { ...DEFAULT_CONFIG22, ...config };
|
|
40737
41820
|
}
|
|
40738
41821
|
config;
|
|
40739
41822
|
/**
|
|
@@ -41187,7 +42270,7 @@ var DEFAULT_WEIGHTS = {
|
|
|
41187
42270
|
traceability: 0.1,
|
|
41188
42271
|
independency: 0.15
|
|
41189
42272
|
};
|
|
41190
|
-
var
|
|
42273
|
+
var DEFAULT_CONFIG23 = {
|
|
41191
42274
|
defaultThreshold: 60,
|
|
41192
42275
|
weights: DEFAULT_WEIGHTS,
|
|
41193
42276
|
enableAIScoring: false
|
|
@@ -41196,7 +42279,7 @@ var TestabilityScorerService = class {
|
|
|
41196
42279
|
constructor(memory, config = {}) {
|
|
41197
42280
|
this.memory = memory;
|
|
41198
42281
|
this.config = {
|
|
41199
|
-
...
|
|
42282
|
+
...DEFAULT_CONFIG23,
|
|
41200
42283
|
...config,
|
|
41201
42284
|
weights: { ...DEFAULT_WEIGHTS, ...config.weights }
|
|
41202
42285
|
};
|
|
@@ -41907,7 +42990,7 @@ var RequirementsValidationEvents = {
|
|
|
41907
42990
|
SprintValidated: "requirements-validation.SprintValidated",
|
|
41908
42991
|
ValidationFailed: "requirements-validation.ValidationFailed"
|
|
41909
42992
|
};
|
|
41910
|
-
var
|
|
42993
|
+
var DEFAULT_CONFIG24 = {
|
|
41911
42994
|
maxConcurrentWorkflows: 5,
|
|
41912
42995
|
defaultTimeout: 6e4,
|
|
41913
42996
|
publishEvents: true,
|
|
@@ -41963,7 +43046,7 @@ var RequirementsValidationCoordinator = class {
|
|
|
41963
43046
|
this.eventBus = eventBus;
|
|
41964
43047
|
this.memory = memory;
|
|
41965
43048
|
this.agentCoordinator = agentCoordinator;
|
|
41966
|
-
this.config = { ...
|
|
43049
|
+
this.config = { ...DEFAULT_CONFIG24, ...config };
|
|
41967
43050
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
41968
43051
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
41969
43052
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -44495,7 +45578,7 @@ function sanitizeId(str) {
|
|
|
44495
45578
|
}
|
|
44496
45579
|
|
|
44497
45580
|
// src/domains/code-intelligence/services/product-factors-bridge.ts
|
|
44498
|
-
var
|
|
45581
|
+
var DEFAULT_CONFIG25 = {
|
|
44499
45582
|
cacheTtlMs: 36e5,
|
|
44500
45583
|
// 1 hour
|
|
44501
45584
|
publishEvents: true,
|
|
@@ -44560,7 +45643,7 @@ var ProductFactorsBridgeService = class {
|
|
|
44560
45643
|
constructor(eventBus, memory, config = {}) {
|
|
44561
45644
|
this.eventBus = eventBus;
|
|
44562
45645
|
this.memory = memory;
|
|
44563
|
-
this.config = { ...
|
|
45646
|
+
this.config = { ...DEFAULT_CONFIG25, ...config };
|
|
44564
45647
|
}
|
|
44565
45648
|
config;
|
|
44566
45649
|
initialized = false;
|
|
@@ -45154,7 +46237,7 @@ init_knowledge_graph();
|
|
|
45154
46237
|
// src/domains/code-intelligence/services/semantic-analyzer.ts
|
|
45155
46238
|
init_types();
|
|
45156
46239
|
init_embeddings();
|
|
45157
|
-
var
|
|
46240
|
+
var DEFAULT_CONFIG27 = {
|
|
45158
46241
|
embeddingDimension: EMBEDDING_CONFIG.DIMENSIONS,
|
|
45159
46242
|
// 768 for Nomic
|
|
45160
46243
|
minScore: 0.5,
|
|
@@ -45167,7 +46250,7 @@ var DEFAULT_CONFIG26 = {
|
|
|
45167
46250
|
var SemanticAnalyzerService = class {
|
|
45168
46251
|
constructor(memory, config = {}) {
|
|
45169
46252
|
this.memory = memory;
|
|
45170
|
-
this.config = { ...
|
|
46253
|
+
this.config = { ...DEFAULT_CONFIG27, ...config };
|
|
45171
46254
|
if (config.embeddingProvider) {
|
|
45172
46255
|
this.embedder = config.embeddingProvider;
|
|
45173
46256
|
this.embedderInitialized = true;
|
|
@@ -45735,7 +46818,7 @@ var SemanticAnalyzerService = class {
|
|
|
45735
46818
|
init_types();
|
|
45736
46819
|
init_knowledge_graph();
|
|
45737
46820
|
import { v4 as uuidv424 } from "uuid";
|
|
45738
|
-
var
|
|
46821
|
+
var DEFAULT_CONFIG28 = {
|
|
45739
46822
|
maxDepth: 5,
|
|
45740
46823
|
riskWeights: {
|
|
45741
46824
|
directImpact: 0.4,
|
|
@@ -45765,7 +46848,7 @@ var DEFAULT_CONFIG27 = {
|
|
|
45765
46848
|
var ImpactAnalyzerService = class {
|
|
45766
46849
|
constructor(memory, knowledgeGraph, config = {}) {
|
|
45767
46850
|
this.memory = memory;
|
|
45768
|
-
this.config = { ...
|
|
46851
|
+
this.config = { ...DEFAULT_CONFIG28, ...config };
|
|
45769
46852
|
this.knowledgeGraph = knowledgeGraph || new KnowledgeGraphService(memory);
|
|
45770
46853
|
}
|
|
45771
46854
|
config;
|
|
@@ -46119,7 +47202,7 @@ init_wrappers();
|
|
|
46119
47202
|
|
|
46120
47203
|
// src/domains/code-intelligence/services/metric-collector/index.ts
|
|
46121
47204
|
import { existsSync as existsSync7, readFileSync as readFileSync6, readdirSync as readdirSync3 } from "fs";
|
|
46122
|
-
import { join as
|
|
47205
|
+
import { join as join8, extname as extname3 } from "path";
|
|
46123
47206
|
|
|
46124
47207
|
// src/domains/code-intelligence/services/metric-collector/interfaces.ts
|
|
46125
47208
|
var DEFAULT_METRIC_CONFIG = {
|
|
@@ -46133,7 +47216,7 @@ var DEFAULT_METRIC_CONFIG = {
|
|
|
46133
47216
|
// src/domains/code-intelligence/services/metric-collector/loc-counter.ts
|
|
46134
47217
|
import { execSync as execSync4, spawnSync } from "child_process";
|
|
46135
47218
|
import { existsSync as existsSync5, readdirSync, readFileSync as readFileSync4 } from "fs";
|
|
46136
|
-
import { join as
|
|
47219
|
+
import { join as join6, extname } from "path";
|
|
46137
47220
|
async function countLOC(projectPath, config = {}) {
|
|
46138
47221
|
const mergedConfig = { ...DEFAULT_METRIC_CONFIG, ...config };
|
|
46139
47222
|
const clocResult = await tryClocCount(projectPath, mergedConfig);
|
|
@@ -46281,7 +47364,7 @@ function manualLOCCount(projectPath, config) {
|
|
|
46281
47364
|
}
|
|
46282
47365
|
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
46283
47366
|
for (const entry of entries) {
|
|
46284
|
-
const fullPath =
|
|
47367
|
+
const fullPath = join6(dirPath, entry.name);
|
|
46285
47368
|
if (entry.isDirectory()) {
|
|
46286
47369
|
if (config.excludeDirs.includes(entry.name)) {
|
|
46287
47370
|
continue;
|
|
@@ -46481,7 +47564,7 @@ function getBlockCommentEnd(ext) {
|
|
|
46481
47564
|
// src/domains/code-intelligence/services/metric-collector/test-counter.ts
|
|
46482
47565
|
import { execSync as execSync5, spawnSync as spawnSync2 } from "child_process";
|
|
46483
47566
|
import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync2 } from "fs";
|
|
46484
|
-
import { join as
|
|
47567
|
+
import { join as join7, extname as extname2 } from "path";
|
|
46485
47568
|
async function countTests(projectPath, config = {}) {
|
|
46486
47569
|
const mergedConfig = { ...DEFAULT_METRIC_CONFIG, ...config };
|
|
46487
47570
|
const runner = detectTestRunner(projectPath);
|
|
@@ -46501,7 +47584,7 @@ async function countTests(projectPath, config = {}) {
|
|
|
46501
47584
|
}
|
|
46502
47585
|
}
|
|
46503
47586
|
function detectTestRunner(projectPath) {
|
|
46504
|
-
const packageJsonPath =
|
|
47587
|
+
const packageJsonPath = join7(projectPath, "package.json");
|
|
46505
47588
|
if (existsSync6(packageJsonPath)) {
|
|
46506
47589
|
try {
|
|
46507
47590
|
const pkg = JSON.parse(readFileSync5(packageJsonPath, "utf-8"));
|
|
@@ -46517,13 +47600,13 @@ function detectTestRunner(projectPath) {
|
|
|
46517
47600
|
} catch {
|
|
46518
47601
|
}
|
|
46519
47602
|
}
|
|
46520
|
-
if (existsSync6(
|
|
47603
|
+
if (existsSync6(join7(projectPath, "Cargo.toml"))) {
|
|
46521
47604
|
return "cargo";
|
|
46522
47605
|
}
|
|
46523
|
-
if (existsSync6(
|
|
47606
|
+
if (existsSync6(join7(projectPath, "pyproject.toml")) || existsSync6(join7(projectPath, "setup.py")) || existsSync6(join7(projectPath, "pytest.ini")) || existsSync6(join7(projectPath, "requirements.txt"))) {
|
|
46524
47607
|
return "pytest";
|
|
46525
47608
|
}
|
|
46526
|
-
if (existsSync6(
|
|
47609
|
+
if (existsSync6(join7(projectPath, "go.mod"))) {
|
|
46527
47610
|
return "go";
|
|
46528
47611
|
}
|
|
46529
47612
|
return "fallback";
|
|
@@ -46798,7 +47881,7 @@ function countTestsByFilePattern(projectPath, config) {
|
|
|
46798
47881
|
}
|
|
46799
47882
|
const entries = readdirSync2(dirPath, { withFileTypes: true });
|
|
46800
47883
|
for (const entry of entries) {
|
|
46801
|
-
const fullPath =
|
|
47884
|
+
const fullPath = join7(dirPath, entry.name);
|
|
46802
47885
|
if (entry.isDirectory()) {
|
|
46803
47886
|
if (config.excludeDirs.includes(entry.name)) {
|
|
46804
47887
|
continue;
|
|
@@ -46887,11 +47970,11 @@ function classifyTests(total, source, projectPath) {
|
|
|
46887
47970
|
let unit = total;
|
|
46888
47971
|
let integration = 0;
|
|
46889
47972
|
let e2e = 0;
|
|
46890
|
-
if (existsSync6(
|
|
47973
|
+
if (existsSync6(join7(projectPath, "tests", "integration")) || existsSync6(join7(projectPath, "test", "integration")) || existsSync6(join7(projectPath, "__tests__", "integration"))) {
|
|
46891
47974
|
integration = Math.floor(total * 0.2);
|
|
46892
47975
|
unit -= integration;
|
|
46893
47976
|
}
|
|
46894
|
-
if (existsSync6(
|
|
47977
|
+
if (existsSync6(join7(projectPath, "tests", "e2e")) || existsSync6(join7(projectPath, "test", "e2e")) || existsSync6(join7(projectPath, "e2e")) || existsSync6(join7(projectPath, "cypress"))) {
|
|
46895
47978
|
e2e = Math.floor(total * 0.1);
|
|
46896
47979
|
unit -= e2e;
|
|
46897
47980
|
}
|
|
@@ -47046,11 +48129,11 @@ var MetricCollectorService = class {
|
|
|
47046
48129
|
* Detect primary language of a project
|
|
47047
48130
|
*/
|
|
47048
48131
|
detectLanguage(projectPath) {
|
|
47049
|
-
if (existsSync7(
|
|
47050
|
-
if (existsSync7(
|
|
47051
|
-
if (existsSync7(
|
|
47052
|
-
if (existsSync7(
|
|
47053
|
-
if (existsSync7(
|
|
48132
|
+
if (existsSync7(join8(projectPath, "Cargo.toml"))) return "rust";
|
|
48133
|
+
if (existsSync7(join8(projectPath, "go.mod"))) return "go";
|
|
48134
|
+
if (existsSync7(join8(projectPath, "pyproject.toml")) || existsSync7(join8(projectPath, "requirements.txt"))) return "python";
|
|
48135
|
+
if (existsSync7(join8(projectPath, "package.json"))) {
|
|
48136
|
+
if (existsSync7(join8(projectPath, "tsconfig.json"))) return "typescript";
|
|
47054
48137
|
return "javascript";
|
|
47055
48138
|
}
|
|
47056
48139
|
return "unknown";
|
|
@@ -47069,7 +48152,7 @@ var MetricCollectorService = class {
|
|
|
47069
48152
|
if (!existsSync7(dirPath)) return;
|
|
47070
48153
|
const entries = readdirSync3(dirPath, { withFileTypes: true });
|
|
47071
48154
|
for (const entry of entries) {
|
|
47072
|
-
const fullPath =
|
|
48155
|
+
const fullPath = join8(dirPath, entry.name);
|
|
47073
48156
|
if (entry.isDirectory()) {
|
|
47074
48157
|
const excludeDirs = ["node_modules", "dist", "coverage", "build", ".git", "vendor", "target"];
|
|
47075
48158
|
if (excludeDirs.includes(entry.name)) continue;
|
|
@@ -48038,7 +49121,7 @@ async function createHypergraphEngine(config) {
|
|
|
48038
49121
|
}
|
|
48039
49122
|
|
|
48040
49123
|
// src/domains/code-intelligence/coordinator.ts
|
|
48041
|
-
var
|
|
49124
|
+
var DEFAULT_CONFIG29 = {
|
|
48042
49125
|
maxConcurrentWorkflows: 5,
|
|
48043
49126
|
defaultTimeout: 12e4,
|
|
48044
49127
|
// 2 minutes
|
|
@@ -48065,7 +49148,7 @@ var CodeIntelligenceCoordinator = class {
|
|
|
48065
49148
|
this.eventBus = eventBus;
|
|
48066
49149
|
this.memory = memory;
|
|
48067
49150
|
this.agentCoordinator = agentCoordinator;
|
|
48068
|
-
this.config = { ...
|
|
49151
|
+
this.config = { ...DEFAULT_CONFIG29, ...config };
|
|
48069
49152
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
48070
49153
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
48071
49154
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -49985,7 +51068,7 @@ var Version = class _Version {
|
|
|
49985
51068
|
init_types();
|
|
49986
51069
|
|
|
49987
51070
|
// src/domains/security-compliance/services/scanners/scanner-types.ts
|
|
49988
|
-
var
|
|
51071
|
+
var DEFAULT_CONFIG30 = {
|
|
49989
51072
|
defaultRuleSets: ["owasp-top-10", "cwe-sans-25"],
|
|
49990
51073
|
maxConcurrentScans: 4,
|
|
49991
51074
|
timeout: 3e5,
|
|
@@ -51987,7 +53070,7 @@ function createHttpClient() {
|
|
|
51987
53070
|
}
|
|
51988
53071
|
|
|
51989
53072
|
// src/shared/security/osv-client.ts
|
|
51990
|
-
var
|
|
53073
|
+
var DEFAULT_CONFIG31 = {
|
|
51991
53074
|
baseUrl: "https://api.osv.dev",
|
|
51992
53075
|
timeout: 3e4,
|
|
51993
53076
|
enableCache: true,
|
|
@@ -51999,7 +53082,7 @@ var OSVClient = class {
|
|
|
51999
53082
|
http;
|
|
52000
53083
|
cache = /* @__PURE__ */ new Map();
|
|
52001
53084
|
constructor(config = {}) {
|
|
52002
|
-
this.config = { ...
|
|
53085
|
+
this.config = { ...DEFAULT_CONFIG31, ...config };
|
|
52003
53086
|
this.http = new HttpClient();
|
|
52004
53087
|
}
|
|
52005
53088
|
/**
|
|
@@ -52909,7 +53992,7 @@ var SecurityScannerService = class {
|
|
|
52909
53992
|
dastScanner;
|
|
52910
53993
|
dependencyScanner;
|
|
52911
53994
|
constructor(dependencies, config = {}) {
|
|
52912
|
-
this.config = { ...
|
|
53995
|
+
this.config = { ...DEFAULT_CONFIG30, ...config };
|
|
52913
53996
|
if ("memory" in dependencies) {
|
|
52914
53997
|
this.memory = dependencies.memory;
|
|
52915
53998
|
this.llmRouter = dependencies.llmRouter;
|
|
@@ -53103,7 +54186,7 @@ async function httpGet(url) {
|
|
|
53103
54186
|
data
|
|
53104
54187
|
};
|
|
53105
54188
|
}
|
|
53106
|
-
var
|
|
54189
|
+
var DEFAULT_CONFIG32 = {
|
|
53107
54190
|
secretPatterns: [
|
|
53108
54191
|
/(?:api[_-]?key|apikey)['":\s]*['"=]?\s*['"]?([a-zA-Z0-9_\-]{20,})['"]?/gi,
|
|
53109
54192
|
/(?:password|passwd|pwd)['":\s]*['"=]?\s*['"]?([^\s'"]{8,})['"]?/gi,
|
|
@@ -53125,7 +54208,7 @@ var DEFAULT_CONFIG31 = {
|
|
|
53125
54208
|
var SecurityAuditorService = class {
|
|
53126
54209
|
constructor(memory, config = {}) {
|
|
53127
54210
|
this.memory = memory;
|
|
53128
|
-
this.config = { ...
|
|
54211
|
+
this.config = { ...DEFAULT_CONFIG32, ...config };
|
|
53129
54212
|
}
|
|
53130
54213
|
config;
|
|
53131
54214
|
// ==========================================================================
|
|
@@ -54713,7 +55796,7 @@ var SecurityAuditorService = class {
|
|
|
54713
55796
|
// src/domains/security-compliance/services/compliance-validator.ts
|
|
54714
55797
|
init_types();
|
|
54715
55798
|
import { v4 as uuidv434 } from "uuid";
|
|
54716
|
-
var
|
|
55799
|
+
var DEFAULT_CONFIG33 = {
|
|
54717
55800
|
customStandards: [],
|
|
54718
55801
|
strictMode: false,
|
|
54719
55802
|
includeRecommended: true,
|
|
@@ -54916,7 +55999,7 @@ var BUILT_IN_STANDARDS = [
|
|
|
54916
55999
|
var ComplianceValidatorService = class {
|
|
54917
56000
|
constructor(memory, config = {}) {
|
|
54918
56001
|
this.memory = memory;
|
|
54919
|
-
this.config = { ...
|
|
56002
|
+
this.config = { ...DEFAULT_CONFIG33, ...config };
|
|
54920
56003
|
this.patternAnalyzer = getCompliancePatternAnalyzer();
|
|
54921
56004
|
this.standards = /* @__PURE__ */ new Map();
|
|
54922
56005
|
for (const std of BUILT_IN_STANDARDS) {
|
|
@@ -55769,7 +56852,7 @@ var DQNAlgorithm = class extends BaseRLAlgorithm {
|
|
|
55769
56852
|
|
|
55770
56853
|
// src/domains/security-compliance/coordinator.ts
|
|
55771
56854
|
init_wrappers();
|
|
55772
|
-
var
|
|
56855
|
+
var DEFAULT_CONFIG34 = {
|
|
55773
56856
|
maxConcurrentWorkflows: 3,
|
|
55774
56857
|
defaultTimeout: 3e5,
|
|
55775
56858
|
// 5 minutes
|
|
@@ -55794,7 +56877,7 @@ var SecurityComplianceCoordinator = class {
|
|
|
55794
56877
|
this.eventBus = eventBus;
|
|
55795
56878
|
this.memory = memory;
|
|
55796
56879
|
this.agentCoordinator = agentCoordinator;
|
|
55797
|
-
this.config = { ...
|
|
56880
|
+
this.config = { ...DEFAULT_CONFIG34, ...config };
|
|
55798
56881
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
55799
56882
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
55800
56883
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -56985,7 +58068,7 @@ init_io();
|
|
|
56985
58068
|
|
|
56986
58069
|
// src/domains/contract-testing/services/contract-validator.ts
|
|
56987
58070
|
init_types();
|
|
56988
|
-
var
|
|
58071
|
+
var DEFAULT_CONFIG35 = {
|
|
56989
58072
|
strictMode: true,
|
|
56990
58073
|
validateExamples: true,
|
|
56991
58074
|
maxSchemaDepth: CONTRACT_CONSTANTS.MAX_SCHEMA_DEPTH,
|
|
@@ -57008,7 +58091,7 @@ var ContractValidatorService = class {
|
|
|
57008
58091
|
constructor(dependencies, config = {}) {
|
|
57009
58092
|
this.memory = dependencies.memory;
|
|
57010
58093
|
this.llmRouter = dependencies.llmRouter;
|
|
57011
|
-
this.config = { ...
|
|
58094
|
+
this.config = { ...DEFAULT_CONFIG35, ...config };
|
|
57012
58095
|
}
|
|
57013
58096
|
/**
|
|
57014
58097
|
* ADR-051: Check if LLM analysis is available
|
|
@@ -58348,7 +59431,7 @@ Provide:
|
|
|
58348
59431
|
|
|
58349
59432
|
// src/domains/contract-testing/services/api-compatibility.ts
|
|
58350
59433
|
init_types();
|
|
58351
|
-
var
|
|
59434
|
+
var DEFAULT_CONFIG36 = {
|
|
58352
59435
|
strictEnumValidation: true,
|
|
58353
59436
|
allowOptionalToRequired: false,
|
|
58354
59437
|
trackDeprecations: true,
|
|
@@ -58357,7 +59440,7 @@ var DEFAULT_CONFIG35 = {
|
|
|
58357
59440
|
var ApiCompatibilityService = class {
|
|
58358
59441
|
constructor(memory, config = {}) {
|
|
58359
59442
|
this.memory = memory;
|
|
58360
|
-
this.config = { ...
|
|
59443
|
+
this.config = { ...DEFAULT_CONFIG36, ...config };
|
|
58361
59444
|
}
|
|
58362
59445
|
config;
|
|
58363
59446
|
/**
|
|
@@ -59020,7 +60103,7 @@ var ContractTestingEvents = {
|
|
|
59020
60103
|
ConsumerContractCreated: "contract-testing.ConsumerContractCreated",
|
|
59021
60104
|
VerificationFailed: "contract-testing.VerificationFailed"
|
|
59022
60105
|
};
|
|
59023
|
-
var
|
|
60106
|
+
var DEFAULT_CONFIG37 = {
|
|
59024
60107
|
maxConcurrentWorkflows: 5,
|
|
59025
60108
|
defaultTimeout: 6e4,
|
|
59026
60109
|
// 60 seconds
|
|
@@ -59043,7 +60126,7 @@ var ContractTestingCoordinator = class {
|
|
|
59043
60126
|
this.eventBus = eventBus;
|
|
59044
60127
|
this.memory = memory;
|
|
59045
60128
|
this.agentCoordinator = agentCoordinator;
|
|
59046
|
-
this.config = { ...
|
|
60129
|
+
this.config = { ...DEFAULT_CONFIG37, ...config };
|
|
59047
60130
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
59048
60131
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
59049
60132
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -60241,7 +61324,7 @@ var ContractTestingCoordinator = class {
|
|
|
60241
61324
|
// src/domains/contract-testing/services/schema-validator.ts
|
|
60242
61325
|
init_types();
|
|
60243
61326
|
import { v4 as uuidv437 } from "uuid";
|
|
60244
|
-
var
|
|
61327
|
+
var DEFAULT_CONFIG38 = {
|
|
60245
61328
|
strictMode: false,
|
|
60246
61329
|
allowAdditionalProperties: true,
|
|
60247
61330
|
maxRecursionDepth: 10,
|
|
@@ -60250,7 +61333,7 @@ var DEFAULT_CONFIG37 = {
|
|
|
60250
61333
|
var SchemaValidatorService = class {
|
|
60251
61334
|
constructor(memory, config = {}) {
|
|
60252
61335
|
this.memory = memory;
|
|
60253
|
-
this.config = { ...
|
|
61336
|
+
this.config = { ...DEFAULT_CONFIG38, ...config };
|
|
60254
61337
|
}
|
|
60255
61338
|
config;
|
|
60256
61339
|
/**
|
|
@@ -61627,7 +62710,7 @@ import { v4 as uuidv441 } from "uuid";
|
|
|
61627
62710
|
// src/domains/visual-accessibility/services/visual-tester.ts
|
|
61628
62711
|
init_types();
|
|
61629
62712
|
import { v4 as uuidv438 } from "uuid";
|
|
61630
|
-
var
|
|
62713
|
+
var DEFAULT_CONFIG39 = {
|
|
61631
62714
|
baselineDirectory: ".visual-tests/baselines",
|
|
61632
62715
|
diffDirectory: ".visual-tests/diffs",
|
|
61633
62716
|
defaultViewport: {
|
|
@@ -61655,7 +62738,7 @@ var VisualTesterService = class {
|
|
|
61655
62738
|
constructor(dependencies, config = {}) {
|
|
61656
62739
|
this.memory = dependencies.memory;
|
|
61657
62740
|
this.llmRouter = dependencies.llmRouter;
|
|
61658
|
-
this.config = { ...
|
|
62741
|
+
this.config = { ...DEFAULT_CONFIG39, ...config };
|
|
61659
62742
|
}
|
|
61660
62743
|
/**
|
|
61661
62744
|
* Set the Vibium client for browser-based operations
|
|
@@ -62674,7 +63757,7 @@ function getWCAGLevel(criterionId) {
|
|
|
62674
63757
|
if (levelAA.includes(criterionId)) return "AA";
|
|
62675
63758
|
return "AAA";
|
|
62676
63759
|
}
|
|
62677
|
-
var
|
|
63760
|
+
var DEFAULT_CONFIG40 = {
|
|
62678
63761
|
en301549Version: "3.2.1",
|
|
62679
63762
|
includeEAA: true,
|
|
62680
63763
|
defaultProductCategory: "e-commerce",
|
|
@@ -62683,7 +63766,7 @@ var DEFAULT_CONFIG39 = {
|
|
|
62683
63766
|
var EUComplianceService = class {
|
|
62684
63767
|
constructor(memory, config = {}) {
|
|
62685
63768
|
this.memory = memory;
|
|
62686
|
-
this.config = { ...
|
|
63769
|
+
this.config = { ...DEFAULT_CONFIG40, ...config };
|
|
62687
63770
|
}
|
|
62688
63771
|
config;
|
|
62689
63772
|
/**
|
|
@@ -62979,7 +64062,7 @@ init_errors();
|
|
|
62979
64062
|
init_client();
|
|
62980
64063
|
|
|
62981
64064
|
// src/domains/visual-accessibility/services/accessibility-tester.ts
|
|
62982
|
-
var
|
|
64065
|
+
var DEFAULT_CONFIG41 = {
|
|
62983
64066
|
defaultWCAGLevel: "AA",
|
|
62984
64067
|
includeWarnings: true,
|
|
62985
64068
|
auditTimeout: 3e4,
|
|
@@ -63020,7 +64103,7 @@ var AccessibilityTesterService = class {
|
|
|
63020
64103
|
*/
|
|
63021
64104
|
constructor(memory, config = {}, vibiumClient) {
|
|
63022
64105
|
this.memory = memory;
|
|
63023
|
-
this.config = { ...
|
|
64106
|
+
this.config = { ...DEFAULT_CONFIG41, ...config };
|
|
63024
64107
|
this.rules = this.initializeRules();
|
|
63025
64108
|
this.vibiumClient = vibiumClient ?? null;
|
|
63026
64109
|
this.browserClient = config.browserClient ?? null;
|
|
@@ -64614,7 +65697,7 @@ var DEVICE_VIEWPORTS = {
|
|
|
64614
65697
|
hasTouch: false
|
|
64615
65698
|
}
|
|
64616
65699
|
};
|
|
64617
|
-
var
|
|
65700
|
+
var DEFAULT_CONFIG42 = {
|
|
64618
65701
|
viewports: [
|
|
64619
65702
|
DEVICE_VIEWPORTS["iphone-14"],
|
|
64620
65703
|
DEVICE_VIEWPORTS["ipad-mini"],
|
|
@@ -64630,7 +65713,7 @@ var DEFAULT_CONFIG41 = {
|
|
|
64630
65713
|
var ResponsiveTesterService = class {
|
|
64631
65714
|
constructor(memory, config = {}) {
|
|
64632
65715
|
this.memory = memory;
|
|
64633
|
-
this.config = { ...
|
|
65716
|
+
this.config = { ...DEFAULT_CONFIG42, ...config };
|
|
64634
65717
|
}
|
|
64635
65718
|
config;
|
|
64636
65719
|
/**
|
|
@@ -65380,7 +66463,7 @@ var A2CAlgorithm = class extends BaseRLAlgorithm {
|
|
|
65380
66463
|
|
|
65381
66464
|
// src/domains/visual-accessibility/coordinator.ts
|
|
65382
66465
|
init_wrappers();
|
|
65383
|
-
var
|
|
66466
|
+
var DEFAULT_CONFIG43 = {
|
|
65384
66467
|
maxConcurrentWorkflows: 5,
|
|
65385
66468
|
defaultTimeout: 12e4,
|
|
65386
66469
|
// 2 minutes
|
|
@@ -65403,7 +66486,7 @@ var VisualAccessibilityCoordinator = class {
|
|
|
65403
66486
|
this.eventBus = eventBus;
|
|
65404
66487
|
this.memory = memory;
|
|
65405
66488
|
this.agentCoordinator = agentCoordinator;
|
|
65406
|
-
this.config = { ...
|
|
66489
|
+
this.config = { ...DEFAULT_CONFIG43, ...config };
|
|
65407
66490
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
65408
66491
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
65409
66492
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -67189,7 +68272,7 @@ init_types();
|
|
|
67189
68272
|
init_cve_prevention();
|
|
67190
68273
|
import * as net from "net";
|
|
67191
68274
|
import { execFile } from "child_process";
|
|
67192
|
-
var
|
|
68275
|
+
var DEFAULT_CONFIG44 = {
|
|
67193
68276
|
defaultTimeout: 6e4,
|
|
67194
68277
|
// 60 seconds
|
|
67195
68278
|
maxConcurrentFaults: 3,
|
|
@@ -67215,7 +68298,7 @@ var ChaosEngineerService = class _ChaosEngineerService {
|
|
|
67215
68298
|
constructor(dependencies, config = {}) {
|
|
67216
68299
|
this.memory = dependencies.memory;
|
|
67217
68300
|
this.llmRouter = dependencies.llmRouter;
|
|
67218
|
-
this.config = { ...
|
|
68301
|
+
this.config = { ...DEFAULT_CONFIG44, ...config };
|
|
67219
68302
|
this.httpClient = new HttpClient();
|
|
67220
68303
|
this.metricsCollector = getSystemMetricsCollector();
|
|
67221
68304
|
}
|
|
@@ -68063,7 +69146,7 @@ Provide:
|
|
|
68063
69146
|
// src/domains/chaos-resilience/services/load-tester.ts
|
|
68064
69147
|
init_types();
|
|
68065
69148
|
import { v4 as uuidv442 } from "uuid";
|
|
68066
|
-
var
|
|
69149
|
+
var DEFAULT_CONFIG45 = {
|
|
68067
69150
|
defaultTimeout: 3e5,
|
|
68068
69151
|
// 5 minutes
|
|
68069
69152
|
maxVirtualUsers: 1e3,
|
|
@@ -68075,7 +69158,7 @@ var DEFAULT_CONFIG44 = {
|
|
|
68075
69158
|
var LoadTesterService = class {
|
|
68076
69159
|
constructor(memory, config = {}) {
|
|
68077
69160
|
this.memory = memory;
|
|
68078
|
-
this.config = { ...
|
|
69161
|
+
this.config = { ...DEFAULT_CONFIG45, ...config };
|
|
68079
69162
|
this.httpClient = new HttpClient();
|
|
68080
69163
|
}
|
|
68081
69164
|
config;
|
|
@@ -68612,7 +69695,7 @@ var LoadTesterService = class {
|
|
|
68612
69695
|
// src/domains/chaos-resilience/services/performance-profiler.ts
|
|
68613
69696
|
init_types();
|
|
68614
69697
|
import { v4 as uuidv443 } from "uuid";
|
|
68615
|
-
var
|
|
69698
|
+
var DEFAULT_CONFIG46 = {
|
|
68616
69699
|
defaultTimeout: 6e4,
|
|
68617
69700
|
// 60 seconds
|
|
68618
69701
|
healthCheckInterval: 1e3,
|
|
@@ -68626,7 +69709,7 @@ var DEFAULT_CONFIG45 = {
|
|
|
68626
69709
|
var PerformanceProfilerService = class {
|
|
68627
69710
|
constructor(memory, config = {}) {
|
|
68628
69711
|
this.memory = memory;
|
|
68629
|
-
this.config = { ...
|
|
69712
|
+
this.config = { ...DEFAULT_CONFIG46, ...config };
|
|
68630
69713
|
this.httpClient = createHttpClient();
|
|
68631
69714
|
}
|
|
68632
69715
|
config;
|
|
@@ -69403,7 +70486,7 @@ var PolicyGradientAlgorithm = class extends BaseRLAlgorithm {
|
|
|
69403
70486
|
};
|
|
69404
70487
|
|
|
69405
70488
|
// src/domains/chaos-resilience/coordinator.ts
|
|
69406
|
-
var
|
|
70489
|
+
var DEFAULT_CONFIG47 = {
|
|
69407
70490
|
maxConcurrentWorkflows: 3,
|
|
69408
70491
|
defaultTimeout: 3e5,
|
|
69409
70492
|
// 5 minutes
|
|
@@ -69426,7 +70509,7 @@ var ChaosResilienceCoordinator = class {
|
|
|
69426
70509
|
this.eventBus = eventBus;
|
|
69427
70510
|
this.memory = memory;
|
|
69428
70511
|
this.agentCoordinator = agentCoordinator;
|
|
69429
|
-
this.config = { ...
|
|
70512
|
+
this.config = { ...DEFAULT_CONFIG47, ...config };
|
|
69430
70513
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
69431
70514
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
69432
70515
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -71356,7 +72439,7 @@ import { v4 as uuidv452 } from "uuid";
|
|
|
71356
72439
|
init_types();
|
|
71357
72440
|
init_wrappers();
|
|
71358
72441
|
import { v4 as uuidv445 } from "uuid";
|
|
71359
|
-
var
|
|
72442
|
+
var DEFAULT_CONFIG48 = {
|
|
71360
72443
|
minExperiencesForPattern: 5,
|
|
71361
72444
|
patternConfidenceThreshold: 0.7,
|
|
71362
72445
|
maxPatternsPerDomain: 100,
|
|
@@ -71380,7 +72463,7 @@ var LearningCoordinatorService = class {
|
|
|
71380
72463
|
constructor(dependencies, config = {}) {
|
|
71381
72464
|
this.memory = dependencies.memory;
|
|
71382
72465
|
this.llmRouter = dependencies.llmRouter;
|
|
71383
|
-
this.config = { ...
|
|
72466
|
+
this.config = { ...DEFAULT_CONFIG48, ...config };
|
|
71384
72467
|
}
|
|
71385
72468
|
// ============================================================================
|
|
71386
72469
|
// FlashAttention Integration Methods (via @ruvector/attention)
|
|
@@ -72265,7 +73348,7 @@ Provide:
|
|
|
72265
73348
|
// src/domains/learning-optimization/services/transfer-specialist.ts
|
|
72266
73349
|
init_types();
|
|
72267
73350
|
import { v4 as uuidv446 } from "uuid";
|
|
72268
|
-
var
|
|
73351
|
+
var DEFAULT_CONFIG49 = {
|
|
72269
73352
|
maxKnowledgeItems: 1e3,
|
|
72270
73353
|
relevanceThreshold: 0.5,
|
|
72271
73354
|
transferDecayFactor: 0.1,
|
|
@@ -72274,7 +73357,7 @@ var DEFAULT_CONFIG48 = {
|
|
|
72274
73357
|
var TransferSpecialistService = class {
|
|
72275
73358
|
constructor(memory, config = {}) {
|
|
72276
73359
|
this.memory = memory;
|
|
72277
|
-
this.config = { ...
|
|
73360
|
+
this.config = { ...DEFAULT_CONFIG49, ...config };
|
|
72278
73361
|
}
|
|
72279
73362
|
config;
|
|
72280
73363
|
// ============================================================================
|
|
@@ -72778,7 +73861,7 @@ var TransferSpecialistService = class {
|
|
|
72778
73861
|
// src/domains/learning-optimization/services/metrics-optimizer.ts
|
|
72779
73862
|
init_types();
|
|
72780
73863
|
import { v4 as uuidv447 } from "uuid";
|
|
72781
|
-
var
|
|
73864
|
+
var DEFAULT_CONFIG50 = {
|
|
72782
73865
|
defaultConfidenceLevel: 0.95,
|
|
72783
73866
|
minSamplesForOptimization: 20,
|
|
72784
73867
|
maxOptimizationIterations: 100,
|
|
@@ -72792,7 +73875,7 @@ function isSafeKey(key) {
|
|
|
72792
73875
|
var MetricsOptimizerService = class {
|
|
72793
73876
|
constructor(memory, config = {}) {
|
|
72794
73877
|
this.memory = memory;
|
|
72795
|
-
this.config = { ...
|
|
73878
|
+
this.config = { ...DEFAULT_CONFIG50, ...config };
|
|
72796
73879
|
}
|
|
72797
73880
|
config;
|
|
72798
73881
|
// ============================================================================
|
|
@@ -73396,7 +74479,7 @@ var MetricsOptimizerService = class {
|
|
|
73396
74479
|
// src/domains/learning-optimization/services/production-intel.ts
|
|
73397
74480
|
init_types();
|
|
73398
74481
|
import { v4 as uuidv448 } from "uuid";
|
|
73399
|
-
var
|
|
74482
|
+
var DEFAULT_CONFIG51 = {
|
|
73400
74483
|
metricsRetentionDays: 90,
|
|
73401
74484
|
anomalyThreshold: 2.5,
|
|
73402
74485
|
trendWindowSize: 7,
|
|
@@ -73410,7 +74493,7 @@ var DEFAULT_CONFIG50 = {
|
|
|
73410
74493
|
var ProductionIntelService = class {
|
|
73411
74494
|
constructor(memory, config = {}) {
|
|
73412
74495
|
this.memory = memory;
|
|
73413
|
-
this.config = { ...
|
|
74496
|
+
this.config = { ...DEFAULT_CONFIG51, ...config };
|
|
73414
74497
|
}
|
|
73415
74498
|
config;
|
|
73416
74499
|
// ============================================================================
|
|
@@ -76487,7 +77570,7 @@ function createDreamScheduler(dependencies, config) {
|
|
|
76487
77570
|
}
|
|
76488
77571
|
|
|
76489
77572
|
// src/domains/learning-optimization/coordinator.ts
|
|
76490
|
-
var
|
|
77573
|
+
var DEFAULT_CONFIG52 = {
|
|
76491
77574
|
maxConcurrentWorkflows: 3,
|
|
76492
77575
|
defaultTimeout: 12e4,
|
|
76493
77576
|
// 2 minutes
|
|
@@ -76519,7 +77602,7 @@ var LearningOptimizationCoordinator = class {
|
|
|
76519
77602
|
this.eventBus = eventBus;
|
|
76520
77603
|
this.memory = memory;
|
|
76521
77604
|
this.agentCoordinator = agentCoordinator;
|
|
76522
|
-
this.config = { ...
|
|
77605
|
+
this.config = { ...DEFAULT_CONFIG52, ...config };
|
|
76523
77606
|
this.minCutMixin = createMinCutAwareMixin(this.domainName, {
|
|
76524
77607
|
enableMinCutAwareness: this.config.enableMinCutAwareness,
|
|
76525
77608
|
topologyHealthThreshold: this.config.topologyHealthThreshold,
|
|
@@ -78594,7 +79677,7 @@ var WorkflowEvents = {
|
|
|
78594
79677
|
StepFailed: "workflow.StepFailed",
|
|
78595
79678
|
StepSkipped: "workflow.StepSkipped"
|
|
78596
79679
|
};
|
|
78597
|
-
var
|
|
79680
|
+
var DEFAULT_CONFIG53 = {
|
|
78598
79681
|
maxConcurrentWorkflows: 10,
|
|
78599
79682
|
defaultStepTimeout: 6e4,
|
|
78600
79683
|
defaultWorkflowTimeout: 6e5,
|
|
@@ -78606,7 +79689,7 @@ var WorkflowOrchestrator = class {
|
|
|
78606
79689
|
this.eventBus = eventBus;
|
|
78607
79690
|
this.memory = memory;
|
|
78608
79691
|
this.agentCoordinator = agentCoordinator;
|
|
78609
|
-
this.config = { ...
|
|
79692
|
+
this.config = { ...DEFAULT_CONFIG53, ...config };
|
|
78610
79693
|
}
|
|
78611
79694
|
config;
|
|
78612
79695
|
workflows = /* @__PURE__ */ new Map();
|
|
@@ -80253,7 +81336,7 @@ var DOMAIN_FACTORIES = {
|
|
|
80253
81336
|
"learning-optimization": (eb, m, c) => createLearningOptimizationPlugin(eb, m, c),
|
|
80254
81337
|
"coordination": (eb, m, c) => createCoordinationPlugin(eb, m, c)
|
|
80255
81338
|
};
|
|
80256
|
-
function
|
|
81339
|
+
function findProjectRoot2() {
|
|
80257
81340
|
let dir = process.cwd();
|
|
80258
81341
|
const root = path9.parse(dir).root;
|
|
80259
81342
|
while (dir !== root) {
|
|
@@ -80264,7 +81347,7 @@ function findProjectRoot() {
|
|
|
80264
81347
|
}
|
|
80265
81348
|
return process.cwd();
|
|
80266
81349
|
}
|
|
80267
|
-
var
|
|
81350
|
+
var DEFAULT_CONFIG54 = {
|
|
80268
81351
|
maxConcurrentAgents: AGENT_CONSTANTS.MAX_CONCURRENT_AGENTS,
|
|
80269
81352
|
memoryBackend: "hybrid",
|
|
80270
81353
|
hnswEnabled: true,
|
|
@@ -80282,9 +81365,9 @@ var QEKernelImpl = class {
|
|
|
80282
81365
|
_startTime;
|
|
80283
81366
|
_initialized = false;
|
|
80284
81367
|
constructor(config = {}) {
|
|
80285
|
-
this._config = { ...
|
|
81368
|
+
this._config = { ...DEFAULT_CONFIG54, ...config };
|
|
80286
81369
|
this._startTime = /* @__PURE__ */ new Date();
|
|
80287
|
-
const projectRoot =
|
|
81370
|
+
const projectRoot = findProjectRoot2();
|
|
80288
81371
|
const dataDir = this._config.dataDir || path9.join(projectRoot, ".agentic-qe");
|
|
80289
81372
|
if (!fs8.existsSync(dataDir)) {
|
|
80290
81373
|
fs8.mkdirSync(dataDir, { recursive: true });
|
|
@@ -80502,7 +81585,7 @@ function createdAtComparator() {
|
|
|
80502
81585
|
}
|
|
80503
81586
|
|
|
80504
81587
|
// src/coordination/services/task-audit-logger.ts
|
|
80505
|
-
var
|
|
81588
|
+
var DEFAULT_CONFIG55 = {
|
|
80506
81589
|
enableConsoleLog: true,
|
|
80507
81590
|
maxEntries: 1e3,
|
|
80508
81591
|
logPrefix: "[TASK]"
|
|
@@ -80511,7 +81594,7 @@ var TaskAuditLogger = class {
|
|
|
80511
81594
|
entries = [];
|
|
80512
81595
|
config;
|
|
80513
81596
|
constructor(config = {}) {
|
|
80514
|
-
this.config = { ...
|
|
81597
|
+
this.config = { ...DEFAULT_CONFIG55, ...config };
|
|
80515
81598
|
}
|
|
80516
81599
|
/**
|
|
80517
81600
|
* Log a task operation
|
|
@@ -83604,7 +84687,7 @@ var QueenRouterAdapter = class {
|
|
|
83604
84687
|
|
|
83605
84688
|
// src/hooks/cross-phase-hooks.ts
|
|
83606
84689
|
import { readFileSync as readFileSync7, existsSync as existsSync9 } from "fs";
|
|
83607
|
-
import { join as
|
|
84690
|
+
import { join as join11 } from "path";
|
|
83608
84691
|
import { parse as parseYaml } from "yaml";
|
|
83609
84692
|
|
|
83610
84693
|
// src/types/cross-phase-signals.ts
|
|
@@ -83884,7 +84967,7 @@ var CrossPhaseHookExecutor = class {
|
|
|
83884
84967
|
configPath;
|
|
83885
84968
|
listeners = /* @__PURE__ */ new Map();
|
|
83886
84969
|
constructor(configPath) {
|
|
83887
|
-
this.configPath = configPath ||
|
|
84970
|
+
this.configPath = configPath || join11(process.cwd(), ".claude/hooks/cross-phase-memory.yaml");
|
|
83888
84971
|
this.memory = getCrossPhaseMemory();
|
|
83889
84972
|
}
|
|
83890
84973
|
// ---------------------------------------------------------------------------
|
|
@@ -84236,7 +85319,7 @@ var TASK_DOMAIN_MAP = {
|
|
|
84236
85319
|
// QCSD Ideation Swarm: requirements-validation is primary, with support from coverage-analysis and security-compliance
|
|
84237
85320
|
"ideation-assessment": ["requirements-validation", "coverage-analysis", "security-compliance"]
|
|
84238
85321
|
};
|
|
84239
|
-
var
|
|
85322
|
+
var DEFAULT_CONFIG56 = {
|
|
84240
85323
|
maxConcurrentTasks: 50,
|
|
84241
85324
|
defaultTaskTimeout: 3e5,
|
|
84242
85325
|
// 5 minutes
|
|
@@ -84271,7 +85354,7 @@ var QueenCoordinator = class _QueenCoordinator {
|
|
|
84271
85354
|
this.protocolExecutor = protocolExecutor;
|
|
84272
85355
|
this.workflowExecutor = workflowExecutor;
|
|
84273
85356
|
this.domainPlugins = domainPlugins;
|
|
84274
|
-
this.config = { ...
|
|
85357
|
+
this.config = { ...DEFAULT_CONFIG56, ...config };
|
|
84275
85358
|
this.auditLogger = createTaskAuditLogger({
|
|
84276
85359
|
enableConsoleLog: this.config.enableMetrics,
|
|
84277
85360
|
maxEntries: 1e3,
|
|
@@ -88076,7 +89159,7 @@ async function createDefaultMemoryBackend(autoInitialize2 = true) {
|
|
|
88076
89159
|
}
|
|
88077
89160
|
|
|
88078
89161
|
// src/init/token-bootstrap.ts
|
|
88079
|
-
var
|
|
89162
|
+
var DEFAULT_CONFIG57 = {
|
|
88080
89163
|
enableOptimization: true,
|
|
88081
89164
|
enablePersistence: true,
|
|
88082
89165
|
storagePath: process.env.AQE_STORAGE_PATH ?? ".aqe",
|
|
@@ -88090,7 +89173,7 @@ async function bootstrapTokenTracking(config) {
|
|
|
88090
89173
|
if (initialized) {
|
|
88091
89174
|
return;
|
|
88092
89175
|
}
|
|
88093
|
-
const cfg = { ...
|
|
89176
|
+
const cfg = { ...DEFAULT_CONFIG57, ...config };
|
|
88094
89177
|
if (cfg.verbose) {
|
|
88095
89178
|
console.log("[TokenBootstrap] Initializing token tracking...");
|
|
88096
89179
|
}
|
|
@@ -89272,7 +90355,7 @@ init_types();
|
|
|
89272
90355
|
|
|
89273
90356
|
// src/init/init-wizard.ts
|
|
89274
90357
|
import { existsSync as existsSync17, mkdirSync as mkdirSync8, writeFileSync as writeFileSync5, readFileSync as readFileSync14, readdirSync as readdirSync8, statSync as statSync7, unlinkSync as unlinkSync2, copyFileSync as copyFileSync5 } from "fs";
|
|
89275
|
-
import { join as
|
|
90358
|
+
import { join as join18, dirname as dirname7 } from "path";
|
|
89276
90359
|
import { createRequire } from "module";
|
|
89277
90360
|
|
|
89278
90361
|
// src/init/types.ts
|
|
@@ -89381,14 +90464,14 @@ function createDefaultConfig(projectName, projectRoot) {
|
|
|
89381
90464
|
|
|
89382
90465
|
// src/init/project-analyzer.ts
|
|
89383
90466
|
import { readFileSync as readFileSync10, existsSync as existsSync13, statSync as statSync4, readdirSync as readdirSync4 } from "fs";
|
|
89384
|
-
import { join as
|
|
90467
|
+
import { join as join14, basename as basename3, extname as extname5, relative as relative4 } from "path";
|
|
89385
90468
|
var frameworkDetectors = [
|
|
89386
90469
|
{
|
|
89387
90470
|
name: "jest",
|
|
89388
90471
|
detect: (root) => {
|
|
89389
90472
|
const configs = ["jest.config.js", "jest.config.ts", "jest.config.mjs", "jest.config.cjs"];
|
|
89390
90473
|
for (const config of configs) {
|
|
89391
|
-
if (existsSync13(
|
|
90474
|
+
if (existsSync13(join14(root, config))) {
|
|
89392
90475
|
const version = getPackageVersion(root, "jest");
|
|
89393
90476
|
return { name: "jest", version, configFile: config, confidence: 1 };
|
|
89394
90477
|
}
|
|
@@ -89409,7 +90492,7 @@ var frameworkDetectors = [
|
|
|
89409
90492
|
detect: (root) => {
|
|
89410
90493
|
const configs = ["vitest.config.ts", "vitest.config.js", "vitest.config.mts", "vite.config.ts"];
|
|
89411
90494
|
for (const config of configs) {
|
|
89412
|
-
if (existsSync13(
|
|
90495
|
+
if (existsSync13(join14(root, config))) {
|
|
89413
90496
|
const version = getPackageVersion(root, "vitest");
|
|
89414
90497
|
return { name: "vitest", version, configFile: config, confidence: 1 };
|
|
89415
90498
|
}
|
|
@@ -89426,7 +90509,7 @@ var frameworkDetectors = [
|
|
|
89426
90509
|
detect: (root) => {
|
|
89427
90510
|
const configs = [".mocharc.js", ".mocharc.json", ".mocharc.yaml", ".mocharc.yml"];
|
|
89428
90511
|
for (const config of configs) {
|
|
89429
|
-
if (existsSync13(
|
|
90512
|
+
if (existsSync13(join14(root, config))) {
|
|
89430
90513
|
const version = getPackageVersion(root, "mocha");
|
|
89431
90514
|
return { name: "mocha", version, configFile: config, confidence: 1 };
|
|
89432
90515
|
}
|
|
@@ -89443,7 +90526,7 @@ var frameworkDetectors = [
|
|
|
89443
90526
|
detect: (root) => {
|
|
89444
90527
|
const configs = ["pytest.ini", "pyproject.toml", "setup.cfg"];
|
|
89445
90528
|
for (const config of configs) {
|
|
89446
|
-
const configPath =
|
|
90529
|
+
const configPath = join14(root, config);
|
|
89447
90530
|
if (existsSync13(configPath)) {
|
|
89448
90531
|
try {
|
|
89449
90532
|
const content = readFileSync10(configPath, "utf-8");
|
|
@@ -89455,7 +90538,7 @@ var frameworkDetectors = [
|
|
|
89455
90538
|
}
|
|
89456
90539
|
}
|
|
89457
90540
|
}
|
|
89458
|
-
const reqPath =
|
|
90541
|
+
const reqPath = join14(root, "requirements.txt");
|
|
89459
90542
|
if (existsSync13(reqPath)) {
|
|
89460
90543
|
try {
|
|
89461
90544
|
const content = readFileSync10(reqPath, "utf-8");
|
|
@@ -89474,7 +90557,7 @@ var frameworkDetectors = [
|
|
|
89474
90557
|
detect: (root) => {
|
|
89475
90558
|
const configs = ["playwright.config.ts", "playwright.config.js"];
|
|
89476
90559
|
for (const config of configs) {
|
|
89477
|
-
if (existsSync13(
|
|
90560
|
+
if (existsSync13(join14(root, config))) {
|
|
89478
90561
|
const version = getPackageVersion(root, "@playwright/test");
|
|
89479
90562
|
return { name: "playwright", version, configFile: config, confidence: 1 };
|
|
89480
90563
|
}
|
|
@@ -89491,12 +90574,12 @@ var frameworkDetectors = [
|
|
|
89491
90574
|
detect: (root) => {
|
|
89492
90575
|
const configs = ["cypress.config.ts", "cypress.config.js", "cypress.json"];
|
|
89493
90576
|
for (const config of configs) {
|
|
89494
|
-
if (existsSync13(
|
|
90577
|
+
if (existsSync13(join14(root, config))) {
|
|
89495
90578
|
const version = getPackageVersion(root, "cypress");
|
|
89496
90579
|
return { name: "cypress", version, configFile: config, confidence: 1 };
|
|
89497
90580
|
}
|
|
89498
90581
|
}
|
|
89499
|
-
if (existsSync13(
|
|
90582
|
+
if (existsSync13(join14(root, "cypress"))) {
|
|
89500
90583
|
return { name: "cypress", configFile: "cypress/", confidence: 0.9 };
|
|
89501
90584
|
}
|
|
89502
90585
|
return null;
|
|
@@ -89517,7 +90600,7 @@ var languagePatterns = [
|
|
|
89517
90600
|
{ name: "swift", extensions: [".swift"] }
|
|
89518
90601
|
];
|
|
89519
90602
|
function readPackageJson(root) {
|
|
89520
|
-
const pkgPath =
|
|
90603
|
+
const pkgPath = join14(root, "package.json");
|
|
89521
90604
|
if (!existsSync13(pkgPath)) return null;
|
|
89522
90605
|
try {
|
|
89523
90606
|
return JSON.parse(readFileSync10(pkgPath, "utf-8"));
|
|
@@ -89542,7 +90625,7 @@ function walkDir(dir, callback, options = {}) {
|
|
|
89542
90625
|
}
|
|
89543
90626
|
for (const entry of entries) {
|
|
89544
90627
|
if (exclude.includes(entry)) continue;
|
|
89545
|
-
const fullPath =
|
|
90628
|
+
const fullPath = join14(currentDir, entry);
|
|
89546
90629
|
let stat3;
|
|
89547
90630
|
try {
|
|
89548
90631
|
stat3 = statSync4(fullPath);
|
|
@@ -89587,7 +90670,7 @@ var ProjectAnalyzer = class {
|
|
|
89587
90670
|
codeComplexity,
|
|
89588
90671
|
coverage,
|
|
89589
90672
|
packageManager: this.detectPackageManager(),
|
|
89590
|
-
hasTypeScript: existsSync13(
|
|
90673
|
+
hasTypeScript: existsSync13(join14(this.projectRoot, "tsconfig.json")),
|
|
89591
90674
|
hasCIConfig: this.detectCIConfig(),
|
|
89592
90675
|
ciProvider: this.detectCIProvider(),
|
|
89593
90676
|
analysisTimestamp: /* @__PURE__ */ new Date(),
|
|
@@ -89673,7 +90756,7 @@ var ProjectAnalyzer = class {
|
|
|
89673
90756
|
} else {
|
|
89674
90757
|
tests.byType.unknown++;
|
|
89675
90758
|
}
|
|
89676
|
-
const dir = relative4(this.projectRoot,
|
|
90759
|
+
const dir = relative4(this.projectRoot, join14(filePath, ".."));
|
|
89677
90760
|
testDirs.add(dir);
|
|
89678
90761
|
}
|
|
89679
90762
|
});
|
|
@@ -89853,7 +90936,7 @@ var ProjectAnalyzer = class {
|
|
|
89853
90936
|
"htmlcov/index.html"
|
|
89854
90937
|
];
|
|
89855
90938
|
for (const coveragePath of coveragePaths) {
|
|
89856
|
-
const fullPath =
|
|
90939
|
+
const fullPath = join14(this.projectRoot, coveragePath);
|
|
89857
90940
|
if (existsSync13(fullPath)) {
|
|
89858
90941
|
if (coveragePath.endsWith(".json")) {
|
|
89859
90942
|
try {
|
|
@@ -89893,9 +90976,9 @@ var ProjectAnalyzer = class {
|
|
|
89893
90976
|
* Detect project type
|
|
89894
90977
|
*/
|
|
89895
90978
|
detectProjectType() {
|
|
89896
|
-
if (existsSync13(
|
|
89897
|
-
if (existsSync13(
|
|
89898
|
-
if (existsSync13(
|
|
90979
|
+
if (existsSync13(join14(this.projectRoot, "lerna.json"))) return "monorepo";
|
|
90980
|
+
if (existsSync13(join14(this.projectRoot, "pnpm-workspace.yaml"))) return "monorepo";
|
|
90981
|
+
if (existsSync13(join14(this.projectRoot, "packages"))) return "monorepo";
|
|
89899
90982
|
const pkg = readPackageJson(this.projectRoot);
|
|
89900
90983
|
if (pkg?.workspaces) return "monorepo";
|
|
89901
90984
|
if (pkg?.main || pkg?.module || pkg?.exports) return "library";
|
|
@@ -89905,10 +90988,10 @@ var ProjectAnalyzer = class {
|
|
|
89905
90988
|
* Detect package manager
|
|
89906
90989
|
*/
|
|
89907
90990
|
detectPackageManager() {
|
|
89908
|
-
if (existsSync13(
|
|
89909
|
-
if (existsSync13(
|
|
89910
|
-
if (existsSync13(
|
|
89911
|
-
if (existsSync13(
|
|
90991
|
+
if (existsSync13(join14(this.projectRoot, "bun.lockb"))) return "bun";
|
|
90992
|
+
if (existsSync13(join14(this.projectRoot, "pnpm-lock.yaml"))) return "pnpm";
|
|
90993
|
+
if (existsSync13(join14(this.projectRoot, "yarn.lock"))) return "yarn";
|
|
90994
|
+
if (existsSync13(join14(this.projectRoot, "package-lock.json"))) return "npm";
|
|
89912
90995
|
return "unknown";
|
|
89913
90996
|
}
|
|
89914
90997
|
/**
|
|
@@ -89923,16 +91006,16 @@ var ProjectAnalyzer = class {
|
|
|
89923
91006
|
".travis.yml",
|
|
89924
91007
|
"azure-pipelines.yml"
|
|
89925
91008
|
];
|
|
89926
|
-
return ciFiles.some((f) => existsSync13(
|
|
91009
|
+
return ciFiles.some((f) => existsSync13(join14(this.projectRoot, f)));
|
|
89927
91010
|
}
|
|
89928
91011
|
/**
|
|
89929
91012
|
* Detect CI provider
|
|
89930
91013
|
*/
|
|
89931
91014
|
detectCIProvider() {
|
|
89932
|
-
if (existsSync13(
|
|
89933
|
-
if (existsSync13(
|
|
89934
|
-
if (existsSync13(
|
|
89935
|
-
if (existsSync13(
|
|
91015
|
+
if (existsSync13(join14(this.projectRoot, ".github/workflows"))) return "github-actions";
|
|
91016
|
+
if (existsSync13(join14(this.projectRoot, ".gitlab-ci.yml"))) return "gitlab-ci";
|
|
91017
|
+
if (existsSync13(join14(this.projectRoot, "Jenkinsfile"))) return "jenkins";
|
|
91018
|
+
if (existsSync13(join14(this.projectRoot, ".circleci/config.yml"))) return "circleci";
|
|
89936
91019
|
if (this.detectCIConfig()) return "other";
|
|
89937
91020
|
return void 0;
|
|
89938
91021
|
}
|
|
@@ -90054,7 +91137,6 @@ var configurationRules = [
|
|
|
90054
91137
|
condition: (a) => a.existingTests.totalCount === 0,
|
|
90055
91138
|
apply: (config) => {
|
|
90056
91139
|
config.workers.enabled = ["pattern-consolidator"];
|
|
90057
|
-
config.domains.enabled = ["test-generation", "coverage-analysis", "learning-optimization"];
|
|
90058
91140
|
config.learning.qualityThreshold = 0.5;
|
|
90059
91141
|
config.learning.promotionThreshold = 2;
|
|
90060
91142
|
}
|
|
@@ -90217,28 +91299,29 @@ var SelfConfigurator = class {
|
|
|
90217
91299
|
}
|
|
90218
91300
|
/**
|
|
90219
91301
|
* Recommend enabled domains
|
|
91302
|
+
*
|
|
91303
|
+
* IMPORTANT: Always enable ALL 12 domains by default.
|
|
91304
|
+
* Limiting domains causes "No factory registered" errors in fleet_init
|
|
91305
|
+
* when MCP tools try to use domains that aren't enabled.
|
|
91306
|
+
*
|
|
91307
|
+
* Project analysis is used for prioritization and worker selection,
|
|
91308
|
+
* but all domains remain available for users who need them.
|
|
90220
91309
|
*/
|
|
90221
|
-
recommendDomains(
|
|
90222
|
-
|
|
91310
|
+
recommendDomains(_analysis) {
|
|
91311
|
+
return [
|
|
90223
91312
|
"test-generation",
|
|
90224
91313
|
"test-execution",
|
|
90225
91314
|
"coverage-analysis",
|
|
91315
|
+
"quality-assessment",
|
|
91316
|
+
"defect-intelligence",
|
|
91317
|
+
"requirements-validation",
|
|
91318
|
+
"code-intelligence",
|
|
91319
|
+
"security-compliance",
|
|
91320
|
+
"contract-testing",
|
|
91321
|
+
"visual-accessibility",
|
|
91322
|
+
"chaos-resilience",
|
|
90226
91323
|
"learning-optimization"
|
|
90227
|
-
]
|
|
90228
|
-
if (analysis.hasCIConfig) {
|
|
90229
|
-
domains.add("quality-assessment");
|
|
90230
|
-
}
|
|
90231
|
-
if (analysis.codeComplexity.totalFiles > 100) {
|
|
90232
|
-
domains.add("security-compliance");
|
|
90233
|
-
}
|
|
90234
|
-
if (analysis.frameworks.some((f) => ["playwright", "cypress"].includes(f.name))) {
|
|
90235
|
-
domains.add("visual-accessibility");
|
|
90236
|
-
}
|
|
90237
|
-
if (analysis.hasTypeScript || analysis.codeComplexity.recommendation === "complex") {
|
|
90238
|
-
domains.add("code-intelligence");
|
|
90239
|
-
}
|
|
90240
|
-
domains.add("contract-testing");
|
|
90241
|
-
return Array.from(domains);
|
|
91324
|
+
];
|
|
90242
91325
|
}
|
|
90243
91326
|
/**
|
|
90244
91327
|
* Recommend max concurrent agents
|
|
@@ -90256,7 +91339,7 @@ function createSelfConfigurator(options) {
|
|
|
90256
91339
|
|
|
90257
91340
|
// src/init/skills-installer.ts
|
|
90258
91341
|
import { existsSync as existsSync14, mkdirSync as mkdirSync5, readdirSync as readdirSync5, statSync as statSync5, readFileSync as readFileSync11, writeFileSync as writeFileSync2, copyFileSync as copyFileSync2 } from "fs";
|
|
90259
|
-
import { join as
|
|
91342
|
+
import { join as join15, dirname as dirname4 } from "path";
|
|
90260
91343
|
import { fileURLToPath } from "url";
|
|
90261
91344
|
var V3_DOMAIN_SKILLS = [
|
|
90262
91345
|
// 12 DDD bounded context skills
|
|
@@ -90366,25 +91449,25 @@ var SkillsInstaller = class {
|
|
|
90366
91449
|
const moduleDir = dirname4(fileURLToPath(import.meta.url));
|
|
90367
91450
|
const possiblePaths = [
|
|
90368
91451
|
// Development: relative to v3/src/init/ (3 levels up to agentic-qe root)
|
|
90369
|
-
|
|
91452
|
+
join15(moduleDir, "../../../.claude/skills"),
|
|
90370
91453
|
// Development: relative to v3/dist/init/ (3 levels up to agentic-qe root)
|
|
90371
|
-
|
|
91454
|
+
join15(moduleDir, "../../../.claude/skills"),
|
|
90372
91455
|
// NPM package: assets directory at package root (dist/init -> dist -> package root)
|
|
90373
|
-
|
|
91456
|
+
join15(moduleDir, "../../assets/skills"),
|
|
90374
91457
|
// Local install: in node_modules
|
|
90375
|
-
|
|
91458
|
+
join15(this.projectRoot, "node_modules/@agentic-qe/v3/assets/skills")
|
|
90376
91459
|
];
|
|
90377
91460
|
try {
|
|
90378
91461
|
const { execSync: execSync7 } = __require("child_process");
|
|
90379
91462
|
const npmPrefix = execSync7("npm config get prefix", { encoding: "utf-8" }).trim();
|
|
90380
91463
|
possiblePaths.push(
|
|
90381
91464
|
// Global install as @agentic-qe/v3
|
|
90382
|
-
|
|
91465
|
+
join15(npmPrefix, "lib/node_modules/@agentic-qe/v3/assets/skills"),
|
|
90383
91466
|
// Global install as agentic-qe (root package)
|
|
90384
|
-
|
|
91467
|
+
join15(npmPrefix, "lib/node_modules/agentic-qe/.claude/skills"),
|
|
90385
91468
|
// Linux global without lib
|
|
90386
|
-
|
|
90387
|
-
|
|
91469
|
+
join15(npmPrefix, "node_modules/@agentic-qe/v3/assets/skills"),
|
|
91470
|
+
join15(npmPrefix, "node_modules/agentic-qe/.claude/skills")
|
|
90388
91471
|
);
|
|
90389
91472
|
} catch (error) {
|
|
90390
91473
|
console.debug("[SkillsInstaller] npm prefix lookup failed:", error instanceof Error ? error.message : error);
|
|
@@ -90405,13 +91488,13 @@ var SkillsInstaller = class {
|
|
|
90405
91488
|
skipped: [],
|
|
90406
91489
|
errors: [],
|
|
90407
91490
|
totalCount: 0,
|
|
90408
|
-
skillsDir:
|
|
91491
|
+
skillsDir: join15(this.projectRoot, ".claude", "skills")
|
|
90409
91492
|
};
|
|
90410
91493
|
if (!existsSync14(this.sourceSkillsDir)) {
|
|
90411
91494
|
result.errors.push(`Source skills directory not found: ${this.sourceSkillsDir}`);
|
|
90412
91495
|
return result;
|
|
90413
91496
|
}
|
|
90414
|
-
const targetSkillsDir =
|
|
91497
|
+
const targetSkillsDir = join15(this.projectRoot, ".claude", "skills");
|
|
90415
91498
|
if (!existsSync14(targetSkillsDir)) {
|
|
90416
91499
|
mkdirSync5(targetSkillsDir, { recursive: true });
|
|
90417
91500
|
}
|
|
@@ -90440,7 +91523,7 @@ var SkillsInstaller = class {
|
|
|
90440
91523
|
try {
|
|
90441
91524
|
const entries = readdirSync5(this.sourceSkillsDir);
|
|
90442
91525
|
return entries.filter((entry) => {
|
|
90443
|
-
const fullPath =
|
|
91526
|
+
const fullPath = join15(this.sourceSkillsDir, entry);
|
|
90444
91527
|
return statSync5(fullPath).isDirectory() && !entry.startsWith(".");
|
|
90445
91528
|
});
|
|
90446
91529
|
} catch {
|
|
@@ -90474,8 +91557,8 @@ var SkillsInstaller = class {
|
|
|
90474
91557
|
* Install a single skill
|
|
90475
91558
|
*/
|
|
90476
91559
|
async installSkill(skillName, targetDir) {
|
|
90477
|
-
const sourceDir =
|
|
90478
|
-
const targetSkillDir =
|
|
91560
|
+
const sourceDir = join15(this.sourceSkillsDir, skillName);
|
|
91561
|
+
const targetSkillDir = join15(targetDir, skillName);
|
|
90479
91562
|
if (existsSync14(targetSkillDir) && !this.options.overwrite) {
|
|
90480
91563
|
return null;
|
|
90481
91564
|
}
|
|
@@ -90485,7 +91568,7 @@ var SkillsInstaller = class {
|
|
|
90485
91568
|
this.copyDirectoryRecursive(sourceDir, targetSkillDir);
|
|
90486
91569
|
const skillType = this.getSkillType(skillName);
|
|
90487
91570
|
const description = this.getSkillDescription(targetSkillDir);
|
|
90488
|
-
const hasResources = existsSync14(
|
|
91571
|
+
const hasResources = existsSync14(join15(targetSkillDir, "resources"));
|
|
90489
91572
|
return {
|
|
90490
91573
|
name: skillName,
|
|
90491
91574
|
type: skillType,
|
|
@@ -90499,8 +91582,8 @@ var SkillsInstaller = class {
|
|
|
90499
91582
|
copyDirectoryRecursive(source, target) {
|
|
90500
91583
|
const entries = readdirSync5(source);
|
|
90501
91584
|
for (const entry of entries) {
|
|
90502
|
-
const sourcePath =
|
|
90503
|
-
const targetPath =
|
|
91585
|
+
const sourcePath = join15(source, entry);
|
|
91586
|
+
const targetPath = join15(target, entry);
|
|
90504
91587
|
const stat3 = statSync5(sourcePath);
|
|
90505
91588
|
if (stat3.isDirectory()) {
|
|
90506
91589
|
if (!existsSync14(targetPath)) {
|
|
@@ -90523,7 +91606,7 @@ var SkillsInstaller = class {
|
|
|
90523
91606
|
* Extract description from SKILL.md file
|
|
90524
91607
|
*/
|
|
90525
91608
|
getSkillDescription(skillDir) {
|
|
90526
|
-
const skillMdPath =
|
|
91609
|
+
const skillMdPath = join15(skillDir, "SKILL.md");
|
|
90527
91610
|
if (!existsSync14(skillMdPath)) return void 0;
|
|
90528
91611
|
try {
|
|
90529
91612
|
const content = readFileSync11(skillMdPath, "utf-8");
|
|
@@ -90576,7 +91659,7 @@ ${v3Skills.map((s) => `- **${s.name}**${s.description ? `: ${s.description}` : "
|
|
|
90576
91659
|
|
|
90577
91660
|
*Generated by AQE v3 init on ${(/* @__PURE__ */ new Date()).toISOString()}*
|
|
90578
91661
|
`;
|
|
90579
|
-
writeFileSync2(
|
|
91662
|
+
writeFileSync2(join15(skillsDir, "README.md"), indexContent, "utf-8");
|
|
90580
91663
|
}
|
|
90581
91664
|
};
|
|
90582
91665
|
function createSkillsInstaller(options) {
|
|
@@ -90585,7 +91668,7 @@ function createSkillsInstaller(options) {
|
|
|
90585
91668
|
|
|
90586
91669
|
// src/init/agents-installer.ts
|
|
90587
91670
|
import { existsSync as existsSync15, mkdirSync as mkdirSync6, readdirSync as readdirSync6, statSync as statSync6, readFileSync as readFileSync12, writeFileSync as writeFileSync3, copyFileSync as copyFileSync3 } from "fs";
|
|
90588
|
-
import { join as
|
|
91671
|
+
import { join as join16, dirname as dirname5 } from "path";
|
|
90589
91672
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
90590
91673
|
var V3_QE_AGENTS = [
|
|
90591
91674
|
// Test Generation Domain
|
|
@@ -90673,25 +91756,25 @@ var AgentsInstaller = class {
|
|
|
90673
91756
|
const possiblePaths = [
|
|
90674
91757
|
// NPM package: assets directory at package root (dist/init -> dist -> package root)
|
|
90675
91758
|
// This is the canonical source with helpers/ directory
|
|
90676
|
-
|
|
91759
|
+
join16(moduleDir, "../../assets/agents/v3"),
|
|
90677
91760
|
// Development: v3/src/init/ -> v3/assets/agents/v3/
|
|
90678
|
-
|
|
91761
|
+
join16(moduleDir, "../../../v3/assets/agents/v3"),
|
|
90679
91762
|
// Fallback: root .claude/agents/v3 (may not have helpers/)
|
|
90680
|
-
|
|
91763
|
+
join16(moduleDir, "../../../.claude/agents/v3"),
|
|
90681
91764
|
// Local install: in node_modules
|
|
90682
|
-
|
|
91765
|
+
join16(this.projectRoot, "node_modules/@agentic-qe/v3/assets/agents/v3")
|
|
90683
91766
|
];
|
|
90684
91767
|
try {
|
|
90685
91768
|
const { execSync: execSync7 } = __require("child_process");
|
|
90686
91769
|
const npmPrefix = execSync7("npm config get prefix", { encoding: "utf-8" }).trim();
|
|
90687
91770
|
possiblePaths.push(
|
|
90688
91771
|
// Global install as @agentic-qe/v3
|
|
90689
|
-
|
|
91772
|
+
join16(npmPrefix, "lib/node_modules/@agentic-qe/v3/assets/agents/v3"),
|
|
90690
91773
|
// Global install as agentic-qe (root package)
|
|
90691
|
-
|
|
91774
|
+
join16(npmPrefix, "lib/node_modules/agentic-qe/v3/assets/agents/v3"),
|
|
90692
91775
|
// Linux global without lib
|
|
90693
|
-
|
|
90694
|
-
|
|
91776
|
+
join16(npmPrefix, "node_modules/@agentic-qe/v3/assets/agents/v3"),
|
|
91777
|
+
join16(npmPrefix, "node_modules/agentic-qe/v3/assets/agents/v3")
|
|
90695
91778
|
);
|
|
90696
91779
|
} catch (error) {
|
|
90697
91780
|
console.debug("[AgentsInstaller] npm prefix lookup failed:", error instanceof Error ? error.message : error);
|
|
@@ -90712,17 +91795,17 @@ var AgentsInstaller = class {
|
|
|
90712
91795
|
skipped: [],
|
|
90713
91796
|
errors: [],
|
|
90714
91797
|
totalCount: 0,
|
|
90715
|
-
agentsDir:
|
|
91798
|
+
agentsDir: join16(this.projectRoot, ".claude", "agents", "v3")
|
|
90716
91799
|
};
|
|
90717
91800
|
if (!existsSync15(this.sourceAgentsDir)) {
|
|
90718
91801
|
result.errors.push(`Source agents directory not found: ${this.sourceAgentsDir}`);
|
|
90719
91802
|
return result;
|
|
90720
91803
|
}
|
|
90721
|
-
const targetAgentsDir =
|
|
91804
|
+
const targetAgentsDir = join16(this.projectRoot, ".claude", "agents", "v3");
|
|
90722
91805
|
if (!existsSync15(targetAgentsDir)) {
|
|
90723
91806
|
mkdirSync6(targetAgentsDir, { recursive: true });
|
|
90724
91807
|
}
|
|
90725
|
-
const targetSubagentsDir =
|
|
91808
|
+
const targetSubagentsDir = join16(targetAgentsDir, "subagents");
|
|
90726
91809
|
if (!existsSync15(targetSubagentsDir)) {
|
|
90727
91810
|
mkdirSync6(targetSubagentsDir, { recursive: true });
|
|
90728
91811
|
}
|
|
@@ -90753,7 +91836,7 @@ var AgentsInstaller = class {
|
|
|
90753
91836
|
try {
|
|
90754
91837
|
const entries = readdirSync6(this.sourceAgentsDir);
|
|
90755
91838
|
for (const entry of entries) {
|
|
90756
|
-
const fullPath =
|
|
91839
|
+
const fullPath = join16(this.sourceAgentsDir, entry);
|
|
90757
91840
|
const stat3 = statSync6(fullPath);
|
|
90758
91841
|
if (stat3.isFile() && entry.endsWith(".md")) {
|
|
90759
91842
|
agents.push(entry.replace(".md", ""));
|
|
@@ -90812,8 +91895,8 @@ var AgentsInstaller = class {
|
|
|
90812
91895
|
async installAgent(agentPath, targetDir, targetSubagentsDir) {
|
|
90813
91896
|
const isSubagent = agentPath.startsWith("subagents/");
|
|
90814
91897
|
const agentName = isSubagent ? agentPath.split("/")[1] : agentPath;
|
|
90815
|
-
const sourceFile =
|
|
90816
|
-
const targetFile = isSubagent ?
|
|
91898
|
+
const sourceFile = join16(this.sourceAgentsDir, `${agentPath}.md`);
|
|
91899
|
+
const targetFile = isSubagent ? join16(targetSubagentsDir, `${agentName}.md`) : join16(targetDir, `${agentName}.md`);
|
|
90817
91900
|
if (existsSync15(targetFile) && !this.options.overwrite) {
|
|
90818
91901
|
return null;
|
|
90819
91902
|
}
|
|
@@ -90849,8 +91932,8 @@ var AgentsInstaller = class {
|
|
|
90849
91932
|
}
|
|
90850
91933
|
const entries = readdirSync6(source);
|
|
90851
91934
|
for (const entry of entries) {
|
|
90852
|
-
const sourcePath =
|
|
90853
|
-
const targetPath =
|
|
91935
|
+
const sourcePath = join16(source, entry);
|
|
91936
|
+
const targetPath = join16(target, entry);
|
|
90854
91937
|
const stat3 = statSync6(sourcePath);
|
|
90855
91938
|
if (stat3.isDirectory()) {
|
|
90856
91939
|
this.copyDirectoryRecursive(sourcePath, targetPath);
|
|
@@ -90865,8 +91948,8 @@ var AgentsInstaller = class {
|
|
|
90865
91948
|
* Copy helpers directory (agent-specific reference files, templates, scripts)
|
|
90866
91949
|
*/
|
|
90867
91950
|
async copyHelpersDirectory(targetAgentsDir) {
|
|
90868
|
-
const sourceHelpersDir =
|
|
90869
|
-
const targetHelpersDir =
|
|
91951
|
+
const sourceHelpersDir = join16(this.sourceAgentsDir, "helpers");
|
|
91952
|
+
const targetHelpersDir = join16(targetAgentsDir, "helpers");
|
|
90870
91953
|
if (existsSync15(sourceHelpersDir)) {
|
|
90871
91954
|
this.copyDirectoryRecursive(sourceHelpersDir, targetHelpersDir);
|
|
90872
91955
|
}
|
|
@@ -90998,7 +92081,7 @@ ${subagents.map((a) => `- **${a.name}**${a.description ? `: ${a.description}` :
|
|
|
90998
92081
|
|
|
90999
92082
|
*Generated by AQE v3 init on ${(/* @__PURE__ */ new Date()).toISOString()}*
|
|
91000
92083
|
`;
|
|
91001
|
-
writeFileSync3(
|
|
92084
|
+
writeFileSync3(join16(agentsDir, "README.md"), indexContent, "utf-8");
|
|
91002
92085
|
}
|
|
91003
92086
|
};
|
|
91004
92087
|
function createAgentsInstaller(options) {
|
|
@@ -91014,7 +92097,7 @@ import {
|
|
|
91014
92097
|
writeFileSync as writeFileSync4,
|
|
91015
92098
|
copyFileSync as copyFileSync4
|
|
91016
92099
|
} from "fs";
|
|
91017
|
-
import { join as
|
|
92100
|
+
import { join as join17, dirname as dirname6 } from "path";
|
|
91018
92101
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
91019
92102
|
var __filename2 = fileURLToPath3(import.meta.url);
|
|
91020
92103
|
var __dirname2 = dirname6(__filename2);
|
|
@@ -91077,38 +92160,38 @@ var N8nInstaller = class {
|
|
|
91077
92160
|
findSourceAgentsDir() {
|
|
91078
92161
|
const possiblePaths = [
|
|
91079
92162
|
// From v3/src/init/ context (development)
|
|
91080
|
-
|
|
91081
|
-
|
|
92163
|
+
join17(__dirname2, "../../../.claude/agents/n8n"),
|
|
92164
|
+
join17(__dirname2, "../../.claude/agents/n8n"),
|
|
91082
92165
|
// From project root
|
|
91083
|
-
|
|
92166
|
+
join17(process.cwd(), ".claude/agents/n8n"),
|
|
91084
92167
|
// NPM package location
|
|
91085
|
-
|
|
92168
|
+
join17(__dirname2, "../../assets/agents/n8n"),
|
|
91086
92169
|
// Monorepo location
|
|
91087
|
-
|
|
92170
|
+
join17(process.cwd(), "../.claude/agents/n8n")
|
|
91088
92171
|
];
|
|
91089
92172
|
for (const path16 of possiblePaths) {
|
|
91090
92173
|
if (existsSync16(path16)) {
|
|
91091
92174
|
return path16;
|
|
91092
92175
|
}
|
|
91093
92176
|
}
|
|
91094
|
-
return
|
|
92177
|
+
return join17(process.cwd(), ".claude/agents/n8n");
|
|
91095
92178
|
}
|
|
91096
92179
|
/**
|
|
91097
92180
|
* Find the source skills directory
|
|
91098
92181
|
*/
|
|
91099
92182
|
findSourceSkillsDir() {
|
|
91100
92183
|
const possiblePaths = [
|
|
91101
|
-
|
|
91102
|
-
|
|
91103
|
-
|
|
91104
|
-
|
|
92184
|
+
join17(__dirname2, "../../../.claude/skills"),
|
|
92185
|
+
join17(__dirname2, "../../.claude/skills"),
|
|
92186
|
+
join17(process.cwd(), ".claude/skills"),
|
|
92187
|
+
join17(__dirname2, "../../assets/skills")
|
|
91105
92188
|
];
|
|
91106
92189
|
for (const path16 of possiblePaths) {
|
|
91107
92190
|
if (existsSync16(path16)) {
|
|
91108
92191
|
return path16;
|
|
91109
92192
|
}
|
|
91110
92193
|
}
|
|
91111
|
-
return
|
|
92194
|
+
return join17(process.cwd(), ".claude/skills");
|
|
91112
92195
|
}
|
|
91113
92196
|
// ==========================================================================
|
|
91114
92197
|
// Installation
|
|
@@ -91123,8 +92206,8 @@ var N8nInstaller = class {
|
|
|
91123
92206
|
skillsInstalled: [],
|
|
91124
92207
|
configGenerated: false,
|
|
91125
92208
|
errors: [],
|
|
91126
|
-
agentsDir:
|
|
91127
|
-
skillsDir:
|
|
92209
|
+
agentsDir: join17(this.projectRoot, ".claude/agents/n8n"),
|
|
92210
|
+
skillsDir: join17(this.projectRoot, ".claude/skills")
|
|
91128
92211
|
};
|
|
91129
92212
|
try {
|
|
91130
92213
|
if (this.options.installAgents) {
|
|
@@ -91169,8 +92252,8 @@ var N8nInstaller = class {
|
|
|
91169
92252
|
);
|
|
91170
92253
|
for (const category of Object.keys(N8N_AGENTS)) {
|
|
91171
92254
|
for (const agent of N8N_AGENTS[category]) {
|
|
91172
|
-
const sourceFile =
|
|
91173
|
-
const targetFile =
|
|
92255
|
+
const sourceFile = join17(this.sourceAgentsDir, agent.filename);
|
|
92256
|
+
const targetFile = join17(targetDir, agent.filename);
|
|
91174
92257
|
if (!availableFiles.includes(agent.filename)) {
|
|
91175
92258
|
continue;
|
|
91176
92259
|
}
|
|
@@ -91206,8 +92289,8 @@ var N8nInstaller = class {
|
|
|
91206
92289
|
return { installed, errors };
|
|
91207
92290
|
}
|
|
91208
92291
|
for (const skillName of N8N_SKILLS) {
|
|
91209
|
-
const sourceSkillDir =
|
|
91210
|
-
const targetSkillDir =
|
|
92292
|
+
const sourceSkillDir = join17(this.sourceSkillsDir, skillName);
|
|
92293
|
+
const targetSkillDir = join17(targetDir, skillName);
|
|
91211
92294
|
if (!existsSync16(sourceSkillDir)) {
|
|
91212
92295
|
continue;
|
|
91213
92296
|
}
|
|
@@ -91234,8 +92317,8 @@ var N8nInstaller = class {
|
|
|
91234
92317
|
}
|
|
91235
92318
|
const entries = readdirSync7(source, { withFileTypes: true });
|
|
91236
92319
|
for (const entry of entries) {
|
|
91237
|
-
const sourcePath =
|
|
91238
|
-
const targetPath =
|
|
92320
|
+
const sourcePath = join17(source, entry.name);
|
|
92321
|
+
const targetPath = join17(target, entry.name);
|
|
91239
92322
|
if (entry.isDirectory()) {
|
|
91240
92323
|
this.copyDirectory(sourcePath, targetPath);
|
|
91241
92324
|
} else {
|
|
@@ -91247,7 +92330,7 @@ var N8nInstaller = class {
|
|
|
91247
92330
|
* Create agents index README
|
|
91248
92331
|
*/
|
|
91249
92332
|
createAgentsIndex(targetDir, agents) {
|
|
91250
|
-
const indexPath =
|
|
92333
|
+
const indexPath = join17(targetDir, "README.md");
|
|
91251
92334
|
const byCategory = {
|
|
91252
92335
|
core: agents.filter((a) => a.category === "core"),
|
|
91253
92336
|
advanced: agents.filter((a) => a.category === "advanced"),
|
|
@@ -91486,7 +92569,7 @@ var InitOrchestrator = class {
|
|
|
91486
92569
|
* This marks the installation as v3
|
|
91487
92570
|
*/
|
|
91488
92571
|
async writeVersionToDb(version) {
|
|
91489
|
-
const memoryDbPath =
|
|
92572
|
+
const memoryDbPath = join18(this.projectRoot, ".agentic-qe", "memory.db");
|
|
91490
92573
|
try {
|
|
91491
92574
|
const dir = dirname7(memoryDbPath);
|
|
91492
92575
|
if (!existsSync17(dir)) {
|
|
@@ -91536,15 +92619,15 @@ var InitOrchestrator = class {
|
|
|
91536
92619
|
* 3. If no version or version < 3.0.0, and v2 markers exist, it's v2
|
|
91537
92620
|
*/
|
|
91538
92621
|
async detectV2Installation() {
|
|
91539
|
-
const memoryDbPath =
|
|
91540
|
-
const configPath =
|
|
91541
|
-
const agentsPath =
|
|
91542
|
-
const v2ConfigFile =
|
|
92622
|
+
const memoryDbPath = join18(this.projectRoot, ".agentic-qe", "memory.db");
|
|
92623
|
+
const configPath = join18(this.projectRoot, ".agentic-qe", "config");
|
|
92624
|
+
const agentsPath = join18(this.projectRoot, ".claude", "agents");
|
|
92625
|
+
const v2ConfigFile = join18(this.projectRoot, ".agentic-qe", "config", "learning.json");
|
|
91543
92626
|
const hasMemoryDb = existsSync17(memoryDbPath);
|
|
91544
92627
|
const hasConfig = existsSync17(configPath);
|
|
91545
92628
|
const hasAgents = existsSync17(agentsPath);
|
|
91546
92629
|
const hasV2ConfigFiles = existsSync17(v2ConfigFile);
|
|
91547
|
-
const hasV3ConfigYaml = existsSync17(
|
|
92630
|
+
const hasV3ConfigYaml = existsSync17(join18(this.projectRoot, ".agentic-qe", "config.yaml"));
|
|
91548
92631
|
let version;
|
|
91549
92632
|
let isV3Installation = false;
|
|
91550
92633
|
if (hasMemoryDb) {
|
|
@@ -91761,7 +92844,7 @@ var InitOrchestrator = class {
|
|
|
91761
92844
|
const { V2ToV3Migrator: V2ToV3Migrator2 } = await Promise.resolve().then(() => (init_v2_to_v3_migration(), v2_to_v3_migration_exports));
|
|
91762
92845
|
if (v2Detection.memoryDbPath) {
|
|
91763
92846
|
console.log(" Migrating V2 data to V3 format...");
|
|
91764
|
-
const v3PatternsDbPath =
|
|
92847
|
+
const v3PatternsDbPath = join18(this.projectRoot, ".agentic-qe", "memory.db");
|
|
91765
92848
|
const migrator = new V2ToV3Migrator2({
|
|
91766
92849
|
v2DbPath: v2Detection.memoryDbPath,
|
|
91767
92850
|
v3PatternsDbPath,
|
|
@@ -91795,7 +92878,7 @@ var InitOrchestrator = class {
|
|
|
91795
92878
|
* Removes qe-* files and specific v2 agents (qx-partner, base-template-generator)
|
|
91796
92879
|
*/
|
|
91797
92880
|
async removeV2QEAgents() {
|
|
91798
|
-
const agentsDir =
|
|
92881
|
+
const agentsDir = join18(this.projectRoot, ".claude", "agents");
|
|
91799
92882
|
if (!existsSync17(agentsDir)) {
|
|
91800
92883
|
return;
|
|
91801
92884
|
}
|
|
@@ -91808,13 +92891,13 @@ var InitOrchestrator = class {
|
|
|
91808
92891
|
const v2QEAgents = [];
|
|
91809
92892
|
for (const entry of entries) {
|
|
91810
92893
|
if (entry.startsWith("qe-") && entry.endsWith(".md")) {
|
|
91811
|
-
const fullPath =
|
|
92894
|
+
const fullPath = join18(agentsDir, entry);
|
|
91812
92895
|
const stat3 = statSync7(fullPath);
|
|
91813
92896
|
if (stat3.isFile()) {
|
|
91814
92897
|
v2QEAgents.push(entry);
|
|
91815
92898
|
}
|
|
91816
92899
|
} else if (V2_LEGACY_AGENTS.includes(entry)) {
|
|
91817
|
-
const fullPath =
|
|
92900
|
+
const fullPath = join18(agentsDir, entry);
|
|
91818
92901
|
const stat3 = statSync7(fullPath);
|
|
91819
92902
|
if (stat3.isFile()) {
|
|
91820
92903
|
v2QEAgents.push(entry);
|
|
@@ -91825,14 +92908,14 @@ var InitOrchestrator = class {
|
|
|
91825
92908
|
return;
|
|
91826
92909
|
}
|
|
91827
92910
|
console.log(` Removing ${v2QEAgents.length} v2 QE agents from .claude/agents/...`);
|
|
91828
|
-
const backupDir =
|
|
92911
|
+
const backupDir = join18(this.projectRoot, ".agentic-qe", "backup", "v2-agents");
|
|
91829
92912
|
if (!existsSync17(backupDir)) {
|
|
91830
92913
|
mkdirSync8(backupDir, { recursive: true });
|
|
91831
92914
|
}
|
|
91832
92915
|
const { renameSync } = await import("fs");
|
|
91833
92916
|
for (const agent of v2QEAgents) {
|
|
91834
|
-
const sourcePath =
|
|
91835
|
-
const backupPath =
|
|
92917
|
+
const sourcePath = join18(agentsDir, agent);
|
|
92918
|
+
const backupPath = join18(backupDir, agent);
|
|
91836
92919
|
try {
|
|
91837
92920
|
copyFileSync5(sourcePath, backupPath);
|
|
91838
92921
|
unlinkSync2(sourcePath);
|
|
@@ -91851,16 +92934,16 @@ var InitOrchestrator = class {
|
|
|
91851
92934
|
*/
|
|
91852
92935
|
async migrateV2Config(v2Detection) {
|
|
91853
92936
|
if (!v2Detection.hasConfig) return;
|
|
91854
|
-
const v2ConfigDir =
|
|
91855
|
-
const v3ConfigPath =
|
|
92937
|
+
const v2ConfigDir = join18(this.projectRoot, ".agentic-qe", "config");
|
|
92938
|
+
const v3ConfigPath = join18(this.projectRoot, ".agentic-qe", "config.yaml");
|
|
91856
92939
|
if (existsSync17(v3ConfigPath)) {
|
|
91857
92940
|
console.log(" \u2713 V3 config already exists, preserving...");
|
|
91858
92941
|
return;
|
|
91859
92942
|
}
|
|
91860
92943
|
try {
|
|
91861
|
-
const learningConfig = this.readJsonSafe(
|
|
91862
|
-
const improvementConfig = this.readJsonSafe(
|
|
91863
|
-
const codeIntelConfig = this.readJsonSafe(
|
|
92944
|
+
const learningConfig = this.readJsonSafe(join18(v2ConfigDir, "learning.json"));
|
|
92945
|
+
const improvementConfig = this.readJsonSafe(join18(v2ConfigDir, "improvement.json"));
|
|
92946
|
+
const codeIntelConfig = this.readJsonSafe(join18(v2ConfigDir, "code-intelligence.json"));
|
|
91864
92947
|
const v3Config = {
|
|
91865
92948
|
version: "3.0.0",
|
|
91866
92949
|
migratedFrom: v2Detection.version || "2.x.x",
|
|
@@ -91911,7 +92994,22 @@ var InitOrchestrator = class {
|
|
|
91911
92994
|
overwrite: false
|
|
91912
92995
|
},
|
|
91913
92996
|
domains: {
|
|
91914
|
-
|
|
92997
|
+
// Enable ALL domains - v3 supports all 12 DDD domains
|
|
92998
|
+
// Limiting to 3 causes "No factory registered" errors in fleet_init
|
|
92999
|
+
enabled: [
|
|
93000
|
+
"test-generation",
|
|
93001
|
+
"test-execution",
|
|
93002
|
+
"coverage-analysis",
|
|
93003
|
+
"quality-assessment",
|
|
93004
|
+
"defect-intelligence",
|
|
93005
|
+
"requirements-validation",
|
|
93006
|
+
"code-intelligence",
|
|
93007
|
+
"security-compliance",
|
|
93008
|
+
"contract-testing",
|
|
93009
|
+
"visual-accessibility",
|
|
93010
|
+
"chaos-resilience",
|
|
93011
|
+
"learning-optimization"
|
|
93012
|
+
],
|
|
91915
93013
|
disabled: []
|
|
91916
93014
|
},
|
|
91917
93015
|
agents: {
|
|
@@ -92014,7 +93112,7 @@ ${yaml.stringify(v3Config)}`;
|
|
|
92014
93112
|
* Uses memory backend to check code-intelligence:kg namespace
|
|
92015
93113
|
*/
|
|
92016
93114
|
async checkCodeIntelligenceIndex() {
|
|
92017
|
-
const dbPath =
|
|
93115
|
+
const dbPath = join18(this.projectRoot, ".agentic-qe", "memory.db");
|
|
92018
93116
|
if (!existsSync17(dbPath)) {
|
|
92019
93117
|
return false;
|
|
92020
93118
|
}
|
|
@@ -92057,7 +93155,7 @@ ${yaml.stringify(v3Config)}`;
|
|
|
92057
93155
|
ignore: ["node_modules/**", "dist/**", "coverage/**", ".agentic-qe/**"]
|
|
92058
93156
|
});
|
|
92059
93157
|
const result = await kgService.index({
|
|
92060
|
-
paths: files.map((f) =>
|
|
93158
|
+
paths: files.map((f) => join18(projectPath, f)),
|
|
92061
93159
|
incremental: false,
|
|
92062
93160
|
includeTests: true
|
|
92063
93161
|
});
|
|
@@ -92078,7 +93176,7 @@ ${yaml.stringify(v3Config)}`;
|
|
|
92078
93176
|
* Get count of KG entries from existing database
|
|
92079
93177
|
*/
|
|
92080
93178
|
async getKGEntryCount() {
|
|
92081
|
-
const dbPath =
|
|
93179
|
+
const dbPath = join18(this.projectRoot, ".agentic-qe", "memory.db");
|
|
92082
93180
|
try {
|
|
92083
93181
|
const Database4 = (await import("better-sqlite3")).default;
|
|
92084
93182
|
const db = new Database4(dbPath);
|
|
@@ -92107,11 +93205,11 @@ ${yaml.stringify(v3Config)}`;
|
|
|
92107
93205
|
"SQLite persistence REQUIRED but better-sqlite3 is not installed.\nInstall it with: npm install better-sqlite3\nIf you see native compilation errors, ensure build tools are installed:\n - macOS: xcode-select --install\n - Ubuntu/Debian: sudo apt-get install build-essential python3\n - Alpine: apk add build-base python3"
|
|
92108
93206
|
);
|
|
92109
93207
|
}
|
|
92110
|
-
const dataDir =
|
|
93208
|
+
const dataDir = join18(this.projectRoot, ".agentic-qe");
|
|
92111
93209
|
if (!existsSync17(dataDir)) {
|
|
92112
93210
|
mkdirSync8(dataDir, { recursive: true });
|
|
92113
93211
|
}
|
|
92114
|
-
const dbPath =
|
|
93212
|
+
const dbPath = join18(dataDir, "memory.db");
|
|
92115
93213
|
try {
|
|
92116
93214
|
const db = new Database4(dbPath);
|
|
92117
93215
|
db.pragma("journal_mode = WAL");
|
|
@@ -92158,22 +93256,22 @@ Ensure the directory is writable and has sufficient disk space.`
|
|
|
92158
93256
|
if (!config.learning.enabled) {
|
|
92159
93257
|
return 0;
|
|
92160
93258
|
}
|
|
92161
|
-
const dataDir =
|
|
93259
|
+
const dataDir = join18(this.projectRoot, ".agentic-qe", "data");
|
|
92162
93260
|
if (!existsSync17(dataDir)) {
|
|
92163
93261
|
mkdirSync8(dataDir, { recursive: true });
|
|
92164
93262
|
}
|
|
92165
|
-
const hnswDir =
|
|
93263
|
+
const hnswDir = join18(dataDir, "hnsw");
|
|
92166
93264
|
if (!existsSync17(hnswDir)) {
|
|
92167
93265
|
mkdirSync8(hnswDir, { recursive: true });
|
|
92168
93266
|
}
|
|
92169
|
-
const learningConfigPath =
|
|
93267
|
+
const learningConfigPath = join18(dataDir, "learning-config.json");
|
|
92170
93268
|
const learningConfig = {
|
|
92171
93269
|
embeddingModel: config.learning.embeddingModel,
|
|
92172
93270
|
hnswConfig: config.learning.hnswConfig,
|
|
92173
93271
|
qualityThreshold: config.learning.qualityThreshold,
|
|
92174
93272
|
promotionThreshold: config.learning.promotionThreshold,
|
|
92175
|
-
databasePath:
|
|
92176
|
-
hnswIndexPath:
|
|
93273
|
+
databasePath: join18(dataDir, "memory.db"),
|
|
93274
|
+
hnswIndexPath: join18(hnswDir, "index.bin"),
|
|
92177
93275
|
initialized: (/* @__PURE__ */ new Date()).toISOString()
|
|
92178
93276
|
};
|
|
92179
93277
|
writeFileSync5(learningConfigPath, JSON.stringify(learningConfig, null, 2), "utf-8");
|
|
@@ -92188,7 +93286,7 @@ Ensure the directory is writable and has sufficient disk space.`
|
|
|
92188
93286
|
}
|
|
92189
93287
|
patternsByDomain.get(domain).push(pattern);
|
|
92190
93288
|
}
|
|
92191
|
-
const patternsIndexPath =
|
|
93289
|
+
const patternsIndexPath = join18(dataDir, "pretrained-index.json");
|
|
92192
93290
|
const patternsIndex = {
|
|
92193
93291
|
version: library.version,
|
|
92194
93292
|
totalPatterns: library.statistics.totalPatterns,
|
|
@@ -92200,11 +93298,11 @@ Ensure the directory is writable and has sufficient disk space.`
|
|
|
92200
93298
|
};
|
|
92201
93299
|
writeFileSync5(patternsIndexPath, JSON.stringify(patternsIndex, null, 2), "utf-8");
|
|
92202
93300
|
for (const [domain, patterns] of patternsByDomain) {
|
|
92203
|
-
const domainDir =
|
|
93301
|
+
const domainDir = join18(dataDir, "patterns", domain);
|
|
92204
93302
|
if (!existsSync17(domainDir)) {
|
|
92205
93303
|
mkdirSync8(domainDir, { recursive: true });
|
|
92206
93304
|
}
|
|
92207
|
-
const patternsPath =
|
|
93305
|
+
const patternsPath = join18(domainDir, "patterns.json");
|
|
92208
93306
|
writeFileSync5(patternsPath, JSON.stringify(patterns, null, 2), "utf-8");
|
|
92209
93307
|
patternsLoaded += patterns.length;
|
|
92210
93308
|
}
|
|
@@ -92221,11 +93319,11 @@ Ensure the directory is writable and has sufficient disk space.`
|
|
|
92221
93319
|
if (!config.hooks.claudeCode) {
|
|
92222
93320
|
return false;
|
|
92223
93321
|
}
|
|
92224
|
-
const claudeDir =
|
|
93322
|
+
const claudeDir = join18(this.projectRoot, ".claude");
|
|
92225
93323
|
if (!existsSync17(claudeDir)) {
|
|
92226
93324
|
mkdirSync8(claudeDir, { recursive: true });
|
|
92227
93325
|
}
|
|
92228
|
-
const settingsPath =
|
|
93326
|
+
const settingsPath = join18(claudeDir, "settings.json");
|
|
92229
93327
|
let settings = {};
|
|
92230
93328
|
if (existsSync17(settingsPath)) {
|
|
92231
93329
|
try {
|
|
@@ -92384,20 +93482,20 @@ Ensure the directory is writable and has sufficient disk space.`
|
|
|
92384
93482
|
* Copies the QCSD feedback loop hooks from assets to .claude/hooks/
|
|
92385
93483
|
*/
|
|
92386
93484
|
async installCrossPhaseMemoryHooks() {
|
|
92387
|
-
const hooksDir =
|
|
93485
|
+
const hooksDir = join18(this.projectRoot, ".claude", "hooks");
|
|
92388
93486
|
if (!existsSync17(hooksDir)) {
|
|
92389
93487
|
mkdirSync8(hooksDir, { recursive: true });
|
|
92390
93488
|
}
|
|
92391
|
-
const targetPath =
|
|
93489
|
+
const targetPath = join18(hooksDir, "cross-phase-memory.yaml");
|
|
92392
93490
|
if (existsSync17(targetPath)) {
|
|
92393
93491
|
return;
|
|
92394
93492
|
}
|
|
92395
93493
|
const possiblePaths = [
|
|
92396
93494
|
// Installed package location
|
|
92397
|
-
|
|
93495
|
+
join18(dirname7(import.meta.url.replace("file://", "")), "..", "..", "assets", "hooks", "cross-phase-memory.yaml"),
|
|
92398
93496
|
// Development location
|
|
92399
|
-
|
|
92400
|
-
|
|
93497
|
+
join18(process.cwd(), "assets", "hooks", "cross-phase-memory.yaml"),
|
|
93498
|
+
join18(process.cwd(), "v3", "assets", "hooks", "cross-phase-memory.yaml")
|
|
92401
93499
|
];
|
|
92402
93500
|
for (const sourcePath of possiblePaths) {
|
|
92403
93501
|
try {
|
|
@@ -92442,11 +93540,11 @@ routing:
|
|
|
92442
93540
|
* Creates .claude/mcp.json with AQE v3 MCP server configuration
|
|
92443
93541
|
*/
|
|
92444
93542
|
async configureMCP() {
|
|
92445
|
-
const claudeDir =
|
|
93543
|
+
const claudeDir = join18(this.projectRoot, ".claude");
|
|
92446
93544
|
if (!existsSync17(claudeDir)) {
|
|
92447
93545
|
mkdirSync8(claudeDir, { recursive: true });
|
|
92448
93546
|
}
|
|
92449
|
-
const mcpPath =
|
|
93547
|
+
const mcpPath = join18(claudeDir, "mcp.json");
|
|
92450
93548
|
let mcpConfig = {};
|
|
92451
93549
|
if (existsSync17(mcpPath)) {
|
|
92452
93550
|
try {
|
|
@@ -92477,14 +93575,14 @@ routing:
|
|
|
92477
93575
|
* If CLAUDE.md exists, creates backup and appends AQE v3 section
|
|
92478
93576
|
*/
|
|
92479
93577
|
async generateCLAUDEmd(config) {
|
|
92480
|
-
const claudeMdPath =
|
|
93578
|
+
const claudeMdPath = join18(this.projectRoot, "CLAUDE.md");
|
|
92481
93579
|
const content = this.generateCLAUDEmdContent(config);
|
|
92482
93580
|
if (existsSync17(claudeMdPath)) {
|
|
92483
93581
|
const existing = readFileSync14(claudeMdPath, "utf-8");
|
|
92484
93582
|
if (existing.includes("## Agentic QE v3")) {
|
|
92485
93583
|
return true;
|
|
92486
93584
|
}
|
|
92487
|
-
const backupPath =
|
|
93585
|
+
const backupPath = join18(this.projectRoot, "CLAUDE.md.backup");
|
|
92488
93586
|
writeFileSync5(backupPath, existing, "utf-8");
|
|
92489
93587
|
writeFileSync5(claudeMdPath, existing + "\n\n" + content, "utf-8");
|
|
92490
93588
|
} else {
|
|
@@ -92706,7 +93804,7 @@ Bash("npx @claude-flow/cli@latest memory store --key 'qe-pattern-1' --value '...
|
|
|
92706
93804
|
### Data Storage
|
|
92707
93805
|
|
|
92708
93806
|
- **Memory Backend**: \`.agentic-qe/memory.db\` (SQLite)
|
|
92709
|
-
- **Pattern Storage**: \`.agentic-qe/data/
|
|
93807
|
+
- **Pattern Storage**: \`.agentic-qe/data/memory.db\` (ReasoningBank)
|
|
92710
93808
|
- **HNSW Index**: \`.agentic-qe/data/hnsw/index.bin\`
|
|
92711
93809
|
- **Configuration**: \`.agentic-qe/config.yaml\`
|
|
92712
93810
|
|
|
@@ -92745,7 +93843,7 @@ aqe init --auto
|
|
|
92745
93843
|
if (!config.workers.daemonAutoStart || config.workers.enabled.length === 0) {
|
|
92746
93844
|
return 0;
|
|
92747
93845
|
}
|
|
92748
|
-
const workersDir =
|
|
93846
|
+
const workersDir = join18(this.projectRoot, ".agentic-qe", "workers");
|
|
92749
93847
|
if (!existsSync17(workersDir)) {
|
|
92750
93848
|
mkdirSync8(workersDir, { recursive: true });
|
|
92751
93849
|
}
|
|
@@ -92769,7 +93867,7 @@ aqe init --auto
|
|
|
92769
93867
|
status: "pending"
|
|
92770
93868
|
};
|
|
92771
93869
|
}
|
|
92772
|
-
const registryPath =
|
|
93870
|
+
const registryPath = join18(workersDir, "registry.json");
|
|
92773
93871
|
const registryData = {
|
|
92774
93872
|
version: config.version,
|
|
92775
93873
|
maxConcurrent: config.workers.maxConcurrent,
|
|
@@ -92780,18 +93878,18 @@ aqe init --auto
|
|
|
92780
93878
|
};
|
|
92781
93879
|
writeFileSync5(registryPath, JSON.stringify(registryData, null, 2), "utf-8");
|
|
92782
93880
|
for (const workerName of config.workers.enabled) {
|
|
92783
|
-
const workerConfigPath =
|
|
93881
|
+
const workerConfigPath = join18(workersDir, `${workerName}.json`);
|
|
92784
93882
|
const workerConfig = {
|
|
92785
93883
|
name: workerName,
|
|
92786
93884
|
enabled: true,
|
|
92787
93885
|
interval: config.workers.intervals[workerName] || defaultIntervals[workerName] || 6e4,
|
|
92788
93886
|
projectRoot: this.projectRoot,
|
|
92789
|
-
dataDir:
|
|
93887
|
+
dataDir: join18(this.projectRoot, ".agentic-qe", "data"),
|
|
92790
93888
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
92791
93889
|
};
|
|
92792
93890
|
writeFileSync5(workerConfigPath, JSON.stringify(workerConfig, null, 2), "utf-8");
|
|
92793
93891
|
}
|
|
92794
|
-
const daemonScriptPath =
|
|
93892
|
+
const daemonScriptPath = join18(workersDir, "start-daemon.sh");
|
|
92795
93893
|
const daemonScript = `#!/bin/bash
|
|
92796
93894
|
# AQE v3 Worker Daemon Startup Script
|
|
92797
93895
|
# Generated by aqe init
|
|
@@ -92894,12 +93992,12 @@ echo "Use: npx aqe hooks session-start"
|
|
|
92894
93992
|
if (!config) {
|
|
92895
93993
|
throw new Error("No configuration to save");
|
|
92896
93994
|
}
|
|
92897
|
-
const configDir =
|
|
93995
|
+
const configDir = join18(this.projectRoot, ".agentic-qe");
|
|
92898
93996
|
if (!existsSync17(configDir)) {
|
|
92899
93997
|
mkdirSync8(configDir, { recursive: true });
|
|
92900
93998
|
}
|
|
92901
93999
|
const yaml = this.configToYAML(config);
|
|
92902
|
-
const configPath =
|
|
94000
|
+
const configPath = join18(configDir, "config.yaml");
|
|
92903
94001
|
writeFileSync5(configPath, yaml, "utf-8");
|
|
92904
94002
|
}
|
|
92905
94003
|
/**
|
|
@@ -93049,7 +94147,7 @@ var BasePhase = class {
|
|
|
93049
94147
|
|
|
93050
94148
|
// src/init/phases/01-detection.ts
|
|
93051
94149
|
import { existsSync as existsSync18 } from "fs";
|
|
93052
|
-
import { join as
|
|
94150
|
+
import { join as join19 } from "path";
|
|
93053
94151
|
import { createRequire as createRequire2 } from "module";
|
|
93054
94152
|
var require3 = createRequire2(import.meta.url);
|
|
93055
94153
|
var DetectionPhase = class extends BasePhase {
|
|
@@ -93060,7 +94158,7 @@ var DetectionPhase = class extends BasePhase {
|
|
|
93060
94158
|
async run(context2) {
|
|
93061
94159
|
const { projectRoot } = context2;
|
|
93062
94160
|
const v2Detection = await this.detectV2Installation(projectRoot);
|
|
93063
|
-
const v3ConfigYaml = existsSync18(
|
|
94161
|
+
const v3ConfigYaml = existsSync18(join19(projectRoot, ".agentic-qe", "config.yaml"));
|
|
93064
94162
|
const v3Version = v2Detection.version?.startsWith("3.");
|
|
93065
94163
|
const v2Detected = v2Detection.detected;
|
|
93066
94164
|
const v3Detected = v3ConfigYaml || v3Version || false;
|
|
@@ -93104,15 +94202,15 @@ var DetectionPhase = class extends BasePhase {
|
|
|
93104
94202
|
* Detect existing v2 AQE installation
|
|
93105
94203
|
*/
|
|
93106
94204
|
async detectV2Installation(projectRoot) {
|
|
93107
|
-
const memoryDbPath =
|
|
93108
|
-
const configPath =
|
|
93109
|
-
const agentsPath =
|
|
93110
|
-
const v2ConfigFile =
|
|
94205
|
+
const memoryDbPath = join19(projectRoot, ".agentic-qe", "memory.db");
|
|
94206
|
+
const configPath = join19(projectRoot, ".agentic-qe", "config");
|
|
94207
|
+
const agentsPath = join19(projectRoot, ".claude", "agents");
|
|
94208
|
+
const v2ConfigFile = join19(projectRoot, ".agentic-qe", "config", "learning.json");
|
|
93111
94209
|
const hasMemoryDb = existsSync18(memoryDbPath);
|
|
93112
94210
|
const hasConfig = existsSync18(configPath);
|
|
93113
94211
|
const hasAgents = existsSync18(agentsPath);
|
|
93114
94212
|
const hasV2ConfigFiles = existsSync18(v2ConfigFile);
|
|
93115
|
-
const hasV3ConfigYaml = existsSync18(
|
|
94213
|
+
const hasV3ConfigYaml = existsSync18(join19(projectRoot, ".agentic-qe", "config.yaml"));
|
|
93116
94214
|
let version;
|
|
93117
94215
|
let isV3Installation = false;
|
|
93118
94216
|
if (hasMemoryDb) {
|
|
@@ -93267,7 +94365,7 @@ var ConfigurationPhase = class extends BasePhase {
|
|
|
93267
94365
|
|
|
93268
94366
|
// src/init/phases/04-database.ts
|
|
93269
94367
|
import { existsSync as existsSync19, mkdirSync as mkdirSync9 } from "fs";
|
|
93270
|
-
import { join as
|
|
94368
|
+
import { join as join20 } from "path";
|
|
93271
94369
|
var DatabasePhase = class extends BasePhase {
|
|
93272
94370
|
name = "database";
|
|
93273
94371
|
description = "Initialize persistence database";
|
|
@@ -93285,11 +94383,11 @@ var DatabasePhase = class extends BasePhase {
|
|
|
93285
94383
|
"SQLite persistence REQUIRED but better-sqlite3 is not installed.\nInstall it with: npm install better-sqlite3\nIf you see native compilation errors, ensure build tools are installed."
|
|
93286
94384
|
);
|
|
93287
94385
|
}
|
|
93288
|
-
const dataDir =
|
|
94386
|
+
const dataDir = join20(projectRoot, ".agentic-qe");
|
|
93289
94387
|
if (!existsSync19(dataDir)) {
|
|
93290
94388
|
mkdirSync9(dataDir, { recursive: true });
|
|
93291
94389
|
}
|
|
93292
|
-
const dbPath =
|
|
94390
|
+
const dbPath = join20(dataDir, "memory.db");
|
|
93293
94391
|
const created = !existsSync19(dbPath);
|
|
93294
94392
|
try {
|
|
93295
94393
|
const db = new Database4(dbPath);
|
|
@@ -93340,7 +94438,7 @@ Ensure the directory is writable and has sufficient disk space.`
|
|
|
93340
94438
|
|
|
93341
94439
|
// src/init/phases/05-learning.ts
|
|
93342
94440
|
import { existsSync as existsSync20, mkdirSync as mkdirSync10, writeFileSync as writeFileSync6 } from "fs";
|
|
93343
|
-
import { join as
|
|
94441
|
+
import { join as join21 } from "path";
|
|
93344
94442
|
var LearningPhase = class extends BasePhase {
|
|
93345
94443
|
name = "learning";
|
|
93346
94444
|
description = "Initialize learning system";
|
|
@@ -93362,22 +94460,22 @@ var LearningPhase = class extends BasePhase {
|
|
|
93362
94460
|
patternsLoaded: 0
|
|
93363
94461
|
};
|
|
93364
94462
|
}
|
|
93365
|
-
const dataDir =
|
|
94463
|
+
const dataDir = join21(projectRoot, ".agentic-qe", "data");
|
|
93366
94464
|
if (!existsSync20(dataDir)) {
|
|
93367
94465
|
mkdirSync10(dataDir, { recursive: true });
|
|
93368
94466
|
}
|
|
93369
|
-
const hnswDir =
|
|
94467
|
+
const hnswDir = join21(dataDir, "hnsw");
|
|
93370
94468
|
if (!existsSync20(hnswDir)) {
|
|
93371
94469
|
mkdirSync10(hnswDir, { recursive: true });
|
|
93372
94470
|
}
|
|
93373
|
-
const learningConfigPath =
|
|
94471
|
+
const learningConfigPath = join21(dataDir, "learning-config.json");
|
|
93374
94472
|
const learningConfig = {
|
|
93375
94473
|
embeddingModel: config.learning.embeddingModel,
|
|
93376
94474
|
hnswConfig: config.learning.hnswConfig,
|
|
93377
94475
|
qualityThreshold: config.learning.qualityThreshold,
|
|
93378
94476
|
promotionThreshold: config.learning.promotionThreshold,
|
|
93379
|
-
databasePath:
|
|
93380
|
-
hnswIndexPath:
|
|
94477
|
+
databasePath: join21(dataDir, "memory.db"),
|
|
94478
|
+
hnswIndexPath: join21(hnswDir, "index.bin"),
|
|
93381
94479
|
initialized: (/* @__PURE__ */ new Date()).toISOString()
|
|
93382
94480
|
};
|
|
93383
94481
|
writeFileSync6(learningConfigPath, JSON.stringify(learningConfig, null, 2), "utf-8");
|
|
@@ -93400,11 +94498,11 @@ var LearningPhase = class extends BasePhase {
|
|
|
93400
94498
|
*/
|
|
93401
94499
|
async loadPretrainedPatterns(dataDir, context2) {
|
|
93402
94500
|
try {
|
|
93403
|
-
const patternsDir =
|
|
94501
|
+
const patternsDir = join21(dataDir, "patterns");
|
|
93404
94502
|
if (!existsSync20(patternsDir)) {
|
|
93405
94503
|
mkdirSync10(patternsDir, { recursive: true });
|
|
93406
94504
|
}
|
|
93407
|
-
const indexPath =
|
|
94505
|
+
const indexPath = join21(patternsDir, "index.json");
|
|
93408
94506
|
if (!existsSync20(indexPath)) {
|
|
93409
94507
|
writeFileSync6(indexPath, JSON.stringify({
|
|
93410
94508
|
version: "3.0.0",
|
|
@@ -93422,7 +94520,7 @@ var LearningPhase = class extends BasePhase {
|
|
|
93422
94520
|
|
|
93423
94521
|
// src/init/phases/06-code-intelligence.ts
|
|
93424
94522
|
import { existsSync as existsSync21 } from "fs";
|
|
93425
|
-
import { join as
|
|
94523
|
+
import { join as join22 } from "path";
|
|
93426
94524
|
var CodeIntelligencePhase = class extends BasePhase {
|
|
93427
94525
|
name = "code-intelligence";
|
|
93428
94526
|
description = "Code intelligence pre-scan";
|
|
@@ -93444,7 +94542,7 @@ var CodeIntelligencePhase = class extends BasePhase {
|
|
|
93444
94542
|
* Check if code intelligence index exists
|
|
93445
94543
|
*/
|
|
93446
94544
|
async checkCodeIntelligenceIndex(projectRoot) {
|
|
93447
|
-
const dbPath =
|
|
94545
|
+
const dbPath = join22(projectRoot, ".agentic-qe", "memory.db");
|
|
93448
94546
|
if (!existsSync21(dbPath)) {
|
|
93449
94547
|
return false;
|
|
93450
94548
|
}
|
|
@@ -93465,7 +94563,7 @@ var CodeIntelligencePhase = class extends BasePhase {
|
|
|
93465
94563
|
* Get count of KG entries
|
|
93466
94564
|
*/
|
|
93467
94565
|
async getKGEntryCount(projectRoot) {
|
|
93468
|
-
const dbPath =
|
|
94566
|
+
const dbPath = join22(projectRoot, ".agentic-qe", "memory.db");
|
|
93469
94567
|
try {
|
|
93470
94568
|
const Database4 = (await import("better-sqlite3")).default;
|
|
93471
94569
|
const db = new Database4(dbPath);
|
|
@@ -93504,7 +94602,7 @@ var CodeIntelligencePhase = class extends BasePhase {
|
|
|
93504
94602
|
ignore: ["node_modules/**", "dist/**", "coverage/**", ".agentic-qe/**"]
|
|
93505
94603
|
});
|
|
93506
94604
|
const result = await kgService.index({
|
|
93507
|
-
paths: files.map((f) =>
|
|
94605
|
+
paths: files.map((f) => join22(projectRoot, f)),
|
|
93508
94606
|
incremental: false,
|
|
93509
94607
|
includeTests: true
|
|
93510
94608
|
});
|
|
@@ -93524,7 +94622,7 @@ var CodeIntelligencePhase = class extends BasePhase {
|
|
|
93524
94622
|
|
|
93525
94623
|
// src/init/phases/07-hooks.ts
|
|
93526
94624
|
import { existsSync as existsSync22, mkdirSync as mkdirSync11, readFileSync as readFileSync15, writeFileSync as writeFileSync7 } from "fs";
|
|
93527
|
-
import { join as
|
|
94625
|
+
import { join as join23 } from "path";
|
|
93528
94626
|
var HooksPhase = class extends BasePhase {
|
|
93529
94627
|
name = "hooks";
|
|
93530
94628
|
description = "Configure Claude Code hooks";
|
|
@@ -93545,11 +94643,11 @@ var HooksPhase = class extends BasePhase {
|
|
|
93545
94643
|
hookTypes: []
|
|
93546
94644
|
};
|
|
93547
94645
|
}
|
|
93548
|
-
const claudeDir =
|
|
94646
|
+
const claudeDir = join23(projectRoot, ".claude");
|
|
93549
94647
|
if (!existsSync22(claudeDir)) {
|
|
93550
94648
|
mkdirSync11(claudeDir, { recursive: true });
|
|
93551
94649
|
}
|
|
93552
|
-
const settingsPath =
|
|
94650
|
+
const settingsPath = join23(claudeDir, "settings.json");
|
|
93553
94651
|
let settings = {};
|
|
93554
94652
|
if (existsSync22(settingsPath)) {
|
|
93555
94653
|
try {
|
|
@@ -93715,7 +94813,7 @@ var HooksPhase = class extends BasePhase {
|
|
|
93715
94813
|
|
|
93716
94814
|
// src/init/phases/08-mcp.ts
|
|
93717
94815
|
import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync16, writeFileSync as writeFileSync8 } from "fs";
|
|
93718
|
-
import { join as
|
|
94816
|
+
import { join as join24 } from "path";
|
|
93719
94817
|
var MCPPhase = class extends BasePhase {
|
|
93720
94818
|
name = "mcp";
|
|
93721
94819
|
description = "Configure MCP server";
|
|
@@ -93724,11 +94822,11 @@ var MCPPhase = class extends BasePhase {
|
|
|
93724
94822
|
requiresPhases = ["configuration"];
|
|
93725
94823
|
async run(context2) {
|
|
93726
94824
|
const { projectRoot } = context2;
|
|
93727
|
-
const claudeDir =
|
|
94825
|
+
const claudeDir = join24(projectRoot, ".claude");
|
|
93728
94826
|
if (!existsSync23(claudeDir)) {
|
|
93729
94827
|
mkdirSync12(claudeDir, { recursive: true });
|
|
93730
94828
|
}
|
|
93731
|
-
const mcpPath =
|
|
94829
|
+
const mcpPath = join24(claudeDir, "mcp.json");
|
|
93732
94830
|
let mcpConfig = {};
|
|
93733
94831
|
if (existsSync23(mcpPath)) {
|
|
93734
94832
|
try {
|
|
@@ -93831,7 +94929,7 @@ var AssetsPhase = class extends BasePhase {
|
|
|
93831
94929
|
|
|
93832
94930
|
// src/init/phases/10-workers.ts
|
|
93833
94931
|
import { existsSync as existsSync24, mkdirSync as mkdirSync13, writeFileSync as writeFileSync9 } from "fs";
|
|
93834
|
-
import { join as
|
|
94932
|
+
import { join as join25 } from "path";
|
|
93835
94933
|
var WorkersPhase = class extends BasePhase {
|
|
93836
94934
|
name = "workers";
|
|
93837
94935
|
description = "Configure background workers";
|
|
@@ -93852,7 +94950,7 @@ var WorkersPhase = class extends BasePhase {
|
|
|
93852
94950
|
registryPath: ""
|
|
93853
94951
|
};
|
|
93854
94952
|
}
|
|
93855
|
-
const workersDir =
|
|
94953
|
+
const workersDir = join25(projectRoot, ".agentic-qe", "workers");
|
|
93856
94954
|
if (!existsSync24(workersDir)) {
|
|
93857
94955
|
mkdirSync13(workersDir, { recursive: true });
|
|
93858
94956
|
}
|
|
@@ -93872,7 +94970,7 @@ var WorkersPhase = class extends BasePhase {
|
|
|
93872
94970
|
status: "pending"
|
|
93873
94971
|
};
|
|
93874
94972
|
}
|
|
93875
|
-
const registryPath =
|
|
94973
|
+
const registryPath = join25(workersDir, "registry.json");
|
|
93876
94974
|
const registryData = {
|
|
93877
94975
|
version: config.version,
|
|
93878
94976
|
maxConcurrent: config.workers.maxConcurrent,
|
|
@@ -93882,18 +94980,18 @@ var WorkersPhase = class extends BasePhase {
|
|
|
93882
94980
|
};
|
|
93883
94981
|
writeFileSync9(registryPath, JSON.stringify(registryData, null, 2), "utf-8");
|
|
93884
94982
|
for (const workerName of config.workers.enabled) {
|
|
93885
|
-
const workerConfigPath =
|
|
94983
|
+
const workerConfigPath = join25(workersDir, `${workerName}.json`);
|
|
93886
94984
|
const workerConfig = {
|
|
93887
94985
|
name: workerName,
|
|
93888
94986
|
enabled: true,
|
|
93889
94987
|
interval: config.workers.intervals[workerName] || defaultIntervals[workerName] || 6e4,
|
|
93890
94988
|
projectRoot,
|
|
93891
|
-
dataDir:
|
|
94989
|
+
dataDir: join25(projectRoot, ".agentic-qe", "data"),
|
|
93892
94990
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
93893
94991
|
};
|
|
93894
94992
|
writeFileSync9(workerConfigPath, JSON.stringify(workerConfig, null, 2), "utf-8");
|
|
93895
94993
|
}
|
|
93896
|
-
const daemonScriptPath =
|
|
94994
|
+
const daemonScriptPath = join25(workersDir, "start-daemon.sh");
|
|
93897
94995
|
const daemonScript = `#!/bin/bash
|
|
93898
94996
|
# AQE v3 Worker Daemon Startup Script
|
|
93899
94997
|
# Generated by aqe init
|
|
@@ -93928,7 +95026,7 @@ echo "Use: npx aqe hooks session-start"
|
|
|
93928
95026
|
|
|
93929
95027
|
// src/init/phases/11-claude-md.ts
|
|
93930
95028
|
import { existsSync as existsSync25, readFileSync as readFileSync17, writeFileSync as writeFileSync10 } from "fs";
|
|
93931
|
-
import { join as
|
|
95029
|
+
import { join as join26 } from "path";
|
|
93932
95030
|
var ClaudeMdPhase = class extends BasePhase {
|
|
93933
95031
|
name = "claude-md";
|
|
93934
95032
|
description = "Generate CLAUDE.md";
|
|
@@ -93938,7 +95036,7 @@ var ClaudeMdPhase = class extends BasePhase {
|
|
|
93938
95036
|
async run(context2) {
|
|
93939
95037
|
const config = context2.config;
|
|
93940
95038
|
const { projectRoot } = context2;
|
|
93941
|
-
const claudeMdPath =
|
|
95039
|
+
const claudeMdPath = join26(projectRoot, "CLAUDE.md");
|
|
93942
95040
|
const content = this.generateContent(config);
|
|
93943
95041
|
let backupCreated = false;
|
|
93944
95042
|
if (existsSync25(claudeMdPath)) {
|
|
@@ -93947,7 +95045,7 @@ var ClaudeMdPhase = class extends BasePhase {
|
|
|
93947
95045
|
context2.services.log(" CLAUDE.md already has AQE section");
|
|
93948
95046
|
return { generated: false, path: claudeMdPath, backupCreated: false };
|
|
93949
95047
|
}
|
|
93950
|
-
const backupPath =
|
|
95048
|
+
const backupPath = join26(projectRoot, "CLAUDE.md.backup");
|
|
93951
95049
|
writeFileSync10(backupPath, existing, "utf-8");
|
|
93952
95050
|
backupCreated = true;
|
|
93953
95051
|
writeFileSync10(claudeMdPath, existing + "\n\n" + content, "utf-8");
|
|
@@ -94060,7 +95158,7 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
|
|
|
94060
95158
|
|
|
94061
95159
|
// src/init/phases/12-verification.ts
|
|
94062
95160
|
import { existsSync as existsSync26, readFileSync as readFileSync18 } from "fs";
|
|
94063
|
-
import { join as
|
|
95161
|
+
import { join as join27, dirname as dirname9 } from "path";
|
|
94064
95162
|
import { mkdirSync as mkdirSync14, writeFileSync as writeFileSync11 } from "fs";
|
|
94065
95163
|
import { createRequire as createRequire3 } from "module";
|
|
94066
95164
|
var require4 = createRequire3(import.meta.url);
|
|
@@ -94074,16 +95172,16 @@ var VerificationPhase = class extends BasePhase {
|
|
|
94074
95172
|
const config = context2.config;
|
|
94075
95173
|
const { projectRoot } = context2;
|
|
94076
95174
|
const checks = [];
|
|
94077
|
-
const dbPath =
|
|
95175
|
+
const dbPath = join27(projectRoot, ".agentic-qe", "memory.db");
|
|
94078
95176
|
checks.push({
|
|
94079
95177
|
name: "Database exists",
|
|
94080
95178
|
passed: existsSync26(dbPath)
|
|
94081
95179
|
});
|
|
94082
95180
|
checks.push({
|
|
94083
95181
|
name: ".agentic-qe directory",
|
|
94084
|
-
passed: existsSync26(
|
|
95182
|
+
passed: existsSync26(join27(projectRoot, ".agentic-qe"))
|
|
94085
95183
|
});
|
|
94086
|
-
const configPath =
|
|
95184
|
+
const configPath = join27(projectRoot, ".agentic-qe", "config.yaml");
|
|
94087
95185
|
await this.saveConfig(config, projectRoot);
|
|
94088
95186
|
checks.push({
|
|
94089
95187
|
name: "Config saved",
|
|
@@ -94111,7 +95209,7 @@ var VerificationPhase = class extends BasePhase {
|
|
|
94111
95209
|
* Write AQE version to memory.db
|
|
94112
95210
|
*/
|
|
94113
95211
|
async writeVersionToDb(version, projectRoot) {
|
|
94114
|
-
const memoryDbPath =
|
|
95212
|
+
const memoryDbPath = join27(projectRoot, ".agentic-qe", "memory.db");
|
|
94115
95213
|
try {
|
|
94116
95214
|
const dir = dirname9(memoryDbPath);
|
|
94117
95215
|
if (!existsSync26(dir)) {
|
|
@@ -94154,11 +95252,11 @@ var VerificationPhase = class extends BasePhase {
|
|
|
94154
95252
|
* Preserves user customizations from existing config (Issue #206)
|
|
94155
95253
|
*/
|
|
94156
95254
|
async saveConfig(config, projectRoot) {
|
|
94157
|
-
const configDir =
|
|
95255
|
+
const configDir = join27(projectRoot, ".agentic-qe");
|
|
94158
95256
|
if (!existsSync26(configDir)) {
|
|
94159
95257
|
mkdirSync14(configDir, { recursive: true });
|
|
94160
95258
|
}
|
|
94161
|
-
const configPath =
|
|
95259
|
+
const configPath = join27(configDir, "config.yaml");
|
|
94162
95260
|
if (existsSync26(configPath)) {
|
|
94163
95261
|
const existingConfig = this.loadExistingConfig(configPath);
|
|
94164
95262
|
if (existingConfig) {
|
|
@@ -94578,10 +95676,10 @@ function createModularInitOrchestrator(options) {
|
|
|
94578
95676
|
|
|
94579
95677
|
// src/cli/commands/claude-flow-setup.ts
|
|
94580
95678
|
import { existsSync as existsSync27, writeFileSync as writeFileSync12, readFileSync as readFileSync19 } from "node:fs";
|
|
94581
|
-
import { join as
|
|
95679
|
+
import { join as join28 } from "node:path";
|
|
94582
95680
|
import { execSync as execSync6 } from "node:child_process";
|
|
94583
95681
|
async function detectClaudeFlow(projectRoot, debug) {
|
|
94584
|
-
const claudeSettingsPath =
|
|
95682
|
+
const claudeSettingsPath = join28(projectRoot, ".claude", "settings.json");
|
|
94585
95683
|
if (existsSync27(claudeSettingsPath)) {
|
|
94586
95684
|
try {
|
|
94587
95685
|
const settings = JSON.parse(readFileSync19(claudeSettingsPath, "utf-8"));
|
|
@@ -94605,7 +95703,7 @@ async function detectClaudeFlow(projectRoot, debug) {
|
|
|
94605
95703
|
} catch {
|
|
94606
95704
|
}
|
|
94607
95705
|
try {
|
|
94608
|
-
const packageJsonPath =
|
|
95706
|
+
const packageJsonPath = join28(projectRoot, "package.json");
|
|
94609
95707
|
if (existsSync27(packageJsonPath)) {
|
|
94610
95708
|
const pkg = JSON.parse(readFileSync19(packageJsonPath, "utf-8"));
|
|
94611
95709
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
@@ -94687,7 +95785,7 @@ function generateClaudeFlowConfig(projectRoot, features) {
|
|
|
94687
95785
|
};
|
|
94688
95786
|
}
|
|
94689
95787
|
function updateMCPConfig(projectRoot) {
|
|
94690
|
-
const claudeSettingsPath =
|
|
95788
|
+
const claudeSettingsPath = join28(projectRoot, ".claude", "settings.json");
|
|
94691
95789
|
let settings = {};
|
|
94692
95790
|
if (existsSync27(claudeSettingsPath)) {
|
|
94693
95791
|
try {
|
|
@@ -94747,8 +95845,8 @@ async function setupClaudeFlowIntegration(options) {
|
|
|
94747
95845
|
features
|
|
94748
95846
|
};
|
|
94749
95847
|
}
|
|
94750
|
-
const aqeDir =
|
|
94751
|
-
const configPath =
|
|
95848
|
+
const aqeDir = join28(projectRoot, ".agentic-qe");
|
|
95849
|
+
const configPath = join28(aqeDir, "claude-flow-integration.json");
|
|
94752
95850
|
try {
|
|
94753
95851
|
const config = generateClaudeFlowConfig(projectRoot, features);
|
|
94754
95852
|
writeFileSync12(configPath, JSON.stringify(config, null, 2));
|
|
@@ -95223,7 +96321,7 @@ import chalk4 from "chalk";
|
|
|
95223
96321
|
|
|
95224
96322
|
// src/cli/config/cli-config.ts
|
|
95225
96323
|
import { existsSync as existsSync28, readFileSync as readFileSync20, writeFileSync as writeFileSync13, mkdirSync as mkdirSync15, unlinkSync as unlinkSync3 } from "fs";
|
|
95226
|
-
import { join as
|
|
96324
|
+
import { join as join29 } from "path";
|
|
95227
96325
|
import { homedir as homedir2 } from "os";
|
|
95228
96326
|
var DEFAULT_CLI_CONFIG = {
|
|
95229
96327
|
wizards: {
|
|
@@ -95250,10 +96348,10 @@ var DEFAULT_CLI_CONFIG = {
|
|
|
95250
96348
|
}
|
|
95251
96349
|
};
|
|
95252
96350
|
function getConfigDir() {
|
|
95253
|
-
return
|
|
96351
|
+
return join29(homedir2(), ".aqe");
|
|
95254
96352
|
}
|
|
95255
96353
|
function getConfigPath() {
|
|
95256
|
-
return
|
|
96354
|
+
return join29(getConfigDir(), "cli-config.json");
|
|
95257
96355
|
}
|
|
95258
96356
|
var cachedConfig = null;
|
|
95259
96357
|
var cacheTimestamp = 0;
|
|
@@ -96447,7 +97545,7 @@ import { resolve as resolve5 } from "path";
|
|
|
96447
97545
|
// src/cli/wizards/core/wizard-utils.ts
|
|
96448
97546
|
import chalk10 from "chalk";
|
|
96449
97547
|
import { existsSync as existsSync29, statSync as statSync8 } from "fs";
|
|
96450
|
-
import { join as
|
|
97548
|
+
import { join as join30, relative as relative6 } from "path";
|
|
96451
97549
|
var WizardPrompt = class {
|
|
96452
97550
|
/**
|
|
96453
97551
|
* Generic prompt helper - wraps readline.question in a Promise
|
|
@@ -96538,7 +97636,7 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
96538
97636
|
const suggestions = [];
|
|
96539
97637
|
const commonDirs = ["src", "lib", "app", "packages", "api"];
|
|
96540
97638
|
for (const dir of commonDirs) {
|
|
96541
|
-
const dirPath =
|
|
97639
|
+
const dirPath = join30(cwd, dir);
|
|
96542
97640
|
if (existsSync29(dirPath) && statSync8(dirPath).isDirectory()) {
|
|
96543
97641
|
suggestions.push(dir);
|
|
96544
97642
|
}
|
|
@@ -96557,7 +97655,7 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
96557
97655
|
".nyc_output"
|
|
96558
97656
|
];
|
|
96559
97657
|
for (const loc of coverageLocations) {
|
|
96560
|
-
const locPath =
|
|
97658
|
+
const locPath = join30(cwd, loc);
|
|
96561
97659
|
if (existsSync29(locPath)) {
|
|
96562
97660
|
suggestions.push(loc);
|
|
96563
97661
|
}
|
|
@@ -96580,7 +97678,7 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
96580
97678
|
"Dockerfile"
|
|
96581
97679
|
];
|
|
96582
97680
|
for (const file of securityFiles) {
|
|
96583
|
-
const filePath =
|
|
97681
|
+
const filePath = join30(cwd, file);
|
|
96584
97682
|
if (existsSync29(filePath)) {
|
|
96585
97683
|
suggestions.push(file);
|
|
96586
97684
|
}
|
|
@@ -96594,13 +97692,13 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
96594
97692
|
const suggestions = [];
|
|
96595
97693
|
const commonDirs = ["src", "lib", "app", "packages"];
|
|
96596
97694
|
for (const dir of commonDirs) {
|
|
96597
|
-
const dirPath =
|
|
97695
|
+
const dirPath = join30(cwd, dir);
|
|
96598
97696
|
if (existsSync29(dirPath) && statSync8(dirPath).isDirectory()) {
|
|
96599
97697
|
suggestions.push(`${dir}/**/*.ts`);
|
|
96600
97698
|
suggestions.push(dir);
|
|
96601
97699
|
}
|
|
96602
97700
|
}
|
|
96603
|
-
if (existsSync29(
|
|
97701
|
+
if (existsSync29(join30(cwd, "src"))) {
|
|
96604
97702
|
suggestions.push("src/services/**/*.ts");
|
|
96605
97703
|
suggestions.push("src/utils/**/*.ts");
|
|
96606
97704
|
suggestions.push("src/components/**/*.tsx");
|
|
@@ -96612,10 +97710,10 @@ var WizardSuggestions = class _WizardSuggestions {
|
|
|
96612
97710
|
*/
|
|
96613
97711
|
static checkPatternsExist(cwd) {
|
|
96614
97712
|
const patternLocations = [
|
|
96615
|
-
|
|
96616
|
-
|
|
96617
|
-
|
|
96618
|
-
|
|
97713
|
+
join30(cwd, ".agentic-qe", "patterns"),
|
|
97714
|
+
join30(cwd, ".agentic-qe", "memory.db"),
|
|
97715
|
+
join30(cwd, ".aqe", "patterns"),
|
|
97716
|
+
join30(cwd, "data", "patterns")
|
|
96619
97717
|
];
|
|
96620
97718
|
return patternLocations.some((loc) => existsSync29(loc));
|
|
96621
97719
|
}
|
|
@@ -99978,7 +101076,7 @@ import chalk20 from "chalk";
|
|
|
99978
101076
|
// src/init/fleet-integration.ts
|
|
99979
101077
|
import chalk19 from "chalk";
|
|
99980
101078
|
import { existsSync as existsSync31 } from "fs";
|
|
99981
|
-
import { join as
|
|
101079
|
+
import { join as join32 } from "path";
|
|
99982
101080
|
var FleetInitEnhancer = class {
|
|
99983
101081
|
projectRoot;
|
|
99984
101082
|
options;
|
|
@@ -100090,7 +101188,7 @@ var FleetInitEnhancer = class {
|
|
|
100090
101188
|
});
|
|
100091
101189
|
console.log(chalk19.gray(` Indexing ${files.length} files...`));
|
|
100092
101190
|
const result = await kgService.index({
|
|
100093
|
-
paths: files.map((f) =>
|
|
101191
|
+
paths: files.map((f) => join32(this.projectRoot, f)),
|
|
100094
101192
|
incremental: false,
|
|
100095
101193
|
includeTests: true
|
|
100096
101194
|
});
|
|
@@ -100125,7 +101223,7 @@ var FleetInitEnhancer = class {
|
|
|
100125
101223
|
* Checks the memory database for code-intelligence:kg namespace entries
|
|
100126
101224
|
*/
|
|
100127
101225
|
async hasCodeIntelligenceIndex() {
|
|
100128
|
-
const dbPath =
|
|
101226
|
+
const dbPath = join32(this.projectRoot, ".agentic-qe", "memory.db");
|
|
100129
101227
|
if (!existsSync31(dbPath)) {
|
|
100130
101228
|
return false;
|
|
100131
101229
|
}
|
|
@@ -100146,7 +101244,7 @@ var FleetInitEnhancer = class {
|
|
|
100146
101244
|
* Get count of knowledge graph entries
|
|
100147
101245
|
*/
|
|
100148
101246
|
async getKGEntryCount() {
|
|
100149
|
-
const dbPath =
|
|
101247
|
+
const dbPath = join32(this.projectRoot, ".agentic-qe", "memory.db");
|
|
100150
101248
|
try {
|
|
100151
101249
|
const Database4 = (await import("better-sqlite3")).default;
|
|
100152
101250
|
const db = new Database4(dbPath);
|
|
@@ -101720,9 +102818,11 @@ import ora2 from "ora";
|
|
|
101720
102818
|
// src/sync/interfaces.ts
|
|
101721
102819
|
var DEFAULT_SYNC_CONFIG = {
|
|
101722
102820
|
local: {
|
|
101723
|
-
//
|
|
101724
|
-
v3MemoryDb: "
|
|
102821
|
+
// PRIMARY: Root database (consolidated, MCP-active)
|
|
102822
|
+
v3MemoryDb: "../.agentic-qe/memory.db",
|
|
102823
|
+
// Now points to root (consolidated)
|
|
101725
102824
|
rootMemoryDb: "../.agentic-qe/memory.db",
|
|
102825
|
+
// Same as above
|
|
101726
102826
|
claudeFlowMemory: "../.claude-flow/memory/store.json",
|
|
101727
102827
|
claudeFlowDaemon: "../.claude-flow/daemon-state.json",
|
|
101728
102828
|
claudeFlowMetrics: "../.claude-flow/metrics/",
|
|
@@ -101744,28 +102844,21 @@ var DEFAULT_SYNC_CONFIG = {
|
|
|
101744
102844
|
batchSize: 1e3,
|
|
101745
102845
|
conflictResolution: "newer-wins",
|
|
101746
102846
|
sourcePriority: {
|
|
101747
|
-
|
|
102847
|
+
rootMemory: 1,
|
|
102848
|
+
// Root is now PRIMARY (consolidated)
|
|
101748
102849
|
claudeFlowMemory: 2,
|
|
101749
|
-
|
|
101750
|
-
|
|
101751
|
-
legacy: 5
|
|
102850
|
+
intelligenceJson: 3,
|
|
102851
|
+
legacy: 4
|
|
101752
102852
|
},
|
|
101753
102853
|
sources: [
|
|
101754
|
-
//
|
|
101755
|
-
|
|
101756
|
-
|
|
101757
|
-
|
|
101758
|
-
path: "../v3/.agentic-qe/memory.db",
|
|
101759
|
-
targetTable: "aqe.qe_patterns",
|
|
101760
|
-
priority: "high",
|
|
101761
|
-
mode: "incremental",
|
|
101762
|
-
query: "SELECT * FROM qe_patterns",
|
|
101763
|
-
enabled: true
|
|
101764
|
-
},
|
|
102854
|
+
// ============================================================
|
|
102855
|
+
// ROOT Memory - PRIMARY (Consolidated from V3 + Historical)
|
|
102856
|
+
// All tables now in single database: .agentic-qe/memory.db
|
|
102857
|
+
// ============================================================
|
|
101765
102858
|
{
|
|
101766
|
-
name: "
|
|
102859
|
+
name: "root-sona-patterns",
|
|
101767
102860
|
type: "sqlite",
|
|
101768
|
-
path: "
|
|
102861
|
+
path: "../.agentic-qe/memory.db",
|
|
101769
102862
|
targetTable: "aqe.sona_patterns",
|
|
101770
102863
|
priority: "high",
|
|
101771
102864
|
mode: "incremental",
|
|
@@ -101773,32 +102866,21 @@ var DEFAULT_SYNC_CONFIG = {
|
|
|
101773
102866
|
enabled: true
|
|
101774
102867
|
},
|
|
101775
102868
|
{
|
|
101776
|
-
name: "
|
|
102869
|
+
name: "root-goap-actions",
|
|
101777
102870
|
type: "sqlite",
|
|
101778
|
-
path: "
|
|
102871
|
+
path: "../.agentic-qe/memory.db",
|
|
101779
102872
|
targetTable: "aqe.goap_actions",
|
|
101780
102873
|
priority: "high",
|
|
101781
102874
|
mode: "incremental",
|
|
101782
102875
|
query: "SELECT * FROM goap_actions",
|
|
101783
102876
|
enabled: true
|
|
101784
102877
|
},
|
|
101785
|
-
// Claude-Flow Memory
|
|
101786
|
-
{
|
|
101787
|
-
name: "claude-flow-memory",
|
|
101788
|
-
type: "json",
|
|
101789
|
-
path: "../.claude-flow/memory/store.json",
|
|
101790
|
-
targetTable: "aqe.claude_flow_memory",
|
|
101791
|
-
priority: "high",
|
|
101792
|
-
mode: "full",
|
|
101793
|
-
enabled: true
|
|
101794
|
-
},
|
|
101795
|
-
// Root Memory - HISTORICAL
|
|
101796
102878
|
{
|
|
101797
102879
|
name: "root-memory-entries",
|
|
101798
102880
|
type: "sqlite",
|
|
101799
102881
|
path: "../.agentic-qe/memory.db",
|
|
101800
102882
|
targetTable: "aqe.memory_entries",
|
|
101801
|
-
priority: "
|
|
102883
|
+
priority: "high",
|
|
101802
102884
|
mode: "incremental",
|
|
101803
102885
|
query: "SELECT * FROM memory_entries",
|
|
101804
102886
|
enabled: true
|
|
@@ -101808,21 +102890,11 @@ var DEFAULT_SYNC_CONFIG = {
|
|
|
101808
102890
|
type: "sqlite",
|
|
101809
102891
|
path: "../.agentic-qe/memory.db",
|
|
101810
102892
|
targetTable: "aqe.learning_experiences",
|
|
101811
|
-
priority: "
|
|
102893
|
+
priority: "high",
|
|
101812
102894
|
mode: "append",
|
|
101813
102895
|
query: "SELECT * FROM learning_experiences",
|
|
101814
102896
|
enabled: true
|
|
101815
102897
|
},
|
|
101816
|
-
{
|
|
101817
|
-
name: "root-goap-actions",
|
|
101818
|
-
type: "sqlite",
|
|
101819
|
-
path: "../.agentic-qe/memory.db",
|
|
101820
|
-
targetTable: "aqe.goap_actions",
|
|
101821
|
-
priority: "medium",
|
|
101822
|
-
mode: "incremental",
|
|
101823
|
-
query: "SELECT * FROM goap_actions",
|
|
101824
|
-
enabled: true
|
|
101825
|
-
},
|
|
101826
102898
|
{
|
|
101827
102899
|
name: "root-patterns",
|
|
101828
102900
|
type: "sqlite",
|
|
@@ -101843,13 +102915,23 @@ var DEFAULT_SYNC_CONFIG = {
|
|
|
101843
102915
|
query: "SELECT * FROM events",
|
|
101844
102916
|
enabled: true
|
|
101845
102917
|
},
|
|
101846
|
-
//
|
|
102918
|
+
// Claude-Flow Memory (JSON)
|
|
102919
|
+
{
|
|
102920
|
+
name: "claude-flow-memory",
|
|
102921
|
+
type: "json",
|
|
102922
|
+
path: "../.claude-flow/memory/store.json",
|
|
102923
|
+
targetTable: "aqe.claude_flow_memory",
|
|
102924
|
+
priority: "medium",
|
|
102925
|
+
mode: "full",
|
|
102926
|
+
enabled: true
|
|
102927
|
+
},
|
|
102928
|
+
// Intelligence JSON (Q-Learning)
|
|
101847
102929
|
{
|
|
101848
102930
|
name: "intelligence-qlearning",
|
|
101849
102931
|
type: "json",
|
|
101850
102932
|
path: "../v3/.ruvector/intelligence.json",
|
|
101851
102933
|
targetTable: "aqe.qlearning_patterns",
|
|
101852
|
-
priority: "
|
|
102934
|
+
priority: "low",
|
|
101853
102935
|
mode: "full",
|
|
101854
102936
|
jsonPath: "$.qvalues",
|
|
101855
102937
|
enabled: true
|
|
@@ -107735,7 +108817,7 @@ async function createCoherenceService(wasmLoader2, config, logger) {
|
|
|
107735
108817
|
// src/integrations/coherence/wasm-loader.ts
|
|
107736
108818
|
import { createRequire as createRequire4 } from "node:module";
|
|
107737
108819
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
107738
|
-
import { dirname as dirname10, join as
|
|
108820
|
+
import { dirname as dirname10, join as join34 } from "node:path";
|
|
107739
108821
|
import { readFileSync as readFileSync23, existsSync as existsSync34 } from "node:fs";
|
|
107740
108822
|
var FALLBACK_RETRY_DELAYS_MS = [1e3, 2e3, 4e3];
|
|
107741
108823
|
var WasmLoader = class {
|
|
@@ -107994,12 +109076,12 @@ var WasmLoader = class {
|
|
|
107994
109076
|
(() => {
|
|
107995
109077
|
try {
|
|
107996
109078
|
const modulePath = require5.resolve("prime-radiant-advanced-wasm");
|
|
107997
|
-
return
|
|
109079
|
+
return join34(dirname10(modulePath), "prime_radiant_advanced_wasm_bg.wasm");
|
|
107998
109080
|
} catch {
|
|
107999
109081
|
return null;
|
|
108000
109082
|
}
|
|
108001
109083
|
})(),
|
|
108002
|
-
|
|
109084
|
+
join34(process.cwd(), "node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm")
|
|
108003
109085
|
].filter((p) => p !== null);
|
|
108004
109086
|
for (const path16 of wasmPaths) {
|
|
108005
109087
|
if (existsSync34(path16)) {
|
|
@@ -108253,15 +109335,15 @@ var WasmLoader = class {
|
|
|
108253
109335
|
(() => {
|
|
108254
109336
|
try {
|
|
108255
109337
|
const modulePath = require5.resolve("prime-radiant-advanced-wasm");
|
|
108256
|
-
return
|
|
109338
|
+
return join34(dirname10(modulePath), "prime_radiant_advanced_wasm_bg.wasm");
|
|
108257
109339
|
} catch {
|
|
108258
109340
|
return null;
|
|
108259
109341
|
}
|
|
108260
109342
|
})(),
|
|
108261
109343
|
// Direct node_modules path from current file
|
|
108262
|
-
|
|
109344
|
+
join34(dirname10(fileURLToPath4(import.meta.url)), "../../../../node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm"),
|
|
108263
109345
|
// Workspace root
|
|
108264
|
-
|
|
109346
|
+
join34(process.cwd(), "node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm")
|
|
108265
109347
|
].filter((p) => p !== null);
|
|
108266
109348
|
let wasmPath = null;
|
|
108267
109349
|
for (const path16 of wasmPaths) {
|
|
@@ -109195,7 +110277,7 @@ async function cleanupAndExit(code = 0) {
|
|
|
109195
110277
|
process.exit(code);
|
|
109196
110278
|
}
|
|
109197
110279
|
var program = new Command13();
|
|
109198
|
-
var VERSION = true ? "3.
|
|
110280
|
+
var VERSION = true ? "3.4.0" : "0.0.0-dev";
|
|
109199
110281
|
program.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(VERSION);
|
|
109200
110282
|
var registry = createCommandRegistry(context, cleanupAndExit, ensureInitialized);
|
|
109201
110283
|
registry.registerAll(program);
|