@cleocode/core 2026.3.42 → 2026.3.44
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/dist/adapters/adapter-registry.d.ts +29 -0
- package/dist/adapters/adapter-registry.d.ts.map +1 -0
- package/dist/adapters/discovery.d.ts +18 -0
- package/dist/adapters/discovery.d.ts.map +1 -0
- package/dist/adapters/index.d.ts +10 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/manager.d.ts +81 -0
- package/dist/adapters/manager.d.ts.map +1 -0
- package/dist/admin/export-tasks.d.ts +30 -0
- package/dist/admin/export-tasks.d.ts.map +1 -0
- package/dist/admin/export.d.ts +28 -0
- package/dist/admin/export.d.ts.map +1 -0
- package/dist/admin/help.d.ts +74 -0
- package/dist/admin/help.d.ts.map +1 -0
- package/dist/admin/import-tasks.d.ts +43 -0
- package/dist/admin/import-tasks.d.ts.map +1 -0
- package/dist/admin/import.d.ts +33 -0
- package/dist/admin/import.d.ts.map +1 -0
- package/dist/admin/index.d.ts +14 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/adrs/find.d.ts +24 -0
- package/dist/adrs/find.d.ts.map +1 -0
- package/dist/adrs/index.d.ts +18 -0
- package/dist/adrs/index.d.ts.map +1 -0
- package/dist/adrs/link-pipeline.d.ts +35 -0
- package/dist/adrs/link-pipeline.d.ts.map +1 -0
- package/dist/adrs/list.d.ts +16 -0
- package/dist/adrs/list.d.ts.map +1 -0
- package/dist/adrs/parse.d.ts +18 -0
- package/dist/adrs/parse.d.ts.map +1 -0
- package/dist/adrs/show.d.ts +11 -0
- package/dist/adrs/show.d.ts.map +1 -0
- package/dist/adrs/sync.d.ts +20 -0
- package/dist/adrs/sync.d.ts.map +1 -0
- package/dist/adrs/types.d.ts +67 -0
- package/dist/adrs/types.d.ts.map +1 -0
- package/dist/adrs/validate.d.ts +24 -0
- package/dist/adrs/validate.d.ts.map +1 -0
- package/dist/agents/agent-schema.d.ts +358 -0
- package/dist/agents/agent-schema.d.ts.map +1 -0
- package/dist/agents/capacity.d.ts +57 -0
- package/dist/agents/capacity.d.ts.map +1 -0
- package/dist/agents/index.d.ts +17 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/registry.d.ts +115 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/retry.d.ts +83 -0
- package/dist/agents/retry.d.ts.map +1 -0
- package/dist/audit-prune.d.ts +35 -0
- package/dist/audit-prune.d.ts.map +1 -0
- package/dist/audit.d.ts +49 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/bootstrap.d.ts +44 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/caamp/adapter.d.ts +130 -0
- package/dist/caamp/adapter.d.ts.map +1 -0
- package/dist/caamp/capability-check.d.ts +27 -0
- package/dist/caamp/capability-check.d.ts.map +1 -0
- package/dist/caamp/index.d.ts +12 -0
- package/dist/caamp/index.d.ts.map +1 -0
- package/dist/caamp-init.d.ts +2 -0
- package/dist/caamp-init.d.ts.map +1 -0
- package/dist/cleo.d.ts +295 -0
- package/dist/cleo.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/architecture.d.ts +7 -0
- package/dist/codebase-map/analyzers/architecture.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/concerns.d.ts +6 -0
- package/dist/codebase-map/analyzers/concerns.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/conventions.d.ts +8 -0
- package/dist/codebase-map/analyzers/conventions.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/integrations.d.ts +7 -0
- package/dist/codebase-map/analyzers/integrations.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/stack.d.ts +8 -0
- package/dist/codebase-map/analyzers/stack.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/structure.d.ts +6 -0
- package/dist/codebase-map/analyzers/structure.d.ts.map +1 -0
- package/dist/codebase-map/analyzers/testing.d.ts +8 -0
- package/dist/codebase-map/analyzers/testing.d.ts.map +1 -0
- package/dist/codebase-map/index.d.ts +94 -0
- package/dist/codebase-map/index.d.ts.map +1 -0
- package/dist/codebase-map/store.d.ts +13 -0
- package/dist/codebase-map/store.d.ts.map +1 -0
- package/dist/codebase-map/summary.d.ts +7 -0
- package/dist/codebase-map/summary.d.ts.map +1 -0
- package/dist/compliance/index.d.ts +38 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/protocol-enforcement.d.ts +106 -0
- package/dist/compliance/protocol-enforcement.d.ts.map +1 -0
- package/dist/compliance/protocol-rules.d.ts +55 -0
- package/dist/compliance/protocol-rules.d.ts.map +1 -0
- package/dist/compliance/protocol-types.d.ts +109 -0
- package/dist/compliance/protocol-types.d.ts.map +1 -0
- package/dist/compliance/store.d.ts +19 -0
- package/dist/compliance/store.d.ts.map +1 -0
- package/dist/config/build-config.d.ts +31 -0
- package/dist/config/build-config.d.ts.map +1 -0
- package/dist/config.d.ts +53 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/context/index.d.ts +20 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/engine-result.d.ts +31 -0
- package/dist/engine-result.d.ts.map +1 -0
- package/dist/error-catalog.d.ts +49 -0
- package/dist/error-catalog.d.ts.map +1 -0
- package/dist/error-registry.d.ts +58 -0
- package/dist/error-registry.d.ts.map +1 -0
- package/dist/errors.d.ts +66 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/hooks/handlers/error-hooks.d.ts +18 -0
- package/dist/hooks/handlers/error-hooks.d.ts.map +1 -0
- package/dist/hooks/handlers/file-hooks.d.ts +20 -0
- package/dist/hooks/handlers/file-hooks.d.ts.map +1 -0
- package/dist/hooks/handlers/index.d.ts +17 -0
- package/dist/hooks/handlers/index.d.ts.map +1 -0
- package/dist/hooks/handlers/mcp-hooks.d.ts +22 -0
- package/dist/hooks/handlers/mcp-hooks.d.ts.map +1 -0
- package/dist/hooks/handlers/session-hooks.d.ts +16 -0
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -0
- package/dist/hooks/handlers/task-hooks.d.ts +16 -0
- package/dist/hooks/handlers/task-hooks.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/payload-schemas.d.ts +214 -0
- package/dist/hooks/payload-schemas.d.ts.map +1 -0
- package/dist/hooks/provider-hooks.d.ts +27 -0
- package/dist/hooks/provider-hooks.d.ts.map +1 -0
- package/dist/hooks/registry.d.ts +111 -0
- package/dist/hooks/registry.d.ts.map +1 -0
- package/dist/hooks/types.d.ts +299 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks.d.ts +46 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16443 -2160
- package/dist/index.js.map +4 -4
- package/dist/init.d.ts +137 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/inject/index.d.ts +26 -0
- package/dist/inject/index.d.ts.map +1 -0
- package/dist/injection.d.ts +69 -0
- package/dist/injection.d.ts.map +1 -0
- package/dist/intelligence/impact.d.ts +51 -0
- package/dist/intelligence/impact.d.ts.map +1 -0
- package/dist/intelligence/index.d.ts +15 -0
- package/dist/intelligence/index.d.ts.map +1 -0
- package/dist/intelligence/patterns.d.ts +66 -0
- package/dist/intelligence/patterns.d.ts.map +1 -0
- package/dist/intelligence/prediction.d.ts +51 -0
- package/dist/intelligence/prediction.d.ts.map +1 -0
- package/dist/intelligence/types.d.ts +221 -0
- package/dist/intelligence/types.d.ts.map +1 -0
- package/dist/internal.d.ts +209 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/issue/create.d.ts +43 -0
- package/dist/issue/create.d.ts.map +1 -0
- package/dist/issue/diagnostics.d.ts +18 -0
- package/dist/issue/diagnostics.d.ts.map +1 -0
- package/dist/issue/index.d.ts +12 -0
- package/dist/issue/index.d.ts.map +1 -0
- package/dist/issue/template-parser.d.ts +54 -0
- package/dist/issue/template-parser.d.ts.map +1 -0
- package/dist/json-schema-validator.d.ts +20 -0
- package/dist/json-schema-validator.d.ts.map +1 -0
- package/dist/lifecycle/chain-composition.d.ts +30 -0
- package/dist/lifecycle/chain-composition.d.ts.map +1 -0
- package/dist/lifecycle/chain-store.d.ts +70 -0
- package/dist/lifecycle/chain-store.d.ts.map +1 -0
- package/dist/lifecycle/consolidate-rcasd.d.ts +81 -0
- package/dist/lifecycle/consolidate-rcasd.d.ts.map +1 -0
- package/dist/lifecycle/default-chain.d.ts +33 -0
- package/dist/lifecycle/default-chain.d.ts.map +1 -0
- package/dist/lifecycle/evidence.d.ts +71 -0
- package/dist/lifecycle/evidence.d.ts.map +1 -0
- package/dist/lifecycle/frontmatter.d.ts +104 -0
- package/dist/lifecycle/frontmatter.d.ts.map +1 -0
- package/dist/lifecycle/index.d.ts +228 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/pipeline.d.ts +335 -0
- package/dist/lifecycle/pipeline.d.ts.map +1 -0
- package/dist/lifecycle/rcasd-index.d.ts +168 -0
- package/dist/lifecycle/rcasd-index.d.ts.map +1 -0
- package/dist/lifecycle/rcasd-paths.d.ts +103 -0
- package/dist/lifecycle/rcasd-paths.d.ts.map +1 -0
- package/dist/lifecycle/resume.d.ts +501 -0
- package/dist/lifecycle/resume.d.ts.map +1 -0
- package/dist/lifecycle/stage-artifacts.d.ts +23 -0
- package/dist/lifecycle/stage-artifacts.d.ts.map +1 -0
- package/dist/lifecycle/stages.d.ts +323 -0
- package/dist/lifecycle/stages.d.ts.map +1 -0
- package/dist/lifecycle/state-machine.d.ts +327 -0
- package/dist/lifecycle/state-machine.d.ts.map +1 -0
- package/dist/lifecycle/tessera-engine.d.ts +48 -0
- package/dist/lifecycle/tessera-engine.d.ts.map +1 -0
- package/dist/logger.d.ts +54 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +42 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/memory/auto-extract.d.ts +34 -0
- package/dist/memory/auto-extract.d.ts.map +1 -0
- package/dist/memory/brain-embedding.d.ts +42 -0
- package/dist/memory/brain-embedding.d.ts.map +1 -0
- package/dist/memory/brain-lifecycle.d.ts +57 -0
- package/dist/memory/brain-lifecycle.d.ts.map +1 -0
- package/dist/memory/brain-links.d.ts +75 -0
- package/dist/memory/brain-links.d.ts.map +1 -0
- package/dist/memory/brain-migration.d.ts +30 -0
- package/dist/memory/brain-migration.d.ts.map +1 -0
- package/dist/memory/brain-reasoning.d.ts +54 -0
- package/dist/memory/brain-reasoning.d.ts.map +1 -0
- package/dist/memory/brain-retrieval.d.ts +157 -0
- package/dist/memory/brain-retrieval.d.ts.map +1 -0
- package/dist/memory/brain-row-types.d.ts +79 -0
- package/dist/memory/brain-row-types.d.ts.map +1 -0
- package/dist/memory/brain-search.d.ts +91 -0
- package/dist/memory/brain-search.d.ts.map +1 -0
- package/dist/memory/brain-similarity.d.ts +33 -0
- package/dist/memory/brain-similarity.d.ts.map +1 -0
- package/dist/memory/claude-mem-migration.d.ts +45 -0
- package/dist/memory/claude-mem-migration.d.ts.map +1 -0
- package/dist/memory/decisions.d.ts +72 -0
- package/dist/memory/decisions.d.ts.map +1 -0
- package/dist/memory/engine-compat.d.ts +144 -0
- package/dist/memory/engine-compat.d.ts.map +1 -0
- package/dist/memory/index.d.ts +305 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/learnings.d.ts +74 -0
- package/dist/memory/learnings.d.ts.map +1 -0
- package/dist/memory/memory-bridge.d.ts +50 -0
- package/dist/memory/memory-bridge.d.ts.map +1 -0
- package/dist/memory/patterns.d.ts +87 -0
- package/dist/memory/patterns.d.ts.map +1 -0
- package/dist/memory/pipeline-manifest-sqlite.d.ts +83 -0
- package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -0
- package/dist/memory/session-memory.d.ts +88 -0
- package/dist/memory/session-memory.d.ts.map +1 -0
- package/dist/metrics/ab-test.d.ts +52 -0
- package/dist/metrics/ab-test.d.ts.map +1 -0
- package/dist/metrics/aggregation.d.ts +41 -0
- package/dist/metrics/aggregation.d.ts.map +1 -0
- package/dist/metrics/common.d.ts +30 -0
- package/dist/metrics/common.d.ts.map +1 -0
- package/dist/metrics/enums.d.ts +68 -0
- package/dist/metrics/enums.d.ts.map +1 -0
- package/dist/metrics/index.d.ts +17 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/model-provider-registry.d.ts +17 -0
- package/dist/metrics/model-provider-registry.d.ts.map +1 -0
- package/dist/metrics/otel-integration.d.ts +49 -0
- package/dist/metrics/otel-integration.d.ts.map +1 -0
- package/dist/metrics/provider-detection.d.ts +20 -0
- package/dist/metrics/provider-detection.d.ts.map +1 -0
- package/dist/metrics/token-estimation.d.ts +70 -0
- package/dist/metrics/token-estimation.d.ts.map +1 -0
- package/dist/metrics/token-service.d.ts +107 -0
- package/dist/metrics/token-service.d.ts.map +1 -0
- package/dist/migration/agent-outputs.d.ts +70 -0
- package/dist/migration/agent-outputs.d.ts.map +1 -0
- package/dist/migration/checksum.d.ts +55 -0
- package/dist/migration/checksum.d.ts.map +1 -0
- package/dist/migration/index.d.ts +79 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/logger.d.ts +161 -0
- package/dist/migration/logger.d.ts.map +1 -0
- package/dist/migration/preflight.d.ts +10 -0
- package/dist/migration/preflight.d.ts.map +1 -0
- package/dist/migration/state.d.ts +186 -0
- package/dist/migration/state.d.ts.map +1 -0
- package/dist/migration/validate.d.ts +57 -0
- package/dist/migration/validate.d.ts.map +1 -0
- package/dist/nexus/deps.d.ts +98 -0
- package/dist/nexus/deps.d.ts.map +1 -0
- package/dist/nexus/discover.d.ts +66 -0
- package/dist/nexus/discover.d.ts.map +1 -0
- package/dist/nexus/hash.d.ts +7 -0
- package/dist/nexus/hash.d.ts.map +1 -0
- package/dist/nexus/index.d.ts +17 -0
- package/dist/nexus/index.d.ts.map +1 -0
- package/dist/nexus/migrate-json-to-sqlite.d.ts +23 -0
- package/dist/nexus/migrate-json-to-sqlite.d.ts.map +1 -0
- package/dist/nexus/permissions.d.ts +60 -0
- package/dist/nexus/permissions.d.ts.map +1 -0
- package/dist/nexus/query.d.ts +53 -0
- package/dist/nexus/query.d.ts.map +1 -0
- package/dist/nexus/registry.d.ts +126 -0
- package/dist/nexus/registry.d.ts.map +1 -0
- package/dist/nexus/sharing/index.d.ts +39 -0
- package/dist/nexus/sharing/index.d.ts.map +1 -0
- package/dist/observability/index.d.ts +32 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/log-filter.d.ts +31 -0
- package/dist/observability/log-filter.d.ts.map +1 -0
- package/dist/observability/log-parser.d.ts +26 -0
- package/dist/observability/log-parser.d.ts.map +1 -0
- package/dist/observability/log-reader.d.ts +35 -0
- package/dist/observability/log-reader.d.ts.map +1 -0
- package/dist/observability/types.d.ts +112 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/orchestration/analyze.d.ts +57 -0
- package/dist/orchestration/analyze.d.ts.map +1 -0
- package/dist/orchestration/bootstrap.d.ts +12 -0
- package/dist/orchestration/bootstrap.d.ts.map +1 -0
- package/dist/orchestration/context.d.ts +38 -0
- package/dist/orchestration/context.d.ts.map +1 -0
- package/dist/orchestration/critical-path.d.ts +22 -0
- package/dist/orchestration/critical-path.d.ts.map +1 -0
- package/dist/orchestration/index.d.ts +116 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/parallel.d.ts +35 -0
- package/dist/orchestration/parallel.d.ts.map +1 -0
- package/dist/orchestration/protocol-validators.d.ts +96 -0
- package/dist/orchestration/protocol-validators.d.ts.map +1 -0
- package/dist/orchestration/skill-ops.d.ts +29 -0
- package/dist/orchestration/skill-ops.d.ts.map +1 -0
- package/dist/orchestration/status.d.ts +92 -0
- package/dist/orchestration/status.d.ts.map +1 -0
- package/dist/orchestration/unblock.d.ts +31 -0
- package/dist/orchestration/unblock.d.ts.map +1 -0
- package/dist/orchestration/validate-spawn.d.ts +19 -0
- package/dist/orchestration/validate-spawn.d.ts.map +1 -0
- package/dist/orchestration/waves.d.ts +26 -0
- package/dist/orchestration/waves.d.ts.map +1 -0
- package/dist/otel/index.d.ts +27 -0
- package/dist/otel/index.d.ts.map +1 -0
- package/dist/output.d.ts +66 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/pagination.d.ts +45 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/paths.d.ts +165 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/phases/deps.d.ts +119 -0
- package/dist/phases/deps.d.ts.map +1 -0
- package/dist/phases/index.d.ts +123 -0
- package/dist/phases/index.d.ts.map +1 -0
- package/dist/pipeline/index.d.ts +10 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/phase.d.ts +36 -0
- package/dist/pipeline/phase.d.ts.map +1 -0
- package/dist/platform.d.ts +103 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/project-info.d.ts +35 -0
- package/dist/project-info.d.ts.map +1 -0
- package/dist/reconciliation/index.d.ts +10 -0
- package/dist/reconciliation/index.d.ts.map +1 -0
- package/dist/reconciliation/link-store.d.ts +44 -0
- package/dist/reconciliation/link-store.d.ts.map +1 -0
- package/dist/reconciliation/reconciliation-engine.d.ts +24 -0
- package/dist/reconciliation/reconciliation-engine.d.ts.map +1 -0
- package/dist/release/artifacts.d.ts +71 -0
- package/dist/release/artifacts.d.ts.map +1 -0
- package/dist/release/changelog-writer.d.ts +26 -0
- package/dist/release/changelog-writer.d.ts.map +1 -0
- package/dist/release/channel.d.ts +54 -0
- package/dist/release/channel.d.ts.map +1 -0
- package/dist/release/ci.d.ts +35 -0
- package/dist/release/ci.d.ts.map +1 -0
- package/dist/release/github-pr.d.ts +63 -0
- package/dist/release/github-pr.d.ts.map +1 -0
- package/dist/release/guards.d.ts +44 -0
- package/dist/release/guards.d.ts.map +1 -0
- package/dist/release/index.d.ts +26 -0
- package/dist/release/index.d.ts.map +1 -0
- package/dist/release/release-config.d.ts +90 -0
- package/dist/release/release-config.d.ts.map +1 -0
- package/dist/release/release-manifest.d.ts +215 -0
- package/dist/release/release-manifest.d.ts.map +1 -0
- package/dist/release/version-bump.d.ts +51 -0
- package/dist/release/version-bump.d.ts.map +1 -0
- package/dist/remote/index.d.ts +81 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/repair.d.ts +30 -0
- package/dist/repair.d.ts.map +1 -0
- package/dist/research/index.d.ts +2 -0
- package/dist/research/index.d.ts.map +1 -0
- package/dist/roadmap/index.d.ts +13 -0
- package/dist/roadmap/index.d.ts.map +1 -0
- package/dist/routing/capability-matrix.d.ts +78 -0
- package/dist/routing/capability-matrix.d.ts.map +1 -0
- package/dist/routing/index.d.ts +10 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/scaffold.d.ts +215 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/schema-management.d.ts +96 -0
- package/dist/schema-management.d.ts.map +1 -0
- package/dist/security/index.d.ts +10 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/input-sanitization.d.ts +93 -0
- package/dist/security/input-sanitization.d.ts.map +1 -0
- package/dist/sequence/index.d.ts +34 -0
- package/dist/sequence/index.d.ts.map +1 -0
- package/dist/sessions/assumptions.d.ts +22 -0
- package/dist/sessions/assumptions.d.ts.map +1 -0
- package/dist/sessions/briefing.d.ts +113 -0
- package/dist/sessions/briefing.d.ts.map +1 -0
- package/dist/sessions/context-alert.d.ts +48 -0
- package/dist/sessions/context-alert.d.ts.map +1 -0
- package/dist/sessions/context-inject.d.ts +31 -0
- package/dist/sessions/context-inject.d.ts.map +1 -0
- package/dist/sessions/context-monitor.d.ts +33 -0
- package/dist/sessions/context-monitor.d.ts.map +1 -0
- package/dist/sessions/decisions.d.ts +29 -0
- package/dist/sessions/decisions.d.ts.map +1 -0
- package/dist/sessions/find.d.ts +38 -0
- package/dist/sessions/find.d.ts.map +1 -0
- package/dist/sessions/handoff.d.ts +137 -0
- package/dist/sessions/handoff.d.ts.map +1 -0
- package/dist/sessions/hitl-warnings.d.ts +58 -0
- package/dist/sessions/hitl-warnings.d.ts.map +1 -0
- package/dist/sessions/index.d.ts +107 -0
- package/dist/sessions/index.d.ts.map +1 -0
- package/dist/sessions/session-archive.d.ts +17 -0
- package/dist/sessions/session-archive.d.ts.map +1 -0
- package/dist/sessions/session-cleanup.d.ts +22 -0
- package/dist/sessions/session-cleanup.d.ts.map +1 -0
- package/dist/sessions/session-drift.d.ts +22 -0
- package/dist/sessions/session-drift.d.ts.map +1 -0
- package/dist/sessions/session-enforcement.d.ts +49 -0
- package/dist/sessions/session-enforcement.d.ts.map +1 -0
- package/dist/sessions/session-grade.d.ts +41 -0
- package/dist/sessions/session-grade.d.ts.map +1 -0
- package/dist/sessions/session-history.d.ts +32 -0
- package/dist/sessions/session-history.d.ts.map +1 -0
- package/dist/sessions/session-id.d.ts +34 -0
- package/dist/sessions/session-id.d.ts.map +1 -0
- package/dist/sessions/session-memory-bridge.d.ts +28 -0
- package/dist/sessions/session-memory-bridge.d.ts.map +1 -0
- package/dist/sessions/session-show.d.ts +14 -0
- package/dist/sessions/session-show.d.ts.map +1 -0
- package/dist/sessions/session-stats.d.ts +30 -0
- package/dist/sessions/session-stats.d.ts.map +1 -0
- package/dist/sessions/session-suspend.d.ts +14 -0
- package/dist/sessions/session-suspend.d.ts.map +1 -0
- package/dist/sessions/session-switch.d.ts +14 -0
- package/dist/sessions/session-switch.d.ts.map +1 -0
- package/dist/sessions/session-view.d.ts +41 -0
- package/dist/sessions/session-view.d.ts.map +1 -0
- package/dist/sessions/statusline-setup.d.ts +24 -0
- package/dist/sessions/statusline-setup.d.ts.map +1 -0
- package/dist/sessions/types.d.ts +110 -0
- package/dist/sessions/types.d.ts.map +1 -0
- package/dist/signaldock/claude-code-transport.d.ts +34 -0
- package/dist/signaldock/claude-code-transport.d.ts.map +1 -0
- package/dist/signaldock/factory.d.ts +22 -0
- package/dist/signaldock/factory.d.ts.map +1 -0
- package/dist/signaldock/index.d.ts +13 -0
- package/dist/signaldock/index.d.ts.map +1 -0
- package/dist/signaldock/signaldock-transport.d.ts +45 -0
- package/dist/signaldock/signaldock-transport.d.ts.map +1 -0
- package/dist/signaldock/transport.d.ts +49 -0
- package/dist/signaldock/transport.d.ts.map +1 -0
- package/dist/signaldock/types.d.ts +88 -0
- package/dist/signaldock/types.d.ts.map +1 -0
- package/dist/skills/agents/config.d.ts +39 -0
- package/dist/skills/agents/config.d.ts.map +1 -0
- package/dist/skills/agents/install.d.ts +33 -0
- package/dist/skills/agents/install.d.ts.map +1 -0
- package/dist/skills/agents/registry.d.ts +56 -0
- package/dist/skills/agents/registry.d.ts.map +1 -0
- package/dist/skills/discovery.d.ts +102 -0
- package/dist/skills/discovery.d.ts.map +1 -0
- package/dist/skills/dispatch.d.ts +67 -0
- package/dist/skills/dispatch.d.ts.map +1 -0
- package/dist/skills/dynamic-skill-generator.d.ts +42 -0
- package/dist/skills/dynamic-skill-generator.d.ts.map +1 -0
- package/dist/skills/index.d.ts +38 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/injection/subagent.d.ts +60 -0
- package/dist/skills/injection/subagent.d.ts.map +1 -0
- package/dist/skills/injection/token.d.ts +121 -0
- package/dist/skills/injection/token.d.ts.map +1 -0
- package/dist/skills/install.d.ts +16 -0
- package/dist/skills/install.d.ts.map +1 -0
- package/dist/skills/manifests/contribution.d.ts +74 -0
- package/dist/skills/manifests/contribution.d.ts.map +1 -0
- package/dist/skills/manifests/research.d.ts +73 -0
- package/dist/skills/manifests/research.d.ts.map +1 -0
- package/dist/skills/manifests/resolver.d.ts +40 -0
- package/dist/skills/manifests/resolver.d.ts.map +1 -0
- package/dist/skills/marketplace.d.ts +45 -0
- package/dist/skills/marketplace.d.ts.map +1 -0
- package/dist/skills/orchestrator/spawn.d.ts +66 -0
- package/dist/skills/orchestrator/spawn.d.ts.map +1 -0
- package/dist/skills/orchestrator/startup.d.ts +85 -0
- package/dist/skills/orchestrator/startup.d.ts.map +1 -0
- package/dist/skills/orchestrator/validator.d.ts +40 -0
- package/dist/skills/orchestrator/validator.d.ts.map +1 -0
- package/dist/skills/precedence-integration.d.ts +46 -0
- package/dist/skills/precedence-integration.d.ts.map +1 -0
- package/dist/skills/precedence-types.d.ts +50 -0
- package/dist/skills/precedence-types.d.ts.map +1 -0
- package/dist/skills/routing-table.d.ts +58 -0
- package/dist/skills/routing-table.d.ts.map +1 -0
- package/dist/skills/skill-paths.d.ts +79 -0
- package/dist/skills/skill-paths.d.ts.map +1 -0
- package/dist/skills/test-utility.d.ts +39 -0
- package/dist/skills/test-utility.d.ts.map +1 -0
- package/dist/skills/types.d.ts +347 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/validation.d.ts +46 -0
- package/dist/skills/validation.d.ts.map +1 -0
- package/dist/skills/version.d.ts +31 -0
- package/dist/skills/version.d.ts.map +1 -0
- package/dist/snapshot/index.d.ts +83 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/spawn/adapter-registry.d.ts +132 -0
- package/dist/spawn/adapter-registry.d.ts.map +1 -0
- package/dist/spawn/index.d.ts +11 -0
- package/dist/spawn/index.d.ts.map +1 -0
- package/dist/stats/index.d.ts +37 -0
- package/dist/stats/index.d.ts.map +1 -0
- package/dist/sticky/archive.d.ts +18 -0
- package/dist/sticky/archive.d.ts.map +1 -0
- package/dist/sticky/convert.d.ts +73 -0
- package/dist/sticky/convert.d.ts.map +1 -0
- package/dist/sticky/create.d.ts +18 -0
- package/dist/sticky/create.d.ts.map +1 -0
- package/dist/sticky/id.d.ts +18 -0
- package/dist/sticky/id.d.ts.map +1 -0
- package/dist/sticky/index.d.ts +17 -0
- package/dist/sticky/index.d.ts.map +1 -0
- package/dist/sticky/list.d.ts +18 -0
- package/dist/sticky/list.d.ts.map +1 -0
- package/dist/sticky/purge.d.ts +17 -0
- package/dist/sticky/purge.d.ts.map +1 -0
- package/dist/sticky/show.d.ts +18 -0
- package/dist/sticky/show.d.ts.map +1 -0
- package/dist/sticky/types.d.ts +87 -0
- package/dist/sticky/types.d.ts.map +1 -0
- package/dist/store/atomic.d.ts +75 -0
- package/dist/store/atomic.d.ts.map +1 -0
- package/dist/store/backup.d.ts +21 -0
- package/dist/store/backup.d.ts.map +1 -0
- package/dist/store/brain-accessor.d.ts +84 -0
- package/dist/store/brain-accessor.d.ts.map +1 -0
- package/dist/store/brain-schema.d.ts +1339 -0
- package/dist/store/brain-schema.d.ts.map +1 -0
- package/dist/store/brain-sqlite.d.ts +59 -0
- package/dist/store/brain-sqlite.d.ts.map +1 -0
- package/dist/store/cache.d.ts +67 -0
- package/dist/store/cache.d.ts.map +1 -0
- package/dist/store/chain-schema.d.ts +319 -0
- package/dist/store/chain-schema.d.ts.map +1 -0
- package/dist/store/converters.d.ts +19 -0
- package/dist/store/converters.d.ts.map +1 -0
- package/dist/store/data-accessor.d.ts +20 -0
- package/dist/store/data-accessor.d.ts.map +1 -0
- package/dist/store/data-safety-central.d.ts +101 -0
- package/dist/store/data-safety-central.d.ts.map +1 -0
- package/dist/store/data-safety.d.ts +92 -0
- package/dist/store/data-safety.d.ts.map +1 -0
- package/dist/store/db-helpers.d.ts +61 -0
- package/dist/store/db-helpers.d.ts.map +1 -0
- package/dist/store/export.d.ts +88 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/file-utils.d.ts +72 -0
- package/dist/store/file-utils.d.ts.map +1 -0
- package/dist/store/git-checkpoint.d.ts +93 -0
- package/dist/store/git-checkpoint.d.ts.map +1 -0
- package/dist/store/import-logging.d.ts +58 -0
- package/dist/store/import-logging.d.ts.map +1 -0
- package/dist/store/import-remap.d.ts +50 -0
- package/dist/store/import-remap.d.ts.map +1 -0
- package/dist/store/import-sort.d.ts +35 -0
- package/dist/store/import-sort.d.ts.map +1 -0
- package/dist/store/index.d.ts +28 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/json.d.ts +57 -0
- package/dist/store/json.d.ts.map +1 -0
- package/dist/store/lifecycle-store.d.ts +125 -0
- package/dist/store/lifecycle-store.d.ts.map +1 -0
- package/dist/store/lock.d.ts +29 -0
- package/dist/store/lock.d.ts.map +1 -0
- package/dist/store/migration-sqlite.d.ts +67 -0
- package/dist/store/migration-sqlite.d.ts.map +1 -0
- package/dist/store/nexus-schema.d.ts +503 -0
- package/dist/store/nexus-schema.d.ts.map +1 -0
- package/dist/store/nexus-sqlite.d.ts +58 -0
- package/dist/store/nexus-sqlite.d.ts.map +1 -0
- package/dist/store/nexus-validation-schemas.d.ts +970 -0
- package/dist/store/nexus-validation-schemas.d.ts.map +1 -0
- package/dist/store/parsers.d.ts +16 -0
- package/dist/store/parsers.d.ts.map +1 -0
- package/dist/store/project-detect.d.ts +56 -0
- package/dist/store/project-detect.d.ts.map +1 -0
- package/dist/store/provider.d.ts +147 -0
- package/dist/store/provider.d.ts.map +1 -0
- package/dist/store/safety-data-accessor.d.ts +123 -0
- package/dist/store/safety-data-accessor.d.ts.map +1 -0
- package/dist/store/schema.d.ts +7 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/session-store.d.ts +42 -0
- package/dist/store/session-store.d.ts.map +1 -0
- package/dist/store/sqlite-backup.d.ts +34 -0
- package/dist/store/sqlite-backup.d.ts.map +1 -0
- package/dist/store/sqlite-data-accessor.d.ts +26 -0
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -0
- package/dist/store/sqlite.d.ts +106 -0
- package/dist/store/sqlite.d.ts.map +1 -0
- package/dist/store/status-registry.d.ts +9 -0
- package/dist/store/status-registry.d.ts.map +1 -0
- package/dist/store/task-store.d.ts +69 -0
- package/dist/store/task-store.d.ts.map +1 -0
- package/dist/store/tasks-schema.d.ts +4077 -0
- package/dist/store/tasks-schema.d.ts.map +1 -0
- package/dist/store/typed-query.d.ts +12 -0
- package/dist/store/typed-query.d.ts.map +1 -0
- package/dist/store/validation-schemas.d.ts +9042 -0
- package/dist/store/validation-schemas.d.ts.map +1 -0
- package/dist/system/archive-analytics.d.ts +148 -0
- package/dist/system/archive-analytics.d.ts.map +1 -0
- package/dist/system/archive-stats.d.ts +21 -0
- package/dist/system/archive-stats.d.ts.map +1 -0
- package/dist/system/audit.d.ts +25 -0
- package/dist/system/audit.d.ts.map +1 -0
- package/dist/system/backup.d.ts +28 -0
- package/dist/system/backup.d.ts.map +1 -0
- package/dist/system/cleanup.d.ts +20 -0
- package/dist/system/cleanup.d.ts.map +1 -0
- package/dist/system/health.d.ts +124 -0
- package/dist/system/health.d.ts.map +1 -0
- package/dist/system/index.d.ts +31 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/inject-generate.d.ts +13 -0
- package/dist/system/inject-generate.d.ts.map +1 -0
- package/dist/system/labels.d.ts +18 -0
- package/dist/system/labels.d.ts.map +1 -0
- package/dist/system/metrics.d.ts +30 -0
- package/dist/system/metrics.d.ts.map +1 -0
- package/dist/system/migrate.d.ts +19 -0
- package/dist/system/migrate.d.ts.map +1 -0
- package/dist/system/platform-paths.d.ts +61 -0
- package/dist/system/platform-paths.d.ts.map +1 -0
- package/dist/system/runtime.d.ts +38 -0
- package/dist/system/runtime.d.ts.map +1 -0
- package/dist/system/safestop.d.ts +35 -0
- package/dist/system/safestop.d.ts.map +1 -0
- package/dist/system/storage-preflight.d.ts +42 -0
- package/dist/system/storage-preflight.d.ts.map +1 -0
- package/dist/task-work/index.d.ts +58 -0
- package/dist/task-work/index.d.ts.map +1 -0
- package/dist/tasks/add.d.ts +123 -0
- package/dist/tasks/add.d.ts.map +1 -0
- package/dist/tasks/analyze.d.ts +16 -0
- package/dist/tasks/analyze.d.ts.map +1 -0
- package/dist/tasks/archive.d.ts +31 -0
- package/dist/tasks/archive.d.ts.map +1 -0
- package/dist/tasks/atomicity.d.ts +21 -0
- package/dist/tasks/atomicity.d.ts.map +1 -0
- package/dist/tasks/cancel-ops.d.ts +42 -0
- package/dist/tasks/cancel-ops.d.ts.map +1 -0
- package/dist/tasks/complete.d.ts +26 -0
- package/dist/tasks/complete.d.ts.map +1 -0
- package/dist/tasks/crossref-extract.d.ts +39 -0
- package/dist/tasks/crossref-extract.d.ts.map +1 -0
- package/dist/tasks/delete-preview.d.ts +69 -0
- package/dist/tasks/delete-preview.d.ts.map +1 -0
- package/dist/tasks/delete.d.ts +24 -0
- package/dist/tasks/delete.d.ts.map +1 -0
- package/dist/tasks/deletion-strategy.d.ts +46 -0
- package/dist/tasks/deletion-strategy.d.ts.map +1 -0
- package/dist/tasks/dependency-check.d.ts +82 -0
- package/dist/tasks/dependency-check.d.ts.map +1 -0
- package/dist/tasks/deps-ready.d.ts +22 -0
- package/dist/tasks/deps-ready.d.ts.map +1 -0
- package/dist/tasks/find.d.ts +48 -0
- package/dist/tasks/find.d.ts.map +1 -0
- package/dist/tasks/graph-cache.d.ts +70 -0
- package/dist/tasks/graph-cache.d.ts.map +1 -0
- package/dist/tasks/graph-ops.d.ts +36 -0
- package/dist/tasks/graph-ops.d.ts.map +1 -0
- package/dist/tasks/graph-rag.d.ts +49 -0
- package/dist/tasks/graph-rag.d.ts.map +1 -0
- package/dist/tasks/hierarchy-policy.d.ts +61 -0
- package/dist/tasks/hierarchy-policy.d.ts.map +1 -0
- package/dist/tasks/hierarchy.d.ts +85 -0
- package/dist/tasks/hierarchy.d.ts.map +1 -0
- package/dist/tasks/id-generator.d.ts +28 -0
- package/dist/tasks/id-generator.d.ts.map +1 -0
- package/dist/tasks/index.d.ts +14 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/labels.d.ts +19 -0
- package/dist/tasks/labels.d.ts.map +1 -0
- package/dist/tasks/list.d.ts +49 -0
- package/dist/tasks/list.d.ts.map +1 -0
- package/dist/tasks/phase-tracking.d.ts +61 -0
- package/dist/tasks/phase-tracking.d.ts.map +1 -0
- package/dist/tasks/plan.d.ts +53 -0
- package/dist/tasks/plan.d.ts.map +1 -0
- package/dist/tasks/relates.d.ts +18 -0
- package/dist/tasks/relates.d.ts.map +1 -0
- package/dist/tasks/show.d.ts +23 -0
- package/dist/tasks/show.d.ts.map +1 -0
- package/dist/tasks/size-weighting.d.ts +38 -0
- package/dist/tasks/size-weighting.d.ts.map +1 -0
- package/dist/tasks/staleness.d.ts +56 -0
- package/dist/tasks/staleness.d.ts.map +1 -0
- package/dist/tasks/task-ops.d.ts +322 -0
- package/dist/tasks/task-ops.d.ts.map +1 -0
- package/dist/tasks/update.d.ts +41 -0
- package/dist/tasks/update.d.ts.map +1 -0
- package/dist/templates/index.d.ts +11 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/parser.d.ts +84 -0
- package/dist/templates/parser.d.ts.map +1 -0
- package/dist/ui/aliases.d.ts +43 -0
- package/dist/ui/aliases.d.ts.map +1 -0
- package/dist/ui/changelog.d.ts +58 -0
- package/dist/ui/changelog.d.ts.map +1 -0
- package/dist/ui/command-registry.d.ts +44 -0
- package/dist/ui/command-registry.d.ts.map +1 -0
- package/dist/ui/flags.d.ts +34 -0
- package/dist/ui/flags.d.ts.map +1 -0
- package/dist/ui/index.d.ts +16 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/injection-legacy.d.ts +26 -0
- package/dist/ui/injection-legacy.d.ts.map +1 -0
- package/dist/upgrade.d.ts +59 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/validation/chain-validation.d.ts +43 -0
- package/dist/validation/chain-validation.d.ts.map +1 -0
- package/dist/validation/compliance.d.ts +94 -0
- package/dist/validation/compliance.d.ts.map +1 -0
- package/dist/validation/docs-sync.d.ts +66 -0
- package/dist/validation/docs-sync.d.ts.map +1 -0
- package/dist/validation/doctor/checks.d.ts +130 -0
- package/dist/validation/doctor/checks.d.ts.map +1 -0
- package/dist/validation/doctor/index.d.ts +9 -0
- package/dist/validation/doctor/index.d.ts.map +1 -0
- package/dist/validation/doctor/project-cache.d.ts +77 -0
- package/dist/validation/doctor/project-cache.d.ts.map +1 -0
- package/dist/validation/doctor/utils.d.ts +68 -0
- package/dist/validation/doctor/utils.d.ts.map +1 -0
- package/dist/validation/engine.d.ts +171 -0
- package/dist/validation/engine.d.ts.map +1 -0
- package/dist/validation/gap-check.d.ts +74 -0
- package/dist/validation/gap-check.d.ts.map +1 -0
- package/dist/validation/index.d.ts +22 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/manifest.d.ts +81 -0
- package/dist/validation/manifest.d.ts.map +1 -0
- package/dist/validation/operation-gate-validators.d.ts +96 -0
- package/dist/validation/operation-gate-validators.d.ts.map +1 -0
- package/dist/validation/operation-verification-gates.d.ts +274 -0
- package/dist/validation/operation-verification-gates.d.ts.map +1 -0
- package/dist/validation/param-utils.d.ts +121 -0
- package/dist/validation/param-utils.d.ts.map +1 -0
- package/dist/validation/protocol-common.d.ts +85 -0
- package/dist/validation/protocol-common.d.ts.map +1 -0
- package/dist/validation/protocols/consensus.d.ts +28 -0
- package/dist/validation/protocols/consensus.d.ts.map +1 -0
- package/dist/validation/protocols/contribution.d.ts +26 -0
- package/dist/validation/protocols/contribution.d.ts.map +1 -0
- package/dist/validation/protocols/decomposition.d.ts +28 -0
- package/dist/validation/protocols/decomposition.d.ts.map +1 -0
- package/dist/validation/protocols/implementation.d.ts +26 -0
- package/dist/validation/protocols/implementation.d.ts.map +1 -0
- package/dist/validation/protocols/release-protocol.d.ts +27 -0
- package/dist/validation/protocols/release-protocol.d.ts.map +1 -0
- package/dist/validation/protocols/research.d.ts +26 -0
- package/dist/validation/protocols/research.d.ts.map +1 -0
- package/dist/validation/protocols/specification.d.ts +28 -0
- package/dist/validation/protocols/specification.d.ts.map +1 -0
- package/dist/validation/protocols/testing-protocol.d.ts +27 -0
- package/dist/validation/protocols/testing-protocol.d.ts.map +1 -0
- package/dist/validation/protocols/validation-protocol.d.ts +27 -0
- package/dist/validation/protocols/validation-protocol.d.ts.map +1 -0
- package/dist/validation/schema-integrity.d.ts +42 -0
- package/dist/validation/schema-integrity.d.ts.map +1 -0
- package/dist/validation/schema-validator.d.ts +52 -0
- package/dist/validation/schema-validator.d.ts.map +1 -0
- package/dist/validation/validate-ops.d.ts +247 -0
- package/dist/validation/validate-ops.d.ts.map +1 -0
- package/dist/validation/validation-rules.d.ts +85 -0
- package/dist/validation/validation-rules.d.ts.map +1 -0
- package/dist/validation/verification.d.ts +153 -0
- package/dist/validation/verification.d.ts.map +1 -0
- package/migrations/drizzle-tasks/20260320013731_wave0-schema-hardening/migration.sql +84 -0
- package/migrations/drizzle-tasks/20260320013731_wave0-schema-hardening/snapshot.json +4060 -0
- package/migrations/drizzle-tasks/20260320020000_agent-dimension/migration.sql +35 -0
- package/migrations/drizzle-tasks/20260320020000_agent-dimension/snapshot.json +4312 -0
- package/package.json +2 -2
- package/src/admin/export-tasks.ts +2 -5
- package/src/agents/__tests__/capacity.test.ts +219 -0
- package/src/agents/__tests__/registry.test.ts +457 -0
- package/src/agents/__tests__/retry.test.ts +289 -0
- package/src/agents/agent-schema.ts +107 -0
- package/src/agents/capacity.ts +151 -0
- package/src/agents/index.ts +68 -0
- package/src/agents/registry.ts +449 -0
- package/src/agents/retry.ts +255 -0
- package/src/hooks/index.ts +20 -1
- package/src/hooks/payload-schemas.ts +199 -0
- package/src/index.ts +69 -0
- package/src/inject/index.ts +14 -14
- package/src/intelligence/__tests__/impact.test.ts +453 -0
- package/src/intelligence/__tests__/patterns.test.ts +450 -0
- package/src/intelligence/__tests__/prediction.test.ts +418 -0
- package/src/intelligence/impact.ts +638 -0
- package/src/intelligence/index.ts +47 -0
- package/src/intelligence/patterns.ts +621 -0
- package/src/intelligence/prediction.ts +621 -0
- package/src/intelligence/types.ts +273 -0
- package/src/internal.ts +82 -1
- package/src/issue/template-parser.ts +65 -4
- package/src/lifecycle/pipeline.ts +14 -7
- package/src/lifecycle/state-machine.ts +6 -2
- package/src/memory/brain-lifecycle.ts +5 -11
- package/src/memory/brain-retrieval.ts +44 -38
- package/src/memory/brain-row-types.ts +43 -6
- package/src/memory/brain-search.ts +53 -32
- package/src/memory/brain-similarity.ts +9 -8
- package/src/memory/claude-mem-migration.ts +4 -3
- package/src/nexus/__tests__/nexus-e2e.test.ts +1481 -0
- package/src/nexus/discover.ts +1 -0
- package/src/orchestration/bootstrap.ts +11 -17
- package/src/orchestration/skill-ops.ts +52 -32
- package/src/otel/index.ts +48 -4
- package/src/sessions/__tests__/briefing.test.ts +31 -2
- package/src/sessions/briefing.ts +27 -42
- package/src/sessions/handoff.ts +52 -86
- package/src/sessions/index.ts +5 -1
- package/src/sessions/types.ts +9 -43
- package/src/signaldock/signaldock-transport.ts +5 -2
- package/src/skills/injection/subagent.ts +10 -16
- package/src/skills/manifests/contribution.ts +5 -13
- package/src/skills/orchestrator/__tests__/spawn-tier.test.ts +44 -30
- package/src/skills/orchestrator/spawn.ts +18 -31
- package/src/skills/orchestrator/startup.ts +78 -65
- package/src/skills/orchestrator/validator.ts +26 -31
- package/src/skills/precedence-types.ts +24 -1
- package/src/skills/types.ts +72 -5
- package/src/store/__tests__/test-db-helper.d.ts +4 -4
- package/src/store/__tests__/test-db-helper.js +5 -16
- package/src/store/__tests__/test-db-helper.ts +5 -18
- package/src/store/chain-schema.ts +1 -1
- package/src/store/export.ts +22 -12
- package/src/store/tasks-schema.ts +65 -8
- package/src/store/typed-query.ts +17 -0
- package/src/store/validation-schemas.ts +347 -23
- package/src/system/inject-generate.ts +9 -23
- package/src/validation/doctor/checks.ts +24 -2
- package/src/validation/engine.ts +11 -11
- package/src/validation/index.ts +131 -3
- package/src/validation/protocol-common.ts +54 -3
- package/src/tasks/reparent.ts +0 -134
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the Agent dimension: registry CRUD, heartbeat protocol,
|
|
3
|
+
* crash detection, error classification, and health reporting.
|
|
4
|
+
*
|
|
5
|
+
* @module agents/__tests__/registry.test
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { mkdir, mkdtemp, rm } from 'node:fs/promises';
|
|
9
|
+
import { tmpdir } from 'node:os';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
checkAgentHealth,
|
|
15
|
+
classifyError,
|
|
16
|
+
deregisterAgent,
|
|
17
|
+
generateAgentId,
|
|
18
|
+
getAgentErrorHistory,
|
|
19
|
+
getAgentInstance,
|
|
20
|
+
getHealthReport,
|
|
21
|
+
heartbeat,
|
|
22
|
+
incrementTasksCompleted,
|
|
23
|
+
listAgentInstances,
|
|
24
|
+
markCrashed,
|
|
25
|
+
registerAgent,
|
|
26
|
+
updateAgentStatus,
|
|
27
|
+
} from '../registry.js';
|
|
28
|
+
|
|
29
|
+
describe('Agent Registry', () => {
|
|
30
|
+
let tempDir: string;
|
|
31
|
+
|
|
32
|
+
beforeEach(async () => {
|
|
33
|
+
tempDir = await mkdtemp(join(tmpdir(), 'cleo-agent-test-'));
|
|
34
|
+
await mkdir(join(tempDir, '.cleo'), { recursive: true });
|
|
35
|
+
await mkdir(join(tempDir, '.cleo', 'backups', 'operational'), { recursive: true });
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
afterEach(async () => {
|
|
39
|
+
try {
|
|
40
|
+
const { closeAllDatabases } = await import('../../store/sqlite.js');
|
|
41
|
+
await closeAllDatabases();
|
|
42
|
+
} catch {
|
|
43
|
+
/* module may not be loaded */
|
|
44
|
+
}
|
|
45
|
+
await Promise.race([
|
|
46
|
+
rm(tempDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 300 }).catch(() => {}),
|
|
47
|
+
new Promise<void>((resolve) => setTimeout(resolve, 8_000)),
|
|
48
|
+
]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// ==========================================================================
|
|
52
|
+
// ID generation
|
|
53
|
+
// ==========================================================================
|
|
54
|
+
|
|
55
|
+
describe('generateAgentId', () => {
|
|
56
|
+
it('generates IDs with agt_ prefix', () => {
|
|
57
|
+
const id = generateAgentId();
|
|
58
|
+
expect(id).toMatch(/^agt_\d{14}_[0-9a-f]{6}$/);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('generates unique IDs', () => {
|
|
62
|
+
const ids = new Set(Array.from({ length: 50 }, () => generateAgentId()));
|
|
63
|
+
expect(ids.size).toBe(50);
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// ==========================================================================
|
|
68
|
+
// Registration CRUD
|
|
69
|
+
// ==========================================================================
|
|
70
|
+
|
|
71
|
+
describe('registerAgent', () => {
|
|
72
|
+
it('creates a new agent instance with default values', async () => {
|
|
73
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
74
|
+
|
|
75
|
+
expect(agent.id).toMatch(/^agt_/);
|
|
76
|
+
expect(agent.agentType).toBe('executor');
|
|
77
|
+
expect(agent.status).toBe('starting');
|
|
78
|
+
expect(agent.errorCount).toBe(0);
|
|
79
|
+
expect(agent.totalTasksCompleted).toBe(0);
|
|
80
|
+
expect(agent.capacity).toBe('1.0');
|
|
81
|
+
expect(agent.sessionId).toBeNull();
|
|
82
|
+
expect(agent.taskId).toBeNull();
|
|
83
|
+
expect(agent.parentAgentId).toBeNull();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('accepts optional session, task, and parent', async () => {
|
|
87
|
+
const agent = await registerAgent(
|
|
88
|
+
{
|
|
89
|
+
agentType: 'researcher',
|
|
90
|
+
sessionId: 'ses_test_123',
|
|
91
|
+
taskId: 'T001',
|
|
92
|
+
parentAgentId: 'agt_parent_abc123',
|
|
93
|
+
},
|
|
94
|
+
tempDir,
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
expect(agent.sessionId).toBe('ses_test_123');
|
|
98
|
+
expect(agent.taskId).toBe('T001');
|
|
99
|
+
expect(agent.parentAgentId).toBe('agt_parent_abc123');
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('stores metadata as JSON', async () => {
|
|
103
|
+
const agent = await registerAgent(
|
|
104
|
+
{
|
|
105
|
+
agentType: 'orchestrator',
|
|
106
|
+
metadata: { model: 'opus-4', region: 'us-east' },
|
|
107
|
+
},
|
|
108
|
+
tempDir,
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const parsed = JSON.parse(agent.metadataJson ?? '{}');
|
|
112
|
+
expect(parsed.model).toBe('opus-4');
|
|
113
|
+
expect(parsed.region).toBe('us-east');
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('getAgentInstance', () => {
|
|
118
|
+
it('returns null for non-existent agent', async () => {
|
|
119
|
+
const result = await getAgentInstance('agt_nonexistent_abc123', tempDir);
|
|
120
|
+
expect(result).toBeNull();
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('retrieves a registered agent by ID', async () => {
|
|
124
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
125
|
+
const retrieved = await getAgentInstance(agent.id, tempDir);
|
|
126
|
+
|
|
127
|
+
expect(retrieved).not.toBeNull();
|
|
128
|
+
expect(retrieved!.id).toBe(agent.id);
|
|
129
|
+
expect(retrieved!.agentType).toBe('executor');
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
describe('deregisterAgent', () => {
|
|
134
|
+
it('marks agent as stopped', async () => {
|
|
135
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
136
|
+
const stopped = await deregisterAgent(agent.id, tempDir);
|
|
137
|
+
|
|
138
|
+
expect(stopped).not.toBeNull();
|
|
139
|
+
expect(stopped!.status).toBe('stopped');
|
|
140
|
+
expect(stopped!.stoppedAt).toBeTruthy();
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('returns null for non-existent agent', async () => {
|
|
144
|
+
const result = await deregisterAgent('agt_nonexistent_abc123', tempDir);
|
|
145
|
+
expect(result).toBeNull();
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('is idempotent for already-stopped agents', async () => {
|
|
149
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
150
|
+
await deregisterAgent(agent.id, tempDir);
|
|
151
|
+
const second = await deregisterAgent(agent.id, tempDir);
|
|
152
|
+
|
|
153
|
+
expect(second).not.toBeNull();
|
|
154
|
+
expect(second!.status).toBe('stopped');
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('listAgentInstances', () => {
|
|
159
|
+
it('returns all agents when no filters', async () => {
|
|
160
|
+
await registerAgent({ agentType: 'executor' }, tempDir);
|
|
161
|
+
await registerAgent({ agentType: 'researcher' }, tempDir);
|
|
162
|
+
|
|
163
|
+
const all = await listAgentInstances(undefined, tempDir);
|
|
164
|
+
expect(all.length).toBe(2);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('filters by status', async () => {
|
|
168
|
+
const a1 = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
169
|
+
await registerAgent({ agentType: 'researcher' }, tempDir);
|
|
170
|
+
await updateAgentStatus(a1.id, { status: 'active' }, tempDir);
|
|
171
|
+
|
|
172
|
+
const active = await listAgentInstances({ status: 'active' }, tempDir);
|
|
173
|
+
expect(active.length).toBe(1);
|
|
174
|
+
expect(active[0]!.id).toBe(a1.id);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('filters by type', async () => {
|
|
178
|
+
await registerAgent({ agentType: 'executor' }, tempDir);
|
|
179
|
+
await registerAgent({ agentType: 'researcher' }, tempDir);
|
|
180
|
+
await registerAgent({ agentType: 'executor' }, tempDir);
|
|
181
|
+
|
|
182
|
+
const executors = await listAgentInstances({ agentType: 'executor' }, tempDir);
|
|
183
|
+
expect(executors.length).toBe(2);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('filters by multiple statuses', async () => {
|
|
187
|
+
const a1 = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
188
|
+
const a2 = await registerAgent({ agentType: 'researcher' }, tempDir);
|
|
189
|
+
await registerAgent({ agentType: 'validator' }, tempDir);
|
|
190
|
+
await updateAgentStatus(a1.id, { status: 'active' }, tempDir);
|
|
191
|
+
await updateAgentStatus(a2.id, { status: 'idle' }, tempDir);
|
|
192
|
+
|
|
193
|
+
const activeOrIdle = await listAgentInstances({ status: ['active', 'idle'] }, tempDir);
|
|
194
|
+
expect(activeOrIdle.length).toBe(2);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
// ==========================================================================
|
|
199
|
+
// Heartbeat
|
|
200
|
+
// ==========================================================================
|
|
201
|
+
|
|
202
|
+
describe('heartbeat', () => {
|
|
203
|
+
it('updates last_heartbeat and returns current status', async () => {
|
|
204
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
205
|
+
await updateAgentStatus(agent.id, { status: 'active' }, tempDir);
|
|
206
|
+
|
|
207
|
+
const status = await heartbeat(agent.id, tempDir);
|
|
208
|
+
expect(status).toBe('active');
|
|
209
|
+
|
|
210
|
+
const updated = await getAgentInstance(agent.id, tempDir);
|
|
211
|
+
expect(updated!.lastHeartbeat).toBeTruthy();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it('returns null for non-existent agent', async () => {
|
|
215
|
+
const status = await heartbeat('agt_nonexistent_abc123', tempDir);
|
|
216
|
+
expect(status).toBeNull();
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('does not update heartbeat for stopped agents', async () => {
|
|
220
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
221
|
+
await deregisterAgent(agent.id, tempDir);
|
|
222
|
+
|
|
223
|
+
const status = await heartbeat(agent.id, tempDir);
|
|
224
|
+
expect(status).toBe('stopped');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it('does not update heartbeat for crashed agents', async () => {
|
|
228
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
229
|
+
await markCrashed(agent.id, 'test crash', tempDir);
|
|
230
|
+
|
|
231
|
+
const status = await heartbeat(agent.id, tempDir);
|
|
232
|
+
expect(status).toBe('crashed');
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// ==========================================================================
|
|
237
|
+
// Status management
|
|
238
|
+
// ==========================================================================
|
|
239
|
+
|
|
240
|
+
describe('updateAgentStatus', () => {
|
|
241
|
+
it('updates status', async () => {
|
|
242
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
243
|
+
const updated = await updateAgentStatus(agent.id, { status: 'active' }, tempDir);
|
|
244
|
+
|
|
245
|
+
expect(updated).not.toBeNull();
|
|
246
|
+
expect(updated!.status).toBe('active');
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('increments error count on error status', async () => {
|
|
250
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
251
|
+
await updateAgentStatus(agent.id, { status: 'error', error: 'Connection timeout' }, tempDir);
|
|
252
|
+
|
|
253
|
+
const updated = await getAgentInstance(agent.id, tempDir);
|
|
254
|
+
expect(updated!.errorCount).toBe(1);
|
|
255
|
+
expect(updated!.status).toBe('error');
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('logs error to agent_error_log', async () => {
|
|
259
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
260
|
+
await updateAgentStatus(
|
|
261
|
+
agent.id,
|
|
262
|
+
{ status: 'error', error: 'SQLITE_BUSY: database is locked' },
|
|
263
|
+
tempDir,
|
|
264
|
+
);
|
|
265
|
+
|
|
266
|
+
const errors = await getAgentErrorHistory(agent.id, tempDir);
|
|
267
|
+
expect(errors.length).toBe(1);
|
|
268
|
+
expect(errors[0]!.errorType).toBe('retriable');
|
|
269
|
+
expect(errors[0]!.message).toBe('SQLITE_BUSY: database is locked');
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it('sets stoppedAt when status is stopped', async () => {
|
|
273
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
274
|
+
const updated = await updateAgentStatus(agent.id, { status: 'stopped' }, tempDir);
|
|
275
|
+
|
|
276
|
+
expect(updated!.stoppedAt).toBeTruthy();
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
it('returns null for non-existent agent', async () => {
|
|
280
|
+
const result = await updateAgentStatus(
|
|
281
|
+
'agt_nonexistent_abc123',
|
|
282
|
+
{ status: 'active' },
|
|
283
|
+
tempDir,
|
|
284
|
+
);
|
|
285
|
+
expect(result).toBeNull();
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
describe('incrementTasksCompleted', () => {
|
|
290
|
+
it('increments the task counter', async () => {
|
|
291
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
292
|
+
await incrementTasksCompleted(agent.id, tempDir);
|
|
293
|
+
await incrementTasksCompleted(agent.id, tempDir);
|
|
294
|
+
|
|
295
|
+
const updated = await getAgentInstance(agent.id, tempDir);
|
|
296
|
+
expect(updated!.totalTasksCompleted).toBe(2);
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
// ==========================================================================
|
|
301
|
+
// Error classification
|
|
302
|
+
// ==========================================================================
|
|
303
|
+
|
|
304
|
+
describe('classifyError', () => {
|
|
305
|
+
it('classifies timeout errors as retriable', () => {
|
|
306
|
+
expect(classifyError(new Error('Connection timeout'))).toBe('retriable');
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
it('classifies network errors as retriable', () => {
|
|
310
|
+
expect(classifyError(new Error('ECONNREFUSED'))).toBe('retriable');
|
|
311
|
+
expect(classifyError(new Error('ECONNRESET'))).toBe('retriable');
|
|
312
|
+
expect(classifyError(new Error('ETIMEDOUT'))).toBe('retriable');
|
|
313
|
+
expect(classifyError(new Error('socket hang up'))).toBe('retriable');
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it('classifies rate limit errors as retriable', () => {
|
|
317
|
+
expect(classifyError(new Error('Rate limit exceeded'))).toBe('retriable');
|
|
318
|
+
expect(classifyError(new Error('429 Too Many Requests'))).toBe('retriable');
|
|
319
|
+
expect(classifyError(new Error('503 Service Unavailable'))).toBe('retriable');
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it('classifies SQLite busy as retriable', () => {
|
|
323
|
+
expect(classifyError(new Error('SQLITE_BUSY: database is locked'))).toBe('retriable');
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('classifies permission errors as permanent', () => {
|
|
327
|
+
expect(classifyError(new Error('Permission denied'))).toBe('permanent');
|
|
328
|
+
expect(classifyError(new Error('EACCES'))).toBe('permanent');
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it('classifies auth errors as permanent', () => {
|
|
332
|
+
expect(classifyError(new Error('401 Unauthorized'))).toBe('permanent');
|
|
333
|
+
expect(classifyError(new Error('403 Forbidden'))).toBe('permanent');
|
|
334
|
+
expect(classifyError(new Error('invalid token'))).toBe('permanent');
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it('classifies constraint errors as permanent', () => {
|
|
338
|
+
expect(classifyError(new Error('SQLITE_CONSTRAINT: UNIQUE violation'))).toBe('permanent');
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it('classifies unknown errors as unknown', () => {
|
|
342
|
+
expect(classifyError(new Error('Something weird happened'))).toBe('unknown');
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it('handles non-Error values', () => {
|
|
346
|
+
expect(classifyError('string error')).toBe('unknown');
|
|
347
|
+
expect(classifyError(42)).toBe('unknown');
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
// ==========================================================================
|
|
352
|
+
// Health monitoring
|
|
353
|
+
// ==========================================================================
|
|
354
|
+
|
|
355
|
+
describe('checkAgentHealth', () => {
|
|
356
|
+
it('detects agents with stale heartbeats', async () => {
|
|
357
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
358
|
+
await updateAgentStatus(agent.id, { status: 'active' }, tempDir);
|
|
359
|
+
|
|
360
|
+
// Wait briefly so heartbeat is definitively in the past, then use
|
|
361
|
+
// a threshold that guarantees staleness detection on slow CI runners
|
|
362
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
363
|
+
const stale = await checkAgentHealth(10, tempDir);
|
|
364
|
+
expect(stale.length).toBeGreaterThanOrEqual(1);
|
|
365
|
+
expect(stale.some((a) => a.id === agent.id)).toBe(true);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it('does not flag stopped agents', async () => {
|
|
369
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
370
|
+
await deregisterAgent(agent.id, tempDir);
|
|
371
|
+
|
|
372
|
+
const stale = await checkAgentHealth(0, tempDir);
|
|
373
|
+
expect(stale.some((a) => a.id === agent.id)).toBe(false);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('returns empty array when all agents are healthy', async () => {
|
|
377
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
378
|
+
await updateAgentStatus(agent.id, { status: 'active' }, tempDir);
|
|
379
|
+
await heartbeat(agent.id, tempDir);
|
|
380
|
+
|
|
381
|
+
// Use a large threshold -- agent should be considered healthy
|
|
382
|
+
const stale = await checkAgentHealth(60_000, tempDir);
|
|
383
|
+
expect(stale.some((a) => a.id === agent.id)).toBe(false);
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
describe('markCrashed', () => {
|
|
388
|
+
it('marks agent as crashed with error details', async () => {
|
|
389
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
390
|
+
const crashed = await markCrashed(agent.id, 'Out of memory', tempDir);
|
|
391
|
+
|
|
392
|
+
expect(crashed).not.toBeNull();
|
|
393
|
+
expect(crashed!.status).toBe('crashed');
|
|
394
|
+
expect(crashed!.errorCount).toBe(1);
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
it('provides default reason when none specified', async () => {
|
|
398
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
399
|
+
await markCrashed(agent.id, undefined, tempDir);
|
|
400
|
+
|
|
401
|
+
const errors = await getAgentErrorHistory(agent.id, tempDir);
|
|
402
|
+
expect(errors.length).toBe(1);
|
|
403
|
+
expect(errors[0]!.message).toContain('Heartbeat timeout');
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
describe('getHealthReport', () => {
|
|
408
|
+
it('produces summary of all agent states', async () => {
|
|
409
|
+
const a1 = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
410
|
+
const a2 = await registerAgent({ agentType: 'researcher' }, tempDir);
|
|
411
|
+
const a3 = await registerAgent({ agentType: 'orchestrator' }, tempDir);
|
|
412
|
+
|
|
413
|
+
await updateAgentStatus(a1.id, { status: 'active' }, tempDir);
|
|
414
|
+
await updateAgentStatus(a2.id, { status: 'idle' }, tempDir);
|
|
415
|
+
await deregisterAgent(a3.id, tempDir);
|
|
416
|
+
|
|
417
|
+
const report = await getHealthReport(60_000, tempDir);
|
|
418
|
+
|
|
419
|
+
expect(report.total).toBe(3);
|
|
420
|
+
expect(report.active).toBe(1);
|
|
421
|
+
expect(report.idle).toBe(1);
|
|
422
|
+
expect(report.stopped).toBe(1);
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
it('counts total errors across all agents', async () => {
|
|
426
|
+
const a1 = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
427
|
+
await updateAgentStatus(a1.id, { status: 'error', error: 'err1' }, tempDir);
|
|
428
|
+
await updateAgentStatus(a1.id, { status: 'error', error: 'err2' }, tempDir);
|
|
429
|
+
|
|
430
|
+
const report = await getHealthReport(60_000, tempDir);
|
|
431
|
+
expect(report.totalErrors).toBe(2);
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
// ==========================================================================
|
|
436
|
+
// Error history
|
|
437
|
+
// ==========================================================================
|
|
438
|
+
|
|
439
|
+
describe('getAgentErrorHistory', () => {
|
|
440
|
+
it('returns empty array for agent with no errors', async () => {
|
|
441
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
442
|
+
const errors = await getAgentErrorHistory(agent.id, tempDir);
|
|
443
|
+
expect(errors).toEqual([]);
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
it('returns all errors for an agent', async () => {
|
|
447
|
+
const agent = await registerAgent({ agentType: 'executor' }, tempDir);
|
|
448
|
+
await updateAgentStatus(agent.id, { status: 'error', error: 'timeout' }, tempDir);
|
|
449
|
+
await updateAgentStatus(agent.id, { status: 'error', error: 'ECONNREFUSED' }, tempDir);
|
|
450
|
+
|
|
451
|
+
const errors = await getAgentErrorHistory(agent.id, tempDir);
|
|
452
|
+
expect(errors.length).toBe(2);
|
|
453
|
+
expect(errors[0]!.errorType).toBe('retriable');
|
|
454
|
+
expect(errors[1]!.errorType).toBe('retriable');
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
});
|