@monoes/monomindcli 1.11.11 → 1.11.12
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/commands/mastermind/idea.md +1 -1
- package/.claude/commands/mastermind/master.md +1 -1
- package/.claude/skills/mastermind/_protocol.md +4 -4
- package/.claude/skills/mastermind/autodev.md +1 -1
- package/.claude/skills/mastermind/build.md +3 -3
- package/.claude/skills/mastermind/content.md +3 -3
- package/.claude/skills/mastermind/createorg.md +2 -2
- package/.claude/skills/mastermind/finance.md +3 -3
- package/.claude/skills/mastermind/marketing.md +3 -3
- package/.claude/skills/mastermind/ops.md +3 -3
- package/.claude/skills/mastermind/release.md +3 -3
- package/.claude/skills/mastermind/research.md +3 -3
- package/.claude/skills/mastermind/review.md +3 -3
- package/.claude/skills/mastermind/sales.md +3 -3
- package/dist/src/init/statusline-generator.js +3 -3
- package/dist/src/observability/replay-reader.d.ts +1 -1
- package/dist/src/observability/replay-reader.d.ts.map +1 -1
- package/dist/src/update/checker.d.ts.map +1 -1
- package/dist/src/update/checker.js +24 -7
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/index.d.ts.map +1 -1
- package/dist/src/update/index.js +3 -6
- package/dist/src/update/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/agents/halt-signal.d.ts +0 -25
- package/dist/src/agents/halt-signal.d.ts.map +0 -1
- package/dist/src/agents/halt-signal.js +0 -76
- package/dist/src/agents/halt-signal.js.map +0 -1
- package/dist/src/agents/index.d.ts +0 -18
- package/dist/src/agents/index.d.ts.map +0 -1
- package/dist/src/agents/index.js +0 -13
- package/dist/src/agents/index.js.map +0 -1
- package/dist/src/agents/managed-agent.d.ts +0 -41
- package/dist/src/agents/managed-agent.d.ts.map +0 -1
- package/dist/src/agents/managed-agent.js +0 -69
- package/dist/src/agents/managed-agent.js.map +0 -1
- package/dist/src/agents/prompt-experiment.d.ts +0 -23
- package/dist/src/agents/prompt-experiment.d.ts.map +0 -1
- package/dist/src/agents/prompt-experiment.js +0 -49
- package/dist/src/agents/prompt-experiment.js.map +0 -1
- package/dist/src/agents/prompt-version-manager.d.ts +0 -22
- package/dist/src/agents/prompt-version-manager.d.ts.map +0 -1
- package/dist/src/agents/prompt-version-manager.js +0 -80
- package/dist/src/agents/prompt-version-manager.js.map +0 -1
- package/dist/src/agents/registry-query.d.ts +0 -71
- package/dist/src/agents/registry-query.d.ts.map +0 -1
- package/dist/src/agents/registry-query.js +0 -125
- package/dist/src/agents/registry-query.js.map +0 -1
- package/dist/src/agents/score-decay.d.ts +0 -19
- package/dist/src/agents/score-decay.d.ts.map +0 -1
- package/dist/src/agents/score-decay.js +0 -22
- package/dist/src/agents/score-decay.js.map +0 -1
- package/dist/src/agents/shared-instructions-loader.d.ts +0 -13
- package/dist/src/agents/shared-instructions-loader.d.ts.map +0 -1
- package/dist/src/agents/shared-instructions-loader.js +0 -40
- package/dist/src/agents/shared-instructions-loader.js.map +0 -1
- package/dist/src/agents/specialization-scorer.d.ts +0 -54
- package/dist/src/agents/specialization-scorer.d.ts.map +0 -1
- package/dist/src/agents/specialization-scorer.js +0 -212
- package/dist/src/agents/specialization-scorer.js.map +0 -1
- package/dist/src/agents/termination-watcher.d.ts +0 -30
- package/dist/src/agents/termination-watcher.d.ts.map +0 -1
- package/dist/src/agents/termination-watcher.js +0 -84
- package/dist/src/agents/termination-watcher.js.map +0 -1
- package/dist/src/agents/trigger-index.d.ts +0 -20
- package/dist/src/agents/trigger-index.d.ts.map +0 -1
- package/dist/src/agents/trigger-index.js +0 -38
- package/dist/src/agents/trigger-index.js.map +0 -1
- package/dist/src/agents/trigger-scanner.d.ts +0 -64
- package/dist/src/agents/trigger-scanner.d.ts.map +0 -1
- package/dist/src/agents/trigger-scanner.js +0 -308
- package/dist/src/agents/trigger-scanner.js.map +0 -1
- package/dist/src/agents/version-diff.d.ts +0 -18
- package/dist/src/agents/version-diff.d.ts.map +0 -1
- package/dist/src/agents/version-diff.js +0 -64
- package/dist/src/agents/version-diff.js.map +0 -1
- package/dist/src/agents/version-store.d.ts +0 -60
- package/dist/src/agents/version-store.d.ts.map +0 -1
- package/dist/src/agents/version-store.js +0 -235
- package/dist/src/agents/version-store.js.map +0 -1
- package/dist/src/benchmarks/pretrain/index.d.ts +0 -45
- package/dist/src/benchmarks/pretrain/index.d.ts.map +0 -1
- package/dist/src/benchmarks/pretrain/index.js +0 -404
- package/dist/src/benchmarks/pretrain/index.js.map +0 -1
- package/dist/src/commands/agent-wasm.d.ts +0 -14
- package/dist/src/commands/agent-wasm.d.ts.map +0 -1
- package/dist/src/commands/agent-wasm.js +0 -333
- package/dist/src/commands/agent-wasm.js.map +0 -1
- package/dist/src/commands/embeddings.d.ts.map +0 -1
- package/dist/src/commands/embeddings.js.map +0 -1
- package/dist/src/commands/ui.js +0 -68
- package/dist/src/consensus/index.d.ts +0 -7
- package/dist/src/consensus/index.d.ts.map +0 -1
- package/dist/src/consensus/index.js +0 -6
- package/dist/src/consensus/index.js.map +0 -1
- package/dist/src/context/context-provider.d.ts +0 -44
- package/dist/src/context/context-provider.d.ts.map +0 -1
- package/dist/src/context/context-provider.js +0 -25
- package/dist/src/context/context-provider.js.map +0 -1
- package/dist/src/context/git-state-provider.d.ts +0 -12
- package/dist/src/context/git-state-provider.d.ts.map +0 -1
- package/dist/src/context/git-state-provider.js +0 -34
- package/dist/src/context/git-state-provider.js.map +0 -1
- package/dist/src/context/index.d.ts +0 -12
- package/dist/src/context/index.d.ts.map +0 -1
- package/dist/src/context/index.js +0 -12
- package/dist/src/context/index.js.map +0 -1
- package/dist/src/context/project-conventions-provider.d.ts +0 -15
- package/dist/src/context/project-conventions-provider.d.ts.map +0 -1
- package/dist/src/context/project-conventions-provider.js +0 -19
- package/dist/src/context/project-conventions-provider.js.map +0 -1
- package/dist/src/context/prompt-assembler.d.ts +0 -26
- package/dist/src/context/prompt-assembler.d.ts.map +0 -1
- package/dist/src/context/prompt-assembler.js +0 -93
- package/dist/src/context/prompt-assembler.js.map +0 -1
- package/dist/src/context/task-history-provider.d.ts +0 -24
- package/dist/src/context/task-history-provider.d.ts.map +0 -1
- package/dist/src/context/task-history-provider.js +0 -32
- package/dist/src/context/task-history-provider.js.map +0 -1
- package/dist/src/context/user-preferences-provider.d.ts +0 -14
- package/dist/src/context/user-preferences-provider.d.ts.map +0 -1
- package/dist/src/context/user-preferences-provider.js +0 -27
- package/dist/src/context/user-preferences-provider.js.map +0 -1
- package/dist/src/dlq/dlq-reader.d.ts +0 -31
- package/dist/src/dlq/dlq-reader.d.ts.map +0 -1
- package/dist/src/dlq/dlq-reader.js +0 -81
- package/dist/src/dlq/dlq-reader.js.map +0 -1
- package/dist/src/dlq/dlq-writer.d.ts +0 -24
- package/dist/src/dlq/dlq-writer.d.ts.map +0 -1
- package/dist/src/dlq/dlq-writer.js +0 -65
- package/dist/src/dlq/dlq-writer.js.map +0 -1
- package/dist/src/dlq/index.d.ts +0 -10
- package/dist/src/dlq/index.d.ts.map +0 -1
- package/dist/src/dlq/index.js +0 -7
- package/dist/src/dlq/index.js.map +0 -1
- package/dist/src/eval/dataset-manager.d.ts +0 -33
- package/dist/src/eval/dataset-manager.d.ts.map +0 -1
- package/dist/src/eval/dataset-manager.js +0 -107
- package/dist/src/eval/dataset-manager.js.map +0 -1
- package/dist/src/eval/dataset-runner.d.ts +0 -23
- package/dist/src/eval/dataset-runner.d.ts.map +0 -1
- package/dist/src/eval/dataset-runner.js +0 -59
- package/dist/src/eval/dataset-runner.js.map +0 -1
- package/dist/src/eval/index.d.ts +0 -10
- package/dist/src/eval/index.d.ts.map +0 -1
- package/dist/src/eval/index.js +0 -7
- package/dist/src/eval/index.js.map +0 -1
- package/dist/src/eval/trace-collector.d.ts +0 -40
- package/dist/src/eval/trace-collector.d.ts.map +0 -1
- package/dist/src/eval/trace-collector.js +0 -102
- package/dist/src/eval/trace-collector.js.map +0 -1
- package/dist/src/graph/enrich.mjs +0 -362
- package/dist/src/infrastructure/in-memory-repositories.d.ts +0 -68
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +0 -1
- package/dist/src/infrastructure/in-memory-repositories.js +0 -264
- package/dist/src/infrastructure/in-memory-repositories.js.map +0 -1
- package/dist/src/interactive/interrupt.d.ts +0 -22
- package/dist/src/interactive/interrupt.d.ts.map +0 -1
- package/dist/src/interactive/interrupt.js +0 -71
- package/dist/src/interactive/interrupt.js.map +0 -1
- package/dist/src/mcp/deprecation-injector.d.ts +0 -25
- package/dist/src/mcp/deprecation-injector.d.ts.map +0 -1
- package/dist/src/mcp/deprecation-injector.js +0 -48
- package/dist/src/mcp/deprecation-injector.js.map +0 -1
- package/dist/src/mcp/tool-registry.d.ts +0 -61
- package/dist/src/mcp/tool-registry.d.ts.map +0 -1
- package/dist/src/mcp/tool-registry.js +0 -246
- package/dist/src/mcp/tool-registry.js.map +0 -1
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts +0 -9
- package/dist/src/mcp-tools/wasm-agent-tools.d.ts.map +0 -1
- package/dist/src/mcp-tools/wasm-agent-tools.js +0 -230
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +0 -1
- package/dist/src/model/complexity-scorer.d.ts +0 -21
- package/dist/src/model/complexity-scorer.d.ts.map +0 -1
- package/dist/src/model/complexity-scorer.js +0 -106
- package/dist/src/model/complexity-scorer.js.map +0 -1
- package/dist/src/model/index.d.ts +0 -4
- package/dist/src/model/index.d.ts.map +0 -1
- package/dist/src/model/index.js +0 -4
- package/dist/src/model/index.js.map +0 -1
- package/dist/src/model/model-settings.d.ts +0 -22
- package/dist/src/model/model-settings.d.ts.map +0 -1
- package/dist/src/model/model-settings.js +0 -33
- package/dist/src/model/model-settings.js.map +0 -1
- package/dist/src/model/model-tier-resolver.d.ts +0 -24
- package/dist/src/model/model-tier-resolver.d.ts.map +0 -1
- package/dist/src/model/model-tier-resolver.js +0 -65
- package/dist/src/model/model-tier-resolver.js.map +0 -1
- package/dist/src/monovector/capabilities.d.ts +0 -34
- package/dist/src/monovector/capabilities.d.ts.map +0 -1
- package/dist/src/monovector/capabilities.js +0 -37
- package/dist/src/monovector/capabilities.js.map +0 -1
- package/dist/src/orchestration/index.d.ts +0 -7
- package/dist/src/orchestration/index.d.ts.map +0 -1
- package/dist/src/orchestration/index.js +0 -6
- package/dist/src/orchestration/index.js.map +0 -1
- package/dist/src/orchestration/mode-dispatcher.d.ts +0 -11
- package/dist/src/orchestration/mode-dispatcher.d.ts.map +0 -1
- package/dist/src/orchestration/mode-dispatcher.js +0 -31
- package/dist/src/orchestration/mode-dispatcher.js.map +0 -1
- package/dist/src/orchestration/routing-modes.d.ts +0 -68
- package/dist/src/orchestration/routing-modes.d.ts.map +0 -1
- package/dist/src/orchestration/routing-modes.js +0 -180
- package/dist/src/orchestration/routing-modes.js.map +0 -1
- package/dist/src/plugins/tests/demo-plugin-store.d.ts +0 -7
- package/dist/src/plugins/tests/demo-plugin-store.d.ts.map +0 -1
- package/dist/src/plugins/tests/demo-plugin-store.js +0 -126
- package/dist/src/plugins/tests/demo-plugin-store.js.map +0 -1
- package/dist/src/plugins/tests/standalone-test.d.ts +0 -12
- package/dist/src/plugins/tests/standalone-test.d.ts.map +0 -1
- package/dist/src/plugins/tests/standalone-test.js +0 -188
- package/dist/src/plugins/tests/standalone-test.js.map +0 -1
- package/dist/src/plugins/tests/test-plugin-store.d.ts +0 -7
- package/dist/src/plugins/tests/test-plugin-store.d.ts.map +0 -1
- package/dist/src/plugins/tests/test-plugin-store.js +0 -206
- package/dist/src/plugins/tests/test-plugin-store.js.map +0 -1
- package/dist/src/runtime/headless.d.ts +0 -60
- package/dist/src/runtime/headless.d.ts.map +0 -1
- package/dist/src/runtime/headless.js +0 -284
- package/dist/src/runtime/headless.js.map +0 -1
- package/dist/src/services/agentic-flow-bridge.d.ts +0 -50
- package/dist/src/services/agentic-flow-bridge.d.ts.map +0 -1
- package/dist/src/services/agentic-flow-bridge.js +0 -95
- package/dist/src/services/agentic-flow-bridge.js.map +0 -1
- package/dist/src/services/container-worker-pool.d.ts +0 -197
- package/dist/src/services/container-worker-pool.d.ts.map +0 -1
- package/dist/src/services/container-worker-pool.js +0 -623
- package/dist/src/services/container-worker-pool.js.map +0 -1
- package/dist/src/services/index.d.ts +0 -13
- package/dist/src/services/index.d.ts.map +0 -1
- package/dist/src/services/index.js +0 -11
- package/dist/src/services/index.js.map +0 -1
- package/dist/src/services/worker-queue.d.ts +0 -201
- package/dist/src/services/worker-queue.d.ts.map +0 -1
- package/dist/src/services/worker-queue.js +0 -594
- package/dist/src/services/worker-queue.js.map +0 -1
- package/dist/src/swarm/communication-graph.d.ts +0 -25
- package/dist/src/swarm/communication-graph.d.ts.map +0 -1
- package/dist/src/swarm/communication-graph.js +0 -77
- package/dist/src/swarm/communication-graph.js.map +0 -1
- package/dist/src/swarm/flow-enforcer.d.ts +0 -31
- package/dist/src/swarm/flow-enforcer.d.ts.map +0 -1
- package/dist/src/swarm/flow-enforcer.js +0 -61
- package/dist/src/swarm/flow-enforcer.js.map +0 -1
- package/dist/src/swarm/flow-visualizer.d.ts +0 -19
- package/dist/src/swarm/flow-visualizer.d.ts.map +0 -1
- package/dist/src/swarm/flow-visualizer.js +0 -68
- package/dist/src/swarm/flow-visualizer.js.map +0 -1
- package/dist/src/transfer/deploy-seraphine.d.ts +0 -13
- package/dist/src/transfer/deploy-seraphine.d.ts.map +0 -1
- package/dist/src/transfer/deploy-seraphine.js +0 -205
- package/dist/src/transfer/deploy-seraphine.js.map +0 -1
- package/dist/src/transfer/store/tests/standalone-test.d.ts +0 -12
- package/dist/src/transfer/store/tests/standalone-test.d.ts.map +0 -1
- package/dist/src/transfer/store/tests/standalone-test.js +0 -190
- package/dist/src/transfer/store/tests/standalone-test.js.map +0 -1
- package/dist/src/transfer/test-seraphine.d.ts +0 -6
- package/dist/src/transfer/test-seraphine.d.ts.map +0 -1
- package/dist/src/transfer/test-seraphine.js +0 -105
- package/dist/src/transfer/test-seraphine.js.map +0 -1
- package/dist/src/transfer/tests/test-store.d.ts +0 -7
- package/dist/src/transfer/tests/test-store.d.ts.map +0 -1
- package/dist/src/transfer/tests/test-store.js +0 -214
- package/dist/src/transfer/tests/test-store.js.map +0 -1
- package/dist/src/ui/.monomind/data/pending-insights.jsonl +0 -0
- package/dist/src/ui/.monomind/data/ranked-context.json +0 -5
- package/dist/src/ui/.monomind/loops/mastermind-review-1778664132789.json +0 -16
- package/dist/src/ui/.monomind/sessions/current.json +0 -13
- package/dist/src/ui/.monomind/sessions/session-1776778451399.json +0 -15
- package/dist/src/ui/collector.mjs +0 -646
- package/dist/src/ui/dashboard.html +0 -9694
- package/dist/src/ui/data/mastermind-events.jsonl +0 -59
- package/dist/src/ui/data/mastermind-sessions.json +0 -1
- package/dist/src/ui/orgs.html +0 -1360
- package/dist/src/ui/server.mjs +0 -4334
- package/dist/src/workflow/condition-evaluator.d.ts +0 -10
- package/dist/src/workflow/condition-evaluator.d.ts.map +0 -1
- package/dist/src/workflow/condition-evaluator.js +0 -82
- package/dist/src/workflow/condition-evaluator.js.map +0 -1
- package/dist/src/workflow/context-resolver.d.ts +0 -12
- package/dist/src/workflow/context-resolver.d.ts.map +0 -1
- package/dist/src/workflow/context-resolver.js +0 -23
- package/dist/src/workflow/context-resolver.js.map +0 -1
- package/dist/src/workflow/dag-builder.d.ts +0 -17
- package/dist/src/workflow/dag-builder.d.ts.map +0 -1
- package/dist/src/workflow/dag-builder.js +0 -129
- package/dist/src/workflow/dag-builder.js.map +0 -1
- package/dist/src/workflow/dag-executor.d.ts +0 -9
- package/dist/src/workflow/dag-executor.d.ts.map +0 -1
- package/dist/src/workflow/dag-executor.js +0 -116
- package/dist/src/workflow/dag-executor.js.map +0 -1
- package/dist/src/workflow/dag-types.d.ts +0 -41
- package/dist/src/workflow/dag-types.d.ts.map +0 -1
- package/dist/src/workflow/dag-types.js +0 -8
- package/dist/src/workflow/dag-types.js.map +0 -1
- package/dist/src/workflow/dsl-parser.d.ts +0 -12
- package/dist/src/workflow/dsl-parser.d.ts.map +0 -1
- package/dist/src/workflow/dsl-parser.js +0 -20
- package/dist/src/workflow/dsl-parser.js.map +0 -1
- package/dist/src/workflow/dsl-schema.d.ts +0 -165
- package/dist/src/workflow/dsl-schema.d.ts.map +0 -1
- package/dist/src/workflow/dsl-schema.js +0 -82
- package/dist/src/workflow/dsl-schema.js.map +0 -1
- package/dist/src/workflow/index.d.ts +0 -13
- package/dist/src/workflow/index.d.ts.map +0 -1
- package/dist/src/workflow/index.js +0 -11
- package/dist/src/workflow/index.js.map +0 -1
- package/dist/src/workflow/template-engine.d.ts +0 -11
- package/dist/src/workflow/template-engine.d.ts.map +0 -1
- package/dist/src/workflow/template-engine.js +0 -40
- package/dist/src/workflow/template-engine.js.map +0 -1
- package/dist/src/workflow/workflow-executor.d.ts +0 -29
- package/dist/src/workflow/workflow-executor.d.ts.map +0 -1
- package/dist/src/workflow/workflow-executor.js +0 -227
- package/dist/src/workflow/workflow-executor.js.map +0 -1
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
// post-build knowledge graph enrichment engine
|
|
2
|
-
// Reads graph.json, enriches nodes with TypeScript AST data, resolves
|
|
3
|
-
// cross-module calls, computes PageRank + eigenvector centrality,
|
|
4
|
-
// then writes graph.enriched.json.
|
|
5
|
-
|
|
6
|
-
import fs from 'fs';
|
|
7
|
-
import path from 'path';
|
|
8
|
-
import crypto from 'crypto';
|
|
9
|
-
import { createRequire } from 'module';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
|
|
12
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = path.dirname(__filename);
|
|
14
|
-
// packages/@monomind/cli/dist/src/graph/ → 6 levels up → project root
|
|
15
|
-
const projectRoot = path.resolve(__dirname, '../../../../../..');
|
|
16
|
-
const _require = createRequire(path.join(projectRoot, 'package.json'));
|
|
17
|
-
|
|
18
|
-
// ── dependencies ──────────────────────────────────────────────────────────
|
|
19
|
-
|
|
20
|
-
let ts;
|
|
21
|
-
try { ts = _require('typescript'); }
|
|
22
|
-
catch { ts = _require(path.join(projectRoot, 'node_modules/typescript/lib/typescript.js')); }
|
|
23
|
-
|
|
24
|
-
function findPnpmPkg(name) {
|
|
25
|
-
const pnpmDir = path.join(projectRoot, 'node_modules', '.pnpm');
|
|
26
|
-
if (!fs.existsSync(pnpmDir)) return null;
|
|
27
|
-
const prefix = name.replace('/', '+') + '@';
|
|
28
|
-
const entries = fs.readdirSync(pnpmDir).filter(e => e.startsWith(prefix)).sort().reverse();
|
|
29
|
-
return entries.length ? path.join(pnpmDir, entries[0], 'node_modules', name) : null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function loadGraphology() {
|
|
33
|
-
for (const fn of [() => _require('graphology'), () => _require(findPnpmPkg('graphology'))]) {
|
|
34
|
-
try { const m = fn(); return m.default ?? m; } catch {}
|
|
35
|
-
}
|
|
36
|
-
throw new Error('graphology not found');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function loadGraphologyMetrics() {
|
|
40
|
-
const base = findPnpmPkg('graphology-metrics') ?? path.join(projectRoot, 'node_modules/graphology-metrics');
|
|
41
|
-
return {
|
|
42
|
-
assignPageRank: _require(path.join(base, 'centrality/pagerank')).assign,
|
|
43
|
-
assignEigen: _require(path.join(base, 'centrality/eigenvector')).assign,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// ── cache ─────────────────────────────────────────────────────────────────
|
|
48
|
-
|
|
49
|
-
const sha256 = str => crypto.createHash('sha256').update(str).digest('hex');
|
|
50
|
-
const cacheFileFor = (fp, dir) => path.join(dir, sha256(fp) + '.json');
|
|
51
|
-
|
|
52
|
-
function readFromCache(filePath, cacheDir) {
|
|
53
|
-
try {
|
|
54
|
-
const cf = cacheFileFor(filePath, cacheDir);
|
|
55
|
-
if (fs.statSync(cf).mtimeMs >= fs.statSync(filePath).mtimeMs)
|
|
56
|
-
return JSON.parse(fs.readFileSync(cf, 'utf8'));
|
|
57
|
-
} catch {}
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function writeToCache(filePath, data, cacheDir) {
|
|
62
|
-
try {
|
|
63
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
64
|
-
fs.writeFileSync(cacheFileFor(filePath, cacheDir), JSON.stringify(data));
|
|
65
|
-
} catch {}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// ── TypeScript AST extraction ─────────────────────────────────────────────
|
|
69
|
-
|
|
70
|
-
function getJsDoc(node, sf) {
|
|
71
|
-
try {
|
|
72
|
-
return (ts.getJSDocCommentsAndTags(node) ?? [])
|
|
73
|
-
.filter(t => ts.isJSDoc(t))
|
|
74
|
-
.map(t => typeof t.comment === 'string' ? t.comment : '')
|
|
75
|
-
.join('\n').trim();
|
|
76
|
-
} catch { return ''; }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const getParams = (node, sf) => (node.parameters ?? []).map(p => ({
|
|
80
|
-
name: p.name?.getText(sf) ?? '', type: p.type?.getText(sf) ?? 'any', optional: !!p.questionToken,
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
const buildSig = (params, ret) => {
|
|
84
|
-
const ps = params.map(p => `${p.name}${p.optional ? '?' : ''}: ${p.type}`).join(', ');
|
|
85
|
-
return `(${ps})${ret ? ': ' + ret : ''}`;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const isExported = node => !!(ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export);
|
|
89
|
-
const lineOf = (node, sf) => sf.getLineAndCharacterOfPosition(node.getStart()).line + 1;
|
|
90
|
-
|
|
91
|
-
function extractSymbolsFromAst(filePath, content) {
|
|
92
|
-
const sf = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
|
|
93
|
-
const symbols = new Map();
|
|
94
|
-
|
|
95
|
-
function visit(node) {
|
|
96
|
-
try {
|
|
97
|
-
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
98
|
-
const params = getParams(node, sf); const ret = node.type?.getText(sf) ?? '';
|
|
99
|
-
symbols.set(node.name.getText(sf), { kind: 'function', signature: buildSig(params, ret),
|
|
100
|
-
parameters: params, returnType: ret, isExported: isExported(node),
|
|
101
|
-
documentation: getJsDoc(node, sf), lineStart: lineOf(node, sf) });
|
|
102
|
-
} else if (ts.isClassDeclaration(node) && node.name) {
|
|
103
|
-
const name = node.name.getText(sf);
|
|
104
|
-
const heritage = (node.heritageClauses ?? []).flatMap(c => c.types.map(t => t.expression.getText(sf)));
|
|
105
|
-
const methods = (node.members ?? []).filter(m => ts.isMethodDeclaration(m) && m.name).map(m => {
|
|
106
|
-
const mp = getParams(m, sf); const mr = m.type?.getText(sf) ?? '';
|
|
107
|
-
return { name: m.name.getText(sf), signature: buildSig(mp, mr), documentation: getJsDoc(m, sf) };
|
|
108
|
-
});
|
|
109
|
-
symbols.set(name, { kind: 'class', signature: name + (heritage.length ? ' extends ' + heritage[0] : ''),
|
|
110
|
-
parameters: [], returnType: '', isExported: isExported(node),
|
|
111
|
-
documentation: getJsDoc(node, sf), lineStart: lineOf(node, sf), heritage, methods });
|
|
112
|
-
} else if (ts.isInterfaceDeclaration(node) && node.name) {
|
|
113
|
-
const name = node.name.getText(sf);
|
|
114
|
-
symbols.set(name, { kind: 'interface', signature: name, parameters: [], returnType: '',
|
|
115
|
-
isExported: isExported(node), documentation: getJsDoc(node, sf), lineStart: lineOf(node, sf) });
|
|
116
|
-
} else if (ts.isTypeAliasDeclaration(node) && node.name) {
|
|
117
|
-
const name = node.name.getText(sf);
|
|
118
|
-
symbols.set(name, { kind: 'type', signature: name, parameters: [], returnType: '',
|
|
119
|
-
isExported: isExported(node), documentation: getJsDoc(node, sf), lineStart: lineOf(node, sf) });
|
|
120
|
-
} else if (ts.isVariableStatement(node)) {
|
|
121
|
-
const exp = isExported(node);
|
|
122
|
-
for (const decl of node.declarationList.declarations) {
|
|
123
|
-
if (decl.name && decl.initializer &&
|
|
124
|
-
(ts.isArrowFunction(decl.initializer) || ts.isFunctionExpression(decl.initializer))) {
|
|
125
|
-
const params = getParams(decl.initializer, sf); const ret = decl.initializer.type?.getText(sf) ?? '';
|
|
126
|
-
symbols.set(decl.name.getText(sf), { kind: 'variable', signature: buildSig(params, ret),
|
|
127
|
-
parameters: params, returnType: ret, isExported: exp,
|
|
128
|
-
documentation: getJsDoc(node, sf), lineStart: lineOf(node, sf) });
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
} catch {}
|
|
133
|
-
ts.forEachChild(node, visit);
|
|
134
|
-
}
|
|
135
|
-
ts.forEachChild(sf, visit);
|
|
136
|
-
return symbols;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function extractImportMap(filePath, content) {
|
|
140
|
-
const sf = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
|
|
141
|
-
const importMap = new Map();
|
|
142
|
-
function visit(node) {
|
|
143
|
-
if (ts.isImportDeclaration(node)) {
|
|
144
|
-
try {
|
|
145
|
-
const spec = node.moduleSpecifier.getText(sf).replace(/^['"]|['"]$/g, '');
|
|
146
|
-
if (!spec.startsWith('.')) return; // skip node_modules
|
|
147
|
-
const resolved = resolveRelativeImport(spec, filePath);
|
|
148
|
-
if (!resolved) return;
|
|
149
|
-
const clause = node.importClause;
|
|
150
|
-
if (!clause) return;
|
|
151
|
-
if (clause.name) importMap.set(clause.name.getText(sf), resolved);
|
|
152
|
-
const b = clause.namedBindings;
|
|
153
|
-
if (b) {
|
|
154
|
-
if (ts.isNamespaceImport(b)) importMap.set(b.name.getText(sf), resolved);
|
|
155
|
-
else if (ts.isNamedImports(b)) for (const el of b.elements) importMap.set(el.name.getText(sf), resolved);
|
|
156
|
-
}
|
|
157
|
-
} catch {}
|
|
158
|
-
}
|
|
159
|
-
ts.forEachChild(node, visit);
|
|
160
|
-
}
|
|
161
|
-
ts.forEachChild(sf, visit);
|
|
162
|
-
return importMap;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function resolveRelativeImport(spec, fromFile) {
|
|
166
|
-
const base = path.resolve(path.dirname(fromFile), spec);
|
|
167
|
-
const exts = ['.ts', '.tsx', '.js', '.mjs', '.cjs'];
|
|
168
|
-
if (fs.existsSync(base) && fs.statSync(base).isFile()) return base;
|
|
169
|
-
for (const ext of exts) if (fs.existsSync(base + ext)) return base + ext;
|
|
170
|
-
for (const ext of exts) { const c = path.join(base, 'index' + ext); if (fs.existsSync(c)) return c; }
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// ── regex fallback ────────────────────────────────────────────────────────
|
|
175
|
-
|
|
176
|
-
function extractSymbolsRegex(content) {
|
|
177
|
-
const symbols = new Map(); let m;
|
|
178
|
-
const fn = /export\s+(async\s+)?function\s+(\w+)\(([^)]*)\)/g;
|
|
179
|
-
while ((m = fn.exec(content)) !== null) {
|
|
180
|
-
const params = m[3].trim() ? m[3].trim().split(',').map(p => ({ name: p.trim(), type: 'any', optional: false })) : [];
|
|
181
|
-
symbols.set(m[2], { kind: 'function', signature: buildSig(params, ''), parameters: params,
|
|
182
|
-
returnType: '', isExported: true, documentation: '', lineStart: 0 });
|
|
183
|
-
}
|
|
184
|
-
const cl = /export\s+class\s+(\w+)/g;
|
|
185
|
-
while ((m = cl.exec(content)) !== null)
|
|
186
|
-
symbols.set(m[1], { kind: 'class', signature: m[1], parameters: [], returnType: '',
|
|
187
|
-
isExported: true, documentation: '', lineStart: 0 });
|
|
188
|
-
return symbols;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// ── per-file extraction ───────────────────────────────────────────────────
|
|
192
|
-
|
|
193
|
-
const MAX_TS_SIZE = 500 * 1024;
|
|
194
|
-
|
|
195
|
-
function extractFile(filePath, cacheDir) {
|
|
196
|
-
const cached = readFromCache(filePath, cacheDir);
|
|
197
|
-
if (cached) return { symbols: new Map(Object.entries(cached.symbols)), importMap: new Map(Object.entries(cached.importMap)) };
|
|
198
|
-
|
|
199
|
-
let content;
|
|
200
|
-
try { content = fs.readFileSync(filePath, 'utf8'); } catch { return { symbols: new Map(), importMap: new Map() }; }
|
|
201
|
-
|
|
202
|
-
const isTs = /\.[cm]?ts$|\.tsx$/.test(filePath);
|
|
203
|
-
let symbols, importMap = new Map();
|
|
204
|
-
if (isTs && content.length <= MAX_TS_SIZE) {
|
|
205
|
-
try { symbols = extractSymbolsFromAst(filePath, content); importMap = extractImportMap(filePath, content); }
|
|
206
|
-
catch { symbols = extractSymbolsRegex(content); }
|
|
207
|
-
} else {
|
|
208
|
-
symbols = extractSymbolsRegex(content);
|
|
209
|
-
}
|
|
210
|
-
writeToCache(filePath, { symbols: Object.fromEntries(symbols), importMap: Object.fromEntries(importMap) }, cacheDir);
|
|
211
|
-
return { symbols, importMap };
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// ── main ──────────────────────────────────────────────────────────────────
|
|
215
|
-
|
|
216
|
-
export async function enrichGraph(projectDir, options = {}) {
|
|
217
|
-
const graphDir = options.graphDir ?? path.join(projectDir, '.monomind', 'graph');
|
|
218
|
-
const verbose = options.verbose ?? false;
|
|
219
|
-
const forceRebuild = options.forceRebuild ?? false;
|
|
220
|
-
const cacheDir = path.join(graphDir, 'cache', 'symbols');
|
|
221
|
-
|
|
222
|
-
const graphPath = path.join(graphDir, 'graph.json');
|
|
223
|
-
if (!fs.existsSync(graphPath)) throw new Error(`graph.json not found at ${graphPath}`);
|
|
224
|
-
const rawGraph = JSON.parse(fs.readFileSync(graphPath, 'utf8'));
|
|
225
|
-
const nodes = rawGraph.nodes ?? [];
|
|
226
|
-
const links = rawGraph.links ?? rawGraph.edges ?? [];
|
|
227
|
-
|
|
228
|
-
// Phase 1+2: extract symbols + import maps per unique source file
|
|
229
|
-
const uniqueFiles = [...new Set(nodes.map(n => n.sourceFile).filter(Boolean))];
|
|
230
|
-
const symbolCache = new Map(), importCache = new Map();
|
|
231
|
-
let filesProcessed = 0;
|
|
232
|
-
for (const fp of uniqueFiles) {
|
|
233
|
-
if (forceRebuild) { try { fs.unlinkSync(cacheFileFor(fp, cacheDir)); } catch {} }
|
|
234
|
-
const { symbols, importMap } = extractFile(fp, cacheDir);
|
|
235
|
-
symbolCache.set(fp, symbols); importCache.set(fp, importMap);
|
|
236
|
-
filesProcessed++;
|
|
237
|
-
if (filesProcessed % 100 === 0 || verbose) {
|
|
238
|
-
console.log(`[enrich] processed ${filesProcessed}/${uniqueFiles.length} files (${Math.round(filesProcessed / uniqueFiles.length * 100)}%)`);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Phase 3: enrich nodes
|
|
243
|
-
let enrichedCount = 0;
|
|
244
|
-
const enrichedNodes = nodes.map(node => {
|
|
245
|
-
const n = { ...node, inDegree: 0, outDegree: 0 };
|
|
246
|
-
const info = symbolCache.get(n.sourceFile)?.get(n.label) ?? symbolCache.get(n.sourceFile)?.get(n.id);
|
|
247
|
-
if (info) {
|
|
248
|
-
Object.assign(n, { kind: info.kind, signature: info.signature, parameters: info.parameters,
|
|
249
|
-
returnType: info.returnType, isExported: info.isExported, documentation: info.documentation });
|
|
250
|
-
enrichedCount++;
|
|
251
|
-
}
|
|
252
|
-
return n;
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
// Phase 4: resolve call/import edges to cross-module links
|
|
256
|
-
const nodeById = new Map(enrichedNodes.map(n => [n.id, n]));
|
|
257
|
-
const nodesByFile = new Map();
|
|
258
|
-
for (const n of enrichedNodes) {
|
|
259
|
-
if (!n.sourceFile) continue;
|
|
260
|
-
if (!nodesByFile.has(n.sourceFile)) nodesByFile.set(n.sourceFile, []);
|
|
261
|
-
nodesByFile.get(n.sourceFile).push(n);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// Walk importCache directly: sourceFile → (importedSymbol → resolvedAbsolutePath).
|
|
265
|
-
// This avoids the graph.json edge format mismatch where link.source is a short filename/path
|
|
266
|
-
// rather than a symbol-name node ID, which caused resolvedCallEdges: 0 when iterating links.
|
|
267
|
-
//
|
|
268
|
-
// One edge per (sourceFile → target node) — not one per source symbol. Fanning out to all
|
|
269
|
-
// N nodes in a file per import inflates edge counts by O(N) and corrupts PageRank.
|
|
270
|
-
// We use the first node in the file as a stable representative for the file-level dependency.
|
|
271
|
-
const resolvedLinks = []; const seenEdgeKeys = new Set();
|
|
272
|
-
for (const [sourceFile, symbolMap] of importCache) {
|
|
273
|
-
const fileNodes = nodesByFile.get(sourceFile) ?? [];
|
|
274
|
-
if (!fileNodes.length) continue;
|
|
275
|
-
const repNode = fileNodes[0]; // representative node for this source file
|
|
276
|
-
for (const [symbolName, resolvedPath] of symbolMap) {
|
|
277
|
-
const candidates = nodesByFile.get(resolvedPath) ?? [];
|
|
278
|
-
// Prefer a node in the target file whose label/id matches the imported symbol name
|
|
279
|
-
const tgt = candidates.find(n => n.label === symbolName || n.id === symbolName) ?? candidates[0];
|
|
280
|
-
if (!tgt) continue;
|
|
281
|
-
if (repNode.id === tgt.id) continue; // skip self-edges
|
|
282
|
-
// Deduplicate by (sourceFile, tgt.id) — one edge per file-level import relationship
|
|
283
|
-
const key = `${sourceFile}:${tgt.id}`;
|
|
284
|
-
if (seenEdgeKeys.has(key)) continue;
|
|
285
|
-
seenEdgeKeys.add(key);
|
|
286
|
-
resolvedLinks.push({ source: repNode.id, target: tgt.id, relation: 'calls_module',
|
|
287
|
-
confidence: 'INFERRED', weight: 1, resolvedFrom: symbolName });
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// Phase 5: degree counts.
|
|
292
|
-
// Raw graph.json links use filename paths as link.source, not symbol IDs, so nodeById
|
|
293
|
-
// lookups on raw links return undefined. Only resolvedLinks have symbol-name IDs on both
|
|
294
|
-
// ends and reliably hit nodeById.
|
|
295
|
-
const allEdges = [...links, ...resolvedLinks];
|
|
296
|
-
for (const link of resolvedLinks) {
|
|
297
|
-
const s = nodeById.get(link.source); const t = nodeById.get(link.target);
|
|
298
|
-
if (s) s.outDegree++; if (t) t.inDegree++;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// Phase 6: PageRank + eigenvector centrality
|
|
302
|
-
const Graph = loadGraphology();
|
|
303
|
-
const { assignPageRank, assignEigen } = loadGraphologyMetrics();
|
|
304
|
-
const G = new Graph({ type: 'directed', multi: false });
|
|
305
|
-
for (const n of enrichedNodes) G.addNode(n.id, { ...n });
|
|
306
|
-
// Guard both endpoints: raw links have filename paths as source which are not graph nodes.
|
|
307
|
-
for (const link of allEdges) {
|
|
308
|
-
try {
|
|
309
|
-
if (G.hasNode(link.source) && G.hasNode(link.target))
|
|
310
|
-
G.addEdge(link.source, link.target, { weight: link.weight ?? 1 });
|
|
311
|
-
} catch {}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
let pageRankComputed = false, centralityComputed = false;
|
|
315
|
-
try { assignPageRank(G, { alpha: 0.85, maxIterations: 100, tolerance: 1e-6 }); pageRankComputed = true; }
|
|
316
|
-
catch (e) { console.warn('[enrich] PageRank failed:', e.message); }
|
|
317
|
-
try { assignEigen(G, { maxIterations: 500, tolerance: 1e-4, normalize: true }); centralityComputed = true; }
|
|
318
|
-
catch (e) { console.warn('[enrich] Eigenvector centrality skipped (disconnected graph):', e.message); }
|
|
319
|
-
|
|
320
|
-
// Map graphology attr names (pagerank, eigenvectorCentrality) to output (pageRank, centrality)
|
|
321
|
-
G.forEachNode((id, attrs) => {
|
|
322
|
-
const n = nodeById.get(id); if (!n) return;
|
|
323
|
-
n.pageRank = attrs.pagerank ?? 0; n.centrality = attrs.eigenvectorCentrality ?? 0;
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
// Phase 7: write graph.enriched.json
|
|
327
|
-
const metrics = { totalNodes: enrichedNodes.length, enrichedNodes: enrichedCount,
|
|
328
|
-
totalEdges: allEdges.length, analyzedEdges: G.size,
|
|
329
|
-
resolvedCallEdges: resolvedLinks.length, pageRankComputed, centralityComputed };
|
|
330
|
-
const output = { version: '1.0.0', builtAt: rawGraph.builtAt ?? 0, projectPath: projectDir,
|
|
331
|
-
enrichedAt: Date.now(), nodes: enrichedNodes, links: allEdges, metrics };
|
|
332
|
-
const outputPath = path.join(graphDir, 'graph.enriched.json');
|
|
333
|
-
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
|
|
334
|
-
console.log(`[enrich] wrote ${outputPath}`);
|
|
335
|
-
|
|
336
|
-
// Update stats.json
|
|
337
|
-
const statsPath = path.join(graphDir, 'stats.json');
|
|
338
|
-
try {
|
|
339
|
-
const stats = fs.existsSync(statsPath) ? JSON.parse(fs.readFileSync(statsPath, 'utf8')) : {};
|
|
340
|
-
stats.enrichedAt = Date.now(); stats.enrichedNodes = enrichedCount;
|
|
341
|
-
fs.writeFileSync(statsPath, JSON.stringify(stats, null, 2));
|
|
342
|
-
} catch {}
|
|
343
|
-
|
|
344
|
-
return { enrichedNodes, resolvedEdges: resolvedLinks, metrics };
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
// ── CLI entrypoint ────────────────────────────────────────────────────────
|
|
348
|
-
|
|
349
|
-
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
350
|
-
const projectDir = process.argv[2];
|
|
351
|
-
if (!projectDir) {
|
|
352
|
-
console.error('Usage: node enrich.mjs <project-dir> [--graph-dir <dir>] [--verbose] [--force]');
|
|
353
|
-
process.exit(1);
|
|
354
|
-
}
|
|
355
|
-
const args = process.argv.slice(3);
|
|
356
|
-
const opts = { verbose: args.includes('--verbose'), forceRebuild: args.includes('--force') };
|
|
357
|
-
const gdIdx = args.indexOf('--graph-dir');
|
|
358
|
-
if (gdIdx !== -1 && args[gdIdx + 1]) opts.graphDir = args[gdIdx + 1];
|
|
359
|
-
enrichGraph(path.resolve(projectDir), opts)
|
|
360
|
-
.then(({ metrics }) => console.log('[enrich] done:', JSON.stringify(metrics, null, 2)))
|
|
361
|
-
.catch(err => { console.error('[enrich] fatal:', err.message); process.exit(1); });
|
|
362
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-Memory Repositories - CLI Infrastructure
|
|
3
|
-
*
|
|
4
|
-
* Lightweight in-memory implementations for CLI use.
|
|
5
|
-
*
|
|
6
|
-
* @module v1/cli/infrastructure
|
|
7
|
-
*/
|
|
8
|
-
import { Agent, AgentStatus, AgentRole } from '../../../swarm/src/domain/entities/agent.js';
|
|
9
|
-
import { Task, TaskStatus, TaskPriority } from '../../../swarm/src/domain/entities/task.js';
|
|
10
|
-
import { IAgentRepository, AgentQueryOptions, AgentStatistics } from '../../../swarm/src/domain/repositories/agent-repository.interface.js';
|
|
11
|
-
import { ITaskRepository, TaskQueryOptions, TaskStatistics } from '../../../swarm/src/domain/repositories/task-repository.interface.js';
|
|
12
|
-
/**
|
|
13
|
-
* In-Memory Agent Repository
|
|
14
|
-
*/
|
|
15
|
-
export declare class InMemoryAgentRepository implements IAgentRepository {
|
|
16
|
-
private agents;
|
|
17
|
-
private initialized;
|
|
18
|
-
initialize(): Promise<void>;
|
|
19
|
-
shutdown(): Promise<void>;
|
|
20
|
-
clear(): Promise<void>;
|
|
21
|
-
save(agent: Agent): Promise<void>;
|
|
22
|
-
findById(id: string): Promise<Agent | null>;
|
|
23
|
-
findByName(name: string): Promise<Agent | null>;
|
|
24
|
-
delete(id: string): Promise<boolean>;
|
|
25
|
-
exists(id: string): Promise<boolean>;
|
|
26
|
-
saveMany(agents: Agent[]): Promise<void>;
|
|
27
|
-
findByIds(ids: string[]): Promise<Agent[]>;
|
|
28
|
-
deleteMany(ids: string[]): Promise<number>;
|
|
29
|
-
findAll(options?: AgentQueryOptions): Promise<Agent[]>;
|
|
30
|
-
findByStatus(status: AgentStatus): Promise<Agent[]>;
|
|
31
|
-
findByRole(role: AgentRole): Promise<Agent[]>;
|
|
32
|
-
findByDomain(domain: string): Promise<Agent[]>;
|
|
33
|
-
findByParent(parentId: string): Promise<Agent[]>;
|
|
34
|
-
findByCapability(capability: string): Promise<Agent[]>;
|
|
35
|
-
findAvailable(): Promise<Agent[]>;
|
|
36
|
-
getStatistics(): Promise<AgentStatistics>;
|
|
37
|
-
count(options?: AgentQueryOptions): Promise<number>;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* In-Memory Task Repository
|
|
41
|
-
*/
|
|
42
|
-
export declare class InMemoryTaskRepository implements ITaskRepository {
|
|
43
|
-
private tasks;
|
|
44
|
-
private initialized;
|
|
45
|
-
initialize(): Promise<void>;
|
|
46
|
-
shutdown(): Promise<void>;
|
|
47
|
-
clear(): Promise<void>;
|
|
48
|
-
save(task: Task): Promise<void>;
|
|
49
|
-
findById(id: string): Promise<Task | null>;
|
|
50
|
-
delete(id: string): Promise<boolean>;
|
|
51
|
-
exists(id: string): Promise<boolean>;
|
|
52
|
-
saveMany(tasks: Task[]): Promise<void>;
|
|
53
|
-
findByIds(ids: string[]): Promise<Task[]>;
|
|
54
|
-
deleteMany(ids: string[]): Promise<number>;
|
|
55
|
-
findAll(options?: TaskQueryOptions): Promise<Task[]>;
|
|
56
|
-
findByStatus(status: TaskStatus): Promise<Task[]>;
|
|
57
|
-
findByPriority(priority: TaskPriority): Promise<Task[]>;
|
|
58
|
-
findByAgent(agentId: string): Promise<Task[]>;
|
|
59
|
-
findPending(): Promise<Task[]>;
|
|
60
|
-
findQueued(): Promise<Task[]>;
|
|
61
|
-
findRunning(): Promise<Task[]>;
|
|
62
|
-
findTimedOut(): Promise<Task[]>;
|
|
63
|
-
getNextTask(agentCapabilities?: string[]): Promise<Task | null>;
|
|
64
|
-
getTaskQueue(limit?: number): Promise<Task[]>;
|
|
65
|
-
getStatistics(): Promise<TaskStatistics>;
|
|
66
|
-
count(options?: TaskQueryOptions): Promise<number>;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=in-memory-repositories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-repositories.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/in-memory-repositories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,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