swarmdo 1.4.8 → 1.6.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/helpers/statusline.cjs +7 -7
- package/README.md +9 -6
- package/package.json +5 -3
- package/v3/@swarmdo/cli/dist/src/commands/compact.d.ts +16 -0
- package/v3/@swarmdo/cli/dist/src/commands/compact.js +106 -0
- package/v3/@swarmdo/cli/dist/src/commands/hooks.js +26 -24
- package/v3/@swarmdo/cli/dist/src/commands/index.js +10 -3
- package/v3/@swarmdo/cli/dist/src/commands/integrations.d.ts +14 -0
- package/v3/@swarmdo/cli/dist/src/commands/integrations.js +158 -0
- package/v3/@swarmdo/cli/dist/src/commands/memory.js +50 -1
- package/v3/@swarmdo/cli/dist/src/commands/providers.js +3 -0
- package/v3/@swarmdo/cli/dist/src/commands/release.d.ts +15 -0
- package/v3/@swarmdo/cli/dist/src/commands/release.js +241 -0
- package/v3/@swarmdo/cli/dist/src/commands/security.js +14 -0
- package/v3/@swarmdo/cli/dist/src/commands/transcript.js +82 -1
- package/v3/@swarmdo/cli/dist/src/commands/usage.js +80 -1
- package/v3/@swarmdo/cli/dist/src/compact/compact.d.ts +60 -0
- package/v3/@swarmdo/cli/dist/src/compact/compact.js +170 -0
- package/v3/@swarmdo/cli/dist/src/config-lint/lint.js +11 -1
- package/v3/@swarmdo/cli/dist/src/index.js +4 -2
- package/v3/@swarmdo/cli/dist/src/init/statusline-generator.js +6 -6
- package/v3/@swarmdo/cli/dist/src/integrations/integrations.d.ts +54 -0
- package/v3/@swarmdo/cli/dist/src/integrations/integrations.js +162 -0
- package/v3/@swarmdo/cli/dist/src/mcp-tools/agent-execute-core.js +25 -3
- package/v3/@swarmdo/cli/dist/src/mcp-tools/agentdb-tools.js +8 -8
- package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.d.ts +12 -0
- package/v3/@swarmdo/cli/dist/src/memory/graph-edge-writer.js +32 -1
- package/v3/@swarmdo/cli/dist/src/memory-vault/watch.d.ts +32 -0
- package/v3/@swarmdo/cli/dist/src/memory-vault/watch.js +66 -0
- package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.d.ts +91 -0
- package/v3/@swarmdo/cli/dist/src/providers/openrouter-config.js +186 -0
- package/v3/@swarmdo/cli/dist/src/release/release.d.ts +72 -0
- package/v3/@swarmdo/cli/dist/src/release/release.js +86 -0
- package/v3/@swarmdo/cli/dist/src/resilience/backoff.d.ts +23 -0
- package/v3/@swarmdo/cli/dist/src/resilience/backoff.js +30 -0
- package/v3/@swarmdo/cli/dist/src/swarmvector/model-router.js +14 -0
- package/v3/@swarmdo/cli/dist/src/transcript/search.d.ts +39 -0
- package/v3/@swarmdo/cli/dist/src/transcript/search.js +67 -0
- package/v3/@swarmdo/cli/dist/src/usage/diff.d.ts +69 -0
- package/v3/@swarmdo/cli/dist/src/usage/diff.js +112 -0
- package/v3/@swarmdo/cli/package.json +4 -4
- package/v3/@swarmdo/cli-core/dist/src/index.js +1 -1
- package/v3/@swarmdo/codex/dist/cli.js +0 -0
- package/v3/@swarmdo/hooks/dist/cli/guidance-cli.js +0 -0
- package/v3/@swarmdo/hooks/dist/statusline/index.d.ts +3 -3
- package/v3/@swarmdo/hooks/dist/statusline/index.js +3 -3
- package/v3/@swarmdo/integration/dist/__tests__/agentic-flow-agent.test.js +4 -1
- package/v3/@swarmdo/neural/dist/flash-attention.d.ts +1 -1
- package/v3/@swarmdo/neural/dist/flash-attention.js +1 -1
- package/v3/@swarmdo/plugin-agent-federation/dist/plugin.js +1 -1
- package/v3/@swarmdo/plugin-agent-federation/dist/transport/midstream-aware-loader.js +2 -2
- package/v3/@swarmdo/providers/dist/swarmvector-provider.d.ts +1 -1
- package/v3/@swarmdo/providers/dist/swarmvector-provider.js +1 -1
- package/v3/@swarmdo/security/dist/input-validator.d.ts +6 -6
- package/v3/@swarmdo/shared/dist/hooks/safety/git-commit.js +1 -1
- package/v3/@swarmdo/shared/dist/mcp/transport/http.js +8 -1
- package/v3/vendor/agentdb/package.json +0 -1
- package/v3/vendor/agentic-flow/package.json +0 -1
- package/.claude/scheduled_tasks.lock +0 -1
- package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/__main__.cpython-314.pyc +0 -0
- package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/cli.cpython-314.pyc +0 -0
- package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/compress.cpython-314.pyc +0 -0
- package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/detect.cpython-314.pyc +0 -0
- package/.claude/skills/sdo-caveman-compress/scripts/__pycache__/validate.cpython-314.pyc +0 -0
- package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.d.ts +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/application/index.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.d.ts +0 -138
- package/v3/@swarmdo/plugin-iot-cognitum/dist/application/iot-coordinator.js +0 -418
- package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.d.ts +0 -15
- package/v3/@swarmdo/plugin-iot-cognitum/dist/bin.js +0 -240
- package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.d.ts +0 -7
- package/v3/@swarmdo/plugin-iot-cognitum/dist/cli-commands.js +0 -508
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.d.ts +0 -54
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-agent.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.d.ts +0 -46
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-fleet.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.d.ts +0 -18
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/device-trust-level.js +0 -28
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.d.ts +0 -5
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/index.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.d.ts +0 -35
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/entities/telemetry.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.d.ts +0 -11
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/device-repository.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.d.ts +0 -9
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/fleet-repository.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.d.ts +0 -5
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/index.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.d.ts +0 -12
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/telemetry-repository.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.d.ts +0 -19
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/repositories/trust-history-repository.js +0 -2
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.d.ts +0 -44
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/anomaly-detection-service.js +0 -117
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.d.ts +0 -70
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/device-lifecycle-service.js +0 -194
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.d.ts +0 -69
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/firmware-orchestration-service.js +0 -139
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.d.ts +0 -34
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/fleet-topology-service.js +0 -101
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.d.ts +0 -10
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/index.js +0 -10
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.d.ts +0 -64
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/mesh-service.js +0 -70
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.d.ts +0 -44
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/sona-integration-service.js +0 -79
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.d.ts +0 -37
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-ingestion-service.js +0 -39
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.d.ts +0 -67
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/telemetry-service.js +0 -58
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.d.ts +0 -45
- package/v3/@swarmdo/plugin-iot-cognitum/dist/domain/services/witness-verification-service.js +0 -63
- package/v3/@swarmdo/plugin-iot-cognitum/dist/index.d.ts +0 -26
- package/v3/@swarmdo/plugin-iot-cognitum/dist/index.js +0 -17
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.d.ts +0 -51
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/agentdb-telemetry-repository.js +0 -110
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.d.ts +0 -13
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-device-repository.js +0 -25
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.d.ts +0 -11
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-fleet-repository.js +0 -19
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.d.ts +0 -11
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/in-memory-trust-history-repository.js +0 -27
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.d.ts +0 -6
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/index.js +0 -6
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.d.ts +0 -41
- package/v3/@swarmdo/plugin-iot-cognitum/dist/infrastructure/seed-client-factory.js +0 -64
- package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.d.ts +0 -8
- package/v3/@swarmdo/plugin-iot-cognitum/dist/mcp-tools.js +0 -703
- package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.d.ts +0 -23
- package/v3/@swarmdo/plugin-iot-cognitum/dist/plugin.js +0 -239
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.d.ts +0 -17
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/anomaly-scan-worker.js +0 -42
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.d.ts +0 -18
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/firmware-watch-worker.js +0 -45
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.d.ts +0 -19
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/health-probe-worker.js +0 -50
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.d.ts +0 -19
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/mesh-sync-worker.js +0 -47
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.d.ts +0 -17
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/telemetry-ingest-worker.js +0 -40
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.d.ts +0 -18
- package/v3/@swarmdo/plugin-iot-cognitum/dist/workers/witness-audit-worker.js +0 -51
- package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.d.ts +0 -214
- package/v3/@swarmdo/testing/dist/fixtures/agent-fixtures.js +0 -595
- package/v3/@swarmdo/testing/dist/fixtures/agents.d.ts +0 -76
- package/v3/@swarmdo/testing/dist/fixtures/agents.js +0 -158
- package/v3/@swarmdo/testing/dist/fixtures/configurations.d.ts +0 -157
- package/v3/@swarmdo/testing/dist/fixtures/configurations.js +0 -337
- package/v3/@swarmdo/testing/dist/fixtures/index.d.ts +0 -10
- package/v3/@swarmdo/testing/dist/fixtures/index.js +0 -17
- package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.d.ts +0 -329
- package/v3/@swarmdo/testing/dist/fixtures/mcp-fixtures.js +0 -714
- package/v3/@swarmdo/testing/dist/fixtures/memory-entries.d.ts +0 -159
- package/v3/@swarmdo/testing/dist/fixtures/memory-entries.js +0 -262
- package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.d.ts +0 -290
- package/v3/@swarmdo/testing/dist/fixtures/memory-fixtures.js +0 -547
- package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.d.ts +0 -289
- package/v3/@swarmdo/testing/dist/fixtures/swarm-fixtures.js +0 -534
- package/v3/@swarmdo/testing/dist/fixtures/tasks.d.ts +0 -106
- package/v3/@swarmdo/testing/dist/fixtures/tasks.js +0 -229
- package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.d.ts +0 -213
- package/v3/@swarmdo/testing/dist/helpers/assertion-helpers.js +0 -435
- package/v3/@swarmdo/testing/dist/helpers/assertions.d.ts +0 -135
- package/v3/@swarmdo/testing/dist/helpers/assertions.js +0 -217
- package/v3/@swarmdo/testing/dist/helpers/create-mock.d.ts +0 -96
- package/v3/@swarmdo/testing/dist/helpers/create-mock.js +0 -164
- package/v3/@swarmdo/testing/dist/helpers/index.d.ts +0 -14
- package/v3/@swarmdo/testing/dist/helpers/index.js +0 -22
- package/v3/@swarmdo/testing/dist/helpers/mock-factory.d.ts +0 -323
- package/v3/@swarmdo/testing/dist/helpers/mock-factory.js +0 -350
- package/v3/@swarmdo/testing/dist/helpers/setup-teardown.d.ts +0 -271
- package/v3/@swarmdo/testing/dist/helpers/setup-teardown.js +0 -446
- package/v3/@swarmdo/testing/dist/helpers/swarm-instance.d.ts +0 -142
- package/v3/@swarmdo/testing/dist/helpers/swarm-instance.js +0 -205
- package/v3/@swarmdo/testing/dist/helpers/test-application.d.ts +0 -190
- package/v3/@swarmdo/testing/dist/helpers/test-application.js +0 -138
- package/v3/@swarmdo/testing/dist/helpers/test-utils.d.ts +0 -274
- package/v3/@swarmdo/testing/dist/helpers/test-utils.js +0 -456
- package/v3/@swarmdo/testing/dist/index.d.ts +0 -42
- package/v3/@swarmdo/testing/dist/index.js +0 -66
- package/v3/@swarmdo/testing/dist/mocks/index.d.ts +0 -8
- package/v3/@swarmdo/testing/dist/mocks/index.js +0 -10
- package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.d.ts +0 -206
- package/v3/@swarmdo/testing/dist/mocks/mock-mcp-client.js +0 -575
- package/v3/@swarmdo/testing/dist/mocks/mock-services.d.ts +0 -287
- package/v3/@swarmdo/testing/dist/mocks/mock-services.js +0 -563
- package/v3/@swarmdo/testing/dist/regression/api-contract.d.ts +0 -109
- package/v3/@swarmdo/testing/dist/regression/api-contract.js +0 -374
- package/v3/@swarmdo/testing/dist/regression/index.d.ts +0 -18
- package/v3/@swarmdo/testing/dist/regression/index.js +0 -18
- package/v3/@swarmdo/testing/dist/regression/integration-regression.d.ts +0 -67
- package/v3/@swarmdo/testing/dist/regression/integration-regression.js +0 -334
- package/v3/@swarmdo/testing/dist/regression/performance-baseline.d.ts +0 -106
- package/v3/@swarmdo/testing/dist/regression/performance-baseline.js +0 -268
- package/v3/@swarmdo/testing/dist/regression/regression-runner.d.ts +0 -124
- package/v3/@swarmdo/testing/dist/regression/regression-runner.js +0 -227
- package/v3/@swarmdo/testing/dist/regression/security-regression.d.ts +0 -73
- package/v3/@swarmdo/testing/dist/regression/security-regression.js +0 -258
- package/v3/@swarmdo/testing/dist/setup.d.ts +0 -43
- package/v3/@swarmdo/testing/dist/setup.js +0 -91
- package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.d.ts +0 -10
- package/v3/@swarmdo/testing/dist/v2-compat/api-compat.test.js +0 -433
- package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.d.ts +0 -10
- package/v3/@swarmdo/testing/dist/v2-compat/cli-compat.test.js +0 -352
- package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.d.ts +0 -206
- package/v3/@swarmdo/testing/dist/v2-compat/compatibility-validator.js +0 -839
- package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.d.ts +0 -10
- package/v3/@swarmdo/testing/dist/v2-compat/hooks-compat.test.js +0 -428
- package/v3/@swarmdo/testing/dist/v2-compat/index.d.ts +0 -38
- package/v3/@swarmdo/testing/dist/v2-compat/index.js +0 -41
- package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.d.ts +0 -10
- package/v3/@swarmdo/testing/dist/v2-compat/mcp-compat.test.js +0 -419
- package/v3/@swarmdo/testing/dist/v2-compat/report-generator.d.ts +0 -34
- package/v3/@swarmdo/testing/dist/v2-compat/report-generator.js +0 -372
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @swarmdo/testing - Memory Fixtures
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive mock memory entries and backend configurations for testing.
|
|
5
|
-
* Supports AgentDB, HNSW indexing, vector search, and ReasoningBank patterns.
|
|
6
|
-
*
|
|
7
|
-
* Based on ADR-006 (Unified Memory Service) and ADR-009 (Hybrid Memory Backend).
|
|
8
|
-
*/
|
|
9
|
-
import { vi } from 'vitest';
|
|
10
|
-
/**
|
|
11
|
-
* Generate deterministic mock embedding vector
|
|
12
|
-
*/
|
|
13
|
-
export function generateMockEmbedding(dimensions, seed) {
|
|
14
|
-
const seedHash = hashString(seed);
|
|
15
|
-
return Array.from({ length: dimensions }, (_, i) => {
|
|
16
|
-
const value = Math.sin(seedHash + i * 0.1) * 0.5 + 0.5;
|
|
17
|
-
return Math.round(value * 10000) / 10000;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Simple string hash function for deterministic embeddings
|
|
22
|
-
*/
|
|
23
|
-
function hashString(str) {
|
|
24
|
-
let hash = 0;
|
|
25
|
-
for (let i = 0; i < str.length; i++) {
|
|
26
|
-
hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;
|
|
27
|
-
}
|
|
28
|
-
return hash;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Pre-defined memory entries for testing
|
|
32
|
-
*/
|
|
33
|
-
export const memoryEntries = {
|
|
34
|
-
agentPattern: {
|
|
35
|
-
key: 'pattern:agent:queen-coordinator',
|
|
36
|
-
value: {
|
|
37
|
-
pattern: 'orchestration',
|
|
38
|
-
successRate: 0.95,
|
|
39
|
-
avgDuration: 150,
|
|
40
|
-
commonTasks: ['task-distribution', 'conflict-resolution', 'priority-scheduling'],
|
|
41
|
-
},
|
|
42
|
-
metadata: {
|
|
43
|
-
type: 'semantic',
|
|
44
|
-
tags: ['agent', 'pattern', 'queen', 'coordination'],
|
|
45
|
-
source: 'learning-module',
|
|
46
|
-
confidence: 0.92,
|
|
47
|
-
agentId: 'queen-coordinator-001',
|
|
48
|
-
},
|
|
49
|
-
embedding: generateMockEmbedding(384, 'orchestration'),
|
|
50
|
-
createdAt: new Date('2024-01-01T00:00:00Z'),
|
|
51
|
-
updatedAt: new Date('2024-01-15T12:00:00Z'),
|
|
52
|
-
accessCount: 150,
|
|
53
|
-
},
|
|
54
|
-
securityRule: {
|
|
55
|
-
key: 'rule:security:path-traversal',
|
|
56
|
-
value: {
|
|
57
|
-
rule: 'block-path-traversal',
|
|
58
|
-
patterns: ['../', '~/', '/etc/', '/tmp/', '/var/'],
|
|
59
|
-
severity: 'critical',
|
|
60
|
-
action: 'reject',
|
|
61
|
-
},
|
|
62
|
-
metadata: {
|
|
63
|
-
type: 'long-term',
|
|
64
|
-
tags: ['security', 'rule', 'validation', 'path'],
|
|
65
|
-
source: 'security-module',
|
|
66
|
-
confidence: 1.0,
|
|
67
|
-
},
|
|
68
|
-
embedding: generateMockEmbedding(384, 'security-path-traversal'),
|
|
69
|
-
createdAt: new Date('2024-01-01T00:00:00Z'),
|
|
70
|
-
updatedAt: new Date('2024-01-01T00:00:00Z'),
|
|
71
|
-
},
|
|
72
|
-
taskMemory: {
|
|
73
|
-
key: 'task:memory:impl-001',
|
|
74
|
-
value: {
|
|
75
|
-
taskId: 'impl-001',
|
|
76
|
-
context: 'implementing security module',
|
|
77
|
-
decisions: ['use argon2 for hashing', 'implement path validation', 'add input sanitization'],
|
|
78
|
-
progress: 0.75,
|
|
79
|
-
},
|
|
80
|
-
metadata: {
|
|
81
|
-
type: 'episodic',
|
|
82
|
-
tags: ['task', 'implementation', 'security'],
|
|
83
|
-
ttl: 86400000, // 24 hours
|
|
84
|
-
sessionId: 'session-001',
|
|
85
|
-
},
|
|
86
|
-
embedding: generateMockEmbedding(384, 'implementation-security'),
|
|
87
|
-
createdAt: new Date('2024-01-15T10:00:00Z'),
|
|
88
|
-
updatedAt: new Date('2024-01-15T10:00:00Z'),
|
|
89
|
-
expiresAt: new Date('2024-01-16T10:00:00Z'),
|
|
90
|
-
},
|
|
91
|
-
sessionContext: {
|
|
92
|
-
key: 'session:context:session-001',
|
|
93
|
-
value: {
|
|
94
|
-
sessionId: 'session-001',
|
|
95
|
-
user: 'developer',
|
|
96
|
-
activeAgents: ['queen-coordinator', 'coder', 'tester'],
|
|
97
|
-
currentTask: 'security-implementation',
|
|
98
|
-
startedAt: new Date('2024-01-15T14:00:00Z'),
|
|
99
|
-
},
|
|
100
|
-
metadata: {
|
|
101
|
-
type: 'short-term',
|
|
102
|
-
tags: ['session', 'context', 'active'],
|
|
103
|
-
ttl: 3600000, // 1 hour
|
|
104
|
-
},
|
|
105
|
-
createdAt: new Date('2024-01-15T14:00:00Z'),
|
|
106
|
-
updatedAt: new Date('2024-01-15T14:30:00Z'),
|
|
107
|
-
expiresAt: new Date('2024-01-15T15:30:00Z'),
|
|
108
|
-
},
|
|
109
|
-
learningTrajectory: {
|
|
110
|
-
key: 'learning:trajectory:traj-001',
|
|
111
|
-
value: {
|
|
112
|
-
trajectoryId: 'traj-001',
|
|
113
|
-
steps: [
|
|
114
|
-
{ action: 'analyze', result: 'success', reward: 0.8, duration: 100 },
|
|
115
|
-
{ action: 'implement', result: 'success', reward: 0.9, duration: 500 },
|
|
116
|
-
{ action: 'test', result: 'success', reward: 1.0, duration: 200 },
|
|
117
|
-
],
|
|
118
|
-
totalReward: 2.7,
|
|
119
|
-
convergenceRate: 0.85,
|
|
120
|
-
},
|
|
121
|
-
metadata: {
|
|
122
|
-
type: 'long-term',
|
|
123
|
-
tags: ['learning', 'trajectory', 'reinforcement', 'reasoningbank'],
|
|
124
|
-
source: 'reasoningbank',
|
|
125
|
-
confidence: 0.88,
|
|
126
|
-
},
|
|
127
|
-
embedding: generateMockEmbedding(384, 'learning-trajectory'),
|
|
128
|
-
createdAt: new Date('2024-01-10T00:00:00Z'),
|
|
129
|
-
updatedAt: new Date('2024-01-15T00:00:00Z'),
|
|
130
|
-
},
|
|
131
|
-
vectorIndex: {
|
|
132
|
-
key: 'index:hnsw:agents',
|
|
133
|
-
value: {
|
|
134
|
-
indexId: 'hnsw-agents',
|
|
135
|
-
dimensions: 384,
|
|
136
|
-
vectorCount: 10000,
|
|
137
|
-
M: 16,
|
|
138
|
-
efConstruction: 200,
|
|
139
|
-
efSearch: 50,
|
|
140
|
-
},
|
|
141
|
-
metadata: {
|
|
142
|
-
type: 'procedural',
|
|
143
|
-
tags: ['index', 'hnsw', 'vector', 'search'],
|
|
144
|
-
source: 'agentdb',
|
|
145
|
-
},
|
|
146
|
-
createdAt: new Date('2024-01-01T00:00:00Z'),
|
|
147
|
-
updatedAt: new Date('2024-01-15T00:00:00Z'),
|
|
148
|
-
},
|
|
149
|
-
cacheEntry: {
|
|
150
|
-
key: 'cache:search:security-patterns',
|
|
151
|
-
value: {
|
|
152
|
-
query: 'security input validation',
|
|
153
|
-
results: ['pattern-001', 'pattern-002', 'pattern-003'],
|
|
154
|
-
hitCount: 45,
|
|
155
|
-
},
|
|
156
|
-
metadata: {
|
|
157
|
-
type: 'short-term',
|
|
158
|
-
tags: ['cache', 'search', 'security'],
|
|
159
|
-
ttl: 300000, // 5 minutes
|
|
160
|
-
},
|
|
161
|
-
createdAt: new Date('2024-01-15T14:00:00Z'),
|
|
162
|
-
updatedAt: new Date('2024-01-15T14:00:00Z'),
|
|
163
|
-
expiresAt: new Date('2024-01-15T14:05:00Z'),
|
|
164
|
-
accessCount: 45,
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* Pre-defined search results for testing
|
|
169
|
-
*/
|
|
170
|
-
export const searchResults = {
|
|
171
|
-
securityPatterns: [
|
|
172
|
-
{
|
|
173
|
-
key: 'pattern:security:input-validation',
|
|
174
|
-
value: { pattern: 'validate all inputs', effectiveness: 0.99, applicability: 'universal' },
|
|
175
|
-
score: 0.95,
|
|
176
|
-
metadata: { type: 'semantic', tags: ['security', 'pattern', 'input'] },
|
|
177
|
-
distance: 0.05,
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
key: 'pattern:security:output-encoding',
|
|
181
|
-
value: { pattern: 'encode all outputs', effectiveness: 0.97, applicability: 'web' },
|
|
182
|
-
score: 0.88,
|
|
183
|
-
metadata: { type: 'semantic', tags: ['security', 'pattern', 'output'] },
|
|
184
|
-
distance: 0.12,
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
key: 'pattern:security:least-privilege',
|
|
188
|
-
value: { pattern: 'minimal permissions', effectiveness: 0.95, applicability: 'universal' },
|
|
189
|
-
score: 0.82,
|
|
190
|
-
metadata: { type: 'semantic', tags: ['security', 'pattern', 'permissions'] },
|
|
191
|
-
distance: 0.18,
|
|
192
|
-
},
|
|
193
|
-
],
|
|
194
|
-
agentPatterns: [
|
|
195
|
-
{
|
|
196
|
-
key: 'pattern:agent:coordination',
|
|
197
|
-
value: { pattern: 'hierarchical coordination', successRate: 0.92, topology: 'hierarchical-mesh' },
|
|
198
|
-
score: 0.91,
|
|
199
|
-
metadata: { type: 'semantic', tags: ['agent', 'pattern', 'coordination'] },
|
|
200
|
-
distance: 0.09,
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
key: 'pattern:agent:communication',
|
|
204
|
-
value: { pattern: 'async messaging', successRate: 0.89, protocol: 'quic' },
|
|
205
|
-
score: 0.85,
|
|
206
|
-
metadata: { type: 'semantic', tags: ['agent', 'pattern', 'communication'] },
|
|
207
|
-
distance: 0.15,
|
|
208
|
-
},
|
|
209
|
-
],
|
|
210
|
-
memoryOptimization: [
|
|
211
|
-
{
|
|
212
|
-
key: 'pattern:memory:hnsw-tuning',
|
|
213
|
-
value: { M: 16, efConstruction: 200, speedup: '150x' },
|
|
214
|
-
score: 0.94,
|
|
215
|
-
metadata: { type: 'procedural', tags: ['memory', 'optimization', 'hnsw'] },
|
|
216
|
-
distance: 0.06,
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
key: 'pattern:memory:quantization',
|
|
220
|
-
value: { bits: 8, compression: '4x', qualityLoss: 0.02 },
|
|
221
|
-
score: 0.89,
|
|
222
|
-
metadata: { type: 'procedural', tags: ['memory', 'optimization', 'quantization'] },
|
|
223
|
-
distance: 0.11,
|
|
224
|
-
},
|
|
225
|
-
],
|
|
226
|
-
emptyResults: [],
|
|
227
|
-
};
|
|
228
|
-
/**
|
|
229
|
-
* Pre-defined learned patterns for ReasoningBank testing
|
|
230
|
-
*/
|
|
231
|
-
export const learnedPatterns = {
|
|
232
|
-
successfulImplementation: {
|
|
233
|
-
id: 'pattern-impl-001',
|
|
234
|
-
sessionId: 'session-001',
|
|
235
|
-
task: 'Implement input validation',
|
|
236
|
-
input: 'Create secure input validation for user data',
|
|
237
|
-
output: 'Implemented regex-based validation with sanitization',
|
|
238
|
-
reward: 0.95,
|
|
239
|
-
success: true,
|
|
240
|
-
critique: 'Good coverage of edge cases, could add more specific error messages',
|
|
241
|
-
tokensUsed: 1500,
|
|
242
|
-
latencyMs: 2500,
|
|
243
|
-
createdAt: new Date('2024-01-15T10:00:00Z'),
|
|
244
|
-
embedding: generateMockEmbedding(384, 'input-validation'),
|
|
245
|
-
},
|
|
246
|
-
failedImplementation: {
|
|
247
|
-
id: 'pattern-impl-002',
|
|
248
|
-
sessionId: 'session-001',
|
|
249
|
-
task: 'Implement path validation',
|
|
250
|
-
input: 'Create path traversal protection',
|
|
251
|
-
output: 'Initial implementation had security gaps',
|
|
252
|
-
reward: 0.3,
|
|
253
|
-
success: false,
|
|
254
|
-
critique: 'Did not handle URL-encoded path traversal attempts',
|
|
255
|
-
tokensUsed: 2000,
|
|
256
|
-
latencyMs: 3500,
|
|
257
|
-
createdAt: new Date('2024-01-15T11:00:00Z'),
|
|
258
|
-
embedding: generateMockEmbedding(384, 'path-validation-failed'),
|
|
259
|
-
},
|
|
260
|
-
optimizationPattern: {
|
|
261
|
-
id: 'pattern-opt-001',
|
|
262
|
-
sessionId: 'session-002',
|
|
263
|
-
task: 'Optimize vector search',
|
|
264
|
-
input: 'Improve HNSW search performance',
|
|
265
|
-
output: 'Tuned M=16, efConstruction=200 for 150x speedup',
|
|
266
|
-
reward: 0.98,
|
|
267
|
-
success: true,
|
|
268
|
-
critique: 'Excellent parameter tuning, validated with benchmarks',
|
|
269
|
-
tokensUsed: 800,
|
|
270
|
-
latencyMs: 1200,
|
|
271
|
-
createdAt: new Date('2024-01-14T08:00:00Z'),
|
|
272
|
-
embedding: generateMockEmbedding(384, 'vector-optimization'),
|
|
273
|
-
},
|
|
274
|
-
};
|
|
275
|
-
/**
|
|
276
|
-
* Pre-defined HNSW configurations
|
|
277
|
-
*/
|
|
278
|
-
export const hnswConfigs = {
|
|
279
|
-
default: {
|
|
280
|
-
M: 16,
|
|
281
|
-
efConstruction: 200,
|
|
282
|
-
efSearch: 50,
|
|
283
|
-
dimensions: 384,
|
|
284
|
-
metric: 'cosine',
|
|
285
|
-
},
|
|
286
|
-
highPerformance: {
|
|
287
|
-
M: 32,
|
|
288
|
-
efConstruction: 400,
|
|
289
|
-
efSearch: 100,
|
|
290
|
-
dimensions: 384,
|
|
291
|
-
metric: 'cosine',
|
|
292
|
-
},
|
|
293
|
-
lowMemory: {
|
|
294
|
-
M: 8,
|
|
295
|
-
efConstruction: 100,
|
|
296
|
-
efSearch: 25,
|
|
297
|
-
dimensions: 384,
|
|
298
|
-
metric: 'dot',
|
|
299
|
-
},
|
|
300
|
-
highDimension: {
|
|
301
|
-
M: 24,
|
|
302
|
-
efConstruction: 300,
|
|
303
|
-
efSearch: 75,
|
|
304
|
-
dimensions: 1536,
|
|
305
|
-
metric: 'euclidean',
|
|
306
|
-
},
|
|
307
|
-
};
|
|
308
|
-
/**
|
|
309
|
-
* Pre-defined quantization configurations
|
|
310
|
-
*/
|
|
311
|
-
export const quantizationConfigs = {
|
|
312
|
-
scalar4bit: {
|
|
313
|
-
enabled: true,
|
|
314
|
-
bits: 4,
|
|
315
|
-
type: 'scalar',
|
|
316
|
-
compressionRatio: 8,
|
|
317
|
-
},
|
|
318
|
-
scalar8bit: {
|
|
319
|
-
enabled: true,
|
|
320
|
-
bits: 8,
|
|
321
|
-
type: 'scalar',
|
|
322
|
-
compressionRatio: 4,
|
|
323
|
-
},
|
|
324
|
-
product: {
|
|
325
|
-
enabled: true,
|
|
326
|
-
bits: 8,
|
|
327
|
-
type: 'product',
|
|
328
|
-
compressionRatio: 32,
|
|
329
|
-
},
|
|
330
|
-
disabled: {
|
|
331
|
-
enabled: false,
|
|
332
|
-
bits: 16,
|
|
333
|
-
type: 'scalar',
|
|
334
|
-
},
|
|
335
|
-
};
|
|
336
|
-
/**
|
|
337
|
-
* Pre-defined memory backend configurations
|
|
338
|
-
*/
|
|
339
|
-
export const memoryBackendConfigs = {
|
|
340
|
-
agentDB: {
|
|
341
|
-
type: 'agentdb',
|
|
342
|
-
vectorDimensions: 384,
|
|
343
|
-
hnswConfig: hnswConfigs.default,
|
|
344
|
-
quantization: quantizationConfigs.scalar8bit,
|
|
345
|
-
caching: {
|
|
346
|
-
enabled: true,
|
|
347
|
-
maxSize: 1000,
|
|
348
|
-
ttl: 3600000,
|
|
349
|
-
strategy: 'lru',
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
hybrid: {
|
|
353
|
-
type: 'hybrid',
|
|
354
|
-
path: './data',
|
|
355
|
-
vectorDimensions: 384,
|
|
356
|
-
hnswConfig: hnswConfigs.highPerformance,
|
|
357
|
-
quantization: quantizationConfigs.scalar4bit,
|
|
358
|
-
caching: {
|
|
359
|
-
enabled: true,
|
|
360
|
-
maxSize: 5000,
|
|
361
|
-
ttl: 7200000,
|
|
362
|
-
strategy: 'arc',
|
|
363
|
-
},
|
|
364
|
-
},
|
|
365
|
-
inMemory: {
|
|
366
|
-
type: 'memory',
|
|
367
|
-
maxSize: 10000,
|
|
368
|
-
vectorDimensions: 384,
|
|
369
|
-
hnswConfig: hnswConfigs.lowMemory,
|
|
370
|
-
caching: {
|
|
371
|
-
enabled: false,
|
|
372
|
-
maxSize: 0,
|
|
373
|
-
ttl: 0,
|
|
374
|
-
strategy: 'lru',
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
sqlite: {
|
|
378
|
-
type: 'sqlite',
|
|
379
|
-
path: './test.db',
|
|
380
|
-
maxSize: 100000,
|
|
381
|
-
caching: {
|
|
382
|
-
enabled: true,
|
|
383
|
-
maxSize: 2000,
|
|
384
|
-
ttl: 1800000,
|
|
385
|
-
strategy: 'lfu',
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
};
|
|
389
|
-
/**
|
|
390
|
-
* Performance targets from V3 specifications
|
|
391
|
-
*/
|
|
392
|
-
export const performanceTargets = {
|
|
393
|
-
searchSpeedupMin: 150,
|
|
394
|
-
searchSpeedupMax: 12500,
|
|
395
|
-
memoryReduction: 0.50,
|
|
396
|
-
insertionTime: 1, // ms
|
|
397
|
-
searchTime: 0.1, // ms for 1M vectors
|
|
398
|
-
flashAttentionSpeedup: [2.49, 7.47],
|
|
399
|
-
};
|
|
400
|
-
/**
|
|
401
|
-
* Factory function to create memory entry with overrides
|
|
402
|
-
*/
|
|
403
|
-
export function createMemoryEntry(base, overrides) {
|
|
404
|
-
return {
|
|
405
|
-
...memoryEntries[base],
|
|
406
|
-
...overrides,
|
|
407
|
-
key: overrides?.key ?? memoryEntries[base].key,
|
|
408
|
-
createdAt: overrides?.createdAt ?? new Date(),
|
|
409
|
-
updatedAt: overrides?.updatedAt ?? new Date(),
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
/**
|
|
413
|
-
* Factory function to create vector query
|
|
414
|
-
*/
|
|
415
|
-
export function createVectorQuery(overrides) {
|
|
416
|
-
return {
|
|
417
|
-
embedding: overrides?.embedding ?? generateMockEmbedding(384, 'query'),
|
|
418
|
-
topK: overrides?.topK ?? 10,
|
|
419
|
-
threshold: overrides?.threshold ?? 0.7,
|
|
420
|
-
filters: overrides?.filters,
|
|
421
|
-
includeMetadata: overrides?.includeMetadata ?? true,
|
|
422
|
-
rerank: overrides?.rerank ?? false,
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Factory function to create learned pattern
|
|
427
|
-
*/
|
|
428
|
-
export function createLearnedPattern(base, overrides) {
|
|
429
|
-
return {
|
|
430
|
-
...learnedPatterns[base],
|
|
431
|
-
...overrides,
|
|
432
|
-
id: overrides?.id ?? `pattern-${Date.now()}`,
|
|
433
|
-
createdAt: overrides?.createdAt ?? new Date(),
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
/**
|
|
437
|
-
* Factory function to create HNSW config
|
|
438
|
-
*/
|
|
439
|
-
export function createHNSWConfig(base = 'default', overrides) {
|
|
440
|
-
return {
|
|
441
|
-
...hnswConfigs[base],
|
|
442
|
-
...overrides,
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Factory function to create memory backend config
|
|
447
|
-
*/
|
|
448
|
-
export function createMemoryBackendConfig(base = 'agentDB', overrides) {
|
|
449
|
-
return {
|
|
450
|
-
...memoryBackendConfigs[base],
|
|
451
|
-
...overrides,
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Create batch of memory entries for performance testing
|
|
456
|
-
*/
|
|
457
|
-
export function createMemoryBatch(count, type = 'semantic', dimensions = 384) {
|
|
458
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
459
|
-
key: `batch:entry:${i}`,
|
|
460
|
-
value: { index: i, data: `test data ${i}` },
|
|
461
|
-
metadata: {
|
|
462
|
-
type,
|
|
463
|
-
tags: ['batch', `entry-${i % 10}`],
|
|
464
|
-
},
|
|
465
|
-
embedding: generateMockEmbedding(dimensions, `batch-${i}`),
|
|
466
|
-
createdAt: new Date(),
|
|
467
|
-
updatedAt: new Date(),
|
|
468
|
-
}));
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Create embeddings batch for vector index testing
|
|
472
|
-
*/
|
|
473
|
-
export function createEmbeddingsBatch(count, dimensions = 384) {
|
|
474
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
475
|
-
id: `embedding-${i}`,
|
|
476
|
-
embedding: generateMockEmbedding(dimensions, `embedding-${i}`),
|
|
477
|
-
}));
|
|
478
|
-
}
|
|
479
|
-
/**
|
|
480
|
-
* Invalid memory entries for error testing
|
|
481
|
-
*/
|
|
482
|
-
export const invalidMemoryEntries = {
|
|
483
|
-
emptyKey: {
|
|
484
|
-
key: '',
|
|
485
|
-
value: { data: 'test' },
|
|
486
|
-
metadata: { type: 'short-term', tags: [] },
|
|
487
|
-
createdAt: new Date(),
|
|
488
|
-
updatedAt: new Date(),
|
|
489
|
-
},
|
|
490
|
-
nullValue: {
|
|
491
|
-
key: 'valid-key',
|
|
492
|
-
value: null,
|
|
493
|
-
metadata: { type: 'short-term', tags: [] },
|
|
494
|
-
createdAt: new Date(),
|
|
495
|
-
updatedAt: new Date(),
|
|
496
|
-
},
|
|
497
|
-
invalidEmbeddingDimension: {
|
|
498
|
-
key: 'valid-key',
|
|
499
|
-
value: { data: 'test' },
|
|
500
|
-
metadata: { type: 'semantic', tags: [] },
|
|
501
|
-
embedding: [0.1, 0.2], // Wrong dimension
|
|
502
|
-
createdAt: new Date(),
|
|
503
|
-
updatedAt: new Date(),
|
|
504
|
-
},
|
|
505
|
-
expiredEntry: {
|
|
506
|
-
key: 'expired-key',
|
|
507
|
-
value: { data: 'expired' },
|
|
508
|
-
metadata: { type: 'short-term', tags: [], ttl: -1000 },
|
|
509
|
-
createdAt: new Date('2024-01-01T00:00:00Z'),
|
|
510
|
-
updatedAt: new Date('2024-01-01T00:00:00Z'),
|
|
511
|
-
expiresAt: new Date('2024-01-01T00:01:00Z'),
|
|
512
|
-
},
|
|
513
|
-
invalidTags: {
|
|
514
|
-
key: 'invalid-tags',
|
|
515
|
-
value: { data: 'test' },
|
|
516
|
-
metadata: { type: 'short-term', tags: null },
|
|
517
|
-
createdAt: new Date(),
|
|
518
|
-
updatedAt: new Date(),
|
|
519
|
-
},
|
|
520
|
-
};
|
|
521
|
-
/**
|
|
522
|
-
* Create a mock memory service
|
|
523
|
-
*/
|
|
524
|
-
export function createMockMemoryService() {
|
|
525
|
-
return {
|
|
526
|
-
store: vi.fn().mockResolvedValue(undefined),
|
|
527
|
-
retrieve: vi.fn().mockResolvedValue(null),
|
|
528
|
-
search: vi.fn().mockResolvedValue([]),
|
|
529
|
-
delete: vi.fn().mockResolvedValue(undefined),
|
|
530
|
-
clear: vi.fn().mockResolvedValue(undefined),
|
|
531
|
-
getStats: vi.fn().mockResolvedValue({ totalEntries: 0, sizeBytes: 0 }),
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Create a mock AgentDB instance
|
|
536
|
-
*/
|
|
537
|
-
export function createMockAgentDB() {
|
|
538
|
-
return {
|
|
539
|
-
insert: vi.fn().mockResolvedValue(undefined),
|
|
540
|
-
search: vi.fn().mockResolvedValue([]),
|
|
541
|
-
delete: vi.fn().mockResolvedValue(undefined),
|
|
542
|
-
update: vi.fn().mockResolvedValue(undefined),
|
|
543
|
-
getStats: vi.fn().mockResolvedValue({ vectorCount: 0, indexSize: 0 }),
|
|
544
|
-
rebuildIndex: vi.fn().mockResolvedValue(undefined),
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
//# sourceMappingURL=memory-fixtures.js.map
|