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,229 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V3 Swarmdo Task Fixtures
|
|
3
|
-
*
|
|
4
|
-
* Test data for task-related testing
|
|
5
|
-
* Following London School principle of explicit test data
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Pre-defined task definitions for testing
|
|
9
|
-
*/
|
|
10
|
-
export const taskDefinitions = {
|
|
11
|
-
securityScan: {
|
|
12
|
-
name: 'Security Scan',
|
|
13
|
-
type: 'security',
|
|
14
|
-
payload: {
|
|
15
|
-
target: './src',
|
|
16
|
-
scanType: 'full',
|
|
17
|
-
severity: 'high',
|
|
18
|
-
},
|
|
19
|
-
priority: 100,
|
|
20
|
-
metadata: { cve: ['CVE-1', 'CVE-2', 'CVE-3'] },
|
|
21
|
-
},
|
|
22
|
-
codeReview: {
|
|
23
|
-
name: 'Code Review',
|
|
24
|
-
type: 'review',
|
|
25
|
-
payload: {
|
|
26
|
-
files: ['src/main.ts', 'src/utils.ts'],
|
|
27
|
-
rules: ['security', 'performance', 'style'],
|
|
28
|
-
},
|
|
29
|
-
priority: 80,
|
|
30
|
-
},
|
|
31
|
-
memoryOptimization: {
|
|
32
|
-
name: 'Memory Optimization',
|
|
33
|
-
type: 'optimization',
|
|
34
|
-
payload: {
|
|
35
|
-
targetReduction: 0.50,
|
|
36
|
-
backend: 'agentdb',
|
|
37
|
-
},
|
|
38
|
-
priority: 70,
|
|
39
|
-
},
|
|
40
|
-
swarmCoordination: {
|
|
41
|
-
name: 'Swarm Coordination',
|
|
42
|
-
type: 'coordination',
|
|
43
|
-
payload: {
|
|
44
|
-
topology: 'hierarchical-mesh',
|
|
45
|
-
agents: 15,
|
|
46
|
-
task: 'implementation',
|
|
47
|
-
},
|
|
48
|
-
priority: 90,
|
|
49
|
-
},
|
|
50
|
-
unitTesting: {
|
|
51
|
-
name: 'Unit Testing',
|
|
52
|
-
type: 'testing',
|
|
53
|
-
payload: {
|
|
54
|
-
framework: 'vitest',
|
|
55
|
-
coverage: 0.90,
|
|
56
|
-
patterns: ['**/*.test.ts'],
|
|
57
|
-
},
|
|
58
|
-
priority: 75,
|
|
59
|
-
},
|
|
60
|
-
implementation: {
|
|
61
|
-
name: 'Implementation Task',
|
|
62
|
-
type: 'coding',
|
|
63
|
-
payload: {
|
|
64
|
-
module: 'security',
|
|
65
|
-
feature: 'path-validation',
|
|
66
|
-
},
|
|
67
|
-
priority: 60,
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Pre-defined task instances for testing
|
|
72
|
-
*/
|
|
73
|
-
export const taskInstances = {
|
|
74
|
-
pendingSecurityScan: {
|
|
75
|
-
id: 'task-security-001',
|
|
76
|
-
name: 'Security Scan',
|
|
77
|
-
type: 'security',
|
|
78
|
-
status: 'pending',
|
|
79
|
-
payload: taskDefinitions.securityScan.payload,
|
|
80
|
-
priority: 100,
|
|
81
|
-
createdAt: new Date('2024-01-15T10:00:00Z'),
|
|
82
|
-
},
|
|
83
|
-
runningCodeReview: {
|
|
84
|
-
id: 'task-review-001',
|
|
85
|
-
name: 'Code Review',
|
|
86
|
-
type: 'review',
|
|
87
|
-
status: 'running',
|
|
88
|
-
payload: taskDefinitions.codeReview.payload,
|
|
89
|
-
priority: 80,
|
|
90
|
-
createdAt: new Date('2024-01-15T09:00:00Z'),
|
|
91
|
-
startedAt: new Date('2024-01-15T09:05:00Z'),
|
|
92
|
-
},
|
|
93
|
-
completedUnitTesting: {
|
|
94
|
-
id: 'task-testing-001',
|
|
95
|
-
name: 'Unit Testing',
|
|
96
|
-
type: 'testing',
|
|
97
|
-
status: 'completed',
|
|
98
|
-
payload: taskDefinitions.unitTesting.payload,
|
|
99
|
-
priority: 75,
|
|
100
|
-
createdAt: new Date('2024-01-15T08:00:00Z'),
|
|
101
|
-
startedAt: new Date('2024-01-15T08:05:00Z'),
|
|
102
|
-
completedAt: new Date('2024-01-15T08:30:00Z'),
|
|
103
|
-
},
|
|
104
|
-
failedImplementation: {
|
|
105
|
-
id: 'task-impl-001',
|
|
106
|
-
name: 'Implementation Task',
|
|
107
|
-
type: 'coding',
|
|
108
|
-
status: 'failed',
|
|
109
|
-
payload: taskDefinitions.implementation.payload,
|
|
110
|
-
priority: 60,
|
|
111
|
-
createdAt: new Date('2024-01-15T07:00:00Z'),
|
|
112
|
-
startedAt: new Date('2024-01-15T07:05:00Z'),
|
|
113
|
-
completedAt: new Date('2024-01-15T07:20:00Z'),
|
|
114
|
-
error: 'Compilation error: missing dependency',
|
|
115
|
-
},
|
|
116
|
-
cancelledSwarmCoordination: {
|
|
117
|
-
id: 'task-swarm-001',
|
|
118
|
-
name: 'Swarm Coordination',
|
|
119
|
-
type: 'coordination',
|
|
120
|
-
status: 'cancelled',
|
|
121
|
-
payload: taskDefinitions.swarmCoordination.payload,
|
|
122
|
-
priority: 90,
|
|
123
|
-
createdAt: new Date('2024-01-15T06:00:00Z'),
|
|
124
|
-
startedAt: new Date('2024-01-15T06:05:00Z'),
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Pre-defined task results for testing
|
|
129
|
-
*/
|
|
130
|
-
export const taskResults = {
|
|
131
|
-
successfulSecurityScan: {
|
|
132
|
-
taskId: 'task-security-001',
|
|
133
|
-
success: true,
|
|
134
|
-
output: {
|
|
135
|
-
vulnerabilities: 0,
|
|
136
|
-
scannedFiles: 150,
|
|
137
|
-
duration: 5000,
|
|
138
|
-
},
|
|
139
|
-
duration: 5000,
|
|
140
|
-
metrics: {
|
|
141
|
-
cpuTime: 4500,
|
|
142
|
-
memoryUsage: 128 * 1024 * 1024,
|
|
143
|
-
ioOperations: 300,
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
failedSecurityScan: {
|
|
147
|
-
taskId: 'task-security-002',
|
|
148
|
-
success: false,
|
|
149
|
-
error: new Error('Critical vulnerability found: CVE-2024-001'),
|
|
150
|
-
duration: 2500,
|
|
151
|
-
},
|
|
152
|
-
successfulCodeReview: {
|
|
153
|
-
taskId: 'task-review-001',
|
|
154
|
-
success: true,
|
|
155
|
-
output: {
|
|
156
|
-
issues: 3,
|
|
157
|
-
suggestions: 10,
|
|
158
|
-
approved: true,
|
|
159
|
-
},
|
|
160
|
-
duration: 15000,
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* Factory function to create task definition with overrides
|
|
165
|
-
*/
|
|
166
|
-
export function createTaskDefinition(base, overrides) {
|
|
167
|
-
return {
|
|
168
|
-
...taskDefinitions[base],
|
|
169
|
-
...overrides,
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Factory function to create task instance with overrides
|
|
174
|
-
*/
|
|
175
|
-
export function createTaskInstance(base, overrides) {
|
|
176
|
-
return {
|
|
177
|
-
...taskInstances[base],
|
|
178
|
-
...overrides,
|
|
179
|
-
id: overrides?.id ?? `task-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
|
|
180
|
-
createdAt: overrides?.createdAt ?? new Date(),
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Factory function to create task result with overrides
|
|
185
|
-
*/
|
|
186
|
-
export function createTaskResult(base, overrides) {
|
|
187
|
-
return {
|
|
188
|
-
...taskResults[base],
|
|
189
|
-
...overrides,
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Invalid task definitions for error testing
|
|
194
|
-
*/
|
|
195
|
-
export const invalidTaskDefinitions = {
|
|
196
|
-
emptyName: {
|
|
197
|
-
name: '',
|
|
198
|
-
type: 'coding',
|
|
199
|
-
payload: {},
|
|
200
|
-
},
|
|
201
|
-
emptyType: {
|
|
202
|
-
name: 'Valid Name',
|
|
203
|
-
type: '',
|
|
204
|
-
payload: {},
|
|
205
|
-
},
|
|
206
|
-
nullPayload: {
|
|
207
|
-
name: 'Valid Name',
|
|
208
|
-
type: 'coding',
|
|
209
|
-
payload: null,
|
|
210
|
-
},
|
|
211
|
-
invalidPriority: {
|
|
212
|
-
name: 'Valid Name',
|
|
213
|
-
type: 'coding',
|
|
214
|
-
payload: {},
|
|
215
|
-
priority: -100,
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
/**
|
|
219
|
-
* Task batch for swarm testing
|
|
220
|
-
*/
|
|
221
|
-
export function createTaskBatch(count, type = 'coding') {
|
|
222
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
223
|
-
name: `Batch Task ${i + 1}`,
|
|
224
|
-
type,
|
|
225
|
-
payload: { index: i },
|
|
226
|
-
priority: Math.floor(Math.random() * 100),
|
|
227
|
-
}));
|
|
228
|
-
}
|
|
229
|
-
//# sourceMappingURL=tasks.js.map
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @swarmdo/testing - Assertion Helpers
|
|
3
|
-
*
|
|
4
|
-
* Custom Vitest matchers and assertion utilities for V3 module testing.
|
|
5
|
-
* Implements London School TDD behavior verification patterns.
|
|
6
|
-
*/
|
|
7
|
-
import { type Mock } from 'vitest';
|
|
8
|
-
/**
|
|
9
|
-
* Assert that a mock was called with arguments matching a pattern
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* assertCalledWithPattern(mockFn, { userId: expect.any(String) });
|
|
13
|
-
*/
|
|
14
|
-
export declare function assertCalledWithPattern(mock: Mock, pattern: Record<string, unknown> | unknown[]): void;
|
|
15
|
-
/**
|
|
16
|
-
* Assert that events were published in order
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* assertEventOrder(mockEventBus.publish, ['UserCreated', 'EmailSent']);
|
|
20
|
-
*/
|
|
21
|
-
export declare function assertEventOrder(publishMock: Mock, expectedEventTypes: string[]): void;
|
|
22
|
-
/**
|
|
23
|
-
* Assert that an event was published with specific payload
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* assertEventPublished(mockEventBus, 'UserCreated', { userId: '123' });
|
|
27
|
-
*/
|
|
28
|
-
export declare function assertEventPublished(eventBusMock: {
|
|
29
|
-
publish: Mock;
|
|
30
|
-
} | Mock, eventType: string, expectedPayload?: Record<string, unknown>): void;
|
|
31
|
-
/**
|
|
32
|
-
* Assert that no event of a specific type was published
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* assertEventNotPublished(mockEventBus, 'UserDeleted');
|
|
36
|
-
*/
|
|
37
|
-
export declare function assertEventNotPublished(eventBusMock: {
|
|
38
|
-
publish: Mock;
|
|
39
|
-
} | Mock, eventType: string): void;
|
|
40
|
-
/**
|
|
41
|
-
* Assert that mocks were called in a specific order
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* assertMocksCalledInOrder([mockValidate, mockSave, mockNotify]);
|
|
45
|
-
*/
|
|
46
|
-
export declare function assertMocksCalledInOrder(mocks: Mock[]): void;
|
|
47
|
-
/**
|
|
48
|
-
* Assert that a mock was called exactly n times with specific arguments
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* assertCalledNTimesWith(mockFn, 3, ['arg1', 'arg2']);
|
|
52
|
-
*/
|
|
53
|
-
export declare function assertCalledNTimesWith(mock: Mock, times: number, args: unknown[]): void;
|
|
54
|
-
/**
|
|
55
|
-
* Assert that async operations completed within time limit
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* await assertCompletesWithin(async () => await slowOp(), 1000);
|
|
59
|
-
*/
|
|
60
|
-
export declare function assertCompletesWithin(operation: () => Promise<unknown>, maxMs: number): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Assert that an operation throws a specific error
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* await assertThrowsError(
|
|
66
|
-
* async () => await riskyOp(),
|
|
67
|
-
* ValidationError,
|
|
68
|
-
* 'Invalid input'
|
|
69
|
-
* );
|
|
70
|
-
*/
|
|
71
|
-
export declare function assertThrowsError<E extends Error>(operation: () => Promise<unknown>, ErrorType: new (...args: unknown[]) => E, messagePattern?: string | RegExp): Promise<E>;
|
|
72
|
-
/**
|
|
73
|
-
* Assert that no sensitive data appears in logs
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* assertNoSensitiveData(mockLogger.logs, ['password', 'token', 'secret']);
|
|
77
|
-
*/
|
|
78
|
-
export declare function assertNoSensitiveData(logs: Array<{
|
|
79
|
-
message: string;
|
|
80
|
-
context?: Record<string, unknown>;
|
|
81
|
-
}>, sensitivePatterns: string[]): void;
|
|
82
|
-
/**
|
|
83
|
-
* Assert that a value matches a snapshot with custom serialization
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* assertMatchesSnapshot(result, { ignoreFields: ['timestamp', 'id'] });
|
|
87
|
-
*/
|
|
88
|
-
export declare function assertMatchesSnapshot(value: unknown, options?: SnapshotOptions): void;
|
|
89
|
-
/**
|
|
90
|
-
* Snapshot options interface
|
|
91
|
-
*/
|
|
92
|
-
export interface SnapshotOptions {
|
|
93
|
-
ignoreFields?: string[];
|
|
94
|
-
transform?: (value: unknown) => unknown;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Assert that performance metrics meet V3 targets
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* assertV3PerformanceTargets({
|
|
101
|
-
* searchSpeedup: 160,
|
|
102
|
-
* memoryReduction: 0.55,
|
|
103
|
-
* });
|
|
104
|
-
*/
|
|
105
|
-
export declare function assertV3PerformanceTargets(metrics: V3PerformanceMetrics): void;
|
|
106
|
-
/**
|
|
107
|
-
* V3 performance metrics interface
|
|
108
|
-
*/
|
|
109
|
-
export interface V3PerformanceMetrics {
|
|
110
|
-
searchSpeedup?: number;
|
|
111
|
-
flashAttentionSpeedup?: number;
|
|
112
|
-
memoryReduction?: number;
|
|
113
|
-
startupTimeMs?: number;
|
|
114
|
-
responseTimeMs?: number;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Assert that a domain object is valid
|
|
118
|
-
*
|
|
119
|
-
* @example
|
|
120
|
-
* assertValidDomainObject(user, UserSchema);
|
|
121
|
-
*/
|
|
122
|
-
export declare function assertValidDomainObject<T>(object: T, validator: (obj: T) => {
|
|
123
|
-
valid: boolean;
|
|
124
|
-
errors?: string[];
|
|
125
|
-
}): void;
|
|
126
|
-
/**
|
|
127
|
-
* Assert that a mock was only called with allowed arguments
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* assertOnlyCalledWithAllowed(mockFn, [['valid1'], ['valid2']]);
|
|
131
|
-
*/
|
|
132
|
-
export declare function assertOnlyCalledWithAllowed(mock: Mock, allowedCalls: unknown[][]): void;
|
|
133
|
-
/**
|
|
134
|
-
* Assert that an array contains elements in partial order
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* assertPartialOrder(events, [
|
|
138
|
-
* { type: 'Start' },
|
|
139
|
-
* { type: 'Process' },
|
|
140
|
-
* { type: 'End' },
|
|
141
|
-
* ]);
|
|
142
|
-
*/
|
|
143
|
-
export declare function assertPartialOrder<T>(actual: T[], expectedOrder: Partial<T>[]): void;
|
|
144
|
-
/**
|
|
145
|
-
* Assert that all items in a collection pass a predicate
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* assertAllPass(results, result => result.success);
|
|
149
|
-
*/
|
|
150
|
-
export declare function assertAllPass<T>(items: T[], predicate: (item: T, index: number) => boolean, message?: string): void;
|
|
151
|
-
/**
|
|
152
|
-
* Assert that none of the items in a collection pass a predicate
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* assertNonePass(results, result => result.error);
|
|
156
|
-
*/
|
|
157
|
-
export declare function assertNonePass<T>(items: T[], predicate: (item: T, index: number) => boolean, message?: string): void;
|
|
158
|
-
/**
|
|
159
|
-
* Assert that two arrays have the same elements regardless of order
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* assertSameElements([1, 2, 3], [3, 1, 2]);
|
|
163
|
-
*/
|
|
164
|
-
export declare function assertSameElements<T>(actual: T[], expected: T[]): void;
|
|
165
|
-
/**
|
|
166
|
-
* Assert that a mock returns expected results in sequence
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* await assertMockReturnsSequence(mockFn, [1, 2, 3]);
|
|
170
|
-
*/
|
|
171
|
-
export declare function assertMockReturnsSequence(mock: Mock, expectedResults: unknown[]): Promise<void>;
|
|
172
|
-
/**
|
|
173
|
-
* Assert state transition is valid
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* assertValidStateTransition(
|
|
177
|
-
* 'pending',
|
|
178
|
-
* 'running',
|
|
179
|
-
* { pending: ['running', 'cancelled'], running: ['completed', 'failed'] }
|
|
180
|
-
* );
|
|
181
|
-
*/
|
|
182
|
-
export declare function assertValidStateTransition<T extends string>(from: T, to: T, allowedTransitions: Record<T, T[]>): void;
|
|
183
|
-
/**
|
|
184
|
-
* Assert that a retry policy was followed
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* assertRetryPattern(mockFn, { attempts: 3, backoffPattern: 'exponential' });
|
|
188
|
-
*/
|
|
189
|
-
export declare function assertRetryPattern(mock: Mock, options: RetryPatternOptions): void;
|
|
190
|
-
/**
|
|
191
|
-
* Retry pattern options interface
|
|
192
|
-
*/
|
|
193
|
-
export interface RetryPatternOptions {
|
|
194
|
-
attempts: number;
|
|
195
|
-
backoffPattern?: 'linear' | 'exponential' | 'constant';
|
|
196
|
-
initialDelayMs?: number;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Assert that a dependency was properly injected
|
|
200
|
-
*
|
|
201
|
-
* @example
|
|
202
|
-
* assertDependencyInjected(service, 'repository', mockRepository);
|
|
203
|
-
*/
|
|
204
|
-
export declare function assertDependencyInjected<T extends object>(subject: T, propertyName: keyof T, expectedDependency: unknown): void;
|
|
205
|
-
/**
|
|
206
|
-
* Custom Vitest matcher declarations
|
|
207
|
-
* Note: Main declarations in setup.ts - these extend CustomMatchers
|
|
208
|
-
*/
|
|
209
|
-
/**
|
|
210
|
-
* Register custom Vitest matchers
|
|
211
|
-
*/
|
|
212
|
-
export declare function registerCustomMatchers(): void;
|
|
213
|
-
//# sourceMappingURL=assertion-helpers.d.ts.map
|